@riverbankcms/sdk 0.165.0 → 0.166.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-CdsSMQEv.d.ts → BlocksIslandsHydrator-CPvN6RBW.d.ts} +1 -1
- package/dist/_dts/{Page-D6gp2Ipb.d.ts → Page-rW0xgQCA.d.ts} +18 -256
- package/dist/_dts/{SdkPreviewMode-DNXAvnet.d.ts → SdkPreviewMode-BWZh2WCk.d.ts} +26 -3
- package/dist/_dts/{client-BkkExozE.d.ts → client-D4BXQEZc.d.ts} +5 -1
- package/dist/_dts/{content-types-CXNAD7ef.d.ts → content-types-MUzta0l9.d.ts} +3 -3
- package/dist/_dts/{contracts-XRXhbLWP.d.ts → contracts-Cl9Xh1DO.d.ts} +4 -4
- package/dist/_dts/{footerPageOutline-BP2bJYdY.d.ts → footerPageOutline-4BgLKehl.d.ts} +6 -6
- package/dist/_dts/{generatePageMetadata-DcMtbztV.d.ts → generatePageMetadata-BsmJ0qKh.d.ts} +2 -2
- package/dist/_dts/{index-RXkE3a7M.d.ts → index--qflsCiy.d.ts} +4 -3
- package/dist/_dts/{index-C_3kdrUb.d.ts → index-BgJ2aU5c.d.ts} +2 -2
- package/dist/_dts/{index-CQfJhOEA.d.ts → index-Bmboeb49.d.ts} +1 -1
- package/dist/_dts/{index-CRRiddNp.d.ts → index-DdcwPqQN.d.ts} +4 -4
- package/dist/_dts/{index-DKNEgSOS.d.ts → index-ahxQCUc7.d.ts} +2 -2
- package/dist/_dts/{index-BdkHhyf8.d.ts → index-kQ5xkM6X.d.ts} +1 -1
- package/dist/_dts/{index-DAPTSmBM.d.ts → index-mMMvLLAJ.d.ts} +2596 -2511
- package/dist/_dts/{index-B4ozSzFP.d.ts → index-wbBZ0awa.d.ts} +9248 -8251
- package/dist/_dts/{loadContent-B9vJMq3s.d.ts → loadContent-BG5IAV-V.d.ts} +9 -6
- package/dist/_dts/resolveBlockData-Cmcle_zV.d.ts +136 -0
- package/dist/_dts/{resolvePageContent-DIQyYUi-.d.ts → resolvePageContent-BRJUTFoH.d.ts} +3 -2
- 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 +9 -6
- 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 +20 -0
- package/dist/_dts/sdk/src/data/resolveBlockData.d.ts +2 -0
- package/dist/_dts/sdk/src/data/types.d.ts +54 -0
- package/dist/_dts/sdk/src/index.d.ts +8 -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 +2 -2
- package/dist/_dts/sdk/src/next/index.d.ts +9 -8
- package/dist/_dts/sdk/src/next/middleware.d.ts +2 -2
- package/dist/_dts/sdk/src/page-converter/index.d.ts +36 -48
- package/dist/_dts/sdk/src/portal/client.d.ts +1 -1
- 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 +2 -0
- package/dist/_dts/sdk/src/rendering/helpers/loadPage.d.ts +3 -0
- package/dist/_dts/sdk/src/rendering/helpers/pageRuntimeSupport.d.ts +257 -0
- package/dist/_dts/sdk/src/rendering/index.d.ts +8 -7
- package/dist/_dts/sdk/src/rendering/islands/client.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/server.d.ts +3 -3
- package/dist/_dts/{themeAdmission-D_qtGYAT.d.ts → sdk/src/rendering/themeAdmission.d.ts} +3 -1
- package/dist/_dts/sdk/src/routing/index.d.ts +5 -5
- package/dist/_dts/sdk/src/server.d.ts +7 -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/{types-Cl0nP6al.d.ts → types-BX3Y-EW3.d.ts} +3 -3
- package/dist/_dts/{types-mstFvhK4.d.ts → types-DF54stxv.d.ts} +8 -7
- package/dist/_dts/{types-BDF73NzM.d.ts → types-DuiHLiPo.d.ts} +2 -2
- package/dist/_dts/{validation-DVWqSvjK.d.ts → validation-Bxi0f81D.d.ts} +4 -4
- package/dist/client/{BlocksIslandsHydrator-CzKpH9Pm.mjs → BlocksIslandsHydrator-DwiRGtgh.mjs} +31 -24
- package/dist/client/{BookingMailingListNote-rUqsBN7L.mjs → BookingMailingListNote-DOWOZYlK.mjs} +2 -2
- package/dist/client/{CalendarNavigationChevron-YGzw2IPB.mjs → CalendarNavigationChevron-5a0x0vcC.mjs} +7 -7
- package/dist/client/{CheckboxChoice-DlTC4J2a.mjs → CheckboxChoice-CZ-anOqV.mjs} +1 -1
- package/dist/client/{DemoBookingPortalAccess-D2LyS_Bi.mjs → DemoBookingPortalAccess-B2qLkPRB.mjs} +6 -6
- package/dist/client/{DemoPortalSignInLink-BaFg2Uit.mjs → DemoPortalSignInLink-B9YrzZt2.mjs} +1 -1
- package/dist/client/{EventCalendar.client-tRrhPscX.mjs → EventCalendar.client-BhADnDCg.mjs} +9 -9
- package/dist/client/{EventCombined.client-6cfAVtnZ.mjs → EventCombined.client-jik34zTb.mjs} +8 -8
- package/dist/client/{EventEmbeddedCheckoutStep-CDNUpI0S.mjs → EventEmbeddedCheckoutStep-D_14yqAU.mjs} +27 -2
- package/dist/client/{EventItem-dILw2PN_.mjs → EventItem-CMKrtkT7.mjs} +26 -11
- package/dist/client/{EventListWeekNavigation-ClgLtjNY.mjs → EventListWeekNavigation-AGHjxy6C.mjs} +1 -1
- package/dist/client/{EventListing.client-BNueAHmU.mjs → EventListing.client-DZeDM0Qt.mjs} +3 -3
- package/dist/client/{EventListing.view-DtVbKVkt.mjs → EventListing.view-3BBRdNVa.mjs} +31 -20
- package/dist/client/{EventRegistrationPayment-CzkG0NSJ.mjs → EventRegistrationPayment-CpNcpga4.mjs} +108 -11
- package/dist/client/{LocationMapActions-zWQsJhE5.mjs → LocationMapActions-D5-H9ooQ.mjs} +2 -2
- package/dist/client/{MapDrawingSvg-D1AO_o4h.mjs → MapDrawingSvg-C30geMl-.mjs} +1 -1
- package/dist/client/{Page-DUr2YhFR.mjs → Page-DNDZLRlB.mjs} +1894 -11322
- package/dist/client/{ProtectedSubmitButton-2fJqT_NR.mjs → ProtectedSubmitButton-8DuDw2ag.mjs} +1 -1
- package/dist/client/{StepIndicator-udNHcpOT.mjs → StepIndicator-Bin7YR0A.mjs} +3 -3
- package/dist/client/{TabBarFragment-C_kt-PXh.mjs → TabBarFragment-_IAthZVM.mjs} +1 -1
- package/dist/client/{ThemedButton-Cfbo1bfh.mjs → ThemedButton-8jUc02mZ.mjs} +64 -2
- package/dist/client/{accordion-3CYNWzTS.mjs → accordion-uVqNowRX.mjs} +1 -1
- package/dist/client/{booking-form.client-BSbWgLyx.mjs → booking-form.client-w-PvyWBv.mjs} +19 -14
- package/dist/client/{bookingForm-2MoFBWSt.mjs → bookingForm-DNMojb6A.mjs} +4 -4
- package/dist/client/bookings.mjs +6 -6
- package/dist/client/{carousel-Cu5mcpO-.mjs → carousel-C8kxI3Dm.mjs} +2 -2
- package/dist/client/{carousel.client-CQLV8_Al.mjs → carousel.client-BO7sCEpH.mjs} +1 -1
- package/dist/client/{cart-CDc6x9cR.mjs → cart-DCxjE3Is.mjs} +3 -3
- package/dist/client/{cart.client-BWS2r5Ef.mjs → cart.client-Ceeng8fB.mjs} +1 -1
- package/dist/client/{checkout-CkxPqSwD.mjs → checkout-B0EKbeVv.mjs} +3 -3
- package/dist/client/{checkout.client-DJfomKQc.mjs → checkout.client-DtPj3fYk.mjs} +1 -1
- package/dist/client/client.mjs +9465 -15
- package/dist/client/{context-CBV21-9L.mjs → context-n6IZigd3.mjs} +8 -6
- package/dist/client/{cta-Bw-al3cs.mjs → cta-CDeAwYoN.mjs} +45 -28
- package/dist/client/{dateFormatting-CFIUJ4Uf.mjs → dateFormatting-BWPzdeZE.mjs} +1 -1
- package/dist/client/{demoPortalMagicLink-D0veHJyi.mjs → demoPortalMagicLink-BdXu0fj-.mjs} +1 -1
- package/dist/client/{enhanceHeaderSection-CEqqq92r.mjs → enhanceHeaderSection-VHfv8M6-.mjs} +3 -3
- package/dist/client/{event-details.client-Bk2kQ7ax.mjs → event-details.client-Cfr1_Cj4.mjs} +2 -2
- package/dist/client/{event-registration.client-QMqtIywj.mjs → event-registration.client-BhygihpQ.mjs} +33 -16
- package/dist/client/{eventCalendar-BTDTMosr.mjs → eventCalendar-B4XCL9u6.mjs} +4 -4
- package/dist/client/{eventCombined-BC7a709c.mjs → eventCombined-DVjz4wdf.mjs} +4 -4
- package/dist/client/{eventDetails-DL08GpUc.mjs → eventDetails-B0DA1Nw1.mjs} +2 -2
- package/dist/client/{eventListing-BfzuEQp_.mjs → eventListing-2-xjn2nz.mjs} +4 -4
- package/dist/client/{eventRegistration-Lfyzh1Ab.mjs → eventRegistration-ng4iGo9O.mjs} +4 -4
- package/dist/client/{form-L-xZOBUS.mjs → form-BeNQiZ2V.mjs} +3 -3
- package/dist/client/{form.client-BtpK3TZW.mjs → form.client-BFdCKlp7.mjs} +5 -5
- package/dist/client/{form.parts-Djos5Un4.mjs → form.parts-C7gLK3jh.mjs} +3 -3
- package/dist/client/{formatDate-DGmrm7YB.mjs → formatDate-CWfelfMt.mjs} +1 -1
- package/dist/client/gifting/client.mjs +3 -4
- package/dist/client/{headerSection-f16OGkz-.mjs → headerSection-CalNAShx.mjs} +2 -2
- package/dist/client/{mediaAssets-DHAmrVIi.mjs → mediaAssets-DpPauppt.mjs} +1 -1
- package/dist/client/{mediaContext-CwT6ZOm7.mjs → mediaContext-BLo4NtjP.mjs} +25 -19
- package/dist/client/{newsletter-form.client-DpHNZc7k.mjs → newsletter-form.client-Dq7GHGXU.mjs} +6 -6
- package/dist/client/{newsletter-form.parts-CLGH20PL.mjs → newsletter-form.parts-BSMDYQiS.mjs} +2 -2
- package/dist/client/{newsletterForm-BEU0Ocu9.mjs → newsletterForm-snzZ4L6i.mjs} +3 -3
- package/dist/client/{noop-CQU7tiMg.mjs → noop-D-RG9eR3.mjs} +394 -168
- package/dist/client/portal/client.mjs +13 -14
- package/dist/client/{product-detail.client-Be-om1BT.mjs → product-detail.client-Gu0INDb7.mjs} +1 -1
- package/dist/client/{product-list.client-DR7hD5Vs.mjs → product-list.client-BmH40fNf.mjs} +1 -1
- package/dist/client/{productDetail-BD42UOmG.mjs → productDetail-DsPUmJ0z.mjs} +3 -3
- package/dist/client/{productList-CSk8sXCl.mjs → productList-DjGrjOwD.mjs} +3 -3
- package/dist/client/{propsDecoder-C_Y6VYnF.mjs → propsDecoder-kTVPMnfD.mjs} +4 -4
- package/dist/client/{registry.server-CIKtTsCl.mjs → registry.server-CKK_RXZo.mjs} +213 -314
- package/dist/client/rendering/client.mjs +29 -28
- package/dist/client/rendering/islands.mjs +1 -1
- package/dist/client/rendering.mjs +70 -8
- package/dist/client/{richText-coerce-spWtx86G.mjs → richText-coerce-BcjTX-7h.mjs} +1 -1
- package/dist/client/{routeIslandApiConfig-CROHPlYS.mjs → routeIslandApiConfig-CaXesATK.mjs} +1 -1
- package/dist/client/{shop-DscvMz86.mjs → shop-DLufMauE.mjs} +3 -3
- package/dist/client/{shop-commerce-CDUohm_2.mjs → shop-commerce-BxYYXLNK.mjs} +12 -12
- package/dist/client/{shop-commerce-store-B9nw4lRP.mjs → shop-commerce-store-Dp3Nl5YK.mjs} +1 -1
- package/dist/client/{shop.client-M3kNsVPi.mjs → shop.client-CBy9_alG.mjs} +13 -13
- package/dist/client/{shop.interactive-BGmkdIAZ.mjs → shop.interactive-BM0NRsFQ.mjs} +48 -34
- package/dist/client/{shopShared-BdWp6LHa.mjs → shopShared-lS23OQE-.mjs} +2 -2
- package/dist/client/site-styles-D8jEPGxA.mjs +3 -0
- package/dist/{preview-next/client/ThemedButton-Dc6aJ34Z.mjs → client/site-styles-DELkUk9s.mjs} +25468 -17264
- package/dist/client/spam-protection.mjs +1 -1
- package/dist/client/src-DjnxOjXG.mjs +217 -0
- package/dist/client/surfaceTransportMarker-BXepAVF6.mjs +152 -0
- package/dist/client/{timetableModel-Dynh5-j4.mjs → timetableModel-DzRWikCU.mjs} +157 -139
- package/dist/client/types-sF-IrGQr.mjs +633 -0
- package/dist/client/{useAvailableSlots-Cw9paRPY.mjs → useAvailableSlots-C3LphWDX.mjs} +8 -5
- package/dist/client/{useBookingNowIso-C9SF2rC6.mjs → useBookingNowIso-Da-f9iHw.mjs} +1 -1
- package/dist/client/{useDiscountApply-B-QJfBg0.mjs → useDiscountApply-SLoWhcen.mjs} +3 -3
- package/dist/client/{useDiscountCodeUi-Uvum8q9d.mjs → useDiscountCodeUi-D6a2BJij.mjs} +1 -1
- package/dist/client/{useEventPagination-BfM3xk6j.mjs → useEventPagination-Ccr4TZlm.mjs} +9 -9
- package/dist/client/{view-DXOuduIr.mjs → view-8w4GA8rf.mjs} +4 -4
- package/dist/client/{view-DlkCDfuN.mjs → view-DAVEoe8A.mjs} +277 -227
- package/dist/client/{wizardSteps-DManVJpc.mjs → wizardSteps-DNpajrAH.mjs} +453 -141
- package/dist/preview-next/before-render.mjs +3 -140
- package/dist/preview-next/client/ArrangementLookControls-DY5TzhEa.mjs +31197 -0
- package/dist/preview-next/client/{EventEmbeddedCheckoutStep-Die6Y25O.mjs → EventEmbeddedCheckoutStep-C_h1cMYm.mjs} +33 -4
- package/dist/preview-next/client/{LocationPickerEnvironment-Bp4BHLCL.mjs → LocationPickerEnvironment-D56RD3e_.mjs} +1 -1
- package/dist/preview-next/client/{MapLibreEditMap-Cb0JhM9p.mjs → MapLibreEditMap-DFnyCckr.mjs} +2 -2
- package/dist/preview-next/client/PreviewEditorSidebar-DdnhmdFO.mjs +37049 -0
- package/dist/preview-next/client/{PreviewEditorUI-CxwlLBGw.mjs → PreviewEditorUI-C7ZmYE33.mjs} +45 -17
- package/dist/preview-next/client/PreviewShell-DnO38NaL.mjs +4707 -0
- package/dist/preview-next/client/SdkPreviewModeRuntime-D2OtoRMB.mjs +4258 -0
- package/dist/preview-next/client/SiteChromeCustomizeButton-eIu2RejJ.mjs +71144 -0
- package/dist/preview-next/client/ThemedButton-C0dgGJ5k.mjs +2006 -0
- package/dist/preview-next/client/{lucide-react-CqxuVAyz.mjs → lucide-react-CPBCf6QT.mjs} +15 -2
- package/dist/preview-next/client/previewAssistantSlot-Bp1AlAxx.mjs +110560 -0
- package/dist/preview-next/client/{previewChromeSurface-yuwnDP3B.mjs → previewChromeSurface-D2cREDJ5.mjs} +90 -28
- package/dist/preview-next/client/runtime.mjs +3 -3
- package/dist/preview-next/client/sdk-runtime-DK0PUhLL.mjs +5 -0
- package/dist/preview-next/client/{editorStatusDecision-DR4BBKhy.mjs → useAutosaveStatus--Pw8vnef.mjs} +40 -3
- package/dist/preview-next/client/useBlockCustomizeControls-C1Rl73N4.mjs +2724 -0
- package/dist/preview-next/client/useOpenBlockForSetup-CL3842FM.mjs +28 -0
- package/dist/preview-next/keepAlive.mjs +25 -2
- package/dist/preview-next/middleware.mjs +1 -1
- package/dist/preview-next/{route-contract-BBAJjFIz.mjs → route-contract-Bq7SUX3K.mjs} +132 -118
- package/dist/server/{Block.shared-ClFI3qpX.mjs → Block.shared-wXr7Iwhs.mjs} +7 -4
- package/dist/server/{src-DsYPhTbs.mjs → ThemeScopeCore-BI2mld9R.mjs} +178 -2532
- package/dist/server/accessibleSurfaces-CuN8U_iU.mjs +2102 -0
- package/dist/server/{bindings-Bi8EoRZD.mjs → bindings-DjdUq9FR.mjs} +2 -3
- package/dist/server/{publicProducts-Bz8loTRn.mjs → client-07UeMDzA.mjs} +2483 -351
- package/dist/server/config-validation.mjs +1 -1
- package/dist/server/config.mjs +33 -2
- package/dist/server/data/dataLoaderContext.mjs +2 -0
- package/dist/server/data/resolveBlockData.mjs +2 -0
- package/dist/server/data/types.mjs +1 -0
- package/dist/server/dataLoaderContext-B3fXA54R.mjs +47 -0
- package/dist/server/identity-Bn9OQiT1.mjs +6 -0
- package/dist/server/index.mjs +3 -3
- package/dist/server/{loadContent-dEEhQxL7.mjs → loadContent-ClpaSlBb.mjs} +6 -5
- package/dist/server/{loadPage-DBFBad8A.mjs → loadPage-BwtVqpaA.mjs} +4 -2
- package/dist/server/manifest.mjs +1 -1
- package/dist/server/media-DnlczCMA.mjs +231 -0
- package/dist/server/mode-Cv_TG9gP.mjs +63 -0
- package/dist/server/next.mjs +11 -11
- package/dist/server/opaqueSurface-3YSDPtDe.mjs +54 -0
- package/dist/server/{overrideResolution-BIJbiXYc.mjs → overrideResolution-Du_w3LY4.mjs} +2 -1
- package/dist/server/overrides-CD4d-1w7.mjs +177 -0
- package/dist/server/page-converter.mjs +243 -91
- package/dist/server/pageRenderPlan-BShULdc2.mjs +4055 -0
- package/dist/server/{themeAdmission-CSknYpxk.mjs → pageRuntimeSupport-C4Dh5-mB.mjs} +13 -28
- package/dist/server/{overrides-DhF87Vsd.mjs → pageShared-HdKFBpaX.mjs} +3472 -1795
- package/dist/server/parseThemeForPersistence-CJMrEkze.mjs +52 -0
- package/dist/server/{prebuild-DaemmWQL.mjs → prebuild-Cl-bkaMA.mjs} +1 -1
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/prefetchBlockData-C4yUmz-r.mjs +786 -0
- package/dist/server/publicProducts-W9hDRwjz.mjs +64 -0
- package/dist/server/{registry-Cdvz1OtL.mjs → registry-TFPJdGQi.mjs} +20624 -640
- package/dist/server/rendering/components/pageShared.mjs +2 -0
- package/dist/server/rendering/helpers/loadPage.mjs +2 -0
- package/dist/server/rendering/helpers/pageRuntimeSupport.mjs +2 -0
- package/dist/server/rendering/server.mjs +5 -4
- package/dist/server/rendering/themeAdmission.mjs +2 -0
- package/dist/server/rendering.mjs +11 -10
- package/dist/server/repeaterFields-MIz7r1ez.mjs +9 -0
- package/dist/server/{resolveBlockData-CLpAJWWf.mjs → resolveBlockData-OHlOXlOE.mjs} +6 -48
- package/dist/server/resolveButtonColourStates-lry2ORwX.mjs +2672 -0
- package/dist/server/{richTextSchema-YYc85FX4.mjs → richTextSchema-Euhuj-7V.mjs} +26 -1
- package/dist/server/routing.mjs +1 -1
- package/dist/server/schema-C2PqHrMo.mjs +2523 -0
- package/dist/server/server.mjs +3 -3
- package/dist/server/theme-bridge.mjs +1031 -1
- package/dist/server/theme.mjs +2 -1
- package/dist/server/themeAdmission-DGSAlFUK.mjs +18 -0
- package/dist/server/{three-pass-converter-Chnb1XD-.mjs → three-pass-converter-_j2UE2tR.mjs} +1 -1
- package/dist/server/validation-CDd6m8Ry.mjs +140 -0
- package/dist/server/{validation-DYxhLzqQ.mjs → validation-DIBFZeMB.mjs} +419 -3
- package/dist/server/{version-Beu4q-Gv.mjs → version-DZWZM1H6.mjs} +1 -1
- package/dist/styles/index.css +14 -4
- package/package.json +39 -1
- package/dist/client/purchase-BV5xfaZH.mjs +0 -894
- package/dist/client/schema-BdSglH2X.mjs +0 -16084
- package/dist/client/site-styles-CWHmlVT5.mjs +0 -14503
- package/dist/client/src-VIsPY-kw.mjs +0 -62
- package/dist/preview-next/client/PreviewEditorSidebar-DEP3xD9K.mjs +0 -5810
- package/dist/preview-next/client/SdkPreviewModeRuntime-Cpe-XP8e.mjs +0 -3
- package/dist/preview-next/client/SdkPreviewModeRuntime-QDkMPASV.mjs +0 -8059
- package/dist/preview-next/client/SiteChromeCustomizeButton-1JaoGOKX.mjs +0 -9367
- package/dist/preview-next/client/previewSidebarNavigation-AXUj9-qQ.mjs +0 -224683
- package/dist/preview-next/client/result-BjJUoxUF.mjs +0 -16
- package/dist/preview-next/client/sdk-runtime-O-eA9-rV.mjs +0 -4
- package/dist/preview-next/refresh-contract-uQ6BXgLJ.mjs +0 -25
- package/dist/server/bindings-Dgt_0goJ.mjs +0 -17
- package/dist/server/client-DfMDbZ41.mjs +0 -2330
- package/dist/server/effectiveNavLinkStyle-BHIYPVG1.mjs +0 -13713
- package/dist/server/loadPage-CnVB-aeL.mjs +0 -2
- package/dist/server/prefetchBlockData-FwcsT5H2.mjs +0 -4359
- package/dist/server/schema-uSA_x1Zh.mjs +0 -16311
- package/dist/server/site-styles-CntHn2KI.mjs +0 -793
- package/dist/server/siteChromeOverlayClearance-DqP40Ka0.mjs +0 -802
|
@@ -1,314 +1,191 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { z } from "zod";
|
|
1
|
+
import { At as parseThemeColorToken, Et as rgbColorValue, Nt as parseColorTokenParts, bt as surfaceInkDeclarations, dt as DEFAULT_SURFACE_TEXT_COLOR, ft as SURFACE_FOREGROUND_CSS_VARS, pt as SURFACE_INK_CSS_VARS, vt as surfaceForegroundValue, wt as cssVarValue, yt as surfaceForegroundValueWithOpacity } from "./resolveButtonColourStates-lry2ORwX.mjs";
|
|
2
|
+
import { C as safeTokenOr, O as resolveOpaqueSurfaceHex, S as resolveSurfaceForeground, T as solveSurfaceInks, i as resolveSurface, l as actionVariableFallback, w as surfaceInkPublication } from "./accessibleSurfaces-CuN8U_iU.mjs";
|
|
3
|
+
import { n as opaqueSurfaceDeclarations } from "./opaqueSurface-3YSDPtDe.mjs";
|
|
5
4
|
import "react";
|
|
6
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
-
//#region ../theme-core/src/
|
|
6
|
+
//#region ../theme-core/src/cards/decorations.ts
|
|
7
|
+
const CARD_EDGE_RULE_WIDTH_MAP = {
|
|
8
|
+
hairline: "1px",
|
|
9
|
+
thin: "2px",
|
|
10
|
+
medium: "3px",
|
|
11
|
+
thick: "4px",
|
|
12
|
+
heavy: "5px"
|
|
13
|
+
};
|
|
14
|
+
const CARD_EDGE_BORDER_PROPERTY_MAP = {
|
|
15
|
+
left: "border-left",
|
|
16
|
+
top: "border-top",
|
|
17
|
+
right: "border-right",
|
|
18
|
+
bottom: "border-bottom"
|
|
19
|
+
};
|
|
8
20
|
/**
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* These attributes are used by CSS selectors to apply
|
|
12
|
-
* axis-specific styles (tone, energy, density, etc.)
|
|
21
|
+
* The one short-rule length in the corpus (the editorial-rule accent). A fixed
|
|
22
|
+
* constant keeps `length: 'short'` a semantic choice rather than a free number.
|
|
13
23
|
*/
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
"data-tone": axes.tone,
|
|
18
|
-
"data-energy": axes.energy,
|
|
19
|
-
"data-density": axes.density,
|
|
20
|
-
"data-media": axes.mediaBias,
|
|
21
|
-
"data-conv": axes.conversionBias,
|
|
22
|
-
"data-motion": axes.motion,
|
|
23
|
-
"data-theme-scope": themeId
|
|
24
|
-
};
|
|
24
|
+
const SHORT_CARD_EDGE_RULE_LENGTH = "2.75rem";
|
|
25
|
+
function isFullLength(rule) {
|
|
26
|
+
return (rule.length ?? "full") === "full";
|
|
25
27
|
}
|
|
26
|
-
/**
|
|
27
|
-
function
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
headerCss: runtime.headerCss,
|
|
32
|
-
footerCss: runtime.footerCss,
|
|
33
|
-
cardCss: runtime.cardCss,
|
|
34
|
-
accordionCss: runtime.accordionCss,
|
|
35
|
-
inputCss: runtime.inputCss,
|
|
36
|
-
layoutCss: runtime.layoutCss,
|
|
37
|
-
statusCss: runtime.statusCss,
|
|
38
|
-
progressCss: runtime.progressCss,
|
|
39
|
-
typographyCss: runtime.typographyCss,
|
|
40
|
-
eventCalendarCss: runtime.eventCalendarCss,
|
|
41
|
-
blockVarsCss: runtime.blockVarsCss,
|
|
42
|
-
blockCustomVarsCss: runtime.blockCustomVarsCss,
|
|
43
|
-
blockCustomCss: runtime.blockCustomCss,
|
|
44
|
-
atRulesCss: runtime.atRulesCss,
|
|
45
|
-
customCss: runtime.customCss
|
|
46
|
-
};
|
|
28
|
+
/** Apply a decoration's optional alpha to its resolved colour. */
|
|
29
|
+
function cardDecorationColor(rule, resolveColor) {
|
|
30
|
+
const color = resolveColor(rule.colorToken);
|
|
31
|
+
if (rule.alpha === void 0 || rule.alpha >= 1) return color;
|
|
32
|
+
return `color-mix(in oklab, ${color}, transparent ${Math.round((1 - rule.alpha) * 100)}%)`;
|
|
47
33
|
}
|
|
48
|
-
//#endregion
|
|
49
|
-
//#region ../theme-core/src/accordions/defaults.ts
|
|
50
34
|
/**
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
35
|
+
* Container border declarations for a variant's border and its full-length
|
|
36
|
+
* edge rules. The two are independent: a card may be outlined *and* carry an
|
|
37
|
+
* accent edge. A variant with edge rules and no border still zeroes the box so
|
|
38
|
+
* only the decorated sides draw.
|
|
55
39
|
*/
|
|
56
|
-
function
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
},
|
|
65
|
-
spacing: space === "comfortable" ? "comfortable" : space === "dense" ? "compact" : "medium",
|
|
66
|
-
corners: null,
|
|
67
|
-
border: defaultAccordionBorder(theme),
|
|
68
|
-
shadow: defaultAccordionShadow(theme),
|
|
69
|
-
icon: {
|
|
70
|
-
style: axes.tone === "bold" ? "plus-minus" : "chevron",
|
|
71
|
-
position: "right",
|
|
72
|
-
size: axes.density === "compact" ? "sm" : "md"
|
|
73
|
-
},
|
|
74
|
-
trigger: {
|
|
75
|
-
textColorToken: "text",
|
|
76
|
-
fontWeight: axes.tone === "bold" ? "bold" : axes.tone === "minimal" ? "medium" : "semibold"
|
|
77
|
-
},
|
|
78
|
-
hover: generateHoverEffects(axes),
|
|
79
|
-
content: { textColorToken: "neutral-700" }
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
function defaultAccordionBorder({ axes, border }) {
|
|
83
|
-
return axes.conversionBias === "high" || border.width !== "none" ? {
|
|
84
|
-
widthClass: border.width === "thick" ? "border-2" : "border",
|
|
85
|
-
colorToken: "border"
|
|
86
|
-
} : null;
|
|
87
|
-
}
|
|
88
|
-
function defaultAccordionShadow({ axes, shadow }) {
|
|
89
|
-
return axes.conversionBias === "high" || shadow.elevation !== "none" ? {
|
|
90
|
-
elevation: shadow.elevation === "none" ? "low" : shadow.elevation,
|
|
91
|
-
softness: shadow.softness === "crisp" || shadow.softness === null ? "soft" : shadow.softness,
|
|
92
|
-
position: shadow.position
|
|
93
|
-
} : null;
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* Generate hover effects based on theme characteristics
|
|
97
|
-
*
|
|
98
|
-
* Strategy:
|
|
99
|
-
* - Minimal/calm themes: subtle text color change only
|
|
100
|
-
* - Bold/vibrant themes: background + text color
|
|
101
|
-
* - High conversion themes: background + shadow elevation
|
|
102
|
-
*/
|
|
103
|
-
function generateHoverEffects(axes) {
|
|
104
|
-
const { tone, energy, conversionBias } = axes;
|
|
105
|
-
if (tone === "minimal" && energy === "calm") return { textColorToken: "primary" };
|
|
106
|
-
if (tone === "bold" || conversionBias === "high") return {
|
|
107
|
-
backgroundColorToken: "primary/10",
|
|
108
|
-
textColorToken: "primary"
|
|
109
|
-
};
|
|
110
|
-
if (energy === "vibrant") return {
|
|
111
|
-
backgroundColorToken: "primary/5",
|
|
112
|
-
textColorToken: "primary"
|
|
113
|
-
};
|
|
114
|
-
return {
|
|
115
|
-
backgroundColorToken: "primary/5",
|
|
116
|
-
textColorToken: "primary"
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
//#endregion
|
|
120
|
-
//#region ../theme-core/src/blockOverrides.ts
|
|
121
|
-
const BLOCK_PREFIX = "block.";
|
|
122
|
-
function isPlainObject(value) {
|
|
123
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
124
|
-
}
|
|
125
|
-
function isUnknownArray(value) {
|
|
126
|
-
return Array.isArray(value);
|
|
127
|
-
}
|
|
128
|
-
function cloneValue(value) {
|
|
129
|
-
if (isUnknownArray(value)) return value.map((item) => cloneValue(item));
|
|
130
|
-
if (isPlainObject(value)) {
|
|
131
|
-
const cloned = {};
|
|
132
|
-
for (const [key, child] of Object.entries(value)) cloned[key] = cloneValue(child);
|
|
133
|
-
return cloned;
|
|
134
|
-
}
|
|
135
|
-
return value;
|
|
136
|
-
}
|
|
137
|
-
function mergeDeep(defaultValue, overrideValue) {
|
|
138
|
-
if (overrideValue === void 0) return cloneValue(defaultValue);
|
|
139
|
-
if (overrideValue === null) return null;
|
|
140
|
-
if (isPlainObject(defaultValue) && isPlainObject(overrideValue)) {
|
|
141
|
-
const merged = {};
|
|
142
|
-
const keys = /* @__PURE__ */ new Set([...Object.keys(defaultValue), ...Object.keys(overrideValue)]);
|
|
143
|
-
for (const key of keys) merged[key] = mergeDeep(defaultValue[key], overrideValue[key]);
|
|
144
|
-
return merged;
|
|
40
|
+
function cardBorderDeclarations(borderDeclaration, decorations, resolveColor) {
|
|
41
|
+
const fullLengthRules = (decorations ?? []).filter(isFullLength);
|
|
42
|
+
const declarations = [];
|
|
43
|
+
if (borderDeclaration) declarations.push(borderDeclaration);
|
|
44
|
+
else if (fullLengthRules.length > 0) declarations.push("border: 0");
|
|
45
|
+
for (const rule of fullLengthRules) {
|
|
46
|
+
const side = CARD_EDGE_BORDER_PROPERTY_MAP[rule.edge];
|
|
47
|
+
const width = CARD_EDGE_RULE_WIDTH_MAP[rule.width];
|
|
48
|
+
declarations.push(`${side}: ${width} solid ${cardDecorationColor(rule, resolveColor)}`);
|
|
145
49
|
}
|
|
146
|
-
return
|
|
147
|
-
}
|
|
148
|
-
function normalizeBlockKind(blockKind) {
|
|
149
|
-
return blockKind.replace(/^block\./, "");
|
|
150
|
-
}
|
|
151
|
-
function buildBlockKindCandidates(blockKind) {
|
|
152
|
-
const normalized = normalizeBlockKind(blockKind);
|
|
153
|
-
const prefixed = `${BLOCK_PREFIX}${normalized}`;
|
|
154
|
-
return Array.from(/* @__PURE__ */ new Set([
|
|
155
|
-
blockKind,
|
|
156
|
-
normalized,
|
|
157
|
-
prefixed
|
|
158
|
-
]));
|
|
159
|
-
}
|
|
160
|
-
function resolveEffectiveHeadingDecoration(themeDecoration, override) {
|
|
161
|
-
if (override === "off" || !themeDecoration || themeDecoration.family === "none") return { kind: "none" };
|
|
162
|
-
return {
|
|
163
|
-
kind: "visible",
|
|
164
|
-
decoration: themeDecoration
|
|
165
|
-
};
|
|
50
|
+
return declarations;
|
|
166
51
|
}
|
|
167
|
-
function
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
52
|
+
function horizontalAlignDeclarations(align) {
|
|
53
|
+
switch (align ?? "start") {
|
|
54
|
+
case "start": return ["left: 0"];
|
|
55
|
+
case "center": return ["left: 50%", "transform: translateX(-50%)"];
|
|
56
|
+
case "end": return ["right: 0"];
|
|
172
57
|
}
|
|
173
58
|
}
|
|
174
|
-
function
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
applyStyleOverride(mergedContent, "_containerStyles", styleOverrides.containerStyles);
|
|
180
|
-
applyStyleOverride(mergedContent, "_cardStyles", styleOverrides.cardStyles);
|
|
59
|
+
function verticalAlignDeclarations(align) {
|
|
60
|
+
switch (align ?? "start") {
|
|
61
|
+
case "start": return ["top: 0"];
|
|
62
|
+
case "center": return ["top: 50%", "transform: translateY(-50%)"];
|
|
63
|
+
case "end": return ["bottom: 0"];
|
|
181
64
|
}
|
|
182
|
-
applyHeadingDecorationSignature(mergedContent, theme?.headingDecoration);
|
|
183
|
-
return mergedContent;
|
|
184
65
|
}
|
|
66
|
+
function shortEdgeRuleDeclarations(rule, resolveColor) {
|
|
67
|
+
const thickness = CARD_EDGE_RULE_WIDTH_MAP[rule.width];
|
|
68
|
+
const isHorizontal = rule.edge === "top" || rule.edge === "bottom";
|
|
69
|
+
return [
|
|
70
|
+
"content: \"\"",
|
|
71
|
+
"position: absolute",
|
|
72
|
+
`${rule.edge}: 0`,
|
|
73
|
+
...isHorizontal ? horizontalAlignDeclarations(rule.align) : verticalAlignDeclarations(rule.align),
|
|
74
|
+
`width: ${isHorizontal ? SHORT_CARD_EDGE_RULE_LENGTH : thickness}`,
|
|
75
|
+
`height: ${isHorizontal ? thickness : SHORT_CARD_EDGE_RULE_LENGTH}`,
|
|
76
|
+
`background: ${cardDecorationColor(rule, resolveColor)}`
|
|
77
|
+
];
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* The pseudo-elements a card container can lend to short edge rules. A short
|
|
81
|
+
* rule cannot be a border, so it is drawn on `::before` / `::after` against the
|
|
82
|
+
* container (which always sets `position: relative`) — and a card has exactly
|
|
83
|
+
* two of those.
|
|
84
|
+
*/
|
|
85
|
+
const CARD_DECORATION_PSEUDOS = ["::before", "::after"];
|
|
185
86
|
/**
|
|
186
|
-
*
|
|
187
|
-
* `_sectionStyles.headingDecoration`, honouring the per-section override:
|
|
188
|
-
* - `off` strips the decoration (the section opts out).
|
|
189
|
-
* - `site-default` / absent use the theme signature.
|
|
87
|
+
* Complete pseudo-element rules for a variant's short edge rules.
|
|
190
88
|
*
|
|
191
|
-
*
|
|
192
|
-
*
|
|
193
|
-
*
|
|
89
|
+
* `cardDecorationsSchema` caps the list at two, which makes the two pseudos
|
|
90
|
+
* sufficient for anything that parsed. The dependency-free core types carry a
|
|
91
|
+
* plain array with no such cap, so short rules past the second are dropped
|
|
92
|
+
* here rather than silently overwriting `::after`.
|
|
194
93
|
*/
|
|
195
|
-
function
|
|
196
|
-
const
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
const next = { ...existingObj };
|
|
203
|
-
delete next["headingDecoration"];
|
|
204
|
-
target["_sectionStyles"] = next;
|
|
205
|
-
}
|
|
206
|
-
return;
|
|
207
|
-
}
|
|
208
|
-
const next = existingObj ? { ...existingObj } : {};
|
|
209
|
-
next["headingDecoration"] = { ...effective.decoration };
|
|
210
|
-
target["_sectionStyles"] = next;
|
|
211
|
-
}
|
|
212
|
-
function applyStyleOverride(target, key, defaults) {
|
|
213
|
-
if (defaults === void 0) return;
|
|
214
|
-
target[key] = mergeStyleOverride(defaults, target[key]);
|
|
215
|
-
}
|
|
216
|
-
function mergeStyleOverride(defaultValue, contentValue) {
|
|
217
|
-
if (!isPlainObject(defaultValue) || !isPlainObject(contentValue)) return mergeDeep(defaultValue, contentValue);
|
|
218
|
-
const merged = mergeDeep(defaultValue, contentValue);
|
|
219
|
-
if (!isPlainObject(merged)) return merged;
|
|
220
|
-
return {
|
|
221
|
-
...merged,
|
|
222
|
-
background: mergeBoxBackground(defaultValue.background, contentValue.background)
|
|
223
|
-
};
|
|
94
|
+
function cardDecorationPseudoRules(containerSelectors, decorations, resolveColor) {
|
|
95
|
+
const shortRules = (decorations ?? []).filter((rule) => !isFullLength(rule));
|
|
96
|
+
return CARD_DECORATION_PSEUDOS.flatMap((pseudo, index) => {
|
|
97
|
+
const rule = shortRules[index];
|
|
98
|
+
if (!rule) return [];
|
|
99
|
+
return [`${containerSelectors.map((containerSelector) => `${containerSelector}${pseudo}`).join(",\n")} {\n ${shortEdgeRuleDeclarations(rule, resolveColor).join(";\n ")};\n}`];
|
|
100
|
+
});
|
|
224
101
|
}
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
if (!content.success) return cloneValue(contentValue);
|
|
231
|
-
if (!defaults.success || defaults.data.type !== content.data.type) return content.data;
|
|
232
|
-
const merged = boxBackgroundSchema.safeParse(mergeDeep(defaults.data, content.data));
|
|
233
|
-
return merged.success ? merged.data : content.data;
|
|
102
|
+
//#endregion
|
|
103
|
+
//#region ../theme-core/src/utils/cssDeclarations.ts
|
|
104
|
+
/** Render CSS declarations whether callers provide terminators or fragments. */
|
|
105
|
+
function renderCssDeclarations(declarations) {
|
|
106
|
+
return declarations.map((declaration) => declaration.endsWith(";") ? declaration : `${declaration};`).join("\n ");
|
|
234
107
|
}
|
|
235
108
|
//#endregion
|
|
236
|
-
//#region ../theme-core/src/
|
|
237
|
-
/**
|
|
238
|
-
* Font Family Formatting Utilities
|
|
239
|
-
*
|
|
240
|
-
* Handles parsing and formatting font family strings for CSS output.
|
|
241
|
-
* Supports font stacks, proper quoting, and generic CSS families.
|
|
242
|
-
*/
|
|
243
|
-
/** CSS generic font families that should never be quoted */
|
|
244
|
-
const GENERIC_CSS_FAMILIES = [
|
|
245
|
-
"serif",
|
|
246
|
-
"sans-serif",
|
|
247
|
-
"monospace",
|
|
248
|
-
"cursive",
|
|
249
|
-
"fantasy",
|
|
250
|
-
"system-ui"
|
|
251
|
-
];
|
|
109
|
+
//#region ../theme-core/src/buttons/resolvedButtonCss.ts
|
|
252
110
|
/**
|
|
253
|
-
*
|
|
111
|
+
* Canonical colour declaration mapping shared by full themes and ThemeBridge.
|
|
112
|
+
* Both background properties are always emitted so transitions cannot retain
|
|
113
|
+
* a stale gradient or solid layer.
|
|
254
114
|
*/
|
|
255
|
-
function
|
|
256
|
-
|
|
115
|
+
function resolvedButtonColourDeclarations(colour, action) {
|
|
116
|
+
const value = (property, fallback) => action ? actionVariableFallback(action.role, action.state, property, fallback) : fallback;
|
|
117
|
+
switch (colour.kind) {
|
|
118
|
+
case "solid":
|
|
119
|
+
case "known-solid": return [
|
|
120
|
+
["background-color", value("background-color", colour.backgroundCss)],
|
|
121
|
+
["background-image", value("background-image", "none")],
|
|
122
|
+
["color", value("color", colour.foregroundCss)]
|
|
123
|
+
];
|
|
124
|
+
case "gradient": return [
|
|
125
|
+
["background-color", value("background-color", "transparent")],
|
|
126
|
+
["background-image", value("background-image", colour.backgroundCss)],
|
|
127
|
+
["color", value("color", colour.foregroundCss)]
|
|
128
|
+
];
|
|
129
|
+
case "surface": return [
|
|
130
|
+
["background-color", value("background-color", colour.backgroundCss)],
|
|
131
|
+
["background-image", value("background-image", "none")],
|
|
132
|
+
["color", value("color", colour.foregroundCss)]
|
|
133
|
+
];
|
|
134
|
+
}
|
|
257
135
|
}
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
const font = rawFont.trim().replace(/^["']|["']$/g, "");
|
|
266
|
-
if (!font) return null;
|
|
267
|
-
if (isGenericFamily(font)) return font;
|
|
268
|
-
return /\s/.test(font) ? `"${font}"` : font;
|
|
136
|
+
function resolvedButtonFocusDeclarations(indicator, role) {
|
|
137
|
+
const value = (property, fallback) => role ? actionVariableFallback(role, "focus", property, fallback) : fallback;
|
|
138
|
+
return indicator.kind === "two-tone" ? [
|
|
139
|
+
["outline", value("outline", `2px solid ${indicator.innerCss}`)],
|
|
140
|
+
["outline-offset", value("outline-offset", "2px")],
|
|
141
|
+
["box-shadow", value("box-shadow", `0 0 0 4px ${indicator.outerCss}`)]
|
|
142
|
+
] : [["outline", value("outline", `${indicator.width ?? 3}px solid ${indicator.colorCss}`)], ["outline-offset", value("outline-offset", `${indicator.offset ?? 3}px`)]];
|
|
269
143
|
}
|
|
270
144
|
/**
|
|
271
|
-
*
|
|
272
|
-
*
|
|
273
|
-
*
|
|
274
|
-
*
|
|
275
|
-
* - Font stacks (comma-separated, each font quoted individually if needed)
|
|
276
|
-
* - Generic CSS families (never quoted)
|
|
277
|
-
* - Appends fallback if not already present
|
|
278
|
-
*
|
|
279
|
-
* @param family - Font family string (e.g., "Open Sans" or "Open Sans, Helvetica, sans-serif")
|
|
280
|
-
* @param fallback - Fallback font family (default: "sans-serif")
|
|
281
|
-
* @returns CSS-ready font-family value
|
|
282
|
-
*
|
|
283
|
-
* @example
|
|
284
|
-
* formatFontFamily("Open Sans") // '"Open Sans", sans-serif'
|
|
285
|
-
* formatFontFamily("Inter") // 'Inter, sans-serif'
|
|
286
|
-
* formatFontFamily("Open Sans, Helvetica, sans-serif") // '"Open Sans", Helvetica, sans-serif'
|
|
287
|
-
* formatFontFamily("") // 'sans-serif'
|
|
145
|
+
* Disabled buttons are deliberately muted as unavailable controls. Native
|
|
146
|
+
* disabled controls are exempt from active-control contrast requirements;
|
|
147
|
+
* opacity distinguishes the state without introducing a focus-like outline.
|
|
148
|
+
* Retaining pointer events lets the not-allowed cursor remain observable.
|
|
288
149
|
*/
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
}
|
|
150
|
+
const RESOLVED_BUTTON_DISABLED_DECLARATIONS = [
|
|
151
|
+
["cursor", "not-allowed"],
|
|
152
|
+
["transform", "none"],
|
|
153
|
+
["box-shadow", "none"],
|
|
154
|
+
["opacity", "0.55"]
|
|
155
|
+
];
|
|
296
156
|
//#endregion
|
|
297
|
-
//#region ../theme-core/src/
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
}
|
|
311
|
-
|
|
157
|
+
//#region ../theme-core/src/responsiveMode.ts
|
|
158
|
+
const DEFAULT_THEME_RESPONSIVE_MODE = "viewport";
|
|
159
|
+
const THEME_RESPONSIVE_CONTAINER_NAME = "rb-site";
|
|
160
|
+
const THEME_RESPONSIVE_MODE_ATTR = "data-rb-responsive-mode";
|
|
161
|
+
function getResponsiveScopeSpec(mode = DEFAULT_THEME_RESPONSIVE_MODE) {
|
|
162
|
+
if (mode === "container") return {
|
|
163
|
+
kind: "container",
|
|
164
|
+
selector: `[${THEME_RESPONSIVE_MODE_ATTR}="container"]`,
|
|
165
|
+
containerName: THEME_RESPONSIVE_CONTAINER_NAME
|
|
166
|
+
};
|
|
167
|
+
return {
|
|
168
|
+
kind: "viewport",
|
|
169
|
+
selector: `[${THEME_RESPONSIVE_MODE_ATTR}="viewport"]`
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
function escapeRegExp(value) {
|
|
173
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
174
|
+
}
|
|
175
|
+
new RegExp(buildResponsiveScopeRulePatternSource(), "g");
|
|
176
|
+
new RegExp(buildResponsiveScopeRulePatternSource(), "y");
|
|
177
|
+
function buildResponsiveScopeRulePatternSource() {
|
|
178
|
+
return [
|
|
179
|
+
"@scope",
|
|
180
|
+
"\\(\\[",
|
|
181
|
+
escapeRegExp(THEME_RESPONSIVE_MODE_ATTR),
|
|
182
|
+
"=\"(?:viewport|container)\"\\]\\)",
|
|
183
|
+
"to",
|
|
184
|
+
"\\((?::scope )?\\[",
|
|
185
|
+
escapeRegExp(THEME_RESPONSIVE_MODE_ATTR),
|
|
186
|
+
"\\]\\)",
|
|
187
|
+
"\\{"
|
|
188
|
+
].join("\\s*");
|
|
312
189
|
}
|
|
313
190
|
//#endregion
|
|
314
191
|
//#region ../theme-core/src/styles/shadow.ts
|
|
@@ -578,229 +455,6 @@ function bookingBarDeclarations(bar) {
|
|
|
578
455
|
];
|
|
579
456
|
}
|
|
580
457
|
//#endregion
|
|
581
|
-
//#region ../theme-core/src/styles/border.ts
|
|
582
|
-
/**
|
|
583
|
-
* Border width mapping from Tailwind class names to px values
|
|
584
|
-
* Used by CSS generators for cards, accordions, and other components
|
|
585
|
-
*/
|
|
586
|
-
const BORDER_WIDTH_TO_PX = {
|
|
587
|
-
"border-0": "0",
|
|
588
|
-
"border": "1px",
|
|
589
|
-
"border-2": "2px",
|
|
590
|
-
"border-3": "3px",
|
|
591
|
-
"border-4": "4px",
|
|
592
|
-
"border-8": "8px"
|
|
593
|
-
};
|
|
594
|
-
/**
|
|
595
|
-
* Parse a Tailwind border width class to px value
|
|
596
|
-
* Falls back to 1px if class is not recognized
|
|
597
|
-
*/
|
|
598
|
-
function parseBorderWidth(widthClass) {
|
|
599
|
-
return BORDER_WIDTH_TO_PX[widthClass] ?? "1px";
|
|
600
|
-
}
|
|
601
|
-
//#endregion
|
|
602
|
-
//#region ../theme-core/src/accordions/generateAccordionCss.ts
|
|
603
|
-
/**
|
|
604
|
-
* Corner radius map for accordion surfaces. Pill is capped here because FAQ
|
|
605
|
-
* rows contain long text and expanded content; full capsules clip awkwardly.
|
|
606
|
-
*/
|
|
607
|
-
const CORNER_MAP$2 = {
|
|
608
|
-
square: "0",
|
|
609
|
-
soft: "0.5rem",
|
|
610
|
-
rounded: "1rem",
|
|
611
|
-
pill: "1rem"
|
|
612
|
-
};
|
|
613
|
-
const FAQ_QUESTION_COLUMNS_TRIGGER_MIN_HEIGHT = "5rem";
|
|
614
|
-
/**
|
|
615
|
-
* Generate CSS for accordion styling based on theme configuration
|
|
616
|
-
*
|
|
617
|
-
* Creates scoped CSS classes that apply theme-aware styling to accordions:
|
|
618
|
-
* - .accordion-root: Container styles (background, border, corners, shadow)
|
|
619
|
-
* - .accordion-item: Individual item borders
|
|
620
|
-
* - .accordion-trigger: Question/trigger text styling
|
|
621
|
-
* - .accordion-content: Answer/content text styling
|
|
622
|
-
* - .accordion-icon: Icon sizing and transitions
|
|
623
|
-
*/
|
|
624
|
-
function generateAccordionCss({ themeId, theme, accordionSystem, solvedInks }) {
|
|
625
|
-
const rootSelector = `:where([data-theme-scope="${themeId}"]) .accordion-root`;
|
|
626
|
-
const itemSelector = `${rootSelector} .accordion-item`;
|
|
627
|
-
const triggerSelector = `${itemSelector} .accordion-trigger`;
|
|
628
|
-
const triggerTextSelector = `${triggerSelector} .accordion-trigger-text`;
|
|
629
|
-
const contentSelector = `${itemSelector} .accordion-content`;
|
|
630
|
-
const contentInnerSelector = `${contentSelector} > .accordion-content-inner`;
|
|
631
|
-
const iconSelector = `${triggerSelector} .accordion-icon`;
|
|
632
|
-
const questionColumnsItemSelector = `${rootSelector}.rb-faq-question-columns .accordion-item`;
|
|
633
|
-
const questionColumnsLastItemSelector = `${questionColumnsItemSelector}:last-child`;
|
|
634
|
-
const questionColumnsTriggerSelector = `${questionColumnsItemSelector} .accordion-trigger`;
|
|
635
|
-
const rootRules = accordionSurfaceRules(theme, accordionSystem, solvedInks);
|
|
636
|
-
const borderRadius = CORNER_MAP$2[accordionSystem.corners ?? theme.corners];
|
|
637
|
-
rootRules.push(`border-radius: ${borderRadius}`);
|
|
638
|
-
if (accordionSystem.border) {
|
|
639
|
-
const borderPx = parseBorderWidth(accordionSystem.border.widthClass);
|
|
640
|
-
rootRules.push(`border: ${borderPx} solid ${rgbColorValue(accordionSystem.border.colorToken)}`);
|
|
641
|
-
}
|
|
642
|
-
if (accordionSystem.shadow && accordionSystem.shadow.elevation !== "none") {
|
|
643
|
-
const shadowValue = generateShadowValue({
|
|
644
|
-
elevation: accordionSystem.shadow.elevation,
|
|
645
|
-
softness: accordionSystem.shadow.softness ?? "soft",
|
|
646
|
-
position: accordionSystem.shadow.position
|
|
647
|
-
});
|
|
648
|
-
rootRules.push(`box-shadow: ${shadowValue}`);
|
|
649
|
-
}
|
|
650
|
-
rootRules.push("overflow: hidden");
|
|
651
|
-
rootRules.push("width: 100%");
|
|
652
|
-
const itemRules = [];
|
|
653
|
-
const itemBorderBottomRule = accordionSystem.border ? `border-bottom: 1px solid ${rgbColorValue(accordionSystem.border.colorToken)}` : "border-bottom: 1px solid rgb(var(--tb-border))";
|
|
654
|
-
itemRules.push(itemBorderBottomRule);
|
|
655
|
-
const lastItemSelector = `${itemSelector}:last-child`;
|
|
656
|
-
const lastItemRules = ["border-bottom: none"];
|
|
657
|
-
const questionColumnsLastItemRules = [itemBorderBottomRule];
|
|
658
|
-
const triggerRules = [];
|
|
659
|
-
const padding = ACCORDION_SPACING_MAP[accordionSystem.spacing];
|
|
660
|
-
triggerRules.push(`padding: ${padding}`);
|
|
661
|
-
triggerRules.push(`color: ${rgbColorValue(accordionSystem.trigger.textColorToken)}`);
|
|
662
|
-
const triggerTypographyRules = [];
|
|
663
|
-
if (accordionSystem.trigger.fontFamily === "heading") triggerTypographyRules.push("font-family: var(--font-heading)");
|
|
664
|
-
else if (accordionSystem.trigger.fontFamily === "body") triggerTypographyRules.push("font-family: var(--font-body)");
|
|
665
|
-
triggerTypographyRules.push(`font-size: ${ACCORDION_TRIGGER_FONT_SCALE[accordionSystem.trigger.fontScale ?? "body"]}`);
|
|
666
|
-
triggerTypographyRules.push("line-height: 1.4");
|
|
667
|
-
if (accordionSystem.trigger.letterSpacing && accordionSystem.trigger.letterSpacing !== "normal") triggerTypographyRules.push(`letter-spacing: ${ACCORDION_TRIGGER_LETTER_SPACING[accordionSystem.trigger.letterSpacing]}`);
|
|
668
|
-
if (accordionSystem.trigger.textTransform === "uppercase") triggerTypographyRules.push("text-transform: uppercase");
|
|
669
|
-
triggerRules.push(...triggerTypographyRules);
|
|
670
|
-
if (accordionSystem.trigger.fontWeight) triggerRules.push(`font-weight: ${{
|
|
671
|
-
regular: "400",
|
|
672
|
-
medium: "500",
|
|
673
|
-
semibold: "600",
|
|
674
|
-
bold: "700"
|
|
675
|
-
}[accordionSystem.trigger.fontWeight]}`);
|
|
676
|
-
triggerRules.push("cursor: pointer");
|
|
677
|
-
triggerRules.push("display: flex");
|
|
678
|
-
triggerRules.push("flex: 1");
|
|
679
|
-
triggerRules.push("align-items: center");
|
|
680
|
-
triggerRules.push("justify-content: space-between");
|
|
681
|
-
triggerRules.push("width: 100%");
|
|
682
|
-
triggerRules.push("text-align: left");
|
|
683
|
-
triggerRules.push("gap: 1rem");
|
|
684
|
-
triggerRules.push("outline: none");
|
|
685
|
-
const transitionProps = ["color 0.2s ease"];
|
|
686
|
-
if (accordionSystem.hover.backgroundColorToken) transitionProps.push("background-color 0.2s ease");
|
|
687
|
-
if (accordionSystem.hover.borderColorToken) transitionProps.push("border-color 0.2s ease");
|
|
688
|
-
triggerRules.push(`transition: ${transitionProps.join(", ")}`);
|
|
689
|
-
const triggerHoverSelector = `${triggerSelector}:hover`;
|
|
690
|
-
const triggerHoverRules = [];
|
|
691
|
-
if (accordionSystem.hover.backgroundColorToken) {
|
|
692
|
-
triggerHoverRules.push(`background-color: ${rgbColorValue(accordionSystem.hover.backgroundColorToken)}`);
|
|
693
|
-
triggerHoverRules.push(...accordionPaintInks(theme, accordionSystem.hover.backgroundColorToken, solvedInks));
|
|
694
|
-
}
|
|
695
|
-
if (accordionSystem.hover.textColorToken) triggerHoverRules.push(`color: ${rgbColorValue(accordionSystem.hover.textColorToken)}`);
|
|
696
|
-
if (accordionSystem.hover.borderColorToken) triggerHoverRules.push(`border-color: ${rgbColorValue(accordionSystem.hover.borderColorToken)}`);
|
|
697
|
-
const triggerFocusSelector = `${triggerSelector}:focus-visible`;
|
|
698
|
-
const triggerFocusRules = [];
|
|
699
|
-
triggerFocusRules.push("outline: 2px solid rgb(var(--tb-primary))");
|
|
700
|
-
triggerFocusRules.push("outline-offset: 2px");
|
|
701
|
-
const openItemSelector = `${itemSelector}[data-state="open"]`;
|
|
702
|
-
const openTriggerSelector = `${openItemSelector} .accordion-trigger`;
|
|
703
|
-
const openItemRules = [];
|
|
704
|
-
const openTriggerRules = [];
|
|
705
|
-
const openState = accordionSystem.openState;
|
|
706
|
-
if (openState?.backgroundColorToken) {
|
|
707
|
-
openItemRules.push(`background-color: ${rgbColorValue(openState.backgroundColorToken)}`);
|
|
708
|
-
openItemRules.push(...accordionPaintInks(theme, openState.backgroundColorToken, solvedInks));
|
|
709
|
-
}
|
|
710
|
-
if (openState?.accent) {
|
|
711
|
-
const thickness = ACCORDION_OPEN_ACCENT_THICKNESS[openState.accent.thickness];
|
|
712
|
-
const accentColor = rgbColorValue(openState.accent.colorToken);
|
|
713
|
-
const insetByEdge = {
|
|
714
|
-
left: `inset ${thickness} 0 0 0 ${accentColor}`,
|
|
715
|
-
top: `inset 0 ${thickness} 0 0 ${accentColor}`,
|
|
716
|
-
bottom: `inset 0 -${thickness} 0 0 ${accentColor}`
|
|
717
|
-
};
|
|
718
|
-
openItemRules.push(`box-shadow: ${insetByEdge[openState.accent.edge]}`);
|
|
719
|
-
}
|
|
720
|
-
if (openState?.triggerColorToken) openTriggerRules.push(`color: ${rgbColorValue(openState.triggerColorToken)}`);
|
|
721
|
-
const contentRules = [];
|
|
722
|
-
const contentInnerRules = [];
|
|
723
|
-
contentRules.push("overflow: hidden");
|
|
724
|
-
contentRules.push(`color: ${rgbColorValue(accordionSystem.content.textColorToken)}`);
|
|
725
|
-
contentRules.push("max-width: none");
|
|
726
|
-
contentInnerRules.push(`padding: 0 ${padding} ${padding} ${padding}`);
|
|
727
|
-
contentInnerRules.push("display: flow-root");
|
|
728
|
-
const contentFirstPSelector = `${contentInnerSelector} > p:first-child`;
|
|
729
|
-
const iconRules = [];
|
|
730
|
-
const iconSize = ICON_SIZE_PX[accordionSystem.icon.size];
|
|
731
|
-
iconRules.push(`width: ${iconSize}`);
|
|
732
|
-
iconRules.push(`height: ${iconSize}`);
|
|
733
|
-
iconRules.push("flex-shrink: 0");
|
|
734
|
-
iconRules.push("display: inline-flex");
|
|
735
|
-
iconRules.push("align-items: center");
|
|
736
|
-
iconRules.push("justify-content: center");
|
|
737
|
-
if (accordionSystem.icon.colorToken) iconRules.push(`color: ${rgbColorValue(accordionSystem.icon.colorToken)}`);
|
|
738
|
-
const iconConfig = ICON_CONFIG[accordionSystem.icon.style];
|
|
739
|
-
const iconSwapBlocks = [];
|
|
740
|
-
const iconRotateBlock = [];
|
|
741
|
-
if (iconConfig.openIcon) {
|
|
742
|
-
const iconClosedSelector = `${iconSelector} .accordion-icon-closed`;
|
|
743
|
-
const iconOpenHiddenSelector = `${iconSelector} .accordion-icon-open`;
|
|
744
|
-
const itemOpenIconClosedSelector = `[data-state="open"] ${iconSelector} .accordion-icon-closed`;
|
|
745
|
-
const itemOpenIconOpenSelector = `[data-state="open"] ${iconSelector} .accordion-icon-open`;
|
|
746
|
-
iconSwapBlocks.push(`${iconClosedSelector} {\n display: block;\n transition: opacity 0.2s ease;\n}`);
|
|
747
|
-
iconSwapBlocks.push(`${iconOpenHiddenSelector} {\n display: none;\n}`);
|
|
748
|
-
iconSwapBlocks.push(`${itemOpenIconClosedSelector} {\n display: none;\n}`);
|
|
749
|
-
iconSwapBlocks.push(`${itemOpenIconOpenSelector} {\n display: block;\n}`);
|
|
750
|
-
} else {
|
|
751
|
-
iconRules.push("transition: transform 0.2s ease");
|
|
752
|
-
if (iconConfig.rotation > 0) {
|
|
753
|
-
const iconOpenSelector = `[data-state="open"] ${iconSelector}`;
|
|
754
|
-
const iconOpenRules = [];
|
|
755
|
-
iconOpenRules.push(`transform: rotate(${iconConfig.rotation}deg)`);
|
|
756
|
-
iconRotateBlock.push(`${iconOpenSelector} {\n ${iconOpenRules.join(";\n ")};\n}`);
|
|
757
|
-
}
|
|
758
|
-
}
|
|
759
|
-
const cssBlocks = [];
|
|
760
|
-
cssBlocks.push(`${rootSelector} {\n ${renderCssDeclarations(rootRules)}\n}`);
|
|
761
|
-
cssBlocks.push(`${itemSelector} {\n ${itemRules.join(";\n ")};\n}`);
|
|
762
|
-
cssBlocks.push(`${itemSelector}.accordion-item {\n border-radius: ${borderRadius};\n}`);
|
|
763
|
-
cssBlocks.push(`${lastItemSelector} {\n ${lastItemRules.join(";\n ")};\n}`);
|
|
764
|
-
if (questionColumnsLastItemRules.length > 0) cssBlocks.push(`${questionColumnsLastItemSelector} {\n ${questionColumnsLastItemRules.join(";\n ")};\n}`);
|
|
765
|
-
cssBlocks.push(`${triggerSelector} {\n ${triggerRules.join(";\n ")};\n}`);
|
|
766
|
-
cssBlocks.push(`${questionColumnsTriggerSelector} {\n min-height: ${FAQ_QUESTION_COLUMNS_TRIGGER_MIN_HEIGHT};\n}`);
|
|
767
|
-
const triggerTextRules = ["flex: 1", ...triggerTypographyRules];
|
|
768
|
-
cssBlocks.push(`${triggerTextSelector} {\n ${triggerTextRules.join(";\n ")};\n}`);
|
|
769
|
-
if (triggerHoverRules.length > 0) cssBlocks.push(`${triggerHoverSelector} {\n ${triggerHoverRules.join(";\n ")};\n}`);
|
|
770
|
-
if (triggerFocusRules.length > 0) cssBlocks.push(`${triggerFocusSelector} {\n ${triggerFocusRules.join(";\n ")};\n}`);
|
|
771
|
-
if (openItemRules.length > 0) cssBlocks.push(`${openItemSelector} {\n ${openItemRules.join(";\n ")};\n}`);
|
|
772
|
-
if (openTriggerRules.length > 0) cssBlocks.push(`${openTriggerSelector} {\n ${openTriggerRules.join(";\n ")};\n}`);
|
|
773
|
-
cssBlocks.push(`${contentSelector} {\n ${contentRules.join(";\n ")};\n}`);
|
|
774
|
-
cssBlocks.push(`${contentInnerSelector} {\n ${contentInnerRules.join(";\n ")};\n}`);
|
|
775
|
-
cssBlocks.push(`${contentFirstPSelector} {\n margin-top: 0;\n}`);
|
|
776
|
-
cssBlocks.push(`${iconSelector} {\n ${iconRules.join(";\n ")};\n}`);
|
|
777
|
-
if (iconSwapBlocks.length > 0) cssBlocks.push(...iconSwapBlocks);
|
|
778
|
-
if (iconRotateBlock.length > 0) cssBlocks.push(...iconRotateBlock);
|
|
779
|
-
return cssBlocks.join("\n\n");
|
|
780
|
-
}
|
|
781
|
-
function accordionSurfaceRules(theme, system, solvedInks) {
|
|
782
|
-
if (!system.background) return [];
|
|
783
|
-
const foreground = resolveSurfaceForeground({
|
|
784
|
-
type: "color",
|
|
785
|
-
color: system.background.colorToken,
|
|
786
|
-
textColor: system.content.textColorToken,
|
|
787
|
-
headingColor: system.trigger.textColorToken
|
|
788
|
-
}, expandPalette(theme.palette), { linkHover: theme.typography.proseLinkStyle?.hoverColorToken });
|
|
789
|
-
return [
|
|
790
|
-
`background-color: ${rgbColorValue(system.background.colorToken)}`,
|
|
791
|
-
...surfaceForegroundDeclarations(foreground.kind === "known" ? surfaceForegroundInputFromResolved(foreground, rgbColorValue) : { text: rgbColorValue(system.content.textColorToken) }),
|
|
792
|
-
...surfaceInkDeclarations(surfaceInkPublication(foreground, solvedInks ?? "withhold"))
|
|
793
|
-
];
|
|
794
|
-
}
|
|
795
|
-
function accordionPaintInks(theme, color, policy) {
|
|
796
|
-
const palette = expandPalette(theme.palette);
|
|
797
|
-
if (!resolveConcreteColorHex(color, palette)) return surfaceInkDeclarations({ kind: "reset" }).map((rule) => rule.replace(/;$/, ""));
|
|
798
|
-
return surfaceInkDeclarations(surfaceInkPublication(resolveSurfaceForeground({
|
|
799
|
-
type: "color",
|
|
800
|
-
color
|
|
801
|
-
}, palette), policy ?? "withhold")).map((rule) => rule.replace(/;$/, ""));
|
|
802
|
-
}
|
|
803
|
-
//#endregion
|
|
804
458
|
//#region ../theme-core/src/inputs/checkable.ts
|
|
805
459
|
/**
|
|
806
460
|
* Checkbox and radio CSS shared by the full theme generator and the SDK
|
|
@@ -1132,475 +786,6 @@ ${root} .form-input-group > :not(.form-input-group-field) {
|
|
|
1132
786
|
}`;
|
|
1133
787
|
}
|
|
1134
788
|
//#endregion
|
|
1135
|
-
//#region ../theme-core/src/inputs/generateInputCss.ts
|
|
1136
|
-
/**
|
|
1137
|
-
* Corner radius map (reused from other systems)
|
|
1138
|
-
*/
|
|
1139
|
-
const CORNER_MAP$1 = {
|
|
1140
|
-
square: "0",
|
|
1141
|
-
soft: "0.5rem",
|
|
1142
|
-
rounded: "1rem",
|
|
1143
|
-
pill: "9999px"
|
|
1144
|
-
};
|
|
1145
|
-
/** A filled shell owns its fill's surface, button context included, the same way a card does. */
|
|
1146
|
-
function inputGroupShellSurface(theme, inputSystem) {
|
|
1147
|
-
const { background, textColorToken } = inputSystem.base;
|
|
1148
|
-
if (background.type === "transparent") return [];
|
|
1149
|
-
return opaqueSurfaceDeclarations(resolveSurface({
|
|
1150
|
-
kind: "paint",
|
|
1151
|
-
paint: {
|
|
1152
|
-
kind: "solid",
|
|
1153
|
-
token: background.colorToken,
|
|
1154
|
-
foregroundToken: textColorToken
|
|
1155
|
-
}
|
|
1156
|
-
}, opaqueSurfaceContextFromTheme(theme)));
|
|
1157
|
-
}
|
|
1158
|
-
function inputBackgroundValue(background) {
|
|
1159
|
-
return background.type === "transparent" ? "transparent" : rgbColorValue(background.colorToken);
|
|
1160
|
-
}
|
|
1161
|
-
/**
|
|
1162
|
-
* Generate CSS for form input styling based on theme configuration
|
|
1163
|
-
*
|
|
1164
|
-
* Creates scoped CSS classes that apply theme-aware styling to form inputs:
|
|
1165
|
-
* - .form-label: Label styling
|
|
1166
|
-
* - .form-input: Text inputs (text, email, url, tel, number)
|
|
1167
|
-
* - .form-textarea: Textarea styling
|
|
1168
|
-
* - .form-select: Select dropdown styling
|
|
1169
|
-
* - .form-checkbox: Checkbox styling
|
|
1170
|
-
* - .form-radio: Radio button styling
|
|
1171
|
-
* - Focus states (:focus-visible)
|
|
1172
|
-
* - Error states ([aria-invalid="true"])
|
|
1173
|
-
* - Disabled states (:disabled)
|
|
1174
|
-
*/
|
|
1175
|
-
function generateInputCss({ themeId, theme, inputSystem }) {
|
|
1176
|
-
const rootSelector = `:where([data-theme-scope="${themeId}"])`;
|
|
1177
|
-
const baseInputRules = [];
|
|
1178
|
-
baseInputRules.push(`background-color: ${inputBackgroundValue(inputSystem.base.background)}`);
|
|
1179
|
-
baseInputRules.push(`color: ${rgbColorValue(inputSystem.base.textColorToken)}`);
|
|
1180
|
-
const borderPx = parseBorderWidth(inputSystem.base.border.widthClass);
|
|
1181
|
-
const borderStyle = inputSystem.base.border.style ?? "all";
|
|
1182
|
-
if (borderStyle === "underline") {
|
|
1183
|
-
baseInputRules.push("border: none");
|
|
1184
|
-
baseInputRules.push(`border-bottom: ${borderPx} solid ${rgbColorValue(inputSystem.base.border.colorToken)}`);
|
|
1185
|
-
} else baseInputRules.push(`border: ${borderPx} solid ${rgbColorValue(inputSystem.base.border.colorToken)}`);
|
|
1186
|
-
if (borderStyle === "underline") baseInputRules.push("border-radius: 0");
|
|
1187
|
-
else {
|
|
1188
|
-
const borderRadius = CORNER_MAP$1[inputSystem.base.corners ?? theme.corners];
|
|
1189
|
-
baseInputRules.push(`border-radius: ${borderRadius}`);
|
|
1190
|
-
}
|
|
1191
|
-
if (inputSystem.base.shadow && inputSystem.base.shadow.elevation !== "none") {
|
|
1192
|
-
const shadowValue = generateShadowValue$1(inputSystem.base.shadow.elevation, inputSystem.base.shadow.softness ?? "soft", "bottom");
|
|
1193
|
-
baseInputRules.push(`box-shadow: ${shadowValue}`);
|
|
1194
|
-
}
|
|
1195
|
-
const padding = INPUT_SPACING_MAP[inputSystem.base.spacing];
|
|
1196
|
-
baseInputRules.push(`padding: ${padding}`);
|
|
1197
|
-
const fontSize = INPUT_FONT_SIZE_MAP[inputSystem.base.fontSize];
|
|
1198
|
-
baseInputRules.push(`font-size: ${fontSize}`);
|
|
1199
|
-
baseInputRules.push("width: 100%");
|
|
1200
|
-
baseInputRules.push("outline: none");
|
|
1201
|
-
baseInputRules.push("transition: border-color 0.2s ease, box-shadow 0.2s ease");
|
|
1202
|
-
const labelSelector = `${rootSelector} .form-label`;
|
|
1203
|
-
const labelRules = [];
|
|
1204
|
-
labelRules.push(`color: ${textColorValue(inputSystem.label.textColorToken)}`);
|
|
1205
|
-
labelRules.push(`font-weight: ${FONT_WEIGHT_MAP[inputSystem.label.fontWeight]}`);
|
|
1206
|
-
labelRules.push(`font-size: ${LABEL_FONT_SIZE_MAP[inputSystem.label.fontSize]}`);
|
|
1207
|
-
if (inputSystem.label.textTransform && inputSystem.label.textTransform !== "none") labelRules.push(`text-transform: ${inputSystem.label.textTransform}`);
|
|
1208
|
-
if (inputSystem.label.letterSpacing && inputSystem.label.letterSpacing !== "normal") labelRules.push(`letter-spacing: ${{
|
|
1209
|
-
normal: "0",
|
|
1210
|
-
wide: "0.025em",
|
|
1211
|
-
wider: "0.05em",
|
|
1212
|
-
widest: "0.1em"
|
|
1213
|
-
}[inputSystem.label.letterSpacing]}`);
|
|
1214
|
-
if (typeof inputSystem.label.opacity === "number") labelRules.push(`opacity: ${inputSystem.label.opacity}`);
|
|
1215
|
-
labelRules.push("display: block");
|
|
1216
|
-
labelRules.push("margin-bottom: 0.25rem");
|
|
1217
|
-
const inputSelector = `${rootSelector} .form-input`;
|
|
1218
|
-
const inputRules = [...baseInputRules];
|
|
1219
|
-
const textareaSelector = `${rootSelector} .form-textarea`;
|
|
1220
|
-
const textareaRules = [...baseInputRules];
|
|
1221
|
-
textareaRules.push("resize: vertical");
|
|
1222
|
-
textareaRules.push("min-height: 5rem");
|
|
1223
|
-
const selectSelector = `${rootSelector} .form-select`;
|
|
1224
|
-
const selectRules = [...baseInputRules];
|
|
1225
|
-
selectRules.push("appearance: none");
|
|
1226
|
-
selectRules.push("background-image: url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e\")");
|
|
1227
|
-
selectRules.push("background-position: right 0.5rem center");
|
|
1228
|
-
selectRules.push("background-repeat: no-repeat");
|
|
1229
|
-
selectRules.push("background-size: 1.5em 1.5em");
|
|
1230
|
-
selectRules.push("padding-right: 2.5rem");
|
|
1231
|
-
const focusSelectors = [
|
|
1232
|
-
`${inputSelector}:focus-visible`,
|
|
1233
|
-
`${textareaSelector}:focus-visible`,
|
|
1234
|
-
`${selectSelector}:focus-visible`,
|
|
1235
|
-
`${rootSelector} ${INPUT_GROUP_FOCUS_SELECTOR}`
|
|
1236
|
-
];
|
|
1237
|
-
const focusRules = [];
|
|
1238
|
-
focusRules.push("outline: none");
|
|
1239
|
-
focusRules.push(`box-shadow: 0 0 0 ${inputSystem.focus.ringWidth}px ${rgbColorValue(inputSystem.focus.ringColorToken)}`);
|
|
1240
|
-
if (inputSystem.focus.borderColorToken) focusRules.push(`border-color: ${rgbColorValue(inputSystem.focus.borderColorToken)}`);
|
|
1241
|
-
const errorSelectors = [
|
|
1242
|
-
`${inputSelector}[aria-invalid="true"]`,
|
|
1243
|
-
`${textareaSelector}[aria-invalid="true"]`,
|
|
1244
|
-
`${selectSelector}[aria-invalid="true"]`,
|
|
1245
|
-
`${rootSelector} ${INPUT_GROUP_ERROR_SELECTOR}`
|
|
1246
|
-
];
|
|
1247
|
-
const errorRules = [];
|
|
1248
|
-
errorRules.push(`border-color: ${rgbColorValue(inputSystem.error.borderColorToken)}`);
|
|
1249
|
-
errorRules.push(`color: ${rgbColorValue(inputSystem.error.textColorToken)}`);
|
|
1250
|
-
const disabledSelectors = [
|
|
1251
|
-
`${inputSelector}:disabled`,
|
|
1252
|
-
`${textareaSelector}:disabled`,
|
|
1253
|
-
`${selectSelector}:disabled`
|
|
1254
|
-
];
|
|
1255
|
-
const disabledRules = [];
|
|
1256
|
-
disabledRules.push(`background-color: ${rgbColorValue(inputSystem.disabled.backgroundColorToken)}`);
|
|
1257
|
-
disabledRules.push(`color: ${rgbColorValue(inputSystem.disabled.textColorToken)}`);
|
|
1258
|
-
disabledRules.push(`opacity: ${inputSystem.disabled.opacity}`);
|
|
1259
|
-
disabledRules.push("cursor: not-allowed");
|
|
1260
|
-
const checkableCss = generateCheckableCss({
|
|
1261
|
-
root: rootSelector,
|
|
1262
|
-
borderWidth: borderPx,
|
|
1263
|
-
borderColor: rgbColorValue(inputSystem.base.border.colorToken),
|
|
1264
|
-
background: inputBackgroundValue(inputSystem.base.background),
|
|
1265
|
-
corners: inputSystem.base.corners ?? theme.corners,
|
|
1266
|
-
accentToken: inputSystem.focus.borderColorToken ?? inputSystem.focus.ringColorToken,
|
|
1267
|
-
errorColor: rgbColorValue(inputSystem.error.borderColorToken)
|
|
1268
|
-
});
|
|
1269
|
-
const cssBlocks = [];
|
|
1270
|
-
cssBlocks.push(`${labelSelector} {\n ${labelRules.join(";\n ")};\n}`);
|
|
1271
|
-
cssBlocks.push(`${inputSelector},\n${rootSelector} ${INPUT_GROUP_SELECTOR} {\n ${inputRules.join(";\n ")};\n}`);
|
|
1272
|
-
cssBlocks.push(`${textareaSelector} {\n ${textareaRules.join(";\n ")};\n}`);
|
|
1273
|
-
cssBlocks.push(`${selectSelector} {\n ${selectRules.join(";\n ")};\n}`);
|
|
1274
|
-
cssBlocks.push(`${focusSelectors.join(",\n")} {\n ${focusRules.join(";\n ")};\n}`);
|
|
1275
|
-
cssBlocks.push(`${errorSelectors.join(",\n")} {\n ${errorRules.join(";\n ")};\n}`);
|
|
1276
|
-
cssBlocks.push(`${disabledSelectors.join(",\n")} {\n ${disabledRules.join(";\n ")};\n}`);
|
|
1277
|
-
cssBlocks.push(generateInputGroupCss(rootSelector, padding, inputGroupShellSurface(theme, inputSystem)));
|
|
1278
|
-
cssBlocks.push(checkableCss);
|
|
1279
|
-
return cssBlocks.join("\n\n");
|
|
1280
|
-
}
|
|
1281
|
-
//#endregion
|
|
1282
|
-
//#region ../theme-core/src/inputs/defaults.ts
|
|
1283
|
-
/**
|
|
1284
|
-
* Generate default input system based on theme configuration
|
|
1285
|
-
*
|
|
1286
|
-
* Creates input styling that harmonizes with the theme's visual language:
|
|
1287
|
-
* - Spacing adapts to theme density
|
|
1288
|
-
* - Border thickness matches theme border style
|
|
1289
|
-
* - Focus states reflect theme energy level
|
|
1290
|
-
* - Colors coordinate with theme palette
|
|
1291
|
-
*
|
|
1292
|
-
* Accepts either Theme or HydratedTheme (uses only shared properties)
|
|
1293
|
-
*/
|
|
1294
|
-
function generateDefaultInputSystem(theme) {
|
|
1295
|
-
const { axes, space, border, shadow } = theme;
|
|
1296
|
-
const inputStyle = theme.inputStyle;
|
|
1297
|
-
let spacing;
|
|
1298
|
-
if (axes.density === "compact") spacing = "compact";
|
|
1299
|
-
else if (axes.density === "airy") spacing = "comfortable";
|
|
1300
|
-
else if (space === "comfortable") spacing = "comfortable";
|
|
1301
|
-
else if (space === "dense") spacing = "compact";
|
|
1302
|
-
else spacing = "medium";
|
|
1303
|
-
let fontSize;
|
|
1304
|
-
if (axes.density === "compact") fontSize = "sm";
|
|
1305
|
-
else if (axes.density === "airy") fontSize = "lg";
|
|
1306
|
-
else fontSize = "base";
|
|
1307
|
-
let borderWidthClass;
|
|
1308
|
-
let borderStyle;
|
|
1309
|
-
if (inputStyle?.border === "subtle") borderWidthClass = "border";
|
|
1310
|
-
else if (inputStyle?.border === "defined") borderWidthClass = "border-2";
|
|
1311
|
-
else if (inputStyle?.border === "underline") {
|
|
1312
|
-
borderWidthClass = "border-b-2";
|
|
1313
|
-
borderStyle = "underline";
|
|
1314
|
-
} else if (border.width === "thick") borderWidthClass = "border-2";
|
|
1315
|
-
else borderWidthClass = "border";
|
|
1316
|
-
const inputCorners = inputStyle?.shape ?? (axes.tone === "bold" ? "square" : null);
|
|
1317
|
-
const inputShadow = shadow.elevation !== "none" && axes.conversionBias === "high" ? {
|
|
1318
|
-
elevation: "low",
|
|
1319
|
-
softness: shadow.softness
|
|
1320
|
-
} : null;
|
|
1321
|
-
let labelFontWeight;
|
|
1322
|
-
if (axes.tone === "bold") labelFontWeight = "semibold";
|
|
1323
|
-
else if (axes.tone === "minimal") labelFontWeight = "regular";
|
|
1324
|
-
else labelFontWeight = "medium";
|
|
1325
|
-
const labelFontSize = axes.density === "compact" ? "xs" : "sm";
|
|
1326
|
-
let focusRingWidth;
|
|
1327
|
-
if (inputStyle?.focus === "glow") focusRingWidth = "3";
|
|
1328
|
-
else if (inputStyle?.focus === "underline") focusRingWidth = "0";
|
|
1329
|
-
else if (axes.energy === "vibrant" || axes.conversionBias === "high") focusRingWidth = "2";
|
|
1330
|
-
else focusRingWidth = "1";
|
|
1331
|
-
return {
|
|
1332
|
-
base: {
|
|
1333
|
-
background: {
|
|
1334
|
-
type: "solid",
|
|
1335
|
-
colorToken: "surface"
|
|
1336
|
-
},
|
|
1337
|
-
textColorToken: "text",
|
|
1338
|
-
border: {
|
|
1339
|
-
widthClass: borderWidthClass,
|
|
1340
|
-
colorToken: "border",
|
|
1341
|
-
...borderStyle && { style: borderStyle }
|
|
1342
|
-
},
|
|
1343
|
-
corners: inputCorners,
|
|
1344
|
-
shadow: inputShadow,
|
|
1345
|
-
spacing,
|
|
1346
|
-
fontSize
|
|
1347
|
-
},
|
|
1348
|
-
label: {
|
|
1349
|
-
textColorToken: "text",
|
|
1350
|
-
fontWeight: labelFontWeight,
|
|
1351
|
-
fontSize: labelFontSize
|
|
1352
|
-
},
|
|
1353
|
-
focus: {
|
|
1354
|
-
ringColorToken: "primary",
|
|
1355
|
-
ringWidth: focusRingWidth,
|
|
1356
|
-
borderColorToken: "primary"
|
|
1357
|
-
},
|
|
1358
|
-
error: {
|
|
1359
|
-
borderColorToken: "error",
|
|
1360
|
-
textColorToken: "error"
|
|
1361
|
-
},
|
|
1362
|
-
disabled: {
|
|
1363
|
-
backgroundColorToken: "neutral-100",
|
|
1364
|
-
textColorToken: "neutral-400",
|
|
1365
|
-
opacity: .6
|
|
1366
|
-
}
|
|
1367
|
-
};
|
|
1368
|
-
}
|
|
1369
|
-
//#endregion
|
|
1370
|
-
//#region ../theme-core/src/layout/boundaryCss.ts
|
|
1371
|
-
/**
|
|
1372
|
-
* Section-break CSS, generated from the transition catalogue (issue 1422).
|
|
1373
|
-
*
|
|
1374
|
-
* The renderer emits one element per shown join:
|
|
1375
|
-
*
|
|
1376
|
-
* <div data-block-boundary data-boundary-treatment="wave-edge-gentle"
|
|
1377
|
-
* data-boundary-placement="previous"
|
|
1378
|
-
* style="--boundary-shape-paint: …; --boundary-band-paint: …">
|
|
1379
|
-
*
|
|
1380
|
-
* Every selector matches an exact attribute value, so there is no reliance on
|
|
1381
|
-
* prefix ordering in the cascade and nothing reads colours out of a string.
|
|
1382
|
-
* The shape layer is `::after`; the band layer (paint → paint only) is
|
|
1383
|
-
* `::before`.
|
|
1384
|
-
*/
|
|
1385
|
-
const waveMaskSvgPaths = {
|
|
1386
|
-
classic: "M0 72V46C130 55 260 24 420 30C590 36 690 62 860 42C1035 21 1160 47 1305 36C1365 31 1415 33 1440 38V72H0Z",
|
|
1387
|
-
balanced: "M0 72V42C120 24 240 24 360 42C480 60 600 60 720 42C840 24 960 24 1080 42C1200 60 1320 60 1440 42V72H0Z",
|
|
1388
|
-
gentle: "M0 72V43C180 32 300 32 480 43C660 54 780 54 960 43C1140 32 1260 32 1440 43V72H0Z",
|
|
1389
|
-
bold: "M0 72V44C90 14 270 14 360 44C450 74 630 74 720 44C810 14 990 14 1080 44C1170 74 1350 74 1440 44V72H0Z",
|
|
1390
|
-
drift: "M0 72V39C115 31 205 54 340 48C505 41 610 16 760 33C920 51 1015 64 1160 44C1280 27 1375 35 1440 50V72H0Z"
|
|
1391
|
-
};
|
|
1392
|
-
function waveMaskDataUrl(mask) {
|
|
1393
|
-
return svgDataUrl(`<svg viewBox='0 0 1440 72' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'><path d='${waveMaskSvgPaths[mask]}' fill='white'/></svg>`);
|
|
1394
|
-
}
|
|
1395
|
-
/**
|
|
1396
|
-
* How each placement anchors the layers against the zero-height boundary
|
|
1397
|
-
* element that sits exactly on the join.
|
|
1398
|
-
*
|
|
1399
|
-
* - `centred` straddles the join, band under shape.
|
|
1400
|
-
* - `previous` sits above the join, inside the previous section.
|
|
1401
|
-
* - `next` sits below the join, inside the next section, with the shape
|
|
1402
|
-
* flipped so it reads as the mirror of `previous`.
|
|
1403
|
-
*/
|
|
1404
|
-
const placementRules = {
|
|
1405
|
-
centred: {
|
|
1406
|
-
shape: ["top: 0;", "transform: translateY(-50%);"],
|
|
1407
|
-
band: ["top: 0;", "transform: translateY(-50%);"]
|
|
1408
|
-
},
|
|
1409
|
-
previous: {
|
|
1410
|
-
shape: ["bottom: 0;"],
|
|
1411
|
-
band: null
|
|
1412
|
-
},
|
|
1413
|
-
next: {
|
|
1414
|
-
shape: ["top: 0;", "transform: scaleY(-1);"],
|
|
1415
|
-
band: null
|
|
1416
|
-
}
|
|
1417
|
-
};
|
|
1418
|
-
function generateBoundaryCss(selector) {
|
|
1419
|
-
const boundary = `${selector} [data-block-boundary]`;
|
|
1420
|
-
return [
|
|
1421
|
-
rule$1(boundary, [
|
|
1422
|
-
"position: relative;",
|
|
1423
|
-
"z-index: 3;",
|
|
1424
|
-
"height: 0;",
|
|
1425
|
-
"pointer-events: none;"
|
|
1426
|
-
]),
|
|
1427
|
-
rule$1(`${selector} [data-block][data-site-style-boundary-before] > :where([data-slot='section'])`, ["padding-top: calc(var(--rb-section-pad-y, 0rem) + var(--site-style-boundary-before-reserve, 0rem));"]),
|
|
1428
|
-
rule$1(`${selector} [data-block][data-site-style-boundary-after] > :where([data-slot='section'])`, ["padding-bottom: calc(var(--rb-section-pad-y, 0rem) + var(--site-style-boundary-after-reserve, 0rem));"]),
|
|
1429
|
-
rule$1(`${boundary}::before,\n${boundary}::after`, [
|
|
1430
|
-
"content: '';",
|
|
1431
|
-
"position: absolute;",
|
|
1432
|
-
"left: 0;",
|
|
1433
|
-
"right: 0;",
|
|
1434
|
-
"height: var(--boundary-height);",
|
|
1435
|
-
"pointer-events: none;"
|
|
1436
|
-
]),
|
|
1437
|
-
rule$1(`${boundary}::before`, ["z-index: 0;", "background: var(--boundary-band-paint, transparent);"]),
|
|
1438
|
-
rule$1(`${boundary}::after`, ["z-index: 1;"]),
|
|
1439
|
-
...placementCss(boundary),
|
|
1440
|
-
...transitionCatalogueEntries.flatMap((entry) => treatmentCss(boundary, entry))
|
|
1441
|
-
].join("\n\n");
|
|
1442
|
-
}
|
|
1443
|
-
function placementCss(boundary) {
|
|
1444
|
-
return Object.keys(placementRules).flatMap((placement) => {
|
|
1445
|
-
const placed = `${boundary}[data-boundary-placement='${placement}']`;
|
|
1446
|
-
const rules = placementRules[placement];
|
|
1447
|
-
return [rule$1(`${placed}::after`, rules.shape), rules.band ? rule$1(`${placed}::before`, rules.band) : rule$1(`${placed}::before`, ["content: none;"])];
|
|
1448
|
-
});
|
|
1449
|
-
}
|
|
1450
|
-
function treatmentCss(boundary, entry) {
|
|
1451
|
-
const selected = `${boundary}[data-boundary-treatment='${entry.intent}']`;
|
|
1452
|
-
return [rule$1(selected, [`--boundary-height: ${boundaryRuntimeMetricsForDecorativeTransition(entry.intent).heightCss};`]), rule$1(`${selected}::after`, shapeDeclarations(entry))];
|
|
1453
|
-
}
|
|
1454
|
-
function shapeDeclarations(entry) {
|
|
1455
|
-
switch (entry.shape.kind) {
|
|
1456
|
-
case "fade": return [
|
|
1457
|
-
"/* Fallback for browsers without color-mix(). */",
|
|
1458
|
-
"background: linear-gradient(to bottom, transparent 0%, var(--boundary-shape-paint) 100%);",
|
|
1459
|
-
"background: linear-gradient(to bottom, transparent 0%, color-mix(in srgb, var(--boundary-shape-paint) 16%, transparent) 34%, color-mix(in srgb, var(--boundary-shape-paint) 68%, transparent) 78%, var(--boundary-shape-paint) 100%);"
|
|
1460
|
-
];
|
|
1461
|
-
case "wave": {
|
|
1462
|
-
const mask = waveMaskDataUrl(entry.shape.mask);
|
|
1463
|
-
return [
|
|
1464
|
-
"background: var(--boundary-shape-paint);",
|
|
1465
|
-
`mask-image: url("${mask}");`,
|
|
1466
|
-
"mask-repeat: no-repeat;",
|
|
1467
|
-
"mask-size: 100% 100%;",
|
|
1468
|
-
`-webkit-mask-image: url("${mask}");`,
|
|
1469
|
-
"-webkit-mask-repeat: no-repeat;",
|
|
1470
|
-
"-webkit-mask-size: 100% 100%;"
|
|
1471
|
-
];
|
|
1472
|
-
}
|
|
1473
|
-
case "angle": return [
|
|
1474
|
-
"height: calc(var(--boundary-height) + 2px);",
|
|
1475
|
-
"background: var(--boundary-shape-paint);",
|
|
1476
|
-
`clip-path: ${anglePolygonCss(entry.shape.polygon)};`
|
|
1477
|
-
];
|
|
1478
|
-
}
|
|
1479
|
-
}
|
|
1480
|
-
function rule$1(selector, declarations) {
|
|
1481
|
-
return `${selector} {\n ${declarations.join("\n ")}\n}`;
|
|
1482
|
-
}
|
|
1483
|
-
function svgDataUrl(svg) {
|
|
1484
|
-
return `data:image/svg+xml,${encodeURIComponent(svg)}`;
|
|
1485
|
-
}
|
|
1486
|
-
//#endregion
|
|
1487
|
-
//#region ../theme-core/src/layout/generateLayoutCss.ts
|
|
1488
|
-
/**
|
|
1489
|
-
* Generate layout CSS for theme scope (background, text color)
|
|
1490
|
-
*
|
|
1491
|
-
* This applies base layout styles to the theme-scope container using the
|
|
1492
|
-
* --tb-* CSS variables (not Tailwind color classes, to avoid conflicts with SDK sites).
|
|
1493
|
-
*/
|
|
1494
|
-
function generateLayoutCss(options) {
|
|
1495
|
-
const { themeId, theme } = options;
|
|
1496
|
-
const selector = `:where([data-theme-scope="${themeId}"])`;
|
|
1497
|
-
const rootRules = [];
|
|
1498
|
-
const cssChunks = [];
|
|
1499
|
-
const containerSelector = `${selector} .rb-container,\n${selector} .rb-container-full`;
|
|
1500
|
-
const containerPadding = theme.layout?.containerPadding;
|
|
1501
|
-
rootRules.push(`background-color: rgb(var(--tb-background));`);
|
|
1502
|
-
rootRules.push(`color: rgb(var(--tb-text));`);
|
|
1503
|
-
cssChunks.push(`${selector} {\n ${rootRules.join("\n ")}\n}`);
|
|
1504
|
-
if (containerPadding?.mobile) cssChunks.push(`${containerSelector} {\n padding-left: ${toPaddingValue(containerPadding.mobile)};\n padding-right: ${toPaddingValue(containerPadding.mobile)};\n}`);
|
|
1505
|
-
if (containerPadding?.tablet) cssChunks.push(`@media ${MQ_SM_UP} {\n ${containerSelector} {\n padding-left: ${toPaddingValue(containerPadding.tablet)};\n padding-right: ${toPaddingValue(containerPadding.tablet)};\n }\n}`);
|
|
1506
|
-
if (containerPadding?.desktop) cssChunks.push(`@media ${MQ_LG_UP} {\n ${containerSelector} {\n padding-left: ${toPaddingValue(containerPadding.desktop)};\n padding-right: ${toPaddingValue(containerPadding.desktop)};\n }\n}`);
|
|
1507
|
-
const heroTypographyCss = generateHeroTypographyCss(themeId, theme);
|
|
1508
|
-
if (heroTypographyCss) cssChunks.push(heroTypographyCss);
|
|
1509
|
-
const bodyTextTypographyCss = generateBodyTextTypographyCss(themeId, theme);
|
|
1510
|
-
if (bodyTextTypographyCss) cssChunks.push(bodyTextTypographyCss);
|
|
1511
|
-
cssChunks.push(generateBoundaryCss(selector));
|
|
1512
|
-
return cssChunks.join("\n\n");
|
|
1513
|
-
}
|
|
1514
|
-
function toPaddingValue(preset) {
|
|
1515
|
-
return {
|
|
1516
|
-
tight: "0.5rem",
|
|
1517
|
-
compact: "0.75rem",
|
|
1518
|
-
default: "1rem",
|
|
1519
|
-
relaxed: "1.5rem"
|
|
1520
|
-
}[preset];
|
|
1521
|
-
}
|
|
1522
|
-
function generateHeroTypographyCss(themeId, theme) {
|
|
1523
|
-
const typography = theme.hero?.typography;
|
|
1524
|
-
if (!typography) return "";
|
|
1525
|
-
const rootSelector = `:where([data-theme-scope="${themeId}"]) :where([data-block="hero"])`;
|
|
1526
|
-
const headlineSelector = `${rootSelector} .hero-headline`;
|
|
1527
|
-
const subheadlineSelector = `${rootSelector} .hero-subheadline`;
|
|
1528
|
-
const microSelector = `${rootSelector}[data-block-variant="micro"]`;
|
|
1529
|
-
const microHeadlineSelector = `${microSelector} .hero-headline`;
|
|
1530
|
-
const microSubheadlineSelector = `${microSelector} .hero-subheadline`;
|
|
1531
|
-
const chunks = [];
|
|
1532
|
-
const headlineRules = buildTypographyRules("headline", typography.headlineSize, typography.headlineLineHeight);
|
|
1533
|
-
if (headlineRules.length > 0) chunks.push(`${headlineSelector} {\n ${headlineRules.join("\n ")}\n}`);
|
|
1534
|
-
const subheadlineRules = buildTypographyRules("subheadline", typography.subheadlineSize, typography.subheadlineLineHeight);
|
|
1535
|
-
if (subheadlineRules.length > 0) chunks.push(`${subheadlineSelector} {\n ${subheadlineRules.join("\n ")}\n}`);
|
|
1536
|
-
const microHeadlineRules = buildTypographyRules("headline", typography.microHeadlineSize, typography.microHeadlineLineHeight);
|
|
1537
|
-
if (microHeadlineRules.length > 0) chunks.push(`${microHeadlineSelector} {\n ${microHeadlineRules.join("\n ")}\n}`);
|
|
1538
|
-
const microSubheadlineRules = buildTypographyRules("subheadline", typography.microSubheadlineSize, typography.microSubheadlineLineHeight);
|
|
1539
|
-
if (microSubheadlineRules.length > 0) chunks.push(`${microSubheadlineSelector} {\n ${microSubheadlineRules.join("\n ")}\n}`);
|
|
1540
|
-
const selectors = {
|
|
1541
|
-
headline: headlineSelector,
|
|
1542
|
-
subheadline: subheadlineSelector
|
|
1543
|
-
};
|
|
1544
|
-
const responsiveChunks = [responsiveHeroTypographyCss(MQ_TABLET_ONLY, selectors, typography.responsive?.tablet), responsiveHeroTypographyCss(MQ_SM_DOWN, selectors, typography.responsive?.mobile)];
|
|
1545
|
-
for (const chunk of responsiveChunks) if (chunk) chunks.push(chunk);
|
|
1546
|
-
return chunks.join("\n\n");
|
|
1547
|
-
}
|
|
1548
|
-
function responsiveHeroTypographyCss(media, selectors, overrides) {
|
|
1549
|
-
if (!overrides) return null;
|
|
1550
|
-
const headlineRules = buildTypographyRules("headline", overrides.headlineSize, overrides.headlineLineHeight);
|
|
1551
|
-
const subheadlineRules = buildTypographyRules("subheadline", overrides.subheadlineSize, overrides.subheadlineLineHeight);
|
|
1552
|
-
const mediaChunks = [];
|
|
1553
|
-
if (headlineRules.length > 0) mediaChunks.push(`${selectors.headline} {\n ${headlineRules.join("\n ")}\n }`);
|
|
1554
|
-
if (subheadlineRules.length > 0) mediaChunks.push(`${selectors.subheadline} {\n ${subheadlineRules.join("\n ")}\n }`);
|
|
1555
|
-
return mediaChunks.length > 0 ? `@media ${media} {\n ${mediaChunks.join("\n\n ")}\n}` : null;
|
|
1556
|
-
}
|
|
1557
|
-
function buildTypographyRules(role, size, lineHeight) {
|
|
1558
|
-
const rules = [];
|
|
1559
|
-
if (size) rules.push(`font-size: ${toHeroSize(role, size)};`);
|
|
1560
|
-
if (lineHeight) rules.push(`line-height: ${toHeroLineHeight(lineHeight)};`);
|
|
1561
|
-
return rules;
|
|
1562
|
-
}
|
|
1563
|
-
function generateBodyTextTypographyCss(themeId, theme) {
|
|
1564
|
-
const intro = theme.bodyText?.intro;
|
|
1565
|
-
if (!intro) return "";
|
|
1566
|
-
const rootSelector = `:where([data-theme-scope="${themeId}"]) :where([data-block="body-text"][data-block-variant="intro"])`;
|
|
1567
|
-
const chunks = [];
|
|
1568
|
-
if (intro.headingSize === "editorial") chunks.push(`${rootSelector} .body-copy-heading {
|
|
1569
|
-
font-size: clamp(1.75rem, 1.15rem + 2.2vw, 3rem);
|
|
1570
|
-
line-height: 1.08;
|
|
1571
|
-
}`);
|
|
1572
|
-
if (intro.paragraphSize === "editorial") chunks.push(`${rootSelector} .body-copy-body {
|
|
1573
|
-
--rb-prose-lg-font-size: clamp(1.35rem, 1.05rem + 1.3vw, 2rem);
|
|
1574
|
-
--rb-prose-lg-line-height: 1.55;
|
|
1575
|
-
--rb-prose-xl-sm-font-size: clamp(1.45rem, 1.1rem + 1.4vw, 2rem);
|
|
1576
|
-
--rb-prose-xl-sm-line-height: 1.55;
|
|
1577
|
-
}`);
|
|
1578
|
-
return chunks.join("\n\n");
|
|
1579
|
-
}
|
|
1580
|
-
function toHeroSize(role, size) {
|
|
1581
|
-
const baseMap = {
|
|
1582
|
-
sm: "0.875rem",
|
|
1583
|
-
base: "1rem",
|
|
1584
|
-
lg: "1.125rem",
|
|
1585
|
-
xl: "1.25rem",
|
|
1586
|
-
"2xl": "1.5rem",
|
|
1587
|
-
"3xl": "1.875rem",
|
|
1588
|
-
"4xl": "2.25rem",
|
|
1589
|
-
"5xl": "3rem",
|
|
1590
|
-
"6xl": "3.75rem"
|
|
1591
|
-
};
|
|
1592
|
-
if (size !== "editorial") return baseMap[size];
|
|
1593
|
-
return role === "subheadline" ? "clamp(1.0625rem, 1.4vw, 1.375rem)" : "clamp(1.25rem, 3vw, 2.25rem)";
|
|
1594
|
-
}
|
|
1595
|
-
function toHeroLineHeight(lineHeight) {
|
|
1596
|
-
return {
|
|
1597
|
-
tight: "1.1",
|
|
1598
|
-
snug: "1.25",
|
|
1599
|
-
normal: "1.4",
|
|
1600
|
-
relaxed: "1.6"
|
|
1601
|
-
}[lineHeight];
|
|
1602
|
-
}
|
|
1603
|
-
//#endregion
|
|
1604
789
|
//#region ../theme-core/src/status/generateStatusCss.ts
|
|
1605
790
|
/**
|
|
1606
791
|
* Corner radius map - derives alert border-radius from theme.corners
|
|
@@ -1984,20 +1169,6 @@ function smallHeadingCss(root, role) {
|
|
|
1984
1169
|
}`;
|
|
1985
1170
|
}
|
|
1986
1171
|
//#endregion
|
|
1987
|
-
//#region ../theme-core/src/event-calendar/generateEventCalendarCss.ts
|
|
1988
|
-
/**
|
|
1989
|
-
* @deprecated Use blocks-static/index.css with CSS variables instead.
|
|
1990
|
-
*
|
|
1991
|
-
* CSS for event calendar classes is now in:
|
|
1992
|
-
* - packages/blocks/src/theme/blocks-static/index.css (static rule bodies)
|
|
1993
|
-
* - packages/blocks/src/theme/blocks/vars/event-calendar.ts (Tier 3 vars)
|
|
1994
|
-
*
|
|
1995
|
-
* Returns an empty string for backwards compatibility.
|
|
1996
|
-
*/
|
|
1997
|
-
function generateEventCalendarCss(_params) {
|
|
1998
|
-
return "";
|
|
1999
|
-
}
|
|
2000
|
-
//#endregion
|
|
2001
1172
|
//#region ../theme-core/src/blocks/vars/event-registration.ts
|
|
2002
1173
|
/**
|
|
2003
1174
|
* Generate CSS variables for the event-registration block.
|
|
@@ -2677,688 +1848,6 @@ function compileRule(selector, declarations, scopePrefix) {
|
|
|
2677
1848
|
return `${prefixSelector(selector, scopePrefix)} {\n${declarationLines}\n}`;
|
|
2678
1849
|
}
|
|
2679
1850
|
//#endregion
|
|
2680
|
-
//#region ../theme-core/src/customCss/compileAtRules.ts
|
|
2681
|
-
/**
|
|
2682
|
-
* Compile an array of CSS at-rules to a CSS string.
|
|
2683
|
-
*
|
|
2684
|
-
* @param atRules - Array of at-rules
|
|
2685
|
-
* @param themeId - Theme scope ID for selector prefixing in @media/@supports
|
|
2686
|
-
* @returns Compiled CSS string
|
|
2687
|
-
*/
|
|
2688
|
-
function compileCustomCssAtRules(atRules, themeId, options) {
|
|
2689
|
-
if (!atRules || atRules.length === 0) return "";
|
|
2690
|
-
const scopePrefix = `:where([data-theme-scope="${themeId}"])`;
|
|
2691
|
-
const responsiveMode = options?.responsiveMode ?? "viewport";
|
|
2692
|
-
const containerName = options?.containerName ?? "rb-site";
|
|
2693
|
-
return atRules.map((atRule) => compileAtRule(atRule, scopePrefix, {
|
|
2694
|
-
responsiveMode,
|
|
2695
|
-
containerName
|
|
2696
|
-
})).filter(Boolean).join("\n\n");
|
|
2697
|
-
}
|
|
2698
|
-
/**
|
|
2699
|
-
* Compile a single at-rule based on its type.
|
|
2700
|
-
*/
|
|
2701
|
-
function compileAtRule(atRule, scopePrefix, options) {
|
|
2702
|
-
switch (atRule.type) {
|
|
2703
|
-
case "keyframes": return compileKeyframes(atRule);
|
|
2704
|
-
case "font-face": return compileFontFace(atRule);
|
|
2705
|
-
case "media": return compileMedia(atRule, scopePrefix, options);
|
|
2706
|
-
case "supports": return compileSupports(atRule, scopePrefix);
|
|
2707
|
-
case "raw": return compileRaw(atRule);
|
|
2708
|
-
}
|
|
2709
|
-
}
|
|
2710
|
-
/**
|
|
2711
|
-
* Compile @keyframes rule.
|
|
2712
|
-
* Output is global (no scoping needed).
|
|
2713
|
-
*
|
|
2714
|
-
* @example
|
|
2715
|
-
* @keyframes fadeIn {
|
|
2716
|
-
* 0% { opacity: 0; }
|
|
2717
|
-
* 100% { opacity: 1; }
|
|
2718
|
-
* }
|
|
2719
|
-
*/
|
|
2720
|
-
function compileKeyframes(atRule) {
|
|
2721
|
-
const framesCss = atRule.frames.map((frame) => {
|
|
2722
|
-
const declarations = compileDeclarations(frame.declarations);
|
|
2723
|
-
return ` ${frame.offset} {\n${indent(declarations, 4)}\n }`;
|
|
2724
|
-
}).join("\n");
|
|
2725
|
-
return `@keyframes ${atRule.name} {\n${framesCss}\n}`;
|
|
2726
|
-
}
|
|
2727
|
-
/**
|
|
2728
|
-
* Compile @font-face rule.
|
|
2729
|
-
* Output is global (no scoping needed).
|
|
2730
|
-
*
|
|
2731
|
-
* @example
|
|
2732
|
-
* @font-face {
|
|
2733
|
-
* font-family: MyFont;
|
|
2734
|
-
* src: url(/fonts/myfont.woff2) format("woff2");
|
|
2735
|
-
* }
|
|
2736
|
-
*/
|
|
2737
|
-
function compileFontFace(atRule) {
|
|
2738
|
-
return `@font-face {\n${indent(compileDeclarations(atRule.declarations), 2)}\n}`;
|
|
2739
|
-
}
|
|
2740
|
-
/**
|
|
2741
|
-
* Compile @media rule with scoped selectors.
|
|
2742
|
-
* Returns empty string if all nested rules filter out.
|
|
2743
|
-
*
|
|
2744
|
-
* @example
|
|
2745
|
-
* @media (max-width: 768px) {
|
|
2746
|
-
* :where([data-theme-scope="..."]) .hero { font-size: 24px; }
|
|
2747
|
-
* }
|
|
2748
|
-
*/
|
|
2749
|
-
function compileMedia(atRule, scopePrefix, options) {
|
|
2750
|
-
const rules = atRule.rules.map((rule) => compileNestedRule(rule.selector, rule.declarations, scopePrefix)).filter(Boolean).join("\n");
|
|
2751
|
-
if (!rules) return "";
|
|
2752
|
-
const containerQuery = options.responsiveMode === "container" ? convertMediaQueryToContainerQuery(atRule.query) : null;
|
|
2753
|
-
if (containerQuery) return `@container ${options.containerName} ${containerQuery} {\n${indent(rules, 2)}\n}`;
|
|
2754
|
-
return `@media ${atRule.query} {\n${indent(rules, 2)}\n}`;
|
|
2755
|
-
}
|
|
2756
|
-
/**
|
|
2757
|
-
* Compile @supports rule with scoped selectors.
|
|
2758
|
-
* Returns empty string if all nested rules filter out.
|
|
2759
|
-
*
|
|
2760
|
-
* @example
|
|
2761
|
-
* @supports (display: grid) {
|
|
2762
|
-
* :where([data-theme-scope="..."]) .container { display: grid; }
|
|
2763
|
-
* }
|
|
2764
|
-
*/
|
|
2765
|
-
function compileSupports(atRule, scopePrefix) {
|
|
2766
|
-
const rules = atRule.rules.map((rule) => compileNestedRule(rule.selector, rule.declarations, scopePrefix)).filter(Boolean).join("\n");
|
|
2767
|
-
if (!rules) return "";
|
|
2768
|
-
return `@supports ${atRule.condition} {\n${indent(rules, 2)}\n}`;
|
|
2769
|
-
}
|
|
2770
|
-
/**
|
|
2771
|
-
* Compile raw at-rule (output as-is with XSS protection).
|
|
2772
|
-
*/
|
|
2773
|
-
function compileRaw(atRule) {
|
|
2774
|
-
return escapeStyleContent(atRule.css.trim());
|
|
2775
|
-
}
|
|
2776
|
-
/**
|
|
2777
|
-
* Compile a nested rule (for @media/@supports) with scoped selector.
|
|
2778
|
-
*/
|
|
2779
|
-
function compileNestedRule(selector, declarations, scopePrefix) {
|
|
2780
|
-
const declarationsStr = compileDeclarations(declarations);
|
|
2781
|
-
if (!declarationsStr) return "";
|
|
2782
|
-
return `${prefixSelector(selector, scopePrefix)} {\n${indent(declarationsStr, 2)}\n}`;
|
|
2783
|
-
}
|
|
2784
|
-
/**
|
|
2785
|
-
* Compile declarations object to CSS string.
|
|
2786
|
-
* Converts camelCase properties to kebab-case.
|
|
2787
|
-
*/
|
|
2788
|
-
function compileDeclarations(declarations) {
|
|
2789
|
-
return Object.entries(declarations).map(([prop, value]) => `${toKebabCase(prop)}: ${value};`).join("\n");
|
|
2790
|
-
}
|
|
2791
|
-
/**
|
|
2792
|
-
* Indent a string by a number of spaces.
|
|
2793
|
-
*/
|
|
2794
|
-
function indent(str, spaces) {
|
|
2795
|
-
const pad = " ".repeat(spaces);
|
|
2796
|
-
return str.split("\n").map((line) => line ? pad + line : line).join("\n");
|
|
2797
|
-
}
|
|
2798
|
-
//#endregion
|
|
2799
|
-
//#region ../theme-core/src/runtime/buildThemeRuntime.ts
|
|
2800
|
-
function buildThemeRuntime(theme, options) {
|
|
2801
|
-
const hydrated = hydrateTheme(theme);
|
|
2802
|
-
const cssVars = buildThemeCssVars(hydrated);
|
|
2803
|
-
const themeId = options?.themeId ?? "theme-default";
|
|
2804
|
-
const responsiveMode = options?.responsiveMode ?? "viewport";
|
|
2805
|
-
const solvedInks = "publish";
|
|
2806
|
-
const buttonOptions = {
|
|
2807
|
-
themeId,
|
|
2808
|
-
theme,
|
|
2809
|
-
buttonSystem: theme.buttons
|
|
2810
|
-
};
|
|
2811
|
-
const buttonCss = `${generateButtonCss(buttonOptions)}\n${generateButtonActionLayoutCss(buttonOptions)}`;
|
|
2812
|
-
const headerCss = generateHeaderCss({
|
|
2813
|
-
themeId,
|
|
2814
|
-
theme,
|
|
2815
|
-
responsiveMode,
|
|
2816
|
-
solvedInks
|
|
2817
|
-
});
|
|
2818
|
-
const footerCss = generateFooterCss({
|
|
2819
|
-
themeId,
|
|
2820
|
-
theme
|
|
2821
|
-
});
|
|
2822
|
-
const cardCss = [generateCardCss({
|
|
2823
|
-
themeId,
|
|
2824
|
-
theme,
|
|
2825
|
-
cardSystem: theme.cards,
|
|
2826
|
-
solvedInks
|
|
2827
|
-
}), generateOpaquePanelCss({
|
|
2828
|
-
themeId,
|
|
2829
|
-
surface: opaqueSurfaceContextFromTheme(theme),
|
|
2830
|
-
bookingBar: theme.skinBookingBar
|
|
2831
|
-
})].join("\n\n");
|
|
2832
|
-
const accordionCss = generateAccordionCss({
|
|
2833
|
-
themeId,
|
|
2834
|
-
theme,
|
|
2835
|
-
accordionSystem: theme.accordions ?? generateDefaultAccordionSystem(theme),
|
|
2836
|
-
solvedInks
|
|
2837
|
-
});
|
|
2838
|
-
const inputCss = generateInputCss({
|
|
2839
|
-
themeId,
|
|
2840
|
-
theme,
|
|
2841
|
-
inputSystem: resolveThemeInputSystem(theme)
|
|
2842
|
-
});
|
|
2843
|
-
const layoutCss = generateLayoutCss({
|
|
2844
|
-
themeId,
|
|
2845
|
-
theme
|
|
2846
|
-
});
|
|
2847
|
-
const statusCss = generateStatusCss({
|
|
2848
|
-
themeId,
|
|
2849
|
-
theme,
|
|
2850
|
-
palette: hydrated.palette
|
|
2851
|
-
});
|
|
2852
|
-
const progressCss = generateProgressCss({
|
|
2853
|
-
themeId,
|
|
2854
|
-
theme
|
|
2855
|
-
});
|
|
2856
|
-
const typographyCss = generateTypographyCss({
|
|
2857
|
-
themeId,
|
|
2858
|
-
theme
|
|
2859
|
-
});
|
|
2860
|
-
const eventCalendarCss = generateEventCalendarCss({
|
|
2861
|
-
themeId,
|
|
2862
|
-
theme
|
|
2863
|
-
});
|
|
2864
|
-
const blockVarsCss = [generateThemeBlockVarsCss(theme, themeId), generateBlockOverrideCss(themeId, theme)].filter(Boolean).join("\n");
|
|
2865
|
-
const blockCustomVarsCss = generateBlockCustomVarsCss(themeId, theme.blockCustomVars);
|
|
2866
|
-
const atRulesCss = theme.customCssAtRules ? compileCustomCssAtRules(theme.customCssAtRules, themeId, { responsiveMode }) : void 0;
|
|
2867
|
-
const customCss = theme.customCssRules ? compileCustomCssRules(parseCustomCssRules(theme.customCssRules), themeId) : void 0;
|
|
2868
|
-
const blockCustomCss = theme.blockCustomCssRules ? compileBlockCustomCssRules(parseBlockCustomCssRules(theme.blockCustomCssRules), themeId) : void 0;
|
|
2869
|
-
return {
|
|
2870
|
-
hydrated,
|
|
2871
|
-
cssVars,
|
|
2872
|
-
tokens: {
|
|
2873
|
-
...buildThemeTokens(hydrated.palette),
|
|
2874
|
-
solvedInks
|
|
2875
|
-
},
|
|
2876
|
-
paletteTokens: hydrated.palette,
|
|
2877
|
-
buttonCss,
|
|
2878
|
-
headerCss,
|
|
2879
|
-
footerCss,
|
|
2880
|
-
cardCss,
|
|
2881
|
-
accordionCss,
|
|
2882
|
-
inputCss,
|
|
2883
|
-
layoutCss,
|
|
2884
|
-
statusCss,
|
|
2885
|
-
progressCss,
|
|
2886
|
-
typographyCss,
|
|
2887
|
-
eventCalendarCss,
|
|
2888
|
-
blockVarsCss,
|
|
2889
|
-
blockCustomVarsCss,
|
|
2890
|
-
blockCustomCss,
|
|
2891
|
-
customCss,
|
|
2892
|
-
atRulesCss
|
|
2893
|
-
};
|
|
2894
|
-
}
|
|
2895
|
-
function hydrateTheme(theme) {
|
|
2896
|
-
return {
|
|
2897
|
-
...theme,
|
|
2898
|
-
palette: expandPalette(theme.palette, {
|
|
2899
|
-
arrangement: theme.skin !== void 0,
|
|
2900
|
-
marksFrom: theme.skinMarks
|
|
2901
|
-
})
|
|
2902
|
-
};
|
|
2903
|
-
}
|
|
2904
|
-
function pageSurfaceInks(palette) {
|
|
2905
|
-
return surfaceInkStyle(surfaceInkPublication(resolveSurfaceForeground({
|
|
2906
|
-
type: "color",
|
|
2907
|
-
color: "background",
|
|
2908
|
-
textColor: "text"
|
|
2909
|
-
}, palette), "publish"));
|
|
2910
|
-
}
|
|
2911
|
-
function resolveThemeInputSystem(theme) {
|
|
2912
|
-
return theme.inputs ?? generateDefaultInputSystem(theme);
|
|
2913
|
-
}
|
|
2914
|
-
function buildThemeCssVars(theme) {
|
|
2915
|
-
const { typography, space, shadow, motion, border } = theme;
|
|
2916
|
-
const sized = applyHeadingSizeOverrides(computeTypeScale(typography.scale, typography.body.size), typography);
|
|
2917
|
-
const inputSystem = resolveThemeInputSystem(theme);
|
|
2918
|
-
const blockRadius = mapBlockRadius(theme.corners);
|
|
2919
|
-
const buttonRadius = mapButtonRadius(theme.corners);
|
|
2920
|
-
const panelRadius = mapPanelRadius(theme.corners);
|
|
2921
|
-
const inputRadius = mapInputRadius(inputSystem.base.corners, theme.corners);
|
|
2922
|
-
return {
|
|
2923
|
-
...generateCssVars(theme.palette),
|
|
2924
|
-
...skinTokenCssVars(theme.skinTokens),
|
|
2925
|
-
["--tb-secondaryForeground"]: "var(--tb-onSecondary)",
|
|
2926
|
-
["--tb-accentForeground"]: "var(--tb-onAccent)",
|
|
2927
|
-
["--tb-scrim"]: "0 0 0",
|
|
2928
|
-
["--tb-shadow"]: "0 0 0",
|
|
2929
|
-
...generateShadowCssVars(theme),
|
|
2930
|
-
...pageSurfaceInks(theme.palette),
|
|
2931
|
-
...typographyFontRoleCssVars(typography),
|
|
2932
|
-
["--font-eyebrow"]: typography.eyebrow?.family ? formatFontFamily(typography.eyebrow.family) : "var(--font-body)",
|
|
2933
|
-
...typography.eyebrow?.size ? { ["--fs-eyebrow"]: mapEyebrowSize(typography.eyebrow.size) } : {},
|
|
2934
|
-
...typography.eyebrow?.weight ? { ["--fw-eyebrow"]: mapWeight(typography.eyebrow.weight) } : {},
|
|
2935
|
-
...typography.eyebrow?.letterSpacing ? { ["--ls-eyebrow"]: mapEyebrowLetterSpacing(typography.eyebrow.letterSpacing) } : {},
|
|
2936
|
-
...typography.eyebrow?.case ? { ["--tt-eyebrow"]: mapEyebrowCase(typography.eyebrow.case) } : {},
|
|
2937
|
-
["--font-weight-heading"]: mapWeight(typography.headings.default.weight),
|
|
2938
|
-
["--font-weight-body"]: mapWeight(typography.body.weight),
|
|
2939
|
-
...typography.headings.h1.weight ? { ["--fw-h1"]: mapWeight(typography.headings.h1.weight) } : {},
|
|
2940
|
-
...typography.headings.h2.weight ? { ["--fw-h2"]: mapWeight(typography.headings.h2.weight) } : {},
|
|
2941
|
-
...typography.headings.h3.weight ? { ["--fw-h3"]: mapWeight(typography.headings.h3.weight) } : {},
|
|
2942
|
-
...typography.headings.h4?.weight ? { ["--fw-h4"]: mapWeight(typography.headings.h4.weight) } : {},
|
|
2943
|
-
...typography.headings.h5?.weight ? { ["--fw-h5"]: mapWeight(typography.headings.h5.weight) } : {},
|
|
2944
|
-
...typography.headings.h6?.weight ? { ["--fw-h6"]: mapWeight(typography.headings.h6.weight) } : {},
|
|
2945
|
-
["--ls-heading"]: mapLetterSpacing(typography.headings.default.letterSpacing),
|
|
2946
|
-
["--ls-body"]: mapLetterSpacing(typography.body.letterSpacing),
|
|
2947
|
-
...typography.headings.h1.letterSpacing ? { ["--ls-h1"]: mapLetterSpacing(typography.headings.h1.letterSpacing) } : {},
|
|
2948
|
-
...typography.headings.h2.letterSpacing ? { ["--ls-h2"]: mapLetterSpacing(typography.headings.h2.letterSpacing) } : {},
|
|
2949
|
-
...typography.headings.h3.letterSpacing ? { ["--ls-h3"]: mapLetterSpacing(typography.headings.h3.letterSpacing) } : {},
|
|
2950
|
-
...typography.headings.h4?.letterSpacing ? { ["--ls-h4"]: mapLetterSpacing(typography.headings.h4.letterSpacing) } : {},
|
|
2951
|
-
...typography.headings.h5?.letterSpacing ? { ["--ls-h5"]: mapLetterSpacing(typography.headings.h5.letterSpacing) } : {},
|
|
2952
|
-
...typography.headings.h6?.letterSpacing ? { ["--ls-h6"]: mapLetterSpacing(typography.headings.h6.letterSpacing) } : {},
|
|
2953
|
-
["--lh-heading"]: mapHeadingLineHeight(typography.headings.default.lineHeight),
|
|
2954
|
-
["--lh-body"]: mapLineHeight(typography.body.lineHeight),
|
|
2955
|
-
...typography.headings.h1.lineHeight ? { ["--lh-h1"]: mapHeadingLineHeight(typography.headings.h1.lineHeight) } : {},
|
|
2956
|
-
...typography.headings.h2.lineHeight ? { ["--lh-h2"]: mapHeadingLineHeight(typography.headings.h2.lineHeight) } : {},
|
|
2957
|
-
...typography.headings.h3.lineHeight ? { ["--lh-h3"]: mapHeadingLineHeight(typography.headings.h3.lineHeight) } : {},
|
|
2958
|
-
...typography.headings.h4?.lineHeight ? { ["--lh-h4"]: mapHeadingLineHeight(typography.headings.h4.lineHeight) } : {},
|
|
2959
|
-
...typography.headings.h5?.lineHeight ? { ["--lh-h5"]: mapHeadingLineHeight(typography.headings.h5.lineHeight) } : {},
|
|
2960
|
-
...typography.headings.h6?.lineHeight ? { ["--lh-h6"]: mapHeadingLineHeight(typography.headings.h6.lineHeight) } : {},
|
|
2961
|
-
["--tt-heading"]: mapTextTransform(typography.headings.default.case),
|
|
2962
|
-
["--fv-heading"]: mapFontVariant(typography.headings.default.case),
|
|
2963
|
-
["--fi-heading"]: mapFontStyle(typography.headings.default.italic),
|
|
2964
|
-
...typography.headings.h1.italic != null ? { ["--fi-h1"]: mapFontStyle(typography.headings.h1.italic) } : {},
|
|
2965
|
-
...typography.headings.h2.italic != null ? { ["--fi-h2"]: mapFontStyle(typography.headings.h2.italic) } : {},
|
|
2966
|
-
...typography.headings.h3.italic != null ? { ["--fi-h3"]: mapFontStyle(typography.headings.h3.italic) } : {},
|
|
2967
|
-
...typography.headings.h4?.italic != null ? { ["--fi-h4"]: mapFontStyle(typography.headings.h4.italic) } : {},
|
|
2968
|
-
...typography.headings.h5?.italic != null ? { ["--fi-h5"]: mapFontStyle(typography.headings.h5.italic) } : {},
|
|
2969
|
-
...typography.headings.h6?.italic != null ? { ["--fi-h6"]: mapFontStyle(typography.headings.h6.italic) } : {},
|
|
2970
|
-
...typography.headings.default.colorToken ? { ["--hc-heading"]: rgbColorValue(typography.headings.default.colorToken) } : {},
|
|
2971
|
-
...typography.headings.h1.colorToken ? { ["--hc-h1"]: rgbColorValue(typography.headings.h1.colorToken) } : {},
|
|
2972
|
-
...typography.headings.h2.colorToken ? { ["--hc-h2"]: rgbColorValue(typography.headings.h2.colorToken) } : {},
|
|
2973
|
-
...typography.headings.h3.colorToken ? { ["--hc-h3"]: rgbColorValue(typography.headings.h3.colorToken) } : {},
|
|
2974
|
-
...typography.headings.h4?.colorToken ? { ["--hc-h4"]: rgbColorValue(typography.headings.h4.colorToken) } : {},
|
|
2975
|
-
...typography.headings.h5?.colorToken ? { ["--hc-h5"]: rgbColorValue(typography.headings.h5.colorToken) } : {},
|
|
2976
|
-
...typography.headings.h6?.colorToken ? { ["--hc-h6"]: rgbColorValue(typography.headings.h6.colorToken) } : {},
|
|
2977
|
-
...proseLinkStyleToCssVars(typography.proseLinkStyle),
|
|
2978
|
-
["--fs-body"]: sized.body,
|
|
2979
|
-
["--fs-h3"]: sized.h3,
|
|
2980
|
-
["--fs-h2"]: sized.h2,
|
|
2981
|
-
["--fs-h1"]: sized.h1,
|
|
2982
|
-
["--fs-h1-fluid"]: sized.h1Fluid,
|
|
2983
|
-
["--fs-h2-fluid"]: sized.h2Fluid,
|
|
2984
|
-
["--fs-h3-fluid"]: sized.h3Fluid,
|
|
2985
|
-
["--fs-h1-display"]: sized.h1Display,
|
|
2986
|
-
["--fs-h1-display-fluid"]: sized.h1DisplayFluid,
|
|
2987
|
-
["--shadow-elev"]: mapShadow(shadow.elevation, shadow.softness, shadow.position || "bottom", shadow.colorToken),
|
|
2988
|
-
["--space-mult"]: mapSpaceMult(space),
|
|
2989
|
-
["--motion-duration"]: mapMotionDuration(motion.level),
|
|
2990
|
-
["--motion-ease"]: mapMotionEasing(motion.easing ?? "standard"),
|
|
2991
|
-
["--rt-space-y"]: mapRhythm(space),
|
|
2992
|
-
[THEME_RADIUS_CSS_VARS.block]: blockRadius,
|
|
2993
|
-
[THEME_RADIUS_CSS_VARS.panel]: panelRadius,
|
|
2994
|
-
["--rb-block-transition"]: mapBlockTransition(motion.level),
|
|
2995
|
-
[THEME_RADIUS_CSS_VARS.button]: buttonRadius,
|
|
2996
|
-
["--rb-border-width"]: mapBorderWidth(border.width),
|
|
2997
|
-
["--rb-border-style"]: mapBorderStyle(border.style),
|
|
2998
|
-
[THEME_RADIUS_CSS_VARS.input]: inputRadius,
|
|
2999
|
-
["--rb-input-focus-width"]: `${inputSystem.focus.ringWidth}px`,
|
|
3000
|
-
["--rb-input-focus-color"]: rgbColorValue(inputSystem.focus.ringColorToken),
|
|
3001
|
-
[THEME_RADIUS_CSS_VARS.legacyCard]: blockRadius,
|
|
3002
|
-
[THEME_RADIUS_CSS_VARS.legacyControl]: inputRadius
|
|
3003
|
-
};
|
|
3004
|
-
}
|
|
3005
|
-
/** Font roles use one formatter and weight mapping; absent small headings add no variables. */
|
|
3006
|
-
function typographyFontRoleCssVars(typography) {
|
|
3007
|
-
return {
|
|
3008
|
-
"--font-heading": formatFontFamily(typography.headings.default.family),
|
|
3009
|
-
"--font-body": formatFontFamily(typography.body.family),
|
|
3010
|
-
...typography.smallHeading ? {
|
|
3011
|
-
"--font-small-heading": formatFontFamily(typography.smallHeading.family),
|
|
3012
|
-
"--fw-small-heading": mapWeight(typography.smallHeading.weight)
|
|
3013
|
-
} : {}
|
|
3014
|
-
};
|
|
3015
|
-
}
|
|
3016
|
-
function mapWeight(w) {
|
|
3017
|
-
return {
|
|
3018
|
-
light: 300,
|
|
3019
|
-
regular: 400,
|
|
3020
|
-
medium: 500,
|
|
3021
|
-
semibold: 600,
|
|
3022
|
-
bold: 700
|
|
3023
|
-
}[w];
|
|
3024
|
-
}
|
|
3025
|
-
function mapShadow(level, softness, position = "bottom", colorToken) {
|
|
3026
|
-
if (level === "none") return "none";
|
|
3027
|
-
const tintVar = colorToken ? cssVarValue(colorToken) : null;
|
|
3028
|
-
const shadowColor = (a) => tintVar ? `rgb(${tintVar} / ${a})` : `rgba(0,0,0,${a})`;
|
|
3029
|
-
const offset = {
|
|
3030
|
-
low: 2,
|
|
3031
|
-
medium: 4,
|
|
3032
|
-
high: 6
|
|
3033
|
-
}[level];
|
|
3034
|
-
const xOffset = position === "bottom-right" ? offset : 0;
|
|
3035
|
-
if (softness === "hard") return `${xOffset}px ${offset}px 0 0 ${shadowColor("1")}`;
|
|
3036
|
-
const soft = softness !== "crisp";
|
|
3037
|
-
switch (level) {
|
|
3038
|
-
case "low": return soft ? `${xOffset}px 1px 2px ${shadowColor(".06")}` : `${xOffset}px 1px 1px ${shadowColor(".12")}`;
|
|
3039
|
-
case "medium": return soft ? `${xOffset}px 10px 20px ${shadowColor(".08")}` : `${xOffset}px 6px 12px ${shadowColor(".16")}`;
|
|
3040
|
-
case "high": return soft ? `${xOffset}px 25px 50px ${shadowColor(".18")}` : `${xOffset}px 20px 30px ${shadowColor(".28")}`;
|
|
3041
|
-
}
|
|
3042
|
-
}
|
|
3043
|
-
function mapSpaceMult(space) {
|
|
3044
|
-
return {
|
|
3045
|
-
comfortable: 1.15,
|
|
3046
|
-
standard: 1,
|
|
3047
|
-
dense: .88
|
|
3048
|
-
}[space];
|
|
3049
|
-
}
|
|
3050
|
-
function mapRhythm(space) {
|
|
3051
|
-
switch (space) {
|
|
3052
|
-
case "comfortable": return "1.2rem";
|
|
3053
|
-
case "dense": return "0.75rem";
|
|
3054
|
-
default: return "1rem";
|
|
3055
|
-
}
|
|
3056
|
-
}
|
|
3057
|
-
function mapMotionDuration(level) {
|
|
3058
|
-
return {
|
|
3059
|
-
off: "0ms",
|
|
3060
|
-
low: "120ms",
|
|
3061
|
-
medium: "180ms",
|
|
3062
|
-
high: "250ms"
|
|
3063
|
-
}[level];
|
|
3064
|
-
}
|
|
3065
|
-
function mapMotionEasing(e) {
|
|
3066
|
-
return {
|
|
3067
|
-
standard: "cubic-bezier(.2,.8,.2,1)",
|
|
3068
|
-
snappy: "cubic-bezier(.2,1,.2,1)",
|
|
3069
|
-
gentle: "cubic-bezier(.15,.85,.15,1)"
|
|
3070
|
-
}[e];
|
|
3071
|
-
}
|
|
3072
|
-
/**
|
|
3073
|
-
* Map corner style to block radius CSS value.
|
|
3074
|
-
* These are Tier 2 vars used consistently across blocks. The pill token is
|
|
3075
|
-
* intentionally capped for block surfaces: buttons can be fully pill-shaped,
|
|
3076
|
-
* but cards/panels with real content should not become capsules.
|
|
3077
|
-
*/
|
|
3078
|
-
function mapBlockRadius(corners) {
|
|
3079
|
-
return {
|
|
3080
|
-
square: "0",
|
|
3081
|
-
soft: "0.5rem",
|
|
3082
|
-
rounded: "0.75rem",
|
|
3083
|
-
pill: "1rem"
|
|
3084
|
-
}[corners];
|
|
3085
|
-
}
|
|
3086
|
-
/**
|
|
3087
|
-
* Map corner style to large-panel radius CSS value (Tier 2 `--rb-panel-radius`).
|
|
3088
|
-
* Derived from the same `corners` enum, one step more generous than the
|
|
3089
|
-
* block/card radius so large surfaces can carry a softer corner without a new
|
|
3090
|
-
* schema field. `rounded` lands on 20px (1.25rem), matching the physio mockup's
|
|
3091
|
-
* large-panel radius.
|
|
3092
|
-
*/
|
|
3093
|
-
function mapPanelRadius(corners) {
|
|
3094
|
-
return {
|
|
3095
|
-
square: "0",
|
|
3096
|
-
soft: "0.75rem",
|
|
3097
|
-
rounded: "1.25rem",
|
|
3098
|
-
pill: "2rem"
|
|
3099
|
-
}[corners];
|
|
3100
|
-
}
|
|
3101
|
-
/**
|
|
3102
|
-
* Map motion level to block transition duration.
|
|
3103
|
-
* These are Tier 2 vars used consistently across blocks.
|
|
3104
|
-
*/
|
|
3105
|
-
function mapBlockTransition(level) {
|
|
3106
|
-
return {
|
|
3107
|
-
off: "0ms",
|
|
3108
|
-
low: "120ms",
|
|
3109
|
-
medium: "150ms",
|
|
3110
|
-
high: "200ms"
|
|
3111
|
-
}[level];
|
|
3112
|
-
}
|
|
3113
|
-
/**
|
|
3114
|
-
* Map corner style to button radius CSS value.
|
|
3115
|
-
* Uses Tailwind-style button radius values that match the button system.
|
|
3116
|
-
* - square/soft → rounded-md (0.375rem) for subtle rounding
|
|
3117
|
-
* - rounded → rounded-lg (0.5rem) for moderate rounding
|
|
3118
|
-
* - pill → rounded-full (9999px) for pill shape
|
|
3119
|
-
*/
|
|
3120
|
-
function mapButtonRadius(corners) {
|
|
3121
|
-
return {
|
|
3122
|
-
square: "0.375rem",
|
|
3123
|
-
soft: "0.375rem",
|
|
3124
|
-
rounded: "0.5rem",
|
|
3125
|
-
pill: "9999px"
|
|
3126
|
-
}[corners];
|
|
3127
|
-
}
|
|
3128
|
-
function mapBorderWidth(width) {
|
|
3129
|
-
switch (width) {
|
|
3130
|
-
case "none": return "0px";
|
|
3131
|
-
case "thick": return "2px";
|
|
3132
|
-
default: return "1px";
|
|
3133
|
-
}
|
|
3134
|
-
}
|
|
3135
|
-
function mapBorderStyle(style) {
|
|
3136
|
-
return style;
|
|
3137
|
-
}
|
|
3138
|
-
function proseLinkStyleToCssVars(style) {
|
|
3139
|
-
if (!style) return {};
|
|
3140
|
-
return {
|
|
3141
|
-
...style.colorToken ? { ["--rb-prose-link-color"]: rgbColorValue(style.colorToken) } : {},
|
|
3142
|
-
...style.hoverColorToken ? { ["--rb-prose-link-hover-color"]: rgbColorValue(style.hoverColorToken) } : {},
|
|
3143
|
-
...style.decorationColorToken ? { ["--rb-prose-link-decoration-color"]: rgbColorValue(style.decorationColorToken) } : {},
|
|
3144
|
-
...style.hoverDecorationColorToken ? { ["--rb-prose-link-hover-decoration-color"]: rgbColorValue(style.hoverDecorationColorToken) } : {},
|
|
3145
|
-
...style.underline != null ? { ["--rb-prose-link-decoration-line"]: style.underline ? "underline" : "none" } : {},
|
|
3146
|
-
...style.underlineStyle ? { ["--rb-prose-link-underline-style"]: style.underlineStyle } : {},
|
|
3147
|
-
...style.underlineThickness ? { ["--rb-prose-link-underline-thickness"]: mapProseLinkUnderlineThickness(style.underlineThickness) } : {},
|
|
3148
|
-
...style.underlineOffset ? { ["--rb-prose-link-underline-offset"]: mapProseLinkUnderlineOffset(style.underlineOffset) } : {}
|
|
3149
|
-
};
|
|
3150
|
-
}
|
|
3151
|
-
/**
|
|
3152
|
-
* Generate structured block override CSS (separate from blockCustomVars).
|
|
3153
|
-
* This handles typed theme overrides, while blockCustomVars remains raw var passthrough.
|
|
3154
|
-
*/
|
|
3155
|
-
function generateBlockOverrideCss(themeId, theme) {
|
|
3156
|
-
const overrides = theme.blockOverrides;
|
|
3157
|
-
if (!overrides) return "";
|
|
3158
|
-
const cssBlocks = [];
|
|
3159
|
-
for (const [blockKind, blockOverride] of Object.entries(overrides)) {
|
|
3160
|
-
const blockSelectorKind = normalizeBlockKind(blockKind);
|
|
3161
|
-
const proseVars = proseLinkStyleToCssVars(blockOverride.typography?.proseLinkStyle);
|
|
3162
|
-
const declarations = Object.entries(proseVars).map(([key, value]) => ` ${key}: ${String(value)};`).join("\n");
|
|
3163
|
-
if (!declarations) continue;
|
|
3164
|
-
cssBlocks.push(`:where([data-theme-scope="${escapeAttrValue(themeId)}"]) :where([data-block="${escapeAttrValue(blockSelectorKind)}"]) {\n${declarations}\n}`);
|
|
3165
|
-
}
|
|
3166
|
-
return cssBlocks.join("\n");
|
|
3167
|
-
}
|
|
3168
|
-
function escapeAttrValue(value) {
|
|
3169
|
-
return value.replace(/\\/g, "\\\\").replace(/"/g, "\\\"");
|
|
3170
|
-
}
|
|
3171
|
-
function mapProseLinkUnderlineThickness(value) {
|
|
3172
|
-
switch (value) {
|
|
3173
|
-
case "fromFont": return "from-font";
|
|
3174
|
-
case "thin": return "1px";
|
|
3175
|
-
case "medium": return "2px";
|
|
3176
|
-
case "thick": return "3px";
|
|
3177
|
-
default: return "auto";
|
|
3178
|
-
}
|
|
3179
|
-
}
|
|
3180
|
-
function mapProseLinkUnderlineOffset(value) {
|
|
3181
|
-
switch (value) {
|
|
3182
|
-
case "tight": return "0.08em";
|
|
3183
|
-
case "loose": return "0.2em";
|
|
3184
|
-
case "normal": return "0.14em";
|
|
3185
|
-
default: return "auto";
|
|
3186
|
-
}
|
|
3187
|
-
}
|
|
3188
|
-
/**
|
|
3189
|
-
* Map input corners to CSS radius value for tier-2 input variables.
|
|
3190
|
-
* Falls back to theme corners if inputCorners is null.
|
|
3191
|
-
*/
|
|
3192
|
-
function mapInputRadius(inputCorners, themeFallback) {
|
|
3193
|
-
switch (inputCorners ?? themeFallback) {
|
|
3194
|
-
case "square": return "0";
|
|
3195
|
-
case "soft": return "0.25rem";
|
|
3196
|
-
case "rounded": return "0.5rem";
|
|
3197
|
-
case "pill": return "9999px";
|
|
3198
|
-
default: return "0.375rem";
|
|
3199
|
-
}
|
|
3200
|
-
}
|
|
3201
|
-
/**
|
|
3202
|
-
* Normalize scale name to handle both old and new naming conventions.
|
|
3203
|
-
* Old names (minorThird, majorThird, perfectFourth) map to new names (compact, balanced, spacious).
|
|
3204
|
-
*/
|
|
3205
|
-
function normalizeScaleName(scale) {
|
|
3206
|
-
return {
|
|
3207
|
-
minorThird: "compact",
|
|
3208
|
-
majorThird: "balanced",
|
|
3209
|
-
perfectFourth: "spacious",
|
|
3210
|
-
compact: "compact",
|
|
3211
|
-
balanced: "balanced",
|
|
3212
|
-
spacious: "spacious"
|
|
3213
|
-
}[scale] ?? "balanced";
|
|
3214
|
-
}
|
|
3215
|
-
/**
|
|
3216
|
-
* Compute base type scale sizes for headings.
|
|
3217
|
-
* Returns both static sizes and min/max for fluid typography.
|
|
3218
|
-
*/
|
|
3219
|
-
function computeTypeScale(scale, bodySize) {
|
|
3220
|
-
const base = {
|
|
3221
|
-
md: 16,
|
|
3222
|
-
lg: 17,
|
|
3223
|
-
xl: 18
|
|
3224
|
-
}[bodySize];
|
|
3225
|
-
const ratio = {
|
|
3226
|
-
compact: 1.2,
|
|
3227
|
-
balanced: 1.25,
|
|
3228
|
-
spacious: 1.333
|
|
3229
|
-
}[normalizeScaleName(scale)];
|
|
3230
|
-
const h3 = Math.round(base * ratio);
|
|
3231
|
-
const h2 = Math.round(h3 * ratio);
|
|
3232
|
-
const h1 = Math.round(h2 * ratio);
|
|
3233
|
-
const fluidMin = .7;
|
|
3234
|
-
const h2FluidMin = .9;
|
|
3235
|
-
const fluidMax = 1.3;
|
|
3236
|
-
return {
|
|
3237
|
-
["--fs-body"]: `${base}px`,
|
|
3238
|
-
["--fs-h3"]: `${h3}px`,
|
|
3239
|
-
["--fs-h2"]: `${h2}px`,
|
|
3240
|
-
["--fs-h1"]: `${h1}px`,
|
|
3241
|
-
["--fs-h1-min"]: `${Math.round(h1 * fluidMin)}px`,
|
|
3242
|
-
["--fs-h1-max"]: `${Math.round(h1 * fluidMax)}px`,
|
|
3243
|
-
["--fs-h2-min"]: `${Math.round(h2 * h2FluidMin)}px`,
|
|
3244
|
-
["--fs-h2-max"]: `${Math.round(h2 * fluidMax)}px`,
|
|
3245
|
-
["--fs-h3-min"]: `${Math.round(h3 * fluidMin)}px`,
|
|
3246
|
-
["--fs-h3-max"]: `${Math.round(h3 * fluidMax)}px`,
|
|
3247
|
-
["--fs-h1-fluid"]: `clamp(${Math.round(h1 * fluidMin)}px, calc(${Math.round(h1 * fluidMin)}px + ${Math.round(h1 * (fluidMax - fluidMin))} * ((100vw - 320px) / 880)), ${Math.round(h1 * fluidMax)}px)`,
|
|
3248
|
-
["--fs-h2-fluid"]: `clamp(${Math.round(h2 * h2FluidMin)}px, calc(${Math.round(h2 * h2FluidMin)}px + ${Math.round(h2 * (fluidMax - h2FluidMin))} * ((100vw - 320px) / 880)), ${Math.round(h2 * fluidMax)}px)`,
|
|
3249
|
-
["--fs-h3-fluid"]: `clamp(${Math.round(h3 * fluidMin)}px, calc(${Math.round(h3 * fluidMin)}px + ${Math.round(h3 * (fluidMax - fluidMin))} * ((100vw - 320px) / 880)), ${Math.round(h3 * fluidMax)}px)`,
|
|
3250
|
-
["--fs-h1-display"]: `${Math.round(h1 * 1.5)}px`,
|
|
3251
|
-
["--fs-h1-display-fluid"]: `clamp(${Math.round(h1 * fluidMin * 1.5)}px, calc(${Math.round(h1 * fluidMin * 1.5)}px + ${Math.round(h1 * (fluidMax - fluidMin) * 1.5)} * ((100vw - 320px) / 880)), ${Math.round(h1 * fluidMax * 1.5)}px)`
|
|
3252
|
-
};
|
|
3253
|
-
}
|
|
3254
|
-
/**
|
|
3255
|
-
* Size scale multipliers for heading size overrides.
|
|
3256
|
-
* Expanded from md/lg/xl to xs through 2xl for finer control.
|
|
3257
|
-
*/
|
|
3258
|
-
const SIZE_SCALE_MAP = {
|
|
3259
|
-
xs: .85,
|
|
3260
|
-
sm: .925,
|
|
3261
|
-
md: 1,
|
|
3262
|
-
lg: 1.1,
|
|
3263
|
-
xl: 1.2,
|
|
3264
|
-
"2xl": 1.35
|
|
3265
|
-
};
|
|
3266
|
-
function applyHeadingSizeOverrides(base, typography) {
|
|
3267
|
-
const body = base["--fs-body"];
|
|
3268
|
-
const h1Base = parseFloat(base["--fs-h1"].replace("px", ""));
|
|
3269
|
-
const h2Base = parseFloat(base["--fs-h2"].replace("px", ""));
|
|
3270
|
-
const h3Base = parseFloat(base["--fs-h3"].replace("px", ""));
|
|
3271
|
-
const h1Scale = typography.headings.h1.size ? SIZE_SCALE_MAP[typography.headings.h1.size] : 1;
|
|
3272
|
-
const h2Scale = typography.headings.h2.size ? SIZE_SCALE_MAP[typography.headings.h2.size] : 1;
|
|
3273
|
-
const h3Scale = typography.headings.h3.size ? SIZE_SCALE_MAP[typography.headings.h3.size] : 1;
|
|
3274
|
-
const h1 = Math.round(h1Base * h1Scale);
|
|
3275
|
-
const h2 = Math.round(h2Base * h2Scale);
|
|
3276
|
-
const h3 = Math.round(h3Base * h3Scale);
|
|
3277
|
-
const fluidMin = .7;
|
|
3278
|
-
const h2FluidMin = .9;
|
|
3279
|
-
const fluidMax = 1.3;
|
|
3280
|
-
return {
|
|
3281
|
-
body,
|
|
3282
|
-
h1: `${h1}px`,
|
|
3283
|
-
h2: `${h2}px`,
|
|
3284
|
-
h3: `${h3}px`,
|
|
3285
|
-
h1Fluid: `clamp(${Math.round(h1 * fluidMin)}px, calc(${Math.round(h1 * fluidMin)}px + ${Math.round(h1 * (fluidMax - fluidMin))} * ((100vw - 320px) / 880)), ${Math.round(h1 * fluidMax)}px)`,
|
|
3286
|
-
h2Fluid: `clamp(${Math.round(h2 * h2FluidMin)}px, calc(${Math.round(h2 * h2FluidMin)}px + ${Math.round(h2 * (fluidMax - h2FluidMin))} * ((100vw - 320px) / 880)), ${Math.round(h2 * fluidMax)}px)`,
|
|
3287
|
-
h3Fluid: `clamp(${Math.round(h3 * fluidMin)}px, calc(${Math.round(h3 * fluidMin)}px + ${Math.round(h3 * (fluidMax - fluidMin))} * ((100vw - 320px) / 880)), ${Math.round(h3 * fluidMax)}px)`,
|
|
3288
|
-
h1Display: `${Math.round(h1 * 1.5)}px`,
|
|
3289
|
-
h1DisplayFluid: `clamp(${Math.round(h1 * 1.5 * fluidMin)}px, calc(${Math.round(h1 * 1.5 * fluidMin)}px + ${Math.round(h1 * 1.5 * (fluidMax - fluidMin))} * ((100vw - 320px) / 880)), ${Math.round(h1 * 1.5 * fluidMax)}px)`
|
|
3290
|
-
};
|
|
3291
|
-
}
|
|
3292
|
-
function mapLetterSpacing(s) {
|
|
3293
|
-
return {
|
|
3294
|
-
tight: "-0.01em",
|
|
3295
|
-
normal: "0em",
|
|
3296
|
-
loose: "0.02em"
|
|
3297
|
-
}[s];
|
|
3298
|
-
}
|
|
3299
|
-
function mapEyebrowSize(s) {
|
|
3300
|
-
return {
|
|
3301
|
-
sm: "0.75rem",
|
|
3302
|
-
md: "0.875rem",
|
|
3303
|
-
lg: "1rem"
|
|
3304
|
-
}[s];
|
|
3305
|
-
}
|
|
3306
|
-
function mapEyebrowLetterSpacing(s) {
|
|
3307
|
-
return {
|
|
3308
|
-
tight: "0em",
|
|
3309
|
-
normal: "0.025em",
|
|
3310
|
-
loose: "0.06em",
|
|
3311
|
-
wide: "0.12em"
|
|
3312
|
-
}[s];
|
|
3313
|
-
}
|
|
3314
|
-
function mapEyebrowCase(c) {
|
|
3315
|
-
return c === "uppercase" ? "uppercase" : "none";
|
|
3316
|
-
}
|
|
3317
|
-
function mapLineHeight(s) {
|
|
3318
|
-
return {
|
|
3319
|
-
normal: "1.5",
|
|
3320
|
-
relaxed: "1.65",
|
|
3321
|
-
loose: "1.8"
|
|
3322
|
-
}[s];
|
|
3323
|
-
}
|
|
3324
|
-
/**
|
|
3325
|
-
* Headings get their own line-height scale, decoupled from body. `mapLineHeight`
|
|
3326
|
-
* is floored at 1.5 (a body leading) which reads as too airy on headings — the
|
|
3327
|
-
* more so as size drops. These values sit well under 1.5 and let presets taper
|
|
3328
|
-
* per level (larger headings tighter). `tight`/`snug` extend the token set for
|
|
3329
|
-
* display headings; body keeps `mapLineHeight`.
|
|
3330
|
-
*/
|
|
3331
|
-
function mapHeadingLineHeight(s) {
|
|
3332
|
-
return {
|
|
3333
|
-
tight: "1.1",
|
|
3334
|
-
snug: "1.15",
|
|
3335
|
-
normal: "1.2",
|
|
3336
|
-
relaxed: "1.3",
|
|
3337
|
-
loose: "1.4"
|
|
3338
|
-
}[s];
|
|
3339
|
-
}
|
|
3340
|
-
function mapTextTransform(c) {
|
|
3341
|
-
if (c === "uppercase") return "uppercase";
|
|
3342
|
-
return "none";
|
|
3343
|
-
}
|
|
3344
|
-
function mapFontVariant(c) {
|
|
3345
|
-
if (c === "smallCaps") return "small-caps";
|
|
3346
|
-
return "normal";
|
|
3347
|
-
}
|
|
3348
|
-
function mapFontStyle(italic) {
|
|
3349
|
-
return italic ? "italic" : "normal";
|
|
3350
|
-
}
|
|
3351
|
-
/** Adapt the canonical default-card decision for the embedded registration. */
|
|
3352
|
-
function generateThemeBlockVarsCss(theme, themeId) {
|
|
3353
|
-
const card = resolveCardRole(theme, theme.cards ?? null, "default");
|
|
3354
|
-
return generateAllBlockVarsCss({
|
|
3355
|
-
theme,
|
|
3356
|
-
themeId,
|
|
3357
|
-
surface: opaqueSurfaceContextFromTheme(theme),
|
|
3358
|
-
embeddedRegistrationPaint: card.kind === "surface" ? cardSurfacePaint(card.variant) : { kind: "transparent" }
|
|
3359
|
-
});
|
|
3360
|
-
}
|
|
3361
|
-
//#endregion
|
|
3362
1851
|
//#region ../theme-core/src/generated/containerResponsiveThemeCss.ts
|
|
3363
1852
|
/**
|
|
3364
1853
|
* Auto-generated by scripts/generate-container-responsive-css.ts
|
|
@@ -23571,6 +22060,15 @@ const containerResponsiveThemeCss = `/*
|
|
|
23571
22060
|
[data-skin="loom"] [data-arrangement][data-treat="items-plates"] [data-card-list-item] [data-slot="facts"] [data-slot="fact-label"] { font-size: inherit; color: var(--rb-surface-muted-color); }
|
|
23572
22061
|
[data-skin="loom"] [data-arrangement][data-treat="items-plates"] [data-card-list-item] [data-slot="facts"] [data-slot="fact-value"] { margin: 0; font-size: inherit; font-weight: 600; }
|
|
23573
22062
|
[data-skin="loom"] [data-arrangement][data-treat="items-plates"] [data-slot="dates"] { display: grid; gap: 0.3rem; margin: 0.5rem 0 0; padding: 0.9rem 0 0; border-top: var(--loom-stitch); list-style: none; font-size: 0.95rem; }
|
|
22063
|
+
/* One offering: the shared layout rules its date rows; Loom stitches them, and the beside layout's column rule. Beside the
|
|
22064
|
+
* details the dates need no seam above them, since the column rule already parts them from the details. */
|
|
22065
|
+
[data-skin="loom"] [data-arrangement] [data-has-one-offering] [data-card-list-item] [data-slot="dates"] [data-slot="date"]:not(:first-child) { border-top: var(--loom-stitch); }
|
|
22066
|
+
@container rb-site (min-width: 768px) {
|
|
22067
|
+
@scope ([data-rb-responsive-mode="container"]) to (:scope [data-rb-responsive-mode]) {
|
|
22068
|
+
[data-skin="loom"]:is(*, :scope) [data-arrangement][data-treat="items-plates"] [data-has-one-offering] [data-card-list-item]:not(:has(> [data-slot="item-media"])) [data-slot="item-body"] > [data-slot="dates"] { margin: 0; padding: 0; border-top: 0; }
|
|
22069
|
+
[data-skin="loom"]:is(*, :scope) [data-arrangement] [data-has-one-offering] [data-card-list-item]:not(:has(> [data-slot="item-media"])) [data-slot="item-body"] > [data-slot="dates"]::before { border-left: var(--loom-stitch); }
|
|
22070
|
+
}
|
|
22071
|
+
}
|
|
23574
22072
|
[data-skin="loom"] [data-arrangement][data-treat="items-plates"] [data-slot="dates"] [data-slot="date"] { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.1rem 0.7rem; margin: 0; font-weight: 600; }
|
|
23575
22073
|
[data-skin="loom"] [data-arrangement][data-treat="items-plates"] [data-slot="date-places"] { font-weight: 400; color: var(--rb-surface-muted-color); }
|
|
23576
22074
|
[data-skin="loom"] [data-arrangement][data-treat="items-plates"] [data-card-list-item] [data-slot="item-body"] > [data-slot="item-actions"] { margin-top: auto; padding-top: 0.7rem; }
|
|
@@ -23860,6 +22358,9 @@ const containerResponsiveThemeCss = `/*
|
|
|
23860
22358
|
[data-skin="poise"] [data-arrangement][data-treat="times-row"] [data-slot="item"] > [data-slot="date"] { flex-direction: row; align-items: baseline; gap: 0.5rem; margin: 0.75rem 0.75rem 0; padding: 0.625rem 0.875rem; border-radius: 16px; }
|
|
23861
22359
|
[data-skin="poise"] [data-arrangement][data-treat="times-row"] [data-slot="item"] > [data-slot="date"] [data-slot="day"] { font-size: 2.125rem; }
|
|
23862
22360
|
[data-skin="poise"] [data-arrangement][data-treat="times-row"] [data-slot="item"] > [data-slot="date"] :is([data-slot="weekday"], [data-slot="month"]) { color: inherit; }
|
|
22361
|
+
/* spotlight: the date as a pill inset in the card under the photo, like the session cards, so it never meets the section. */
|
|
22362
|
+
[data-skin="poise"] [data-arrangement][data-treat="spotlight"] [data-slot="item"] > [data-slot="date"] { flex-direction: row; align-items: baseline; gap: 0.5rem; margin: 0.75rem 0.75rem 0; padding: 0.625rem 0.875rem; border-radius: 16px; }
|
|
22363
|
+
[data-skin="poise"] [data-arrangement][data-treat="spotlight"] [data-slot="item"] > [data-slot="date"] :is([data-slot="weekday"], [data-slot="month"]) { color: inherit; }
|
|
23863
22364
|
[data-skin="poise"] [data-arrangement][data-treat="times-row"] [data-slot="item-body"] { gap: 0.25rem; padding: 0.875rem 1.125rem 1rem; }
|
|
23864
22365
|
[data-skin="poise"] [data-arrangement][data-treat="times-row"] [data-slot="item-title"] { font-family: var(--font-body); font-size: 1rem; font-weight: 700; line-height: 1.3; letter-spacing: 0; }
|
|
23865
22366
|
[data-skin="poise"] [data-arrangement][data-treat="times-row"] [data-slot="item-text"] { display: none; }
|
|
@@ -23945,8 +22446,8 @@ const containerResponsiveThemeCss = `/*
|
|
|
23945
22446
|
[data-skin="poise"] [data-arrangement]:is([data-treat="signup-beside"], [data-treat="signup-row"]) [data-slot="layout"] > [data-slot="panel"] { padding: clamp(1.25rem, 2.5cqi, 1.75rem); }
|
|
23946
22447
|
[data-skin="poise"] [data-arrangement]:is([data-treat="signup-beside"], [data-treat="signup-row"]) [data-slot="caption"] { margin-top: 0.75rem; font-size: 0.8125rem; color: var(--rb-surface-muted-color); }
|
|
23947
22448
|
|
|
23948
|
-
/* signup-frame: the signup inside one rounded frame
|
|
23949
|
-
[data-skin="poise"] [data-arrangement][data-treat="signup-frame"] [data-slot="frame"] { padding: clamp(1.5rem, 4cqi, 3.5rem); border
|
|
22449
|
+
/* signup-frame: the signup inside one rounded panel, filled by the frame role of the offer (statement). */
|
|
22450
|
+
[data-skin="poise"] [data-arrangement][data-treat="signup-frame"] [data-slot="frame"] { padding: clamp(1.5rem, 4cqi, 3.5rem); border-radius: var(--poise-photo-radius); }
|
|
23950
22451
|
|
|
23951
22452
|
/* form-beside and form-below: the form on a rounded panel, a step rounder than cards. */
|
|
23952
22453
|
[data-skin="poise"] [data-arrangement]:is([data-treat="form-beside"], [data-treat="form-below"]) [data-slot="panel"] { box-sizing: border-box; padding: clamp(1.25rem, 3cqi, 2.5rem); border-radius: var(--poise-photo-radius); }
|
|
@@ -24410,10 +22911,10 @@ const containerResponsiveThemeCss = `/*
|
|
|
24410
22911
|
[data-skin="haven"] [data-arrangement]:is([data-treat="signup-beside"], [data-treat="signup-row"], [data-treat="signup-frame"]) [data-slot="caption"] { margin-top: 0.75rem; font-size: 0.85rem; color: var(--rb-surface-muted-color); }
|
|
24411
22912
|
[data-skin="haven"] [data-arrangement]:is([data-treat="signup-beside"], [data-treat="signup-row"], [data-treat="signup-frame"]) [data-slot="control"] { border-radius: 999px; }
|
|
24412
22913
|
|
|
24413
|
-
/* signup-frame: the signup in one soft frame
|
|
22914
|
+
/* signup-frame: the signup in one soft panel filled by the frame role of the offer (card), two pebbles peeking out from behind its corners.
|
|
24414
22915
|
* At most 1.5rem of each pebble reaches inside the frame, less than its smallest padding, so they never sit under
|
|
24415
22916
|
* the words; on phones, where the frame meets the page margin, they are left out. */
|
|
24416
|
-
[data-skin="haven"] [data-arrangement][data-treat="signup-frame"] [data-slot="frame"] { position: relative; isolation: isolate; padding: clamp(1.75rem, 4.5cqi, 3.5rem); border
|
|
22917
|
+
[data-skin="haven"] [data-arrangement][data-treat="signup-frame"] [data-slot="frame"] { position: relative; isolation: isolate; padding: clamp(1.75rem, 4.5cqi, 3.5rem); border-radius: var(--rb-skin-radius, 30px); }
|
|
24417
22918
|
[data-skin="haven"] [data-arrangement][data-treat="signup-frame"] [data-slot="frame"]::before,
|
|
24418
22919
|
[data-skin="haven"] [data-arrangement][data-treat="signup-frame"] [data-slot="frame"]::after { content: ""; position: absolute; z-index: -1; aspect-ratio: 1; pointer-events: none; }
|
|
24419
22920
|
[data-skin="haven"] [data-arrangement][data-treat="signup-frame"] [data-slot="frame"]::before { top: -7.25rem; right: -7.25rem; width: 8.75rem; border-radius: var(--haven-pebble-a); background: var(--haven-pebble-1); }
|
|
@@ -24681,859 +23182,4 @@ function ThemeScopeCore({ cssVars, buttonCss, headerCss, footerCss, cardCss, acc
|
|
|
24681
23182
|
});
|
|
24682
23183
|
}
|
|
24683
23184
|
//#endregion
|
|
24684
|
-
|
|
24685
|
-
/**
|
|
24686
|
-
* Server Component that injects theme CSS.
|
|
24687
|
-
*
|
|
24688
|
-
* This component:
|
|
24689
|
-
* 1. Generates CSS from theme config via buildThemeRuntime
|
|
24690
|
-
* 2. Passes all CSS to ThemeScopeCore for injection
|
|
24691
|
-
* 3. Sets data attributes for theme axes
|
|
24692
|
-
*
|
|
24693
|
-
* Note: All CSS injection is handled by ThemeScopeCore to prevent drift
|
|
24694
|
-
* between this server component and ClientThemeScope.
|
|
24695
|
-
*/
|
|
24696
|
-
function ThemeScope({ theme, children, themeId = "theme-default", responsiveMode = DEFAULT_THEME_RESPONSIVE_MODE, className }) {
|
|
24697
|
-
const runtime = buildThemeRuntime(theme, {
|
|
24698
|
-
themeId,
|
|
24699
|
-
responsiveMode
|
|
24700
|
-
});
|
|
24701
|
-
const dataAttrs = buildThemeDataAttrs(theme.axes, themeId, theme.skin);
|
|
24702
|
-
return /* @__PURE__ */ jsx(ThemeScopeCore, {
|
|
24703
|
-
...themeRuntimeScopeProps(runtime),
|
|
24704
|
-
dataAttrs,
|
|
24705
|
-
responsiveMode,
|
|
24706
|
-
suppressHydrationWarning: true,
|
|
24707
|
-
className,
|
|
24708
|
-
children
|
|
24709
|
-
});
|
|
24710
|
-
}
|
|
24711
|
-
//#endregion
|
|
24712
|
-
//#region ../theme-core/src/ResponsiveScope.tsx
|
|
24713
|
-
/**
|
|
24714
|
-
* Structural responsive root for SDK/runtime chrome that opts out of CMS theme
|
|
24715
|
-
* styling but still depends on scoped rb-* responsive utility classes.
|
|
24716
|
-
*/
|
|
24717
|
-
function ResponsiveScope({ children, responsiveMode = DEFAULT_THEME_RESPONSIVE_MODE, className }) {
|
|
24718
|
-
const responsiveScope = getResponsiveScopeSpec(responsiveMode);
|
|
24719
|
-
const isContainerResponsive = responsiveScope.kind === "container";
|
|
24720
|
-
const wrapperStyle = isContainerResponsive ? {
|
|
24721
|
-
containerType: "inline-size",
|
|
24722
|
-
containerName: responsiveScope.containerName
|
|
24723
|
-
} : {};
|
|
24724
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
24725
|
-
className: className ? `theme-scope ${className}` : "theme-scope",
|
|
24726
|
-
style: wrapperStyle,
|
|
24727
|
-
"data-rb-responsive-mode": responsiveScope.kind,
|
|
24728
|
-
children: [isContainerResponsive && /* @__PURE__ */ jsx("style", {
|
|
24729
|
-
"data-container-responsive-overrides": true,
|
|
24730
|
-
dangerouslySetInnerHTML: { __html: escapeStyleContent(containerResponsiveThemeCss) }
|
|
24731
|
-
}), children]
|
|
24732
|
-
});
|
|
24733
|
-
}
|
|
24734
|
-
//#endregion
|
|
24735
|
-
//#region ../theme-core/src/runtime/bridgeColourTokens.ts
|
|
24736
|
-
/**
|
|
24737
|
-
* The SDK theme bridge's colour tokens: RGB channel triplets as CSS vars, the
|
|
24738
|
-
* on-colours derived for them, and the same tokens as an opaque hex palette
|
|
24739
|
-
* for the contrast-checked generators (buttons, block panels).
|
|
24740
|
-
*/
|
|
24741
|
-
const RGB_CHANNELS_PATTERN = /^(\d{1,3})\s+(\d{1,3})\s+(\d{1,3})(?:\s*\/\s*(0|1|0?\.\d+|\d{1,3}%))?$/;
|
|
24742
|
-
function hexToRgbChannels(hex) {
|
|
24743
|
-
try {
|
|
24744
|
-
const { r, g, b } = hexToRgb(hex);
|
|
24745
|
-
return `${r} ${g} ${b}`;
|
|
24746
|
-
} catch {
|
|
24747
|
-
throw new Error(`[ThemeBridge] Invalid token value "${hex}": expected a valid hex colour, CSS var(), or RGB channel value.`);
|
|
24748
|
-
}
|
|
24749
|
-
}
|
|
24750
|
-
function deriveConcreteBridgeOnTokens(tokens) {
|
|
24751
|
-
return Object.fromEntries(Object.entries(tokens).flatMap(([name, value]) => {
|
|
24752
|
-
if (!isOnColorBackgroundCandidateToken(name)) return [];
|
|
24753
|
-
const hex = rgbChannelsToOpaqueHex(value);
|
|
24754
|
-
const onToken = onColorTokenName(name);
|
|
24755
|
-
return hex === null || tokens[onToken] !== void 0 ? [] : [[onToken, hexToRgbChannels(getTextColorForBackground(hex))]];
|
|
24756
|
-
}));
|
|
24757
|
-
}
|
|
24758
|
-
function buildBridgeButtonPalette(tokens) {
|
|
24759
|
-
return {
|
|
24760
|
-
...Object.fromEntries(Object.entries({
|
|
24761
|
-
...tokens,
|
|
24762
|
-
...deriveConcreteBridgeOnTokens(tokens)
|
|
24763
|
-
}).flatMap(([name, value]) => {
|
|
24764
|
-
const hex = rgbChannelsToOpaqueHex(value);
|
|
24765
|
-
return hex === null ? [] : [[name, hex]];
|
|
24766
|
-
})),
|
|
24767
|
-
meta: { mode: "light" }
|
|
24768
|
-
};
|
|
24769
|
-
}
|
|
24770
|
-
function rgbChannelsToOpaqueHex(value) {
|
|
24771
|
-
const match = value.match(RGB_CHANNELS_PATTERN);
|
|
24772
|
-
if (!match || match[4] !== void 0) return null;
|
|
24773
|
-
return `#${[
|
|
24774
|
-
Number(match[1]),
|
|
24775
|
-
Number(match[2]),
|
|
24776
|
-
Number(match[3])
|
|
24777
|
-
].map((channel) => channel.toString(16).padStart(2, "0")).join("")}`;
|
|
24778
|
-
}
|
|
24779
|
-
//#endregion
|
|
24780
|
-
//#region ../theme-core/src/buttons/core.ts
|
|
24781
|
-
const CORNER_RADIUS_MAP$1 = {
|
|
24782
|
-
square: "0",
|
|
24783
|
-
soft: "0.375rem",
|
|
24784
|
-
rounded: "0.5rem",
|
|
24785
|
-
pill: "9999px"
|
|
24786
|
-
};
|
|
24787
|
-
const BORDER_WIDTH_MAP$1 = {
|
|
24788
|
-
none: "0",
|
|
24789
|
-
thin: "1px",
|
|
24790
|
-
medium: "2px",
|
|
24791
|
-
thick: "4px"
|
|
24792
|
-
};
|
|
24793
|
-
const SHADOW_VALUES$1 = {
|
|
24794
|
-
none: "none",
|
|
24795
|
-
low: "0 1px 2px rgba(0,0,0,0.06)",
|
|
24796
|
-
medium: "0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1)",
|
|
24797
|
-
high: "0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1)"
|
|
24798
|
-
};
|
|
24799
|
-
const RESOLVER_GLOBAL = {
|
|
24800
|
-
cornerStyle: "rounded",
|
|
24801
|
-
textTransform: "none",
|
|
24802
|
-
fontWeight: 500,
|
|
24803
|
-
hoverTransform: "none",
|
|
24804
|
-
hoverColor: "none"
|
|
24805
|
-
};
|
|
24806
|
-
function generateButtonCoreCss(scopeId, variants, settings, palette) {
|
|
24807
|
-
const seenIds = /* @__PURE__ */ new Set();
|
|
24808
|
-
for (const variant of variants) {
|
|
24809
|
-
if (!buttonVariantIdSchema.safeParse(variant.id).success) throw new Error(`[ThemeBridge] Invalid button variant ID: ${variant.id}`);
|
|
24810
|
-
if (seenIds.has(variant.id)) throw new Error(`[ThemeBridge] Duplicate button variant ID: ${variant.id}`);
|
|
24811
|
-
seenIds.add(variant.id);
|
|
24812
|
-
}
|
|
24813
|
-
return variants.map((variant) => generateVariantCss(scopeId, variant, settings, palette)).join("\n\n");
|
|
24814
|
-
}
|
|
24815
|
-
function generateVariantCss(scopeId, variant, settings, palette) {
|
|
24816
|
-
const borderWidth = BORDER_WIDTH_MAP$1[variant.borderWidth ?? "none"];
|
|
24817
|
-
const result = compileButtonColourStates({
|
|
24818
|
-
variant: {
|
|
24819
|
-
id: variant.id,
|
|
24820
|
-
name: variant.id,
|
|
24821
|
-
enabled: true,
|
|
24822
|
-
priority: 1,
|
|
24823
|
-
background: variant.treatment,
|
|
24824
|
-
...borderWidth === "0" ? {} : { border: { widthClass: borderWidth } }
|
|
24825
|
-
},
|
|
24826
|
-
global: RESOLVER_GLOBAL,
|
|
24827
|
-
palette
|
|
24828
|
-
});
|
|
24829
|
-
if (!result.ok) throw new Error(`[ThemeBridge] ${formatButtonColourContractError(result.error)}`);
|
|
24830
|
-
const selector = `:where([data-theme-scope="${scopeId}"]) .button-${variant.id}`;
|
|
24831
|
-
return [
|
|
24832
|
-
rule(selector, [
|
|
24833
|
-
...borderWidth === "0" ? ["padding: 0.5rem 1rem;"] : [
|
|
24834
|
-
`padding-top: calc(0.5rem - ${borderWidth});`,
|
|
24835
|
-
`padding-bottom: calc(0.5rem - ${borderWidth});`,
|
|
24836
|
-
`padding-left: calc(1rem - ${borderWidth});`,
|
|
24837
|
-
`padding-right: calc(1rem - ${borderWidth});`
|
|
24838
|
-
],
|
|
24839
|
-
`font-weight: ${settings.fontWeight ?? 500};`,
|
|
24840
|
-
...settings.textTransform && settings.textTransform !== "none" ? [`text-transform: ${settings.textTransform};`] : [],
|
|
24841
|
-
"cursor: pointer;",
|
|
24842
|
-
"transition: all 200ms ease-in-out;",
|
|
24843
|
-
"display: inline-flex;",
|
|
24844
|
-
"align-items: center;",
|
|
24845
|
-
"justify-content: center;",
|
|
24846
|
-
`border-radius: ${CORNER_RADIUS_MAP$1[settings.corners]};`,
|
|
24847
|
-
`box-shadow: ${SHADOW_VALUES$1[settings.shadow]};`,
|
|
24848
|
-
...declarationStrings(resolvedButtonColourDeclarations(result.states.base, {
|
|
24849
|
-
role: variant.id,
|
|
24850
|
-
state: "base"
|
|
24851
|
-
})),
|
|
24852
|
-
borderWidth === "0" ? "border: none;" : `border: ${borderWidth} solid currentColor;`
|
|
24853
|
-
]),
|
|
24854
|
-
rule(`${selector}:hover`, declarationStrings(resolvedButtonColourDeclarations(result.states.hover, {
|
|
24855
|
-
role: variant.id,
|
|
24856
|
-
state: "hover"
|
|
24857
|
-
}))),
|
|
24858
|
-
rule(`${selector}:active`, [...declarationStrings(resolvedButtonColourDeclarations(result.states.active, {
|
|
24859
|
-
role: variant.id,
|
|
24860
|
-
state: "active"
|
|
24861
|
-
})), "transform: scale(0.98);"]),
|
|
24862
|
-
rule(`${selector}:focus-visible`, declarationStrings(resolvedButtonFocusDeclarations(result.focusIndicator, variant.id))),
|
|
24863
|
-
rule(`${selector}:disabled,\n${selector}:disabled:hover,\n${selector}:disabled:active`, [...declarationStrings(resolvedButtonColourDeclarations(result.states.disabled, {
|
|
24864
|
-
role: variant.id,
|
|
24865
|
-
state: "disabled"
|
|
24866
|
-
})), ...declarationStrings(RESOLVED_BUTTON_DISABLED_DECLARATIONS)])
|
|
24867
|
-
].join("\n\n");
|
|
24868
|
-
}
|
|
24869
|
-
function declarationStrings(declarations) {
|
|
24870
|
-
return declarations.map(([property, value]) => `${property}: ${value};`);
|
|
24871
|
-
}
|
|
24872
|
-
function rule(selector, declarations) {
|
|
24873
|
-
return `${selector} {\n ${declarations.join("\n ")}\n}`;
|
|
24874
|
-
}
|
|
24875
|
-
function getDefaultButtonVariants() {
|
|
24876
|
-
return [
|
|
24877
|
-
{
|
|
24878
|
-
id: "primary",
|
|
24879
|
-
treatment: {
|
|
24880
|
-
type: "solid",
|
|
24881
|
-
colorToken: unsafeAsOpaqueButtonColourToken("primary")
|
|
24882
|
-
}
|
|
24883
|
-
},
|
|
24884
|
-
{
|
|
24885
|
-
id: "secondary",
|
|
24886
|
-
treatment: {
|
|
24887
|
-
type: "solid",
|
|
24888
|
-
colorToken: unsafeAsOpaqueButtonColourToken("secondary")
|
|
24889
|
-
}
|
|
24890
|
-
},
|
|
24891
|
-
{
|
|
24892
|
-
id: "outline",
|
|
24893
|
-
treatment: {
|
|
24894
|
-
type: "surface",
|
|
24895
|
-
role: "link"
|
|
24896
|
-
},
|
|
24897
|
-
borderWidth: "thin"
|
|
24898
|
-
},
|
|
24899
|
-
{
|
|
24900
|
-
id: "ghost",
|
|
24901
|
-
treatment: {
|
|
24902
|
-
type: "surface",
|
|
24903
|
-
role: "link"
|
|
24904
|
-
}
|
|
24905
|
-
}
|
|
24906
|
-
];
|
|
24907
|
-
}
|
|
24908
|
-
//#endregion
|
|
24909
|
-
//#region ../theme-core/src/inputs/core.ts
|
|
24910
|
-
/**
|
|
24911
|
-
* Core Input CSS Generator
|
|
24912
|
-
*
|
|
24913
|
-
* Pure functions for generating form input CSS without requiring the full Theme type.
|
|
24914
|
-
* Used by both the full CMS theme system and the SDK theme bridge.
|
|
24915
|
-
*/
|
|
24916
|
-
const CORNER_RADIUS_MAP = {
|
|
24917
|
-
square: "0",
|
|
24918
|
-
soft: "0.25rem",
|
|
24919
|
-
rounded: "0.5rem",
|
|
24920
|
-
pill: "9999px"
|
|
24921
|
-
};
|
|
24922
|
-
const BORDER_WIDTH_MAP = {
|
|
24923
|
-
none: "0",
|
|
24924
|
-
thin: "1px",
|
|
24925
|
-
medium: "2px",
|
|
24926
|
-
thick: "4px"
|
|
24927
|
-
};
|
|
24928
|
-
const INPUT_PADDING = "0.5rem 0.75rem";
|
|
24929
|
-
const SHADOW_VALUES = {
|
|
24930
|
-
none: "none",
|
|
24931
|
-
low: "0 1px 2px rgba(0,0,0,0.04)",
|
|
24932
|
-
medium: "0 1px 3px rgba(0,0,0,0.08)",
|
|
24933
|
-
high: "0 2px 6px rgba(0,0,0,0.12)"
|
|
24934
|
-
};
|
|
24935
|
-
/** The bridge has token references but no resolved palette, so the shell publishes its foreground only, as bridge cards do. */
|
|
24936
|
-
function bridgeInputGroupCss(root, textToken) {
|
|
24937
|
-
const text = `rgb(var(--tb-${textToken}))`;
|
|
24938
|
-
return generateInputGroupCss(root, INPUT_PADDING, surfaceForegroundDeclarations({
|
|
24939
|
-
text,
|
|
24940
|
-
link: text
|
|
24941
|
-
}));
|
|
24942
|
-
}
|
|
24943
|
-
/**
|
|
24944
|
-
* Generate input CSS from core settings.
|
|
24945
|
-
*
|
|
24946
|
-
* This is a pure function with no dependencies on Theme type.
|
|
24947
|
-
* Selectors use :where() for zero specificity, allowing site styles to override easily.
|
|
24948
|
-
*
|
|
24949
|
-
* @param scopeId - Theme scope ID for selector
|
|
24950
|
-
* @param settings - Input style settings
|
|
24951
|
-
* @returns CSS string
|
|
24952
|
-
*/
|
|
24953
|
-
function generateInputCoreCss(scopeId, settings) {
|
|
24954
|
-
const root = `:where([data-theme-scope="${scopeId}"])`;
|
|
24955
|
-
const borderWidth = BORDER_WIDTH_MAP[settings.borderWidth];
|
|
24956
|
-
const borderRadius = CORNER_RADIUS_MAP[settings.corners];
|
|
24957
|
-
const cssBlocks = [];
|
|
24958
|
-
cssBlocks.push(`${root} .form-label {
|
|
24959
|
-
color: ${textColorValue(settings.labelToken)};
|
|
24960
|
-
font-weight: 600;
|
|
24961
|
-
font-size: 0.875rem;
|
|
24962
|
-
display: block;
|
|
24963
|
-
margin-bottom: 0.25rem;
|
|
24964
|
-
}`);
|
|
24965
|
-
const sharedInputRules = `
|
|
24966
|
-
background-color: rgb(var(--tb-${settings.backgroundToken}));
|
|
24967
|
-
color: rgb(var(--tb-${settings.textToken}));
|
|
24968
|
-
border: ${borderWidth} solid rgb(var(--tb-${settings.borderToken}));
|
|
24969
|
-
border-radius: ${borderRadius};
|
|
24970
|
-
padding: ${INPUT_PADDING};
|
|
24971
|
-
font-size: 1rem;
|
|
24972
|
-
width: 100%;
|
|
24973
|
-
outline: none;
|
|
24974
|
-
transition: border-color 0.2s ease, box-shadow 0.2s ease;
|
|
24975
|
-
${settings.shadow !== "none" ? `box-shadow: ${SHADOW_VALUES[settings.shadow]};` : ""}
|
|
24976
|
-
`.trim();
|
|
24977
|
-
cssBlocks.push(`${root} .form-input,
|
|
24978
|
-
${root} ${INPUT_GROUP_SELECTOR} {
|
|
24979
|
-
${sharedInputRules}
|
|
24980
|
-
}`);
|
|
24981
|
-
cssBlocks.push(bridgeInputGroupCss(root, settings.textToken));
|
|
24982
|
-
cssBlocks.push(`${root} .form-textarea {
|
|
24983
|
-
${sharedInputRules}
|
|
24984
|
-
resize: vertical;
|
|
24985
|
-
min-height: 5rem;
|
|
24986
|
-
}`);
|
|
24987
|
-
cssBlocks.push(`${root} .form-select {
|
|
24988
|
-
${sharedInputRules}
|
|
24989
|
-
appearance: none;
|
|
24990
|
-
background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
|
|
24991
|
-
background-position: right 0.5rem center;
|
|
24992
|
-
background-repeat: no-repeat;
|
|
24993
|
-
background-size: 1.5em 1.5em;
|
|
24994
|
-
padding-right: 2.5rem;
|
|
24995
|
-
}`);
|
|
24996
|
-
cssBlocks.push(`${root} .form-input:focus-visible,
|
|
24997
|
-
${root} .form-textarea:focus-visible,
|
|
24998
|
-
${root} .form-select:focus-visible,
|
|
24999
|
-
${root} ${INPUT_GROUP_FOCUS_SELECTOR} {
|
|
25000
|
-
outline: none;
|
|
25001
|
-
box-shadow: 0 0 0 ${settings.focusRingWidth}px rgb(var(--tb-${settings.focusRingToken}));
|
|
25002
|
-
border-color: rgb(var(--tb-${settings.focusRingToken}));
|
|
25003
|
-
}`);
|
|
25004
|
-
cssBlocks.push(`${root} .form-input[aria-invalid="true"],
|
|
25005
|
-
${root} .form-textarea[aria-invalid="true"],
|
|
25006
|
-
${root} .form-select[aria-invalid="true"],
|
|
25007
|
-
${root} ${INPUT_GROUP_ERROR_SELECTOR} {
|
|
25008
|
-
border-color: rgb(var(--tb-${settings.errorBorderToken}));
|
|
25009
|
-
color: rgb(var(--tb-${settings.errorTextToken}));
|
|
25010
|
-
}`);
|
|
25011
|
-
cssBlocks.push(`${root} .form-input:disabled,
|
|
25012
|
-
${root} .form-textarea:disabled,
|
|
25013
|
-
${root} .form-select:disabled {
|
|
25014
|
-
background-color: rgb(var(--tb-${settings.disabledBackgroundToken}));
|
|
25015
|
-
color: rgb(var(--tb-${settings.disabledTextToken}));
|
|
25016
|
-
opacity: 0.6;
|
|
25017
|
-
cursor: not-allowed;
|
|
25018
|
-
}`);
|
|
25019
|
-
cssBlocks.push(generateCheckableCss({
|
|
25020
|
-
root,
|
|
25021
|
-
borderWidth,
|
|
25022
|
-
borderColor: `rgb(var(--tb-${settings.borderToken}))`,
|
|
25023
|
-
background: `rgb(var(--tb-${settings.backgroundToken}))`,
|
|
25024
|
-
corners: settings.corners,
|
|
25025
|
-
accentToken: settings.focusRingToken,
|
|
25026
|
-
errorColor: `rgb(var(--tb-${settings.errorBorderToken}))`
|
|
25027
|
-
}));
|
|
25028
|
-
return cssBlocks.join("\n\n");
|
|
25029
|
-
}
|
|
25030
|
-
/**
|
|
25031
|
-
* Get default input settings for SDK usage.
|
|
25032
|
-
*/
|
|
25033
|
-
function getDefaultInputSettings() {
|
|
25034
|
-
return {
|
|
25035
|
-
corners: "rounded",
|
|
25036
|
-
shadow: "none",
|
|
25037
|
-
borderWidth: "thin",
|
|
25038
|
-
focusRingToken: "primary",
|
|
25039
|
-
focusRingWidth: 3,
|
|
25040
|
-
backgroundToken: "surface",
|
|
25041
|
-
textToken: "text",
|
|
25042
|
-
borderToken: "border",
|
|
25043
|
-
labelToken: "text",
|
|
25044
|
-
errorBorderToken: "destructive",
|
|
25045
|
-
errorTextToken: "destructive",
|
|
25046
|
-
disabledBackgroundToken: "neutral-100",
|
|
25047
|
-
disabledTextToken: "neutral-400"
|
|
25048
|
-
};
|
|
25049
|
-
}
|
|
25050
|
-
const SYSTEM_FONT_STACK = "ui-sans-serif, system-ui, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\"";
|
|
25051
|
-
const SPACING_CONFIG = {
|
|
25052
|
-
comfortable: {
|
|
25053
|
-
mult: 1.15,
|
|
25054
|
-
rhythm: "1.2rem"
|
|
25055
|
-
},
|
|
25056
|
-
standard: {
|
|
25057
|
-
mult: 1,
|
|
25058
|
-
rhythm: "1rem"
|
|
25059
|
-
},
|
|
25060
|
-
dense: {
|
|
25061
|
-
mult: .88,
|
|
25062
|
-
rhythm: "0.75rem"
|
|
25063
|
-
}
|
|
25064
|
-
};
|
|
25065
|
-
const CORNERS_CONFIG = {
|
|
25066
|
-
square: {
|
|
25067
|
-
control: "0px",
|
|
25068
|
-
card: "0px",
|
|
25069
|
-
block: "0",
|
|
25070
|
-
button: "0.375rem"
|
|
25071
|
-
},
|
|
25072
|
-
soft: {
|
|
25073
|
-
control: "4px",
|
|
25074
|
-
card: "8px",
|
|
25075
|
-
block: "0.5rem",
|
|
25076
|
-
button: "0.375rem"
|
|
25077
|
-
},
|
|
25078
|
-
rounded: {
|
|
25079
|
-
control: "8px",
|
|
25080
|
-
card: "12px",
|
|
25081
|
-
block: "0.75rem",
|
|
25082
|
-
button: "0.5rem"
|
|
25083
|
-
},
|
|
25084
|
-
pill: {
|
|
25085
|
-
control: "9999px",
|
|
25086
|
-
card: "16px",
|
|
25087
|
-
block: "1rem",
|
|
25088
|
-
button: "9999px"
|
|
25089
|
-
}
|
|
25090
|
-
};
|
|
25091
|
-
const SHADOWS_CONFIG = {
|
|
25092
|
-
none: "none",
|
|
25093
|
-
low: "0 1px 2px rgba(0,0,0,.06)",
|
|
25094
|
-
medium: "0 10px 20px rgba(0,0,0,.08)",
|
|
25095
|
-
high: "0 25px 50px rgba(0,0,0,.18)"
|
|
25096
|
-
};
|
|
25097
|
-
const BRIDGE_DEFAULT_TOKENS = {
|
|
25098
|
-
background: "255 255 255",
|
|
25099
|
-
surface: "248 250 252",
|
|
25100
|
-
foreground: "15 23 42",
|
|
25101
|
-
text: "15 23 42",
|
|
25102
|
-
muted: "241 245 249",
|
|
25103
|
-
mutedForeground: "100 116 139",
|
|
25104
|
-
mutedText: "100 116 139",
|
|
25105
|
-
border: "226 232 240",
|
|
25106
|
-
primary: "17 24 39",
|
|
25107
|
-
primaryForeground: "255 255 255",
|
|
25108
|
-
secondary: "71 85 105",
|
|
25109
|
-
secondaryForeground: "255 255 255",
|
|
25110
|
-
white: "255 255 255",
|
|
25111
|
-
success: "22 163 74",
|
|
25112
|
-
destructive: "220 38 38",
|
|
25113
|
-
danger: "220 38 38",
|
|
25114
|
-
error: "220 38 38",
|
|
25115
|
-
warning: "245 158 11",
|
|
25116
|
-
info: "14 165 233",
|
|
25117
|
-
"neutral-100": "241 245 249",
|
|
25118
|
-
"neutral-400": "148 163 184"
|
|
25119
|
-
};
|
|
25120
|
-
const TOKEN_NAME_PATTERN = /^[a-zA-Z][a-zA-Z0-9-]*$/;
|
|
25121
|
-
const CSS_VARIABLE_REFERENCE_PATTERN = /^var\(\s*--[a-zA-Z][a-zA-Z0-9-]*(?:\s*,\s*[^{};<>]+)?\s*\)$/;
|
|
25122
|
-
const CSS_DECLARATION_PROPERTY_PATTERN = /^(?:-[a-zA-Z][a-zA-Z0-9-]*|[a-zA-Z][a-zA-Z0-9-]*|--[a-zA-Z][a-zA-Z0-9-]*)$/;
|
|
25123
|
-
const UNSAFE_CSS_MARKUP_PATTERN = /[{}<>]|<\/|<script/i;
|
|
25124
|
-
const EXTERNAL_URL_PATTERN = /url\s*\(\s*['"]?(?:https?:|\/\/)/i;
|
|
25125
|
-
const JAVASCRIPT_URL_PATTERN = /javascript\s*:/i;
|
|
25126
|
-
const themeBridgeConfigSchema = z.object({
|
|
25127
|
-
tokens: z.record(z.string(), z.string()),
|
|
25128
|
-
typography: z.object({
|
|
25129
|
-
headingFamily: z.string().optional(),
|
|
25130
|
-
bodyFamily: z.string().optional(),
|
|
25131
|
-
headingWeight: z.number().optional(),
|
|
25132
|
-
bodyWeight: z.number().optional()
|
|
25133
|
-
}).optional(),
|
|
25134
|
-
spacing: z.enum([
|
|
25135
|
-
"comfortable",
|
|
25136
|
-
"standard",
|
|
25137
|
-
"dense"
|
|
25138
|
-
]).optional(),
|
|
25139
|
-
corners: z.enum([
|
|
25140
|
-
"square",
|
|
25141
|
-
"soft",
|
|
25142
|
-
"rounded",
|
|
25143
|
-
"pill"
|
|
25144
|
-
]).optional(),
|
|
25145
|
-
shadows: z.enum([
|
|
25146
|
-
"none",
|
|
25147
|
-
"low",
|
|
25148
|
-
"medium",
|
|
25149
|
-
"high"
|
|
25150
|
-
]).optional(),
|
|
25151
|
-
components: z.object({
|
|
25152
|
-
buttons: z.union([z.boolean(), z.object({ variants: z.array(z.enum([
|
|
25153
|
-
"primary",
|
|
25154
|
-
"secondary",
|
|
25155
|
-
"outline",
|
|
25156
|
-
"ghost"
|
|
25157
|
-
])).optional() })]).optional(),
|
|
25158
|
-
cards: z.union([z.boolean(), z.object({ variants: z.array(z.enum([
|
|
25159
|
-
"default",
|
|
25160
|
-
"alternative",
|
|
25161
|
-
"open",
|
|
25162
|
-
"elevated",
|
|
25163
|
-
"outlined"
|
|
25164
|
-
])).optional() })]).optional(),
|
|
25165
|
-
inputs: z.boolean().optional()
|
|
25166
|
-
}).optional(),
|
|
25167
|
-
overrides: z.record(z.string(), z.string()).optional()
|
|
25168
|
-
}).passthrough();
|
|
25169
|
-
const TOKEN_ALIASES = [
|
|
25170
|
-
{
|
|
25171
|
-
source: "text",
|
|
25172
|
-
target: "foreground"
|
|
25173
|
-
},
|
|
25174
|
-
{
|
|
25175
|
-
source: "foreground",
|
|
25176
|
-
target: "text"
|
|
25177
|
-
},
|
|
25178
|
-
{
|
|
25179
|
-
source: "mutedText",
|
|
25180
|
-
target: "mutedForeground"
|
|
25181
|
-
},
|
|
25182
|
-
{
|
|
25183
|
-
source: "mutedForeground",
|
|
25184
|
-
target: "mutedText"
|
|
25185
|
-
},
|
|
25186
|
-
{
|
|
25187
|
-
source: "white",
|
|
25188
|
-
target: "primaryForeground"
|
|
25189
|
-
},
|
|
25190
|
-
{
|
|
25191
|
-
source: "danger",
|
|
25192
|
-
target: "destructive"
|
|
25193
|
-
},
|
|
25194
|
-
{
|
|
25195
|
-
source: "destructive",
|
|
25196
|
-
target: "danger"
|
|
25197
|
-
},
|
|
25198
|
-
{
|
|
25199
|
-
source: "destructive",
|
|
25200
|
-
target: "error"
|
|
25201
|
-
},
|
|
25202
|
-
{
|
|
25203
|
-
source: "accent",
|
|
25204
|
-
target: "info"
|
|
25205
|
-
}
|
|
25206
|
-
];
|
|
25207
|
-
function normalizeTokenValue(value) {
|
|
25208
|
-
const trimmedValue = value.trim();
|
|
25209
|
-
if (!isSafeBridgeTokenValue(trimmedValue)) throw new Error(`[ThemeBridge] Invalid token value "${value}": expected a hex colour, CSS var(), or RGB channel value.`);
|
|
25210
|
-
if (trimmedValue.startsWith("var(")) return trimmedValue;
|
|
25211
|
-
if (trimmedValue.startsWith("#")) return hexToRgbChannels(trimmedValue);
|
|
25212
|
-
return trimmedValue;
|
|
25213
|
-
}
|
|
25214
|
-
function buildThemeBridgeRuntime(config) {
|
|
25215
|
-
const validatedConfig = validateThemeBridgeConfig(config);
|
|
25216
|
-
const cssVars = buildBridgeCssVars(validatedConfig);
|
|
25217
|
-
const themeId = "sdk";
|
|
25218
|
-
const corners = validatedConfig.corners ?? "rounded";
|
|
25219
|
-
const generatorTheme = buildBridgeGeneratorTheme(corners);
|
|
25220
|
-
return {
|
|
25221
|
-
themeId,
|
|
25222
|
-
cssVars,
|
|
25223
|
-
buttonCss: shouldGenerateComponent(config.components?.buttons) ? generateButtonsCss(config, corners, config.shadows ?? "medium") : void 0,
|
|
25224
|
-
cardCss: `${generateCardsCss(config, corners, config.shadows ?? "medium")}\n\n${generateOpaquePanelCss({
|
|
25225
|
-
themeId,
|
|
25226
|
-
surface: {
|
|
25227
|
-
palette: buildBridgeButtonPalette(resolveBridgeTokens(validatedConfig.tokens)),
|
|
25228
|
-
buttonSystem: void 0,
|
|
25229
|
-
solvedInks: "withhold"
|
|
25230
|
-
}
|
|
25231
|
-
})}`,
|
|
25232
|
-
inputCss: shouldGenerateComponent(config.components?.inputs) ? generateInputsCss(corners, config.shadows ?? "medium") : void 0,
|
|
25233
|
-
statusCss: generateStatusCss({
|
|
25234
|
-
themeId,
|
|
25235
|
-
theme: generatorTheme,
|
|
25236
|
-
palette: buildBridgeButtonPalette(resolveBridgeTokens(validatedConfig.tokens))
|
|
25237
|
-
}),
|
|
25238
|
-
progressCss: generateProgressCss({
|
|
25239
|
-
themeId,
|
|
25240
|
-
theme: generatorTheme
|
|
25241
|
-
}),
|
|
25242
|
-
typographyCss: generateTypographyCss({ themeId }),
|
|
25243
|
-
blockVarsCss: generateAllBlockVarsCss({
|
|
25244
|
-
themeId,
|
|
25245
|
-
theme: generatorTheme
|
|
25246
|
-
}),
|
|
25247
|
-
customCss: hasBridgeOverrides(config.overrides) ? generateOverrideCss(config.overrides) : void 0
|
|
25248
|
-
};
|
|
25249
|
-
}
|
|
25250
|
-
function buildBridgeCssVars(config) {
|
|
25251
|
-
const tokens = resolveBridgeTokens(config.tokens);
|
|
25252
|
-
return {
|
|
25253
|
-
...buildColorCssVars({
|
|
25254
|
-
...tokens,
|
|
25255
|
-
...deriveConcreteBridgeOnTokens(tokens)
|
|
25256
|
-
}),
|
|
25257
|
-
...buildTypographyCssVars(config.typography),
|
|
25258
|
-
...buildFontSizeCssVars(),
|
|
25259
|
-
...buildTextRhythmCssVars(),
|
|
25260
|
-
...buildSpacingCssVars(config.spacing),
|
|
25261
|
-
...buildCornerCssVars(config.corners),
|
|
25262
|
-
...buildShadowCssVars(config.shadows),
|
|
25263
|
-
...buildMotionCssVars()
|
|
25264
|
-
};
|
|
25265
|
-
}
|
|
25266
|
-
function buildColorCssVars(tokens) {
|
|
25267
|
-
const cssVars = {};
|
|
25268
|
-
for (const [name, value] of Object.entries(tokens)) cssVars[`--tb-${name}`] = value;
|
|
25269
|
-
return cssVars;
|
|
25270
|
-
}
|
|
25271
|
-
function buildTypographyCssVars(typography) {
|
|
25272
|
-
const cssVars = {};
|
|
25273
|
-
const typographyConfig = typography ?? {};
|
|
25274
|
-
const headingFamily = typographyConfig.headingFamily ?? SYSTEM_FONT_STACK;
|
|
25275
|
-
const bodyFamily = typographyConfig.bodyFamily ?? SYSTEM_FONT_STACK;
|
|
25276
|
-
const headingWeight = typographyConfig.headingWeight ?? 600;
|
|
25277
|
-
const bodyWeight = typographyConfig.bodyWeight ?? 400;
|
|
25278
|
-
cssVars["--font-heading"] = headingFamily;
|
|
25279
|
-
cssVars["--font-body"] = bodyFamily;
|
|
25280
|
-
cssVars["--font-weight-heading"] = headingWeight;
|
|
25281
|
-
cssVars["--font-weight-body"] = bodyWeight;
|
|
25282
|
-
cssVars["--tb-font-heading"] = headingFamily;
|
|
25283
|
-
cssVars["--tb-font-body"] = bodyFamily;
|
|
25284
|
-
cssVars["--tb-font-weight-heading"] = String(headingWeight);
|
|
25285
|
-
cssVars["--tb-font-weight-body"] = String(bodyWeight);
|
|
25286
|
-
return cssVars;
|
|
25287
|
-
}
|
|
25288
|
-
function buildFontSizeCssVars() {
|
|
25289
|
-
return {
|
|
25290
|
-
"--fs-h1": "2.5rem",
|
|
25291
|
-
"--fs-h2": "2rem",
|
|
25292
|
-
"--fs-h3": "1.5rem",
|
|
25293
|
-
"--fs-body": "1rem",
|
|
25294
|
-
"--fs-h1-fluid": "clamp(2rem, 1.5rem + 2.5vw, 2.5rem)",
|
|
25295
|
-
"--fs-h2-fluid": "clamp(1.5rem, 1.25rem + 1.5vw, 2rem)",
|
|
25296
|
-
"--fs-h3-fluid": "clamp(1.25rem, 1rem + 1vw, 1.5rem)",
|
|
25297
|
-
"--fs-h1-display": "3.75rem",
|
|
25298
|
-
"--fs-h1-display-fluid": "clamp(2.5rem, 2rem + 4vw, 3.75rem)",
|
|
25299
|
-
"--tb-fs-h1": "2.5rem",
|
|
25300
|
-
"--tb-fs-h2": "2rem",
|
|
25301
|
-
"--tb-fs-h3": "1.5rem",
|
|
25302
|
-
"--tb-fs-body": "1rem"
|
|
25303
|
-
};
|
|
25304
|
-
}
|
|
25305
|
-
function buildTextRhythmCssVars() {
|
|
25306
|
-
return {
|
|
25307
|
-
"--ls-heading": "-0.02em",
|
|
25308
|
-
"--ls-body": "0em",
|
|
25309
|
-
"--lh-heading": "1.2",
|
|
25310
|
-
"--lh-body": "1.5",
|
|
25311
|
-
"--tt-heading": "none",
|
|
25312
|
-
"--fv-heading": "normal",
|
|
25313
|
-
"--fi-heading": "normal",
|
|
25314
|
-
"--tb-ls-heading": "-0.02em",
|
|
25315
|
-
"--tb-ls-body": "0em",
|
|
25316
|
-
"--tb-lh-heading": "1.2",
|
|
25317
|
-
"--tb-lh-body": "1.5",
|
|
25318
|
-
"--tb-tt-heading": "none",
|
|
25319
|
-
"--tb-fv-heading": "normal"
|
|
25320
|
-
};
|
|
25321
|
-
}
|
|
25322
|
-
function buildSpacingCssVars(spacing) {
|
|
25323
|
-
const spacingPreset = SPACING_CONFIG[spacing ?? "standard"];
|
|
25324
|
-
return {
|
|
25325
|
-
"--space-mult": spacingPreset.mult,
|
|
25326
|
-
"--rt-space-y": spacingPreset.rhythm,
|
|
25327
|
-
"--tb-space-mult": String(spacingPreset.mult),
|
|
25328
|
-
"--tb-rt-space-y": spacingPreset.rhythm
|
|
25329
|
-
};
|
|
25330
|
-
}
|
|
25331
|
-
function buildCornerCssVars(corners) {
|
|
25332
|
-
const cornersPreset = CORNERS_CONFIG[corners ?? "rounded"];
|
|
25333
|
-
return {
|
|
25334
|
-
[THEME_RADIUS_CSS_VARS.block]: cornersPreset.block,
|
|
25335
|
-
[THEME_RADIUS_CSS_VARS.button]: cornersPreset.button,
|
|
25336
|
-
[THEME_RADIUS_CSS_VARS.input]: cornersPreset.control,
|
|
25337
|
-
[THEME_RADIUS_CSS_VARS.legacyControl]: cornersPreset.control,
|
|
25338
|
-
[THEME_RADIUS_CSS_VARS.legacyCard]: cornersPreset.block,
|
|
25339
|
-
"--tb-radius-control": cornersPreset.control,
|
|
25340
|
-
"--tb-radius-card": cornersPreset.card
|
|
25341
|
-
};
|
|
25342
|
-
}
|
|
25343
|
-
function buildShadowCssVars(shadows) {
|
|
25344
|
-
const shadowPreset = shadows ?? "medium";
|
|
25345
|
-
const shadowElev = SHADOWS_CONFIG[shadowPreset];
|
|
25346
|
-
const cssVars = { "--shadow-elev": shadowElev };
|
|
25347
|
-
cssVars["--tb-shadow-elev"] = shadowElev;
|
|
25348
|
-
if (shadows === "none") {
|
|
25349
|
-
cssVars["--shadow-sm"] = "none";
|
|
25350
|
-
cssVars["--shadow-md"] = "none";
|
|
25351
|
-
cssVars["--shadow-lg"] = "none";
|
|
25352
|
-
cssVars["--shadow-xl"] = "none";
|
|
25353
|
-
cssVars["--shadow-2xl"] = "none";
|
|
25354
|
-
} else Object.assign(cssVars, generateShadowCssVars({ shadow: {
|
|
25355
|
-
elevation: shadowPreset,
|
|
25356
|
-
softness: "crisp",
|
|
25357
|
-
position: "bottom"
|
|
25358
|
-
} }));
|
|
25359
|
-
cssVars["--tb-shadow-sm"] = cssVars["--shadow-sm"] ?? shadowElev;
|
|
25360
|
-
cssVars["--tb-shadow-md"] = cssVars["--shadow-md"] ?? shadowElev;
|
|
25361
|
-
cssVars["--tb-shadow-lg"] = cssVars["--shadow-lg"] ?? shadowElev;
|
|
25362
|
-
cssVars["--tb-shadow-xl"] = cssVars["--shadow-xl"] ?? shadowElev;
|
|
25363
|
-
cssVars["--tb-shadow-2xl"] = cssVars["--shadow-2xl"] ?? shadowElev;
|
|
25364
|
-
return cssVars;
|
|
25365
|
-
}
|
|
25366
|
-
function buildMotionCssVars() {
|
|
25367
|
-
return {
|
|
25368
|
-
"--motion-duration": "180ms",
|
|
25369
|
-
"--motion-ease": "cubic-bezier(0.2, 0.8, 0.2, 1)",
|
|
25370
|
-
"--rb-block-transition": "150ms",
|
|
25371
|
-
"--tb-motion-duration": "180ms",
|
|
25372
|
-
"--tb-motion-ease": "cubic-bezier(0.2, 0.8, 0.2, 1)"
|
|
25373
|
-
};
|
|
25374
|
-
}
|
|
25375
|
-
function validateThemeBridgeConfig(config) {
|
|
25376
|
-
if (!config || typeof config !== "object") throw new Error("[ThemeBridge] Invalid config: expected an object with a \"tokens\" property.");
|
|
25377
|
-
if (!config.tokens || typeof config.tokens !== "object" || Array.isArray(config.tokens)) throw new Error("[ThemeBridge] Missing \"tokens\" property in config. ThemeBridgeConfig requires a \"tokens\" object with color definitions. Example: { tokens: { primary: \"#6d28d9\", background: \"#ffffff\" } }");
|
|
25378
|
-
const parsedConfig = themeBridgeConfigSchema.safeParse(config);
|
|
25379
|
-
if (!parsedConfig.success) {
|
|
25380
|
-
const firstIssue = parsedConfig.error.issues[0];
|
|
25381
|
-
throw new Error(`[ThemeBridge] Invalid config: ${firstIssue?.message ?? "failed validation"}.`);
|
|
25382
|
-
}
|
|
25383
|
-
validateBridgeTokens(config.tokens);
|
|
25384
|
-
if (config.overrides !== void 0) parseBridgeOverrideRules(config.overrides);
|
|
25385
|
-
return config;
|
|
25386
|
-
}
|
|
25387
|
-
function resolveBridgeTokens(tokens) {
|
|
25388
|
-
const resolved = {};
|
|
25389
|
-
for (const [name, rawValue] of Object.entries(tokens)) if (isPresentTokenValue(rawValue)) resolved[name] = normalizeTokenValue(rawValue);
|
|
25390
|
-
for (const { source, target } of TOKEN_ALIASES) if (!isPresentTokenValue(resolved[target]) && isPresentTokenValue(resolved[source])) resolved[target] = resolved[source];
|
|
25391
|
-
for (const [name, value] of Object.entries(BRIDGE_DEFAULT_TOKENS)) if (!isPresentTokenValue(resolved[name])) resolved[name] = value;
|
|
25392
|
-
return resolved;
|
|
25393
|
-
}
|
|
25394
|
-
function isPresentTokenValue(value) {
|
|
25395
|
-
return typeof value === "string" && value.trim().length > 0;
|
|
25396
|
-
}
|
|
25397
|
-
function isSafeBridgeTokenName(name) {
|
|
25398
|
-
return TOKEN_NAME_PATTERN.test(name);
|
|
25399
|
-
}
|
|
25400
|
-
function isSafeBridgeTokenValue(value) {
|
|
25401
|
-
const trimmedValue = value.trim();
|
|
25402
|
-
if (trimmedValue.length === 0) return true;
|
|
25403
|
-
if (trimmedValue.startsWith("#")) return true;
|
|
25404
|
-
if (trimmedValue.startsWith("var(")) return CSS_VARIABLE_REFERENCE_PATTERN.test(trimmedValue);
|
|
25405
|
-
return isRgbChannelValue(trimmedValue);
|
|
25406
|
-
}
|
|
25407
|
-
function isRgbChannelValue(value) {
|
|
25408
|
-
const match = value.match(RGB_CHANNELS_PATTERN);
|
|
25409
|
-
if (!match) return false;
|
|
25410
|
-
const [, red, green, blue, alpha] = match;
|
|
25411
|
-
if (![
|
|
25412
|
-
red,
|
|
25413
|
-
green,
|
|
25414
|
-
blue
|
|
25415
|
-
].map((channel) => Number(channel)).every((channel) => Number.isInteger(channel) && channel >= 0 && channel <= 255)) return false;
|
|
25416
|
-
if (alpha === void 0) return true;
|
|
25417
|
-
if (alpha.endsWith("%")) {
|
|
25418
|
-
const percent = Number(alpha.slice(0, -1));
|
|
25419
|
-
return Number.isFinite(percent) && percent >= 0 && percent <= 100;
|
|
25420
|
-
}
|
|
25421
|
-
const alphaNumber = Number(alpha);
|
|
25422
|
-
return Number.isFinite(alphaNumber) && alphaNumber >= 0 && alphaNumber <= 1;
|
|
25423
|
-
}
|
|
25424
|
-
function validateBridgeTokens(tokens) {
|
|
25425
|
-
for (const [name, value] of Object.entries(tokens)) {
|
|
25426
|
-
if (!isSafeBridgeTokenName(name)) throw new Error(`[ThemeBridge] Invalid token name "${name}": token names must match ${String(TOKEN_NAME_PATTERN)}.`);
|
|
25427
|
-
if (typeof value !== "string" || !isSafeBridgeTokenValue(value)) throw new Error(`[ThemeBridge] Invalid token value for "${name}": expected a hex colour, CSS var(), or RGB channel value.`);
|
|
25428
|
-
}
|
|
25429
|
-
}
|
|
25430
|
-
function parseBridgeOverrideRules(overrides) {
|
|
25431
|
-
if (!overrides || typeof overrides !== "object" || Array.isArray(overrides)) throw new Error("[ThemeBridge] Invalid overrides: expected a selector-to-rules object.");
|
|
25432
|
-
return Object.entries(overrides).map(([selector, rules], index) => {
|
|
25433
|
-
if (hasUnsafeCssFragment(selector)) throw new Error(`[ThemeBridge] Invalid override selector "${selector}": selectors contain unsafe CSS markup or external URLs.`);
|
|
25434
|
-
return {
|
|
25435
|
-
id: `theme-bridge-override-${index + 1}`,
|
|
25436
|
-
selector,
|
|
25437
|
-
declarations: parseBridgeOverrideDeclarations(selector, rules)
|
|
25438
|
-
};
|
|
25439
|
-
});
|
|
25440
|
-
}
|
|
25441
|
-
function parseBridgeOverrideDeclarations(selector, rules) {
|
|
25442
|
-
if (typeof rules !== "string") throw new Error(`[ThemeBridge] Invalid override for "${selector}": expected a CSS declaration string.`);
|
|
25443
|
-
if (hasUnsafeCssFragment(rules)) throw new Error(`[ThemeBridge] Invalid override for "${selector}": rules contain unsafe CSS markup or external URLs.`);
|
|
25444
|
-
const declarations = {};
|
|
25445
|
-
for (const declaration of rules.split(";")) {
|
|
25446
|
-
const trimmedDeclaration = declaration.trim();
|
|
25447
|
-
if (trimmedDeclaration.length === 0) continue;
|
|
25448
|
-
const colonIndex = trimmedDeclaration.indexOf(":");
|
|
25449
|
-
if (colonIndex <= 0) throw new Error(`[ThemeBridge] Invalid override for "${selector}": expected "property: value" declarations.`);
|
|
25450
|
-
const property = trimmedDeclaration.slice(0, colonIndex).trim();
|
|
25451
|
-
const value = trimmedDeclaration.slice(colonIndex + 1).trim();
|
|
25452
|
-
if (!CSS_DECLARATION_PROPERTY_PATTERN.test(property) || value.length === 0) throw new Error(`[ThemeBridge] Invalid override for "${selector}": expected safe CSS declaration names and values.`);
|
|
25453
|
-
if (hasUnsafeCssFragment(value)) throw new Error(`[ThemeBridge] Invalid override for "${selector}": declaration value contains unsafe CSS.`);
|
|
25454
|
-
declarations[property] = value;
|
|
25455
|
-
}
|
|
25456
|
-
return declarations;
|
|
25457
|
-
}
|
|
25458
|
-
function hasUnsafeCssFragment(value) {
|
|
25459
|
-
return UNSAFE_CSS_MARKUP_PATTERN.test(value) || /@import/i.test(value) || EXTERNAL_URL_PATTERN.test(value) || JAVASCRIPT_URL_PATTERN.test(value);
|
|
25460
|
-
}
|
|
25461
|
-
function shouldGenerateComponent(value) {
|
|
25462
|
-
return value !== void 0 && value !== false;
|
|
25463
|
-
}
|
|
25464
|
-
function generateButtonsCss(config, corners, shadows) {
|
|
25465
|
-
let variants = getDefaultButtonVariants();
|
|
25466
|
-
const buttonConfig = config.components?.buttons;
|
|
25467
|
-
if (typeof buttonConfig === "object" && buttonConfig.variants) {
|
|
25468
|
-
const requestedIds = new Set(buttonConfig.variants);
|
|
25469
|
-
variants = variants.filter((variant) => requestedIds.has(variant.id));
|
|
25470
|
-
}
|
|
25471
|
-
const settings = {
|
|
25472
|
-
corners,
|
|
25473
|
-
shadow: shadows,
|
|
25474
|
-
fontWeight: 500,
|
|
25475
|
-
textTransform: "none"
|
|
25476
|
-
};
|
|
25477
|
-
const tokens = resolveBridgeTokens(config.tokens);
|
|
25478
|
-
return generateButtonCoreCss("sdk", variants, settings, buildBridgeButtonPalette(tokens));
|
|
25479
|
-
}
|
|
25480
|
-
/**
|
|
25481
|
-
* Bridge card CSS, in two halves with different opt-in rules.
|
|
25482
|
-
*
|
|
25483
|
-
* The `.card-role-*` aliases always emit, from the full default variant set:
|
|
25484
|
-
* they are the card contract compiled content renders against, so a consumer
|
|
25485
|
-
* who never mentions `components.cards` still gets a working card surface.
|
|
25486
|
-
* The named `.card-{id}` classes (and the legacy ids beside them) are a
|
|
25487
|
-
* catalogue an SDK site addresses by hand, so they stay opt-in and keep
|
|
25488
|
-
* honouring a `variants` allow-list.
|
|
25489
|
-
*/
|
|
25490
|
-
function generateCardsCss(config, corners, shadows) {
|
|
25491
|
-
const allVariants = getDefaultCardVariants();
|
|
25492
|
-
const cardConfig = config.components?.cards;
|
|
25493
|
-
const settings = {
|
|
25494
|
-
corners,
|
|
25495
|
-
shadow: shadows,
|
|
25496
|
-
borderWidth: "thin"
|
|
25497
|
-
};
|
|
25498
|
-
const roleAliasCss = generateCardCoreCss("sdk", allVariants, settings, "role-aliases");
|
|
25499
|
-
if (cardConfig === void 0 || cardConfig === false) return roleAliasCss;
|
|
25500
|
-
let namedVariants = allVariants;
|
|
25501
|
-
if (cardConfig !== true && cardConfig.variants) {
|
|
25502
|
-
const requested = new Set(cardConfig.variants);
|
|
25503
|
-
namedVariants = allVariants.filter((variant) => requested.has(variant.id) || variant.role !== void 0 && requested.has(variant.role) || (variant.legacyIds ?? []).some((legacyId) => requested.has(legacyId)));
|
|
25504
|
-
}
|
|
25505
|
-
return [roleAliasCss, generateCardCoreCss("sdk", namedVariants, settings, "named")].filter(Boolean).join("\n\n");
|
|
25506
|
-
}
|
|
25507
|
-
function generateInputsCss(corners, shadows) {
|
|
25508
|
-
return generateInputCoreCss("sdk", {
|
|
25509
|
-
...getDefaultInputSettings(),
|
|
25510
|
-
corners,
|
|
25511
|
-
shadow: shadows === "none" ? "none" : "low"
|
|
25512
|
-
});
|
|
25513
|
-
}
|
|
25514
|
-
function hasBridgeOverrides(overrides) {
|
|
25515
|
-
return overrides !== void 0 && Object.keys(overrides).length > 0;
|
|
25516
|
-
}
|
|
25517
|
-
function generateOverrideCss(overrides) {
|
|
25518
|
-
return compileCustomCssRules(parseCustomCssRules(parseBridgeOverrideRules(overrides)), "sdk");
|
|
25519
|
-
}
|
|
25520
|
-
function buildBridgeGeneratorTheme(corners) {
|
|
25521
|
-
return {
|
|
25522
|
-
corners,
|
|
25523
|
-
motion: {
|
|
25524
|
-
level: "medium",
|
|
25525
|
-
easing: "standard"
|
|
25526
|
-
}
|
|
25527
|
-
};
|
|
25528
|
-
}
|
|
25529
|
-
z.object({
|
|
25530
|
-
palette: paletteColorsSchema,
|
|
25531
|
-
paletteMode: paletteModeSchema,
|
|
25532
|
-
typography: z.object({
|
|
25533
|
-
headingFamily: z.string().trim().min(1),
|
|
25534
|
-
bodyFamily: z.string().trim().min(1)
|
|
25535
|
-
}).strict(),
|
|
25536
|
-
corners
|
|
25537
|
-
}).strict();
|
|
25538
|
-
//#endregion
|
|
25539
|
-
export { buildThemeRuntime as a, ThemeScopeCore as i, ResponsiveScope as n, mergeContentWithBlockStyleOverrides as o, ThemeScope as r, generateDefaultAccordionSystem as s, buildThemeBridgeRuntime as t };
|
|
23185
|
+
export { getResponsiveScopeSpec as C, renderCssDeclarations as D, resolvedButtonFocusDeclarations as E, cardBorderDeclarations as O, THEME_RESPONSIVE_CONTAINER_NAME as S, resolvedButtonColourDeclarations as T, generateInputGroupCss as _, escapeStyleContent as a, generateShadowCssVars as b, generateAllBlockVarsCss as c, generateTypographyCss as d, generateProgressCss as f, INPUT_GROUP_SELECTOR as g, INPUT_GROUP_FOCUS_SELECTOR as h, compileCustomCssRules as i, cardDecorationPseudoRules as k, generateBlockCustomVarsCss as l, INPUT_GROUP_ERROR_SELECTOR as m, containerResponsiveThemeCss as n, prefixSelector as o, generateStatusCss as p, compileBlockCustomCssRules as r, toKebabCase as s, ThemeScopeCore as t, THEME_RADIUS_CSS_VARS as u, generateCheckableCss as v, RESOLVED_BUTTON_DISABLED_DECLARATIONS as w, DEFAULT_THEME_RESPONSIVE_MODE as x, generateOpaquePanelCss as y };
|