@riverbankcms/sdk 0.111.0 → 0.119.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{PreviewEditorSidebar-CTR6LUhN.mjs → PreviewEditorSidebar-C7TXFitV.mjs} +4 -4
- package/dist/{PreviewEditorUI-DZg15Zip.mjs → PreviewEditorUI-_1JIHTXS.mjs} +3 -3
- package/dist/{PreviewQueryProvider-kkmjklLG.mjs → PreviewQueryProvider-nKUT4TL-.mjs} +1 -1
- package/dist/{SdkPreviewModeRuntime-DeOTAFvR.mjs → SdkPreviewModeRuntime-CvJTVgWa.mjs} +2579 -34325
- package/dist/{SiteChromeCustomizeContext-DOSDLCiJ.mjs → SiteChromeCustomizeContext-66QfCbAS.mjs} +64625 -32791
- package/dist/_dts/ai/src/contracts/proposals.d.ts +5211 -639
- package/dist/_dts/ai/src/designer/themePatch.d.ts +1 -1
- package/dist/_dts/api/src/bookingAdjustments.d.ts +30 -36
- package/dist/_dts/api/src/bookingConfig.d.ts +26 -1
- package/dist/_dts/api/src/bookingRecords.d.ts +6 -74
- package/dist/_dts/api/src/bookingRefundOutcomes.d.ts +3 -3
- package/dist/_dts/api/src/contentRuntime.d.ts +5 -1
- package/dist/_dts/api/src/customerMembershipOutcomes.d.ts +4 -4
- package/dist/_dts/api/src/endpoints.d.ts +35 -0
- package/dist/_dts/api/src/event-presentation.d.ts +4 -0
- package/dist/_dts/api/src/index.d.ts +4 -4
- package/dist/_dts/api/src/navigation/dashboardBookingsNav.d.ts +4 -1
- package/dist/_dts/api/src/navigation/dashboardSettingsNav.d.ts +2 -2
- package/dist/_dts/api/src/sdk-event-upsert.d.ts +2 -2
- package/dist/_dts/api/src/sdkContracts.d.ts +85 -7
- package/dist/_dts/api/src/siteBanner.d.ts +8 -8
- package/dist/_dts/api/src/siteOperations.d.ts +1 -1
- package/dist/_dts/api/src/sitePlatformEndpoints.d.ts +32 -4
- package/dist/_dts/block-form/src/widgets/RichTextField/richTextFieldDefaults.d.ts +3 -12
- package/dist/_dts/block-form/src/widgets/RichTextField/richTextFieldSchema.d.ts +1 -5
- package/dist/_dts/blocks/src/bindings/index.d.ts +1 -10
- package/dist/_dts/blocks/src/index.d.ts +3 -6
- package/dist/_dts/blocks/src/primitives/content/primitives.d.ts +2 -2
- package/dist/_dts/blocks/src/system/blocks/body-text.d.ts +2 -2
- package/dist/_dts/blocks/src/system/blocks/events/recurring-schedule.d.ts +2 -2
- package/dist/_dts/blocks/src/system/blocks/events/shared/schemas.d.ts +2 -8
- package/dist/_dts/blocks/src/system/blocks/feature-card-icons.d.ts +2 -2
- package/dist/_dts/blocks/src/system/blocks/feature-cards.d.ts +3 -3
- package/dist/_dts/blocks/src/system/blocks/form.d.ts +2 -15
- package/dist/_dts/blocks/src/system/blocks/intro.d.ts +2 -2
- package/dist/_dts/blocks/src/system/blocks/media-text.d.ts +66 -66
- package/dist/_dts/blocks/src/system/blocks/newsletter-signup.d.ts +2 -16
- package/dist/_dts/blocks/src/system/blocks/site-footer.d.ts +0 -3
- package/dist/_dts/blocks/src/system/fragments/index.d.ts +0 -1
- package/dist/_dts/blocks/src/system/manifest/fieldValidation/index.d.ts +19 -2
- package/dist/_dts/blocks/src/system/manifest/richTextSchema.d.ts +8 -70
- package/dist/_dts/blocks/src/system/manifest/schema.d.ts +1 -0
- package/dist/_dts/blocks/src/system/manifest/validation.d.ts +6 -0
- package/dist/_dts/blocks/src/system/node/schema.d.ts +4 -4
- package/dist/_dts/blocks/src/system/runtime/nodes/basic.d.ts +1 -10
- package/dist/_dts/blocks/src/system/runtime/nodes/buttonAffordance.d.ts +5 -21
- package/dist/_dts/blocks/src/system/runtime/nodes/richText-coerce.d.ts +14 -2
- package/dist/_dts/blocks/src/system/transforms/typed.d.ts +1 -1
- package/dist/_dts/content-editor/src/controller/seedDraftBaselinesFromBlocks.d.ts +1 -1
- package/dist/_dts/content-editor/src/hooks/useBlockAutosave.d.ts +17 -1
- package/dist/_dts/content-editor/src/hooks/useDebouncedLatestSave.d.ts +1 -1
- package/dist/_dts/content-editor/src/hooks/useSimpleAutosave.d.ts +1 -1
- package/dist/_dts/content-editor/src/ui/editorSnapshot.d.ts +3 -2
- package/dist/_dts/content-editor/src/ui/editorUiStore.d.ts +2 -2
- package/dist/_dts/content-editor/src/ui/stores/autosaveStore.d.ts +1 -1
- package/dist/_dts/content-editor/src/ui/stores/types.d.ts +1 -1
- package/dist/_dts/content-model/src/content-types/builtins.d.ts +3 -15
- package/dist/_dts/content-model/src/content-types/entryValidation.d.ts +2 -0
- package/dist/_dts/content-model/src/content-types/schema.d.ts +1 -1
- package/dist/_dts/content-model/src/templates/defaults.d.ts +1 -21
- package/dist/_dts/core/src/editor-state.d.ts +14 -1
- package/dist/_dts/core/src/footer-composition.d.ts +2 -1
- package/dist/_dts/core/src/index.d.ts +1 -0
- package/dist/_dts/core/src/rich-text.d.ts +16 -0
- package/dist/_dts/db/src/generated/supabase/database.types.d.ts +189 -86
- package/dist/_dts/editor/src/index.d.ts +1 -1
- package/dist/_dts/editor/src/primitives/rich-text/utils.d.ts +3 -5
- package/dist/_dts/editor-blocks/src/BlockEditor.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/block-editor/BlockCard.d.ts +2 -1
- package/dist/_dts/editor-blocks/src/block-editor/BlockCardHeader.d.ts +2 -1
- package/dist/_dts/editor-blocks/src/block-editor/blockDraftBaselineSeed.d.ts +15 -0
- package/dist/_dts/editor-blocks/src/block-editor/hooks/useBlockBaselineSync.d.ts +3 -7
- package/dist/_dts/editor-blocks/src/block-editor/hooks/useBlockDuplication.d.ts +12 -0
- package/dist/_dts/editor-blocks/src/block-editor/types.d.ts +1 -0
- package/dist/_dts/editor-blocks/src/block-editor/utils.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/index.d.ts +6 -5
- package/dist/_dts/editor-blocks/src/widgets/rich-text/RichTextField.d.ts +2 -2
- package/dist/_dts/media-core/src/contentMediaAudit.d.ts +104 -0
- package/dist/_dts/media-core/src/contentMediaAuditFieldAdapter.d.ts +8 -0
- package/dist/_dts/media-core/src/contentMediaSnapshotAudit.d.ts +22 -0
- package/dist/_dts/media-core/src/index.d.ts +3 -1
- package/dist/_dts/sdk/src/cli/commands/event.d.ts +18 -1
- package/dist/_dts/sdk/src/cli/commands/push/execute/theme.d.ts +2 -16
- package/dist/_dts/sdk/src/cli/content/reader.d.ts +8 -5
- package/dist/_dts/sdk/src/client/management/events.d.ts +2 -1
- package/dist/_dts/sdk/src/client/management/index.d.ts +1 -1
- package/dist/_dts/sdk/src/client/management/types.d.ts +36 -9
- package/dist/_dts/sdk/src/config/typed-entries.d.ts +7 -7
- package/dist/_dts/sdk/src/config/validation.d.ts +7 -7
- package/dist/_dts/sdk/src/contracts/content.d.ts +5 -15
- package/dist/_dts/sdk/src/contracts/index.d.ts +1 -1
- package/dist/_dts/sdk/src/contracts/system-block-content.d.ts +12 -25
- package/dist/_dts/sdk/src/contracts/theme.d.ts +2 -18
- package/dist/_dts/sdk/src/manifest/passes/pass1-fields.d.ts +1 -1
- package/dist/_dts/sdk/src/manifest/three-pass-converter.d.ts +4 -4
- package/dist/_dts/sdk/src/rendering/helpers/bindings.d.ts +1 -2
- package/dist/_dts/sdk/src/rendering/helpers/index.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/islands/types.d.ts +2 -13
- package/dist/_dts/sdk/src/theme/index.d.ts +0 -29
- package/dist/_dts/sdk/src/version.d.ts +1 -1
- package/dist/_dts/site-commands/src/commands.d.ts +31 -18
- package/dist/_dts/theme-core/src/buttons/affordanceIcons.d.ts +2 -2
- package/dist/_dts/theme-core/src/buttons/core.d.ts +0 -1
- package/dist/_dts/theme-core/src/buttons/effectClassification.d.ts +22 -9
- package/dist/_dts/theme-core/src/buttons/effects/presets/background.d.ts +1 -2
- package/dist/_dts/theme-core/src/buttons/effects/presets/border.d.ts +1 -2
- package/dist/_dts/theme-core/src/buttons/effects/presets/overlay.d.ts +3 -1
- package/dist/_dts/theme-core/src/buttons/effects/presets/shadow.d.ts +2 -2
- package/dist/_dts/theme-core/src/buttons/effects/types.d.ts +8 -18
- package/dist/_dts/theme-core/src/buttons/generateButtonCss.d.ts +2 -2
- package/dist/_dts/theme-core/src/buttons/generateDefaultButtonSystem.d.ts +5 -5
- package/dist/_dts/theme-core/src/buttons/index.d.ts +1 -4
- package/dist/_dts/theme-core/src/buttons/parseThemeForPersistence.d.ts +36 -0
- package/dist/_dts/theme-core/src/buttons/types.d.ts +1638 -93
- package/dist/_dts/theme-core/src/cards/types.d.ts +13 -13
- package/dist/_dts/theme-core/src/mock-themes/all.d.ts +969 -69
- package/dist/_dts/theme-core/src/navigation/types.d.ts +2 -2
- package/dist/_dts/theme-core/src/recommend/generateThemes.d.ts +0 -1
- package/dist/_dts/theme-core/src/schema.d.ts +1100 -116
- package/dist/_dts/theme-core/src/site-styles/backgroundAppearance.d.ts +2 -2
- package/dist/_dts/theme-core/src/site-styles/designState.d.ts +14 -14
- package/dist/_dts/theme-core/src/site-styles/generatedSchemas.d.ts +2 -2
- package/dist/_dts/theme-core/src/site-styles/pageDesignIntent.d.ts +4 -4
- package/dist/_dts/theme-core/src/site-styles/previewCompiler.d.ts +6 -0
- package/dist/cli/index.mjs +5706 -4852
- package/dist/cli/init-docs/content/cli-reference.md +40 -1
- package/dist/cli/init-docs/content/content-management.md +6 -0
- package/dist/client/{DiscountCodeDisclosure-C4xvTBux.mjs → DiscountCodeDisclosure-DIWj-P9v.mjs} +1 -1
- package/dist/client/{EventCombined.client-Cr7G131j.mjs → EventCombined.client-De8YWBSr.mjs} +2 -2
- package/dist/client/{EventListing.client-CAjbseNy.mjs → EventListing.client-seHTjimY.mjs} +2 -2
- package/dist/client/{LeafletStaticMap-BMlWfwz3.mjs → LeafletStaticMap-BmQxFcJW.mjs} +1 -1
- package/dist/client/{MagicLinkForm-ChdFz96y.mjs → MagicLinkForm-OoJAIUIj.mjs} +1 -1
- package/dist/client/{StepIndicator-7D3GaBeM.mjs → StepIndicator-CiZ8kdPk.mjs} +2 -2
- package/dist/client/{accordion-D8JTs2Si.mjs → accordion-6lnN__XJ.mjs} +1 -1
- package/dist/client/{bookingForm-H3DCRBHs.mjs → bookingForm-5uyqhONU.mjs} +6 -6
- package/dist/client/bookings.mjs +2219 -527
- package/dist/client/{carousel-DMr_QWlz.mjs → carousel-Dtnifil_.mjs} +1 -1
- package/dist/client/{cart-DWMbfBdR.mjs → cart-5Tc5S7NV.mjs} +3 -3
- package/dist/client/{checkout-zmfdkXLx.mjs → checkout-CYKKN5Hr.mjs} +3 -3
- package/dist/client/client.mjs +2498 -2384
- package/dist/client/{colorTokenParts-FSS3al6l.mjs → colorStyles-BWpj_h4C.mjs} +88 -1
- package/dist/client/{courseRegistration-Z_mn18jy.mjs → courseRegistration-CxCBybB4.mjs} +6 -6
- package/dist/client/{eventCalendar-CYp0YJGF.mjs → eventCalendar-Xj2jZS9X.mjs} +4 -4
- package/dist/client/{eventCombined-rKyYZUa9.mjs → eventCombined-CgcMoOgM.mjs} +2 -2
- package/dist/client/{eventDetails-X0ZaUuMj.mjs → eventDetails-CEAH8Edc.mjs} +3 -3
- package/dist/client/{eventListing-W1SuL7EP.mjs → eventListing-qyPVQ0wP.mjs} +2 -2
- package/dist/client/{eventRegistration-ClWricui.mjs → eventRegistration-DDu79CtL.mjs} +6 -6
- package/dist/client/{form--eKPwAAD.mjs → form-Bc7JKI7I.mjs} +1 -1
- package/dist/client/{headerSection-BSeGr-FS.mjs → headerSection-vTku_LEl.mjs} +2 -2
- package/dist/client/hooks.mjs +373 -555
- package/dist/client/{locationMap-BpOrtNYn.mjs → locationMap-Bg7X4Jna.mjs} +3 -3
- package/dist/client/{media-DoF0dcVx.mjs → media-CNE1Z-wb.mjs} +1 -2
- package/dist/client/{newsletterForm-Bt7it7Dy.mjs → newsletterForm-lpylVdp5.mjs} +1 -1
- package/dist/client/{pricing-BTjSDDr4.mjs → pricing-DE8fjJiT.mjs} +1 -1
- package/dist/client/{productDetail-ICnVTcCg.mjs → productDetail-D7Bo2RMH.mjs} +3 -3
- package/dist/client/{productList-ZHr6D604.mjs → productList-VjnZqiqN.mjs} +3 -3
- package/dist/client/{propsDecoder-wWN0tBDF.mjs → propsDecoder-DreFXjNP.mjs} +2212 -621
- package/dist/client/rendering/client.mjs +21612 -21646
- package/dist/client/rendering/islands.mjs +20 -20
- package/dist/client/rendering.mjs +1571 -1547
- package/dist/client/{shop-C1u_BUn0.mjs → shop-IRsHHbf7.mjs} +5 -5
- package/dist/client/{shop-commerce-CleZdRha.mjs → shop-commerce-gnI8PieZ.mjs} +27 -10
- package/dist/client/{shop-commerce-store-ycnoB2Ce.mjs → shop-commerce-store-BTbrhObn.mjs} +1 -1
- package/dist/client/{shopShared-CPhByt2a.mjs → shopShared-D6KS2_qk.mjs} +3 -3
- package/dist/client/{useDiscountCodeUi-cStSQI6C.mjs → useDiscountCodeUi-DCccGCxV.mjs} +1 -1
- package/dist/client/{useEventFilters-DKPN7hSY.mjs → useEventFilters-eGs3rPZQ.mjs} +3 -104
- package/dist/client/{usePolling-BKAd6pkZ.mjs → usePolling-CvSU2sur.mjs} +2 -2
- package/dist/preview-next/before-render.mjs +57 -0
- package/dist/preview-next/client/runtime.mjs +4 -4
- package/dist/preview-next/middleware.mjs +57 -0
- package/dist/{previewAuthStore-BkT1D06A.mjs → previewAuthStore-DN7vcRsv.mjs} +57 -0
- package/dist/{sdk-runtime-hu3wr3ng.mjs → sdk-runtime-DaOiA7ct.mjs} +2 -2
- package/dist/{separator-Bln8izQ9.mjs → separator-CqRhcCxD.mjs} +1 -1
- package/dist/server/components.mjs +4092 -4108
- package/dist/server/config-template-validation.mjs +4 -23
- package/dist/server/config-validation.mjs +373 -555
- package/dist/server/config.mjs +410 -558
- package/dist/server/data.mjs +373 -555
- package/dist/server/index.mjs +58 -1
- package/dist/server/next.mjs +32958 -32926
- package/dist/server/page-converter.mjs +369 -526
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +5371 -3174
- package/dist/server/rendering.mjs +4099 -4124
- package/dist/server/routing.mjs +758 -966
- package/dist/server/server.mjs +448 -632
- package/dist/server/theme-bridge.mjs +472 -525
- package/dist/server/theme.mjs +1074 -392
- package/package.json +1 -1
- package/dist/_dts/blocks/src/primitives/content/components/Button.d.ts +0 -40
- package/dist/_dts/blocks/src/system/fragments/library/footerBottomText.d.ts +0 -19
- package/dist/_dts/media-core/src/legacyMediaValue.d.ts +0 -11
- package/dist/_dts/theme-core/src/styles/buttons.d.ts +0 -27
- package/dist/_dts/theme-core/src/styles/buttonsLibrary.d.ts +0 -2
- package/dist/_dts/theme-core/src/styles/glow.d.ts +0 -3
- package/dist/client/colorStyles-gcTh5yZT.mjs +0 -89
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as parseColorTokenParts, b as ok$1, l as parseEventOfferingId, r as rgbColorValue, s as parseAspectRatioValue, u as parseEventSeriesId, y as err$1 } from "./colorStyles-BWpj_h4C.mjs";
|
|
2
2
|
import z, { z as z$1 } from "zod";
|
|
3
3
|
//#region ../core/src/assert-never.ts
|
|
4
4
|
function assertNever$2(value, message = "Unexpected variant") {
|
|
@@ -1498,111 +1498,6 @@ function isEventContentType(slug) {
|
|
|
1498
1498
|
return EVENT_CONTENT_TYPE_SLUGS.includes(slug);
|
|
1499
1499
|
}
|
|
1500
1500
|
//#endregion
|
|
1501
|
-
//#region ../theme-core/src/buttons/effectClassification.ts
|
|
1502
|
-
/**
|
|
1503
|
-
* Exhaustive live policy for every registered effect id.
|
|
1504
|
-
*
|
|
1505
|
-
* The resolver consumes the transition payload directly, so adding an effect
|
|
1506
|
-
* cannot update classification without also defining its runtime behavior.
|
|
1507
|
-
*/
|
|
1508
|
-
const BUTTON_EFFECT_POLICIES = {
|
|
1509
|
-
"darken-background": {
|
|
1510
|
-
classification: "colour-transition",
|
|
1511
|
-
transition: {
|
|
1512
|
-
kind: "adjust-shade",
|
|
1513
|
-
direction: "darker"
|
|
1514
|
-
}
|
|
1515
|
-
},
|
|
1516
|
-
"lighten-background": {
|
|
1517
|
-
classification: "colour-transition",
|
|
1518
|
-
transition: {
|
|
1519
|
-
kind: "adjust-shade",
|
|
1520
|
-
direction: "lighter"
|
|
1521
|
-
}
|
|
1522
|
-
},
|
|
1523
|
-
"background-on-hover": {
|
|
1524
|
-
classification: "colour-transition",
|
|
1525
|
-
transition: { kind: "replace-background" }
|
|
1526
|
-
},
|
|
1527
|
-
"background-on-hover-alpha": {
|
|
1528
|
-
classification: "unsupported-colour",
|
|
1529
|
-
reason: "alpha_requires_surface"
|
|
1530
|
-
},
|
|
1531
|
-
"fade-background": {
|
|
1532
|
-
classification: "unsupported-colour",
|
|
1533
|
-
reason: "changes_element_opacity"
|
|
1534
|
-
},
|
|
1535
|
-
"opacity-reduce": {
|
|
1536
|
-
classification: "unsupported-colour",
|
|
1537
|
-
reason: "changes_element_opacity"
|
|
1538
|
-
},
|
|
1539
|
-
"gradient-text": {
|
|
1540
|
-
classification: "unsupported-colour",
|
|
1541
|
-
reason: "changes_foreground"
|
|
1542
|
-
},
|
|
1543
|
-
"text-color-change": {
|
|
1544
|
-
classification: "unsupported-colour",
|
|
1545
|
-
reason: "changes_foreground"
|
|
1546
|
-
},
|
|
1547
|
-
"border-color-change": {
|
|
1548
|
-
classification: "unsupported-colour",
|
|
1549
|
-
reason: "changes_border"
|
|
1550
|
-
},
|
|
1551
|
-
"aurora-glow": {
|
|
1552
|
-
classification: "unsupported-background-overlay",
|
|
1553
|
-
reason: "unresolved_background_overlay"
|
|
1554
|
-
},
|
|
1555
|
-
"cosmic-stardust": {
|
|
1556
|
-
classification: "unsupported-background-overlay",
|
|
1557
|
-
reason: "unresolved_background_overlay"
|
|
1558
|
-
},
|
|
1559
|
-
"gradient-border-fill": {
|
|
1560
|
-
classification: "unsupported-background-overlay",
|
|
1561
|
-
reason: "unresolved_background_overlay"
|
|
1562
|
-
},
|
|
1563
|
-
"animated-gradient-border-fill": {
|
|
1564
|
-
classification: "unsupported-background-overlay",
|
|
1565
|
-
reason: "unresolved_background_overlay"
|
|
1566
|
-
},
|
|
1567
|
-
"nav-underline": {
|
|
1568
|
-
classification: "not-button",
|
|
1569
|
-
reason: "not_button_effect"
|
|
1570
|
-
},
|
|
1571
|
-
"nav-frosted-base": {
|
|
1572
|
-
classification: "not-button",
|
|
1573
|
-
reason: "not_button_effect"
|
|
1574
|
-
},
|
|
1575
|
-
"nav-frosted-hover": {
|
|
1576
|
-
classification: "not-button",
|
|
1577
|
-
reason: "not_button_effect"
|
|
1578
|
-
},
|
|
1579
|
-
"nav-frosted-active": {
|
|
1580
|
-
classification: "not-button",
|
|
1581
|
-
reason: "not_button_effect"
|
|
1582
|
-
},
|
|
1583
|
-
"animated-gradient": { classification: "non-colour" },
|
|
1584
|
-
"border-glow": { classification: "non-colour" },
|
|
1585
|
-
"drop-shadow": { classification: "non-colour" },
|
|
1586
|
-
"inner-shadow": { classification: "non-colour" },
|
|
1587
|
-
"neumorphic-shadow": { classification: "non-colour" },
|
|
1588
|
-
"outer-glow": { classification: "non-colour" },
|
|
1589
|
-
"retro-3d-shadow": { classification: "non-colour" },
|
|
1590
|
-
"scale-up": { classification: "non-colour" },
|
|
1591
|
-
"scale-down": { classification: "non-colour" },
|
|
1592
|
-
lift: { classification: "non-colour" },
|
|
1593
|
-
"press-down": { classification: "non-colour" },
|
|
1594
|
-
pop: { classification: "non-colour" },
|
|
1595
|
-
"border-bottom-grow": { classification: "non-colour" },
|
|
1596
|
-
"sketchy-border": { classification: "non-colour" },
|
|
1597
|
-
"pulse-animation": { classification: "non-colour" }
|
|
1598
|
-
};
|
|
1599
|
-
function getButtonEffectPolicy(effectId) {
|
|
1600
|
-
return Object.prototype.hasOwnProperty.call(BUTTON_EFFECT_POLICIES, effectId) ? BUTTON_EFFECT_POLICIES[effectId] : null;
|
|
1601
|
-
}
|
|
1602
|
-
function classifyButtonEffectId(effectId) {
|
|
1603
|
-
return getButtonEffectPolicy(effectId)?.classification ?? "unknown";
|
|
1604
|
-
}
|
|
1605
|
-
//#endregion
|
|
1606
1501
|
//#region ../theme-core/src/tokens/blockColorTokens.ts
|
|
1607
1502
|
const blockColorTokenNames = [
|
|
1608
1503
|
"text",
|
|
@@ -1718,6 +1613,13 @@ const VARIANT_ROLES = [
|
|
|
1718
1613
|
"tertiary",
|
|
1719
1614
|
"accent"
|
|
1720
1615
|
];
|
|
1616
|
+
/**
|
|
1617
|
+
* Canonical persisted/CSS-safe button variant identifier.
|
|
1618
|
+
*
|
|
1619
|
+
* IDs become class selectors, so keep the contract deliberately narrower than
|
|
1620
|
+
* an arbitrary string and shared with every authoring/runtime boundary.
|
|
1621
|
+
*/
|
|
1622
|
+
const buttonVariantIdSchema = z$1.string().min(1).max(50).regex(/^[a-z0-9-]+$/, "Button variant IDs may contain lowercase letters, numbers, and hyphens only");
|
|
1721
1623
|
function parseOpaqueButtonColourToken(value) {
|
|
1722
1624
|
const token = parseThemeColorToken(value);
|
|
1723
1625
|
if (token === null) return null;
|
|
@@ -1732,6 +1634,109 @@ const opaqueButtonColourTokenSchema = themeColorTokenSchema.refine((value) => pa
|
|
|
1732
1634
|
if (token === null) throw new Error("Invariant: opaque button token passed its schema");
|
|
1733
1635
|
return token;
|
|
1734
1636
|
});
|
|
1637
|
+
const buttonShadeAmountSchema = z$1.number().finite().min(0).max(900).multipleOf(100);
|
|
1638
|
+
const buttonShadowIntensitySchema = z$1.enum([
|
|
1639
|
+
"subtle",
|
|
1640
|
+
"medium",
|
|
1641
|
+
"strong"
|
|
1642
|
+
]);
|
|
1643
|
+
/**
|
|
1644
|
+
* The complete persisted button-effect contract.
|
|
1645
|
+
*
|
|
1646
|
+
* Navigation has its own generic interactive-effect model. Button variants use
|
|
1647
|
+
* this closed union so unsupported effect IDs, unknown option keys, and unsafe
|
|
1648
|
+
* CSS values cannot become representable after the schema boundary.
|
|
1649
|
+
*/
|
|
1650
|
+
const buttonEffectApplicationSchema = z$1.discriminatedUnion("effectId", [
|
|
1651
|
+
z$1.strictObject({
|
|
1652
|
+
effectId: z$1.literal("darken-background"),
|
|
1653
|
+
options: z$1.strictObject({ amount: buttonShadeAmountSchema.optional() }).optional()
|
|
1654
|
+
}),
|
|
1655
|
+
z$1.strictObject({
|
|
1656
|
+
effectId: z$1.literal("lighten-background"),
|
|
1657
|
+
options: z$1.strictObject({ amount: buttonShadeAmountSchema.optional() }).optional()
|
|
1658
|
+
}),
|
|
1659
|
+
z$1.strictObject({
|
|
1660
|
+
effectId: z$1.literal("background-on-hover"),
|
|
1661
|
+
options: z$1.strictObject({ colorToken: opaqueButtonColourTokenSchema.optional() }).optional()
|
|
1662
|
+
}),
|
|
1663
|
+
z$1.strictObject({
|
|
1664
|
+
effectId: z$1.literal("animated-gradient"),
|
|
1665
|
+
options: z$1.strictObject({ direction: z$1.enum(["horizontal", "vertical"]).optional() }).optional()
|
|
1666
|
+
}),
|
|
1667
|
+
z$1.strictObject({
|
|
1668
|
+
effectId: z$1.literal("drop-shadow"),
|
|
1669
|
+
options: z$1.strictObject({ intensity: buttonShadowIntensitySchema.optional() }).optional()
|
|
1670
|
+
}),
|
|
1671
|
+
z$1.strictObject({
|
|
1672
|
+
effectId: z$1.literal("inner-shadow"),
|
|
1673
|
+
options: z$1.strictObject({}).optional()
|
|
1674
|
+
}),
|
|
1675
|
+
z$1.strictObject({
|
|
1676
|
+
effectId: z$1.literal("neumorphic-shadow"),
|
|
1677
|
+
options: z$1.strictObject({
|
|
1678
|
+
mode: z$1.enum(["raised", "pressed"]).optional(),
|
|
1679
|
+
intensity: buttonShadowIntensitySchema.optional()
|
|
1680
|
+
}).optional()
|
|
1681
|
+
}),
|
|
1682
|
+
z$1.strictObject({
|
|
1683
|
+
effectId: z$1.literal("retro-3d-shadow"),
|
|
1684
|
+
options: z$1.strictObject({}).optional()
|
|
1685
|
+
}),
|
|
1686
|
+
z$1.strictObject({
|
|
1687
|
+
effectId: z$1.literal("scale-up"),
|
|
1688
|
+
options: z$1.strictObject({ scale: z$1.enum([
|
|
1689
|
+
"1.02",
|
|
1690
|
+
"1.03",
|
|
1691
|
+
"1.05",
|
|
1692
|
+
"1.10"
|
|
1693
|
+
]).optional() }).optional()
|
|
1694
|
+
}),
|
|
1695
|
+
z$1.strictObject({
|
|
1696
|
+
effectId: z$1.literal("scale-down"),
|
|
1697
|
+
options: z$1.strictObject({ scale: z$1.enum([
|
|
1698
|
+
"0.90",
|
|
1699
|
+
"0.95",
|
|
1700
|
+
"0.97",
|
|
1701
|
+
"0.98"
|
|
1702
|
+
]).optional() }).optional()
|
|
1703
|
+
}),
|
|
1704
|
+
z$1.strictObject({
|
|
1705
|
+
effectId: z$1.literal("lift"),
|
|
1706
|
+
options: z$1.strictObject({ amount: z$1.enum([
|
|
1707
|
+
"0.25",
|
|
1708
|
+
"0.5",
|
|
1709
|
+
"1"
|
|
1710
|
+
]).optional() }).optional()
|
|
1711
|
+
}),
|
|
1712
|
+
z$1.strictObject({
|
|
1713
|
+
effectId: z$1.literal("press-down"),
|
|
1714
|
+
options: z$1.strictObject({}).optional()
|
|
1715
|
+
}),
|
|
1716
|
+
z$1.strictObject({
|
|
1717
|
+
effectId: z$1.literal("pop"),
|
|
1718
|
+
options: z$1.strictObject({ intensity: z$1.enum([
|
|
1719
|
+
"subtle",
|
|
1720
|
+
"medium",
|
|
1721
|
+
"dramatic"
|
|
1722
|
+
]).optional() }).optional()
|
|
1723
|
+
}),
|
|
1724
|
+
z$1.strictObject({
|
|
1725
|
+
effectId: z$1.literal("border-bottom-grow"),
|
|
1726
|
+
options: z$1.strictObject({
|
|
1727
|
+
height: z$1.union([z$1.literal(1), z$1.literal(2)]).optional(),
|
|
1728
|
+
origin: z$1.enum([
|
|
1729
|
+
"left",
|
|
1730
|
+
"center",
|
|
1731
|
+
"right"
|
|
1732
|
+
]).optional()
|
|
1733
|
+
}).optional()
|
|
1734
|
+
}),
|
|
1735
|
+
z$1.strictObject({
|
|
1736
|
+
effectId: z$1.literal("sketchy-border"),
|
|
1737
|
+
options: z$1.strictObject({ intensity: buttonShadowIntensitySchema.optional() }).optional()
|
|
1738
|
+
})
|
|
1739
|
+
]);
|
|
1735
1740
|
const cornerStyleSchema = z$1.enum([
|
|
1736
1741
|
"square",
|
|
1737
1742
|
"rounded",
|
|
@@ -1766,13 +1771,7 @@ const hoverTransformSchema = z$1.enum([
|
|
|
1766
1771
|
"scale",
|
|
1767
1772
|
"press"
|
|
1768
1773
|
]);
|
|
1769
|
-
|
|
1770
|
-
"none",
|
|
1771
|
-
"brighten",
|
|
1772
|
-
"darken",
|
|
1773
|
-
"saturate",
|
|
1774
|
-
"token"
|
|
1775
|
-
]);
|
|
1774
|
+
z$1.enum(["none", "token"]);
|
|
1776
1775
|
const buttonPaddingPresetSchema = z$1.enum([
|
|
1777
1776
|
"compact",
|
|
1778
1777
|
"default",
|
|
@@ -1833,7 +1832,7 @@ const buttonSizesSchema = z$1.object({
|
|
|
1833
1832
|
lg,
|
|
1834
1833
|
xl: xl ?? lg
|
|
1835
1834
|
}));
|
|
1836
|
-
const
|
|
1835
|
+
const buttonGlobalSettingsBaseSchema = z$1.strictObject({
|
|
1837
1836
|
cornerStyle: cornerStyleSchema,
|
|
1838
1837
|
cornerRadius: z$1.number().min(0).max(24).optional(),
|
|
1839
1838
|
/**
|
|
@@ -1846,30 +1845,23 @@ const canonicalButtonGlobalSettingsSchema = z$1.object({
|
|
|
1846
1845
|
shadow: shadowSizeSchema.optional(),
|
|
1847
1846
|
textTransform: textTransformSchema,
|
|
1848
1847
|
fontWeight: fontWeightSchema,
|
|
1849
|
-
/**
|
|
1850
|
-
* @deprecated Set per-variant via `variant.border.widthClass` instead.
|
|
1851
|
-
* Schema field is preserved so existing presets parse; the value is unread
|
|
1852
|
-
* by the current generator and will be removed once the legacy
|
|
1853
|
-
* `primitives/content/components/Button.tsx` slot exports are deleted.
|
|
1854
|
-
*/
|
|
1855
|
-
borderWidth: z$1.union([
|
|
1856
|
-
z$1.literal(1),
|
|
1857
|
-
z$1.literal(2),
|
|
1858
|
-
z$1.literal(3)
|
|
1859
|
-
]),
|
|
1860
1848
|
typography: buttonTypographySchema.optional(),
|
|
1861
1849
|
fontSize: z$1.string().optional(),
|
|
1862
1850
|
letterSpacing: letterSpacingSchema.optional(),
|
|
1863
1851
|
italic: z$1.boolean().optional(),
|
|
1864
1852
|
paddingPreset: buttonPaddingPresetSchema.optional(),
|
|
1865
1853
|
hoverTransform: hoverTransformSchema,
|
|
1866
|
-
hoverColor: hoverColorSchema,
|
|
1867
|
-
hoverColorToken: opaqueButtonColourTokenSchema.optional(),
|
|
1868
1854
|
gradientStyle: gradientStyleSchema.optional(),
|
|
1869
1855
|
gradientAngle: z$1.number().min(0).max(360).optional(),
|
|
1870
1856
|
gradientSharpness: gradientSharpnessSchema.optional()
|
|
1871
1857
|
});
|
|
1872
|
-
const buttonGlobalSettingsSchema = z$1.
|
|
1858
|
+
const buttonGlobalSettingsSchema = z$1.discriminatedUnion("hoverColor", [buttonGlobalSettingsBaseSchema.extend({
|
|
1859
|
+
hoverColor: z$1.literal("none"),
|
|
1860
|
+
hoverColorToken: z$1.never().optional()
|
|
1861
|
+
}), buttonGlobalSettingsBaseSchema.extend({
|
|
1862
|
+
hoverColor: z$1.literal("token"),
|
|
1863
|
+
hoverColorToken: opaqueButtonColourTokenSchema
|
|
1864
|
+
})]);
|
|
1873
1865
|
const gradientDirectionSchema$1 = z$1.enum([
|
|
1874
1866
|
"to-r",
|
|
1875
1867
|
"to-l",
|
|
@@ -1881,11 +1873,11 @@ const gradientDirectionSchema$1 = z$1.enum([
|
|
|
1881
1873
|
"to-bl"
|
|
1882
1874
|
]);
|
|
1883
1875
|
const buttonColourTreatmentSchema = z$1.discriminatedUnion("type", [
|
|
1884
|
-
z$1.
|
|
1876
|
+
z$1.strictObject({
|
|
1885
1877
|
type: z$1.literal("solid"),
|
|
1886
1878
|
colorToken: opaqueButtonColourTokenSchema
|
|
1887
1879
|
}),
|
|
1888
|
-
z$1.
|
|
1880
|
+
z$1.strictObject({
|
|
1889
1881
|
type: z$1.literal("gradient"),
|
|
1890
1882
|
stops: z$1.array(opaqueButtonColourTokenSchema).min(2).transform((stops) => {
|
|
1891
1883
|
const [first, second, ...rest] = stops;
|
|
@@ -1899,19 +1891,15 @@ const buttonColourTreatmentSchema = z$1.discriminatedUnion("type", [
|
|
|
1899
1891
|
direction: gradientDirectionSchema$1,
|
|
1900
1892
|
foregroundToken: opaqueButtonColourTokenSchema
|
|
1901
1893
|
}),
|
|
1902
|
-
z$1.
|
|
1894
|
+
z$1.strictObject({
|
|
1903
1895
|
type: z$1.literal("surface"),
|
|
1904
1896
|
role: z$1.literal("link")
|
|
1905
1897
|
})
|
|
1906
1898
|
]);
|
|
1907
1899
|
const buttonBackgroundSchema = buttonColourTreatmentSchema;
|
|
1908
|
-
const
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
});
|
|
1912
|
-
const buttonBorderSchema = z$1.object({ widthClass: z$1.string() });
|
|
1913
|
-
const buttonVariantAffordanceSchema = z$1.object({ iconId: z$1.string().min(1) });
|
|
1914
|
-
const variantShadowSchema = z$1.object({
|
|
1900
|
+
const buttonBorderSchema = z$1.strictObject({ widthClass: z$1.string() });
|
|
1901
|
+
const buttonVariantAffordanceSchema = z$1.strictObject({ iconId: z$1.string().min(1) });
|
|
1902
|
+
const variantShadowSchema = z$1.strictObject({
|
|
1915
1903
|
elevation: z$1.enum([
|
|
1916
1904
|
"none",
|
|
1917
1905
|
"low",
|
|
@@ -1924,13 +1912,13 @@ const variantShadowSchema = z$1.object({
|
|
|
1924
1912
|
"hard"
|
|
1925
1913
|
]).nullable(),
|
|
1926
1914
|
position: z$1.enum(["bottom", "bottom-right"]).default("bottom"),
|
|
1927
|
-
colorToken:
|
|
1915
|
+
colorToken: opaqueButtonColourTokenSchema.optional()
|
|
1928
1916
|
});
|
|
1929
|
-
const variantEffectsSchema = z$1.
|
|
1930
|
-
base: z$1.array(
|
|
1931
|
-
hover: z$1.array(
|
|
1932
|
-
active: z$1.array(
|
|
1933
|
-
focus: z$1.array(
|
|
1917
|
+
const variantEffectsSchema = z$1.strictObject({
|
|
1918
|
+
base: z$1.array(buttonEffectApplicationSchema).optional(),
|
|
1919
|
+
hover: z$1.array(buttonEffectApplicationSchema).optional(),
|
|
1920
|
+
active: z$1.array(buttonEffectApplicationSchema).optional(),
|
|
1921
|
+
focus: z$1.array(buttonEffectApplicationSchema).optional()
|
|
1934
1922
|
});
|
|
1935
1923
|
/**
|
|
1936
1924
|
* Per-variant size overrides schema — every entry is optional.
|
|
@@ -1951,8 +1939,8 @@ const variantSizeOverridesSchema = z$1.object({
|
|
|
1951
1939
|
* default (e.g. link-style variants declaring zero horizontal padding at
|
|
1952
1940
|
* every size).
|
|
1953
1941
|
*/
|
|
1954
|
-
const
|
|
1955
|
-
id:
|
|
1942
|
+
const buttonVariantSchema = z$1.strictObject({
|
|
1943
|
+
id: buttonVariantIdSchema,
|
|
1956
1944
|
name: z$1.string().min(1).max(20),
|
|
1957
1945
|
enabled: z$1.boolean(),
|
|
1958
1946
|
priority: prioritySchema,
|
|
@@ -1966,171 +1954,1989 @@ const canonicalButtonVariantSchema = z$1.object({
|
|
|
1966
1954
|
sizes: variantSizeOverridesSchema.optional(),
|
|
1967
1955
|
affordance: buttonVariantAffordanceSchema.optional()
|
|
1968
1956
|
});
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1957
|
+
const buttonSystemSchema = z$1.strictObject({
|
|
1958
|
+
global: buttonGlobalSettingsSchema,
|
|
1959
|
+
variants: z$1.array(buttonVariantSchema).min(1).max(6),
|
|
1960
|
+
sizes: buttonSizesSchema.optional()
|
|
1961
|
+
}).superRefine((system, ctx) => {
|
|
1962
|
+
const seen = /* @__PURE__ */ new Set();
|
|
1963
|
+
system.variants.forEach((variant, index) => {
|
|
1964
|
+
if (seen.has(variant.id)) ctx.addIssue({
|
|
1965
|
+
code: "custom",
|
|
1966
|
+
path: [
|
|
1967
|
+
"variants",
|
|
1968
|
+
index,
|
|
1969
|
+
"id"
|
|
1970
|
+
],
|
|
1971
|
+
message: `Duplicate button variant ID: ${variant.id}`
|
|
1972
|
+
});
|
|
1973
|
+
seen.add(variant.id);
|
|
1974
|
+
});
|
|
1975
|
+
});
|
|
1976
|
+
//#endregion
|
|
1977
|
+
//#region ../theme-core/src/lib/media.ts
|
|
1978
|
+
const hotspotSchema$1 = z.object({
|
|
1979
|
+
x: z.number().min(0).max(1),
|
|
1980
|
+
y: z.number().min(0).max(1),
|
|
1981
|
+
radius: z.number().optional()
|
|
1982
|
+
});
|
|
1983
|
+
const rotationSchema$1 = z.union([
|
|
1984
|
+
z.literal(0),
|
|
1985
|
+
z.literal(90),
|
|
1986
|
+
z.literal(180),
|
|
1987
|
+
z.literal(270)
|
|
1988
|
+
]);
|
|
1989
|
+
const rectSchema$1 = z.tuple([
|
|
1990
|
+
z.number(),
|
|
1991
|
+
z.number(),
|
|
1992
|
+
z.number(),
|
|
1993
|
+
z.number()
|
|
1994
|
+
]);
|
|
1995
|
+
const aspectCropSchema$1 = z.object({
|
|
1996
|
+
aspect: z.preprocess((value) => value == null ? void 0 : value, z.string().optional()),
|
|
1997
|
+
rect: z.preprocess((value) => value == null ? void 0 : value, rectSchema$1.optional()),
|
|
1998
|
+
hotspot: z.preprocess((value) => value == null ? void 0 : value, hotspotSchema$1.optional()),
|
|
1999
|
+
rotation: z.preprocess((value) => value == null ? void 0 : value, rotationSchema$1.optional())
|
|
2000
|
+
});
|
|
2001
|
+
const transformSchema$1 = z.object({
|
|
2002
|
+
aspectCrops: z.preprocess((value) => {
|
|
2003
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return;
|
|
2004
|
+
return value;
|
|
2005
|
+
}, z.record(z.string(), aspectCropSchema$1.catch({}))).optional(),
|
|
2006
|
+
rect: rectSchema$1.optional(),
|
|
2007
|
+
hotspot: hotspotSchema$1.optional(),
|
|
2008
|
+
rotation: rotationSchema$1.optional()
|
|
2009
|
+
});
|
|
2010
|
+
const mediaSchema$1 = z.object({
|
|
2011
|
+
type: z.enum([
|
|
2012
|
+
"image",
|
|
2013
|
+
"video",
|
|
2014
|
+
"audio",
|
|
2015
|
+
"document",
|
|
2016
|
+
"spreadsheet",
|
|
2017
|
+
"archive"
|
|
2018
|
+
]),
|
|
2019
|
+
purpose: z.string().optional(),
|
|
2020
|
+
placeholder: z.boolean().default(true).optional(),
|
|
2021
|
+
assetId: z.string().optional(),
|
|
2022
|
+
identifier: z.string().optional(),
|
|
2023
|
+
src: z.string().optional(),
|
|
2024
|
+
alt: z.string().optional(),
|
|
2025
|
+
filename: z.string().optional(),
|
|
2026
|
+
mimeType: z.string().optional(),
|
|
2027
|
+
width: z.number().optional(),
|
|
2028
|
+
height: z.number().optional(),
|
|
2029
|
+
storageBucket: z.string().optional(),
|
|
2030
|
+
storagePath: z.string().optional(),
|
|
2031
|
+
transform: transformSchema$1.optional()
|
|
2032
|
+
});
|
|
2033
|
+
//#endregion
|
|
2034
|
+
//#region ../theme-core/src/cards/types.ts
|
|
2035
|
+
const cardVariantRoleValues = ["default", "alternative"];
|
|
2036
|
+
const boxlessCardVariantValue = "none";
|
|
2037
|
+
const legacyCardVariantRoleAliases = {
|
|
2038
|
+
variant1: "alternative",
|
|
2039
|
+
variant2: "alternative"
|
|
2040
|
+
};
|
|
2041
|
+
const cardSpacingSchema = z$1.enum([
|
|
2042
|
+
"none",
|
|
2043
|
+
"compact",
|
|
2044
|
+
"cozy",
|
|
2045
|
+
"medium",
|
|
2046
|
+
"comfortable",
|
|
2047
|
+
"spacious"
|
|
2048
|
+
]);
|
|
2049
|
+
const gradientDirectionSchema = z$1.enum([
|
|
2050
|
+
"to-r",
|
|
2051
|
+
"to-l",
|
|
2052
|
+
"to-t",
|
|
2053
|
+
"to-b",
|
|
2054
|
+
"to-tr",
|
|
2055
|
+
"to-tl",
|
|
2056
|
+
"to-br",
|
|
2057
|
+
"to-bl"
|
|
2058
|
+
]);
|
|
2059
|
+
const cardVariantRoleSchema = z$1.enum(cardVariantRoleValues);
|
|
2060
|
+
const boxStylesCardVariantSchema = z$1.enum([...cardVariantRoleValues, boxlessCardVariantValue]);
|
|
2061
|
+
function isCardVariantRole(value) {
|
|
2062
|
+
return typeof value === "string" && cardVariantRoleValues.includes(value);
|
|
2063
|
+
}
|
|
2064
|
+
function normalizeCardVariantRole(value) {
|
|
2065
|
+
if (isCardVariantRole(value)) return value;
|
|
2066
|
+
if (typeof value !== "string") return null;
|
|
2067
|
+
return legacyCardVariantRoleAliases[value] ?? null;
|
|
2068
|
+
}
|
|
2069
|
+
const cardBackgroundSchema = z$1.discriminatedUnion("type", [
|
|
2070
|
+
z$1.object({
|
|
2071
|
+
type: z$1.literal("solid"),
|
|
2072
|
+
colorToken: themeColorTokenSchema
|
|
2073
|
+
}),
|
|
2074
|
+
z$1.object({
|
|
2075
|
+
type: z$1.literal("gradient"),
|
|
2076
|
+
fromToken: themeColorTokenSchema,
|
|
2077
|
+
toToken: themeColorTokenSchema,
|
|
2078
|
+
direction: gradientDirectionSchema
|
|
2079
|
+
}),
|
|
2080
|
+
z$1.object({ type: z$1.literal("transparent") })
|
|
2081
|
+
]);
|
|
2082
|
+
const cardBorderSchema = z$1.object({
|
|
2083
|
+
widthClass: z$1.string(),
|
|
2084
|
+
colorToken: themeColorTokenSchema
|
|
2085
|
+
});
|
|
2086
|
+
/** Per-corner radius value. `expressive` is a large block-radius multiple. */
|
|
2087
|
+
const cardCornerValueSchema = z$1.enum([
|
|
2088
|
+
"square",
|
|
2089
|
+
"soft",
|
|
2090
|
+
"rounded",
|
|
2091
|
+
"pill",
|
|
2092
|
+
"expressive"
|
|
2093
|
+
]);
|
|
2094
|
+
/**
|
|
2095
|
+
* A single accented card edge (e.g. a left accent bar). When set, it replaces
|
|
2096
|
+
* the full `border` so the card reads as edge-accented rather than outlined.
|
|
2097
|
+
*/
|
|
2098
|
+
const cardAccentEdgeSchema = z$1.object({
|
|
2099
|
+
edge: z$1.enum([
|
|
2100
|
+
"left",
|
|
2101
|
+
"top",
|
|
2102
|
+
"right",
|
|
2103
|
+
"bottom"
|
|
2104
|
+
]),
|
|
2105
|
+
colorToken: themeColorTokenSchema,
|
|
2106
|
+
width: z$1.enum([
|
|
2107
|
+
"thin",
|
|
2108
|
+
"medium",
|
|
2109
|
+
"thick",
|
|
2110
|
+
"heavy"
|
|
2111
|
+
])
|
|
2112
|
+
});
|
|
2113
|
+
const cardCornerRadiiSchema = z$1.object({
|
|
2114
|
+
topLeft: cardCornerValueSchema.optional(),
|
|
2115
|
+
topRight: cardCornerValueSchema.optional(),
|
|
2116
|
+
bottomLeft: cardCornerValueSchema.optional(),
|
|
2117
|
+
bottomRight: cardCornerValueSchema.optional()
|
|
2118
|
+
});
|
|
2119
|
+
const cardVariantSchema = z$1.object({
|
|
2120
|
+
id: z$1.string(),
|
|
2121
|
+
name: z$1.string().min(1).max(20),
|
|
2122
|
+
enabled: z$1.boolean(),
|
|
2123
|
+
priority: z$1.union([
|
|
2124
|
+
z$1.literal(1),
|
|
2125
|
+
z$1.literal(2),
|
|
2126
|
+
z$1.literal(3)
|
|
2127
|
+
]),
|
|
2128
|
+
background: cardBackgroundSchema,
|
|
2129
|
+
spacing: cardSpacingSchema,
|
|
2130
|
+
foregroundToken: themeColorTokenSchema.optional(),
|
|
2131
|
+
shadow: z$1.object({
|
|
2132
|
+
elevation: z$1.enum([
|
|
2133
|
+
"none",
|
|
2134
|
+
"low",
|
|
2135
|
+
"medium",
|
|
2136
|
+
"high"
|
|
2137
|
+
]),
|
|
2138
|
+
softness: z$1.enum([
|
|
2139
|
+
"crisp",
|
|
2140
|
+
"soft",
|
|
2141
|
+
"hard"
|
|
2142
|
+
]).nullable(),
|
|
2143
|
+
position: z$1.enum(["bottom", "bottom-right"]).default("bottom")
|
|
2144
|
+
}).optional(),
|
|
2145
|
+
corners: z$1.enum([
|
|
2146
|
+
"square",
|
|
2147
|
+
"soft",
|
|
2148
|
+
"rounded",
|
|
2149
|
+
"pill"
|
|
2150
|
+
]).optional(),
|
|
2151
|
+
cornerRadii: cardCornerRadiiSchema.optional(),
|
|
2152
|
+
border: cardBorderSchema.optional(),
|
|
2153
|
+
accentEdge: cardAccentEdgeSchema.optional()
|
|
2154
|
+
});
|
|
2155
|
+
const cardSystemSchema = z$1.object({ variants: z$1.array(cardVariantSchema).min(1).max(3) });
|
|
2156
|
+
//#endregion
|
|
2157
|
+
//#region ../theme-core/src/accordions/types.ts
|
|
2158
|
+
/**
|
|
2159
|
+
* Accordion icon styles for expand/collapse indicators
|
|
2160
|
+
*/
|
|
2161
|
+
const accordionIconSchema = z$1.enum([
|
|
2162
|
+
"plus-minus",
|
|
2163
|
+
"chevron",
|
|
2164
|
+
"caret",
|
|
2165
|
+
"arrow",
|
|
2166
|
+
"circle-plus-minus"
|
|
2167
|
+
]);
|
|
2168
|
+
/**
|
|
2169
|
+
* Accordion configuration for a theme
|
|
2170
|
+
* Single style per theme (no variants needed)
|
|
2171
|
+
*/
|
|
2172
|
+
const accordionSystemSchema = z$1.object({
|
|
2173
|
+
background: z$1.object({
|
|
2174
|
+
type: z$1.literal("solid"),
|
|
2175
|
+
colorToken: themeColorTokenSchema
|
|
2176
|
+
}).nullable(),
|
|
2177
|
+
spacing: z$1.enum([
|
|
2178
|
+
"none",
|
|
2179
|
+
"compact",
|
|
2180
|
+
"cozy",
|
|
2181
|
+
"medium",
|
|
2182
|
+
"comfortable",
|
|
2183
|
+
"spacious"
|
|
2184
|
+
]),
|
|
2185
|
+
corners: z$1.enum([
|
|
2186
|
+
"square",
|
|
2187
|
+
"soft",
|
|
2188
|
+
"rounded",
|
|
2189
|
+
"pill"
|
|
2190
|
+
]).nullable(),
|
|
2191
|
+
border: z$1.object({
|
|
2192
|
+
widthClass: z$1.string(),
|
|
2193
|
+
colorToken: themeColorTokenSchema
|
|
2194
|
+
}).nullable(),
|
|
2195
|
+
shadow: z$1.object({
|
|
2196
|
+
elevation: z$1.enum([
|
|
2197
|
+
"none",
|
|
2198
|
+
"low",
|
|
2199
|
+
"medium",
|
|
2200
|
+
"high"
|
|
2201
|
+
]),
|
|
2202
|
+
softness: z$1.enum([
|
|
2203
|
+
"soft",
|
|
2204
|
+
"crisp",
|
|
2205
|
+
"hard"
|
|
2206
|
+
]).nullable(),
|
|
2207
|
+
position: z$1.enum(["bottom", "bottom-right"])
|
|
2208
|
+
}).nullable(),
|
|
2209
|
+
icon: z$1.object({
|
|
2210
|
+
style: accordionIconSchema,
|
|
2211
|
+
position: z$1.enum(["left", "right"]),
|
|
2212
|
+
size: z$1.enum([
|
|
2213
|
+
"sm",
|
|
2214
|
+
"md",
|
|
2215
|
+
"lg"
|
|
2216
|
+
]),
|
|
2217
|
+
colorToken: themeColorTokenSchema.optional()
|
|
2218
|
+
}),
|
|
2219
|
+
trigger: z$1.object({
|
|
2220
|
+
textColorToken: themeColorTokenSchema,
|
|
2221
|
+
fontWeight: z$1.enum([
|
|
2222
|
+
"regular",
|
|
2223
|
+
"medium",
|
|
2224
|
+
"semibold",
|
|
2225
|
+
"bold"
|
|
2226
|
+
]).nullable(),
|
|
2227
|
+
fontFamily: z$1.enum(["body", "heading"]).optional(),
|
|
2228
|
+
fontScale: z$1.enum([
|
|
2229
|
+
"body",
|
|
2230
|
+
"md",
|
|
2231
|
+
"lg"
|
|
2232
|
+
]).optional(),
|
|
2233
|
+
letterSpacing: z$1.enum([
|
|
2234
|
+
"normal",
|
|
2235
|
+
"tight",
|
|
2236
|
+
"wide"
|
|
2237
|
+
]).optional(),
|
|
2238
|
+
textTransform: z$1.enum(["none", "uppercase"]).optional()
|
|
2239
|
+
}),
|
|
2240
|
+
hover: z$1.object({
|
|
2241
|
+
backgroundColorToken: themeColorTokenSchema.optional(),
|
|
2242
|
+
textColorToken: themeColorTokenSchema.optional(),
|
|
2243
|
+
borderColorToken: themeColorTokenSchema.optional()
|
|
2244
|
+
}),
|
|
2245
|
+
openState: z$1.object({
|
|
2246
|
+
backgroundColorToken: themeColorTokenSchema.optional(),
|
|
2247
|
+
triggerColorToken: themeColorTokenSchema.optional(),
|
|
2248
|
+
accent: z$1.object({
|
|
2249
|
+
edge: z$1.enum([
|
|
2250
|
+
"left",
|
|
2251
|
+
"top",
|
|
2252
|
+
"bottom"
|
|
2253
|
+
]),
|
|
2254
|
+
colorToken: themeColorTokenSchema,
|
|
2255
|
+
thickness: z$1.enum([
|
|
2256
|
+
"thin",
|
|
2257
|
+
"medium",
|
|
2258
|
+
"thick"
|
|
2259
|
+
])
|
|
2260
|
+
}).optional()
|
|
2261
|
+
}).optional(),
|
|
2262
|
+
content: z$1.object({ textColorToken: themeColorTokenSchema })
|
|
2263
|
+
});
|
|
2264
|
+
//#endregion
|
|
2265
|
+
//#region ../theme-core/src/inputs/types.ts
|
|
2266
|
+
/**
|
|
2267
|
+
* Input styling configuration for a theme
|
|
2268
|
+
*
|
|
2269
|
+
* Provides comprehensive control over form input appearance including:
|
|
2270
|
+
* - Base styling (background, borders, spacing)
|
|
2271
|
+
* - Label styling
|
|
2272
|
+
* - Focus, error, and disabled states
|
|
2273
|
+
*
|
|
2274
|
+
* Single configuration per theme (no variants needed for inputs)
|
|
2275
|
+
*/
|
|
2276
|
+
const inputSystemSchema = z$1.object({
|
|
2277
|
+
base: z$1.object({
|
|
2278
|
+
background: z$1.union([z$1.object({
|
|
2279
|
+
type: z$1.literal("solid"),
|
|
2280
|
+
colorToken: themeColorTokenSchema
|
|
2281
|
+
}), z$1.object({ type: z$1.literal("transparent") })]),
|
|
2282
|
+
textColorToken: themeColorTokenSchema,
|
|
2283
|
+
border: z$1.object({
|
|
2284
|
+
widthClass: z$1.string(),
|
|
2285
|
+
colorToken: themeColorTokenSchema,
|
|
2286
|
+
style: z$1.enum(["all", "underline"]).optional()
|
|
2287
|
+
}),
|
|
2288
|
+
corners: z$1.enum([
|
|
2289
|
+
"square",
|
|
2290
|
+
"soft",
|
|
2291
|
+
"rounded",
|
|
2292
|
+
"pill"
|
|
2293
|
+
]).nullable(),
|
|
2294
|
+
shadow: z$1.object({
|
|
2295
|
+
elevation: z$1.enum([
|
|
2296
|
+
"none",
|
|
2297
|
+
"low",
|
|
2298
|
+
"medium"
|
|
2299
|
+
]),
|
|
2300
|
+
softness: z$1.enum([
|
|
2301
|
+
"soft",
|
|
2302
|
+
"crisp",
|
|
2303
|
+
"hard"
|
|
2304
|
+
]).nullable()
|
|
2305
|
+
}).nullable(),
|
|
2306
|
+
spacing: z$1.enum([
|
|
2307
|
+
"compact",
|
|
2308
|
+
"cozy",
|
|
2309
|
+
"medium",
|
|
2310
|
+
"comfortable"
|
|
2311
|
+
]),
|
|
2312
|
+
fontSize: z$1.enum([
|
|
2313
|
+
"sm",
|
|
2314
|
+
"base",
|
|
2315
|
+
"lg"
|
|
2316
|
+
])
|
|
2317
|
+
}),
|
|
2318
|
+
label: z$1.object({
|
|
2319
|
+
textColorToken: themeColorTokenSchema,
|
|
2320
|
+
fontWeight: z$1.enum([
|
|
2321
|
+
"regular",
|
|
2322
|
+
"medium",
|
|
2323
|
+
"semibold",
|
|
2324
|
+
"bold",
|
|
2325
|
+
"black"
|
|
2326
|
+
]),
|
|
2327
|
+
fontSize: z$1.enum([
|
|
2328
|
+
"2xs",
|
|
2329
|
+
"xs",
|
|
2330
|
+
"sm",
|
|
2331
|
+
"base"
|
|
2332
|
+
]),
|
|
2333
|
+
textTransform: z$1.enum([
|
|
2334
|
+
"none",
|
|
2335
|
+
"uppercase",
|
|
2336
|
+
"lowercase",
|
|
2337
|
+
"capitalize"
|
|
2338
|
+
]).optional(),
|
|
2339
|
+
letterSpacing: z$1.enum([
|
|
2340
|
+
"normal",
|
|
2341
|
+
"wide",
|
|
2342
|
+
"wider",
|
|
2343
|
+
"widest"
|
|
2344
|
+
]).optional(),
|
|
2345
|
+
opacity: z$1.number().min(.2).max(1).optional()
|
|
2346
|
+
}),
|
|
2347
|
+
focus: z$1.object({
|
|
2348
|
+
ringColorToken: themeColorTokenSchema,
|
|
2349
|
+
ringWidth: z$1.enum([
|
|
2350
|
+
"0",
|
|
2351
|
+
"1",
|
|
2352
|
+
"2",
|
|
2353
|
+
"3"
|
|
2354
|
+
]),
|
|
2355
|
+
borderColorToken: themeColorTokenSchema.optional()
|
|
2356
|
+
}),
|
|
2357
|
+
error: z$1.object({
|
|
2358
|
+
borderColorToken: themeColorTokenSchema,
|
|
2359
|
+
textColorToken: themeColorTokenSchema
|
|
2360
|
+
}),
|
|
2361
|
+
disabled: z$1.object({
|
|
2362
|
+
backgroundColorToken: themeColorTokenSchema,
|
|
2363
|
+
textColorToken: themeColorTokenSchema,
|
|
2364
|
+
opacity: z$1.number().min(.3).max(.7)
|
|
2365
|
+
})
|
|
2366
|
+
});
|
|
2367
|
+
//#endregion
|
|
2368
|
+
//#region ../theme-core/src/gradients/types.ts
|
|
2369
|
+
/**
|
|
2370
|
+
* Gradient configuration types and schemas
|
|
2371
|
+
*/
|
|
2372
|
+
/**
|
|
2373
|
+
* Gradient color stop
|
|
2374
|
+
*/
|
|
2375
|
+
const gradientStopSchema = z$1.object({
|
|
2376
|
+
color: themeColorTokenSchema,
|
|
2377
|
+
position: z$1.number().min(0).max(100)
|
|
2378
|
+
});
|
|
2379
|
+
/**
|
|
2380
|
+
* Radial gradient shape. Optional; defaults to `circle` (the historical shape)
|
|
2381
|
+
* so existing radial gradients are byte-identical.
|
|
2382
|
+
*
|
|
2383
|
+
* Named `RadialGradientShape` to avoid clashing with `styles/gradients.ts`'s
|
|
2384
|
+
* `GradientShape` (which names the gradient *kind*: linear/radial/conic).
|
|
2385
|
+
*/
|
|
2386
|
+
const radialGradientShapeSchema = z$1.enum(["circle", "ellipse"]);
|
|
2387
|
+
/**
|
|
2388
|
+
* Gradient configuration.
|
|
2389
|
+
*
|
|
2390
|
+
* `type` is optional and defaults to `'linear'` so gradients persisted without a
|
|
2391
|
+
* type (or with an explicit `'linear'`) render exactly as before. `'radial'` and
|
|
2392
|
+
* `'conic'` are additive kinds:
|
|
2393
|
+
* - linear: `angle` (degrees)
|
|
2394
|
+
* - radial: optional `shape` (circle/ellipse) + `position`
|
|
2395
|
+
* - conic: optional `angle` (from-angle, degrees) + `position`
|
|
2396
|
+
*/
|
|
2397
|
+
const gradientConfigSchema = z$1.object({
|
|
2398
|
+
type: z$1.enum([
|
|
2399
|
+
"linear",
|
|
2400
|
+
"radial",
|
|
2401
|
+
"conic"
|
|
2402
|
+
]).default("linear"),
|
|
2403
|
+
angle: z$1.number().min(0).max(360).optional(),
|
|
2404
|
+
shape: radialGradientShapeSchema.optional(),
|
|
2405
|
+
position: z$1.string().optional(),
|
|
2406
|
+
stops: z$1.array(gradientStopSchema).min(2)
|
|
2407
|
+
});
|
|
2408
|
+
//#endregion
|
|
2409
|
+
//#region ../theme-core/src/interactive/baseSchema.ts
|
|
2410
|
+
/**
|
|
2411
|
+
* Shared Base Schemas for Interactive Elements
|
|
2412
|
+
*
|
|
2413
|
+
* These Zod schemas are shared by buttons and nav links for DRY architecture.
|
|
2414
|
+
*/
|
|
2415
|
+
/**
|
|
2416
|
+
* Typography settings shared by buttons and nav links
|
|
2417
|
+
*/
|
|
2418
|
+
const interactiveTypographySchema = z$1.object({
|
|
2419
|
+
/** Font family source */
|
|
2420
|
+
typography: z$1.enum(["body", "heading"]).default("body"),
|
|
2421
|
+
/** Font weight */
|
|
2422
|
+
fontWeight: z$1.enum([
|
|
2423
|
+
"regular",
|
|
2424
|
+
"medium",
|
|
2425
|
+
"semibold",
|
|
2426
|
+
"bold"
|
|
2427
|
+
]).default("medium"),
|
|
2428
|
+
/** Text transform */
|
|
2429
|
+
textTransform: z$1.enum([
|
|
2430
|
+
"none",
|
|
2431
|
+
"uppercase",
|
|
2432
|
+
"capitalize"
|
|
2433
|
+
]).default("none"),
|
|
2434
|
+
/** Italic style */
|
|
2435
|
+
italic: z$1.boolean().default(false)
|
|
2436
|
+
});
|
|
2437
|
+
/**
|
|
2438
|
+
* Effect application reference (shared between buttons and nav)
|
|
2439
|
+
*/
|
|
2440
|
+
const effectApplicationSchema = z$1.object({
|
|
2441
|
+
/** Effect preset ID */
|
|
2442
|
+
effectId: z$1.string(),
|
|
2443
|
+
/** User-provided customization options */
|
|
2444
|
+
options: z$1.record(z$1.string(), z$1.any()).optional()
|
|
2445
|
+
});
|
|
2446
|
+
/**
|
|
2447
|
+
* Effect composition by state (shared pattern)
|
|
2448
|
+
*/
|
|
2449
|
+
const effectCompositionSchema = z$1.object({
|
|
2450
|
+
/** Effects always applied */
|
|
2451
|
+
base: z$1.array(effectApplicationSchema).optional(),
|
|
2452
|
+
/** Effects applied on hover */
|
|
2453
|
+
hover: z$1.array(effectApplicationSchema).optional(),
|
|
2454
|
+
/** Effects applied on active/pressed */
|
|
2455
|
+
active: z$1.array(effectApplicationSchema).optional(),
|
|
2456
|
+
/** Effects applied on focus */
|
|
2457
|
+
focus: z$1.array(effectApplicationSchema).optional()
|
|
2458
|
+
});
|
|
2459
|
+
//#endregion
|
|
2460
|
+
//#region ../theme-core/src/navigation/types.ts
|
|
2461
|
+
/**
|
|
2462
|
+
* Navigation Link Style Types
|
|
2463
|
+
*
|
|
2464
|
+
* Schema and types for composable nav link styling used by header and footer.
|
|
2465
|
+
*/
|
|
2466
|
+
/**
|
|
2467
|
+
* Padding preset options for nav links
|
|
2468
|
+
*/
|
|
2469
|
+
const navLinkPaddingSchema = z$1.enum([
|
|
2470
|
+
"none",
|
|
2471
|
+
"compact",
|
|
2472
|
+
"default"
|
|
2473
|
+
]);
|
|
2474
|
+
/**
|
|
2475
|
+
* Horizontal padding override for nav links.
|
|
2476
|
+
* When set, overrides only the horizontal component of the `padding` preset.
|
|
2477
|
+
*/
|
|
2478
|
+
const navLinkPaddingXSchema = z$1.enum([
|
|
2479
|
+
"none",
|
|
2480
|
+
"tight",
|
|
2481
|
+
"compact",
|
|
2482
|
+
"default",
|
|
2483
|
+
"relaxed",
|
|
2484
|
+
"spacious"
|
|
2485
|
+
]);
|
|
2486
|
+
/**
|
|
2487
|
+
* Border radius options for nav links
|
|
2488
|
+
*/
|
|
2489
|
+
const navLinkBorderRadiusSchema = z$1.enum([
|
|
2490
|
+
"none",
|
|
2491
|
+
"sm",
|
|
2492
|
+
"md",
|
|
2493
|
+
"full"
|
|
2494
|
+
]);
|
|
2495
|
+
/**
|
|
2496
|
+
* Typography size options for nav links.
|
|
2497
|
+
*/
|
|
2498
|
+
const navLinkTextSizeSchema = z$1.enum([
|
|
2499
|
+
"xs",
|
|
2500
|
+
"sm",
|
|
2501
|
+
"base",
|
|
2502
|
+
"lg",
|
|
2503
|
+
"xl"
|
|
2504
|
+
]);
|
|
2505
|
+
/**
|
|
2506
|
+
* Letter spacing options for nav links.
|
|
2507
|
+
*/
|
|
2508
|
+
const navLinkLetterSpacingSchema = z$1.enum([
|
|
2509
|
+
"normal",
|
|
2510
|
+
"wide",
|
|
2511
|
+
"wider",
|
|
2512
|
+
"widest"
|
|
2513
|
+
]);
|
|
2514
|
+
/**
|
|
2515
|
+
* Optional legibility aid for nav text that floats over uncertain imagery or color.
|
|
2516
|
+
*/
|
|
2517
|
+
const navLinkContrastTreatmentSchema = z$1.enum(["none", "soft-glow"]);
|
|
2518
|
+
/**
|
|
2519
|
+
* Nav link style schema
|
|
2520
|
+
*
|
|
2521
|
+
* Extends interactive typography base with nav-specific settings.
|
|
2522
|
+
*/
|
|
2523
|
+
const navLinkStyleSchema = z$1.object({
|
|
2524
|
+
/** Display name for the style */
|
|
2525
|
+
name: z$1.string().min(1).max(30).optional(),
|
|
2526
|
+
/** Typography settings (inherited from interactive base) */
|
|
2527
|
+
...interactiveTypographySchema.shape,
|
|
2528
|
+
/** Text color token */
|
|
2529
|
+
colorToken: themeColorTokenSchema.default("text"),
|
|
2530
|
+
/** Optional text size override */
|
|
2531
|
+
textSize: navLinkTextSizeSchema.optional(),
|
|
2532
|
+
/** Optional letter spacing override */
|
|
2533
|
+
letterSpacing: navLinkLetterSpacingSchema.optional(),
|
|
2534
|
+
/** Optional text-only contrast treatment for transparent/overlay navigation */
|
|
2535
|
+
contrastTreatment: navLinkContrastTreatmentSchema.optional(),
|
|
2536
|
+
/** Hover/active color token (for color-change effects) */
|
|
2537
|
+
hoverColorToken: themeColorTokenSchema.nullable().optional(),
|
|
2538
|
+
/** Padding preset */
|
|
2539
|
+
padding: navLinkPaddingSchema.default("compact"),
|
|
2540
|
+
/** Horizontal padding override (overrides horizontal component of padding preset) */
|
|
2541
|
+
paddingX: navLinkPaddingXSchema.optional(),
|
|
2542
|
+
/** Border radius (for capsule/pill styles) */
|
|
2543
|
+
borderRadius: navLinkBorderRadiusSchema.default("none"),
|
|
2544
|
+
/** Composable effects */
|
|
2545
|
+
effects: effectCompositionSchema.optional()
|
|
2546
|
+
});
|
|
2547
|
+
//#endregion
|
|
2548
|
+
//#region ../theme-core/src/customCss/validation.ts
|
|
2549
|
+
/**
|
|
2550
|
+
* Custom CSS Validation Schemas
|
|
2551
|
+
*
|
|
2552
|
+
* Zod schemas for validating custom CSS rules.
|
|
2553
|
+
* Enforces security constraints by construction.
|
|
2554
|
+
*/
|
|
2555
|
+
/** Global selectors that could affect elements outside theme scope */
|
|
2556
|
+
const FORBIDDEN_SELECTORS = [
|
|
2557
|
+
":root",
|
|
2558
|
+
"html",
|
|
2559
|
+
"body"
|
|
2560
|
+
];
|
|
2561
|
+
/** Universal selector - forbidden because it affects everything */
|
|
2562
|
+
const UNIVERSAL_SELECTOR = "*";
|
|
2563
|
+
/** Pattern to detect remote URL references (http://, https://, //) */
|
|
2564
|
+
const REMOTE_URL_PATTERN = /url\s*\(\s*['"]?(https?:|\/\/)/i;
|
|
2565
|
+
/** Pattern to detect javascript: URLs */
|
|
2566
|
+
const JAVASCRIPT_URL_PATTERN = /javascript\s*:/i;
|
|
2567
|
+
/**
|
|
2568
|
+
* Check if a single selector part (no commas) is forbidden.
|
|
2569
|
+
*/
|
|
2570
|
+
function isForbiddenSelectorPart(part) {
|
|
2571
|
+
const normalized = part.toLowerCase().trim();
|
|
2572
|
+
if (!normalized) return true;
|
|
2573
|
+
if (normalized === UNIVERSAL_SELECTOR || normalized.startsWith("* ") || normalized.endsWith(" *") || normalized.includes(" * ")) return true;
|
|
2574
|
+
for (const forbidden of FORBIDDEN_SELECTORS) {
|
|
2575
|
+
if (normalized === forbidden) return true;
|
|
2576
|
+
if (normalized.startsWith(forbidden + " ")) return true;
|
|
2577
|
+
if (normalized.startsWith(forbidden + ">")) return true;
|
|
2578
|
+
if (normalized.startsWith(forbidden + "+")) return true;
|
|
2579
|
+
if (normalized.startsWith(forbidden + "~")) return true;
|
|
2580
|
+
if (normalized.startsWith(forbidden + ".")) return true;
|
|
2581
|
+
if (normalized.startsWith(forbidden + "#")) return true;
|
|
2582
|
+
if (normalized.startsWith(forbidden + "[")) return true;
|
|
2583
|
+
if (normalized.startsWith(forbidden + ":") && !normalized.startsWith(forbidden + "::")) return true;
|
|
2584
|
+
}
|
|
2585
|
+
return false;
|
|
2586
|
+
}
|
|
2587
|
+
/**
|
|
2588
|
+
* Check if a selector uses sibling combinators with & that could escape scope.
|
|
2589
|
+
* Patterns like "& ~ .outside" or "& + .sibling" can select elements outside the scope.
|
|
2590
|
+
*/
|
|
2591
|
+
function hasScopeEscapingSiblingCombinator(selector) {
|
|
2592
|
+
const normalized = selector.trim();
|
|
2593
|
+
return /&\s*[+~]/.test(normalized);
|
|
2594
|
+
}
|
|
2595
|
+
/**
|
|
2596
|
+
* Check if a selector contains forbidden global selectors.
|
|
2597
|
+
* Handles selectors like ":root", "html body", "body.class", "body, .x", etc.
|
|
2598
|
+
*/
|
|
2599
|
+
function containsForbiddenSelector(selector) {
|
|
2600
|
+
const normalized = selector.toLowerCase().trim();
|
|
2601
|
+
if (!normalized) return true;
|
|
2602
|
+
if (hasScopeEscapingSiblingCombinator(selector)) return true;
|
|
2603
|
+
const parts = normalized.split(",");
|
|
2604
|
+
for (const part of parts) if (isForbiddenSelectorPart(part)) return true;
|
|
2605
|
+
return false;
|
|
2606
|
+
}
|
|
2607
|
+
/**
|
|
2608
|
+
* Validates a CSS selector for safety.
|
|
2609
|
+
*/
|
|
2610
|
+
const selectorSchema = z$1.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" });
|
|
2611
|
+
/**
|
|
2612
|
+
* Check if a CSS value contains a remote URL.
|
|
2613
|
+
*/
|
|
2614
|
+
function containsRemoteUrl(value) {
|
|
2615
|
+
return REMOTE_URL_PATTERN.test(value);
|
|
2616
|
+
}
|
|
2617
|
+
/**
|
|
2618
|
+
* Check if a CSS value contains a javascript: URL.
|
|
2619
|
+
*/
|
|
2620
|
+
function containsJavascriptUrl(value) {
|
|
2621
|
+
return JAVASCRIPT_URL_PATTERN.test(value);
|
|
2622
|
+
}
|
|
2623
|
+
/**
|
|
2624
|
+
* Validates a CSS declaration value for safety.
|
|
2625
|
+
* Allows: url(#id), url(data:...), url(/path), var(--)
|
|
2626
|
+
* Forbids: url(http...), url(//...), javascript:
|
|
2627
|
+
*/
|
|
2628
|
+
const declarationValueSchema = z$1.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" });
|
|
2629
|
+
/**
|
|
2630
|
+
* Schema for CSS declarations object (property -> value map).
|
|
2631
|
+
*/
|
|
2632
|
+
const declarationsSchema = z$1.record(z$1.string().min(1).max(100), declarationValueSchema);
|
|
2633
|
+
/**
|
|
2634
|
+
* Schema for a single custom CSS rule.
|
|
2635
|
+
*/
|
|
2636
|
+
const customCssRuleSchema = z$1.object({
|
|
2637
|
+
id: z$1.string().min(1, "Rule ID is required").max(50, "Rule ID too long"),
|
|
2638
|
+
selector: selectorSchema,
|
|
2639
|
+
declarations: declarationsSchema
|
|
2640
|
+
});
|
|
2641
|
+
/**
|
|
2642
|
+
* Schema for block-specific CSS rule.
|
|
2643
|
+
*/
|
|
2644
|
+
const blockCustomCssRuleSchema = customCssRuleSchema.extend({ blockKind: z$1.string().min(1, "Block kind is required").max(50, "Block kind too long") });
|
|
2645
|
+
/**
|
|
2646
|
+
* Array of custom CSS rules for theme-level styling.
|
|
2647
|
+
*/
|
|
2648
|
+
const customCssRulesSchema = z$1.array(customCssRuleSchema).optional();
|
|
2649
|
+
/**
|
|
2650
|
+
* Array of block-specific CSS rules.
|
|
2651
|
+
*/
|
|
2652
|
+
const blockCustomCssRulesSchema = z$1.array(blockCustomCssRuleSchema).optional();
|
|
2653
|
+
//#endregion
|
|
2654
|
+
//#region ../theme-core/src/customCss/atRuleValidation.ts
|
|
2655
|
+
/**
|
|
2656
|
+
* CSS At-Rule Validation Schemas
|
|
2657
|
+
*
|
|
2658
|
+
* Zod schemas for validating CSS at-rules.
|
|
2659
|
+
* Blocks @import for security.
|
|
2660
|
+
*/
|
|
2661
|
+
/** Valid keyframe offset values - requires % for numeric values */
|
|
2662
|
+
const KEYFRAME_OFFSET_PATTERN = /^(from|to|\d{1,3}%)$/i;
|
|
2663
|
+
/** Valid animation name (CSS identifier) */
|
|
2664
|
+
const ANIMATION_NAME_PATTERN = /^[a-zA-Z_-][a-zA-Z0-9_-]*$/;
|
|
2665
|
+
/** Blocked at-rules in raw CSS */
|
|
2666
|
+
const BLOCKED_AT_RULES = ["@import", "@charset"];
|
|
2667
|
+
/** Pattern to detect blocked at-rules */
|
|
2668
|
+
const BLOCKED_AT_RULE_PATTERN = /@(?:import|charset)\b/i;
|
|
2669
|
+
/** Rule ID schema - reused from main validation */
|
|
2670
|
+
const ruleIdSchema = z$1.string().min(1, "Rule ID is required").max(50, "Rule ID too long");
|
|
2671
|
+
/** Nested rule schema for @media and @supports */
|
|
2672
|
+
const nestedRuleSchema = z$1.object({
|
|
2673
|
+
selector: selectorSchema,
|
|
2674
|
+
declarations: declarationsSchema
|
|
2675
|
+
});
|
|
2676
|
+
/**
|
|
2677
|
+
* Validate keyframe offset is in valid range (0-100%).
|
|
2678
|
+
* Returns true for 'from', 'to', or numeric values 0-100.
|
|
2679
|
+
*/
|
|
2680
|
+
function isValidKeyframeOffset(offset) {
|
|
2681
|
+
const trimmed = offset.trim().toLowerCase();
|
|
2682
|
+
if (trimmed === "from" || trimmed === "to") return true;
|
|
2683
|
+
const match = trimmed.match(/^(\d{1,3})%$/);
|
|
2684
|
+
if (!match || match[1] === void 0) return false;
|
|
2685
|
+
const value = parseInt(match[1], 10);
|
|
2686
|
+
return value >= 0 && value <= 100;
|
|
2687
|
+
}
|
|
2688
|
+
/** Keyframe offset validation (0%, 50%, 100%, from, to) */
|
|
2689
|
+
const keyframeOffsetSchema = z$1.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%" });
|
|
2690
|
+
/** Animation name validation (CSS identifier) */
|
|
2691
|
+
const animationNameSchema = z$1.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)" });
|
|
2692
|
+
/** Single keyframe (offset + declarations) */
|
|
2693
|
+
const keyframeSchema = z$1.object({
|
|
2694
|
+
offset: keyframeOffsetSchema,
|
|
2695
|
+
declarations: declarationsSchema
|
|
2696
|
+
});
|
|
2697
|
+
/** @keyframes rule schema */
|
|
2698
|
+
const keyframesAtRuleSchema = z$1.object({
|
|
2699
|
+
id: ruleIdSchema,
|
|
2700
|
+
type: z$1.literal("keyframes"),
|
|
2701
|
+
name: animationNameSchema,
|
|
2702
|
+
frames: z$1.array(keyframeSchema).min(1, "At least one keyframe is required")
|
|
2703
|
+
});
|
|
2704
|
+
/** Font-face declarations - uses standard declarations but with font-specific validation */
|
|
2705
|
+
const fontFaceDeclarationsSchema = z$1.record(z$1.string().min(1).max(100), declarationValueSchema).refine((decls) => "fontFamily" in decls || "font-family" in decls, { message: "font-family is required in @font-face" });
|
|
2706
|
+
/** @font-face rule schema */
|
|
2707
|
+
const fontFaceAtRuleSchema = z$1.object({
|
|
2708
|
+
id: ruleIdSchema,
|
|
2709
|
+
type: z$1.literal("font-face"),
|
|
2710
|
+
declarations: fontFaceDeclarationsSchema
|
|
2711
|
+
});
|
|
2712
|
+
/** Media query string validation */
|
|
2713
|
+
const mediaQuerySchema = z$1.string().min(1, "Media query is required").max(200, "Media query too long");
|
|
2714
|
+
/** @media rule schema */
|
|
2715
|
+
const mediaAtRuleSchema = z$1.object({
|
|
2716
|
+
id: ruleIdSchema,
|
|
2717
|
+
type: z$1.literal("media"),
|
|
2718
|
+
query: mediaQuerySchema,
|
|
2719
|
+
rules: z$1.array(nestedRuleSchema).min(1, "At least one rule is required")
|
|
2720
|
+
});
|
|
2721
|
+
/** Supports condition string validation */
|
|
2722
|
+
const supportsConditionSchema = z$1.string().min(1, "Supports condition is required").max(200, "Supports condition too long");
|
|
2723
|
+
/** @supports rule schema */
|
|
2724
|
+
const supportsAtRuleSchema = z$1.object({
|
|
2725
|
+
id: ruleIdSchema,
|
|
2726
|
+
type: z$1.literal("supports"),
|
|
2727
|
+
condition: supportsConditionSchema,
|
|
2728
|
+
rules: z$1.array(nestedRuleSchema).min(1, "At least one rule is required")
|
|
2729
|
+
});
|
|
2730
|
+
/**
|
|
2731
|
+
* Check if raw CSS contains blocked at-rules.
|
|
2732
|
+
*/
|
|
2733
|
+
function containsBlockedAtRule(css) {
|
|
2734
|
+
return BLOCKED_AT_RULE_PATTERN.test(css);
|
|
2735
|
+
}
|
|
2736
|
+
/** Raw CSS validation - blocks @import, @charset, must start with @ */
|
|
2737
|
+
const rawCssSchema = z$1.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.` });
|
|
2738
|
+
/** Raw at-rule schema */
|
|
2739
|
+
const rawAtRuleSchema = z$1.object({
|
|
2740
|
+
id: ruleIdSchema,
|
|
2741
|
+
type: z$1.literal("raw"),
|
|
2742
|
+
css: rawCssSchema
|
|
2743
|
+
});
|
|
2744
|
+
/**
|
|
2745
|
+
* Discriminated union schema for all at-rule types.
|
|
2746
|
+
*/
|
|
2747
|
+
const customCssAtRuleSchema = z$1.discriminatedUnion("type", [
|
|
2748
|
+
keyframesAtRuleSchema,
|
|
2749
|
+
fontFaceAtRuleSchema,
|
|
2750
|
+
mediaAtRuleSchema,
|
|
2751
|
+
supportsAtRuleSchema,
|
|
2752
|
+
rawAtRuleSchema
|
|
2753
|
+
]);
|
|
2754
|
+
/**
|
|
2755
|
+
* Array of at-rules for theme-level styling.
|
|
2756
|
+
*/
|
|
2757
|
+
const customCssAtRulesSchema = z$1.array(customCssAtRuleSchema).optional();
|
|
2758
|
+
//#endregion
|
|
2759
|
+
//#region ../theme-core/src/shared/componentStyles.ts
|
|
2760
|
+
/**
|
|
2761
|
+
* Shared Component Style Schemas
|
|
2762
|
+
*
|
|
2763
|
+
* Reusable schemas for border and shadow styling that can be shared across
|
|
2764
|
+
* themed components (header, buttons, cards, accordions, inputs).
|
|
2765
|
+
*
|
|
2766
|
+
* Design decisions:
|
|
2767
|
+
* - Shadow elevation uses CSS-aligned names (none/sm/md/lg/xl/2xl)
|
|
2768
|
+
* - Shadow softness is controlled globally, not per-component
|
|
2769
|
+
* - Border position is component-specific, not in shared schema
|
|
2770
|
+
*/
|
|
2771
|
+
/**
|
|
2772
|
+
* Shared border schema for themed components.
|
|
2773
|
+
* Position is excluded - each component determines its own border position.
|
|
2774
|
+
*/
|
|
2775
|
+
const componentBorderSchema = z$1.object({
|
|
2776
|
+
width: z$1.enum([
|
|
2777
|
+
"none",
|
|
2778
|
+
"hairline",
|
|
2779
|
+
"thin",
|
|
2780
|
+
"medium",
|
|
2781
|
+
"thick"
|
|
2782
|
+
]).default("none"),
|
|
2783
|
+
style: z$1.enum(["solid", "dashed"]).default("solid"),
|
|
2784
|
+
colorToken: themeColorTokenSchema.optional()
|
|
2785
|
+
});
|
|
2786
|
+
/**
|
|
2787
|
+
* Shared shadow schema for themed components.
|
|
2788
|
+
* Softness is inherited from global theme, not configurable per-component.
|
|
2789
|
+
*/
|
|
2790
|
+
const componentShadowSchema = z$1.object({ elevation: z$1.enum([
|
|
2791
|
+
"none",
|
|
2792
|
+
"sm",
|
|
2793
|
+
"md",
|
|
2794
|
+
"lg",
|
|
2795
|
+
"xl",
|
|
2796
|
+
"2xl"
|
|
2797
|
+
]).default("sm") });
|
|
2798
|
+
//#endregion
|
|
2799
|
+
//#region ../theme-core/src/site-styles/types.ts
|
|
2800
|
+
function asSiteStyleId(value) {
|
|
2801
|
+
const siteStyleId = brandNonEmptyString(value, "SiteStyleId");
|
|
2802
|
+
if (!siteStyleId.startsWith("site-style:")) throw new Error(`SiteStyleId must start with "site-style:". Received: ${value}`);
|
|
2803
|
+
return siteStyleId;
|
|
2804
|
+
}
|
|
2805
|
+
function brandNonEmptyString(value, label) {
|
|
2806
|
+
if (value.length === 0) throw new Error(`${label} must be a non-empty string.`);
|
|
2807
|
+
return value;
|
|
2808
|
+
}
|
|
2809
|
+
const tileTreatmentValues = [
|
|
2810
|
+
"default",
|
|
2811
|
+
"quiet",
|
|
2812
|
+
"brand-depth"
|
|
2813
|
+
];
|
|
2814
|
+
const eventListTreatmentValues = [
|
|
2815
|
+
"plain",
|
|
2816
|
+
"lined-panel",
|
|
2817
|
+
"ruled-register",
|
|
2818
|
+
"editorial-register",
|
|
2819
|
+
"dense-index"
|
|
2820
|
+
];
|
|
2821
|
+
const eyebrowTreatmentValues = [
|
|
2822
|
+
"plain",
|
|
2823
|
+
"accent",
|
|
2824
|
+
"pill",
|
|
2825
|
+
"accent-pill",
|
|
2826
|
+
"pill-bounce",
|
|
2827
|
+
"accent-pill-bounce"
|
|
2828
|
+
];
|
|
2829
|
+
const visibleHeadingDecorationFamilyValues = ["organic-squiggle", "short-center-rule"];
|
|
2830
|
+
const headingDecorationOverrideValues = ["site-default", "off"];
|
|
2831
|
+
const headingDecorationColorTokenValues = [
|
|
2832
|
+
"text",
|
|
2833
|
+
"primary",
|
|
2834
|
+
"secondary",
|
|
2835
|
+
"accent",
|
|
2836
|
+
"border",
|
|
2837
|
+
"muted"
|
|
2838
|
+
];
|
|
2839
|
+
const accordionIconSetValues = [
|
|
2840
|
+
"plus",
|
|
2841
|
+
"chevron",
|
|
2842
|
+
"caret",
|
|
2843
|
+
"minimal-cross"
|
|
2844
|
+
];
|
|
2845
|
+
const accordionIconColorTokenValues = [
|
|
2846
|
+
"text",
|
|
2847
|
+
"muted",
|
|
2848
|
+
"primary",
|
|
2849
|
+
"secondary",
|
|
2850
|
+
"accent",
|
|
2851
|
+
"current"
|
|
2852
|
+
];
|
|
2853
|
+
const accordionIconMotionValues = [
|
|
2854
|
+
"none",
|
|
2855
|
+
"rotate",
|
|
2856
|
+
"swap"
|
|
2857
|
+
];
|
|
2858
|
+
//#endregion
|
|
2859
|
+
//#region ../theme-core/src/site-styles/logoBranding.ts
|
|
2860
|
+
const logoTextConfidenceValues = [
|
|
2861
|
+
"low",
|
|
2862
|
+
"medium",
|
|
2863
|
+
"high"
|
|
2864
|
+
];
|
|
2865
|
+
const logoAssetShapeValues = [
|
|
2866
|
+
"none",
|
|
2867
|
+
"horizontal",
|
|
2868
|
+
"square",
|
|
2869
|
+
"portrait",
|
|
2870
|
+
"tall"
|
|
2871
|
+
];
|
|
2872
|
+
const logoKindValues = [
|
|
2873
|
+
"mark",
|
|
2874
|
+
"wordmark",
|
|
2875
|
+
"lockup",
|
|
2876
|
+
"badge",
|
|
2877
|
+
"stacked-wordmark",
|
|
2878
|
+
"unknown"
|
|
2879
|
+
];
|
|
2880
|
+
const logoDensityValues = [
|
|
2881
|
+
"simple",
|
|
2882
|
+
"detailed",
|
|
2883
|
+
"unknown"
|
|
2884
|
+
];
|
|
2885
|
+
const logoContainsTextSchema = z$1.discriminatedUnion("kind", [
|
|
2886
|
+
z$1.object({
|
|
2887
|
+
kind: z$1.literal("contains-text"),
|
|
2888
|
+
confidence: z$1.enum(logoTextConfidenceValues),
|
|
2889
|
+
text: z$1.string().trim().min(1).max(200).optional()
|
|
2890
|
+
}),
|
|
2891
|
+
z$1.object({
|
|
2892
|
+
kind: z$1.literal("no-text"),
|
|
2893
|
+
confidence: z$1.enum(logoTextConfidenceValues)
|
|
2894
|
+
}),
|
|
2895
|
+
z$1.object({
|
|
2896
|
+
kind: z$1.literal("unknown"),
|
|
2897
|
+
reason: z$1.enum([
|
|
2898
|
+
"analysis-unavailable",
|
|
2899
|
+
"unsupported-file",
|
|
2900
|
+
"low-confidence"
|
|
2901
|
+
])
|
|
2902
|
+
})
|
|
2903
|
+
]);
|
|
2904
|
+
const logoAnalysisSourceSchema = z$1.discriminatedUnion("kind", [
|
|
2905
|
+
z$1.object({ kind: z$1.literal("none") }),
|
|
2906
|
+
z$1.object({
|
|
2907
|
+
kind: z$1.literal("deterministic"),
|
|
2908
|
+
reason: z$1.enum(["dimensions", "fallback"])
|
|
2909
|
+
}),
|
|
2910
|
+
z$1.object({
|
|
2911
|
+
kind: z$1.literal("llm"),
|
|
2912
|
+
model: z$1.literal("gpt-5.4-mini"),
|
|
2913
|
+
analyzedAt: z$1.string().trim().min(1).max(80).optional()
|
|
2914
|
+
}),
|
|
2915
|
+
z$1.object({ kind: z$1.literal("manual-override") })
|
|
2916
|
+
]);
|
|
2917
|
+
z$1.object({
|
|
2918
|
+
shape: z$1.enum(logoAssetShapeValues),
|
|
2919
|
+
containsText: logoContainsTextSchema,
|
|
2920
|
+
kind: z$1.enum(logoKindValues),
|
|
2921
|
+
density: z$1.enum(logoDensityValues),
|
|
2922
|
+
source: logoAnalysisSourceSchema
|
|
2923
|
+
});
|
|
2924
|
+
const brandDisplayModeValues = [
|
|
2925
|
+
"auto",
|
|
2926
|
+
"logo-only",
|
|
2927
|
+
"logo-plus-title",
|
|
2928
|
+
"title-only"
|
|
2929
|
+
];
|
|
2930
|
+
const logoAccommodationPatternValues = [
|
|
2931
|
+
"title-only",
|
|
2932
|
+
"inline-logo-only",
|
|
2933
|
+
"inline-wordmark",
|
|
2934
|
+
"inline-mark-with-title",
|
|
2935
|
+
"logo-plate",
|
|
2936
|
+
"centered-badge",
|
|
2937
|
+
"popout-badge",
|
|
2938
|
+
"centered-masthead",
|
|
2939
|
+
"hero-badge"
|
|
2940
|
+
];
|
|
2941
|
+
const logoSizePolicyValues = [
|
|
2942
|
+
"auto",
|
|
2943
|
+
"compact",
|
|
2944
|
+
"standard",
|
|
2945
|
+
"generous",
|
|
2946
|
+
"display"
|
|
2947
|
+
];
|
|
2948
|
+
//#endregion
|
|
2949
|
+
//#region ../theme-core/src/site-styles/rawStyleFields.ts
|
|
2950
|
+
const themeV2RuntimeStyleFieldNames = [
|
|
2951
|
+
"_frameStyles",
|
|
2952
|
+
"_sectionStyles",
|
|
2953
|
+
"_containerStyles",
|
|
2954
|
+
"_cardStyles",
|
|
2955
|
+
"_transitionStyles",
|
|
2956
|
+
"styleGroup"
|
|
2957
|
+
];
|
|
2958
|
+
const themeV2BlockSpecificRawStyleFieldNames = [
|
|
2959
|
+
"_contentCardStyles",
|
|
2960
|
+
"_heroLayoutStyles",
|
|
2961
|
+
"_textCardStyles"
|
|
2962
|
+
];
|
|
2963
|
+
const themeV2NormalEditorRawStyleFieldNames = [...themeV2RuntimeStyleFieldNames, ...themeV2BlockSpecificRawStyleFieldNames];
|
|
2964
|
+
new Set(themeV2NormalEditorRawStyleFieldNames);
|
|
2965
|
+
[...themeV2RuntimeStyleFieldNames, ...themeV2BlockSpecificRawStyleFieldNames];
|
|
2966
|
+
const pageDesignEditorBackgroundOverrideOwner = "page-design-editor";
|
|
2967
|
+
const siteChromeBackgroundOverrideOwner = "site-chrome-editor";
|
|
2968
|
+
//#endregion
|
|
2969
|
+
//#region ../theme-core/src/utils/tokenOrColor.ts
|
|
2970
|
+
/**
|
|
2971
|
+
* Runtime color-reference fields intentionally accept any string, including
|
|
2972
|
+
* the legacy empty-string "no color" sentinel. Semantic validation needs
|
|
2973
|
+
* palette context and happens in `parseThemeColorReference`.
|
|
2974
|
+
*/
|
|
2975
|
+
const tokenOrCssColorValueSchema = z$1.string();
|
|
2976
|
+
const CSS_COLOR_FUNCTION_PATTERN = /^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color|color-mix|light-dark)\(/i;
|
|
2977
|
+
const CSS_HEX_COLOR_PATTERN = /^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i;
|
|
2978
|
+
const CSS_COLOR_KEYWORDS = /* @__PURE__ */ new Set([
|
|
2979
|
+
"transparent",
|
|
2980
|
+
"currentcolor",
|
|
2981
|
+
"inherit",
|
|
2982
|
+
"initial",
|
|
2983
|
+
"revert",
|
|
2984
|
+
"revert-layer",
|
|
2985
|
+
"unset"
|
|
2986
|
+
]);
|
|
2987
|
+
const COMMON_CSS_NAMED_COLORS = /* @__PURE__ */ new Set([
|
|
2988
|
+
"black",
|
|
2989
|
+
"blue",
|
|
2990
|
+
"gray",
|
|
2991
|
+
"green",
|
|
2992
|
+
"grey",
|
|
2993
|
+
"orange",
|
|
2994
|
+
"pink",
|
|
2995
|
+
"purple",
|
|
2996
|
+
"red",
|
|
2997
|
+
"white",
|
|
2998
|
+
"yellow"
|
|
2999
|
+
]);
|
|
3000
|
+
function isCssColorLiteral(value) {
|
|
3001
|
+
const trimmed = value.trim();
|
|
3002
|
+
if (!trimmed) return false;
|
|
3003
|
+
return CSS_HEX_COLOR_PATTERN.test(trimmed) || CSS_COLOR_FUNCTION_PATTERN.test(trimmed) || /^var\(/i.test(trimmed) || CSS_COLOR_KEYWORDS.has(trimmed.toLowerCase());
|
|
3004
|
+
}
|
|
3005
|
+
function parseThemeToken(token) {
|
|
3006
|
+
const trimmed = token.trim();
|
|
3007
|
+
const match = trimmed.match(/^(.*?)-(\d{2,3})$/);
|
|
3008
|
+
if (!match) return {
|
|
3009
|
+
role: trimmed,
|
|
3010
|
+
shade: null
|
|
3011
|
+
};
|
|
3012
|
+
const role = match[1] ?? trimmed;
|
|
3013
|
+
const shade = match[2] ? Number(match[2]) : null;
|
|
3014
|
+
return {
|
|
3015
|
+
role,
|
|
3016
|
+
shade: Number.isFinite(shade) ? shade : null
|
|
3017
|
+
};
|
|
3018
|
+
}
|
|
3019
|
+
function parseContextThemeColorToken(value, context) {
|
|
3020
|
+
const parts = parseColorTokenParts(value);
|
|
3021
|
+
if (parts.kind !== "token") return null;
|
|
3022
|
+
if (!(Boolean(context?.palette?.[value.trim()]) || parts.opacityPercent !== null && Boolean(context?.palette?.[parts.token]))) return null;
|
|
3023
|
+
return value.trim();
|
|
3024
|
+
}
|
|
3025
|
+
function isTokenShapedTypo(value) {
|
|
3026
|
+
if (COMMON_CSS_NAMED_COLORS.has(value.toLowerCase())) return false;
|
|
3027
|
+
if (!/^[a-zA-Z][a-zA-Z0-9]*(?:-[a-zA-Z0-9]+)*(?:\/[^/]+)?$/.test(value)) return false;
|
|
3028
|
+
return !isCssColorLiteral(value);
|
|
3029
|
+
}
|
|
3030
|
+
function warnUnknownThemeColorReference(value) {
|
|
3031
|
+
if (!isTokenShapedTypo(value)) return;
|
|
3032
|
+
console.warn(`[theme-core] Unknown Theme V2 color token "${value}" treated as literal CSS. Use raw:* for deliberate custom CSS values.`);
|
|
3033
|
+
}
|
|
3034
|
+
function parseThemeColorReference(input, context) {
|
|
3035
|
+
const trimmed = input.trim();
|
|
3036
|
+
if (trimmed.startsWith("raw:")) return {
|
|
3037
|
+
kind: "literal-css",
|
|
3038
|
+
value: trimmed.slice(4)
|
|
3039
|
+
};
|
|
3040
|
+
const contextToken = parseContextThemeColorToken(trimmed, context);
|
|
3041
|
+
if (contextToken) return {
|
|
3042
|
+
kind: "palette-context-token",
|
|
3043
|
+
token: contextToken
|
|
3044
|
+
};
|
|
3045
|
+
const knownToken = parseThemeColorToken(trimmed);
|
|
3046
|
+
if (knownToken) return {
|
|
3047
|
+
kind: "theme-token",
|
|
3048
|
+
token: knownToken
|
|
3049
|
+
};
|
|
3050
|
+
warnUnknownThemeColorReference(trimmed);
|
|
3051
|
+
return {
|
|
3052
|
+
kind: "literal-css",
|
|
3053
|
+
value: trimmed
|
|
3054
|
+
};
|
|
3055
|
+
}
|
|
3056
|
+
function resolveThemeColorReferenceValue(input, context) {
|
|
3057
|
+
const reference = parseThemeColorReference(input, context);
|
|
3058
|
+
return reference.kind === "literal-css" ? reference.value : rgbColorValue(reference.token);
|
|
3059
|
+
}
|
|
3060
|
+
function resolveTokenOrCssColorValue(input, context) {
|
|
3061
|
+
return resolveThemeColorReferenceValue(input, context);
|
|
3062
|
+
}
|
|
3063
|
+
function resolveOnColorForThemeToken(token) {
|
|
3064
|
+
if (!parseThemeColorToken(token)) return null;
|
|
3065
|
+
const parts = parseColorTokenParts(token);
|
|
3066
|
+
if (parts.kind !== "token") return null;
|
|
3067
|
+
const { role, shade } = parseThemeToken(parts.token);
|
|
3068
|
+
const normalizedRole = role.trim();
|
|
3069
|
+
if (!normalizedRole) return null;
|
|
3070
|
+
if (!shade) return rgbColorValue(`on${normalizedRole.charAt(0).toUpperCase() + normalizedRole.slice(1)}`);
|
|
3071
|
+
return shade <= 400 ? "#000000" : "#FFFFFF";
|
|
3072
|
+
}
|
|
3073
|
+
//#endregion
|
|
3074
|
+
//#region ../theme-core/src/schema.ts
|
|
3075
|
+
const axesSchema = z$1.object({
|
|
3076
|
+
tone: z$1.enum([
|
|
3077
|
+
"minimal",
|
|
3078
|
+
"classic",
|
|
3079
|
+
"bold"
|
|
3080
|
+
]),
|
|
3081
|
+
energy: z$1.enum(["calm", "vibrant"]),
|
|
3082
|
+
density: z$1.enum([
|
|
3083
|
+
"airy",
|
|
3084
|
+
"regular",
|
|
3085
|
+
"compact"
|
|
3086
|
+
]),
|
|
3087
|
+
mediaBias: z$1.enum([
|
|
3088
|
+
"text",
|
|
3089
|
+
"media",
|
|
3090
|
+
"mixed"
|
|
3091
|
+
]),
|
|
3092
|
+
conversionBias: z$1.enum([
|
|
3093
|
+
"low",
|
|
3094
|
+
"med",
|
|
3095
|
+
"high"
|
|
3096
|
+
]),
|
|
3097
|
+
motion: z$1.enum([
|
|
3098
|
+
"subtle",
|
|
3099
|
+
"standard",
|
|
3100
|
+
"expressive"
|
|
3101
|
+
])
|
|
3102
|
+
});
|
|
3103
|
+
const colourHexString = z$1.string().regex(/^#([0-9A-Fa-f]{3}){1,2}$/);
|
|
3104
|
+
const paletteColorSchema = z$1.object({
|
|
3105
|
+
name: z$1.string().min(1),
|
|
3106
|
+
hex: colourHexString
|
|
3107
|
+
});
|
|
3108
|
+
const paletteMetaSchema = z$1.object({ mode: z$1.enum(["light", "dark"]) });
|
|
3109
|
+
const paletteSchema = z$1.object({
|
|
3110
|
+
colors: z$1.array(paletteColorSchema),
|
|
3111
|
+
meta: paletteMetaSchema
|
|
3112
|
+
});
|
|
3113
|
+
const typographyStyleSchema = z$1.object({
|
|
3114
|
+
family: z$1.string().min(1),
|
|
3115
|
+
weight: z$1.enum([
|
|
3116
|
+
"light",
|
|
3117
|
+
"regular",
|
|
3118
|
+
"medium",
|
|
3119
|
+
"semibold",
|
|
3120
|
+
"bold"
|
|
3121
|
+
]),
|
|
3122
|
+
letterSpacing: z$1.enum([
|
|
3123
|
+
"tight",
|
|
3124
|
+
"normal",
|
|
3125
|
+
"loose"
|
|
3126
|
+
]),
|
|
3127
|
+
lineHeight: z$1.enum([
|
|
3128
|
+
"normal",
|
|
3129
|
+
"relaxed",
|
|
3130
|
+
"loose"
|
|
3131
|
+
])
|
|
3132
|
+
});
|
|
3133
|
+
const bodyTypographyStyleSchema = typographyStyleSchema.extend({ size: z$1.enum([
|
|
3134
|
+
"md",
|
|
3135
|
+
"lg",
|
|
3136
|
+
"xl"
|
|
3137
|
+
]) });
|
|
3138
|
+
const headingSizeSchema = z$1.enum([
|
|
3139
|
+
"xs",
|
|
3140
|
+
"sm",
|
|
3141
|
+
"md",
|
|
3142
|
+
"lg",
|
|
3143
|
+
"xl",
|
|
3144
|
+
"2xl"
|
|
3145
|
+
]);
|
|
3146
|
+
const headingTypographyOverridesSchema = z$1.object({
|
|
3147
|
+
weight: z$1.enum([
|
|
3148
|
+
"light",
|
|
3149
|
+
"regular",
|
|
3150
|
+
"medium",
|
|
3151
|
+
"semibold",
|
|
3152
|
+
"bold"
|
|
3153
|
+
]).nullable().optional(),
|
|
3154
|
+
letterSpacing: z$1.enum([
|
|
3155
|
+
"tight",
|
|
3156
|
+
"normal",
|
|
3157
|
+
"loose"
|
|
3158
|
+
]).nullable().optional(),
|
|
3159
|
+
size: headingSizeSchema.nullable().optional(),
|
|
3160
|
+
lineHeight: z$1.enum([
|
|
3161
|
+
"tight",
|
|
3162
|
+
"snug",
|
|
3163
|
+
"normal",
|
|
3164
|
+
"relaxed",
|
|
3165
|
+
"loose"
|
|
3166
|
+
]).nullable().optional(),
|
|
3167
|
+
italic: z$1.boolean().nullable().optional(),
|
|
3168
|
+
colorToken: themeColorTokenSchema.nullable().optional()
|
|
3169
|
+
});
|
|
3170
|
+
const headingTypographyStyleSchema = typographyStyleSchema.extend({
|
|
3171
|
+
case: z$1.enum([
|
|
3172
|
+
"uppercase",
|
|
3173
|
+
"normal",
|
|
3174
|
+
"smallCaps"
|
|
3175
|
+
]).nullable(),
|
|
3176
|
+
italic: z$1.boolean().nullable(),
|
|
3177
|
+
colorToken: themeColorTokenSchema.nullable().optional()
|
|
3178
|
+
});
|
|
3179
|
+
const proseLinkUnderlineStyleSchema = z$1.enum([
|
|
3180
|
+
"solid",
|
|
3181
|
+
"dotted",
|
|
3182
|
+
"dashed"
|
|
3183
|
+
]);
|
|
3184
|
+
const proseLinkUnderlineThicknessSchema = z$1.enum([
|
|
3185
|
+
"auto",
|
|
3186
|
+
"fromFont",
|
|
3187
|
+
"thin",
|
|
3188
|
+
"medium",
|
|
3189
|
+
"thick"
|
|
3190
|
+
]);
|
|
3191
|
+
const proseLinkUnderlineOffsetSchema = z$1.enum([
|
|
3192
|
+
"auto",
|
|
3193
|
+
"tight",
|
|
3194
|
+
"normal",
|
|
3195
|
+
"loose"
|
|
3196
|
+
]);
|
|
3197
|
+
const proseLinkStyleSchema = z$1.object({
|
|
3198
|
+
colorToken: themeColorTokenSchema.optional(),
|
|
3199
|
+
hoverColorToken: themeColorTokenSchema.optional(),
|
|
3200
|
+
underline: z$1.boolean().optional(),
|
|
3201
|
+
decorationColorToken: themeColorTokenSchema.optional(),
|
|
3202
|
+
hoverDecorationColorToken: themeColorTokenSchema.optional(),
|
|
3203
|
+
underlineStyle: proseLinkUnderlineStyleSchema.optional(),
|
|
3204
|
+
underlineThickness: proseLinkUnderlineThicknessSchema.optional(),
|
|
3205
|
+
underlineOffset: proseLinkUnderlineOffsetSchema.optional()
|
|
3206
|
+
});
|
|
3207
|
+
const semanticSpacingSchema = z$1.enum([
|
|
3208
|
+
"none",
|
|
3209
|
+
"compact",
|
|
3210
|
+
"cozy",
|
|
3211
|
+
"medium",
|
|
3212
|
+
"comfortable",
|
|
3213
|
+
"spacious"
|
|
3214
|
+
]);
|
|
3215
|
+
const boxRoundedSchema = z$1.enum([
|
|
3216
|
+
"none",
|
|
3217
|
+
"sm",
|
|
3218
|
+
"md",
|
|
3219
|
+
"lg",
|
|
3220
|
+
"xl",
|
|
3221
|
+
"2xl",
|
|
3222
|
+
"full"
|
|
3223
|
+
]);
|
|
3224
|
+
const boxBackgroundOverlaySchema = z$1.object({
|
|
3225
|
+
type: z$1.enum([
|
|
3226
|
+
"none",
|
|
3227
|
+
"color",
|
|
3228
|
+
"gradient"
|
|
3229
|
+
]).nullable().optional(),
|
|
3230
|
+
color: tokenOrCssColorValueSchema.nullable().optional(),
|
|
3231
|
+
gradient: z$1.string().nullable().optional(),
|
|
3232
|
+
opacity: z$1.number().min(0).max(1).nullable().optional()
|
|
3233
|
+
});
|
|
3234
|
+
const boxBackgroundSchema = z$1.object({
|
|
3235
|
+
type: z$1.enum([
|
|
3236
|
+
"color",
|
|
3237
|
+
"gradient",
|
|
3238
|
+
"image"
|
|
3239
|
+
]).optional(),
|
|
3240
|
+
contentOwner: z$1.literal(pageDesignEditorBackgroundOverrideOwner).optional(),
|
|
3241
|
+
color: tokenOrCssColorValueSchema.nullable().optional(),
|
|
3242
|
+
gradient: z$1.string().nullable().optional(),
|
|
3243
|
+
gradientPresetId: z$1.string().min(1).nullable().optional(),
|
|
3244
|
+
image: mediaSchema$1.nullable().optional(),
|
|
3245
|
+
objectFit: z$1.enum([
|
|
3246
|
+
"fill",
|
|
3247
|
+
"fit",
|
|
3248
|
+
"original",
|
|
3249
|
+
"custom"
|
|
3250
|
+
]).nullable().optional(),
|
|
3251
|
+
scale: z$1.string().nullable().optional(),
|
|
3252
|
+
position: z$1.string().nullable().optional(),
|
|
3253
|
+
opacity: z$1.number().min(0).max(1).nullable().optional(),
|
|
3254
|
+
motion: z$1.enum(["static", "fixed-frame"]).nullable().optional(),
|
|
3255
|
+
overlay: boxBackgroundOverlaySchema.nullable().optional(),
|
|
3256
|
+
textColor: tokenOrCssColorValueSchema.nullable().optional(),
|
|
3257
|
+
headingColor: tokenOrCssColorValueSchema.nullable().optional(),
|
|
3258
|
+
linkColor: tokenOrCssColorValueSchema.nullable().optional(),
|
|
3259
|
+
supportingColor: tokenOrCssColorValueSchema.nullable().optional()
|
|
3260
|
+
});
|
|
3261
|
+
const noHeadingDecorationSchema = z$1.object({ family: z$1.literal("none") });
|
|
3262
|
+
const visibleHeadingDecorationSchema = z$1.object({
|
|
3263
|
+
family: z$1.enum(visibleHeadingDecorationFamilyValues),
|
|
3264
|
+
colorToken: z$1.enum(headingDecorationColorTokenValues).optional()
|
|
3265
|
+
});
|
|
3266
|
+
const headingDecorationSchema = z$1.union([noHeadingDecorationSchema, visibleHeadingDecorationSchema]);
|
|
3267
|
+
const headingDecorationOverrideSchema = z$1.union([z$1.enum(headingDecorationOverrideValues), z$1.literal("on").transform(() => "site-default")]);
|
|
3268
|
+
const accordionIconTreatmentSchema = z$1.object({
|
|
3269
|
+
iconSet: z$1.enum(accordionIconSetValues),
|
|
3270
|
+
colorToken: z$1.enum(accordionIconColorTokenValues),
|
|
3271
|
+
openColorToken: z$1.enum(accordionIconColorTokenValues).optional(),
|
|
3272
|
+
motion: z$1.enum(accordionIconMotionValues)
|
|
3273
|
+
});
|
|
3274
|
+
const sectionStylesOverrideSchema = z$1.object({
|
|
3275
|
+
background: boxBackgroundSchema.nullable().optional(),
|
|
3276
|
+
spacing: semanticSpacingSchema.nullable().optional(),
|
|
3277
|
+
minHeight: z$1.enum([
|
|
3278
|
+
"none",
|
|
3279
|
+
"banner",
|
|
3280
|
+
"hero",
|
|
3281
|
+
"immersive"
|
|
3282
|
+
]).nullable().optional(),
|
|
3283
|
+
tileTreatment: z$1.enum(tileTreatmentValues).nullable().optional(),
|
|
3284
|
+
eventListTreatment: z$1.enum(eventListTreatmentValues).nullable().optional(),
|
|
3285
|
+
eyebrowTreatment: z$1.enum(eyebrowTreatmentValues).nullable().optional(),
|
|
3286
|
+
headingDecoration: headingDecorationSchema.nullable().optional(),
|
|
3287
|
+
headingDecorationOverride: headingDecorationOverrideSchema.nullable().optional(),
|
|
3288
|
+
accordionIconTreatment: accordionIconTreatmentSchema.nullable().optional()
|
|
3289
|
+
});
|
|
3290
|
+
const containerStylesOverrideSchema = z$1.object({
|
|
3291
|
+
background: boxBackgroundSchema.nullable().optional(),
|
|
3292
|
+
spacing: semanticSpacingSchema.nullable().optional(),
|
|
3293
|
+
raised: z$1.boolean().nullable().optional(),
|
|
3294
|
+
rounded: boxRoundedSchema.nullable().optional(),
|
|
3295
|
+
fullWidth: z$1.boolean().nullable().optional()
|
|
3296
|
+
});
|
|
3297
|
+
const cardBorderOverrideSchema = z$1.object({
|
|
3298
|
+
enabled: z$1.boolean().nullable().optional(),
|
|
3299
|
+
width: z$1.enum([
|
|
3300
|
+
"none",
|
|
3301
|
+
"1",
|
|
3302
|
+
"2",
|
|
3303
|
+
"3"
|
|
3304
|
+
]).nullable().optional(),
|
|
3305
|
+
colorToken: themeColorTokenSchema.nullable().optional()
|
|
3306
|
+
});
|
|
3307
|
+
const cardStylesOverrideSchema = z$1.object({
|
|
3308
|
+
background: boxBackgroundSchema.nullable().optional(),
|
|
3309
|
+
border: cardBorderOverrideSchema.nullable().optional(),
|
|
3310
|
+
spacing: semanticSpacingSchema.nullable().optional(),
|
|
3311
|
+
raised: z$1.boolean().nullable().optional(),
|
|
3312
|
+
rounded: boxRoundedSchema.nullable().optional(),
|
|
3313
|
+
treatment: z$1.enum([
|
|
3314
|
+
"accent-quote",
|
|
3315
|
+
"editorial-rule",
|
|
3316
|
+
"soft-panel",
|
|
3317
|
+
"editorial-serif-quote",
|
|
3318
|
+
"editorial-open",
|
|
3319
|
+
"color-blocked"
|
|
3320
|
+
]).nullable().optional(),
|
|
3321
|
+
cardVariant: boxStylesCardVariantSchema.nullable().optional()
|
|
3322
|
+
});
|
|
3323
|
+
const blockStyleOverridesSchema = z$1.object({
|
|
3324
|
+
sectionStyles: sectionStylesOverrideSchema.nullable().optional(),
|
|
3325
|
+
containerStyles: containerStylesOverrideSchema.nullable().optional(),
|
|
3326
|
+
cardStyles: cardStylesOverrideSchema.nullable().optional()
|
|
3327
|
+
});
|
|
3328
|
+
const blockThemeOverrideSchema = z$1.object({
|
|
3329
|
+
typography: z$1.object({ proseLinkStyle: proseLinkStyleSchema.optional() }).optional(),
|
|
3330
|
+
styles: blockStyleOverridesSchema.optional()
|
|
3331
|
+
});
|
|
3332
|
+
const typographyScaleSchema = z$1.enum([
|
|
3333
|
+
"compact",
|
|
3334
|
+
"balanced",
|
|
3335
|
+
"spacious",
|
|
3336
|
+
"minorThird",
|
|
3337
|
+
"majorThird",
|
|
3338
|
+
"perfectFourth"
|
|
3339
|
+
]);
|
|
3340
|
+
const eyebrowTypographyStyleSchema = z$1.object({
|
|
3341
|
+
family: z$1.string().min(1),
|
|
3342
|
+
size: z$1.enum([
|
|
3343
|
+
"sm",
|
|
3344
|
+
"md",
|
|
3345
|
+
"lg"
|
|
3346
|
+
]).optional(),
|
|
3347
|
+
weight: z$1.enum([
|
|
3348
|
+
"light",
|
|
3349
|
+
"regular",
|
|
3350
|
+
"medium",
|
|
3351
|
+
"semibold",
|
|
3352
|
+
"bold"
|
|
3353
|
+
]).optional(),
|
|
3354
|
+
letterSpacing: z$1.enum([
|
|
3355
|
+
"tight",
|
|
3356
|
+
"normal",
|
|
3357
|
+
"loose",
|
|
3358
|
+
"wide"
|
|
3359
|
+
]).optional(),
|
|
3360
|
+
case: z$1.enum(["uppercase", "normal"]).optional()
|
|
3361
|
+
});
|
|
3362
|
+
const typographySchema = z$1.object({
|
|
3363
|
+
body: bodyTypographyStyleSchema,
|
|
3364
|
+
headings: z$1.object({
|
|
3365
|
+
default: headingTypographyStyleSchema,
|
|
3366
|
+
h1: headingTypographyOverridesSchema,
|
|
3367
|
+
h2: headingTypographyOverridesSchema,
|
|
3368
|
+
h3: headingTypographyOverridesSchema,
|
|
3369
|
+
h4: headingTypographyOverridesSchema.optional(),
|
|
3370
|
+
h5: headingTypographyOverridesSchema.optional(),
|
|
3371
|
+
h6: headingTypographyOverridesSchema.optional()
|
|
3372
|
+
}),
|
|
3373
|
+
scale: typographyScaleSchema,
|
|
3374
|
+
proseLinkStyle: proseLinkStyleSchema.optional(),
|
|
3375
|
+
eyebrow: eyebrowTypographyStyleSchema.optional()
|
|
3376
|
+
});
|
|
3377
|
+
const spaceSchema = z$1.enum([
|
|
3378
|
+
"comfortable",
|
|
3379
|
+
"standard",
|
|
3380
|
+
"dense"
|
|
3381
|
+
]);
|
|
3382
|
+
const corners = z$1.enum([
|
|
3383
|
+
"square",
|
|
3384
|
+
"soft",
|
|
3385
|
+
"rounded",
|
|
3386
|
+
"pill"
|
|
3387
|
+
]);
|
|
3388
|
+
const shadow = z$1.object({
|
|
3389
|
+
elevation: z$1.enum([
|
|
3390
|
+
"none",
|
|
3391
|
+
"low",
|
|
3392
|
+
"medium",
|
|
3393
|
+
"high"
|
|
3394
|
+
]),
|
|
3395
|
+
softness: z$1.enum([
|
|
3396
|
+
"crisp",
|
|
3397
|
+
"soft",
|
|
3398
|
+
"hard"
|
|
3399
|
+
]).nullable(),
|
|
3400
|
+
position: z$1.enum(["bottom", "bottom-right"]).default("bottom"),
|
|
3401
|
+
colorToken: themeColorTokenSchema.optional()
|
|
3402
|
+
});
|
|
3403
|
+
const border = z$1.object({
|
|
3404
|
+
width: z$1.enum([
|
|
3405
|
+
"none",
|
|
3406
|
+
"hairline",
|
|
3407
|
+
"thin",
|
|
3408
|
+
"thick"
|
|
3409
|
+
]),
|
|
3410
|
+
style: z$1.enum(["solid", "dashed"])
|
|
3411
|
+
});
|
|
3412
|
+
const motion = z$1.object({
|
|
3413
|
+
level: z$1.enum([
|
|
3414
|
+
"off",
|
|
3415
|
+
"low",
|
|
3416
|
+
"medium",
|
|
3417
|
+
"high"
|
|
3418
|
+
]),
|
|
3419
|
+
easing: z$1.enum([
|
|
3420
|
+
"standard",
|
|
3421
|
+
"snappy",
|
|
3422
|
+
"gentle"
|
|
3423
|
+
]).nullable()
|
|
3424
|
+
});
|
|
3425
|
+
z$1.object({ shape: corners });
|
|
3426
|
+
z$1.object({
|
|
3427
|
+
elevation: z$1.enum([
|
|
3428
|
+
"none",
|
|
3429
|
+
"low",
|
|
3430
|
+
"medium",
|
|
3431
|
+
"high"
|
|
3432
|
+
]),
|
|
3433
|
+
border: z$1.enum([
|
|
3434
|
+
"none",
|
|
3435
|
+
"subtle",
|
|
3436
|
+
"defined"
|
|
3437
|
+
]),
|
|
3438
|
+
shape: corners,
|
|
3439
|
+
headerStyle: z$1.enum([
|
|
3440
|
+
"plain",
|
|
3441
|
+
"accentBar",
|
|
3442
|
+
"subtleBg"
|
|
3443
|
+
]).nullable(),
|
|
3444
|
+
mediaTreatment: z$1.enum([
|
|
3445
|
+
"square",
|
|
3446
|
+
"rounded",
|
|
3447
|
+
"bleed"
|
|
3448
|
+
]).nullable()
|
|
3449
|
+
});
|
|
3450
|
+
const inputStyle = z$1.object({
|
|
3451
|
+
shape: corners,
|
|
3452
|
+
border: z$1.enum([
|
|
3453
|
+
"subtle",
|
|
3454
|
+
"defined",
|
|
3455
|
+
"underline"
|
|
3456
|
+
]),
|
|
3457
|
+
focus: z$1.enum([
|
|
3458
|
+
"glow",
|
|
3459
|
+
"ring",
|
|
3460
|
+
"underline"
|
|
3461
|
+
]),
|
|
3462
|
+
label: z$1.enum(["inside", "above"])
|
|
3463
|
+
});
|
|
3464
|
+
const headerVariant = z$1.enum([
|
|
3465
|
+
"classic",
|
|
3466
|
+
"centered",
|
|
3467
|
+
"transparent",
|
|
3468
|
+
"floating"
|
|
3469
|
+
]);
|
|
3470
|
+
const headerPositioning = z$1.enum([
|
|
3471
|
+
"static",
|
|
3472
|
+
"sticky",
|
|
3473
|
+
"fixed"
|
|
3474
|
+
]);
|
|
3475
|
+
const headerNavStyle = z$1.enum([
|
|
3476
|
+
"minimal",
|
|
3477
|
+
"underline",
|
|
3478
|
+
"underline-grow",
|
|
3479
|
+
"capsule",
|
|
3480
|
+
"scale",
|
|
3481
|
+
"frosted",
|
|
3482
|
+
"solid"
|
|
3483
|
+
]);
|
|
3484
|
+
const navFontWeight = z$1.enum([
|
|
3485
|
+
"regular",
|
|
3486
|
+
"medium",
|
|
3487
|
+
"semibold",
|
|
3488
|
+
"bold"
|
|
3489
|
+
]);
|
|
3490
|
+
const headerMaxWidth = z$1.enum(["container", "full"]);
|
|
3491
|
+
const headerBarFrame = z$1.enum(["full-bleed", "inset-shell"]);
|
|
3492
|
+
const headerContainerSchema = z$1.object({
|
|
3493
|
+
rounded: z$1.enum([
|
|
3494
|
+
"none",
|
|
3495
|
+
"sm",
|
|
3496
|
+
"md",
|
|
3497
|
+
"lg",
|
|
3498
|
+
"xl",
|
|
3499
|
+
"2xl"
|
|
3500
|
+
]).default("xl"),
|
|
3501
|
+
border: z$1.boolean().default(true),
|
|
3502
|
+
shadow: z$1.boolean().default(true),
|
|
3503
|
+
padding: z$1.enum([
|
|
3504
|
+
"sm",
|
|
3505
|
+
"md",
|
|
3506
|
+
"lg"
|
|
3507
|
+
]).default("md"),
|
|
3508
|
+
tint: z$1.string().nullable().optional(),
|
|
3509
|
+
opacity: z$1.number().min(0).max(1).default(.12)
|
|
3510
|
+
}).optional();
|
|
3511
|
+
const headerBorderSchema = componentBorderSchema.extend({ position: z$1.enum([
|
|
3512
|
+
"bottom",
|
|
3513
|
+
"top",
|
|
3514
|
+
"both",
|
|
3515
|
+
"none"
|
|
3516
|
+
]).default("bottom") }).optional();
|
|
3517
|
+
const logoStyleSchema = z$1.object({
|
|
3518
|
+
fontFamily: z$1.enum(["heading", "body"]).default("heading"),
|
|
3519
|
+
letterSpacing: z$1.enum([
|
|
3520
|
+
"normal",
|
|
3521
|
+
"wide",
|
|
3522
|
+
"wider",
|
|
3523
|
+
"widest"
|
|
3524
|
+
]).default("normal"),
|
|
3525
|
+
gradient: z$1.boolean().default(false),
|
|
3526
|
+
brandDisplay: z$1.enum(brandDisplayModeValues).optional(),
|
|
3527
|
+
size: z$1.enum(logoSizePolicyValues).optional(),
|
|
3528
|
+
accommodation: z$1.enum(logoAccommodationPatternValues).optional()
|
|
3529
|
+
}).optional();
|
|
3530
|
+
const headerLogoTextSchema = z$1.object({
|
|
3531
|
+
mobileWrapLines: z$1.union([z$1.literal(1), z$1.literal(2)]).optional(),
|
|
3532
|
+
mobileMaxWidth: z$1.enum([
|
|
3533
|
+
"xs",
|
|
3534
|
+
"sm",
|
|
3535
|
+
"md"
|
|
3536
|
+
]).optional(),
|
|
3537
|
+
hideOnShrink: z$1.boolean().optional()
|
|
3538
|
+
}).optional();
|
|
3539
|
+
const navEffectsSchema = z$1.object({
|
|
3540
|
+
underlineGradient: z$1.boolean().default(false),
|
|
3541
|
+
glow: z$1.boolean().default(false),
|
|
3542
|
+
glowColor: z$1.string().optional(),
|
|
3543
|
+
neumorphic: z$1.boolean().default(false)
|
|
3544
|
+
}).optional();
|
|
3545
|
+
const dropdownStyleSchema = z$1.object({
|
|
3546
|
+
background: themeColorTokenSchema.default("surface"),
|
|
3547
|
+
textColor: themeColorTokenSchema.default("text"),
|
|
3548
|
+
borderColor: themeColorTokenSchema.nullable().default("border"),
|
|
3549
|
+
shadow: z$1.enum([
|
|
3550
|
+
"none",
|
|
3551
|
+
"sm",
|
|
3552
|
+
"md",
|
|
3553
|
+
"lg"
|
|
3554
|
+
]).default("md"),
|
|
3555
|
+
borderRadius: z$1.enum([
|
|
3556
|
+
"none",
|
|
3557
|
+
"sm",
|
|
3558
|
+
"md",
|
|
3559
|
+
"lg"
|
|
3560
|
+
]).default("md"),
|
|
3561
|
+
hoverBackground: themeColorTokenSchema.nullable().optional(),
|
|
3562
|
+
hoverTextColor: themeColorTokenSchema.nullable().optional(),
|
|
3563
|
+
textTransform: z$1.enum([
|
|
3564
|
+
"none",
|
|
3565
|
+
"uppercase",
|
|
3566
|
+
"capitalize"
|
|
3567
|
+
]).default("none"),
|
|
3568
|
+
letterSpacing: z$1.enum([
|
|
3569
|
+
"normal",
|
|
3570
|
+
"wide",
|
|
3571
|
+
"wider"
|
|
3572
|
+
]).default("normal"),
|
|
3573
|
+
fontWeight: z$1.enum([
|
|
3574
|
+
"regular",
|
|
3575
|
+
"medium",
|
|
3576
|
+
"semibold",
|
|
3577
|
+
"bold"
|
|
3578
|
+
]).optional(),
|
|
3579
|
+
textSize: z$1.enum([
|
|
3580
|
+
"xs",
|
|
3581
|
+
"sm",
|
|
3582
|
+
"base",
|
|
3583
|
+
"lg"
|
|
3584
|
+
]).optional()
|
|
3585
|
+
}).optional();
|
|
3586
|
+
/**
|
|
3587
|
+
* CTA button gap (left margin) for desktop header.
|
|
3588
|
+
* Controls the spacing between nav links and the CTA button.
|
|
3589
|
+
*/
|
|
3590
|
+
const headerCtaGapSchema = z$1.enum([
|
|
3591
|
+
"none",
|
|
3592
|
+
"tight",
|
|
3593
|
+
"compact",
|
|
3594
|
+
"default",
|
|
3595
|
+
"relaxed",
|
|
3596
|
+
"spacious"
|
|
3597
|
+
]);
|
|
3598
|
+
const headerCtaTreatmentSchema = z$1.enum([
|
|
3599
|
+
"default",
|
|
3600
|
+
"primary",
|
|
3601
|
+
"secondary",
|
|
3602
|
+
"inverted",
|
|
3603
|
+
"outline",
|
|
3604
|
+
"ghost"
|
|
3605
|
+
]);
|
|
3606
|
+
const navContainerSchema = z$1.object({
|
|
3607
|
+
type: z$1.enum([
|
|
3608
|
+
"none",
|
|
3609
|
+
"pill",
|
|
3610
|
+
"glass"
|
|
3611
|
+
]).default("none"),
|
|
3612
|
+
tint: z$1.string().nullable().optional(),
|
|
3613
|
+
opacity: z$1.number().min(0).max(1).default(.15)
|
|
3614
|
+
}).default({
|
|
3615
|
+
type: "none",
|
|
3616
|
+
tint: null,
|
|
3617
|
+
opacity: .15
|
|
3618
|
+
});
|
|
3619
|
+
const headerBackgroundSchema = z$1.object({
|
|
3620
|
+
type: z$1.enum([
|
|
3621
|
+
"color",
|
|
3622
|
+
"gradient",
|
|
3623
|
+
"image"
|
|
3624
|
+
]),
|
|
3625
|
+
contentOwner: z$1.literal(siteChromeBackgroundOverrideOwner).optional(),
|
|
3626
|
+
color: tokenOrCssColorValueSchema.nullable().optional(),
|
|
3627
|
+
gradient: gradientConfigSchema.nullable().optional(),
|
|
3628
|
+
image: mediaSchema$1.nullable().optional(),
|
|
3629
|
+
textColor: tokenOrCssColorValueSchema.nullable().optional()
|
|
3630
|
+
});
|
|
3631
|
+
const headerSchema = z$1.object({
|
|
3632
|
+
variant: headerVariant,
|
|
3633
|
+
positioning: headerPositioning,
|
|
3634
|
+
shrinkOnScroll: z$1.boolean(),
|
|
3635
|
+
maxWidth: headerMaxWidth,
|
|
3636
|
+
barFrame: headerBarFrame.optional(),
|
|
3637
|
+
logoOverride: mediaSchema$1.nullable().optional(),
|
|
3638
|
+
background: headerBackgroundSchema.default({
|
|
3639
|
+
type: "color",
|
|
3640
|
+
color: "surface"
|
|
3641
|
+
}),
|
|
3642
|
+
textColor: themeColorTokenSchema.nullable().optional(),
|
|
3643
|
+
navStyle: headerNavStyle,
|
|
3644
|
+
navColor: themeColorTokenSchema.nullable().optional(),
|
|
3645
|
+
navWeight: navFontWeight.default("medium"),
|
|
3646
|
+
navFontRole: z$1.enum(["body", "heading"]).optional(),
|
|
3647
|
+
navTypography: z$1.enum(["body", "heading"]).optional(),
|
|
3648
|
+
navTextSize: navLinkStyleSchema.shape.textSize,
|
|
3649
|
+
navPlacement: z$1.enum(["end", "center"]).optional(),
|
|
3650
|
+
container: headerContainerSchema,
|
|
3651
|
+
border: headerBorderSchema,
|
|
3652
|
+
shadow: componentShadowSchema.optional(),
|
|
3653
|
+
logo: logoStyleSchema,
|
|
3654
|
+
logoText: headerLogoTextSchema,
|
|
3655
|
+
navEffects: navEffectsSchema,
|
|
3656
|
+
navContainer: navContainerSchema,
|
|
3657
|
+
navLinkStyle: navLinkStyleSchema.optional(),
|
|
3658
|
+
ctaGap: headerCtaGapSchema.optional(),
|
|
3659
|
+
ctaTreatment: headerCtaTreatmentSchema.optional(),
|
|
3660
|
+
ctaVariant: z$1.string().min(1).optional(),
|
|
3661
|
+
dropdownStyle: dropdownStyleSchema
|
|
3662
|
+
}).transform(normaliseHeaderNavFontRole);
|
|
3663
|
+
/**
|
|
3664
|
+
* Normalises the legacy `navTypography` font-role alias into the canonical
|
|
3665
|
+
* `navFontRole` field so persisted themes migrate at the parse boundary without
|
|
3666
|
+
* a data migration. `navFontRole` always wins when both are present; the legacy
|
|
3667
|
+
* field is dropped so we never carry a dual write forward.
|
|
3668
|
+
*/
|
|
3669
|
+
function normaliseHeaderNavFontRole(header) {
|
|
3670
|
+
if (header.navTypography === void 0) return header;
|
|
3671
|
+
const { navTypography, ...rest } = header;
|
|
3672
|
+
return header.navFontRole === void 0 ? {
|
|
3673
|
+
...rest,
|
|
3674
|
+
navFontRole: navTypography
|
|
3675
|
+
} : rest;
|
|
3676
|
+
}
|
|
3677
|
+
const footerVariant = z$1.enum([
|
|
3678
|
+
"simple",
|
|
3679
|
+
"columns",
|
|
3680
|
+
"split"
|
|
3681
|
+
]);
|
|
3682
|
+
const footerMaxWidth = z$1.enum(["container", "full"]);
|
|
3683
|
+
const footerMode = z$1.enum([
|
|
3684
|
+
"default",
|
|
3685
|
+
"blocks",
|
|
3686
|
+
"default+blocks",
|
|
3687
|
+
"none"
|
|
3688
|
+
]);
|
|
3689
|
+
const footerNavLayoutMode = z$1.enum([
|
|
3690
|
+
"stack",
|
|
3691
|
+
"inline",
|
|
3692
|
+
"inline-wrap"
|
|
3693
|
+
]);
|
|
3694
|
+
const footerNavLayoutAlign = z$1.enum([
|
|
3695
|
+
"start",
|
|
3696
|
+
"center",
|
|
3697
|
+
"end",
|
|
3698
|
+
"space-between"
|
|
3699
|
+
]);
|
|
3700
|
+
const footerSpacing = z$1.enum([
|
|
3701
|
+
"none",
|
|
3702
|
+
"tight",
|
|
3703
|
+
"compact",
|
|
3704
|
+
"default",
|
|
3705
|
+
"relaxed",
|
|
3706
|
+
"spacious"
|
|
3707
|
+
]);
|
|
3708
|
+
const footerLogoPlacement = z$1.enum([
|
|
3709
|
+
"left",
|
|
3710
|
+
"right",
|
|
3711
|
+
"above",
|
|
3712
|
+
"below"
|
|
3713
|
+
]);
|
|
3714
|
+
const footerLogoSize = z$1.enum([
|
|
3715
|
+
"sm",
|
|
3716
|
+
"md",
|
|
3717
|
+
"lg",
|
|
3718
|
+
"xl"
|
|
3719
|
+
]);
|
|
3720
|
+
const footerLogoMaxHeight = z$1.enum([
|
|
3721
|
+
"sm",
|
|
3722
|
+
"md",
|
|
3723
|
+
"lg",
|
|
3724
|
+
"xl"
|
|
3725
|
+
]);
|
|
3726
|
+
const footerBottomTextLinkStyleSchema = z$1.object({
|
|
3727
|
+
colorToken: themeColorTokenSchema.optional(),
|
|
3728
|
+
hoverColorToken: themeColorTokenSchema.nullable().optional(),
|
|
3729
|
+
decorationColorToken: themeColorTokenSchema.nullable().optional(),
|
|
3730
|
+
underline: z$1.boolean().optional()
|
|
3731
|
+
});
|
|
3732
|
+
const footerBottomBarSchema = z$1.object({
|
|
3733
|
+
enabled: z$1.boolean().optional(),
|
|
3734
|
+
fullBleed: z$1.boolean().optional(),
|
|
3735
|
+
background: headerBackgroundSchema.optional(),
|
|
3736
|
+
textColor: themeColorTokenSchema.nullable().optional(),
|
|
3737
|
+
textAlign: z$1.enum([
|
|
3738
|
+
"left",
|
|
3739
|
+
"center",
|
|
3740
|
+
"right"
|
|
3741
|
+
]).optional(),
|
|
3742
|
+
paddingY: footerSpacing.optional(),
|
|
3743
|
+
paddingX: footerSpacing.optional(),
|
|
3744
|
+
borderTop: z$1.object({
|
|
3745
|
+
colorToken: themeColorTokenSchema.nullable().optional(),
|
|
3746
|
+
width: z$1.enum([
|
|
3747
|
+
"none",
|
|
3748
|
+
"thin",
|
|
3749
|
+
"medium",
|
|
3750
|
+
"thick"
|
|
3751
|
+
]).optional()
|
|
3752
|
+
}).optional()
|
|
3753
|
+
});
|
|
3754
|
+
const footerNavLayoutSchema = z$1.object({
|
|
3755
|
+
layout: footerNavLayoutMode.optional(),
|
|
3756
|
+
align: footerNavLayoutAlign.optional(),
|
|
3757
|
+
gapX: footerSpacing.optional(),
|
|
3758
|
+
gapY: footerSpacing.optional(),
|
|
3759
|
+
columns: z$1.number().int().min(1).max(6).optional()
|
|
3760
|
+
});
|
|
3761
|
+
const footerLogoSchema = z$1.object({
|
|
3762
|
+
showLogo: z$1.boolean().default(true),
|
|
3763
|
+
showLogoText: z$1.boolean().optional(),
|
|
3764
|
+
placement: footerLogoPlacement.optional(),
|
|
3765
|
+
size: footerLogoSize.optional(),
|
|
3766
|
+
maxHeight: footerLogoMaxHeight.optional(),
|
|
3767
|
+
align: z$1.enum([
|
|
3768
|
+
"start",
|
|
3769
|
+
"center",
|
|
3770
|
+
"end"
|
|
3771
|
+
]).optional()
|
|
3772
|
+
});
|
|
3773
|
+
const footerSchema = z$1.object({
|
|
3774
|
+
/**
|
|
3775
|
+
* SDK-only footer rendering mode.
|
|
3776
|
+
*
|
|
3777
|
+
* Backwards compatible: missing/undefined behaves as 'default'.
|
|
3778
|
+
*/
|
|
3779
|
+
mode: footerMode.optional(),
|
|
3780
|
+
variant: footerVariant,
|
|
3781
|
+
maxWidth: footerMaxWidth,
|
|
3782
|
+
showLogoText: z$1.boolean().optional(),
|
|
3783
|
+
background: headerBackgroundSchema.default({
|
|
3784
|
+
type: "color",
|
|
3785
|
+
color: "surface"
|
|
3786
|
+
}),
|
|
3787
|
+
navStyle: headerNavStyle.default("minimal"),
|
|
3788
|
+
navColor: themeColorTokenSchema.nullable().optional(),
|
|
3789
|
+
navWeight: navFontWeight.default("medium"),
|
|
3790
|
+
navLinkStyle: navLinkStyleSchema.optional(),
|
|
3791
|
+
bottomTextLinkStyle: footerBottomTextLinkStyleSchema.optional(),
|
|
3792
|
+
navLayout: footerNavLayoutSchema.optional(),
|
|
3793
|
+
logo: footerLogoSchema.optional(),
|
|
3794
|
+
bottomBar: footerBottomBarSchema.optional()
|
|
3795
|
+
});
|
|
3796
|
+
const containerPaddingPresetSchema = z$1.enum([
|
|
3797
|
+
"tight",
|
|
3798
|
+
"compact",
|
|
3799
|
+
"default",
|
|
3800
|
+
"relaxed"
|
|
3801
|
+
]);
|
|
3802
|
+
const layoutSchema = z$1.object({ containerPadding: z$1.object({
|
|
3803
|
+
mobile: containerPaddingPresetSchema.optional(),
|
|
3804
|
+
tablet: containerPaddingPresetSchema.optional(),
|
|
3805
|
+
desktop: containerPaddingPresetSchema.optional()
|
|
3806
|
+
}).optional() }).optional();
|
|
3807
|
+
const heroTypographySizeSchema = z$1.enum([
|
|
3808
|
+
"sm",
|
|
3809
|
+
"base",
|
|
3810
|
+
"lg",
|
|
3811
|
+
"xl",
|
|
3812
|
+
"2xl",
|
|
3813
|
+
"3xl",
|
|
3814
|
+
"4xl",
|
|
3815
|
+
"5xl",
|
|
3816
|
+
"6xl",
|
|
3817
|
+
"editorial"
|
|
3818
|
+
]);
|
|
3819
|
+
const heroTypographyLineHeightSchema = z$1.enum([
|
|
3820
|
+
"tight",
|
|
3821
|
+
"snug",
|
|
3822
|
+
"normal",
|
|
3823
|
+
"relaxed"
|
|
3824
|
+
]);
|
|
3825
|
+
const heroResponsiveTypographySchema = z$1.object({
|
|
3826
|
+
headlineSize: heroTypographySizeSchema.optional(),
|
|
3827
|
+
headlineLineHeight: heroTypographyLineHeightSchema.optional(),
|
|
3828
|
+
subheadlineSize: heroTypographySizeSchema.optional(),
|
|
3829
|
+
subheadlineLineHeight: heroTypographyLineHeightSchema.optional()
|
|
3830
|
+
});
|
|
3831
|
+
const heroTypographySchema = z$1.object({
|
|
3832
|
+
headlineSize: heroTypographySizeSchema.optional(),
|
|
3833
|
+
headlineLineHeight: heroTypographyLineHeightSchema.optional(),
|
|
3834
|
+
subheadlineSize: heroTypographySizeSchema.optional(),
|
|
3835
|
+
subheadlineLineHeight: heroTypographyLineHeightSchema.optional(),
|
|
3836
|
+
microHeadlineSize: heroTypographySizeSchema.optional(),
|
|
3837
|
+
microHeadlineLineHeight: heroTypographyLineHeightSchema.optional(),
|
|
3838
|
+
microSubheadlineSize: heroTypographySizeSchema.optional(),
|
|
3839
|
+
microSubheadlineLineHeight: heroTypographyLineHeightSchema.optional(),
|
|
3840
|
+
responsive: z$1.object({
|
|
3841
|
+
tablet: heroResponsiveTypographySchema.optional(),
|
|
3842
|
+
mobile: heroResponsiveTypographySchema.optional()
|
|
3843
|
+
}).optional()
|
|
3844
|
+
});
|
|
3845
|
+
const heroSchema = z$1.object({ typography: heroTypographySchema.optional() }).optional();
|
|
3846
|
+
const bodyTextIntroTypographySizeSchema = z$1.enum(["default", "editorial"]);
|
|
3847
|
+
const bodyTextSchema = z$1.object({ intro: z$1.object({
|
|
3848
|
+
paragraphSize: bodyTextIntroTypographySizeSchema.optional(),
|
|
3849
|
+
headingSize: bodyTextIntroTypographySizeSchema.optional()
|
|
3850
|
+
}).optional() }).optional();
|
|
3851
|
+
const gradientsSchema = z$1.object({
|
|
3852
|
+
button: z$1.string().min(1).nullable().optional(),
|
|
3853
|
+
hero: z$1.string().min(1).nullable().optional(),
|
|
3854
|
+
background: z$1.string().min(1).nullable().optional()
|
|
3855
|
+
});
|
|
3856
|
+
/**
|
|
3857
|
+
* Testimonial quote-mark treatment, owned by the site style (analogous to the
|
|
3858
|
+
* accordion icon). `style` is the coarse selector; the optional fields fine-tune
|
|
3859
|
+
* it. `none` hides the mark. The block renders the mark; the site style decides
|
|
3860
|
+
* its character; a look may still hide it.
|
|
3861
|
+
*/
|
|
3862
|
+
const testimonialQuoteTreatmentSchema = z$1.object({
|
|
3863
|
+
style: z$1.enum([
|
|
3864
|
+
"serif-display",
|
|
3865
|
+
"accent-glyph",
|
|
3866
|
+
"none"
|
|
3867
|
+
]),
|
|
3868
|
+
fontFamily: z$1.enum(["heading", "body"]).optional(),
|
|
3869
|
+
scale: z$1.enum([
|
|
3870
|
+
"sm",
|
|
3871
|
+
"md",
|
|
3872
|
+
"lg",
|
|
3873
|
+
"xl"
|
|
3874
|
+
]).optional(),
|
|
3875
|
+
colorToken: themeColorTokenSchema.optional(),
|
|
3876
|
+
opacity: z$1.number().min(0).max(1).optional()
|
|
3877
|
+
});
|
|
3878
|
+
const themeSchema = z$1.object({
|
|
3879
|
+
name: z$1.string().min(1).max(30),
|
|
3880
|
+
description: z$1.string().min(1).max(400),
|
|
3881
|
+
rationale: z$1.string().min(1).max(400),
|
|
3882
|
+
siteStyleId: z$1.string().min(1).transform((value) => asSiteStyleId(value)).optional(),
|
|
3883
|
+
axes: axesSchema,
|
|
3884
|
+
palette: paletteSchema,
|
|
3885
|
+
typography: typographySchema,
|
|
3886
|
+
space: spaceSchema,
|
|
3887
|
+
border,
|
|
3888
|
+
shadow,
|
|
3889
|
+
motion,
|
|
3890
|
+
corners,
|
|
3891
|
+
gradients: gradientsSchema.optional(),
|
|
3892
|
+
layout: layoutSchema,
|
|
3893
|
+
hero: heroSchema,
|
|
3894
|
+
bodyText: bodyTextSchema,
|
|
3895
|
+
header: headerSchema,
|
|
3896
|
+
footer: footerSchema,
|
|
3897
|
+
buttons: buttonSystemSchema.optional(),
|
|
3898
|
+
cards: cardSystemSchema.optional(),
|
|
3899
|
+
accordions: accordionSystemSchema.optional(),
|
|
3900
|
+
testimonialQuote: testimonialQuoteTreatmentSchema.optional(),
|
|
3901
|
+
inputs: inputSystemSchema.optional(),
|
|
3902
|
+
inputStyle: inputStyle.optional(),
|
|
3903
|
+
blockCustomVars: z$1.record(z$1.string(), z$1.record(z$1.string(), z$1.string())).optional(),
|
|
3904
|
+
blockOverrides: z$1.record(z$1.string(), blockThemeOverrideSchema).optional(),
|
|
3905
|
+
headingDecoration: headingDecorationSchema.optional(),
|
|
3906
|
+
customCssRules: customCssRulesSchema,
|
|
3907
|
+
blockCustomCssRules: blockCustomCssRulesSchema,
|
|
3908
|
+
customCssAtRules: customCssAtRulesSchema,
|
|
3909
|
+
/**
|
|
3910
|
+
* Style groups define named visual presets that content authors can apply to blocks.
|
|
3911
|
+
*
|
|
3912
|
+
* Unlike variants (which change block structure/layout), style groups only affect
|
|
3913
|
+
* CSS styling. The selected style group is rendered as a `data-style-group` attribute
|
|
3914
|
+
* on the block wrapper, which can be targeted in `blockCustomCssRules`.
|
|
3915
|
+
*
|
|
3916
|
+
* @example
|
|
3917
|
+
* ```typescript
|
|
3918
|
+
* {
|
|
3919
|
+
* styleGroups: {
|
|
3920
|
+
* hero: ['bold', 'minimal', 'featured'],
|
|
3921
|
+
* 'body-text': ['intro', 'compact'],
|
|
3922
|
+
* },
|
|
3923
|
+
* blockCustomCssRules: [
|
|
3924
|
+
* {
|
|
3925
|
+
* id: 'hero-bold-headline',
|
|
3926
|
+
* blockKind: 'hero',
|
|
3927
|
+
* selector: '&[data-style-group="bold"] .hero-headline',
|
|
3928
|
+
* declarations: { fontWeight: '800', fontSize: '3rem' }
|
|
3929
|
+
* }
|
|
3930
|
+
* ]
|
|
3931
|
+
* }
|
|
3932
|
+
* ```
|
|
3933
|
+
*/
|
|
3934
|
+
styleGroups: z$1.record(z$1.string(), z$1.array(z$1.string())).optional()
|
|
3935
|
+
});
|
|
3936
|
+
z$1.object({
|
|
3937
|
+
message: z$1.string().min(1),
|
|
3938
|
+
themes: z$1.array(themeSchema).length(3)
|
|
1982
3939
|
});
|
|
1983
|
-
function normalizeLegacyButtonVariantInput(input) {
|
|
1984
|
-
if (!isUnknownRecord(input)) return input;
|
|
1985
|
-
const background = input.background;
|
|
1986
|
-
if (!isUnknownRecord(background)) return input;
|
|
1987
|
-
if (!(background.type === "transparent" || Object.prototype.hasOwnProperty.call(input, "textColorToken") || isUnknownRecord(input.border) && Object.prototype.hasOwnProperty.call(input.border, "colorToken") || hasLegacyButtonEffects(input.effects) || hasLegacyAlphaToken(input, background))) return input;
|
|
1988
|
-
const { textColorToken, ...withoutLegacyText } = input;
|
|
1989
|
-
const normalizedBorder = isUnknownRecord(input.border) && typeof input.border.widthClass === "string" ? { widthClass: input.border.widthClass } : input.border;
|
|
1990
|
-
const normalizedAffordance = isUnknownRecord(input.affordance) && typeof input.affordance.iconId === "string" ? { iconId: input.affordance.iconId } : input.affordance;
|
|
1991
|
-
const normalizedEffects = normalizeLegacyButtonEffects(input.effects, background.type);
|
|
1992
|
-
const hoverBackgroundToken = stripLegacyTokenAlpha(input.hoverBackgroundToken);
|
|
1993
|
-
if (background.type === "transparent") return {
|
|
1994
|
-
...withoutLegacyText,
|
|
1995
|
-
background: {
|
|
1996
|
-
type: "surface",
|
|
1997
|
-
role: "link"
|
|
1998
|
-
},
|
|
1999
|
-
border: normalizedBorder,
|
|
2000
|
-
affordance: normalizedAffordance,
|
|
2001
|
-
effects: normalizedEffects,
|
|
2002
|
-
hoverBackgroundToken
|
|
2003
|
-
};
|
|
2004
|
-
if (background.type === "gradient") {
|
|
2005
|
-
const stops = Array.isArray(background.stops) ? background.stops.map(stripLegacyTokenAlpha) : background.stops;
|
|
2006
|
-
return {
|
|
2007
|
-
...withoutLegacyText,
|
|
2008
|
-
background: {
|
|
2009
|
-
...background,
|
|
2010
|
-
stops,
|
|
2011
|
-
foregroundToken: stripLegacyTokenAlpha(background.foregroundToken ?? textColorToken)
|
|
2012
|
-
},
|
|
2013
|
-
border: normalizedBorder,
|
|
2014
|
-
affordance: normalizedAffordance,
|
|
2015
|
-
effects: normalizedEffects,
|
|
2016
|
-
hoverBackgroundToken
|
|
2017
|
-
};
|
|
2018
|
-
}
|
|
2019
|
-
return {
|
|
2020
|
-
...withoutLegacyText,
|
|
2021
|
-
background: background.type === "solid" ? {
|
|
2022
|
-
...background,
|
|
2023
|
-
colorToken: stripLegacyTokenAlpha(background.colorToken)
|
|
2024
|
-
} : background,
|
|
2025
|
-
border: normalizedBorder,
|
|
2026
|
-
affordance: normalizedAffordance,
|
|
2027
|
-
effects: normalizedEffects,
|
|
2028
|
-
hoverBackgroundToken
|
|
2029
|
-
};
|
|
2030
|
-
}
|
|
2031
|
-
function normalizeLegacyButtonGlobalInput(input) {
|
|
2032
|
-
if (!isUnknownRecord(input)) return input;
|
|
2033
|
-
const hoverColorToken = stripLegacyTokenAlpha(input.hoverColorToken);
|
|
2034
|
-
return hoverColorToken === input.hoverColorToken ? input : {
|
|
2035
|
-
...input,
|
|
2036
|
-
hoverColorToken
|
|
2037
|
-
};
|
|
2038
|
-
}
|
|
2039
|
-
function hasLegacyAlphaToken(input, background) {
|
|
2040
|
-
const stops = isUnknownArray(background.stops) ? background.stops : [];
|
|
2041
|
-
return [
|
|
2042
|
-
input.hoverBackgroundToken,
|
|
2043
|
-
background.colorToken,
|
|
2044
|
-
background.foregroundToken,
|
|
2045
|
-
...stops
|
|
2046
|
-
].some((token) => stripLegacyTokenAlpha(token) !== token);
|
|
2047
|
-
}
|
|
2048
|
-
function stripLegacyTokenAlpha(value) {
|
|
2049
|
-
if (typeof value !== "string") return value;
|
|
2050
|
-
const slashIndex = value.indexOf("/");
|
|
2051
|
-
return slashIndex < 0 ? value : value.slice(0, slashIndex);
|
|
2052
|
-
}
|
|
2053
|
-
function hasLegacyButtonEffects(input) {
|
|
2054
|
-
if (!isUnknownRecord(input)) return false;
|
|
2055
|
-
return [
|
|
2056
|
-
"base",
|
|
2057
|
-
"hover",
|
|
2058
|
-
"active",
|
|
2059
|
-
"focus"
|
|
2060
|
-
].some((state) => {
|
|
2061
|
-
const effects = input[state];
|
|
2062
|
-
return Array.isArray(effects) && effects.some((effect) => {
|
|
2063
|
-
if (!isUnknownRecord(effect) || typeof effect.effectId !== "string") return true;
|
|
2064
|
-
const classification = classifyButtonEffectId(effect.effectId);
|
|
2065
|
-
if (classification !== "colour-transition" && classification !== "non-colour") return true;
|
|
2066
|
-
return effect.effectId === "background-on-hover" && isUnknownRecord(effect.options) && stripLegacyTokenAlpha(effect.options.colorToken) !== effect.options.colorToken;
|
|
2067
|
-
});
|
|
2068
|
-
});
|
|
2069
|
-
}
|
|
2070
|
-
function normalizeLegacyButtonEffects(input, backgroundType) {
|
|
2071
|
-
if (!isUnknownRecord(input)) return input;
|
|
2072
|
-
const normalized = {};
|
|
2073
|
-
for (const state of [
|
|
2074
|
-
"base",
|
|
2075
|
-
"hover",
|
|
2076
|
-
"active",
|
|
2077
|
-
"focus"
|
|
2078
|
-
]) {
|
|
2079
|
-
const effects = input[state];
|
|
2080
|
-
if (!Array.isArray(effects)) continue;
|
|
2081
|
-
const safeEffects = effects.flatMap((effect) => {
|
|
2082
|
-
if (!isUnknownRecord(effect) || typeof effect.effectId !== "string") return [];
|
|
2083
|
-
const classification = classifyButtonEffectId(effect.effectId);
|
|
2084
|
-
if (classification === "non-colour") return [effect];
|
|
2085
|
-
if (classification !== "colour-transition") return [];
|
|
2086
|
-
if (effect.effectId === "background-on-hover") {
|
|
2087
|
-
const options = isUnknownRecord(effect.options) ? effect.options : null;
|
|
2088
|
-
const colorToken = options === null ? null : parseOpaqueButtonColourToken(stripLegacyTokenAlpha(options.colorToken));
|
|
2089
|
-
return colorToken === null ? [] : [{
|
|
2090
|
-
...effect,
|
|
2091
|
-
options: {
|
|
2092
|
-
...options,
|
|
2093
|
-
colorToken
|
|
2094
|
-
}
|
|
2095
|
-
}];
|
|
2096
|
-
}
|
|
2097
|
-
if (backgroundType !== "solid") return [];
|
|
2098
|
-
const rawAmount = isUnknownRecord(effect.options) ? effect.options.amount : void 0;
|
|
2099
|
-
const amount = typeof rawAmount === "number" && rawAmount > 0 ? Math.max(100, Math.round(rawAmount / 100) * 100) : 100;
|
|
2100
|
-
return [{
|
|
2101
|
-
...effect,
|
|
2102
|
-
options: {
|
|
2103
|
-
...isUnknownRecord(effect.options) ? effect.options : {},
|
|
2104
|
-
amount
|
|
2105
|
-
}
|
|
2106
|
-
}];
|
|
2107
|
-
});
|
|
2108
|
-
if (safeEffects.length > 0) normalized[state] = safeEffects;
|
|
2109
|
-
}
|
|
2110
|
-
return Object.keys(normalized).length === 0 ? void 0 : normalized;
|
|
2111
|
-
}
|
|
2112
|
-
function isUnknownRecord(value) {
|
|
2113
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
2114
|
-
}
|
|
2115
|
-
function isUnknownArray(value) {
|
|
2116
|
-
return Array.isArray(value);
|
|
2117
|
-
}
|
|
2118
|
-
//#endregion
|
|
2119
|
-
//#region ../theme-core/src/buttons/classNames.ts
|
|
2120
|
-
function themeButtonVariantClassNames(variant) {
|
|
2121
|
-
if (variant === "default") return [variant];
|
|
2122
|
-
return [variant, `button-${variant}`];
|
|
2123
|
-
}
|
|
2124
|
-
function themeButtonSizeClassName(size) {
|
|
2125
|
-
return `btn-${size}`;
|
|
2126
|
-
}
|
|
2127
|
-
function themeButtonClassName(spec) {
|
|
2128
|
-
return [
|
|
2129
|
-
...themeButtonVariantClassNames(spec.variant),
|
|
2130
|
-
themeButtonSizeClassName(spec.size),
|
|
2131
|
-
spec.extraClassName
|
|
2132
|
-
].filter(Boolean).join(" ");
|
|
2133
|
-
}
|
|
2134
3940
|
//#endregion
|
|
2135
3941
|
//#region ../theme-core/src/palette/utils/colorConversion.ts
|
|
2136
3942
|
function hexToRgb(hex) {
|
|
@@ -2154,6 +3960,22 @@ function relativeLuminance(r, g, b) {
|
|
|
2154
3960
|
const R = srgbToLinear(r), G = srgbToLinear(g), B = srgbToLinear(b);
|
|
2155
3961
|
return .2126 * R + .7152 * G + .0722 * B;
|
|
2156
3962
|
}
|
|
3963
|
+
//#endregion
|
|
3964
|
+
//#region ../theme-core/src/buttons/classNames.ts
|
|
3965
|
+
function themeButtonVariantClassNames(variant) {
|
|
3966
|
+
if (variant === "default") return [variant];
|
|
3967
|
+
return [variant, `button-${variant}`];
|
|
3968
|
+
}
|
|
3969
|
+
function themeButtonSizeClassName(size) {
|
|
3970
|
+
return `btn-${size}`;
|
|
3971
|
+
}
|
|
3972
|
+
function themeButtonClassName(spec) {
|
|
3973
|
+
return [
|
|
3974
|
+
...themeButtonVariantClassNames(spec.variant),
|
|
3975
|
+
themeButtonSizeClassName(spec.size),
|
|
3976
|
+
spec.extraClassName
|
|
3977
|
+
].filter(Boolean).join(" ");
|
|
3978
|
+
}
|
|
2157
3979
|
buttonSizeNameSchema.options;
|
|
2158
3980
|
//#endregion
|
|
2159
3981
|
//#region ../theme-core/src/buttons/styles/domain.ts
|
|
@@ -2309,7 +4131,6 @@ const quietArrowRecipe = defineButtonStyleRecipe({
|
|
|
2309
4131
|
cornerStyle: "rounded",
|
|
2310
4132
|
textTransform: "uppercase",
|
|
2311
4133
|
fontWeight: 500,
|
|
2312
|
-
borderWidth: 1,
|
|
2313
4134
|
typography: "body",
|
|
2314
4135
|
fontSize: "text-sm",
|
|
2315
4136
|
letterSpacing: "loose",
|
|
@@ -2373,7 +4194,7 @@ const quietArrowRecipe = defineButtonStyleRecipe({
|
|
|
2373
4194
|
affordance: { iconId: "ArrowRight" },
|
|
2374
4195
|
effects: { hover: [{
|
|
2375
4196
|
effectId: "background-on-hover",
|
|
2376
|
-
options: { colorToken: "surfaceAlt" }
|
|
4197
|
+
options: { colorToken: unsafeAsOpaqueButtonColourToken("surfaceAlt") }
|
|
2377
4198
|
}] }
|
|
2378
4199
|
}
|
|
2379
4200
|
},
|
|
@@ -2484,7 +4305,6 @@ const softPillRecipe = defineStaticButtonStyleRecipe({
|
|
|
2484
4305
|
shadow: "low",
|
|
2485
4306
|
textTransform: "none",
|
|
2486
4307
|
fontWeight: 500,
|
|
2487
|
-
borderWidth: 2,
|
|
2488
4308
|
hoverTransform: "lift",
|
|
2489
4309
|
hoverColor: "none"
|
|
2490
4310
|
},
|
|
@@ -2503,10 +4323,7 @@ const softPillRecipe = defineStaticButtonStyleRecipe({
|
|
|
2503
4323
|
position: "bottom"
|
|
2504
4324
|
},
|
|
2505
4325
|
effects: {
|
|
2506
|
-
hover: [{
|
|
2507
|
-
effectId: "lift",
|
|
2508
|
-
options: { translateY: "-1px" }
|
|
2509
|
-
}],
|
|
4326
|
+
hover: [{ effectId: "lift" }],
|
|
2510
4327
|
active: [{
|
|
2511
4328
|
effectId: "scale-down",
|
|
2512
4329
|
options: { scale: "0.98" }
|
|
@@ -2525,7 +4342,7 @@ const softPillRecipe = defineStaticButtonStyleRecipe({
|
|
|
2525
4342
|
border: { widthClass: "border-2" },
|
|
2526
4343
|
effects: { hover: [{
|
|
2527
4344
|
effectId: "background-on-hover",
|
|
2528
|
-
options: { colorToken: "surface" }
|
|
4345
|
+
options: { colorToken: unsafeAsOpaqueButtonColourToken("surface") }
|
|
2529
4346
|
}] }
|
|
2530
4347
|
}
|
|
2531
4348
|
},
|
|
@@ -2540,7 +4357,7 @@ const softPillRecipe = defineStaticButtonStyleRecipe({
|
|
|
2540
4357
|
border: { widthClass: "border" },
|
|
2541
4358
|
effects: { hover: [{
|
|
2542
4359
|
effectId: "background-on-hover",
|
|
2543
|
-
options: { colorToken: "surface" }
|
|
4360
|
+
options: { colorToken: unsafeAsOpaqueButtonColourToken("surface") }
|
|
2544
4361
|
}] }
|
|
2545
4362
|
}
|
|
2546
4363
|
},
|
|
@@ -2554,7 +4371,7 @@ const softPillRecipe = defineStaticButtonStyleRecipe({
|
|
|
2554
4371
|
borderRadius: "rounded-full",
|
|
2555
4372
|
effects: { hover: [{
|
|
2556
4373
|
effectId: "background-on-hover",
|
|
2557
|
-
options: { colorToken: "surface" }
|
|
4374
|
+
options: { colorToken: unsafeAsOpaqueButtonColourToken("surface") }
|
|
2558
4375
|
}] }
|
|
2559
4376
|
}
|
|
2560
4377
|
},
|
|
@@ -2584,7 +4401,6 @@ const earthPillRecipe = defineStaticButtonStyleRecipe({
|
|
|
2584
4401
|
shadow: "low",
|
|
2585
4402
|
textTransform: "none",
|
|
2586
4403
|
fontWeight: 500,
|
|
2587
|
-
borderWidth: 1,
|
|
2588
4404
|
hoverTransform: "lift",
|
|
2589
4405
|
hoverColor: "none",
|
|
2590
4406
|
typography: "body",
|
|
@@ -2620,12 +4436,9 @@ const earthPillRecipe = defineStaticButtonStyleRecipe({
|
|
|
2620
4436
|
position: "bottom"
|
|
2621
4437
|
},
|
|
2622
4438
|
effects: {
|
|
2623
|
-
hover: [{
|
|
2624
|
-
effectId: "lift",
|
|
2625
|
-
options: { translateY: "-1px" }
|
|
2626
|
-
}, {
|
|
4439
|
+
hover: [{ effectId: "lift" }, {
|
|
2627
4440
|
effectId: "background-on-hover",
|
|
2628
|
-
options: { colorToken: "accent" }
|
|
4441
|
+
options: { colorToken: unsafeAsOpaqueButtonColourToken("accent") }
|
|
2629
4442
|
}],
|
|
2630
4443
|
active: [{
|
|
2631
4444
|
effectId: "scale-down",
|
|
@@ -2645,7 +4458,7 @@ const earthPillRecipe = defineStaticButtonStyleRecipe({
|
|
|
2645
4458
|
border: { widthClass: "border" },
|
|
2646
4459
|
effects: { hover: [{
|
|
2647
4460
|
effectId: "background-on-hover",
|
|
2648
|
-
options: { colorToken: "muted" }
|
|
4461
|
+
options: { colorToken: unsafeAsOpaqueButtonColourToken("muted") }
|
|
2649
4462
|
}] }
|
|
2650
4463
|
}
|
|
2651
4464
|
},
|
|
@@ -2660,7 +4473,7 @@ const earthPillRecipe = defineStaticButtonStyleRecipe({
|
|
|
2660
4473
|
border: { widthClass: "border" },
|
|
2661
4474
|
effects: { hover: [{
|
|
2662
4475
|
effectId: "background-on-hover",
|
|
2663
|
-
options: { colorToken: "surfaceAlt" }
|
|
4476
|
+
options: { colorToken: unsafeAsOpaqueButtonColourToken("surfaceAlt") }
|
|
2664
4477
|
}] }
|
|
2665
4478
|
}
|
|
2666
4479
|
},
|
|
@@ -2720,7 +4533,6 @@ const confidentChipRecipe = defineStaticButtonStyleRecipe({
|
|
|
2720
4533
|
shadow: "medium",
|
|
2721
4534
|
textTransform: "none",
|
|
2722
4535
|
fontWeight: 600,
|
|
2723
|
-
borderWidth: 1,
|
|
2724
4536
|
hoverTransform: "none",
|
|
2725
4537
|
hoverColor: "none"
|
|
2726
4538
|
},
|
|
@@ -2761,7 +4573,7 @@ const confidentChipRecipe = defineStaticButtonStyleRecipe({
|
|
|
2761
4573
|
border: { widthClass: "border" },
|
|
2762
4574
|
effects: { hover: [{
|
|
2763
4575
|
effectId: "background-on-hover",
|
|
2764
|
-
options: { colorToken: "background" }
|
|
4576
|
+
options: { colorToken: unsafeAsOpaqueButtonColourToken("background") }
|
|
2765
4577
|
}] }
|
|
2766
4578
|
}
|
|
2767
4579
|
},
|
|
@@ -2776,7 +4588,7 @@ const confidentChipRecipe = defineStaticButtonStyleRecipe({
|
|
|
2776
4588
|
border: { widthClass: "border" },
|
|
2777
4589
|
effects: { hover: [{
|
|
2778
4590
|
effectId: "background-on-hover",
|
|
2779
|
-
options: { colorToken: "surface" }
|
|
4591
|
+
options: { colorToken: unsafeAsOpaqueButtonColourToken("surface") }
|
|
2780
4592
|
}] }
|
|
2781
4593
|
}
|
|
2782
4594
|
},
|
|
@@ -2790,7 +4602,7 @@ const confidentChipRecipe = defineStaticButtonStyleRecipe({
|
|
|
2790
4602
|
borderRadius: "rounded-md",
|
|
2791
4603
|
effects: { hover: [{
|
|
2792
4604
|
effectId: "background-on-hover",
|
|
2793
|
-
options: { colorToken: "surface" }
|
|
4605
|
+
options: { colorToken: unsafeAsOpaqueButtonColourToken("surface") }
|
|
2794
4606
|
}] }
|
|
2795
4607
|
}
|
|
2796
4608
|
},
|
|
@@ -2825,7 +4637,6 @@ const editorialLinkRecipe = defineStaticButtonStyleRecipe({
|
|
|
2825
4637
|
cornerStyle: "square",
|
|
2826
4638
|
textTransform: "none",
|
|
2827
4639
|
fontWeight: 500,
|
|
2828
|
-
borderWidth: 1,
|
|
2829
4640
|
hoverTransform: "none",
|
|
2830
4641
|
hoverColor: "none"
|
|
2831
4642
|
},
|
|
@@ -2843,7 +4654,6 @@ const editorialLinkRecipe = defineStaticButtonStyleRecipe({
|
|
|
2843
4654
|
effectId: "border-bottom-grow",
|
|
2844
4655
|
options: {
|
|
2845
4656
|
height: 2,
|
|
2846
|
-
colorToken: "text",
|
|
2847
4657
|
origin: "left"
|
|
2848
4658
|
}
|
|
2849
4659
|
}] }
|
|
@@ -2862,7 +4672,6 @@ const editorialLinkRecipe = defineStaticButtonStyleRecipe({
|
|
|
2862
4672
|
effectId: "border-bottom-grow",
|
|
2863
4673
|
options: {
|
|
2864
4674
|
height: 1,
|
|
2865
|
-
colorToken: "mutedText",
|
|
2866
4675
|
origin: "left"
|
|
2867
4676
|
}
|
|
2868
4677
|
}] }
|
|
@@ -2881,7 +4690,6 @@ const editorialLinkRecipe = defineStaticButtonStyleRecipe({
|
|
|
2881
4690
|
effectId: "border-bottom-grow",
|
|
2882
4691
|
options: {
|
|
2883
4692
|
height: 1,
|
|
2884
|
-
colorToken: "accent",
|
|
2885
4693
|
origin: "left"
|
|
2886
4694
|
}
|
|
2887
4695
|
}] }
|
|
@@ -2905,7 +4713,6 @@ const editorialLinkRecipe = defineStaticButtonStyleRecipe({
|
|
|
2905
4713
|
effectId: "border-bottom-grow",
|
|
2906
4714
|
options: {
|
|
2907
4715
|
height: 2,
|
|
2908
|
-
colorToken: "accent",
|
|
2909
4716
|
origin: "left"
|
|
2910
4717
|
}
|
|
2911
4718
|
}] } }
|
|
@@ -2927,7 +4734,6 @@ const pebbleRecipe = defineStaticButtonStyleRecipe({
|
|
|
2927
4734
|
cornerStyle: "pill",
|
|
2928
4735
|
textTransform: "none",
|
|
2929
4736
|
fontWeight: 500,
|
|
2930
|
-
borderWidth: 2,
|
|
2931
4737
|
hoverTransform: "none",
|
|
2932
4738
|
hoverColor: "none"
|
|
2933
4739
|
},
|
|
@@ -2972,7 +4778,7 @@ const pebbleRecipe = defineStaticButtonStyleRecipe({
|
|
|
2972
4778
|
border: { widthClass: "border-2" },
|
|
2973
4779
|
effects: { hover: [{
|
|
2974
4780
|
effectId: "background-on-hover",
|
|
2975
|
-
options: { colorToken: "accent" }
|
|
4781
|
+
options: { colorToken: unsafeAsOpaqueButtonColourToken("accent") }
|
|
2976
4782
|
}] }
|
|
2977
4783
|
}
|
|
2978
4784
|
},
|
|
@@ -2987,7 +4793,7 @@ const pebbleRecipe = defineStaticButtonStyleRecipe({
|
|
|
2987
4793
|
border: { widthClass: "border" },
|
|
2988
4794
|
effects: { hover: [{
|
|
2989
4795
|
effectId: "background-on-hover",
|
|
2990
|
-
options: { colorToken: "surface" }
|
|
4796
|
+
options: { colorToken: unsafeAsOpaqueButtonColourToken("surface") }
|
|
2991
4797
|
}] }
|
|
2992
4798
|
}
|
|
2993
4799
|
},
|
|
@@ -3042,7 +4848,6 @@ const brushedWashRecipe = defineStaticButtonStyleRecipe({
|
|
|
3042
4848
|
shadow: "low",
|
|
3043
4849
|
textTransform: "none",
|
|
3044
4850
|
fontWeight: 500,
|
|
3045
|
-
borderWidth: 1,
|
|
3046
4851
|
hoverTransform: "none",
|
|
3047
4852
|
hoverColor: "none"
|
|
3048
4853
|
},
|
|
@@ -3107,7 +4912,7 @@ const brushedWashRecipe = defineStaticButtonStyleRecipe({
|
|
|
3107
4912
|
border: { widthClass: "border" },
|
|
3108
4913
|
effects: { hover: [{
|
|
3109
4914
|
effectId: "background-on-hover",
|
|
3110
|
-
options: { colorToken: "surface" }
|
|
4915
|
+
options: { colorToken: unsafeAsOpaqueButtonColourToken("surface") }
|
|
3111
4916
|
}] }
|
|
3112
4917
|
}
|
|
3113
4918
|
},
|
|
@@ -3121,7 +4926,7 @@ const brushedWashRecipe = defineStaticButtonStyleRecipe({
|
|
|
3121
4926
|
borderRadius: "rounded-lg",
|
|
3122
4927
|
effects: { hover: [{
|
|
3123
4928
|
effectId: "background-on-hover",
|
|
3124
|
-
options: { colorToken: "surface" }
|
|
4929
|
+
options: { colorToken: unsafeAsOpaqueButtonColourToken("surface") }
|
|
3125
4930
|
}] }
|
|
3126
4931
|
}
|
|
3127
4932
|
},
|
|
@@ -3150,7 +4955,6 @@ const inkStampRecipe = defineStaticButtonStyleRecipe({
|
|
|
3150
4955
|
cornerStyle: "rounded",
|
|
3151
4956
|
textTransform: "uppercase",
|
|
3152
4957
|
fontWeight: 600,
|
|
3153
|
-
borderWidth: 1,
|
|
3154
4958
|
hoverTransform: "none",
|
|
3155
4959
|
hoverColor: "none",
|
|
3156
4960
|
letterSpacing: "loose"
|
|
@@ -3208,7 +5012,7 @@ const inkStampRecipe = defineStaticButtonStyleRecipe({
|
|
|
3208
5012
|
border: { widthClass: "border-2" },
|
|
3209
5013
|
effects: { hover: [{
|
|
3210
5014
|
effectId: "background-on-hover",
|
|
3211
|
-
options: { colorToken: "surface" }
|
|
5015
|
+
options: { colorToken: unsafeAsOpaqueButtonColourToken("surface") }
|
|
3212
5016
|
}] }
|
|
3213
5017
|
}
|
|
3214
5018
|
},
|
|
@@ -3223,7 +5027,7 @@ const inkStampRecipe = defineStaticButtonStyleRecipe({
|
|
|
3223
5027
|
border: { widthClass: "border-2" },
|
|
3224
5028
|
effects: { hover: [{
|
|
3225
5029
|
effectId: "background-on-hover",
|
|
3226
|
-
options: { colorToken: "surface" }
|
|
5030
|
+
options: { colorToken: unsafeAsOpaqueButtonColourToken("surface") }
|
|
3227
5031
|
}] }
|
|
3228
5032
|
}
|
|
3229
5033
|
},
|
|
@@ -3257,7 +5061,6 @@ const inkStampRecipe = defineStaticButtonStyleRecipe({
|
|
|
3257
5061
|
effectId: "border-bottom-grow",
|
|
3258
5062
|
options: {
|
|
3259
5063
|
height: 1,
|
|
3260
|
-
colorToken: "accent",
|
|
3261
5064
|
origin: "left"
|
|
3262
5065
|
}
|
|
3263
5066
|
}] }
|
|
@@ -3288,7 +5091,6 @@ const flatInkRecipe = defineStaticButtonStyleRecipe({
|
|
|
3288
5091
|
cornerStyle: "rounded",
|
|
3289
5092
|
textTransform: "none",
|
|
3290
5093
|
fontWeight: 600,
|
|
3291
|
-
borderWidth: 1,
|
|
3292
5094
|
typography: "body",
|
|
3293
5095
|
letterSpacing: "tight",
|
|
3294
5096
|
paddingPreset: "default",
|
|
@@ -3320,12 +5122,9 @@ const flatInkRecipe = defineStaticButtonStyleRecipe({
|
|
|
3320
5122
|
},
|
|
3321
5123
|
borderRadius: "rounded-lg",
|
|
3322
5124
|
affordance: { iconId: "ArrowRight" },
|
|
3323
|
-
effects: { hover: [{
|
|
3324
|
-
effectId: "lift",
|
|
3325
|
-
options: { translateY: "-2px" }
|
|
3326
|
-
}, {
|
|
5125
|
+
effects: { hover: [{ effectId: "lift" }, {
|
|
3327
5126
|
effectId: "background-on-hover",
|
|
3328
|
-
options: { colorToken: "secondary" }
|
|
5127
|
+
options: { colorToken: unsafeAsOpaqueButtonColourToken("secondary") }
|
|
3329
5128
|
}] }
|
|
3330
5129
|
}
|
|
3331
5130
|
},
|
|
@@ -3338,12 +5137,9 @@ const flatInkRecipe = defineStaticButtonStyleRecipe({
|
|
|
3338
5137
|
},
|
|
3339
5138
|
borderRadius: "rounded-lg",
|
|
3340
5139
|
border: { widthClass: "border" },
|
|
3341
|
-
effects: { hover: [{
|
|
3342
|
-
effectId: "lift",
|
|
3343
|
-
options: { translateY: "-2px" }
|
|
3344
|
-
}, {
|
|
5140
|
+
effects: { hover: [{ effectId: "lift" }, {
|
|
3345
5141
|
effectId: "background-on-hover",
|
|
3346
|
-
options: { colorToken: "surfaceAlt" }
|
|
5142
|
+
options: { colorToken: unsafeAsOpaqueButtonColourToken("surfaceAlt") }
|
|
3347
5143
|
}] }
|
|
3348
5144
|
}
|
|
3349
5145
|
},
|
|
@@ -3356,12 +5152,9 @@ const flatInkRecipe = defineStaticButtonStyleRecipe({
|
|
|
3356
5152
|
},
|
|
3357
5153
|
borderRadius: "rounded-lg",
|
|
3358
5154
|
border: { widthClass: "border" },
|
|
3359
|
-
effects: { hover: [{
|
|
3360
|
-
effectId: "lift",
|
|
3361
|
-
options: { translateY: "-2px" }
|
|
3362
|
-
}, {
|
|
5155
|
+
effects: { hover: [{ effectId: "lift" }, {
|
|
3363
5156
|
effectId: "background-on-hover",
|
|
3364
|
-
options: { colorToken: "surfaceAlt" }
|
|
5157
|
+
options: { colorToken: unsafeAsOpaqueButtonColourToken("surfaceAlt") }
|
|
3365
5158
|
}] }
|
|
3366
5159
|
}
|
|
3367
5160
|
},
|
|
@@ -3373,10 +5166,7 @@ const flatInkRecipe = defineStaticButtonStyleRecipe({
|
|
|
3373
5166
|
role: "link"
|
|
3374
5167
|
},
|
|
3375
5168
|
borderRadius: "rounded-lg",
|
|
3376
|
-
effects: { hover: [{
|
|
3377
|
-
effectId: "lift",
|
|
3378
|
-
options: { translateY: "-2px" }
|
|
3379
|
-
}] }
|
|
5169
|
+
effects: { hover: [{ effectId: "lift" }] }
|
|
3380
5170
|
}
|
|
3381
5171
|
},
|
|
3382
5172
|
accent: {
|
|
@@ -3388,10 +5178,7 @@ const flatInkRecipe = defineStaticButtonStyleRecipe({
|
|
|
3388
5178
|
},
|
|
3389
5179
|
borderRadius: "rounded-lg",
|
|
3390
5180
|
affordance: { iconId: "ArrowRight" },
|
|
3391
|
-
effects: { hover: [{
|
|
3392
|
-
effectId: "lift",
|
|
3393
|
-
options: { translateY: "-2px" }
|
|
3394
|
-
}] }
|
|
5181
|
+
effects: { hover: [{ effectId: "lift" }] }
|
|
3395
5182
|
}
|
|
3396
5183
|
}
|
|
3397
5184
|
}
|
|
@@ -3412,9 +5199,8 @@ const showtimePillRecipe = defineStaticButtonStyleRecipe({
|
|
|
3412
5199
|
shadow: "low",
|
|
3413
5200
|
textTransform: "uppercase",
|
|
3414
5201
|
fontWeight: 700,
|
|
3415
|
-
borderWidth: 2,
|
|
3416
5202
|
hoverTransform: "lift",
|
|
3417
|
-
hoverColor: "
|
|
5203
|
+
hoverColor: "none",
|
|
3418
5204
|
typography: "body",
|
|
3419
5205
|
paddingPreset: "spacious",
|
|
3420
5206
|
italic: false
|
|
@@ -3472,7 +5258,7 @@ const showtimePillRecipe = defineStaticButtonStyleRecipe({
|
|
|
3472
5258
|
border: { widthClass: "border-2" },
|
|
3473
5259
|
effects: { hover: [{
|
|
3474
5260
|
effectId: "background-on-hover",
|
|
3475
|
-
options: { colorToken: "background" }
|
|
5261
|
+
options: { colorToken: unsafeAsOpaqueButtonColourToken("background") }
|
|
3476
5262
|
}] }
|
|
3477
5263
|
}
|
|
3478
5264
|
},
|
|
@@ -3486,7 +5272,7 @@ const showtimePillRecipe = defineStaticButtonStyleRecipe({
|
|
|
3486
5272
|
borderRadius: "rounded-full",
|
|
3487
5273
|
effects: { hover: [{
|
|
3488
5274
|
effectId: "background-on-hover",
|
|
3489
|
-
options: { colorToken: "surface" }
|
|
5275
|
+
options: { colorToken: unsafeAsOpaqueButtonColourToken("surface") }
|
|
3490
5276
|
}] }
|
|
3491
5277
|
}
|
|
3492
5278
|
},
|
|
@@ -3521,7 +5307,6 @@ const joyStampRecipe = defineStaticButtonStyleRecipe({
|
|
|
3521
5307
|
typography: "heading",
|
|
3522
5308
|
fontWeight: 700,
|
|
3523
5309
|
fontSize: "text-lg",
|
|
3524
|
-
borderWidth: 2,
|
|
3525
5310
|
hoverTransform: "none",
|
|
3526
5311
|
hoverColor: "none"
|
|
3527
5312
|
},
|
|
@@ -3556,7 +5341,7 @@ const joyStampRecipe = defineStaticButtonStyleRecipe({
|
|
|
3556
5341
|
elevation: "high",
|
|
3557
5342
|
softness: "hard",
|
|
3558
5343
|
position: "bottom-right",
|
|
3559
|
-
colorToken: "text"
|
|
5344
|
+
colorToken: unsafeAsOpaqueButtonColourToken("text")
|
|
3560
5345
|
},
|
|
3561
5346
|
effects: { hover: [{ effectId: "press-down" }] }
|
|
3562
5347
|
}
|
|
@@ -3574,7 +5359,7 @@ const joyStampRecipe = defineStaticButtonStyleRecipe({
|
|
|
3574
5359
|
elevation: "high",
|
|
3575
5360
|
softness: "hard",
|
|
3576
5361
|
position: "bottom-right",
|
|
3577
|
-
colorToken: "secondary"
|
|
5362
|
+
colorToken: unsafeAsOpaqueButtonColourToken("secondary")
|
|
3578
5363
|
},
|
|
3579
5364
|
effects: { hover: [{ effectId: "press-down" }] }
|
|
3580
5365
|
}
|
|
@@ -3619,7 +5404,6 @@ const ornateRitualRecipe = defineStaticButtonStyleRecipe({
|
|
|
3619
5404
|
cornerStyle: "rounded",
|
|
3620
5405
|
textTransform: "uppercase",
|
|
3621
5406
|
fontWeight: 600,
|
|
3622
|
-
borderWidth: 1,
|
|
3623
5407
|
hoverTransform: "none",
|
|
3624
5408
|
hoverColor: "none",
|
|
3625
5409
|
letterSpacing: "loose"
|
|
@@ -3655,7 +5439,7 @@ const ornateRitualRecipe = defineStaticButtonStyleRecipe({
|
|
|
3655
5439
|
effects: {
|
|
3656
5440
|
hover: [{
|
|
3657
5441
|
effectId: "background-on-hover",
|
|
3658
|
-
options: { colorToken: "primary-100" }
|
|
5442
|
+
options: { colorToken: unsafeAsOpaqueButtonColourToken("primary-100") }
|
|
3659
5443
|
}],
|
|
3660
5444
|
active: [{
|
|
3661
5445
|
effectId: "scale-down",
|
|
@@ -3675,7 +5459,7 @@ const ornateRitualRecipe = defineStaticButtonStyleRecipe({
|
|
|
3675
5459
|
border: { widthClass: "border" },
|
|
3676
5460
|
effects: { hover: [{
|
|
3677
5461
|
effectId: "background-on-hover",
|
|
3678
|
-
options: { colorToken: "surface" }
|
|
5462
|
+
options: { colorToken: unsafeAsOpaqueButtonColourToken("surface") }
|
|
3679
5463
|
}] }
|
|
3680
5464
|
}
|
|
3681
5465
|
},
|
|
@@ -3690,7 +5474,7 @@ const ornateRitualRecipe = defineStaticButtonStyleRecipe({
|
|
|
3690
5474
|
border: { widthClass: "border" },
|
|
3691
5475
|
effects: { hover: [{
|
|
3692
5476
|
effectId: "background-on-hover",
|
|
3693
|
-
options: { colorToken: "muted" }
|
|
5477
|
+
options: { colorToken: unsafeAsOpaqueButtonColourToken("muted") }
|
|
3694
5478
|
}] }
|
|
3695
5479
|
}
|
|
3696
5480
|
},
|
|
@@ -3724,7 +5508,6 @@ const ornateRitualRecipe = defineStaticButtonStyleRecipe({
|
|
|
3724
5508
|
effectId: "border-bottom-grow",
|
|
3725
5509
|
options: {
|
|
3726
5510
|
height: 1,
|
|
3727
|
-
colorToken: "accent",
|
|
3728
5511
|
origin: "left"
|
|
3729
5512
|
}
|
|
3730
5513
|
}] }
|
|
@@ -4041,129 +5824,6 @@ const courseRegistrationInteractiveIslandPropsCodec = createInteractiveIslandCod
|
|
|
4041
5824
|
})
|
|
4042
5825
|
});
|
|
4043
5826
|
//#endregion
|
|
4044
|
-
//#region ../theme-core/src/cards/types.ts
|
|
4045
|
-
const cardVariantRoleValues = ["default", "alternative"];
|
|
4046
|
-
const boxlessCardVariantValue = "none";
|
|
4047
|
-
const legacyCardVariantRoleAliases = {
|
|
4048
|
-
variant1: "alternative",
|
|
4049
|
-
variant2: "alternative"
|
|
4050
|
-
};
|
|
4051
|
-
const cardSpacingSchema = z$1.enum([
|
|
4052
|
-
"none",
|
|
4053
|
-
"compact",
|
|
4054
|
-
"cozy",
|
|
4055
|
-
"medium",
|
|
4056
|
-
"comfortable",
|
|
4057
|
-
"spacious"
|
|
4058
|
-
]);
|
|
4059
|
-
const gradientDirectionSchema = z$1.enum([
|
|
4060
|
-
"to-r",
|
|
4061
|
-
"to-l",
|
|
4062
|
-
"to-t",
|
|
4063
|
-
"to-b",
|
|
4064
|
-
"to-tr",
|
|
4065
|
-
"to-tl",
|
|
4066
|
-
"to-br",
|
|
4067
|
-
"to-bl"
|
|
4068
|
-
]);
|
|
4069
|
-
const cardVariantRoleSchema = z$1.enum(cardVariantRoleValues);
|
|
4070
|
-
z$1.enum([...cardVariantRoleValues, boxlessCardVariantValue]);
|
|
4071
|
-
function isCardVariantRole(value) {
|
|
4072
|
-
return typeof value === "string" && cardVariantRoleValues.includes(value);
|
|
4073
|
-
}
|
|
4074
|
-
function normalizeCardVariantRole(value) {
|
|
4075
|
-
if (isCardVariantRole(value)) return value;
|
|
4076
|
-
if (typeof value !== "string") return null;
|
|
4077
|
-
return legacyCardVariantRoleAliases[value] ?? null;
|
|
4078
|
-
}
|
|
4079
|
-
const cardBackgroundSchema = z$1.discriminatedUnion("type", [
|
|
4080
|
-
z$1.object({
|
|
4081
|
-
type: z$1.literal("solid"),
|
|
4082
|
-
colorToken: themeColorTokenSchema
|
|
4083
|
-
}),
|
|
4084
|
-
z$1.object({
|
|
4085
|
-
type: z$1.literal("gradient"),
|
|
4086
|
-
fromToken: themeColorTokenSchema,
|
|
4087
|
-
toToken: themeColorTokenSchema,
|
|
4088
|
-
direction: gradientDirectionSchema
|
|
4089
|
-
}),
|
|
4090
|
-
z$1.object({ type: z$1.literal("transparent") })
|
|
4091
|
-
]);
|
|
4092
|
-
const cardBorderSchema = z$1.object({
|
|
4093
|
-
widthClass: z$1.string(),
|
|
4094
|
-
colorToken: themeColorTokenSchema
|
|
4095
|
-
});
|
|
4096
|
-
/** Per-corner radius value. `expressive` is a large block-radius multiple. */
|
|
4097
|
-
const cardCornerValueSchema = z$1.enum([
|
|
4098
|
-
"square",
|
|
4099
|
-
"soft",
|
|
4100
|
-
"rounded",
|
|
4101
|
-
"pill",
|
|
4102
|
-
"expressive"
|
|
4103
|
-
]);
|
|
4104
|
-
/**
|
|
4105
|
-
* A single accented card edge (e.g. a left accent bar). When set, it replaces
|
|
4106
|
-
* the full `border` so the card reads as edge-accented rather than outlined.
|
|
4107
|
-
*/
|
|
4108
|
-
const cardAccentEdgeSchema = z$1.object({
|
|
4109
|
-
edge: z$1.enum([
|
|
4110
|
-
"left",
|
|
4111
|
-
"top",
|
|
4112
|
-
"right",
|
|
4113
|
-
"bottom"
|
|
4114
|
-
]),
|
|
4115
|
-
colorToken: themeColorTokenSchema,
|
|
4116
|
-
width: z$1.enum([
|
|
4117
|
-
"thin",
|
|
4118
|
-
"medium",
|
|
4119
|
-
"thick",
|
|
4120
|
-
"heavy"
|
|
4121
|
-
])
|
|
4122
|
-
});
|
|
4123
|
-
const cardCornerRadiiSchema = z$1.object({
|
|
4124
|
-
topLeft: cardCornerValueSchema.optional(),
|
|
4125
|
-
topRight: cardCornerValueSchema.optional(),
|
|
4126
|
-
bottomLeft: cardCornerValueSchema.optional(),
|
|
4127
|
-
bottomRight: cardCornerValueSchema.optional()
|
|
4128
|
-
});
|
|
4129
|
-
const cardVariantSchema = z$1.object({
|
|
4130
|
-
id: z$1.string(),
|
|
4131
|
-
name: z$1.string().min(1).max(20),
|
|
4132
|
-
enabled: z$1.boolean(),
|
|
4133
|
-
priority: z$1.union([
|
|
4134
|
-
z$1.literal(1),
|
|
4135
|
-
z$1.literal(2),
|
|
4136
|
-
z$1.literal(3)
|
|
4137
|
-
]),
|
|
4138
|
-
background: cardBackgroundSchema,
|
|
4139
|
-
spacing: cardSpacingSchema,
|
|
4140
|
-
foregroundToken: themeColorTokenSchema.optional(),
|
|
4141
|
-
shadow: z$1.object({
|
|
4142
|
-
elevation: z$1.enum([
|
|
4143
|
-
"none",
|
|
4144
|
-
"low",
|
|
4145
|
-
"medium",
|
|
4146
|
-
"high"
|
|
4147
|
-
]),
|
|
4148
|
-
softness: z$1.enum([
|
|
4149
|
-
"crisp",
|
|
4150
|
-
"soft",
|
|
4151
|
-
"hard"
|
|
4152
|
-
]).nullable(),
|
|
4153
|
-
position: z$1.enum(["bottom", "bottom-right"]).default("bottom")
|
|
4154
|
-
}).optional(),
|
|
4155
|
-
corners: z$1.enum([
|
|
4156
|
-
"square",
|
|
4157
|
-
"soft",
|
|
4158
|
-
"rounded",
|
|
4159
|
-
"pill"
|
|
4160
|
-
]).optional(),
|
|
4161
|
-
cornerRadii: cardCornerRadiiSchema.optional(),
|
|
4162
|
-
border: cardBorderSchema.optional(),
|
|
4163
|
-
accentEdge: cardAccentEdgeSchema.optional()
|
|
4164
|
-
});
|
|
4165
|
-
z$1.object({ variants: z$1.array(cardVariantSchema).min(1).max(3) });
|
|
4166
|
-
//#endregion
|
|
4167
5827
|
//#region ../blocks/src/lib/media.ts
|
|
4168
5828
|
const hotspotSchema = z.object({
|
|
4169
5829
|
x: z.number().min(0).max(1),
|
|
@@ -4253,11 +5913,8 @@ function isRecord$3(value) {
|
|
|
4253
5913
|
* This module provides a single source of truth for TipTap rich text validation
|
|
4254
5914
|
* across both the block-form editor and the block rendering system.
|
|
4255
5915
|
*
|
|
4256
|
-
*
|
|
4257
|
-
*
|
|
4258
|
-
* - Wrapped format (legacy): { doc: { type: 'doc', content: [...] } }
|
|
4259
|
-
*
|
|
4260
|
-
* Both formats are supported for backward compatibility during migration.
|
|
5916
|
+
* Rich-text fields use one canonical root shape:
|
|
5917
|
+
* `{ type: 'doc', content: [...] }`.
|
|
4261
5918
|
*/
|
|
4262
5919
|
/**
|
|
4263
5920
|
* TipTap document node schema (recursive structure)
|
|
@@ -4270,17 +5927,40 @@ function isRecord$3(value) {
|
|
|
4270
5927
|
* - marks: Text formatting marks (e.g., bold, italic)
|
|
4271
5928
|
*/
|
|
4272
5929
|
const TipTapMarkSchema = z$1.object({
|
|
4273
|
-
type: z$1.string(),
|
|
5930
|
+
type: z$1.string().min(1),
|
|
4274
5931
|
attrs: z$1.record(z$1.string(), z$1.unknown()).optional()
|
|
4275
|
-
});
|
|
5932
|
+
}).strict();
|
|
4276
5933
|
const TipTapNodeSchema = z$1.lazy(() => z$1.object({
|
|
4277
|
-
type: z$1.string(),
|
|
5934
|
+
type: z$1.string().min(1),
|
|
4278
5935
|
content: z$1.array(TipTapNodeSchema).optional(),
|
|
4279
5936
|
text: z$1.string().optional(),
|
|
4280
5937
|
attrs: z$1.record(z$1.string(), z$1.unknown()).optional(),
|
|
4281
5938
|
marks: z$1.array(TipTapMarkSchema).optional()
|
|
5939
|
+
}).strict().superRefine((node, ctx) => {
|
|
5940
|
+
if (node.type === "doc") ctx.addIssue({
|
|
5941
|
+
code: "custom",
|
|
5942
|
+
path: ["type"],
|
|
5943
|
+
message: "Document nodes are only valid at the rich-text root"
|
|
5944
|
+
});
|
|
5945
|
+
if (node.type === "text") {
|
|
5946
|
+
if (node.text === void 0 || node.text.length === 0) ctx.addIssue({
|
|
5947
|
+
code: "custom",
|
|
5948
|
+
path: ["text"],
|
|
5949
|
+
message: "Text nodes require a non-empty text value"
|
|
5950
|
+
});
|
|
5951
|
+
if (node.content !== void 0) ctx.addIssue({
|
|
5952
|
+
code: "custom",
|
|
5953
|
+
path: ["content"],
|
|
5954
|
+
message: "Text nodes cannot contain child nodes"
|
|
5955
|
+
});
|
|
5956
|
+
return;
|
|
5957
|
+
}
|
|
5958
|
+
if (node.text !== void 0) ctx.addIssue({
|
|
5959
|
+
code: "custom",
|
|
5960
|
+
path: ["text"],
|
|
5961
|
+
message: "Only text nodes can contain a text value"
|
|
5962
|
+
});
|
|
4282
5963
|
}));
|
|
4283
|
-
z$1.union([TipTapNodeSchema, z$1.object({ doc: TipTapNodeSchema })]);
|
|
4284
5964
|
/**
|
|
4285
5965
|
* Canonical schema for a TipTap rich-text document root.
|
|
4286
5966
|
*
|
|
@@ -4289,111 +5969,11 @@ z$1.union([TipTapNodeSchema, z$1.object({ doc: TipTapNodeSchema })]);
|
|
|
4289
5969
|
* (dummy content, editor output, migrations) must emit, and the shape every
|
|
4290
5970
|
* non-legacy consumer can rely on.
|
|
4291
5971
|
*
|
|
4292
|
-
* Legacy envelopes are read-tolerated by {@link RichTextValueSchema} but
|
|
4293
|
-
* normalised before reaching anywhere typed as `RichTextDoc`.
|
|
4294
5972
|
*/
|
|
4295
5973
|
const RichTextDocSchema = z$1.object({
|
|
4296
5974
|
type: z$1.literal("doc"),
|
|
4297
5975
|
content: z$1.array(TipTapNodeSchema)
|
|
4298
|
-
});
|
|
4299
|
-
/**
|
|
4300
|
-
* Permissive unwrap for a value known to be the root of a rich-text field.
|
|
4301
|
-
*
|
|
4302
|
-
* Producers should emit the canonical unwrapped form `{ type: 'doc', content: [...] }`,
|
|
4303
|
-
* but two legacy shapes still appear in older data and pre-Phase-1 fixtures:
|
|
4304
|
-
*
|
|
4305
|
-
* - `{ doc: <typed-doc> }` — pre-migration DB storage.
|
|
4306
|
-
* - `{ doc: <typed-doc>, html, plain }` — pre-Phase-1 dummy-content output.
|
|
4307
|
-
*
|
|
4308
|
-
* This helper is the single right place to tolerate either shape at a known
|
|
4309
|
-
* rich-text root (transforms, coercion, validators that operate on rich text).
|
|
4310
|
-
* The strictness sits on the inner node's `type === 'doc'`, which prevents
|
|
4311
|
-
* misidentifying random objects that happen to carry a field named `doc`.
|
|
4312
|
-
*
|
|
4313
|
-
* Returns the inner doc node when the input matches a legacy shape, otherwise
|
|
4314
|
-
* returns the input unchanged.
|
|
4315
|
-
*
|
|
4316
|
-
* For deep structural traversal where any nested key might be named `doc`
|
|
4317
|
-
* (and unwrapping would be incorrect), use the strict `isDocWrapper` private
|
|
4318
|
-
* helper inside `@riverbankcms/blocks/bindings`.
|
|
4319
|
-
*/
|
|
4320
|
-
function unwrapRichTextRoot(value) {
|
|
4321
|
-
if (!isRecord$3(value)) return value;
|
|
4322
|
-
if (!("doc" in value)) return value;
|
|
4323
|
-
const inner = value.doc;
|
|
4324
|
-
if (isRecord$3(inner) && inner.type === "doc") return inner;
|
|
4325
|
-
return value;
|
|
4326
|
-
}
|
|
4327
|
-
function createHardBreakNode() {
|
|
4328
|
-
return { type: "hardBreak" };
|
|
4329
|
-
}
|
|
4330
|
-
/**
|
|
4331
|
-
* Parse a small markdown subset into TipTap inline nodes.
|
|
4332
|
-
*
|
|
4333
|
-
* This intentionally supports only bold (`**text**`) because the SDK/content
|
|
4334
|
-
* import paths use it for lightweight default content, not full markdown.
|
|
4335
|
-
*/
|
|
4336
|
-
function parseRichTextInlineMarkdown(text) {
|
|
4337
|
-
const out = [];
|
|
4338
|
-
const pushText = (value, marks) => {
|
|
4339
|
-
if (!value) return;
|
|
4340
|
-
out.push(marks && marks.length > 0 ? {
|
|
4341
|
-
type: "text",
|
|
4342
|
-
text: value,
|
|
4343
|
-
marks
|
|
4344
|
-
} : {
|
|
4345
|
-
type: "text",
|
|
4346
|
-
text: value
|
|
4347
|
-
});
|
|
4348
|
-
};
|
|
4349
|
-
let rest = text;
|
|
4350
|
-
while (rest.length > 0) {
|
|
4351
|
-
const start = rest.indexOf("**");
|
|
4352
|
-
if (start === -1) {
|
|
4353
|
-
pushText(rest);
|
|
4354
|
-
break;
|
|
4355
|
-
}
|
|
4356
|
-
const end = rest.indexOf("**", start + 2);
|
|
4357
|
-
if (end === -1) {
|
|
4358
|
-
pushText(rest);
|
|
4359
|
-
break;
|
|
4360
|
-
}
|
|
4361
|
-
pushText(rest.slice(0, start));
|
|
4362
|
-
pushText(rest.slice(start + 2, end), [{ type: "bold" }]);
|
|
4363
|
-
rest = rest.slice(end + 2);
|
|
4364
|
-
}
|
|
4365
|
-
return out;
|
|
4366
|
-
}
|
|
4367
|
-
function parseRichTextParagraphInlineMarkdown(text) {
|
|
4368
|
-
return text.split("\n").flatMap((line, index) => {
|
|
4369
|
-
const lineNodes = parseRichTextInlineMarkdown(line.trim());
|
|
4370
|
-
return index === 0 ? lineNodes : [createHardBreakNode(), ...lineNodes];
|
|
4371
|
-
});
|
|
4372
|
-
}
|
|
4373
|
-
/**
|
|
4374
|
-
* Convert a plain string with a tiny markdown subset to canonical TipTap JSON.
|
|
4375
|
-
*
|
|
4376
|
-
* Double newlines create semantic paragraphs. Single newlines remain inside the
|
|
4377
|
-
* current paragraph as TipTap `hardBreak` nodes for line-oriented content such
|
|
4378
|
-
* as addresses, opening hours, and contact details.
|
|
4379
|
-
*/
|
|
4380
|
-
function createRichTextDocFromMarkdown(markdown) {
|
|
4381
|
-
const normalized = markdown.replace(/\r\n/g, "\n").trim();
|
|
4382
|
-
if (!normalized) return {
|
|
4383
|
-
type: "doc",
|
|
4384
|
-
content: []
|
|
4385
|
-
};
|
|
4386
|
-
return {
|
|
4387
|
-
type: "doc",
|
|
4388
|
-
content: normalized.split(/\n{2,}/).map((paragraph) => paragraph.trim()).filter(Boolean).map((paragraph) => {
|
|
4389
|
-
const inline = parseRichTextParagraphInlineMarkdown(paragraph);
|
|
4390
|
-
return inline.length > 0 ? {
|
|
4391
|
-
type: "paragraph",
|
|
4392
|
-
content: inline
|
|
4393
|
-
} : { type: "paragraph" };
|
|
4394
|
-
})
|
|
4395
|
-
};
|
|
4396
|
-
}
|
|
5976
|
+
}).strict();
|
|
4397
5977
|
//#endregion
|
|
4398
5978
|
//#region ../blocks/src/system/blocks/events/shared/schemas.ts
|
|
4399
5979
|
const eventPresetSchema = z$1.enum([
|
|
@@ -6147,6 +7727,7 @@ const DISPLAY_MEDIA_KINDS = [
|
|
|
6147
7727
|
"video",
|
|
6148
7728
|
"audio"
|
|
6149
7729
|
];
|
|
7730
|
+
const DEFAULT_MEDIA_FIELD_KINDS = ["image"];
|
|
6150
7731
|
const PUBLIC_FILE_FIELD_KINDS = [
|
|
6151
7732
|
"document",
|
|
6152
7733
|
"spreadsheet",
|
|
@@ -6347,18 +7928,28 @@ const inlineTextFieldSchema = baseFieldSchema.extend({
|
|
|
6347
7928
|
maxLength: z$1.number().int().positive().optional(),
|
|
6348
7929
|
plainTextField: z$1.string().min(1).optional()
|
|
6349
7930
|
});
|
|
7931
|
+
function hasMediaDefaultIdentifier(value) {
|
|
7932
|
+
return value !== null && typeof value === "object" && !Array.isArray(value) && typeof value.identifier === "string" && value.identifier.trim().length > 0;
|
|
7933
|
+
}
|
|
7934
|
+
function validateMediaFieldDefault(field, ctx) {
|
|
7935
|
+
if (field.defaultValue !== void 0 && field.defaultValue !== null && !hasMediaDefaultIdentifier(field.defaultValue)) ctx.addIssue({
|
|
7936
|
+
code: z$1.ZodIssueCode.custom,
|
|
7937
|
+
path: ["defaultValue"],
|
|
7938
|
+
message: `${field.type} defaultValue must be null or an object with a non-empty identifier`
|
|
7939
|
+
});
|
|
7940
|
+
}
|
|
6350
7941
|
const mediaFieldSchema = baseFieldSchema.extend({
|
|
6351
7942
|
type: z$1.literal("media"),
|
|
6352
|
-
mediaKinds: z$1.array(z$1.enum(MEDIA_KINDS)).default([
|
|
7943
|
+
mediaKinds: z$1.array(z$1.enum(MEDIA_KINDS)).default([...DEFAULT_MEDIA_FIELD_KINDS]).transform((kinds) => {
|
|
6353
7944
|
const displayKinds = kinds.filter(isDisplayMediaKind);
|
|
6354
|
-
return displayKinds.length > 0 ? displayKinds : [
|
|
7945
|
+
return displayKinds.length > 0 ? displayKinds : [...DEFAULT_MEDIA_FIELD_KINDS];
|
|
6355
7946
|
}),
|
|
6356
7947
|
aspectRatio: z$1.string().optional()
|
|
6357
|
-
});
|
|
7948
|
+
}).superRefine(validateMediaFieldDefault);
|
|
6358
7949
|
const fileFieldSchema = baseFieldSchema.extend({
|
|
6359
7950
|
type: z$1.literal("file"),
|
|
6360
7951
|
fileKinds: z$1.array(z$1.enum(PUBLIC_FILE_FIELD_KINDS)).default([...PUBLIC_FILE_FIELD_KINDS])
|
|
6361
|
-
});
|
|
7952
|
+
}).superRefine(validateMediaFieldDefault);
|
|
6362
7953
|
const booleanFieldSchema = baseFieldSchema.extend({ type: z$1.literal("boolean") });
|
|
6363
7954
|
const dateFieldSchema = baseFieldSchema.extend({ type: z$1.literal("date") });
|
|
6364
7955
|
const timeFieldSchema = baseFieldSchema.extend({ type: z$1.literal("time") });
|
|
@@ -10141,4 +11732,4 @@ function defineIslandPropsDecoder(kind) {
|
|
|
10141
11732
|
};
|
|
10142
11733
|
}
|
|
10143
11734
|
//#endregion
|
|
10144
|
-
export {
|
|
11735
|
+
export { hexToRgb as $, formatDate as A, formatBookingInstant as At, resolveEventCta as B, publicEventPricingCurrency as Bt, getWizardStepsForContext as C, ok as Ct, normalizeCsvIds as D, addLocalScheduleDays as Dt, getEventRuntimeFiltersKey as E, reportWorkflowSuccess as Et, formatEventTeacherLine as F, resolveBookingTimeZoneId as Ft, getLocalDateKey as G, formatCurrencyAmount as Gt, resolveRuntimeEventPricing as H, publicEventPricingType as Ht, formatTime as I, toBookingTimeZone as It, RichTextDocSchema as J, getLocalMinuteOfDay as K, assertNever$2 as Kt, getCardOrientation as L, toScheduledBookingDateTime as Lt, formatEventDateParts as M, formatLocalScheduleDate as Mt, formatEventPrice as N, getBookingLocalDateKey as Nt, normalizeCsvString as O, formatBookingDate as Ot, formatEventPriceDisplay as P, parseBookingLocalDate as Pt, relativeLuminance as Q, getContainerClass as R, parseEventPageSurfaceSubject as Rt, getStepNumber as S, err as St, buildEventRuntimeFilters as T, reportWorkflowError as Tt, getEventAvailability as U, publicEventScalarPrice as Ut, resolveEventLinkProps as V, publicEventPricingMode as Vt, getEventAvailabilityStatus as W, publicEventTicketTypes as Wt, resolveEventRegistrationScopedEvents as X, isRecord$3 as Y, themeButtonClassName as Z, findPreSelectedEvent as _, resolveDefaultBookingServiceId as _t, buildProductDetailDisplay as a, deriveBookingFormViewState as at, resolveRegistrationTarget as b, assertNever$1 as bt, EMPTY_COMMERCE_CART_STATE as c, getBookingRedirectStateFromLocation as ct, deriveCommerceCheckoutState as d, isBookingServiceSlidingAmountInRange as dt, isCssColorLiteral as et, parseStoredCommerceCartState as f, parseBookingCurrencyInputToCents as ft, findEventByOccurrenceId as g, resolveBookingSiteId as gt, toRegistrationEvents as h, resolveBookingPaymentStep as ht, buildProductCardDisplay as i, logger as it, formatEventCompactDateRail as j, formatBookingTime as jt, normalizeOptionalId as k, formatBookingDateTime as kt, buildPassCartItem as l, getBookingServiceSlidingScale as lt, reduceCommerceCart as m, resolveAppointmentCheckoutVerificationState as mt, getShopDisplayForItems as n, resolveTokenOrCssColorValue as nt, formatCommercePrice as o, formatBookingCentsAsCurrencyInput as ot, productItemKey as p, prepareBookingSubmission as pt, normalizeEventBlockKind as q, buildCartDisplay as r, normalizeCardVariantRole as rt, formatInterval as s, formatBookingSubmissionPreparationError as st, defineIslandPropsDecoder as t, resolveOnColorForThemeToken as tt, buildProductCartItem as u, getBookingSuccessMessage as ut, resolveDiscountContext as v, toSelectedCollectionOptionKind as vt, buildEventCalendarListingRender as w, okWith as wt, WIZARD_STEPS as x, clearWorkflowFeedback as xt, resolveEventRequiresPayment as y, BOOKING_FORM_DATA_RESERVED_KEYS as yt, groupEventsByDate as z, formatBookingPriceDisplay as zt };
|