@riverbankcms/sdk 0.181.0 → 0.183.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/CHANGELOG.md +79 -0
- package/README.md +49 -3
- package/dist/_dts/{BlocksIslandsHydrator-CVCasDPz.d.ts → BlocksIslandsHydrator-X1_G96iN.d.ts} +1 -1
- package/dist/_dts/{Page-Dtj2Ui3S.d.ts → Page-CEqZJZEE.d.ts} +7 -7
- package/dist/_dts/{SdkPreviewMode-D1f_60WW.d.ts → SdkPreviewMode-DQejfbXL.d.ts} +2 -2
- package/dist/_dts/{client-Chr9pNVW.d.ts → client-B_B_amKD.d.ts} +2 -3
- package/dist/_dts/{content-types-kjccgopX.d.ts → content-types-Dhx5Ocvx.d.ts} +9 -16
- package/dist/_dts/{contracts-BodaiS00.d.ts → contracts-FeOnfoa1.d.ts} +3 -3
- package/dist/_dts/{generatePageMetadata-BS6kaJFp.d.ts → generatePageMetadata-m70J6tit.d.ts} +2 -2
- package/dist/_dts/{index-Brl6_I2j.d.ts → index-BOpUh8kO.d.ts} +1 -1
- package/dist/_dts/{index-CJkefwYh.d.ts → index-Bizdaxji.d.ts} +2 -2
- package/dist/_dts/{index-Diqt0PvG.d.ts → index-BxCmCit0.d.ts} +1 -1
- package/dist/_dts/{index-DG0OvBs0.d.ts → index-CjAkEWAp.d.ts} +4 -4
- package/dist/_dts/{index-D1WpKwQe.d.ts → index-iuFrbIjt.d.ts} +1 -1
- package/dist/_dts/{index-Dy50xUMK.d.ts → index-liuhlOX7.d.ts} +2 -2
- package/dist/_dts/{loadContent-BgxshKrA.d.ts → loadContent-D4wrTIIw.d.ts} +7 -7
- package/dist/_dts/{request-CA0izds5.d.ts → request-Gn0O1blj.d.ts} +25042 -23761
- package/dist/_dts/{resolveBlockData-ChQmwEd3.d.ts → resolveBlockData-D5duwuqS.d.ts} +5 -5
- package/dist/_dts/{resolvePageContent-BvGyvblj.d.ts → resolvePageContent-xzJ3c9Na.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 +7 -7
- 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 -1
- 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 +3 -3
- package/dist/_dts/sdk/src/next/index.d.ts +7 -7
- 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 +1 -1
- package/dist/_dts/sdk/src/portal/index.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 +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 +91 -2
- package/dist/_dts/{serviceBookingOutline-BgFbJQhU.d.ts → serviceBookingOutline-B1gyJon_.d.ts} +7 -7
- package/dist/_dts/{types-CgS3xLk8.d.ts → types-BoITy0rA.d.ts} +41 -4
- package/dist/_dts/{types-CQrsP1x_.d.ts → types-DBNuMtSk.d.ts} +16 -5
- package/dist/_dts/{types-R65DKjPn.d.ts → types-DHMcuoeQ.d.ts} +7 -7
- package/dist/_dts/{validation-6LTIbuBA.d.ts → validation-BIPO-XlE.d.ts} +4 -4
- package/dist/client/{BlocksIslandsHydrator-DqZPz6oW.mjs → BlocksIslandsHydrator-Ct8slgRk.mjs} +22 -18
- package/dist/client/{BookingMailingListNote-uWfR2kaG.mjs → BookingMailingListNote-qqTxGGS4.mjs} +7 -7
- package/dist/client/{BookingQuestionFields-CyNIKw6k.mjs → BookingQuestionFields-DCh9MUIF.mjs} +2 -2
- package/dist/client/{CalendarAction-D_Glwvz2.mjs → CalendarAction-RcdaStG7.mjs} +1 -1
- package/dist/client/{CalendarNavigationChevron-BGCX3zwG.mjs → CalendarNavigationChevron-D7Wt-Oaa.mjs} +27 -10
- package/dist/client/{CheckboxChoice-C8i4NraK.mjs → CheckboxChoice-BdGxZWeg.mjs} +1 -1
- package/dist/client/{DemoBookingPortalAccess-DFLPyuqe.mjs → DemoBookingPortalAccess-HFVkoOac.mjs} +5 -5
- package/dist/client/{EventCalendar.client-zDL4-t-B.mjs → EventCalendar.client-BtkJW8bA.mjs} +10 -10
- package/dist/client/{EventCombined.client-uciDKLID.mjs → EventCombined.client-DxaGjFFS.mjs} +9 -9
- package/dist/client/{EventEmbeddedCheckoutStep-BGkbUhuw.mjs → EventEmbeddedCheckoutStep-B2c5dR49.mjs} +1 -1
- package/dist/client/{EventItem-CwzrjcRw.mjs → EventItem-Fr2qi2C2.mjs} +33 -186
- package/dist/client/{EventListWeekNavigation-ChvcnPma.mjs → EventListWeekNavigation-BRMaq0ky.mjs} +1 -1
- package/dist/client/{EventListing.client-DA57Qoyx.mjs → EventListing.client-BhGxfbjt.mjs} +3 -3
- package/dist/client/{EventListing.view-DZ0qMFF4.mjs → EventListing.view-COuEJzbO.mjs} +8 -8
- package/dist/client/{EventRegistrationPayment-DSqCJL8E.mjs → EventRegistrationPayment-BTLYhVxD.mjs} +41 -195
- package/dist/client/{Page-C7mygH_f.mjs → Page-CgbQZP5g.mjs} +2947 -1018
- package/dist/client/{ProtectedSubmitButton-BNnKuir8.mjs → ProtectedSubmitButton-BG7my0Qf.mjs} +1 -1
- package/dist/client/{SiteTermsAgreementField-B4z-e4Wq.mjs → SiteTermsAgreementField-DQNkfNLA.mjs} +3 -3
- package/dist/client/{StepIndicator-Dn_DY4oY.mjs → StepIndicator-DvPekKeM.mjs} +1 -1
- package/dist/client/{StepIndicator-atfDU82W.mjs → StepIndicator-DyXoI3ob.mjs} +221 -20
- package/dist/client/{ThemedButton-PFOhXktM.mjs → ThemedButton-Bc9DBbVp.mjs} +42 -9
- package/dist/client/{accessibleSurfaces-n6kS6Hct.mjs → accessibleSurfaces-wj4Rloo5.mjs} +1214 -724
- package/dist/client/{accordion-CsW8U3ff.mjs → accordion-BVXfjnh-.mjs} +1 -1
- package/dist/client/{booking-form.client-cBWM392H.mjs → booking-form.client-DycPGtke.mjs} +191 -71
- package/dist/client/{bookingForm-DgySpp6C.mjs → bookingForm-DrWSUqL3.mjs} +4 -4
- package/dist/client/bookings.mjs +5 -5
- package/dist/client/{boxStyleClassNames-BpGVdLFD.mjs → boxStyleClassNames-CduDRcIk.mjs} +2 -2
- package/dist/client/buttonParts-CJEtVOUy.mjs +1511 -0
- package/dist/client/{carousel-DJoleFV3.mjs → carousel-DyCLMP8s.mjs} +2 -2
- package/dist/client/{carousel.client-BtLwHefX.mjs → carousel.client-DffP_Nv0.mjs} +1 -1
- package/dist/client/{cart-EO5o6uPH.mjs → cart-BuEp_cj4.mjs} +3 -3
- package/dist/client/{cart.client-D_gPw45z.mjs → cart.client-CAO39uDG.mjs} +1 -1
- package/dist/client/{checkout-NVfZW0kR.mjs → checkout-BoxzT64s.mjs} +3 -3
- package/dist/client/{checkout.client-DD3JuqOy.mjs → checkout.client-IGUy7XOx.mjs} +1 -1
- package/dist/client/{checkoutUrls-z2gXvlGw.mjs → checkoutUrls-D0UsiFmm.mjs} +1 -1
- package/dist/client/client.mjs +466 -94
- package/dist/client/{constants-CoOkvw__.mjs → constants-C_8AxMdm.mjs} +1 -1
- package/dist/client/{context-CRhn9qzS.mjs → context-D1L0pe__.mjs} +23 -5
- package/dist/client/{dateFormatting-BnWB4L1s.mjs → dateFormatting-HvfmS_cH.mjs} +1 -1
- package/dist/client/{demoPortalMagicLink-CWDGSTBu.mjs → demoPortalMagicLink-BunFTnIq.mjs} +1 -1
- package/dist/client/{enhanceHeaderSection-tdP_-Z9o.mjs → enhanceHeaderSection-CtLAG651.mjs} +4 -4
- package/dist/client/{event-registration.client-D7YYKySQ.mjs → event-registration.client-DiSxkBUP.mjs} +15 -15
- package/dist/client/{eventCalendar-CsAfu5d0.mjs → eventCalendar-DUnhwZ1o.mjs} +4 -4
- package/dist/client/{eventCombined-VXJB5CoS.mjs → eventCombined-BvBQo0nF.mjs} +4 -4
- package/dist/client/{eventListing-B3KIZNfY.mjs → eventListing-aTLifOX7.mjs} +4 -4
- package/dist/client/{eventRegistration-BP-dEk1c.mjs → eventRegistration-DFd7pr09.mjs} +4 -4
- package/dist/client/{form-DM8Zbxbv.mjs → form-Dikmc2AO.mjs} +3 -3
- package/dist/client/{form.client-e2z_Tlgk.mjs → form.client-zHaQK5I9.mjs} +5 -5
- package/dist/client/{form.parts-Ctljy1a3.mjs → form.parts-BLl9n8TH.mjs} +3 -3
- package/dist/client/gifting/client.mjs +16 -9
- package/dist/client/{gifting-DWIsqQru.mjs → gifting-CufPM38H.mjs} +4 -4
- package/dist/client/{gifting.client-QsSWF0uA.mjs → gifting.client--N1GaSY8.mjs} +155 -84
- package/dist/client/gifting.interactive-D9MK4HkV.mjs +157 -0
- package/dist/client/gifting.parts-CRtiRzo-.mjs +119 -0
- package/dist/client/{headerSection-DAkRkwb-.mjs → headerSection-BIaBpmk3.mjs} +2 -2
- package/dist/client/{noop-Dl4mZ-rr.mjs → islands-DJDLGQEm.mjs} +16008 -8676
- package/dist/client/{newsletter-form.client-WYja9-WN.mjs → newsletter-form.client-wg_JHTxm.mjs} +6 -6
- package/dist/client/{newsletter-form.interactive-RuM86VAv.mjs → newsletter-form.interactive-hzpkW9NQ.mjs} +384 -326
- package/dist/client/{newsletter-form.parts-2petDnWv.mjs → newsletter-form.parts-CgzpSv9p.mjs} +2 -2
- package/dist/client/{newsletterForm-BUbXdA_e.mjs → newsletterForm-CvxLiEBT.mjs} +3 -3
- package/dist/client/portal/client.mjs +291 -101
- package/dist/client/{portalOrders-COGn4BKG.mjs → portalOrders-tCxS04g0.mjs} +3 -2
- package/dist/client/{portalRoutes-D72yvtDh.mjs → portalRoutes-DTHlWg_F.mjs} +33 -7
- package/dist/client/{product-detail.client-pOAryevt.mjs → product-detail.client-22Q7zgjN.mjs} +1 -1
- package/dist/client/{product-list.client-CcUpUiud.mjs → product-list.client-DFWYvK8z.mjs} +1 -1
- package/dist/client/{productDetail-BZJCfqat.mjs → productDetail-DhZAwo60.mjs} +3 -3
- package/dist/client/{productList-CiRs3mNb.mjs → productList-BiVpbZK2.mjs} +3 -3
- package/dist/client/{propsDecoder--uHW4tFM.mjs → propsDecoder-DFYqKnLy.mjs} +4 -2
- package/dist/client/{registry.server-CDNNd8wC.mjs → registry.server-C3OBRg7x.mjs} +2305 -873
- package/dist/client/rendering/client.mjs +29 -26
- package/dist/client/rendering/islands.mjs +1 -1
- package/dist/client/rendering.mjs +5 -5
- package/dist/client/{richText-coerce-CQGE_wHV.mjs → richText-coerce-ms477Z08.mjs} +2 -2
- package/dist/client/{routeIslandApiConfig-BtCg87-N.mjs → routeIslandApiConfig-B6nQeqvH.mjs} +1 -1
- package/dist/client/{runtimeResponse-Ds9cmBUf.mjs → runtimeResponse-BYqsV1Kb.mjs} +1 -1
- package/dist/client/runtimeResponse-CUX_lldL.mjs +3 -0
- package/dist/client/{shop-commerce-D8evQnMT.mjs → shop-commerce-DVsIcPaI.mjs} +16 -15
- package/dist/client/{shop-commerce-store-C9PcsSTj.mjs → shop-commerce-store-7mO6KY7_.mjs} +1 -1
- package/dist/client/{shop-discount-apply.state-D5CtGfJI.mjs → shop-discount-apply.state-L1Vge8tG.mjs} +2 -2
- package/dist/client/{shop-Rx_gEMK8.mjs → shop-xt4dQ3HH.mjs} +3 -3
- package/dist/client/{shop.client-D4lzQ9oY.mjs → shop.client-DNJfD3VQ.mjs} +28 -17
- package/dist/client/{shopShared-BVbq7Nm-.mjs → shopShared-DS8t6749.mjs} +2 -2
- package/dist/client/spam-protection.mjs +1 -1
- package/dist/client/{src-ZSqRK3dD.mjs → src-Do_s2lqH.mjs} +16 -19
- package/dist/client/{timetableModel-BQJrSK0K.mjs → timetableModel-Dy3nNfTG.mjs} +13 -17
- package/dist/client/{useAvailableSlots-Dm3lKJKR.mjs → useAvailableSlots-DcjtDpUu.mjs} +2 -2
- package/dist/client/{useDiscountCodeUi-klgfGn7f.mjs → useDiscountCodeUi-DvdFFWOT.mjs} +1 -1
- package/dist/client/{useEventPagination-Jnjt7_ly.mjs → useEventPagination-Cq-7sU5_.mjs} +8 -8
- package/dist/client/{view-CC_yQLSA.mjs → view-4gnPcpWJ.mjs} +24 -9
- package/dist/client/{wizardSteps-BliJOzEX.mjs → wizardSteps-DDvL3iza.mjs} +375 -186
- package/dist/preview-next/client/{EventEmbeddedCheckoutStep-aRJjq4x8.mjs → EventEmbeddedCheckoutStep-CLqSRUpt.mjs} +1 -1
- package/dist/preview-next/client/{LocationPickerEnvironment-BW3dRFIv.mjs → LocationPickerEnvironment-CIdAg-Tm.mjs} +1 -1
- package/dist/preview-next/client/{MapLibreEditMap-Db9BHyXh.mjs → MapLibreEditMap-Bm85jX35.mjs} +2 -2
- package/dist/preview-next/client/{PageSectionToolbar-BhL0uADo.mjs → PageSectionToolbar-D8srnz9R.mjs} +445 -18
- package/dist/preview-next/client/{PreviewEditorSidebar-Ct8eIm0i.mjs → PreviewEditorSidebar-DVpk5cqp.mjs} +3871 -1947
- package/dist/preview-next/client/{PreviewEditorUI-BS32G4V9.mjs → PreviewEditorUI-XoTtHSFH.mjs} +11 -36
- package/dist/preview-next/client/{PreviewShell-RL0WfZXD.mjs → PreviewShell-VQHsRg2u.mjs} +40 -35
- package/dist/preview-next/client/{SdkPreviewModeRuntime-MK_gHeGy.mjs → SdkPreviewModeRuntime-CLdF9f6o.mjs} +51 -20
- package/dist/preview-next/client/{ThemedButton-CVYz7h68.mjs → ThemedButton-ORNN4x-3.mjs} +782 -16
- package/dist/preview-next/client/{lucide-react-00FF_oar.mjs → lucide-react-eAi3tDAr.mjs} +11 -1
- package/dist/preview-next/client/{previewAssistantSlot-CQyS8pcq.mjs → previewAssistantSlot-CqH91EwA.mjs} +20687 -8562
- package/dist/preview-next/client/{previewChromeRoot-BSxp3Mfu.mjs → previewChromeRoot-B3ySEu6p.mjs} +3 -90
- package/dist/preview-next/client/runtime.mjs +3 -3
- package/dist/preview-next/client/{sdk-runtime-DKnTzy74.mjs → sdk-runtime-CdpSupcr.mjs} +2 -2
- package/dist/preview-next/client/{siteStyleAccess-BlmbvbLN.mjs → siteStyleAccess-C6eOP6QW.mjs} +35 -6
- package/dist/preview-next/client/{useAutosaveStatus-D-7GwZOQ.mjs → useAutosaveStatus-BhPg4e-r.mjs} +49 -3
- package/dist/preview-next/client/{useOpenBlockForSetup-BNZtGM5g.mjs → useOpenBlockForSetup-BaWUF9D7.mjs} +2007 -448
- package/dist/preview-next/container-responsive.css +320 -0
- package/dist/preview-next/editor-chrome.css +23 -2
- package/dist/preview-next/keepAlive.mjs +1 -1
- package/dist/preview-next/middleware.mjs +1 -1
- package/dist/preview-next/{route-contract-R3PcMmax.mjs → route-contract-Ch0X99vE.mjs} +183 -18
- package/dist/server/{Block.shared-CniF9tSu.mjs → Block.shared-B2FmczLO.mjs} +5 -5
- package/dist/server/{ThemeScopeCore-BQWsnGT6.mjs → ThemeScopeCore-DtAyv9qA.mjs} +51 -29
- package/dist/server/{accessibleSurfaces-WPzUAHp4.mjs → accessibleSurfaces-BtPqb76u.mjs} +509 -389
- package/dist/server/{accordions-By_0Ykks.mjs → accordions-vzdZ2Wt1.mjs} +1 -1
- package/dist/server/{bindings-DxojjtK3.mjs → bindings-B_9JuU66.mjs} +7 -7
- package/dist/server/{client-CDndhbYO.mjs → client-DC7cjiSw.mjs} +489 -93
- package/dist/server/config-validation.mjs +1 -1
- package/dist/server/config.mjs +2 -2
- package/dist/server/{constants-VyF5nEhL.mjs → constants-d6nPNJpe.mjs} +33 -6
- package/dist/server/{customCss-C9kgPHvr.mjs → customCss-rtIfEYwQ.mjs} +1 -18
- package/dist/server/data/resolveBlockData.mjs +1 -1
- package/dist/server/{resolveButtonColourStates-B0O1IM16.mjs → expandPalette-DxPrNOAB.mjs} +950 -316
- package/dist/server/index.mjs +3 -3
- package/dist/server/{loadContent-BKstMBmX.mjs → loadContent-hb27HYic.mjs} +11 -10
- package/dist/server/{loadPage-IgNnZaqr.mjs → loadPage-JToD8wDD.mjs} +3 -3
- package/dist/server/{lookMediaFrame-TFjgNG61.mjs → lookMediaFrame-CTsycLLK.mjs} +94 -39
- package/dist/server/manifest.mjs +2 -2
- package/dist/server/{navigation-quBYlSKD.mjs → navigation-B2WhGofA.mjs} +1 -1
- package/dist/server/navigation.mjs +1 -1
- package/dist/server/next.mjs +8 -8
- package/dist/server/{overrideResolution-CCaAPpIa.mjs → overrideResolution-vD5KTClL.mjs} +1 -1
- package/dist/server/page-converter.mjs +3 -3
- package/dist/server/{pageRenderPlan-B7iULvKe.mjs → pageRenderPlan-CdqJ1NQZ.mjs} +242 -336
- package/dist/server/{pageRuntimeSupport-BytMroxn.mjs → pageRuntimeSupport-CAhr4oOf.mjs} +3 -3
- package/dist/server/{pageShared-Dcs_XTIO.mjs → pageShared-m80Xu2pd.mjs} +1292 -877
- package/dist/server/{parseThemeForPersistence-Bihl4W5K.mjs → parseThemeForPersistence-CRwOZfpa.mjs} +3 -3
- package/dist/server/{portal-CMW_b9mG.mjs → portal-B2wCQno_.mjs} +1 -1
- package/dist/server/portal.mjs +2 -2
- package/dist/server/{prebuild-agaH-vZV.mjs → prebuild-BWIkFaXq.mjs} +1 -1
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/{prefetchBlockData-DwpRjqw4.mjs → prefetchBlockData-D1PHU-K9.mjs} +3 -3
- package/dist/server/{registry-DM9dHfDC.mjs → registry-KtsOsAzY.mjs} +21703 -10936
- 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 +9 -9
- package/dist/server/{resolveBlockData-CinHGf8l.mjs → resolveBlockData-sjIDJYl7.mjs} +1 -1
- package/dist/server/{schema-CwfxQjc4.mjs → schema-BBEqquBM.mjs} +44 -28
- package/dist/server/server.mjs +3 -3
- package/dist/server/{servicePageContent-BBBhOtdE.mjs → servicePageContent-ChEZDRwU.mjs} +38 -15
- package/dist/server/theme-bridge.mjs +34 -9
- package/dist/server/theme.mjs +2 -2
- package/dist/server/{three-pass-converter-DPaUPTfl.mjs → three-pass-converter-DKCIBeb1.mjs} +2 -2
- package/dist/server/{titleSourceSchema-NhK6azFS.mjs → titleSourceSchema-DybHErxH.mjs} +4 -4
- package/dist/server/{typeGuards-CTW_9AXq.mjs → typeGuards-DZOaGTEv.mjs} +126 -126
- package/dist/server/{types-BKaBZFjD.mjs → types-vyz09w64.mjs} +479 -8
- package/dist/server/{validation-DG5jX3jH.mjs → validation-Cvi-1TZZ.mjs} +13 -9
- package/dist/server/{version-CipbxPHL.mjs → version-B-icAIV1.mjs} +1 -1
- package/dist/server/{video-Cdr3wh-q.mjs → video-DBaeSawZ.mjs} +1 -1
- package/dist/styles/index.css +2568 -154
- package/package.json +1 -1
- package/dist/client/gifting.parts-CedLgwa_.mjs +0 -86
- package/dist/client/runtimeResponse-DL_ARBpa.mjs +0 -3
- package/dist/client/types-BEaKfam_.mjs +0 -778
|
@@ -1,778 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
//#region ../site-contracts/src/identity/blockKinds.ts
|
|
4
|
-
/**
|
|
5
|
-
* Standard semantic variant roles a theme exposes.
|
|
6
|
-
*
|
|
7
|
-
* Block content references variants by role; the active theme determines
|
|
8
|
-
* what each role looks like.
|
|
9
|
-
*/
|
|
10
|
-
const VARIANT_ROLES = [
|
|
11
|
-
"primary",
|
|
12
|
-
"secondary",
|
|
13
|
-
"outline",
|
|
14
|
-
"ghost",
|
|
15
|
-
"accent"
|
|
16
|
-
];
|
|
17
|
-
const variantRoleSchema = z.enum(VARIANT_ROLES);
|
|
18
|
-
const SYSTEM_BLOCK_KINDS = [
|
|
19
|
-
"block.hero",
|
|
20
|
-
"block.intro",
|
|
21
|
-
"block.columns",
|
|
22
|
-
"block.collection",
|
|
23
|
-
"block.class-prices",
|
|
24
|
-
"block.feature-cards",
|
|
25
|
-
"block.media-text",
|
|
26
|
-
"block.cta-full",
|
|
27
|
-
"block.single-button",
|
|
28
|
-
"block.body-text",
|
|
29
|
-
"block.location-map",
|
|
30
|
-
"block.faq",
|
|
31
|
-
"block.list",
|
|
32
|
-
"block.testimonials",
|
|
33
|
-
"block.team-members",
|
|
34
|
-
"block.embed",
|
|
35
|
-
"block.blog-post",
|
|
36
|
-
"block.blog-listing",
|
|
37
|
-
"block.site-header",
|
|
38
|
-
"block.site-footer",
|
|
39
|
-
"block.form",
|
|
40
|
-
"block.contact-newsletter",
|
|
41
|
-
"block.appointment-booking",
|
|
42
|
-
"block.appointment-services",
|
|
43
|
-
"block.service-details",
|
|
44
|
-
"block.weekly-slot-availability",
|
|
45
|
-
"block.event-registration",
|
|
46
|
-
...[
|
|
47
|
-
"block.event-details",
|
|
48
|
-
"block.event-spotlight",
|
|
49
|
-
"block.event-listing",
|
|
50
|
-
"block.event-calendar",
|
|
51
|
-
"block.recurring-schedule",
|
|
52
|
-
"block.offerings-preview"
|
|
53
|
-
],
|
|
54
|
-
"block.shop",
|
|
55
|
-
"block.product-list",
|
|
56
|
-
"block.product-detail",
|
|
57
|
-
"block.cart",
|
|
58
|
-
"block.checkout",
|
|
59
|
-
"block.gifting",
|
|
60
|
-
"block.newsletter-signup",
|
|
61
|
-
"block.image-gallery",
|
|
62
|
-
"block.video-grid",
|
|
63
|
-
"block.audio-player",
|
|
64
|
-
"block.file-download"
|
|
65
|
-
];
|
|
66
|
-
//#endregion
|
|
67
|
-
//#region ../site-contracts/src/tokens.ts
|
|
68
|
-
const blockColorTokenNames = [
|
|
69
|
-
"text",
|
|
70
|
-
"heading",
|
|
71
|
-
"mutedText",
|
|
72
|
-
"surface",
|
|
73
|
-
"background",
|
|
74
|
-
"foreground",
|
|
75
|
-
"border",
|
|
76
|
-
"primary",
|
|
77
|
-
"secondary",
|
|
78
|
-
"accent",
|
|
79
|
-
"success",
|
|
80
|
-
"warning",
|
|
81
|
-
"info",
|
|
82
|
-
"error",
|
|
83
|
-
"destructive",
|
|
84
|
-
"scrim",
|
|
85
|
-
"shadow",
|
|
86
|
-
"onPrimary",
|
|
87
|
-
"onSecondary",
|
|
88
|
-
"onAccent",
|
|
89
|
-
"onSuccess",
|
|
90
|
-
"onWarning",
|
|
91
|
-
"onInfo",
|
|
92
|
-
"onError",
|
|
93
|
-
"onDestructive",
|
|
94
|
-
"onSurface",
|
|
95
|
-
"onText"
|
|
96
|
-
];
|
|
97
|
-
function parseOpacityPercent(source) {
|
|
98
|
-
const trimmed = source.trim();
|
|
99
|
-
if (!trimmed) return null;
|
|
100
|
-
if (!/^\d{1,3}(?:\.\d+)?$/.test(trimmed)) return null;
|
|
101
|
-
const value = Number(trimmed);
|
|
102
|
-
if (!Number.isFinite(value)) return null;
|
|
103
|
-
if (value < 0 || value > 100) return null;
|
|
104
|
-
return value;
|
|
105
|
-
}
|
|
106
|
-
function parseColorTokenParts(source) {
|
|
107
|
-
const trimmed = source.trim();
|
|
108
|
-
if (trimmed.startsWith("raw:")) return {
|
|
109
|
-
kind: "raw",
|
|
110
|
-
value: trimmed.slice(4)
|
|
111
|
-
};
|
|
112
|
-
const [token, opacityRaw, extra] = trimmed.split("/");
|
|
113
|
-
if (!token || extra !== void 0) return {
|
|
114
|
-
kind: "invalid",
|
|
115
|
-
token: trimmed
|
|
116
|
-
};
|
|
117
|
-
if (opacityRaw === void 0) return {
|
|
118
|
-
kind: "token",
|
|
119
|
-
token,
|
|
120
|
-
opacityPercent: null
|
|
121
|
-
};
|
|
122
|
-
const opacityPercent = parseOpacityPercent(opacityRaw);
|
|
123
|
-
if (opacityPercent === null) return {
|
|
124
|
-
kind: "invalid",
|
|
125
|
-
token: trimmed
|
|
126
|
-
};
|
|
127
|
-
return {
|
|
128
|
-
kind: "token",
|
|
129
|
-
token,
|
|
130
|
-
opacityPercent
|
|
131
|
-
};
|
|
132
|
-
}
|
|
133
|
-
/**
|
|
134
|
-
* Known palette role token names. This is the low-level source of truth for
|
|
135
|
-
* palette roles used by palette variants, Theme V2 schemas, and runtime color
|
|
136
|
-
* reference parsing.
|
|
137
|
-
*/
|
|
138
|
-
const PALETTE_TOKEN_NAMES = [
|
|
139
|
-
"primary",
|
|
140
|
-
"primaryForeground",
|
|
141
|
-
"secondary",
|
|
142
|
-
"accent",
|
|
143
|
-
"success",
|
|
144
|
-
"warning",
|
|
145
|
-
"destructive",
|
|
146
|
-
"background",
|
|
147
|
-
"surface",
|
|
148
|
-
"surfaceAlt",
|
|
149
|
-
"muted",
|
|
150
|
-
"text",
|
|
151
|
-
"border"
|
|
152
|
-
];
|
|
153
|
-
const paletteTokenNameSchema = z.enum(PALETTE_TOKEN_NAMES);
|
|
154
|
-
const themeColorBaseTokenNames = [
|
|
155
|
-
...PALETTE_TOKEN_NAMES,
|
|
156
|
-
...blockColorTokenNames,
|
|
157
|
-
"white",
|
|
158
|
-
"neutral",
|
|
159
|
-
"primaryText",
|
|
160
|
-
"secondaryForeground",
|
|
161
|
-
"accentForeground"
|
|
162
|
-
];
|
|
163
|
-
const themeColorBaseTokenSet = new Set(themeColorBaseTokenNames);
|
|
164
|
-
const shadeStepSet = /* @__PURE__ */ new Set([
|
|
165
|
-
"50",
|
|
166
|
-
"100",
|
|
167
|
-
"200",
|
|
168
|
-
"300",
|
|
169
|
-
"400",
|
|
170
|
-
"500",
|
|
171
|
-
"600",
|
|
172
|
-
"700",
|
|
173
|
-
"800",
|
|
174
|
-
"900",
|
|
175
|
-
"950"
|
|
176
|
-
]);
|
|
177
|
-
function isKnownBaseToken(value) {
|
|
178
|
-
return themeColorBaseTokenSet.has(value);
|
|
179
|
-
}
|
|
180
|
-
function isKnownShadeToken(value) {
|
|
181
|
-
const match = value.match(/^([a-zA-Z][a-zA-Z0-9]*)(?:-([0-9]{2,3}))$/);
|
|
182
|
-
if (!match) return false;
|
|
183
|
-
const [, base, shade] = match;
|
|
184
|
-
return Boolean(base && shade && isKnownBaseToken(base) && shadeStepSet.has(shade));
|
|
185
|
-
}
|
|
186
|
-
function isThemeColorTokenBase(value) {
|
|
187
|
-
return isKnownBaseToken(value) || isKnownShadeToken(value);
|
|
188
|
-
}
|
|
189
|
-
function isThemeColorToken(value) {
|
|
190
|
-
if (typeof value !== "string") return false;
|
|
191
|
-
const parts = parseColorTokenParts(value);
|
|
192
|
-
return parts.kind === "token" && isThemeColorTokenBase(parts.token);
|
|
193
|
-
}
|
|
194
|
-
function parseThemeColorToken(value) {
|
|
195
|
-
if (!isThemeColorToken(value)) return null;
|
|
196
|
-
return value.trim();
|
|
197
|
-
}
|
|
198
|
-
const themeColorTokenSchema = z.string().min(1).refine((value) => Boolean(isThemeColorToken(value)), "Expected a known Theme V2 color token");
|
|
199
|
-
const HEX_COLOR_REGEX = /^#[0-9a-f]{6}$/;
|
|
200
|
-
const NORMALIZABLE_HEX_REGEX = /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;
|
|
201
|
-
const THEME_PALETTE_COLOR_ORDER = [
|
|
202
|
-
"primary",
|
|
203
|
-
"secondary",
|
|
204
|
-
"accent",
|
|
205
|
-
"success",
|
|
206
|
-
"warning",
|
|
207
|
-
"destructive",
|
|
208
|
-
"background",
|
|
209
|
-
"surface",
|
|
210
|
-
"surfaceAlt",
|
|
211
|
-
"muted",
|
|
212
|
-
"text",
|
|
213
|
-
"primaryForeground",
|
|
214
|
-
"border"
|
|
215
|
-
];
|
|
216
|
-
const hexColorSchema = z.string().regex(HEX_COLOR_REGEX, "Hex must be #RRGGBB (lowercase)").transform((value) => value);
|
|
217
|
-
const paletteModeSchema = z.enum(["light", "dark"]);
|
|
218
|
-
const paletteColorsSchema = z.object({
|
|
219
|
-
primary: hexColorSchema,
|
|
220
|
-
primaryForeground: hexColorSchema,
|
|
221
|
-
secondary: hexColorSchema,
|
|
222
|
-
accent: hexColorSchema,
|
|
223
|
-
success: hexColorSchema,
|
|
224
|
-
warning: hexColorSchema,
|
|
225
|
-
destructive: hexColorSchema,
|
|
226
|
-
background: hexColorSchema,
|
|
227
|
-
surface: hexColorSchema,
|
|
228
|
-
surfaceAlt: hexColorSchema,
|
|
229
|
-
muted: hexColorSchema,
|
|
230
|
-
text: hexColorSchema,
|
|
231
|
-
border: hexColorSchema
|
|
232
|
-
}).strict().transform((value) => value);
|
|
233
|
-
function normalizePaletteHex(value) {
|
|
234
|
-
if (!NORMALIZABLE_HEX_REGEX.test(value)) return null;
|
|
235
|
-
const normalized = value.toLowerCase();
|
|
236
|
-
if (normalized.length === 7) return normalized;
|
|
237
|
-
const triplet = normalized.slice(1);
|
|
238
|
-
const red = triplet.charAt(0);
|
|
239
|
-
const green = triplet.charAt(1);
|
|
240
|
-
const blue = triplet.charAt(2);
|
|
241
|
-
return `#${red}${red}${green}${green}${blue}${blue}`;
|
|
242
|
-
}
|
|
243
|
-
function admitPaletteEntry(values, entry) {
|
|
244
|
-
const parsedRole = paletteTokenNameSchema.safeParse(entry.name);
|
|
245
|
-
if (!parsedRole.success) return {
|
|
246
|
-
ok: false,
|
|
247
|
-
error: {
|
|
248
|
-
kind: "unknown-role",
|
|
249
|
-
role: entry.name
|
|
250
|
-
}
|
|
251
|
-
};
|
|
252
|
-
const role = parsedRole.data;
|
|
253
|
-
if (values[role] !== void 0) return {
|
|
254
|
-
ok: false,
|
|
255
|
-
error: {
|
|
256
|
-
kind: "duplicate-role",
|
|
257
|
-
role
|
|
258
|
-
}
|
|
259
|
-
};
|
|
260
|
-
const hex = normalizePaletteHex(entry.hex);
|
|
261
|
-
if (hex === null) return {
|
|
262
|
-
ok: false,
|
|
263
|
-
error: {
|
|
264
|
-
kind: "invalid-color",
|
|
265
|
-
role,
|
|
266
|
-
value: entry.hex
|
|
267
|
-
}
|
|
268
|
-
};
|
|
269
|
-
return {
|
|
270
|
-
ok: true,
|
|
271
|
-
values: {
|
|
272
|
-
...values,
|
|
273
|
-
[role]: hex
|
|
274
|
-
}
|
|
275
|
-
};
|
|
276
|
-
}
|
|
277
|
-
function paletteColorsFromEntries(entries) {
|
|
278
|
-
const admitted = entries.reduce((result, entry) => result.ok ? admitPaletteEntry(result.values, entry) : result, {
|
|
279
|
-
ok: true,
|
|
280
|
-
values: {}
|
|
281
|
-
});
|
|
282
|
-
if (!admitted.ok) return admitted;
|
|
283
|
-
const missing = PALETTE_TOKEN_NAMES.filter((role) => admitted.values[role] === void 0);
|
|
284
|
-
return missing.length > 0 ? {
|
|
285
|
-
ok: false,
|
|
286
|
-
error: {
|
|
287
|
-
kind: "missing-roles",
|
|
288
|
-
roles: missing
|
|
289
|
-
}
|
|
290
|
-
} : {
|
|
291
|
-
ok: true,
|
|
292
|
-
colors: paletteColorsSchema.parse(admitted.values)
|
|
293
|
-
};
|
|
294
|
-
}
|
|
295
|
-
function paletteColorEntries(colors) {
|
|
296
|
-
return THEME_PALETTE_COLOR_ORDER.map((name) => ({
|
|
297
|
-
name,
|
|
298
|
-
hex: colors[name]
|
|
299
|
-
}));
|
|
300
|
-
}
|
|
301
|
-
//#endregion
|
|
302
|
-
//#region ../site-contracts/src/theme/buttonTypography.ts
|
|
303
|
-
const textTransformSchema = z.enum([
|
|
304
|
-
"none",
|
|
305
|
-
"uppercase",
|
|
306
|
-
"lowercase",
|
|
307
|
-
"capitalize"
|
|
308
|
-
]);
|
|
309
|
-
const fontWeightSchema = z.union([
|
|
310
|
-
z.literal(400),
|
|
311
|
-
z.literal(500),
|
|
312
|
-
z.literal(600),
|
|
313
|
-
z.literal(700),
|
|
314
|
-
z.literal(800)
|
|
315
|
-
]);
|
|
316
|
-
const buttonTypographySchema = z.enum(["body", "heading"]);
|
|
317
|
-
const letterSpacingSchema = z.enum([
|
|
318
|
-
"tight",
|
|
319
|
-
"normal",
|
|
320
|
-
"slight",
|
|
321
|
-
"loose",
|
|
322
|
-
"wide"
|
|
323
|
-
]);
|
|
324
|
-
//#endregion
|
|
325
|
-
//#region ../site-contracts/src/theme/buttons.ts
|
|
326
|
-
/**
|
|
327
|
-
* Canonical persisted/CSS-safe button variant identifier.
|
|
328
|
-
*
|
|
329
|
-
* IDs become class selectors, so keep the contract deliberately narrower than
|
|
330
|
-
* an arbitrary string and shared with every authoring/runtime boundary.
|
|
331
|
-
*/
|
|
332
|
-
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" });
|
|
333
|
-
function parseOpaqueButtonColourToken(value) {
|
|
334
|
-
const token = parseThemeColorToken(value);
|
|
335
|
-
if (token === null) return null;
|
|
336
|
-
const parts = parseColorTokenParts(token);
|
|
337
|
-
return parts.kind === "token" && parts.opacityPercent === null ? token : null;
|
|
338
|
-
}
|
|
339
|
-
const opaqueButtonColourTokenSchema = themeColorTokenSchema.refine((value) => parseOpaqueButtonColourToken(value) !== null, "Button colour tokens must be opaque").transform((value) => {
|
|
340
|
-
const token = parseOpaqueButtonColourToken(value);
|
|
341
|
-
if (token === null) throw new Error("Invariant: opaque button token passed its schema");
|
|
342
|
-
return token;
|
|
343
|
-
});
|
|
344
|
-
const contextualButtonHoverSchema = z.strictObject({
|
|
345
|
-
kind: z.literal("shade-shift"),
|
|
346
|
-
seedToken: opaqueButtonColourTokenSchema,
|
|
347
|
-
fallbackDirection: z.enum(["lighter", "darker"]),
|
|
348
|
-
preferredToken: opaqueButtonColourTokenSchema.optional()
|
|
349
|
-
});
|
|
350
|
-
const buttonShadeAmountSchema = z.number().finite().min(0).max(900).multipleOf(100);
|
|
351
|
-
const buttonShadowIntensitySchema = z.enum([
|
|
352
|
-
"subtle",
|
|
353
|
-
"medium",
|
|
354
|
-
"strong"
|
|
355
|
-
]);
|
|
356
|
-
/**
|
|
357
|
-
* The complete persisted button-effect contract.
|
|
358
|
-
*
|
|
359
|
-
* Navigation has its own generic interactive-effect model. Button variants use
|
|
360
|
-
* this closed union so unsupported effect IDs, unknown option keys, and unsafe
|
|
361
|
-
* CSS values cannot become representable after the schema boundary.
|
|
362
|
-
*/
|
|
363
|
-
const buttonPressOffsetSchema = z.strictObject({
|
|
364
|
-
x: z.number().int().min(0).max(12),
|
|
365
|
-
y: z.number().int().min(0).max(12)
|
|
366
|
-
});
|
|
367
|
-
const buttonEffectApplicationSchema = z.discriminatedUnion("effectId", [
|
|
368
|
-
z.strictObject({
|
|
369
|
-
effectId: z.literal("darken-background"),
|
|
370
|
-
options: z.strictObject({ amount: buttonShadeAmountSchema.optional() }).optional()
|
|
371
|
-
}),
|
|
372
|
-
z.strictObject({
|
|
373
|
-
effectId: z.literal("lighten-background"),
|
|
374
|
-
options: z.strictObject({ amount: buttonShadeAmountSchema.optional() }).optional()
|
|
375
|
-
}),
|
|
376
|
-
z.strictObject({
|
|
377
|
-
effectId: z.literal("background-on-hover"),
|
|
378
|
-
options: z.strictObject({ colorToken: opaqueButtonColourTokenSchema.optional() }).optional()
|
|
379
|
-
}),
|
|
380
|
-
z.strictObject({
|
|
381
|
-
effectId: z.literal("animated-gradient"),
|
|
382
|
-
options: z.strictObject({ direction: z.enum(["horizontal", "vertical"]).optional() }).optional()
|
|
383
|
-
}),
|
|
384
|
-
z.strictObject({
|
|
385
|
-
effectId: z.literal("drop-shadow"),
|
|
386
|
-
options: z.strictObject({ intensity: buttonShadowIntensitySchema.optional() }).optional()
|
|
387
|
-
}),
|
|
388
|
-
z.strictObject({
|
|
389
|
-
effectId: z.literal("inner-shadow"),
|
|
390
|
-
options: z.strictObject({}).optional()
|
|
391
|
-
}),
|
|
392
|
-
z.strictObject({
|
|
393
|
-
effectId: z.literal("neumorphic-shadow"),
|
|
394
|
-
options: z.strictObject({
|
|
395
|
-
mode: z.enum(["raised", "pressed"]).optional(),
|
|
396
|
-
intensity: buttonShadowIntensitySchema.optional()
|
|
397
|
-
}).optional()
|
|
398
|
-
}),
|
|
399
|
-
z.strictObject({
|
|
400
|
-
effectId: z.literal("retro-3d-shadow"),
|
|
401
|
-
options: z.strictObject({}).optional()
|
|
402
|
-
}),
|
|
403
|
-
z.strictObject({
|
|
404
|
-
effectId: z.literal("scale-up"),
|
|
405
|
-
options: z.strictObject({ scale: z.enum([
|
|
406
|
-
"1.02",
|
|
407
|
-
"1.03",
|
|
408
|
-
"1.05",
|
|
409
|
-
"1.10"
|
|
410
|
-
]).optional() }).optional()
|
|
411
|
-
}),
|
|
412
|
-
z.strictObject({
|
|
413
|
-
effectId: z.literal("scale-down"),
|
|
414
|
-
options: z.strictObject({ scale: z.enum([
|
|
415
|
-
"0.90",
|
|
416
|
-
"0.95",
|
|
417
|
-
"0.97",
|
|
418
|
-
"0.98"
|
|
419
|
-
]).optional() }).optional()
|
|
420
|
-
}),
|
|
421
|
-
z.strictObject({
|
|
422
|
-
effectId: z.literal("lift"),
|
|
423
|
-
options: z.strictObject({ amount: z.enum([
|
|
424
|
-
"0.125",
|
|
425
|
-
"0.25",
|
|
426
|
-
"0.5",
|
|
427
|
-
"1"
|
|
428
|
-
]).optional() }).optional()
|
|
429
|
-
}),
|
|
430
|
-
z.strictObject({
|
|
431
|
-
effectId: z.literal("press-down"),
|
|
432
|
-
options: z.strictObject({ offset: buttonPressOffsetSchema.optional() }).optional()
|
|
433
|
-
}),
|
|
434
|
-
z.strictObject({
|
|
435
|
-
effectId: z.literal("pop"),
|
|
436
|
-
options: z.strictObject({ intensity: z.enum([
|
|
437
|
-
"subtle",
|
|
438
|
-
"gentle",
|
|
439
|
-
"medium",
|
|
440
|
-
"dramatic"
|
|
441
|
-
]).optional() }).optional()
|
|
442
|
-
}),
|
|
443
|
-
z.strictObject({
|
|
444
|
-
effectId: z.literal("border-bottom-grow"),
|
|
445
|
-
options: z.strictObject({
|
|
446
|
-
height: z.union([z.literal(1), z.literal(2)]).optional(),
|
|
447
|
-
origin: z.enum([
|
|
448
|
-
"left",
|
|
449
|
-
"center",
|
|
450
|
-
"right"
|
|
451
|
-
]).optional(),
|
|
452
|
-
persistent: z.boolean().optional(),
|
|
453
|
-
colourRole: z.literal("mark").optional()
|
|
454
|
-
}).optional()
|
|
455
|
-
}),
|
|
456
|
-
z.strictObject({
|
|
457
|
-
effectId: z.literal("inner-dashed-outline"),
|
|
458
|
-
options: z.strictObject({
|
|
459
|
-
colourRole: z.enum(["ink", "mark"]),
|
|
460
|
-
width: z.number().finite().min(.5).max(4),
|
|
461
|
-
inset: z.number().finite().min(0).max(16)
|
|
462
|
-
})
|
|
463
|
-
}),
|
|
464
|
-
z.strictObject({
|
|
465
|
-
effectId: z.literal("sketchy-border"),
|
|
466
|
-
options: z.strictObject({ intensity: buttonShadowIntensitySchema.optional() }).optional()
|
|
467
|
-
})
|
|
468
|
-
]);
|
|
469
|
-
const cornerStyleSchema = z.enum([
|
|
470
|
-
"square",
|
|
471
|
-
"rounded",
|
|
472
|
-
"pill"
|
|
473
|
-
]);
|
|
474
|
-
const shadowSizeSchema = z.enum([
|
|
475
|
-
"none",
|
|
476
|
-
"low",
|
|
477
|
-
"medium",
|
|
478
|
-
"high"
|
|
479
|
-
]);
|
|
480
|
-
const hoverTransformSchema = z.enum([
|
|
481
|
-
"none",
|
|
482
|
-
"lift",
|
|
483
|
-
"scale",
|
|
484
|
-
"press"
|
|
485
|
-
]);
|
|
486
|
-
const buttonPaddingPresetSchema = z.enum([
|
|
487
|
-
"compact",
|
|
488
|
-
"default",
|
|
489
|
-
"spacious"
|
|
490
|
-
]);
|
|
491
|
-
const gradientStyleSchema = z.enum([
|
|
492
|
-
"linear",
|
|
493
|
-
"radial",
|
|
494
|
-
"conic"
|
|
495
|
-
]);
|
|
496
|
-
const gradientSharpnessSchema = z.enum([
|
|
497
|
-
"smooth",
|
|
498
|
-
"medium",
|
|
499
|
-
"hard"
|
|
500
|
-
]);
|
|
501
|
-
const prioritySchema = z.union([
|
|
502
|
-
z.literal(1),
|
|
503
|
-
z.literal(2),
|
|
504
|
-
z.literal(3)
|
|
505
|
-
]);
|
|
506
|
-
const buttonSurfaceFallbackSchema = z.discriminatedUnion("kind", [z.strictObject({ kind: z.literal("surface-outline") }), z.strictObject({
|
|
507
|
-
kind: z.literal("variant"),
|
|
508
|
-
role: variantRoleSchema
|
|
509
|
-
})]);
|
|
510
|
-
const buttonSurfacePolicyShape = Object.fromEntries(VARIANT_ROLES.map((role) => [role, z.array(buttonSurfaceFallbackSchema).max(VARIANT_ROLES.length)]));
|
|
511
|
-
const buttonSurfacePolicySchema = z.strictObject(buttonSurfacePolicyShape);
|
|
512
|
-
/**
|
|
513
|
-
* CSS padding string in `"<vertical> <horizontal>"` shorthand form.
|
|
514
|
-
*
|
|
515
|
-
* Exactly two space-separated CSS length tokens. Each token is either the
|
|
516
|
-
* literal `0` or a number followed by `rem`/`em`/`px`/`%`. This lets the
|
|
517
|
-
* generator trust the shape rather than defensively defaulting downstream.
|
|
518
|
-
*/
|
|
519
|
-
const PADDING_TOKEN_PATTERN = /^(?:0|\d+(?:\.\d+)?(?:rem|em|px|%))$/;
|
|
520
|
-
const paddingShorthandSchema = z.string().refine((value) => {
|
|
521
|
-
const parts = value.split(/\s+/).filter(Boolean);
|
|
522
|
-
return parts.length === 2 && parts.every((token) => PADDING_TOKEN_PATTERN.test(token));
|
|
523
|
-
}, { message: "Padding must be two space-separated CSS length tokens (e.g. \"0.5rem 1rem\"). Use `0` for zero." });
|
|
524
|
-
const buttonSizeConfigSchema = z.object({
|
|
525
|
-
padding: paddingShorthandSchema,
|
|
526
|
-
fontSize: z.string().optional(),
|
|
527
|
-
borderRadius: z.string().optional()
|
|
528
|
-
});
|
|
529
|
-
/**
|
|
530
|
-
* `xl` is optional on the wire so themes persisted before the `xl` size was
|
|
531
|
-
* added (e.g. SWTS) continue to parse. When `xl` is missing the schema
|
|
532
|
-
* backfills it from `lg`, keeping `ButtonSizes` a complete `sm/md/lg/xl` map
|
|
533
|
-
* downstream — generators never need to deal with an undefined `xl`.
|
|
534
|
-
*/
|
|
535
|
-
const buttonSizesSchema = z.object({
|
|
536
|
-
sm: buttonSizeConfigSchema,
|
|
537
|
-
md: buttonSizeConfigSchema,
|
|
538
|
-
lg: buttonSizeConfigSchema,
|
|
539
|
-
xl: buttonSizeConfigSchema.optional()
|
|
540
|
-
}).transform(({ sm, md, lg, xl }) => ({
|
|
541
|
-
sm,
|
|
542
|
-
md,
|
|
543
|
-
lg,
|
|
544
|
-
xl: xl ?? lg
|
|
545
|
-
}));
|
|
546
|
-
const buttonGlobalSettingsBaseSchema = z.strictObject({
|
|
547
|
-
cornerStyle: cornerStyleSchema,
|
|
548
|
-
cornerRadius: z.number().min(0).max(24).optional(),
|
|
549
|
-
/**
|
|
550
|
-
* Family-level shadow inherited by variants that don't set their own.
|
|
551
|
-
* Optional and flat-by-default: when omitted, buttons carry no drop shadow
|
|
552
|
-
* (`elevation: 'none'`). A personality opts the whole family into a shadow by
|
|
553
|
-
* setting this; individual variants still override. There is no system-level
|
|
554
|
-
* shadow-by-default — shadows only appear when explicitly declared.
|
|
555
|
-
*/
|
|
556
|
-
shadow: shadowSizeSchema.optional(),
|
|
557
|
-
textTransform: textTransformSchema,
|
|
558
|
-
fontWeight: fontWeightSchema,
|
|
559
|
-
typography: buttonTypographySchema.optional(),
|
|
560
|
-
fontSize: z.string().optional(),
|
|
561
|
-
letterSpacing: letterSpacingSchema.optional(),
|
|
562
|
-
italic: z.boolean().optional(),
|
|
563
|
-
paddingPreset: buttonPaddingPresetSchema.optional(),
|
|
564
|
-
hoverTransform: hoverTransformSchema,
|
|
565
|
-
gradientStyle: gradientStyleSchema.optional(),
|
|
566
|
-
gradientAngle: z.number().min(0).max(360).optional(),
|
|
567
|
-
gradientSharpness: gradientSharpnessSchema.optional()
|
|
568
|
-
});
|
|
569
|
-
const buttonGlobalSettingsSchema = z.discriminatedUnion("hoverColor", [buttonGlobalSettingsBaseSchema.extend({
|
|
570
|
-
hoverColor: z.literal("none"),
|
|
571
|
-
hoverColorToken: z.never().optional()
|
|
572
|
-
}), buttonGlobalSettingsBaseSchema.extend({
|
|
573
|
-
hoverColor: z.literal("token"),
|
|
574
|
-
hoverColorToken: opaqueButtonColourTokenSchema
|
|
575
|
-
})]);
|
|
576
|
-
const gradientDirectionSchema = z.enum([
|
|
577
|
-
"to-r",
|
|
578
|
-
"to-l",
|
|
579
|
-
"to-t",
|
|
580
|
-
"to-b",
|
|
581
|
-
"to-tr",
|
|
582
|
-
"to-tl",
|
|
583
|
-
"to-br",
|
|
584
|
-
"to-bl"
|
|
585
|
-
]);
|
|
586
|
-
const buttonColourTreatmentSchema = z.discriminatedUnion("type", [
|
|
587
|
-
z.strictObject({
|
|
588
|
-
type: z.literal("solid"),
|
|
589
|
-
colorToken: opaqueButtonColourTokenSchema,
|
|
590
|
-
foregroundToken: opaqueButtonColourTokenSchema.optional()
|
|
591
|
-
}),
|
|
592
|
-
z.strictObject({
|
|
593
|
-
type: z.literal("gradient"),
|
|
594
|
-
stops: z.array(opaqueButtonColourTokenSchema).min(2).transform((stops) => {
|
|
595
|
-
const [first, second, ...rest] = stops;
|
|
596
|
-
if (first === void 0 || second === void 0) throw new Error("Invariant: gradient stops passed the minimum length schema");
|
|
597
|
-
return [
|
|
598
|
-
first,
|
|
599
|
-
second,
|
|
600
|
-
...rest
|
|
601
|
-
];
|
|
602
|
-
}),
|
|
603
|
-
direction: gradientDirectionSchema,
|
|
604
|
-
foregroundToken: opaqueButtonColourTokenSchema
|
|
605
|
-
}),
|
|
606
|
-
z.strictObject({
|
|
607
|
-
type: z.literal("surface"),
|
|
608
|
-
role: z.literal("link")
|
|
609
|
-
})
|
|
610
|
-
]);
|
|
611
|
-
const buttonBackgroundSchema = buttonColourTreatmentSchema;
|
|
612
|
-
const buttonBorderSchema = z.strictObject({
|
|
613
|
-
widthClass: z.string(),
|
|
614
|
-
marksBoundary: z.literal(true).optional(),
|
|
615
|
-
ring: z.literal(true).optional(),
|
|
616
|
-
boundaryInk: opaqueButtonColourTokenSchema.optional()
|
|
617
|
-
});
|
|
618
|
-
const buttonVariantAffordanceSchema = z.strictObject({ iconId: z.string().min(1) });
|
|
619
|
-
const variantShadowSchema = z.strictObject({
|
|
620
|
-
elevation: z.enum([
|
|
621
|
-
"none",
|
|
622
|
-
"low",
|
|
623
|
-
"medium",
|
|
624
|
-
"high"
|
|
625
|
-
]),
|
|
626
|
-
softness: z.enum([
|
|
627
|
-
"crisp",
|
|
628
|
-
"soft",
|
|
629
|
-
"hard"
|
|
630
|
-
]).nullable(),
|
|
631
|
-
position: z.enum(["bottom", "bottom-right"]).default("bottom"),
|
|
632
|
-
colorToken: opaqueButtonColourTokenSchema.optional()
|
|
633
|
-
});
|
|
634
|
-
/** Recipe states own every visual property; treatment owns its readable label. */
|
|
635
|
-
const buttonVisualAppearanceSchema = z.strictObject({
|
|
636
|
-
background: buttonColourTreatmentSchema,
|
|
637
|
-
text: z.literal("treatment"),
|
|
638
|
-
border: z.union([z.literal("none"), buttonBorderSchema]),
|
|
639
|
-
borderRadius: z.string(),
|
|
640
|
-
shadow: z.union([z.literal("focus-indicator"), variantShadowSchema]),
|
|
641
|
-
sizes: buttonSizesSchema,
|
|
642
|
-
typography: z.strictObject({
|
|
643
|
-
fontWeight: fontWeightSchema,
|
|
644
|
-
typography: buttonTypographySchema,
|
|
645
|
-
fontSize: z.string().nullable(),
|
|
646
|
-
letterSpacing: z.union([letterSpacingSchema, z.literal("heading")]).nullable(),
|
|
647
|
-
italic: z.boolean(),
|
|
648
|
-
textTransform: textTransformSchema
|
|
649
|
-
}),
|
|
650
|
-
effects: z.array(buttonEffectApplicationSchema),
|
|
651
|
-
transform: z.literal("none").optional(),
|
|
652
|
-
contextualHover: contextualButtonHoverSchema.optional()
|
|
653
|
-
});
|
|
654
|
-
const buttonVisualStatesSchema = z.strictObject({
|
|
655
|
-
base: buttonVisualAppearanceSchema.extend({ shadow: variantShadowSchema }),
|
|
656
|
-
hover: buttonVisualAppearanceSchema.extend({ shadow: variantShadowSchema }),
|
|
657
|
-
focus: buttonVisualAppearanceSchema.extend({
|
|
658
|
-
shadow: z.literal("focus-indicator"),
|
|
659
|
-
indicator: z.strictObject({
|
|
660
|
-
kind: z.literal("surface-ink"),
|
|
661
|
-
width: z.union([z.literal(2), z.literal(3)]),
|
|
662
|
-
offset: z.union([z.literal(3), z.literal(4)])
|
|
663
|
-
}).optional()
|
|
664
|
-
}),
|
|
665
|
-
active: buttonVisualAppearanceSchema.extend({ shadow: variantShadowSchema }),
|
|
666
|
-
disabled: buttonVisualAppearanceSchema.extend({ shadow: variantShadowSchema })
|
|
667
|
-
});
|
|
668
|
-
const variantEffectsSchema = z.strictObject({
|
|
669
|
-
base: z.array(buttonEffectApplicationSchema).optional(),
|
|
670
|
-
hover: z.array(buttonEffectApplicationSchema).optional(),
|
|
671
|
-
active: z.array(buttonEffectApplicationSchema).optional(),
|
|
672
|
-
focus: z.array(buttonEffectApplicationSchema).optional()
|
|
673
|
-
});
|
|
674
|
-
/**
|
|
675
|
-
* Per-variant size overrides schema — every entry is optional.
|
|
676
|
-
*
|
|
677
|
-
* For each size key present, the values override the theme's `sizes` config
|
|
678
|
-
* for that size on this variant. Missing sizes fall through to theme.sizes,
|
|
679
|
-
* then system defaults.
|
|
680
|
-
*/
|
|
681
|
-
const variantSizeOverridesSchema = z.object({
|
|
682
|
-
sm: buttonSizeConfigSchema.optional(),
|
|
683
|
-
md: buttonSizeConfigSchema.optional(),
|
|
684
|
-
lg: buttonSizeConfigSchema.optional(),
|
|
685
|
-
xl: buttonSizeConfigSchema.optional()
|
|
686
|
-
});
|
|
687
|
-
/**
|
|
688
|
-
* Unified variant schema. Every variant participates in the size system; the
|
|
689
|
-
* optional `sizes` field lets a variant scale differently than the theme
|
|
690
|
-
* default (e.g. link-style variants declaring zero horizontal padding at
|
|
691
|
-
* every size).
|
|
692
|
-
*/
|
|
693
|
-
const buttonVariantSchema = z.strictObject({
|
|
694
|
-
id: buttonVariantIdSchema,
|
|
695
|
-
name: z.string().min(1).max(20),
|
|
696
|
-
enabled: z.boolean(),
|
|
697
|
-
priority: prioritySchema,
|
|
698
|
-
visualStates: buttonVisualStatesSchema.optional(),
|
|
699
|
-
background: buttonBackgroundSchema,
|
|
700
|
-
/** Tailwind radius token (e.g. `'rounded-md'`). Omit to inherit from `global.cornerStyle`. */
|
|
701
|
-
borderRadius: z.string().optional(),
|
|
702
|
-
shadow: variantShadowSchema.optional(),
|
|
703
|
-
border: buttonBorderSchema.optional(),
|
|
704
|
-
hoverBackgroundToken: opaqueButtonColourTokenSchema.optional(),
|
|
705
|
-
contextualHover: contextualButtonHoverSchema.optional(),
|
|
706
|
-
effects: variantEffectsSchema.optional(),
|
|
707
|
-
sizes: variantSizeOverridesSchema.optional(),
|
|
708
|
-
affordance: buttonVariantAffordanceSchema.optional()
|
|
709
|
-
});
|
|
710
|
-
const buttonSystemSchema = z.strictObject({
|
|
711
|
-
global: buttonGlobalSettingsSchema,
|
|
712
|
-
variants: z.array(buttonVariantSchema).min(1).max(6),
|
|
713
|
-
sizes: buttonSizesSchema.optional(),
|
|
714
|
-
surfacePolicy: buttonSurfacePolicySchema.optional(),
|
|
715
|
-
surfaceContexts: z.record(z.string(), z.strictObject({
|
|
716
|
-
primary: opaqueButtonColourTokenSchema,
|
|
717
|
-
primaryText: opaqueButtonColourTokenSchema.optional()
|
|
718
|
-
})).optional()
|
|
719
|
-
}).superRefine((system, ctx) => {
|
|
720
|
-
const seen = /* @__PURE__ */ new Set();
|
|
721
|
-
system.variants.forEach((variant, index) => {
|
|
722
|
-
if (seen.has(variant.id)) ctx.addIssue({
|
|
723
|
-
code: "custom",
|
|
724
|
-
path: [
|
|
725
|
-
"variants",
|
|
726
|
-
index,
|
|
727
|
-
"id"
|
|
728
|
-
],
|
|
729
|
-
message: `Duplicate button variant ID: ${variant.id}`
|
|
730
|
-
});
|
|
731
|
-
seen.add(variant.id);
|
|
732
|
-
});
|
|
733
|
-
});
|
|
734
|
-
//#endregion
|
|
735
|
-
//#region ../theme-core/src/buttons/types.ts
|
|
736
|
-
function isVariantRole(value) {
|
|
737
|
-
return VARIANT_ROLES.includes(value);
|
|
738
|
-
}
|
|
739
|
-
function asSpecialVariantId(value) {
|
|
740
|
-
const parsed = buttonVariantIdSchema.safeParse(value);
|
|
741
|
-
if (!parsed.success) throw new Error("SpecialVariantId must be a CSS-safe button variant ID");
|
|
742
|
-
return parsed.data;
|
|
743
|
-
}
|
|
744
|
-
/**
|
|
745
|
-
* Magic alias the CSS generator emits for the highest-priority variant.
|
|
746
|
-
*
|
|
747
|
-
* Shared between generator and renderer so neither side hard-codes the string.
|
|
748
|
-
*/
|
|
749
|
-
const DEFAULT_VARIANT_ALIAS_ID = "default";
|
|
750
|
-
function unsafeAsOpaqueButtonColourToken(value) {
|
|
751
|
-
return value;
|
|
752
|
-
}
|
|
753
|
-
z.enum(["none", "token"]);
|
|
754
|
-
const standardButtonSurfacePolicy = {
|
|
755
|
-
primary: [{ kind: "surface-outline" }],
|
|
756
|
-
secondary: [{ kind: "surface-outline" }, {
|
|
757
|
-
kind: "variant",
|
|
758
|
-
role: "primary"
|
|
759
|
-
}],
|
|
760
|
-
outline: [{ kind: "surface-outline" }],
|
|
761
|
-
ghost: [{ kind: "surface-outline" }],
|
|
762
|
-
accent: [{ kind: "surface-outline" }, {
|
|
763
|
-
kind: "variant",
|
|
764
|
-
role: "primary"
|
|
765
|
-
}]
|
|
766
|
-
};
|
|
767
|
-
const STANDARD_BUTTON_SURFACE_POLICY = Object.freeze(Object.fromEntries(VARIANT_ROLES.map((role) => [role, Object.freeze([...standardButtonSurfacePolicy[role]])])));
|
|
768
|
-
function createStandardButtonSurfacePolicy() {
|
|
769
|
-
return Object.fromEntries(VARIANT_ROLES.map((role) => [role, [...STANDARD_BUTTON_SURFACE_POLICY[role]]]));
|
|
770
|
-
}
|
|
771
|
-
const buttonSizeNameSchema = z.enum([
|
|
772
|
-
"sm",
|
|
773
|
-
"md",
|
|
774
|
-
"lg",
|
|
775
|
-
"xl"
|
|
776
|
-
]);
|
|
777
|
-
//#endregion
|
|
778
|
-
export { paletteModeSchema as C, SYSTEM_BLOCK_KINDS as D, themeColorTokenSchema as E, VARIANT_ROLES as O, paletteColorsSchema as S, parseThemeColorToken as T, hexColorSchema as _, createStandardButtonSurfacePolicy as a, paletteColorEntries as b, buttonEffectApplicationSchema as c, buttonVariantIdSchema as d, buttonVisualStatesSchema as f, blockColorTokenNames as g, PALETTE_TOKEN_NAMES as h, buttonSizeNameSchema as i, buttonPressOffsetSchema as l, parseOpaqueButtonColourToken as m, STANDARD_BUTTON_SURFACE_POLICY as n, isVariantRole as o, opaqueButtonColourTokenSchema as p, asSpecialVariantId as r, unsafeAsOpaqueButtonColourToken as s, DEFAULT_VARIANT_ALIAS_ID as t, buttonSystemSchema as u, isThemeColorToken as v, parseColorTokenParts as w, paletteColorsFromEntries as x, normalizePaletteHex as y };
|