@riverbankcms/sdk 0.180.0 → 0.181.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_dts/{BlocksIslandsHydrator-DC_AvZwy.d.ts → BlocksIslandsHydrator-CVCasDPz.d.ts} +1 -1
- package/dist/_dts/{Page-DQOxVtp3.d.ts → Page-Dtj2Ui3S.d.ts} +7 -7
- package/dist/_dts/{SdkPreviewMode-DrLgY9_f.d.ts → SdkPreviewMode-D1f_60WW.d.ts} +2 -2
- package/dist/_dts/{client-BP7VBRvs.d.ts → client-Chr9pNVW.d.ts} +58 -70
- package/dist/_dts/{content-types-1-K2qi__.d.ts → content-types-kjccgopX.d.ts} +2 -2
- package/dist/_dts/{contracts-Dfqz0Tcu.d.ts → contracts-BodaiS00.d.ts} +3 -3
- package/dist/_dts/{generatePageMetadata-CSfAqmry.d.ts → generatePageMetadata-BS6kaJFp.d.ts} +2 -2
- package/dist/_dts/{index-BeM5Ylwf.d.ts → index-Brl6_I2j.d.ts} +1 -2
- package/dist/_dts/{index-CB5Csefo.d.ts → index-CJkefwYh.d.ts} +2 -2
- package/dist/_dts/{index-DQBGwBPx.d.ts → index-D1WpKwQe.d.ts} +1 -1
- package/dist/_dts/{index-DQr358-m.d.ts → index-DG0OvBs0.d.ts} +8 -8
- package/dist/_dts/{index-Blrw2oVk.d.ts → index-Diqt0PvG.d.ts} +1 -1
- package/dist/_dts/{index-DCcxLa8p.d.ts → index-Dy50xUMK.d.ts} +2 -2
- package/dist/_dts/{loadContent-BG2tLGXj.d.ts → loadContent-BgxshKrA.d.ts} +7 -7
- package/dist/_dts/{request-P08l6mkr.d.ts → request-CA0izds5.d.ts} +2498 -1108
- package/dist/_dts/{resolveBlockData-BDHc8lFs.d.ts → resolveBlockData-ChQmwEd3.d.ts} +5 -5
- package/dist/_dts/{resolvePageContent-Y3IZBbtL.d.ts → resolvePageContent-BvGyvblj.d.ts} +1 -1
- package/dist/_dts/sdk/src/bookings/index.d.ts +2 -2
- package/dist/_dts/sdk/src/client/types.d.ts +2 -2
- package/dist/_dts/sdk/src/client.d.ts +7 -7
- package/dist/_dts/sdk/src/config/index.d.ts +6 -6
- package/dist/_dts/sdk/src/config/template-validation.d.ts +1 -1
- package/dist/_dts/sdk/src/config/validation.d.ts +1 -1
- package/dist/_dts/sdk/src/data/dataLoaderContext.d.ts +2 -2
- package/dist/_dts/sdk/src/data/resolveBlockData.d.ts +1 -1
- package/dist/_dts/sdk/src/data/types.d.ts +2 -2
- package/dist/_dts/sdk/src/gifting/client.d.ts +1 -2
- package/dist/_dts/sdk/src/index.d.ts +104 -8
- package/dist/_dts/sdk/src/manifest/index.d.ts +3 -3
- package/dist/_dts/sdk/src/metadata/index.d.ts +1 -1
- package/dist/_dts/sdk/src/navigation/index.d.ts +3 -3
- package/dist/_dts/sdk/src/next/index.d.ts +83 -52
- package/dist/_dts/sdk/src/next/middleware.d.ts +2 -2
- package/dist/_dts/sdk/src/page-converter/index.d.ts +3 -3
- package/dist/_dts/sdk/src/portal/client.d.ts +43 -56
- package/dist/_dts/sdk/src/portal/index.d.ts +3 -18
- package/dist/_dts/sdk/src/prebuild/index.d.ts +1 -1
- package/dist/_dts/sdk/src/preview-next/before-render.d.ts +2 -2
- package/dist/_dts/sdk/src/preview-next/client/index.d.ts +2 -2
- package/dist/_dts/sdk/src/preview-next/client/runtime.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/client.d.ts +2 -2
- package/dist/_dts/sdk/src/rendering/components/pageShared.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/helpers/loadPage.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/helpers/pageRuntimeSupport.d.ts +4 -4
- package/dist/_dts/sdk/src/rendering/index.d.ts +6 -6
- package/dist/_dts/sdk/src/rendering/islands/client.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/server.d.ts +2 -2
- package/dist/_dts/sdk/src/rendering/themeAdmission.d.ts +1 -1
- package/dist/_dts/sdk/src/routing/index.d.ts +6 -6
- package/dist/_dts/sdk/src/server.d.ts +5 -5
- package/dist/_dts/sdk/src/spam-protection/index.d.ts +2 -2
- package/dist/_dts/sdk/src/theme/index.d.ts +1 -1
- package/dist/_dts/{serviceBookingOutline-BvtNagjw.d.ts → serviceBookingOutline-BgFbJQhU.d.ts} +6 -6
- package/dist/_dts/{types-HAy1-Jjo.d.ts → types-CQrsP1x_.d.ts} +3 -3
- package/dist/_dts/{types-DpEAnP4F.d.ts → types-CgS3xLk8.d.ts} +2 -2
- package/dist/_dts/{types-BrK6SS5c.d.ts → types-R65DKjPn.d.ts} +7 -7
- package/dist/_dts/{validation-D6q3tOBA.d.ts → validation-6LTIbuBA.d.ts} +4 -4
- package/dist/client/{BlocksIslandsHydrator-DJSmdNUJ.mjs → BlocksIslandsHydrator-DqZPz6oW.mjs} +19 -19
- package/dist/client/{BookingMailingListNote-CGxg37zx.mjs → BookingMailingListNote-uWfR2kaG.mjs} +93 -18
- package/dist/client/{BookingQuestionFields-DXegGSnS.mjs → BookingQuestionFields-CyNIKw6k.mjs} +7 -87
- package/dist/client/CalendarAction-D_Glwvz2.mjs +105 -0
- package/dist/client/{CalendarNavigationChevron-VfP50sYm.mjs → CalendarNavigationChevron-BGCX3zwG.mjs} +6 -6
- package/dist/client/{CheckboxChoice-BZPLCgTU.mjs → CheckboxChoice-C8i4NraK.mjs} +1 -1
- package/dist/client/{DemoBookingPortalAccess-0Ua44F1j.mjs → DemoBookingPortalAccess-DFLPyuqe.mjs} +9 -6
- package/dist/client/{EventCalendar.client-CrpiyDSP.mjs → EventCalendar.client-zDL4-t-B.mjs} +10 -10
- package/dist/client/{EventCombined.client-D0me9wnz.mjs → EventCombined.client-uciDKLID.mjs} +60 -10
- package/dist/client/{EventEmbeddedCheckoutStep-BDnicDM6.mjs → EventEmbeddedCheckoutStep-BGkbUhuw.mjs} +1 -1
- package/dist/client/{EventItem-CJITrGkF.mjs → EventItem-CwzrjcRw.mjs} +6 -6
- package/dist/client/{EventListWeekNavigation-BlEm_xjq.mjs → EventListWeekNavigation-ChvcnPma.mjs} +1 -1
- package/dist/client/{EventListing.client-BNM_HuS0.mjs → EventListing.client-DA57Qoyx.mjs} +3 -3
- package/dist/client/{EventListing.view-CXfb7RRy.mjs → EventListing.view-DZ0qMFF4.mjs} +6 -6
- package/dist/client/{EventRegistrationPayment-DiD9uYs6.mjs → EventRegistrationPayment-DSqCJL8E.mjs} +700 -514
- package/dist/client/{Page-bX7iy_MK.mjs → Page-C7mygH_f.mjs} +389 -248
- package/dist/client/{ProtectedSubmitButton-De6AzhE6.mjs → ProtectedSubmitButton-BNnKuir8.mjs} +1 -1
- package/dist/client/{SiteTermsAgreementField-BAdW5DvE.mjs → SiteTermsAgreementField-B4z-e4Wq.mjs} +7 -11
- package/dist/client/{StepIndicator-DCfdcb7s.mjs → StepIndicator-Dn_DY4oY.mjs} +1 -1
- package/dist/client/{StepIndicator-DCqorVne.mjs → StepIndicator-atfDU82W.mjs} +21 -13
- package/dist/client/{ThemedButton-CnSa7o-I.mjs → ThemedButton-PFOhXktM.mjs} +1 -33
- package/dist/client/{accessibleSurfaces-Wl8-_OVJ.mjs → accessibleSurfaces-n6kS6Hct.mjs} +77 -1
- package/dist/client/{accordion-wofJY8xY.mjs → accordion-CsW8U3ff.mjs} +1 -1
- package/dist/client/{booking-form.client-CYl9NrqS.mjs → booking-form.client-cBWM392H.mjs} +52 -29
- package/dist/client/bookingCalendar--aWnqFDn.mjs +180 -0
- package/dist/client/{bookingForm-kgVWtuMe.mjs → bookingForm-DgySpp6C.mjs} +4 -4
- package/dist/client/bookings.mjs +17 -11
- package/dist/client/{boxStyleClassNames-CQHWz5gJ.mjs → boxStyleClassNames-BpGVdLFD.mjs} +2 -2
- package/dist/client/{carousel-BE1dEFsD.mjs → carousel-DJoleFV3.mjs} +2 -2
- package/dist/client/{carousel.client-DMtGYTTM.mjs → carousel.client-BtLwHefX.mjs} +1 -1
- package/dist/client/{cart-BsjsdGZE.mjs → cart-EO5o6uPH.mjs} +3 -3
- package/dist/client/{cart.client-DylGUWXY.mjs → cart.client-D_gPw45z.mjs} +1 -1
- package/dist/client/{checkout-B5KxEUDr.mjs → checkout-NVfZW0kR.mjs} +3 -3
- package/dist/client/{checkout.client-C98fhch3.mjs → checkout.client-DD3JuqOy.mjs} +1 -1
- package/dist/client/{checkoutUrls-BMLYTf38.mjs → checkoutUrls-z2gXvlGw.mjs} +1 -1
- package/dist/client/client.mjs +87 -43
- package/dist/client/{constants-PfYJsEZF.mjs → constants-CoOkvw__.mjs} +1 -2
- package/dist/client/{context-DtKdUdkO.mjs → context-CRhn9qzS.mjs} +732 -370
- package/dist/client/{dateFormatting-BaGPvQS3.mjs → dateFormatting-BnWB4L1s.mjs} +15 -25
- package/dist/client/{demoPortalMagicLink-B8eDjhuG.mjs → demoPortalMagicLink-CWDGSTBu.mjs} +2 -3
- package/dist/client/{enhanceHeaderSection-DvhD-8eE.mjs → enhanceHeaderSection-tdP_-Z9o.mjs} +4 -5
- package/dist/client/{event-registration.client-Du9a_xAN.mjs → event-registration.client-D7YYKySQ.mjs} +191 -210
- package/dist/client/{eventCalendar-Di9wDfzl.mjs → eventCalendar-CsAfu5d0.mjs} +4 -4
- package/dist/client/{eventCombined-CNW6nBsB.mjs → eventCombined-VXJB5CoS.mjs} +4 -4
- package/dist/client/{eventListing-CQMxQ8By.mjs → eventListing-B3KIZNfY.mjs} +4 -4
- package/dist/client/{eventRegistration-CprS9k1D.mjs → eventRegistration-BP-dEk1c.mjs} +4 -4
- package/dist/client/{form-Zl1_8RJ6.mjs → form-DM8Zbxbv.mjs} +3 -3
- package/dist/client/{form.client-TaMUys6I.mjs → form.client-e2z_Tlgk.mjs} +5 -5
- package/dist/client/{form.parts-CpNPbPPM.mjs → form.parts-Ctljy1a3.mjs} +3 -3
- package/dist/client/gifting/client.mjs +32 -29
- package/dist/client/{gifting-DNVa7-Wj.mjs → gifting-DWIsqQru.mjs} +4 -4
- package/dist/client/{gifting.client-CFUq3GVx.mjs → gifting.client-QsSWF0uA.mjs} +5 -5
- package/dist/client/{gifting.parts-CDQvxA4A.mjs → gifting.parts-CedLgwa_.mjs} +2 -2
- package/dist/client/{headerSection-Cg6083rn.mjs → headerSection-DAkRkwb-.mjs} +2 -2
- package/dist/client/{mediaAssets-B99AP7ai.mjs → mediaAssets-COfQolI3.mjs} +1 -1
- package/dist/client/{mediaContext-Fusweriw.mjs → mediaContext-DzvnjYXm.mjs} +1 -1
- package/dist/client/{newsletter-form.client-VuL9I96G.mjs → newsletter-form.client-WYja9-WN.mjs} +7 -7
- package/dist/client/{newsletter-form.interactive-7Of3eYn0.mjs → newsletter-form.interactive-RuM86VAv.mjs} +23 -24
- package/dist/client/{newsletter-form.parts-OBqsfT24.mjs → newsletter-form.parts-2petDnWv.mjs} +2 -2
- package/dist/client/{newsletterForm-BkJe_RTv.mjs → newsletterForm-BUbXdA_e.mjs} +3 -3
- package/dist/client/{lookSurfaces-gJ3OqPf9.mjs → noop-Dl4mZ-rr.mjs} +167 -49
- package/dist/client/portal/client.mjs +13040 -8190
- package/dist/client/portalOrders-COGn4BKG.mjs +596 -0
- package/dist/client/portalRoutes-D72yvtDh.mjs +862 -0
- package/dist/client/{product-detail.client-B2hdxqJN.mjs → product-detail.client-pOAryevt.mjs} +1 -1
- package/dist/client/{product-list.client-CCEgu9rx.mjs → product-list.client-CcUpUiud.mjs} +1 -1
- package/dist/client/{productDetail-CRX_ZRfS.mjs → productDetail-BZJCfqat.mjs} +3 -3
- package/dist/client/{productList-BAdJ6z5S.mjs → productList-CiRs3mNb.mjs} +3 -3
- package/dist/client/{propsDecoder-BLKAmX0S.mjs → propsDecoder--uHW4tFM.mjs} +2 -2
- package/dist/client/{registry.server-Bj9cmHHF.mjs → registry.server-CDNNd8wC.mjs} +247 -203
- package/dist/client/{renderableMediaAssetAdmission-BlfqYLJW.mjs → renderableMediaAssetAdmission-BsOWd9lf.mjs} +1 -1
- package/dist/client/rendering/client.mjs +26 -26
- package/dist/client/rendering/islands.mjs +1 -1
- package/dist/client/rendering.mjs +16 -8
- package/dist/client/{richText-coerce-Z45OLLEX.mjs → richText-coerce-CQGE_wHV.mjs} +2 -1
- package/dist/client/{routeIslandApiConfig-DHpTTK77.mjs → routeIslandApiConfig-BtCg87-N.mjs} +1 -1
- package/dist/client/{runtimeResponse-D2j2-mOk.mjs → runtimeResponse-DL_ARBpa.mjs} +1 -1
- package/dist/client/{runtimeResponse-DtWSfWSZ.mjs → runtimeResponse-Ds9cmBUf.mjs} +1 -1
- package/dist/client/{shop-BKsgxm_-.mjs → shop-Rx_gEMK8.mjs} +3 -3
- package/dist/client/{shop-commerce-Cbtk_kUW.mjs → shop-commerce-D8evQnMT.mjs} +53 -16
- package/dist/client/{shop-commerce-store-B-rv2p5h.mjs → shop-commerce-store-C9PcsSTj.mjs} +22 -5
- package/dist/client/{shop-discount-apply.state-CiCDLNh7.mjs → shop-discount-apply.state-D5CtGfJI.mjs} +2 -2
- package/dist/client/{shop.client-Rnqa74Tk.mjs → shop.client-D4lzQ9oY.mjs} +17 -39
- package/dist/client/{shopShared-BaBfhjCq.mjs → shopShared-BVbq7Nm-.mjs} +2 -2
- package/dist/client/spam-protection.mjs +1 -1
- package/dist/client/src-Al4ooTl_.mjs +164 -0
- package/dist/client/{src-o7WEvbK1.mjs → src-ZSqRK3dD.mjs} +228 -90
- package/dist/client/{timetableModel-BOff1Kk5.mjs → timetableModel-BQJrSK0K.mjs} +9 -78
- package/dist/client/{shop-add-feedback-DvC2kP1K.mjs → urlParams-C2QHo1Pa.mjs} +1 -42
- package/dist/client/{useAvailableSlots-DQJNh10g.mjs → useAvailableSlots-Dm3lKJKR.mjs} +2 -3
- package/dist/client/{useDiscountCodeUi-BcFQRI_7.mjs → useDiscountCodeUi-klgfGn7f.mjs} +1 -1
- package/dist/client/{useEventPagination-BvdcexDC.mjs → useEventPagination-Jnjt7_ly.mjs} +8 -8
- package/dist/client/{view-CTBwSpKv.mjs → view-CC_yQLSA.mjs} +4 -4
- package/dist/client/{wizardSteps-CWIQyRIw.mjs → wizardSteps-BliJOzEX.mjs} +953 -279
- package/dist/preview-next/client/{PageSectionToolbar-CG6KwITA.mjs → PageSectionToolbar-BhL0uADo.mjs} +3 -3
- package/dist/preview-next/client/{PreviewEditorSidebar-BGBqrC9m.mjs → PreviewEditorSidebar-Ct8eIm0i.mjs} +5 -5
- package/dist/preview-next/client/{PreviewEditorUI-Bwkyx28x.mjs → PreviewEditorUI-BS32G4V9.mjs} +4 -4
- package/dist/preview-next/client/{PreviewShell-DB1l6JNU.mjs → PreviewShell-RL0WfZXD.mjs} +5 -5
- package/dist/preview-next/client/{SdkPreviewModeRuntime-Bs6Cwzr3.mjs → SdkPreviewModeRuntime-MK_gHeGy.mjs} +29 -5
- package/dist/preview-next/client/{previewAssistantSlot-T-oDD_Dd.mjs → previewAssistantSlot-CQyS8pcq.mjs} +5011 -2074
- package/dist/preview-next/client/{previewChromeRoot-BeukcDRy.mjs → previewChromeRoot-BSxp3Mfu.mjs} +1 -1
- package/dist/preview-next/client/runtime.mjs +3 -3
- package/dist/preview-next/client/{sdk-runtime-ceDW_9q2.mjs → sdk-runtime-DKnTzy74.mjs} +2 -2
- package/dist/preview-next/client/{siteStyleAccess-CCB9bScO.mjs → siteStyleAccess-BlmbvbLN.mjs} +3 -3
- package/dist/preview-next/client/{useAutosaveStatus-D4o0CKq7.mjs → useAutosaveStatus-D-7GwZOQ.mjs} +1 -1
- package/dist/preview-next/client/{useOpenBlockForSetup-Seccrvwu.mjs → useOpenBlockForSetup-BNZtGM5g.mjs} +1 -1
- package/dist/preview-next/container-responsive.css +203 -174
- package/dist/preview-next/keepAlive.mjs +1 -1
- package/dist/preview-next/middleware.mjs +1 -1
- package/dist/preview-next/{route-contract-FwFj8zGL.mjs → route-contract-R3PcMmax.mjs} +71 -37
- package/dist/server/{Block.shared-D6WrRCxX.mjs → Block.shared-CniF9tSu.mjs} +5 -5
- package/dist/server/{ThemeScopeCore-BQzjDQ2q.mjs → ThemeScopeCore-BQWsnGT6.mjs} +126 -120
- package/dist/server/{accessibleSurfaces-CM3QANtw.mjs → accessibleSurfaces-WPzUAHp4.mjs} +33 -2
- package/dist/server/accordions-By_0Ykks.mjs +111 -0
- package/dist/server/{bindings-CS6ih1Yc.mjs → bindings-DxojjtK3.mjs} +7 -7
- package/dist/server/{client-m0ylCj_f.mjs → client-CDndhbYO.mjs} +86 -42
- package/dist/server/config-validation.mjs +1 -1
- package/dist/server/config.mjs +2 -2
- package/dist/server/constants-VyF5nEhL.mjs +1474 -0
- package/dist/server/{customCss-BZ8YSrQg.mjs → customCss-C9kgPHvr.mjs} +41 -5
- package/dist/server/data/resolveBlockData.mjs +1 -1
- package/dist/server/index.mjs +3 -3
- package/dist/server/{loadContent-vgWMz1uD.mjs → loadContent-BKstMBmX.mjs} +5 -4
- package/dist/server/{loadPage-CIOL3-9t.mjs → loadPage-IgNnZaqr.mjs} +3 -3
- package/dist/server/{lookMediaFrame-m-91jGGn.mjs → lookMediaFrame-TFjgNG61.mjs} +38 -18
- package/dist/server/manifest.mjs +36 -25
- package/dist/server/{mapLocation-BM5WX7FY.mjs → mapLocation-MDDSubTp.mjs} +1 -1
- package/dist/server/media-BRmYrnzb.mjs +31 -0
- package/dist/server/{media-luf7RF22.mjs → media-gvfIw3z8.mjs} +2 -31
- package/dist/server/{navigation-BcNfYYuu.mjs → navigation-quBYlSKD.mjs} +2 -2
- package/dist/server/navigation.mjs +1 -1
- package/dist/server/next.mjs +134 -81
- package/dist/server/{overrideResolution-BiHmsvTZ.mjs → overrideResolution-CCaAPpIa.mjs} +1 -1
- package/dist/server/page-converter.mjs +3 -3
- package/dist/server/{pageRenderPlan-DJo_obpi.mjs → pageRenderPlan-B7iULvKe.mjs} +8 -7
- package/dist/server/{pageRuntimeSupport-BnSuoHON.mjs → pageRuntimeSupport-BytMroxn.mjs} +5 -5
- package/dist/server/{pageShared-BJuOzxzn.mjs → pageShared-Dcs_XTIO.mjs} +243 -323
- package/dist/server/{parseThemeForPersistence-DOsfofCy.mjs → parseThemeForPersistence-Bihl4W5K.mjs} +3 -2
- package/dist/server/{portal-B4JVkdjc.mjs → portal-CMW_b9mG.mjs} +62 -46
- package/dist/server/portal.mjs +3 -3
- package/dist/server/portalQuestions-oUyohgL9.mjs +225 -0
- package/dist/server/{prebuild-Cr8p8T7V.mjs → prebuild-agaH-vZV.mjs} +1 -1
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/{prefetchBlockData-BZh57-ua.mjs → prefetchBlockData-DwpRjqw4.mjs} +4 -3
- package/dist/server/{registry-CvhFwbXJ.mjs → registry-DM9dHfDC.mjs} +345 -449
- package/dist/server/rendering/components/pageShared.mjs +1 -1
- package/dist/server/rendering/helpers/loadPage.mjs +1 -1
- package/dist/server/rendering/helpers/pageRuntimeSupport.mjs +1 -1
- package/dist/server/rendering/server.mjs +4 -4
- package/dist/server/rendering.mjs +10 -9
- package/dist/server/{resolveBlockData-Cv_W1LVB.mjs → resolveBlockData-CinHGf8l.mjs} +2 -2
- package/dist/server/{resolveButtonColourStates--6yJp9Tq.mjs → resolveButtonColourStates-B0O1IM16.mjs} +2 -1028
- package/dist/server/{responseMedia-KRKguBC5.mjs → responseMedia-IfH65QAH.mjs} +1 -1
- package/dist/server/{schema-BpsqaSSU.mjs → schema-CwfxQjc4.mjs} +10 -113
- package/dist/server/server.mjs +3 -3
- package/dist/server/{servicePageContent-CRKbTm_7.mjs → servicePageContent-BBBhOtdE.mjs} +21 -20
- package/dist/server/theme-bridge.mjs +3 -2
- package/dist/server/theme.mjs +2 -2
- package/dist/server/{three-pass-converter-39SXCCnh.mjs → three-pass-converter-DPaUPTfl.mjs} +34 -16
- package/dist/server/titleSourceSchema-NhK6azFS.mjs +2018 -0
- package/dist/server/typeGuards-CTW_9AXq.mjs +413 -0
- package/dist/server/types-BKaBZFjD.mjs +1085 -0
- package/dist/server/{validation-DCl-FCk_.mjs → validation-DG5jX3jH.mjs} +70 -17
- package/dist/server/{version-DT_R5JAR.mjs → version-CipbxPHL.mjs} +1 -1
- package/dist/server/video-Cdr3wh-q.mjs +272 -0
- package/dist/styles/index.css +1013 -1840
- package/package.json +2 -1
- package/dist/_dts/index-B0_2-65A.d.ts +0 -101
- package/dist/client/TabBarFragment-DlKQRhP4.mjs +0 -56
- package/dist/client/checkoutRoute-DKlZRNZD.mjs +0 -22
- package/dist/client/creditProducts-BQ1t1erI.mjs +0 -266
- package/dist/client/formatDate-hhI1-tzt.mjs +0 -26
- package/dist/server/constants-Cj7hfbrA.mjs +0 -41
- package/dist/server/richTextSchema-QLaQrbII.mjs +0 -212
- package/dist/server/titleSourceSchema-Cu-3PRvv.mjs +0 -122
|
@@ -1,490 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
//#region ../site-contracts/src/tokens.ts
|
|
3
|
-
const blockColorTokenNames = [
|
|
4
|
-
"text",
|
|
5
|
-
"heading",
|
|
6
|
-
"mutedText",
|
|
7
|
-
"surface",
|
|
8
|
-
"background",
|
|
9
|
-
"foreground",
|
|
10
|
-
"border",
|
|
11
|
-
"primary",
|
|
12
|
-
"secondary",
|
|
13
|
-
"accent",
|
|
14
|
-
"success",
|
|
15
|
-
"warning",
|
|
16
|
-
"info",
|
|
17
|
-
"error",
|
|
18
|
-
"destructive",
|
|
19
|
-
"scrim",
|
|
20
|
-
"shadow",
|
|
21
|
-
"onPrimary",
|
|
22
|
-
"onSecondary",
|
|
23
|
-
"onAccent",
|
|
24
|
-
"onSuccess",
|
|
25
|
-
"onWarning",
|
|
26
|
-
"onInfo",
|
|
27
|
-
"onError",
|
|
28
|
-
"onDestructive",
|
|
29
|
-
"onSurface",
|
|
30
|
-
"onText"
|
|
31
|
-
];
|
|
32
|
-
function parseOpacityPercent(source) {
|
|
33
|
-
const trimmed = source.trim();
|
|
34
|
-
if (!trimmed) return null;
|
|
35
|
-
if (!/^\d{1,3}(?:\.\d+)?$/.test(trimmed)) return null;
|
|
36
|
-
const value = Number(trimmed);
|
|
37
|
-
if (!Number.isFinite(value)) return null;
|
|
38
|
-
if (value < 0 || value > 100) return null;
|
|
39
|
-
return value;
|
|
40
|
-
}
|
|
41
|
-
function parseColorTokenParts(source) {
|
|
42
|
-
const trimmed = source.trim();
|
|
43
|
-
if (trimmed.startsWith("raw:")) return {
|
|
44
|
-
kind: "raw",
|
|
45
|
-
value: trimmed.slice(4)
|
|
46
|
-
};
|
|
47
|
-
const [token, opacityRaw, extra] = trimmed.split("/");
|
|
48
|
-
if (!token || extra !== void 0) return {
|
|
49
|
-
kind: "invalid",
|
|
50
|
-
token: trimmed
|
|
51
|
-
};
|
|
52
|
-
if (opacityRaw === void 0) return {
|
|
53
|
-
kind: "token",
|
|
54
|
-
token,
|
|
55
|
-
opacityPercent: null
|
|
56
|
-
};
|
|
57
|
-
const opacityPercent = parseOpacityPercent(opacityRaw);
|
|
58
|
-
if (opacityPercent === null) return {
|
|
59
|
-
kind: "invalid",
|
|
60
|
-
token: trimmed
|
|
61
|
-
};
|
|
62
|
-
return {
|
|
63
|
-
kind: "token",
|
|
64
|
-
token,
|
|
65
|
-
opacityPercent
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Known palette role token names. This is the low-level source of truth for
|
|
70
|
-
* palette roles used by palette variants, Theme V2 schemas, and runtime color
|
|
71
|
-
* reference parsing.
|
|
72
|
-
*/
|
|
73
|
-
const PALETTE_TOKEN_NAMES = [
|
|
74
|
-
"primary",
|
|
75
|
-
"primaryForeground",
|
|
76
|
-
"secondary",
|
|
77
|
-
"accent",
|
|
78
|
-
"success",
|
|
79
|
-
"warning",
|
|
80
|
-
"destructive",
|
|
81
|
-
"background",
|
|
82
|
-
"surface",
|
|
83
|
-
"surfaceAlt",
|
|
84
|
-
"muted",
|
|
85
|
-
"text",
|
|
86
|
-
"border"
|
|
87
|
-
];
|
|
88
|
-
const paletteTokenNameSchema = z.enum(PALETTE_TOKEN_NAMES);
|
|
89
|
-
const themeColorBaseTokenNames = [
|
|
90
|
-
...PALETTE_TOKEN_NAMES,
|
|
91
|
-
...blockColorTokenNames,
|
|
92
|
-
"white",
|
|
93
|
-
"neutral",
|
|
94
|
-
"primaryText",
|
|
95
|
-
"secondaryForeground",
|
|
96
|
-
"accentForeground"
|
|
97
|
-
];
|
|
98
|
-
const themeColorBaseTokenSet = new Set(themeColorBaseTokenNames);
|
|
99
|
-
const shadeStepSet = /* @__PURE__ */ new Set([
|
|
100
|
-
"50",
|
|
101
|
-
"100",
|
|
102
|
-
"200",
|
|
103
|
-
"300",
|
|
104
|
-
"400",
|
|
105
|
-
"500",
|
|
106
|
-
"600",
|
|
107
|
-
"700",
|
|
108
|
-
"800",
|
|
109
|
-
"900",
|
|
110
|
-
"950"
|
|
111
|
-
]);
|
|
112
|
-
function isKnownBaseToken(value) {
|
|
113
|
-
return themeColorBaseTokenSet.has(value);
|
|
114
|
-
}
|
|
115
|
-
function isKnownShadeToken(value) {
|
|
116
|
-
const match = value.match(/^([a-zA-Z][a-zA-Z0-9]*)(?:-([0-9]{2,3}))$/);
|
|
117
|
-
if (!match) return false;
|
|
118
|
-
const [, base, shade] = match;
|
|
119
|
-
return Boolean(base && shade && isKnownBaseToken(base) && shadeStepSet.has(shade));
|
|
120
|
-
}
|
|
121
|
-
function isThemeColorTokenBase(value) {
|
|
122
|
-
return isKnownBaseToken(value) || isKnownShadeToken(value);
|
|
123
|
-
}
|
|
124
|
-
function isThemeColorToken(value) {
|
|
125
|
-
if (typeof value !== "string") return false;
|
|
126
|
-
const parts = parseColorTokenParts(value);
|
|
127
|
-
return parts.kind === "token" && isThemeColorTokenBase(parts.token);
|
|
128
|
-
}
|
|
129
|
-
function parseThemeColorToken(value) {
|
|
130
|
-
if (!isThemeColorToken(value)) return null;
|
|
131
|
-
return value.trim();
|
|
132
|
-
}
|
|
133
|
-
const themeColorTokenSchema = z.string().min(1).refine((value) => Boolean(isThemeColorToken(value)), "Expected a known Theme V2 color token");
|
|
134
|
-
const HEX_COLOR_REGEX = /^#[0-9a-f]{6}$/;
|
|
135
|
-
const NORMALIZABLE_HEX_REGEX = /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;
|
|
136
|
-
const THEME_PALETTE_COLOR_ORDER = [
|
|
137
|
-
"primary",
|
|
138
|
-
"secondary",
|
|
139
|
-
"accent",
|
|
140
|
-
"success",
|
|
141
|
-
"warning",
|
|
142
|
-
"destructive",
|
|
143
|
-
"background",
|
|
144
|
-
"surface",
|
|
145
|
-
"surfaceAlt",
|
|
146
|
-
"muted",
|
|
147
|
-
"text",
|
|
148
|
-
"primaryForeground",
|
|
149
|
-
"border"
|
|
150
|
-
];
|
|
151
|
-
const hexColorSchema = z.string().regex(HEX_COLOR_REGEX, "Hex must be #RRGGBB (lowercase)").transform((value) => value);
|
|
152
|
-
const paletteModeSchema = z.enum(["light", "dark"]);
|
|
153
|
-
const paletteColorsSchema = z.object({
|
|
154
|
-
primary: hexColorSchema,
|
|
155
|
-
primaryForeground: hexColorSchema,
|
|
156
|
-
secondary: hexColorSchema,
|
|
157
|
-
accent: hexColorSchema,
|
|
158
|
-
success: hexColorSchema,
|
|
159
|
-
warning: hexColorSchema,
|
|
160
|
-
destructive: hexColorSchema,
|
|
161
|
-
background: hexColorSchema,
|
|
162
|
-
surface: hexColorSchema,
|
|
163
|
-
surfaceAlt: hexColorSchema,
|
|
164
|
-
muted: hexColorSchema,
|
|
165
|
-
text: hexColorSchema,
|
|
166
|
-
border: hexColorSchema
|
|
167
|
-
}).strict().transform((value) => value);
|
|
168
|
-
function normalizePaletteHex(value) {
|
|
169
|
-
if (!NORMALIZABLE_HEX_REGEX.test(value)) return null;
|
|
170
|
-
const normalized = value.toLowerCase();
|
|
171
|
-
if (normalized.length === 7) return normalized;
|
|
172
|
-
const triplet = normalized.slice(1);
|
|
173
|
-
const red = triplet.charAt(0);
|
|
174
|
-
const green = triplet.charAt(1);
|
|
175
|
-
const blue = triplet.charAt(2);
|
|
176
|
-
return `#${red}${red}${green}${green}${blue}${blue}`;
|
|
177
|
-
}
|
|
178
|
-
function admitPaletteEntry(values, entry) {
|
|
179
|
-
const parsedRole = paletteTokenNameSchema.safeParse(entry.name);
|
|
180
|
-
if (!parsedRole.success) return {
|
|
181
|
-
ok: false,
|
|
182
|
-
error: {
|
|
183
|
-
kind: "unknown-role",
|
|
184
|
-
role: entry.name
|
|
185
|
-
}
|
|
186
|
-
};
|
|
187
|
-
const role = parsedRole.data;
|
|
188
|
-
if (values[role] !== void 0) return {
|
|
189
|
-
ok: false,
|
|
190
|
-
error: {
|
|
191
|
-
kind: "duplicate-role",
|
|
192
|
-
role
|
|
193
|
-
}
|
|
194
|
-
};
|
|
195
|
-
const hex = normalizePaletteHex(entry.hex);
|
|
196
|
-
if (hex === null) return {
|
|
197
|
-
ok: false,
|
|
198
|
-
error: {
|
|
199
|
-
kind: "invalid-color",
|
|
200
|
-
role,
|
|
201
|
-
value: entry.hex
|
|
202
|
-
}
|
|
203
|
-
};
|
|
204
|
-
return {
|
|
205
|
-
ok: true,
|
|
206
|
-
values: {
|
|
207
|
-
...values,
|
|
208
|
-
[role]: hex
|
|
209
|
-
}
|
|
210
|
-
};
|
|
211
|
-
}
|
|
212
|
-
function paletteColorsFromEntries(entries) {
|
|
213
|
-
const admitted = entries.reduce((result, entry) => result.ok ? admitPaletteEntry(result.values, entry) : result, {
|
|
214
|
-
ok: true,
|
|
215
|
-
values: {}
|
|
216
|
-
});
|
|
217
|
-
if (!admitted.ok) return admitted;
|
|
218
|
-
const missing = PALETTE_TOKEN_NAMES.filter((role) => admitted.values[role] === void 0);
|
|
219
|
-
return missing.length > 0 ? {
|
|
220
|
-
ok: false,
|
|
221
|
-
error: {
|
|
222
|
-
kind: "missing-roles",
|
|
223
|
-
roles: missing
|
|
224
|
-
}
|
|
225
|
-
} : {
|
|
226
|
-
ok: true,
|
|
227
|
-
colors: paletteColorsSchema.parse(admitted.values)
|
|
228
|
-
};
|
|
229
|
-
}
|
|
230
|
-
function paletteColorEntries(colors) {
|
|
231
|
-
return THEME_PALETTE_COLOR_ORDER.map((name) => ({
|
|
232
|
-
name,
|
|
233
|
-
hex: colors[name]
|
|
234
|
-
}));
|
|
235
|
-
}
|
|
236
|
-
//#endregion
|
|
237
|
-
//#region ../theme-core/src/utils/colorStyles.ts
|
|
238
|
-
const COLOR_VAR_PREFIX = "--tb-";
|
|
239
|
-
function parseToken(source) {
|
|
240
|
-
const parts = parseColorTokenParts(source);
|
|
241
|
-
if (parts.kind === "raw") return {
|
|
242
|
-
token: source,
|
|
243
|
-
raw: parts.value
|
|
244
|
-
};
|
|
245
|
-
if (parts.kind === "invalid") return { token: source };
|
|
246
|
-
return {
|
|
247
|
-
token: parts.token,
|
|
248
|
-
opacityPercent: parts.opacityPercent === null ? void 0 : parts.opacityPercent
|
|
249
|
-
};
|
|
250
|
-
}
|
|
251
|
-
const SURFACE_TEXT_ROLE_BY_TOKEN = {
|
|
252
|
-
text: "text",
|
|
253
|
-
heading: "heading",
|
|
254
|
-
mutedText: "supporting"
|
|
255
|
-
};
|
|
256
|
-
function surfaceRoleForTextToken(token) {
|
|
257
|
-
return Object.prototype.hasOwnProperty.call(SURFACE_TEXT_ROLE_BY_TOKEN, token) ? SURFACE_TEXT_ROLE_BY_TOKEN[token] : null;
|
|
258
|
-
}
|
|
259
|
-
/**
|
|
260
|
-
* Converts a theme color token to a CSS rgb value.
|
|
261
|
-
* This is the primary function for applying theme colors to CSS properties.
|
|
262
|
-
*
|
|
263
|
-
* @param token - Theme color token (semantic, with opacity, or raw)
|
|
264
|
-
* @returns CSS color value (rgb with optional alpha, or raw CSS value)
|
|
265
|
-
*
|
|
266
|
-
* @example
|
|
267
|
-
* rgbColorValue('primary') // => 'rgb(var(--tb-primary))'
|
|
268
|
-
* rgbColorValue('surface/95') // => 'rgb(var(--tb-surface) / 0.95)'
|
|
269
|
-
* rgbColorValue('raw:transparent') // => 'transparent'
|
|
270
|
-
*/
|
|
271
|
-
function rgbColorValue(token) {
|
|
272
|
-
const { token: baseToken, opacityPercent, raw } = parseToken(token);
|
|
273
|
-
if (raw) return raw;
|
|
274
|
-
const cssVar = `${COLOR_VAR_PREFIX}${baseToken}`;
|
|
275
|
-
if (opacityPercent === void 0) return `rgb(var(${cssVar}))`;
|
|
276
|
-
return `rgb(var(${cssVar}) / ${opacityPercent / 100})`;
|
|
277
|
-
}
|
|
278
|
-
/**
|
|
279
|
-
* Converts a theme color token to a CSS variable reference.
|
|
280
|
-
* Note: This returns the base variable without rgb() wrapper, ignoring opacity.
|
|
281
|
-
*
|
|
282
|
-
* @param token - Theme color token
|
|
283
|
-
* @returns CSS variable reference
|
|
284
|
-
*
|
|
285
|
-
* @example
|
|
286
|
-
* cssVarValue('primary') // => 'var(--tb-primary)'
|
|
287
|
-
* cssVarValue('surface/95') // => 'var(--tb-surface)' (opacity ignored)
|
|
288
|
-
*/
|
|
289
|
-
function cssVarValue(token) {
|
|
290
|
-
const { token: baseToken } = parseToken(token);
|
|
291
|
-
return `var(${COLOR_VAR_PREFIX}${baseToken})`;
|
|
292
|
-
}
|
|
293
|
-
/**
|
|
294
|
-
* Creates a backgroundColor style object from a theme token.
|
|
295
|
-
*
|
|
296
|
-
* @param token - Theme color token
|
|
297
|
-
* @returns CSSProperties with backgroundColor
|
|
298
|
-
*/
|
|
299
|
-
function backgroundColorStyle(token) {
|
|
300
|
-
return { backgroundColor: rgbColorValue(token) };
|
|
301
|
-
}
|
|
302
|
-
/**
|
|
303
|
-
* Converts a text color token to a CSS color value that follows the enclosing
|
|
304
|
-
* surface. The semantic text tokens (`text`, `heading`, `mutedText`) resolve
|
|
305
|
-
* to the surface foreground variables, so text adapts when a section's
|
|
306
|
-
* background changes; any other token is a fixed theme color.
|
|
307
|
-
*
|
|
308
|
-
* @param token - Theme color token
|
|
309
|
-
* @returns CSS color value
|
|
310
|
-
*/
|
|
311
|
-
function textColorValue(token) {
|
|
312
|
-
const parsed = parseToken(token);
|
|
313
|
-
const surfaceRole = parsed.raw ? null : surfaceRoleForTextToken(parsed.token);
|
|
314
|
-
if (!surfaceRole) return rgbColorValue(token);
|
|
315
|
-
return parsed.opacityPercent === void 0 ? surfaceForegroundValue(surfaceRole) : surfaceForegroundValueWithOpacity(surfaceRole, parsed.opacityPercent);
|
|
316
|
-
}
|
|
317
|
-
/**
|
|
318
|
-
* Creates a text color style object from a theme token.
|
|
319
|
-
*
|
|
320
|
-
* @param token - Theme color token
|
|
321
|
-
* @returns CSSProperties with color
|
|
322
|
-
*/
|
|
323
|
-
function textColorStyle(token) {
|
|
324
|
-
return { color: textColorValue(token) };
|
|
325
|
-
}
|
|
326
|
-
/**
|
|
327
|
-
* Creates a border color style object from a theme token.
|
|
328
|
-
*
|
|
329
|
-
* @param token - Theme color token
|
|
330
|
-
* @returns CSSProperties with borderColor
|
|
331
|
-
*/
|
|
332
|
-
function borderColorStyle(token) {
|
|
333
|
-
return { borderColor: rgbColorValue(token) };
|
|
334
|
-
}
|
|
335
|
-
/**
|
|
336
|
-
* Merges multiple CSSProperties objects into a single object.
|
|
337
|
-
* Later styles override earlier ones. Undefined values are filtered out.
|
|
338
|
-
* Returns undefined if the merged result is empty.
|
|
339
|
-
*
|
|
340
|
-
* @param styles - Variable number of CSSProperties objects (can be undefined)
|
|
341
|
-
* @returns Merged CSSProperties object, or undefined if empty
|
|
342
|
-
*
|
|
343
|
-
* @example
|
|
344
|
-
* mergeStyles(
|
|
345
|
-
* backgroundColorStyle('surface'),
|
|
346
|
-
* textColorStyle('text'),
|
|
347
|
-
* borderColorStyle('border')
|
|
348
|
-
* )
|
|
349
|
-
* // => { backgroundColor: '...', color: '...', borderColor: '...' }
|
|
350
|
-
*/
|
|
351
|
-
function mergeStyles(...styles) {
|
|
352
|
-
const merged = {};
|
|
353
|
-
for (const style of styles) {
|
|
354
|
-
if (!style) continue;
|
|
355
|
-
Object.assign(merged, style);
|
|
356
|
-
}
|
|
357
|
-
return Object.keys(merged).length ? merged : void 0;
|
|
358
|
-
}
|
|
359
|
-
//#endregion
|
|
360
|
-
//#region ../theme-core/src/surfaces/foregroundContract.ts
|
|
361
|
-
const SURFACE_FOREGROUND_CSS_VARS = {
|
|
362
|
-
text: "--rb-surface-text-color",
|
|
363
|
-
heading: "--rb-surface-heading-color",
|
|
364
|
-
link: "--rb-surface-link-color",
|
|
365
|
-
linkHover: "--rb-surface-link-hover-color",
|
|
366
|
-
supporting: "--rb-surface-supporting-color",
|
|
367
|
-
muted: "--rb-surface-muted-color",
|
|
368
|
-
line: "--rb-surface-line-color",
|
|
369
|
-
mark: "--rb-surface-mark-color"
|
|
370
|
-
};
|
|
371
|
-
const DEFAULT_SURFACE_TEXT_COLOR = "rgb(var(--tb-text, 17 24 39))";
|
|
372
|
-
const DEFAULT_SURFACE_LINK_COLOR = "rgb(var(--tb-primary, var(--tb-text, 17 24 39)))";
|
|
373
|
-
const DEFAULT_SURFACE_SUPPORTING_COLOR = "rgb(var(--tb-mutedText, 100 116 139))";
|
|
374
|
-
const DEFAULT_ROLE_FALLBACKS = {
|
|
375
|
-
text: DEFAULT_SURFACE_TEXT_COLOR,
|
|
376
|
-
heading: DEFAULT_SURFACE_TEXT_COLOR,
|
|
377
|
-
link: DEFAULT_SURFACE_LINK_COLOR,
|
|
378
|
-
linkHover: DEFAULT_SURFACE_LINK_COLOR,
|
|
379
|
-
supporting: DEFAULT_SURFACE_SUPPORTING_COLOR,
|
|
380
|
-
muted: DEFAULT_SURFACE_SUPPORTING_COLOR
|
|
381
|
-
};
|
|
382
|
-
function requireSurfaceColorValue(role, value) {
|
|
383
|
-
const normalized = value.trim();
|
|
384
|
-
if (normalized.length === 0) throw new RangeError(`Surface foreground ${role} must be a non-empty CSS color.`);
|
|
385
|
-
return normalized;
|
|
386
|
-
}
|
|
387
|
-
function completeSurfaceForegrounds(input) {
|
|
388
|
-
const text = requireSurfaceColorValue("text", input.text);
|
|
389
|
-
const link = input.link === void 0 ? text : requireSurfaceColorValue("link", input.link);
|
|
390
|
-
return {
|
|
391
|
-
text,
|
|
392
|
-
heading: input.heading === void 0 ? text : requireSurfaceColorValue("heading", input.heading),
|
|
393
|
-
link,
|
|
394
|
-
linkHover: input.linkHover === void 0 ? link : requireSurfaceColorValue("linkHover", input.linkHover),
|
|
395
|
-
muted: input.muted === void 0 ? text : requireSurfaceColorValue("muted", input.muted),
|
|
396
|
-
supporting: input.supporting === void 0 ? text : requireSurfaceColorValue("supporting", input.supporting)
|
|
397
|
-
};
|
|
398
|
-
}
|
|
399
|
-
function surfaceForegroundValue(role, outsideProviderFallback = DEFAULT_ROLE_FALLBACKS[role]) {
|
|
400
|
-
const roleVariable = SURFACE_FOREGROUND_CSS_VARS[role];
|
|
401
|
-
const fallback = requireSurfaceColorValue("fallback", outsideProviderFallback);
|
|
402
|
-
if (role === "text") return `var(${roleVariable}, ${fallback})`;
|
|
403
|
-
if (role === "linkHover") return `var(${roleVariable}, ${surfaceForegroundValue("link", fallback)})`;
|
|
404
|
-
return `var(${roleVariable}, var(${SURFACE_FOREGROUND_CSS_VARS.text}, ${fallback}))`;
|
|
405
|
-
}
|
|
406
|
-
/** The solved inks, published beside the foreground roles by the same surfaces. */
|
|
407
|
-
const SURFACE_INK_CSS_VARS = {
|
|
408
|
-
brand: "--rb-surface-brand-color",
|
|
409
|
-
accent: "--rb-surface-accent-color",
|
|
410
|
-
focus: "--rb-surface-focus-color",
|
|
411
|
-
control: "--rb-surface-control-color"
|
|
412
|
-
};
|
|
413
|
-
/**
|
|
414
|
-
* Read a solved ink, falling back straight to the declaration's own previous
|
|
415
|
-
* expression. Unlike `surfaceForegroundValue` this never falls through to
|
|
416
|
-
* `--rb-surface-text-color`: where no ink is published (bridge pages, unmeasured
|
|
417
|
-
* paints) brand text must keep its brand colour, not turn into the text ink.
|
|
418
|
-
*/
|
|
419
|
-
function surfaceInkValue(role, previousExpression) {
|
|
420
|
-
return `var(${SURFACE_INK_CSS_VARS[role]}, ${requireSurfaceColorValue("fallback", previousExpression)})`;
|
|
421
|
-
}
|
|
422
|
-
/**
|
|
423
|
-
* The declarations for a surface's ink publication. An exact ink is a token
|
|
424
|
-
* reference (`rgb(var(--tb-primary))`), so a site's own token value wins; a
|
|
425
|
-
* nudged or replaced ink is a literal colour.
|
|
426
|
-
*/
|
|
427
|
-
function surfaceInkStyle(publication) {
|
|
428
|
-
switch (publication.kind) {
|
|
429
|
-
case "none": return {};
|
|
430
|
-
case "reset": return inkVariables(() => "initial");
|
|
431
|
-
case "solved": return inkVariables((role) => {
|
|
432
|
-
const ink = publication.inks[role];
|
|
433
|
-
const token = parseThemeColorToken(ink);
|
|
434
|
-
return token ? rgbColorValue(token) : ink;
|
|
435
|
-
});
|
|
436
|
-
}
|
|
437
|
-
}
|
|
438
|
-
function surfaceInkDeclarations(publication) {
|
|
439
|
-
return Object.entries(surfaceInkStyle(publication)).map(([property, value]) => `${property}: ${value};`);
|
|
440
|
-
}
|
|
441
|
-
function inkVariables(value) {
|
|
442
|
-
return {
|
|
443
|
-
[SURFACE_INK_CSS_VARS.brand]: value("brand"),
|
|
444
|
-
[SURFACE_INK_CSS_VARS.accent]: value("accent"),
|
|
445
|
-
[SURFACE_INK_CSS_VARS.focus]: value("focus"),
|
|
446
|
-
[SURFACE_INK_CSS_VARS.control]: value("control")
|
|
447
|
-
};
|
|
448
|
-
}
|
|
449
|
-
function surfaceForegroundValueWithOpacity(role, opacityPercent) {
|
|
450
|
-
if (!Number.isFinite(opacityPercent) || opacityPercent < 0 || opacityPercent > 100) throw new RangeError("Surface foreground opacity must be between 0 and 100.");
|
|
451
|
-
return `color-mix(in srgb, ${surfaceForegroundValue(role)} ${opacityPercent}%, transparent)`;
|
|
452
|
-
}
|
|
453
|
-
function surfaceForegroundStyle(input) {
|
|
454
|
-
const foregrounds = completeSurfaceForegrounds(input);
|
|
455
|
-
return {
|
|
456
|
-
color: foregrounds.text,
|
|
457
|
-
[SURFACE_FOREGROUND_CSS_VARS.text]: foregrounds.text,
|
|
458
|
-
[SURFACE_FOREGROUND_CSS_VARS.heading]: foregrounds.heading,
|
|
459
|
-
[SURFACE_FOREGROUND_CSS_VARS.link]: foregrounds.link,
|
|
460
|
-
[SURFACE_FOREGROUND_CSS_VARS.linkHover]: foregrounds.linkHover,
|
|
461
|
-
[SURFACE_FOREGROUND_CSS_VARS.supporting]: foregrounds.supporting,
|
|
462
|
-
...input.muted === void 0 ? {} : { [SURFACE_FOREGROUND_CSS_VARS.muted]: foregrounds.muted },
|
|
463
|
-
"--rb-surface-link-hover-decoration": hoverDecoration(input)
|
|
464
|
-
};
|
|
465
|
-
}
|
|
466
|
-
function surfaceForegroundDeclarations(input) {
|
|
467
|
-
return Object.entries(surfaceForegroundStyle(input)).map(([property, value]) => `${property}: ${value};`);
|
|
468
|
-
}
|
|
469
|
-
function surfaceForegroundInputFromResolved(foreground, color) {
|
|
470
|
-
const { roles } = foreground;
|
|
471
|
-
const value = (ink) => {
|
|
472
|
-
const token = parseThemeColorToken(ink);
|
|
473
|
-
return token ? color(token) : ink;
|
|
474
|
-
};
|
|
475
|
-
return {
|
|
476
|
-
text: value(roles.text),
|
|
477
|
-
heading: value(roles.heading),
|
|
478
|
-
link: value(roles.link),
|
|
479
|
-
linkHover: value(roles.linkHover),
|
|
480
|
-
supporting: value(roles.supporting),
|
|
481
|
-
hoverDecoration: foreground.hoverDecoration
|
|
482
|
-
};
|
|
483
|
-
}
|
|
484
|
-
function hoverDecoration(input) {
|
|
485
|
-
return input.hoverDecoration ?? "underline";
|
|
486
|
-
}
|
|
487
|
-
//#endregion
|
|
1
|
+
import { c as buttonEffectApplicationSchema, m as parseOpaqueButtonColourToken, s as unsafeAsOpaqueButtonColourToken, w as surfaceForegroundValue } from "./types-BKaBZFjD.mjs";
|
|
488
2
|
//#region ../theme-core/src/palette/utils/colorConversion.ts
|
|
489
3
|
const clamp01 = (x) => Math.max(0, Math.min(1, x));
|
|
490
4
|
const mod = (a, n) => (a % n + n) % n;
|
|
@@ -1095,546 +609,6 @@ function member(hex, sample) {
|
|
|
1095
609
|
};
|
|
1096
610
|
}
|
|
1097
611
|
//#endregion
|
|
1098
|
-
//#region ../site-contracts/src/identity/blockKinds.ts
|
|
1099
|
-
/**
|
|
1100
|
-
* Standard semantic variant roles a theme exposes.
|
|
1101
|
-
*
|
|
1102
|
-
* Block content references variants by role; the active theme determines
|
|
1103
|
-
* what each role looks like.
|
|
1104
|
-
*/
|
|
1105
|
-
const VARIANT_ROLES = [
|
|
1106
|
-
"primary",
|
|
1107
|
-
"secondary",
|
|
1108
|
-
"outline",
|
|
1109
|
-
"ghost",
|
|
1110
|
-
"accent"
|
|
1111
|
-
];
|
|
1112
|
-
const variantRoleSchema = z.enum(VARIANT_ROLES);
|
|
1113
|
-
const SYSTEM_BLOCK_KINDS = [
|
|
1114
|
-
"block.hero",
|
|
1115
|
-
"block.intro",
|
|
1116
|
-
"block.columns",
|
|
1117
|
-
"block.collection",
|
|
1118
|
-
"block.class-prices",
|
|
1119
|
-
"block.feature-cards",
|
|
1120
|
-
"block.media-text",
|
|
1121
|
-
"block.cta-full",
|
|
1122
|
-
"block.single-button",
|
|
1123
|
-
"block.body-text",
|
|
1124
|
-
"block.location-map",
|
|
1125
|
-
"block.faq",
|
|
1126
|
-
"block.list",
|
|
1127
|
-
"block.testimonials",
|
|
1128
|
-
"block.team-members",
|
|
1129
|
-
"block.embed",
|
|
1130
|
-
"block.blog-post",
|
|
1131
|
-
"block.blog-listing",
|
|
1132
|
-
"block.site-header",
|
|
1133
|
-
"block.site-footer",
|
|
1134
|
-
"block.form",
|
|
1135
|
-
"block.contact-newsletter",
|
|
1136
|
-
"block.appointment-booking",
|
|
1137
|
-
"block.appointment-services",
|
|
1138
|
-
"block.service-details",
|
|
1139
|
-
"block.weekly-slot-availability",
|
|
1140
|
-
"block.event-registration",
|
|
1141
|
-
...[
|
|
1142
|
-
"block.event-details",
|
|
1143
|
-
"block.event-spotlight",
|
|
1144
|
-
"block.event-listing",
|
|
1145
|
-
"block.event-calendar",
|
|
1146
|
-
"block.recurring-schedule",
|
|
1147
|
-
"block.offerings-preview"
|
|
1148
|
-
],
|
|
1149
|
-
"block.shop",
|
|
1150
|
-
"block.product-list",
|
|
1151
|
-
"block.product-detail",
|
|
1152
|
-
"block.cart",
|
|
1153
|
-
"block.checkout",
|
|
1154
|
-
"block.gifting",
|
|
1155
|
-
"block.newsletter-signup",
|
|
1156
|
-
"block.image-gallery",
|
|
1157
|
-
"block.video-grid",
|
|
1158
|
-
"block.audio-player",
|
|
1159
|
-
"block.file-download"
|
|
1160
|
-
];
|
|
1161
|
-
//#endregion
|
|
1162
|
-
//#region ../site-contracts/src/theme/buttonTypography.ts
|
|
1163
|
-
const textTransformSchema = z.enum([
|
|
1164
|
-
"none",
|
|
1165
|
-
"uppercase",
|
|
1166
|
-
"lowercase",
|
|
1167
|
-
"capitalize"
|
|
1168
|
-
]);
|
|
1169
|
-
const fontWeightSchema = z.union([
|
|
1170
|
-
z.literal(400),
|
|
1171
|
-
z.literal(500),
|
|
1172
|
-
z.literal(600),
|
|
1173
|
-
z.literal(700),
|
|
1174
|
-
z.literal(800)
|
|
1175
|
-
]);
|
|
1176
|
-
const buttonTypographySchema = z.enum(["body", "heading"]);
|
|
1177
|
-
const letterSpacingSchema = z.enum([
|
|
1178
|
-
"tight",
|
|
1179
|
-
"normal",
|
|
1180
|
-
"slight",
|
|
1181
|
-
"loose",
|
|
1182
|
-
"wide"
|
|
1183
|
-
]);
|
|
1184
|
-
//#endregion
|
|
1185
|
-
//#region ../site-contracts/src/theme/buttons.ts
|
|
1186
|
-
/**
|
|
1187
|
-
* Canonical persisted/CSS-safe button variant identifier.
|
|
1188
|
-
*
|
|
1189
|
-
* IDs become class selectors, so keep the contract deliberately narrower than
|
|
1190
|
-
* an arbitrary string and shared with every authoring/runtime boundary.
|
|
1191
|
-
*/
|
|
1192
|
-
const buttonVariantIdSchema = z.string().min(1).max(50).regex(/^[a-z0-9-]+$/, "Button variant IDs may contain lowercase letters, numbers, and hyphens only").refine((value) => value !== "link" && value !== "tertiary", { message: "Retired button role IDs are not valid variant IDs" });
|
|
1193
|
-
function parseOpaqueButtonColourToken(value) {
|
|
1194
|
-
const token = parseThemeColorToken(value);
|
|
1195
|
-
if (token === null) return null;
|
|
1196
|
-
const parts = parseColorTokenParts(token);
|
|
1197
|
-
return parts.kind === "token" && parts.opacityPercent === null ? token : null;
|
|
1198
|
-
}
|
|
1199
|
-
const opaqueButtonColourTokenSchema = themeColorTokenSchema.refine((value) => parseOpaqueButtonColourToken(value) !== null, "Button colour tokens must be opaque").transform((value) => {
|
|
1200
|
-
const token = parseOpaqueButtonColourToken(value);
|
|
1201
|
-
if (token === null) throw new Error("Invariant: opaque button token passed its schema");
|
|
1202
|
-
return token;
|
|
1203
|
-
});
|
|
1204
|
-
const contextualButtonHoverSchema = z.strictObject({
|
|
1205
|
-
kind: z.literal("shade-shift"),
|
|
1206
|
-
seedToken: opaqueButtonColourTokenSchema,
|
|
1207
|
-
fallbackDirection: z.enum(["lighter", "darker"]),
|
|
1208
|
-
preferredToken: opaqueButtonColourTokenSchema.optional()
|
|
1209
|
-
});
|
|
1210
|
-
const buttonShadeAmountSchema = z.number().finite().min(0).max(900).multipleOf(100);
|
|
1211
|
-
const buttonShadowIntensitySchema = z.enum([
|
|
1212
|
-
"subtle",
|
|
1213
|
-
"medium",
|
|
1214
|
-
"strong"
|
|
1215
|
-
]);
|
|
1216
|
-
/**
|
|
1217
|
-
* The complete persisted button-effect contract.
|
|
1218
|
-
*
|
|
1219
|
-
* Navigation has its own generic interactive-effect model. Button variants use
|
|
1220
|
-
* this closed union so unsupported effect IDs, unknown option keys, and unsafe
|
|
1221
|
-
* CSS values cannot become representable after the schema boundary.
|
|
1222
|
-
*/
|
|
1223
|
-
const buttonPressOffsetSchema = z.strictObject({
|
|
1224
|
-
x: z.number().int().min(0).max(12),
|
|
1225
|
-
y: z.number().int().min(0).max(12)
|
|
1226
|
-
});
|
|
1227
|
-
const buttonEffectApplicationSchema = z.discriminatedUnion("effectId", [
|
|
1228
|
-
z.strictObject({
|
|
1229
|
-
effectId: z.literal("darken-background"),
|
|
1230
|
-
options: z.strictObject({ amount: buttonShadeAmountSchema.optional() }).optional()
|
|
1231
|
-
}),
|
|
1232
|
-
z.strictObject({
|
|
1233
|
-
effectId: z.literal("lighten-background"),
|
|
1234
|
-
options: z.strictObject({ amount: buttonShadeAmountSchema.optional() }).optional()
|
|
1235
|
-
}),
|
|
1236
|
-
z.strictObject({
|
|
1237
|
-
effectId: z.literal("background-on-hover"),
|
|
1238
|
-
options: z.strictObject({ colorToken: opaqueButtonColourTokenSchema.optional() }).optional()
|
|
1239
|
-
}),
|
|
1240
|
-
z.strictObject({
|
|
1241
|
-
effectId: z.literal("animated-gradient"),
|
|
1242
|
-
options: z.strictObject({ direction: z.enum(["horizontal", "vertical"]).optional() }).optional()
|
|
1243
|
-
}),
|
|
1244
|
-
z.strictObject({
|
|
1245
|
-
effectId: z.literal("drop-shadow"),
|
|
1246
|
-
options: z.strictObject({ intensity: buttonShadowIntensitySchema.optional() }).optional()
|
|
1247
|
-
}),
|
|
1248
|
-
z.strictObject({
|
|
1249
|
-
effectId: z.literal("inner-shadow"),
|
|
1250
|
-
options: z.strictObject({}).optional()
|
|
1251
|
-
}),
|
|
1252
|
-
z.strictObject({
|
|
1253
|
-
effectId: z.literal("neumorphic-shadow"),
|
|
1254
|
-
options: z.strictObject({
|
|
1255
|
-
mode: z.enum(["raised", "pressed"]).optional(),
|
|
1256
|
-
intensity: buttonShadowIntensitySchema.optional()
|
|
1257
|
-
}).optional()
|
|
1258
|
-
}),
|
|
1259
|
-
z.strictObject({
|
|
1260
|
-
effectId: z.literal("retro-3d-shadow"),
|
|
1261
|
-
options: z.strictObject({}).optional()
|
|
1262
|
-
}),
|
|
1263
|
-
z.strictObject({
|
|
1264
|
-
effectId: z.literal("scale-up"),
|
|
1265
|
-
options: z.strictObject({ scale: z.enum([
|
|
1266
|
-
"1.02",
|
|
1267
|
-
"1.03",
|
|
1268
|
-
"1.05",
|
|
1269
|
-
"1.10"
|
|
1270
|
-
]).optional() }).optional()
|
|
1271
|
-
}),
|
|
1272
|
-
z.strictObject({
|
|
1273
|
-
effectId: z.literal("scale-down"),
|
|
1274
|
-
options: z.strictObject({ scale: z.enum([
|
|
1275
|
-
"0.90",
|
|
1276
|
-
"0.95",
|
|
1277
|
-
"0.97",
|
|
1278
|
-
"0.98"
|
|
1279
|
-
]).optional() }).optional()
|
|
1280
|
-
}),
|
|
1281
|
-
z.strictObject({
|
|
1282
|
-
effectId: z.literal("lift"),
|
|
1283
|
-
options: z.strictObject({ amount: z.enum([
|
|
1284
|
-
"0.125",
|
|
1285
|
-
"0.25",
|
|
1286
|
-
"0.5",
|
|
1287
|
-
"1"
|
|
1288
|
-
]).optional() }).optional()
|
|
1289
|
-
}),
|
|
1290
|
-
z.strictObject({
|
|
1291
|
-
effectId: z.literal("press-down"),
|
|
1292
|
-
options: z.strictObject({ offset: buttonPressOffsetSchema.optional() }).optional()
|
|
1293
|
-
}),
|
|
1294
|
-
z.strictObject({
|
|
1295
|
-
effectId: z.literal("pop"),
|
|
1296
|
-
options: z.strictObject({ intensity: z.enum([
|
|
1297
|
-
"subtle",
|
|
1298
|
-
"gentle",
|
|
1299
|
-
"medium",
|
|
1300
|
-
"dramatic"
|
|
1301
|
-
]).optional() }).optional()
|
|
1302
|
-
}),
|
|
1303
|
-
z.strictObject({
|
|
1304
|
-
effectId: z.literal("border-bottom-grow"),
|
|
1305
|
-
options: z.strictObject({
|
|
1306
|
-
height: z.union([z.literal(1), z.literal(2)]).optional(),
|
|
1307
|
-
origin: z.enum([
|
|
1308
|
-
"left",
|
|
1309
|
-
"center",
|
|
1310
|
-
"right"
|
|
1311
|
-
]).optional(),
|
|
1312
|
-
persistent: z.boolean().optional(),
|
|
1313
|
-
colourRole: z.literal("mark").optional()
|
|
1314
|
-
}).optional()
|
|
1315
|
-
}),
|
|
1316
|
-
z.strictObject({
|
|
1317
|
-
effectId: z.literal("inner-dashed-outline"),
|
|
1318
|
-
options: z.strictObject({
|
|
1319
|
-
colourRole: z.enum(["ink", "mark"]),
|
|
1320
|
-
width: z.number().finite().min(.5).max(4),
|
|
1321
|
-
inset: z.number().finite().min(0).max(16)
|
|
1322
|
-
})
|
|
1323
|
-
}),
|
|
1324
|
-
z.strictObject({
|
|
1325
|
-
effectId: z.literal("sketchy-border"),
|
|
1326
|
-
options: z.strictObject({ intensity: buttonShadowIntensitySchema.optional() }).optional()
|
|
1327
|
-
})
|
|
1328
|
-
]);
|
|
1329
|
-
const cornerStyleSchema = z.enum([
|
|
1330
|
-
"square",
|
|
1331
|
-
"rounded",
|
|
1332
|
-
"pill"
|
|
1333
|
-
]);
|
|
1334
|
-
const shadowSizeSchema = z.enum([
|
|
1335
|
-
"none",
|
|
1336
|
-
"low",
|
|
1337
|
-
"medium",
|
|
1338
|
-
"high"
|
|
1339
|
-
]);
|
|
1340
|
-
const hoverTransformSchema = z.enum([
|
|
1341
|
-
"none",
|
|
1342
|
-
"lift",
|
|
1343
|
-
"scale",
|
|
1344
|
-
"press"
|
|
1345
|
-
]);
|
|
1346
|
-
const buttonPaddingPresetSchema = z.enum([
|
|
1347
|
-
"compact",
|
|
1348
|
-
"default",
|
|
1349
|
-
"spacious"
|
|
1350
|
-
]);
|
|
1351
|
-
const gradientStyleSchema = z.enum([
|
|
1352
|
-
"linear",
|
|
1353
|
-
"radial",
|
|
1354
|
-
"conic"
|
|
1355
|
-
]);
|
|
1356
|
-
const gradientSharpnessSchema = z.enum([
|
|
1357
|
-
"smooth",
|
|
1358
|
-
"medium",
|
|
1359
|
-
"hard"
|
|
1360
|
-
]);
|
|
1361
|
-
const prioritySchema = z.union([
|
|
1362
|
-
z.literal(1),
|
|
1363
|
-
z.literal(2),
|
|
1364
|
-
z.literal(3)
|
|
1365
|
-
]);
|
|
1366
|
-
const buttonSurfaceFallbackSchema = z.discriminatedUnion("kind", [z.strictObject({ kind: z.literal("surface-outline") }), z.strictObject({
|
|
1367
|
-
kind: z.literal("variant"),
|
|
1368
|
-
role: variantRoleSchema
|
|
1369
|
-
})]);
|
|
1370
|
-
const buttonSurfacePolicyShape = Object.fromEntries(VARIANT_ROLES.map((role) => [role, z.array(buttonSurfaceFallbackSchema).max(VARIANT_ROLES.length)]));
|
|
1371
|
-
const buttonSurfacePolicySchema = z.strictObject(buttonSurfacePolicyShape);
|
|
1372
|
-
/**
|
|
1373
|
-
* CSS padding string in `"<vertical> <horizontal>"` shorthand form.
|
|
1374
|
-
*
|
|
1375
|
-
* Exactly two space-separated CSS length tokens. Each token is either the
|
|
1376
|
-
* literal `0` or a number followed by `rem`/`em`/`px`/`%`. This lets the
|
|
1377
|
-
* generator trust the shape rather than defensively defaulting downstream.
|
|
1378
|
-
*/
|
|
1379
|
-
const PADDING_TOKEN_PATTERN = /^(?:0|\d+(?:\.\d+)?(?:rem|em|px|%))$/;
|
|
1380
|
-
const paddingShorthandSchema = z.string().refine((value) => {
|
|
1381
|
-
const parts = value.split(/\s+/).filter(Boolean);
|
|
1382
|
-
return parts.length === 2 && parts.every((token) => PADDING_TOKEN_PATTERN.test(token));
|
|
1383
|
-
}, { message: "Padding must be two space-separated CSS length tokens (e.g. \"0.5rem 1rem\"). Use `0` for zero." });
|
|
1384
|
-
const buttonSizeConfigSchema = z.object({
|
|
1385
|
-
padding: paddingShorthandSchema,
|
|
1386
|
-
fontSize: z.string().optional(),
|
|
1387
|
-
borderRadius: z.string().optional()
|
|
1388
|
-
});
|
|
1389
|
-
/**
|
|
1390
|
-
* `xl` is optional on the wire so themes persisted before the `xl` size was
|
|
1391
|
-
* added (e.g. SWTS) continue to parse. When `xl` is missing the schema
|
|
1392
|
-
* backfills it from `lg`, keeping `ButtonSizes` a complete `sm/md/lg/xl` map
|
|
1393
|
-
* downstream — generators never need to deal with an undefined `xl`.
|
|
1394
|
-
*/
|
|
1395
|
-
const buttonSizesSchema = z.object({
|
|
1396
|
-
sm: buttonSizeConfigSchema,
|
|
1397
|
-
md: buttonSizeConfigSchema,
|
|
1398
|
-
lg: buttonSizeConfigSchema,
|
|
1399
|
-
xl: buttonSizeConfigSchema.optional()
|
|
1400
|
-
}).transform(({ sm, md, lg, xl }) => ({
|
|
1401
|
-
sm,
|
|
1402
|
-
md,
|
|
1403
|
-
lg,
|
|
1404
|
-
xl: xl ?? lg
|
|
1405
|
-
}));
|
|
1406
|
-
const buttonGlobalSettingsBaseSchema = z.strictObject({
|
|
1407
|
-
cornerStyle: cornerStyleSchema,
|
|
1408
|
-
cornerRadius: z.number().min(0).max(24).optional(),
|
|
1409
|
-
/**
|
|
1410
|
-
* Family-level shadow inherited by variants that don't set their own.
|
|
1411
|
-
* Optional and flat-by-default: when omitted, buttons carry no drop shadow
|
|
1412
|
-
* (`elevation: 'none'`). A personality opts the whole family into a shadow by
|
|
1413
|
-
* setting this; individual variants still override. There is no system-level
|
|
1414
|
-
* shadow-by-default — shadows only appear when explicitly declared.
|
|
1415
|
-
*/
|
|
1416
|
-
shadow: shadowSizeSchema.optional(),
|
|
1417
|
-
textTransform: textTransformSchema,
|
|
1418
|
-
fontWeight: fontWeightSchema,
|
|
1419
|
-
typography: buttonTypographySchema.optional(),
|
|
1420
|
-
fontSize: z.string().optional(),
|
|
1421
|
-
letterSpacing: letterSpacingSchema.optional(),
|
|
1422
|
-
italic: z.boolean().optional(),
|
|
1423
|
-
paddingPreset: buttonPaddingPresetSchema.optional(),
|
|
1424
|
-
hoverTransform: hoverTransformSchema,
|
|
1425
|
-
gradientStyle: gradientStyleSchema.optional(),
|
|
1426
|
-
gradientAngle: z.number().min(0).max(360).optional(),
|
|
1427
|
-
gradientSharpness: gradientSharpnessSchema.optional()
|
|
1428
|
-
});
|
|
1429
|
-
const buttonGlobalSettingsSchema = z.discriminatedUnion("hoverColor", [buttonGlobalSettingsBaseSchema.extend({
|
|
1430
|
-
hoverColor: z.literal("none"),
|
|
1431
|
-
hoverColorToken: z.never().optional()
|
|
1432
|
-
}), buttonGlobalSettingsBaseSchema.extend({
|
|
1433
|
-
hoverColor: z.literal("token"),
|
|
1434
|
-
hoverColorToken: opaqueButtonColourTokenSchema
|
|
1435
|
-
})]);
|
|
1436
|
-
const gradientDirectionSchema = z.enum([
|
|
1437
|
-
"to-r",
|
|
1438
|
-
"to-l",
|
|
1439
|
-
"to-t",
|
|
1440
|
-
"to-b",
|
|
1441
|
-
"to-tr",
|
|
1442
|
-
"to-tl",
|
|
1443
|
-
"to-br",
|
|
1444
|
-
"to-bl"
|
|
1445
|
-
]);
|
|
1446
|
-
const buttonColourTreatmentSchema = z.discriminatedUnion("type", [
|
|
1447
|
-
z.strictObject({
|
|
1448
|
-
type: z.literal("solid"),
|
|
1449
|
-
colorToken: opaqueButtonColourTokenSchema,
|
|
1450
|
-
foregroundToken: opaqueButtonColourTokenSchema.optional()
|
|
1451
|
-
}),
|
|
1452
|
-
z.strictObject({
|
|
1453
|
-
type: z.literal("gradient"),
|
|
1454
|
-
stops: z.array(opaqueButtonColourTokenSchema).min(2).transform((stops) => {
|
|
1455
|
-
const [first, second, ...rest] = stops;
|
|
1456
|
-
if (first === void 0 || second === void 0) throw new Error("Invariant: gradient stops passed the minimum length schema");
|
|
1457
|
-
return [
|
|
1458
|
-
first,
|
|
1459
|
-
second,
|
|
1460
|
-
...rest
|
|
1461
|
-
];
|
|
1462
|
-
}),
|
|
1463
|
-
direction: gradientDirectionSchema,
|
|
1464
|
-
foregroundToken: opaqueButtonColourTokenSchema
|
|
1465
|
-
}),
|
|
1466
|
-
z.strictObject({
|
|
1467
|
-
type: z.literal("surface"),
|
|
1468
|
-
role: z.literal("link")
|
|
1469
|
-
})
|
|
1470
|
-
]);
|
|
1471
|
-
const buttonBackgroundSchema = buttonColourTreatmentSchema;
|
|
1472
|
-
const buttonBorderSchema = z.strictObject({
|
|
1473
|
-
widthClass: z.string(),
|
|
1474
|
-
marksBoundary: z.literal(true).optional(),
|
|
1475
|
-
ring: z.literal(true).optional(),
|
|
1476
|
-
boundaryInk: opaqueButtonColourTokenSchema.optional()
|
|
1477
|
-
});
|
|
1478
|
-
const buttonVariantAffordanceSchema = z.strictObject({ iconId: z.string().min(1) });
|
|
1479
|
-
const variantShadowSchema = z.strictObject({
|
|
1480
|
-
elevation: z.enum([
|
|
1481
|
-
"none",
|
|
1482
|
-
"low",
|
|
1483
|
-
"medium",
|
|
1484
|
-
"high"
|
|
1485
|
-
]),
|
|
1486
|
-
softness: z.enum([
|
|
1487
|
-
"crisp",
|
|
1488
|
-
"soft",
|
|
1489
|
-
"hard"
|
|
1490
|
-
]).nullable(),
|
|
1491
|
-
position: z.enum(["bottom", "bottom-right"]).default("bottom"),
|
|
1492
|
-
colorToken: opaqueButtonColourTokenSchema.optional()
|
|
1493
|
-
});
|
|
1494
|
-
/** Recipe states own every visual property; treatment owns its readable label. */
|
|
1495
|
-
const buttonVisualAppearanceSchema = z.strictObject({
|
|
1496
|
-
background: buttonColourTreatmentSchema,
|
|
1497
|
-
text: z.literal("treatment"),
|
|
1498
|
-
border: z.union([z.literal("none"), buttonBorderSchema]),
|
|
1499
|
-
borderRadius: z.string(),
|
|
1500
|
-
shadow: z.union([z.literal("focus-indicator"), variantShadowSchema]),
|
|
1501
|
-
sizes: buttonSizesSchema,
|
|
1502
|
-
typography: z.strictObject({
|
|
1503
|
-
fontWeight: fontWeightSchema,
|
|
1504
|
-
typography: buttonTypographySchema,
|
|
1505
|
-
fontSize: z.string().nullable(),
|
|
1506
|
-
letterSpacing: z.union([letterSpacingSchema, z.literal("heading")]).nullable(),
|
|
1507
|
-
italic: z.boolean(),
|
|
1508
|
-
textTransform: textTransformSchema
|
|
1509
|
-
}),
|
|
1510
|
-
effects: z.array(buttonEffectApplicationSchema),
|
|
1511
|
-
transform: z.literal("none").optional(),
|
|
1512
|
-
contextualHover: contextualButtonHoverSchema.optional()
|
|
1513
|
-
});
|
|
1514
|
-
const buttonVisualStatesSchema = z.strictObject({
|
|
1515
|
-
base: buttonVisualAppearanceSchema.extend({ shadow: variantShadowSchema }),
|
|
1516
|
-
hover: buttonVisualAppearanceSchema.extend({ shadow: variantShadowSchema }),
|
|
1517
|
-
focus: buttonVisualAppearanceSchema.extend({
|
|
1518
|
-
shadow: z.literal("focus-indicator"),
|
|
1519
|
-
indicator: z.strictObject({
|
|
1520
|
-
kind: z.literal("surface-ink"),
|
|
1521
|
-
width: z.union([z.literal(2), z.literal(3)]),
|
|
1522
|
-
offset: z.union([z.literal(3), z.literal(4)])
|
|
1523
|
-
}).optional()
|
|
1524
|
-
}),
|
|
1525
|
-
active: buttonVisualAppearanceSchema.extend({ shadow: variantShadowSchema }),
|
|
1526
|
-
disabled: buttonVisualAppearanceSchema.extend({ shadow: variantShadowSchema })
|
|
1527
|
-
});
|
|
1528
|
-
const variantEffectsSchema = z.strictObject({
|
|
1529
|
-
base: z.array(buttonEffectApplicationSchema).optional(),
|
|
1530
|
-
hover: z.array(buttonEffectApplicationSchema).optional(),
|
|
1531
|
-
active: z.array(buttonEffectApplicationSchema).optional(),
|
|
1532
|
-
focus: z.array(buttonEffectApplicationSchema).optional()
|
|
1533
|
-
});
|
|
1534
|
-
/**
|
|
1535
|
-
* Per-variant size overrides schema — every entry is optional.
|
|
1536
|
-
*
|
|
1537
|
-
* For each size key present, the values override the theme's `sizes` config
|
|
1538
|
-
* for that size on this variant. Missing sizes fall through to theme.sizes,
|
|
1539
|
-
* then system defaults.
|
|
1540
|
-
*/
|
|
1541
|
-
const variantSizeOverridesSchema = z.object({
|
|
1542
|
-
sm: buttonSizeConfigSchema.optional(),
|
|
1543
|
-
md: buttonSizeConfigSchema.optional(),
|
|
1544
|
-
lg: buttonSizeConfigSchema.optional(),
|
|
1545
|
-
xl: buttonSizeConfigSchema.optional()
|
|
1546
|
-
});
|
|
1547
|
-
/**
|
|
1548
|
-
* Unified variant schema. Every variant participates in the size system; the
|
|
1549
|
-
* optional `sizes` field lets a variant scale differently than the theme
|
|
1550
|
-
* default (e.g. link-style variants declaring zero horizontal padding at
|
|
1551
|
-
* every size).
|
|
1552
|
-
*/
|
|
1553
|
-
const buttonVariantSchema = z.strictObject({
|
|
1554
|
-
id: buttonVariantIdSchema,
|
|
1555
|
-
name: z.string().min(1).max(20),
|
|
1556
|
-
enabled: z.boolean(),
|
|
1557
|
-
priority: prioritySchema,
|
|
1558
|
-
visualStates: buttonVisualStatesSchema.optional(),
|
|
1559
|
-
background: buttonBackgroundSchema,
|
|
1560
|
-
/** Tailwind radius token (e.g. `'rounded-md'`). Omit to inherit from `global.cornerStyle`. */
|
|
1561
|
-
borderRadius: z.string().optional(),
|
|
1562
|
-
shadow: variantShadowSchema.optional(),
|
|
1563
|
-
border: buttonBorderSchema.optional(),
|
|
1564
|
-
hoverBackgroundToken: opaqueButtonColourTokenSchema.optional(),
|
|
1565
|
-
contextualHover: contextualButtonHoverSchema.optional(),
|
|
1566
|
-
effects: variantEffectsSchema.optional(),
|
|
1567
|
-
sizes: variantSizeOverridesSchema.optional(),
|
|
1568
|
-
affordance: buttonVariantAffordanceSchema.optional()
|
|
1569
|
-
});
|
|
1570
|
-
const buttonSystemSchema = z.strictObject({
|
|
1571
|
-
global: buttonGlobalSettingsSchema,
|
|
1572
|
-
variants: z.array(buttonVariantSchema).min(1).max(6),
|
|
1573
|
-
sizes: buttonSizesSchema.optional(),
|
|
1574
|
-
surfacePolicy: buttonSurfacePolicySchema.optional(),
|
|
1575
|
-
surfaceContexts: z.record(z.string(), z.strictObject({
|
|
1576
|
-
primary: opaqueButtonColourTokenSchema,
|
|
1577
|
-
primaryText: opaqueButtonColourTokenSchema.optional()
|
|
1578
|
-
})).optional()
|
|
1579
|
-
}).superRefine((system, ctx) => {
|
|
1580
|
-
const seen = /* @__PURE__ */ new Set();
|
|
1581
|
-
system.variants.forEach((variant, index) => {
|
|
1582
|
-
if (seen.has(variant.id)) ctx.addIssue({
|
|
1583
|
-
code: "custom",
|
|
1584
|
-
path: [
|
|
1585
|
-
"variants",
|
|
1586
|
-
index,
|
|
1587
|
-
"id"
|
|
1588
|
-
],
|
|
1589
|
-
message: `Duplicate button variant ID: ${variant.id}`
|
|
1590
|
-
});
|
|
1591
|
-
seen.add(variant.id);
|
|
1592
|
-
});
|
|
1593
|
-
});
|
|
1594
|
-
//#endregion
|
|
1595
|
-
//#region ../theme-core/src/buttons/types.ts
|
|
1596
|
-
function isVariantRole(value) {
|
|
1597
|
-
return VARIANT_ROLES.includes(value);
|
|
1598
|
-
}
|
|
1599
|
-
function asSpecialVariantId(value) {
|
|
1600
|
-
const parsed = buttonVariantIdSchema.safeParse(value);
|
|
1601
|
-
if (!parsed.success) throw new Error("SpecialVariantId must be a CSS-safe button variant ID");
|
|
1602
|
-
return parsed.data;
|
|
1603
|
-
}
|
|
1604
|
-
/**
|
|
1605
|
-
* Magic alias the CSS generator emits for the highest-priority variant.
|
|
1606
|
-
*
|
|
1607
|
-
* Shared between generator and renderer so neither side hard-codes the string.
|
|
1608
|
-
*/
|
|
1609
|
-
const DEFAULT_VARIANT_ALIAS_ID = "default";
|
|
1610
|
-
function unsafeAsOpaqueButtonColourToken(value) {
|
|
1611
|
-
return value;
|
|
1612
|
-
}
|
|
1613
|
-
z.enum(["none", "token"]);
|
|
1614
|
-
const standardButtonSurfacePolicy = {
|
|
1615
|
-
primary: [{ kind: "surface-outline" }],
|
|
1616
|
-
secondary: [{ kind: "surface-outline" }, {
|
|
1617
|
-
kind: "variant",
|
|
1618
|
-
role: "primary"
|
|
1619
|
-
}],
|
|
1620
|
-
outline: [{ kind: "surface-outline" }],
|
|
1621
|
-
ghost: [{ kind: "surface-outline" }],
|
|
1622
|
-
accent: [{ kind: "surface-outline" }, {
|
|
1623
|
-
kind: "variant",
|
|
1624
|
-
role: "primary"
|
|
1625
|
-
}]
|
|
1626
|
-
};
|
|
1627
|
-
const STANDARD_BUTTON_SURFACE_POLICY = Object.freeze(Object.fromEntries(VARIANT_ROLES.map((role) => [role, Object.freeze([...standardButtonSurfacePolicy[role]])])));
|
|
1628
|
-
function createStandardButtonSurfacePolicy() {
|
|
1629
|
-
return Object.fromEntries(VARIANT_ROLES.map((role) => [role, [...STANDARD_BUTTON_SURFACE_POLICY[role]]]));
|
|
1630
|
-
}
|
|
1631
|
-
const buttonSizeNameSchema = z.enum([
|
|
1632
|
-
"sm",
|
|
1633
|
-
"md",
|
|
1634
|
-
"lg",
|
|
1635
|
-
"xl"
|
|
1636
|
-
]);
|
|
1637
|
-
//#endregion
|
|
1638
612
|
//#region ../theme-core/src/buttons/constants.ts
|
|
1639
613
|
/**
|
|
1640
614
|
* Shared constants for button CSS generation
|
|
@@ -2593,4 +1567,4 @@ function interpolateHex(startHex, endHex, position) {
|
|
|
2593
1567
|
return `#${channel(start.r, end.r)}${channel(start.g, end.g)}${channel(start.b, end.b)}`;
|
|
2594
1568
|
}
|
|
2595
1569
|
//#endregion
|
|
2596
|
-
export {
|
|
1570
|
+
export { featuresFromHex as A, contrastRatio as C, relativeLuminance as D, preparePaletteColourIndex as E, oklchToOklab as F, rgbToHex as I, srgbToOklab as L, oklabToOklch as M, oklabToSrgb as N, solidPaint as O, oklchToHexGamut as P, assertContrastRatio as S, maxContrastBlackOrWhite as T, isOnColorBackgroundCandidateToken as _, formatButtonColourContractError as a, pickBlackOrWhiteTextColor as b, DEFAULT_BUTTON_SIZES as c, generateShadowValue as d, colourFamily as f, expandPalette as g, deriveSurfaceMutedColor as h, BUTTON_CONTRAST_POLICY as i, hexToRgb as j, worstContrast as k, ELEVATION_OFFSET as l, deriveSurfaceDecorationColors as m, compileButtonColourStates as n, BORDER_RADIUS_MAP as o, oklabDistance as p, resolveSolidButtonColour as r, BORDER_WIDTH_MAP as s, buttonStateBorder as t, FONT_SIZE_MAP as u, onColorTokenName as v, hexLuminance as w, ORDINARY_TEXT_MIN_CONTRAST_RATIO as x, getTextColorForBackground as y };
|