@riverbankcms/sdk 0.180.0 → 0.182.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/_dts/{BlocksIslandsHydrator-DC_AvZwy.d.ts → BlocksIslandsHydrator-Bvw2bUif.d.ts} +1 -1
- package/dist/_dts/{Page-DQOxVtp3.d.ts → Page-B2EAT-bE.d.ts} +7 -7
- package/dist/_dts/{SdkPreviewMode-DrLgY9_f.d.ts → SdkPreviewMode-D0vww6rh.d.ts} +2 -2
- package/dist/_dts/{client-BP7VBRvs.d.ts → client-D6T430bk.d.ts} +56 -70
- package/dist/_dts/{content-types-1-K2qi__.d.ts → content-types-wZVWccC6.d.ts} +2 -2
- package/dist/_dts/{contracts-Dfqz0Tcu.d.ts → contracts-B-vtOcr8.d.ts} +3 -3
- package/dist/_dts/{generatePageMetadata-CSfAqmry.d.ts → generatePageMetadata-CxfwHE6z.d.ts} +2 -2
- package/dist/_dts/{index-BeM5Ylwf.d.ts → index-CEyYMhLJ.d.ts} +1 -2
- package/dist/_dts/{index-DQr358-m.d.ts → index-CQrb3Ccc.d.ts} +8 -8
- package/dist/_dts/{index-DCcxLa8p.d.ts → index-CciRW_w1.d.ts} +2 -2
- package/dist/_dts/{index-Blrw2oVk.d.ts → index-Cqxis-nv.d.ts} +1 -1
- package/dist/_dts/{index-CB5Csefo.d.ts → index-DIU-wL1M.d.ts} +2 -2
- package/dist/_dts/{index-DQBGwBPx.d.ts → index-DqPKdeTk.d.ts} +1 -1
- package/dist/_dts/{loadContent-BG2tLGXj.d.ts → loadContent-D0wrxiSp.d.ts} +7 -7
- package/dist/_dts/{request-P08l6mkr.d.ts → request-DEwxUSw8.d.ts} +2375 -883
- package/dist/_dts/{resolveBlockData-BDHc8lFs.d.ts → resolveBlockData-VaG_MYbN.d.ts} +5 -5
- package/dist/_dts/{resolvePageContent-Y3IZBbtL.d.ts → resolvePageContent-DTwklC_v.d.ts} +1 -1
- package/dist/_dts/sdk/src/bookings/index.d.ts +2 -2
- package/dist/_dts/sdk/src/client/types.d.ts +2 -2
- package/dist/_dts/sdk/src/client.d.ts +7 -7
- package/dist/_dts/sdk/src/config/index.d.ts +6 -6
- package/dist/_dts/sdk/src/config/template-validation.d.ts +1 -1
- package/dist/_dts/sdk/src/config/validation.d.ts +1 -1
- package/dist/_dts/sdk/src/data/dataLoaderContext.d.ts +2 -2
- package/dist/_dts/sdk/src/data/resolveBlockData.d.ts +1 -1
- package/dist/_dts/sdk/src/data/types.d.ts +2 -2
- package/dist/_dts/sdk/src/gifting/client.d.ts +1 -2
- package/dist/_dts/sdk/src/index.d.ts +104 -8
- package/dist/_dts/sdk/src/manifest/index.d.ts +3 -3
- package/dist/_dts/sdk/src/metadata/index.d.ts +1 -1
- package/dist/_dts/sdk/src/navigation/index.d.ts +3 -3
- package/dist/_dts/sdk/src/next/index.d.ts +83 -52
- package/dist/_dts/sdk/src/next/middleware.d.ts +2 -2
- package/dist/_dts/sdk/src/page-converter/index.d.ts +3 -3
- package/dist/_dts/sdk/src/portal/client.d.ts +43 -56
- package/dist/_dts/sdk/src/portal/index.d.ts +3 -18
- package/dist/_dts/sdk/src/prebuild/index.d.ts +1 -1
- package/dist/_dts/sdk/src/preview-next/before-render.d.ts +2 -2
- package/dist/_dts/sdk/src/preview-next/client/index.d.ts +2 -2
- package/dist/_dts/sdk/src/preview-next/client/runtime.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/client.d.ts +2 -2
- package/dist/_dts/sdk/src/rendering/components/pageShared.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/helpers/loadPage.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/helpers/pageRuntimeSupport.d.ts +4 -4
- package/dist/_dts/sdk/src/rendering/index.d.ts +6 -6
- package/dist/_dts/sdk/src/rendering/islands/client.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/server.d.ts +2 -2
- package/dist/_dts/sdk/src/rendering/themeAdmission.d.ts +1 -1
- package/dist/_dts/sdk/src/routing/index.d.ts +6 -6
- package/dist/_dts/sdk/src/server.d.ts +5 -5
- package/dist/_dts/sdk/src/spam-protection/index.d.ts +2 -2
- package/dist/_dts/sdk/src/theme/index.d.ts +1 -1
- package/dist/_dts/{serviceBookingOutline-BvtNagjw.d.ts → serviceBookingOutline-DtQuFlID.d.ts} +6 -6
- package/dist/_dts/{types-DpEAnP4F.d.ts → types-B3RjeBLV.d.ts} +2 -2
- package/dist/_dts/{types-HAy1-Jjo.d.ts → types-BvUSGQrw.d.ts} +3 -3
- package/dist/_dts/{types-BrK6SS5c.d.ts → types-CkRFtBqd.d.ts} +7 -7
- package/dist/_dts/{validation-D6q3tOBA.d.ts → validation-BZA3DhcV.d.ts} +4 -4
- package/dist/client/{BlocksIslandsHydrator-DJSmdNUJ.mjs → BlocksIslandsHydrator-CQMf0HdN.mjs} +19 -19
- package/dist/client/{BookingMailingListNote-CGxg37zx.mjs → BookingMailingListNote-7kdvuPow.mjs} +93 -18
- package/dist/client/{BookingQuestionFields-DXegGSnS.mjs → BookingQuestionFields-BJI7mZuV.mjs} +7 -87
- package/dist/client/CalendarAction-D_Glwvz2.mjs +105 -0
- package/dist/client/{CalendarNavigationChevron-VfP50sYm.mjs → CalendarNavigationChevron-DPUD6wjy.mjs} +8 -8
- package/dist/client/{CheckboxChoice-BZPLCgTU.mjs → CheckboxChoice-C8i4NraK.mjs} +1 -1
- package/dist/client/{DemoBookingPortalAccess-0Ua44F1j.mjs → DemoBookingPortalAccess-8kwNF9HN.mjs} +9 -6
- package/dist/client/{EventCalendar.client-CrpiyDSP.mjs → EventCalendar.client-Dhb14bcC.mjs} +10 -10
- package/dist/client/{EventCombined.client-D0me9wnz.mjs → EventCombined.client-C1jEZBN9.mjs} +60 -10
- package/dist/client/{EventEmbeddedCheckoutStep-BDnicDM6.mjs → EventEmbeddedCheckoutStep-BGkbUhuw.mjs} +1 -1
- package/dist/client/{EventItem-CJITrGkF.mjs → EventItem-Bb0ppG2N.mjs} +9 -177
- package/dist/client/{EventListWeekNavigation-BlEm_xjq.mjs → EventListWeekNavigation-DMryCaNV.mjs} +1 -1
- package/dist/client/{EventListing.client-BNM_HuS0.mjs → EventListing.client-BuH5kKA3.mjs} +3 -3
- package/dist/client/{EventListing.view-CXfb7RRy.mjs → EventListing.view-DsqvuulZ.mjs} +8 -8
- package/dist/client/{EventRegistrationPayment-DiD9uYs6.mjs → EventRegistrationPayment-D4FvQSFF.mjs} +555 -502
- package/dist/client/{Page-bX7iy_MK.mjs → Page-sV6BJkXX.mjs} +550 -339
- package/dist/client/{ProtectedSubmitButton-De6AzhE6.mjs → ProtectedSubmitButton-BNnKuir8.mjs} +1 -1
- package/dist/client/{SiteTermsAgreementField-BAdW5DvE.mjs → SiteTermsAgreementField-VfSd6JU-.mjs} +7 -11
- package/dist/client/{StepIndicator-DCfdcb7s.mjs → StepIndicator-B6o5B7g3.mjs} +1 -1
- package/dist/client/{StepIndicator-DCqorVne.mjs → StepIndicator-BTqO7cJl.mjs} +235 -26
- package/dist/client/{ThemedButton-CnSa7o-I.mjs → ThemedButton-PFOhXktM.mjs} +1 -33
- package/dist/client/{accessibleSurfaces-Wl8-_OVJ.mjs → accessibleSurfaces-BogaGutk.mjs} +983 -634
- package/dist/client/{accordion-wofJY8xY.mjs → accordion-6cuswD_s.mjs} +1 -1
- package/dist/client/{booking-form.client-CYl9NrqS.mjs → booking-form.client-BOMe_SKi.mjs} +52 -29
- package/dist/client/bookingCalendar--aWnqFDn.mjs +180 -0
- package/dist/client/{bookingForm-kgVWtuMe.mjs → bookingForm-DSCH-VHo.mjs} +4 -4
- package/dist/client/bookings.mjs +17 -11
- package/dist/client/{boxStyleClassNames-CQHWz5gJ.mjs → boxStyleClassNames-BFuqZCfz.mjs} +2 -2
- package/dist/client/{carousel-BE1dEFsD.mjs → carousel-CGyQVV1M.mjs} +2 -2
- package/dist/client/{carousel.client-DMtGYTTM.mjs → carousel.client-BtLwHefX.mjs} +1 -1
- package/dist/client/{cart-BsjsdGZE.mjs → cart-BYOe7MCh.mjs} +3 -3
- package/dist/client/{cart.client-DylGUWXY.mjs → cart.client-BKFkaXdV.mjs} +1 -1
- package/dist/client/{checkout-B5KxEUDr.mjs → checkout-Dwd7Di77.mjs} +3 -3
- package/dist/client/{checkout.client-C98fhch3.mjs → checkout.client-C25hpi-z.mjs} +1 -1
- package/dist/client/{checkoutUrls-BMLYTf38.mjs → checkoutUrls-tG788sw0.mjs} +1 -1
- package/dist/client/client.mjs +106 -43
- package/dist/client/{constants-PfYJsEZF.mjs → constants-DdxFG3Ic.mjs} +1 -2
- package/dist/client/{context-DtKdUdkO.mjs → context-Hi1RuYEM.mjs} +753 -373
- package/dist/client/{dateFormatting-BaGPvQS3.mjs → dateFormatting-C8vBCHuo.mjs} +15 -25
- package/dist/client/{demoPortalMagicLink-B8eDjhuG.mjs → demoPortalMagicLink-BAL5UIDG.mjs} +2 -3
- package/dist/client/{enhanceHeaderSection-DvhD-8eE.mjs → enhanceHeaderSection-Dv1Lr9kJ.mjs} +4 -5
- package/dist/client/{event-registration.client-Du9a_xAN.mjs → event-registration.client-dB_Z7bb-.mjs} +191 -210
- package/dist/client/{eventCalendar-Di9wDfzl.mjs → eventCalendar-CQnRA4Ww.mjs} +4 -4
- package/dist/client/{eventCombined-CNW6nBsB.mjs → eventCombined-BDOG1hVp.mjs} +4 -4
- package/dist/client/{eventListing-CQMxQ8By.mjs → eventListing-DSVmhy9n.mjs} +4 -4
- package/dist/client/{eventRegistration-CprS9k1D.mjs → eventRegistration-CD5mRtEH.mjs} +4 -4
- package/dist/client/{form-Zl1_8RJ6.mjs → form-DWnlEVSK.mjs} +3 -3
- package/dist/client/{form.client-TaMUys6I.mjs → form.client-D7zmeqNI.mjs} +5 -5
- package/dist/client/{form.parts-CpNPbPPM.mjs → form.parts-C-G6N_MK.mjs} +3 -3
- package/dist/client/gifting/client.mjs +32 -29
- package/dist/client/{gifting-DNVa7-Wj.mjs → gifting-Cn0jidP5.mjs} +4 -4
- package/dist/client/{gifting.client-CFUq3GVx.mjs → gifting.client-DVo1YFLs.mjs} +5 -5
- package/dist/client/{gifting.parts-CDQvxA4A.mjs → gifting.parts-Bak93gD2.mjs} +2 -2
- package/dist/client/{headerSection-Cg6083rn.mjs → headerSection-DjQuj_6v.mjs} +2 -2
- package/dist/client/{mediaAssets-B99AP7ai.mjs → mediaAssets-COfQolI3.mjs} +1 -1
- package/dist/client/{mediaContext-Fusweriw.mjs → mediaContext-DzvnjYXm.mjs} +1 -1
- package/dist/client/{newsletter-form.client-VuL9I96G.mjs → newsletter-form.client-rIYPziZC.mjs} +7 -7
- package/dist/client/{newsletter-form.interactive-7Of3eYn0.mjs → newsletter-form.interactive-DVt3enLr.mjs} +181 -155
- package/dist/client/{newsletter-form.parts-OBqsfT24.mjs → newsletter-form.parts-CH6dGfdn.mjs} +2 -2
- package/dist/client/{newsletterForm-BkJe_RTv.mjs → newsletterForm-Cg8cBDHd.mjs} +3 -3
- package/dist/client/{lookSurfaces-gJ3OqPf9.mjs → noop-jesvJXEE.mjs} +403 -275
- package/dist/client/portal/client.mjs +12202 -7166
- package/dist/client/portalOrders-oEoTvzkW.mjs +596 -0
- package/dist/client/portalRoutes-ByyVZfVq.mjs +873 -0
- package/dist/client/{product-detail.client-B2hdxqJN.mjs → product-detail.client-5aHq-vuu.mjs} +1 -1
- package/dist/client/{product-list.client-CCEgu9rx.mjs → product-list.client-CyAk5rnC.mjs} +1 -1
- package/dist/client/{productDetail-CRX_ZRfS.mjs → productDetail-B8aZ2mqY.mjs} +3 -3
- package/dist/client/{productList-BAdJ6z5S.mjs → productList-BuLemmod.mjs} +3 -3
- package/dist/client/{propsDecoder-BLKAmX0S.mjs → propsDecoder-0Unsqn3R.mjs} +2 -2
- package/dist/client/{registry.server-Bj9cmHHF.mjs → registry.server-DzvtVVD0.mjs} +664 -434
- package/dist/client/{renderableMediaAssetAdmission-BlfqYLJW.mjs → renderableMediaAssetAdmission-BsOWd9lf.mjs} +1 -1
- package/dist/client/rendering/client.mjs +26 -26
- package/dist/client/rendering/islands.mjs +1 -1
- package/dist/client/rendering.mjs +16 -8
- package/dist/client/{richText-coerce-Z45OLLEX.mjs → richText-coerce-Bnng7JFA.mjs} +2 -1
- package/dist/client/{routeIslandApiConfig-DHpTTK77.mjs → routeIslandApiConfig-BGfcc9sk.mjs} +1 -1
- package/dist/client/{runtimeResponse-DtWSfWSZ.mjs → runtimeResponse-DAPVRToN.mjs} +1 -1
- package/dist/client/{runtimeResponse-D2j2-mOk.mjs → runtimeResponse-nXT8VAMl.mjs} +1 -1
- package/dist/client/{shop-BKsgxm_-.mjs → shop-GuMqnDL-.mjs} +3 -3
- package/dist/client/{shop-commerce-Cbtk_kUW.mjs → shop-commerce-D5bDY1o1.mjs} +53 -16
- package/dist/client/{shop-commerce-store-B-rv2p5h.mjs → shop-commerce-store-B7sHnLwI.mjs} +22 -5
- package/dist/client/{shop-discount-apply.state-CiCDLNh7.mjs → shop-discount-apply.state-Dos2zdC2.mjs} +2 -2
- package/dist/client/{shop.client-Rnqa74Tk.mjs → shop.client-uvj5GDZb.mjs} +17 -39
- package/dist/client/{shopShared-BaBfhjCq.mjs → shopShared-3giNWE3H.mjs} +2 -2
- package/dist/client/spam-protection.mjs +1 -1
- package/dist/client/src-Al4ooTl_.mjs +164 -0
- package/dist/client/{src-o7WEvbK1.mjs → src-CmXh3JWs.mjs} +233 -91
- package/dist/client/{timetableModel-BOff1Kk5.mjs → timetableModel-GA-hn1qM.mjs} +11 -87
- package/dist/client/{shop-add-feedback-DvC2kP1K.mjs → urlParams-C2QHo1Pa.mjs} +1 -42
- package/dist/client/{useAvailableSlots-DQJNh10g.mjs → useAvailableSlots-CBneCxbG.mjs} +2 -3
- package/dist/client/{useDiscountCodeUi-BcFQRI_7.mjs → useDiscountCodeUi-D0kGF0C7.mjs} +1 -1
- package/dist/client/{useEventPagination-BvdcexDC.mjs → useEventPagination-xX8n_Tuu.mjs} +8 -8
- package/dist/client/{view-CTBwSpKv.mjs → view-DOyZc-DF.mjs} +4 -4
- package/dist/client/{wizardSteps-CWIQyRIw.mjs → wizardSteps-B952ify5.mjs} +1241 -295
- package/dist/preview-next/client/{PageSectionToolbar-CG6KwITA.mjs → PageSectionToolbar-BI3UCdpu.mjs} +3 -3
- package/dist/preview-next/client/{PreviewEditorSidebar-BGBqrC9m.mjs → PreviewEditorSidebar-jkfLVOgY.mjs} +12 -9
- package/dist/preview-next/client/{PreviewEditorUI-Bwkyx28x.mjs → PreviewEditorUI-DwJQs4hM.mjs} +4 -4
- package/dist/preview-next/client/{PreviewShell-DB1l6JNU.mjs → PreviewShell-BAxAkuz8.mjs} +5 -5
- package/dist/preview-next/client/{SdkPreviewModeRuntime-Bs6Cwzr3.mjs → SdkPreviewModeRuntime-0UVB-39f.mjs} +68 -17
- package/dist/preview-next/client/{previewAssistantSlot-T-oDD_Dd.mjs → previewAssistantSlot-BgiYk3PB.mjs} +7347 -3516
- package/dist/preview-next/client/{previewChromeRoot-BeukcDRy.mjs → previewChromeRoot-tieNdF3E.mjs} +1 -1
- package/dist/preview-next/client/runtime.mjs +3 -3
- package/dist/preview-next/client/{sdk-runtime-ceDW_9q2.mjs → sdk-runtime-DXb_Evl0.mjs} +2 -2
- package/dist/preview-next/client/{siteStyleAccess-CCB9bScO.mjs → siteStyleAccess-BlN0jt2c.mjs} +3 -3
- package/dist/preview-next/client/{useAutosaveStatus-D4o0CKq7.mjs → useAutosaveStatus-BUEPA4oL.mjs} +1 -1
- package/dist/preview-next/client/{useOpenBlockForSetup-Seccrvwu.mjs → useOpenBlockForSetup-BVfr5P--.mjs} +1 -1
- package/dist/preview-next/container-responsive.css +203 -174
- package/dist/preview-next/keepAlive.mjs +1 -1
- package/dist/preview-next/middleware.mjs +1 -1
- package/dist/preview-next/{route-contract-FwFj8zGL.mjs → route-contract-BHTBA48n.mjs} +90 -37
- package/dist/server/{Block.shared-D6WrRCxX.mjs → Block.shared-hGoyEdjJ.mjs} +5 -5
- package/dist/server/{ThemeScopeCore-BQzjDQ2q.mjs → ThemeScopeCore-BfUCTOwj.mjs} +160 -142
- package/dist/server/{accessibleSurfaces-CM3QANtw.mjs → accessibleSurfaces-Dskni4Xj.mjs} +94 -330
- package/dist/server/accordions-By_0Ykks.mjs +111 -0
- package/dist/server/{bindings-CS6ih1Yc.mjs → bindings-DMJH4bvo.mjs} +7 -7
- package/dist/server/{client-m0ylCj_f.mjs → client-DrwlRNAH.mjs} +105 -42
- package/dist/server/config-validation.mjs +1 -1
- package/dist/server/config.mjs +2 -2
- package/dist/server/constants-CeMywaiD.mjs +1485 -0
- package/dist/server/{customCss-BZ8YSrQg.mjs → customCss-C9kgPHvr.mjs} +41 -5
- package/dist/server/data/resolveBlockData.mjs +1 -1
- package/dist/server/{resolveButtonColourStates--6yJp9Tq.mjs → expandPalette-ehuW8r2g.mjs} +745 -1229
- package/dist/server/index.mjs +3 -3
- package/dist/server/{loadContent-vgWMz1uD.mjs → loadContent-D0prFflT.mjs} +5 -4
- package/dist/server/{loadPage-CIOL3-9t.mjs → loadPage-CBLke9pJ.mjs} +3 -3
- package/dist/server/{lookMediaFrame-m-91jGGn.mjs → lookMediaFrame-H0fi4bJk.mjs} +38 -18
- package/dist/server/manifest.mjs +36 -25
- package/dist/server/{mapLocation-BM5WX7FY.mjs → mapLocation-MDDSubTp.mjs} +1 -1
- package/dist/server/media-BRmYrnzb.mjs +31 -0
- package/dist/server/{media-luf7RF22.mjs → media-gvfIw3z8.mjs} +2 -31
- package/dist/server/{navigation-BcNfYYuu.mjs → navigation-wrcuWmgp.mjs} +2 -2
- package/dist/server/navigation.mjs +1 -1
- package/dist/server/next.mjs +134 -81
- package/dist/server/{overrideResolution-BiHmsvTZ.mjs → overrideResolution-DUgCEH8z.mjs} +1 -1
- package/dist/server/page-converter.mjs +3 -3
- package/dist/server/{pageRenderPlan-DJo_obpi.mjs → pageRenderPlan-BHrmogsW.mjs} +165 -247
- package/dist/server/{pageRuntimeSupport-BnSuoHON.mjs → pageRuntimeSupport-D2-YMRei.mjs} +5 -5
- package/dist/server/{pageShared-BJuOzxzn.mjs → pageShared-CG8O31Eo.mjs} +3402 -3249
- package/dist/server/{parseThemeForPersistence-DOsfofCy.mjs → parseThemeForPersistence-CrPlbJEN.mjs} +3 -2
- package/dist/server/{portal-B4JVkdjc.mjs → portal-pG_uhsI2.mjs} +62 -46
- package/dist/server/portal.mjs +3 -3
- package/dist/server/portalQuestions-oUyohgL9.mjs +225 -0
- package/dist/server/{prebuild-Cr8p8T7V.mjs → prebuild-C8Amvzce.mjs} +1 -1
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/{prefetchBlockData-BZh57-ua.mjs → prefetchBlockData-BxUETRIZ.mjs} +4 -3
- package/dist/server/{registry-CvhFwbXJ.mjs → registry-Cc88-23f.mjs} +1514 -1190
- package/dist/server/rendering/components/pageShared.mjs +1 -1
- package/dist/server/rendering/helpers/loadPage.mjs +1 -1
- package/dist/server/rendering/helpers/pageRuntimeSupport.mjs +1 -1
- package/dist/server/rendering/server.mjs +4 -4
- package/dist/server/rendering.mjs +10 -9
- package/dist/server/{resolveBlockData-Cv_W1LVB.mjs → resolveBlockData-OG3KOkig.mjs} +2 -2
- package/dist/server/{responseMedia-KRKguBC5.mjs → responseMedia-IfH65QAH.mjs} +1 -1
- package/dist/server/{schema-BpsqaSSU.mjs → schema-CwfxQjc4.mjs} +10 -113
- package/dist/server/server.mjs +3 -3
- package/dist/server/{servicePageContent-CRKbTm_7.mjs → servicePageContent-BcFuhhD7.mjs} +22 -21
- package/dist/server/theme-bridge.mjs +34 -8
- package/dist/server/theme.mjs +2 -2
- package/dist/server/{three-pass-converter-39SXCCnh.mjs → three-pass-converter-DPaUPTfl.mjs} +34 -16
- package/dist/server/titleSourceSchema-NhK6azFS.mjs +2018 -0
- package/dist/server/typeGuards-CTW_9AXq.mjs +413 -0
- package/dist/server/types-BKaBZFjD.mjs +1085 -0
- package/dist/server/{validation-DCl-FCk_.mjs → validation-BovmbS8N.mjs} +70 -17
- package/dist/server/{version-DT_R5JAR.mjs → version-hws4hgyX.mjs} +1 -1
- package/dist/server/video-Cdr3wh-q.mjs +272 -0
- package/dist/styles/index.css +1098 -1885
- package/package.json +2 -1
- package/dist/_dts/index-B0_2-65A.d.ts +0 -101
- package/dist/client/TabBarFragment-DlKQRhP4.mjs +0 -56
- package/dist/client/checkoutRoute-DKlZRNZD.mjs +0 -22
- package/dist/client/creditProducts-BQ1t1erI.mjs +0 -266
- package/dist/client/formatDate-hhI1-tzt.mjs +0 -26
- package/dist/server/constants-Cj7hfbrA.mjs +0 -41
- package/dist/server/richTextSchema-QLaQrbII.mjs +0 -212
- package/dist/server/titleSourceSchema-Cu-3PRvv.mjs +0 -122
|
@@ -0,0 +1,1085 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region ../site-contracts/src/tokens.ts
|
|
3
|
+
const blockColorTokenNames = [
|
|
4
|
+
"text",
|
|
5
|
+
"heading",
|
|
6
|
+
"mutedText",
|
|
7
|
+
"surface",
|
|
8
|
+
"background",
|
|
9
|
+
"foreground",
|
|
10
|
+
"border",
|
|
11
|
+
"primary",
|
|
12
|
+
"secondary",
|
|
13
|
+
"accent",
|
|
14
|
+
"success",
|
|
15
|
+
"warning",
|
|
16
|
+
"info",
|
|
17
|
+
"error",
|
|
18
|
+
"destructive",
|
|
19
|
+
"scrim",
|
|
20
|
+
"shadow",
|
|
21
|
+
"onPrimary",
|
|
22
|
+
"onSecondary",
|
|
23
|
+
"onAccent",
|
|
24
|
+
"onSuccess",
|
|
25
|
+
"onWarning",
|
|
26
|
+
"onInfo",
|
|
27
|
+
"onError",
|
|
28
|
+
"onDestructive",
|
|
29
|
+
"onSurface",
|
|
30
|
+
"onText"
|
|
31
|
+
];
|
|
32
|
+
function parseOpacityPercent(source) {
|
|
33
|
+
const trimmed = source.trim();
|
|
34
|
+
if (!trimmed) return null;
|
|
35
|
+
if (!/^\d{1,3}(?:\.\d+)?$/.test(trimmed)) return null;
|
|
36
|
+
const value = Number(trimmed);
|
|
37
|
+
if (!Number.isFinite(value)) return null;
|
|
38
|
+
if (value < 0 || value > 100) return null;
|
|
39
|
+
return value;
|
|
40
|
+
}
|
|
41
|
+
function parseColorTokenParts(source) {
|
|
42
|
+
const trimmed = source.trim();
|
|
43
|
+
if (trimmed.startsWith("raw:")) return {
|
|
44
|
+
kind: "raw",
|
|
45
|
+
value: trimmed.slice(4)
|
|
46
|
+
};
|
|
47
|
+
const [token, opacityRaw, extra] = trimmed.split("/");
|
|
48
|
+
if (!token || extra !== void 0) return {
|
|
49
|
+
kind: "invalid",
|
|
50
|
+
token: trimmed
|
|
51
|
+
};
|
|
52
|
+
if (opacityRaw === void 0) return {
|
|
53
|
+
kind: "token",
|
|
54
|
+
token,
|
|
55
|
+
opacityPercent: null
|
|
56
|
+
};
|
|
57
|
+
const opacityPercent = parseOpacityPercent(opacityRaw);
|
|
58
|
+
if (opacityPercent === null) return {
|
|
59
|
+
kind: "invalid",
|
|
60
|
+
token: trimmed
|
|
61
|
+
};
|
|
62
|
+
return {
|
|
63
|
+
kind: "token",
|
|
64
|
+
token,
|
|
65
|
+
opacityPercent
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Known palette role token names. This is the low-level source of truth for
|
|
70
|
+
* palette roles used by palette variants, Theme V2 schemas, and runtime color
|
|
71
|
+
* reference parsing.
|
|
72
|
+
*/
|
|
73
|
+
const PALETTE_TOKEN_NAMES = [
|
|
74
|
+
"primary",
|
|
75
|
+
"primaryForeground",
|
|
76
|
+
"secondary",
|
|
77
|
+
"accent",
|
|
78
|
+
"success",
|
|
79
|
+
"warning",
|
|
80
|
+
"destructive",
|
|
81
|
+
"background",
|
|
82
|
+
"surface",
|
|
83
|
+
"surfaceAlt",
|
|
84
|
+
"muted",
|
|
85
|
+
"text",
|
|
86
|
+
"border"
|
|
87
|
+
];
|
|
88
|
+
const paletteTokenNameSchema = z.enum(PALETTE_TOKEN_NAMES);
|
|
89
|
+
const themeColorBaseTokenNames = [
|
|
90
|
+
...PALETTE_TOKEN_NAMES,
|
|
91
|
+
...blockColorTokenNames,
|
|
92
|
+
"white",
|
|
93
|
+
"neutral",
|
|
94
|
+
"primaryText",
|
|
95
|
+
"secondaryForeground",
|
|
96
|
+
"accentForeground"
|
|
97
|
+
];
|
|
98
|
+
const themeColorBaseTokenSet = new Set(themeColorBaseTokenNames);
|
|
99
|
+
const shadeStepSet = /* @__PURE__ */ new Set([
|
|
100
|
+
"50",
|
|
101
|
+
"100",
|
|
102
|
+
"200",
|
|
103
|
+
"300",
|
|
104
|
+
"400",
|
|
105
|
+
"500",
|
|
106
|
+
"600",
|
|
107
|
+
"700",
|
|
108
|
+
"800",
|
|
109
|
+
"900",
|
|
110
|
+
"950"
|
|
111
|
+
]);
|
|
112
|
+
function isKnownBaseToken(value) {
|
|
113
|
+
return themeColorBaseTokenSet.has(value);
|
|
114
|
+
}
|
|
115
|
+
function isKnownShadeToken(value) {
|
|
116
|
+
const match = value.match(/^([a-zA-Z][a-zA-Z0-9]*)(?:-([0-9]{2,3}))$/);
|
|
117
|
+
if (!match) return false;
|
|
118
|
+
const [, base, shade] = match;
|
|
119
|
+
return Boolean(base && shade && isKnownBaseToken(base) && shadeStepSet.has(shade));
|
|
120
|
+
}
|
|
121
|
+
function isThemeColorTokenBase(value) {
|
|
122
|
+
return isKnownBaseToken(value) || isKnownShadeToken(value);
|
|
123
|
+
}
|
|
124
|
+
function isThemeColorToken(value) {
|
|
125
|
+
if (typeof value !== "string") return false;
|
|
126
|
+
const parts = parseColorTokenParts(value);
|
|
127
|
+
return parts.kind === "token" && isThemeColorTokenBase(parts.token);
|
|
128
|
+
}
|
|
129
|
+
function parseThemeColorToken(value) {
|
|
130
|
+
if (!isThemeColorToken(value)) return null;
|
|
131
|
+
return value.trim();
|
|
132
|
+
}
|
|
133
|
+
const themeColorTokenSchema = z.string().min(1).refine((value) => Boolean(isThemeColorToken(value)), "Expected a known Theme V2 color token");
|
|
134
|
+
const HEX_COLOR_REGEX = /^#[0-9a-f]{6}$/;
|
|
135
|
+
const NORMALIZABLE_HEX_REGEX = /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;
|
|
136
|
+
const THEME_PALETTE_COLOR_ORDER = [
|
|
137
|
+
"primary",
|
|
138
|
+
"secondary",
|
|
139
|
+
"accent",
|
|
140
|
+
"success",
|
|
141
|
+
"warning",
|
|
142
|
+
"destructive",
|
|
143
|
+
"background",
|
|
144
|
+
"surface",
|
|
145
|
+
"surfaceAlt",
|
|
146
|
+
"muted",
|
|
147
|
+
"text",
|
|
148
|
+
"primaryForeground",
|
|
149
|
+
"border"
|
|
150
|
+
];
|
|
151
|
+
const hexColorSchema = z.string().regex(HEX_COLOR_REGEX, "Hex must be #RRGGBB (lowercase)").transform((value) => value);
|
|
152
|
+
const paletteModeSchema = z.enum(["light", "dark"]);
|
|
153
|
+
const paletteColorsSchema = z.object({
|
|
154
|
+
primary: hexColorSchema,
|
|
155
|
+
primaryForeground: hexColorSchema,
|
|
156
|
+
secondary: hexColorSchema,
|
|
157
|
+
accent: hexColorSchema,
|
|
158
|
+
success: hexColorSchema,
|
|
159
|
+
warning: hexColorSchema,
|
|
160
|
+
destructive: hexColorSchema,
|
|
161
|
+
background: hexColorSchema,
|
|
162
|
+
surface: hexColorSchema,
|
|
163
|
+
surfaceAlt: hexColorSchema,
|
|
164
|
+
muted: hexColorSchema,
|
|
165
|
+
text: hexColorSchema,
|
|
166
|
+
border: hexColorSchema
|
|
167
|
+
}).strict().transform((value) => value);
|
|
168
|
+
function normalizePaletteHex(value) {
|
|
169
|
+
if (!NORMALIZABLE_HEX_REGEX.test(value)) return null;
|
|
170
|
+
const normalized = value.toLowerCase();
|
|
171
|
+
if (normalized.length === 7) return normalized;
|
|
172
|
+
const triplet = normalized.slice(1);
|
|
173
|
+
const red = triplet.charAt(0);
|
|
174
|
+
const green = triplet.charAt(1);
|
|
175
|
+
const blue = triplet.charAt(2);
|
|
176
|
+
return `#${red}${red}${green}${green}${blue}${blue}`;
|
|
177
|
+
}
|
|
178
|
+
function admitPaletteEntry(values, entry) {
|
|
179
|
+
const parsedRole = paletteTokenNameSchema.safeParse(entry.name);
|
|
180
|
+
if (!parsedRole.success) return {
|
|
181
|
+
ok: false,
|
|
182
|
+
error: {
|
|
183
|
+
kind: "unknown-role",
|
|
184
|
+
role: entry.name
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
const role = parsedRole.data;
|
|
188
|
+
if (values[role] !== void 0) return {
|
|
189
|
+
ok: false,
|
|
190
|
+
error: {
|
|
191
|
+
kind: "duplicate-role",
|
|
192
|
+
role
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
const hex = normalizePaletteHex(entry.hex);
|
|
196
|
+
if (hex === null) return {
|
|
197
|
+
ok: false,
|
|
198
|
+
error: {
|
|
199
|
+
kind: "invalid-color",
|
|
200
|
+
role,
|
|
201
|
+
value: entry.hex
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
return {
|
|
205
|
+
ok: true,
|
|
206
|
+
values: {
|
|
207
|
+
...values,
|
|
208
|
+
[role]: hex
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
function paletteColorsFromEntries(entries) {
|
|
213
|
+
const admitted = entries.reduce((result, entry) => result.ok ? admitPaletteEntry(result.values, entry) : result, {
|
|
214
|
+
ok: true,
|
|
215
|
+
values: {}
|
|
216
|
+
});
|
|
217
|
+
if (!admitted.ok) return admitted;
|
|
218
|
+
const missing = PALETTE_TOKEN_NAMES.filter((role) => admitted.values[role] === void 0);
|
|
219
|
+
return missing.length > 0 ? {
|
|
220
|
+
ok: false,
|
|
221
|
+
error: {
|
|
222
|
+
kind: "missing-roles",
|
|
223
|
+
roles: missing
|
|
224
|
+
}
|
|
225
|
+
} : {
|
|
226
|
+
ok: true,
|
|
227
|
+
colors: paletteColorsSchema.parse(admitted.values)
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
function paletteColorEntries(colors) {
|
|
231
|
+
return THEME_PALETTE_COLOR_ORDER.map((name) => ({
|
|
232
|
+
name,
|
|
233
|
+
hex: colors[name]
|
|
234
|
+
}));
|
|
235
|
+
}
|
|
236
|
+
//#endregion
|
|
237
|
+
//#region ../theme-core/src/utils/cssValueSafety.ts
|
|
238
|
+
/**
|
|
239
|
+
* Whether a value can be written into CSS where its author meant it to go
|
|
240
|
+
* (issue 1185).
|
|
241
|
+
*
|
|
242
|
+
* Server rendering writes a `style` object as one attribute string, and
|
|
243
|
+
* generated stylesheets interpolate tokens into declarations. Either way the
|
|
244
|
+
* value is left as it is, so one holding a `;` or a brace adds declarations or
|
|
245
|
+
* rules nobody wrote. This is the one rule for "a value stays inside its
|
|
246
|
+
* declaration"; the inline style guard, the colour token helpers and the
|
|
247
|
+
* custom-block layout gate all build on it.
|
|
248
|
+
*/
|
|
249
|
+
/** A complete quoted string, inside which `;` is just text (a font name, a data URI). */
|
|
250
|
+
const QUOTED_STRING = /"[^"\\\n]*"|'[^'\\\n]*'/g;
|
|
251
|
+
/**
|
|
252
|
+
* Outside quoted strings: the end of a declaration, a block, a CSS escape, or
|
|
253
|
+
* a quote that never closes and would swallow what follows.
|
|
254
|
+
*/
|
|
255
|
+
const DECLARATION_BREAK = /[;{}\\"']/;
|
|
256
|
+
/**
|
|
257
|
+
* Refused inside quoted strings too: values also go into `<style>` elements,
|
|
258
|
+
* where `</style>` ends the stylesheet whether or not CSS reads it as a string.
|
|
259
|
+
*/
|
|
260
|
+
const TAG_BRACKET = /[<>]/;
|
|
261
|
+
/** The value with its complete quoted strings removed. */
|
|
262
|
+
const outsideQuotedStrings = (value) => value.replace(QUOTED_STRING, "");
|
|
263
|
+
/** True when `value` cannot end its declaration or open another construct. */
|
|
264
|
+
function staysInsideDeclaration(value) {
|
|
265
|
+
return !TAG_BRACKET.test(value) && !DECLARATION_BREAK.test(outsideQuotedStrings(value));
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* CSS functions that fetch a file, for naming one in an error. `image()` and
|
|
269
|
+
* `src()` are specified but no browser fetches through them yet.
|
|
270
|
+
*/
|
|
271
|
+
const CSS_LOADING_FUNCTIONS = /* @__PURE__ */ new Set([
|
|
272
|
+
"url",
|
|
273
|
+
"image-set",
|
|
274
|
+
"-webkit-image-set",
|
|
275
|
+
"image",
|
|
276
|
+
"src"
|
|
277
|
+
]);
|
|
278
|
+
/** `url(` and `image-set(` (which `-webkit-image-set(` ends in), the two every browser fetches through. */
|
|
279
|
+
const LOADING_FUNCTION_CALL = /(?:url|image-set)\(/i;
|
|
280
|
+
/**
|
|
281
|
+
* True when `value` calls `url()` or `image-set()`, in any letter case.
|
|
282
|
+
*
|
|
283
|
+
* Only meaningful for a value that `staysInsideDeclaration`: that rule refuses
|
|
284
|
+
* backslashes, so the name cannot be spelled with CSS escapes. A name split
|
|
285
|
+
* from its bracket by a space or a comment is not a function call to a browser
|
|
286
|
+
* either, so it fetches nothing.
|
|
287
|
+
*/
|
|
288
|
+
function callsCssLoadingFunction(value) {
|
|
289
|
+
return LOADING_FUNCTION_CALL.test(outsideQuotedStrings(value));
|
|
290
|
+
}
|
|
291
|
+
//#endregion
|
|
292
|
+
//#region ../theme-core/src/utils/colorStyles.ts
|
|
293
|
+
const COLOR_VAR_PREFIX = "--tb-";
|
|
294
|
+
function parseToken(source) {
|
|
295
|
+
const parts = parseColorTokenParts(source);
|
|
296
|
+
if (parts.kind === "raw") return {
|
|
297
|
+
token: source,
|
|
298
|
+
raw: parts.value
|
|
299
|
+
};
|
|
300
|
+
if (parts.kind === "invalid") return { token: source };
|
|
301
|
+
return {
|
|
302
|
+
token: parts.token,
|
|
303
|
+
opacityPercent: parts.opacityPercent === null ? void 0 : parts.opacityPercent
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
const SURFACE_TEXT_ROLE_BY_TOKEN = {
|
|
307
|
+
text: "text",
|
|
308
|
+
heading: "heading",
|
|
309
|
+
mutedText: "supporting"
|
|
310
|
+
};
|
|
311
|
+
function surfaceRoleForTextToken(token) {
|
|
312
|
+
return Object.prototype.hasOwnProperty.call(SURFACE_TEXT_ROLE_BY_TOKEN, token) ? SURFACE_TEXT_ROLE_BY_TOKEN[token] : null;
|
|
313
|
+
}
|
|
314
|
+
/**
|
|
315
|
+
* Converts a theme color token to a CSS rgb value.
|
|
316
|
+
* This is the primary function for applying theme colors to CSS properties.
|
|
317
|
+
*
|
|
318
|
+
* @param token - Theme color token (semantic, with opacity, or raw)
|
|
319
|
+
* @returns CSS color value (rgb with optional alpha, or raw CSS value)
|
|
320
|
+
*
|
|
321
|
+
* @example
|
|
322
|
+
* rgbColorValue('primary') // => 'rgb(var(--tb-primary))'
|
|
323
|
+
* rgbColorValue('surface/95') // => 'rgb(var(--tb-surface) / 0.95)'
|
|
324
|
+
* rgbColorValue('raw:transparent') // => 'transparent'
|
|
325
|
+
*/
|
|
326
|
+
function rgbColorValue(token) {
|
|
327
|
+
if (typeof token !== "string" || !staysInsideDeclaration(token)) return "transparent";
|
|
328
|
+
const { token: baseToken, opacityPercent, raw } = parseToken(token);
|
|
329
|
+
if (raw) return raw;
|
|
330
|
+
const cssVar = `${COLOR_VAR_PREFIX}${baseToken}`;
|
|
331
|
+
if (opacityPercent === void 0) return `rgb(var(${cssVar}))`;
|
|
332
|
+
return `rgb(var(${cssVar}) / ${opacityPercent / 100})`;
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* Converts a theme color token to a CSS variable reference.
|
|
336
|
+
* Note: This returns the base variable without rgb() wrapper, ignoring opacity.
|
|
337
|
+
*
|
|
338
|
+
* @param token - Theme color token
|
|
339
|
+
* @returns CSS variable reference
|
|
340
|
+
*
|
|
341
|
+
* @example
|
|
342
|
+
* cssVarValue('primary') // => 'var(--tb-primary)'
|
|
343
|
+
* cssVarValue('surface/95') // => 'var(--tb-surface)' (opacity ignored)
|
|
344
|
+
*/
|
|
345
|
+
function cssVarValue(token) {
|
|
346
|
+
if (typeof token !== "string" || !staysInsideDeclaration(token)) return "transparent";
|
|
347
|
+
const { token: baseToken } = parseToken(token);
|
|
348
|
+
return `var(${COLOR_VAR_PREFIX}${baseToken})`;
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* Creates a backgroundColor style object from a theme token.
|
|
352
|
+
*
|
|
353
|
+
* @param token - Theme color token
|
|
354
|
+
* @returns CSSProperties with backgroundColor
|
|
355
|
+
*/
|
|
356
|
+
function backgroundColorStyle(token) {
|
|
357
|
+
return { backgroundColor: rgbColorValue(token) };
|
|
358
|
+
}
|
|
359
|
+
/**
|
|
360
|
+
* Converts a text color token to a CSS color value that follows the enclosing
|
|
361
|
+
* surface. The semantic text tokens (`text`, `heading`, `mutedText`) resolve
|
|
362
|
+
* to the surface foreground variables, so text adapts when a section's
|
|
363
|
+
* background changes; any other token is a fixed theme color.
|
|
364
|
+
*
|
|
365
|
+
* @param token - Theme color token
|
|
366
|
+
* @returns CSS color value
|
|
367
|
+
*/
|
|
368
|
+
function textColorValue(token) {
|
|
369
|
+
const parsed = parseToken(token);
|
|
370
|
+
const surfaceRole = parsed.raw ? null : surfaceRoleForTextToken(parsed.token);
|
|
371
|
+
if (!surfaceRole) return rgbColorValue(token);
|
|
372
|
+
return parsed.opacityPercent === void 0 ? surfaceForegroundValue(surfaceRole) : surfaceForegroundValueWithOpacity(surfaceRole, parsed.opacityPercent);
|
|
373
|
+
}
|
|
374
|
+
/**
|
|
375
|
+
* Creates a text color style object from a theme token.
|
|
376
|
+
*
|
|
377
|
+
* @param token - Theme color token
|
|
378
|
+
* @returns CSSProperties with color
|
|
379
|
+
*/
|
|
380
|
+
function textColorStyle(token) {
|
|
381
|
+
return { color: textColorValue(token) };
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* Creates a border color style object from a theme token.
|
|
385
|
+
*
|
|
386
|
+
* @param token - Theme color token
|
|
387
|
+
* @returns CSSProperties with borderColor
|
|
388
|
+
*/
|
|
389
|
+
function borderColorStyle(token) {
|
|
390
|
+
return { borderColor: rgbColorValue(token) };
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* Merges multiple CSSProperties objects into a single object.
|
|
394
|
+
* Later styles override earlier ones. Undefined values are filtered out.
|
|
395
|
+
* Returns undefined if the merged result is empty.
|
|
396
|
+
*
|
|
397
|
+
* @param styles - Variable number of CSSProperties objects (can be undefined)
|
|
398
|
+
* @returns Merged CSSProperties object, or undefined if empty
|
|
399
|
+
*
|
|
400
|
+
* @example
|
|
401
|
+
* mergeStyles(
|
|
402
|
+
* backgroundColorStyle('surface'),
|
|
403
|
+
* textColorStyle('text'),
|
|
404
|
+
* borderColorStyle('border')
|
|
405
|
+
* )
|
|
406
|
+
* // => { backgroundColor: '...', color: '...', borderColor: '...' }
|
|
407
|
+
*/
|
|
408
|
+
function mergeStyles(...styles) {
|
|
409
|
+
const merged = {};
|
|
410
|
+
for (const style of styles) {
|
|
411
|
+
if (!style) continue;
|
|
412
|
+
Object.assign(merged, style);
|
|
413
|
+
}
|
|
414
|
+
return Object.keys(merged).length ? merged : void 0;
|
|
415
|
+
}
|
|
416
|
+
//#endregion
|
|
417
|
+
//#region ../theme-core/src/surfaces/foregroundContract.ts
|
|
418
|
+
const SURFACE_FOREGROUND_CSS_VARS = {
|
|
419
|
+
text: "--rb-surface-text-color",
|
|
420
|
+
heading: "--rb-surface-heading-color",
|
|
421
|
+
link: "--rb-surface-link-color",
|
|
422
|
+
linkHover: "--rb-surface-link-hover-color",
|
|
423
|
+
supporting: "--rb-surface-supporting-color",
|
|
424
|
+
muted: "--rb-surface-muted-color",
|
|
425
|
+
line: "--rb-surface-line-color",
|
|
426
|
+
mark: "--rb-surface-mark-color"
|
|
427
|
+
};
|
|
428
|
+
const DEFAULT_SURFACE_TEXT_COLOR = "rgb(var(--tb-text, 17 24 39))";
|
|
429
|
+
const DEFAULT_SURFACE_LINK_COLOR = "rgb(var(--tb-primary, var(--tb-text, 17 24 39)))";
|
|
430
|
+
const DEFAULT_SURFACE_SUPPORTING_COLOR = "rgb(var(--tb-mutedText, 100 116 139))";
|
|
431
|
+
const DEFAULT_ROLE_FALLBACKS = {
|
|
432
|
+
text: DEFAULT_SURFACE_TEXT_COLOR,
|
|
433
|
+
heading: DEFAULT_SURFACE_TEXT_COLOR,
|
|
434
|
+
link: DEFAULT_SURFACE_LINK_COLOR,
|
|
435
|
+
linkHover: DEFAULT_SURFACE_LINK_COLOR,
|
|
436
|
+
supporting: DEFAULT_SURFACE_SUPPORTING_COLOR,
|
|
437
|
+
muted: DEFAULT_SURFACE_SUPPORTING_COLOR
|
|
438
|
+
};
|
|
439
|
+
function requireSurfaceColorValue(role, value) {
|
|
440
|
+
const normalized = value.trim();
|
|
441
|
+
if (normalized.length === 0) throw new RangeError(`Surface foreground ${role} must be a non-empty CSS color.`);
|
|
442
|
+
return normalized;
|
|
443
|
+
}
|
|
444
|
+
function completeSurfaceForegrounds(input) {
|
|
445
|
+
const text = requireSurfaceColorValue("text", input.text);
|
|
446
|
+
const link = input.link === void 0 ? text : requireSurfaceColorValue("link", input.link);
|
|
447
|
+
return {
|
|
448
|
+
text,
|
|
449
|
+
heading: input.heading === void 0 ? text : requireSurfaceColorValue("heading", input.heading),
|
|
450
|
+
link,
|
|
451
|
+
linkHover: input.linkHover === void 0 ? link : requireSurfaceColorValue("linkHover", input.linkHover),
|
|
452
|
+
muted: input.muted === void 0 ? text : requireSurfaceColorValue("muted", input.muted),
|
|
453
|
+
supporting: input.supporting === void 0 ? text : requireSurfaceColorValue("supporting", input.supporting)
|
|
454
|
+
};
|
|
455
|
+
}
|
|
456
|
+
function surfaceForegroundValue(role, outsideProviderFallback = DEFAULT_ROLE_FALLBACKS[role]) {
|
|
457
|
+
const roleVariable = SURFACE_FOREGROUND_CSS_VARS[role];
|
|
458
|
+
const fallback = requireSurfaceColorValue("fallback", outsideProviderFallback);
|
|
459
|
+
if (role === "text") return `var(${roleVariable}, ${fallback})`;
|
|
460
|
+
if (role === "linkHover") return `var(${roleVariable}, ${surfaceForegroundValue("link", fallback)})`;
|
|
461
|
+
return `var(${roleVariable}, var(${SURFACE_FOREGROUND_CSS_VARS.text}, ${fallback}))`;
|
|
462
|
+
}
|
|
463
|
+
/** The solved inks, published beside the foreground roles by the same surfaces. */
|
|
464
|
+
const SURFACE_INK_CSS_VARS = {
|
|
465
|
+
brand: "--rb-surface-brand-color",
|
|
466
|
+
accent: "--rb-surface-accent-color",
|
|
467
|
+
focus: "--rb-surface-focus-color",
|
|
468
|
+
control: "--rb-surface-control-color"
|
|
469
|
+
};
|
|
470
|
+
/**
|
|
471
|
+
* Read a solved ink, falling back straight to the declaration's own previous
|
|
472
|
+
* expression. Unlike `surfaceForegroundValue` this never falls through to
|
|
473
|
+
* `--rb-surface-text-color`: where no ink is published (bridge pages, unmeasured
|
|
474
|
+
* paints) brand text must keep its brand colour, not turn into the text ink.
|
|
475
|
+
*/
|
|
476
|
+
function surfaceInkValue(role, previousExpression) {
|
|
477
|
+
return `var(${SURFACE_INK_CSS_VARS[role]}, ${requireSurfaceColorValue("fallback", previousExpression)})`;
|
|
478
|
+
}
|
|
479
|
+
/**
|
|
480
|
+
* The declarations for a surface's ink publication. An exact ink is a token
|
|
481
|
+
* reference (`rgb(var(--tb-primary))`), so a site's own token value wins; a
|
|
482
|
+
* nudged or replaced ink is a literal colour.
|
|
483
|
+
*/
|
|
484
|
+
function surfaceInkStyle(publication) {
|
|
485
|
+
switch (publication.kind) {
|
|
486
|
+
case "none": return {};
|
|
487
|
+
case "reset": return inkVariables(() => "initial");
|
|
488
|
+
case "solved": return inkVariables((role) => {
|
|
489
|
+
const ink = publication.inks[role];
|
|
490
|
+
const token = parseThemeColorToken(ink);
|
|
491
|
+
return token ? rgbColorValue(token) : ink;
|
|
492
|
+
});
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
function surfaceInkDeclarations(publication) {
|
|
496
|
+
return Object.entries(surfaceInkStyle(publication)).map(([property, value]) => `${property}: ${value};`);
|
|
497
|
+
}
|
|
498
|
+
function inkVariables(value) {
|
|
499
|
+
return {
|
|
500
|
+
[SURFACE_INK_CSS_VARS.brand]: value("brand"),
|
|
501
|
+
[SURFACE_INK_CSS_VARS.accent]: value("accent"),
|
|
502
|
+
[SURFACE_INK_CSS_VARS.focus]: value("focus"),
|
|
503
|
+
[SURFACE_INK_CSS_VARS.control]: value("control")
|
|
504
|
+
};
|
|
505
|
+
}
|
|
506
|
+
function surfaceForegroundValueWithOpacity(role, opacityPercent) {
|
|
507
|
+
if (!Number.isFinite(opacityPercent) || opacityPercent < 0 || opacityPercent > 100) throw new RangeError("Surface foreground opacity must be between 0 and 100.");
|
|
508
|
+
return `color-mix(in srgb, ${surfaceForegroundValue(role)} ${opacityPercent}%, transparent)`;
|
|
509
|
+
}
|
|
510
|
+
function surfaceForegroundStyle(input) {
|
|
511
|
+
const foregrounds = completeSurfaceForegrounds(input);
|
|
512
|
+
return {
|
|
513
|
+
color: foregrounds.text,
|
|
514
|
+
[SURFACE_FOREGROUND_CSS_VARS.text]: foregrounds.text,
|
|
515
|
+
[SURFACE_FOREGROUND_CSS_VARS.heading]: foregrounds.heading,
|
|
516
|
+
[SURFACE_FOREGROUND_CSS_VARS.link]: foregrounds.link,
|
|
517
|
+
[SURFACE_FOREGROUND_CSS_VARS.linkHover]: foregrounds.linkHover,
|
|
518
|
+
[SURFACE_FOREGROUND_CSS_VARS.supporting]: foregrounds.supporting,
|
|
519
|
+
...input.muted === void 0 ? {} : { [SURFACE_FOREGROUND_CSS_VARS.muted]: foregrounds.muted },
|
|
520
|
+
"--rb-surface-link-hover-decoration": hoverDecoration(input)
|
|
521
|
+
};
|
|
522
|
+
}
|
|
523
|
+
function surfaceForegroundDeclarations(input) {
|
|
524
|
+
return Object.entries(surfaceForegroundStyle(input)).map(([property, value]) => `${property}: ${value};`);
|
|
525
|
+
}
|
|
526
|
+
function surfaceForegroundInputFromResolved(foreground, color) {
|
|
527
|
+
const { roles } = foreground;
|
|
528
|
+
const value = (ink) => {
|
|
529
|
+
const token = parseThemeColorToken(ink);
|
|
530
|
+
return token ? color(token) : ink;
|
|
531
|
+
};
|
|
532
|
+
return {
|
|
533
|
+
text: value(roles.text),
|
|
534
|
+
heading: value(roles.heading),
|
|
535
|
+
link: value(roles.link),
|
|
536
|
+
linkHover: value(roles.linkHover),
|
|
537
|
+
supporting: value(roles.supporting),
|
|
538
|
+
hoverDecoration: foreground.hoverDecoration
|
|
539
|
+
};
|
|
540
|
+
}
|
|
541
|
+
function hoverDecoration(input) {
|
|
542
|
+
return input.hoverDecoration ?? "underline";
|
|
543
|
+
}
|
|
544
|
+
//#endregion
|
|
545
|
+
//#region ../site-contracts/src/identity/blockKinds.ts
|
|
546
|
+
/**
|
|
547
|
+
* Standard semantic variant roles a theme exposes.
|
|
548
|
+
*
|
|
549
|
+
* Block content references variants by role; the active theme determines
|
|
550
|
+
* what each role looks like.
|
|
551
|
+
*/
|
|
552
|
+
const VARIANT_ROLES = [
|
|
553
|
+
"primary",
|
|
554
|
+
"secondary",
|
|
555
|
+
"outline",
|
|
556
|
+
"ghost",
|
|
557
|
+
"accent"
|
|
558
|
+
];
|
|
559
|
+
const variantRoleSchema = z.enum(VARIANT_ROLES);
|
|
560
|
+
const SYSTEM_BLOCK_KINDS = [
|
|
561
|
+
"block.hero",
|
|
562
|
+
"block.intro",
|
|
563
|
+
"block.columns",
|
|
564
|
+
"block.collection",
|
|
565
|
+
"block.class-prices",
|
|
566
|
+
"block.feature-cards",
|
|
567
|
+
"block.media-text",
|
|
568
|
+
"block.cta-full",
|
|
569
|
+
"block.single-button",
|
|
570
|
+
"block.body-text",
|
|
571
|
+
"block.location-map",
|
|
572
|
+
"block.faq",
|
|
573
|
+
"block.list",
|
|
574
|
+
"block.testimonials",
|
|
575
|
+
"block.team-members",
|
|
576
|
+
"block.embed",
|
|
577
|
+
"block.blog-post",
|
|
578
|
+
"block.blog-listing",
|
|
579
|
+
"block.site-header",
|
|
580
|
+
"block.site-footer",
|
|
581
|
+
"block.form",
|
|
582
|
+
"block.contact-newsletter",
|
|
583
|
+
"block.appointment-booking",
|
|
584
|
+
"block.appointment-services",
|
|
585
|
+
"block.service-details",
|
|
586
|
+
"block.weekly-slot-availability",
|
|
587
|
+
"block.event-registration",
|
|
588
|
+
...[
|
|
589
|
+
"block.event-details",
|
|
590
|
+
"block.event-spotlight",
|
|
591
|
+
"block.event-listing",
|
|
592
|
+
"block.event-calendar",
|
|
593
|
+
"block.recurring-schedule",
|
|
594
|
+
"block.offerings-preview"
|
|
595
|
+
],
|
|
596
|
+
"block.shop",
|
|
597
|
+
"block.product-list",
|
|
598
|
+
"block.product-detail",
|
|
599
|
+
"block.cart",
|
|
600
|
+
"block.checkout",
|
|
601
|
+
"block.gifting",
|
|
602
|
+
"block.newsletter-signup",
|
|
603
|
+
"block.image-gallery",
|
|
604
|
+
"block.video-grid",
|
|
605
|
+
"block.audio-player",
|
|
606
|
+
"block.file-download"
|
|
607
|
+
];
|
|
608
|
+
//#endregion
|
|
609
|
+
//#region ../site-contracts/src/theme/buttonTypography.ts
|
|
610
|
+
const textTransformSchema = z.enum([
|
|
611
|
+
"none",
|
|
612
|
+
"uppercase",
|
|
613
|
+
"lowercase",
|
|
614
|
+
"capitalize"
|
|
615
|
+
]);
|
|
616
|
+
const fontWeightSchema = z.union([
|
|
617
|
+
z.literal(400),
|
|
618
|
+
z.literal(500),
|
|
619
|
+
z.literal(600),
|
|
620
|
+
z.literal(700),
|
|
621
|
+
z.literal(800)
|
|
622
|
+
]);
|
|
623
|
+
const buttonTypographySchema = z.enum(["body", "heading"]);
|
|
624
|
+
const letterSpacingSchema = z.enum([
|
|
625
|
+
"tight",
|
|
626
|
+
"normal",
|
|
627
|
+
"slight",
|
|
628
|
+
"loose",
|
|
629
|
+
"wide"
|
|
630
|
+
]);
|
|
631
|
+
//#endregion
|
|
632
|
+
//#region ../site-contracts/src/theme/buttons.ts
|
|
633
|
+
/**
|
|
634
|
+
* Canonical persisted/CSS-safe button variant identifier.
|
|
635
|
+
*
|
|
636
|
+
* IDs become class selectors, so keep the contract deliberately narrower than
|
|
637
|
+
* an arbitrary string and shared with every authoring/runtime boundary.
|
|
638
|
+
*/
|
|
639
|
+
const buttonVariantIdSchema = z.string().min(1).max(50).regex(/^[a-z0-9-]+$/, "Button variant IDs may contain lowercase letters, numbers, and hyphens only").refine((value) => value !== "link" && value !== "tertiary", { message: "Retired button role IDs are not valid variant IDs" });
|
|
640
|
+
function parseOpaqueButtonColourToken(value) {
|
|
641
|
+
const token = parseThemeColorToken(value);
|
|
642
|
+
if (token === null) return null;
|
|
643
|
+
const parts = parseColorTokenParts(token);
|
|
644
|
+
return parts.kind === "token" && parts.opacityPercent === null ? token : null;
|
|
645
|
+
}
|
|
646
|
+
const opaqueButtonColourTokenSchema = themeColorTokenSchema.refine((value) => parseOpaqueButtonColourToken(value) !== null, "Button colour tokens must be opaque").transform((value) => {
|
|
647
|
+
const token = parseOpaqueButtonColourToken(value);
|
|
648
|
+
if (token === null) throw new Error("Invariant: opaque button token passed its schema");
|
|
649
|
+
return token;
|
|
650
|
+
});
|
|
651
|
+
const contextualButtonHoverSchema = z.strictObject({
|
|
652
|
+
kind: z.literal("shade-shift"),
|
|
653
|
+
seedToken: opaqueButtonColourTokenSchema,
|
|
654
|
+
fallbackDirection: z.enum(["lighter", "darker"]),
|
|
655
|
+
preferredToken: opaqueButtonColourTokenSchema.optional()
|
|
656
|
+
});
|
|
657
|
+
const buttonShadeAmountSchema = z.number().finite().min(0).max(900).multipleOf(100);
|
|
658
|
+
const buttonShadowIntensitySchema = z.enum([
|
|
659
|
+
"subtle",
|
|
660
|
+
"medium",
|
|
661
|
+
"strong"
|
|
662
|
+
]);
|
|
663
|
+
/**
|
|
664
|
+
* The complete persisted button-effect contract.
|
|
665
|
+
*
|
|
666
|
+
* Navigation has its own generic interactive-effect model. Button variants use
|
|
667
|
+
* this closed union so unsupported effect IDs, unknown option keys, and unsafe
|
|
668
|
+
* CSS values cannot become representable after the schema boundary.
|
|
669
|
+
*/
|
|
670
|
+
const buttonPressOffsetSchema = z.strictObject({
|
|
671
|
+
x: z.number().int().min(0).max(12),
|
|
672
|
+
y: z.number().int().min(0).max(12)
|
|
673
|
+
});
|
|
674
|
+
const buttonEffectApplicationSchema = z.discriminatedUnion("effectId", [
|
|
675
|
+
z.strictObject({
|
|
676
|
+
effectId: z.literal("darken-background"),
|
|
677
|
+
options: z.strictObject({ amount: buttonShadeAmountSchema.optional() }).optional()
|
|
678
|
+
}),
|
|
679
|
+
z.strictObject({
|
|
680
|
+
effectId: z.literal("lighten-background"),
|
|
681
|
+
options: z.strictObject({ amount: buttonShadeAmountSchema.optional() }).optional()
|
|
682
|
+
}),
|
|
683
|
+
z.strictObject({
|
|
684
|
+
effectId: z.literal("background-on-hover"),
|
|
685
|
+
options: z.strictObject({ colorToken: opaqueButtonColourTokenSchema.optional() }).optional()
|
|
686
|
+
}),
|
|
687
|
+
z.strictObject({
|
|
688
|
+
effectId: z.literal("animated-gradient"),
|
|
689
|
+
options: z.strictObject({ direction: z.enum(["horizontal", "vertical"]).optional() }).optional()
|
|
690
|
+
}),
|
|
691
|
+
z.strictObject({
|
|
692
|
+
effectId: z.literal("drop-shadow"),
|
|
693
|
+
options: z.strictObject({ intensity: buttonShadowIntensitySchema.optional() }).optional()
|
|
694
|
+
}),
|
|
695
|
+
z.strictObject({
|
|
696
|
+
effectId: z.literal("inner-shadow"),
|
|
697
|
+
options: z.strictObject({}).optional()
|
|
698
|
+
}),
|
|
699
|
+
z.strictObject({
|
|
700
|
+
effectId: z.literal("neumorphic-shadow"),
|
|
701
|
+
options: z.strictObject({
|
|
702
|
+
mode: z.enum(["raised", "pressed"]).optional(),
|
|
703
|
+
intensity: buttonShadowIntensitySchema.optional()
|
|
704
|
+
}).optional()
|
|
705
|
+
}),
|
|
706
|
+
z.strictObject({
|
|
707
|
+
effectId: z.literal("retro-3d-shadow"),
|
|
708
|
+
options: z.strictObject({}).optional()
|
|
709
|
+
}),
|
|
710
|
+
z.strictObject({
|
|
711
|
+
effectId: z.literal("scale-up"),
|
|
712
|
+
options: z.strictObject({ scale: z.enum([
|
|
713
|
+
"1.02",
|
|
714
|
+
"1.03",
|
|
715
|
+
"1.05",
|
|
716
|
+
"1.10"
|
|
717
|
+
]).optional() }).optional()
|
|
718
|
+
}),
|
|
719
|
+
z.strictObject({
|
|
720
|
+
effectId: z.literal("scale-down"),
|
|
721
|
+
options: z.strictObject({ scale: z.enum([
|
|
722
|
+
"0.90",
|
|
723
|
+
"0.95",
|
|
724
|
+
"0.97",
|
|
725
|
+
"0.98"
|
|
726
|
+
]).optional() }).optional()
|
|
727
|
+
}),
|
|
728
|
+
z.strictObject({
|
|
729
|
+
effectId: z.literal("lift"),
|
|
730
|
+
options: z.strictObject({ amount: z.enum([
|
|
731
|
+
"0.125",
|
|
732
|
+
"0.25",
|
|
733
|
+
"0.5",
|
|
734
|
+
"1"
|
|
735
|
+
]).optional() }).optional()
|
|
736
|
+
}),
|
|
737
|
+
z.strictObject({
|
|
738
|
+
effectId: z.literal("press-down"),
|
|
739
|
+
options: z.strictObject({ offset: buttonPressOffsetSchema.optional() }).optional()
|
|
740
|
+
}),
|
|
741
|
+
z.strictObject({
|
|
742
|
+
effectId: z.literal("pop"),
|
|
743
|
+
options: z.strictObject({ intensity: z.enum([
|
|
744
|
+
"subtle",
|
|
745
|
+
"gentle",
|
|
746
|
+
"medium",
|
|
747
|
+
"dramatic"
|
|
748
|
+
]).optional() }).optional()
|
|
749
|
+
}),
|
|
750
|
+
z.strictObject({
|
|
751
|
+
effectId: z.literal("border-bottom-grow"),
|
|
752
|
+
options: z.strictObject({
|
|
753
|
+
height: z.union([z.literal(1), z.literal(2)]).optional(),
|
|
754
|
+
origin: z.enum([
|
|
755
|
+
"left",
|
|
756
|
+
"center",
|
|
757
|
+
"right"
|
|
758
|
+
]).optional(),
|
|
759
|
+
persistent: z.boolean().optional(),
|
|
760
|
+
colourRole: z.literal("mark").optional()
|
|
761
|
+
}).optional()
|
|
762
|
+
}),
|
|
763
|
+
z.strictObject({
|
|
764
|
+
effectId: z.literal("inner-dashed-outline"),
|
|
765
|
+
options: z.strictObject({
|
|
766
|
+
colourRole: z.enum(["ink", "mark"]),
|
|
767
|
+
width: z.number().finite().min(.5).max(4),
|
|
768
|
+
inset: z.number().finite().min(0).max(16)
|
|
769
|
+
})
|
|
770
|
+
}),
|
|
771
|
+
z.strictObject({
|
|
772
|
+
effectId: z.literal("sketchy-border"),
|
|
773
|
+
options: z.strictObject({ intensity: buttonShadowIntensitySchema.optional() }).optional()
|
|
774
|
+
})
|
|
775
|
+
]);
|
|
776
|
+
const cornerStyleSchema = z.enum([
|
|
777
|
+
"square",
|
|
778
|
+
"rounded",
|
|
779
|
+
"pill"
|
|
780
|
+
]);
|
|
781
|
+
const shadowSizeSchema = z.enum([
|
|
782
|
+
"none",
|
|
783
|
+
"low",
|
|
784
|
+
"medium",
|
|
785
|
+
"high"
|
|
786
|
+
]);
|
|
787
|
+
const hoverTransformSchema = z.enum([
|
|
788
|
+
"none",
|
|
789
|
+
"lift",
|
|
790
|
+
"scale",
|
|
791
|
+
"press"
|
|
792
|
+
]);
|
|
793
|
+
const buttonPaddingPresetSchema = z.enum([
|
|
794
|
+
"compact",
|
|
795
|
+
"default",
|
|
796
|
+
"spacious"
|
|
797
|
+
]);
|
|
798
|
+
const gradientStyleSchema = z.enum([
|
|
799
|
+
"linear",
|
|
800
|
+
"radial",
|
|
801
|
+
"conic"
|
|
802
|
+
]);
|
|
803
|
+
const gradientSharpnessSchema = z.enum([
|
|
804
|
+
"smooth",
|
|
805
|
+
"medium",
|
|
806
|
+
"hard"
|
|
807
|
+
]);
|
|
808
|
+
const prioritySchema = z.union([
|
|
809
|
+
z.literal(1),
|
|
810
|
+
z.literal(2),
|
|
811
|
+
z.literal(3)
|
|
812
|
+
]);
|
|
813
|
+
const buttonSurfaceFallbackSchema = z.discriminatedUnion("kind", [z.strictObject({ kind: z.literal("surface-outline") }), z.strictObject({
|
|
814
|
+
kind: z.literal("variant"),
|
|
815
|
+
role: variantRoleSchema
|
|
816
|
+
})]);
|
|
817
|
+
const buttonSurfacePolicyShape = Object.fromEntries(VARIANT_ROLES.map((role) => [role, z.array(buttonSurfaceFallbackSchema).max(VARIANT_ROLES.length)]));
|
|
818
|
+
const buttonSurfacePolicySchema = z.strictObject(buttonSurfacePolicyShape);
|
|
819
|
+
/**
|
|
820
|
+
* CSS padding string in `"<vertical> <horizontal>"` shorthand form.
|
|
821
|
+
*
|
|
822
|
+
* Exactly two space-separated CSS length tokens. Each token is either the
|
|
823
|
+
* literal `0` or a number followed by `rem`/`em`/`px`/`%`. This lets the
|
|
824
|
+
* generator trust the shape rather than defensively defaulting downstream.
|
|
825
|
+
*/
|
|
826
|
+
const PADDING_TOKEN_PATTERN = /^(?:0|\d+(?:\.\d+)?(?:rem|em|px|%))$/;
|
|
827
|
+
const paddingShorthandSchema = z.string().refine((value) => {
|
|
828
|
+
const parts = value.split(/\s+/).filter(Boolean);
|
|
829
|
+
return parts.length === 2 && parts.every((token) => PADDING_TOKEN_PATTERN.test(token));
|
|
830
|
+
}, { message: "Padding must be two space-separated CSS length tokens (e.g. \"0.5rem 1rem\"). Use `0` for zero." });
|
|
831
|
+
const buttonSizeConfigSchema = z.object({
|
|
832
|
+
padding: paddingShorthandSchema,
|
|
833
|
+
fontSize: z.string().optional(),
|
|
834
|
+
borderRadius: z.string().optional()
|
|
835
|
+
});
|
|
836
|
+
/**
|
|
837
|
+
* `xl` is optional on the wire so themes persisted before the `xl` size was
|
|
838
|
+
* added (e.g. SWTS) continue to parse. When `xl` is missing the schema
|
|
839
|
+
* backfills it from `lg`, keeping `ButtonSizes` a complete `sm/md/lg/xl` map
|
|
840
|
+
* downstream — generators never need to deal with an undefined `xl`.
|
|
841
|
+
*/
|
|
842
|
+
const buttonSizesSchema = z.object({
|
|
843
|
+
sm: buttonSizeConfigSchema,
|
|
844
|
+
md: buttonSizeConfigSchema,
|
|
845
|
+
lg: buttonSizeConfigSchema,
|
|
846
|
+
xl: buttonSizeConfigSchema.optional()
|
|
847
|
+
}).transform(({ sm, md, lg, xl }) => ({
|
|
848
|
+
sm,
|
|
849
|
+
md,
|
|
850
|
+
lg,
|
|
851
|
+
xl: xl ?? lg
|
|
852
|
+
}));
|
|
853
|
+
const buttonGlobalSettingsBaseSchema = z.strictObject({
|
|
854
|
+
cornerStyle: cornerStyleSchema,
|
|
855
|
+
cornerRadius: z.number().min(0).max(24).optional(),
|
|
856
|
+
/**
|
|
857
|
+
* Family-level shadow inherited by variants that don't set their own.
|
|
858
|
+
* Optional and flat-by-default: when omitted, buttons carry no drop shadow
|
|
859
|
+
* (`elevation: 'none'`). A personality opts the whole family into a shadow by
|
|
860
|
+
* setting this; individual variants still override. There is no system-level
|
|
861
|
+
* shadow-by-default — shadows only appear when explicitly declared.
|
|
862
|
+
*/
|
|
863
|
+
shadow: shadowSizeSchema.optional(),
|
|
864
|
+
textTransform: textTransformSchema,
|
|
865
|
+
fontWeight: fontWeightSchema,
|
|
866
|
+
typography: buttonTypographySchema.optional(),
|
|
867
|
+
fontSize: z.string().optional(),
|
|
868
|
+
letterSpacing: letterSpacingSchema.optional(),
|
|
869
|
+
italic: z.boolean().optional(),
|
|
870
|
+
paddingPreset: buttonPaddingPresetSchema.optional(),
|
|
871
|
+
hoverTransform: hoverTransformSchema,
|
|
872
|
+
gradientStyle: gradientStyleSchema.optional(),
|
|
873
|
+
gradientAngle: z.number().min(0).max(360).optional(),
|
|
874
|
+
gradientSharpness: gradientSharpnessSchema.optional()
|
|
875
|
+
});
|
|
876
|
+
const buttonGlobalSettingsSchema = z.discriminatedUnion("hoverColor", [buttonGlobalSettingsBaseSchema.extend({
|
|
877
|
+
hoverColor: z.literal("none"),
|
|
878
|
+
hoverColorToken: z.never().optional()
|
|
879
|
+
}), buttonGlobalSettingsBaseSchema.extend({
|
|
880
|
+
hoverColor: z.literal("token"),
|
|
881
|
+
hoverColorToken: opaqueButtonColourTokenSchema
|
|
882
|
+
})]);
|
|
883
|
+
const gradientDirectionSchema = z.enum([
|
|
884
|
+
"to-r",
|
|
885
|
+
"to-l",
|
|
886
|
+
"to-t",
|
|
887
|
+
"to-b",
|
|
888
|
+
"to-tr",
|
|
889
|
+
"to-tl",
|
|
890
|
+
"to-br",
|
|
891
|
+
"to-bl"
|
|
892
|
+
]);
|
|
893
|
+
const buttonColourTreatmentSchema = z.discriminatedUnion("type", [
|
|
894
|
+
z.strictObject({
|
|
895
|
+
type: z.literal("solid"),
|
|
896
|
+
colorToken: opaqueButtonColourTokenSchema,
|
|
897
|
+
foregroundToken: opaqueButtonColourTokenSchema.optional()
|
|
898
|
+
}),
|
|
899
|
+
z.strictObject({
|
|
900
|
+
type: z.literal("gradient"),
|
|
901
|
+
stops: z.array(opaqueButtonColourTokenSchema).min(2).transform((stops) => {
|
|
902
|
+
const [first, second, ...rest] = stops;
|
|
903
|
+
if (first === void 0 || second === void 0) throw new Error("Invariant: gradient stops passed the minimum length schema");
|
|
904
|
+
return [
|
|
905
|
+
first,
|
|
906
|
+
second,
|
|
907
|
+
...rest
|
|
908
|
+
];
|
|
909
|
+
}),
|
|
910
|
+
direction: gradientDirectionSchema,
|
|
911
|
+
foregroundToken: opaqueButtonColourTokenSchema
|
|
912
|
+
}),
|
|
913
|
+
z.strictObject({
|
|
914
|
+
type: z.literal("surface"),
|
|
915
|
+
role: z.literal("link")
|
|
916
|
+
})
|
|
917
|
+
]);
|
|
918
|
+
const buttonBackgroundSchema = buttonColourTreatmentSchema;
|
|
919
|
+
const buttonBorderSchema = z.strictObject({
|
|
920
|
+
widthClass: z.string(),
|
|
921
|
+
marksBoundary: z.literal(true).optional(),
|
|
922
|
+
ring: z.literal(true).optional(),
|
|
923
|
+
boundaryInk: opaqueButtonColourTokenSchema.optional()
|
|
924
|
+
});
|
|
925
|
+
const buttonVariantAffordanceSchema = z.strictObject({ iconId: z.string().min(1) });
|
|
926
|
+
const variantShadowSchema = z.strictObject({
|
|
927
|
+
elevation: z.enum([
|
|
928
|
+
"none",
|
|
929
|
+
"low",
|
|
930
|
+
"medium",
|
|
931
|
+
"high"
|
|
932
|
+
]),
|
|
933
|
+
softness: z.enum([
|
|
934
|
+
"crisp",
|
|
935
|
+
"soft",
|
|
936
|
+
"hard"
|
|
937
|
+
]).nullable(),
|
|
938
|
+
position: z.enum(["bottom", "bottom-right"]).default("bottom"),
|
|
939
|
+
colorToken: opaqueButtonColourTokenSchema.optional()
|
|
940
|
+
});
|
|
941
|
+
/** Recipe states own every visual property; treatment owns its readable label. */
|
|
942
|
+
const buttonVisualAppearanceSchema = z.strictObject({
|
|
943
|
+
background: buttonColourTreatmentSchema,
|
|
944
|
+
text: z.literal("treatment"),
|
|
945
|
+
border: z.union([z.literal("none"), buttonBorderSchema]),
|
|
946
|
+
borderRadius: z.string(),
|
|
947
|
+
shadow: z.union([z.literal("focus-indicator"), variantShadowSchema]),
|
|
948
|
+
sizes: buttonSizesSchema,
|
|
949
|
+
typography: z.strictObject({
|
|
950
|
+
fontWeight: fontWeightSchema,
|
|
951
|
+
typography: buttonTypographySchema,
|
|
952
|
+
fontSize: z.string().nullable(),
|
|
953
|
+
letterSpacing: z.union([letterSpacingSchema, z.literal("heading")]).nullable(),
|
|
954
|
+
italic: z.boolean(),
|
|
955
|
+
textTransform: textTransformSchema
|
|
956
|
+
}),
|
|
957
|
+
effects: z.array(buttonEffectApplicationSchema),
|
|
958
|
+
transform: z.literal("none").optional(),
|
|
959
|
+
contextualHover: contextualButtonHoverSchema.optional()
|
|
960
|
+
});
|
|
961
|
+
const buttonVisualStatesSchema = z.strictObject({
|
|
962
|
+
base: buttonVisualAppearanceSchema.extend({ shadow: variantShadowSchema }),
|
|
963
|
+
hover: buttonVisualAppearanceSchema.extend({ shadow: variantShadowSchema }),
|
|
964
|
+
focus: buttonVisualAppearanceSchema.extend({
|
|
965
|
+
shadow: z.literal("focus-indicator"),
|
|
966
|
+
indicator: z.strictObject({
|
|
967
|
+
kind: z.literal("surface-ink"),
|
|
968
|
+
width: z.union([z.literal(2), z.literal(3)]),
|
|
969
|
+
offset: z.union([z.literal(3), z.literal(4)])
|
|
970
|
+
}).optional()
|
|
971
|
+
}),
|
|
972
|
+
active: buttonVisualAppearanceSchema.extend({ shadow: variantShadowSchema }),
|
|
973
|
+
disabled: buttonVisualAppearanceSchema.extend({ shadow: variantShadowSchema })
|
|
974
|
+
});
|
|
975
|
+
const variantEffectsSchema = z.strictObject({
|
|
976
|
+
base: z.array(buttonEffectApplicationSchema).optional(),
|
|
977
|
+
hover: z.array(buttonEffectApplicationSchema).optional(),
|
|
978
|
+
active: z.array(buttonEffectApplicationSchema).optional(),
|
|
979
|
+
focus: z.array(buttonEffectApplicationSchema).optional()
|
|
980
|
+
});
|
|
981
|
+
/**
|
|
982
|
+
* Per-variant size overrides schema — every entry is optional.
|
|
983
|
+
*
|
|
984
|
+
* For each size key present, the values override the theme's `sizes` config
|
|
985
|
+
* for that size on this variant. Missing sizes fall through to theme.sizes,
|
|
986
|
+
* then system defaults.
|
|
987
|
+
*/
|
|
988
|
+
const variantSizeOverridesSchema = z.object({
|
|
989
|
+
sm: buttonSizeConfigSchema.optional(),
|
|
990
|
+
md: buttonSizeConfigSchema.optional(),
|
|
991
|
+
lg: buttonSizeConfigSchema.optional(),
|
|
992
|
+
xl: buttonSizeConfigSchema.optional()
|
|
993
|
+
});
|
|
994
|
+
/**
|
|
995
|
+
* Unified variant schema. Every variant participates in the size system; the
|
|
996
|
+
* optional `sizes` field lets a variant scale differently than the theme
|
|
997
|
+
* default (e.g. link-style variants declaring zero horizontal padding at
|
|
998
|
+
* every size).
|
|
999
|
+
*/
|
|
1000
|
+
const buttonVariantSchema = z.strictObject({
|
|
1001
|
+
id: buttonVariantIdSchema,
|
|
1002
|
+
name: z.string().min(1).max(20),
|
|
1003
|
+
enabled: z.boolean(),
|
|
1004
|
+
priority: prioritySchema,
|
|
1005
|
+
visualStates: buttonVisualStatesSchema.optional(),
|
|
1006
|
+
background: buttonBackgroundSchema,
|
|
1007
|
+
/** Tailwind radius token (e.g. `'rounded-md'`). Omit to inherit from `global.cornerStyle`. */
|
|
1008
|
+
borderRadius: z.string().optional(),
|
|
1009
|
+
shadow: variantShadowSchema.optional(),
|
|
1010
|
+
border: buttonBorderSchema.optional(),
|
|
1011
|
+
hoverBackgroundToken: opaqueButtonColourTokenSchema.optional(),
|
|
1012
|
+
contextualHover: contextualButtonHoverSchema.optional(),
|
|
1013
|
+
effects: variantEffectsSchema.optional(),
|
|
1014
|
+
sizes: variantSizeOverridesSchema.optional(),
|
|
1015
|
+
affordance: buttonVariantAffordanceSchema.optional()
|
|
1016
|
+
});
|
|
1017
|
+
const buttonSystemSchema = z.strictObject({
|
|
1018
|
+
global: buttonGlobalSettingsSchema,
|
|
1019
|
+
variants: z.array(buttonVariantSchema).min(1).max(6),
|
|
1020
|
+
sizes: buttonSizesSchema.optional(),
|
|
1021
|
+
surfacePolicy: buttonSurfacePolicySchema.optional(),
|
|
1022
|
+
surfaceContexts: z.record(z.string(), z.strictObject({
|
|
1023
|
+
primary: opaqueButtonColourTokenSchema,
|
|
1024
|
+
primaryText: opaqueButtonColourTokenSchema.optional()
|
|
1025
|
+
})).optional()
|
|
1026
|
+
}).superRefine((system, ctx) => {
|
|
1027
|
+
const seen = /* @__PURE__ */ new Set();
|
|
1028
|
+
system.variants.forEach((variant, index) => {
|
|
1029
|
+
if (seen.has(variant.id)) ctx.addIssue({
|
|
1030
|
+
code: "custom",
|
|
1031
|
+
path: [
|
|
1032
|
+
"variants",
|
|
1033
|
+
index,
|
|
1034
|
+
"id"
|
|
1035
|
+
],
|
|
1036
|
+
message: `Duplicate button variant ID: ${variant.id}`
|
|
1037
|
+
});
|
|
1038
|
+
seen.add(variant.id);
|
|
1039
|
+
});
|
|
1040
|
+
});
|
|
1041
|
+
//#endregion
|
|
1042
|
+
//#region ../theme-core/src/buttons/types.ts
|
|
1043
|
+
function isVariantRole(value) {
|
|
1044
|
+
return VARIANT_ROLES.includes(value);
|
|
1045
|
+
}
|
|
1046
|
+
function asSpecialVariantId(value) {
|
|
1047
|
+
const parsed = buttonVariantIdSchema.safeParse(value);
|
|
1048
|
+
if (!parsed.success) throw new Error("SpecialVariantId must be a CSS-safe button variant ID");
|
|
1049
|
+
return parsed.data;
|
|
1050
|
+
}
|
|
1051
|
+
/**
|
|
1052
|
+
* Magic alias the CSS generator emits for the highest-priority variant.
|
|
1053
|
+
*
|
|
1054
|
+
* Shared between generator and renderer so neither side hard-codes the string.
|
|
1055
|
+
*/
|
|
1056
|
+
const DEFAULT_VARIANT_ALIAS_ID = "default";
|
|
1057
|
+
function unsafeAsOpaqueButtonColourToken(value) {
|
|
1058
|
+
return value;
|
|
1059
|
+
}
|
|
1060
|
+
z.enum(["none", "token"]);
|
|
1061
|
+
const standardButtonSurfacePolicy = {
|
|
1062
|
+
primary: [{ kind: "surface-outline" }],
|
|
1063
|
+
secondary: [{ kind: "surface-outline" }, {
|
|
1064
|
+
kind: "variant",
|
|
1065
|
+
role: "primary"
|
|
1066
|
+
}],
|
|
1067
|
+
outline: [{ kind: "surface-outline" }],
|
|
1068
|
+
ghost: [{ kind: "surface-outline" }],
|
|
1069
|
+
accent: [{ kind: "surface-outline" }, {
|
|
1070
|
+
kind: "variant",
|
|
1071
|
+
role: "primary"
|
|
1072
|
+
}]
|
|
1073
|
+
};
|
|
1074
|
+
const STANDARD_BUTTON_SURFACE_POLICY = Object.freeze(Object.fromEntries(VARIANT_ROLES.map((role) => [role, Object.freeze([...standardButtonSurfacePolicy[role]])])));
|
|
1075
|
+
function createStandardButtonSurfacePolicy() {
|
|
1076
|
+
return Object.fromEntries(VARIANT_ROLES.map((role) => [role, [...STANDARD_BUTTON_SURFACE_POLICY[role]]]));
|
|
1077
|
+
}
|
|
1078
|
+
const buttonSizeNameSchema = z.enum([
|
|
1079
|
+
"sm",
|
|
1080
|
+
"md",
|
|
1081
|
+
"lg",
|
|
1082
|
+
"xl"
|
|
1083
|
+
]);
|
|
1084
|
+
//#endregion
|
|
1085
|
+
export { borderColorStyle as A, blockColorTokenNames as B, surfaceForegroundStyle as C, surfaceInkStyle as D, surfaceInkDeclarations as E, textColorValue as F, paletteColorsFromEntries as G, isThemeColorToken as H, CSS_LOADING_FUNCTIONS as I, parseColorTokenParts as J, paletteColorsSchema as K, callsCssLoadingFunction as L, mergeStyles as M, rgbColorValue as N, surfaceInkValue as O, textColorStyle as P, staysInsideDeclaration as R, surfaceForegroundInputFromResolved as S, surfaceForegroundValueWithOpacity as T, normalizePaletteHex as U, hexColorSchema as V, paletteColorEntries as W, themeColorTokenSchema as X, parseThemeColorToken as Y, DEFAULT_SURFACE_TEXT_COLOR as _, createStandardButtonSurfacePolicy as a, completeSurfaceForegrounds as b, buttonEffectApplicationSchema as c, buttonVariantIdSchema as d, buttonVisualStatesSchema as f, VARIANT_ROLES as g, SYSTEM_BLOCK_KINDS as h, buttonSizeNameSchema as i, cssVarValue as j, backgroundColorStyle as k, buttonPressOffsetSchema as l, parseOpaqueButtonColourToken as m, STANDARD_BUTTON_SURFACE_POLICY as n, isVariantRole as o, opaqueButtonColourTokenSchema as p, paletteModeSchema as q, asSpecialVariantId as r, unsafeAsOpaqueButtonColourToken as s, DEFAULT_VARIANT_ALIAS_ID as t, buttonSystemSchema as u, SURFACE_FOREGROUND_CSS_VARS as v, surfaceForegroundValue as w, surfaceForegroundDeclarations as x, SURFACE_INK_CSS_VARS as y, PALETTE_TOKEN_NAMES as z };
|