@riverbankcms/sdk 0.129.0 → 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 +51 -266
- package/dist/{PreviewEditorSidebar-B43CJ0g_.mjs → PreviewEditorSidebar-DiEpbOdw.mjs} +313 -239
- package/dist/{PreviewEditorUI-DHirVkeM.mjs → PreviewEditorUI-C6MvxnIa.mjs} +3 -3
- package/dist/{PreviewQueryProvider-B1kbhaJD.mjs → PreviewQueryProvider-C2rnoPz6.mjs} +1 -1
- package/dist/{SdkPreviewModeRuntime-BJumZy1B.mjs → SdkPreviewModeRuntime-DRXA_m5L.mjs} +208 -211
- package/dist/{SiteChromeCustomizeContext-D9SlpwEj.mjs → SiteChromeCustomizeContext-BTHdv5_-.mjs} +6222 -6190
- package/dist/_dts/ai/src/contracts/commandExposure.d.ts +1 -1
- package/dist/_dts/ai/src/contracts/proposalPrimitives.d.ts +52 -0
- package/dist/_dts/ai/src/contracts/proposals.d.ts +9438 -33588
- 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 +5 -3
- package/dist/_dts/api/src/publicExperience/commerceEndpoints.d.ts +22 -47
- package/dist/_dts/api/src/sdk-event-management.d.ts +53 -0
- package/dist/_dts/api/src/sdk-event-schedule.d.ts +8 -6
- package/dist/_dts/api/src/sdk-event-upsert.d.ts +112 -20
- package/dist/_dts/api/src/sdkContracts.d.ts +74 -115
- package/dist/_dts/api/src/sdkManagedEventContracts.d.ts +35 -0
- package/dist/_dts/api/src/sdkThemeWire.d.ts +4517 -0
- package/dist/_dts/api/src/sitePlatformEndpoints.d.ts +18 -29
- 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/media-core/src/index.d.ts +1 -0
- 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 +5 -4
- 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 +2 -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/palette/index.d.ts +1 -0
- 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/headerLayoutTypes.d.ts +142 -0
- 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 +3 -0
- 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 +18324 -18224
- 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 +4550 -4211
- 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 +3606 -4078
- package/dist/client/rendering/islands.mjs +18 -18
- package/dist/client/rendering.mjs +15969 -15843
- 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-CfZd5pAm.mjs → sdk-runtime-hhSOMShR.mjs} +2 -2
- package/dist/{separator-DkTe68HE.mjs → separator-flRaFc14.mjs} +1 -1
- package/dist/server/components.mjs +17802 -17875
- package/dist/server/config-validation.mjs +4729 -4416
- package/dist/server/config.mjs +4733 -4420
- package/dist/server/data.mjs +4533 -4211
- package/dist/server/date-time.mjs +22 -13
- package/dist/server/index.mjs +17 -28
- package/dist/server/manifest.mjs +4966 -0
- package/dist/server/next.mjs +17635 -17676
- package/dist/server/page-converter.mjs +3759 -4386
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +18960 -19049
- package/dist/server/rendering.mjs +17848 -17902
- package/dist/server/routing.mjs +4776 -4323
- package/dist/server/server.mjs +4609 -4264
- package/dist/server/theme-bridge.mjs +1361 -1850
- package/dist/server/theme.mjs +736 -605
- package/dist/styles/index.css +22 -3
- package/package.json +9 -12
- package/dist/_dts/api/src/event-presentation.d.ts +0 -14
- package/dist/_dts/blocks/src/definitions.d.ts +0 -14
- package/dist/_dts/preview-next/src/client/preview/siteChromeLookRows.d.ts +0 -66
- package/dist/_dts/sdk/src/cli/canonical-entry-policy.d.ts +0 -53
- package/dist/_dts/sdk/src/cli/commands/audit.d.ts +0 -101
- package/dist/_dts/sdk/src/cli/commands/block.d.ts +0 -24
- package/dist/_dts/sdk/src/cli/commands/compare.d.ts +0 -62
- package/dist/_dts/sdk/src/cli/commands/content-type.d.ts +0 -10
- package/dist/_dts/sdk/src/cli/commands/content.d.ts +0 -56
- package/dist/_dts/sdk/src/cli/commands/delete.d.ts +0 -14
- package/dist/_dts/sdk/src/cli/commands/deploy.d.ts +0 -43
- package/dist/_dts/sdk/src/cli/commands/drafts.d.ts +0 -18
- package/dist/_dts/sdk/src/cli/commands/entry.d.ts +0 -55
- package/dist/_dts/sdk/src/cli/commands/env.d.ts +0 -31
- package/dist/_dts/sdk/src/cli/commands/event.d.ts +0 -23
- package/dist/_dts/sdk/src/cli/commands/eventOccurrenceSchedule.d.ts +0 -12
- package/dist/_dts/sdk/src/cli/commands/identifiers.d.ts +0 -10
- package/dist/_dts/sdk/src/cli/commands/init-docs.d.ts +0 -13
- package/dist/_dts/sdk/src/cli/commands/manifest.d.ts +0 -10
- package/dist/_dts/sdk/src/cli/commands/media-validation.d.ts +0 -3
- package/dist/_dts/sdk/src/cli/commands/migrate.d.ts +0 -11
- package/dist/_dts/sdk/src/cli/commands/navigation.d.ts +0 -12
- package/dist/_dts/sdk/src/cli/commands/page.d.ts +0 -14
- package/dist/_dts/sdk/src/cli/commands/publish-all.d.ts +0 -50
- package/dist/_dts/sdk/src/cli/commands/pull-dated-offering-scope.d.ts +0 -10
- package/dist/_dts/sdk/src/cli/commands/pull-dry-run.d.ts +0 -70
- package/dist/_dts/sdk/src/cli/commands/pull-scope-diff.d.ts +0 -8
- package/dist/_dts/sdk/src/cli/commands/pull.d.ts +0 -43
- package/dist/_dts/sdk/src/cli/commands/push/consts.d.ts +0 -3
- package/dist/_dts/sdk/src/cli/commands/push/execute/diff.d.ts +0 -19
- package/dist/_dts/sdk/src/cli/commands/push/execute/footer.d.ts +0 -42
- package/dist/_dts/sdk/src/cli/commands/push/execute/localMediaReporting.d.ts +0 -23
- package/dist/_dts/sdk/src/cli/commands/push/execute/media.d.ts +0 -22
- package/dist/_dts/sdk/src/cli/commands/push/execute/metadata.d.ts +0 -1
- package/dist/_dts/sdk/src/cli/commands/push/execute/reporting.d.ts +0 -7
- package/dist/_dts/sdk/src/cli/commands/push/execute/theme.d.ts +0 -63
- package/dist/_dts/sdk/src/cli/commands/push/filter.d.ts +0 -15
- package/dist/_dts/sdk/src/cli/commands/push/metadata.d.ts +0 -29
- package/dist/_dts/sdk/src/cli/commands/push/normalizeLocalContent.d.ts +0 -2
- package/dist/_dts/sdk/src/cli/commands/push/options.d.ts +0 -32
- package/dist/_dts/sdk/src/cli/commands/push/publishGuidance.d.ts +0 -15
- package/dist/_dts/sdk/src/cli/commands/push/pushAllExtras.d.ts +0 -25
- package/dist/_dts/sdk/src/cli/commands/push/scopes/commandBackedDatedOfferingScope.d.ts +0 -83
- package/dist/_dts/sdk/src/cli/commands/push/scopes/eventCategories.d.ts +0 -4
- package/dist/_dts/sdk/src/cli/commands/push/scopes/events.d.ts +0 -4
- package/dist/_dts/sdk/src/cli/commands/push/scopes/mediaPrep.d.ts +0 -14
- package/dist/_dts/sdk/src/cli/commands/push/scopes/pushScopeGeneric.d.ts +0 -6
- package/dist/_dts/sdk/src/cli/commands/push/scopes/types.d.ts +0 -87
- package/dist/_dts/sdk/src/cli/commands/push/scopes/venues.d.ts +0 -4
- package/dist/_dts/sdk/src/cli/commands/push/stale-resolution.d.ts +0 -48
- package/dist/_dts/sdk/src/cli/commands/push/stale.d.ts +0 -17
- package/dist/_dts/sdk/src/cli/commands/push/verification.d.ts +0 -56
- package/dist/_dts/sdk/src/cli/commands/push/workflowPlan.d.ts +0 -34
- package/dist/_dts/sdk/src/cli/commands/push-execute.d.ts +0 -54
- package/dist/_dts/sdk/src/cli/commands/push.d.ts +0 -40
- package/dist/_dts/sdk/src/cli/commands/setup.d.ts +0 -3
- package/dist/_dts/sdk/src/cli/commands/style.d.ts +0 -60
- package/dist/_dts/sdk/src/cli/commands/verify.d.ts +0 -11
- package/dist/_dts/sdk/src/cli/commands/webhooks.d.ts +0 -44
- package/dist/_dts/sdk/src/cli/config-loader.d.ts +0 -47
- package/dist/_dts/sdk/src/cli/content/collectionWriters.d.ts +0 -23
- package/dist/_dts/sdk/src/cli/content/edit/format.d.ts +0 -2
- package/dist/_dts/sdk/src/cli/content/edit/path.d.ts +0 -14
- package/dist/_dts/sdk/src/cli/content/edit/planner.d.ts +0 -46
- package/dist/_dts/sdk/src/cli/content/entryPaths.d.ts +0 -6
- package/dist/_dts/sdk/src/cli/content/footerFile.d.ts +0 -10
- package/dist/_dts/sdk/src/cli/content/fs-utils.d.ts +0 -39
- package/dist/_dts/sdk/src/cli/content/legacyEventScheduleShapeError.d.ts +0 -5
- package/dist/_dts/sdk/src/cli/content/localEventSchedule.d.ts +0 -17
- package/dist/_dts/sdk/src/cli/content/media-manifest.d.ts +0 -13
- package/dist/_dts/sdk/src/cli/content/metadataAfterPush.d.ts +0 -25
- package/dist/_dts/sdk/src/cli/content/metadataStore.d.ts +0 -29
- package/dist/_dts/sdk/src/cli/content/reader.d.ts +0 -488
- package/dist/_dts/sdk/src/cli/content/writer.d.ts +0 -142
- package/dist/_dts/sdk/src/cli/env-scope.d.ts +0 -2
- package/dist/_dts/sdk/src/cli/env.d.ts +0 -71
- package/dist/_dts/sdk/src/cli/errors.d.ts +0 -62
- package/dist/_dts/sdk/src/cli/helpers/ai-runtime.d.ts +0 -2
- package/dist/_dts/sdk/src/cli/helpers.d.ts +0 -399
- package/dist/_dts/sdk/src/cli/index.d.ts +0 -11
- package/dist/_dts/sdk/src/cli/init-docs/constants.d.ts +0 -16
- package/dist/_dts/sdk/src/cli/init-docs/index.d.ts +0 -12
- package/dist/_dts/sdk/src/cli/init-docs/templates.d.ts +0 -18
- package/dist/_dts/sdk/src/cli/init-docs/zod-to-markdown.d.ts +0 -28
- package/dist/_dts/sdk/src/cli/load-config.d.ts +0 -14
- package/dist/_dts/sdk/src/cli/media/identifiers.d.ts +0 -18
- package/dist/_dts/sdk/src/cli/media/local-media.d.ts +0 -14
- package/dist/_dts/sdk/src/cli/media/local-sync.d.ts +0 -91
- package/dist/_dts/sdk/src/cli/media/portable.d.ts +0 -11
- package/dist/_dts/sdk/src/cli/media/rich-text.d.ts +0 -12
- package/dist/_dts/sdk/src/cli/media/value-utils.d.ts +0 -15
- package/dist/_dts/sdk/src/cli/media/write-guard.d.ts +0 -52
- package/dist/_dts/sdk/src/cli/merge-remote/entryLocal.d.ts +0 -3
- package/dist/_dts/sdk/src/cli/merge-remote/entryMerge.d.ts +0 -78
- package/dist/_dts/sdk/src/cli/merge-remote/entryMergePlan.d.ts +0 -45
- package/dist/_dts/sdk/src/cli/merge-remote/entryMergePush.d.ts +0 -24
- package/dist/_dts/sdk/src/cli/merge-remote/entryMergeReport.d.ts +0 -18
- package/dist/_dts/sdk/src/cli/merge-remote/entryRemote.d.ts +0 -9
- package/dist/_dts/sdk/src/cli/merge-remote/entrySnapshots.d.ts +0 -48
- package/dist/_dts/sdk/src/cli/merge-remote/mergeFieldChanges.d.ts +0 -22
- package/dist/_dts/sdk/src/cli/merge-remote/pageLocal.d.ts +0 -3
- package/dist/_dts/sdk/src/cli/merge-remote/pageMerge.d.ts +0 -78
- package/dist/_dts/sdk/src/cli/merge-remote/pageMergePlan.d.ts +0 -36
- package/dist/_dts/sdk/src/cli/merge-remote/pageMergePush.d.ts +0 -23
- package/dist/_dts/sdk/src/cli/merge-remote/pageMergeReport.d.ts +0 -17
- package/dist/_dts/sdk/src/cli/merge-remote/pageSnapshots.d.ts +0 -46
- package/dist/_dts/sdk/src/cli/merge-remote/sharedBaseSnapshots.d.ts +0 -32
- package/dist/_dts/sdk/src/cli/merge-remote/sharedMergePlan.d.ts +0 -27
- package/dist/_dts/sdk/src/cli/merge-remote/sharedMergeReport.d.ts +0 -63
- package/dist/_dts/sdk/src/cli/migrations/entries.d.ts +0 -28
- package/dist/_dts/sdk/src/cli/migrations/events.d.ts +0 -73
- package/dist/_dts/sdk/src/cli/navigationIdentity.d.ts +0 -11
- package/dist/_dts/sdk/src/cli/output.d.ts +0 -133
- package/dist/_dts/sdk/src/cli/program.d.ts +0 -29
- package/dist/_dts/sdk/src/cli/push-config.d.ts +0 -49
- package/dist/_dts/sdk/src/cli/setup/setupPlan.d.ts +0 -51
- package/dist/_dts/sdk/src/cli/site-commands/commandKeys.d.ts +0 -13
- package/dist/_dts/sdk/src/cli/site-commands/commandRuntime.d.ts +0 -170
- package/dist/_dts/sdk/src/cli/site-commands/commandRuntimeCompat.d.ts +0 -21
- package/dist/_dts/sdk/src/cli/site-commands/commandSurfaceDispatch.d.ts +0 -32
- package/dist/_dts/sdk/src/cli/site-commands/datedOfferingCommands.d.ts +0 -53
- package/dist/_dts/sdk/src/cli/site-commands/entryCommands.d.ts +0 -65
- package/dist/_dts/sdk/src/cli/site-commands/eventScheduleCompiler.d.ts +0 -24
- package/dist/_dts/sdk/src/cli/site-commands/footerCommands.d.ts +0 -68
- package/dist/_dts/sdk/src/cli/site-commands/formCommands.d.ts +0 -53
- package/dist/_dts/sdk/src/cli/site-commands/index.d.ts +0 -8
- package/dist/_dts/sdk/src/cli/site-commands/localBlockManifestResolver.d.ts +0 -31
- package/dist/_dts/sdk/src/cli/site-commands/navigationCommands.d.ts +0 -57
- package/dist/_dts/sdk/src/cli/site-commands/oneOffCommands.d.ts +0 -82
- package/dist/_dts/sdk/src/cli/site-commands/pageCommands.d.ts +0 -84
- package/dist/_dts/sdk/src/cli/site-commands/pushExecution.d.ts +0 -39
- package/dist/_dts/sdk/src/cli/site-commands/pushExecutionPlan.d.ts +0 -8
- package/dist/_dts/sdk/src/cli/site-commands/pushExecutionTypes.d.ts +0 -97
- package/dist/_dts/sdk/src/cli/site-commands/residualSettingsTrimming.d.ts +0 -15
- package/dist/_dts/sdk/src/cli/sync/diff.d.ts +0 -222
- package/dist/_dts/sdk/src/cli/sync/executor.d.ts +0 -84
- package/dist/_dts/sdk/src/cli/sync/field-diff.d.ts +0 -39
- package/dist/_dts/sdk/src/cli/sync/index.d.ts +0 -10
- package/dist/_dts/sdk/src/cli/sync/mapper.d.ts +0 -41
- package/dist/_dts/sdk/src/cli/sync/media-sync.d.ts +0 -15
- package/dist/_dts/sdk/src/cli/sync/media.d.ts +0 -158
- package/dist/_dts/sdk/src/cli/sync/syncResultAggregation.d.ts +0 -4
- package/dist/_dts/sdk/src/cli/sync/validation.d.ts +0 -68
- package/dist/_dts/sdk/src/cli/utils/checksum.d.ts +0 -1
- package/dist/_dts/sdk/src/client/management/blocks.d.ts +0 -19
- package/dist/_dts/sdk/src/client/management/catalog.d.ts +0 -10
- package/dist/_dts/sdk/src/client/management/entries.d.ts +0 -6
- package/dist/_dts/sdk/src/client/management/eventCategories.d.ts +0 -6
- package/dist/_dts/sdk/src/client/management/events.d.ts +0 -7
- package/dist/_dts/sdk/src/client/management/footer.d.ts +0 -9
- package/dist/_dts/sdk/src/client/management/forms.d.ts +0 -6
- package/dist/_dts/sdk/src/client/management/http.d.ts +0 -79
- package/dist/_dts/sdk/src/client/management/identifiers.d.ts +0 -11
- package/dist/_dts/sdk/src/client/management/index.d.ts +0 -41
- package/dist/_dts/sdk/src/client/management/media.d.ts +0 -72
- package/dist/_dts/sdk/src/client/management/navigation.d.ts +0 -6
- package/dist/_dts/sdk/src/client/management/pages.d.ts +0 -6
- package/dist/_dts/sdk/src/client/management/pull.d.ts +0 -6
- package/dist/_dts/sdk/src/client/management/settings-branding.d.ts +0 -32
- package/dist/_dts/sdk/src/client/management/settings.d.ts +0 -6
- package/dist/_dts/sdk/src/client/management/theme.d.ts +0 -8
- package/dist/_dts/sdk/src/client/management/types.d.ts +0 -1069
- package/dist/_dts/sdk/src/client/management/venues.d.ts +0 -6
- package/dist/_dts/sdk/src/client/management/webhooks.d.ts +0 -3
- package/dist/_dts/sdk/src/test/env.d.ts +0 -4
- package/dist/_dts/site-commands/src/adapter.d.ts +0 -23
- package/dist/_dts/site-commands/src/appointmentCommandSchemas.d.ts +0 -100
- package/dist/_dts/site-commands/src/capabilityGaps.d.ts +0 -8
- package/dist/_dts/site-commands/src/commandContract.d.ts +0 -1277
- package/dist/_dts/site-commands/src/commandDomain.d.ts +0 -20
- package/dist/_dts/site-commands/src/commandIdentifiers.d.ts +0 -7
- package/dist/_dts/site-commands/src/commandValidation.d.ts +0 -10
- package/dist/_dts/site-commands/src/commands.d.ts +0 -1983
- package/dist/_dts/site-commands/src/domain.d.ts +0 -104
- package/dist/_dts/site-commands/src/eventCommandContent.d.ts +0 -11
- package/dist/_dts/site-commands/src/exposure.d.ts +0 -41
- package/dist/_dts/site-commands/src/guards.d.ts +0 -1
- package/dist/_dts/site-commands/src/index.d.ts +0 -18
- package/dist/_dts/site-commands/src/metadata.d.ts +0 -555
- package/dist/_dts/site-commands/src/pagePaths.d.ts +0 -6
- package/dist/_dts/site-commands/src/planner.d.ts +0 -58
- package/dist/_dts/site-commands/src/refContributions.d.ts +0 -11
- package/dist/_dts/site-commands/src/refs.d.ts +0 -90
- package/dist/_dts/site-commands/src/siteStyleCommandSchema.d.ts +0 -405
- package/dist/_dts/site-commands/src/siteStyleSelectionSchemaBuilder.d.ts +0 -46
- package/dist/_dts/site-commands/src/stableJson.d.ts +0 -5
- package/dist/_dts/site-commands/src/staticExecutionGaps.d.ts +0 -10
- package/dist/_dts/site-commands/src/venueCommandMapping.d.ts +0 -21
- package/dist/_dts/theme-core/src/data.d.ts +0 -12
- package/dist/_dts/theme-core/src/site-styles/headerLooks.d.ts +0 -841
- package/dist/_dts/theme-core/src/site-styles/headerStyleParts.d.ts +0 -4
- package/dist/cli/index.mjs +0 -162988
- package/dist/cli/init-docs/content/agents-section.md +0 -67
- package/dist/cli/init-docs/content/cli-reference.md +0 -1238
- package/dist/cli/init-docs/content/content-management.md +0 -792
- package/dist/cli/init-docs/content/context-brand.md +0 -125
- package/dist/cli/init-docs/content/context-brief.md +0 -77
- package/dist/cli/init-docs/content/context-knowledge.md +0 -111
- package/dist/cli/init-docs/content/getting-started.md +0 -171
- package/dist/cli/init-docs/content/site-workflows-readme.md +0 -96
- package/dist/cli/init-docs/content/workflow-add-block.md +0 -299
- package/dist/cli/init-docs/content/workflow-agent-safe-sync.md +0 -83
- package/dist/cli/init-docs/content/workflow-block-extensions.md +0 -370
- package/dist/cli/init-docs/content/workflow-cmsify-page.md +0 -357
- package/dist/cli/init-docs/content/workflow-content-types.md +0 -330
- package/dist/cli/init-docs/content/workflow-create-page.md +0 -212
- package/dist/cli/init-docs/content/workflow-custom-block.md +0 -470
- package/dist/cli/init-docs/content/workflow-editor-workflows.md +0 -130
- package/dist/cli/init-docs/content/workflow-isr-revalidation.md +0 -158
- package/dist/cli/init-docs/content/workflow-preview-mode.md +0 -252
- package/dist/cli/init-docs/content/workflow-publish.md +0 -285
- package/dist/cli/init-docs/content/workflow-remote-setup.md +0 -51
- package/dist/cli/init-docs/content/workflow-templates.md +0 -381
- /package/dist/_dts/{sdk/src/cli/utils/mime.d.ts → media-core/src/mimeType.d.ts} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import
|
|
2
|
+
import { z } from "zod";
|
|
3
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
//#region ../theme-core/src/lib/media.ts
|
|
5
5
|
const hotspotSchema = z.object({
|
|
@@ -34,15 +34,17 @@ const transformSchema = z.object({
|
|
|
34
34
|
hotspot: hotspotSchema.optional(),
|
|
35
35
|
rotation: rotationSchema.optional()
|
|
36
36
|
});
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
37
|
+
const mediaPosterSchema = z.discriminatedUnion("tag", [z.object({
|
|
38
|
+
tag: z.literal("storage"),
|
|
39
|
+
assetId: z.string().optional(),
|
|
40
|
+
storageBucket: z.string().min(1),
|
|
41
|
+
storagePath: z.string().min(1)
|
|
42
|
+
}), z.object({
|
|
43
|
+
tag: z.literal("external-src"),
|
|
44
|
+
assetId: z.string().optional(),
|
|
45
|
+
src: z.string().url()
|
|
46
|
+
})]);
|
|
47
|
+
const mediaBaseSchema = z.object({
|
|
46
48
|
purpose: z.string().optional(),
|
|
47
49
|
placeholder: z.boolean().default(true).optional(),
|
|
48
50
|
assetId: z.string().optional(),
|
|
@@ -55,8 +57,33 @@ const mediaSchema = z.object({
|
|
|
55
57
|
height: z.number().optional(),
|
|
56
58
|
storageBucket: z.string().optional(),
|
|
57
59
|
storagePath: z.string().optional(),
|
|
60
|
+
poster: mediaPosterSchema.optional(),
|
|
58
61
|
transform: transformSchema.optional()
|
|
59
62
|
});
|
|
63
|
+
const mediaIdentifierSchema = z.string().trim().min(1).brand();
|
|
64
|
+
const imageMediaSchema = mediaBaseSchema.extend({ type: z.literal("image") });
|
|
65
|
+
const videoMediaSchema = mediaBaseSchema.extend({ type: z.literal("video") });
|
|
66
|
+
const audioMediaSchema = mediaBaseSchema.extend({ type: z.literal("audio") });
|
|
67
|
+
const documentMediaSchema = mediaBaseSchema.extend({ type: z.literal("document") });
|
|
68
|
+
const spreadsheetMediaSchema = mediaBaseSchema.extend({ type: z.literal("spreadsheet") });
|
|
69
|
+
const archiveMediaSchema = mediaBaseSchema.extend({ type: z.literal("archive") });
|
|
70
|
+
const mediaSchema = z.discriminatedUnion("type", [
|
|
71
|
+
imageMediaSchema,
|
|
72
|
+
videoMediaSchema,
|
|
73
|
+
audioMediaSchema,
|
|
74
|
+
documentMediaSchema,
|
|
75
|
+
spreadsheetMediaSchema,
|
|
76
|
+
archiveMediaSchema
|
|
77
|
+
]);
|
|
78
|
+
const persistableMediaBaseSchema = mediaBaseSchema.extend({ identifier: mediaIdentifierSchema });
|
|
79
|
+
z.discriminatedUnion("type", [
|
|
80
|
+
persistableMediaBaseSchema.extend({ type: z.literal("image") }),
|
|
81
|
+
persistableMediaBaseSchema.extend({ type: z.literal("video") }),
|
|
82
|
+
persistableMediaBaseSchema.extend({ type: z.literal("audio") }),
|
|
83
|
+
persistableMediaBaseSchema.extend({ type: z.literal("document") }),
|
|
84
|
+
persistableMediaBaseSchema.extend({ type: z.literal("spreadsheet") }),
|
|
85
|
+
persistableMediaBaseSchema.extend({ type: z.literal("archive") })
|
|
86
|
+
]);
|
|
60
87
|
//#endregion
|
|
61
88
|
//#region ../theme-core/src/tokens/colorTokenParts.ts
|
|
62
89
|
function parseOpacityPercent(source) {
|
|
@@ -148,7 +175,7 @@ const PALETTE_TOKEN_NAMES = [
|
|
|
148
175
|
"text",
|
|
149
176
|
"border"
|
|
150
177
|
];
|
|
151
|
-
const paletteTokenNameSchema = z
|
|
178
|
+
const paletteTokenNameSchema = z.enum(PALETTE_TOKEN_NAMES);
|
|
152
179
|
const themeColorBaseTokenNames = [
|
|
153
180
|
...PALETTE_TOKEN_NAMES,
|
|
154
181
|
...blockColorTokenNames,
|
|
@@ -193,7 +220,7 @@ function parseThemeColorToken(value) {
|
|
|
193
220
|
if (!isThemeColorToken(value)) return null;
|
|
194
221
|
return value.trim();
|
|
195
222
|
}
|
|
196
|
-
const themeColorTokenSchema = z
|
|
223
|
+
const themeColorTokenSchema = z.string().min(1).refine((value) => Boolean(isThemeColorToken(value)), "Expected a known Theme V2 color token");
|
|
197
224
|
//#endregion
|
|
198
225
|
//#region ../theme-core/src/palette/colors.ts
|
|
199
226
|
const HEX_COLOR_REGEX = /^#[0-9a-f]{6}$/;
|
|
@@ -213,11 +240,11 @@ const THEME_PALETTE_COLOR_ORDER = [
|
|
|
213
240
|
"primaryForeground",
|
|
214
241
|
"border"
|
|
215
242
|
];
|
|
216
|
-
const hexColorSchema = z
|
|
217
|
-
const paletteModeSchema = z
|
|
243
|
+
const hexColorSchema = z.string().regex(HEX_COLOR_REGEX, "Hex must be #RRGGBB (lowercase)").transform((value) => value);
|
|
244
|
+
const paletteModeSchema = z.enum(["light", "dark"]);
|
|
218
245
|
const PALETTE_VALUE_KEY_PREFIX = "palette-value:v1|";
|
|
219
|
-
z
|
|
220
|
-
const paletteColorsSchema = z
|
|
246
|
+
z.string().regex(/^[0-9a-f]{64}$/, "Palette hash must be a lowercase SHA-256 value").transform((value) => value);
|
|
247
|
+
const paletteColorsSchema = z.object({
|
|
221
248
|
primary: hexColorSchema,
|
|
222
249
|
primaryForeground: hexColorSchema,
|
|
223
250
|
secondary: hexColorSchema,
|
|
@@ -328,25 +355,25 @@ function parsePaletteValueKey(value) {
|
|
|
328
355
|
if (!colors.ok || paletteValueKey(colors.colors, mode.data) !== value) return null;
|
|
329
356
|
return value;
|
|
330
357
|
}
|
|
331
|
-
const paletteValueKeySchema = z
|
|
358
|
+
const paletteValueKeySchema = z.string().transform((value, ctx) => {
|
|
332
359
|
const parsed = parsePaletteValueKey(value);
|
|
333
360
|
if (parsed) return parsed;
|
|
334
361
|
ctx.addIssue({
|
|
335
362
|
code: "custom",
|
|
336
363
|
message: "Invalid canonical palette value key"
|
|
337
364
|
});
|
|
338
|
-
return z
|
|
365
|
+
return z.NEVER;
|
|
339
366
|
});
|
|
340
367
|
//#endregion
|
|
341
368
|
//#region ../theme-core/src/palette/schema.ts
|
|
342
|
-
const colourHexString = z
|
|
343
|
-
const paletteColorSchema = z
|
|
344
|
-
name: z
|
|
369
|
+
const colourHexString = z.string().regex(/^#([0-9A-Fa-f]{3}){1,2}$/);
|
|
370
|
+
const paletteColorSchema = z.object({
|
|
371
|
+
name: z.string().min(1),
|
|
345
372
|
hex: colourHexString
|
|
346
373
|
});
|
|
347
|
-
const paletteMetaSchema = z
|
|
348
|
-
const paletteSchema = z
|
|
349
|
-
colors: z
|
|
374
|
+
const paletteMetaSchema = z.object({ mode: z.enum(["light", "dark"]) });
|
|
375
|
+
const paletteSchema = z.object({
|
|
376
|
+
colors: z.array(paletteColorSchema),
|
|
350
377
|
meta: paletteMetaSchema
|
|
351
378
|
}).transform((palette, ctx) => {
|
|
352
379
|
const colors = paletteColorsFromEntries(palette.colors);
|
|
@@ -355,7 +382,7 @@ const paletteSchema = z$1.object({
|
|
|
355
382
|
code: "custom",
|
|
356
383
|
message: `Invalid complete palette: ${colors.error.kind}`
|
|
357
384
|
});
|
|
358
|
-
return z
|
|
385
|
+
return z.NEVER;
|
|
359
386
|
}
|
|
360
387
|
return {
|
|
361
388
|
colors: paletteColorEntries(colors.colors).map(({ name, hex }) => ({
|
|
@@ -386,7 +413,7 @@ const VARIANT_ROLES = [
|
|
|
386
413
|
* IDs become class selectors, so keep the contract deliberately narrower than
|
|
387
414
|
* an arbitrary string and shared with every authoring/runtime boundary.
|
|
388
415
|
*/
|
|
389
|
-
const buttonVariantIdSchema = z
|
|
416
|
+
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" });
|
|
390
417
|
function parseOpaqueButtonColourToken(value) {
|
|
391
418
|
const token = parseThemeColorToken(value);
|
|
392
419
|
if (token === null) return null;
|
|
@@ -401,8 +428,8 @@ const opaqueButtonColourTokenSchema = themeColorTokenSchema.refine((value) => pa
|
|
|
401
428
|
if (token === null) throw new Error("Invariant: opaque button token passed its schema");
|
|
402
429
|
return token;
|
|
403
430
|
});
|
|
404
|
-
const buttonShadeAmountSchema = z
|
|
405
|
-
const buttonShadowIntensitySchema = z
|
|
431
|
+
const buttonShadeAmountSchema = z.number().finite().min(0).max(900).multipleOf(100);
|
|
432
|
+
const buttonShadowIntensitySchema = z.enum([
|
|
406
433
|
"subtle",
|
|
407
434
|
"medium",
|
|
408
435
|
"strong"
|
|
@@ -414,153 +441,176 @@ const buttonShadowIntensitySchema = z$1.enum([
|
|
|
414
441
|
* this closed union so unsupported effect IDs, unknown option keys, and unsafe
|
|
415
442
|
* CSS values cannot become representable after the schema boundary.
|
|
416
443
|
*/
|
|
417
|
-
const buttonEffectApplicationSchema = z
|
|
418
|
-
z
|
|
419
|
-
effectId: z
|
|
420
|
-
options: z
|
|
444
|
+
const buttonEffectApplicationSchema = z.discriminatedUnion("effectId", [
|
|
445
|
+
z.strictObject({
|
|
446
|
+
effectId: z.literal("darken-background"),
|
|
447
|
+
options: z.strictObject({ amount: buttonShadeAmountSchema.optional() }).optional()
|
|
421
448
|
}),
|
|
422
|
-
z
|
|
423
|
-
effectId: z
|
|
424
|
-
options: z
|
|
449
|
+
z.strictObject({
|
|
450
|
+
effectId: z.literal("lighten-background"),
|
|
451
|
+
options: z.strictObject({ amount: buttonShadeAmountSchema.optional() }).optional()
|
|
425
452
|
}),
|
|
426
|
-
z
|
|
427
|
-
effectId: z
|
|
428
|
-
options: z
|
|
453
|
+
z.strictObject({
|
|
454
|
+
effectId: z.literal("background-on-hover"),
|
|
455
|
+
options: z.strictObject({ colorToken: opaqueButtonColourTokenSchema.optional() }).optional()
|
|
429
456
|
}),
|
|
430
|
-
z
|
|
431
|
-
effectId: z
|
|
432
|
-
options: z
|
|
457
|
+
z.strictObject({
|
|
458
|
+
effectId: z.literal("animated-gradient"),
|
|
459
|
+
options: z.strictObject({ direction: z.enum(["horizontal", "vertical"]).optional() }).optional()
|
|
433
460
|
}),
|
|
434
|
-
z
|
|
435
|
-
effectId: z
|
|
436
|
-
options: z
|
|
461
|
+
z.strictObject({
|
|
462
|
+
effectId: z.literal("drop-shadow"),
|
|
463
|
+
options: z.strictObject({ intensity: buttonShadowIntensitySchema.optional() }).optional()
|
|
437
464
|
}),
|
|
438
|
-
z
|
|
439
|
-
effectId: z
|
|
440
|
-
options: z
|
|
465
|
+
z.strictObject({
|
|
466
|
+
effectId: z.literal("inner-shadow"),
|
|
467
|
+
options: z.strictObject({}).optional()
|
|
441
468
|
}),
|
|
442
|
-
z
|
|
443
|
-
effectId: z
|
|
444
|
-
options: z
|
|
445
|
-
mode: z
|
|
469
|
+
z.strictObject({
|
|
470
|
+
effectId: z.literal("neumorphic-shadow"),
|
|
471
|
+
options: z.strictObject({
|
|
472
|
+
mode: z.enum(["raised", "pressed"]).optional(),
|
|
446
473
|
intensity: buttonShadowIntensitySchema.optional()
|
|
447
474
|
}).optional()
|
|
448
475
|
}),
|
|
449
|
-
z
|
|
450
|
-
effectId: z
|
|
451
|
-
options: z
|
|
476
|
+
z.strictObject({
|
|
477
|
+
effectId: z.literal("retro-3d-shadow"),
|
|
478
|
+
options: z.strictObject({}).optional()
|
|
452
479
|
}),
|
|
453
|
-
z
|
|
454
|
-
effectId: z
|
|
455
|
-
options: z
|
|
480
|
+
z.strictObject({
|
|
481
|
+
effectId: z.literal("scale-up"),
|
|
482
|
+
options: z.strictObject({ scale: z.enum([
|
|
456
483
|
"1.02",
|
|
457
484
|
"1.03",
|
|
458
485
|
"1.05",
|
|
459
486
|
"1.10"
|
|
460
487
|
]).optional() }).optional()
|
|
461
488
|
}),
|
|
462
|
-
z
|
|
463
|
-
effectId: z
|
|
464
|
-
options: z
|
|
489
|
+
z.strictObject({
|
|
490
|
+
effectId: z.literal("scale-down"),
|
|
491
|
+
options: z.strictObject({ scale: z.enum([
|
|
465
492
|
"0.90",
|
|
466
493
|
"0.95",
|
|
467
494
|
"0.97",
|
|
468
495
|
"0.98"
|
|
469
496
|
]).optional() }).optional()
|
|
470
497
|
}),
|
|
471
|
-
z
|
|
472
|
-
effectId: z
|
|
473
|
-
options: z
|
|
498
|
+
z.strictObject({
|
|
499
|
+
effectId: z.literal("lift"),
|
|
500
|
+
options: z.strictObject({ amount: z.enum([
|
|
474
501
|
"0.25",
|
|
475
502
|
"0.5",
|
|
476
503
|
"1"
|
|
477
504
|
]).optional() }).optional()
|
|
478
505
|
}),
|
|
479
|
-
z
|
|
480
|
-
effectId: z
|
|
481
|
-
options: z
|
|
506
|
+
z.strictObject({
|
|
507
|
+
effectId: z.literal("press-down"),
|
|
508
|
+
options: z.strictObject({}).optional()
|
|
482
509
|
}),
|
|
483
|
-
z
|
|
484
|
-
effectId: z
|
|
485
|
-
options: z
|
|
510
|
+
z.strictObject({
|
|
511
|
+
effectId: z.literal("pop"),
|
|
512
|
+
options: z.strictObject({ intensity: z.enum([
|
|
486
513
|
"subtle",
|
|
487
514
|
"medium",
|
|
488
515
|
"dramatic"
|
|
489
516
|
]).optional() }).optional()
|
|
490
517
|
}),
|
|
491
|
-
z
|
|
492
|
-
effectId: z
|
|
493
|
-
options: z
|
|
494
|
-
height: z
|
|
495
|
-
origin: z
|
|
518
|
+
z.strictObject({
|
|
519
|
+
effectId: z.literal("border-bottom-grow"),
|
|
520
|
+
options: z.strictObject({
|
|
521
|
+
height: z.union([z.literal(1), z.literal(2)]).optional(),
|
|
522
|
+
origin: z.enum([
|
|
496
523
|
"left",
|
|
497
524
|
"center",
|
|
498
525
|
"right"
|
|
499
526
|
]).optional()
|
|
500
527
|
}).optional()
|
|
501
528
|
}),
|
|
502
|
-
z
|
|
503
|
-
effectId: z
|
|
504
|
-
options: z
|
|
529
|
+
z.strictObject({
|
|
530
|
+
effectId: z.literal("sketchy-border"),
|
|
531
|
+
options: z.strictObject({ intensity: buttonShadowIntensitySchema.optional() }).optional()
|
|
505
532
|
})
|
|
506
533
|
]);
|
|
507
|
-
const cornerStyleSchema = z
|
|
534
|
+
const cornerStyleSchema = z.enum([
|
|
508
535
|
"square",
|
|
509
536
|
"rounded",
|
|
510
537
|
"pill"
|
|
511
538
|
]);
|
|
512
|
-
const shadowSizeSchema = z
|
|
539
|
+
const shadowSizeSchema = z.enum([
|
|
513
540
|
"none",
|
|
514
541
|
"low",
|
|
515
542
|
"medium",
|
|
516
543
|
"high"
|
|
517
544
|
]);
|
|
518
|
-
const textTransformSchema = z
|
|
545
|
+
const textTransformSchema = z.enum([
|
|
519
546
|
"none",
|
|
520
547
|
"uppercase",
|
|
521
548
|
"lowercase",
|
|
522
549
|
"capitalize"
|
|
523
550
|
]);
|
|
524
|
-
const fontWeightSchema = z
|
|
525
|
-
z
|
|
526
|
-
z
|
|
527
|
-
z
|
|
551
|
+
const fontWeightSchema = z.union([
|
|
552
|
+
z.literal(500),
|
|
553
|
+
z.literal(600),
|
|
554
|
+
z.literal(700)
|
|
528
555
|
]);
|
|
529
|
-
const buttonTypographySchema = z
|
|
530
|
-
const letterSpacingSchema = z
|
|
556
|
+
const buttonTypographySchema = z.enum(["body", "heading"]);
|
|
557
|
+
const letterSpacingSchema = z.enum([
|
|
531
558
|
"tight",
|
|
532
559
|
"normal",
|
|
533
560
|
"loose"
|
|
534
561
|
]);
|
|
535
|
-
const hoverTransformSchema = z
|
|
562
|
+
const hoverTransformSchema = z.enum([
|
|
536
563
|
"none",
|
|
537
564
|
"lift",
|
|
538
565
|
"scale",
|
|
539
566
|
"press"
|
|
540
567
|
]);
|
|
541
|
-
z
|
|
542
|
-
const buttonPaddingPresetSchema = z
|
|
568
|
+
z.enum(["none", "token"]);
|
|
569
|
+
const buttonPaddingPresetSchema = z.enum([
|
|
543
570
|
"compact",
|
|
544
571
|
"default",
|
|
545
572
|
"spacious"
|
|
546
573
|
]);
|
|
547
|
-
const gradientStyleSchema = z
|
|
574
|
+
const gradientStyleSchema = z.enum([
|
|
548
575
|
"linear",
|
|
549
576
|
"radial",
|
|
550
577
|
"conic"
|
|
551
578
|
]);
|
|
552
|
-
const gradientSharpnessSchema = z
|
|
579
|
+
const gradientSharpnessSchema = z.enum([
|
|
553
580
|
"smooth",
|
|
554
581
|
"medium",
|
|
555
582
|
"hard"
|
|
556
583
|
]);
|
|
557
|
-
const prioritySchema = z
|
|
558
|
-
z
|
|
559
|
-
z
|
|
560
|
-
z
|
|
584
|
+
const prioritySchema = z.union([
|
|
585
|
+
z.literal(1),
|
|
586
|
+
z.literal(2),
|
|
587
|
+
z.literal(3)
|
|
561
588
|
]);
|
|
562
|
-
z
|
|
563
|
-
const
|
|
589
|
+
const variantRoleSchema = z.enum(VARIANT_ROLES);
|
|
590
|
+
const buttonSurfaceFallbackSchema = z.discriminatedUnion("kind", [z.strictObject({ kind: z.literal("surface-outline") }), z.strictObject({
|
|
591
|
+
kind: z.literal("variant"),
|
|
592
|
+
role: variantRoleSchema
|
|
593
|
+
})]);
|
|
594
|
+
const standardButtonSurfacePolicy = {
|
|
595
|
+
primary: [{ kind: "surface-outline" }],
|
|
596
|
+
secondary: [{ kind: "surface-outline" }, {
|
|
597
|
+
kind: "variant",
|
|
598
|
+
role: "primary"
|
|
599
|
+
}],
|
|
600
|
+
outline: [{ kind: "surface-outline" }],
|
|
601
|
+
ghost: [{ kind: "surface-outline" }],
|
|
602
|
+
accent: [{ kind: "surface-outline" }, {
|
|
603
|
+
kind: "variant",
|
|
604
|
+
role: "primary"
|
|
605
|
+
}]
|
|
606
|
+
};
|
|
607
|
+
const STANDARD_BUTTON_SURFACE_POLICY = Object.freeze(Object.fromEntries(VARIANT_ROLES.map((role) => [role, Object.freeze([...standardButtonSurfacePolicy[role]])])));
|
|
608
|
+
function createStandardButtonSurfacePolicy() {
|
|
609
|
+
return Object.fromEntries(VARIANT_ROLES.map((role) => [role, [...STANDARD_BUTTON_SURFACE_POLICY[role]]]));
|
|
610
|
+
}
|
|
611
|
+
const buttonSurfacePolicyShape = Object.fromEntries(VARIANT_ROLES.map((role) => [role, z.array(buttonSurfaceFallbackSchema).max(VARIANT_ROLES.length)]));
|
|
612
|
+
const buttonSurfacePolicySchema = z.strictObject(buttonSurfacePolicyShape);
|
|
613
|
+
const buttonSizeNameSchema = z.enum([
|
|
564
614
|
"sm",
|
|
565
615
|
"md",
|
|
566
616
|
"lg",
|
|
@@ -574,13 +624,13 @@ const buttonSizeNameSchema = z$1.enum([
|
|
|
574
624
|
* generator trust the shape rather than defensively defaulting downstream.
|
|
575
625
|
*/
|
|
576
626
|
const PADDING_TOKEN_PATTERN = /^(?:0|\d+(?:\.\d+)?(?:rem|em|px|%))$/;
|
|
577
|
-
const paddingShorthandSchema = z
|
|
627
|
+
const paddingShorthandSchema = z.string().refine((value) => {
|
|
578
628
|
const parts = value.split(/\s+/).filter(Boolean);
|
|
579
629
|
return parts.length === 2 && parts.every((token) => PADDING_TOKEN_PATTERN.test(token));
|
|
580
630
|
}, { message: "Padding must be two space-separated CSS length tokens (e.g. \"0.5rem 1rem\"). Use `0` for zero." });
|
|
581
|
-
const buttonSizeConfigSchema = z
|
|
631
|
+
const buttonSizeConfigSchema = z.object({
|
|
582
632
|
padding: paddingShorthandSchema,
|
|
583
|
-
fontSize: z
|
|
633
|
+
fontSize: z.string().optional()
|
|
584
634
|
});
|
|
585
635
|
/**
|
|
586
636
|
* `xl` is optional on the wire so themes persisted before the `xl` size was
|
|
@@ -588,7 +638,7 @@ const buttonSizeConfigSchema = z$1.object({
|
|
|
588
638
|
* backfills it from `lg`, keeping `ButtonSizes` a complete `sm/md/lg/xl` map
|
|
589
639
|
* downstream — generators never need to deal with an undefined `xl`.
|
|
590
640
|
*/
|
|
591
|
-
const buttonSizesSchema = z
|
|
641
|
+
const buttonSizesSchema = z.object({
|
|
592
642
|
sm: buttonSizeConfigSchema,
|
|
593
643
|
md: buttonSizeConfigSchema,
|
|
594
644
|
lg: buttonSizeConfigSchema,
|
|
@@ -599,9 +649,9 @@ const buttonSizesSchema = z$1.object({
|
|
|
599
649
|
lg,
|
|
600
650
|
xl: xl ?? lg
|
|
601
651
|
}));
|
|
602
|
-
const buttonGlobalSettingsBaseSchema = z
|
|
652
|
+
const buttonGlobalSettingsBaseSchema = z.strictObject({
|
|
603
653
|
cornerStyle: cornerStyleSchema,
|
|
604
|
-
cornerRadius: z
|
|
654
|
+
cornerRadius: z.number().min(0).max(24).optional(),
|
|
605
655
|
/**
|
|
606
656
|
* Family-level shadow inherited by variants that don't set their own.
|
|
607
657
|
* Optional and flat-by-default: when omitted, buttons carry no drop shadow
|
|
@@ -613,23 +663,23 @@ const buttonGlobalSettingsBaseSchema = z$1.strictObject({
|
|
|
613
663
|
textTransform: textTransformSchema,
|
|
614
664
|
fontWeight: fontWeightSchema,
|
|
615
665
|
typography: buttonTypographySchema.optional(),
|
|
616
|
-
fontSize: z
|
|
666
|
+
fontSize: z.string().optional(),
|
|
617
667
|
letterSpacing: letterSpacingSchema.optional(),
|
|
618
|
-
italic: z
|
|
668
|
+
italic: z.boolean().optional(),
|
|
619
669
|
paddingPreset: buttonPaddingPresetSchema.optional(),
|
|
620
670
|
hoverTransform: hoverTransformSchema,
|
|
621
671
|
gradientStyle: gradientStyleSchema.optional(),
|
|
622
|
-
gradientAngle: z
|
|
672
|
+
gradientAngle: z.number().min(0).max(360).optional(),
|
|
623
673
|
gradientSharpness: gradientSharpnessSchema.optional()
|
|
624
674
|
});
|
|
625
|
-
const buttonGlobalSettingsSchema = z
|
|
626
|
-
hoverColor: z
|
|
627
|
-
hoverColorToken: z
|
|
675
|
+
const buttonGlobalSettingsSchema = z.discriminatedUnion("hoverColor", [buttonGlobalSettingsBaseSchema.extend({
|
|
676
|
+
hoverColor: z.literal("none"),
|
|
677
|
+
hoverColorToken: z.never().optional()
|
|
628
678
|
}), buttonGlobalSettingsBaseSchema.extend({
|
|
629
|
-
hoverColor: z
|
|
679
|
+
hoverColor: z.literal("token"),
|
|
630
680
|
hoverColorToken: opaqueButtonColourTokenSchema
|
|
631
681
|
})]);
|
|
632
|
-
const gradientDirectionSchema$1 = z
|
|
682
|
+
const gradientDirectionSchema$1 = z.enum([
|
|
633
683
|
"to-r",
|
|
634
684
|
"to-l",
|
|
635
685
|
"to-t",
|
|
@@ -639,14 +689,14 @@ const gradientDirectionSchema$1 = z$1.enum([
|
|
|
639
689
|
"to-br",
|
|
640
690
|
"to-bl"
|
|
641
691
|
]);
|
|
642
|
-
const buttonColourTreatmentSchema = z
|
|
643
|
-
z
|
|
644
|
-
type: z
|
|
692
|
+
const buttonColourTreatmentSchema = z.discriminatedUnion("type", [
|
|
693
|
+
z.strictObject({
|
|
694
|
+
type: z.literal("solid"),
|
|
645
695
|
colorToken: opaqueButtonColourTokenSchema
|
|
646
696
|
}),
|
|
647
|
-
z
|
|
648
|
-
type: z
|
|
649
|
-
stops: z
|
|
697
|
+
z.strictObject({
|
|
698
|
+
type: z.literal("gradient"),
|
|
699
|
+
stops: z.array(opaqueButtonColourTokenSchema).min(2).transform((stops) => {
|
|
650
700
|
const [first, second, ...rest] = stops;
|
|
651
701
|
if (first === void 0 || second === void 0) throw new Error("Invariant: gradient stops passed the minimum length schema");
|
|
652
702
|
return [
|
|
@@ -658,34 +708,34 @@ const buttonColourTreatmentSchema = z$1.discriminatedUnion("type", [
|
|
|
658
708
|
direction: gradientDirectionSchema$1,
|
|
659
709
|
foregroundToken: opaqueButtonColourTokenSchema
|
|
660
710
|
}),
|
|
661
|
-
z
|
|
662
|
-
type: z
|
|
663
|
-
role: z
|
|
711
|
+
z.strictObject({
|
|
712
|
+
type: z.literal("surface"),
|
|
713
|
+
role: z.literal("link")
|
|
664
714
|
})
|
|
665
715
|
]);
|
|
666
716
|
const buttonBackgroundSchema = buttonColourTreatmentSchema;
|
|
667
|
-
const buttonBorderSchema = z
|
|
668
|
-
const buttonVariantAffordanceSchema = z
|
|
669
|
-
const variantShadowSchema = z
|
|
670
|
-
elevation: z
|
|
717
|
+
const buttonBorderSchema = z.strictObject({ widthClass: z.string() });
|
|
718
|
+
const buttonVariantAffordanceSchema = z.strictObject({ iconId: z.string().min(1) });
|
|
719
|
+
const variantShadowSchema = z.strictObject({
|
|
720
|
+
elevation: z.enum([
|
|
671
721
|
"none",
|
|
672
722
|
"low",
|
|
673
723
|
"medium",
|
|
674
724
|
"high"
|
|
675
725
|
]),
|
|
676
|
-
softness: z
|
|
726
|
+
softness: z.enum([
|
|
677
727
|
"crisp",
|
|
678
728
|
"soft",
|
|
679
729
|
"hard"
|
|
680
730
|
]).nullable(),
|
|
681
|
-
position: z
|
|
731
|
+
position: z.enum(["bottom", "bottom-right"]).default("bottom"),
|
|
682
732
|
colorToken: opaqueButtonColourTokenSchema.optional()
|
|
683
733
|
});
|
|
684
|
-
const variantEffectsSchema = z
|
|
685
|
-
base: z
|
|
686
|
-
hover: z
|
|
687
|
-
active: z
|
|
688
|
-
focus: z
|
|
734
|
+
const variantEffectsSchema = z.strictObject({
|
|
735
|
+
base: z.array(buttonEffectApplicationSchema).optional(),
|
|
736
|
+
hover: z.array(buttonEffectApplicationSchema).optional(),
|
|
737
|
+
active: z.array(buttonEffectApplicationSchema).optional(),
|
|
738
|
+
focus: z.array(buttonEffectApplicationSchema).optional()
|
|
689
739
|
});
|
|
690
740
|
/**
|
|
691
741
|
* Per-variant size overrides schema — every entry is optional.
|
|
@@ -694,7 +744,7 @@ const variantEffectsSchema = z$1.strictObject({
|
|
|
694
744
|
* for that size on this variant. Missing sizes fall through to theme.sizes,
|
|
695
745
|
* then system defaults.
|
|
696
746
|
*/
|
|
697
|
-
const variantSizeOverridesSchema = z
|
|
747
|
+
const variantSizeOverridesSchema = z.object({
|
|
698
748
|
sm: buttonSizeConfigSchema.optional(),
|
|
699
749
|
md: buttonSizeConfigSchema.optional(),
|
|
700
750
|
lg: buttonSizeConfigSchema.optional(),
|
|
@@ -706,14 +756,14 @@ const variantSizeOverridesSchema = z$1.object({
|
|
|
706
756
|
* default (e.g. link-style variants declaring zero horizontal padding at
|
|
707
757
|
* every size).
|
|
708
758
|
*/
|
|
709
|
-
const buttonVariantSchema = z
|
|
759
|
+
const buttonVariantSchema = z.strictObject({
|
|
710
760
|
id: buttonVariantIdSchema,
|
|
711
|
-
name: z
|
|
712
|
-
enabled: z
|
|
761
|
+
name: z.string().min(1).max(20),
|
|
762
|
+
enabled: z.boolean(),
|
|
713
763
|
priority: prioritySchema,
|
|
714
764
|
background: buttonBackgroundSchema,
|
|
715
765
|
/** Tailwind radius token (e.g. `'rounded-md'`). Omit to inherit from `global.cornerStyle`. */
|
|
716
|
-
borderRadius: z
|
|
766
|
+
borderRadius: z.string().optional(),
|
|
717
767
|
shadow: variantShadowSchema.optional(),
|
|
718
768
|
border: buttonBorderSchema.optional(),
|
|
719
769
|
hoverBackgroundToken: opaqueButtonColourTokenSchema.optional(),
|
|
@@ -721,10 +771,11 @@ const buttonVariantSchema = z$1.strictObject({
|
|
|
721
771
|
sizes: variantSizeOverridesSchema.optional(),
|
|
722
772
|
affordance: buttonVariantAffordanceSchema.optional()
|
|
723
773
|
});
|
|
724
|
-
const buttonSystemSchema = z
|
|
774
|
+
const buttonSystemSchema = z.strictObject({
|
|
725
775
|
global: buttonGlobalSettingsSchema,
|
|
726
|
-
variants: z
|
|
727
|
-
sizes: buttonSizesSchema.optional()
|
|
776
|
+
variants: z.array(buttonVariantSchema).min(1).max(6),
|
|
777
|
+
sizes: buttonSizesSchema.optional(),
|
|
778
|
+
surfacePolicy: buttonSurfacePolicySchema.optional()
|
|
728
779
|
}).superRefine((system, ctx) => {
|
|
729
780
|
const seen = /* @__PURE__ */ new Set();
|
|
730
781
|
system.variants.forEach((variant, index) => {
|
|
@@ -1025,7 +1076,7 @@ function getButtonEffectPolicy(effectId) {
|
|
|
1025
1076
|
return Object.prototype.hasOwnProperty.call(BUTTON_EFFECT_POLICIES, effectId) ? BUTTON_EFFECT_POLICIES[effectId] : null;
|
|
1026
1077
|
}
|
|
1027
1078
|
//#endregion
|
|
1028
|
-
//#region ../theme-core/src/buttons/
|
|
1079
|
+
//#region ../theme-core/src/buttons/buttonColourContract.ts
|
|
1029
1080
|
const BUTTON_VISUAL_STATES = [
|
|
1030
1081
|
"base",
|
|
1031
1082
|
"hover",
|
|
@@ -1040,6 +1091,50 @@ const BUTTON_CONTRAST_POLICY = {
|
|
|
1040
1091
|
alphaBackgrounds: "reject-without-known-surface",
|
|
1041
1092
|
disabled: "retain-full-colour-contract"
|
|
1042
1093
|
};
|
|
1094
|
+
function formatButtonColourContractError(error) {
|
|
1095
|
+
switch (error.tag) {
|
|
1096
|
+
case "unknown_palette_token": return `Button "${error.variantId}" ${error.state} state uses unknown palette token "${error.token}".`;
|
|
1097
|
+
case "missing_on_colour": return `Button "${error.variantId}" ${error.state} state cannot derive ${error.foregroundToken} from ${error.backgroundToken}.`;
|
|
1098
|
+
case "insufficient_contrast": return `Button "${error.variantId}" ${error.state} state has ${error.ratio.toFixed(2)}:1 contrast (${error.requiredRatio}:1 required).`;
|
|
1099
|
+
case "insufficient_surface_contrast": return `Button "${error.variantId}" ${error.state} state is indistinguishable from its surface at ${error.ratio.toFixed(2)}:1 contrast (${error.requiredRatio}:1 required).`;
|
|
1100
|
+
case "unsupported_colour_effect": return `Button "${error.variantId}" ${error.state} effect "${error.effectId}" is not contrast-safe (${error.reason}).`;
|
|
1101
|
+
case "invalid_colour_effect_options": return `Button "${error.variantId}" ${error.state} effect "${error.effectId}" has an invalid ${error.option} option.`;
|
|
1102
|
+
case "inapplicable_colour_effect": return `Button "${error.variantId}" ${error.state} effect "${error.effectId}" cannot apply to a ${error.treatment} treatment.`;
|
|
1103
|
+
case "unknown_button_effect": return `Button "${error.variantId}" ${error.state} uses unknown effect "${error.effectId}".`;
|
|
1104
|
+
}
|
|
1105
|
+
}
|
|
1106
|
+
function validateButtonSurfaceContrast(input) {
|
|
1107
|
+
const ratio = contrastRatio(input.buttonPaint, input.surfaceHex);
|
|
1108
|
+
return ratio >= BUTTON_CONTRAST_POLICY.nonTextMinimumRatio ? { ok: true } : {
|
|
1109
|
+
ok: false,
|
|
1110
|
+
error: {
|
|
1111
|
+
tag: "insufficient_surface_contrast",
|
|
1112
|
+
variantId: input.variantId,
|
|
1113
|
+
state: input.state,
|
|
1114
|
+
buttonPaint: input.buttonPaint,
|
|
1115
|
+
surface: input.surfaceHex,
|
|
1116
|
+
ratio,
|
|
1117
|
+
requiredRatio: BUTTON_CONTRAST_POLICY.nonTextMinimumRatio
|
|
1118
|
+
}
|
|
1119
|
+
};
|
|
1120
|
+
}
|
|
1121
|
+
function validateButtonTextContrast(input) {
|
|
1122
|
+
const ratio = contrastRatio(input.backgroundHex, input.foregroundHex);
|
|
1123
|
+
return ratio >= BUTTON_CONTRAST_POLICY.textMinimumRatio ? { ok: true } : {
|
|
1124
|
+
ok: false,
|
|
1125
|
+
error: {
|
|
1126
|
+
tag: "insufficient_contrast",
|
|
1127
|
+
variantId: input.variantId,
|
|
1128
|
+
state: input.state,
|
|
1129
|
+
background: input.background,
|
|
1130
|
+
foreground: input.foreground,
|
|
1131
|
+
ratio,
|
|
1132
|
+
requiredRatio: BUTTON_CONTRAST_POLICY.textMinimumRatio
|
|
1133
|
+
}
|
|
1134
|
+
};
|
|
1135
|
+
}
|
|
1136
|
+
//#endregion
|
|
1137
|
+
//#region ../theme-core/src/buttons/resolveButtonColourStates.ts
|
|
1043
1138
|
function compileButtonColourStates(input) {
|
|
1044
1139
|
const baseTransition = applyColourEffects({
|
|
1045
1140
|
variantId: input.variant.id,
|
|
@@ -1079,7 +1174,9 @@ function compileButtonColourStates(input) {
|
|
|
1079
1174
|
variantId: input.variant.id,
|
|
1080
1175
|
state,
|
|
1081
1176
|
treatment: stateTreatments[state],
|
|
1082
|
-
palette: input.palette
|
|
1177
|
+
palette: input.palette,
|
|
1178
|
+
surface: input.surface,
|
|
1179
|
+
hasBoundary: input.variant.border !== void 0
|
|
1083
1180
|
});
|
|
1084
1181
|
if (!result.ok) return result;
|
|
1085
1182
|
resolved[state] = result.colour;
|
|
@@ -1091,17 +1188,6 @@ function compileButtonColourStates(input) {
|
|
|
1091
1188
|
nonColourEffects
|
|
1092
1189
|
};
|
|
1093
1190
|
}
|
|
1094
|
-
function formatButtonColourContractError(error) {
|
|
1095
|
-
switch (error.tag) {
|
|
1096
|
-
case "unknown_palette_token": return `Button "${error.variantId}" ${error.state} state uses unknown palette token "${error.token}".`;
|
|
1097
|
-
case "missing_on_colour": return `Button "${error.variantId}" ${error.state} state cannot derive ${error.foregroundToken} from ${error.backgroundToken}.`;
|
|
1098
|
-
case "insufficient_contrast": return `Button "${error.variantId}" ${error.state} state has ${error.ratio.toFixed(2)}:1 contrast (${error.requiredRatio}:1 required).`;
|
|
1099
|
-
case "unsupported_colour_effect": return `Button "${error.variantId}" ${error.state} effect "${error.effectId}" is not contrast-safe (${error.reason}).`;
|
|
1100
|
-
case "invalid_colour_effect_options": return `Button "${error.variantId}" ${error.state} effect "${error.effectId}" has an invalid ${error.option} option.`;
|
|
1101
|
-
case "inapplicable_colour_effect": return `Button "${error.variantId}" ${error.state} effect "${error.effectId}" cannot apply to a ${error.treatment} treatment.`;
|
|
1102
|
-
case "unknown_button_effect": return `Button "${error.variantId}" ${error.state} uses unknown effect "${error.effectId}".`;
|
|
1103
|
-
}
|
|
1104
|
-
}
|
|
1105
1191
|
function hoverTreatment(variant, global, fallback) {
|
|
1106
1192
|
const token = variant.hoverBackgroundToken ?? (global.hoverColor === "token" ? global.hoverColorToken : void 0);
|
|
1107
1193
|
return token === void 0 ? fallback : {
|
|
@@ -1158,22 +1244,42 @@ function applyColourEffects(input) {
|
|
|
1158
1244
|
function resolveTreatment(input) {
|
|
1159
1245
|
const treatment = input.treatment;
|
|
1160
1246
|
switch (treatment.type) {
|
|
1161
|
-
case "surface":
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1247
|
+
case "surface":
|
|
1248
|
+
if (input.surface) {
|
|
1249
|
+
const foreground = validateButtonTextContrast({
|
|
1250
|
+
...input,
|
|
1251
|
+
background: "surface",
|
|
1252
|
+
backgroundHex: input.surface.backgroundHex,
|
|
1253
|
+
foreground: "surface-foreground",
|
|
1254
|
+
foregroundHex: input.surface.foregroundHex
|
|
1255
|
+
});
|
|
1256
|
+
if (!foreground.ok) return foreground;
|
|
1168
1257
|
}
|
|
1169
|
-
|
|
1258
|
+
if (input.surface && input.hasBoundary) {
|
|
1259
|
+
const boundary = validateButtonSurfaceContrast({
|
|
1260
|
+
...input,
|
|
1261
|
+
buttonPaint: input.surface.foregroundHex,
|
|
1262
|
+
surfaceHex: input.surface.backgroundHex
|
|
1263
|
+
});
|
|
1264
|
+
if (!boundary.ok) return boundary;
|
|
1265
|
+
}
|
|
1266
|
+
return {
|
|
1267
|
+
ok: true,
|
|
1268
|
+
colour: {
|
|
1269
|
+
kind: "surface",
|
|
1270
|
+
role: treatment.role,
|
|
1271
|
+
backgroundCss: "transparent",
|
|
1272
|
+
foregroundCss: input.surface?.foregroundCss ?? surfaceForegroundValue(treatment.role)
|
|
1273
|
+
}
|
|
1274
|
+
};
|
|
1170
1275
|
case "solid": return resolveSolid(input, treatment.colorToken);
|
|
1171
1276
|
case "gradient": return resolveGradient(input, treatment);
|
|
1172
1277
|
}
|
|
1173
1278
|
}
|
|
1174
1279
|
function resolveFocusIndicator(colour) {
|
|
1175
1280
|
switch (colour.kind) {
|
|
1176
|
-
case "solid":
|
|
1281
|
+
case "solid":
|
|
1282
|
+
case "known-solid": return {
|
|
1177
1283
|
kind: "two-tone",
|
|
1178
1284
|
innerCss: colour.foregroundCss,
|
|
1179
1285
|
outerCss: colour.backgroundCss,
|
|
@@ -1207,7 +1313,7 @@ function resolveSolid(input, backgroundToken) {
|
|
|
1207
1313
|
foregroundToken
|
|
1208
1314
|
}
|
|
1209
1315
|
};
|
|
1210
|
-
const contrast =
|
|
1316
|
+
const contrast = validateButtonTextContrast({
|
|
1211
1317
|
...input,
|
|
1212
1318
|
background: backgroundToken,
|
|
1213
1319
|
backgroundHex: backgroundHex.hex,
|
|
@@ -1215,6 +1321,14 @@ function resolveSolid(input, backgroundToken) {
|
|
|
1215
1321
|
foregroundHex
|
|
1216
1322
|
});
|
|
1217
1323
|
if (!contrast.ok) return contrast;
|
|
1324
|
+
if (input.surface) {
|
|
1325
|
+
const boundary = validateButtonSurfaceContrast({
|
|
1326
|
+
...input,
|
|
1327
|
+
buttonPaint: backgroundHex.hex,
|
|
1328
|
+
surfaceHex: input.surface.backgroundHex
|
|
1329
|
+
});
|
|
1330
|
+
if (!boundary.ok) return boundary;
|
|
1331
|
+
}
|
|
1218
1332
|
return {
|
|
1219
1333
|
ok: true,
|
|
1220
1334
|
colour: {
|
|
@@ -1244,7 +1358,7 @@ function resolveGradient(input, treatment) {
|
|
|
1244
1358
|
for (let sample = 0; sample <= BUTTON_CONTRAST_POLICY.gradientSamplesPerSegment; sample += 1) {
|
|
1245
1359
|
const position = sample / BUTTON_CONTRAST_POLICY.gradientSamplesPerSegment;
|
|
1246
1360
|
const sampleHex = interpolateHex(start, end, position);
|
|
1247
|
-
const contrast =
|
|
1361
|
+
const contrast = validateButtonTextContrast({
|
|
1248
1362
|
...input,
|
|
1249
1363
|
background: `${startToken}→${endToken}@${position.toFixed(2)}`,
|
|
1250
1364
|
backgroundHex: sampleHex,
|
|
@@ -1252,6 +1366,14 @@ function resolveGradient(input, treatment) {
|
|
|
1252
1366
|
foregroundHex: foregroundHex.hex
|
|
1253
1367
|
});
|
|
1254
1368
|
if (!contrast.ok) return contrast;
|
|
1369
|
+
if (input.surface) {
|
|
1370
|
+
const boundary = validateButtonSurfaceContrast({
|
|
1371
|
+
...input,
|
|
1372
|
+
buttonPaint: sampleHex,
|
|
1373
|
+
surfaceHex: input.surface.backgroundHex
|
|
1374
|
+
});
|
|
1375
|
+
if (!boundary.ok) return boundary;
|
|
1376
|
+
}
|
|
1255
1377
|
}
|
|
1256
1378
|
}
|
|
1257
1379
|
const direction = GRADIENT_DIRECTION_MAP$1[treatment.direction] ?? "to right";
|
|
@@ -1281,21 +1403,6 @@ function paletteHex(input, token) {
|
|
|
1281
1403
|
}
|
|
1282
1404
|
};
|
|
1283
1405
|
}
|
|
1284
|
-
function validateContrast(input) {
|
|
1285
|
-
const ratio = contrastRatio(input.backgroundHex, input.foregroundHex);
|
|
1286
|
-
return ratio >= BUTTON_CONTRAST_POLICY.textMinimumRatio ? { ok: true } : {
|
|
1287
|
-
ok: false,
|
|
1288
|
-
error: {
|
|
1289
|
-
tag: "insufficient_contrast",
|
|
1290
|
-
variantId: input.variantId,
|
|
1291
|
-
state: input.state,
|
|
1292
|
-
background: input.background,
|
|
1293
|
-
foreground: input.foreground,
|
|
1294
|
-
ratio,
|
|
1295
|
-
requiredRatio: BUTTON_CONTRAST_POLICY.textMinimumRatio
|
|
1296
|
-
}
|
|
1297
|
-
};
|
|
1298
|
-
}
|
|
1299
1406
|
function tokenCss(token) {
|
|
1300
1407
|
return `rgb(var(--tb-${token}))`;
|
|
1301
1408
|
}
|
|
@@ -1440,37 +1547,105 @@ function shadeBackgroundEffect(config) {
|
|
|
1440
1547
|
};
|
|
1441
1548
|
}
|
|
1442
1549
|
//#endregion
|
|
1550
|
+
//#region ../theme-core/src/utils/colorStyles.ts
|
|
1551
|
+
const COLOR_VAR_PREFIX = "--tb-";
|
|
1552
|
+
function parseToken(source) {
|
|
1553
|
+
const parts = parseColorTokenParts(source);
|
|
1554
|
+
if (parts.kind === "raw") return {
|
|
1555
|
+
token: source,
|
|
1556
|
+
raw: parts.value
|
|
1557
|
+
};
|
|
1558
|
+
if (parts.kind === "invalid") return { token: source };
|
|
1559
|
+
return {
|
|
1560
|
+
token: parts.token,
|
|
1561
|
+
opacityPercent: parts.opacityPercent === null ? void 0 : parts.opacityPercent
|
|
1562
|
+
};
|
|
1563
|
+
}
|
|
1564
|
+
/**
|
|
1565
|
+
* Converts a theme color token to a CSS rgb value.
|
|
1566
|
+
* This is the primary function for applying theme colors to CSS properties.
|
|
1567
|
+
*
|
|
1568
|
+
* @param token - Theme color token (semantic, with opacity, or raw)
|
|
1569
|
+
* @returns CSS color value (rgb with optional alpha, or raw CSS value)
|
|
1570
|
+
*
|
|
1571
|
+
* @example
|
|
1572
|
+
* rgbColorValue('primary') // => 'rgb(var(--tb-primary))'
|
|
1573
|
+
* rgbColorValue('surface/95') // => 'rgb(var(--tb-surface) / 0.95)'
|
|
1574
|
+
* rgbColorValue('raw:transparent') // => 'transparent'
|
|
1575
|
+
*/
|
|
1576
|
+
function rgbColorValue(token) {
|
|
1577
|
+
const { token: baseToken, opacityPercent, raw } = parseToken(token);
|
|
1578
|
+
if (raw) return raw;
|
|
1579
|
+
const cssVar = `${COLOR_VAR_PREFIX}${baseToken}`;
|
|
1580
|
+
if (opacityPercent === void 0) return `rgb(var(${cssVar}))`;
|
|
1581
|
+
return `rgb(var(${cssVar}) / ${opacityPercent / 100})`;
|
|
1582
|
+
}
|
|
1583
|
+
/**
|
|
1584
|
+
* Converts a theme color token to a CSS variable reference.
|
|
1585
|
+
* Note: This returns the base variable without rgb() wrapper, ignoring opacity.
|
|
1586
|
+
*
|
|
1587
|
+
* @param token - Theme color token
|
|
1588
|
+
* @returns CSS variable reference
|
|
1589
|
+
*
|
|
1590
|
+
* @example
|
|
1591
|
+
* cssVarValue('primary') // => 'var(--tb-primary)'
|
|
1592
|
+
* cssVarValue('surface/95') // => 'var(--tb-surface)' (opacity ignored)
|
|
1593
|
+
*/
|
|
1594
|
+
function cssVarValue(token) {
|
|
1595
|
+
const { token: baseToken } = parseToken(token);
|
|
1596
|
+
return `var(${COLOR_VAR_PREFIX}${baseToken})`;
|
|
1597
|
+
}
|
|
1598
|
+
//#endregion
|
|
1599
|
+
//#region ../theme-core/src/utils/tokenOrColor.ts
|
|
1600
|
+
/**
|
|
1601
|
+
* Runtime color-reference fields intentionally accept any string, including
|
|
1602
|
+
* the legacy empty-string "no color" sentinel. Semantic validation needs
|
|
1603
|
+
* palette context and happens in `parseThemeColorReference`.
|
|
1604
|
+
*/
|
|
1605
|
+
const tokenOrCssColorValueSchema = z.string();
|
|
1606
|
+
//#endregion
|
|
1607
|
+
//#region ../theme-core/src/buttons/buttonSurfaceContext.ts
|
|
1608
|
+
function actionVariableName(role, state, property) {
|
|
1609
|
+
return `--rb-action-${role}-${state}-${property}`;
|
|
1610
|
+
}
|
|
1611
|
+
function actionVariableFallback(role, state, property, fallback) {
|
|
1612
|
+
return `var(${actionVariableName(role, state, property)}, ${fallback})`;
|
|
1613
|
+
}
|
|
1614
|
+
//#endregion
|
|
1443
1615
|
//#region ../theme-core/src/buttons/resolvedButtonCss.ts
|
|
1444
1616
|
/**
|
|
1445
1617
|
* Canonical colour declaration mapping shared by full themes and ThemeBridge.
|
|
1446
1618
|
* Both background properties are always emitted so transitions cannot retain
|
|
1447
1619
|
* a stale gradient or solid layer.
|
|
1448
1620
|
*/
|
|
1449
|
-
function resolvedButtonColourDeclarations(colour) {
|
|
1621
|
+
function resolvedButtonColourDeclarations(colour, action) {
|
|
1622
|
+
const value = (property, fallback) => action ? actionVariableFallback(action.role, action.state, property, fallback) : fallback;
|
|
1450
1623
|
switch (colour.kind) {
|
|
1451
|
-
case "solid":
|
|
1452
|
-
|
|
1453
|
-
["background-
|
|
1454
|
-
["
|
|
1624
|
+
case "solid":
|
|
1625
|
+
case "known-solid": return [
|
|
1626
|
+
["background-color", value("background-color", colour.backgroundCss)],
|
|
1627
|
+
["background-image", value("background-image", "none")],
|
|
1628
|
+
["color", value("color", colour.foregroundCss)]
|
|
1455
1629
|
];
|
|
1456
1630
|
case "gradient": return [
|
|
1457
|
-
["background-color", "transparent"],
|
|
1458
|
-
["background-image", colour.backgroundCss],
|
|
1459
|
-
["color", colour.foregroundCss]
|
|
1631
|
+
["background-color", value("background-color", "transparent")],
|
|
1632
|
+
["background-image", value("background-image", colour.backgroundCss)],
|
|
1633
|
+
["color", value("color", colour.foregroundCss)]
|
|
1460
1634
|
];
|
|
1461
1635
|
case "surface": return [
|
|
1462
|
-
["background-color", colour.backgroundCss],
|
|
1463
|
-
["background-image", "none"],
|
|
1464
|
-
["color", colour.foregroundCss]
|
|
1636
|
+
["background-color", value("background-color", colour.backgroundCss)],
|
|
1637
|
+
["background-image", value("background-image", "none")],
|
|
1638
|
+
["color", value("color", colour.foregroundCss)]
|
|
1465
1639
|
];
|
|
1466
1640
|
}
|
|
1467
1641
|
}
|
|
1468
|
-
function resolvedButtonFocusDeclarations(indicator) {
|
|
1642
|
+
function resolvedButtonFocusDeclarations(indicator, role) {
|
|
1643
|
+
const value = (property, fallback) => role ? actionVariableFallback(role, "focus", property, fallback) : fallback;
|
|
1469
1644
|
return indicator.kind === "two-tone" ? [
|
|
1470
|
-
["outline", `2px solid ${indicator.innerCss}`],
|
|
1471
|
-
["outline-offset", "2px"],
|
|
1472
|
-
["box-shadow", `0 0 0 4px ${indicator.outerCss}`]
|
|
1473
|
-
] : [["outline", `3px solid ${indicator.colorCss}`], ["outline-offset", "3px"]];
|
|
1645
|
+
["outline", value("outline", `2px solid ${indicator.innerCss}`)],
|
|
1646
|
+
["outline-offset", value("outline-offset", "2px")],
|
|
1647
|
+
["box-shadow", value("box-shadow", `0 0 0 4px ${indicator.outerCss}`)]
|
|
1648
|
+
] : [["outline", value("outline", `3px solid ${indicator.colorCss}`)], ["outline-offset", value("outline-offset", "3px")]];
|
|
1474
1649
|
}
|
|
1475
1650
|
/**
|
|
1476
1651
|
* Disabled buttons retain their validated colour pair and add a non-layout
|
|
@@ -1528,6 +1703,7 @@ function resolveButtonStyleRecipe(recipe, parameters) {
|
|
|
1528
1703
|
const buttonSystem = {
|
|
1529
1704
|
global: definition.global,
|
|
1530
1705
|
variants: PUBLIC_BUTTON_ROLES.map((role) => roles[role]),
|
|
1706
|
+
surfacePolicy: definition.surfacePolicy ?? createStandardButtonSurfacePolicy(),
|
|
1531
1707
|
...definition.sizes ? { sizes: definition.sizes } : {}
|
|
1532
1708
|
};
|
|
1533
1709
|
const parsedButtonSystem = buttonSystemSchema.safeParse(buttonSystem);
|
|
@@ -1588,15 +1764,15 @@ const BUTTON_STYLE_IDS = [
|
|
|
1588
1764
|
"ornate-ritual",
|
|
1589
1765
|
"quiet-arrow"
|
|
1590
1766
|
];
|
|
1591
|
-
const quietArrowParametersSchema = z
|
|
1592
|
-
const emptyParametersSchema$1 = z
|
|
1767
|
+
const quietArrowParametersSchema = z.object({ secondaryTreatment: z.enum(["outlined", "solid-accent"]) }).strict();
|
|
1768
|
+
const emptyParametersSchema$1 = z.object({}).strict();
|
|
1593
1769
|
function selectionBranch(styleId, parameters) {
|
|
1594
|
-
return z
|
|
1595
|
-
styleId: z
|
|
1770
|
+
return z.object({
|
|
1771
|
+
styleId: z.literal(styleId),
|
|
1596
1772
|
parameters
|
|
1597
1773
|
}).strict();
|
|
1598
1774
|
}
|
|
1599
|
-
const buttonStyleSelectionSchema = z
|
|
1775
|
+
const buttonStyleSelectionSchema = z.discriminatedUnion("styleId", [
|
|
1600
1776
|
selectionBranch("soft-pill", emptyParametersSchema$1),
|
|
1601
1777
|
selectionBranch("earth-pill", emptyParametersSchema$1),
|
|
1602
1778
|
selectionBranch("confident-chip", emptyParametersSchema$1),
|
|
@@ -1741,7 +1917,7 @@ const quietArrowRecipe = defineButtonStyleRecipe({
|
|
|
1741
1917
|
});
|
|
1742
1918
|
//#endregion
|
|
1743
1919
|
//#region ../theme-core/src/buttons/styles/recipes/defineStaticButtonStyleRecipe.ts
|
|
1744
|
-
const emptyParametersSchema = z
|
|
1920
|
+
const emptyParametersSchema = z.object({}).strict();
|
|
1745
1921
|
function defineStaticButtonStyleRecipe(input) {
|
|
1746
1922
|
const system = normalizeSystem(input.system);
|
|
1747
1923
|
return defineButtonStyleRecipe({
|
|
@@ -3107,7 +3283,7 @@ function presetCategory(recipe) {
|
|
|
3107
3283
|
//#region ../theme-core/src/cards/types.ts
|
|
3108
3284
|
const cardVariantRoleValues = ["default", "alternative"];
|
|
3109
3285
|
const boxlessCardVariantValue = "none";
|
|
3110
|
-
const cardSpacingSchema = z
|
|
3286
|
+
const cardSpacingSchema = z.enum([
|
|
3111
3287
|
"none",
|
|
3112
3288
|
"compact",
|
|
3113
3289
|
"cozy",
|
|
@@ -3115,7 +3291,7 @@ const cardSpacingSchema = z$1.enum([
|
|
|
3115
3291
|
"comfortable",
|
|
3116
3292
|
"spacious"
|
|
3117
3293
|
]);
|
|
3118
|
-
const gradientDirectionSchema = z
|
|
3294
|
+
const gradientDirectionSchema = z.enum([
|
|
3119
3295
|
"to-r",
|
|
3120
3296
|
"to-l",
|
|
3121
3297
|
"to-t",
|
|
@@ -3125,27 +3301,27 @@ const gradientDirectionSchema = z$1.enum([
|
|
|
3125
3301
|
"to-br",
|
|
3126
3302
|
"to-bl"
|
|
3127
3303
|
]);
|
|
3128
|
-
z
|
|
3129
|
-
const boxStylesCardVariantSchema = z
|
|
3130
|
-
const cardBackgroundSchema = z
|
|
3131
|
-
z
|
|
3132
|
-
type: z
|
|
3304
|
+
z.enum(cardVariantRoleValues);
|
|
3305
|
+
const boxStylesCardVariantSchema = z.enum([...cardVariantRoleValues, boxlessCardVariantValue]);
|
|
3306
|
+
const cardBackgroundSchema = z.discriminatedUnion("type", [
|
|
3307
|
+
z.object({
|
|
3308
|
+
type: z.literal("solid"),
|
|
3133
3309
|
colorToken: themeColorTokenSchema
|
|
3134
3310
|
}),
|
|
3135
|
-
z
|
|
3136
|
-
type: z
|
|
3311
|
+
z.object({
|
|
3312
|
+
type: z.literal("gradient"),
|
|
3137
3313
|
fromToken: themeColorTokenSchema,
|
|
3138
3314
|
toToken: themeColorTokenSchema,
|
|
3139
3315
|
direction: gradientDirectionSchema
|
|
3140
3316
|
}),
|
|
3141
|
-
z
|
|
3317
|
+
z.object({ type: z.literal("transparent") })
|
|
3142
3318
|
]);
|
|
3143
|
-
const cardBorderSchema = z
|
|
3144
|
-
widthClass: z
|
|
3319
|
+
const cardBorderSchema = z.object({
|
|
3320
|
+
widthClass: z.string(),
|
|
3145
3321
|
colorToken: themeColorTokenSchema
|
|
3146
3322
|
});
|
|
3147
3323
|
/** Per-corner radius value. `expressive` is a large block-radius multiple. */
|
|
3148
|
-
const cardCornerValueSchema = z
|
|
3324
|
+
const cardCornerValueSchema = z.enum([
|
|
3149
3325
|
"square",
|
|
3150
3326
|
"soft",
|
|
3151
3327
|
"rounded",
|
|
@@ -3156,54 +3332,54 @@ const cardCornerValueSchema = z$1.enum([
|
|
|
3156
3332
|
* A single accented card edge (e.g. a left accent bar). When set, it replaces
|
|
3157
3333
|
* the full `border` so the card reads as edge-accented rather than outlined.
|
|
3158
3334
|
*/
|
|
3159
|
-
const cardAccentEdgeSchema = z
|
|
3160
|
-
edge: z
|
|
3335
|
+
const cardAccentEdgeSchema = z.object({
|
|
3336
|
+
edge: z.enum([
|
|
3161
3337
|
"left",
|
|
3162
3338
|
"top",
|
|
3163
3339
|
"right",
|
|
3164
3340
|
"bottom"
|
|
3165
3341
|
]),
|
|
3166
3342
|
colorToken: themeColorTokenSchema,
|
|
3167
|
-
width: z
|
|
3343
|
+
width: z.enum([
|
|
3168
3344
|
"thin",
|
|
3169
3345
|
"medium",
|
|
3170
3346
|
"thick",
|
|
3171
3347
|
"heavy"
|
|
3172
3348
|
])
|
|
3173
3349
|
});
|
|
3174
|
-
const cardCornerRadiiSchema = z
|
|
3350
|
+
const cardCornerRadiiSchema = z.object({
|
|
3175
3351
|
topLeft: cardCornerValueSchema.optional(),
|
|
3176
3352
|
topRight: cardCornerValueSchema.optional(),
|
|
3177
3353
|
bottomLeft: cardCornerValueSchema.optional(),
|
|
3178
3354
|
bottomRight: cardCornerValueSchema.optional()
|
|
3179
3355
|
});
|
|
3180
|
-
const cardVariantSchema = z
|
|
3181
|
-
id: z
|
|
3182
|
-
name: z
|
|
3183
|
-
enabled: z
|
|
3184
|
-
priority: z
|
|
3185
|
-
z
|
|
3186
|
-
z
|
|
3187
|
-
z
|
|
3356
|
+
const cardVariantSchema = z.object({
|
|
3357
|
+
id: z.string(),
|
|
3358
|
+
name: z.string().min(1).max(20),
|
|
3359
|
+
enabled: z.boolean(),
|
|
3360
|
+
priority: z.union([
|
|
3361
|
+
z.literal(1),
|
|
3362
|
+
z.literal(2),
|
|
3363
|
+
z.literal(3)
|
|
3188
3364
|
]),
|
|
3189
3365
|
background: cardBackgroundSchema,
|
|
3190
3366
|
spacing: cardSpacingSchema,
|
|
3191
3367
|
foregroundToken: themeColorTokenSchema.optional(),
|
|
3192
|
-
shadow: z
|
|
3193
|
-
elevation: z
|
|
3368
|
+
shadow: z.object({
|
|
3369
|
+
elevation: z.enum([
|
|
3194
3370
|
"none",
|
|
3195
3371
|
"low",
|
|
3196
3372
|
"medium",
|
|
3197
3373
|
"high"
|
|
3198
3374
|
]),
|
|
3199
|
-
softness: z
|
|
3375
|
+
softness: z.enum([
|
|
3200
3376
|
"crisp",
|
|
3201
3377
|
"soft",
|
|
3202
3378
|
"hard"
|
|
3203
3379
|
]).nullable(),
|
|
3204
|
-
position: z
|
|
3380
|
+
position: z.enum(["bottom", "bottom-right"]).default("bottom")
|
|
3205
3381
|
}).optional(),
|
|
3206
|
-
corners: z
|
|
3382
|
+
corners: z.enum([
|
|
3207
3383
|
"square",
|
|
3208
3384
|
"soft",
|
|
3209
3385
|
"rounded",
|
|
@@ -3213,7 +3389,7 @@ const cardVariantSchema = z$1.object({
|
|
|
3213
3389
|
border: cardBorderSchema.optional(),
|
|
3214
3390
|
accentEdge: cardAccentEdgeSchema.optional()
|
|
3215
3391
|
});
|
|
3216
|
-
const cardSystemSchema = z
|
|
3392
|
+
const cardSystemSchema = z.object({ variants: z.array(cardVariantSchema).min(1).max(3) });
|
|
3217
3393
|
//#endregion
|
|
3218
3394
|
//#region ../theme-core/src/cards/core.ts
|
|
3219
3395
|
/**
|
|
@@ -3387,7 +3563,7 @@ function getDefaultCardVariants() {
|
|
|
3387
3563
|
/**
|
|
3388
3564
|
* Accordion icon styles for expand/collapse indicators
|
|
3389
3565
|
*/
|
|
3390
|
-
const accordionIconSchema = z
|
|
3566
|
+
const accordionIconSchema = z.enum([
|
|
3391
3567
|
"plus-minus",
|
|
3392
3568
|
"chevron",
|
|
3393
3569
|
"caret",
|
|
@@ -3398,12 +3574,12 @@ const accordionIconSchema = z$1.enum([
|
|
|
3398
3574
|
* Accordion configuration for a theme
|
|
3399
3575
|
* Single style per theme (no variants needed)
|
|
3400
3576
|
*/
|
|
3401
|
-
const accordionSystemSchema = z
|
|
3402
|
-
background: z
|
|
3403
|
-
type: z
|
|
3577
|
+
const accordionSystemSchema = z.object({
|
|
3578
|
+
background: z.object({
|
|
3579
|
+
type: z.literal("solid"),
|
|
3404
3580
|
colorToken: themeColorTokenSchema
|
|
3405
3581
|
}).nullable(),
|
|
3406
|
-
spacing: z
|
|
3582
|
+
spacing: z.enum([
|
|
3407
3583
|
"none",
|
|
3408
3584
|
"compact",
|
|
3409
3585
|
"cozy",
|
|
@@ -3411,84 +3587,84 @@ const accordionSystemSchema = z$1.object({
|
|
|
3411
3587
|
"comfortable",
|
|
3412
3588
|
"spacious"
|
|
3413
3589
|
]),
|
|
3414
|
-
corners: z
|
|
3590
|
+
corners: z.enum([
|
|
3415
3591
|
"square",
|
|
3416
3592
|
"soft",
|
|
3417
3593
|
"rounded",
|
|
3418
3594
|
"pill"
|
|
3419
3595
|
]).nullable(),
|
|
3420
|
-
border: z
|
|
3421
|
-
widthClass: z
|
|
3596
|
+
border: z.object({
|
|
3597
|
+
widthClass: z.string(),
|
|
3422
3598
|
colorToken: themeColorTokenSchema
|
|
3423
3599
|
}).nullable(),
|
|
3424
|
-
shadow: z
|
|
3425
|
-
elevation: z
|
|
3600
|
+
shadow: z.object({
|
|
3601
|
+
elevation: z.enum([
|
|
3426
3602
|
"none",
|
|
3427
3603
|
"low",
|
|
3428
3604
|
"medium",
|
|
3429
3605
|
"high"
|
|
3430
3606
|
]),
|
|
3431
|
-
softness: z
|
|
3607
|
+
softness: z.enum([
|
|
3432
3608
|
"soft",
|
|
3433
3609
|
"crisp",
|
|
3434
3610
|
"hard"
|
|
3435
3611
|
]).nullable(),
|
|
3436
|
-
position: z
|
|
3612
|
+
position: z.enum(["bottom", "bottom-right"])
|
|
3437
3613
|
}).nullable(),
|
|
3438
|
-
icon: z
|
|
3614
|
+
icon: z.object({
|
|
3439
3615
|
style: accordionIconSchema,
|
|
3440
|
-
position: z
|
|
3441
|
-
size: z
|
|
3616
|
+
position: z.enum(["left", "right"]),
|
|
3617
|
+
size: z.enum([
|
|
3442
3618
|
"sm",
|
|
3443
3619
|
"md",
|
|
3444
3620
|
"lg"
|
|
3445
3621
|
]),
|
|
3446
3622
|
colorToken: themeColorTokenSchema.optional()
|
|
3447
3623
|
}),
|
|
3448
|
-
trigger: z
|
|
3624
|
+
trigger: z.object({
|
|
3449
3625
|
textColorToken: themeColorTokenSchema,
|
|
3450
|
-
fontWeight: z
|
|
3626
|
+
fontWeight: z.enum([
|
|
3451
3627
|
"regular",
|
|
3452
3628
|
"medium",
|
|
3453
3629
|
"semibold",
|
|
3454
3630
|
"bold"
|
|
3455
3631
|
]).nullable(),
|
|
3456
|
-
fontFamily: z
|
|
3457
|
-
fontScale: z
|
|
3632
|
+
fontFamily: z.enum(["body", "heading"]).optional(),
|
|
3633
|
+
fontScale: z.enum([
|
|
3458
3634
|
"body",
|
|
3459
3635
|
"md",
|
|
3460
3636
|
"lg"
|
|
3461
3637
|
]).optional(),
|
|
3462
|
-
letterSpacing: z
|
|
3638
|
+
letterSpacing: z.enum([
|
|
3463
3639
|
"normal",
|
|
3464
3640
|
"tight",
|
|
3465
3641
|
"wide"
|
|
3466
3642
|
]).optional(),
|
|
3467
|
-
textTransform: z
|
|
3643
|
+
textTransform: z.enum(["none", "uppercase"]).optional()
|
|
3468
3644
|
}),
|
|
3469
|
-
hover: z
|
|
3645
|
+
hover: z.object({
|
|
3470
3646
|
backgroundColorToken: themeColorTokenSchema.optional(),
|
|
3471
3647
|
textColorToken: themeColorTokenSchema.optional(),
|
|
3472
3648
|
borderColorToken: themeColorTokenSchema.optional()
|
|
3473
3649
|
}),
|
|
3474
|
-
openState: z
|
|
3650
|
+
openState: z.object({
|
|
3475
3651
|
backgroundColorToken: themeColorTokenSchema.optional(),
|
|
3476
3652
|
triggerColorToken: themeColorTokenSchema.optional(),
|
|
3477
|
-
accent: z
|
|
3478
|
-
edge: z
|
|
3653
|
+
accent: z.object({
|
|
3654
|
+
edge: z.enum([
|
|
3479
3655
|
"left",
|
|
3480
3656
|
"top",
|
|
3481
3657
|
"bottom"
|
|
3482
3658
|
]),
|
|
3483
3659
|
colorToken: themeColorTokenSchema,
|
|
3484
|
-
thickness: z
|
|
3660
|
+
thickness: z.enum([
|
|
3485
3661
|
"thin",
|
|
3486
3662
|
"medium",
|
|
3487
3663
|
"thick"
|
|
3488
3664
|
])
|
|
3489
3665
|
}).optional()
|
|
3490
3666
|
}).optional(),
|
|
3491
|
-
content: z
|
|
3667
|
+
content: z.object({ textColorToken: themeColorTokenSchema })
|
|
3492
3668
|
});
|
|
3493
3669
|
//#endregion
|
|
3494
3670
|
//#region ../theme-core/src/inputs/types.ts
|
|
@@ -3502,80 +3678,80 @@ const accordionSystemSchema = z$1.object({
|
|
|
3502
3678
|
*
|
|
3503
3679
|
* Single configuration per theme (no variants needed for inputs)
|
|
3504
3680
|
*/
|
|
3505
|
-
const inputSystemSchema = z
|
|
3506
|
-
base: z
|
|
3507
|
-
background: z
|
|
3508
|
-
type: z
|
|
3681
|
+
const inputSystemSchema = z.object({
|
|
3682
|
+
base: z.object({
|
|
3683
|
+
background: z.union([z.object({
|
|
3684
|
+
type: z.literal("solid"),
|
|
3509
3685
|
colorToken: themeColorTokenSchema
|
|
3510
|
-
}), z
|
|
3686
|
+
}), z.object({ type: z.literal("transparent") })]),
|
|
3511
3687
|
textColorToken: themeColorTokenSchema,
|
|
3512
|
-
border: z
|
|
3513
|
-
widthClass: z
|
|
3688
|
+
border: z.object({
|
|
3689
|
+
widthClass: z.string(),
|
|
3514
3690
|
colorToken: themeColorTokenSchema,
|
|
3515
|
-
style: z
|
|
3691
|
+
style: z.enum(["all", "underline"]).optional()
|
|
3516
3692
|
}),
|
|
3517
|
-
corners: z
|
|
3693
|
+
corners: z.enum([
|
|
3518
3694
|
"square",
|
|
3519
3695
|
"soft",
|
|
3520
3696
|
"rounded",
|
|
3521
3697
|
"pill"
|
|
3522
3698
|
]).nullable(),
|
|
3523
|
-
shadow: z
|
|
3524
|
-
elevation: z
|
|
3699
|
+
shadow: z.object({
|
|
3700
|
+
elevation: z.enum([
|
|
3525
3701
|
"none",
|
|
3526
3702
|
"low",
|
|
3527
3703
|
"medium"
|
|
3528
3704
|
]),
|
|
3529
|
-
softness: z
|
|
3705
|
+
softness: z.enum([
|
|
3530
3706
|
"soft",
|
|
3531
3707
|
"crisp",
|
|
3532
3708
|
"hard"
|
|
3533
3709
|
]).nullable()
|
|
3534
3710
|
}).nullable(),
|
|
3535
|
-
spacing: z
|
|
3711
|
+
spacing: z.enum([
|
|
3536
3712
|
"compact",
|
|
3537
3713
|
"cozy",
|
|
3538
3714
|
"medium",
|
|
3539
3715
|
"comfortable"
|
|
3540
3716
|
]),
|
|
3541
|
-
fontSize: z
|
|
3717
|
+
fontSize: z.enum([
|
|
3542
3718
|
"sm",
|
|
3543
3719
|
"base",
|
|
3544
3720
|
"lg"
|
|
3545
3721
|
])
|
|
3546
3722
|
}),
|
|
3547
|
-
label: z
|
|
3723
|
+
label: z.object({
|
|
3548
3724
|
textColorToken: themeColorTokenSchema,
|
|
3549
|
-
fontWeight: z
|
|
3725
|
+
fontWeight: z.enum([
|
|
3550
3726
|
"regular",
|
|
3551
3727
|
"medium",
|
|
3552
3728
|
"semibold",
|
|
3553
3729
|
"bold",
|
|
3554
3730
|
"black"
|
|
3555
3731
|
]),
|
|
3556
|
-
fontSize: z
|
|
3732
|
+
fontSize: z.enum([
|
|
3557
3733
|
"2xs",
|
|
3558
3734
|
"xs",
|
|
3559
3735
|
"sm",
|
|
3560
3736
|
"base"
|
|
3561
3737
|
]),
|
|
3562
|
-
textTransform: z
|
|
3738
|
+
textTransform: z.enum([
|
|
3563
3739
|
"none",
|
|
3564
3740
|
"uppercase",
|
|
3565
3741
|
"lowercase",
|
|
3566
3742
|
"capitalize"
|
|
3567
3743
|
]).optional(),
|
|
3568
|
-
letterSpacing: z
|
|
3744
|
+
letterSpacing: z.enum([
|
|
3569
3745
|
"normal",
|
|
3570
3746
|
"wide",
|
|
3571
3747
|
"wider",
|
|
3572
3748
|
"widest"
|
|
3573
3749
|
]).optional(),
|
|
3574
|
-
opacity: z
|
|
3750
|
+
opacity: z.number().min(.2).max(1).optional()
|
|
3575
3751
|
}),
|
|
3576
|
-
focus: z
|
|
3752
|
+
focus: z.object({
|
|
3577
3753
|
ringColorToken: themeColorTokenSchema,
|
|
3578
|
-
ringWidth: z
|
|
3754
|
+
ringWidth: z.enum([
|
|
3579
3755
|
"0",
|
|
3580
3756
|
"1",
|
|
3581
3757
|
"2",
|
|
@@ -3583,14 +3759,14 @@ const inputSystemSchema = z$1.object({
|
|
|
3583
3759
|
]),
|
|
3584
3760
|
borderColorToken: themeColorTokenSchema.optional()
|
|
3585
3761
|
}),
|
|
3586
|
-
error: z
|
|
3762
|
+
error: z.object({
|
|
3587
3763
|
borderColorToken: themeColorTokenSchema,
|
|
3588
3764
|
textColorToken: themeColorTokenSchema
|
|
3589
3765
|
}),
|
|
3590
|
-
disabled: z
|
|
3766
|
+
disabled: z.object({
|
|
3591
3767
|
backgroundColorToken: themeColorTokenSchema,
|
|
3592
3768
|
textColorToken: themeColorTokenSchema,
|
|
3593
|
-
opacity: z
|
|
3769
|
+
opacity: z.number().min(.3).max(.7)
|
|
3594
3770
|
})
|
|
3595
3771
|
});
|
|
3596
3772
|
//#endregion
|
|
@@ -3601,9 +3777,9 @@ const inputSystemSchema = z$1.object({
|
|
|
3601
3777
|
/**
|
|
3602
3778
|
* Gradient color stop
|
|
3603
3779
|
*/
|
|
3604
|
-
const gradientStopSchema = z
|
|
3780
|
+
const gradientStopSchema = z.object({
|
|
3605
3781
|
color: themeColorTokenSchema,
|
|
3606
|
-
position: z
|
|
3782
|
+
position: z.number().min(0).max(100)
|
|
3607
3783
|
});
|
|
3608
3784
|
/**
|
|
3609
3785
|
* Radial gradient shape. Optional; defaults to `circle` (the historical shape)
|
|
@@ -3612,7 +3788,7 @@ const gradientStopSchema = z$1.object({
|
|
|
3612
3788
|
* Named `RadialGradientShape` to avoid clashing with `styles/gradients.ts`'s
|
|
3613
3789
|
* `GradientShape` (which names the gradient *kind*: linear/radial/conic).
|
|
3614
3790
|
*/
|
|
3615
|
-
const radialGradientShapeSchema = z
|
|
3791
|
+
const radialGradientShapeSchema = z.enum(["circle", "ellipse"]);
|
|
3616
3792
|
/**
|
|
3617
3793
|
* Gradient configuration.
|
|
3618
3794
|
*
|
|
@@ -3623,16 +3799,16 @@ const radialGradientShapeSchema = z$1.enum(["circle", "ellipse"]);
|
|
|
3623
3799
|
* - radial: optional `shape` (circle/ellipse) + `position`
|
|
3624
3800
|
* - conic: optional `angle` (from-angle, degrees) + `position`
|
|
3625
3801
|
*/
|
|
3626
|
-
const gradientConfigSchema = z
|
|
3627
|
-
type: z
|
|
3802
|
+
const gradientConfigSchema = z.object({
|
|
3803
|
+
type: z.enum([
|
|
3628
3804
|
"linear",
|
|
3629
3805
|
"radial",
|
|
3630
3806
|
"conic"
|
|
3631
3807
|
]).default("linear"),
|
|
3632
|
-
angle: z
|
|
3808
|
+
angle: z.number().min(0).max(360).optional(),
|
|
3633
3809
|
shape: radialGradientShapeSchema.optional(),
|
|
3634
|
-
position: z
|
|
3635
|
-
stops: z
|
|
3810
|
+
position: z.string().optional(),
|
|
3811
|
+
stops: z.array(gradientStopSchema).min(2)
|
|
3636
3812
|
});
|
|
3637
3813
|
//#endregion
|
|
3638
3814
|
//#region ../theme-core/src/interactive/baseSchema.ts
|
|
@@ -3644,46 +3820,46 @@ const gradientConfigSchema = z$1.object({
|
|
|
3644
3820
|
/**
|
|
3645
3821
|
* Typography settings shared by buttons and nav links
|
|
3646
3822
|
*/
|
|
3647
|
-
const interactiveTypographySchema = z
|
|
3823
|
+
const interactiveTypographySchema = z.object({
|
|
3648
3824
|
/** Font family source */
|
|
3649
|
-
typography: z
|
|
3825
|
+
typography: z.enum(["body", "heading"]).default("body"),
|
|
3650
3826
|
/** Font weight */
|
|
3651
|
-
fontWeight: z
|
|
3827
|
+
fontWeight: z.enum([
|
|
3652
3828
|
"regular",
|
|
3653
3829
|
"medium",
|
|
3654
3830
|
"semibold",
|
|
3655
3831
|
"bold"
|
|
3656
3832
|
]).default("medium"),
|
|
3657
3833
|
/** Text transform */
|
|
3658
|
-
textTransform: z
|
|
3834
|
+
textTransform: z.enum([
|
|
3659
3835
|
"none",
|
|
3660
3836
|
"uppercase",
|
|
3661
3837
|
"capitalize"
|
|
3662
3838
|
]).default("none"),
|
|
3663
3839
|
/** Italic style */
|
|
3664
|
-
italic: z
|
|
3840
|
+
italic: z.boolean().default(false)
|
|
3665
3841
|
});
|
|
3666
3842
|
/**
|
|
3667
3843
|
* Effect application reference (shared between buttons and nav)
|
|
3668
3844
|
*/
|
|
3669
|
-
const effectApplicationSchema = z
|
|
3845
|
+
const effectApplicationSchema = z.object({
|
|
3670
3846
|
/** Effect preset ID */
|
|
3671
|
-
effectId: z
|
|
3847
|
+
effectId: z.string(),
|
|
3672
3848
|
/** User-provided customization options */
|
|
3673
|
-
options: z
|
|
3849
|
+
options: z.record(z.string(), z.any()).optional()
|
|
3674
3850
|
});
|
|
3675
3851
|
/**
|
|
3676
3852
|
* Effect composition by state (shared pattern)
|
|
3677
3853
|
*/
|
|
3678
|
-
const effectCompositionSchema = z
|
|
3854
|
+
const effectCompositionSchema = z.object({
|
|
3679
3855
|
/** Effects always applied */
|
|
3680
|
-
base: z
|
|
3856
|
+
base: z.array(effectApplicationSchema).optional(),
|
|
3681
3857
|
/** Effects applied on hover */
|
|
3682
|
-
hover: z
|
|
3858
|
+
hover: z.array(effectApplicationSchema).optional(),
|
|
3683
3859
|
/** Effects applied on active/pressed */
|
|
3684
|
-
active: z
|
|
3860
|
+
active: z.array(effectApplicationSchema).optional(),
|
|
3685
3861
|
/** Effects applied on focus */
|
|
3686
|
-
focus: z
|
|
3862
|
+
focus: z.array(effectApplicationSchema).optional()
|
|
3687
3863
|
});
|
|
3688
3864
|
//#endregion
|
|
3689
3865
|
//#region ../theme-core/src/navigation/types.ts
|
|
@@ -3695,7 +3871,7 @@ const effectCompositionSchema = z$1.object({
|
|
|
3695
3871
|
/**
|
|
3696
3872
|
* Padding preset options for nav links
|
|
3697
3873
|
*/
|
|
3698
|
-
const navLinkPaddingSchema = z
|
|
3874
|
+
const navLinkPaddingSchema = z.enum([
|
|
3699
3875
|
"none",
|
|
3700
3876
|
"compact",
|
|
3701
3877
|
"default"
|
|
@@ -3704,7 +3880,7 @@ const navLinkPaddingSchema = z$1.enum([
|
|
|
3704
3880
|
* Horizontal padding override for nav links.
|
|
3705
3881
|
* When set, overrides only the horizontal component of the `padding` preset.
|
|
3706
3882
|
*/
|
|
3707
|
-
const navLinkPaddingXSchema = z
|
|
3883
|
+
const navLinkPaddingXSchema = z.enum([
|
|
3708
3884
|
"none",
|
|
3709
3885
|
"tight",
|
|
3710
3886
|
"compact",
|
|
@@ -3715,7 +3891,7 @@ const navLinkPaddingXSchema = z$1.enum([
|
|
|
3715
3891
|
/**
|
|
3716
3892
|
* Border radius options for nav links
|
|
3717
3893
|
*/
|
|
3718
|
-
const navLinkBorderRadiusSchema = z
|
|
3894
|
+
const navLinkBorderRadiusSchema = z.enum([
|
|
3719
3895
|
"none",
|
|
3720
3896
|
"sm",
|
|
3721
3897
|
"md",
|
|
@@ -3724,7 +3900,7 @@ const navLinkBorderRadiusSchema = z$1.enum([
|
|
|
3724
3900
|
/**
|
|
3725
3901
|
* Typography size options for nav links.
|
|
3726
3902
|
*/
|
|
3727
|
-
const navLinkTextSizeSchema = z
|
|
3903
|
+
const navLinkTextSizeSchema = z.enum([
|
|
3728
3904
|
"xs",
|
|
3729
3905
|
"sm",
|
|
3730
3906
|
"base",
|
|
@@ -3734,7 +3910,7 @@ const navLinkTextSizeSchema = z$1.enum([
|
|
|
3734
3910
|
/**
|
|
3735
3911
|
* Letter spacing options for nav links.
|
|
3736
3912
|
*/
|
|
3737
|
-
const navLinkLetterSpacingSchema = z
|
|
3913
|
+
const navLinkLetterSpacingSchema = z.enum([
|
|
3738
3914
|
"normal",
|
|
3739
3915
|
"wide",
|
|
3740
3916
|
"wider",
|
|
@@ -3743,15 +3919,15 @@ const navLinkLetterSpacingSchema = z$1.enum([
|
|
|
3743
3919
|
/**
|
|
3744
3920
|
* Optional legibility aid for nav text that floats over uncertain imagery or color.
|
|
3745
3921
|
*/
|
|
3746
|
-
const navLinkContrastTreatmentSchema = z
|
|
3922
|
+
const navLinkContrastTreatmentSchema = z.enum(["none", "soft-glow"]);
|
|
3747
3923
|
/**
|
|
3748
3924
|
* Nav link style schema
|
|
3749
3925
|
*
|
|
3750
3926
|
* Extends interactive typography base with nav-specific settings.
|
|
3751
3927
|
*/
|
|
3752
|
-
const navLinkStyleSchema = z
|
|
3928
|
+
const navLinkStyleSchema = z.object({
|
|
3753
3929
|
/** Display name for the style */
|
|
3754
|
-
name: z
|
|
3930
|
+
name: z.string().min(1).max(30).optional(),
|
|
3755
3931
|
/** Typography settings (inherited from interactive base) */
|
|
3756
3932
|
...interactiveTypographySchema.shape,
|
|
3757
3933
|
/** Text color token */
|
|
@@ -3836,7 +4012,7 @@ function containsForbiddenSelector(selector) {
|
|
|
3836
4012
|
/**
|
|
3837
4013
|
* Validates a CSS selector for safety.
|
|
3838
4014
|
*/
|
|
3839
|
-
const selectorSchema = z
|
|
4015
|
+
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" });
|
|
3840
4016
|
/**
|
|
3841
4017
|
* Check if a CSS value contains a remote URL.
|
|
3842
4018
|
*/
|
|
@@ -3854,31 +4030,31 @@ function containsJavascriptUrl(value) {
|
|
|
3854
4030
|
* Allows: url(#id), url(data:...), url(/path), var(--)
|
|
3855
4031
|
* Forbids: url(http...), url(//...), javascript:
|
|
3856
4032
|
*/
|
|
3857
|
-
const declarationValueSchema = z
|
|
4033
|
+
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" });
|
|
3858
4034
|
/**
|
|
3859
4035
|
* Schema for CSS declarations object (property -> value map).
|
|
3860
4036
|
*/
|
|
3861
|
-
const declarationsSchema = z
|
|
4037
|
+
const declarationsSchema = z.record(z.string().min(1).max(100), declarationValueSchema);
|
|
3862
4038
|
/**
|
|
3863
4039
|
* Schema for a single custom CSS rule.
|
|
3864
4040
|
*/
|
|
3865
|
-
const customCssRuleSchema = z
|
|
3866
|
-
id: z
|
|
4041
|
+
const customCssRuleSchema = z.object({
|
|
4042
|
+
id: z.string().min(1, "Rule ID is required").max(50, "Rule ID too long"),
|
|
3867
4043
|
selector: selectorSchema,
|
|
3868
4044
|
declarations: declarationsSchema
|
|
3869
4045
|
});
|
|
3870
4046
|
/**
|
|
3871
4047
|
* Schema for block-specific CSS rule.
|
|
3872
4048
|
*/
|
|
3873
|
-
const blockCustomCssRuleSchema = customCssRuleSchema.extend({ blockKind: z
|
|
4049
|
+
const blockCustomCssRuleSchema = customCssRuleSchema.extend({ blockKind: z.string().min(1, "Block kind is required").max(50, "Block kind too long") });
|
|
3874
4050
|
/**
|
|
3875
4051
|
* Array of custom CSS rules for theme-level styling.
|
|
3876
4052
|
*/
|
|
3877
|
-
const customCssRulesSchema = z
|
|
4053
|
+
const customCssRulesSchema = z.array(customCssRuleSchema).optional();
|
|
3878
4054
|
/**
|
|
3879
4055
|
* Array of block-specific CSS rules.
|
|
3880
4056
|
*/
|
|
3881
|
-
const blockCustomCssRulesSchema = z
|
|
4057
|
+
const blockCustomCssRulesSchema = z.array(blockCustomCssRuleSchema).optional();
|
|
3882
4058
|
function toValidatedCssSelector(value) {
|
|
3883
4059
|
return value;
|
|
3884
4060
|
}
|
|
@@ -3916,9 +4092,9 @@ const BLOCKED_AT_RULES = ["@import", "@charset"];
|
|
|
3916
4092
|
/** Pattern to detect blocked at-rules */
|
|
3917
4093
|
const BLOCKED_AT_RULE_PATTERN = /@(?:import|charset)\b/i;
|
|
3918
4094
|
/** Rule ID schema - reused from main validation */
|
|
3919
|
-
const ruleIdSchema = z
|
|
4095
|
+
const ruleIdSchema = z.string().min(1, "Rule ID is required").max(50, "Rule ID too long");
|
|
3920
4096
|
/** Nested rule schema for @media and @supports */
|
|
3921
|
-
const nestedRuleSchema = z
|
|
4097
|
+
const nestedRuleSchema = z.object({
|
|
3922
4098
|
selector: selectorSchema,
|
|
3923
4099
|
declarations: declarationsSchema
|
|
3924
4100
|
});
|
|
@@ -3935,46 +4111,46 @@ function isValidKeyframeOffset(offset) {
|
|
|
3935
4111
|
return value >= 0 && value <= 100;
|
|
3936
4112
|
}
|
|
3937
4113
|
/** Keyframe offset validation (0%, 50%, 100%, from, to) */
|
|
3938
|
-
const keyframeOffsetSchema = z
|
|
4114
|
+
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%" });
|
|
3939
4115
|
/** Animation name validation (CSS identifier) */
|
|
3940
|
-
const animationNameSchema = z
|
|
4116
|
+
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)" });
|
|
3941
4117
|
/** Single keyframe (offset + declarations) */
|
|
3942
|
-
const keyframeSchema = z
|
|
4118
|
+
const keyframeSchema = z.object({
|
|
3943
4119
|
offset: keyframeOffsetSchema,
|
|
3944
4120
|
declarations: declarationsSchema
|
|
3945
4121
|
});
|
|
3946
4122
|
/** @keyframes rule schema */
|
|
3947
|
-
const keyframesAtRuleSchema = z
|
|
4123
|
+
const keyframesAtRuleSchema = z.object({
|
|
3948
4124
|
id: ruleIdSchema,
|
|
3949
|
-
type: z
|
|
4125
|
+
type: z.literal("keyframes"),
|
|
3950
4126
|
name: animationNameSchema,
|
|
3951
|
-
frames: z
|
|
4127
|
+
frames: z.array(keyframeSchema).min(1, "At least one keyframe is required")
|
|
3952
4128
|
});
|
|
3953
4129
|
/** Font-face declarations - uses standard declarations but with font-specific validation */
|
|
3954
|
-
const fontFaceDeclarationsSchema = z
|
|
4130
|
+
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" });
|
|
3955
4131
|
/** @font-face rule schema */
|
|
3956
|
-
const fontFaceAtRuleSchema = z
|
|
4132
|
+
const fontFaceAtRuleSchema = z.object({
|
|
3957
4133
|
id: ruleIdSchema,
|
|
3958
|
-
type: z
|
|
4134
|
+
type: z.literal("font-face"),
|
|
3959
4135
|
declarations: fontFaceDeclarationsSchema
|
|
3960
4136
|
});
|
|
3961
4137
|
/** Media query string validation */
|
|
3962
|
-
const mediaQuerySchema = z
|
|
4138
|
+
const mediaQuerySchema = z.string().min(1, "Media query is required").max(200, "Media query too long");
|
|
3963
4139
|
/** @media rule schema */
|
|
3964
|
-
const mediaAtRuleSchema = z
|
|
4140
|
+
const mediaAtRuleSchema = z.object({
|
|
3965
4141
|
id: ruleIdSchema,
|
|
3966
|
-
type: z
|
|
4142
|
+
type: z.literal("media"),
|
|
3967
4143
|
query: mediaQuerySchema,
|
|
3968
|
-
rules: z
|
|
4144
|
+
rules: z.array(nestedRuleSchema).min(1, "At least one rule is required")
|
|
3969
4145
|
});
|
|
3970
4146
|
/** Supports condition string validation */
|
|
3971
|
-
const supportsConditionSchema = z
|
|
4147
|
+
const supportsConditionSchema = z.string().min(1, "Supports condition is required").max(200, "Supports condition too long");
|
|
3972
4148
|
/** @supports rule schema */
|
|
3973
|
-
const supportsAtRuleSchema = z
|
|
4149
|
+
const supportsAtRuleSchema = z.object({
|
|
3974
4150
|
id: ruleIdSchema,
|
|
3975
|
-
type: z
|
|
4151
|
+
type: z.literal("supports"),
|
|
3976
4152
|
condition: supportsConditionSchema,
|
|
3977
|
-
rules: z
|
|
4153
|
+
rules: z.array(nestedRuleSchema).min(1, "At least one rule is required")
|
|
3978
4154
|
});
|
|
3979
4155
|
/**
|
|
3980
4156
|
* Check if raw CSS contains blocked at-rules.
|
|
@@ -3983,17 +4159,17 @@ function containsBlockedAtRule(css) {
|
|
|
3983
4159
|
return BLOCKED_AT_RULE_PATTERN.test(css);
|
|
3984
4160
|
}
|
|
3985
4161
|
/** Raw CSS validation - blocks @import, @charset, must start with @ */
|
|
3986
|
-
const rawCssSchema = z
|
|
4162
|
+
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.` });
|
|
3987
4163
|
/** Raw at-rule schema */
|
|
3988
|
-
const rawAtRuleSchema = z
|
|
4164
|
+
const rawAtRuleSchema = z.object({
|
|
3989
4165
|
id: ruleIdSchema,
|
|
3990
|
-
type: z
|
|
4166
|
+
type: z.literal("raw"),
|
|
3991
4167
|
css: rawCssSchema
|
|
3992
4168
|
});
|
|
3993
4169
|
/**
|
|
3994
4170
|
* Discriminated union schema for all at-rule types.
|
|
3995
4171
|
*/
|
|
3996
|
-
const customCssAtRuleSchema = z
|
|
4172
|
+
const customCssAtRuleSchema = z.discriminatedUnion("type", [
|
|
3997
4173
|
keyframesAtRuleSchema,
|
|
3998
4174
|
fontFaceAtRuleSchema,
|
|
3999
4175
|
mediaAtRuleSchema,
|
|
@@ -4003,7 +4179,7 @@ const customCssAtRuleSchema = z$1.discriminatedUnion("type", [
|
|
|
4003
4179
|
/**
|
|
4004
4180
|
* Array of at-rules for theme-level styling.
|
|
4005
4181
|
*/
|
|
4006
|
-
const customCssAtRulesSchema = z
|
|
4182
|
+
const customCssAtRulesSchema = z.array(customCssAtRuleSchema).optional();
|
|
4007
4183
|
//#endregion
|
|
4008
4184
|
//#region ../theme-core/src/shared/componentStyles.ts
|
|
4009
4185
|
/**
|
|
@@ -4021,22 +4197,22 @@ const customCssAtRulesSchema = z$1.array(customCssAtRuleSchema).optional();
|
|
|
4021
4197
|
* Shared border schema for themed components.
|
|
4022
4198
|
* Position is excluded - each component determines its own border position.
|
|
4023
4199
|
*/
|
|
4024
|
-
const componentBorderSchema = z
|
|
4025
|
-
width: z
|
|
4200
|
+
const componentBorderSchema = z.object({
|
|
4201
|
+
width: z.enum([
|
|
4026
4202
|
"none",
|
|
4027
4203
|
"hairline",
|
|
4028
4204
|
"thin",
|
|
4029
4205
|
"medium",
|
|
4030
4206
|
"thick"
|
|
4031
4207
|
]).default("none"),
|
|
4032
|
-
style: z
|
|
4208
|
+
style: z.enum(["solid", "dashed"]).default("solid"),
|
|
4033
4209
|
colorToken: themeColorTokenSchema.optional()
|
|
4034
4210
|
});
|
|
4035
4211
|
/**
|
|
4036
4212
|
* Shared shadow schema for themed components.
|
|
4037
4213
|
* Softness is inherited from global theme, not configurable per-component.
|
|
4038
4214
|
*/
|
|
4039
|
-
const componentShadowSchema = z
|
|
4215
|
+
const componentShadowSchema = z.object({ elevation: z.enum([
|
|
4040
4216
|
"none",
|
|
4041
4217
|
"sm",
|
|
4042
4218
|
"md",
|
|
@@ -4070,9 +4246,6 @@ function asSiteStyleId(value) {
|
|
|
4070
4246
|
function asDesignSystemTemplateId(value) {
|
|
4071
4247
|
return brandNonEmptyString(value, "DesignSystemTemplateId");
|
|
4072
4248
|
}
|
|
4073
|
-
function assertNever(value, message = "Unhandled Theme V2 variant") {
|
|
4074
|
-
throw new Error(`${message}: ${String(value)}`);
|
|
4075
|
-
}
|
|
4076
4249
|
function brandNonEmptyString(value, label) {
|
|
4077
4250
|
if (value.length === 0) throw new Error(`${label} must be a non-empty string.`);
|
|
4078
4251
|
return value;
|
|
@@ -4168,43 +4341,43 @@ const logoDensityValues = [
|
|
|
4168
4341
|
"detailed",
|
|
4169
4342
|
"unknown"
|
|
4170
4343
|
];
|
|
4171
|
-
const logoContainsTextSchema = z
|
|
4172
|
-
z
|
|
4173
|
-
kind: z
|
|
4174
|
-
confidence: z
|
|
4175
|
-
text: z
|
|
4344
|
+
const logoContainsTextSchema = z.discriminatedUnion("kind", [
|
|
4345
|
+
z.object({
|
|
4346
|
+
kind: z.literal("contains-text"),
|
|
4347
|
+
confidence: z.enum(logoTextConfidenceValues),
|
|
4348
|
+
text: z.string().trim().min(1).max(200).optional()
|
|
4176
4349
|
}),
|
|
4177
|
-
z
|
|
4178
|
-
kind: z
|
|
4179
|
-
confidence: z
|
|
4350
|
+
z.object({
|
|
4351
|
+
kind: z.literal("no-text"),
|
|
4352
|
+
confidence: z.enum(logoTextConfidenceValues)
|
|
4180
4353
|
}),
|
|
4181
|
-
z
|
|
4182
|
-
kind: z
|
|
4183
|
-
reason: z
|
|
4354
|
+
z.object({
|
|
4355
|
+
kind: z.literal("unknown"),
|
|
4356
|
+
reason: z.enum([
|
|
4184
4357
|
"analysis-unavailable",
|
|
4185
4358
|
"unsupported-file",
|
|
4186
4359
|
"low-confidence"
|
|
4187
4360
|
])
|
|
4188
4361
|
})
|
|
4189
4362
|
]);
|
|
4190
|
-
const logoAnalysisSourceSchema = z
|
|
4191
|
-
z
|
|
4192
|
-
z
|
|
4193
|
-
kind: z
|
|
4194
|
-
reason: z
|
|
4363
|
+
const logoAnalysisSourceSchema = z.discriminatedUnion("kind", [
|
|
4364
|
+
z.object({ kind: z.literal("none") }),
|
|
4365
|
+
z.object({
|
|
4366
|
+
kind: z.literal("deterministic"),
|
|
4367
|
+
reason: z.enum(["dimensions", "fallback"])
|
|
4195
4368
|
}),
|
|
4196
|
-
z
|
|
4197
|
-
kind: z
|
|
4198
|
-
model: z
|
|
4199
|
-
analyzedAt: z
|
|
4369
|
+
z.object({
|
|
4370
|
+
kind: z.literal("llm"),
|
|
4371
|
+
model: z.literal("gpt-5.4-mini"),
|
|
4372
|
+
analyzedAt: z.string().trim().min(1).max(80).optional()
|
|
4200
4373
|
}),
|
|
4201
|
-
z
|
|
4374
|
+
z.object({ kind: z.literal("manual-override") })
|
|
4202
4375
|
]);
|
|
4203
|
-
z
|
|
4204
|
-
shape: z
|
|
4376
|
+
z.object({
|
|
4377
|
+
shape: z.enum(logoAssetShapeValues),
|
|
4205
4378
|
containsText: logoContainsTextSchema,
|
|
4206
|
-
kind: z
|
|
4207
|
-
density: z
|
|
4379
|
+
kind: z.enum(logoKindValues),
|
|
4380
|
+
density: z.enum(logoDensityValues),
|
|
4208
4381
|
source: logoAnalysisSourceSchema
|
|
4209
4382
|
});
|
|
4210
4383
|
const brandDisplayModeValues = [
|
|
@@ -4251,63 +4424,6 @@ new Set(themeV2NormalEditorRawStyleFieldNames);
|
|
|
4251
4424
|
[...themeV2RuntimeStyleFieldNames, ...themeV2BlockSpecificRawStyleFieldNames];
|
|
4252
4425
|
const pageDesignEditorBackgroundOverrideOwner = "page-design-editor";
|
|
4253
4426
|
const siteChromeBackgroundOverrideOwner = "site-chrome-editor";
|
|
4254
|
-
//#endregion
|
|
4255
|
-
//#region ../theme-core/src/utils/colorStyles.ts
|
|
4256
|
-
const COLOR_VAR_PREFIX = "--tb-";
|
|
4257
|
-
function parseToken(source) {
|
|
4258
|
-
const parts = parseColorTokenParts(source);
|
|
4259
|
-
if (parts.kind === "raw") return {
|
|
4260
|
-
token: source,
|
|
4261
|
-
raw: parts.value
|
|
4262
|
-
};
|
|
4263
|
-
if (parts.kind === "invalid") return { token: source };
|
|
4264
|
-
return {
|
|
4265
|
-
token: parts.token,
|
|
4266
|
-
opacityPercent: parts.opacityPercent === null ? void 0 : parts.opacityPercent
|
|
4267
|
-
};
|
|
4268
|
-
}
|
|
4269
|
-
/**
|
|
4270
|
-
* Converts a theme color token to a CSS rgb value.
|
|
4271
|
-
* This is the primary function for applying theme colors to CSS properties.
|
|
4272
|
-
*
|
|
4273
|
-
* @param token - Theme color token (semantic, with opacity, or raw)
|
|
4274
|
-
* @returns CSS color value (rgb with optional alpha, or raw CSS value)
|
|
4275
|
-
*
|
|
4276
|
-
* @example
|
|
4277
|
-
* rgbColorValue('primary') // => 'rgb(var(--tb-primary))'
|
|
4278
|
-
* rgbColorValue('surface/95') // => 'rgb(var(--tb-surface) / 0.95)'
|
|
4279
|
-
* rgbColorValue('raw:transparent') // => 'transparent'
|
|
4280
|
-
*/
|
|
4281
|
-
function rgbColorValue(token) {
|
|
4282
|
-
const { token: baseToken, opacityPercent, raw } = parseToken(token);
|
|
4283
|
-
if (raw) return raw;
|
|
4284
|
-
const cssVar = `${COLOR_VAR_PREFIX}${baseToken}`;
|
|
4285
|
-
if (opacityPercent === void 0) return `rgb(var(${cssVar}))`;
|
|
4286
|
-
return `rgb(var(${cssVar}) / ${opacityPercent / 100})`;
|
|
4287
|
-
}
|
|
4288
|
-
/**
|
|
4289
|
-
* Converts a theme color token to a CSS variable reference.
|
|
4290
|
-
* Note: This returns the base variable without rgb() wrapper, ignoring opacity.
|
|
4291
|
-
*
|
|
4292
|
-
* @param token - Theme color token
|
|
4293
|
-
* @returns CSS variable reference
|
|
4294
|
-
*
|
|
4295
|
-
* @example
|
|
4296
|
-
* cssVarValue('primary') // => 'var(--tb-primary)'
|
|
4297
|
-
* cssVarValue('surface/95') // => 'var(--tb-surface)' (opacity ignored)
|
|
4298
|
-
*/
|
|
4299
|
-
function cssVarValue(token) {
|
|
4300
|
-
const { token: baseToken } = parseToken(token);
|
|
4301
|
-
return `var(${COLOR_VAR_PREFIX}${baseToken})`;
|
|
4302
|
-
}
|
|
4303
|
-
//#endregion
|
|
4304
|
-
//#region ../theme-core/src/utils/tokenOrColor.ts
|
|
4305
|
-
/**
|
|
4306
|
-
* Runtime color-reference fields intentionally accept any string, including
|
|
4307
|
-
* the legacy empty-string "no color" sentinel. Semantic validation needs
|
|
4308
|
-
* palette context and happens in `parseThemeColorReference`.
|
|
4309
|
-
*/
|
|
4310
|
-
const tokenOrCssColorValueSchema = z$1.string();
|
|
4311
4427
|
const BREAKPOINT_LG = 1024;
|
|
4312
4428
|
const BREAKPOINT_XL = 1280;
|
|
4313
4429
|
const BREAKPOINT_LG_DOWN = BREAKPOINT_LG - 1;
|
|
@@ -4332,14 +4448,14 @@ mqDown(640);
|
|
|
4332
4448
|
mqDown(768);
|
|
4333
4449
|
//#endregion
|
|
4334
4450
|
//#region ../theme-core/src/header/scrollTreatment.ts
|
|
4335
|
-
const headerScrollTreatmentSchema = z
|
|
4336
|
-
kind: z
|
|
4337
|
-
backgroundTone: z
|
|
4451
|
+
const headerScrollTreatmentSchema = z.discriminatedUnion("kind", [z.object({
|
|
4452
|
+
kind: z.literal("contrast-glass"),
|
|
4453
|
+
backgroundTone: z.enum(["light", "dark"])
|
|
4338
4454
|
})]).optional();
|
|
4339
4455
|
//#endregion
|
|
4340
4456
|
//#region ../theme-core/src/header/containerSchema.ts
|
|
4341
|
-
const headerContainerSchema = z
|
|
4342
|
-
rounded: z
|
|
4457
|
+
const headerContainerSchema = z.object({
|
|
4458
|
+
rounded: z.enum([
|
|
4343
4459
|
"none",
|
|
4344
4460
|
"sm",
|
|
4345
4461
|
"md",
|
|
@@ -4347,77 +4463,146 @@ const headerContainerSchema = z$1.object({
|
|
|
4347
4463
|
"xl",
|
|
4348
4464
|
"2xl"
|
|
4349
4465
|
]).default("xl"),
|
|
4350
|
-
border: z
|
|
4351
|
-
shadow: z
|
|
4352
|
-
padding: z
|
|
4466
|
+
border: z.boolean().default(true),
|
|
4467
|
+
shadow: z.boolean().default(true),
|
|
4468
|
+
padding: z.enum([
|
|
4353
4469
|
"sm",
|
|
4354
4470
|
"md",
|
|
4355
4471
|
"lg"
|
|
4356
4472
|
]).default("md"),
|
|
4357
|
-
tint: z
|
|
4358
|
-
opacity: z
|
|
4473
|
+
tint: z.string().nullable().optional(),
|
|
4474
|
+
opacity: z.number().min(0).max(1).default(.12)
|
|
4359
4475
|
}).optional();
|
|
4360
|
-
const headerInteractionPaletteSchema = z
|
|
4476
|
+
const headerInteractionPaletteSchema = z.enum([
|
|
4361
4477
|
"primary",
|
|
4362
4478
|
"secondary",
|
|
4363
4479
|
"accent"
|
|
4364
4480
|
]);
|
|
4365
4481
|
//#endregion
|
|
4482
|
+
//#region ../theme-core/src/boxBackgroundSchema.ts
|
|
4483
|
+
const boxBackgroundOverlaySchema = z.preprocess(normalizeAuthoringOpacity, z.discriminatedUnion("type", [
|
|
4484
|
+
z.object({ type: z.literal("none") }),
|
|
4485
|
+
z.object({
|
|
4486
|
+
type: z.literal("color"),
|
|
4487
|
+
color: tokenOrCssColorValueSchema.nullable().optional(),
|
|
4488
|
+
opacity: z.number().min(0).max(1).nullable().optional()
|
|
4489
|
+
}),
|
|
4490
|
+
z.object({
|
|
4491
|
+
type: z.literal("gradient"),
|
|
4492
|
+
gradient: z.string().nullable().optional(),
|
|
4493
|
+
opacity: z.number().min(0).max(1).nullable().optional()
|
|
4494
|
+
})
|
|
4495
|
+
]));
|
|
4496
|
+
const commonSchema = z.object({
|
|
4497
|
+
contentOwner: z.literal(pageDesignEditorBackgroundOverrideOwner).optional(),
|
|
4498
|
+
textColor: tokenOrCssColorValueSchema.nullable().optional(),
|
|
4499
|
+
headingColor: tokenOrCssColorValueSchema.nullable().optional(),
|
|
4500
|
+
linkColor: tokenOrCssColorValueSchema.nullable().optional(),
|
|
4501
|
+
supportingColor: tokenOrCssColorValueSchema.nullable().optional()
|
|
4502
|
+
});
|
|
4503
|
+
const mediaPresentationSchema = commonSchema.extend({
|
|
4504
|
+
opacity: z.preprocess(normalizeOpacity, z.number().min(0).max(1).nullable()).optional(),
|
|
4505
|
+
objectFit: z.enum([
|
|
4506
|
+
"fill",
|
|
4507
|
+
"fit",
|
|
4508
|
+
"original",
|
|
4509
|
+
"custom"
|
|
4510
|
+
]).nullable().optional(),
|
|
4511
|
+
scale: z.string().nullable().optional(),
|
|
4512
|
+
position: z.string().nullable().optional(),
|
|
4513
|
+
motion: z.enum(["static", "fixed-frame"]).nullable().optional(),
|
|
4514
|
+
overflow: z.boolean().nullable().optional(),
|
|
4515
|
+
overlay: boxBackgroundOverlaySchema.nullable().optional()
|
|
4516
|
+
});
|
|
4517
|
+
const boxBackgroundSchema = z.discriminatedUnion("type", [
|
|
4518
|
+
commonSchema.extend({
|
|
4519
|
+
type: z.literal("color"),
|
|
4520
|
+
color: tokenOrCssColorValueSchema.nullable().optional()
|
|
4521
|
+
}),
|
|
4522
|
+
commonSchema.extend({
|
|
4523
|
+
type: z.literal("gradient"),
|
|
4524
|
+
gradient: z.string().nullable().optional(),
|
|
4525
|
+
gradientPresetId: z.string().min(1).nullable().optional()
|
|
4526
|
+
}),
|
|
4527
|
+
mediaPresentationSchema.extend({
|
|
4528
|
+
type: z.literal("image"),
|
|
4529
|
+
image: imageMediaSchema.nullable().optional()
|
|
4530
|
+
}),
|
|
4531
|
+
mediaPresentationSchema.extend({
|
|
4532
|
+
type: z.literal("video"),
|
|
4533
|
+
image: videoMediaSchema.nullable().optional(),
|
|
4534
|
+
showVideoOnMobile: z.boolean().nullable().optional()
|
|
4535
|
+
})
|
|
4536
|
+
]);
|
|
4537
|
+
function normalizeAuthoringOpacity(value) {
|
|
4538
|
+
if (!isRecord(value)) return value;
|
|
4539
|
+
return {
|
|
4540
|
+
...value,
|
|
4541
|
+
opacity: normalizeOpacity(value.opacity)
|
|
4542
|
+
};
|
|
4543
|
+
}
|
|
4544
|
+
function normalizeOpacity(value) {
|
|
4545
|
+
return typeof value === "number" && value > 1 && value <= 100 ? value / 100 : value;
|
|
4546
|
+
}
|
|
4547
|
+
function isRecord(value) {
|
|
4548
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
4549
|
+
}
|
|
4550
|
+
//#endregion
|
|
4366
4551
|
//#region ../theme-core/src/schema.ts
|
|
4367
|
-
const axesSchema = z
|
|
4368
|
-
tone: z
|
|
4552
|
+
const axesSchema = z.object({
|
|
4553
|
+
tone: z.enum([
|
|
4369
4554
|
"minimal",
|
|
4370
4555
|
"classic",
|
|
4371
4556
|
"bold"
|
|
4372
4557
|
]),
|
|
4373
|
-
energy: z
|
|
4374
|
-
density: z
|
|
4558
|
+
energy: z.enum(["calm", "vibrant"]),
|
|
4559
|
+
density: z.enum([
|
|
4375
4560
|
"airy",
|
|
4376
4561
|
"regular",
|
|
4377
4562
|
"compact"
|
|
4378
4563
|
]),
|
|
4379
|
-
mediaBias: z
|
|
4564
|
+
mediaBias: z.enum([
|
|
4380
4565
|
"text",
|
|
4381
4566
|
"media",
|
|
4382
4567
|
"mixed"
|
|
4383
4568
|
]),
|
|
4384
|
-
conversionBias: z
|
|
4569
|
+
conversionBias: z.enum([
|
|
4385
4570
|
"low",
|
|
4386
4571
|
"med",
|
|
4387
4572
|
"high"
|
|
4388
4573
|
]),
|
|
4389
|
-
motion: z
|
|
4574
|
+
motion: z.enum([
|
|
4390
4575
|
"subtle",
|
|
4391
4576
|
"standard",
|
|
4392
4577
|
"expressive"
|
|
4393
4578
|
])
|
|
4394
4579
|
});
|
|
4395
|
-
const typographyStyleSchema = z
|
|
4396
|
-
family: z
|
|
4397
|
-
weight: z
|
|
4580
|
+
const typographyStyleSchema = z.object({
|
|
4581
|
+
family: z.string().min(1),
|
|
4582
|
+
weight: z.enum([
|
|
4398
4583
|
"light",
|
|
4399
4584
|
"regular",
|
|
4400
4585
|
"medium",
|
|
4401
4586
|
"semibold",
|
|
4402
4587
|
"bold"
|
|
4403
4588
|
]),
|
|
4404
|
-
letterSpacing: z
|
|
4589
|
+
letterSpacing: z.enum([
|
|
4405
4590
|
"tight",
|
|
4406
4591
|
"normal",
|
|
4407
4592
|
"loose"
|
|
4408
4593
|
]),
|
|
4409
|
-
lineHeight: z
|
|
4594
|
+
lineHeight: z.enum([
|
|
4410
4595
|
"normal",
|
|
4411
4596
|
"relaxed",
|
|
4412
4597
|
"loose"
|
|
4413
4598
|
])
|
|
4414
4599
|
});
|
|
4415
|
-
const bodyTypographyStyleSchema = typographyStyleSchema.extend({ size: z
|
|
4600
|
+
const bodyTypographyStyleSchema = typographyStyleSchema.extend({ size: z.enum([
|
|
4416
4601
|
"md",
|
|
4417
4602
|
"lg",
|
|
4418
4603
|
"xl"
|
|
4419
4604
|
]) });
|
|
4420
|
-
const headingSizeSchema = z
|
|
4605
|
+
const headingSizeSchema = z.enum([
|
|
4421
4606
|
"xs",
|
|
4422
4607
|
"sm",
|
|
4423
4608
|
"md",
|
|
@@ -4425,68 +4610,68 @@ const headingSizeSchema = z$1.enum([
|
|
|
4425
4610
|
"xl",
|
|
4426
4611
|
"2xl"
|
|
4427
4612
|
]);
|
|
4428
|
-
const headingTypographyOverridesSchema = z
|
|
4429
|
-
weight: z
|
|
4613
|
+
const headingTypographyOverridesSchema = z.object({
|
|
4614
|
+
weight: z.enum([
|
|
4430
4615
|
"light",
|
|
4431
4616
|
"regular",
|
|
4432
4617
|
"medium",
|
|
4433
4618
|
"semibold",
|
|
4434
4619
|
"bold"
|
|
4435
4620
|
]).nullable().optional(),
|
|
4436
|
-
letterSpacing: z
|
|
4621
|
+
letterSpacing: z.enum([
|
|
4437
4622
|
"tight",
|
|
4438
4623
|
"normal",
|
|
4439
4624
|
"loose"
|
|
4440
4625
|
]).nullable().optional(),
|
|
4441
4626
|
size: headingSizeSchema.nullable().optional(),
|
|
4442
|
-
lineHeight: z
|
|
4627
|
+
lineHeight: z.enum([
|
|
4443
4628
|
"tight",
|
|
4444
4629
|
"snug",
|
|
4445
4630
|
"normal",
|
|
4446
4631
|
"relaxed",
|
|
4447
4632
|
"loose"
|
|
4448
4633
|
]).nullable().optional(),
|
|
4449
|
-
italic: z
|
|
4634
|
+
italic: z.boolean().nullable().optional(),
|
|
4450
4635
|
colorToken: themeColorTokenSchema.nullable().optional()
|
|
4451
4636
|
});
|
|
4452
4637
|
const headingTypographyStyleSchema = typographyStyleSchema.extend({
|
|
4453
|
-
case: z
|
|
4638
|
+
case: z.enum([
|
|
4454
4639
|
"uppercase",
|
|
4455
4640
|
"normal",
|
|
4456
4641
|
"smallCaps"
|
|
4457
4642
|
]).nullable(),
|
|
4458
|
-
italic: z
|
|
4643
|
+
italic: z.boolean().nullable(),
|
|
4459
4644
|
colorToken: themeColorTokenSchema.nullable().optional()
|
|
4460
4645
|
});
|
|
4461
|
-
const proseLinkUnderlineStyleSchema = z
|
|
4646
|
+
const proseLinkUnderlineStyleSchema = z.enum([
|
|
4462
4647
|
"solid",
|
|
4463
4648
|
"dotted",
|
|
4464
4649
|
"dashed"
|
|
4465
4650
|
]);
|
|
4466
|
-
const proseLinkUnderlineThicknessSchema = z
|
|
4651
|
+
const proseLinkUnderlineThicknessSchema = z.enum([
|
|
4467
4652
|
"auto",
|
|
4468
4653
|
"fromFont",
|
|
4469
4654
|
"thin",
|
|
4470
4655
|
"medium",
|
|
4471
4656
|
"thick"
|
|
4472
4657
|
]);
|
|
4473
|
-
const proseLinkUnderlineOffsetSchema = z
|
|
4658
|
+
const proseLinkUnderlineOffsetSchema = z.enum([
|
|
4474
4659
|
"auto",
|
|
4475
4660
|
"tight",
|
|
4476
4661
|
"normal",
|
|
4477
4662
|
"loose"
|
|
4478
4663
|
]);
|
|
4479
|
-
const proseLinkStyleSchema = z
|
|
4664
|
+
const proseLinkStyleSchema = z.object({
|
|
4480
4665
|
colorToken: themeColorTokenSchema.optional(),
|
|
4481
4666
|
hoverColorToken: themeColorTokenSchema.optional(),
|
|
4482
|
-
underline: z
|
|
4667
|
+
underline: z.boolean().optional(),
|
|
4483
4668
|
decorationColorToken: themeColorTokenSchema.optional(),
|
|
4484
4669
|
hoverDecorationColorToken: themeColorTokenSchema.optional(),
|
|
4485
4670
|
underlineStyle: proseLinkUnderlineStyleSchema.optional(),
|
|
4486
4671
|
underlineThickness: proseLinkUnderlineThicknessSchema.optional(),
|
|
4487
4672
|
underlineOffset: proseLinkUnderlineOffsetSchema.optional()
|
|
4488
4673
|
});
|
|
4489
|
-
const semanticSpacingSchema = z
|
|
4674
|
+
const semanticSpacingSchema = z.enum([
|
|
4490
4675
|
"none",
|
|
4491
4676
|
"compact",
|
|
4492
4677
|
"cozy",
|
|
@@ -4494,7 +4679,7 @@ const semanticSpacingSchema = z$1.enum([
|
|
|
4494
4679
|
"comfortable",
|
|
4495
4680
|
"spacious"
|
|
4496
4681
|
]);
|
|
4497
|
-
const boxRoundedSchema = z
|
|
4682
|
+
const boxRoundedSchema = z.enum([
|
|
4498
4683
|
"none",
|
|
4499
4684
|
"sm",
|
|
4500
4685
|
"md",
|
|
@@ -4503,82 +4688,45 @@ const boxRoundedSchema = z$1.enum([
|
|
|
4503
4688
|
"2xl",
|
|
4504
4689
|
"full"
|
|
4505
4690
|
]);
|
|
4506
|
-
const
|
|
4507
|
-
|
|
4508
|
-
|
|
4509
|
-
|
|
4510
|
-
"gradient"
|
|
4511
|
-
]).nullable().optional(),
|
|
4512
|
-
color: tokenOrCssColorValueSchema.nullable().optional(),
|
|
4513
|
-
gradient: z$1.string().nullable().optional(),
|
|
4514
|
-
opacity: z$1.number().min(0).max(1).nullable().optional()
|
|
4515
|
-
});
|
|
4516
|
-
const boxBackgroundSchema = z$1.object({
|
|
4517
|
-
type: z$1.enum([
|
|
4518
|
-
"color",
|
|
4519
|
-
"gradient",
|
|
4520
|
-
"image"
|
|
4521
|
-
]).optional(),
|
|
4522
|
-
contentOwner: z$1.literal(pageDesignEditorBackgroundOverrideOwner).optional(),
|
|
4523
|
-
color: tokenOrCssColorValueSchema.nullable().optional(),
|
|
4524
|
-
gradient: z$1.string().nullable().optional(),
|
|
4525
|
-
gradientPresetId: z$1.string().min(1).nullable().optional(),
|
|
4526
|
-
image: mediaSchema.nullable().optional(),
|
|
4527
|
-
objectFit: z$1.enum([
|
|
4528
|
-
"fill",
|
|
4529
|
-
"fit",
|
|
4530
|
-
"original",
|
|
4531
|
-
"custom"
|
|
4532
|
-
]).nullable().optional(),
|
|
4533
|
-
scale: z$1.string().nullable().optional(),
|
|
4534
|
-
position: z$1.string().nullable().optional(),
|
|
4535
|
-
opacity: z$1.number().min(0).max(1).nullable().optional(),
|
|
4536
|
-
motion: z$1.enum(["static", "fixed-frame"]).nullable().optional(),
|
|
4537
|
-
overlay: boxBackgroundOverlaySchema.nullable().optional(),
|
|
4538
|
-
textColor: tokenOrCssColorValueSchema.nullable().optional(),
|
|
4539
|
-
headingColor: tokenOrCssColorValueSchema.nullable().optional(),
|
|
4540
|
-
linkColor: tokenOrCssColorValueSchema.nullable().optional(),
|
|
4541
|
-
supportingColor: tokenOrCssColorValueSchema.nullable().optional()
|
|
4542
|
-
});
|
|
4543
|
-
const noHeadingDecorationSchema = z$1.object({ family: z$1.literal("none") });
|
|
4544
|
-
const visibleHeadingDecorationSchema = z$1.object({
|
|
4545
|
-
family: z$1.enum(visibleHeadingDecorationFamilyValues),
|
|
4546
|
-
colorToken: z$1.enum(headingDecorationColorTokenValues).optional()
|
|
4691
|
+
const noHeadingDecorationSchema = z.object({ family: z.literal("none") });
|
|
4692
|
+
const visibleHeadingDecorationSchema = z.object({
|
|
4693
|
+
family: z.enum(visibleHeadingDecorationFamilyValues),
|
|
4694
|
+
colorToken: z.enum(headingDecorationColorTokenValues).optional()
|
|
4547
4695
|
});
|
|
4548
|
-
const headingDecorationSchema = z
|
|
4549
|
-
const headingDecorationOverrideSchema = z
|
|
4550
|
-
const accordionIconTreatmentSchema = z
|
|
4551
|
-
iconSet: z
|
|
4552
|
-
colorToken: z
|
|
4553
|
-
openColorToken: z
|
|
4554
|
-
motion: z
|
|
4696
|
+
const headingDecorationSchema = z.union([noHeadingDecorationSchema, visibleHeadingDecorationSchema]);
|
|
4697
|
+
const headingDecorationOverrideSchema = z.union([z.enum(headingDecorationOverrideValues), z.literal("on").transform(() => "site-default")]);
|
|
4698
|
+
const accordionIconTreatmentSchema = z.object({
|
|
4699
|
+
iconSet: z.enum(accordionIconSetValues),
|
|
4700
|
+
colorToken: z.enum(accordionIconColorTokenValues),
|
|
4701
|
+
openColorToken: z.enum(accordionIconColorTokenValues).optional(),
|
|
4702
|
+
motion: z.enum(accordionIconMotionValues)
|
|
4555
4703
|
});
|
|
4556
|
-
const sectionStylesOverrideSchema = z
|
|
4704
|
+
const sectionStylesOverrideSchema = z.object({
|
|
4557
4705
|
background: boxBackgroundSchema.nullable().optional(),
|
|
4558
4706
|
spacing: semanticSpacingSchema.nullable().optional(),
|
|
4559
|
-
minHeight: z
|
|
4707
|
+
minHeight: z.enum([
|
|
4560
4708
|
"none",
|
|
4561
4709
|
"banner",
|
|
4562
4710
|
"hero",
|
|
4563
4711
|
"immersive"
|
|
4564
4712
|
]).nullable().optional(),
|
|
4565
|
-
tileTreatment: z
|
|
4566
|
-
eventListTreatment: z
|
|
4567
|
-
eyebrowTreatment: z
|
|
4713
|
+
tileTreatment: z.enum(tileTreatmentValues).nullable().optional(),
|
|
4714
|
+
eventListTreatment: z.enum(eventListTreatmentValues).nullable().optional(),
|
|
4715
|
+
eyebrowTreatment: z.enum(eyebrowTreatmentValues).nullable().optional(),
|
|
4568
4716
|
headingDecoration: headingDecorationSchema.nullable().optional(),
|
|
4569
4717
|
headingDecorationOverride: headingDecorationOverrideSchema.nullable().optional(),
|
|
4570
4718
|
accordionIconTreatment: accordionIconTreatmentSchema.nullable().optional()
|
|
4571
4719
|
});
|
|
4572
|
-
const containerStylesOverrideSchema = z
|
|
4720
|
+
const containerStylesOverrideSchema = z.object({
|
|
4573
4721
|
background: boxBackgroundSchema.nullable().optional(),
|
|
4574
4722
|
spacing: semanticSpacingSchema.nullable().optional(),
|
|
4575
|
-
raised: z
|
|
4723
|
+
raised: z.boolean().nullable().optional(),
|
|
4576
4724
|
rounded: boxRoundedSchema.nullable().optional(),
|
|
4577
|
-
fullWidth: z
|
|
4725
|
+
fullWidth: z.boolean().nullable().optional()
|
|
4578
4726
|
});
|
|
4579
|
-
const cardBorderOverrideSchema = z
|
|
4580
|
-
enabled: z
|
|
4581
|
-
width: z
|
|
4727
|
+
const cardBorderOverrideSchema = z.object({
|
|
4728
|
+
enabled: z.boolean().nullable().optional(),
|
|
4729
|
+
width: z.enum([
|
|
4582
4730
|
"none",
|
|
4583
4731
|
"1",
|
|
4584
4732
|
"2",
|
|
@@ -4586,13 +4734,13 @@ const cardBorderOverrideSchema = z$1.object({
|
|
|
4586
4734
|
]).nullable().optional(),
|
|
4587
4735
|
colorToken: themeColorTokenSchema.nullable().optional()
|
|
4588
4736
|
});
|
|
4589
|
-
const cardStylesOverrideSchema = z
|
|
4737
|
+
const cardStylesOverrideSchema = z.object({
|
|
4590
4738
|
background: boxBackgroundSchema.nullable().optional(),
|
|
4591
4739
|
border: cardBorderOverrideSchema.nullable().optional(),
|
|
4592
4740
|
spacing: semanticSpacingSchema.nullable().optional(),
|
|
4593
|
-
raised: z
|
|
4741
|
+
raised: z.boolean().nullable().optional(),
|
|
4594
4742
|
rounded: boxRoundedSchema.nullable().optional(),
|
|
4595
|
-
treatment: z
|
|
4743
|
+
treatment: z.enum([
|
|
4596
4744
|
"accent-quote",
|
|
4597
4745
|
"editorial-rule",
|
|
4598
4746
|
"soft-panel",
|
|
@@ -4602,16 +4750,16 @@ const cardStylesOverrideSchema = z$1.object({
|
|
|
4602
4750
|
]).nullable().optional(),
|
|
4603
4751
|
cardVariant: boxStylesCardVariantSchema.nullable().optional()
|
|
4604
4752
|
});
|
|
4605
|
-
const blockStyleOverridesSchema = z
|
|
4753
|
+
const blockStyleOverridesSchema = z.object({
|
|
4606
4754
|
sectionStyles: sectionStylesOverrideSchema.nullable().optional(),
|
|
4607
4755
|
containerStyles: containerStylesOverrideSchema.nullable().optional(),
|
|
4608
4756
|
cardStyles: cardStylesOverrideSchema.nullable().optional()
|
|
4609
4757
|
});
|
|
4610
|
-
const blockThemeOverrideSchema = z
|
|
4611
|
-
typography: z
|
|
4758
|
+
const blockThemeOverrideSchema = z.object({
|
|
4759
|
+
typography: z.object({ proseLinkStyle: proseLinkStyleSchema.optional() }).optional(),
|
|
4612
4760
|
styles: blockStyleOverridesSchema.optional()
|
|
4613
4761
|
});
|
|
4614
|
-
const typographyScaleSchema = z
|
|
4762
|
+
const typographyScaleSchema = z.enum([
|
|
4615
4763
|
"compact",
|
|
4616
4764
|
"balanced",
|
|
4617
4765
|
"spacious",
|
|
@@ -4619,31 +4767,31 @@ const typographyScaleSchema = z$1.enum([
|
|
|
4619
4767
|
"majorThird",
|
|
4620
4768
|
"perfectFourth"
|
|
4621
4769
|
]);
|
|
4622
|
-
const eyebrowTypographyStyleSchema = z
|
|
4623
|
-
family: z
|
|
4624
|
-
size: z
|
|
4770
|
+
const eyebrowTypographyStyleSchema = z.object({
|
|
4771
|
+
family: z.string().min(1),
|
|
4772
|
+
size: z.enum([
|
|
4625
4773
|
"sm",
|
|
4626
4774
|
"md",
|
|
4627
4775
|
"lg"
|
|
4628
4776
|
]).optional(),
|
|
4629
|
-
weight: z
|
|
4777
|
+
weight: z.enum([
|
|
4630
4778
|
"light",
|
|
4631
4779
|
"regular",
|
|
4632
4780
|
"medium",
|
|
4633
4781
|
"semibold",
|
|
4634
4782
|
"bold"
|
|
4635
4783
|
]).optional(),
|
|
4636
|
-
letterSpacing: z
|
|
4784
|
+
letterSpacing: z.enum([
|
|
4637
4785
|
"tight",
|
|
4638
4786
|
"normal",
|
|
4639
4787
|
"loose",
|
|
4640
4788
|
"wide"
|
|
4641
4789
|
]).optional(),
|
|
4642
|
-
case: z
|
|
4790
|
+
case: z.enum(["uppercase", "normal"]).optional()
|
|
4643
4791
|
});
|
|
4644
|
-
const typographySchema = z
|
|
4792
|
+
const typographySchema = z.object({
|
|
4645
4793
|
body: bodyTypographyStyleSchema,
|
|
4646
|
-
headings: z
|
|
4794
|
+
headings: z.object({
|
|
4647
4795
|
default: headingTypographyStyleSchema,
|
|
4648
4796
|
h1: headingTypographyOverridesSchema,
|
|
4649
4797
|
h2: headingTypographyOverridesSchema,
|
|
@@ -4656,105 +4804,105 @@ const typographySchema = z$1.object({
|
|
|
4656
4804
|
proseLinkStyle: proseLinkStyleSchema.optional(),
|
|
4657
4805
|
eyebrow: eyebrowTypographyStyleSchema.optional()
|
|
4658
4806
|
});
|
|
4659
|
-
const spaceSchema = z
|
|
4807
|
+
const spaceSchema = z.enum([
|
|
4660
4808
|
"comfortable",
|
|
4661
4809
|
"standard",
|
|
4662
4810
|
"dense"
|
|
4663
4811
|
]);
|
|
4664
|
-
const corners = z
|
|
4812
|
+
const corners = z.enum([
|
|
4665
4813
|
"square",
|
|
4666
4814
|
"soft",
|
|
4667
4815
|
"rounded",
|
|
4668
4816
|
"pill"
|
|
4669
4817
|
]);
|
|
4670
|
-
const shadow = z
|
|
4671
|
-
elevation: z
|
|
4818
|
+
const shadow = z.object({
|
|
4819
|
+
elevation: z.enum([
|
|
4672
4820
|
"none",
|
|
4673
4821
|
"low",
|
|
4674
4822
|
"medium",
|
|
4675
4823
|
"high"
|
|
4676
4824
|
]),
|
|
4677
|
-
softness: z
|
|
4825
|
+
softness: z.enum([
|
|
4678
4826
|
"crisp",
|
|
4679
4827
|
"soft",
|
|
4680
4828
|
"hard"
|
|
4681
4829
|
]).nullable(),
|
|
4682
|
-
position: z
|
|
4830
|
+
position: z.enum(["bottom", "bottom-right"]).default("bottom"),
|
|
4683
4831
|
colorToken: themeColorTokenSchema.optional()
|
|
4684
4832
|
});
|
|
4685
|
-
const border = z
|
|
4686
|
-
width: z
|
|
4833
|
+
const border = z.object({
|
|
4834
|
+
width: z.enum([
|
|
4687
4835
|
"none",
|
|
4688
4836
|
"hairline",
|
|
4689
4837
|
"thin",
|
|
4690
4838
|
"thick"
|
|
4691
4839
|
]),
|
|
4692
|
-
style: z
|
|
4840
|
+
style: z.enum(["solid", "dashed"])
|
|
4693
4841
|
});
|
|
4694
|
-
const motion = z
|
|
4695
|
-
level: z
|
|
4842
|
+
const motion = z.object({
|
|
4843
|
+
level: z.enum([
|
|
4696
4844
|
"off",
|
|
4697
4845
|
"low",
|
|
4698
4846
|
"medium",
|
|
4699
4847
|
"high"
|
|
4700
4848
|
]),
|
|
4701
|
-
easing: z
|
|
4849
|
+
easing: z.enum([
|
|
4702
4850
|
"standard",
|
|
4703
4851
|
"snappy",
|
|
4704
4852
|
"gentle"
|
|
4705
4853
|
]).nullable()
|
|
4706
4854
|
});
|
|
4707
|
-
z
|
|
4708
|
-
z
|
|
4709
|
-
elevation: z
|
|
4855
|
+
z.object({ shape: corners });
|
|
4856
|
+
z.object({
|
|
4857
|
+
elevation: z.enum([
|
|
4710
4858
|
"none",
|
|
4711
4859
|
"low",
|
|
4712
4860
|
"medium",
|
|
4713
4861
|
"high"
|
|
4714
4862
|
]),
|
|
4715
|
-
border: z
|
|
4863
|
+
border: z.enum([
|
|
4716
4864
|
"none",
|
|
4717
4865
|
"subtle",
|
|
4718
4866
|
"defined"
|
|
4719
4867
|
]),
|
|
4720
4868
|
shape: corners,
|
|
4721
|
-
headerStyle: z
|
|
4869
|
+
headerStyle: z.enum([
|
|
4722
4870
|
"plain",
|
|
4723
4871
|
"accentBar",
|
|
4724
4872
|
"subtleBg"
|
|
4725
4873
|
]).nullable(),
|
|
4726
|
-
mediaTreatment: z
|
|
4874
|
+
mediaTreatment: z.enum([
|
|
4727
4875
|
"square",
|
|
4728
4876
|
"rounded",
|
|
4729
4877
|
"bleed"
|
|
4730
4878
|
]).nullable()
|
|
4731
4879
|
});
|
|
4732
|
-
const inputStyle = z
|
|
4880
|
+
const inputStyle = z.object({
|
|
4733
4881
|
shape: corners,
|
|
4734
|
-
border: z
|
|
4882
|
+
border: z.enum([
|
|
4735
4883
|
"subtle",
|
|
4736
4884
|
"defined",
|
|
4737
4885
|
"underline"
|
|
4738
4886
|
]),
|
|
4739
|
-
focus: z
|
|
4887
|
+
focus: z.enum([
|
|
4740
4888
|
"glow",
|
|
4741
4889
|
"ring",
|
|
4742
4890
|
"underline"
|
|
4743
4891
|
]),
|
|
4744
|
-
label: z
|
|
4892
|
+
label: z.enum(["inside", "above"])
|
|
4745
4893
|
});
|
|
4746
|
-
const headerVariant = z
|
|
4894
|
+
const headerVariant = z.enum([
|
|
4747
4895
|
"classic",
|
|
4748
4896
|
"centered",
|
|
4749
4897
|
"transparent",
|
|
4750
4898
|
"floating"
|
|
4751
4899
|
]);
|
|
4752
|
-
const headerPositioning = z
|
|
4900
|
+
const headerPositioning = z.enum([
|
|
4753
4901
|
"static",
|
|
4754
4902
|
"sticky",
|
|
4755
4903
|
"fixed"
|
|
4756
4904
|
]);
|
|
4757
|
-
const headerNavStyle = z
|
|
4905
|
+
const headerNavStyle = z.enum([
|
|
4758
4906
|
"minimal",
|
|
4759
4907
|
"underline",
|
|
4760
4908
|
"underline-grow",
|
|
@@ -4763,59 +4911,59 @@ const headerNavStyle = z$1.enum([
|
|
|
4763
4911
|
"frosted",
|
|
4764
4912
|
"solid"
|
|
4765
4913
|
]);
|
|
4766
|
-
const navFontWeight = z
|
|
4914
|
+
const navFontWeight = z.enum([
|
|
4767
4915
|
"regular",
|
|
4768
4916
|
"medium",
|
|
4769
4917
|
"semibold",
|
|
4770
4918
|
"bold"
|
|
4771
4919
|
]);
|
|
4772
|
-
const headerMaxWidth = z
|
|
4773
|
-
const headerBarFrame = z
|
|
4774
|
-
const headerBorderSchema = componentBorderSchema.extend({ position: z
|
|
4920
|
+
const headerMaxWidth = z.enum(["container", "full"]);
|
|
4921
|
+
const headerBarFrame = z.enum(["full-bleed", "inset-shell"]);
|
|
4922
|
+
const headerBorderSchema = componentBorderSchema.extend({ position: z.enum([
|
|
4775
4923
|
"bottom",
|
|
4776
4924
|
"top",
|
|
4777
4925
|
"both",
|
|
4778
4926
|
"none"
|
|
4779
4927
|
]).default("bottom") }).optional();
|
|
4780
|
-
const logoStyleSchema = z
|
|
4781
|
-
fontFamily: z
|
|
4782
|
-
letterSpacing: z
|
|
4928
|
+
const logoStyleSchema = z.object({
|
|
4929
|
+
fontFamily: z.enum(["heading", "body"]).default("heading"),
|
|
4930
|
+
letterSpacing: z.enum([
|
|
4783
4931
|
"normal",
|
|
4784
4932
|
"wide",
|
|
4785
4933
|
"wider",
|
|
4786
4934
|
"widest"
|
|
4787
4935
|
]).default("normal"),
|
|
4788
|
-
gradient: z
|
|
4789
|
-
brandDisplay: z
|
|
4790
|
-
size: z
|
|
4791
|
-
accommodation: z
|
|
4936
|
+
gradient: z.boolean().default(false),
|
|
4937
|
+
brandDisplay: z.enum(brandDisplayModeValues).optional(),
|
|
4938
|
+
size: z.enum(logoSizePolicyValues).optional(),
|
|
4939
|
+
accommodation: z.enum(logoAccommodationPatternValues).optional()
|
|
4792
4940
|
}).optional();
|
|
4793
|
-
const headerLogoTextSchema = z
|
|
4794
|
-
mobileWrapLines: z
|
|
4795
|
-
mobileMaxWidth: z
|
|
4941
|
+
const headerLogoTextSchema = z.object({
|
|
4942
|
+
mobileWrapLines: z.union([z.literal(1), z.literal(2)]).optional(),
|
|
4943
|
+
mobileMaxWidth: z.enum([
|
|
4796
4944
|
"xs",
|
|
4797
4945
|
"sm",
|
|
4798
4946
|
"md"
|
|
4799
4947
|
]).optional(),
|
|
4800
|
-
hideOnShrink: z
|
|
4948
|
+
hideOnShrink: z.boolean().optional()
|
|
4801
4949
|
}).optional();
|
|
4802
|
-
const navEffectsSchema = z
|
|
4803
|
-
underlineGradient: z
|
|
4804
|
-
glow: z
|
|
4805
|
-
glowColor: z
|
|
4806
|
-
neumorphic: z
|
|
4950
|
+
const navEffectsSchema = z.object({
|
|
4951
|
+
underlineGradient: z.boolean().default(false),
|
|
4952
|
+
glow: z.boolean().default(false),
|
|
4953
|
+
glowColor: z.string().optional(),
|
|
4954
|
+
neumorphic: z.boolean().default(false)
|
|
4807
4955
|
}).optional();
|
|
4808
|
-
const dropdownStyleSchema = z
|
|
4956
|
+
const dropdownStyleSchema = z.object({
|
|
4809
4957
|
background: themeColorTokenSchema.default("surface"),
|
|
4810
4958
|
textColor: themeColorTokenSchema.default("text"),
|
|
4811
4959
|
borderColor: themeColorTokenSchema.nullable().default("border"),
|
|
4812
|
-
shadow: z
|
|
4960
|
+
shadow: z.enum([
|
|
4813
4961
|
"none",
|
|
4814
4962
|
"sm",
|
|
4815
4963
|
"md",
|
|
4816
4964
|
"lg"
|
|
4817
4965
|
]).default("md"),
|
|
4818
|
-
borderRadius: z
|
|
4966
|
+
borderRadius: z.enum([
|
|
4819
4967
|
"none",
|
|
4820
4968
|
"sm",
|
|
4821
4969
|
"md",
|
|
@@ -4823,23 +4971,23 @@ const dropdownStyleSchema = z$1.object({
|
|
|
4823
4971
|
]).default("md"),
|
|
4824
4972
|
hoverBackground: themeColorTokenSchema.nullable().optional(),
|
|
4825
4973
|
hoverTextColor: themeColorTokenSchema.nullable().optional(),
|
|
4826
|
-
textTransform: z
|
|
4974
|
+
textTransform: z.enum([
|
|
4827
4975
|
"none",
|
|
4828
4976
|
"uppercase",
|
|
4829
4977
|
"capitalize"
|
|
4830
4978
|
]).default("none"),
|
|
4831
|
-
letterSpacing: z
|
|
4979
|
+
letterSpacing: z.enum([
|
|
4832
4980
|
"normal",
|
|
4833
4981
|
"wide",
|
|
4834
4982
|
"wider"
|
|
4835
4983
|
]).default("normal"),
|
|
4836
|
-
fontWeight: z
|
|
4984
|
+
fontWeight: z.enum([
|
|
4837
4985
|
"regular",
|
|
4838
4986
|
"medium",
|
|
4839
4987
|
"semibold",
|
|
4840
4988
|
"bold"
|
|
4841
4989
|
]).optional(),
|
|
4842
|
-
textSize: z
|
|
4990
|
+
textSize: z.enum([
|
|
4843
4991
|
"xs",
|
|
4844
4992
|
"sm",
|
|
4845
4993
|
"base",
|
|
@@ -4850,7 +4998,7 @@ const dropdownStyleSchema = z$1.object({
|
|
|
4850
4998
|
* CTA button gap (left margin) for desktop header.
|
|
4851
4999
|
* Controls the spacing between nav links and the CTA button.
|
|
4852
5000
|
*/
|
|
4853
|
-
const headerCtaGapSchema = z
|
|
5001
|
+
const headerCtaGapSchema = z.enum([
|
|
4854
5002
|
"none",
|
|
4855
5003
|
"tight",
|
|
4856
5004
|
"compact",
|
|
@@ -4858,7 +5006,7 @@ const headerCtaGapSchema = z$1.enum([
|
|
|
4858
5006
|
"relaxed",
|
|
4859
5007
|
"spacious"
|
|
4860
5008
|
]);
|
|
4861
|
-
const headerCtaTreatmentSchema = z
|
|
5009
|
+
const headerCtaTreatmentSchema = z.enum([
|
|
4862
5010
|
"default",
|
|
4863
5011
|
"primary",
|
|
4864
5012
|
"secondary",
|
|
@@ -4866,35 +5014,35 @@ const headerCtaTreatmentSchema = z$1.enum([
|
|
|
4866
5014
|
"outline",
|
|
4867
5015
|
"ghost"
|
|
4868
5016
|
]);
|
|
4869
|
-
const navContainerSchema = z
|
|
4870
|
-
type: z
|
|
5017
|
+
const navContainerSchema = z.object({
|
|
5018
|
+
type: z.enum([
|
|
4871
5019
|
"none",
|
|
4872
5020
|
"pill",
|
|
4873
5021
|
"glass"
|
|
4874
5022
|
]).default("none"),
|
|
4875
|
-
tint: z
|
|
4876
|
-
opacity: z
|
|
5023
|
+
tint: z.string().nullable().optional(),
|
|
5024
|
+
opacity: z.number().min(0).max(1).default(.15)
|
|
4877
5025
|
}).default({
|
|
4878
5026
|
type: "none",
|
|
4879
5027
|
tint: null,
|
|
4880
5028
|
opacity: .15
|
|
4881
5029
|
});
|
|
4882
|
-
const headerBackgroundSchema = z
|
|
4883
|
-
type: z
|
|
5030
|
+
const headerBackgroundSchema = z.object({
|
|
5031
|
+
type: z.enum([
|
|
4884
5032
|
"color",
|
|
4885
5033
|
"gradient",
|
|
4886
5034
|
"image"
|
|
4887
5035
|
]),
|
|
4888
|
-
contentOwner: z
|
|
5036
|
+
contentOwner: z.literal(siteChromeBackgroundOverrideOwner).optional(),
|
|
4889
5037
|
color: tokenOrCssColorValueSchema.nullable().optional(),
|
|
4890
5038
|
gradient: gradientConfigSchema.nullable().optional(),
|
|
4891
5039
|
image: mediaSchema.nullable().optional(),
|
|
4892
5040
|
textColor: tokenOrCssColorValueSchema.nullable().optional()
|
|
4893
5041
|
});
|
|
4894
|
-
const headerSchema = z
|
|
5042
|
+
const headerSchema = z.object({
|
|
4895
5043
|
variant: headerVariant,
|
|
4896
5044
|
positioning: headerPositioning,
|
|
4897
|
-
shrinkOnScroll: z
|
|
5045
|
+
shrinkOnScroll: z.boolean(),
|
|
4898
5046
|
maxWidth: headerMaxWidth,
|
|
4899
5047
|
barFrame: headerBarFrame.optional(),
|
|
4900
5048
|
scrollTreatment: headerScrollTreatmentSchema,
|
|
@@ -4907,11 +5055,10 @@ const headerSchema = z$1.object({
|
|
|
4907
5055
|
navStyle: headerNavStyle,
|
|
4908
5056
|
navColor: themeColorTokenSchema.nullable().optional(),
|
|
4909
5057
|
navWeight: navFontWeight.default("medium"),
|
|
4910
|
-
navFontRole: z
|
|
4911
|
-
navTypography: z$1.enum(["body", "heading"]).optional(),
|
|
5058
|
+
navFontRole: z.enum(["body", "heading"]).optional(),
|
|
4912
5059
|
navTextSize: navLinkStyleSchema.shape.textSize,
|
|
4913
5060
|
interactionPalette: headerInteractionPaletteSchema.optional(),
|
|
4914
|
-
navPlacement: z
|
|
5061
|
+
navPlacement: z.enum(["end", "center"]).optional(),
|
|
4915
5062
|
container: headerContainerSchema,
|
|
4916
5063
|
border: headerBorderSchema,
|
|
4917
5064
|
shadow: componentShadowSchema.optional(),
|
|
@@ -4922,47 +5069,33 @@ const headerSchema = z$1.object({
|
|
|
4922
5069
|
navLinkStyle: navLinkStyleSchema.optional(),
|
|
4923
5070
|
ctaGap: headerCtaGapSchema.optional(),
|
|
4924
5071
|
ctaTreatment: headerCtaTreatmentSchema.optional(),
|
|
4925
|
-
ctaVariant: z
|
|
5072
|
+
ctaVariant: z.string().min(1).optional(),
|
|
4926
5073
|
dropdownStyle: dropdownStyleSchema
|
|
4927
|
-
})
|
|
4928
|
-
|
|
4929
|
-
* Normalises the legacy `navTypography` font-role alias into the canonical
|
|
4930
|
-
* `navFontRole` field so persisted themes migrate at the parse boundary without
|
|
4931
|
-
* a data migration. `navFontRole` always wins when both are present; the legacy
|
|
4932
|
-
* field is dropped so we never carry a dual write forward.
|
|
4933
|
-
*/
|
|
4934
|
-
function normaliseHeaderNavFontRole(header) {
|
|
4935
|
-
if (header.navTypography === void 0) return header;
|
|
4936
|
-
const { navTypography, ...rest } = header;
|
|
4937
|
-
return header.navFontRole === void 0 ? {
|
|
4938
|
-
...rest,
|
|
4939
|
-
navFontRole: navTypography
|
|
4940
|
-
} : rest;
|
|
4941
|
-
}
|
|
4942
|
-
const footerVariant = z$1.enum([
|
|
5074
|
+
});
|
|
5075
|
+
const footerVariant = z.enum([
|
|
4943
5076
|
"simple",
|
|
4944
5077
|
"columns",
|
|
4945
5078
|
"split"
|
|
4946
5079
|
]);
|
|
4947
|
-
const footerMaxWidth = z
|
|
4948
|
-
const footerMode = z
|
|
5080
|
+
const footerMaxWidth = z.enum(["container", "full"]);
|
|
5081
|
+
const footerMode = z.enum([
|
|
4949
5082
|
"default",
|
|
4950
5083
|
"blocks",
|
|
4951
5084
|
"default+blocks",
|
|
4952
5085
|
"none"
|
|
4953
5086
|
]);
|
|
4954
|
-
const footerNavLayoutMode = z
|
|
5087
|
+
const footerNavLayoutMode = z.enum([
|
|
4955
5088
|
"stack",
|
|
4956
5089
|
"inline",
|
|
4957
5090
|
"inline-wrap"
|
|
4958
5091
|
]);
|
|
4959
|
-
const footerNavLayoutAlign = z
|
|
5092
|
+
const footerNavLayoutAlign = z.enum([
|
|
4960
5093
|
"start",
|
|
4961
5094
|
"center",
|
|
4962
5095
|
"end",
|
|
4963
5096
|
"space-between"
|
|
4964
5097
|
]);
|
|
4965
|
-
const footerSpacing = z
|
|
5098
|
+
const footerSpacing = z.enum([
|
|
4966
5099
|
"none",
|
|
4967
5100
|
"tight",
|
|
4968
5101
|
"compact",
|
|
@@ -4970,45 +5103,45 @@ const footerSpacing = z$1.enum([
|
|
|
4970
5103
|
"relaxed",
|
|
4971
5104
|
"spacious"
|
|
4972
5105
|
]);
|
|
4973
|
-
const footerLogoPlacement = z
|
|
5106
|
+
const footerLogoPlacement = z.enum([
|
|
4974
5107
|
"left",
|
|
4975
5108
|
"right",
|
|
4976
5109
|
"above",
|
|
4977
5110
|
"below"
|
|
4978
5111
|
]);
|
|
4979
|
-
const footerLogoSize = z
|
|
5112
|
+
const footerLogoSize = z.enum([
|
|
4980
5113
|
"sm",
|
|
4981
5114
|
"md",
|
|
4982
5115
|
"lg",
|
|
4983
5116
|
"xl"
|
|
4984
5117
|
]);
|
|
4985
|
-
const footerLogoMaxHeight = z
|
|
5118
|
+
const footerLogoMaxHeight = z.enum([
|
|
4986
5119
|
"sm",
|
|
4987
5120
|
"md",
|
|
4988
5121
|
"lg",
|
|
4989
5122
|
"xl"
|
|
4990
5123
|
]);
|
|
4991
|
-
const footerBottomTextLinkStyleSchema = z
|
|
5124
|
+
const footerBottomTextLinkStyleSchema = z.object({
|
|
4992
5125
|
colorToken: themeColorTokenSchema.optional(),
|
|
4993
5126
|
hoverColorToken: themeColorTokenSchema.nullable().optional(),
|
|
4994
5127
|
decorationColorToken: themeColorTokenSchema.nullable().optional(),
|
|
4995
|
-
underline: z
|
|
5128
|
+
underline: z.boolean().optional()
|
|
4996
5129
|
});
|
|
4997
|
-
const footerBottomBarSchema = z
|
|
4998
|
-
enabled: z
|
|
4999
|
-
fullBleed: z
|
|
5130
|
+
const footerBottomBarSchema = z.object({
|
|
5131
|
+
enabled: z.boolean().optional(),
|
|
5132
|
+
fullBleed: z.boolean().optional(),
|
|
5000
5133
|
background: headerBackgroundSchema.optional(),
|
|
5001
5134
|
textColor: themeColorTokenSchema.nullable().optional(),
|
|
5002
|
-
textAlign: z
|
|
5135
|
+
textAlign: z.enum([
|
|
5003
5136
|
"left",
|
|
5004
5137
|
"center",
|
|
5005
5138
|
"right"
|
|
5006
5139
|
]).optional(),
|
|
5007
5140
|
paddingY: footerSpacing.optional(),
|
|
5008
5141
|
paddingX: footerSpacing.optional(),
|
|
5009
|
-
borderTop: z
|
|
5142
|
+
borderTop: z.object({
|
|
5010
5143
|
colorToken: themeColorTokenSchema.nullable().optional(),
|
|
5011
|
-
width: z
|
|
5144
|
+
width: z.enum([
|
|
5012
5145
|
"none",
|
|
5013
5146
|
"thin",
|
|
5014
5147
|
"medium",
|
|
@@ -5016,26 +5149,26 @@ const footerBottomBarSchema = z$1.object({
|
|
|
5016
5149
|
]).optional()
|
|
5017
5150
|
}).optional()
|
|
5018
5151
|
});
|
|
5019
|
-
const footerNavLayoutSchema = z
|
|
5152
|
+
const footerNavLayoutSchema = z.object({
|
|
5020
5153
|
layout: footerNavLayoutMode.optional(),
|
|
5021
5154
|
align: footerNavLayoutAlign.optional(),
|
|
5022
5155
|
gapX: footerSpacing.optional(),
|
|
5023
5156
|
gapY: footerSpacing.optional(),
|
|
5024
|
-
columns: z
|
|
5157
|
+
columns: z.number().int().min(1).max(6).optional()
|
|
5025
5158
|
});
|
|
5026
|
-
const footerLogoSchema = z
|
|
5027
|
-
showLogo: z
|
|
5028
|
-
showLogoText: z
|
|
5159
|
+
const footerLogoSchema = z.object({
|
|
5160
|
+
showLogo: z.boolean().default(true),
|
|
5161
|
+
showLogoText: z.boolean().optional(),
|
|
5029
5162
|
placement: footerLogoPlacement.optional(),
|
|
5030
5163
|
size: footerLogoSize.optional(),
|
|
5031
5164
|
maxHeight: footerLogoMaxHeight.optional(),
|
|
5032
|
-
align: z
|
|
5165
|
+
align: z.enum([
|
|
5033
5166
|
"start",
|
|
5034
5167
|
"center",
|
|
5035
5168
|
"end"
|
|
5036
5169
|
]).optional()
|
|
5037
5170
|
});
|
|
5038
|
-
const footerSchema = z
|
|
5171
|
+
const footerSchema = z.object({
|
|
5039
5172
|
/**
|
|
5040
5173
|
* SDK-only footer rendering mode.
|
|
5041
5174
|
*
|
|
@@ -5044,7 +5177,7 @@ const footerSchema = z$1.object({
|
|
|
5044
5177
|
mode: footerMode.optional(),
|
|
5045
5178
|
variant: footerVariant,
|
|
5046
5179
|
maxWidth: footerMaxWidth,
|
|
5047
|
-
showLogoText: z
|
|
5180
|
+
showLogoText: z.boolean().optional(),
|
|
5048
5181
|
background: headerBackgroundSchema.default({
|
|
5049
5182
|
type: "color",
|
|
5050
5183
|
color: "surface"
|
|
@@ -5058,18 +5191,18 @@ const footerSchema = z$1.object({
|
|
|
5058
5191
|
logo: footerLogoSchema.optional(),
|
|
5059
5192
|
bottomBar: footerBottomBarSchema.optional()
|
|
5060
5193
|
});
|
|
5061
|
-
const containerPaddingPresetSchema = z
|
|
5194
|
+
const containerPaddingPresetSchema = z.enum([
|
|
5062
5195
|
"tight",
|
|
5063
5196
|
"compact",
|
|
5064
5197
|
"default",
|
|
5065
5198
|
"relaxed"
|
|
5066
5199
|
]);
|
|
5067
|
-
const layoutSchema = z
|
|
5200
|
+
const layoutSchema = z.object({ containerPadding: z.object({
|
|
5068
5201
|
mobile: containerPaddingPresetSchema.optional(),
|
|
5069
5202
|
tablet: containerPaddingPresetSchema.optional(),
|
|
5070
5203
|
desktop: containerPaddingPresetSchema.optional()
|
|
5071
5204
|
}).optional() }).optional();
|
|
5072
|
-
const heroTypographySizeSchema = z
|
|
5205
|
+
const heroTypographySizeSchema = z.enum([
|
|
5073
5206
|
"sm",
|
|
5074
5207
|
"base",
|
|
5075
5208
|
"lg",
|
|
@@ -5081,19 +5214,19 @@ const heroTypographySizeSchema = z$1.enum([
|
|
|
5081
5214
|
"6xl",
|
|
5082
5215
|
"editorial"
|
|
5083
5216
|
]);
|
|
5084
|
-
const heroTypographyLineHeightSchema = z
|
|
5217
|
+
const heroTypographyLineHeightSchema = z.enum([
|
|
5085
5218
|
"tight",
|
|
5086
5219
|
"snug",
|
|
5087
5220
|
"normal",
|
|
5088
5221
|
"relaxed"
|
|
5089
5222
|
]);
|
|
5090
|
-
const heroResponsiveTypographySchema = z
|
|
5223
|
+
const heroResponsiveTypographySchema = z.object({
|
|
5091
5224
|
headlineSize: heroTypographySizeSchema.optional(),
|
|
5092
5225
|
headlineLineHeight: heroTypographyLineHeightSchema.optional(),
|
|
5093
5226
|
subheadlineSize: heroTypographySizeSchema.optional(),
|
|
5094
5227
|
subheadlineLineHeight: heroTypographyLineHeightSchema.optional()
|
|
5095
5228
|
});
|
|
5096
|
-
const heroTypographySchema = z
|
|
5229
|
+
const heroTypographySchema = z.object({
|
|
5097
5230
|
headlineSize: heroTypographySizeSchema.optional(),
|
|
5098
5231
|
headlineLineHeight: heroTypographyLineHeightSchema.optional(),
|
|
5099
5232
|
subheadlineSize: heroTypographySizeSchema.optional(),
|
|
@@ -5102,21 +5235,21 @@ const heroTypographySchema = z$1.object({
|
|
|
5102
5235
|
microHeadlineLineHeight: heroTypographyLineHeightSchema.optional(),
|
|
5103
5236
|
microSubheadlineSize: heroTypographySizeSchema.optional(),
|
|
5104
5237
|
microSubheadlineLineHeight: heroTypographyLineHeightSchema.optional(),
|
|
5105
|
-
responsive: z
|
|
5238
|
+
responsive: z.object({
|
|
5106
5239
|
tablet: heroResponsiveTypographySchema.optional(),
|
|
5107
5240
|
mobile: heroResponsiveTypographySchema.optional()
|
|
5108
5241
|
}).optional()
|
|
5109
5242
|
});
|
|
5110
|
-
const heroSchema = z
|
|
5111
|
-
const bodyTextIntroTypographySizeSchema = z
|
|
5112
|
-
const bodyTextSchema = z
|
|
5243
|
+
const heroSchema = z.object({ typography: heroTypographySchema.optional() }).optional();
|
|
5244
|
+
const bodyTextIntroTypographySizeSchema = z.enum(["default", "editorial"]);
|
|
5245
|
+
const bodyTextSchema = z.object({ intro: z.object({
|
|
5113
5246
|
paragraphSize: bodyTextIntroTypographySizeSchema.optional(),
|
|
5114
5247
|
headingSize: bodyTextIntroTypographySizeSchema.optional()
|
|
5115
5248
|
}).optional() }).optional();
|
|
5116
|
-
const gradientsSchema = z
|
|
5117
|
-
button: z
|
|
5118
|
-
hero: z
|
|
5119
|
-
background: z
|
|
5249
|
+
const gradientsSchema = z.object({
|
|
5250
|
+
button: z.string().min(1).nullable().optional(),
|
|
5251
|
+
hero: z.string().min(1).nullable().optional(),
|
|
5252
|
+
background: z.string().min(1).nullable().optional()
|
|
5120
5253
|
});
|
|
5121
5254
|
/**
|
|
5122
5255
|
* Testimonial quote-mark treatment, owned by the site style (analogous to the
|
|
@@ -5124,27 +5257,27 @@ const gradientsSchema = z$1.object({
|
|
|
5124
5257
|
* it. `none` hides the mark. The block renders the mark; the site style decides
|
|
5125
5258
|
* its character; a look may still hide it.
|
|
5126
5259
|
*/
|
|
5127
|
-
const testimonialQuoteTreatmentSchema = z
|
|
5128
|
-
style: z
|
|
5260
|
+
const testimonialQuoteTreatmentSchema = z.object({
|
|
5261
|
+
style: z.enum([
|
|
5129
5262
|
"serif-display",
|
|
5130
5263
|
"accent-glyph",
|
|
5131
5264
|
"none"
|
|
5132
5265
|
]),
|
|
5133
|
-
fontFamily: z
|
|
5134
|
-
scale: z
|
|
5266
|
+
fontFamily: z.enum(["heading", "body"]).optional(),
|
|
5267
|
+
scale: z.enum([
|
|
5135
5268
|
"sm",
|
|
5136
5269
|
"md",
|
|
5137
5270
|
"lg",
|
|
5138
5271
|
"xl"
|
|
5139
5272
|
]).optional(),
|
|
5140
5273
|
colorToken: themeColorTokenSchema.optional(),
|
|
5141
|
-
opacity: z
|
|
5274
|
+
opacity: z.number().min(0).max(1).optional()
|
|
5142
5275
|
});
|
|
5143
|
-
const themeSchema = z
|
|
5144
|
-
name: z
|
|
5145
|
-
description: z
|
|
5146
|
-
rationale: z
|
|
5147
|
-
siteStyleId: z
|
|
5276
|
+
const themeSchema = z.object({
|
|
5277
|
+
name: z.string().min(1).max(30),
|
|
5278
|
+
description: z.string().min(1).max(400),
|
|
5279
|
+
rationale: z.string().min(1).max(400),
|
|
5280
|
+
siteStyleId: z.string().min(1).transform((value) => asSiteStyleId(value)).optional(),
|
|
5148
5281
|
axes: axesSchema,
|
|
5149
5282
|
palette: paletteSchema,
|
|
5150
5283
|
typography: typographySchema,
|
|
@@ -5165,8 +5298,8 @@ const themeSchema = z$1.object({
|
|
|
5165
5298
|
testimonialQuote: testimonialQuoteTreatmentSchema.optional(),
|
|
5166
5299
|
inputs: inputSystemSchema.optional(),
|
|
5167
5300
|
inputStyle: inputStyle.optional(),
|
|
5168
|
-
blockCustomVars: z
|
|
5169
|
-
blockOverrides: z
|
|
5301
|
+
blockCustomVars: z.record(z.string(), z.record(z.string(), z.string())).optional(),
|
|
5302
|
+
blockOverrides: z.record(z.string(), blockThemeOverrideSchema).optional(),
|
|
5170
5303
|
headingDecoration: headingDecorationSchema.optional(),
|
|
5171
5304
|
customCssRules: customCssRulesSchema,
|
|
5172
5305
|
blockCustomCssRules: blockCustomCssRulesSchema,
|
|
@@ -5196,11 +5329,11 @@ const themeSchema = z$1.object({
|
|
|
5196
5329
|
* }
|
|
5197
5330
|
* ```
|
|
5198
5331
|
*/
|
|
5199
|
-
styleGroups: z
|
|
5332
|
+
styleGroups: z.record(z.string(), z.array(z.string())).optional()
|
|
5200
5333
|
});
|
|
5201
|
-
z
|
|
5202
|
-
message: z
|
|
5203
|
-
themes: z
|
|
5334
|
+
z.object({
|
|
5335
|
+
message: z.string().min(1),
|
|
5336
|
+
themes: z.array(themeSchema).length(3)
|
|
5204
5337
|
});
|
|
5205
5338
|
//#endregion
|
|
5206
5339
|
//#region ../theme-core/src/styles/shadow.ts
|
|
@@ -5305,11 +5438,11 @@ const STYLE_AXIS_VALUES = {
|
|
|
5305
5438
|
"retro"
|
|
5306
5439
|
]
|
|
5307
5440
|
};
|
|
5308
|
-
const styleTagsSchema = z
|
|
5309
|
-
tone: z
|
|
5310
|
-
energy: z
|
|
5311
|
-
motion: z
|
|
5312
|
-
era: z
|
|
5441
|
+
const styleTagsSchema = z.object({
|
|
5442
|
+
tone: z.enum(STYLE_AXIS_VALUES.tone).optional(),
|
|
5443
|
+
energy: z.enum(STYLE_AXIS_VALUES.energy).optional(),
|
|
5444
|
+
motion: z.enum(STYLE_AXIS_VALUES.motion).optional(),
|
|
5445
|
+
era: z.enum(STYLE_AXIS_VALUES.era).optional()
|
|
5313
5446
|
});
|
|
5314
5447
|
//#endregion
|
|
5315
5448
|
//#region ../theme-core/src/palette/curated/types.ts
|
|
@@ -5317,12 +5450,12 @@ function asCuratedPaletteAuthoringKey(value) {
|
|
|
5317
5450
|
if (value.length === 0) throw new Error("CuratedPaletteAuthoringKey must be a non-empty string");
|
|
5318
5451
|
return value;
|
|
5319
5452
|
}
|
|
5320
|
-
const curatedPaletteAuthoringKeySchema = z
|
|
5321
|
-
z
|
|
5453
|
+
const curatedPaletteAuthoringKeySchema = z.string().min(1).transform((value) => asCuratedPaletteAuthoringKey(value));
|
|
5454
|
+
z.object({
|
|
5322
5455
|
authoringKey: curatedPaletteAuthoringKeySchema,
|
|
5323
5456
|
valueKey: paletteValueKeySchema,
|
|
5324
|
-
name: z
|
|
5325
|
-
description: z
|
|
5457
|
+
name: z.string().min(1),
|
|
5458
|
+
description: z.string().min(1),
|
|
5326
5459
|
tags: styleTagsSchema,
|
|
5327
5460
|
mode: paletteModeSchema,
|
|
5328
5461
|
colors: paletteColorsSchema
|
|
@@ -5346,7 +5479,7 @@ function defineCuratedPalette(input) {
|
|
|
5346
5479
|
colors
|
|
5347
5480
|
};
|
|
5348
5481
|
}
|
|
5349
|
-
z
|
|
5482
|
+
z.object({
|
|
5350
5483
|
primary: hexColorSchema.optional(),
|
|
5351
5484
|
primaryForeground: hexColorSchema.optional(),
|
|
5352
5485
|
secondary: hexColorSchema.optional(),
|
|
@@ -7199,23 +7332,12 @@ function parseGradientPresetId(value) {
|
|
|
7199
7332
|
return normalized;
|
|
7200
7333
|
}
|
|
7201
7334
|
//#endregion
|
|
7202
|
-
//#region ../theme-core/src/site-styles/
|
|
7203
|
-
function
|
|
7204
|
-
return
|
|
7205
|
-
}
|
|
7206
|
-
function
|
|
7207
|
-
|
|
7208
|
-
case "default": return;
|
|
7209
|
-
case "primary": return "primary";
|
|
7210
|
-
case "secondary": return hasButtonVariant(theme, "secondary") ? "secondary" : "primary";
|
|
7211
|
-
case "inverted":
|
|
7212
|
-
if (hasButtonVariant(theme, "header")) return "header";
|
|
7213
|
-
if (hasButtonVariant(theme, "secondary")) return "secondary";
|
|
7214
|
-
if (hasButtonVariant(theme, "outline")) return "outline";
|
|
7215
|
-
return "primary";
|
|
7216
|
-
case "outline": return hasButtonVariant(theme, "outline") ? "outline" : "secondary";
|
|
7217
|
-
case "ghost": return hasButtonVariant(theme, "ghost") ? "ghost" : "secondary";
|
|
7218
|
-
}
|
|
7335
|
+
//#region ../theme-core/src/site-styles/headerLayoutTypes.ts
|
|
7336
|
+
function asHeaderLayoutId(value) {
|
|
7337
|
+
return value;
|
|
7338
|
+
}
|
|
7339
|
+
function asHeaderStyleId(value) {
|
|
7340
|
+
return value;
|
|
7219
7341
|
}
|
|
7220
7342
|
//#endregion
|
|
7221
7343
|
//#region ../theme-core/src/site-styles/lookOptionGroups.ts
|
|
@@ -7250,16 +7372,7 @@ const clearSplitInteractionPalette = defineLookOptionGroup({
|
|
|
7250
7372
|
]
|
|
7251
7373
|
});
|
|
7252
7374
|
//#endregion
|
|
7253
|
-
//#region ../theme-core/src/site-styles/
|
|
7254
|
-
function asHeaderLookId(value) {
|
|
7255
|
-
return value;
|
|
7256
|
-
}
|
|
7257
|
-
function asHeaderLayoutId(value) {
|
|
7258
|
-
return value;
|
|
7259
|
-
}
|
|
7260
|
-
function asHeaderStyleId(value) {
|
|
7261
|
-
return value;
|
|
7262
|
-
}
|
|
7375
|
+
//#region ../theme-core/src/site-styles/headerLayoutCatalog.ts
|
|
7263
7376
|
const titleOnlyLogoAccommodation = {
|
|
7264
7377
|
pattern: "title-only",
|
|
7265
7378
|
supportedShapes: [
|
|
@@ -7378,21 +7491,6 @@ const overlayLogoAccommodations = [
|
|
|
7378
7491
|
inlineMarkWithTitleLogoAccommodation,
|
|
7379
7492
|
unbackedOverlayLogoAccommodation
|
|
7380
7493
|
];
|
|
7381
|
-
/**
|
|
7382
|
-
* Starts every Look from the generated theme's header branch, then clears
|
|
7383
|
-
* optional nested styling fields that would otherwise leak from another Look.
|
|
7384
|
-
*/
|
|
7385
|
-
function baseHeader(theme) {
|
|
7386
|
-
const { navLinkStyle: _navLinkStyle, navFontRole: _navFontRole, navTypography: _navTypography, navTextSize: _navTextSize, interactionPalette: _interactionPalette, dropdownStyle: _dropdownStyle, ctaVariant: _ctaVariant, navContainer: _navContainer, container: _container, shadow: _shadow, logo: _logo, logoText: _logoText, border: _border, ...header } = theme.header;
|
|
7387
|
-
return {
|
|
7388
|
-
...header,
|
|
7389
|
-
navContainer: {
|
|
7390
|
-
type: "none",
|
|
7391
|
-
tint: null,
|
|
7392
|
-
opacity: .15
|
|
7393
|
-
}
|
|
7394
|
-
};
|
|
7395
|
-
}
|
|
7396
7494
|
const headerLayoutCatalog = defineExactCatalog()([
|
|
7397
7495
|
{
|
|
7398
7496
|
id: asHeaderLayoutId("classic"),
|
|
@@ -7400,7 +7498,9 @@ const headerLayoutCatalog = defineExactCatalog()([
|
|
|
7400
7498
|
description: "Logo and navigation in one practical horizontal row.",
|
|
7401
7499
|
variant: "classic",
|
|
7402
7500
|
defaultPositioning: "sticky",
|
|
7403
|
-
shrinkOnScroll: false
|
|
7501
|
+
shrinkOnScroll: false,
|
|
7502
|
+
logoAccommodations: inlineClassicLogoAccommodations,
|
|
7503
|
+
openingRequirement: "none"
|
|
7404
7504
|
},
|
|
7405
7505
|
{
|
|
7406
7506
|
id: asHeaderLayoutId("centered"),
|
|
@@ -7409,790 +7509,141 @@ const headerLayoutCatalog = defineExactCatalog()([
|
|
|
7409
7509
|
variant: "centered",
|
|
7410
7510
|
defaultPositioning: "static",
|
|
7411
7511
|
shrinkOnScroll: false,
|
|
7412
|
-
|
|
7413
|
-
|
|
7414
|
-
"none",
|
|
7415
|
-
"text-only",
|
|
7416
|
-
"horizontal",
|
|
7417
|
-
"square"
|
|
7418
|
-
]
|
|
7419
|
-
},
|
|
7420
|
-
{
|
|
7421
|
-
id: asHeaderLayoutId("floating"),
|
|
7422
|
-
label: "Floating",
|
|
7423
|
-
description: "Detached header chrome that sits over the opening section.",
|
|
7424
|
-
variant: "floating",
|
|
7425
|
-
defaultPositioning: "sticky",
|
|
7426
|
-
shrinkOnScroll: true,
|
|
7427
|
-
maxRecommendedNavItems: 5,
|
|
7428
|
-
allowedLogoShapes: [
|
|
7429
|
-
"none",
|
|
7430
|
-
"text-only",
|
|
7431
|
-
"horizontal"
|
|
7432
|
-
]
|
|
7433
|
-
}
|
|
7434
|
-
]);
|
|
7435
|
-
function supportedLayouts(ids) {
|
|
7436
|
-
return ids.map(asHeaderLayoutId);
|
|
7437
|
-
}
|
|
7438
|
-
const headerStyleCatalog = defineExactCatalog()([
|
|
7439
|
-
{
|
|
7440
|
-
id: asHeaderStyleId("minimal"),
|
|
7441
|
-
label: "Minimal",
|
|
7442
|
-
description: "Quiet surface with simple color-change navigation.",
|
|
7443
|
-
supportedLayoutIds: supportedLayouts(["classic", "centered"]),
|
|
7444
|
-
navInteraction: "color-change",
|
|
7445
|
-
surface: "neutral",
|
|
7446
|
-
defaultDepth: "none",
|
|
7447
|
-
navTypography: "plain",
|
|
7448
|
-
moods: [
|
|
7449
|
-
"calm",
|
|
7450
|
-
"professional",
|
|
7451
|
-
"editorial"
|
|
7452
|
-
]
|
|
7453
|
-
},
|
|
7454
|
-
{
|
|
7455
|
-
id: asHeaderStyleId("fine-line"),
|
|
7456
|
-
label: "Seamless",
|
|
7457
|
-
description: "Borderless surface with underline hover for a quieter page transition.",
|
|
7458
|
-
supportedLayoutIds: supportedLayouts(["classic", "centered"]),
|
|
7459
|
-
navInteraction: "underline-grow",
|
|
7460
|
-
surface: "neutral",
|
|
7461
|
-
defaultDepth: "none",
|
|
7462
|
-
navTypography: "plain",
|
|
7463
|
-
moods: [
|
|
7464
|
-
"calm",
|
|
7465
|
-
"professional",
|
|
7466
|
-
"editorial"
|
|
7467
|
-
]
|
|
7468
|
-
},
|
|
7469
|
-
{
|
|
7470
|
-
id: asHeaderStyleId("soft-bar"),
|
|
7471
|
-
label: "Soft Bar",
|
|
7472
|
-
description: "Soft tinted surface with gentle pill hover states.",
|
|
7473
|
-
supportedLayoutIds: supportedLayouts(["classic", "centered"]),
|
|
7474
|
-
navInteraction: "pill-background",
|
|
7475
|
-
surface: "soft",
|
|
7476
|
-
defaultDepth: "line",
|
|
7477
|
-
navTypography: "plain",
|
|
7478
|
-
moods: ["calm", "professional"]
|
|
7479
|
-
},
|
|
7480
|
-
{
|
|
7481
|
-
id: asHeaderStyleId("pill-nav"),
|
|
7482
|
-
label: "Pill Nav",
|
|
7483
|
-
description: "A calm pill navigation rail over a neutral header.",
|
|
7484
|
-
supportedLayoutIds: supportedLayouts(["classic", "centered"]),
|
|
7485
|
-
navInteraction: "pill-background",
|
|
7486
|
-
surface: "soft",
|
|
7487
|
-
defaultDepth: "none",
|
|
7488
|
-
navTypography: "plain",
|
|
7489
|
-
moods: ["calm"]
|
|
7490
|
-
},
|
|
7491
|
-
{
|
|
7492
|
-
id: asHeaderStyleId("brand-bar"),
|
|
7493
|
-
label: "Brand Bar",
|
|
7494
|
-
description: "Solid brand surface with high-contrast navigation.",
|
|
7495
|
-
supportedLayoutIds: supportedLayouts(["classic", "centered"]),
|
|
7496
|
-
navInteraction: "color-change",
|
|
7497
|
-
surface: "brand-solid",
|
|
7498
|
-
defaultDepth: "none",
|
|
7499
|
-
navTypography: "brand-caps",
|
|
7500
|
-
moods: [
|
|
7501
|
-
"professional",
|
|
7502
|
-
"expressive",
|
|
7503
|
-
"utility"
|
|
7504
|
-
]
|
|
7505
|
-
},
|
|
7506
|
-
{
|
|
7507
|
-
id: asHeaderStyleId("brand-underline"),
|
|
7508
|
-
label: "Brand Underline",
|
|
7509
|
-
description: "Brand surface with underline-grow navigation.",
|
|
7510
|
-
supportedLayoutIds: supportedLayouts(["classic"]),
|
|
7511
|
-
navInteraction: "underline-grow",
|
|
7512
|
-
surface: "brand-solid",
|
|
7513
|
-
defaultDepth: "none",
|
|
7514
|
-
navTypography: "brand-caps",
|
|
7515
|
-
moods: ["expressive"]
|
|
7516
|
-
},
|
|
7517
|
-
{
|
|
7518
|
-
id: asHeaderStyleId("brand-pill"),
|
|
7519
|
-
label: "Brand Pill",
|
|
7520
|
-
description: "Solid brand surface with rounded active and hover states.",
|
|
7521
|
-
supportedLayoutIds: supportedLayouts([
|
|
7522
|
-
"classic",
|
|
7523
|
-
"centered",
|
|
7524
|
-
"floating"
|
|
7525
|
-
]),
|
|
7526
|
-
navInteraction: "pill-background",
|
|
7527
|
-
surface: "brand-solid",
|
|
7528
|
-
defaultDepth: "none",
|
|
7529
|
-
navTypography: "brand-caps",
|
|
7530
|
-
moods: ["expressive"]
|
|
7531
|
-
},
|
|
7532
|
-
{
|
|
7533
|
-
id: asHeaderStyleId("brand-capsule"),
|
|
7534
|
-
label: "Brand Capsule",
|
|
7535
|
-
description: "Solid brand chrome designed as a floating capsule, with quiet-caps nav, a soft pill active state, and an inverted CTA pill.",
|
|
7536
|
-
supportedLayoutIds: supportedLayouts(["classic"]),
|
|
7537
|
-
navInteraction: "pill-background",
|
|
7538
|
-
surface: "brand-solid",
|
|
7539
|
-
defaultDepth: "shadow",
|
|
7540
|
-
navTypography: "quiet-caps",
|
|
7541
|
-
moods: ["expressive", "professional"]
|
|
7542
|
-
},
|
|
7543
|
-
{
|
|
7544
|
-
id: asHeaderStyleId("serif-line"),
|
|
7545
|
-
label: "Serif Line",
|
|
7546
|
-
description: "Typographic logo treatment with understated underline navigation.",
|
|
7547
|
-
supportedLayoutIds: supportedLayouts(["classic", "centered"]),
|
|
7548
|
-
navInteraction: "underline-grow",
|
|
7549
|
-
surface: "bordered",
|
|
7550
|
-
defaultDepth: "line",
|
|
7551
|
-
navTypography: "heading",
|
|
7552
|
-
moods: ["editorial", "calm"]
|
|
7553
|
-
},
|
|
7554
|
-
{
|
|
7555
|
-
id: asHeaderStyleId("flat-tabs"),
|
|
7556
|
-
label: "Flat Tabs",
|
|
7557
|
-
description: "Flat block hover and active states with a Swiss utility feel.",
|
|
7558
|
-
supportedLayoutIds: supportedLayouts(["classic", "centered"]),
|
|
7559
|
-
navInteraction: "flat-block",
|
|
7560
|
-
surface: "bordered",
|
|
7561
|
-
defaultDepth: "shadow",
|
|
7562
|
-
navTypography: "quiet-caps",
|
|
7563
|
-
moods: [
|
|
7564
|
-
"professional",
|
|
7565
|
-
"utility",
|
|
7566
|
-
"expressive"
|
|
7567
|
-
]
|
|
7568
|
-
},
|
|
7569
|
-
{
|
|
7570
|
-
id: asHeaderStyleId("glass"),
|
|
7571
|
-
label: "Glass",
|
|
7572
|
-
description: "Translucent chrome with frosted navigation backing.",
|
|
7573
|
-
supportedLayoutIds: supportedLayouts(["floating"]),
|
|
7574
|
-
navInteraction: "glass-backed",
|
|
7575
|
-
surface: "floating",
|
|
7576
|
-
defaultDepth: "shadow",
|
|
7577
|
-
navTypography: "plain",
|
|
7578
|
-
moods: ["expressive", "calm"]
|
|
7579
|
-
},
|
|
7580
|
-
{
|
|
7581
|
-
id: asHeaderStyleId("minimal-surface"),
|
|
7582
|
-
label: "Clear Split",
|
|
7583
|
-
description: "Floating logo with transparent navigation and no shared shell.",
|
|
7584
|
-
supportedLayoutIds: supportedLayouts(["floating"]),
|
|
7585
|
-
navInteraction: "pill-background",
|
|
7586
|
-
surface: "floating",
|
|
7587
|
-
defaultDepth: "line",
|
|
7588
|
-
navTypography: "plain",
|
|
7589
|
-
openingForegroundTarget: "all",
|
|
7590
|
-
scrollTreatment: "contrast-glass",
|
|
7591
|
-
interactionPalette: clearSplitInteractionPalette,
|
|
7592
|
-
moods: ["editorial", "calm"]
|
|
7593
|
-
},
|
|
7594
|
-
{
|
|
7595
|
-
id: asHeaderStyleId("soft-shell"),
|
|
7596
|
-
label: "Soft Shell",
|
|
7597
|
-
description: "Floating rounded shell with soft pill navigation states.",
|
|
7598
|
-
supportedLayoutIds: supportedLayouts(["floating"]),
|
|
7599
|
-
navInteraction: "pill-background",
|
|
7600
|
-
surface: "floating",
|
|
7601
|
-
defaultDepth: "shadow",
|
|
7602
|
-
navTypography: "plain",
|
|
7603
|
-
moods: ["calm", "professional"]
|
|
7604
|
-
},
|
|
7605
|
-
{
|
|
7606
|
-
id: asHeaderStyleId("split-glass"),
|
|
7607
|
-
label: "Split Glass",
|
|
7608
|
-
description: "Logo floats independently while the navigation sits in a glass rail.",
|
|
7609
|
-
supportedLayoutIds: supportedLayouts(["floating"]),
|
|
7610
|
-
navInteraction: "glass-backed",
|
|
7611
|
-
surface: "floating",
|
|
7612
|
-
defaultDepth: "shadow",
|
|
7613
|
-
navTypography: "quiet-caps",
|
|
7614
|
-
openingForegroundTarget: "brand-only",
|
|
7615
|
-
moods: ["expressive"]
|
|
7616
|
-
},
|
|
7617
|
-
{
|
|
7618
|
-
id: asHeaderStyleId("split-pill"),
|
|
7619
|
-
label: "Split Pill",
|
|
7620
|
-
description: "Logo floats independently with a soft pill-backed navigation rail.",
|
|
7621
|
-
supportedLayoutIds: supportedLayouts(["floating"]),
|
|
7622
|
-
navInteraction: "pill-background",
|
|
7623
|
-
surface: "floating",
|
|
7624
|
-
defaultDepth: "shadow",
|
|
7625
|
-
navTypography: "heading",
|
|
7626
|
-
openingForegroundTarget: "brand-only",
|
|
7627
|
-
moods: ["calm", "editorial"]
|
|
7628
|
-
}
|
|
7629
|
-
]);
|
|
7630
|
-
new Map(headerLayoutCatalog.map((layout) => [layout.id, layout]));
|
|
7631
|
-
const headerStylesById = new Map(headerStyleCatalog.map((style) => [style.id, style]));
|
|
7632
|
-
const headerStyleCompatibilityOrder = /* @__PURE__ */ new Map([
|
|
7633
|
-
[asHeaderLayoutId("classic"), headerStyleRepairChain([
|
|
7634
|
-
"minimal",
|
|
7635
|
-
"fine-line",
|
|
7636
|
-
"soft-bar",
|
|
7637
|
-
"pill-nav",
|
|
7638
|
-
"brand-bar",
|
|
7639
|
-
"brand-underline",
|
|
7640
|
-
"brand-pill",
|
|
7641
|
-
"brand-capsule",
|
|
7642
|
-
"serif-line",
|
|
7643
|
-
"flat-tabs"
|
|
7644
|
-
])],
|
|
7645
|
-
[asHeaderLayoutId("centered"), headerStyleRepairChain([
|
|
7646
|
-
"minimal",
|
|
7647
|
-
"fine-line",
|
|
7648
|
-
"soft-bar",
|
|
7649
|
-
"pill-nav",
|
|
7650
|
-
"brand-bar",
|
|
7651
|
-
"brand-pill",
|
|
7652
|
-
"serif-line",
|
|
7653
|
-
"flat-tabs"
|
|
7654
|
-
])],
|
|
7655
|
-
[asHeaderLayoutId("floating"), headerStyleRepairChain([
|
|
7656
|
-
"glass",
|
|
7657
|
-
"minimal-surface",
|
|
7658
|
-
"split-glass",
|
|
7659
|
-
"split-pill",
|
|
7660
|
-
"soft-shell",
|
|
7661
|
-
"brand-pill"
|
|
7662
|
-
])]
|
|
7663
|
-
]);
|
|
7664
|
-
function headerStyleRepairChain(values) {
|
|
7665
|
-
return values.map(asHeaderStyleId);
|
|
7666
|
-
}
|
|
7667
|
-
headerStyleRepairChain([
|
|
7668
|
-
"brand-bar",
|
|
7669
|
-
"brand-pill",
|
|
7670
|
-
"minimal"
|
|
7671
|
-
]), headerStyleRepairChain([
|
|
7672
|
-
"serif-line",
|
|
7673
|
-
"fine-line",
|
|
7674
|
-
"minimal"
|
|
7675
|
-
]), headerStyleRepairChain([
|
|
7676
|
-
"brand-pill",
|
|
7677
|
-
"brand-bar",
|
|
7678
|
-
"minimal"
|
|
7679
|
-
]), headerStyleRepairChain([
|
|
7680
|
-
"brand-capsule",
|
|
7681
|
-
"brand-pill",
|
|
7682
|
-
"brand-bar",
|
|
7683
|
-
"minimal"
|
|
7684
|
-
]), headerStyleRepairChain([
|
|
7685
|
-
"pill-nav",
|
|
7686
|
-
"soft-bar",
|
|
7687
|
-
"minimal"
|
|
7688
|
-
]), headerStyleRepairChain([
|
|
7689
|
-
"flat-tabs",
|
|
7690
|
-
"pill-nav",
|
|
7691
|
-
"minimal"
|
|
7692
|
-
]), headerStyleRepairChain([
|
|
7693
|
-
"serif-line",
|
|
7694
|
-
"fine-line",
|
|
7695
|
-
"minimal"
|
|
7696
|
-
]), headerStyleRepairChain([
|
|
7697
|
-
"glass",
|
|
7698
|
-
"soft-shell",
|
|
7699
|
-
"fine-line",
|
|
7700
|
-
"minimal-surface",
|
|
7701
|
-
"minimal"
|
|
7702
|
-
]), headerStyleRepairChain([
|
|
7703
|
-
"soft-shell",
|
|
7704
|
-
"soft-bar",
|
|
7705
|
-
"minimal"
|
|
7706
|
-
]), headerStyleRepairChain(["minimal-surface", "minimal"]), headerStyleRepairChain([
|
|
7707
|
-
"split-glass",
|
|
7708
|
-
"glass",
|
|
7709
|
-
"minimal-surface"
|
|
7710
|
-
]), headerStyleRepairChain([
|
|
7711
|
-
"split-pill",
|
|
7712
|
-
"soft-shell",
|
|
7713
|
-
"brand-pill"
|
|
7714
|
-
]), headerStyleRepairChain(["fine-line", "minimal"]), headerStyleRepairChain(["soft-bar", "minimal"]), headerStyleRepairChain(["minimal"]);
|
|
7715
|
-
const legacyHeaderLookAliases = defineExactCatalog()([
|
|
7716
|
-
{
|
|
7717
|
-
lookId: asHeaderLookId("clean-base"),
|
|
7718
|
-
selection: {
|
|
7719
|
-
layoutId: asHeaderLayoutId("classic"),
|
|
7720
|
-
styleId: asHeaderStyleId("minimal")
|
|
7721
|
-
}
|
|
7722
|
-
},
|
|
7723
|
-
{
|
|
7724
|
-
lookId: asHeaderLookId("classic-centered-nav"),
|
|
7725
|
-
selection: {
|
|
7726
|
-
layoutId: asHeaderLayoutId("classic"),
|
|
7727
|
-
styleId: asHeaderStyleId("fine-line")
|
|
7728
|
-
}
|
|
7729
|
-
},
|
|
7730
|
-
{
|
|
7731
|
-
lookId: asHeaderLookId("brand-solid"),
|
|
7732
|
-
selection: {
|
|
7733
|
-
layoutId: asHeaderLayoutId("classic"),
|
|
7734
|
-
styleId: asHeaderStyleId("brand-bar")
|
|
7735
|
-
}
|
|
7736
|
-
},
|
|
7737
|
-
{
|
|
7738
|
-
lookId: asHeaderLookId("serif-line"),
|
|
7739
|
-
selection: {
|
|
7740
|
-
layoutId: asHeaderLayoutId("centered"),
|
|
7741
|
-
styleId: asHeaderStyleId("serif-line")
|
|
7742
|
-
}
|
|
7743
|
-
},
|
|
7744
|
-
{
|
|
7745
|
-
lookId: asHeaderLookId("centered-calm"),
|
|
7746
|
-
selection: {
|
|
7747
|
-
layoutId: asHeaderLayoutId("centered"),
|
|
7748
|
-
styleId: asHeaderStyleId("minimal")
|
|
7749
|
-
}
|
|
7750
|
-
},
|
|
7751
|
-
{
|
|
7752
|
-
lookId: asHeaderLookId("practical-utility"),
|
|
7753
|
-
selection: {
|
|
7754
|
-
layoutId: asHeaderLayoutId("classic"),
|
|
7755
|
-
styleId: asHeaderStyleId("flat-tabs")
|
|
7756
|
-
}
|
|
7757
|
-
},
|
|
7758
|
-
{
|
|
7759
|
-
lookId: asHeaderLookId("minimal-transparent"),
|
|
7760
|
-
selection: {
|
|
7761
|
-
layoutId: asHeaderLayoutId("classic"),
|
|
7762
|
-
styleId: asHeaderStyleId("minimal")
|
|
7763
|
-
}
|
|
7764
|
-
},
|
|
7765
|
-
{
|
|
7766
|
-
lookId: asHeaderLookId("transparent-overlay"),
|
|
7767
|
-
selection: {
|
|
7768
|
-
layoutId: asHeaderLayoutId("floating"),
|
|
7769
|
-
styleId: asHeaderStyleId("glass")
|
|
7770
|
-
}
|
|
7512
|
+
logoAccommodations: centeredLogoAccommodations,
|
|
7513
|
+
openingRequirement: "none"
|
|
7771
7514
|
},
|
|
7772
|
-
{
|
|
7773
|
-
|
|
7774
|
-
|
|
7775
|
-
|
|
7776
|
-
styleId: asHeaderStyleId("glass")
|
|
7777
|
-
}
|
|
7778
|
-
}
|
|
7779
|
-
]);
|
|
7780
|
-
const legacyHeaderLookAliasesById = new Map(legacyHeaderLookAliases.map((alias) => [alias.lookId, alias]));
|
|
7781
|
-
function getHeaderStyle(id) {
|
|
7782
|
-
return headerStylesById.get(id) ?? null;
|
|
7783
|
-
}
|
|
7784
|
-
function isHeaderStyleCompatibleWithLayout(style, layoutId) {
|
|
7785
|
-
return style.supportedLayoutIds.includes(layoutId);
|
|
7786
|
-
}
|
|
7787
|
-
function getHeaderStyleOrThrow(id) {
|
|
7788
|
-
const style = getHeaderStyle(id);
|
|
7789
|
-
if (!style) throw new Error(`Unknown Theme V2 header style: ${id}`);
|
|
7790
|
-
return style;
|
|
7791
|
-
}
|
|
7792
|
-
function resolveLegacyHeaderLookAlias(lookId) {
|
|
7793
|
-
return legacyHeaderLookAliasesById.get(lookId)?.selection ?? null;
|
|
7794
|
-
}
|
|
7795
|
-
function getCompatibleHeaderStyleIds(layoutId) {
|
|
7796
|
-
return (headerStyleCompatibilityOrder.get(layoutId) ?? []).filter((styleId) => {
|
|
7797
|
-
return isHeaderStyleCompatibleWithLayout(getHeaderStyleOrThrow(styleId), layoutId);
|
|
7798
|
-
});
|
|
7799
|
-
}
|
|
7800
|
-
function applyNavTypography(style, typography) {
|
|
7801
|
-
switch (typography) {
|
|
7802
|
-
case "plain": return style;
|
|
7803
|
-
case "heading": return {
|
|
7804
|
-
...style,
|
|
7805
|
-
typography: "heading",
|
|
7806
|
-
fontWeight: "medium",
|
|
7807
|
-
letterSpacing: "wide"
|
|
7808
|
-
};
|
|
7809
|
-
case "quiet-caps": return {
|
|
7810
|
-
...style,
|
|
7811
|
-
textTransform: "uppercase",
|
|
7812
|
-
textSize: "sm",
|
|
7813
|
-
letterSpacing: "wide"
|
|
7814
|
-
};
|
|
7815
|
-
case "brand-caps": return {
|
|
7816
|
-
...style,
|
|
7817
|
-
textTransform: "uppercase",
|
|
7818
|
-
textSize: "sm",
|
|
7819
|
-
letterSpacing: "wider"
|
|
7820
|
-
};
|
|
7821
|
-
default: return assertNever(typography, "Unhandled header nav typography");
|
|
7822
|
-
}
|
|
7823
|
-
}
|
|
7824
|
-
function underlineNavLinkStyle(colorToken, underlineColorToken, typography = "plain") {
|
|
7825
|
-
return applyNavTypography({
|
|
7826
|
-
name: "Underline grow",
|
|
7827
|
-
typography: "body",
|
|
7828
|
-
fontWeight: "medium",
|
|
7829
|
-
textTransform: "none",
|
|
7830
|
-
italic: false,
|
|
7831
|
-
colorToken,
|
|
7832
|
-
padding: "compact",
|
|
7833
|
-
paddingX: "compact",
|
|
7834
|
-
borderRadius: "none",
|
|
7835
|
-
effects: { hover: [{
|
|
7836
|
-
effectId: "nav-underline",
|
|
7837
|
-
options: {
|
|
7838
|
-
style: "grow",
|
|
7839
|
-
...underlineColorToken ? { colorToken: underlineColorToken } : {}
|
|
7840
|
-
}
|
|
7841
|
-
}] }
|
|
7842
|
-
}, typography);
|
|
7843
|
-
}
|
|
7844
|
-
function themedHeaderShadow(theme) {
|
|
7845
|
-
switch (theme.shadow.elevation) {
|
|
7846
|
-
case "none": return;
|
|
7847
|
-
case "low": return { elevation: "sm" };
|
|
7848
|
-
case "medium": return { elevation: "md" };
|
|
7849
|
-
case "high": return { elevation: "lg" };
|
|
7850
|
-
default: return assertNever(theme.shadow.elevation, "Unhandled theme shadow elevation");
|
|
7851
|
-
}
|
|
7852
|
-
}
|
|
7853
|
-
function solidBrandHeader(theme) {
|
|
7854
|
-
const ctaVariant = resolveHeaderCtaVariant(theme, "inverted");
|
|
7855
|
-
return {
|
|
7856
|
-
...baseHeader(theme),
|
|
7857
|
-
variant: "classic",
|
|
7858
|
-
positioning: "sticky",
|
|
7859
|
-
shrinkOnScroll: true,
|
|
7860
|
-
background: {
|
|
7861
|
-
type: "color",
|
|
7862
|
-
color: "primary"
|
|
7863
|
-
},
|
|
7864
|
-
textColor: "primaryForeground",
|
|
7865
|
-
navColor: "primaryForeground",
|
|
7866
|
-
navStyle: "underline-grow",
|
|
7867
|
-
navWeight: "bold",
|
|
7868
|
-
navLinkStyle: {
|
|
7869
|
-
typography: "body",
|
|
7870
|
-
fontWeight: "bold",
|
|
7871
|
-
textTransform: "uppercase",
|
|
7872
|
-
italic: false,
|
|
7873
|
-
colorToken: "primaryForeground",
|
|
7874
|
-
hoverColorToken: "secondary",
|
|
7875
|
-
textSize: "sm",
|
|
7876
|
-
letterSpacing: "wider",
|
|
7877
|
-
padding: "compact",
|
|
7878
|
-
paddingX: "compact",
|
|
7879
|
-
borderRadius: "none",
|
|
7880
|
-
effects: { hover: [{
|
|
7881
|
-
effectId: "text-color-change",
|
|
7882
|
-
options: { hoverColorToken: "secondary" }
|
|
7883
|
-
}, {
|
|
7884
|
-
effectId: "nav-underline",
|
|
7885
|
-
options: {
|
|
7886
|
-
style: "grow",
|
|
7887
|
-
colorToken: "secondary"
|
|
7888
|
-
}
|
|
7889
|
-
}] }
|
|
7890
|
-
},
|
|
7891
|
-
dropdownStyle: {
|
|
7892
|
-
background: "primary-700",
|
|
7893
|
-
textColor: "primaryForeground",
|
|
7894
|
-
borderColor: null,
|
|
7895
|
-
shadow: "md",
|
|
7896
|
-
borderRadius: "md",
|
|
7897
|
-
hoverBackground: "primary-900",
|
|
7898
|
-
hoverTextColor: "secondary",
|
|
7899
|
-
textTransform: "uppercase",
|
|
7900
|
-
letterSpacing: "wider",
|
|
7901
|
-
fontWeight: "bold",
|
|
7902
|
-
textSize: "sm"
|
|
7903
|
-
},
|
|
7904
|
-
border: {
|
|
7905
|
-
style: "solid",
|
|
7906
|
-
width: "none",
|
|
7907
|
-
position: "none"
|
|
7908
|
-
},
|
|
7909
|
-
logoText: {
|
|
7910
|
-
hideOnShrink: true,
|
|
7911
|
-
mobileMaxWidth: "sm",
|
|
7912
|
-
mobileWrapLines: 2
|
|
7913
|
-
},
|
|
7914
|
-
ctaGap: "compact",
|
|
7915
|
-
ctaTreatment: "inverted",
|
|
7916
|
-
...ctaVariant ? { ctaVariant } : {}
|
|
7917
|
-
};
|
|
7918
|
-
}
|
|
7919
|
-
function cleanBaseHeader(theme) {
|
|
7920
|
-
return {
|
|
7921
|
-
...baseHeader(theme),
|
|
7922
|
-
variant: "classic",
|
|
7923
|
-
positioning: "sticky",
|
|
7924
|
-
shrinkOnScroll: false,
|
|
7925
|
-
background: {
|
|
7926
|
-
type: "color",
|
|
7927
|
-
color: "surface"
|
|
7928
|
-
},
|
|
7929
|
-
textColor: "text",
|
|
7930
|
-
navColor: "text",
|
|
7931
|
-
navStyle: "minimal",
|
|
7932
|
-
navWeight: "medium",
|
|
7933
|
-
border: {
|
|
7934
|
-
style: "solid",
|
|
7935
|
-
width: "thin",
|
|
7936
|
-
position: "bottom",
|
|
7937
|
-
colorToken: "border"
|
|
7938
|
-
},
|
|
7939
|
-
ctaTreatment: "default",
|
|
7940
|
-
ctaGap: "default"
|
|
7941
|
-
};
|
|
7942
|
-
}
|
|
7943
|
-
function classicCenteredNavHeader(theme) {
|
|
7944
|
-
return {
|
|
7945
|
-
...baseHeader(theme),
|
|
7946
|
-
variant: "classic",
|
|
7947
|
-
navPlacement: "center",
|
|
7948
|
-
positioning: "sticky",
|
|
7949
|
-
shrinkOnScroll: false,
|
|
7950
|
-
background: {
|
|
7951
|
-
type: "color",
|
|
7952
|
-
color: "surface"
|
|
7953
|
-
},
|
|
7954
|
-
textColor: "text",
|
|
7955
|
-
navColor: "text",
|
|
7956
|
-
navStyle: "underline-grow",
|
|
7957
|
-
navWeight: "medium",
|
|
7958
|
-
navLinkStyle: underlineNavLinkStyle("text", "accent"),
|
|
7959
|
-
border: {
|
|
7960
|
-
style: "solid",
|
|
7961
|
-
width: "thin",
|
|
7962
|
-
position: "bottom",
|
|
7963
|
-
colorToken: "border"
|
|
7964
|
-
},
|
|
7965
|
-
ctaTreatment: "primary",
|
|
7966
|
-
ctaVariant: resolveHeaderCtaVariant(theme, "primary"),
|
|
7967
|
-
ctaGap: "default",
|
|
7968
|
-
logoText: {
|
|
7969
|
-
mobileMaxWidth: "sm",
|
|
7970
|
-
mobileWrapLines: 1,
|
|
7971
|
-
hideOnShrink: false
|
|
7972
|
-
}
|
|
7973
|
-
};
|
|
7974
|
-
}
|
|
7975
|
-
function serifLineHeader(theme) {
|
|
7976
|
-
return {
|
|
7977
|
-
...baseHeader(theme),
|
|
7978
|
-
variant: "centered",
|
|
7979
|
-
positioning: "sticky",
|
|
7980
|
-
shrinkOnScroll: false,
|
|
7981
|
-
background: {
|
|
7982
|
-
type: "color",
|
|
7983
|
-
color: "background"
|
|
7984
|
-
},
|
|
7985
|
-
textColor: "text",
|
|
7986
|
-
navColor: "text",
|
|
7987
|
-
navStyle: "underline-grow",
|
|
7988
|
-
navWeight: "medium",
|
|
7989
|
-
logo: {
|
|
7990
|
-
fontFamily: "heading",
|
|
7991
|
-
letterSpacing: "wide",
|
|
7992
|
-
gradient: false
|
|
7993
|
-
},
|
|
7994
|
-
border: {
|
|
7995
|
-
style: "solid",
|
|
7996
|
-
width: "none",
|
|
7997
|
-
position: "none"
|
|
7998
|
-
},
|
|
7999
|
-
shadow: { elevation: "none" },
|
|
8000
|
-
ctaTreatment: "outline",
|
|
8001
|
-
ctaVariant: resolveHeaderCtaVariant(theme, "outline"),
|
|
8002
|
-
ctaGap: "relaxed"
|
|
8003
|
-
};
|
|
8004
|
-
}
|
|
8005
|
-
function centeredCalmHeader(theme) {
|
|
8006
|
-
return {
|
|
8007
|
-
...baseHeader(theme),
|
|
8008
|
-
variant: "centered",
|
|
8009
|
-
positioning: "static",
|
|
8010
|
-
shrinkOnScroll: false,
|
|
8011
|
-
background: {
|
|
8012
|
-
type: "color",
|
|
8013
|
-
color: "surface"
|
|
8014
|
-
},
|
|
8015
|
-
textColor: "text",
|
|
8016
|
-
navColor: "text",
|
|
8017
|
-
navStyle: "minimal",
|
|
8018
|
-
navWeight: "medium",
|
|
8019
|
-
ctaTreatment: "ghost",
|
|
8020
|
-
ctaVariant: resolveHeaderCtaVariant(theme, "ghost"),
|
|
8021
|
-
ctaGap: "none"
|
|
8022
|
-
};
|
|
8023
|
-
}
|
|
8024
|
-
function practicalUtilityHeader(theme) {
|
|
8025
|
-
return {
|
|
8026
|
-
...baseHeader(theme),
|
|
8027
|
-
variant: "classic",
|
|
8028
|
-
positioning: "sticky",
|
|
8029
|
-
shrinkOnScroll: true,
|
|
8030
|
-
background: {
|
|
8031
|
-
type: "color",
|
|
8032
|
-
color: "surface"
|
|
8033
|
-
},
|
|
8034
|
-
textColor: "text",
|
|
8035
|
-
navColor: "text",
|
|
8036
|
-
navStyle: "solid",
|
|
8037
|
-
navWeight: "semibold",
|
|
8038
|
-
shadow: themedHeaderShadow(theme),
|
|
8039
|
-
border: {
|
|
8040
|
-
style: "solid",
|
|
8041
|
-
width: "thin",
|
|
8042
|
-
position: "bottom",
|
|
8043
|
-
colorToken: "border"
|
|
8044
|
-
},
|
|
8045
|
-
ctaTreatment: "primary",
|
|
8046
|
-
ctaVariant: resolveHeaderCtaVariant(theme, "primary"),
|
|
8047
|
-
ctaGap: "compact",
|
|
8048
|
-
logoText: {
|
|
8049
|
-
mobileMaxWidth: "sm",
|
|
8050
|
-
mobileWrapLines: 1,
|
|
8051
|
-
hideOnShrink: false
|
|
8052
|
-
}
|
|
8053
|
-
};
|
|
8054
|
-
}
|
|
8055
|
-
function minimalTransparentHeader(theme) {
|
|
8056
|
-
return {
|
|
8057
|
-
...baseHeader(theme),
|
|
8058
|
-
variant: "classic",
|
|
8059
|
-
positioning: "static",
|
|
8060
|
-
shrinkOnScroll: false,
|
|
8061
|
-
background: {
|
|
8062
|
-
type: "color",
|
|
8063
|
-
color: "transparent"
|
|
8064
|
-
},
|
|
8065
|
-
textColor: "text",
|
|
8066
|
-
navColor: "text",
|
|
8067
|
-
navStyle: "underline",
|
|
8068
|
-
navWeight: "medium",
|
|
8069
|
-
border: {
|
|
8070
|
-
style: "solid",
|
|
8071
|
-
width: "none",
|
|
8072
|
-
position: "none"
|
|
8073
|
-
},
|
|
8074
|
-
ctaTreatment: "outline",
|
|
8075
|
-
ctaVariant: resolveHeaderCtaVariant(theme, "outline"),
|
|
8076
|
-
ctaGap: "default"
|
|
8077
|
-
};
|
|
8078
|
-
}
|
|
8079
|
-
function transparentOverlayHeader(theme) {
|
|
8080
|
-
return {
|
|
8081
|
-
...baseHeader(theme),
|
|
8082
|
-
variant: "transparent",
|
|
8083
|
-
positioning: "fixed",
|
|
8084
|
-
shrinkOnScroll: true,
|
|
8085
|
-
background: {
|
|
8086
|
-
type: "color",
|
|
8087
|
-
color: "transparent"
|
|
8088
|
-
},
|
|
8089
|
-
textColor: "background",
|
|
8090
|
-
navColor: "background",
|
|
8091
|
-
navStyle: "frosted",
|
|
8092
|
-
navWeight: "semibold",
|
|
8093
|
-
border: {
|
|
8094
|
-
style: "solid",
|
|
8095
|
-
width: "none",
|
|
8096
|
-
position: "none"
|
|
8097
|
-
},
|
|
8098
|
-
ctaTreatment: "inverted",
|
|
8099
|
-
ctaVariant: resolveHeaderCtaVariant(theme, "inverted"),
|
|
8100
|
-
ctaGap: "compact"
|
|
8101
|
-
};
|
|
8102
|
-
}
|
|
8103
|
-
function floatingGlassHeader(theme) {
|
|
8104
|
-
return {
|
|
8105
|
-
...transparentOverlayHeader(theme),
|
|
7515
|
+
{
|
|
7516
|
+
id: asHeaderLayoutId("floating"),
|
|
7517
|
+
label: "Floating",
|
|
7518
|
+
description: "Detached header chrome that sits over the opening section.",
|
|
8106
7519
|
variant: "floating",
|
|
8107
|
-
|
|
8108
|
-
|
|
8109
|
-
|
|
8110
|
-
|
|
8111
|
-
|
|
8112
|
-
|
|
8113
|
-
|
|
8114
|
-
|
|
8115
|
-
rounded: "2xl",
|
|
8116
|
-
border: true,
|
|
8117
|
-
shadow: true,
|
|
8118
|
-
padding: "sm",
|
|
8119
|
-
tint: "background",
|
|
8120
|
-
opacity: .12
|
|
8121
|
-
}
|
|
8122
|
-
};
|
|
7520
|
+
defaultPositioning: "sticky",
|
|
7521
|
+
shrinkOnScroll: true,
|
|
7522
|
+
logoAccommodations: overlayLogoAccommodations,
|
|
7523
|
+
openingRequirement: "requires-image-hero-with-contrast-overlay"
|
|
7524
|
+
}
|
|
7525
|
+
]);
|
|
7526
|
+
function supportedLayouts(ids) {
|
|
7527
|
+
return ids.map(asHeaderLayoutId);
|
|
8123
7528
|
}
|
|
8124
|
-
const
|
|
7529
|
+
const headerStyleCatalog = defineExactCatalog()([
|
|
8125
7530
|
{
|
|
8126
|
-
id:
|
|
8127
|
-
label: "
|
|
8128
|
-
|
|
8129
|
-
|
|
8130
|
-
|
|
7531
|
+
id: asHeaderStyleId("minimal"),
|
|
7532
|
+
label: "Minimal",
|
|
7533
|
+
description: "Quiet surface with simple color-change navigation.",
|
|
7534
|
+
supportedLayoutIds: supportedLayouts(["classic", "centered"]),
|
|
7535
|
+
navTypography: "plain"
|
|
8131
7536
|
},
|
|
8132
7537
|
{
|
|
8133
|
-
id:
|
|
8134
|
-
label: "
|
|
8135
|
-
|
|
8136
|
-
|
|
8137
|
-
|
|
8138
|
-
compile: classicCenteredNavHeader
|
|
7538
|
+
id: asHeaderStyleId("fine-line"),
|
|
7539
|
+
label: "Seamless",
|
|
7540
|
+
description: "Borderless surface with underline hover for a quieter page transition.",
|
|
7541
|
+
supportedLayoutIds: supportedLayouts(["classic", "centered"]),
|
|
7542
|
+
navTypography: "plain"
|
|
8139
7543
|
},
|
|
8140
7544
|
{
|
|
8141
|
-
id:
|
|
8142
|
-
label: "
|
|
8143
|
-
|
|
8144
|
-
|
|
8145
|
-
|
|
7545
|
+
id: asHeaderStyleId("soft-bar"),
|
|
7546
|
+
label: "Soft Bar",
|
|
7547
|
+
description: "Soft tinted surface with gentle pill hover states.",
|
|
7548
|
+
supportedLayoutIds: supportedLayouts(["classic", "centered"]),
|
|
7549
|
+
navTypography: "plain"
|
|
8146
7550
|
},
|
|
8147
7551
|
{
|
|
8148
|
-
id:
|
|
8149
|
-
label: "
|
|
8150
|
-
|
|
8151
|
-
|
|
8152
|
-
|
|
8153
|
-
compile: serifLineHeader
|
|
7552
|
+
id: asHeaderStyleId("pill-nav"),
|
|
7553
|
+
label: "Pill Nav",
|
|
7554
|
+
description: "A calm pill navigation rail over a neutral header.",
|
|
7555
|
+
supportedLayoutIds: supportedLayouts(["classic", "centered"]),
|
|
7556
|
+
navTypography: "plain"
|
|
8154
7557
|
},
|
|
8155
7558
|
{
|
|
8156
|
-
id:
|
|
8157
|
-
label: "
|
|
8158
|
-
|
|
8159
|
-
|
|
8160
|
-
|
|
8161
|
-
compile: centeredCalmHeader
|
|
7559
|
+
id: asHeaderStyleId("brand-bar"),
|
|
7560
|
+
label: "Brand Bar",
|
|
7561
|
+
description: "Solid brand surface with high-contrast navigation.",
|
|
7562
|
+
supportedLayoutIds: supportedLayouts(["classic", "centered"]),
|
|
7563
|
+
navTypography: "brand-caps"
|
|
8162
7564
|
},
|
|
8163
7565
|
{
|
|
8164
|
-
id:
|
|
8165
|
-
label: "
|
|
8166
|
-
|
|
8167
|
-
|
|
8168
|
-
|
|
8169
|
-
compile: practicalUtilityHeader
|
|
7566
|
+
id: asHeaderStyleId("brand-underline"),
|
|
7567
|
+
label: "Brand Underline",
|
|
7568
|
+
description: "Brand surface with underline-grow navigation.",
|
|
7569
|
+
supportedLayoutIds: supportedLayouts(["classic"]),
|
|
7570
|
+
navTypography: "brand-caps"
|
|
8170
7571
|
},
|
|
8171
7572
|
{
|
|
8172
|
-
id:
|
|
8173
|
-
label: "
|
|
8174
|
-
|
|
8175
|
-
|
|
8176
|
-
|
|
7573
|
+
id: asHeaderStyleId("brand-pill"),
|
|
7574
|
+
label: "Brand Pill",
|
|
7575
|
+
description: "Solid brand surface with rounded active and hover states.",
|
|
7576
|
+
supportedLayoutIds: supportedLayouts([
|
|
7577
|
+
"classic",
|
|
7578
|
+
"centered",
|
|
7579
|
+
"floating"
|
|
7580
|
+
]),
|
|
7581
|
+
navTypography: "brand-caps"
|
|
8177
7582
|
},
|
|
8178
7583
|
{
|
|
8179
|
-
id:
|
|
8180
|
-
label: "
|
|
8181
|
-
|
|
8182
|
-
|
|
8183
|
-
|
|
8184
|
-
compile: transparentOverlayHeader
|
|
7584
|
+
id: asHeaderStyleId("brand-capsule"),
|
|
7585
|
+
label: "Brand Capsule",
|
|
7586
|
+
description: "Solid brand chrome designed as a floating capsule, with quiet-caps nav, a soft pill active state, and an inverted CTA pill.",
|
|
7587
|
+
supportedLayoutIds: supportedLayouts(["classic"]),
|
|
7588
|
+
navTypography: "quiet-caps"
|
|
8185
7589
|
},
|
|
8186
7590
|
{
|
|
8187
|
-
id:
|
|
8188
|
-
label: "
|
|
8189
|
-
|
|
8190
|
-
|
|
8191
|
-
|
|
8192
|
-
|
|
7591
|
+
id: asHeaderStyleId("serif-line"),
|
|
7592
|
+
label: "Serif Line",
|
|
7593
|
+
description: "Typographic logo treatment with understated underline navigation.",
|
|
7594
|
+
supportedLayoutIds: supportedLayouts(["classic", "centered"]),
|
|
7595
|
+
navTypography: "heading"
|
|
7596
|
+
},
|
|
7597
|
+
{
|
|
7598
|
+
id: asHeaderStyleId("flat-tabs"),
|
|
7599
|
+
label: "Flat Tabs",
|
|
7600
|
+
description: "Flat block hover and active states with a Swiss utility feel.",
|
|
7601
|
+
supportedLayoutIds: supportedLayouts(["classic", "centered"]),
|
|
7602
|
+
navTypography: "quiet-caps"
|
|
7603
|
+
},
|
|
7604
|
+
{
|
|
7605
|
+
id: asHeaderStyleId("glass"),
|
|
7606
|
+
label: "Glass",
|
|
7607
|
+
description: "Translucent chrome with frosted navigation backing.",
|
|
7608
|
+
supportedLayoutIds: supportedLayouts(["floating"]),
|
|
7609
|
+
navTypography: "plain"
|
|
7610
|
+
},
|
|
7611
|
+
{
|
|
7612
|
+
id: asHeaderStyleId("minimal-surface"),
|
|
7613
|
+
label: "Clear Split",
|
|
7614
|
+
description: "Floating logo with transparent navigation and no shared shell.",
|
|
7615
|
+
supportedLayoutIds: supportedLayouts(["floating"]),
|
|
7616
|
+
navTypography: "plain",
|
|
7617
|
+
openingForegroundTarget: "all",
|
|
7618
|
+
scrollTreatment: "contrast-glass",
|
|
7619
|
+
interactionPalette: clearSplitInteractionPalette
|
|
7620
|
+
},
|
|
7621
|
+
{
|
|
7622
|
+
id: asHeaderStyleId("soft-shell"),
|
|
7623
|
+
label: "Soft Shell",
|
|
7624
|
+
description: "Floating rounded shell with soft pill navigation states.",
|
|
7625
|
+
supportedLayoutIds: supportedLayouts(["floating"]),
|
|
7626
|
+
navTypography: "plain"
|
|
7627
|
+
},
|
|
7628
|
+
{
|
|
7629
|
+
id: asHeaderStyleId("split-glass"),
|
|
7630
|
+
label: "Split Glass",
|
|
7631
|
+
description: "Logo floats independently while the navigation sits in a glass rail.",
|
|
7632
|
+
supportedLayoutIds: supportedLayouts(["floating"]),
|
|
7633
|
+
navTypography: "quiet-caps",
|
|
7634
|
+
openingForegroundTarget: "brand-only"
|
|
7635
|
+
},
|
|
7636
|
+
{
|
|
7637
|
+
id: asHeaderStyleId("split-pill"),
|
|
7638
|
+
label: "Split Pill",
|
|
7639
|
+
description: "Logo floats independently with a soft pill-backed navigation rail.",
|
|
7640
|
+
supportedLayoutIds: supportedLayouts(["floating"]),
|
|
7641
|
+
navTypography: "heading",
|
|
7642
|
+
openingForegroundTarget: "brand-only"
|
|
8193
7643
|
}
|
|
8194
7644
|
]);
|
|
8195
|
-
new Map(
|
|
7645
|
+
new Map(headerLayoutCatalog.map((layout) => [layout.id, layout]));
|
|
7646
|
+
new Map(headerStyleCatalog.map((style) => [style.id, style]));
|
|
8196
7647
|
//#endregion
|
|
8197
7648
|
//#region ../theme-core/src/site-styles/footerLooks.ts
|
|
8198
7649
|
function asFooterLookId(value) {
|
|
@@ -8767,75 +8218,75 @@ function defaultTypographyForRecipe(recipe) {
|
|
|
8767
8218
|
case "classic-serif": return classicSerifTypography;
|
|
8768
8219
|
}
|
|
8769
8220
|
}
|
|
8770
|
-
const designResolutionPolicySchema = z
|
|
8221
|
+
const designResolutionPolicySchema = z.enum([
|
|
8771
8222
|
"generated",
|
|
8772
8223
|
"user",
|
|
8773
8224
|
"admin",
|
|
8774
8225
|
"sdk"
|
|
8775
8226
|
]);
|
|
8776
|
-
const runtimeStyleFieldNameSchema = z
|
|
8777
|
-
const nonEmptyRuntimeStyleFieldNamesSchema = z
|
|
8778
|
-
const heroLegibilityStrategySchema = z
|
|
8227
|
+
const runtimeStyleFieldNameSchema = z.enum(themeV2RuntimeStyleFieldNames);
|
|
8228
|
+
const nonEmptyRuntimeStyleFieldNamesSchema = z.array(runtimeStyleFieldNameSchema).min(1).transform((fields) => [fields[0], ...fields.slice(1)]);
|
|
8229
|
+
const heroLegibilityStrategySchema = z.enum([
|
|
8779
8230
|
"none",
|
|
8780
8231
|
"scrim-gradient",
|
|
8781
8232
|
"solid-panel"
|
|
8782
8233
|
]);
|
|
8783
|
-
const heroCompositionIntentSchema = z
|
|
8784
|
-
const heroTypographyScaleIntentSchema = z
|
|
8234
|
+
const heroCompositionIntentSchema = z.enum(["center", "bottom-left"]);
|
|
8235
|
+
const heroTypographyScaleIntentSchema = z.enum([
|
|
8785
8236
|
"quiet",
|
|
8786
8237
|
"editorial",
|
|
8787
8238
|
"display",
|
|
8788
8239
|
"poster"
|
|
8789
8240
|
]);
|
|
8790
|
-
const sectionHeightIntentSchema = z
|
|
8241
|
+
const sectionHeightIntentSchema = z.enum([
|
|
8791
8242
|
"default",
|
|
8792
8243
|
"banner",
|
|
8793
8244
|
"hero",
|
|
8794
8245
|
"immersive"
|
|
8795
8246
|
]);
|
|
8796
|
-
const imageSurfaceTreatmentIntensitySchema = z
|
|
8247
|
+
const imageSurfaceTreatmentIntensitySchema = z.enum([
|
|
8797
8248
|
"soft",
|
|
8798
8249
|
"balanced",
|
|
8799
8250
|
"strong"
|
|
8800
8251
|
]);
|
|
8801
|
-
const imageSurfaceMotionSchema = z
|
|
8802
|
-
const imageSurfaceTreatmentSchema = z
|
|
8803
|
-
z
|
|
8804
|
-
z
|
|
8805
|
-
kind: z
|
|
8806
|
-
token: z
|
|
8252
|
+
const imageSurfaceMotionSchema = z.enum(["static", "fixed-frame"]);
|
|
8253
|
+
const imageSurfaceTreatmentSchema = z.discriminatedUnion("kind", [
|
|
8254
|
+
z.object({ kind: z.literal("none") }).strict(),
|
|
8255
|
+
z.object({
|
|
8256
|
+
kind: z.literal("brand-scrim"),
|
|
8257
|
+
token: z.enum([
|
|
8807
8258
|
"primary",
|
|
8808
8259
|
"secondary",
|
|
8809
8260
|
"accent"
|
|
8810
8261
|
]),
|
|
8811
8262
|
intensity: imageSurfaceTreatmentIntensitySchema.optional()
|
|
8812
8263
|
}).strict(),
|
|
8813
|
-
z
|
|
8814
|
-
kind: z
|
|
8815
|
-
token: z
|
|
8264
|
+
z.object({
|
|
8265
|
+
kind: z.literal("brand-wash"),
|
|
8266
|
+
token: z.enum([
|
|
8816
8267
|
"primary",
|
|
8817
8268
|
"secondary",
|
|
8818
8269
|
"accent"
|
|
8819
8270
|
]),
|
|
8820
8271
|
intensity: imageSurfaceTreatmentIntensitySchema.optional()
|
|
8821
8272
|
}).strict(),
|
|
8822
|
-
z
|
|
8823
|
-
kind: z
|
|
8273
|
+
z.object({
|
|
8274
|
+
kind: z.literal("neutral-scrim"),
|
|
8824
8275
|
intensity: imageSurfaceTreatmentIntensitySchema.optional()
|
|
8825
8276
|
}).strict(),
|
|
8826
|
-
z
|
|
8827
|
-
kind: z
|
|
8277
|
+
z.object({
|
|
8278
|
+
kind: z.literal("neutral-wash"),
|
|
8828
8279
|
intensity: imageSurfaceTreatmentIntensitySchema.optional()
|
|
8829
8280
|
}).strict(),
|
|
8830
|
-
z
|
|
8831
|
-
kind: z
|
|
8281
|
+
z.object({
|
|
8282
|
+
kind: z.literal("solid-panel"),
|
|
8832
8283
|
intensity: imageSurfaceTreatmentIntensitySchema.optional()
|
|
8833
8284
|
}).strict()
|
|
8834
8285
|
]);
|
|
8835
|
-
const testimonialCardTreatmentSchema = z
|
|
8836
|
-
const tileTreatmentSchema = z
|
|
8837
|
-
const eventListTreatmentSchema = z
|
|
8838
|
-
const eyebrowTreatmentSchema = z
|
|
8286
|
+
const testimonialCardTreatmentSchema = z.enum(["default", "accent-quote"]);
|
|
8287
|
+
const tileTreatmentSchema = z.enum(tileTreatmentValues);
|
|
8288
|
+
const eventListTreatmentSchema = z.enum(eventListTreatmentValues);
|
|
8289
|
+
const eyebrowTreatmentSchema = z.enum(eyebrowTreatmentValues);
|
|
8839
8290
|
function uniqueNonEmpty(values) {
|
|
8840
8291
|
const uniqueValues = [...new Set(values)];
|
|
8841
8292
|
const firstValue = uniqueValues[0];
|
|
@@ -8845,27 +8296,27 @@ function uniqueNonEmpty(values) {
|
|
|
8845
8296
|
const userPanelTreatments = uniqueNonEmpty(userDesignOptionCatalog.contentFrames.filter((frame) => frame.kind === "panel").map((frame) => frame.treatment));
|
|
8846
8297
|
const userFlushTreatments = uniqueNonEmpty(userDesignOptionCatalog.contentFrames.filter((frame) => frame.kind === "flush-panel").map((frame) => frame.treatment));
|
|
8847
8298
|
const userFlushBleeds = uniqueNonEmpty(userDesignOptionCatalog.contentFrames.filter((frame) => frame.kind === "flush-panel").map((frame) => frame.bleed));
|
|
8848
|
-
const contentFrameIntentSchema = z
|
|
8849
|
-
z
|
|
8850
|
-
z
|
|
8851
|
-
kind: z
|
|
8852
|
-
treatment: z
|
|
8299
|
+
const contentFrameIntentSchema = z.discriminatedUnion("kind", [
|
|
8300
|
+
z.object({ kind: z.literal("plain") }).strict(),
|
|
8301
|
+
z.object({
|
|
8302
|
+
kind: z.literal("panel"),
|
|
8303
|
+
treatment: z.enum(userPanelTreatments)
|
|
8853
8304
|
}).strict(),
|
|
8854
|
-
z
|
|
8855
|
-
kind: z
|
|
8856
|
-
treatment: z
|
|
8857
|
-
bleed: z
|
|
8305
|
+
z.object({
|
|
8306
|
+
kind: z.literal("flush-panel"),
|
|
8307
|
+
treatment: z.enum(userFlushTreatments),
|
|
8308
|
+
bleed: z.enum(userFlushBleeds)
|
|
8858
8309
|
}).strict()
|
|
8859
8310
|
]);
|
|
8860
|
-
const blockDesignPlanSchema = z
|
|
8861
|
-
blockId: z
|
|
8862
|
-
blockKind: z
|
|
8863
|
-
purpose: z
|
|
8864
|
-
sectionSurface: z
|
|
8311
|
+
const blockDesignPlanSchema = z.object({
|
|
8312
|
+
blockId: z.string().min(1).transform(asDesignBlockId),
|
|
8313
|
+
blockKind: z.string().min(1),
|
|
8314
|
+
purpose: z.string().min(1),
|
|
8315
|
+
sectionSurface: z.enum(userDesignOptionCatalog.sectionSurfaces),
|
|
8865
8316
|
contentFrame: contentFrameIntentSchema,
|
|
8866
|
-
itemSurface: z
|
|
8867
|
-
transitionAfter: z
|
|
8868
|
-
emphasis: z
|
|
8317
|
+
itemSurface: z.enum(userDesignOptionCatalog.itemSurfaces),
|
|
8318
|
+
transitionAfter: z.enum(userDesignOptionCatalog.transitions),
|
|
8319
|
+
emphasis: z.enum(userDesignOptionCatalog.emphases),
|
|
8869
8320
|
sectionHeight: sectionHeightIntentSchema.optional(),
|
|
8870
8321
|
heroLegibility: heroLegibilityStrategySchema.optional(),
|
|
8871
8322
|
heroComposition: heroCompositionIntentSchema.optional(),
|
|
@@ -8877,39 +8328,39 @@ const blockDesignPlanSchema = z$1.object({
|
|
|
8877
8328
|
eventListTreatment: eventListTreatmentSchema.optional(),
|
|
8878
8329
|
eyebrowTreatment: eyebrowTreatmentSchema.optional()
|
|
8879
8330
|
}).strict();
|
|
8880
|
-
const styleAuthoritySchema = z
|
|
8881
|
-
z
|
|
8882
|
-
kind: z
|
|
8331
|
+
const styleAuthoritySchema = z.discriminatedUnion("kind", [
|
|
8332
|
+
z.object({
|
|
8333
|
+
kind: z.literal("theme-v2"),
|
|
8883
8334
|
source: designResolutionPolicySchema,
|
|
8884
|
-
siteStyleId: z
|
|
8885
|
-
templateId: z
|
|
8886
|
-
templateVersion: z
|
|
8887
|
-
resolverVersion: z
|
|
8335
|
+
siteStyleId: z.string().min(1).transform(asSiteStyleId),
|
|
8336
|
+
templateId: z.string().min(1).transform(asDesignSystemTemplateId),
|
|
8337
|
+
templateVersion: z.number().int().nonnegative(),
|
|
8338
|
+
resolverVersion: z.number().int().nonnegative()
|
|
8888
8339
|
}).strict(),
|
|
8889
|
-
z
|
|
8890
|
-
kind: z
|
|
8891
|
-
reason: z
|
|
8340
|
+
z.object({
|
|
8341
|
+
kind: z.literal("legacy-raw"),
|
|
8342
|
+
reason: z.enum(["pre-theme-v2", "manual-runtime-fields"])
|
|
8892
8343
|
}).strict(),
|
|
8893
|
-
z
|
|
8894
|
-
kind: z
|
|
8895
|
-
reason: z
|
|
8344
|
+
z.object({
|
|
8345
|
+
kind: z.literal("advanced-detached"),
|
|
8346
|
+
reason: z.literal("detached-custom-runtime-fields")
|
|
8896
8347
|
}).strict()
|
|
8897
8348
|
]);
|
|
8898
|
-
const blockRuntimeStyleAuthoritySchema = z
|
|
8899
|
-
unit: z
|
|
8900
|
-
blockId: z
|
|
8349
|
+
const blockRuntimeStyleAuthoritySchema = z.object({
|
|
8350
|
+
unit: z.literal("block-runtime-fields"),
|
|
8351
|
+
blockId: z.string().min(1).transform(asDesignBlockId),
|
|
8901
8352
|
fields: nonEmptyRuntimeStyleFieldNamesSchema,
|
|
8902
8353
|
authority: styleAuthoritySchema
|
|
8903
8354
|
}).strict();
|
|
8904
|
-
z
|
|
8905
|
-
schemaVersion: z
|
|
8906
|
-
siteStyleId: z
|
|
8907
|
-
templateId: z
|
|
8908
|
-
templateVersion: z
|
|
8909
|
-
resolverVersion: z
|
|
8910
|
-
rhythmPresetId: z
|
|
8911
|
-
blocks: z
|
|
8912
|
-
styleAuthorities: z
|
|
8355
|
+
z.object({
|
|
8356
|
+
schemaVersion: z.literal(1),
|
|
8357
|
+
siteStyleId: z.string().min(1).transform(asSiteStyleId),
|
|
8358
|
+
templateId: z.string().min(1).transform(asDesignSystemTemplateId),
|
|
8359
|
+
templateVersion: z.number().int().nonnegative(),
|
|
8360
|
+
resolverVersion: z.number().int().nonnegative(),
|
|
8361
|
+
rhythmPresetId: z.string().min(1),
|
|
8362
|
+
blocks: z.array(blockDesignPlanSchema),
|
|
8363
|
+
styleAuthorities: z.array(blockRuntimeStyleAuthoritySchema)
|
|
8913
8364
|
}).strict();
|
|
8914
8365
|
//#endregion
|
|
8915
8366
|
//#region ../theme-core/src/site-styles/sectionTransitions.ts
|
|
@@ -9101,7 +8552,10 @@ function uniformSectionForeground(token) {
|
|
|
9101
8552
|
supportingColor: token
|
|
9102
8553
|
};
|
|
9103
8554
|
}
|
|
9104
|
-
|
|
8555
|
+
//#endregion
|
|
8556
|
+
//#region ../theme-core/src/site-styles/curatedSiteStyles.ts
|
|
8557
|
+
const SOFT_EARTH_SITE_STYLE_ID_VALUE = "site-style:soft-earth";
|
|
8558
|
+
asSiteStyleId(SOFT_EARTH_SITE_STYLE_ID_VALUE);
|
|
9105
8559
|
const quietBudget = {
|
|
9106
8560
|
accentDensity: "low",
|
|
9107
8561
|
panelDensity: "medium",
|
|
@@ -9334,9 +8788,290 @@ function uniqueContentFrameKinds() {
|
|
|
9334
8788
|
return [firstKind, ...kinds.slice(1)];
|
|
9335
8789
|
}
|
|
9336
8790
|
const generatedContentFrameKinds = uniqueContentFrameKinds();
|
|
8791
|
+
function defineHeaderCuration(input) {
|
|
8792
|
+
const toEntry = ({ layoutId, styleIds }) => {
|
|
8793
|
+
const [firstStyleId, ...remainingStyleIds] = styleIds;
|
|
8794
|
+
return {
|
|
8795
|
+
layout: { id: asHeaderLayoutId(layoutId) },
|
|
8796
|
+
styles: [{ id: asHeaderStyleId(firstStyleId) }, ...remainingStyleIds.map((styleId) => ({ id: asHeaderStyleId(styleId) }))]
|
|
8797
|
+
};
|
|
8798
|
+
};
|
|
8799
|
+
const [first, ...remaining] = input;
|
|
8800
|
+
return [toEntry(first), ...remaining.map(toEntry)];
|
|
8801
|
+
}
|
|
8802
|
+
const headerCurationBySiteStyle = {
|
|
8803
|
+
"site-style:calm-studio": defineHeaderCuration([{
|
|
8804
|
+
layoutId: "centered",
|
|
8805
|
+
styleIds: [
|
|
8806
|
+
"minimal",
|
|
8807
|
+
"fine-line",
|
|
8808
|
+
"soft-bar"
|
|
8809
|
+
]
|
|
8810
|
+
}, {
|
|
8811
|
+
layoutId: "classic",
|
|
8812
|
+
styleIds: [
|
|
8813
|
+
"minimal",
|
|
8814
|
+
"fine-line",
|
|
8815
|
+
"soft-bar",
|
|
8816
|
+
"brand-bar"
|
|
8817
|
+
]
|
|
8818
|
+
}]),
|
|
8819
|
+
"site-style:clear-professional": defineHeaderCuration([{
|
|
8820
|
+
layoutId: "classic",
|
|
8821
|
+
styleIds: [
|
|
8822
|
+
"flat-tabs",
|
|
8823
|
+
"brand-bar",
|
|
8824
|
+
"minimal",
|
|
8825
|
+
"fine-line",
|
|
8826
|
+
"soft-bar"
|
|
8827
|
+
]
|
|
8828
|
+
}]),
|
|
8829
|
+
"site-style:warm-editorial": defineHeaderCuration([{
|
|
8830
|
+
layoutId: "centered",
|
|
8831
|
+
styleIds: [
|
|
8832
|
+
"serif-line",
|
|
8833
|
+
"minimal",
|
|
8834
|
+
"fine-line",
|
|
8835
|
+
"soft-bar"
|
|
8836
|
+
]
|
|
8837
|
+
}, {
|
|
8838
|
+
layoutId: "classic",
|
|
8839
|
+
styleIds: [
|
|
8840
|
+
"minimal",
|
|
8841
|
+
"serif-line",
|
|
8842
|
+
"fine-line",
|
|
8843
|
+
"soft-bar"
|
|
8844
|
+
]
|
|
8845
|
+
}]),
|
|
8846
|
+
"site-style:bright-community": defineHeaderCuration([{
|
|
8847
|
+
layoutId: "classic",
|
|
8848
|
+
styleIds: [
|
|
8849
|
+
"brand-bar",
|
|
8850
|
+
"flat-tabs",
|
|
8851
|
+
"minimal",
|
|
8852
|
+
"brand-underline",
|
|
8853
|
+
"brand-pill",
|
|
8854
|
+
"fine-line"
|
|
8855
|
+
]
|
|
8856
|
+
}]),
|
|
8857
|
+
"site-style:quiet-luxury": defineHeaderCuration([{
|
|
8858
|
+
layoutId: "classic",
|
|
8859
|
+
styleIds: [
|
|
8860
|
+
"minimal",
|
|
8861
|
+
"serif-line",
|
|
8862
|
+
"fine-line",
|
|
8863
|
+
"soft-bar"
|
|
8864
|
+
]
|
|
8865
|
+
}, {
|
|
8866
|
+
layoutId: "centered",
|
|
8867
|
+
styleIds: [
|
|
8868
|
+
"serif-line",
|
|
8869
|
+
"fine-line",
|
|
8870
|
+
"minimal",
|
|
8871
|
+
"soft-bar"
|
|
8872
|
+
]
|
|
8873
|
+
}]),
|
|
8874
|
+
"site-style:practical-services": defineHeaderCuration([{
|
|
8875
|
+
layoutId: "classic",
|
|
8876
|
+
styleIds: [
|
|
8877
|
+
"flat-tabs",
|
|
8878
|
+
"brand-bar",
|
|
8879
|
+
"minimal",
|
|
8880
|
+
"brand-underline",
|
|
8881
|
+
"brand-pill",
|
|
8882
|
+
"fine-line"
|
|
8883
|
+
]
|
|
8884
|
+
}]),
|
|
8885
|
+
"site-style:modern-wellness": defineHeaderCuration([{
|
|
8886
|
+
layoutId: "centered",
|
|
8887
|
+
styleIds: [
|
|
8888
|
+
"minimal",
|
|
8889
|
+
"soft-bar",
|
|
8890
|
+
"pill-nav",
|
|
8891
|
+
"fine-line"
|
|
8892
|
+
]
|
|
8893
|
+
}, {
|
|
8894
|
+
layoutId: "classic",
|
|
8895
|
+
styleIds: [
|
|
8896
|
+
"minimal",
|
|
8897
|
+
"soft-bar",
|
|
8898
|
+
"pill-nav",
|
|
8899
|
+
"fine-line"
|
|
8900
|
+
]
|
|
8901
|
+
}]),
|
|
8902
|
+
"site-style:quiet-practice": defineHeaderCuration([{
|
|
8903
|
+
layoutId: "classic",
|
|
8904
|
+
styleIds: [
|
|
8905
|
+
"flat-tabs",
|
|
8906
|
+
"minimal",
|
|
8907
|
+
"fine-line",
|
|
8908
|
+
"soft-bar",
|
|
8909
|
+
"brand-bar"
|
|
8910
|
+
]
|
|
8911
|
+
}, {
|
|
8912
|
+
layoutId: "centered",
|
|
8913
|
+
styleIds: [
|
|
8914
|
+
"minimal",
|
|
8915
|
+
"fine-line",
|
|
8916
|
+
"soft-bar"
|
|
8917
|
+
]
|
|
8918
|
+
}]),
|
|
8919
|
+
"site-style:clarity-zen-blue": defineHeaderCuration([{
|
|
8920
|
+
layoutId: "centered",
|
|
8921
|
+
styleIds: [
|
|
8922
|
+
"minimal",
|
|
8923
|
+
"serif-line",
|
|
8924
|
+
"fine-line",
|
|
8925
|
+
"soft-bar"
|
|
8926
|
+
]
|
|
8927
|
+
}, {
|
|
8928
|
+
layoutId: "classic",
|
|
8929
|
+
styleIds: [
|
|
8930
|
+
"minimal",
|
|
8931
|
+
"serif-line",
|
|
8932
|
+
"fine-line",
|
|
8933
|
+
"soft-bar"
|
|
8934
|
+
]
|
|
8935
|
+
}]),
|
|
8936
|
+
"site-style:personal-retreat-journal": defineHeaderCuration([{
|
|
8937
|
+
layoutId: "centered",
|
|
8938
|
+
styleIds: [
|
|
8939
|
+
"serif-line",
|
|
8940
|
+
"minimal",
|
|
8941
|
+
"fine-line",
|
|
8942
|
+
"soft-bar"
|
|
8943
|
+
]
|
|
8944
|
+
}, {
|
|
8945
|
+
layoutId: "classic",
|
|
8946
|
+
styleIds: [
|
|
8947
|
+
"minimal",
|
|
8948
|
+
"serif-line",
|
|
8949
|
+
"fine-line",
|
|
8950
|
+
"soft-bar"
|
|
8951
|
+
]
|
|
8952
|
+
}]),
|
|
8953
|
+
"site-style:tactile-workshop": defineHeaderCuration([{
|
|
8954
|
+
layoutId: "classic",
|
|
8955
|
+
styleIds: [
|
|
8956
|
+
"brand-bar",
|
|
8957
|
+
"flat-tabs",
|
|
8958
|
+
"minimal",
|
|
8959
|
+
"fine-line",
|
|
8960
|
+
"soft-bar"
|
|
8961
|
+
]
|
|
8962
|
+
}]),
|
|
8963
|
+
"site-style:soft-earth": defineHeaderCuration([{
|
|
8964
|
+
layoutId: "centered",
|
|
8965
|
+
styleIds: [
|
|
8966
|
+
"minimal",
|
|
8967
|
+
"serif-line",
|
|
8968
|
+
"fine-line",
|
|
8969
|
+
"soft-bar"
|
|
8970
|
+
]
|
|
8971
|
+
}, {
|
|
8972
|
+
layoutId: "classic",
|
|
8973
|
+
styleIds: [
|
|
8974
|
+
"minimal",
|
|
8975
|
+
"serif-line",
|
|
8976
|
+
"fine-line",
|
|
8977
|
+
"soft-bar"
|
|
8978
|
+
]
|
|
8979
|
+
}]),
|
|
8980
|
+
"site-style:bold-launch": defineHeaderCuration([{
|
|
8981
|
+
layoutId: "floating",
|
|
8982
|
+
styleIds: [
|
|
8983
|
+
"glass",
|
|
8984
|
+
"split-glass",
|
|
8985
|
+
"brand-pill",
|
|
8986
|
+
"soft-shell"
|
|
8987
|
+
]
|
|
8988
|
+
}, {
|
|
8989
|
+
layoutId: "classic",
|
|
8990
|
+
styleIds: [
|
|
8991
|
+
"brand-bar",
|
|
8992
|
+
"brand-underline",
|
|
8993
|
+
"flat-tabs",
|
|
8994
|
+
"brand-pill",
|
|
8995
|
+
"fine-line"
|
|
8996
|
+
]
|
|
8997
|
+
}]),
|
|
8998
|
+
"site-style:south-west-twerk-school": defineHeaderCuration([{
|
|
8999
|
+
layoutId: "classic",
|
|
9000
|
+
styleIds: [
|
|
9001
|
+
"brand-bar",
|
|
9002
|
+
"flat-tabs",
|
|
9003
|
+
"brand-underline",
|
|
9004
|
+
"brand-pill",
|
|
9005
|
+
"fine-line"
|
|
9006
|
+
]
|
|
9007
|
+
}, {
|
|
9008
|
+
layoutId: "floating",
|
|
9009
|
+
styleIds: [
|
|
9010
|
+
"glass",
|
|
9011
|
+
"split-glass",
|
|
9012
|
+
"brand-pill",
|
|
9013
|
+
"soft-shell"
|
|
9014
|
+
]
|
|
9015
|
+
}]),
|
|
9016
|
+
"site-style:kirtan-ornate": defineHeaderCuration([{
|
|
9017
|
+
layoutId: "floating",
|
|
9018
|
+
styleIds: [
|
|
9019
|
+
"minimal-surface",
|
|
9020
|
+
"split-glass",
|
|
9021
|
+
"glass"
|
|
9022
|
+
]
|
|
9023
|
+
}]),
|
|
9024
|
+
"site-style:original-joy": defineHeaderCuration([{
|
|
9025
|
+
layoutId: "floating",
|
|
9026
|
+
styleIds: [
|
|
9027
|
+
"minimal-surface",
|
|
9028
|
+
"split-glass",
|
|
9029
|
+
"glass"
|
|
9030
|
+
]
|
|
9031
|
+
}]),
|
|
9032
|
+
"site-style:fulcrum": defineHeaderCuration([{
|
|
9033
|
+
layoutId: "classic",
|
|
9034
|
+
styleIds: [
|
|
9035
|
+
"fine-line",
|
|
9036
|
+
"minimal",
|
|
9037
|
+
"serif-line",
|
|
9038
|
+
"soft-bar"
|
|
9039
|
+
]
|
|
9040
|
+
}, {
|
|
9041
|
+
layoutId: "centered",
|
|
9042
|
+
styleIds: [
|
|
9043
|
+
"serif-line",
|
|
9044
|
+
"minimal",
|
|
9045
|
+
"fine-line",
|
|
9046
|
+
"soft-bar"
|
|
9047
|
+
]
|
|
9048
|
+
}]),
|
|
9049
|
+
"site-style:grounded-practice": defineHeaderCuration([
|
|
9050
|
+
{
|
|
9051
|
+
layoutId: "classic",
|
|
9052
|
+
styleIds: [
|
|
9053
|
+
"minimal",
|
|
9054
|
+
"serif-line",
|
|
9055
|
+
"fine-line",
|
|
9056
|
+
"soft-bar"
|
|
9057
|
+
]
|
|
9058
|
+
},
|
|
9059
|
+
{
|
|
9060
|
+
layoutId: "centered",
|
|
9061
|
+
styleIds: [
|
|
9062
|
+
"serif-line",
|
|
9063
|
+
"fine-line",
|
|
9064
|
+
"minimal",
|
|
9065
|
+
"soft-bar"
|
|
9066
|
+
]
|
|
9067
|
+
},
|
|
9068
|
+
{
|
|
9069
|
+
layoutId: "floating",
|
|
9070
|
+
styleIds: ["minimal-surface", "glass"]
|
|
9071
|
+
}
|
|
9072
|
+
])
|
|
9073
|
+
};
|
|
9337
9074
|
function defineCuratedSiteStyle(input) {
|
|
9338
|
-
const legacyHeaderLookIds = input.recommendedHeaderLookIds ?? ["clean-base"];
|
|
9339
|
-
const inferredHeaderCuration = inferHeaderCurationFromLegacyLooks(legacyHeaderLookIds, input.tokenRecipes);
|
|
9340
9075
|
return {
|
|
9341
9076
|
id: asSiteStyleId(input.id),
|
|
9342
9077
|
name: input.name,
|
|
@@ -9361,17 +9096,7 @@ function defineCuratedSiteStyle(input) {
|
|
|
9361
9096
|
componentRuntimeRules: input.componentRuntimeRules ?? componentRuntimeRulesForTokenRecipes(input.tokenRecipes),
|
|
9362
9097
|
...input.defaultBlockVariants ? { defaultBlockVariants: input.defaultBlockVariants } : {},
|
|
9363
9098
|
recommendedAppearancePresetIds: (input.recommendedAppearancePresetIds ?? []).map(asAppearancePresetId),
|
|
9364
|
-
|
|
9365
|
-
layoutId: asHeaderLayoutId(input.defaultHeaderSelection.layoutId),
|
|
9366
|
-
styleId: asHeaderStyleId(input.defaultHeaderSelection.styleId)
|
|
9367
|
-
} : inferredHeaderCuration.defaultHeaderSelection,
|
|
9368
|
-
recommendedHeaderLayoutChoices: input.recommendedHeaderLayoutChoices ?? inferredHeaderCuration.recommendedHeaderLayoutChoices,
|
|
9369
|
-
recommendedHeaderStyleChoicesByLayout: input.recommendedHeaderStyleChoicesByLayout ?? inferredHeaderCuration.recommendedHeaderStyleChoicesByLayout,
|
|
9370
|
-
discouragedHeaderSelections: input.discouragedHeaderSelections?.map((selection) => ({
|
|
9371
|
-
layoutId: asHeaderLayoutId(selection.layoutId),
|
|
9372
|
-
styleId: asHeaderStyleId(selection.styleId)
|
|
9373
|
-
})),
|
|
9374
|
-
recommendedHeaderLookIds: legacyHeaderLookIds.map(asHeaderLookId),
|
|
9099
|
+
headerCuration: headerCurationBySiteStyle[input.id],
|
|
9375
9100
|
recommendedFooterLookIds: (input.recommendedFooterLookIds ?? []).map(asFooterLookId),
|
|
9376
9101
|
buttonStyleChoices: input.buttonStyleChoices,
|
|
9377
9102
|
paletteRecommendations: input.paletteRecommendations,
|
|
@@ -9396,148 +9121,6 @@ function paletteRecommendation(authoringKey, note) {
|
|
|
9396
9121
|
note
|
|
9397
9122
|
} : { id: valueKey };
|
|
9398
9123
|
}
|
|
9399
|
-
function headerLayoutChoice(id, note) {
|
|
9400
|
-
return note ? {
|
|
9401
|
-
id: asHeaderLayoutId(id),
|
|
9402
|
-
note
|
|
9403
|
-
} : { id: asHeaderLayoutId(id) };
|
|
9404
|
-
}
|
|
9405
|
-
function headerStyleChoice(id, note) {
|
|
9406
|
-
return note ? {
|
|
9407
|
-
id: asHeaderStyleId(id),
|
|
9408
|
-
note
|
|
9409
|
-
} : { id: asHeaderStyleId(id) };
|
|
9410
|
-
}
|
|
9411
|
-
function unbrandHeaderLayoutId(id) {
|
|
9412
|
-
return id;
|
|
9413
|
-
}
|
|
9414
|
-
function uniqueHeaderLayoutChoices(choices) {
|
|
9415
|
-
const seen = /* @__PURE__ */ new Set();
|
|
9416
|
-
const unique = choices.filter((choice) => {
|
|
9417
|
-
if (seen.has(choice.id)) return false;
|
|
9418
|
-
seen.add(choice.id);
|
|
9419
|
-
return true;
|
|
9420
|
-
});
|
|
9421
|
-
const first = unique[0];
|
|
9422
|
-
if (!first) throw new Error("Expected at least one curated header layout choice.");
|
|
9423
|
-
return [first, ...unique.slice(1)];
|
|
9424
|
-
}
|
|
9425
|
-
function nonEmptyHeaderStyleChoices(choices, fallbackLayoutId) {
|
|
9426
|
-
return [choices[0] ?? { id: getCompatibleHeaderStyleIds(fallbackLayoutId)[0] ?? asHeaderStyleId("minimal") }, ...choices.slice(1)];
|
|
9427
|
-
}
|
|
9428
|
-
function uniqueCompatibleHeaderStyleChoices(choices, fallbackLayoutId) {
|
|
9429
|
-
const compatible = new Set(getCompatibleHeaderStyleIds(fallbackLayoutId));
|
|
9430
|
-
const seen = /* @__PURE__ */ new Set();
|
|
9431
|
-
return nonEmptyHeaderStyleChoices(choices.filter((choice) => {
|
|
9432
|
-
if (!compatible.has(choice.id)) return false;
|
|
9433
|
-
if (seen.has(choice.id)) return false;
|
|
9434
|
-
seen.add(choice.id);
|
|
9435
|
-
return true;
|
|
9436
|
-
}), fallbackLayoutId);
|
|
9437
|
-
}
|
|
9438
|
-
function inferredHeaderStyleValuesForRecipes(layoutId, recipes) {
|
|
9439
|
-
switch (layoutId) {
|
|
9440
|
-
case "classic":
|
|
9441
|
-
if (isExpressiveRecipe(recipes)) return [
|
|
9442
|
-
"brand-bar",
|
|
9443
|
-
"brand-underline",
|
|
9444
|
-
"flat-tabs",
|
|
9445
|
-
"brand-pill",
|
|
9446
|
-
"fine-line"
|
|
9447
|
-
];
|
|
9448
|
-
if (recipes.spacing === "compact") return [
|
|
9449
|
-
"flat-tabs",
|
|
9450
|
-
"fine-line",
|
|
9451
|
-
"minimal",
|
|
9452
|
-
"brand-bar"
|
|
9453
|
-
];
|
|
9454
|
-
if (isSerifTypographyRecipe(recipes)) return [
|
|
9455
|
-
"serif-line",
|
|
9456
|
-
"fine-line",
|
|
9457
|
-
"minimal",
|
|
9458
|
-
"soft-bar"
|
|
9459
|
-
];
|
|
9460
|
-
if (recipes.radius === "rounded" || recipes.radius === "pill") return [
|
|
9461
|
-
"soft-bar",
|
|
9462
|
-
"pill-nav",
|
|
9463
|
-
"fine-line",
|
|
9464
|
-
"minimal"
|
|
9465
|
-
];
|
|
9466
|
-
return [
|
|
9467
|
-
"fine-line",
|
|
9468
|
-
"minimal",
|
|
9469
|
-
"soft-bar",
|
|
9470
|
-
"brand-bar"
|
|
9471
|
-
];
|
|
9472
|
-
case "centered":
|
|
9473
|
-
if (isSerifTypographyRecipe(recipes)) return [
|
|
9474
|
-
"serif-line",
|
|
9475
|
-
"fine-line",
|
|
9476
|
-
"minimal",
|
|
9477
|
-
"soft-bar"
|
|
9478
|
-
];
|
|
9479
|
-
if (isExpressiveRecipe(recipes)) return [
|
|
9480
|
-
"brand-pill",
|
|
9481
|
-
"flat-tabs",
|
|
9482
|
-
"brand-bar",
|
|
9483
|
-
"fine-line"
|
|
9484
|
-
];
|
|
9485
|
-
if (recipes.radius === "rounded" || recipes.radius === "pill") return [
|
|
9486
|
-
"soft-bar",
|
|
9487
|
-
"pill-nav",
|
|
9488
|
-
"fine-line",
|
|
9489
|
-
"minimal"
|
|
9490
|
-
];
|
|
9491
|
-
return [
|
|
9492
|
-
"minimal",
|
|
9493
|
-
"fine-line",
|
|
9494
|
-
"soft-bar"
|
|
9495
|
-
];
|
|
9496
|
-
case "floating":
|
|
9497
|
-
if (isExpressiveRecipe(recipes)) return [
|
|
9498
|
-
"glass",
|
|
9499
|
-
"split-glass",
|
|
9500
|
-
"brand-pill",
|
|
9501
|
-
"soft-shell"
|
|
9502
|
-
];
|
|
9503
|
-
if (isSerifTypographyRecipe(recipes)) return [
|
|
9504
|
-
"split-pill",
|
|
9505
|
-
"minimal-surface",
|
|
9506
|
-
"soft-shell"
|
|
9507
|
-
];
|
|
9508
|
-
return [
|
|
9509
|
-
"soft-shell",
|
|
9510
|
-
"minimal-surface",
|
|
9511
|
-
"glass"
|
|
9512
|
-
];
|
|
9513
|
-
default: return [];
|
|
9514
|
-
}
|
|
9515
|
-
}
|
|
9516
|
-
function isExpressiveRecipe(recipes) {
|
|
9517
|
-
return recipes.contrast === "maximum" || recipes.shadow === "layered" || recipes.motion === "expressive";
|
|
9518
|
-
}
|
|
9519
|
-
function isSerifTypographyRecipe(recipes) {
|
|
9520
|
-
return recipes.typography === "serif-editorial" || recipes.typography === "classic-serif";
|
|
9521
|
-
}
|
|
9522
|
-
function inferHeaderCurationFromLegacyLooks(lookIds, recipes) {
|
|
9523
|
-
const selections = lookIds.map((lookId) => resolveLegacyHeaderLookAlias(asHeaderLookId(lookId))).filter((selection) => Boolean(selection));
|
|
9524
|
-
const defaultHeaderSelection = selections[0] ?? {
|
|
9525
|
-
layoutId: asHeaderLayoutId("classic"),
|
|
9526
|
-
styleId: asHeaderStyleId("minimal")
|
|
9527
|
-
};
|
|
9528
|
-
const layoutChoices = uniqueHeaderLayoutChoices(selections.map((selection) => headerLayoutChoice(selection.layoutId)));
|
|
9529
|
-
const stylesByLayout = {};
|
|
9530
|
-
for (const layoutChoice of layoutChoices) {
|
|
9531
|
-
const legacyStyleChoices = selections.filter((selection) => selection.layoutId === layoutChoice.id).map((selection) => headerStyleChoice(selection.styleId));
|
|
9532
|
-
const inferredStyleChoices = inferredHeaderStyleValuesForRecipes(layoutChoice.id, recipes).map((styleId) => headerStyleChoice(styleId));
|
|
9533
|
-
stylesByLayout[unbrandHeaderLayoutId(layoutChoice.id)] = uniqueCompatibleHeaderStyleChoices([...legacyStyleChoices, ...inferredStyleChoices], layoutChoice.id);
|
|
9534
|
-
}
|
|
9535
|
-
return {
|
|
9536
|
-
defaultHeaderSelection,
|
|
9537
|
-
recommendedHeaderLayoutChoices: layoutChoices,
|
|
9538
|
-
recommendedHeaderStyleChoicesByLayout: stylesByLayout
|
|
9539
|
-
};
|
|
9540
|
-
}
|
|
9541
9124
|
/**
|
|
9542
9125
|
* V1 generated site styles are curated product presets, not AI-authored design
|
|
9543
9126
|
* systems. Generators choose one of these bounded entries, then downstream
|
|
@@ -9567,11 +9150,6 @@ const curatedSiteStyles = [
|
|
|
9567
9150
|
motion: "subtle"
|
|
9568
9151
|
},
|
|
9569
9152
|
compositionBudget: quietBudget,
|
|
9570
|
-
recommendedHeaderLookIds: [
|
|
9571
|
-
"centered-calm",
|
|
9572
|
-
"minimal-transparent",
|
|
9573
|
-
"clean-base"
|
|
9574
|
-
],
|
|
9575
9153
|
buttonStyleChoices: [
|
|
9576
9154
|
buttonChoice("soft-pill"),
|
|
9577
9155
|
buttonChoice("pebble"),
|
|
@@ -9604,11 +9182,6 @@ const curatedSiteStyles = [
|
|
|
9604
9182
|
motion: "subtle"
|
|
9605
9183
|
},
|
|
9606
9184
|
compositionBudget: balancedBudget,
|
|
9607
|
-
recommendedHeaderLookIds: [
|
|
9608
|
-
"practical-utility",
|
|
9609
|
-
"brand-solid",
|
|
9610
|
-
"clean-base"
|
|
9611
|
-
],
|
|
9612
9185
|
buttonStyleChoices: [
|
|
9613
9186
|
buttonChoice("confident-chip"),
|
|
9614
9187
|
buttonChoice("soft-pill"),
|
|
@@ -9643,11 +9216,6 @@ const curatedSiteStyles = [
|
|
|
9643
9216
|
motion: "subtle"
|
|
9644
9217
|
},
|
|
9645
9218
|
compositionBudget: balancedBudget,
|
|
9646
|
-
recommendedHeaderLookIds: [
|
|
9647
|
-
"serif-line",
|
|
9648
|
-
"minimal-transparent",
|
|
9649
|
-
"centered-calm"
|
|
9650
|
-
],
|
|
9651
9219
|
buttonStyleChoices: [
|
|
9652
9220
|
buttonChoice("editorial-link"),
|
|
9653
9221
|
buttonChoice("soft-pill"),
|
|
@@ -9683,11 +9251,6 @@ const curatedSiteStyles = [
|
|
|
9683
9251
|
motion: "expressive"
|
|
9684
9252
|
},
|
|
9685
9253
|
compositionBudget: balancedBudget,
|
|
9686
|
-
recommendedHeaderLookIds: [
|
|
9687
|
-
"brand-solid",
|
|
9688
|
-
"practical-utility",
|
|
9689
|
-
"clean-base"
|
|
9690
|
-
],
|
|
9691
9254
|
buttonStyleChoices: [
|
|
9692
9255
|
buttonChoice("pebble"),
|
|
9693
9256
|
buttonChoice("brushed-wash"),
|
|
@@ -9744,11 +9307,6 @@ const curatedSiteStyles = [
|
|
|
9744
9307
|
motion: "none"
|
|
9745
9308
|
},
|
|
9746
9309
|
compositionBudget: quietBudget,
|
|
9747
|
-
recommendedHeaderLookIds: [
|
|
9748
|
-
"minimal-transparent",
|
|
9749
|
-
"serif-line",
|
|
9750
|
-
"clean-base"
|
|
9751
|
-
],
|
|
9752
9310
|
buttonStyleChoices: [
|
|
9753
9311
|
buttonChoice("editorial-link"),
|
|
9754
9312
|
buttonChoice("confident-chip"),
|
|
@@ -9806,11 +9364,6 @@ const curatedSiteStyles = [
|
|
|
9806
9364
|
motion: "none"
|
|
9807
9365
|
},
|
|
9808
9366
|
compositionBudget: quietBudget,
|
|
9809
|
-
recommendedHeaderLookIds: [
|
|
9810
|
-
"practical-utility",
|
|
9811
|
-
"brand-solid",
|
|
9812
|
-
"clean-base"
|
|
9813
|
-
],
|
|
9814
9367
|
buttonStyleChoices: [
|
|
9815
9368
|
buttonChoice("confident-chip"),
|
|
9816
9369
|
buttonChoice("pebble"),
|
|
@@ -9845,11 +9398,6 @@ const curatedSiteStyles = [
|
|
|
9845
9398
|
motion: "subtle"
|
|
9846
9399
|
},
|
|
9847
9400
|
compositionBudget: balancedBudget,
|
|
9848
|
-
recommendedHeaderLookIds: [
|
|
9849
|
-
"centered-calm",
|
|
9850
|
-
"minimal-transparent",
|
|
9851
|
-
"clean-base"
|
|
9852
|
-
],
|
|
9853
9401
|
buttonStyleChoices: [
|
|
9854
9402
|
buttonChoice("soft-pill"),
|
|
9855
9403
|
buttonChoice("pebble"),
|
|
@@ -9918,11 +9466,6 @@ const curatedSiteStyles = [
|
|
|
9918
9466
|
motion: "subtle"
|
|
9919
9467
|
},
|
|
9920
9468
|
compositionBudget: quietBudget,
|
|
9921
|
-
recommendedHeaderLookIds: [
|
|
9922
|
-
"practical-utility",
|
|
9923
|
-
"clean-base",
|
|
9924
|
-
"centered-calm"
|
|
9925
|
-
],
|
|
9926
9469
|
buttonStyleChoices: [
|
|
9927
9470
|
buttonChoice("pebble"),
|
|
9928
9471
|
buttonChoice("soft-pill"),
|
|
@@ -10037,11 +9580,6 @@ const curatedSiteStyles = [
|
|
|
10037
9580
|
"faq-contained-help",
|
|
10038
9581
|
"contact-form-panel"
|
|
10039
9582
|
],
|
|
10040
|
-
recommendedHeaderLookIds: [
|
|
10041
|
-
"centered-calm",
|
|
10042
|
-
"serif-line",
|
|
10043
|
-
"minimal-transparent"
|
|
10044
|
-
],
|
|
10045
9583
|
recommendedFooterLookIds: ["footer-links-quiet"],
|
|
10046
9584
|
buttonStyleChoices: [
|
|
10047
9585
|
buttonChoice("soft-pill"),
|
|
@@ -10112,11 +9650,6 @@ const curatedSiteStyles = [
|
|
|
10112
9650
|
motion: "subtle"
|
|
10113
9651
|
},
|
|
10114
9652
|
compositionBudget: balancedBudget,
|
|
10115
|
-
recommendedHeaderLookIds: [
|
|
10116
|
-
"serif-line",
|
|
10117
|
-
"centered-calm",
|
|
10118
|
-
"minimal-transparent"
|
|
10119
|
-
],
|
|
10120
9653
|
buttonStyleChoices: [
|
|
10121
9654
|
buttonChoice("editorial-link"),
|
|
10122
9655
|
buttonChoice("soft-pill"),
|
|
@@ -10185,11 +9718,6 @@ const curatedSiteStyles = [
|
|
|
10185
9718
|
motion: "subtle"
|
|
10186
9719
|
},
|
|
10187
9720
|
compositionBudget: balancedBudget,
|
|
10188
|
-
recommendedHeaderLookIds: [
|
|
10189
|
-
"brand-solid",
|
|
10190
|
-
"practical-utility",
|
|
10191
|
-
"clean-base"
|
|
10192
|
-
],
|
|
10193
9721
|
recommendedFooterLookIds: ["footer-links-emphasized", "footer-links-quiet"],
|
|
10194
9722
|
buttonStyleChoices: [
|
|
10195
9723
|
buttonChoice("pebble"),
|
|
@@ -10205,7 +9733,7 @@ const curatedSiteStyles = [
|
|
|
10205
9733
|
]
|
|
10206
9734
|
}),
|
|
10207
9735
|
defineCuratedSiteStyle({
|
|
10208
|
-
id:
|
|
9736
|
+
id: SOFT_EARTH_SITE_STYLE_ID_VALUE,
|
|
10209
9737
|
name: "Soft Earth",
|
|
10210
9738
|
headingDecoration: {
|
|
10211
9739
|
family: "organic-squiggle",
|
|
@@ -10307,11 +9835,6 @@ const curatedSiteStyles = [
|
|
|
10307
9835
|
"testimonials-non-carded",
|
|
10308
9836
|
"contact-form-panel"
|
|
10309
9837
|
],
|
|
10310
|
-
recommendedHeaderLookIds: [
|
|
10311
|
-
"centered-calm",
|
|
10312
|
-
"minimal-transparent",
|
|
10313
|
-
"serif-line"
|
|
10314
|
-
],
|
|
10315
9838
|
recommendedFooterLookIds: ["footer-links-quiet", "footer-links-emphasized"],
|
|
10316
9839
|
buttonStyleChoices: [
|
|
10317
9840
|
buttonChoice("earth-pill"),
|
|
@@ -10379,11 +9902,6 @@ const curatedSiteStyles = [
|
|
|
10379
9902
|
motion: "expressive"
|
|
10380
9903
|
},
|
|
10381
9904
|
compositionBudget: expressiveBudget,
|
|
10382
|
-
recommendedHeaderLookIds: [
|
|
10383
|
-
"transparent-overlay",
|
|
10384
|
-
"floating-glass",
|
|
10385
|
-
"brand-solid"
|
|
10386
|
-
],
|
|
10387
9905
|
buttonStyleChoices: [
|
|
10388
9906
|
buttonChoice("ink-stamp"),
|
|
10389
9907
|
buttonChoice("confident-chip"),
|
|
@@ -10434,11 +9952,6 @@ const curatedSiteStyles = [
|
|
|
10434
9952
|
"testimonials-brand-statement-cards",
|
|
10435
9953
|
"contact-form-panel"
|
|
10436
9954
|
],
|
|
10437
|
-
recommendedHeaderLookIds: [
|
|
10438
|
-
"brand-solid",
|
|
10439
|
-
"transparent-overlay",
|
|
10440
|
-
"practical-utility"
|
|
10441
|
-
],
|
|
10442
9955
|
recommendedFooterLookIds: ["footer-links-emphasized", "footer-links-quiet"],
|
|
10443
9956
|
buttonStyleChoices: [
|
|
10444
9957
|
buttonChoice("showtime-pill"),
|
|
@@ -10510,17 +10023,6 @@ const curatedSiteStyles = [
|
|
|
10510
10023
|
"testimonials-statement-cards",
|
|
10511
10024
|
"contact-form-panel"
|
|
10512
10025
|
],
|
|
10513
|
-
defaultHeaderSelection: {
|
|
10514
|
-
layoutId: "floating",
|
|
10515
|
-
styleId: "minimal-surface"
|
|
10516
|
-
},
|
|
10517
|
-
recommendedHeaderLayoutChoices: [headerLayoutChoice("floating")],
|
|
10518
|
-
recommendedHeaderStyleChoicesByLayout: { floating: [
|
|
10519
|
-
headerStyleChoice("minimal-surface"),
|
|
10520
|
-
headerStyleChoice("split-glass"),
|
|
10521
|
-
headerStyleChoice("glass")
|
|
10522
|
-
] },
|
|
10523
|
-
recommendedHeaderLookIds: ["minimal-transparent"],
|
|
10524
10026
|
recommendedFooterLookIds: ["footer-links-emphasized", "footer-links-quiet"],
|
|
10525
10027
|
buttonStyleChoices: [
|
|
10526
10028
|
buttonChoice("ornate-ritual"),
|
|
@@ -10564,17 +10066,6 @@ const curatedSiteStyles = [
|
|
|
10564
10066
|
} }
|
|
10565
10067
|
},
|
|
10566
10068
|
recommendedAppearancePresetIds: ["feature-cards-bold-colors", "testimonials-statement-cards"],
|
|
10567
|
-
defaultHeaderSelection: {
|
|
10568
|
-
layoutId: "floating",
|
|
10569
|
-
styleId: "minimal-surface"
|
|
10570
|
-
},
|
|
10571
|
-
recommendedHeaderLayoutChoices: [headerLayoutChoice("floating")],
|
|
10572
|
-
recommendedHeaderStyleChoicesByLayout: { floating: [
|
|
10573
|
-
headerStyleChoice("minimal-surface"),
|
|
10574
|
-
headerStyleChoice("split-glass"),
|
|
10575
|
-
headerStyleChoice("glass")
|
|
10576
|
-
] },
|
|
10577
|
-
recommendedHeaderLookIds: ["minimal-transparent"],
|
|
10578
10069
|
recommendedFooterLookIds: ["footer-links-emphasized", "footer-links-quiet"],
|
|
10579
10070
|
buttonStyleChoices: [
|
|
10580
10071
|
buttonChoice("joy-stamp"),
|
|
@@ -10660,12 +10151,6 @@ const curatedSiteStyles = [
|
|
|
10660
10151
|
},
|
|
10661
10152
|
testimonialQuote: serifDisplayQuote
|
|
10662
10153
|
},
|
|
10663
|
-
recommendedHeaderLookIds: [
|
|
10664
|
-
"classic-centered-nav",
|
|
10665
|
-
"serif-line",
|
|
10666
|
-
"centered-calm",
|
|
10667
|
-
"clean-base"
|
|
10668
|
-
],
|
|
10669
10154
|
recommendedFooterLookIds: ["footer-links-quiet"],
|
|
10670
10155
|
buttonStyleChoices: [
|
|
10671
10156
|
buttonChoice("flat-ink"),
|
|
@@ -10739,11 +10224,6 @@ const curatedSiteStyles = [
|
|
|
10739
10224
|
"testimonials-non-carded",
|
|
10740
10225
|
"faq-base-accordion"
|
|
10741
10226
|
],
|
|
10742
|
-
recommendedHeaderLookIds: [
|
|
10743
|
-
"minimal-transparent",
|
|
10744
|
-
"serif-line",
|
|
10745
|
-
"clean-base"
|
|
10746
|
-
],
|
|
10747
10227
|
recommendedFooterLookIds: ["footer-links-quiet"],
|
|
10748
10228
|
buttonStyleChoices: [
|
|
10749
10229
|
buttonChoice("quiet-arrow", void 0, { secondaryTreatment: "solid-accent" }),
|
|
@@ -12253,6 +11733,9 @@ const containerResponsiveThemeCss = `/*
|
|
|
12253
11733
|
.rb-md-grid-cols-4 {
|
|
12254
11734
|
grid-template-columns: repeat(4, minmax(0, 1fr));
|
|
12255
11735
|
}
|
|
11736
|
+
.rb-md-col-span-2 {
|
|
11737
|
+
grid-column: span 2 / span 2;
|
|
11738
|
+
}
|
|
12256
11739
|
}
|
|
12257
11740
|
|
|
12258
11741
|
}
|
|
@@ -12268,6 +11751,9 @@ const containerResponsiveThemeCss = `/*
|
|
|
12268
11751
|
.rb-lg-grid-cols-4 {
|
|
12269
11752
|
grid-template-columns: repeat(4, minmax(0, 1fr));
|
|
12270
11753
|
}
|
|
11754
|
+
.rb-lg-grid-cols-5 {
|
|
11755
|
+
grid-template-columns: repeat(5, minmax(0, 1fr));
|
|
11756
|
+
}
|
|
12271
11757
|
.rb-lg-w-3\\/4 {
|
|
12272
11758
|
width: 75%;
|
|
12273
11759
|
}
|
|
@@ -12283,6 +11769,9 @@ const containerResponsiveThemeCss = `/*
|
|
|
12283
11769
|
.rb-lg-col-span-4 {
|
|
12284
11770
|
grid-column: span 4 / span 4;
|
|
12285
11771
|
}
|
|
11772
|
+
.rb-lg-col-span-5 {
|
|
11773
|
+
grid-column: span 5 / span 5;
|
|
11774
|
+
}
|
|
12286
11775
|
}
|
|
12287
11776
|
|
|
12288
11777
|
}
|
|
@@ -19753,7 +19242,8 @@ const containerResponsiveThemeCss = `/*
|
|
|
19753
19242
|
:where(.theme-scope) .shop--register .shop__card-name,
|
|
19754
19243
|
:where(.theme-scope) .shop--register .shop__card-price,
|
|
19755
19244
|
:where(.theme-scope) .shop--register .shop__card-details,
|
|
19756
|
-
:where(.theme-scope) .shop--register .shop__cta
|
|
19245
|
+
:where(.theme-scope) .shop--register .shop__cta,
|
|
19246
|
+
:where(.theme-scope) .shop--register .shop__purchase-unavailable {
|
|
19757
19247
|
margin: 0;
|
|
19758
19248
|
}
|
|
19759
19249
|
|
|
@@ -19789,7 +19279,8 @@ const containerResponsiveThemeCss = `/*
|
|
|
19789
19279
|
font-size: 0.86rem;
|
|
19790
19280
|
}
|
|
19791
19281
|
|
|
19792
|
-
:where(.theme-scope) .shop--register .shop__cta
|
|
19282
|
+
:where(.theme-scope) .shop--register .shop__cta,
|
|
19283
|
+
:where(.theme-scope) .shop--register .shop__purchase-unavailable {
|
|
19793
19284
|
grid-column: 4;
|
|
19794
19285
|
grid-row: 1;
|
|
19795
19286
|
align-self: center;
|
|
@@ -19821,7 +19312,8 @@ const containerResponsiveThemeCss = `/*
|
|
|
19821
19312
|
grid-row: 2;
|
|
19822
19313
|
}
|
|
19823
19314
|
|
|
19824
|
-
:where(.theme-scope) .shop--register .shop__cta
|
|
19315
|
+
:where(.theme-scope) .shop--register .shop__cta,
|
|
19316
|
+
:where(.theme-scope) .shop--register .shop__purchase-unavailable {
|
|
19825
19317
|
grid-column: 1 / -1;
|
|
19826
19318
|
grid-row: 3;
|
|
19827
19319
|
justify-self: start;
|
|
@@ -19914,6 +19406,13 @@ const containerResponsiveThemeCss = `/*
|
|
|
19914
19406
|
align-self: flex-start;
|
|
19915
19407
|
}
|
|
19916
19408
|
|
|
19409
|
+
:where(.theme-scope) .shop__purchase-unavailable {
|
|
19410
|
+
margin: auto 0 0;
|
|
19411
|
+
color: var(--rb-surface-supporting-color, rgb(var(--tb-mutedText)));
|
|
19412
|
+
font-size: 0.875rem;
|
|
19413
|
+
line-height: 1.4;
|
|
19414
|
+
}
|
|
19415
|
+
|
|
19917
19416
|
/* Responsive grid */
|
|
19918
19417
|
@container rb-site (max-width: 768px) {
|
|
19919
19418
|
@scope ([data-rb-responsive-mode="container"]) to (:scope [data-rb-responsive-mode]) {
|
|
@@ -24756,13 +24255,25 @@ function generateVariantCss(scopeId, variant, settings, palette) {
|
|
|
24756
24255
|
"justify-content: center;",
|
|
24757
24256
|
`border-radius: ${CORNER_RADIUS_MAP$1[settings.corners]};`,
|
|
24758
24257
|
`box-shadow: ${SHADOW_VALUES$1[settings.shadow]};`,
|
|
24759
|
-
...declarationStrings(resolvedButtonColourDeclarations(result.states.base
|
|
24258
|
+
...declarationStrings(resolvedButtonColourDeclarations(result.states.base, {
|
|
24259
|
+
role: variant.id,
|
|
24260
|
+
state: "base"
|
|
24261
|
+
})),
|
|
24760
24262
|
borderWidth === "0" ? "border: none;" : `border: ${borderWidth} solid currentColor;`
|
|
24761
24263
|
]),
|
|
24762
|
-
rule(`${selector}:hover`, declarationStrings(resolvedButtonColourDeclarations(result.states.hover
|
|
24763
|
-
|
|
24764
|
-
|
|
24765
|
-
|
|
24264
|
+
rule(`${selector}:hover`, declarationStrings(resolvedButtonColourDeclarations(result.states.hover, {
|
|
24265
|
+
role: variant.id,
|
|
24266
|
+
state: "hover"
|
|
24267
|
+
}))),
|
|
24268
|
+
rule(`${selector}:active`, [...declarationStrings(resolvedButtonColourDeclarations(result.states.active, {
|
|
24269
|
+
role: variant.id,
|
|
24270
|
+
state: "active"
|
|
24271
|
+
})), "transform: scale(0.98);"]),
|
|
24272
|
+
rule(`${selector}:focus-visible`, declarationStrings(resolvedButtonFocusDeclarations(result.focusIndicator, variant.id))),
|
|
24273
|
+
rule(`${selector}:disabled,\n${selector}:disabled:hover,\n${selector}:disabled:active`, [...declarationStrings(resolvedButtonColourDeclarations(result.states.disabled, {
|
|
24274
|
+
role: variant.id,
|
|
24275
|
+
state: "disabled"
|
|
24276
|
+
})), ...declarationStrings(RESOLVED_BUTTON_DISABLED_DECLARATIONS)])
|
|
24766
24277
|
].join("\n\n");
|
|
24767
24278
|
}
|
|
24768
24279
|
function declarationStrings(declarations) {
|
|
@@ -25035,46 +24546,46 @@ const CSS_DECLARATION_PROPERTY_PATTERN = /^(?:-[a-zA-Z][a-zA-Z0-9-]*|[a-zA-Z][a-
|
|
|
25035
24546
|
const UNSAFE_CSS_MARKUP_PATTERN = /[{}<>]|<\/|<script/i;
|
|
25036
24547
|
const EXTERNAL_URL_PATTERN = /url\s*\(\s*['"]?(?:https?:|\/\/)/i;
|
|
25037
24548
|
const JAVASCRIPT_URL_PATTERN = /javascript\s*:/i;
|
|
25038
|
-
const themeBridgeConfigSchema = z
|
|
25039
|
-
tokens: z
|
|
25040
|
-
typography: z
|
|
25041
|
-
headingFamily: z
|
|
25042
|
-
bodyFamily: z
|
|
25043
|
-
headingWeight: z
|
|
25044
|
-
bodyWeight: z
|
|
24549
|
+
const themeBridgeConfigSchema = z.object({
|
|
24550
|
+
tokens: z.record(z.string(), z.string()),
|
|
24551
|
+
typography: z.object({
|
|
24552
|
+
headingFamily: z.string().optional(),
|
|
24553
|
+
bodyFamily: z.string().optional(),
|
|
24554
|
+
headingWeight: z.number().optional(),
|
|
24555
|
+
bodyWeight: z.number().optional()
|
|
25045
24556
|
}).optional(),
|
|
25046
|
-
spacing: z
|
|
24557
|
+
spacing: z.enum([
|
|
25047
24558
|
"comfortable",
|
|
25048
24559
|
"standard",
|
|
25049
24560
|
"dense"
|
|
25050
24561
|
]).optional(),
|
|
25051
|
-
corners: z
|
|
24562
|
+
corners: z.enum([
|
|
25052
24563
|
"square",
|
|
25053
24564
|
"soft",
|
|
25054
24565
|
"rounded",
|
|
25055
24566
|
"pill"
|
|
25056
24567
|
]).optional(),
|
|
25057
|
-
shadows: z
|
|
24568
|
+
shadows: z.enum([
|
|
25058
24569
|
"none",
|
|
25059
24570
|
"low",
|
|
25060
24571
|
"medium",
|
|
25061
24572
|
"high"
|
|
25062
24573
|
]).optional(),
|
|
25063
|
-
components: z
|
|
25064
|
-
buttons: z
|
|
24574
|
+
components: z.object({
|
|
24575
|
+
buttons: z.union([z.boolean(), z.object({ variants: z.array(z.enum([
|
|
25065
24576
|
"primary",
|
|
25066
24577
|
"secondary",
|
|
25067
24578
|
"outline",
|
|
25068
24579
|
"ghost"
|
|
25069
24580
|
])).optional() })]).optional(),
|
|
25070
|
-
cards: z
|
|
24581
|
+
cards: z.union([z.boolean(), z.object({ variants: z.array(z.enum([
|
|
25071
24582
|
"default",
|
|
25072
24583
|
"elevated",
|
|
25073
24584
|
"outlined"
|
|
25074
24585
|
])).optional() })]).optional(),
|
|
25075
|
-
inputs: z
|
|
24586
|
+
inputs: z.boolean().optional()
|
|
25076
24587
|
}).optional(),
|
|
25077
|
-
overrides: z
|
|
24588
|
+
overrides: z.record(z.string(), z.string()).optional()
|
|
25078
24589
|
}).passthrough();
|
|
25079
24590
|
const TOKEN_ALIASES = [
|
|
25080
24591
|
{
|