@riverbankcms/sdk 0.129.1 → 0.130.2
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/CHANGELOG.md +85 -0
- package/README.md +33 -11
- package/dist/{PreviewEditorSidebar-DceRseRV.mjs → PreviewEditorSidebar-BY-1QdE2.mjs} +327 -250
- package/dist/{PreviewEditorUI-BNunq3kk.mjs → PreviewEditorUI-BS34jI9_.mjs} +3 -3
- package/dist/{PreviewQueryProvider-B1kbhaJD.mjs → PreviewQueryProvider-BD0kOjtI.mjs} +1 -1
- package/dist/{SdkPreviewModeRuntime-Bt87-62u.mjs → SdkPreviewModeRuntime-B1pWnhu-.mjs} +235 -211
- package/dist/{SiteChromeCustomizeContext-BLl-OlL4.mjs → SiteChromeCustomizeContext-BhUG_72i.mjs} +12981 -11912
- package/dist/_dts/ai/src/contracts/proposalPrimitives.d.ts +52 -0
- package/dist/_dts/ai/src/contracts/proposals.d.ts +5256 -29129
- package/dist/_dts/ai/src/contracts/siteStyleProposalSchemas.d.ts +33429 -0
- package/dist/_dts/api/src/accountApi.d.ts +213 -0
- package/dist/_dts/api/src/accountEndpointDefinitions.d.ts +30 -0
- package/dist/_dts/api/src/accountEndpoints.d.ts +254 -0
- package/dist/_dts/api/src/apiCallParams.d.ts +60 -0
- package/dist/_dts/api/src/appointmentSetup.d.ts +21 -9
- package/dist/_dts/api/src/bookingConfig.d.ts +12 -64
- package/dist/_dts/api/src/bookingManagementEndpoints.d.ts +17 -16
- package/dist/_dts/api/src/bookingManagementEventEndpointTypes.d.ts +15 -0
- package/dist/_dts/api/src/bookingRecords.d.ts +1 -0
- package/dist/_dts/api/src/bookingSettingsSections.d.ts +9 -0
- package/dist/_dts/api/src/bookingVerticals.d.ts +2 -2
- package/dist/_dts/api/src/commercePortalEndpoints.d.ts +2 -0
- package/dist/_dts/api/src/contentRuntime.d.ts +3 -5
- package/dist/_dts/api/src/endpoints.d.ts +1355 -1318
- package/dist/_dts/api/src/event-destination-policy.d.ts +1 -1
- package/dist/_dts/api/src/eventManagementContracts.d.ts +152 -0
- package/dist/_dts/api/src/eventManagementEndpointDefinitions.d.ts +26 -0
- package/dist/_dts/api/src/eventSeriesPresentationPreset.d.ts +12 -0
- package/dist/_dts/api/src/index.d.ts +12 -3
- package/dist/_dts/api/src/indexCoreTypes.d.ts +1 -0
- package/dist/_dts/api/src/indexExtendedTypes.d.ts +1 -0
- package/dist/_dts/api/src/oauth.d.ts +8 -0
- package/dist/_dts/api/src/preview-auth.d.ts +26 -0
- package/dist/_dts/api/src/publicExperience/commerceEndpoints.d.ts +22 -47
- package/dist/_dts/api/src/publicExperience/eventEndpoints.d.ts +5 -5
- package/dist/_dts/api/src/publicExperience/wholeSeriesEndpoints.d.ts +0 -1
- package/dist/_dts/api/src/sdk-event-schedule.d.ts +5 -0
- package/dist/_dts/api/src/sdk-event-upsert.d.ts +114 -20
- package/dist/_dts/api/src/sdkBlockUpsertContracts.d.ts +48 -0
- package/dist/_dts/api/src/sdkContracts.d.ts +43 -79
- package/dist/_dts/api/src/sdkEventCategoryContracts.d.ts +9 -0
- package/dist/_dts/api/src/sdkManagedEventContracts.d.ts +35 -0
- package/dist/_dts/api/src/sdkThemeWire.d.ts +2256 -302
- package/dist/_dts/api/src/settings/permissions.d.ts +2 -2
- package/dist/_dts/api/src/siteApiKeyEndpointDefinitions.d.ts +66 -0
- package/dist/_dts/api/src/siteInfrastructure.d.ts +3 -3
- package/dist/_dts/api/src/siteOperations.d.ts +1 -1
- package/dist/_dts/api/src/sitePlatformEndpoints.d.ts +17 -4
- package/dist/_dts/api/src/siteRuntimeEndpoints.d.ts +23 -37
- package/dist/_dts/api/src/types.d.ts +7 -59
- package/dist/_dts/block-form/src/client/index.d.ts +15 -23
- package/dist/_dts/block-form/src/index.d.ts +23 -22
- 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/primitives/layout/Grid.d.ts +18 -1
- package/dist/_dts/blocks/src/system/blocks/appointment-booking.d.ts +1 -0
- package/dist/_dts/blocks/src/system/blocks/events/shared/filtering.d.ts +1 -1
- package/dist/_dts/blocks/src/system/blocks/events/shared/schemas.d.ts +61 -0
- package/dist/_dts/blocks/src/system/blocks/events/shared/types.d.ts +24 -22
- package/dist/_dts/blocks/src/system/blocks/feature-cards.d.ts +25 -1
- package/dist/_dts/blocks/src/system/blocks/location-map.d.ts +3 -2
- package/dist/_dts/blocks/src/system/blocks/media-text.d.ts +142 -120
- 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/blocks/site-header.d.ts +0 -1
- package/dist/_dts/blocks/src/system/blocks/team-members.d.ts +4 -63
- package/dist/_dts/blocks/src/system/componentFactory.d.ts +5 -5
- package/dist/_dts/blocks/src/system/customize/backgrounds.d.ts +9 -9
- 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 +18 -34
- package/dist/_dts/blocks/src/system/fields/gridLayout.d.ts +20 -0
- 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/node/fragments/classNameBinding.d.ts +6 -1
- package/dist/_dts/blocks/src/system/node/fragments/styledCard.d.ts +31 -0
- package/dist/_dts/blocks/src/system/registry.d.ts +2 -0
- package/dist/_dts/blocks/src/system/runtime/api/endpoints.d.ts +4 -0
- package/dist/_dts/blocks/src/system/runtime/api/types/courses.d.ts +0 -1
- package/dist/_dts/blocks/src/system/runtime/api/types/events.d.ts +0 -1
- 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/hooks/useHeadlessBookingFlow.state.d.ts +4 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.headless.state.d.ts +24 -8
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.server.d.ts +8 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.validationErrors.d.ts +17 -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/event-registration/event-registration.headless.planning.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/eventScope.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration.server.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/eventCollectionContract.d.ts +42 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/utils.d.ts +4 -1
- 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/runtime/shared/components/FeedbackMessage.d.ts +17 -1
- package/dist/_dts/blocks/src/system/runtime/shared/components/index.d.ts +1 -1
- package/dist/_dts/blocks/src/system/spacing.d.ts +1 -1
- package/dist/_dts/blocks/src/system/transforms/registry/_utils/boxStyleClassNames.d.ts +90 -0
- package/dist/_dts/blocks/src/system/transforms/registry/_utils/surfaceForegroundStyles.d.ts +7 -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 +29 -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 +4 -40
- 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/components/ContentFieldsForm.d.ts +2 -2
- 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/content-types/builtin-schemas.d.ts +6 -6
- package/dist/_dts/content-model/src/content-types/builtins.d.ts +6 -6
- 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/branded.d.ts +4 -0
- package/dist/_dts/core/src/event-page-surface-subject.d.ts +25 -4
- 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 +4 -0
- package/dist/_dts/core/src/public-event-booking-availability.d.ts +8 -0
- package/dist/_dts/core/src/secret.d.ts +44 -0
- package/dist/_dts/db/src/generated/supabase/database.types.d.ts +379 -18
- package/dist/_dts/editor-blocks/src/BlockEditor.d.ts +2 -1
- package/dist/_dts/editor-blocks/src/BlockForm.d.ts +2 -2
- package/dist/_dts/editor-blocks/src/block-editor/BlockCard.d.ts +2 -2
- package/dist/_dts/editor-blocks/src/block-editor/BlockCardBody.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/block-editor/BlockCardHeader.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/block-editor/SortableBlockItem.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/block-editor/hooks/useBlockValidationManifests.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/block-editor/preparedManifest.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/blockPayload.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/index.d.ts +2 -2
- package/dist/_dts/editor-blocks/src/media/MediaField.d.ts +2 -2
- package/dist/_dts/editor-blocks/src/widgets/button/ButtonField.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/widgets/button/ButtonVariantField.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/widgets/button/index.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/widgets/content-type-select/ContentTypeSelectField.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/widgets/entry-picker/EntryPickerField.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/widgets/entry-picker/index.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/widgets/icon-picker/IconPickerField.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/widgets/inline-text/InlineTextField.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/widgets/link/LinkField.d.ts +2 -2
- package/dist/_dts/editor-blocks/src/widgets/offerings-preview/OfferingsPreviewGroupOrderField.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/widgets/reference/ReferenceField.d.ts +2 -2
- package/dist/_dts/editor-blocks/src/widgets/rich-text/RichTextField.d.ts +2 -2
- package/dist/_dts/editor-blocks/src/widgets/site-option-picker/SiteOptionPickerField.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/widgets/site-option-picker/utils.d.ts +1 -1
- package/dist/_dts/preview-next/src/client/blocks/useBlockCustomizeControls.d.ts +1 -1
- package/dist/_dts/preview-next/src/client/preview/EntryEditorPanel.d.ts +1 -1
- package/dist/_dts/preview-next/src/client/preview/EntrySlotBlockEditorPanel.d.ts +1 -1
- 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 +5 -5
- package/dist/_dts/preview-next/src/client/preview/PreviewShellLayout.d.ts +3 -5
- package/dist/_dts/preview-next/src/client/preview/PreviewSiteFontStorageContext.d.ts +6 -0
- 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/siteFontPreview.d.ts +5 -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/preview-next/src/client/sdk/contentStorage.d.ts +10 -0
- package/dist/_dts/preview-next/src/client/widgets/widgetOverrides.d.ts +1 -1
- package/dist/_dts/preview-next/src/index.d.ts +1 -0
- package/dist/_dts/preview-next/src/keepAlive.d.ts +3 -5
- package/dist/_dts/preview-next/src/refresh-contract.d.ts +1 -0
- package/dist/_dts/preview-next/src/route-contract.d.ts +7 -0
- package/dist/_dts/sdk/src/config/types.d.ts +1 -0
- package/dist/_dts/sdk/src/config/validation.d.ts +2 -0
- package/dist/_dts/sdk/src/contracts/index.d.ts +1 -1
- package/dist/_dts/sdk/src/contracts/system-block-content.d.ts +64 -79
- 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/preview-next/keep-alive.d.ts +1 -1
- package/dist/_dts/sdk/src/public-api/contracts.d.ts +2 -16
- package/dist/_dts/sdk/src/rendering/components/Layout.d.ts +4 -3
- 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 +3 -1
- package/dist/_dts/sdk/src/rendering/islands/types.d.ts +15 -2
- 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/theme-bridge/types.d.ts +4 -2
- package/dist/_dts/sdk/src/version.d.ts +1 -1
- package/dist/_dts/theme-core/src/blockOverrides.d.ts +1 -1
- package/dist/_dts/theme-core/src/boxBackgroundSchema.d.ts +184 -0
- package/dist/_dts/theme-core/src/buttons/buttonColourContract.d.ts +96 -0
- package/dist/_dts/theme-core/src/buttons/buttonSurfaceContext.d.ts +78 -0
- package/dist/_dts/theme-core/src/buttons/index.d.ts +1 -0
- package/dist/_dts/theme-core/src/buttons/parseThemeForPersistence.d.ts +2 -2
- package/dist/_dts/theme-core/src/buttons/resolveButtonColourStates.d.ts +9 -57
- package/dist/_dts/theme-core/src/buttons/resolvedButtonCss.d.ts +6 -3
- package/dist/_dts/theme-core/src/buttons/styles/domain.d.ts +8 -7
- package/dist/_dts/theme-core/src/buttons/styles/recipes/quietArrow.d.ts +1 -0
- package/dist/_dts/theme-core/src/buttons/styles/recipes/staticRecipes.d.ts +11 -0
- package/dist/_dts/theme-core/src/buttons/styles/registry.d.ts +12 -0
- package/dist/_dts/theme-core/src/buttons/styles/selection.d.ts +5 -0
- package/dist/_dts/theme-core/src/buttons/types.d.ts +51 -4
- package/dist/_dts/theme-core/src/cards/core.d.ts +54 -10
- package/dist/_dts/theme-core/src/cards/decorations.d.ts +33 -0
- package/dist/_dts/theme-core/src/cards/generateDefaultCardSystem.d.ts +7 -2
- package/dist/_dts/theme-core/src/cards/index.d.ts +3 -0
- package/dist/_dts/theme-core/src/cards/openCardVariant.d.ts +24 -0
- package/dist/_dts/theme-core/src/cards/roles.d.ts +38 -0
- package/dist/_dts/theme-core/src/cards/siteStyleDefaults.d.ts +53 -8
- package/dist/_dts/theme-core/src/cards/types.d.ts +489 -21
- package/dist/_dts/theme-core/src/generated/containerResponsiveThemeCss.d.ts +1 -1
- package/dist/_dts/theme-core/src/header/legacyHeaderVariant.d.ts +59 -0
- package/dist/_dts/theme-core/src/header/paintTargets.d.ts +2 -2
- package/dist/_dts/theme-core/src/header/scrollTreatment.d.ts +3 -2
- package/dist/_dts/theme-core/src/lib/media.d.ts +583 -10
- package/dist/_dts/theme-core/src/mock-themes/all.d.ts +5085 -1524
- package/dist/_dts/theme-core/src/palette/utils/contrast.d.ts +1 -0
- package/dist/_dts/theme-core/src/palette/utils/opaqueSurfaceColor.d.ts +6 -0
- package/dist/_dts/theme-core/src/runtime/buildThemeRuntimeFromBridge.d.ts +1 -1
- package/dist/_dts/theme-core/src/schema.d.ts +5300 -2019
- package/dist/_dts/theme-core/src/site-styles/appearancePresetCatalog.d.ts +84 -102
- package/dist/_dts/theme-core/src/site-styles/appearancePresetResolution.d.ts +12 -1
- package/dist/_dts/theme-core/src/site-styles/appearancePresetTypes.d.ts +9 -4
- package/dist/_dts/theme-core/src/site-styles/backgroundAppearance.d.ts +0 -20
- package/dist/_dts/theme-core/src/site-styles/blockAppearancePresets.d.ts +84 -102
- package/dist/_dts/theme-core/src/site-styles/cardRoleVocabulary.d.ts +48 -0
- 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 +21 -385
- 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 +10 -18
- package/dist/_dts/theme-core/src/site-styles/headerLayoutCatalog.d.ts +281 -0
- package/dist/_dts/theme-core/src/site-styles/headerLayoutResolution.d.ts +13 -0
- package/dist/_dts/theme-core/src/site-styles/headerLayoutStyles.d.ts +6 -0
- package/dist/_dts/theme-core/src/site-styles/{headerLookTypes.d.ts → headerLayoutTypes.d.ts} +18 -90
- 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 -11
- package/dist/_dts/theme-core/src/site-styles/headerOpeningSection.d.ts +2 -4
- package/dist/_dts/theme-core/src/site-styles/headerStyleCompiler.d.ts +2 -2
- package/dist/_dts/theme-core/src/site-styles/imageSurfaceBackground.d.ts +14 -0
- package/dist/_dts/theme-core/src/site-styles/index.d.ts +6 -1
- package/dist/_dts/theme-core/src/site-styles/pageDesignAppearanceAvailability.d.ts +3 -0
- package/dist/_dts/theme-core/src/site-styles/pageDesignEditorCapabilities.d.ts +22 -0
- package/dist/_dts/theme-core/src/site-styles/pageDesignEditorModel.d.ts +9 -8
- package/dist/_dts/theme-core/src/site-styles/pageDesignIntentEquality.d.ts +3 -0
- package/dist/_dts/theme-core/src/site-styles/previewCompiler.d.ts +14 -41
- package/dist/_dts/theme-core/src/site-styles/previewRuntimeCapabilities.d.ts +19 -0
- package/dist/_dts/theme-core/src/site-styles/runtimeBackgroundResolution.d.ts +32 -0
- package/dist/_dts/theme-core/src/site-styles/runtimeCompiler.d.ts +9 -68
- package/dist/_dts/theme-core/src/site-styles/siteChromeNavPreferences.d.ts +1 -1
- package/dist/_dts/theme-core/src/site-styles/sourceCatalogs.d.ts +13 -12
- package/dist/_dts/theme-core/src/site-styles/types.d.ts +50 -39
- package/dist/_dts/theme-core/src/siteChromePlanning.d.ts +9 -9
- package/dist/_dts/theme-core/src/status/generateStatusCss.d.ts +1 -0
- package/dist/_dts/theme-core/src/surfaces/index.d.ts +1 -0
- package/dist/_dts/theme-core/src/surfaces/resolveSurfaceForeground.d.ts +39 -0
- package/dist/_dts/ui/src/navigation-tabs.d.ts +3 -2
- package/dist/client/{CourseRegistrationWizard-xRmA7REV.mjs → CourseRegistrationWizard-DGW9F0SQ.mjs} +7 -7
- package/dist/client/{DiscountCodeDisclosure-B9vriL5C.mjs → DiscountCodeDisclosure-BPZ-yfGI.mjs} +1 -1
- package/dist/client/{EventCombined.client-BgVnVTlz.mjs → EventCombined.client-Cjt3kKYR.mjs} +4 -4
- package/dist/client/{EventListing.client-CqdsO7jO.mjs → EventListing.client-DY9dn6Fh.mjs} +2 -2
- package/dist/client/{FeedbackMessage-ByMrs3cr.mjs → FeedbackMessage-CtLvvS_d.mjs} +15 -3
- package/dist/client/{LeafletStaticMap-CKPxot9M.mjs → LeafletStaticMap--2c61XYn.mjs} +1 -1
- package/dist/client/{StepIndicator-DGCYuBJ1.mjs → StepIndicator-CLjQhkDb.mjs} +3 -3
- package/dist/client/{accordion-BfN5Eqd-.mjs → accordion-_boYwHHi.mjs} +1 -1
- package/dist/client/{bookingForm-DOvCpBFP.mjs → bookingForm--AqEfyBX.mjs} +56 -39
- package/dist/client/bookings.mjs +1348 -1157
- package/dist/client/{carousel-DPNmiH0f.mjs → carousel-CVI2dqZr.mjs} +2 -2
- package/dist/client/{carousel.client-CpwTUhIo.mjs → carousel.client-59G_WMr4.mjs} +1 -1
- package/dist/client/{cart--egVXlrR.mjs → cart-DR6IiPz9.mjs} +3 -3
- package/dist/client/{checkout-DywWtMcq.mjs → checkout-CsrGAfQt.mjs} +3 -3
- package/dist/client/client.mjs +20935 -19889
- package/dist/client/{colorStyles-BWpj_h4C.mjs → colorStyles-CrxJrPjJ.mjs} +277 -1
- package/dist/client/{context-CJz1Vlsz.mjs → context-B83PiNzm.mjs} +6 -21
- package/dist/client/{courseRegistration-Dk9qFVwt.mjs → courseRegistration-aNJVaLa3.mjs} +3 -3
- package/dist/client/{eventCalendar-Bkz2HjlS.mjs → eventCalendar-OZ7h59VN.mjs} +6 -6
- package/dist/client/{eventCombined-D4kipYWg.mjs → eventCombined-BbJ6bFKz.mjs} +3 -3
- package/dist/client/{eventDetails-Dz_5ix2Q.mjs → eventDetails-BLyUBiCT.mjs} +3 -3
- package/dist/client/{eventListing-D0vm-zST.mjs → eventListing-DuP1yhBS.mjs} +3 -3
- package/dist/client/{eventRegistration-Cw1E4Q4p.mjs → eventRegistration-BXyECPa-.mjs} +11 -12
- package/dist/client/{form-C2Zf1n3K.mjs → form-BA4t3kKU.mjs} +4 -4
- package/dist/client/{headerSection-CP05gzdc.mjs → headerSection-CpNaJxhW.mjs} +151 -104
- package/dist/client/hooks.mjs +6328 -6104
- package/dist/client/{locationMap-Cl3x9PYJ.mjs → locationMap-3HGMCL7_.mjs} +3 -3
- package/dist/client/{media-CNE1Z-wb.mjs → media-BOHuueS5.mjs} +16 -4
- package/dist/client/{newsletterForm-DyEJoClm.mjs → newsletterForm-C2s6Mw67.mjs} +4 -4
- package/dist/client/{pricing-DGuNR1W4.mjs → pricing-BiqIMgZk.mjs} +1 -1
- package/dist/client/{productDetail-Cq-HrGew.mjs → productDetail-C9joWhdE.mjs} +3 -3
- package/dist/client/{productList-DbB3jwqd.mjs → productList-CjzdU3pB.mjs} +3 -3
- package/dist/client/{propsDecoder-CiTuhUwY.mjs → propsDecoder-CBPGXEYX.mjs} +2480 -2478
- package/dist/client/rendering/client.mjs +5371 -6741
- package/dist/client/rendering/islands.mjs +20 -20
- package/dist/client/rendering.mjs +18616 -17447
- package/dist/client/{scrollToBlock-CShkRqab.mjs → scrollToBlock-DZ73aEX6.mjs} +1 -1
- package/dist/client/{shop-Cu4Ib-ZA.mjs → shop-CQRai7hj.mjs} +36 -25
- package/dist/client/{shop-commerce-BzpsOdh7.mjs → shop-commerce-hP9UboOx.mjs} +8 -8
- package/dist/client/{shop-commerce-store-DaE7Fhj8.mjs → shop-commerce-store-DiD5a32e.mjs} +1 -1
- package/dist/client/{shopShared-cF0c20vB.mjs → shopShared-DP8DXTkF.mjs} +12 -6
- package/dist/client/{useEventFilters-QZ3HMgaJ.mjs → useEventFilters-pF_OJNQP.mjs} +137 -81
- package/dist/client/{usePolling-BKf0GcE-.mjs → usePolling-Cls91SD2.mjs} +2 -2
- package/dist/preview-next/before-render.mjs +202 -129
- package/dist/preview-next/client/runtime.mjs +4 -4
- package/dist/preview-next/keepAlive.mjs +7406 -29
- package/dist/preview-next/middleware.mjs +196 -128
- package/dist/{previewAuthStore-BesgU5Xu.mjs → previewAuthStore-CX1C_KJ4.mjs} +195 -128
- package/dist/{sdk-runtime-C20CVWbb.mjs → sdk-runtime-5CcPAI14.mjs} +2 -2
- package/dist/{separator-BE3NCquy.mjs → separator-BXlYN_gr.mjs} +1 -1
- package/dist/server/components.mjs +22644 -21375
- package/dist/server/config-validation.mjs +6507 -6309
- package/dist/server/config.mjs +6511 -6313
- package/dist/server/data.mjs +6311 -6104
- package/dist/server/date-time.mjs +22 -13
- package/dist/server/index.mjs +196 -129
- package/dist/server/next.mjs +22782 -21578
- package/dist/server/page-converter.mjs +4769 -6213
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +20525 -20291
- package/dist/server/rendering.mjs +22677 -21389
- package/dist/server/routing.mjs +6651 -5398
- package/dist/server/server.mjs +6389 -6256
- package/dist/server/theme-bridge.mjs +2251 -2465
- package/dist/server/theme.mjs +974 -642
- package/dist/styles/index.css +317 -337
- package/package.json +3 -2
- package/dist/_dts/block-form/src/client/blockDraftSaveability.d.ts +0 -1
- package/dist/_dts/block-form/src/widgets/index.d.ts +0 -20
- package/dist/_dts/blocks/src/system/runtime/api/requestBody.d.ts +0 -7
- package/dist/_dts/preview-next/src/client/preview/siteChromeLookRows.d.ts +0 -66
- package/dist/_dts/theme-core/src/site-styles/headerLayoutStyleCatalog.d.ts +0 -254
- package/dist/_dts/theme-core/src/site-styles/headerLegacyLooks.d.ts +0 -372
- package/dist/_dts/theme-core/src/site-styles/headerLookBranding.d.ts +0 -106
- package/dist/_dts/theme-core/src/site-styles/headerLookSelection.d.ts +0 -2
- package/dist/_dts/theme-core/src/site-styles/headerLooks.d.ts +0 -7
- package/dist/_dts/theme-core/src/site-styles/headerStyleCompilerPrimitives.d.ts +0 -23
- package/dist/client/clsx-DgIEfj3H.mjs +0 -16
package/dist/server/theme.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { z } from "zod";
|
|
2
2
|
import * as fs from "fs/promises";
|
|
3
3
|
import * as path from "path";
|
|
4
4
|
//#region ../theme-core/src/palette/utils/colorConversion.ts
|
|
@@ -312,6 +312,25 @@ const nonShadeablePaletteRoleNames = /* @__PURE__ */ new Set([
|
|
|
312
312
|
"warning",
|
|
313
313
|
"destructive"
|
|
314
314
|
]);
|
|
315
|
+
/**
|
|
316
|
+
* Status role aliases the persisted palette does not carry itself.
|
|
317
|
+
*
|
|
318
|
+
* Generators reference `--tb-error` (the site-style-owned input error border)
|
|
319
|
+
* and `--tb-info` (`.alert-info`, `.status-info`, the field-note rule), but the
|
|
320
|
+
* palette schema only defines `destructive` and has no `info` role at all.
|
|
321
|
+
* Without these aliases those declarations name variables that are never
|
|
322
|
+
* defined and browsers drop them. The SDK bridge resolves the same pair via
|
|
323
|
+
* TOKEN_ALIASES, so both runtimes agree on what a status token means.
|
|
324
|
+
*
|
|
325
|
+
* Runs after the danger → destructive promotion above, so `destructive` is
|
|
326
|
+
* already the single source of truth for the error colour.
|
|
327
|
+
*/
|
|
328
|
+
function statusAliasTokens(expanded) {
|
|
329
|
+
const aliases = {};
|
|
330
|
+
if (expanded.destructive) aliases.error = expanded.destructive;
|
|
331
|
+
if (expanded.accent) aliases.info = expanded.accent;
|
|
332
|
+
return aliases;
|
|
333
|
+
}
|
|
315
334
|
function expandPalette(palette) {
|
|
316
335
|
const base = colorsToMap(palette);
|
|
317
336
|
const expanded = { ...base };
|
|
@@ -330,6 +349,7 @@ function expandPalette(palette) {
|
|
|
330
349
|
}
|
|
331
350
|
if (base.text) expanded.body = base.text;
|
|
332
351
|
if (base.danger && !base.destructive) expanded.destructive = base.danger;
|
|
352
|
+
Object.assign(expanded, statusAliasTokens(expanded));
|
|
333
353
|
const isDark = base.background ? isBackgroundDark(base.background) : false;
|
|
334
354
|
expanded.mutedText = palette.meta?.mode === "dark" || isDark ? expanded["neutral-600"] ?? "#666" : expanded["neutral-500"] ?? "#888";
|
|
335
355
|
for (const [token, hex] of Object.entries({ ...expanded })) {
|
|
@@ -431,7 +451,7 @@ const PALETTE_TOKEN_NAMES = [
|
|
|
431
451
|
"text",
|
|
432
452
|
"border"
|
|
433
453
|
];
|
|
434
|
-
const paletteTokenNameSchema = z
|
|
454
|
+
const paletteTokenNameSchema = z.enum(PALETTE_TOKEN_NAMES);
|
|
435
455
|
const themeColorBaseTokenNames = [
|
|
436
456
|
...PALETTE_TOKEN_NAMES,
|
|
437
457
|
...blockColorTokenNames,
|
|
@@ -476,7 +496,7 @@ function parseThemeColorToken(value) {
|
|
|
476
496
|
if (!isThemeColorToken(value)) return null;
|
|
477
497
|
return value.trim();
|
|
478
498
|
}
|
|
479
|
-
const themeColorTokenSchema = z
|
|
499
|
+
const themeColorTokenSchema = z.string().min(1).refine((value) => Boolean(isThemeColorToken(value)), "Expected a known Theme V2 color token");
|
|
480
500
|
//#endregion
|
|
481
501
|
//#region ../theme-core/src/palette/colors.ts
|
|
482
502
|
const HEX_COLOR_REGEX = /^#[0-9a-f]{6}$/;
|
|
@@ -496,11 +516,11 @@ const THEME_PALETTE_COLOR_ORDER = [
|
|
|
496
516
|
"primaryForeground",
|
|
497
517
|
"border"
|
|
498
518
|
];
|
|
499
|
-
const hexColorSchema = z
|
|
500
|
-
const paletteModeSchema = z
|
|
519
|
+
const hexColorSchema = z.string().regex(HEX_COLOR_REGEX, "Hex must be #RRGGBB (lowercase)").transform((value) => value);
|
|
520
|
+
const paletteModeSchema = z.enum(["light", "dark"]);
|
|
501
521
|
const PALETTE_VALUE_KEY_PREFIX = "palette-value:v1|";
|
|
502
|
-
z
|
|
503
|
-
const paletteColorsSchema = z
|
|
522
|
+
z.string().regex(/^[0-9a-f]{64}$/, "Palette hash must be a lowercase SHA-256 value").transform((value) => value);
|
|
523
|
+
const paletteColorsSchema = z.object({
|
|
504
524
|
primary: hexColorSchema,
|
|
505
525
|
primaryForeground: hexColorSchema,
|
|
506
526
|
secondary: hexColorSchema,
|
|
@@ -606,14 +626,14 @@ function parsePaletteValueKey(value) {
|
|
|
606
626
|
if (!colors.ok || paletteValueKey(colors.colors, mode.data) !== value) return null;
|
|
607
627
|
return value;
|
|
608
628
|
}
|
|
609
|
-
z
|
|
629
|
+
z.string().transform((value, ctx) => {
|
|
610
630
|
const parsed = parsePaletteValueKey(value);
|
|
611
631
|
if (parsed) return parsed;
|
|
612
632
|
ctx.addIssue({
|
|
613
633
|
code: "custom",
|
|
614
634
|
message: "Invalid canonical palette value key"
|
|
615
635
|
});
|
|
616
|
-
return z
|
|
636
|
+
return z.NEVER;
|
|
617
637
|
});
|
|
618
638
|
//#endregion
|
|
619
639
|
//#region ../theme-core/src/lib/media.ts
|
|
@@ -649,15 +669,17 @@ const transformSchema = z.object({
|
|
|
649
669
|
hotspot: hotspotSchema.optional(),
|
|
650
670
|
rotation: rotationSchema.optional()
|
|
651
671
|
});
|
|
652
|
-
const
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
672
|
+
const mediaPosterSchema = z.discriminatedUnion("tag", [z.object({
|
|
673
|
+
tag: z.literal("storage"),
|
|
674
|
+
assetId: z.string().optional(),
|
|
675
|
+
storageBucket: z.string().min(1),
|
|
676
|
+
storagePath: z.string().min(1)
|
|
677
|
+
}), z.object({
|
|
678
|
+
tag: z.literal("external-src"),
|
|
679
|
+
assetId: z.string().optional(),
|
|
680
|
+
src: z.string().url()
|
|
681
|
+
})]);
|
|
682
|
+
const mediaBaseSchema = z.object({
|
|
661
683
|
purpose: z.string().optional(),
|
|
662
684
|
placeholder: z.boolean().default(true).optional(),
|
|
663
685
|
assetId: z.string().optional(),
|
|
@@ -670,18 +692,43 @@ const mediaSchema = z.object({
|
|
|
670
692
|
height: z.number().optional(),
|
|
671
693
|
storageBucket: z.string().optional(),
|
|
672
694
|
storagePath: z.string().optional(),
|
|
695
|
+
poster: mediaPosterSchema.optional(),
|
|
673
696
|
transform: transformSchema.optional()
|
|
674
697
|
});
|
|
698
|
+
const mediaIdentifierSchema = z.string().trim().min(1).brand();
|
|
699
|
+
const imageMediaSchema = mediaBaseSchema.extend({ type: z.literal("image") });
|
|
700
|
+
const videoMediaSchema = mediaBaseSchema.extend({ type: z.literal("video") });
|
|
701
|
+
const audioMediaSchema = mediaBaseSchema.extend({ type: z.literal("audio") });
|
|
702
|
+
const documentMediaSchema = mediaBaseSchema.extend({ type: z.literal("document") });
|
|
703
|
+
const spreadsheetMediaSchema = mediaBaseSchema.extend({ type: z.literal("spreadsheet") });
|
|
704
|
+
const archiveMediaSchema = mediaBaseSchema.extend({ type: z.literal("archive") });
|
|
705
|
+
const mediaSchema = z.discriminatedUnion("type", [
|
|
706
|
+
imageMediaSchema,
|
|
707
|
+
videoMediaSchema,
|
|
708
|
+
audioMediaSchema,
|
|
709
|
+
documentMediaSchema,
|
|
710
|
+
spreadsheetMediaSchema,
|
|
711
|
+
archiveMediaSchema
|
|
712
|
+
]);
|
|
713
|
+
const persistableMediaBaseSchema = mediaBaseSchema.extend({ identifier: mediaIdentifierSchema });
|
|
714
|
+
z.discriminatedUnion("type", [
|
|
715
|
+
persistableMediaBaseSchema.extend({ type: z.literal("image") }),
|
|
716
|
+
persistableMediaBaseSchema.extend({ type: z.literal("video") }),
|
|
717
|
+
persistableMediaBaseSchema.extend({ type: z.literal("audio") }),
|
|
718
|
+
persistableMediaBaseSchema.extend({ type: z.literal("document") }),
|
|
719
|
+
persistableMediaBaseSchema.extend({ type: z.literal("spreadsheet") }),
|
|
720
|
+
persistableMediaBaseSchema.extend({ type: z.literal("archive") })
|
|
721
|
+
]);
|
|
675
722
|
//#endregion
|
|
676
723
|
//#region ../theme-core/src/palette/schema.ts
|
|
677
|
-
const colourHexString = z
|
|
678
|
-
const paletteColorSchema = z
|
|
679
|
-
name: z
|
|
724
|
+
const colourHexString = z.string().regex(/^#([0-9A-Fa-f]{3}){1,2}$/);
|
|
725
|
+
const paletteColorSchema = z.object({
|
|
726
|
+
name: z.string().min(1),
|
|
680
727
|
hex: colourHexString
|
|
681
728
|
});
|
|
682
|
-
const paletteMetaSchema = z
|
|
683
|
-
const paletteSchema = z
|
|
684
|
-
colors: z
|
|
729
|
+
const paletteMetaSchema = z.object({ mode: z.enum(["light", "dark"]) });
|
|
730
|
+
const paletteSchema = z.object({
|
|
731
|
+
colors: z.array(paletteColorSchema),
|
|
685
732
|
meta: paletteMetaSchema
|
|
686
733
|
}).transform((palette, ctx) => {
|
|
687
734
|
const colors = paletteColorsFromEntries(palette.colors);
|
|
@@ -690,7 +737,7 @@ const paletteSchema = z$1.object({
|
|
|
690
737
|
code: "custom",
|
|
691
738
|
message: `Invalid complete palette: ${colors.error.kind}`
|
|
692
739
|
});
|
|
693
|
-
return z
|
|
740
|
+
return z.NEVER;
|
|
694
741
|
}
|
|
695
742
|
return {
|
|
696
743
|
colors: paletteColorEntries(colors.colors).map(({ name, hex }) => ({
|
|
@@ -721,7 +768,7 @@ const VARIANT_ROLES = [
|
|
|
721
768
|
* IDs become class selectors, so keep the contract deliberately narrower than
|
|
722
769
|
* an arbitrary string and shared with every authoring/runtime boundary.
|
|
723
770
|
*/
|
|
724
|
-
const buttonVariantIdSchema = z
|
|
771
|
+
const buttonVariantIdSchema = z.string().min(1).max(50).regex(/^[a-z0-9-]+$/, "Button variant IDs may contain lowercase letters, numbers, and hyphens only").refine((value) => value !== "link" && value !== "tertiary", { message: "Retired button role IDs are not valid variant IDs" });
|
|
725
772
|
function parseOpaqueButtonColourToken(value) {
|
|
726
773
|
const token = parseThemeColorToken(value);
|
|
727
774
|
if (token === null) return null;
|
|
@@ -736,8 +783,8 @@ const opaqueButtonColourTokenSchema = themeColorTokenSchema.refine((value) => pa
|
|
|
736
783
|
if (token === null) throw new Error("Invariant: opaque button token passed its schema");
|
|
737
784
|
return token;
|
|
738
785
|
});
|
|
739
|
-
const buttonShadeAmountSchema = z
|
|
740
|
-
const buttonShadowIntensitySchema = z
|
|
786
|
+
const buttonShadeAmountSchema = z.number().finite().min(0).max(900).multipleOf(100);
|
|
787
|
+
const buttonShadowIntensitySchema = z.enum([
|
|
741
788
|
"subtle",
|
|
742
789
|
"medium",
|
|
743
790
|
"strong"
|
|
@@ -749,153 +796,176 @@ const buttonShadowIntensitySchema = z$1.enum([
|
|
|
749
796
|
* this closed union so unsupported effect IDs, unknown option keys, and unsafe
|
|
750
797
|
* CSS values cannot become representable after the schema boundary.
|
|
751
798
|
*/
|
|
752
|
-
const buttonEffectApplicationSchema = z
|
|
753
|
-
z
|
|
754
|
-
effectId: z
|
|
755
|
-
options: z
|
|
799
|
+
const buttonEffectApplicationSchema = z.discriminatedUnion("effectId", [
|
|
800
|
+
z.strictObject({
|
|
801
|
+
effectId: z.literal("darken-background"),
|
|
802
|
+
options: z.strictObject({ amount: buttonShadeAmountSchema.optional() }).optional()
|
|
756
803
|
}),
|
|
757
|
-
z
|
|
758
|
-
effectId: z
|
|
759
|
-
options: z
|
|
804
|
+
z.strictObject({
|
|
805
|
+
effectId: z.literal("lighten-background"),
|
|
806
|
+
options: z.strictObject({ amount: buttonShadeAmountSchema.optional() }).optional()
|
|
760
807
|
}),
|
|
761
|
-
z
|
|
762
|
-
effectId: z
|
|
763
|
-
options: z
|
|
808
|
+
z.strictObject({
|
|
809
|
+
effectId: z.literal("background-on-hover"),
|
|
810
|
+
options: z.strictObject({ colorToken: opaqueButtonColourTokenSchema.optional() }).optional()
|
|
764
811
|
}),
|
|
765
|
-
z
|
|
766
|
-
effectId: z
|
|
767
|
-
options: z
|
|
812
|
+
z.strictObject({
|
|
813
|
+
effectId: z.literal("animated-gradient"),
|
|
814
|
+
options: z.strictObject({ direction: z.enum(["horizontal", "vertical"]).optional() }).optional()
|
|
768
815
|
}),
|
|
769
|
-
z
|
|
770
|
-
effectId: z
|
|
771
|
-
options: z
|
|
816
|
+
z.strictObject({
|
|
817
|
+
effectId: z.literal("drop-shadow"),
|
|
818
|
+
options: z.strictObject({ intensity: buttonShadowIntensitySchema.optional() }).optional()
|
|
772
819
|
}),
|
|
773
|
-
z
|
|
774
|
-
effectId: z
|
|
775
|
-
options: z
|
|
820
|
+
z.strictObject({
|
|
821
|
+
effectId: z.literal("inner-shadow"),
|
|
822
|
+
options: z.strictObject({}).optional()
|
|
776
823
|
}),
|
|
777
|
-
z
|
|
778
|
-
effectId: z
|
|
779
|
-
options: z
|
|
780
|
-
mode: z
|
|
824
|
+
z.strictObject({
|
|
825
|
+
effectId: z.literal("neumorphic-shadow"),
|
|
826
|
+
options: z.strictObject({
|
|
827
|
+
mode: z.enum(["raised", "pressed"]).optional(),
|
|
781
828
|
intensity: buttonShadowIntensitySchema.optional()
|
|
782
829
|
}).optional()
|
|
783
830
|
}),
|
|
784
|
-
z
|
|
785
|
-
effectId: z
|
|
786
|
-
options: z
|
|
831
|
+
z.strictObject({
|
|
832
|
+
effectId: z.literal("retro-3d-shadow"),
|
|
833
|
+
options: z.strictObject({}).optional()
|
|
787
834
|
}),
|
|
788
|
-
z
|
|
789
|
-
effectId: z
|
|
790
|
-
options: z
|
|
835
|
+
z.strictObject({
|
|
836
|
+
effectId: z.literal("scale-up"),
|
|
837
|
+
options: z.strictObject({ scale: z.enum([
|
|
791
838
|
"1.02",
|
|
792
839
|
"1.03",
|
|
793
840
|
"1.05",
|
|
794
841
|
"1.10"
|
|
795
842
|
]).optional() }).optional()
|
|
796
843
|
}),
|
|
797
|
-
z
|
|
798
|
-
effectId: z
|
|
799
|
-
options: z
|
|
844
|
+
z.strictObject({
|
|
845
|
+
effectId: z.literal("scale-down"),
|
|
846
|
+
options: z.strictObject({ scale: z.enum([
|
|
800
847
|
"0.90",
|
|
801
848
|
"0.95",
|
|
802
849
|
"0.97",
|
|
803
850
|
"0.98"
|
|
804
851
|
]).optional() }).optional()
|
|
805
852
|
}),
|
|
806
|
-
z
|
|
807
|
-
effectId: z
|
|
808
|
-
options: z
|
|
853
|
+
z.strictObject({
|
|
854
|
+
effectId: z.literal("lift"),
|
|
855
|
+
options: z.strictObject({ amount: z.enum([
|
|
809
856
|
"0.25",
|
|
810
857
|
"0.5",
|
|
811
858
|
"1"
|
|
812
859
|
]).optional() }).optional()
|
|
813
860
|
}),
|
|
814
|
-
z
|
|
815
|
-
effectId: z
|
|
816
|
-
options: z
|
|
861
|
+
z.strictObject({
|
|
862
|
+
effectId: z.literal("press-down"),
|
|
863
|
+
options: z.strictObject({}).optional()
|
|
817
864
|
}),
|
|
818
|
-
z
|
|
819
|
-
effectId: z
|
|
820
|
-
options: z
|
|
865
|
+
z.strictObject({
|
|
866
|
+
effectId: z.literal("pop"),
|
|
867
|
+
options: z.strictObject({ intensity: z.enum([
|
|
821
868
|
"subtle",
|
|
822
869
|
"medium",
|
|
823
870
|
"dramatic"
|
|
824
871
|
]).optional() }).optional()
|
|
825
872
|
}),
|
|
826
|
-
z
|
|
827
|
-
effectId: z
|
|
828
|
-
options: z
|
|
829
|
-
height: z
|
|
830
|
-
origin: z
|
|
873
|
+
z.strictObject({
|
|
874
|
+
effectId: z.literal("border-bottom-grow"),
|
|
875
|
+
options: z.strictObject({
|
|
876
|
+
height: z.union([z.literal(1), z.literal(2)]).optional(),
|
|
877
|
+
origin: z.enum([
|
|
831
878
|
"left",
|
|
832
879
|
"center",
|
|
833
880
|
"right"
|
|
834
881
|
]).optional()
|
|
835
882
|
}).optional()
|
|
836
883
|
}),
|
|
837
|
-
z
|
|
838
|
-
effectId: z
|
|
839
|
-
options: z
|
|
884
|
+
z.strictObject({
|
|
885
|
+
effectId: z.literal("sketchy-border"),
|
|
886
|
+
options: z.strictObject({ intensity: buttonShadowIntensitySchema.optional() }).optional()
|
|
840
887
|
})
|
|
841
888
|
]);
|
|
842
|
-
const cornerStyleSchema = z
|
|
889
|
+
const cornerStyleSchema = z.enum([
|
|
843
890
|
"square",
|
|
844
891
|
"rounded",
|
|
845
892
|
"pill"
|
|
846
893
|
]);
|
|
847
|
-
const shadowSizeSchema = z
|
|
894
|
+
const shadowSizeSchema = z.enum([
|
|
848
895
|
"none",
|
|
849
896
|
"low",
|
|
850
897
|
"medium",
|
|
851
898
|
"high"
|
|
852
899
|
]);
|
|
853
|
-
const textTransformSchema = z
|
|
900
|
+
const textTransformSchema = z.enum([
|
|
854
901
|
"none",
|
|
855
902
|
"uppercase",
|
|
856
903
|
"lowercase",
|
|
857
904
|
"capitalize"
|
|
858
905
|
]);
|
|
859
|
-
const fontWeightSchema = z
|
|
860
|
-
z
|
|
861
|
-
z
|
|
862
|
-
z
|
|
906
|
+
const fontWeightSchema = z.union([
|
|
907
|
+
z.literal(500),
|
|
908
|
+
z.literal(600),
|
|
909
|
+
z.literal(700)
|
|
863
910
|
]);
|
|
864
|
-
const buttonTypographySchema = z
|
|
865
|
-
const letterSpacingSchema = z
|
|
911
|
+
const buttonTypographySchema = z.enum(["body", "heading"]);
|
|
912
|
+
const letterSpacingSchema = z.enum([
|
|
866
913
|
"tight",
|
|
867
914
|
"normal",
|
|
868
915
|
"loose"
|
|
869
916
|
]);
|
|
870
|
-
const hoverTransformSchema = z
|
|
917
|
+
const hoverTransformSchema = z.enum([
|
|
871
918
|
"none",
|
|
872
919
|
"lift",
|
|
873
920
|
"scale",
|
|
874
921
|
"press"
|
|
875
922
|
]);
|
|
876
|
-
z
|
|
877
|
-
const buttonPaddingPresetSchema = z
|
|
923
|
+
z.enum(["none", "token"]);
|
|
924
|
+
const buttonPaddingPresetSchema = z.enum([
|
|
878
925
|
"compact",
|
|
879
926
|
"default",
|
|
880
927
|
"spacious"
|
|
881
928
|
]);
|
|
882
|
-
const gradientStyleSchema = z
|
|
929
|
+
const gradientStyleSchema = z.enum([
|
|
883
930
|
"linear",
|
|
884
931
|
"radial",
|
|
885
932
|
"conic"
|
|
886
933
|
]);
|
|
887
|
-
const gradientSharpnessSchema = z
|
|
934
|
+
const gradientSharpnessSchema = z.enum([
|
|
888
935
|
"smooth",
|
|
889
936
|
"medium",
|
|
890
937
|
"hard"
|
|
891
938
|
]);
|
|
892
|
-
const prioritySchema = z
|
|
893
|
-
z
|
|
894
|
-
z
|
|
895
|
-
z
|
|
939
|
+
const prioritySchema = z.union([
|
|
940
|
+
z.literal(1),
|
|
941
|
+
z.literal(2),
|
|
942
|
+
z.literal(3)
|
|
896
943
|
]);
|
|
897
|
-
z
|
|
898
|
-
const
|
|
944
|
+
const variantRoleSchema = z.enum(VARIANT_ROLES);
|
|
945
|
+
const buttonSurfaceFallbackSchema = z.discriminatedUnion("kind", [z.strictObject({ kind: z.literal("surface-outline") }), z.strictObject({
|
|
946
|
+
kind: z.literal("variant"),
|
|
947
|
+
role: variantRoleSchema
|
|
948
|
+
})]);
|
|
949
|
+
const standardButtonSurfacePolicy = {
|
|
950
|
+
primary: [{ kind: "surface-outline" }],
|
|
951
|
+
secondary: [{ kind: "surface-outline" }, {
|
|
952
|
+
kind: "variant",
|
|
953
|
+
role: "primary"
|
|
954
|
+
}],
|
|
955
|
+
outline: [{ kind: "surface-outline" }],
|
|
956
|
+
ghost: [{ kind: "surface-outline" }],
|
|
957
|
+
accent: [{ kind: "surface-outline" }, {
|
|
958
|
+
kind: "variant",
|
|
959
|
+
role: "primary"
|
|
960
|
+
}]
|
|
961
|
+
};
|
|
962
|
+
const STANDARD_BUTTON_SURFACE_POLICY = Object.freeze(Object.fromEntries(VARIANT_ROLES.map((role) => [role, Object.freeze([...standardButtonSurfacePolicy[role]])])));
|
|
963
|
+
function createStandardButtonSurfacePolicy() {
|
|
964
|
+
return Object.fromEntries(VARIANT_ROLES.map((role) => [role, [...STANDARD_BUTTON_SURFACE_POLICY[role]]]));
|
|
965
|
+
}
|
|
966
|
+
const buttonSurfacePolicyShape = Object.fromEntries(VARIANT_ROLES.map((role) => [role, z.array(buttonSurfaceFallbackSchema).max(VARIANT_ROLES.length)]));
|
|
967
|
+
const buttonSurfacePolicySchema = z.strictObject(buttonSurfacePolicyShape);
|
|
968
|
+
const buttonSizeNameSchema = z.enum([
|
|
899
969
|
"sm",
|
|
900
970
|
"md",
|
|
901
971
|
"lg",
|
|
@@ -909,13 +979,13 @@ const buttonSizeNameSchema = z$1.enum([
|
|
|
909
979
|
* generator trust the shape rather than defensively defaulting downstream.
|
|
910
980
|
*/
|
|
911
981
|
const PADDING_TOKEN_PATTERN = /^(?:0|\d+(?:\.\d+)?(?:rem|em|px|%))$/;
|
|
912
|
-
const paddingShorthandSchema = z
|
|
982
|
+
const paddingShorthandSchema = z.string().refine((value) => {
|
|
913
983
|
const parts = value.split(/\s+/).filter(Boolean);
|
|
914
984
|
return parts.length === 2 && parts.every((token) => PADDING_TOKEN_PATTERN.test(token));
|
|
915
985
|
}, { message: "Padding must be two space-separated CSS length tokens (e.g. \"0.5rem 1rem\"). Use `0` for zero." });
|
|
916
|
-
const buttonSizeConfigSchema = z
|
|
986
|
+
const buttonSizeConfigSchema = z.object({
|
|
917
987
|
padding: paddingShorthandSchema,
|
|
918
|
-
fontSize: z
|
|
988
|
+
fontSize: z.string().optional()
|
|
919
989
|
});
|
|
920
990
|
/**
|
|
921
991
|
* `xl` is optional on the wire so themes persisted before the `xl` size was
|
|
@@ -923,7 +993,7 @@ const buttonSizeConfigSchema = z$1.object({
|
|
|
923
993
|
* backfills it from `lg`, keeping `ButtonSizes` a complete `sm/md/lg/xl` map
|
|
924
994
|
* downstream — generators never need to deal with an undefined `xl`.
|
|
925
995
|
*/
|
|
926
|
-
const buttonSizesSchema = z
|
|
996
|
+
const buttonSizesSchema = z.object({
|
|
927
997
|
sm: buttonSizeConfigSchema,
|
|
928
998
|
md: buttonSizeConfigSchema,
|
|
929
999
|
lg: buttonSizeConfigSchema,
|
|
@@ -934,9 +1004,9 @@ const buttonSizesSchema = z$1.object({
|
|
|
934
1004
|
lg,
|
|
935
1005
|
xl: xl ?? lg
|
|
936
1006
|
}));
|
|
937
|
-
const buttonGlobalSettingsBaseSchema = z
|
|
1007
|
+
const buttonGlobalSettingsBaseSchema = z.strictObject({
|
|
938
1008
|
cornerStyle: cornerStyleSchema,
|
|
939
|
-
cornerRadius: z
|
|
1009
|
+
cornerRadius: z.number().min(0).max(24).optional(),
|
|
940
1010
|
/**
|
|
941
1011
|
* Family-level shadow inherited by variants that don't set their own.
|
|
942
1012
|
* Optional and flat-by-default: when omitted, buttons carry no drop shadow
|
|
@@ -948,23 +1018,23 @@ const buttonGlobalSettingsBaseSchema = z$1.strictObject({
|
|
|
948
1018
|
textTransform: textTransformSchema,
|
|
949
1019
|
fontWeight: fontWeightSchema,
|
|
950
1020
|
typography: buttonTypographySchema.optional(),
|
|
951
|
-
fontSize: z
|
|
1021
|
+
fontSize: z.string().optional(),
|
|
952
1022
|
letterSpacing: letterSpacingSchema.optional(),
|
|
953
|
-
italic: z
|
|
1023
|
+
italic: z.boolean().optional(),
|
|
954
1024
|
paddingPreset: buttonPaddingPresetSchema.optional(),
|
|
955
1025
|
hoverTransform: hoverTransformSchema,
|
|
956
1026
|
gradientStyle: gradientStyleSchema.optional(),
|
|
957
|
-
gradientAngle: z
|
|
1027
|
+
gradientAngle: z.number().min(0).max(360).optional(),
|
|
958
1028
|
gradientSharpness: gradientSharpnessSchema.optional()
|
|
959
1029
|
});
|
|
960
|
-
const buttonGlobalSettingsSchema = z
|
|
961
|
-
hoverColor: z
|
|
962
|
-
hoverColorToken: z
|
|
1030
|
+
const buttonGlobalSettingsSchema = z.discriminatedUnion("hoverColor", [buttonGlobalSettingsBaseSchema.extend({
|
|
1031
|
+
hoverColor: z.literal("none"),
|
|
1032
|
+
hoverColorToken: z.never().optional()
|
|
963
1033
|
}), buttonGlobalSettingsBaseSchema.extend({
|
|
964
|
-
hoverColor: z
|
|
1034
|
+
hoverColor: z.literal("token"),
|
|
965
1035
|
hoverColorToken: opaqueButtonColourTokenSchema
|
|
966
1036
|
})]);
|
|
967
|
-
const gradientDirectionSchema$1 = z
|
|
1037
|
+
const gradientDirectionSchema$1 = z.enum([
|
|
968
1038
|
"to-r",
|
|
969
1039
|
"to-l",
|
|
970
1040
|
"to-t",
|
|
@@ -974,14 +1044,14 @@ const gradientDirectionSchema$1 = z$1.enum([
|
|
|
974
1044
|
"to-br",
|
|
975
1045
|
"to-bl"
|
|
976
1046
|
]);
|
|
977
|
-
const buttonColourTreatmentSchema = z
|
|
978
|
-
z
|
|
979
|
-
type: z
|
|
1047
|
+
const buttonColourTreatmentSchema = z.discriminatedUnion("type", [
|
|
1048
|
+
z.strictObject({
|
|
1049
|
+
type: z.literal("solid"),
|
|
980
1050
|
colorToken: opaqueButtonColourTokenSchema
|
|
981
1051
|
}),
|
|
982
|
-
z
|
|
983
|
-
type: z
|
|
984
|
-
stops: z
|
|
1052
|
+
z.strictObject({
|
|
1053
|
+
type: z.literal("gradient"),
|
|
1054
|
+
stops: z.array(opaqueButtonColourTokenSchema).min(2).transform((stops) => {
|
|
985
1055
|
const [first, second, ...rest] = stops;
|
|
986
1056
|
if (first === void 0 || second === void 0) throw new Error("Invariant: gradient stops passed the minimum length schema");
|
|
987
1057
|
return [
|
|
@@ -993,34 +1063,34 @@ const buttonColourTreatmentSchema = z$1.discriminatedUnion("type", [
|
|
|
993
1063
|
direction: gradientDirectionSchema$1,
|
|
994
1064
|
foregroundToken: opaqueButtonColourTokenSchema
|
|
995
1065
|
}),
|
|
996
|
-
z
|
|
997
|
-
type: z
|
|
998
|
-
role: z
|
|
1066
|
+
z.strictObject({
|
|
1067
|
+
type: z.literal("surface"),
|
|
1068
|
+
role: z.literal("link")
|
|
999
1069
|
})
|
|
1000
1070
|
]);
|
|
1001
1071
|
const buttonBackgroundSchema = buttonColourTreatmentSchema;
|
|
1002
|
-
const buttonBorderSchema = z
|
|
1003
|
-
const buttonVariantAffordanceSchema = z
|
|
1004
|
-
const variantShadowSchema = z
|
|
1005
|
-
elevation: z
|
|
1072
|
+
const buttonBorderSchema = z.strictObject({ widthClass: z.string() });
|
|
1073
|
+
const buttonVariantAffordanceSchema = z.strictObject({ iconId: z.string().min(1) });
|
|
1074
|
+
const variantShadowSchema = z.strictObject({
|
|
1075
|
+
elevation: z.enum([
|
|
1006
1076
|
"none",
|
|
1007
1077
|
"low",
|
|
1008
1078
|
"medium",
|
|
1009
1079
|
"high"
|
|
1010
1080
|
]),
|
|
1011
|
-
softness: z
|
|
1081
|
+
softness: z.enum([
|
|
1012
1082
|
"crisp",
|
|
1013
1083
|
"soft",
|
|
1014
1084
|
"hard"
|
|
1015
1085
|
]).nullable(),
|
|
1016
|
-
position: z
|
|
1086
|
+
position: z.enum(["bottom", "bottom-right"]).default("bottom"),
|
|
1017
1087
|
colorToken: opaqueButtonColourTokenSchema.optional()
|
|
1018
1088
|
});
|
|
1019
|
-
const variantEffectsSchema = z
|
|
1020
|
-
base: z
|
|
1021
|
-
hover: z
|
|
1022
|
-
active: z
|
|
1023
|
-
focus: z
|
|
1089
|
+
const variantEffectsSchema = z.strictObject({
|
|
1090
|
+
base: z.array(buttonEffectApplicationSchema).optional(),
|
|
1091
|
+
hover: z.array(buttonEffectApplicationSchema).optional(),
|
|
1092
|
+
active: z.array(buttonEffectApplicationSchema).optional(),
|
|
1093
|
+
focus: z.array(buttonEffectApplicationSchema).optional()
|
|
1024
1094
|
});
|
|
1025
1095
|
/**
|
|
1026
1096
|
* Per-variant size overrides schema — every entry is optional.
|
|
@@ -1029,7 +1099,7 @@ const variantEffectsSchema = z$1.strictObject({
|
|
|
1029
1099
|
* for that size on this variant. Missing sizes fall through to theme.sizes,
|
|
1030
1100
|
* then system defaults.
|
|
1031
1101
|
*/
|
|
1032
|
-
const variantSizeOverridesSchema = z
|
|
1102
|
+
const variantSizeOverridesSchema = z.object({
|
|
1033
1103
|
sm: buttonSizeConfigSchema.optional(),
|
|
1034
1104
|
md: buttonSizeConfigSchema.optional(),
|
|
1035
1105
|
lg: buttonSizeConfigSchema.optional(),
|
|
@@ -1041,14 +1111,14 @@ const variantSizeOverridesSchema = z$1.object({
|
|
|
1041
1111
|
* default (e.g. link-style variants declaring zero horizontal padding at
|
|
1042
1112
|
* every size).
|
|
1043
1113
|
*/
|
|
1044
|
-
const buttonVariantSchema = z
|
|
1114
|
+
const buttonVariantSchema = z.strictObject({
|
|
1045
1115
|
id: buttonVariantIdSchema,
|
|
1046
|
-
name: z
|
|
1047
|
-
enabled: z
|
|
1116
|
+
name: z.string().min(1).max(20),
|
|
1117
|
+
enabled: z.boolean(),
|
|
1048
1118
|
priority: prioritySchema,
|
|
1049
1119
|
background: buttonBackgroundSchema,
|
|
1050
1120
|
/** Tailwind radius token (e.g. `'rounded-md'`). Omit to inherit from `global.cornerStyle`. */
|
|
1051
|
-
borderRadius: z
|
|
1121
|
+
borderRadius: z.string().optional(),
|
|
1052
1122
|
shadow: variantShadowSchema.optional(),
|
|
1053
1123
|
border: buttonBorderSchema.optional(),
|
|
1054
1124
|
hoverBackgroundToken: opaqueButtonColourTokenSchema.optional(),
|
|
@@ -1056,10 +1126,11 @@ const buttonVariantSchema = z$1.strictObject({
|
|
|
1056
1126
|
sizes: variantSizeOverridesSchema.optional(),
|
|
1057
1127
|
affordance: buttonVariantAffordanceSchema.optional()
|
|
1058
1128
|
});
|
|
1059
|
-
const buttonSystemSchema = z
|
|
1129
|
+
const buttonSystemSchema = z.strictObject({
|
|
1060
1130
|
global: buttonGlobalSettingsSchema,
|
|
1061
|
-
variants: z
|
|
1062
|
-
sizes: buttonSizesSchema.optional()
|
|
1131
|
+
variants: z.array(buttonVariantSchema).min(1).max(6),
|
|
1132
|
+
sizes: buttonSizesSchema.optional(),
|
|
1133
|
+
surfacePolicy: buttonSurfacePolicySchema.optional()
|
|
1063
1134
|
}).superRefine((system, ctx) => {
|
|
1064
1135
|
const seen = /* @__PURE__ */ new Set();
|
|
1065
1136
|
system.variants.forEach((variant, index) => {
|
|
@@ -1244,7 +1315,7 @@ function getButtonEffectPolicy(effectId) {
|
|
|
1244
1315
|
return Object.prototype.hasOwnProperty.call(BUTTON_EFFECT_POLICIES, effectId) ? BUTTON_EFFECT_POLICIES[effectId] : null;
|
|
1245
1316
|
}
|
|
1246
1317
|
//#endregion
|
|
1247
|
-
//#region ../theme-core/src/buttons/
|
|
1318
|
+
//#region ../theme-core/src/buttons/buttonColourContract.ts
|
|
1248
1319
|
const BUTTON_VISUAL_STATES = [
|
|
1249
1320
|
"base",
|
|
1250
1321
|
"hover",
|
|
@@ -1259,6 +1330,38 @@ const BUTTON_CONTRAST_POLICY = {
|
|
|
1259
1330
|
alphaBackgrounds: "reject-without-known-surface",
|
|
1260
1331
|
disabled: "retain-full-colour-contract"
|
|
1261
1332
|
};
|
|
1333
|
+
function validateButtonSurfaceContrast(input) {
|
|
1334
|
+
const ratio = contrastRatio(input.buttonPaint, input.surfaceHex);
|
|
1335
|
+
return ratio >= BUTTON_CONTRAST_POLICY.nonTextMinimumRatio ? { ok: true } : {
|
|
1336
|
+
ok: false,
|
|
1337
|
+
error: {
|
|
1338
|
+
tag: "insufficient_surface_contrast",
|
|
1339
|
+
variantId: input.variantId,
|
|
1340
|
+
state: input.state,
|
|
1341
|
+
buttonPaint: input.buttonPaint,
|
|
1342
|
+
surface: input.surfaceHex,
|
|
1343
|
+
ratio,
|
|
1344
|
+
requiredRatio: BUTTON_CONTRAST_POLICY.nonTextMinimumRatio
|
|
1345
|
+
}
|
|
1346
|
+
};
|
|
1347
|
+
}
|
|
1348
|
+
function validateButtonTextContrast(input) {
|
|
1349
|
+
const ratio = contrastRatio(input.backgroundHex, input.foregroundHex);
|
|
1350
|
+
return ratio >= BUTTON_CONTRAST_POLICY.textMinimumRatio ? { ok: true } : {
|
|
1351
|
+
ok: false,
|
|
1352
|
+
error: {
|
|
1353
|
+
tag: "insufficient_contrast",
|
|
1354
|
+
variantId: input.variantId,
|
|
1355
|
+
state: input.state,
|
|
1356
|
+
background: input.background,
|
|
1357
|
+
foreground: input.foreground,
|
|
1358
|
+
ratio,
|
|
1359
|
+
requiredRatio: BUTTON_CONTRAST_POLICY.textMinimumRatio
|
|
1360
|
+
}
|
|
1361
|
+
};
|
|
1362
|
+
}
|
|
1363
|
+
//#endregion
|
|
1364
|
+
//#region ../theme-core/src/buttons/resolveButtonColourStates.ts
|
|
1262
1365
|
function compileButtonColourStates(input) {
|
|
1263
1366
|
const baseTransition = applyColourEffects({
|
|
1264
1367
|
variantId: input.variant.id,
|
|
@@ -1298,7 +1401,9 @@ function compileButtonColourStates(input) {
|
|
|
1298
1401
|
variantId: input.variant.id,
|
|
1299
1402
|
state,
|
|
1300
1403
|
treatment: stateTreatments[state],
|
|
1301
|
-
palette: input.palette
|
|
1404
|
+
palette: input.palette,
|
|
1405
|
+
surface: input.surface,
|
|
1406
|
+
hasBoundary: input.variant.border !== void 0
|
|
1302
1407
|
});
|
|
1303
1408
|
if (!result.ok) return result;
|
|
1304
1409
|
resolved[state] = result.colour;
|
|
@@ -1366,22 +1471,42 @@ function applyColourEffects(input) {
|
|
|
1366
1471
|
function resolveTreatment(input) {
|
|
1367
1472
|
const treatment = input.treatment;
|
|
1368
1473
|
switch (treatment.type) {
|
|
1369
|
-
case "surface":
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1474
|
+
case "surface":
|
|
1475
|
+
if (input.surface) {
|
|
1476
|
+
const foreground = validateButtonTextContrast({
|
|
1477
|
+
...input,
|
|
1478
|
+
background: "surface",
|
|
1479
|
+
backgroundHex: input.surface.backgroundHex,
|
|
1480
|
+
foreground: "surface-foreground",
|
|
1481
|
+
foregroundHex: input.surface.foregroundHex
|
|
1482
|
+
});
|
|
1483
|
+
if (!foreground.ok) return foreground;
|
|
1376
1484
|
}
|
|
1377
|
-
|
|
1485
|
+
if (input.surface && input.hasBoundary) {
|
|
1486
|
+
const boundary = validateButtonSurfaceContrast({
|
|
1487
|
+
...input,
|
|
1488
|
+
buttonPaint: input.surface.foregroundHex,
|
|
1489
|
+
surfaceHex: input.surface.backgroundHex
|
|
1490
|
+
});
|
|
1491
|
+
if (!boundary.ok) return boundary;
|
|
1492
|
+
}
|
|
1493
|
+
return {
|
|
1494
|
+
ok: true,
|
|
1495
|
+
colour: {
|
|
1496
|
+
kind: "surface",
|
|
1497
|
+
role: treatment.role,
|
|
1498
|
+
backgroundCss: "transparent",
|
|
1499
|
+
foregroundCss: input.surface?.foregroundCss ?? surfaceForegroundValue(treatment.role)
|
|
1500
|
+
}
|
|
1501
|
+
};
|
|
1378
1502
|
case "solid": return resolveSolid(input, treatment.colorToken);
|
|
1379
1503
|
case "gradient": return resolveGradient(input, treatment);
|
|
1380
1504
|
}
|
|
1381
1505
|
}
|
|
1382
1506
|
function resolveFocusIndicator(colour) {
|
|
1383
1507
|
switch (colour.kind) {
|
|
1384
|
-
case "solid":
|
|
1508
|
+
case "solid":
|
|
1509
|
+
case "known-solid": return {
|
|
1385
1510
|
kind: "two-tone",
|
|
1386
1511
|
innerCss: colour.foregroundCss,
|
|
1387
1512
|
outerCss: colour.backgroundCss,
|
|
@@ -1415,7 +1540,7 @@ function resolveSolid(input, backgroundToken) {
|
|
|
1415
1540
|
foregroundToken
|
|
1416
1541
|
}
|
|
1417
1542
|
};
|
|
1418
|
-
const contrast =
|
|
1543
|
+
const contrast = validateButtonTextContrast({
|
|
1419
1544
|
...input,
|
|
1420
1545
|
background: backgroundToken,
|
|
1421
1546
|
backgroundHex: backgroundHex.hex,
|
|
@@ -1423,6 +1548,14 @@ function resolveSolid(input, backgroundToken) {
|
|
|
1423
1548
|
foregroundHex
|
|
1424
1549
|
});
|
|
1425
1550
|
if (!contrast.ok) return contrast;
|
|
1551
|
+
if (input.surface) {
|
|
1552
|
+
const boundary = validateButtonSurfaceContrast({
|
|
1553
|
+
...input,
|
|
1554
|
+
buttonPaint: backgroundHex.hex,
|
|
1555
|
+
surfaceHex: input.surface.backgroundHex
|
|
1556
|
+
});
|
|
1557
|
+
if (!boundary.ok) return boundary;
|
|
1558
|
+
}
|
|
1426
1559
|
return {
|
|
1427
1560
|
ok: true,
|
|
1428
1561
|
colour: {
|
|
@@ -1452,7 +1585,7 @@ function resolveGradient(input, treatment) {
|
|
|
1452
1585
|
for (let sample = 0; sample <= BUTTON_CONTRAST_POLICY.gradientSamplesPerSegment; sample += 1) {
|
|
1453
1586
|
const position = sample / BUTTON_CONTRAST_POLICY.gradientSamplesPerSegment;
|
|
1454
1587
|
const sampleHex = interpolateHex(start, end, position);
|
|
1455
|
-
const contrast =
|
|
1588
|
+
const contrast = validateButtonTextContrast({
|
|
1456
1589
|
...input,
|
|
1457
1590
|
background: `${startToken}→${endToken}@${position.toFixed(2)}`,
|
|
1458
1591
|
backgroundHex: sampleHex,
|
|
@@ -1460,6 +1593,14 @@ function resolveGradient(input, treatment) {
|
|
|
1460
1593
|
foregroundHex: foregroundHex.hex
|
|
1461
1594
|
});
|
|
1462
1595
|
if (!contrast.ok) return contrast;
|
|
1596
|
+
if (input.surface) {
|
|
1597
|
+
const boundary = validateButtonSurfaceContrast({
|
|
1598
|
+
...input,
|
|
1599
|
+
buttonPaint: sampleHex,
|
|
1600
|
+
surfaceHex: input.surface.backgroundHex
|
|
1601
|
+
});
|
|
1602
|
+
if (!boundary.ok) return boundary;
|
|
1603
|
+
}
|
|
1463
1604
|
}
|
|
1464
1605
|
}
|
|
1465
1606
|
const direction = GRADIENT_DIRECTION_MAP[treatment.direction] ?? "to right";
|
|
@@ -1489,21 +1630,6 @@ function paletteHex(input, token) {
|
|
|
1489
1630
|
}
|
|
1490
1631
|
};
|
|
1491
1632
|
}
|
|
1492
|
-
function validateContrast(input) {
|
|
1493
|
-
const ratio = contrastRatio(input.backgroundHex, input.foregroundHex);
|
|
1494
|
-
return ratio >= BUTTON_CONTRAST_POLICY.textMinimumRatio ? { ok: true } : {
|
|
1495
|
-
ok: false,
|
|
1496
|
-
error: {
|
|
1497
|
-
tag: "insufficient_contrast",
|
|
1498
|
-
variantId: input.variantId,
|
|
1499
|
-
state: input.state,
|
|
1500
|
-
background: input.background,
|
|
1501
|
-
foreground: input.foreground,
|
|
1502
|
-
ratio,
|
|
1503
|
-
requiredRatio: BUTTON_CONTRAST_POLICY.textMinimumRatio
|
|
1504
|
-
}
|
|
1505
|
-
};
|
|
1506
|
-
}
|
|
1507
1633
|
function tokenCss(token) {
|
|
1508
1634
|
return `rgb(var(--tb-${token}))`;
|
|
1509
1635
|
}
|
|
@@ -1610,7 +1736,14 @@ function parseThemeForPersistence(value) {
|
|
|
1610
1736
|
issues: parsed.error.issues
|
|
1611
1737
|
}
|
|
1612
1738
|
};
|
|
1613
|
-
const
|
|
1739
|
+
const parsedTheme = parsed.data;
|
|
1740
|
+
const theme = parsedTheme.buttons && !parsedTheme.buttons.surfacePolicy ? {
|
|
1741
|
+
...parsedTheme,
|
|
1742
|
+
buttons: {
|
|
1743
|
+
...parsedTheme.buttons,
|
|
1744
|
+
surfacePolicy: createStandardButtonSurfacePolicy()
|
|
1745
|
+
}
|
|
1746
|
+
} : parsedTheme;
|
|
1614
1747
|
if (!theme.buttons) return {
|
|
1615
1748
|
ok: true,
|
|
1616
1749
|
value: theme
|
|
@@ -1689,6 +1822,14 @@ function shadeBackgroundEffect(config) {
|
|
|
1689
1822
|
}
|
|
1690
1823
|
};
|
|
1691
1824
|
}
|
|
1825
|
+
//#endregion
|
|
1826
|
+
//#region ../theme-core/src/utils/tokenOrColor.ts
|
|
1827
|
+
/**
|
|
1828
|
+
* Runtime color-reference fields intentionally accept any string, including
|
|
1829
|
+
* the legacy empty-string "no color" sentinel. Semantic validation needs
|
|
1830
|
+
* palette context and happens in `parseThemeColorReference`.
|
|
1831
|
+
*/
|
|
1832
|
+
const tokenOrCssColorValueSchema = z.string();
|
|
1692
1833
|
buttonSizeNameSchema.options;
|
|
1693
1834
|
//#endregion
|
|
1694
1835
|
//#region ../theme-core/src/buttons/styles/domain.ts
|
|
@@ -1732,6 +1873,7 @@ function resolveButtonStyleRecipe(recipe, parameters) {
|
|
|
1732
1873
|
const buttonSystem = {
|
|
1733
1874
|
global: definition.global,
|
|
1734
1875
|
variants: PUBLIC_BUTTON_ROLES.map((role) => roles[role]),
|
|
1876
|
+
surfacePolicy: definition.surfacePolicy ?? createStandardButtonSurfacePolicy(),
|
|
1735
1877
|
...definition.sizes ? { sizes: definition.sizes } : {}
|
|
1736
1878
|
};
|
|
1737
1879
|
const parsedButtonSystem = buttonSystemSchema.safeParse(buttonSystem);
|
|
@@ -1792,15 +1934,15 @@ const BUTTON_STYLE_IDS = [
|
|
|
1792
1934
|
"ornate-ritual",
|
|
1793
1935
|
"quiet-arrow"
|
|
1794
1936
|
];
|
|
1795
|
-
const quietArrowParametersSchema = z
|
|
1796
|
-
const emptyParametersSchema$1 = z
|
|
1937
|
+
const quietArrowParametersSchema = z.object({ secondaryTreatment: z.enum(["outlined", "solid-accent"]) }).strict();
|
|
1938
|
+
const emptyParametersSchema$1 = z.object({}).strict();
|
|
1797
1939
|
function selectionBranch(styleId, parameters) {
|
|
1798
|
-
return z
|
|
1799
|
-
styleId: z
|
|
1940
|
+
return z.object({
|
|
1941
|
+
styleId: z.literal(styleId),
|
|
1800
1942
|
parameters
|
|
1801
1943
|
}).strict();
|
|
1802
1944
|
}
|
|
1803
|
-
z
|
|
1945
|
+
z.discriminatedUnion("styleId", [
|
|
1804
1946
|
selectionBranch("soft-pill", emptyParametersSchema$1),
|
|
1805
1947
|
selectionBranch("earth-pill", emptyParametersSchema$1),
|
|
1806
1948
|
selectionBranch("confident-chip", emptyParametersSchema$1),
|
|
@@ -1945,7 +2087,7 @@ const quietArrowRecipe = defineButtonStyleRecipe({
|
|
|
1945
2087
|
});
|
|
1946
2088
|
//#endregion
|
|
1947
2089
|
//#region ../theme-core/src/buttons/styles/recipes/defineStaticButtonStyleRecipe.ts
|
|
1948
|
-
const emptyParametersSchema = z
|
|
2090
|
+
const emptyParametersSchema = z.object({}).strict();
|
|
1949
2091
|
function defineStaticButtonStyleRecipe(input) {
|
|
1950
2092
|
const system = normalizeSystem(input.system);
|
|
1951
2093
|
return defineButtonStyleRecipe({
|
|
@@ -3311,7 +3453,27 @@ function presetCategory(recipe) {
|
|
|
3311
3453
|
//#region ../theme-core/src/cards/types.ts
|
|
3312
3454
|
const cardVariantRoleValues = ["default", "alternative"];
|
|
3313
3455
|
const boxlessCardVariantValue = "none";
|
|
3314
|
-
const
|
|
3456
|
+
const openCardRoleValue = "open";
|
|
3457
|
+
/**
|
|
3458
|
+
* The roles a site style implements with an actual card variant. `none` is
|
|
3459
|
+
* deliberately absent: it is a role value only, never a variant.
|
|
3460
|
+
*/
|
|
3461
|
+
const surfaceCardRoleValues = [...cardVariantRoleValues, openCardRoleValue];
|
|
3462
|
+
/**
|
|
3463
|
+
* The closed card-role vocabulary Looks and blocks address cards by — this is
|
|
3464
|
+
* `BoxStylesCardVariant` widened with `open`, not a parallel enum.
|
|
3465
|
+
*
|
|
3466
|
+
* - `none` — no site-style card surface; the block's own composition and
|
|
3467
|
+
* the author's own card fields govern the item. This is *not*
|
|
3468
|
+
* a promise of visible boxlessness: a block whose base class
|
|
3469
|
+
* draws a border still draws one. It says the Look is not
|
|
3470
|
+
* asking the site style for a card.
|
|
3471
|
+
* - `open` — boxless but marked (a rule or accent edge, no enclosing box)
|
|
3472
|
+
* - `default` — the site's quiet everyday card
|
|
3473
|
+
* - `alternative` — the statement card carrying the site's personality
|
|
3474
|
+
*/
|
|
3475
|
+
const cardRoleValues = [...surfaceCardRoleValues, boxlessCardVariantValue];
|
|
3476
|
+
const cardSpacingSchema = z.enum([
|
|
3315
3477
|
"none",
|
|
3316
3478
|
"compact",
|
|
3317
3479
|
"cozy",
|
|
@@ -3319,7 +3481,18 @@ const cardSpacingSchema = z$1.enum([
|
|
|
3319
3481
|
"comfortable",
|
|
3320
3482
|
"spacious"
|
|
3321
3483
|
]);
|
|
3322
|
-
|
|
3484
|
+
/** Per-axis padding, for boxless cards whose inline padding differs from block. */
|
|
3485
|
+
const cardSpacingAxesSchema = z.object({
|
|
3486
|
+
block: cardSpacingSchema,
|
|
3487
|
+
inline: cardSpacingSchema
|
|
3488
|
+
});
|
|
3489
|
+
/**
|
|
3490
|
+
* A card's content padding: one value for both axes, or one per axis. Two
|
|
3491
|
+
* fields would let a variant say both and leave the reader to guess, so this is
|
|
3492
|
+
* a union — the legacy `spacingAxes` key is lifted into it on parse.
|
|
3493
|
+
*/
|
|
3494
|
+
const cardSpacingValueSchema = z.union([cardSpacingSchema, cardSpacingAxesSchema]);
|
|
3495
|
+
const gradientDirectionSchema = z.enum([
|
|
3323
3496
|
"to-r",
|
|
3324
3497
|
"to-l",
|
|
3325
3498
|
"to-t",
|
|
@@ -3329,85 +3502,138 @@ const gradientDirectionSchema = z$1.enum([
|
|
|
3329
3502
|
"to-br",
|
|
3330
3503
|
"to-bl"
|
|
3331
3504
|
]);
|
|
3332
|
-
z
|
|
3333
|
-
const
|
|
3334
|
-
const
|
|
3335
|
-
|
|
3336
|
-
|
|
3505
|
+
z.enum(cardVariantRoleValues);
|
|
3506
|
+
const surfaceCardRoleSchema = z.enum(surfaceCardRoleValues);
|
|
3507
|
+
const cardRoleSchema = z.enum(cardRoleValues);
|
|
3508
|
+
/**
|
|
3509
|
+
* Historical name for the role vocabulary as it reaches box styles. Widened to
|
|
3510
|
+
* the full `CardRole` set — old values keep parsing, `open` now parses too.
|
|
3511
|
+
*/
|
|
3512
|
+
const boxStylesCardVariantSchema = cardRoleSchema;
|
|
3513
|
+
const PRIORITY_ROLE_INFERENCE = {
|
|
3514
|
+
1: "default",
|
|
3515
|
+
2: "alternative"
|
|
3516
|
+
};
|
|
3517
|
+
/**
|
|
3518
|
+
* Role inference for legacy card systems authored before variants carried a
|
|
3519
|
+
* `role`. Priority 1 is the everyday card, priority 2 the statement card —
|
|
3520
|
+
* which is how variants are surfaced today. `open` is never inferred: a site
|
|
3521
|
+
* style has to opt into it.
|
|
3522
|
+
*/
|
|
3523
|
+
function inferCardVariantRoleFromPriority(priority) {
|
|
3524
|
+
return PRIORITY_ROLE_INFERENCE[priority] ?? null;
|
|
3525
|
+
}
|
|
3526
|
+
const cardBackgroundSchema = z.discriminatedUnion("type", [
|
|
3527
|
+
z.object({
|
|
3528
|
+
type: z.literal("solid"),
|
|
3337
3529
|
colorToken: themeColorTokenSchema
|
|
3338
3530
|
}),
|
|
3339
|
-
z
|
|
3340
|
-
type: z
|
|
3531
|
+
z.object({
|
|
3532
|
+
type: z.literal("gradient"),
|
|
3341
3533
|
fromToken: themeColorTokenSchema,
|
|
3342
3534
|
toToken: themeColorTokenSchema,
|
|
3343
3535
|
direction: gradientDirectionSchema
|
|
3344
3536
|
}),
|
|
3345
|
-
z
|
|
3537
|
+
z.object({ type: z.literal("transparent") })
|
|
3346
3538
|
]);
|
|
3347
|
-
const cardBorderSchema = z
|
|
3348
|
-
widthClass: z
|
|
3539
|
+
const cardBorderSchema = z.object({
|
|
3540
|
+
widthClass: z.string(),
|
|
3349
3541
|
colorToken: themeColorTokenSchema
|
|
3350
3542
|
});
|
|
3351
3543
|
/** Per-corner radius value. `expressive` is a large block-radius multiple. */
|
|
3352
|
-
const cardCornerValueSchema = z
|
|
3544
|
+
const cardCornerValueSchema = z.enum([
|
|
3353
3545
|
"square",
|
|
3354
3546
|
"soft",
|
|
3355
3547
|
"rounded",
|
|
3356
3548
|
"pill",
|
|
3357
3549
|
"expressive"
|
|
3358
3550
|
]);
|
|
3551
|
+
const cardEdgeSchema = z.enum([
|
|
3552
|
+
"left",
|
|
3553
|
+
"top",
|
|
3554
|
+
"right",
|
|
3555
|
+
"bottom"
|
|
3556
|
+
]);
|
|
3359
3557
|
/**
|
|
3360
|
-
*
|
|
3361
|
-
*
|
|
3558
|
+
* Legacy single accented card edge (e.g. a left accent bar). Persisted and
|
|
3559
|
+
* curated data may still carry it; it lifts into a one-element `decorations`
|
|
3560
|
+
* list at the parse boundary and has no representation after that.
|
|
3362
3561
|
*/
|
|
3363
|
-
const cardAccentEdgeSchema = z
|
|
3364
|
-
edge:
|
|
3365
|
-
"left",
|
|
3366
|
-
"top",
|
|
3367
|
-
"right",
|
|
3368
|
-
"bottom"
|
|
3369
|
-
]),
|
|
3562
|
+
const cardAccentEdgeSchema = z.object({
|
|
3563
|
+
edge: cardEdgeSchema,
|
|
3370
3564
|
colorToken: themeColorTokenSchema,
|
|
3371
|
-
width: z
|
|
3565
|
+
width: z.enum([
|
|
3372
3566
|
"thin",
|
|
3373
3567
|
"medium",
|
|
3374
3568
|
"thick",
|
|
3375
3569
|
"heavy"
|
|
3376
3570
|
])
|
|
3377
3571
|
});
|
|
3378
|
-
|
|
3572
|
+
/** `hairline` (1px) is the widening the boxless `open` role needs. */
|
|
3573
|
+
const cardEdgeRuleWidthSchema = z.enum([
|
|
3574
|
+
"hairline",
|
|
3575
|
+
"thin",
|
|
3576
|
+
"medium",
|
|
3577
|
+
"thick",
|
|
3578
|
+
"heavy"
|
|
3579
|
+
]);
|
|
3580
|
+
const cardEdgeRuleLengthSchema = z.enum(["full", "short"]);
|
|
3581
|
+
const cardEdgeRuleAlignSchema = z.enum([
|
|
3582
|
+
"start",
|
|
3583
|
+
"center",
|
|
3584
|
+
"end"
|
|
3585
|
+
]);
|
|
3586
|
+
/**
|
|
3587
|
+
* Decorations are edge rules today. The alias exists so the list can grow into
|
|
3588
|
+
* a discriminated union without every call site changing.
|
|
3589
|
+
*/
|
|
3590
|
+
const cardDecorationSchema = z.object({
|
|
3591
|
+
edge: cardEdgeSchema,
|
|
3592
|
+
colorToken: themeColorTokenSchema,
|
|
3593
|
+
width: cardEdgeRuleWidthSchema,
|
|
3594
|
+
/** Defaults to `full`. */
|
|
3595
|
+
length: cardEdgeRuleLengthSchema.optional(),
|
|
3596
|
+
/** Where a `short` rule sits along its edge. Defaults to `start`. */
|
|
3597
|
+
align: cardEdgeRuleAlignSchema.optional(),
|
|
3598
|
+
/** Opacity applied to `colorToken`, 0–1. Scoped here, not on the token. */
|
|
3599
|
+
alpha: z.number().min(0).max(1).optional()
|
|
3600
|
+
});
|
|
3601
|
+
const cardDecorationsSchema = z.array(cardDecorationSchema).max(2);
|
|
3602
|
+
const cardCornerRadiiSchema = z.object({
|
|
3379
3603
|
topLeft: cardCornerValueSchema.optional(),
|
|
3380
3604
|
topRight: cardCornerValueSchema.optional(),
|
|
3381
3605
|
bottomLeft: cardCornerValueSchema.optional(),
|
|
3382
3606
|
bottomRight: cardCornerValueSchema.optional()
|
|
3383
3607
|
});
|
|
3384
|
-
const
|
|
3385
|
-
id: z
|
|
3386
|
-
name: z
|
|
3387
|
-
enabled: z
|
|
3388
|
-
priority: z
|
|
3389
|
-
z
|
|
3390
|
-
z
|
|
3391
|
-
z
|
|
3608
|
+
const cardVariantInputSchema = z.object({
|
|
3609
|
+
id: z.string(),
|
|
3610
|
+
name: z.string().min(1).max(20),
|
|
3611
|
+
enabled: z.boolean(),
|
|
3612
|
+
priority: z.union([
|
|
3613
|
+
z.literal(1),
|
|
3614
|
+
z.literal(2),
|
|
3615
|
+
z.literal(3)
|
|
3392
3616
|
]),
|
|
3617
|
+
role: surfaceCardRoleSchema.optional(),
|
|
3393
3618
|
background: cardBackgroundSchema,
|
|
3394
|
-
spacing:
|
|
3619
|
+
spacing: cardSpacingValueSchema,
|
|
3620
|
+
spacingAxes: cardSpacingAxesSchema.optional(),
|
|
3395
3621
|
foregroundToken: themeColorTokenSchema.optional(),
|
|
3396
|
-
shadow: z
|
|
3397
|
-
elevation: z
|
|
3622
|
+
shadow: z.object({
|
|
3623
|
+
elevation: z.enum([
|
|
3398
3624
|
"none",
|
|
3399
3625
|
"low",
|
|
3400
3626
|
"medium",
|
|
3401
3627
|
"high"
|
|
3402
3628
|
]),
|
|
3403
|
-
softness: z
|
|
3629
|
+
softness: z.enum([
|
|
3404
3630
|
"crisp",
|
|
3405
3631
|
"soft",
|
|
3406
3632
|
"hard"
|
|
3407
3633
|
]).nullable(),
|
|
3408
|
-
position: z
|
|
3634
|
+
position: z.enum(["bottom", "bottom-right"]).default("bottom")
|
|
3409
3635
|
}).optional(),
|
|
3410
|
-
corners: z
|
|
3636
|
+
corners: z.enum([
|
|
3411
3637
|
"square",
|
|
3412
3638
|
"soft",
|
|
3413
3639
|
"rounded",
|
|
@@ -3415,15 +3641,97 @@ const cardVariantSchema = z$1.object({
|
|
|
3415
3641
|
]).optional(),
|
|
3416
3642
|
cornerRadii: cardCornerRadiiSchema.optional(),
|
|
3417
3643
|
border: cardBorderSchema.optional(),
|
|
3644
|
+
decorations: cardDecorationsSchema.optional(),
|
|
3418
3645
|
accentEdge: cardAccentEdgeSchema.optional()
|
|
3419
3646
|
});
|
|
3420
|
-
|
|
3647
|
+
/**
|
|
3648
|
+
* Lift a legacy `accentEdge` into the decoration list. The old emitter reset
|
|
3649
|
+
* `border: 0` implicitly whenever an accent edge was present; conversion drops
|
|
3650
|
+
* the border instead, so the output is unchanged and the data says so.
|
|
3651
|
+
*/
|
|
3652
|
+
function normalizeLegacyAccentEdge(variant) {
|
|
3653
|
+
const { accentEdge, ...rest } = normalizeLegacySpacingAxes(variant);
|
|
3654
|
+
if (!accentEdge) return rest;
|
|
3655
|
+
const { border: _droppedByAccentEdgeReset, ...withoutBorder } = rest;
|
|
3656
|
+
return {
|
|
3657
|
+
...withoutBorder,
|
|
3658
|
+
decorations: [{
|
|
3659
|
+
...accentEdge,
|
|
3660
|
+
length: "full"
|
|
3661
|
+
}]
|
|
3662
|
+
};
|
|
3663
|
+
}
|
|
3664
|
+
/**
|
|
3665
|
+
* Lift a legacy `spacingAxes` into `spacing`. It always won over the flat value
|
|
3666
|
+
* when both were set, so the lift preserves the emitted padding exactly.
|
|
3667
|
+
*/
|
|
3668
|
+
function normalizeLegacySpacingAxes(variant) {
|
|
3669
|
+
const { spacingAxes, ...rest } = variant;
|
|
3670
|
+
return spacingAxes ? {
|
|
3671
|
+
...rest,
|
|
3672
|
+
spacing: spacingAxes
|
|
3673
|
+
} : variant;
|
|
3674
|
+
}
|
|
3675
|
+
function validateSingleDecorationSource(variant, ctx) {
|
|
3676
|
+
if (!variant.accentEdge || !variant.decorations) return;
|
|
3677
|
+
ctx.addIssue({
|
|
3678
|
+
code: "custom",
|
|
3679
|
+
path: ["decorations"],
|
|
3680
|
+
message: "A card variant carries either the legacy `accentEdge` or `decorations`, never both."
|
|
3681
|
+
});
|
|
3682
|
+
}
|
|
3683
|
+
const cardVariantSchema = cardVariantInputSchema.superRefine(validateSingleDecorationSource).transform(normalizeLegacyAccentEdge);
|
|
3684
|
+
/**
|
|
3685
|
+
* Fill in roles for legacy systems whose variants declare none. Inference is
|
|
3686
|
+
* collision-tolerant on purpose: first claimant wins and a later variant that
|
|
3687
|
+
* would infer a taken role simply gets no role. Legacy data is not obliged to
|
|
3688
|
+
* be well-formed, and a card system that fails to parse takes the whole theme
|
|
3689
|
+
* down with it.
|
|
3690
|
+
*/
|
|
3691
|
+
function withInferredRoles(variants) {
|
|
3692
|
+
const claimed = new Set(variants.flatMap((variant) => variant.role ? [variant.role] : []));
|
|
3693
|
+
return variants.map((variant) => {
|
|
3694
|
+
if (variant.role) return variant;
|
|
3695
|
+
const inferred = inferCardVariantRoleFromPriority(variant.priority);
|
|
3696
|
+
if (!inferred || claimed.has(inferred)) return variant;
|
|
3697
|
+
claimed.add(inferred);
|
|
3698
|
+
return {
|
|
3699
|
+
...variant,
|
|
3700
|
+
role: inferred
|
|
3701
|
+
};
|
|
3702
|
+
});
|
|
3703
|
+
}
|
|
3704
|
+
/**
|
|
3705
|
+
* Only *declared* roles are validated — a site style saying "these two
|
|
3706
|
+
* variants are both the default card" is an authoring error worth rejecting.
|
|
3707
|
+
*/
|
|
3708
|
+
function validateUniqueDeclaredCardVariantRoles(system, ctx) {
|
|
3709
|
+
const declared = /* @__PURE__ */ new Set();
|
|
3710
|
+
system.variants.forEach((variant, index) => {
|
|
3711
|
+
const role = variant.role;
|
|
3712
|
+
if (!role) return;
|
|
3713
|
+
if (declared.has(role)) {
|
|
3714
|
+
ctx.addIssue({
|
|
3715
|
+
code: "custom",
|
|
3716
|
+
path: [
|
|
3717
|
+
"variants",
|
|
3718
|
+
index,
|
|
3719
|
+
"role"
|
|
3720
|
+
],
|
|
3721
|
+
message: `Card role "${role}" is already implemented by another variant.`
|
|
3722
|
+
});
|
|
3723
|
+
return;
|
|
3724
|
+
}
|
|
3725
|
+
declared.add(role);
|
|
3726
|
+
});
|
|
3727
|
+
}
|
|
3728
|
+
const cardSystemSchema = z.object({ variants: z.array(cardVariantSchema).min(1).max(3) }).superRefine(validateUniqueDeclaredCardVariantRoles).transform((system) => ({ variants: withInferredRoles(system.variants) }));
|
|
3421
3729
|
//#endregion
|
|
3422
3730
|
//#region ../theme-core/src/accordions/types.ts
|
|
3423
3731
|
/**
|
|
3424
3732
|
* Accordion icon styles for expand/collapse indicators
|
|
3425
3733
|
*/
|
|
3426
|
-
const accordionIconSchema = z
|
|
3734
|
+
const accordionIconSchema = z.enum([
|
|
3427
3735
|
"plus-minus",
|
|
3428
3736
|
"chevron",
|
|
3429
3737
|
"caret",
|
|
@@ -3434,12 +3742,12 @@ const accordionIconSchema = z$1.enum([
|
|
|
3434
3742
|
* Accordion configuration for a theme
|
|
3435
3743
|
* Single style per theme (no variants needed)
|
|
3436
3744
|
*/
|
|
3437
|
-
const accordionSystemSchema = z
|
|
3438
|
-
background: z
|
|
3439
|
-
type: z
|
|
3745
|
+
const accordionSystemSchema = z.object({
|
|
3746
|
+
background: z.object({
|
|
3747
|
+
type: z.literal("solid"),
|
|
3440
3748
|
colorToken: themeColorTokenSchema
|
|
3441
3749
|
}).nullable(),
|
|
3442
|
-
spacing: z
|
|
3750
|
+
spacing: z.enum([
|
|
3443
3751
|
"none",
|
|
3444
3752
|
"compact",
|
|
3445
3753
|
"cozy",
|
|
@@ -3447,84 +3755,84 @@ const accordionSystemSchema = z$1.object({
|
|
|
3447
3755
|
"comfortable",
|
|
3448
3756
|
"spacious"
|
|
3449
3757
|
]),
|
|
3450
|
-
corners: z
|
|
3758
|
+
corners: z.enum([
|
|
3451
3759
|
"square",
|
|
3452
3760
|
"soft",
|
|
3453
3761
|
"rounded",
|
|
3454
3762
|
"pill"
|
|
3455
3763
|
]).nullable(),
|
|
3456
|
-
border: z
|
|
3457
|
-
widthClass: z
|
|
3764
|
+
border: z.object({
|
|
3765
|
+
widthClass: z.string(),
|
|
3458
3766
|
colorToken: themeColorTokenSchema
|
|
3459
3767
|
}).nullable(),
|
|
3460
|
-
shadow: z
|
|
3461
|
-
elevation: z
|
|
3768
|
+
shadow: z.object({
|
|
3769
|
+
elevation: z.enum([
|
|
3462
3770
|
"none",
|
|
3463
3771
|
"low",
|
|
3464
3772
|
"medium",
|
|
3465
3773
|
"high"
|
|
3466
3774
|
]),
|
|
3467
|
-
softness: z
|
|
3775
|
+
softness: z.enum([
|
|
3468
3776
|
"soft",
|
|
3469
3777
|
"crisp",
|
|
3470
3778
|
"hard"
|
|
3471
3779
|
]).nullable(),
|
|
3472
|
-
position: z
|
|
3780
|
+
position: z.enum(["bottom", "bottom-right"])
|
|
3473
3781
|
}).nullable(),
|
|
3474
|
-
icon: z
|
|
3782
|
+
icon: z.object({
|
|
3475
3783
|
style: accordionIconSchema,
|
|
3476
|
-
position: z
|
|
3477
|
-
size: z
|
|
3784
|
+
position: z.enum(["left", "right"]),
|
|
3785
|
+
size: z.enum([
|
|
3478
3786
|
"sm",
|
|
3479
3787
|
"md",
|
|
3480
3788
|
"lg"
|
|
3481
3789
|
]),
|
|
3482
3790
|
colorToken: themeColorTokenSchema.optional()
|
|
3483
3791
|
}),
|
|
3484
|
-
trigger: z
|
|
3792
|
+
trigger: z.object({
|
|
3485
3793
|
textColorToken: themeColorTokenSchema,
|
|
3486
|
-
fontWeight: z
|
|
3794
|
+
fontWeight: z.enum([
|
|
3487
3795
|
"regular",
|
|
3488
3796
|
"medium",
|
|
3489
3797
|
"semibold",
|
|
3490
3798
|
"bold"
|
|
3491
3799
|
]).nullable(),
|
|
3492
|
-
fontFamily: z
|
|
3493
|
-
fontScale: z
|
|
3800
|
+
fontFamily: z.enum(["body", "heading"]).optional(),
|
|
3801
|
+
fontScale: z.enum([
|
|
3494
3802
|
"body",
|
|
3495
3803
|
"md",
|
|
3496
3804
|
"lg"
|
|
3497
3805
|
]).optional(),
|
|
3498
|
-
letterSpacing: z
|
|
3806
|
+
letterSpacing: z.enum([
|
|
3499
3807
|
"normal",
|
|
3500
3808
|
"tight",
|
|
3501
3809
|
"wide"
|
|
3502
3810
|
]).optional(),
|
|
3503
|
-
textTransform: z
|
|
3811
|
+
textTransform: z.enum(["none", "uppercase"]).optional()
|
|
3504
3812
|
}),
|
|
3505
|
-
hover: z
|
|
3813
|
+
hover: z.object({
|
|
3506
3814
|
backgroundColorToken: themeColorTokenSchema.optional(),
|
|
3507
3815
|
textColorToken: themeColorTokenSchema.optional(),
|
|
3508
3816
|
borderColorToken: themeColorTokenSchema.optional()
|
|
3509
3817
|
}),
|
|
3510
|
-
openState: z
|
|
3818
|
+
openState: z.object({
|
|
3511
3819
|
backgroundColorToken: themeColorTokenSchema.optional(),
|
|
3512
3820
|
triggerColorToken: themeColorTokenSchema.optional(),
|
|
3513
|
-
accent: z
|
|
3514
|
-
edge: z
|
|
3821
|
+
accent: z.object({
|
|
3822
|
+
edge: z.enum([
|
|
3515
3823
|
"left",
|
|
3516
3824
|
"top",
|
|
3517
3825
|
"bottom"
|
|
3518
3826
|
]),
|
|
3519
3827
|
colorToken: themeColorTokenSchema,
|
|
3520
|
-
thickness: z
|
|
3828
|
+
thickness: z.enum([
|
|
3521
3829
|
"thin",
|
|
3522
3830
|
"medium",
|
|
3523
3831
|
"thick"
|
|
3524
3832
|
])
|
|
3525
3833
|
}).optional()
|
|
3526
3834
|
}).optional(),
|
|
3527
|
-
content: z
|
|
3835
|
+
content: z.object({ textColorToken: themeColorTokenSchema })
|
|
3528
3836
|
});
|
|
3529
3837
|
//#endregion
|
|
3530
3838
|
//#region ../theme-core/src/inputs/types.ts
|
|
@@ -3538,80 +3846,80 @@ const accordionSystemSchema = z$1.object({
|
|
|
3538
3846
|
*
|
|
3539
3847
|
* Single configuration per theme (no variants needed for inputs)
|
|
3540
3848
|
*/
|
|
3541
|
-
const inputSystemSchema = z
|
|
3542
|
-
base: z
|
|
3543
|
-
background: z
|
|
3544
|
-
type: z
|
|
3849
|
+
const inputSystemSchema = z.object({
|
|
3850
|
+
base: z.object({
|
|
3851
|
+
background: z.union([z.object({
|
|
3852
|
+
type: z.literal("solid"),
|
|
3545
3853
|
colorToken: themeColorTokenSchema
|
|
3546
|
-
}), z
|
|
3854
|
+
}), z.object({ type: z.literal("transparent") })]),
|
|
3547
3855
|
textColorToken: themeColorTokenSchema,
|
|
3548
|
-
border: z
|
|
3549
|
-
widthClass: z
|
|
3856
|
+
border: z.object({
|
|
3857
|
+
widthClass: z.string(),
|
|
3550
3858
|
colorToken: themeColorTokenSchema,
|
|
3551
|
-
style: z
|
|
3859
|
+
style: z.enum(["all", "underline"]).optional()
|
|
3552
3860
|
}),
|
|
3553
|
-
corners: z
|
|
3861
|
+
corners: z.enum([
|
|
3554
3862
|
"square",
|
|
3555
3863
|
"soft",
|
|
3556
3864
|
"rounded",
|
|
3557
3865
|
"pill"
|
|
3558
3866
|
]).nullable(),
|
|
3559
|
-
shadow: z
|
|
3560
|
-
elevation: z
|
|
3867
|
+
shadow: z.object({
|
|
3868
|
+
elevation: z.enum([
|
|
3561
3869
|
"none",
|
|
3562
3870
|
"low",
|
|
3563
3871
|
"medium"
|
|
3564
3872
|
]),
|
|
3565
|
-
softness: z
|
|
3873
|
+
softness: z.enum([
|
|
3566
3874
|
"soft",
|
|
3567
3875
|
"crisp",
|
|
3568
3876
|
"hard"
|
|
3569
3877
|
]).nullable()
|
|
3570
3878
|
}).nullable(),
|
|
3571
|
-
spacing: z
|
|
3879
|
+
spacing: z.enum([
|
|
3572
3880
|
"compact",
|
|
3573
3881
|
"cozy",
|
|
3574
3882
|
"medium",
|
|
3575
3883
|
"comfortable"
|
|
3576
3884
|
]),
|
|
3577
|
-
fontSize: z
|
|
3885
|
+
fontSize: z.enum([
|
|
3578
3886
|
"sm",
|
|
3579
3887
|
"base",
|
|
3580
3888
|
"lg"
|
|
3581
3889
|
])
|
|
3582
3890
|
}),
|
|
3583
|
-
label: z
|
|
3891
|
+
label: z.object({
|
|
3584
3892
|
textColorToken: themeColorTokenSchema,
|
|
3585
|
-
fontWeight: z
|
|
3893
|
+
fontWeight: z.enum([
|
|
3586
3894
|
"regular",
|
|
3587
3895
|
"medium",
|
|
3588
3896
|
"semibold",
|
|
3589
3897
|
"bold",
|
|
3590
3898
|
"black"
|
|
3591
3899
|
]),
|
|
3592
|
-
fontSize: z
|
|
3900
|
+
fontSize: z.enum([
|
|
3593
3901
|
"2xs",
|
|
3594
3902
|
"xs",
|
|
3595
3903
|
"sm",
|
|
3596
3904
|
"base"
|
|
3597
3905
|
]),
|
|
3598
|
-
textTransform: z
|
|
3906
|
+
textTransform: z.enum([
|
|
3599
3907
|
"none",
|
|
3600
3908
|
"uppercase",
|
|
3601
3909
|
"lowercase",
|
|
3602
3910
|
"capitalize"
|
|
3603
3911
|
]).optional(),
|
|
3604
|
-
letterSpacing: z
|
|
3912
|
+
letterSpacing: z.enum([
|
|
3605
3913
|
"normal",
|
|
3606
3914
|
"wide",
|
|
3607
3915
|
"wider",
|
|
3608
3916
|
"widest"
|
|
3609
3917
|
]).optional(),
|
|
3610
|
-
opacity: z
|
|
3918
|
+
opacity: z.number().min(.2).max(1).optional()
|
|
3611
3919
|
}),
|
|
3612
|
-
focus: z
|
|
3920
|
+
focus: z.object({
|
|
3613
3921
|
ringColorToken: themeColorTokenSchema,
|
|
3614
|
-
ringWidth: z
|
|
3922
|
+
ringWidth: z.enum([
|
|
3615
3923
|
"0",
|
|
3616
3924
|
"1",
|
|
3617
3925
|
"2",
|
|
@@ -3619,14 +3927,14 @@ const inputSystemSchema = z$1.object({
|
|
|
3619
3927
|
]),
|
|
3620
3928
|
borderColorToken: themeColorTokenSchema.optional()
|
|
3621
3929
|
}),
|
|
3622
|
-
error: z
|
|
3930
|
+
error: z.object({
|
|
3623
3931
|
borderColorToken: themeColorTokenSchema,
|
|
3624
3932
|
textColorToken: themeColorTokenSchema
|
|
3625
3933
|
}),
|
|
3626
|
-
disabled: z
|
|
3934
|
+
disabled: z.object({
|
|
3627
3935
|
backgroundColorToken: themeColorTokenSchema,
|
|
3628
3936
|
textColorToken: themeColorTokenSchema,
|
|
3629
|
-
opacity: z
|
|
3937
|
+
opacity: z.number().min(.3).max(.7)
|
|
3630
3938
|
})
|
|
3631
3939
|
});
|
|
3632
3940
|
//#endregion
|
|
@@ -3637,9 +3945,9 @@ const inputSystemSchema = z$1.object({
|
|
|
3637
3945
|
/**
|
|
3638
3946
|
* Gradient color stop
|
|
3639
3947
|
*/
|
|
3640
|
-
const gradientStopSchema = z
|
|
3948
|
+
const gradientStopSchema = z.object({
|
|
3641
3949
|
color: themeColorTokenSchema,
|
|
3642
|
-
position: z
|
|
3950
|
+
position: z.number().min(0).max(100)
|
|
3643
3951
|
});
|
|
3644
3952
|
/**
|
|
3645
3953
|
* Radial gradient shape. Optional; defaults to `circle` (the historical shape)
|
|
@@ -3648,7 +3956,7 @@ const gradientStopSchema = z$1.object({
|
|
|
3648
3956
|
* Named `RadialGradientShape` to avoid clashing with `styles/gradients.ts`'s
|
|
3649
3957
|
* `GradientShape` (which names the gradient *kind*: linear/radial/conic).
|
|
3650
3958
|
*/
|
|
3651
|
-
const radialGradientShapeSchema = z
|
|
3959
|
+
const radialGradientShapeSchema = z.enum(["circle", "ellipse"]);
|
|
3652
3960
|
/**
|
|
3653
3961
|
* Gradient configuration.
|
|
3654
3962
|
*
|
|
@@ -3659,16 +3967,16 @@ const radialGradientShapeSchema = z$1.enum(["circle", "ellipse"]);
|
|
|
3659
3967
|
* - radial: optional `shape` (circle/ellipse) + `position`
|
|
3660
3968
|
* - conic: optional `angle` (from-angle, degrees) + `position`
|
|
3661
3969
|
*/
|
|
3662
|
-
const gradientConfigSchema = z
|
|
3663
|
-
type: z
|
|
3970
|
+
const gradientConfigSchema = z.object({
|
|
3971
|
+
type: z.enum([
|
|
3664
3972
|
"linear",
|
|
3665
3973
|
"radial",
|
|
3666
3974
|
"conic"
|
|
3667
3975
|
]).default("linear"),
|
|
3668
|
-
angle: z
|
|
3976
|
+
angle: z.number().min(0).max(360).optional(),
|
|
3669
3977
|
shape: radialGradientShapeSchema.optional(),
|
|
3670
|
-
position: z
|
|
3671
|
-
stops: z
|
|
3978
|
+
position: z.string().optional(),
|
|
3979
|
+
stops: z.array(gradientStopSchema).min(2)
|
|
3672
3980
|
});
|
|
3673
3981
|
//#endregion
|
|
3674
3982
|
//#region ../theme-core/src/interactive/baseSchema.ts
|
|
@@ -3680,46 +3988,46 @@ const gradientConfigSchema = z$1.object({
|
|
|
3680
3988
|
/**
|
|
3681
3989
|
* Typography settings shared by buttons and nav links
|
|
3682
3990
|
*/
|
|
3683
|
-
const interactiveTypographySchema = z
|
|
3991
|
+
const interactiveTypographySchema = z.object({
|
|
3684
3992
|
/** Font family source */
|
|
3685
|
-
typography: z
|
|
3993
|
+
typography: z.enum(["body", "heading"]).default("body"),
|
|
3686
3994
|
/** Font weight */
|
|
3687
|
-
fontWeight: z
|
|
3995
|
+
fontWeight: z.enum([
|
|
3688
3996
|
"regular",
|
|
3689
3997
|
"medium",
|
|
3690
3998
|
"semibold",
|
|
3691
3999
|
"bold"
|
|
3692
4000
|
]).default("medium"),
|
|
3693
4001
|
/** Text transform */
|
|
3694
|
-
textTransform: z
|
|
4002
|
+
textTransform: z.enum([
|
|
3695
4003
|
"none",
|
|
3696
4004
|
"uppercase",
|
|
3697
4005
|
"capitalize"
|
|
3698
4006
|
]).default("none"),
|
|
3699
4007
|
/** Italic style */
|
|
3700
|
-
italic: z
|
|
4008
|
+
italic: z.boolean().default(false)
|
|
3701
4009
|
});
|
|
3702
4010
|
/**
|
|
3703
4011
|
* Effect application reference (shared between buttons and nav)
|
|
3704
4012
|
*/
|
|
3705
|
-
const effectApplicationSchema = z
|
|
4013
|
+
const effectApplicationSchema = z.object({
|
|
3706
4014
|
/** Effect preset ID */
|
|
3707
|
-
effectId: z
|
|
4015
|
+
effectId: z.string(),
|
|
3708
4016
|
/** User-provided customization options */
|
|
3709
|
-
options: z
|
|
4017
|
+
options: z.record(z.string(), z.any()).optional()
|
|
3710
4018
|
});
|
|
3711
4019
|
/**
|
|
3712
4020
|
* Effect composition by state (shared pattern)
|
|
3713
4021
|
*/
|
|
3714
|
-
const effectCompositionSchema = z
|
|
4022
|
+
const effectCompositionSchema = z.object({
|
|
3715
4023
|
/** Effects always applied */
|
|
3716
|
-
base: z
|
|
4024
|
+
base: z.array(effectApplicationSchema).optional(),
|
|
3717
4025
|
/** Effects applied on hover */
|
|
3718
|
-
hover: z
|
|
4026
|
+
hover: z.array(effectApplicationSchema).optional(),
|
|
3719
4027
|
/** Effects applied on active/pressed */
|
|
3720
|
-
active: z
|
|
4028
|
+
active: z.array(effectApplicationSchema).optional(),
|
|
3721
4029
|
/** Effects applied on focus */
|
|
3722
|
-
focus: z
|
|
4030
|
+
focus: z.array(effectApplicationSchema).optional()
|
|
3723
4031
|
});
|
|
3724
4032
|
//#endregion
|
|
3725
4033
|
//#region ../theme-core/src/navigation/types.ts
|
|
@@ -3731,7 +4039,7 @@ const effectCompositionSchema = z$1.object({
|
|
|
3731
4039
|
/**
|
|
3732
4040
|
* Padding preset options for nav links
|
|
3733
4041
|
*/
|
|
3734
|
-
const navLinkPaddingSchema = z
|
|
4042
|
+
const navLinkPaddingSchema = z.enum([
|
|
3735
4043
|
"none",
|
|
3736
4044
|
"compact",
|
|
3737
4045
|
"default"
|
|
@@ -3740,7 +4048,7 @@ const navLinkPaddingSchema = z$1.enum([
|
|
|
3740
4048
|
* Horizontal padding override for nav links.
|
|
3741
4049
|
* When set, overrides only the horizontal component of the `padding` preset.
|
|
3742
4050
|
*/
|
|
3743
|
-
const navLinkPaddingXSchema = z
|
|
4051
|
+
const navLinkPaddingXSchema = z.enum([
|
|
3744
4052
|
"none",
|
|
3745
4053
|
"tight",
|
|
3746
4054
|
"compact",
|
|
@@ -3751,7 +4059,7 @@ const navLinkPaddingXSchema = z$1.enum([
|
|
|
3751
4059
|
/**
|
|
3752
4060
|
* Border radius options for nav links
|
|
3753
4061
|
*/
|
|
3754
|
-
const navLinkBorderRadiusSchema = z
|
|
4062
|
+
const navLinkBorderRadiusSchema = z.enum([
|
|
3755
4063
|
"none",
|
|
3756
4064
|
"sm",
|
|
3757
4065
|
"md",
|
|
@@ -3760,7 +4068,7 @@ const navLinkBorderRadiusSchema = z$1.enum([
|
|
|
3760
4068
|
/**
|
|
3761
4069
|
* Typography size options for nav links.
|
|
3762
4070
|
*/
|
|
3763
|
-
const navLinkTextSizeSchema = z
|
|
4071
|
+
const navLinkTextSizeSchema = z.enum([
|
|
3764
4072
|
"xs",
|
|
3765
4073
|
"sm",
|
|
3766
4074
|
"base",
|
|
@@ -3770,7 +4078,7 @@ const navLinkTextSizeSchema = z$1.enum([
|
|
|
3770
4078
|
/**
|
|
3771
4079
|
* Letter spacing options for nav links.
|
|
3772
4080
|
*/
|
|
3773
|
-
const navLinkLetterSpacingSchema = z
|
|
4081
|
+
const navLinkLetterSpacingSchema = z.enum([
|
|
3774
4082
|
"normal",
|
|
3775
4083
|
"wide",
|
|
3776
4084
|
"wider",
|
|
@@ -3779,15 +4087,15 @@ const navLinkLetterSpacingSchema = z$1.enum([
|
|
|
3779
4087
|
/**
|
|
3780
4088
|
* Optional legibility aid for nav text that floats over uncertain imagery or color.
|
|
3781
4089
|
*/
|
|
3782
|
-
const navLinkContrastTreatmentSchema = z
|
|
4090
|
+
const navLinkContrastTreatmentSchema = z.enum(["none", "soft-glow"]);
|
|
3783
4091
|
/**
|
|
3784
4092
|
* Nav link style schema
|
|
3785
4093
|
*
|
|
3786
4094
|
* Extends interactive typography base with nav-specific settings.
|
|
3787
4095
|
*/
|
|
3788
|
-
const navLinkStyleSchema = z
|
|
4096
|
+
const navLinkStyleSchema = z.object({
|
|
3789
4097
|
/** Display name for the style */
|
|
3790
|
-
name: z
|
|
4098
|
+
name: z.string().min(1).max(30).optional(),
|
|
3791
4099
|
/** Typography settings (inherited from interactive base) */
|
|
3792
4100
|
...interactiveTypographySchema.shape,
|
|
3793
4101
|
/** Text color token */
|
|
@@ -3872,7 +4180,7 @@ function containsForbiddenSelector(selector) {
|
|
|
3872
4180
|
/**
|
|
3873
4181
|
* Validates a CSS selector for safety.
|
|
3874
4182
|
*/
|
|
3875
|
-
const selectorSchema = z
|
|
4183
|
+
const selectorSchema = z.string().min(1, "Selector cannot be empty").max(200, "Selector too long (max 200 characters)").refine((s) => !containsForbiddenSelector(s), { message: "Global selectors (:root, html, body, *) are not allowed" });
|
|
3876
4184
|
/**
|
|
3877
4185
|
* Check if a CSS value contains a remote URL.
|
|
3878
4186
|
*/
|
|
@@ -3890,31 +4198,31 @@ function containsJavascriptUrl(value) {
|
|
|
3890
4198
|
* Allows: url(#id), url(data:...), url(/path), var(--)
|
|
3891
4199
|
* Forbids: url(http...), url(//...), javascript:
|
|
3892
4200
|
*/
|
|
3893
|
-
const declarationValueSchema = z
|
|
4201
|
+
const declarationValueSchema = z.string().max(500, "Declaration value too long (max 500 characters)").refine((v) => !containsRemoteUrl(v), { message: "Remote url() references are not allowed. Use local paths, data URIs, or fragment IDs." }).refine((v) => !containsJavascriptUrl(v), { message: "javascript: URLs are not allowed" });
|
|
3894
4202
|
/**
|
|
3895
4203
|
* Schema for CSS declarations object (property -> value map).
|
|
3896
4204
|
*/
|
|
3897
|
-
const declarationsSchema = z
|
|
4205
|
+
const declarationsSchema = z.record(z.string().min(1).max(100), declarationValueSchema);
|
|
3898
4206
|
/**
|
|
3899
4207
|
* Schema for a single custom CSS rule.
|
|
3900
4208
|
*/
|
|
3901
|
-
const customCssRuleSchema = z
|
|
3902
|
-
id: z
|
|
4209
|
+
const customCssRuleSchema = z.object({
|
|
4210
|
+
id: z.string().min(1, "Rule ID is required").max(50, "Rule ID too long"),
|
|
3903
4211
|
selector: selectorSchema,
|
|
3904
4212
|
declarations: declarationsSchema
|
|
3905
4213
|
});
|
|
3906
4214
|
/**
|
|
3907
4215
|
* Schema for block-specific CSS rule.
|
|
3908
4216
|
*/
|
|
3909
|
-
const blockCustomCssRuleSchema = customCssRuleSchema.extend({ blockKind: z
|
|
4217
|
+
const blockCustomCssRuleSchema = customCssRuleSchema.extend({ blockKind: z.string().min(1, "Block kind is required").max(50, "Block kind too long") });
|
|
3910
4218
|
/**
|
|
3911
4219
|
* Array of custom CSS rules for theme-level styling.
|
|
3912
4220
|
*/
|
|
3913
|
-
const customCssRulesSchema = z
|
|
4221
|
+
const customCssRulesSchema = z.array(customCssRuleSchema).optional();
|
|
3914
4222
|
/**
|
|
3915
4223
|
* Array of block-specific CSS rules.
|
|
3916
4224
|
*/
|
|
3917
|
-
const blockCustomCssRulesSchema = z
|
|
4225
|
+
const blockCustomCssRulesSchema = z.array(blockCustomCssRuleSchema).optional();
|
|
3918
4226
|
//#endregion
|
|
3919
4227
|
//#region ../theme-core/src/customCss/atRuleValidation.ts
|
|
3920
4228
|
/**
|
|
@@ -3932,9 +4240,9 @@ const BLOCKED_AT_RULES = ["@import", "@charset"];
|
|
|
3932
4240
|
/** Pattern to detect blocked at-rules */
|
|
3933
4241
|
const BLOCKED_AT_RULE_PATTERN = /@(?:import|charset)\b/i;
|
|
3934
4242
|
/** Rule ID schema - reused from main validation */
|
|
3935
|
-
const ruleIdSchema = z
|
|
4243
|
+
const ruleIdSchema = z.string().min(1, "Rule ID is required").max(50, "Rule ID too long");
|
|
3936
4244
|
/** Nested rule schema for @media and @supports */
|
|
3937
|
-
const nestedRuleSchema = z
|
|
4245
|
+
const nestedRuleSchema = z.object({
|
|
3938
4246
|
selector: selectorSchema,
|
|
3939
4247
|
declarations: declarationsSchema
|
|
3940
4248
|
});
|
|
@@ -3951,46 +4259,46 @@ function isValidKeyframeOffset(offset) {
|
|
|
3951
4259
|
return value >= 0 && value <= 100;
|
|
3952
4260
|
}
|
|
3953
4261
|
/** Keyframe offset validation (0%, 50%, 100%, from, to) */
|
|
3954
|
-
const keyframeOffsetSchema = z
|
|
4262
|
+
const keyframeOffsetSchema = z.string().transform((offset) => offset.trim()).refine((offset) => KEYFRAME_OFFSET_PATTERN.test(offset), { message: "Invalid keyframe offset. Use percentages (0%, 50%, 100%) or \"from\"/\"to\"" }).refine(isValidKeyframeOffset, { message: "Keyframe offset must be between 0% and 100%" });
|
|
3955
4263
|
/** Animation name validation (CSS identifier) */
|
|
3956
|
-
const animationNameSchema = z
|
|
4264
|
+
const animationNameSchema = z.string().min(1, "Animation name is required").max(50, "Animation name too long").refine((name) => ANIMATION_NAME_PATTERN.test(name), { message: "Invalid animation name. Use letters, numbers, dashes, underscores (start with letter, dash, or underscore)" });
|
|
3957
4265
|
/** Single keyframe (offset + declarations) */
|
|
3958
|
-
const keyframeSchema = z
|
|
4266
|
+
const keyframeSchema = z.object({
|
|
3959
4267
|
offset: keyframeOffsetSchema,
|
|
3960
4268
|
declarations: declarationsSchema
|
|
3961
4269
|
});
|
|
3962
4270
|
/** @keyframes rule schema */
|
|
3963
|
-
const keyframesAtRuleSchema = z
|
|
4271
|
+
const keyframesAtRuleSchema = z.object({
|
|
3964
4272
|
id: ruleIdSchema,
|
|
3965
|
-
type: z
|
|
4273
|
+
type: z.literal("keyframes"),
|
|
3966
4274
|
name: animationNameSchema,
|
|
3967
|
-
frames: z
|
|
4275
|
+
frames: z.array(keyframeSchema).min(1, "At least one keyframe is required")
|
|
3968
4276
|
});
|
|
3969
4277
|
/** Font-face declarations - uses standard declarations but with font-specific validation */
|
|
3970
|
-
const fontFaceDeclarationsSchema = z
|
|
4278
|
+
const fontFaceDeclarationsSchema = z.record(z.string().min(1).max(100), declarationValueSchema).refine((decls) => "fontFamily" in decls || "font-family" in decls, { message: "font-family is required in @font-face" });
|
|
3971
4279
|
/** @font-face rule schema */
|
|
3972
|
-
const fontFaceAtRuleSchema = z
|
|
4280
|
+
const fontFaceAtRuleSchema = z.object({
|
|
3973
4281
|
id: ruleIdSchema,
|
|
3974
|
-
type: z
|
|
4282
|
+
type: z.literal("font-face"),
|
|
3975
4283
|
declarations: fontFaceDeclarationsSchema
|
|
3976
4284
|
});
|
|
3977
4285
|
/** Media query string validation */
|
|
3978
|
-
const mediaQuerySchema = z
|
|
4286
|
+
const mediaQuerySchema = z.string().min(1, "Media query is required").max(200, "Media query too long");
|
|
3979
4287
|
/** @media rule schema */
|
|
3980
|
-
const mediaAtRuleSchema = z
|
|
4288
|
+
const mediaAtRuleSchema = z.object({
|
|
3981
4289
|
id: ruleIdSchema,
|
|
3982
|
-
type: z
|
|
4290
|
+
type: z.literal("media"),
|
|
3983
4291
|
query: mediaQuerySchema,
|
|
3984
|
-
rules: z
|
|
4292
|
+
rules: z.array(nestedRuleSchema).min(1, "At least one rule is required")
|
|
3985
4293
|
});
|
|
3986
4294
|
/** Supports condition string validation */
|
|
3987
|
-
const supportsConditionSchema = z
|
|
4295
|
+
const supportsConditionSchema = z.string().min(1, "Supports condition is required").max(200, "Supports condition too long");
|
|
3988
4296
|
/** @supports rule schema */
|
|
3989
|
-
const supportsAtRuleSchema = z
|
|
4297
|
+
const supportsAtRuleSchema = z.object({
|
|
3990
4298
|
id: ruleIdSchema,
|
|
3991
|
-
type: z
|
|
4299
|
+
type: z.literal("supports"),
|
|
3992
4300
|
condition: supportsConditionSchema,
|
|
3993
|
-
rules: z
|
|
4301
|
+
rules: z.array(nestedRuleSchema).min(1, "At least one rule is required")
|
|
3994
4302
|
});
|
|
3995
4303
|
/**
|
|
3996
4304
|
* Check if raw CSS contains blocked at-rules.
|
|
@@ -3999,17 +4307,17 @@ function containsBlockedAtRule(css) {
|
|
|
3999
4307
|
return BLOCKED_AT_RULE_PATTERN.test(css);
|
|
4000
4308
|
}
|
|
4001
4309
|
/** Raw CSS validation - blocks @import, @charset, must start with @ */
|
|
4002
|
-
const rawCssSchema = z
|
|
4310
|
+
const rawCssSchema = z.string().min(1, "CSS is required").max(5e3, "Raw CSS too long (max 5000 characters)").refine((css) => css.trim().startsWith("@"), { message: "Raw at-rule must start with @" }).refine((css) => !containsBlockedAtRule(css), { message: `Blocked at-rules: ${BLOCKED_AT_RULES.join(", ")}. Use typed at-rules or local assets instead.` });
|
|
4003
4311
|
/** Raw at-rule schema */
|
|
4004
|
-
const rawAtRuleSchema = z
|
|
4312
|
+
const rawAtRuleSchema = z.object({
|
|
4005
4313
|
id: ruleIdSchema,
|
|
4006
|
-
type: z
|
|
4314
|
+
type: z.literal("raw"),
|
|
4007
4315
|
css: rawCssSchema
|
|
4008
4316
|
});
|
|
4009
4317
|
/**
|
|
4010
4318
|
* Discriminated union schema for all at-rule types.
|
|
4011
4319
|
*/
|
|
4012
|
-
const customCssAtRuleSchema = z
|
|
4320
|
+
const customCssAtRuleSchema = z.discriminatedUnion("type", [
|
|
4013
4321
|
keyframesAtRuleSchema,
|
|
4014
4322
|
fontFaceAtRuleSchema,
|
|
4015
4323
|
mediaAtRuleSchema,
|
|
@@ -4019,7 +4327,7 @@ const customCssAtRuleSchema = z$1.discriminatedUnion("type", [
|
|
|
4019
4327
|
/**
|
|
4020
4328
|
* Array of at-rules for theme-level styling.
|
|
4021
4329
|
*/
|
|
4022
|
-
const customCssAtRulesSchema = z
|
|
4330
|
+
const customCssAtRulesSchema = z.array(customCssAtRuleSchema).optional();
|
|
4023
4331
|
//#endregion
|
|
4024
4332
|
//#region ../theme-core/src/shared/componentStyles.ts
|
|
4025
4333
|
/**
|
|
@@ -4037,22 +4345,22 @@ const customCssAtRulesSchema = z$1.array(customCssAtRuleSchema).optional();
|
|
|
4037
4345
|
* Shared border schema for themed components.
|
|
4038
4346
|
* Position is excluded - each component determines its own border position.
|
|
4039
4347
|
*/
|
|
4040
|
-
const componentBorderSchema = z
|
|
4041
|
-
width: z
|
|
4348
|
+
const componentBorderSchema = z.object({
|
|
4349
|
+
width: z.enum([
|
|
4042
4350
|
"none",
|
|
4043
4351
|
"hairline",
|
|
4044
4352
|
"thin",
|
|
4045
4353
|
"medium",
|
|
4046
4354
|
"thick"
|
|
4047
4355
|
]).default("none"),
|
|
4048
|
-
style: z
|
|
4356
|
+
style: z.enum(["solid", "dashed"]).default("solid"),
|
|
4049
4357
|
colorToken: themeColorTokenSchema.optional()
|
|
4050
4358
|
});
|
|
4051
4359
|
/**
|
|
4052
4360
|
* Shared shadow schema for themed components.
|
|
4053
4361
|
* Softness is inherited from global theme, not configurable per-component.
|
|
4054
4362
|
*/
|
|
4055
|
-
const componentShadowSchema = z
|
|
4363
|
+
const componentShadowSchema = z.object({ elevation: z.enum([
|
|
4056
4364
|
"none",
|
|
4057
4365
|
"sm",
|
|
4058
4366
|
"md",
|
|
@@ -4147,43 +4455,43 @@ const logoDensityValues = [
|
|
|
4147
4455
|
"detailed",
|
|
4148
4456
|
"unknown"
|
|
4149
4457
|
];
|
|
4150
|
-
const logoContainsTextSchema = z
|
|
4151
|
-
z
|
|
4152
|
-
kind: z
|
|
4153
|
-
confidence: z
|
|
4154
|
-
text: z
|
|
4458
|
+
const logoContainsTextSchema = z.discriminatedUnion("kind", [
|
|
4459
|
+
z.object({
|
|
4460
|
+
kind: z.literal("contains-text"),
|
|
4461
|
+
confidence: z.enum(logoTextConfidenceValues),
|
|
4462
|
+
text: z.string().trim().min(1).max(200).optional()
|
|
4155
4463
|
}),
|
|
4156
|
-
z
|
|
4157
|
-
kind: z
|
|
4158
|
-
confidence: z
|
|
4464
|
+
z.object({
|
|
4465
|
+
kind: z.literal("no-text"),
|
|
4466
|
+
confidence: z.enum(logoTextConfidenceValues)
|
|
4159
4467
|
}),
|
|
4160
|
-
z
|
|
4161
|
-
kind: z
|
|
4162
|
-
reason: z
|
|
4468
|
+
z.object({
|
|
4469
|
+
kind: z.literal("unknown"),
|
|
4470
|
+
reason: z.enum([
|
|
4163
4471
|
"analysis-unavailable",
|
|
4164
4472
|
"unsupported-file",
|
|
4165
4473
|
"low-confidence"
|
|
4166
4474
|
])
|
|
4167
4475
|
})
|
|
4168
4476
|
]);
|
|
4169
|
-
const logoAnalysisSourceSchema = z
|
|
4170
|
-
z
|
|
4171
|
-
z
|
|
4172
|
-
kind: z
|
|
4173
|
-
reason: z
|
|
4477
|
+
const logoAnalysisSourceSchema = z.discriminatedUnion("kind", [
|
|
4478
|
+
z.object({ kind: z.literal("none") }),
|
|
4479
|
+
z.object({
|
|
4480
|
+
kind: z.literal("deterministic"),
|
|
4481
|
+
reason: z.enum(["dimensions", "fallback"])
|
|
4174
4482
|
}),
|
|
4175
|
-
z
|
|
4176
|
-
kind: z
|
|
4177
|
-
model: z
|
|
4178
|
-
analyzedAt: z
|
|
4483
|
+
z.object({
|
|
4484
|
+
kind: z.literal("llm"),
|
|
4485
|
+
model: z.literal("gpt-5.4-mini"),
|
|
4486
|
+
analyzedAt: z.string().trim().min(1).max(80).optional()
|
|
4179
4487
|
}),
|
|
4180
|
-
z
|
|
4488
|
+
z.object({ kind: z.literal("manual-override") })
|
|
4181
4489
|
]);
|
|
4182
|
-
z
|
|
4183
|
-
shape: z
|
|
4490
|
+
z.object({
|
|
4491
|
+
shape: z.enum(logoAssetShapeValues),
|
|
4184
4492
|
containsText: logoContainsTextSchema,
|
|
4185
|
-
kind: z
|
|
4186
|
-
density: z
|
|
4493
|
+
kind: z.enum(logoKindValues),
|
|
4494
|
+
density: z.enum(logoDensityValues),
|
|
4187
4495
|
source: logoAnalysisSourceSchema
|
|
4188
4496
|
});
|
|
4189
4497
|
const brandDisplayModeValues = [
|
|
@@ -4231,13 +4539,57 @@ new Set(themeV2NormalEditorRawStyleFieldNames);
|
|
|
4231
4539
|
const pageDesignEditorBackgroundOverrideOwner = "page-design-editor";
|
|
4232
4540
|
const siteChromeBackgroundOverrideOwner = "site-chrome-editor";
|
|
4233
4541
|
//#endregion
|
|
4234
|
-
//#region ../theme-core/src/
|
|
4542
|
+
//#region ../theme-core/src/header/legacyHeaderVariant.ts
|
|
4235
4543
|
/**
|
|
4236
|
-
*
|
|
4237
|
-
*
|
|
4238
|
-
*
|
|
4544
|
+
* The header variants the system actually renders.
|
|
4545
|
+
*
|
|
4546
|
+
* Each one has a layout row in the site-header block and a paint target in
|
|
4547
|
+
* `paintTargets.ts`. This is the canonical list: the block transform's variant
|
|
4548
|
+
* class allowlist and the AI theme generator's enum both derive from it, so
|
|
4549
|
+
* they cannot drift.
|
|
4550
|
+
*/
|
|
4551
|
+
const headerVariantValues = [
|
|
4552
|
+
"classic",
|
|
4553
|
+
"centered",
|
|
4554
|
+
"floating"
|
|
4555
|
+
];
|
|
4556
|
+
z.enum(headerVariantValues);
|
|
4557
|
+
/**
|
|
4558
|
+
* Header variant spellings that were once authorable but no longer name a
|
|
4559
|
+
* layout of their own, and the variant they read as now.
|
|
4560
|
+
*
|
|
4561
|
+
* `transparent` was an overlay header with no CSS of its own: everything it
|
|
4562
|
+
* did (transparent root background, overlay content flow) is what `floating`
|
|
4563
|
+
* already does, and it had zero persisted usage in production or locally when
|
|
4564
|
+
* it was retired. It survives here as a one-boundary alias so a theme authored
|
|
4565
|
+
* against the old vocabulary still parses.
|
|
4566
|
+
*
|
|
4567
|
+
* This matters because the theme schema is strict and has no per-field
|
|
4568
|
+
* `.catch()`: an out-of-enum variant fails `themeSchema.safeParse` for the
|
|
4569
|
+
* *whole* theme, which silently swaps the site's theme for
|
|
4570
|
+
* `modernMinimalTheme`. Aliasing here keeps that from happening.
|
|
4571
|
+
*/
|
|
4572
|
+
const legacyHeaderVariants = { transparent: "floating" };
|
|
4573
|
+
const legacyHeaderVariantValues = Object.keys(legacyHeaderVariants);
|
|
4574
|
+
/**
|
|
4575
|
+
* The header variant boundary for themes that go through `themeSchema`:
|
|
4576
|
+
* canonical variants pass through, legacy spellings normalize to the variant
|
|
4577
|
+
* they meant, everything else fails the parse.
|
|
4578
|
+
*
|
|
4579
|
+
* Deliberately an enum plus a transform rather than a `z.preprocess`, so the
|
|
4580
|
+
* schema's *input* type stays an accurate union (the legacy spelling is still
|
|
4581
|
+
* accepted on the wire) instead of widening to `unknown`. `SdkThemeWire` in
|
|
4582
|
+
* `@riverbankcms/api` is `z.input<typeof themeSchema>`, so a widened input here
|
|
4583
|
+
* would leak straight into a public type.
|
|
4584
|
+
*
|
|
4585
|
+
* Not every read of a persisted theme goes through the schema:
|
|
4586
|
+
* `resolveRuntimeTheme` in
|
|
4587
|
+
* `apps/dashboard/src/server/services/sites/runtimeSiteResponse.ts` returns the
|
|
4588
|
+
* raw database JSON asserted as `Theme` with no parse, so a theme still
|
|
4589
|
+
* carrying a legacy spelling reaches the theme editor un-aliased. That gap
|
|
4590
|
+
* predates this alias and is harmless while persisted usage is zero.
|
|
4239
4591
|
*/
|
|
4240
|
-
const
|
|
4592
|
+
const headerVariantWithLegacyAliasSchema = z.enum([...headerVariantValues, ...legacyHeaderVariantValues]).transform((value) => value in legacyHeaderVariants ? legacyHeaderVariants[value] : value);
|
|
4241
4593
|
const BREAKPOINT_LG = 1024;
|
|
4242
4594
|
const BREAKPOINT_XL = 1280;
|
|
4243
4595
|
const BREAKPOINT_LG_DOWN = BREAKPOINT_LG - 1;
|
|
@@ -4262,14 +4614,14 @@ mqDown(640);
|
|
|
4262
4614
|
mqDown(768);
|
|
4263
4615
|
//#endregion
|
|
4264
4616
|
//#region ../theme-core/src/header/scrollTreatment.ts
|
|
4265
|
-
const headerScrollTreatmentSchema = z
|
|
4266
|
-
kind: z
|
|
4267
|
-
backgroundTone: z
|
|
4617
|
+
const headerScrollTreatmentSchema = z.discriminatedUnion("kind", [z.object({
|
|
4618
|
+
kind: z.literal("contrast-glass"),
|
|
4619
|
+
backgroundTone: z.enum(["light", "dark"])
|
|
4268
4620
|
})]).optional();
|
|
4269
4621
|
//#endregion
|
|
4270
4622
|
//#region ../theme-core/src/header/containerSchema.ts
|
|
4271
|
-
const headerContainerSchema = z
|
|
4272
|
-
rounded: z
|
|
4623
|
+
const headerContainerSchema = z.object({
|
|
4624
|
+
rounded: z.enum([
|
|
4273
4625
|
"none",
|
|
4274
4626
|
"sm",
|
|
4275
4627
|
"md",
|
|
@@ -4277,77 +4629,146 @@ const headerContainerSchema = z$1.object({
|
|
|
4277
4629
|
"xl",
|
|
4278
4630
|
"2xl"
|
|
4279
4631
|
]).default("xl"),
|
|
4280
|
-
border: z
|
|
4281
|
-
shadow: z
|
|
4282
|
-
padding: z
|
|
4632
|
+
border: z.boolean().default(true),
|
|
4633
|
+
shadow: z.boolean().default(true),
|
|
4634
|
+
padding: z.enum([
|
|
4283
4635
|
"sm",
|
|
4284
4636
|
"md",
|
|
4285
4637
|
"lg"
|
|
4286
4638
|
]).default("md"),
|
|
4287
|
-
tint: z
|
|
4288
|
-
opacity: z
|
|
4639
|
+
tint: z.string().nullable().optional(),
|
|
4640
|
+
opacity: z.number().min(0).max(1).default(.12)
|
|
4289
4641
|
}).optional();
|
|
4290
|
-
const headerInteractionPaletteSchema = z
|
|
4642
|
+
const headerInteractionPaletteSchema = z.enum([
|
|
4291
4643
|
"primary",
|
|
4292
4644
|
"secondary",
|
|
4293
4645
|
"accent"
|
|
4294
4646
|
]);
|
|
4295
4647
|
//#endregion
|
|
4648
|
+
//#region ../theme-core/src/boxBackgroundSchema.ts
|
|
4649
|
+
const boxBackgroundOverlaySchema = z.preprocess(normalizeAuthoringOpacity, z.discriminatedUnion("type", [
|
|
4650
|
+
z.object({ type: z.literal("none") }),
|
|
4651
|
+
z.object({
|
|
4652
|
+
type: z.literal("color"),
|
|
4653
|
+
color: tokenOrCssColorValueSchema.nullable().optional(),
|
|
4654
|
+
opacity: z.number().min(0).max(1).nullable().optional()
|
|
4655
|
+
}),
|
|
4656
|
+
z.object({
|
|
4657
|
+
type: z.literal("gradient"),
|
|
4658
|
+
gradient: z.string().nullable().optional(),
|
|
4659
|
+
opacity: z.number().min(0).max(1).nullable().optional()
|
|
4660
|
+
})
|
|
4661
|
+
]));
|
|
4662
|
+
const commonSchema = z.object({
|
|
4663
|
+
contentOwner: z.literal(pageDesignEditorBackgroundOverrideOwner).optional(),
|
|
4664
|
+
textColor: tokenOrCssColorValueSchema.nullable().optional(),
|
|
4665
|
+
headingColor: tokenOrCssColorValueSchema.nullable().optional(),
|
|
4666
|
+
linkColor: tokenOrCssColorValueSchema.nullable().optional(),
|
|
4667
|
+
supportingColor: tokenOrCssColorValueSchema.nullable().optional()
|
|
4668
|
+
});
|
|
4669
|
+
const mediaPresentationSchema = commonSchema.extend({
|
|
4670
|
+
opacity: z.preprocess(normalizeOpacity, z.number().min(0).max(1).nullable()).optional(),
|
|
4671
|
+
objectFit: z.enum([
|
|
4672
|
+
"fill",
|
|
4673
|
+
"fit",
|
|
4674
|
+
"original",
|
|
4675
|
+
"custom"
|
|
4676
|
+
]).nullable().optional(),
|
|
4677
|
+
scale: z.string().nullable().optional(),
|
|
4678
|
+
position: z.string().nullable().optional(),
|
|
4679
|
+
motion: z.enum(["static", "fixed-frame"]).nullable().optional(),
|
|
4680
|
+
overflow: z.boolean().nullable().optional(),
|
|
4681
|
+
overlay: boxBackgroundOverlaySchema.nullable().optional()
|
|
4682
|
+
});
|
|
4683
|
+
const boxBackgroundSchema = z.discriminatedUnion("type", [
|
|
4684
|
+
commonSchema.extend({
|
|
4685
|
+
type: z.literal("color"),
|
|
4686
|
+
color: tokenOrCssColorValueSchema.nullable().optional()
|
|
4687
|
+
}),
|
|
4688
|
+
commonSchema.extend({
|
|
4689
|
+
type: z.literal("gradient"),
|
|
4690
|
+
gradient: z.string().nullable().optional(),
|
|
4691
|
+
gradientPresetId: z.string().min(1).nullable().optional()
|
|
4692
|
+
}),
|
|
4693
|
+
mediaPresentationSchema.extend({
|
|
4694
|
+
type: z.literal("image"),
|
|
4695
|
+
image: imageMediaSchema.nullable().optional()
|
|
4696
|
+
}),
|
|
4697
|
+
mediaPresentationSchema.extend({
|
|
4698
|
+
type: z.literal("video"),
|
|
4699
|
+
image: videoMediaSchema.nullable().optional(),
|
|
4700
|
+
showVideoOnMobile: z.boolean().nullable().optional()
|
|
4701
|
+
})
|
|
4702
|
+
]);
|
|
4703
|
+
function normalizeAuthoringOpacity(value) {
|
|
4704
|
+
if (!isRecord(value)) return value;
|
|
4705
|
+
return {
|
|
4706
|
+
...value,
|
|
4707
|
+
opacity: normalizeOpacity(value.opacity)
|
|
4708
|
+
};
|
|
4709
|
+
}
|
|
4710
|
+
function normalizeOpacity(value) {
|
|
4711
|
+
return typeof value === "number" && value > 1 && value <= 100 ? value / 100 : value;
|
|
4712
|
+
}
|
|
4713
|
+
function isRecord(value) {
|
|
4714
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
4715
|
+
}
|
|
4716
|
+
//#endregion
|
|
4296
4717
|
//#region ../theme-core/src/schema.ts
|
|
4297
|
-
const axesSchema = z
|
|
4298
|
-
tone: z
|
|
4718
|
+
const axesSchema = z.object({
|
|
4719
|
+
tone: z.enum([
|
|
4299
4720
|
"minimal",
|
|
4300
4721
|
"classic",
|
|
4301
4722
|
"bold"
|
|
4302
4723
|
]),
|
|
4303
|
-
energy: z
|
|
4304
|
-
density: z
|
|
4724
|
+
energy: z.enum(["calm", "vibrant"]),
|
|
4725
|
+
density: z.enum([
|
|
4305
4726
|
"airy",
|
|
4306
4727
|
"regular",
|
|
4307
4728
|
"compact"
|
|
4308
4729
|
]),
|
|
4309
|
-
mediaBias: z
|
|
4730
|
+
mediaBias: z.enum([
|
|
4310
4731
|
"text",
|
|
4311
4732
|
"media",
|
|
4312
4733
|
"mixed"
|
|
4313
4734
|
]),
|
|
4314
|
-
conversionBias: z
|
|
4735
|
+
conversionBias: z.enum([
|
|
4315
4736
|
"low",
|
|
4316
4737
|
"med",
|
|
4317
4738
|
"high"
|
|
4318
4739
|
]),
|
|
4319
|
-
motion: z
|
|
4740
|
+
motion: z.enum([
|
|
4320
4741
|
"subtle",
|
|
4321
4742
|
"standard",
|
|
4322
4743
|
"expressive"
|
|
4323
4744
|
])
|
|
4324
4745
|
});
|
|
4325
|
-
const typographyStyleSchema = z
|
|
4326
|
-
family: z
|
|
4327
|
-
weight: z
|
|
4746
|
+
const typographyStyleSchema = z.object({
|
|
4747
|
+
family: z.string().min(1),
|
|
4748
|
+
weight: z.enum([
|
|
4328
4749
|
"light",
|
|
4329
4750
|
"regular",
|
|
4330
4751
|
"medium",
|
|
4331
4752
|
"semibold",
|
|
4332
4753
|
"bold"
|
|
4333
4754
|
]),
|
|
4334
|
-
letterSpacing: z
|
|
4755
|
+
letterSpacing: z.enum([
|
|
4335
4756
|
"tight",
|
|
4336
4757
|
"normal",
|
|
4337
4758
|
"loose"
|
|
4338
4759
|
]),
|
|
4339
|
-
lineHeight: z
|
|
4760
|
+
lineHeight: z.enum([
|
|
4340
4761
|
"normal",
|
|
4341
4762
|
"relaxed",
|
|
4342
4763
|
"loose"
|
|
4343
4764
|
])
|
|
4344
4765
|
});
|
|
4345
|
-
const bodyTypographyStyleSchema = typographyStyleSchema.extend({ size: z
|
|
4766
|
+
const bodyTypographyStyleSchema = typographyStyleSchema.extend({ size: z.enum([
|
|
4346
4767
|
"md",
|
|
4347
4768
|
"lg",
|
|
4348
4769
|
"xl"
|
|
4349
4770
|
]) });
|
|
4350
|
-
const headingSizeSchema = z
|
|
4771
|
+
const headingSizeSchema = z.enum([
|
|
4351
4772
|
"xs",
|
|
4352
4773
|
"sm",
|
|
4353
4774
|
"md",
|
|
@@ -4355,68 +4776,68 @@ const headingSizeSchema = z$1.enum([
|
|
|
4355
4776
|
"xl",
|
|
4356
4777
|
"2xl"
|
|
4357
4778
|
]);
|
|
4358
|
-
const headingTypographyOverridesSchema = z
|
|
4359
|
-
weight: z
|
|
4779
|
+
const headingTypographyOverridesSchema = z.object({
|
|
4780
|
+
weight: z.enum([
|
|
4360
4781
|
"light",
|
|
4361
4782
|
"regular",
|
|
4362
4783
|
"medium",
|
|
4363
4784
|
"semibold",
|
|
4364
4785
|
"bold"
|
|
4365
4786
|
]).nullable().optional(),
|
|
4366
|
-
letterSpacing: z
|
|
4787
|
+
letterSpacing: z.enum([
|
|
4367
4788
|
"tight",
|
|
4368
4789
|
"normal",
|
|
4369
4790
|
"loose"
|
|
4370
4791
|
]).nullable().optional(),
|
|
4371
4792
|
size: headingSizeSchema.nullable().optional(),
|
|
4372
|
-
lineHeight: z
|
|
4793
|
+
lineHeight: z.enum([
|
|
4373
4794
|
"tight",
|
|
4374
4795
|
"snug",
|
|
4375
4796
|
"normal",
|
|
4376
4797
|
"relaxed",
|
|
4377
4798
|
"loose"
|
|
4378
4799
|
]).nullable().optional(),
|
|
4379
|
-
italic: z
|
|
4800
|
+
italic: z.boolean().nullable().optional(),
|
|
4380
4801
|
colorToken: themeColorTokenSchema.nullable().optional()
|
|
4381
4802
|
});
|
|
4382
4803
|
const headingTypographyStyleSchema = typographyStyleSchema.extend({
|
|
4383
|
-
case: z
|
|
4804
|
+
case: z.enum([
|
|
4384
4805
|
"uppercase",
|
|
4385
4806
|
"normal",
|
|
4386
4807
|
"smallCaps"
|
|
4387
4808
|
]).nullable(),
|
|
4388
|
-
italic: z
|
|
4809
|
+
italic: z.boolean().nullable(),
|
|
4389
4810
|
colorToken: themeColorTokenSchema.nullable().optional()
|
|
4390
4811
|
});
|
|
4391
|
-
const proseLinkUnderlineStyleSchema = z
|
|
4812
|
+
const proseLinkUnderlineStyleSchema = z.enum([
|
|
4392
4813
|
"solid",
|
|
4393
4814
|
"dotted",
|
|
4394
4815
|
"dashed"
|
|
4395
4816
|
]);
|
|
4396
|
-
const proseLinkUnderlineThicknessSchema = z
|
|
4817
|
+
const proseLinkUnderlineThicknessSchema = z.enum([
|
|
4397
4818
|
"auto",
|
|
4398
4819
|
"fromFont",
|
|
4399
4820
|
"thin",
|
|
4400
4821
|
"medium",
|
|
4401
4822
|
"thick"
|
|
4402
4823
|
]);
|
|
4403
|
-
const proseLinkUnderlineOffsetSchema = z
|
|
4824
|
+
const proseLinkUnderlineOffsetSchema = z.enum([
|
|
4404
4825
|
"auto",
|
|
4405
4826
|
"tight",
|
|
4406
4827
|
"normal",
|
|
4407
4828
|
"loose"
|
|
4408
4829
|
]);
|
|
4409
|
-
const proseLinkStyleSchema = z
|
|
4830
|
+
const proseLinkStyleSchema = z.object({
|
|
4410
4831
|
colorToken: themeColorTokenSchema.optional(),
|
|
4411
4832
|
hoverColorToken: themeColorTokenSchema.optional(),
|
|
4412
|
-
underline: z
|
|
4833
|
+
underline: z.boolean().optional(),
|
|
4413
4834
|
decorationColorToken: themeColorTokenSchema.optional(),
|
|
4414
4835
|
hoverDecorationColorToken: themeColorTokenSchema.optional(),
|
|
4415
4836
|
underlineStyle: proseLinkUnderlineStyleSchema.optional(),
|
|
4416
4837
|
underlineThickness: proseLinkUnderlineThicknessSchema.optional(),
|
|
4417
4838
|
underlineOffset: proseLinkUnderlineOffsetSchema.optional()
|
|
4418
4839
|
});
|
|
4419
|
-
const semanticSpacingSchema = z
|
|
4840
|
+
const semanticSpacingSchema = z.enum([
|
|
4420
4841
|
"none",
|
|
4421
4842
|
"compact",
|
|
4422
4843
|
"cozy",
|
|
@@ -4424,7 +4845,7 @@ const semanticSpacingSchema = z$1.enum([
|
|
|
4424
4845
|
"comfortable",
|
|
4425
4846
|
"spacious"
|
|
4426
4847
|
]);
|
|
4427
|
-
const boxRoundedSchema = z
|
|
4848
|
+
const boxRoundedSchema = z.enum([
|
|
4428
4849
|
"none",
|
|
4429
4850
|
"sm",
|
|
4430
4851
|
"md",
|
|
@@ -4433,82 +4854,45 @@ const boxRoundedSchema = z$1.enum([
|
|
|
4433
4854
|
"2xl",
|
|
4434
4855
|
"full"
|
|
4435
4856
|
]);
|
|
4436
|
-
const
|
|
4437
|
-
|
|
4438
|
-
|
|
4439
|
-
|
|
4440
|
-
"gradient"
|
|
4441
|
-
]).nullable().optional(),
|
|
4442
|
-
color: tokenOrCssColorValueSchema.nullable().optional(),
|
|
4443
|
-
gradient: z$1.string().nullable().optional(),
|
|
4444
|
-
opacity: z$1.number().min(0).max(1).nullable().optional()
|
|
4445
|
-
});
|
|
4446
|
-
const boxBackgroundSchema = z$1.object({
|
|
4447
|
-
type: z$1.enum([
|
|
4448
|
-
"color",
|
|
4449
|
-
"gradient",
|
|
4450
|
-
"image"
|
|
4451
|
-
]).optional(),
|
|
4452
|
-
contentOwner: z$1.literal(pageDesignEditorBackgroundOverrideOwner).optional(),
|
|
4453
|
-
color: tokenOrCssColorValueSchema.nullable().optional(),
|
|
4454
|
-
gradient: z$1.string().nullable().optional(),
|
|
4455
|
-
gradientPresetId: z$1.string().min(1).nullable().optional(),
|
|
4456
|
-
image: mediaSchema.nullable().optional(),
|
|
4457
|
-
objectFit: z$1.enum([
|
|
4458
|
-
"fill",
|
|
4459
|
-
"fit",
|
|
4460
|
-
"original",
|
|
4461
|
-
"custom"
|
|
4462
|
-
]).nullable().optional(),
|
|
4463
|
-
scale: z$1.string().nullable().optional(),
|
|
4464
|
-
position: z$1.string().nullable().optional(),
|
|
4465
|
-
opacity: z$1.number().min(0).max(1).nullable().optional(),
|
|
4466
|
-
motion: z$1.enum(["static", "fixed-frame"]).nullable().optional(),
|
|
4467
|
-
overlay: boxBackgroundOverlaySchema.nullable().optional(),
|
|
4468
|
-
textColor: tokenOrCssColorValueSchema.nullable().optional(),
|
|
4469
|
-
headingColor: tokenOrCssColorValueSchema.nullable().optional(),
|
|
4470
|
-
linkColor: tokenOrCssColorValueSchema.nullable().optional(),
|
|
4471
|
-
supportingColor: tokenOrCssColorValueSchema.nullable().optional()
|
|
4857
|
+
const noHeadingDecorationSchema = z.object({ family: z.literal("none") });
|
|
4858
|
+
const visibleHeadingDecorationSchema = z.object({
|
|
4859
|
+
family: z.enum(visibleHeadingDecorationFamilyValues),
|
|
4860
|
+
colorToken: z.enum(headingDecorationColorTokenValues).optional()
|
|
4472
4861
|
});
|
|
4473
|
-
const
|
|
4474
|
-
const
|
|
4475
|
-
|
|
4476
|
-
|
|
4862
|
+
const headingDecorationSchema = z.union([noHeadingDecorationSchema, visibleHeadingDecorationSchema]);
|
|
4863
|
+
const headingDecorationOverrideSchema = z.union([z.enum(headingDecorationOverrideValues), z.literal("on").transform(() => "site-default")]);
|
|
4864
|
+
const accordionIconTreatmentSchema = z.object({
|
|
4865
|
+
iconSet: z.enum(accordionIconSetValues),
|
|
4866
|
+
colorToken: z.enum(accordionIconColorTokenValues),
|
|
4867
|
+
openColorToken: z.enum(accordionIconColorTokenValues).optional(),
|
|
4868
|
+
motion: z.enum(accordionIconMotionValues)
|
|
4477
4869
|
});
|
|
4478
|
-
const
|
|
4479
|
-
const headingDecorationOverrideSchema = z$1.union([z$1.enum(headingDecorationOverrideValues), z$1.literal("on").transform(() => "site-default")]);
|
|
4480
|
-
const accordionIconTreatmentSchema = z$1.object({
|
|
4481
|
-
iconSet: z$1.enum(accordionIconSetValues),
|
|
4482
|
-
colorToken: z$1.enum(accordionIconColorTokenValues),
|
|
4483
|
-
openColorToken: z$1.enum(accordionIconColorTokenValues).optional(),
|
|
4484
|
-
motion: z$1.enum(accordionIconMotionValues)
|
|
4485
|
-
});
|
|
4486
|
-
const sectionStylesOverrideSchema = z$1.object({
|
|
4870
|
+
const sectionStylesOverrideSchema = z.object({
|
|
4487
4871
|
background: boxBackgroundSchema.nullable().optional(),
|
|
4488
4872
|
spacing: semanticSpacingSchema.nullable().optional(),
|
|
4489
|
-
minHeight: z
|
|
4873
|
+
minHeight: z.enum([
|
|
4490
4874
|
"none",
|
|
4491
4875
|
"banner",
|
|
4492
4876
|
"hero",
|
|
4493
4877
|
"immersive"
|
|
4494
4878
|
]).nullable().optional(),
|
|
4495
|
-
tileTreatment: z
|
|
4496
|
-
eventListTreatment: z
|
|
4497
|
-
eyebrowTreatment: z
|
|
4879
|
+
tileTreatment: z.enum(tileTreatmentValues).nullable().optional(),
|
|
4880
|
+
eventListTreatment: z.enum(eventListTreatmentValues).nullable().optional(),
|
|
4881
|
+
eyebrowTreatment: z.enum(eyebrowTreatmentValues).nullable().optional(),
|
|
4498
4882
|
headingDecoration: headingDecorationSchema.nullable().optional(),
|
|
4499
4883
|
headingDecorationOverride: headingDecorationOverrideSchema.nullable().optional(),
|
|
4500
4884
|
accordionIconTreatment: accordionIconTreatmentSchema.nullable().optional()
|
|
4501
4885
|
});
|
|
4502
|
-
const containerStylesOverrideSchema = z
|
|
4886
|
+
const containerStylesOverrideSchema = z.object({
|
|
4503
4887
|
background: boxBackgroundSchema.nullable().optional(),
|
|
4504
4888
|
spacing: semanticSpacingSchema.nullable().optional(),
|
|
4505
|
-
raised: z
|
|
4889
|
+
raised: z.boolean().nullable().optional(),
|
|
4506
4890
|
rounded: boxRoundedSchema.nullable().optional(),
|
|
4507
|
-
fullWidth: z
|
|
4891
|
+
fullWidth: z.boolean().nullable().optional()
|
|
4508
4892
|
});
|
|
4509
|
-
const cardBorderOverrideSchema = z
|
|
4510
|
-
enabled: z
|
|
4511
|
-
width: z
|
|
4893
|
+
const cardBorderOverrideSchema = z.object({
|
|
4894
|
+
enabled: z.boolean().nullable().optional(),
|
|
4895
|
+
width: z.enum([
|
|
4512
4896
|
"none",
|
|
4513
4897
|
"1",
|
|
4514
4898
|
"2",
|
|
@@ -4516,32 +4900,25 @@ const cardBorderOverrideSchema = z$1.object({
|
|
|
4516
4900
|
]).nullable().optional(),
|
|
4517
4901
|
colorToken: themeColorTokenSchema.nullable().optional()
|
|
4518
4902
|
});
|
|
4519
|
-
const cardStylesOverrideSchema = z
|
|
4903
|
+
const cardStylesOverrideSchema = z.object({
|
|
4520
4904
|
background: boxBackgroundSchema.nullable().optional(),
|
|
4521
4905
|
border: cardBorderOverrideSchema.nullable().optional(),
|
|
4522
4906
|
spacing: semanticSpacingSchema.nullable().optional(),
|
|
4523
|
-
raised: z
|
|
4907
|
+
raised: z.boolean().nullable().optional(),
|
|
4524
4908
|
rounded: boxRoundedSchema.nullable().optional(),
|
|
4525
|
-
|
|
4526
|
-
"accent-quote",
|
|
4527
|
-
"editorial-rule",
|
|
4528
|
-
"soft-panel",
|
|
4529
|
-
"editorial-serif-quote",
|
|
4530
|
-
"editorial-open",
|
|
4531
|
-
"color-blocked"
|
|
4532
|
-
]).nullable().optional(),
|
|
4909
|
+
role: cardRoleSchema.nullable().optional(),
|
|
4533
4910
|
cardVariant: boxStylesCardVariantSchema.nullable().optional()
|
|
4534
4911
|
});
|
|
4535
|
-
const blockStyleOverridesSchema = z
|
|
4912
|
+
const blockStyleOverridesSchema = z.object({
|
|
4536
4913
|
sectionStyles: sectionStylesOverrideSchema.nullable().optional(),
|
|
4537
4914
|
containerStyles: containerStylesOverrideSchema.nullable().optional(),
|
|
4538
4915
|
cardStyles: cardStylesOverrideSchema.nullable().optional()
|
|
4539
4916
|
});
|
|
4540
|
-
const blockThemeOverrideSchema = z
|
|
4541
|
-
typography: z
|
|
4917
|
+
const blockThemeOverrideSchema = z.object({
|
|
4918
|
+
typography: z.object({ proseLinkStyle: proseLinkStyleSchema.optional() }).optional(),
|
|
4542
4919
|
styles: blockStyleOverridesSchema.optional()
|
|
4543
4920
|
});
|
|
4544
|
-
const typographyScaleSchema = z
|
|
4921
|
+
const typographyScaleSchema = z.enum([
|
|
4545
4922
|
"compact",
|
|
4546
4923
|
"balanced",
|
|
4547
4924
|
"spacious",
|
|
@@ -4549,31 +4926,31 @@ const typographyScaleSchema = z$1.enum([
|
|
|
4549
4926
|
"majorThird",
|
|
4550
4927
|
"perfectFourth"
|
|
4551
4928
|
]);
|
|
4552
|
-
const eyebrowTypographyStyleSchema = z
|
|
4553
|
-
family: z
|
|
4554
|
-
size: z
|
|
4929
|
+
const eyebrowTypographyStyleSchema = z.object({
|
|
4930
|
+
family: z.string().min(1),
|
|
4931
|
+
size: z.enum([
|
|
4555
4932
|
"sm",
|
|
4556
4933
|
"md",
|
|
4557
4934
|
"lg"
|
|
4558
4935
|
]).optional(),
|
|
4559
|
-
weight: z
|
|
4936
|
+
weight: z.enum([
|
|
4560
4937
|
"light",
|
|
4561
4938
|
"regular",
|
|
4562
4939
|
"medium",
|
|
4563
4940
|
"semibold",
|
|
4564
4941
|
"bold"
|
|
4565
4942
|
]).optional(),
|
|
4566
|
-
letterSpacing: z
|
|
4943
|
+
letterSpacing: z.enum([
|
|
4567
4944
|
"tight",
|
|
4568
4945
|
"normal",
|
|
4569
4946
|
"loose",
|
|
4570
4947
|
"wide"
|
|
4571
4948
|
]).optional(),
|
|
4572
|
-
case: z
|
|
4949
|
+
case: z.enum(["uppercase", "normal"]).optional()
|
|
4573
4950
|
});
|
|
4574
|
-
const typographySchema = z
|
|
4951
|
+
const typographySchema = z.object({
|
|
4575
4952
|
body: bodyTypographyStyleSchema,
|
|
4576
|
-
headings: z
|
|
4953
|
+
headings: z.object({
|
|
4577
4954
|
default: headingTypographyStyleSchema,
|
|
4578
4955
|
h1: headingTypographyOverridesSchema,
|
|
4579
4956
|
h2: headingTypographyOverridesSchema,
|
|
@@ -4586,105 +4963,75 @@ const typographySchema = z$1.object({
|
|
|
4586
4963
|
proseLinkStyle: proseLinkStyleSchema.optional(),
|
|
4587
4964
|
eyebrow: eyebrowTypographyStyleSchema.optional()
|
|
4588
4965
|
});
|
|
4589
|
-
const spaceSchema = z
|
|
4966
|
+
const spaceSchema = z.enum([
|
|
4590
4967
|
"comfortable",
|
|
4591
4968
|
"standard",
|
|
4592
4969
|
"dense"
|
|
4593
4970
|
]);
|
|
4594
|
-
const corners = z
|
|
4971
|
+
const corners = z.enum([
|
|
4595
4972
|
"square",
|
|
4596
4973
|
"soft",
|
|
4597
4974
|
"rounded",
|
|
4598
4975
|
"pill"
|
|
4599
4976
|
]);
|
|
4600
|
-
const shadow = z
|
|
4601
|
-
elevation: z
|
|
4977
|
+
const shadow = z.object({
|
|
4978
|
+
elevation: z.enum([
|
|
4602
4979
|
"none",
|
|
4603
4980
|
"low",
|
|
4604
4981
|
"medium",
|
|
4605
4982
|
"high"
|
|
4606
4983
|
]),
|
|
4607
|
-
softness: z
|
|
4984
|
+
softness: z.enum([
|
|
4608
4985
|
"crisp",
|
|
4609
4986
|
"soft",
|
|
4610
4987
|
"hard"
|
|
4611
4988
|
]).nullable(),
|
|
4612
|
-
position: z
|
|
4989
|
+
position: z.enum(["bottom", "bottom-right"]).default("bottom"),
|
|
4613
4990
|
colorToken: themeColorTokenSchema.optional()
|
|
4614
4991
|
});
|
|
4615
|
-
const border = z
|
|
4616
|
-
width: z
|
|
4992
|
+
const border = z.object({
|
|
4993
|
+
width: z.enum([
|
|
4617
4994
|
"none",
|
|
4618
4995
|
"hairline",
|
|
4619
4996
|
"thin",
|
|
4620
4997
|
"thick"
|
|
4621
4998
|
]),
|
|
4622
|
-
style: z
|
|
4999
|
+
style: z.enum(["solid", "dashed"])
|
|
4623
5000
|
});
|
|
4624
|
-
const motion = z
|
|
4625
|
-
level: z
|
|
5001
|
+
const motion = z.object({
|
|
5002
|
+
level: z.enum([
|
|
4626
5003
|
"off",
|
|
4627
5004
|
"low",
|
|
4628
5005
|
"medium",
|
|
4629
5006
|
"high"
|
|
4630
5007
|
]),
|
|
4631
|
-
easing: z
|
|
5008
|
+
easing: z.enum([
|
|
4632
5009
|
"standard",
|
|
4633
5010
|
"snappy",
|
|
4634
5011
|
"gentle"
|
|
4635
5012
|
]).nullable()
|
|
4636
5013
|
});
|
|
4637
|
-
z
|
|
4638
|
-
z
|
|
4639
|
-
elevation: z$1.enum([
|
|
4640
|
-
"none",
|
|
4641
|
-
"low",
|
|
4642
|
-
"medium",
|
|
4643
|
-
"high"
|
|
4644
|
-
]),
|
|
4645
|
-
border: z$1.enum([
|
|
4646
|
-
"none",
|
|
4647
|
-
"subtle",
|
|
4648
|
-
"defined"
|
|
4649
|
-
]),
|
|
5014
|
+
z.object({ shape: corners });
|
|
5015
|
+
const inputStyle = z.object({
|
|
4650
5016
|
shape: corners,
|
|
4651
|
-
|
|
4652
|
-
"plain",
|
|
4653
|
-
"accentBar",
|
|
4654
|
-
"subtleBg"
|
|
4655
|
-
]).nullable(),
|
|
4656
|
-
mediaTreatment: z$1.enum([
|
|
4657
|
-
"square",
|
|
4658
|
-
"rounded",
|
|
4659
|
-
"bleed"
|
|
4660
|
-
]).nullable()
|
|
4661
|
-
});
|
|
4662
|
-
const inputStyle = z$1.object({
|
|
4663
|
-
shape: corners,
|
|
4664
|
-
border: z$1.enum([
|
|
5017
|
+
border: z.enum([
|
|
4665
5018
|
"subtle",
|
|
4666
5019
|
"defined",
|
|
4667
5020
|
"underline"
|
|
4668
5021
|
]),
|
|
4669
|
-
focus: z
|
|
5022
|
+
focus: z.enum([
|
|
4670
5023
|
"glow",
|
|
4671
5024
|
"ring",
|
|
4672
5025
|
"underline"
|
|
4673
5026
|
]),
|
|
4674
|
-
label: z
|
|
5027
|
+
label: z.enum(["inside", "above"])
|
|
4675
5028
|
});
|
|
4676
|
-
const
|
|
4677
|
-
"classic",
|
|
4678
|
-
"centered",
|
|
4679
|
-
"transparent",
|
|
4680
|
-
"floating"
|
|
4681
|
-
]);
|
|
4682
|
-
const headerPositioning = z$1.enum([
|
|
5029
|
+
const headerPositioning = z.enum([
|
|
4683
5030
|
"static",
|
|
4684
5031
|
"sticky",
|
|
4685
5032
|
"fixed"
|
|
4686
5033
|
]);
|
|
4687
|
-
const headerNavStyle = z
|
|
5034
|
+
const headerNavStyle = z.enum([
|
|
4688
5035
|
"minimal",
|
|
4689
5036
|
"underline",
|
|
4690
5037
|
"underline-grow",
|
|
@@ -4693,59 +5040,59 @@ const headerNavStyle = z$1.enum([
|
|
|
4693
5040
|
"frosted",
|
|
4694
5041
|
"solid"
|
|
4695
5042
|
]);
|
|
4696
|
-
const navFontWeight = z
|
|
5043
|
+
const navFontWeight = z.enum([
|
|
4697
5044
|
"regular",
|
|
4698
5045
|
"medium",
|
|
4699
5046
|
"semibold",
|
|
4700
5047
|
"bold"
|
|
4701
5048
|
]);
|
|
4702
|
-
const headerMaxWidth = z
|
|
4703
|
-
const headerBarFrame = z
|
|
4704
|
-
const headerBorderSchema = componentBorderSchema.extend({ position: z
|
|
5049
|
+
const headerMaxWidth = z.enum(["container", "full"]);
|
|
5050
|
+
const headerBarFrame = z.enum(["full-bleed", "inset-shell"]);
|
|
5051
|
+
const headerBorderSchema = componentBorderSchema.extend({ position: z.enum([
|
|
4705
5052
|
"bottom",
|
|
4706
5053
|
"top",
|
|
4707
5054
|
"both",
|
|
4708
5055
|
"none"
|
|
4709
5056
|
]).default("bottom") }).optional();
|
|
4710
|
-
const logoStyleSchema = z
|
|
4711
|
-
fontFamily: z
|
|
4712
|
-
letterSpacing: z
|
|
5057
|
+
const logoStyleSchema = z.object({
|
|
5058
|
+
fontFamily: z.enum(["heading", "body"]).default("heading"),
|
|
5059
|
+
letterSpacing: z.enum([
|
|
4713
5060
|
"normal",
|
|
4714
5061
|
"wide",
|
|
4715
5062
|
"wider",
|
|
4716
5063
|
"widest"
|
|
4717
5064
|
]).default("normal"),
|
|
4718
|
-
gradient: z
|
|
4719
|
-
brandDisplay: z
|
|
4720
|
-
size: z
|
|
4721
|
-
accommodation: z
|
|
5065
|
+
gradient: z.boolean().default(false),
|
|
5066
|
+
brandDisplay: z.enum(brandDisplayModeValues).optional(),
|
|
5067
|
+
size: z.enum(logoSizePolicyValues).optional(),
|
|
5068
|
+
accommodation: z.enum(logoAccommodationPatternValues).optional()
|
|
4722
5069
|
}).optional();
|
|
4723
|
-
const headerLogoTextSchema = z
|
|
4724
|
-
mobileWrapLines: z
|
|
4725
|
-
mobileMaxWidth: z
|
|
5070
|
+
const headerLogoTextSchema = z.object({
|
|
5071
|
+
mobileWrapLines: z.union([z.literal(1), z.literal(2)]).optional(),
|
|
5072
|
+
mobileMaxWidth: z.enum([
|
|
4726
5073
|
"xs",
|
|
4727
5074
|
"sm",
|
|
4728
5075
|
"md"
|
|
4729
5076
|
]).optional(),
|
|
4730
|
-
hideOnShrink: z
|
|
5077
|
+
hideOnShrink: z.boolean().optional()
|
|
4731
5078
|
}).optional();
|
|
4732
|
-
const navEffectsSchema = z
|
|
4733
|
-
underlineGradient: z
|
|
4734
|
-
glow: z
|
|
4735
|
-
glowColor: z
|
|
4736
|
-
neumorphic: z
|
|
5079
|
+
const navEffectsSchema = z.object({
|
|
5080
|
+
underlineGradient: z.boolean().default(false),
|
|
5081
|
+
glow: z.boolean().default(false),
|
|
5082
|
+
glowColor: z.string().optional(),
|
|
5083
|
+
neumorphic: z.boolean().default(false)
|
|
4737
5084
|
}).optional();
|
|
4738
|
-
const dropdownStyleSchema = z
|
|
5085
|
+
const dropdownStyleSchema = z.object({
|
|
4739
5086
|
background: themeColorTokenSchema.default("surface"),
|
|
4740
5087
|
textColor: themeColorTokenSchema.default("text"),
|
|
4741
5088
|
borderColor: themeColorTokenSchema.nullable().default("border"),
|
|
4742
|
-
shadow: z
|
|
5089
|
+
shadow: z.enum([
|
|
4743
5090
|
"none",
|
|
4744
5091
|
"sm",
|
|
4745
5092
|
"md",
|
|
4746
5093
|
"lg"
|
|
4747
5094
|
]).default("md"),
|
|
4748
|
-
borderRadius: z
|
|
5095
|
+
borderRadius: z.enum([
|
|
4749
5096
|
"none",
|
|
4750
5097
|
"sm",
|
|
4751
5098
|
"md",
|
|
@@ -4753,23 +5100,23 @@ const dropdownStyleSchema = z$1.object({
|
|
|
4753
5100
|
]).default("md"),
|
|
4754
5101
|
hoverBackground: themeColorTokenSchema.nullable().optional(),
|
|
4755
5102
|
hoverTextColor: themeColorTokenSchema.nullable().optional(),
|
|
4756
|
-
textTransform: z
|
|
5103
|
+
textTransform: z.enum([
|
|
4757
5104
|
"none",
|
|
4758
5105
|
"uppercase",
|
|
4759
5106
|
"capitalize"
|
|
4760
5107
|
]).default("none"),
|
|
4761
|
-
letterSpacing: z
|
|
5108
|
+
letterSpacing: z.enum([
|
|
4762
5109
|
"normal",
|
|
4763
5110
|
"wide",
|
|
4764
5111
|
"wider"
|
|
4765
5112
|
]).default("normal"),
|
|
4766
|
-
fontWeight: z
|
|
5113
|
+
fontWeight: z.enum([
|
|
4767
5114
|
"regular",
|
|
4768
5115
|
"medium",
|
|
4769
5116
|
"semibold",
|
|
4770
5117
|
"bold"
|
|
4771
5118
|
]).optional(),
|
|
4772
|
-
textSize: z
|
|
5119
|
+
textSize: z.enum([
|
|
4773
5120
|
"xs",
|
|
4774
5121
|
"sm",
|
|
4775
5122
|
"base",
|
|
@@ -4780,7 +5127,7 @@ const dropdownStyleSchema = z$1.object({
|
|
|
4780
5127
|
* CTA button gap (left margin) for desktop header.
|
|
4781
5128
|
* Controls the spacing between nav links and the CTA button.
|
|
4782
5129
|
*/
|
|
4783
|
-
const headerCtaGapSchema = z
|
|
5130
|
+
const headerCtaGapSchema = z.enum([
|
|
4784
5131
|
"none",
|
|
4785
5132
|
"tight",
|
|
4786
5133
|
"compact",
|
|
@@ -4788,7 +5135,7 @@ const headerCtaGapSchema = z$1.enum([
|
|
|
4788
5135
|
"relaxed",
|
|
4789
5136
|
"spacious"
|
|
4790
5137
|
]);
|
|
4791
|
-
const headerCtaTreatmentSchema = z
|
|
5138
|
+
const headerCtaTreatmentSchema = z.enum([
|
|
4792
5139
|
"default",
|
|
4793
5140
|
"primary",
|
|
4794
5141
|
"secondary",
|
|
@@ -4796,35 +5143,35 @@ const headerCtaTreatmentSchema = z$1.enum([
|
|
|
4796
5143
|
"outline",
|
|
4797
5144
|
"ghost"
|
|
4798
5145
|
]);
|
|
4799
|
-
const navContainerSchema = z
|
|
4800
|
-
type: z
|
|
5146
|
+
const navContainerSchema = z.object({
|
|
5147
|
+
type: z.enum([
|
|
4801
5148
|
"none",
|
|
4802
5149
|
"pill",
|
|
4803
5150
|
"glass"
|
|
4804
5151
|
]).default("none"),
|
|
4805
|
-
tint: z
|
|
4806
|
-
opacity: z
|
|
5152
|
+
tint: z.string().nullable().optional(),
|
|
5153
|
+
opacity: z.number().min(0).max(1).default(.15)
|
|
4807
5154
|
}).default({
|
|
4808
5155
|
type: "none",
|
|
4809
5156
|
tint: null,
|
|
4810
5157
|
opacity: .15
|
|
4811
5158
|
});
|
|
4812
|
-
const headerBackgroundSchema = z
|
|
4813
|
-
type: z
|
|
5159
|
+
const headerBackgroundSchema = z.object({
|
|
5160
|
+
type: z.enum([
|
|
4814
5161
|
"color",
|
|
4815
5162
|
"gradient",
|
|
4816
5163
|
"image"
|
|
4817
5164
|
]),
|
|
4818
|
-
contentOwner: z
|
|
5165
|
+
contentOwner: z.literal(siteChromeBackgroundOverrideOwner).optional(),
|
|
4819
5166
|
color: tokenOrCssColorValueSchema.nullable().optional(),
|
|
4820
5167
|
gradient: gradientConfigSchema.nullable().optional(),
|
|
4821
5168
|
image: mediaSchema.nullable().optional(),
|
|
4822
5169
|
textColor: tokenOrCssColorValueSchema.nullable().optional()
|
|
4823
5170
|
});
|
|
4824
|
-
const headerSchema = z
|
|
4825
|
-
variant:
|
|
5171
|
+
const headerSchema = z.object({
|
|
5172
|
+
variant: headerVariantWithLegacyAliasSchema,
|
|
4826
5173
|
positioning: headerPositioning,
|
|
4827
|
-
shrinkOnScroll: z
|
|
5174
|
+
shrinkOnScroll: z.boolean(),
|
|
4828
5175
|
maxWidth: headerMaxWidth,
|
|
4829
5176
|
barFrame: headerBarFrame.optional(),
|
|
4830
5177
|
scrollTreatment: headerScrollTreatmentSchema,
|
|
@@ -4837,11 +5184,10 @@ const headerSchema = z$1.object({
|
|
|
4837
5184
|
navStyle: headerNavStyle,
|
|
4838
5185
|
navColor: themeColorTokenSchema.nullable().optional(),
|
|
4839
5186
|
navWeight: navFontWeight.default("medium"),
|
|
4840
|
-
navFontRole: z
|
|
4841
|
-
navTypography: z$1.enum(["body", "heading"]).optional(),
|
|
5187
|
+
navFontRole: z.enum(["body", "heading"]).optional(),
|
|
4842
5188
|
navTextSize: navLinkStyleSchema.shape.textSize,
|
|
4843
5189
|
interactionPalette: headerInteractionPaletteSchema.optional(),
|
|
4844
|
-
navPlacement: z
|
|
5190
|
+
navPlacement: z.enum(["end", "center"]).optional(),
|
|
4845
5191
|
container: headerContainerSchema,
|
|
4846
5192
|
border: headerBorderSchema,
|
|
4847
5193
|
shadow: componentShadowSchema.optional(),
|
|
@@ -4852,47 +5198,33 @@ const headerSchema = z$1.object({
|
|
|
4852
5198
|
navLinkStyle: navLinkStyleSchema.optional(),
|
|
4853
5199
|
ctaGap: headerCtaGapSchema.optional(),
|
|
4854
5200
|
ctaTreatment: headerCtaTreatmentSchema.optional(),
|
|
4855
|
-
ctaVariant: z
|
|
5201
|
+
ctaVariant: z.string().min(1).optional(),
|
|
4856
5202
|
dropdownStyle: dropdownStyleSchema
|
|
4857
|
-
})
|
|
4858
|
-
|
|
4859
|
-
* Normalises the legacy `navTypography` font-role alias into the canonical
|
|
4860
|
-
* `navFontRole` field so persisted themes migrate at the parse boundary without
|
|
4861
|
-
* a data migration. `navFontRole` always wins when both are present; the legacy
|
|
4862
|
-
* field is dropped so we never carry a dual write forward.
|
|
4863
|
-
*/
|
|
4864
|
-
function normaliseHeaderNavFontRole(header) {
|
|
4865
|
-
if (header.navTypography === void 0) return header;
|
|
4866
|
-
const { navTypography, ...rest } = header;
|
|
4867
|
-
return header.navFontRole === void 0 ? {
|
|
4868
|
-
...rest,
|
|
4869
|
-
navFontRole: navTypography
|
|
4870
|
-
} : rest;
|
|
4871
|
-
}
|
|
4872
|
-
const footerVariant = z$1.enum([
|
|
5203
|
+
});
|
|
5204
|
+
const footerVariant = z.enum([
|
|
4873
5205
|
"simple",
|
|
4874
5206
|
"columns",
|
|
4875
5207
|
"split"
|
|
4876
5208
|
]);
|
|
4877
|
-
const footerMaxWidth = z
|
|
4878
|
-
const footerMode = z
|
|
5209
|
+
const footerMaxWidth = z.enum(["container", "full"]);
|
|
5210
|
+
const footerMode = z.enum([
|
|
4879
5211
|
"default",
|
|
4880
5212
|
"blocks",
|
|
4881
5213
|
"default+blocks",
|
|
4882
5214
|
"none"
|
|
4883
5215
|
]);
|
|
4884
|
-
const footerNavLayoutMode = z
|
|
5216
|
+
const footerNavLayoutMode = z.enum([
|
|
4885
5217
|
"stack",
|
|
4886
5218
|
"inline",
|
|
4887
5219
|
"inline-wrap"
|
|
4888
5220
|
]);
|
|
4889
|
-
const footerNavLayoutAlign = z
|
|
5221
|
+
const footerNavLayoutAlign = z.enum([
|
|
4890
5222
|
"start",
|
|
4891
5223
|
"center",
|
|
4892
5224
|
"end",
|
|
4893
5225
|
"space-between"
|
|
4894
5226
|
]);
|
|
4895
|
-
const footerSpacing = z
|
|
5227
|
+
const footerSpacing = z.enum([
|
|
4896
5228
|
"none",
|
|
4897
5229
|
"tight",
|
|
4898
5230
|
"compact",
|
|
@@ -4900,45 +5232,45 @@ const footerSpacing = z$1.enum([
|
|
|
4900
5232
|
"relaxed",
|
|
4901
5233
|
"spacious"
|
|
4902
5234
|
]);
|
|
4903
|
-
const footerLogoPlacement = z
|
|
5235
|
+
const footerLogoPlacement = z.enum([
|
|
4904
5236
|
"left",
|
|
4905
5237
|
"right",
|
|
4906
5238
|
"above",
|
|
4907
5239
|
"below"
|
|
4908
5240
|
]);
|
|
4909
|
-
const footerLogoSize = z
|
|
5241
|
+
const footerLogoSize = z.enum([
|
|
4910
5242
|
"sm",
|
|
4911
5243
|
"md",
|
|
4912
5244
|
"lg",
|
|
4913
5245
|
"xl"
|
|
4914
5246
|
]);
|
|
4915
|
-
const footerLogoMaxHeight = z
|
|
5247
|
+
const footerLogoMaxHeight = z.enum([
|
|
4916
5248
|
"sm",
|
|
4917
5249
|
"md",
|
|
4918
5250
|
"lg",
|
|
4919
5251
|
"xl"
|
|
4920
5252
|
]);
|
|
4921
|
-
const footerBottomTextLinkStyleSchema = z
|
|
5253
|
+
const footerBottomTextLinkStyleSchema = z.object({
|
|
4922
5254
|
colorToken: themeColorTokenSchema.optional(),
|
|
4923
5255
|
hoverColorToken: themeColorTokenSchema.nullable().optional(),
|
|
4924
5256
|
decorationColorToken: themeColorTokenSchema.nullable().optional(),
|
|
4925
|
-
underline: z
|
|
5257
|
+
underline: z.boolean().optional()
|
|
4926
5258
|
});
|
|
4927
|
-
const footerBottomBarSchema = z
|
|
4928
|
-
enabled: z
|
|
4929
|
-
fullBleed: z
|
|
5259
|
+
const footerBottomBarSchema = z.object({
|
|
5260
|
+
enabled: z.boolean().optional(),
|
|
5261
|
+
fullBleed: z.boolean().optional(),
|
|
4930
5262
|
background: headerBackgroundSchema.optional(),
|
|
4931
5263
|
textColor: themeColorTokenSchema.nullable().optional(),
|
|
4932
|
-
textAlign: z
|
|
5264
|
+
textAlign: z.enum([
|
|
4933
5265
|
"left",
|
|
4934
5266
|
"center",
|
|
4935
5267
|
"right"
|
|
4936
5268
|
]).optional(),
|
|
4937
5269
|
paddingY: footerSpacing.optional(),
|
|
4938
5270
|
paddingX: footerSpacing.optional(),
|
|
4939
|
-
borderTop: z
|
|
5271
|
+
borderTop: z.object({
|
|
4940
5272
|
colorToken: themeColorTokenSchema.nullable().optional(),
|
|
4941
|
-
width: z
|
|
5273
|
+
width: z.enum([
|
|
4942
5274
|
"none",
|
|
4943
5275
|
"thin",
|
|
4944
5276
|
"medium",
|
|
@@ -4946,26 +5278,26 @@ const footerBottomBarSchema = z$1.object({
|
|
|
4946
5278
|
]).optional()
|
|
4947
5279
|
}).optional()
|
|
4948
5280
|
});
|
|
4949
|
-
const footerNavLayoutSchema = z
|
|
5281
|
+
const footerNavLayoutSchema = z.object({
|
|
4950
5282
|
layout: footerNavLayoutMode.optional(),
|
|
4951
5283
|
align: footerNavLayoutAlign.optional(),
|
|
4952
5284
|
gapX: footerSpacing.optional(),
|
|
4953
5285
|
gapY: footerSpacing.optional(),
|
|
4954
|
-
columns: z
|
|
5286
|
+
columns: z.number().int().min(1).max(6).optional()
|
|
4955
5287
|
});
|
|
4956
|
-
const footerLogoSchema = z
|
|
4957
|
-
showLogo: z
|
|
4958
|
-
showLogoText: z
|
|
5288
|
+
const footerLogoSchema = z.object({
|
|
5289
|
+
showLogo: z.boolean().default(true),
|
|
5290
|
+
showLogoText: z.boolean().optional(),
|
|
4959
5291
|
placement: footerLogoPlacement.optional(),
|
|
4960
5292
|
size: footerLogoSize.optional(),
|
|
4961
5293
|
maxHeight: footerLogoMaxHeight.optional(),
|
|
4962
|
-
align: z
|
|
5294
|
+
align: z.enum([
|
|
4963
5295
|
"start",
|
|
4964
5296
|
"center",
|
|
4965
5297
|
"end"
|
|
4966
5298
|
]).optional()
|
|
4967
5299
|
});
|
|
4968
|
-
const footerSchema = z
|
|
5300
|
+
const footerSchema = z.object({
|
|
4969
5301
|
/**
|
|
4970
5302
|
* SDK-only footer rendering mode.
|
|
4971
5303
|
*
|
|
@@ -4974,7 +5306,7 @@ const footerSchema = z$1.object({
|
|
|
4974
5306
|
mode: footerMode.optional(),
|
|
4975
5307
|
variant: footerVariant,
|
|
4976
5308
|
maxWidth: footerMaxWidth,
|
|
4977
|
-
showLogoText: z
|
|
5309
|
+
showLogoText: z.boolean().optional(),
|
|
4978
5310
|
background: headerBackgroundSchema.default({
|
|
4979
5311
|
type: "color",
|
|
4980
5312
|
color: "surface"
|
|
@@ -4988,18 +5320,18 @@ const footerSchema = z$1.object({
|
|
|
4988
5320
|
logo: footerLogoSchema.optional(),
|
|
4989
5321
|
bottomBar: footerBottomBarSchema.optional()
|
|
4990
5322
|
});
|
|
4991
|
-
const containerPaddingPresetSchema = z
|
|
5323
|
+
const containerPaddingPresetSchema = z.enum([
|
|
4992
5324
|
"tight",
|
|
4993
5325
|
"compact",
|
|
4994
5326
|
"default",
|
|
4995
5327
|
"relaxed"
|
|
4996
5328
|
]);
|
|
4997
|
-
const layoutSchema = z
|
|
5329
|
+
const layoutSchema = z.object({ containerPadding: z.object({
|
|
4998
5330
|
mobile: containerPaddingPresetSchema.optional(),
|
|
4999
5331
|
tablet: containerPaddingPresetSchema.optional(),
|
|
5000
5332
|
desktop: containerPaddingPresetSchema.optional()
|
|
5001
5333
|
}).optional() }).optional();
|
|
5002
|
-
const heroTypographySizeSchema = z
|
|
5334
|
+
const heroTypographySizeSchema = z.enum([
|
|
5003
5335
|
"sm",
|
|
5004
5336
|
"base",
|
|
5005
5337
|
"lg",
|
|
@@ -5011,19 +5343,19 @@ const heroTypographySizeSchema = z$1.enum([
|
|
|
5011
5343
|
"6xl",
|
|
5012
5344
|
"editorial"
|
|
5013
5345
|
]);
|
|
5014
|
-
const heroTypographyLineHeightSchema = z
|
|
5346
|
+
const heroTypographyLineHeightSchema = z.enum([
|
|
5015
5347
|
"tight",
|
|
5016
5348
|
"snug",
|
|
5017
5349
|
"normal",
|
|
5018
5350
|
"relaxed"
|
|
5019
5351
|
]);
|
|
5020
|
-
const heroResponsiveTypographySchema = z
|
|
5352
|
+
const heroResponsiveTypographySchema = z.object({
|
|
5021
5353
|
headlineSize: heroTypographySizeSchema.optional(),
|
|
5022
5354
|
headlineLineHeight: heroTypographyLineHeightSchema.optional(),
|
|
5023
5355
|
subheadlineSize: heroTypographySizeSchema.optional(),
|
|
5024
5356
|
subheadlineLineHeight: heroTypographyLineHeightSchema.optional()
|
|
5025
5357
|
});
|
|
5026
|
-
const heroTypographySchema = z
|
|
5358
|
+
const heroTypographySchema = z.object({
|
|
5027
5359
|
headlineSize: heroTypographySizeSchema.optional(),
|
|
5028
5360
|
headlineLineHeight: heroTypographyLineHeightSchema.optional(),
|
|
5029
5361
|
subheadlineSize: heroTypographySizeSchema.optional(),
|
|
@@ -5032,21 +5364,21 @@ const heroTypographySchema = z$1.object({
|
|
|
5032
5364
|
microHeadlineLineHeight: heroTypographyLineHeightSchema.optional(),
|
|
5033
5365
|
microSubheadlineSize: heroTypographySizeSchema.optional(),
|
|
5034
5366
|
microSubheadlineLineHeight: heroTypographyLineHeightSchema.optional(),
|
|
5035
|
-
responsive: z
|
|
5367
|
+
responsive: z.object({
|
|
5036
5368
|
tablet: heroResponsiveTypographySchema.optional(),
|
|
5037
5369
|
mobile: heroResponsiveTypographySchema.optional()
|
|
5038
5370
|
}).optional()
|
|
5039
5371
|
});
|
|
5040
|
-
const heroSchema = z
|
|
5041
|
-
const bodyTextIntroTypographySizeSchema = z
|
|
5042
|
-
const bodyTextSchema = z
|
|
5372
|
+
const heroSchema = z.object({ typography: heroTypographySchema.optional() }).optional();
|
|
5373
|
+
const bodyTextIntroTypographySizeSchema = z.enum(["default", "editorial"]);
|
|
5374
|
+
const bodyTextSchema = z.object({ intro: z.object({
|
|
5043
5375
|
paragraphSize: bodyTextIntroTypographySizeSchema.optional(),
|
|
5044
5376
|
headingSize: bodyTextIntroTypographySizeSchema.optional()
|
|
5045
5377
|
}).optional() }).optional();
|
|
5046
|
-
const gradientsSchema = z
|
|
5047
|
-
button: z
|
|
5048
|
-
hero: z
|
|
5049
|
-
background: z
|
|
5378
|
+
const gradientsSchema = z.object({
|
|
5379
|
+
button: z.string().min(1).nullable().optional(),
|
|
5380
|
+
hero: z.string().min(1).nullable().optional(),
|
|
5381
|
+
background: z.string().min(1).nullable().optional()
|
|
5050
5382
|
});
|
|
5051
5383
|
/**
|
|
5052
5384
|
* Testimonial quote-mark treatment, owned by the site style (analogous to the
|
|
@@ -5054,27 +5386,27 @@ const gradientsSchema = z$1.object({
|
|
|
5054
5386
|
* it. `none` hides the mark. The block renders the mark; the site style decides
|
|
5055
5387
|
* its character; a look may still hide it.
|
|
5056
5388
|
*/
|
|
5057
|
-
const testimonialQuoteTreatmentSchema = z
|
|
5058
|
-
style: z
|
|
5389
|
+
const testimonialQuoteTreatmentSchema = z.object({
|
|
5390
|
+
style: z.enum([
|
|
5059
5391
|
"serif-display",
|
|
5060
5392
|
"accent-glyph",
|
|
5061
5393
|
"none"
|
|
5062
5394
|
]),
|
|
5063
|
-
fontFamily: z
|
|
5064
|
-
scale: z
|
|
5395
|
+
fontFamily: z.enum(["heading", "body"]).optional(),
|
|
5396
|
+
scale: z.enum([
|
|
5065
5397
|
"sm",
|
|
5066
5398
|
"md",
|
|
5067
5399
|
"lg",
|
|
5068
5400
|
"xl"
|
|
5069
5401
|
]).optional(),
|
|
5070
5402
|
colorToken: themeColorTokenSchema.optional(),
|
|
5071
|
-
opacity: z
|
|
5403
|
+
opacity: z.number().min(0).max(1).optional()
|
|
5072
5404
|
});
|
|
5073
|
-
const themeSchema$1 = z
|
|
5074
|
-
name: z
|
|
5075
|
-
description: z
|
|
5076
|
-
rationale: z
|
|
5077
|
-
siteStyleId: z
|
|
5405
|
+
const themeSchema$1 = z.object({
|
|
5406
|
+
name: z.string().min(1).max(30),
|
|
5407
|
+
description: z.string().min(1).max(400),
|
|
5408
|
+
rationale: z.string().min(1).max(400),
|
|
5409
|
+
siteStyleId: z.string().min(1).transform((value) => asSiteStyleId(value)).optional(),
|
|
5078
5410
|
axes: axesSchema,
|
|
5079
5411
|
palette: paletteSchema,
|
|
5080
5412
|
typography: typographySchema,
|
|
@@ -5095,8 +5427,8 @@ const themeSchema$1 = z$1.object({
|
|
|
5095
5427
|
testimonialQuote: testimonialQuoteTreatmentSchema.optional(),
|
|
5096
5428
|
inputs: inputSystemSchema.optional(),
|
|
5097
5429
|
inputStyle: inputStyle.optional(),
|
|
5098
|
-
blockCustomVars: z
|
|
5099
|
-
blockOverrides: z
|
|
5430
|
+
blockCustomVars: z.record(z.string(), z.record(z.string(), z.string())).optional(),
|
|
5431
|
+
blockOverrides: z.record(z.string(), blockThemeOverrideSchema).optional(),
|
|
5100
5432
|
headingDecoration: headingDecorationSchema.optional(),
|
|
5101
5433
|
customCssRules: customCssRulesSchema,
|
|
5102
5434
|
blockCustomCssRules: blockCustomCssRulesSchema,
|
|
@@ -5126,11 +5458,11 @@ const themeSchema$1 = z$1.object({
|
|
|
5126
5458
|
* }
|
|
5127
5459
|
* ```
|
|
5128
5460
|
*/
|
|
5129
|
-
styleGroups: z
|
|
5461
|
+
styleGroups: z.record(z.string(), z.array(z.string())).optional()
|
|
5130
5462
|
});
|
|
5131
|
-
z
|
|
5132
|
-
message: z
|
|
5133
|
-
themes: z
|
|
5463
|
+
z.object({
|
|
5464
|
+
message: z.string().min(1),
|
|
5465
|
+
themes: z.array(themeSchema$1).length(3)
|
|
5134
5466
|
});
|
|
5135
5467
|
//#endregion
|
|
5136
5468
|
//#region src/theme/loader.ts
|