@riverbankcms/sdk 0.174.1 → 0.175.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-YRmc-Yxz.d.ts → BlocksIslandsHydrator-hb2IWD8K.d.ts} +1 -1
- package/dist/_dts/{Page-Du0zX1B-.d.ts → Page-BlY68ZF-.d.ts} +7 -7
- package/dist/_dts/{SdkPreviewMode-4L8v3FkY.d.ts → SdkPreviewMode-CA8hU7hW.d.ts} +2 -2
- package/dist/_dts/{client-B1J6Akyf.d.ts → client-B6tCvmG4.d.ts} +487 -11
- package/dist/_dts/{content-types-CGGYI0u_.d.ts → content-types-B9qryk4R.d.ts} +2 -2
- package/dist/_dts/{contracts-CHMlw9hT.d.ts → contracts-DWoaRxj1.d.ts} +3 -3
- package/dist/_dts/{footerPageOutline-DIHSU1Vr.d.ts → footerPageOutline-Djdrhp5s.d.ts} +6 -6
- package/dist/_dts/{generatePageMetadata-JITXD6BU.d.ts → generatePageMetadata-CFi0vxov.d.ts} +2 -2
- package/dist/_dts/{index-yWDbUojb.d.ts → index-Bl5_pjmq.d.ts} +1 -1
- package/dist/_dts/{index-CF62FntA.d.ts → index-Btp5nIoz.d.ts} +2 -2
- package/dist/_dts/{index-BLEKFHt1.d.ts → index-CQUzwOxO.d.ts} +1 -1
- package/dist/_dts/{index-D9ZYmGAJ.d.ts → index-DmhFb6R1.d.ts} +1 -1
- package/dist/_dts/{index-CXZSy_9M.d.ts → index-OtazQE3U.d.ts} +2 -2
- package/dist/_dts/{index-BgOr1Xyz.d.ts → index-YRQulWB4.d.ts} +3 -3
- package/dist/_dts/{index-DpJm0NpL.d.ts → index-_pXaCO12.d.ts} +4 -4
- package/dist/_dts/{loadContent-M-s0p0rq.d.ts → loadContent-Hcuvs4pz.d.ts} +7 -7
- package/dist/_dts/{request-BK-pHf0P.d.ts → request-BT8i_vH-.d.ts} +1621 -385
- package/dist/_dts/{resolveBlockData-DZAlnhwt.d.ts → resolveBlockData-B-dJrunl.d.ts} +5 -5
- package/dist/_dts/{resolvePageContent-DXUCWJ3y.d.ts → resolvePageContent-CVLYWcoI.d.ts} +2 -2
- package/dist/_dts/sdk/src/bookings/index.d.ts +2 -2
- package/dist/_dts/sdk/src/client/types.d.ts +2 -2
- package/dist/_dts/sdk/src/client.d.ts +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 +13 -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 +3 -2
- 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 +5 -5
- 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 +2 -1
- package/dist/_dts/{types-DjVNADXR.d.ts → types-C0XZnjXz.d.ts} +3 -3
- package/dist/_dts/{types-CwmB2NHU.d.ts → types-CXL1QJSY.d.ts} +7 -7
- package/dist/_dts/{types-Dmow_FI6.d.ts → types-OKzbqRBx.d.ts} +2 -2
- package/dist/_dts/{validation-h8t1HLlL.d.ts → validation-Bxi66FtQ.d.ts} +4 -4
- package/dist/client/{BlocksIslandsHydrator-DRVx_XLi.mjs → BlocksIslandsHydrator-2xzlERTG.mjs} +17 -16
- package/dist/client/{BookingMailingListNote-CwrMzj-k.mjs → BookingMailingListNote-qsohSEdQ.mjs} +6 -6
- package/dist/client/{BookingPanelArrangement-C2_hFT6K.mjs → BookingPanelArrangement-DrdtON0q.mjs} +1 -1
- package/dist/client/{BookingQuestionFields-DZMrGvBh.mjs → BookingQuestionFields-CUFxBaTM.mjs} +3 -3
- package/dist/client/{CalendarNavigationChevron-Az1-TIEI.mjs → CalendarNavigationChevron-Ch0w0Utn.mjs} +34 -9
- package/dist/client/DemoBookingPortalAccess-DGgsjqXK.mjs +545 -0
- package/dist/client/{EventCalendar.client-CDkkP-Lv.mjs → EventCalendar.client-Dg4PHFJJ.mjs} +15 -25
- package/dist/client/{EventCombined.client-DK3aaz62.mjs → EventCombined.client-tky8JcnQ.mjs} +25 -17
- package/dist/client/{EventItem-WeUipfIP.mjs → EventItem-BybMSKNL.mjs} +4 -3
- package/dist/client/{EventListWeekNavigation-D3sbAeDo.mjs → EventListWeekNavigation-uvWRE5wi.mjs} +1 -1
- package/dist/client/{EventListing.client-DL3gGGmF.mjs → EventListing.client-DQx9dohz.mjs} +3 -3
- package/dist/client/{EventListing.view-DKFImKOx.mjs → EventListing.view-r31k8Icz.mjs} +8 -7
- package/dist/client/{EventRegistrationPayment-Dn9TpWyL.mjs → EventRegistrationPayment-BMmPDmSf.mjs} +635 -359
- package/dist/client/{LocationMapActions-BJT7MqP2.mjs → LocationMapActions-BecH-qhI.mjs} +1 -1
- package/dist/client/{MapDrawingSvg-DCIwlON6.mjs → MapDrawingSvg-BJzmFdcn.mjs} +18 -3
- package/dist/client/{Page-BpeP9xdt.mjs → Page-CWN_8cLZ.mjs} +601 -579
- package/dist/client/{DemoBookingPortalAccess-1p-pJ1lg.mjs → SiteTermsAgreementField-Dr5lj4oY.mjs} +4 -301
- package/dist/client/{StepIndicator-CP6zrwkl.mjs → StepIndicator-C7RJBOW3.mjs} +37 -12
- package/dist/client/{accordion-nR7D4m1a.mjs → accordion-uUi_N6mZ.mjs} +1 -1
- package/dist/client/{booking-form.client-Ce-mQZ7W.mjs → booking-form.client-CKHgxvsh.mjs} +229 -42
- package/dist/client/{bookingForm-B-qT_AQB.mjs → bookingForm-Bi74dmiS.mjs} +4 -4
- package/dist/client/bookings.mjs +22 -15
- package/dist/client/{boxStyleClassNames-CrE3TDpW.mjs → boxStyleClassNames-C-gFwhnO.mjs} +2 -1
- package/dist/client/{carousel-CVUOatsY.mjs → carousel-C0_BqMA0.mjs} +1 -1
- package/dist/client/{cart-DE0K6E0R.mjs → cart-BOHuppVu.mjs} +3 -3
- package/dist/client/{cart.client-C23E6WQ5.mjs → cart.client-IfJE1zAp.mjs} +1 -1
- package/dist/client/{checkout-76cdHyPL.mjs → checkout-C3Aj-aNa.mjs} +3 -3
- package/dist/client/{checkout.client-DJOzqb26.mjs → checkout.client-Tg9lfeYf.mjs} +1 -1
- package/dist/client/{checkoutUrls-CvIP5DCO.mjs → checkoutUrls-OLqQdAXD.mjs} +1 -1
- package/dist/client/client.mjs +112 -21
- package/dist/client/{context-CNlesLfF.mjs → context-D8TpQXjX.mjs} +76 -58
- package/dist/client/{course-DHIrXqNT.mjs → course-DHmeQAvq.mjs} +2 -2
- package/dist/client/{creditProducts-KYMVIH3J.mjs → creditProducts-BQ1t1erI.mjs} +14 -61
- package/dist/client/{dateFormatting-B73Ll0s4.mjs → dateFormatting-ABCZWkpT.mjs} +1 -1
- package/dist/client/{demoPortalMagicLink-BVbLD4pi.mjs → demoPortalMagicLink-BdcuW_pa.mjs} +1 -1
- package/dist/client/display-DMqotaGU.mjs +11797 -0
- package/dist/client/{enhanceHeaderSection-5GD5o4Mt.mjs → enhanceHeaderSection-Ciuhsk0E.mjs} +3 -3
- package/dist/client/{event-details.client-D7Oz1q2L.mjs → event-details.client-CJapNbTv.mjs} +1 -1
- package/dist/client/{event-registration.client-zbuX36aA.mjs → event-registration.client-CAdcpnLc.mjs} +176 -75
- package/dist/client/{eventCalendar-uZrksODt.mjs → eventCalendar-BlsD5R8M.mjs} +4 -4
- package/dist/client/{eventCombined-DxhvNAx8.mjs → eventCombined-B9Ly3024.mjs} +4 -4
- package/dist/client/{eventDetails-DCIH4BYG.mjs → eventDetails-CbEGI4jO.mjs} +2 -2
- package/dist/client/{eventListing-B9KrnPvc.mjs → eventListing-ZSmvhWII.mjs} +4 -4
- package/dist/client/{eventRegistration-TjnURMKl.mjs → eventRegistration-D-yUcIyO.mjs} +4 -4
- package/dist/client/{form-CfqIAhfN.mjs → form-DG_YZSNn.mjs} +3 -3
- package/dist/client/{form.client-CL6fF0cW.mjs → form.client-BU6dM0-C.mjs} +4 -4
- package/dist/client/{form.parts-Bf-L66Gg.mjs → form.parts-Db0Iq7nx.mjs} +1 -1
- package/dist/client/{formatDate-Dp7POa9Y.mjs → formatDate-DFfWHpQB.mjs} +1 -1
- package/dist/client/gifting/client.mjs +5 -3
- package/dist/client/gifting-DMrsN4B4.mjs +28 -0
- package/dist/client/gifting.client-BVa2XYJB.mjs +404 -0
- package/dist/client/gifting.parts-C2u4Y-pf.mjs +86 -0
- package/dist/client/{headerSection-WVXtOcuW.mjs → headerSection-D91EzlOR.mjs} +2 -2
- package/dist/client/{display-Cf_j5stk.mjs → lookSurfaces-BDZLALxj.mjs} +2951 -14395
- package/dist/client/{newsletter-form.client-Bb7GAZpO.mjs → newsletter-form.client-BMGRiRpo.mjs} +7 -5
- package/dist/client/{newsletter-form.parts-BqOVRdIc.mjs → newsletter-form.parts-D5UfUaD3.mjs} +3 -3
- package/dist/client/{newsletterForm-DOVe-qY3.mjs → newsletterForm-B_67sNwa.mjs} +3 -3
- package/dist/client/{noop-D5mFWXtN.mjs → noop-DF8_EiFt.mjs} +93 -28
- package/dist/client/portal/client.mjs +313 -148
- package/dist/client/{product-detail.client-CNzeFnFf.mjs → product-detail.client-D-XNir0m.mjs} +1 -1
- package/dist/client/{product-list.client-LKpzC7pj.mjs → product-list.client-BLfYQ-qi.mjs} +1 -1
- package/dist/client/{productDetail-D2JNeEgx.mjs → productDetail-W0_0lDGe.mjs} +3 -3
- package/dist/client/{productList-DTgZXOEq.mjs → productList-ayAtPJdb.mjs} +3 -3
- package/dist/client/{propsDecoder-mpBQt2AT.mjs → propsDecoder-ChYKWjLA.mjs} +4 -3
- package/dist/client/{registry.server-DdTJyar2.mjs → registry.server-B1EEZkcr.mjs} +307 -240
- package/dist/client/rendering/client.mjs +25 -491
- package/dist/client/rendering/islands.mjs +1 -1
- package/dist/client/rendering.mjs +7 -6
- package/dist/client/{richText-coerce-C32cRQ03.mjs → richText-coerce-CDAfpMQU.mjs} +1 -1
- package/dist/client/{routeIslandApiConfig-8cfSgT0E.mjs → routeIslandApiConfig-CcGWvyht.mjs} +1 -1
- package/dist/client/{shop-5LBhftWx.mjs → shop-DbUUoHFJ.mjs} +3 -3
- package/dist/client/{shop-discount-apply.state-D0ifS6KX.mjs → shop-add-feedback-DvC2kP1K.mjs} +1 -78
- package/dist/client/{shop-commerce-DkValjZj.mjs → shop-commerce-aQqcDmyZ.mjs} +64 -32
- package/dist/client/{shop-commerce-store-BOmXFmk_.mjs → shop-commerce-store-Cd7USpuY.mjs} +1 -1
- package/dist/client/shop-discount-apply.state-DGvPBmVP.mjs +83 -0
- package/dist/client/{shop.client-BTtZqNmv.mjs → shop.client-BNZ9M8cG.mjs} +56 -19
- package/dist/client/{shop.interactive-DNRqG4aX.mjs → shop.interactive-CJAINJr3.mjs} +113 -35
- package/dist/client/{shopShared-Nky6kPYr.mjs → shopShared-DwVAuGsx.mjs} +2 -2
- package/dist/client/{timetableModel-DZArznD_.mjs → timetableModel-DBTIFWTb.mjs} +10 -10
- package/dist/client/{useAvailableSlots-CUVRD1nx.mjs → useAvailableSlots-BomyyKeo.mjs} +3 -3
- package/dist/client/{useDiscountCodeUi-d7viY_mu.mjs → useDiscountCodeUi-CCxHMWlU.mjs} +32 -17
- package/dist/client/{useEventPagination-Da2JqxGC.mjs → useEventPagination-Bjin_qaN.mjs} +7 -6
- package/dist/client/{view-BvuYmQJ5.mjs → view-BTk470k0.mjs} +3 -2
- package/dist/client/{view-D9ObkFtz.mjs → view-Cw4EmEPv.mjs} +99 -30
- package/dist/preview-next/client/{PageSectionToolbar-DwxHT-2k.mjs → PageSectionToolbar-bq7gbKvn.mjs} +4 -4
- package/dist/preview-next/client/{PreviewEditorSidebar-D4SBxGU6.mjs → PreviewEditorSidebar-DVsPNcos.mjs} +28 -25
- package/dist/preview-next/client/{PreviewEditorUI-D8mUct32.mjs → PreviewEditorUI-B-pq3aZc.mjs} +4 -4
- package/dist/preview-next/client/{PreviewShell-L2AEdNUQ.mjs → PreviewShell-ChyjB96e.mjs} +5 -5
- package/dist/preview-next/client/{SdkPreviewModeRuntime-bhVAU2D2.mjs → SdkPreviewModeRuntime-D_czeC0l.mjs} +84 -101
- package/dist/preview-next/client/{previewAssistantSlot-Jpj_HDra.mjs → previewAssistantSlot-B61mZd81.mjs} +4141 -2677
- package/dist/preview-next/client/{previewChromeRoot-CYTDvx4u.mjs → previewChromeRoot-dwOn9XtM.mjs} +1 -1
- package/dist/preview-next/client/runtime.mjs +3 -3
- package/dist/preview-next/client/{sdk-runtime-CZHX6J_4.mjs → sdk-runtime-DZDfOxoW.mjs} +2 -2
- package/dist/preview-next/client/{siteStyleAccess-DmGIG9Hk.mjs → siteStyleAccess-BZDIC-fA.mjs} +527 -236
- package/dist/preview-next/client/{useAutosaveStatus-DQCyswQ-.mjs → useAutosaveStatus-BbzLMf-l.mjs} +1 -1
- package/dist/preview-next/client/{useOpenBlockForSetup-LwE5yXvL.mjs → useOpenBlockForSetup-BEXcWQeI.mjs} +13 -4
- package/dist/preview-next/container-responsive.css +51 -3
- package/dist/preview-next/keepAlive.mjs +1 -1
- package/dist/preview-next/middleware.mjs +1 -1
- package/dist/preview-next/{route-contract-BOuNcOcN.mjs → route-contract-0gSlK9S0.mjs} +86 -12
- package/dist/server/{Block.shared-wfJfhs08.mjs → Block.shared-DeXXycg8.mjs} +4 -4
- package/dist/server/{ThemeScopeCore-BtrJNHTB.mjs → ThemeScopeCore-DFEM1a85.mjs} +16 -2
- package/dist/server/{bindings-P1CF2Gm6.mjs → bindings-7L3pC5Os.mjs} +13 -34
- package/dist/server/{client-CGtU5fHI.mjs → client-CgghATBm.mjs} +111 -20
- package/dist/server/config-validation.mjs +1 -1
- package/dist/server/config.mjs +2 -2
- package/dist/server/{customCss-BGB8gMVb.mjs → customCss-BZ8YSrQg.mjs} +1 -0
- package/dist/server/data/resolveBlockData.mjs +1 -1
- package/dist/server/index.mjs +2 -2
- package/dist/server/{loadContent-ChnkJSay.mjs → loadContent-D7M5Vcug.mjs} +5 -5
- package/dist/server/{loadPage-DesHhgxj.mjs → loadPage-CiTId05y.mjs} +2 -2
- package/dist/server/{lookMediaFrame-BBr0mkze.mjs → lookMediaFrame-CaH018pK.mjs} +24 -5
- package/dist/server/next.mjs +35 -9
- package/dist/server/{overrideResolution-DHEkHcZs.mjs → overrideResolution-CJ3MRI5Q.mjs} +1 -1
- package/dist/server/page-converter.mjs +1 -1
- package/dist/server/{pageRenderPlan-0jvm0RBk.mjs → pageRenderPlan-Cuos4Xcd.mjs} +97 -39
- package/dist/server/{pageRuntimeSupport-8-f1Zr9e.mjs → pageRuntimeSupport-CuVj3bkd.mjs} +4 -3
- package/dist/server/{pageShared-CuVFoV4z.mjs → pageShared-JxlV8_Bo.mjs} +1261 -1129
- package/dist/server/{parseThemeForPersistence-Cwqb5pZx.mjs → parseThemeForPersistence-DOsfofCy.mjs} +1 -1
- package/dist/server/{prebuild-Bms_Y7wQ.mjs → prebuild-BDhlJbAx.mjs} +1 -1
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/{prefetchBlockData-5oC5kyHe.mjs → prefetchBlockData-kERh_c0v.mjs} +2 -2
- package/dist/server/{registry-DmqxC8th.mjs → registry-cQ9N5W-n.mjs} +20432 -20165
- 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 +3 -3
- package/dist/server/rendering.mjs +7 -7
- package/dist/server/{resolveBlockData-EYogtwQc.mjs → resolveBlockData-CN4UmmTK.mjs} +1 -1
- package/dist/server/{schema-CUDHMirj.mjs → schema-BpsqaSSU.mjs} +2 -2
- package/dist/server/server.mjs +3 -3
- package/dist/server/theme-bridge.mjs +1 -1
- package/dist/server/theme.mjs +2 -2
- package/dist/server/{validation-Bt_8IL1g.mjs → validation-3puM5SM8.mjs} +3 -3
- package/dist/server/{version-DT_efohp.mjs → version-B8g-Wx57.mjs} +1 -1
- package/dist/styles/index.css +295 -37
- package/package.json +1 -1
- package/dist/client/useDiscountApply-BBnStWXU.mjs +0 -199
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { Dt as parseThemeColorToken, Et as parseColorTokenParts, G as hexToRgb, R as contrastRatio, a as formatButtonColourContractError, at as surfaceForegroundValue, c as DEFAULT_BUTTON_SIZES, ct as surfaceInkStyle, d as generateShadowValue$1, et as SURFACE_INK_CSS_VARS, f as DEFAULT_VARIANT_ALIAS_ID, ft as cssVarValue, g as createStandardButtonSurfacePolicy, gt as textColorValue, h as buttonSizeNameSchema, ht as textColorStyle, i as BUTTON_CONTRAST_POLICY, j as expandPalette, mt as rgbColorValue, n as compileButtonColourStates, nt as surfaceForegroundDeclarations, pt as mergeStyles, r as resolveSolidButtonColour, rt as surfaceForegroundInputFromResolved, s as BORDER_WIDTH_MAP, st as surfaceInkDeclarations, u as FONT_SIZE_MAP, ut as backgroundColorStyle, v as unsafeAsOpaqueButtonColourToken } from "./resolveButtonColourStates--6yJp9Tq.mjs";
|
|
2
|
-
import { $ as
|
|
3
|
-
import { $ as RichText, $
|
|
2
|
+
import { $ as formatEventDuration, A as deriveEventScheduleSummary, B as MapPinIcon, C as EventHeader, D as OfferingCourseCards, E as EventListingFrameView, F as CardListCollection, G as buildMonthDay, H as eventDisplayTitleText, I as CardListItems, J as selectQuickDateEvents, K as resolveMonthSelectedDay, L as EventItem, M as createEditorPresentationPageReader, N as createPresentationPageReader, O as eventCardListContent, P as EmptyState, Q as formatEventLocation, R as eventCategoryBadge, S as lookPartShown, T as MonthLookView, U as formatCourseDatesAfter, V as eventDisplayTitle, W as formatCourseSessions, X as eventOnlinePlace, Y as formatEventTeacherLine, Z as eventVenuePlace, _ as publicAppointmentPricingSchema, a as joinSlotKey, b as resolvePageRouteTarget, c as buildLinkedContentEditTarget, ct as defaultThemeTokens, et as resolveEventCardBooking, f as defaultTransforms, g as publicAppointmentLocationSchema, h as formatAppointmentPrice, i as composePageJoins, j as derivePreviewRunSchedule, k as offeringDatesBySeries, m as formatAppointmentLocation, n as createPageRenderPlanReader, nt as resolveEventLinkProps, o as renderedJoinLayout, p as formatAppointmentDuration, q as formatEventQuickDate, rt as parseStoredVariant, s as retargetJoinsAcrossOmissions, st as buildThemeTokens, tt as resolveEventCta, u as resolveLinkedEntryInlineFieldEligibility, w as EVENT_REGISTRATION_ANCHOR_ID, x as resolveRouteTarget, y as resolveEntryRouteTarget, z as CalendarIcon } from "./pageRenderPlan-Cuos4Xcd.mjs";
|
|
3
|
+
import { $ as RichText, $a as generateEffectsCSS, $o as publicEventsArraySchema, $r as boxStyleClassNames, $t as formatEventCompactDateRail, A as publicRouteCandidatesSchema, Aa as arrangementManifestFromVariants, Ai as FileAudioIcon, Ao as bindingSchema, Ar as formatEventPrice, At as offeringsListingFor, B as buildEventCollectionHydration, Br as faqHeadingFragment, Bt as SpinnerNode, C as buildProductListInteractiveIslandProps, Ci as resolveBlockIconRenderValue, Cn as planOrdinarySeriesSelection, Cs as sameMailingListPlacementTargeting, D as membershipClassesLabel, Di as CirclePlusIcon, Dn as resolveSelectionBookingClosedDetail, Ds as normalizeLocationAddressText, Dt as groupOfferingRunsByCourse, E as membershipCardListContent, Ei as CircleMinusIcon, En as planWholeSeriesRunSelection, Et as buildOfferingsPreviewListing, F as buildEventCalendarListingDisplay, Fi as inlineTextToPlainText, Fn as isEventFull, Ft as ThemedAuthoredButton, G as catalogueEventCardProps, Gi as isRecord$4, Go as formatDateKey, Gr as testimonialsCarouselFragment, Gs as toUtcIsoDateTimeString, H as eventCollectionDisplaySchemaShape, Ha as requireCuratedSiteStyle, Hi as PUBLIC_DOWNLOAD_MEDIA_TYPES, Hn as composeHeaderSectionWrapperClassName, Ho as getLocalDateKey, Hr as singleButtonFragment, Hs as parseLocalScheduleTime, Ht as eventListWeekDays, Ii as isInlineTextEmpty, In as groupPublicEventsByRun, Ir as richTextFragment, Is as formatBookingCompactEnglishTime, It as ThemedButton, Ja as resolveCardRole, Ji as eventReadinessLoaderKey, Jn as teamMemberCardBiography, Jo as getWeekCalendarDayTuple, Jr as heroCtaRowFragment, Js as isPublicEventPricingOptionDisplayable, Jt as eventDateOptions, K as listingEventCardProps, Ki as chosenString, Kn as parseTeamMemberSpecialties, Ko as getDayOfWeek, Kr as testimonialsHeadingFragment, Kt as buildCalendarViewport, L as eventListingBlockDefinition, Li as parseInlineTextFromUnknown, Ln as FEATURE_CARD_ICON_TREATMENTS, Lr as headingFragment, Ls as toScheduledBookingDateTime, Lt as ThemedButtonLink, M as offeringsCatalogueShape, Ma as resolveEffectiveArrangement, Mi as FileTextIcon, Mn as formatTotalCapacity, Ms as formatDate$1, Mt as resolveOfferingsPreviewGroupCta, N as eventCalendarBlockDefinition, Ni as MinusIcon, Nt as resolveOfferingsPreviewGroups, O as passCardListContent, Oi as ClockIcon, On as selectionRepresentativeEvent, Or as formatCoursePrice, Ot as normalizeOfferingsPreviewItemLimit, P as buildEventCalendarInteractiveIslandProps, Pi as PlusIcon, Pn as getEventAvailabilityStatus, Pt as resolveOfferingsRenderInput, Q as MediaNodeServer, Qa as generateNavLinkCSS, Qs as resolveExactOrFreePriceDisplay, Qt as formatEventClockLabel, R as buildEventListingInteractiveIslandProps, Rn as resolveFeatureCardGeneratedIconSizePx, Rr as cardFragment, Rt as ThemedDownloadLink, S as buildProductDetailInteractiveIslandProps, Sa as arrangementLookHooks, Si as parseBlockIconValue, Sn as planDropInPanel, Ss as parseMailingListPlacementTargeting, T as shopProductPresentation, Ti as ChevronDownIcon, Tn as planWholeSeriesParentSelection, Ts as decideLocationSourcePermission, Tt as OFFERINGS_PREVIEW_EVENT_PRESET_DEFINITIONS, U as eventCollectionHydrationSchema, Un as markEditableSurfaceForwarding, Uo as getLocalMinuteOfDay, Ur as formEmbedFragment, Us as resolveBookingBusinessTimeZone, Ut as eventWeekGroupingContext, V as buildEventCollectionListingDisplay, Vi as parseFieldDefinitions, Vr as blogFeaturedPostFragment, Vt as buildEventListWeek, W as eventCollectionSourceSchemaShape, Wi as isObjectRecord, Wn as splitPositioningClasses, Wo as addDays, Wr as formCopyFragment, Ws as toBookingTimeZone, Xa as generateFooterCss, Xn as resolveDateRuntimeContext, Xo as isSameCalendarDay, Xr as isBlockButtonRole, Xs as publicEventPricingDisplay, Xt as formatCalendarTitle, Y as cardListPresentationSchemaShape, Ya as generateDefaultCardSystem, Yn as readRuntimeNow, Yo as getWeekCalendarDays, Yr as ctaRowFragment, Ys as publicEventPricingCurrency, Za as buildTextContrastShadow, Zi as eventReadinessResultSchema, Zo as isToday, Zr as heroCopyFragment, Zs as publicEventPricingType, Zt as formatDate, _ as productDetailBlockDefinition, _n as cancelledDateCopy, _r as resolvedItemSurfaceProps, _s as orderedLiveRunSessions, _t as resolveEventRegistrationEventSource, a as normalizeLocationMapProps, ar as formBlockDefinition, b as buildCartInteractiveIslandProps, ba as headerRootPaint, bi as when, bn as getPublicEventCanonicalPath, br as clsx, bs as parseMailingListRuntimeContext, bt as normalizeEventRegistrationPageSurfaceSubject, c as newsletterSignupBlockDefinition, ca as AFFORDANCE_SUPPRESS_CLASS, ci as ctaButton, cn as resolveEventTimeZone, cr as createInteractiveIslandCodec, cs as admitReadinessFacts, d as buildNewsletterFormInteractiveIslandProps, di as defineFragment, dn as bookingPresentation, do as boundaryRuntimeMetricsForDecorativeTransition, dr as defineClientOwnedBlockRuntime, ds as pageTemplateFromEntry, dt as setContextResolveImageUrlContext, ec as formatCurrencyAmount, ei as normalizeBoxStylesBorder, en as formatEventDateParts, eo as resolveEffectApplications, es as blockBookingPaymentTermsSchema, et as ImagePresets, f as newsletterBlockSubmissionMessage, fa as selectItemSurfacePresentation, fn as browserReadAuthoritySchema, fr as defineProgressiveBlockRuntime, fs as unavailableReadinessFact, ft as EventQuickFacts, g as cartBlockDefinition, ga as readOpeningToneProjection, gn as bookingPageKindSchema, gr as lookListPresentationSchemaShape, gt as buildEventRegistrationInteractiveIslandProps, h as checkoutBlockDefinition, ha as effectiveHeaderNavLinkStyle, hn as closedRunCopy, hr as listLookSlot, hs as CANCELLED_SESSION_STATUS, ht as eventRegistrationBlockDefinition, in as formatEventTimeRange, is as sanitizeHref, j as buildOfferingsCatalogueListing, ji as FileSpreadsheetIcon, jn as formatEventRemainingPlaces, jr as formatEventPriceAmount, js as mapDrawingSchema, jt as readOfferingsGrouping, k as offeringsPreviewBlockDefinition, ki as FileArchiveIcon, kn as isBookableEvent, kr as formatEventDepositNote, kt as offeringRunLifecycle, la as resolveHeaderRootForeground, ln as resolveRuntimeEventDestination, lr as defineInteractiveIslandMetaKeys, ls as hiddenFromVisitors, lt as buildResolveImageUrlContext, m as buildGiftingInteractiveIslandProps, ma as authoredHeaderLinkForeground, mn as pageNavigationSchema, mr as listLookControl, mt as getContainerClass, nn as formatEventNextDateFact, no as generateInteractiveChildInheritanceCSS, ns as bookingConsentCarrierSchema, o as normalizeLocationMapSource, oa as parseThemeButtonVariantId, oc as TokenResolver, on as formatTime, or as buildFormInteractiveIslandProps, ot as resolvePublicMediaUrl, p as giftingBlockDefinition, pn as blockSiteTermsSchema, pr as listItemPresentation, pt as getCardOrientation, q as CardListContentPart, qn as teamMemberBiography, qo as getOrderedDayNames, qr as ctaCopyFragment, qs as formatBookingPriceDisplay, r as normalizeBlockContent, rs as beforeBookingQuestionsPresentationSchema, s as resolveLocationMapLocation, sa as themeButtonSelector, si as resolveBackgroundColorValue, sn as groupEventsByDate, sr as buildInteractiveIslandProps, t as getBlockDefinition, ti as resolveCardRoleForBoxStyles, tn as formatEventHourLabel, to as resolveEffectPaint, tr as staticHeaderChromeRuntime, ts as blockBookingConsentSchema, tt as MediaPlaceholder, u as NEWSLETTER_SIGNUPS_PAUSED_MESSAGE, ui as bodyCopyFragment, ur as createZodCodec, us as loadedReadinessFact, ut as getCurrentResolveImageUrlContext, v as productListBlockDefinition, va as headerNeedsPhotoShade, vi as runTransforms, vn as hasCancelledRegistrationDate, vo as anglePolygonCss, vr as itemRole, vs as resolveWholeSeriesBookingPhase, vt as bookingNowSchema, w as buildShopInteractiveIslandProps, wi as ArrowDownIcon, wn as planWholeSeriesParentBooking, x as buildCheckoutInteractiveIslandProps, xi as buildGeneratedBlockIconRenderAssetLookupFromUnknown, xn as isOrdinaryPublicEvent, xt as resolveEventRegistrationScopedEvents, y as shopBlockDefinition, ya as headerRootIsTransparent, yi as el, yn as eventOccurrenceContext, yo as transitionCatalogueEntries, yr as Grid, ys as buildMailingListSignupBlockSourceRef, yt as previewStageSchema, z as buildEventCollectionDisplay, zn as shouldReserveFeatureCardIconZone, zr as faqAccordionFragment, zs as getBookingLocalDateKey, zt as getIconComponent } from "./registry-cQ9N5W-n.mjs";
|
|
4
4
|
import { B as HOVER_TEXT_THRESHOLD, C as materializeRuntimeButtonAppearance, F as resolveSurfaceForeground, G as resolveConcreteColorHex, H as contrastThresholdByPolicy, K as resolveOpaqueSurfaceHex, L as surfaceInkPublication, N as freezeOwnedThemeValue, O as mapButtonVisualAppearances, P as ownedThemeSnapshot, S as buttonTypographyDeclarations, U as inkReference, V as certifyPaint, b as buttonShadow, f as compositeHex, g as actionVariableFallback, n as parseSurfaceTree, o as resolveSurface, s as serializeSurfaceTree, v as buttonBorder, w as paddingDeclarations, x as buttonStateAppearanceDeclarations, y as buttonRadius } from "./accessibleSurfaces-CM3QANtw.mjs";
|
|
5
|
-
import {
|
|
5
|
+
import { b as siteChromeBackgroundOverrideOwner, m as surfaceCardRoleValues, s as boxBackgroundSchema } from "./schema-BpsqaSSU.mjs";
|
|
6
6
|
import { l as renderableMediaAssetSchema, o as runtimeMediaSchema } from "./media-luf7RF22.mjs";
|
|
7
7
|
import { t as assertNever$1 } from "./assert-never-ku-PUn9U.mjs";
|
|
8
|
-
import { A as MQ_TABLET_ONLY, D as MQ_MD_UP, E as MQ_MD_DOWN, O as MQ_SM_DOWN, T as MQ_LG_UP, c as readSdkPreviewPublishedPlacement, g as validateManifestDraft, k as MQ_SM_UP, m as compileManifestContentContract } from "./pageRuntimeSupport-
|
|
8
|
+
import { A as MQ_TABLET_ONLY, D as MQ_MD_UP, E as MQ_MD_DOWN, O as MQ_SM_DOWN, T as MQ_LG_UP, c as readSdkPreviewPublishedPlacement, g as validateManifestDraft, k as MQ_SM_UP, m as compileManifestContentContract } from "./pageRuntimeSupport-CuVj3bkd.mjs";
|
|
9
9
|
import { n as RichTextDocSchema } from "./richTextSchema-QLaQrbII.mjs";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { c as
|
|
13
|
-
import { t as parseThemeForPersistence } from "./parseThemeForPersistence-
|
|
10
|
+
import { M as opaqueSurfaceDeclarations, T as testimonialsCompositionTreatmentValues, j as opaqueSurfaceContextFromTheme, v as featureCardCompositionTreatmentValues, x as offeringsPreviewCompositionTreatmentValues, y as introCompositionTreatmentValues } from "./lookMediaFrame-CaH018pK.mjs";
|
|
11
|
+
import { c as mergeHeaderNavTypographyPreference, l as readHeaderNavFontSizePreference } from "./bindings-7L3pC5Os.mjs";
|
|
12
|
+
import { A as generateShadowCssVars, C as INPUT_ERROR_BORDER_COLOR_VAR, D as RESOLVED_BUTTON_DISABLED_DECLARATIONS, E as generateOpaquePanelCss, M as cardBorderDeclarations, N as cardDecorationPseudoRules, O as resolvedButtonColourDeclarations, S as INPUT_EDGE_COLOR_VAR, T as generateCheckableCss, _ as getResponsiveScopeSpec, a as prefixSelector, b as INPUT_GROUP_SELECTOR, c as parseCustomCssRules, d as THEME_RADIUS_CSS_VARS, f as generateTypographyCss, g as THEME_RESPONSIVE_CONTAINER_NAME, h as DEFAULT_THEME_RESPONSIVE_MODE, i as escapeStyleContent, j as renderCssDeclarations, k as resolvedButtonFocusDeclarations, l as generateAllBlockVarsCss, m as generateStatusCss, n as compileBlockCustomCssRules, o as toKebabCase, p as generateProgressCss, r as compileCustomCssRules, s as parseBlockCustomCssRules, t as ThemeScopeCore, u as generateBlockCustomVarsCss, v as INPUT_GROUP_ERROR_SELECTOR, w as inputEdgeColorValue, x as generateInputGroupCss, y as INPUT_GROUP_FOCUS_SELECTOR } from "./ThemeScopeCore-DFEM1a85.mjs";
|
|
13
|
+
import { t as parseThemeForPersistence } from "./parseThemeForPersistence-DOsfofCy.mjs";
|
|
14
14
|
import { n as mapOutlineBlocks } from "./pageRegions-BaeEF2MU.mjs";
|
|
15
15
|
import { t as getAtPath } from "./src-DHK4JUlp.mjs";
|
|
16
16
|
import * as React$1 from "react";
|
|
@@ -159,225 +159,320 @@ function formatOpeningHoursRows(hours, options = {}) {
|
|
|
159
159
|
}, []);
|
|
160
160
|
}
|
|
161
161
|
//#endregion
|
|
162
|
-
//#region ../
|
|
163
|
-
/**
|
|
164
|
-
* Corner style to border-radius value map for content-bearing card surfaces.
|
|
165
|
-
* Full pill radii are reserved for controls; cards need a capped radius so
|
|
166
|
-
* long titles, media, and expanded content do not clip into capsule shapes.
|
|
167
|
-
*/
|
|
168
|
-
const CORNER_RADIUS_MAP = {
|
|
169
|
-
square: "0px",
|
|
170
|
-
soft: "8px",
|
|
171
|
-
rounded: "16px",
|
|
172
|
-
pill: "24px"
|
|
173
|
-
};
|
|
174
|
-
/**
|
|
175
|
-
* Gradient direction to CSS direction map
|
|
176
|
-
*/
|
|
177
|
-
const GRADIENT_DIRECTION_MAP = {
|
|
178
|
-
"to-r": "to right",
|
|
179
|
-
"to-l": "to left",
|
|
180
|
-
"to-t": "to top",
|
|
181
|
-
"to-b": "to bottom",
|
|
182
|
-
"to-tr": "to top right",
|
|
183
|
-
"to-tl": "to top left",
|
|
184
|
-
"to-br": "to bottom right",
|
|
185
|
-
"to-bl": "to bottom left"
|
|
186
|
-
};
|
|
187
|
-
/**
|
|
188
|
-
* Generate CSS box-shadow value from Shadow object
|
|
189
|
-
*/
|
|
190
|
-
function generateShadowValue(shadow) {
|
|
191
|
-
if (shadow.elevation === "none") return "none";
|
|
192
|
-
const offset = {
|
|
193
|
-
low: 2,
|
|
194
|
-
medium: 4,
|
|
195
|
-
high: 6
|
|
196
|
-
}[shadow.elevation];
|
|
197
|
-
const xOffset = shadow.position === "bottom-right" ? offset : 0;
|
|
198
|
-
if (shadow.softness === "hard") return `${xOffset}px ${offset}px 0 0 rgba(0,0,0,1)`;
|
|
199
|
-
const soft = shadow.softness !== "crisp";
|
|
200
|
-
switch (shadow.elevation) {
|
|
201
|
-
case "low": return soft ? `${xOffset}px 1px 2px rgba(0,0,0,.06)` : `${xOffset}px 1px 1px rgba(0,0,0,.12)`;
|
|
202
|
-
case "medium": return soft ? `${xOffset}px 10px 20px rgba(0,0,0,.08)` : `${xOffset}px 6px 12px rgba(0,0,0,.16)`;
|
|
203
|
-
case "high": return soft ? `${xOffset}px 25px 50px rgba(0,0,0,.18)` : `${xOffset}px 20px 30px rgba(0,0,0,.28)`;
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
//#endregion
|
|
207
|
-
//#region ../theme-core/src/cards/generateCardCss.ts
|
|
208
|
-
const PER_CORNER_RADIUS_MAP = {
|
|
209
|
-
square: "0",
|
|
210
|
-
soft: "0.5rem",
|
|
211
|
-
rounded: "1rem",
|
|
212
|
-
pill: "1.5rem",
|
|
213
|
-
expressive: "calc(var(--rb-block-radius) * 3)"
|
|
214
|
-
};
|
|
215
|
-
function resolveCornerRadiiCss(cornerRadii, fallback) {
|
|
216
|
-
const fallbackValue = CORNER_RADIUS_MAP[fallback];
|
|
217
|
-
const at = (value) => value ? PER_CORNER_RADIUS_MAP[value] : fallbackValue;
|
|
218
|
-
return `${at(cornerRadii.topLeft)} ${at(cornerRadii.topRight)} ${at(cornerRadii.bottomRight)} ${at(cornerRadii.bottomLeft)}`;
|
|
219
|
-
}
|
|
220
|
-
function generateCardCss(options) {
|
|
221
|
-
const { themeId, cardSystem: providedCardSystem, solvedInks } = options;
|
|
222
|
-
const theme = {
|
|
223
|
-
...options.theme,
|
|
224
|
-
buttons: ownedThemeSnapshot(options.theme.buttons)
|
|
225
|
-
};
|
|
226
|
-
const tokens = new TokenResolver(theme);
|
|
227
|
-
const palette = freezeOwnedThemeValue(expandPalette(theme.palette));
|
|
228
|
-
const cardSystem = providedCardSystem ?? generateDefaultCardSystem(theme);
|
|
229
|
-
const source = providedCardSystem ? "site-style" : "generated-baseline";
|
|
230
|
-
const aliasGroups = resolveRoleAliasGroups(theme, providedCardSystem ?? null);
|
|
231
|
-
const cssChunks = [];
|
|
232
|
-
const emittedGroupKeys = /* @__PURE__ */ new Set();
|
|
233
|
-
for (const variant of cardSystem.variants) {
|
|
234
|
-
if (!variant.enabled) continue;
|
|
235
|
-
const groupKey = roleAliasGroupKey(source, variant.id);
|
|
236
|
-
emittedGroupKeys.add(groupKey);
|
|
237
|
-
const aliasClasses = aliasGroups.get(groupKey)?.classes ?? [];
|
|
238
|
-
cssChunks.push(generateVariantCSS(variant, themeId, [`card-${variant.id}`, ...aliasClasses], tokens, theme, palette, solvedInks));
|
|
239
|
-
}
|
|
240
|
-
for (const [groupKey, group] of aliasGroups) {
|
|
241
|
-
if (emittedGroupKeys.has(groupKey)) continue;
|
|
242
|
-
cssChunks.push(generateVariantCSS(group.variant, themeId, group.classes, tokens, theme, palette, solvedInks));
|
|
243
|
-
}
|
|
244
|
-
return cssChunks.filter(Boolean).join("\n\n");
|
|
245
|
-
}
|
|
246
|
-
function roleAliasGroupKey(source, variantId) {
|
|
247
|
-
return `${source}:${variantId}`;
|
|
248
|
-
}
|
|
162
|
+
//#region ../calendar/src/lane-packing.ts
|
|
249
163
|
/**
|
|
250
|
-
*
|
|
251
|
-
* through the fallback chain so compiled content can address a role without
|
|
252
|
-
* knowing which variant id a site style used — or whether it defined one.
|
|
164
|
+
* Assign lanes to a list of intervals.
|
|
253
165
|
*
|
|
254
|
-
*
|
|
255
|
-
*
|
|
166
|
+
* Returns one result per input in the same order as the input. Internally
|
|
167
|
+
* sorts a copy by `(start, end, orderKey)` to ensure determinism, then
|
|
168
|
+
* permutes results back to input order.
|
|
256
169
|
*/
|
|
257
|
-
function
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
170
|
+
function assignLanes(intervals) {
|
|
171
|
+
if (intervals.length === 0) return [];
|
|
172
|
+
const indexed = intervals.map((interval, index) => ({
|
|
173
|
+
interval,
|
|
174
|
+
index
|
|
175
|
+
}));
|
|
176
|
+
indexed.sort((left, right) => left.interval.start - right.interval.start || left.interval.end - right.interval.end || left.interval.orderKey.localeCompare(right.interval.orderKey));
|
|
177
|
+
const results = new Array(intervals.length);
|
|
178
|
+
let cluster = [];
|
|
179
|
+
let activeLaneEnds = [];
|
|
180
|
+
let clusterMaxEnd = -Infinity;
|
|
181
|
+
const closeCluster = () => {
|
|
182
|
+
if (cluster.length === 0) return;
|
|
183
|
+
const laneCount = Math.max(1, cluster.reduce((max, entry) => Math.max(max, entry.laneIndex + 1), 0));
|
|
184
|
+
for (const entry of cluster) results[entry.index] = {
|
|
185
|
+
laneIndex: entry.laneIndex,
|
|
186
|
+
laneCount
|
|
187
|
+
};
|
|
188
|
+
cluster = [];
|
|
189
|
+
activeLaneEnds = [];
|
|
190
|
+
clusterMaxEnd = -Infinity;
|
|
191
|
+
};
|
|
192
|
+
for (const { interval, index } of indexed) {
|
|
193
|
+
if (interval.start >= clusterMaxEnd) closeCluster();
|
|
194
|
+
const laneIndex = firstAvailableLane(activeLaneEnds, interval.start);
|
|
195
|
+
activeLaneEnds[laneIndex] = interval.end;
|
|
196
|
+
clusterMaxEnd = Math.max(clusterMaxEnd, interval.end);
|
|
197
|
+
cluster.push({
|
|
198
|
+
index,
|
|
199
|
+
laneIndex
|
|
269
200
|
});
|
|
270
201
|
}
|
|
271
|
-
|
|
202
|
+
closeCluster();
|
|
203
|
+
return results;
|
|
272
204
|
}
|
|
205
|
+
function firstAvailableLane(activeLaneEnds, start) {
|
|
206
|
+
const laneIndex = activeLaneEnds.findIndex((end) => end <= start);
|
|
207
|
+
return laneIndex >= 0 ? laneIndex : activeLaneEnds.length;
|
|
208
|
+
}
|
|
209
|
+
//#endregion
|
|
210
|
+
//#region ../calendar/src/timetable.ts
|
|
273
211
|
/**
|
|
274
|
-
*
|
|
275
|
-
*/
|
|
276
|
-
const CONTENT_PADDING_MAP = {
|
|
277
|
-
none: "0",
|
|
278
|
-
compact: "0.75rem",
|
|
279
|
-
cozy: "1rem",
|
|
280
|
-
medium: "1.25rem",
|
|
281
|
-
comfortable: "1.5rem",
|
|
282
|
-
spacious: "2rem"
|
|
283
|
-
};
|
|
284
|
-
/**
|
|
285
|
-
* Corner radius map for card media (top corners only). Match card surface
|
|
286
|
-
* radii rather than button pills so media does not become capsule-clipped.
|
|
287
|
-
*/
|
|
288
|
-
const MEDIA_CORNER_MAP = {
|
|
289
|
-
square: "0",
|
|
290
|
-
soft: "0.5rem",
|
|
291
|
-
rounded: "1rem",
|
|
292
|
-
pill: "1.5rem"
|
|
293
|
-
};
|
|
294
|
-
/**
|
|
295
|
-
* Generate CSS for a single card variant
|
|
212
|
+
* Timetable model — the package's core surface.
|
|
296
213
|
*
|
|
297
|
-
*
|
|
298
|
-
* -
|
|
299
|
-
*
|
|
300
|
-
* - .card-content: padding based on spacing
|
|
214
|
+
* Generic over `T`. Takes a list of timed items + a viewport; returns a
|
|
215
|
+
* day-by-day layout with overlap-packed lanes and percent-based positions
|
|
216
|
+
* plus a diagnostics list for items dropped during processing.
|
|
301
217
|
*
|
|
302
|
-
*
|
|
303
|
-
*
|
|
218
|
+
* The function is pure: given identical input (including `now`), it returns
|
|
219
|
+
* the same output. The model has no opinion on what an item is — pass
|
|
220
|
+
* accessors.
|
|
304
221
|
*/
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
const
|
|
315
|
-
|
|
316
|
-
const
|
|
317
|
-
const
|
|
318
|
-
|
|
319
|
-
const
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
222
|
+
const DEFAULT_BOUNDS = {
|
|
223
|
+
minStartHour: 5,
|
|
224
|
+
maxEndHour: 23,
|
|
225
|
+
defaultStartHour: 6,
|
|
226
|
+
defaultEndHour: 21,
|
|
227
|
+
minHeightPercent: 2.5,
|
|
228
|
+
marginMinutes: 0
|
|
229
|
+
};
|
|
230
|
+
function buildTimetableModel$1(input) {
|
|
231
|
+
const bounds = resolveBounds(input.bounds);
|
|
232
|
+
const viewportDays = getTimetableDays(input.viewDate, input.view ?? "week", input.startOfWeek);
|
|
233
|
+
const viewportKeys = new Set(viewportDays.map(formatDateKey));
|
|
234
|
+
const parsed = parseAllItems(input.items, input);
|
|
235
|
+
const inViewport = deriveVisibleSegments(parsed.drafts, viewportKeys);
|
|
236
|
+
const hourRange = input.hours === void 0 ? resolveHourRange(inViewport, bounds) : fixedHourRange(input.hours);
|
|
237
|
+
const laid = layoutCellsByDate(inViewport, hourRange, bounds);
|
|
238
|
+
return {
|
|
239
|
+
days: assembleDays(viewportDays, laid.cellsByDate, input.today),
|
|
240
|
+
hourTicks: buildHourTicks(hourRange.startHour, hourRange.endHour),
|
|
241
|
+
startHour: hourRange.startHour,
|
|
242
|
+
endHour: hourRange.endHour,
|
|
243
|
+
rangeMinutes: (hourRange.endHour - hourRange.startHour) * 60,
|
|
244
|
+
hasItems: inViewport.length > 0,
|
|
245
|
+
diagnostics: [...parsed.diagnostics, ...laid.diagnostics]
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
function parseAllItems(items, accessors) {
|
|
249
|
+
const drafts = [];
|
|
250
|
+
const diagnostics = [];
|
|
251
|
+
for (const item of items) {
|
|
252
|
+
const result = parseDraft(item, accessors);
|
|
253
|
+
if (result.ok) drafts.push(result.draft);
|
|
254
|
+
else diagnostics.push({
|
|
255
|
+
item,
|
|
256
|
+
reason: result.reason
|
|
257
|
+
});
|
|
323
258
|
}
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
return [
|
|
329
|
-
`${structureSelector} {\n display: flex;\n flex-direction: column;\n position: relative;\n overflow: visible;\n}`,
|
|
330
|
-
`${containerSelector} {\n ${renderCssDeclarations(rules)}\n}`,
|
|
331
|
-
...cardDecorationPseudoRules(containerSelectors, variant.decorations, resolveColor),
|
|
332
|
-
`${fallbackBackgroundSelector} {\n background: transparent;\n}`,
|
|
333
|
-
`${mediaSelector} {\n ${mediaRules.join(";\n ")};\n}`,
|
|
334
|
-
`${contentSelector} {\n ${contentRules.join(";\n ")};\n}`
|
|
335
|
-
].join("\n\n");
|
|
259
|
+
return {
|
|
260
|
+
drafts,
|
|
261
|
+
diagnostics
|
|
262
|
+
};
|
|
336
263
|
}
|
|
337
|
-
function
|
|
338
|
-
|
|
339
|
-
const
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
264
|
+
function layoutCellsByDate(segments, hourRange, bounds) {
|
|
265
|
+
const rangeMinutes = (hourRange.endHour - hourRange.startHour) * 60;
|
|
266
|
+
const rangeStartMinutes = hourRange.startHour * 60;
|
|
267
|
+
const rangeEndMinutes = hourRange.endHour * 60;
|
|
268
|
+
const segmentsByDate = groupSegmentsByDate(segments);
|
|
269
|
+
const cellsByDate = /* @__PURE__ */ new Map();
|
|
270
|
+
const diagnostics = [];
|
|
271
|
+
for (const [dateKey, daySegments] of segmentsByDate) {
|
|
272
|
+
const clipped = [];
|
|
273
|
+
for (const segment of daySegments) {
|
|
274
|
+
const result = clipDraft(segment, rangeStartMinutes, rangeEndMinutes);
|
|
275
|
+
if (result.ok) clipped.push(result.clipped);
|
|
276
|
+
else diagnostics.push({
|
|
277
|
+
item: segment.draft.item,
|
|
278
|
+
reason: result.reason
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
const laneResults = assignLanes(clipped.map((entry) => ({
|
|
282
|
+
start: entry.visibleStart,
|
|
283
|
+
end: entry.visibleEnd,
|
|
284
|
+
orderKey: entry.segment.draft.orderKey
|
|
285
|
+
})));
|
|
286
|
+
cellsByDate.set(dateKey, clipped.map((entry, idx) => buildCell(entry, laneResults[idx] ?? {
|
|
287
|
+
laneIndex: 0,
|
|
288
|
+
laneCount: 1
|
|
289
|
+
}, rangeStartMinutes, rangeMinutes, bounds.minHeightPercent)));
|
|
290
|
+
}
|
|
291
|
+
return {
|
|
292
|
+
cellsByDate,
|
|
293
|
+
diagnostics
|
|
294
|
+
};
|
|
349
295
|
}
|
|
350
|
-
function
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
case "gradient": return {
|
|
359
|
-
kind: "gradient",
|
|
360
|
-
foregroundToken: variant.foregroundToken
|
|
296
|
+
function assembleDays(viewportDays, cellsByDate, today) {
|
|
297
|
+
return viewportDays.map((date) => {
|
|
298
|
+
const dateKey = formatDateKey(date);
|
|
299
|
+
return {
|
|
300
|
+
date,
|
|
301
|
+
dateKey,
|
|
302
|
+
isToday: isSameCalendarDay(date, today),
|
|
303
|
+
cells: cellsByDate.get(dateKey) ?? []
|
|
361
304
|
};
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
function parseDraft(item, accessors) {
|
|
308
|
+
const startsAtIso = accessors.getStartsAt(item);
|
|
309
|
+
const endsAtIso = accessors.getEndsAt(item);
|
|
310
|
+
const timeZone = accessors.getTimeZone(item);
|
|
311
|
+
const startsAtMinutes = getLocalMinuteOfDay(startsAtIso, timeZone);
|
|
312
|
+
if (Number.isNaN(startsAtMinutes)) return {
|
|
313
|
+
ok: false,
|
|
314
|
+
reason: "invalid-start"
|
|
315
|
+
};
|
|
316
|
+
const startDateKey = getLocalDateKey(startsAtIso, timeZone);
|
|
317
|
+
if (startDateKey == null) return {
|
|
318
|
+
ok: false,
|
|
319
|
+
reason: "invalid-timezone"
|
|
320
|
+
};
|
|
321
|
+
const endDateKey = getLocalDateKey(endsAtIso, timeZone);
|
|
322
|
+
if (endDateKey == null) return {
|
|
323
|
+
ok: false,
|
|
324
|
+
reason: "invalid-end"
|
|
325
|
+
};
|
|
326
|
+
const endsAtMinutesRaw = getLocalMinuteOfDay(endsAtIso, timeZone);
|
|
327
|
+
if (Number.isNaN(endsAtMinutesRaw)) return {
|
|
328
|
+
ok: false,
|
|
329
|
+
reason: "invalid-end"
|
|
330
|
+
};
|
|
331
|
+
const spansMultipleDays = startDateKey < endDateKey;
|
|
332
|
+
const endsAtMinutes = spansMultipleDays || endsAtMinutesRaw > startsAtMinutes ? endsAtMinutesRaw : Math.min(1440, startsAtMinutes + 60);
|
|
333
|
+
if (!spansMultipleDays && endsAtMinutes <= startsAtMinutes) return {
|
|
334
|
+
ok: false,
|
|
335
|
+
reason: "non-positive-duration"
|
|
336
|
+
};
|
|
337
|
+
return {
|
|
338
|
+
ok: true,
|
|
339
|
+
draft: {
|
|
340
|
+
item,
|
|
341
|
+
startDateKey,
|
|
342
|
+
endDateKey,
|
|
343
|
+
startsAtMinutes,
|
|
344
|
+
endsAtMinutes,
|
|
345
|
+
color: accessors.getColor?.(item) ?? null,
|
|
346
|
+
orderKey: accessors.getOrderKey?.(item) ?? accessors.getId(item)
|
|
347
|
+
}
|
|
348
|
+
};
|
|
349
|
+
}
|
|
350
|
+
function deriveVisibleSegments(drafts, viewportKeys) {
|
|
351
|
+
const segments = [];
|
|
352
|
+
for (const draft of drafts) for (const dateKey of enumerateDateKeys(draft.startDateKey, draft.endDateKey)) {
|
|
353
|
+
if (!viewportKeys.has(dateKey)) continue;
|
|
354
|
+
const isStartDay = dateKey === draft.startDateKey;
|
|
355
|
+
const isEndDay = dateKey === draft.endDateKey;
|
|
356
|
+
const startsAtMinutes = isStartDay ? draft.startsAtMinutes : 0;
|
|
357
|
+
const endsAtMinutes = isEndDay ? draft.endsAtMinutes : 1440;
|
|
358
|
+
if (endsAtMinutes <= startsAtMinutes) continue;
|
|
359
|
+
segments.push({
|
|
360
|
+
draft,
|
|
361
|
+
dateKey,
|
|
362
|
+
startsAtMinutes,
|
|
363
|
+
endsAtMinutes,
|
|
364
|
+
continuesBefore: !isStartDay,
|
|
365
|
+
continuesAfter: !isEndDay
|
|
366
|
+
});
|
|
362
367
|
}
|
|
368
|
+
return segments;
|
|
363
369
|
}
|
|
364
|
-
function
|
|
365
|
-
|
|
366
|
-
const
|
|
367
|
-
|
|
368
|
-
|
|
370
|
+
function clipDraft(segment, rangeStartMinutes, rangeEndMinutes) {
|
|
371
|
+
const visibleStart = Math.max(rangeStartMinutes, segment.startsAtMinutes);
|
|
372
|
+
const visibleEnd = Math.min(rangeEndMinutes, segment.endsAtMinutes);
|
|
373
|
+
if (visibleEnd <= visibleStart) return {
|
|
374
|
+
ok: false,
|
|
375
|
+
reason: "out-of-visible-hours"
|
|
376
|
+
};
|
|
377
|
+
return {
|
|
378
|
+
ok: true,
|
|
379
|
+
clipped: {
|
|
380
|
+
segment,
|
|
381
|
+
visibleStart,
|
|
382
|
+
visibleEnd
|
|
383
|
+
}
|
|
384
|
+
};
|
|
369
385
|
}
|
|
370
|
-
function
|
|
371
|
-
const
|
|
372
|
-
|
|
386
|
+
function buildCell(entry, lane, rangeStartMinutes, rangeMinutes, minHeightPercent) {
|
|
387
|
+
const heightPercent = Math.max(minHeightPercent, toRangePercent(entry.visibleEnd - entry.visibleStart, rangeMinutes));
|
|
388
|
+
const rawTopPercent = toRangePercent(entry.visibleStart - rangeStartMinutes, rangeMinutes);
|
|
389
|
+
const topPercent = Math.min(rawTopPercent, 100 - heightPercent);
|
|
390
|
+
return {
|
|
391
|
+
item: entry.segment.draft.item,
|
|
392
|
+
dateKey: entry.segment.dateKey,
|
|
393
|
+
startsAtMinutes: entry.segment.startsAtMinutes,
|
|
394
|
+
endsAtMinutes: entry.segment.endsAtMinutes,
|
|
395
|
+
visibleStartsAtMinutes: entry.visibleStart,
|
|
396
|
+
visibleEndsAtMinutes: entry.visibleEnd,
|
|
397
|
+
topPercent,
|
|
398
|
+
heightPercent,
|
|
399
|
+
isClippedStart: entry.segment.continuesBefore || entry.segment.startsAtMinutes < entry.visibleStart,
|
|
400
|
+
isClippedEnd: entry.segment.continuesAfter || entry.segment.endsAtMinutes > entry.visibleEnd,
|
|
401
|
+
laneIndex: lane.laneIndex,
|
|
402
|
+
laneCount: lane.laneCount,
|
|
403
|
+
color: entry.segment.draft.color
|
|
404
|
+
};
|
|
373
405
|
}
|
|
374
|
-
function
|
|
375
|
-
return
|
|
406
|
+
function resolveBounds(bounds) {
|
|
407
|
+
return {
|
|
408
|
+
...DEFAULT_BOUNDS,
|
|
409
|
+
...bounds
|
|
410
|
+
};
|
|
376
411
|
}
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
412
|
+
function resolveHourRange(segments, bounds) {
|
|
413
|
+
if (segments.length === 0) return {
|
|
414
|
+
startHour: bounds.defaultStartHour,
|
|
415
|
+
endHour: bounds.defaultEndHour
|
|
416
|
+
};
|
|
417
|
+
const earliestStart = Math.min(...segments.map((segment) => segment.startsAtMinutes));
|
|
418
|
+
const latestEnd = Math.max(...segments.map((segment) => segment.endsAtMinutes));
|
|
419
|
+
const startHour = Math.max(bounds.minStartHour, Math.floor((earliestStart - bounds.marginMinutes) / 60));
|
|
420
|
+
const endHour = Math.min(bounds.maxEndHour, Math.ceil((latestEnd + bounds.marginMinutes) / 60));
|
|
421
|
+
return {
|
|
422
|
+
startHour,
|
|
423
|
+
endHour: Math.max(startHour + 1, endHour)
|
|
424
|
+
};
|
|
425
|
+
}
|
|
426
|
+
function fixedHourRange(hours) {
|
|
427
|
+
const startHour = Math.min(23, Math.max(0, Math.floor(hours.startHour)));
|
|
428
|
+
return {
|
|
429
|
+
startHour,
|
|
430
|
+
endHour: Math.min(24, Math.max(startHour + 1, Math.ceil(hours.endHour)))
|
|
431
|
+
};
|
|
432
|
+
}
|
|
433
|
+
function buildHourTicks(startHour, endHour) {
|
|
434
|
+
const ticks = [];
|
|
435
|
+
for (let hour = startHour; hour <= endHour; hour += 1) ticks.push(hour);
|
|
436
|
+
return ticks;
|
|
437
|
+
}
|
|
438
|
+
function groupSegmentsByDate(segments) {
|
|
439
|
+
const grouped = /* @__PURE__ */ new Map();
|
|
440
|
+
for (const segment of segments) {
|
|
441
|
+
const existing = grouped.get(segment.dateKey) ?? [];
|
|
442
|
+
existing.push(segment);
|
|
443
|
+
grouped.set(segment.dateKey, existing);
|
|
444
|
+
}
|
|
445
|
+
return grouped;
|
|
446
|
+
}
|
|
447
|
+
function toRangePercent(minutes, rangeMinutes) {
|
|
448
|
+
if (rangeMinutes <= 0) return 0;
|
|
449
|
+
return minutes / rangeMinutes * 100;
|
|
450
|
+
}
|
|
451
|
+
function getTimetableDays(viewDate, view, startOfWeek) {
|
|
452
|
+
if (view === "day") return [viewDate];
|
|
453
|
+
return getWeekCalendarDays(viewDate, startOfWeek);
|
|
454
|
+
}
|
|
455
|
+
function enumerateDateKeys(startDateKey, endDateKey) {
|
|
456
|
+
if (startDateKey > endDateKey) throw new Error(`Invalid timetable date range: ${startDateKey} is after ${endDateKey}`);
|
|
457
|
+
const start = parseDateKey(startDateKey);
|
|
458
|
+
parseDateKey(endDateKey);
|
|
459
|
+
const keys = [];
|
|
460
|
+
let cursor = start;
|
|
461
|
+
while (formatDateKey(cursor) <= endDateKey) {
|
|
462
|
+
keys.push(formatDateKey(cursor));
|
|
463
|
+
cursor = addDays(cursor, 1);
|
|
464
|
+
}
|
|
465
|
+
return keys;
|
|
466
|
+
}
|
|
467
|
+
function parseDateKey(dateKey) {
|
|
468
|
+
const match = /^(\d{4})-(\d{2})-(\d{2})$/.exec(dateKey);
|
|
469
|
+
if (match === null) throw new Error(`Invalid timetable date key: ${dateKey}`);
|
|
470
|
+
const [, year, month, day] = match;
|
|
471
|
+
return {
|
|
472
|
+
year: Number(year),
|
|
473
|
+
month: Number(month),
|
|
474
|
+
day: Number(day)
|
|
475
|
+
};
|
|
381
476
|
}
|
|
382
477
|
//#endregion
|
|
383
478
|
//#region ../theme-core/src/styles/skinTokens.ts
|
|
@@ -385,21 +480,242 @@ function skinTokenCssVars(tokens) {
|
|
|
385
480
|
return Object.fromEntries(Object.entries(tokens ?? {}).map(([name, value]) => [`--rb-skin-${name}`, value]));
|
|
386
481
|
}
|
|
387
482
|
//#endregion
|
|
388
|
-
//#region ../theme-core/src/
|
|
483
|
+
//#region ../theme-core/src/cards/constants.ts
|
|
389
484
|
/**
|
|
390
|
-
*
|
|
391
|
-
*
|
|
392
|
-
*
|
|
393
|
-
* visual language (spacing, borders, shadows, colors).
|
|
485
|
+
* Corner style to border-radius value map for content-bearing card surfaces.
|
|
486
|
+
* Full pill radii are reserved for controls; cards need a capped radius so
|
|
487
|
+
* long titles, media, and expanded content do not clip into capsule shapes.
|
|
394
488
|
*/
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
489
|
+
const CORNER_RADIUS_MAP = {
|
|
490
|
+
square: "0px",
|
|
491
|
+
soft: "8px",
|
|
492
|
+
rounded: "16px",
|
|
493
|
+
pill: "24px"
|
|
494
|
+
};
|
|
495
|
+
/**
|
|
496
|
+
* Gradient direction to CSS direction map
|
|
497
|
+
*/
|
|
498
|
+
const GRADIENT_DIRECTION_MAP = {
|
|
499
|
+
"to-r": "to right",
|
|
500
|
+
"to-l": "to left",
|
|
501
|
+
"to-t": "to top",
|
|
502
|
+
"to-b": "to bottom",
|
|
503
|
+
"to-tr": "to top right",
|
|
504
|
+
"to-tl": "to top left",
|
|
505
|
+
"to-br": "to bottom right",
|
|
506
|
+
"to-bl": "to bottom left"
|
|
507
|
+
};
|
|
508
|
+
/**
|
|
509
|
+
* Generate CSS box-shadow value from Shadow object
|
|
510
|
+
*/
|
|
511
|
+
function generateShadowValue(shadow) {
|
|
512
|
+
if (shadow.elevation === "none") return "none";
|
|
513
|
+
const offset = {
|
|
514
|
+
low: 2,
|
|
515
|
+
medium: 4,
|
|
516
|
+
high: 6
|
|
517
|
+
}[shadow.elevation];
|
|
518
|
+
const xOffset = shadow.position === "bottom-right" ? offset : 0;
|
|
519
|
+
if (shadow.softness === "hard") return `${xOffset}px ${offset}px 0 0 rgba(0,0,0,1)`;
|
|
520
|
+
const soft = shadow.softness !== "crisp";
|
|
521
|
+
switch (shadow.elevation) {
|
|
522
|
+
case "low": return soft ? `${xOffset}px 1px 2px rgba(0,0,0,.06)` : `${xOffset}px 1px 1px rgba(0,0,0,.12)`;
|
|
523
|
+
case "medium": return soft ? `${xOffset}px 10px 20px rgba(0,0,0,.08)` : `${xOffset}px 6px 12px rgba(0,0,0,.16)`;
|
|
524
|
+
case "high": return soft ? `${xOffset}px 25px 50px rgba(0,0,0,.18)` : `${xOffset}px 20px 30px rgba(0,0,0,.28)`;
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
//#endregion
|
|
528
|
+
//#region ../theme-core/src/cards/generateCardCss.ts
|
|
529
|
+
const PER_CORNER_RADIUS_MAP = {
|
|
530
|
+
square: "0",
|
|
531
|
+
soft: "0.5rem",
|
|
532
|
+
rounded: "1rem",
|
|
533
|
+
pill: "1.5rem",
|
|
534
|
+
expressive: "calc(var(--rb-block-radius) * 3)"
|
|
535
|
+
};
|
|
536
|
+
function resolveCornerRadiiCss(cornerRadii, fallback) {
|
|
537
|
+
const fallbackValue = CORNER_RADIUS_MAP[fallback];
|
|
538
|
+
const at = (value) => value ? PER_CORNER_RADIUS_MAP[value] : fallbackValue;
|
|
539
|
+
return `${at(cornerRadii.topLeft)} ${at(cornerRadii.topRight)} ${at(cornerRadii.bottomRight)} ${at(cornerRadii.bottomLeft)}`;
|
|
540
|
+
}
|
|
541
|
+
function generateCardCss(options) {
|
|
542
|
+
const { themeId, cardSystem: providedCardSystem, solvedInks } = options;
|
|
543
|
+
const theme = {
|
|
544
|
+
...options.theme,
|
|
545
|
+
buttons: ownedThemeSnapshot(options.theme.buttons)
|
|
546
|
+
};
|
|
547
|
+
const tokens = new TokenResolver(theme);
|
|
548
|
+
const palette = freezeOwnedThemeValue(expandPalette(theme.palette));
|
|
549
|
+
const cardSystem = providedCardSystem ?? generateDefaultCardSystem(theme);
|
|
550
|
+
const source = providedCardSystem ? "site-style" : "generated-baseline";
|
|
551
|
+
const aliasGroups = resolveRoleAliasGroups(theme, providedCardSystem ?? null);
|
|
552
|
+
const cssChunks = [];
|
|
553
|
+
const emittedGroupKeys = /* @__PURE__ */ new Set();
|
|
554
|
+
for (const variant of cardSystem.variants) {
|
|
555
|
+
if (!variant.enabled) continue;
|
|
556
|
+
const groupKey = roleAliasGroupKey(source, variant.id);
|
|
557
|
+
emittedGroupKeys.add(groupKey);
|
|
558
|
+
const aliasClasses = aliasGroups.get(groupKey)?.classes ?? [];
|
|
559
|
+
cssChunks.push(generateVariantCSS(variant, themeId, [`card-${variant.id}`, ...aliasClasses], tokens, theme, palette, solvedInks));
|
|
560
|
+
}
|
|
561
|
+
for (const [groupKey, group] of aliasGroups) {
|
|
562
|
+
if (emittedGroupKeys.has(groupKey)) continue;
|
|
563
|
+
cssChunks.push(generateVariantCSS(group.variant, themeId, group.classes, tokens, theme, palette, solvedInks));
|
|
564
|
+
}
|
|
565
|
+
return cssChunks.filter(Boolean).join("\n\n");
|
|
566
|
+
}
|
|
567
|
+
function roleAliasGroupKey(source, variantId) {
|
|
568
|
+
return `${source}:${variantId}`;
|
|
569
|
+
}
|
|
570
|
+
/**
|
|
571
|
+
* Stable per-theme role aliases (`.card-role-default` and friends), resolved
|
|
572
|
+
* through the fallback chain so compiled content can address a role without
|
|
573
|
+
* knowing which variant id a site style used — or whether it defined one.
|
|
574
|
+
*
|
|
575
|
+
* Aliases are grouped by the variant they resolve to, so an alias shares one
|
|
576
|
+
* rule with that variant rather than duplicating its declarations.
|
|
577
|
+
*/
|
|
578
|
+
function resolveRoleAliasGroups(theme, cardSystem) {
|
|
579
|
+
const groups = /* @__PURE__ */ new Map();
|
|
580
|
+
for (const role of surfaceCardRoleValues) {
|
|
581
|
+
const resolved = resolveCardRole(theme, cardSystem, role);
|
|
582
|
+
if (resolved.kind === "none") continue;
|
|
583
|
+
const groupKey = roleAliasGroupKey(resolved.source, resolved.variant.id);
|
|
584
|
+
const aliasClass = `card-role-${role}`;
|
|
585
|
+
const group = groups.get(groupKey);
|
|
586
|
+
if (group) group.classes.push(aliasClass);
|
|
587
|
+
else groups.set(groupKey, {
|
|
588
|
+
variant: resolved.variant,
|
|
589
|
+
classes: [aliasClass]
|
|
590
|
+
});
|
|
591
|
+
}
|
|
592
|
+
return groups;
|
|
593
|
+
}
|
|
594
|
+
/**
|
|
595
|
+
* Padding map for card content based on spacing semantic values
|
|
596
|
+
*/
|
|
597
|
+
const CONTENT_PADDING_MAP = {
|
|
598
|
+
none: "0",
|
|
599
|
+
compact: "0.75rem",
|
|
600
|
+
cozy: "1rem",
|
|
601
|
+
medium: "1.25rem",
|
|
602
|
+
comfortable: "1.5rem",
|
|
603
|
+
spacious: "2rem"
|
|
604
|
+
};
|
|
605
|
+
/**
|
|
606
|
+
* Corner radius map for card media (top corners only). Match card surface
|
|
607
|
+
* radii rather than button pills so media does not become capsule-clipped.
|
|
608
|
+
*/
|
|
609
|
+
const MEDIA_CORNER_MAP = {
|
|
610
|
+
square: "0",
|
|
611
|
+
soft: "0.5rem",
|
|
612
|
+
rounded: "1rem",
|
|
613
|
+
pill: "1.5rem"
|
|
614
|
+
};
|
|
615
|
+
/**
|
|
616
|
+
* Generate CSS for a single card variant
|
|
617
|
+
*
|
|
618
|
+
* Generates complete CSS for card containers and their children:
|
|
619
|
+
* - Container: background, shadow, corners, border
|
|
620
|
+
* - .card-media: top corners matching container
|
|
621
|
+
* - .card-content: padding based on spacing
|
|
622
|
+
*
|
|
623
|
+
* This CSS-first approach eliminates runtime transforms for styling,
|
|
624
|
+
* keeping transforms only for data normalization and dynamic layout.
|
|
625
|
+
*/
|
|
626
|
+
function generateVariantCSS(variant, themeId, cardClasses, tokens, theme, palette, solvedInks) {
|
|
627
|
+
const selectorsFor = (suffix) => cardClasses.map((cardClass) => `:where([data-theme-scope="${themeId}"]) .${cardClass}.${cardClass}${suffix}`).join(",\n");
|
|
628
|
+
const containerSelectors = cardClasses.map((cardClass) => `:where([data-theme-scope="${themeId}"]) .${cardClass}.${cardClass}`);
|
|
629
|
+
const containerSelector = containerSelectors.join(",\n");
|
|
630
|
+
const mediaSelector = selectorsFor(" .card-media");
|
|
631
|
+
const contentSelector = selectorsFor(" .card-content");
|
|
632
|
+
const fallbackBackgroundSelector = selectorsFor(" > .rb-bg-surface");
|
|
633
|
+
const rules = [];
|
|
634
|
+
rules.push(...cardSurfaceRules(variant, tokens, theme, palette, solvedInks));
|
|
635
|
+
const resolveColor = (token) => tokens.getColor(token);
|
|
636
|
+
rules.push(...cardBorderDeclarations(variant.border ? borderDeclaration(variant.border, tokens) : null, variant.decorations, resolveColor));
|
|
637
|
+
const corners = variant.corners ?? theme.corners;
|
|
638
|
+
const radius = variant.cornerRadii ? resolveCornerRadiiCss(variant.cornerRadii, corners) : CORNER_RADIUS_MAP[corners];
|
|
639
|
+
rules.push(`border-radius: ${radius}`);
|
|
640
|
+
const shadow = variant.shadow ?? theme.shadow;
|
|
641
|
+
if (shadow.elevation !== "none") {
|
|
642
|
+
const shadowValue = generateShadowValue(shadow);
|
|
643
|
+
rules.push(`box-shadow: ${shadowValue}`);
|
|
644
|
+
}
|
|
645
|
+
const structureSelector = cardClasses.map((cardClass) => `:where([data-theme-scope="${themeId}"]) :where(.${cardClass})`).join(",\n");
|
|
646
|
+
const mediaRadius = MEDIA_CORNER_MAP[corners];
|
|
647
|
+
const mediaRules = [`border-top-left-radius: ${mediaRadius}`, `border-top-right-radius: ${mediaRadius}`];
|
|
648
|
+
const contentRules = [`padding: ${resolveContentPadding(variant)}`];
|
|
649
|
+
return [
|
|
650
|
+
`${structureSelector} {\n display: flex;\n flex-direction: column;\n position: relative;\n overflow: visible;\n}`,
|
|
651
|
+
`${containerSelector} {\n ${renderCssDeclarations(rules)}\n}`,
|
|
652
|
+
...cardDecorationPseudoRules(containerSelectors, variant.decorations, resolveColor),
|
|
653
|
+
`${fallbackBackgroundSelector} {\n background: transparent;\n}`,
|
|
654
|
+
`${mediaSelector} {\n ${mediaRules.join(";\n ")};\n}`,
|
|
655
|
+
`${contentSelector} {\n ${contentRules.join(";\n ")};\n}`
|
|
656
|
+
].join("\n\n");
|
|
657
|
+
}
|
|
658
|
+
function cardSurfaceRules(variant, tokens, theme, palette, solvedInks) {
|
|
659
|
+
if (variant.background.type === "transparent") return ["background: transparent"];
|
|
660
|
+
const surface = resolveSurface({
|
|
661
|
+
kind: "paint",
|
|
662
|
+
paint: cardSurfacePaint(variant)
|
|
663
|
+
}, {
|
|
664
|
+
palette,
|
|
665
|
+
buttonSystem: theme.buttons,
|
|
666
|
+
linkHoverToken: theme.typography.proseLinkStyle?.hoverColorToken,
|
|
667
|
+
solvedInks
|
|
668
|
+
});
|
|
669
|
+
return [cardBackgroundRule(variant.background, tokens), ...opaqueSurfaceDeclarations(surface)];
|
|
670
|
+
}
|
|
671
|
+
function cardSurfacePaint(variant) {
|
|
672
|
+
switch (variant.background.type) {
|
|
673
|
+
case "transparent": return { kind: "transparent" };
|
|
674
|
+
case "solid": return {
|
|
675
|
+
kind: "solid",
|
|
676
|
+
token: variant.background.colorToken,
|
|
677
|
+
foregroundToken: variant.foregroundToken
|
|
678
|
+
};
|
|
679
|
+
case "gradient": return {
|
|
680
|
+
kind: "gradient",
|
|
681
|
+
foregroundToken: variant.foregroundToken
|
|
682
|
+
};
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
function cardBackgroundRule(background, tokens) {
|
|
686
|
+
if (background.type === "solid") return `background: ${tokens.getColor(background.colorToken)}`;
|
|
687
|
+
const from = tokens.getColor(background.fromToken);
|
|
688
|
+
const to = tokens.getColor(background.toToken);
|
|
689
|
+
return `background: linear-gradient(${GRADIENT_DIRECTION_MAP[background.direction] || "to right"}, ${from}, ${to})`;
|
|
690
|
+
}
|
|
691
|
+
function borderDeclaration(border, tokens) {
|
|
692
|
+
const borderColor = tokens.getColor(border.colorToken);
|
|
693
|
+
return `border: ${border.widthClass === "border-4" ? "4px" : border.widthClass === "border-2" ? "2px" : border.widthClass === "border" ? "1px" : "1px"} solid ${borderColor}`;
|
|
694
|
+
}
|
|
695
|
+
function paddingFor(spacing) {
|
|
696
|
+
return CONTENT_PADDING_MAP[spacing] || CONTENT_PADDING_MAP.comfortable;
|
|
697
|
+
}
|
|
698
|
+
/** A card's padding: one value for both axes, or one per axis. */
|
|
699
|
+
function resolveContentPadding(variant) {
|
|
700
|
+
const spacing = variant.spacing;
|
|
701
|
+
return typeof spacing === "string" ? paddingFor(spacing) : `${paddingFor(spacing.block)} ${paddingFor(spacing.inline)}`;
|
|
702
|
+
}
|
|
703
|
+
//#endregion
|
|
704
|
+
//#region ../theme-core/src/accordions/defaults.ts
|
|
705
|
+
/**
|
|
706
|
+
* Generate default accordion system based on theme configuration
|
|
707
|
+
*
|
|
708
|
+
* Creates a single accordion style that harmonizes with the theme's
|
|
709
|
+
* visual language (spacing, borders, shadows, colors).
|
|
710
|
+
*/
|
|
711
|
+
function generateDefaultAccordionSystem(theme) {
|
|
712
|
+
const overrides = theme.siteStyleId ? requireCuratedSiteStyle(theme.siteStyleId).themeOverrides?.accordions : void 0;
|
|
713
|
+
if (overrides) return overrides;
|
|
714
|
+
const { axes, space } = theme;
|
|
715
|
+
return {
|
|
716
|
+
background: {
|
|
717
|
+
type: "solid",
|
|
718
|
+
colorToken: "surface"
|
|
403
719
|
},
|
|
404
720
|
spacing: space === "comfortable" ? "comfortable" : space === "dense" ? "compact" : "medium",
|
|
405
721
|
corners: null,
|
|
@@ -2194,77 +2510,26 @@ const NAV_RENDERED_STATES = [
|
|
|
2194
2510
|
function isNavHover(state) {
|
|
2195
2511
|
return state === "hover" || state === "current-hover";
|
|
2196
2512
|
}
|
|
2197
|
-
|
|
2198
|
-
return state === "current" || state === "current-hover";
|
|
2199
|
-
}
|
|
2200
|
-
/** Mirrors the historical emitters: every group writes a base gradient and hover opacity;
|
|
2201
|
-
* active groups additionally write the more specific current-page selector. */
|
|
2513
|
+
/** Project the emitted declarations into the four disjoint nav states. */
|
|
2202
2514
|
function resolveRenderedNavEffects(effects, state) {
|
|
2203
|
-
const
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
"
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
})));
|
|
2212
|
-
const opacity = winner(
|
|
2515
|
+
const current = state === "current" || state === "current-hover";
|
|
2516
|
+
const declarations = resolveEffectApplications(effects).flatMap((application) => {
|
|
2517
|
+
if (application.currentPage && !current) return [];
|
|
2518
|
+
return resolveEffectPaint(application.effect, { background: { type: "transparent" } }).filter((paint) => paint.when === "always" || isNavHover(state)).map((paint) => ({
|
|
2519
|
+
paint,
|
|
2520
|
+
specificity: 1 + Number(application.currentPage) + Number(paint.when === "hover")
|
|
2521
|
+
}));
|
|
2522
|
+
});
|
|
2523
|
+
const text = winner(declarations.filter(({ paint }) => paint.property === "text"));
|
|
2524
|
+
const opacity = winner(declarations.filter(({ paint }) => paint.property === "opacity"));
|
|
2213
2525
|
return {
|
|
2214
|
-
text:
|
|
2215
|
-
opacity: opacity
|
|
2216
|
-
};
|
|
2217
|
-
}
|
|
2218
|
-
function authoredOpacity(effect) {
|
|
2219
|
-
const options = effect.options ?? {};
|
|
2220
|
-
const opacity = effect.effectId === "fade-background" ? Number(options.opacity || 80) / 100 : 1 - Number(options.reduction || 15) / 100;
|
|
2221
|
-
return Number.isFinite(opacity) && opacity >= 0 && opacity <= 1 ? opacity : null;
|
|
2222
|
-
}
|
|
2223
|
-
function textCandidates(app, state) {
|
|
2224
|
-
const gradient = {
|
|
2225
|
-
effect: app.effect,
|
|
2226
|
-
fill: "gradient"
|
|
2227
|
-
};
|
|
2228
|
-
const solid = {
|
|
2229
|
-
effect: app.effect,
|
|
2230
|
-
fill: "solid"
|
|
2231
|
-
};
|
|
2232
|
-
const solidOnHover = app.effect.options?.solidOnHover === true || app.effect.options?.solidOnHover === "true";
|
|
2233
|
-
const hover = isNavHover(state) && solidOnHover ? [{
|
|
2234
|
-
value: solid,
|
|
2235
|
-
specificity: 2
|
|
2236
|
-
}] : [];
|
|
2237
|
-
const currentHover = isNavHover(state) && solidOnHover ? [{
|
|
2238
|
-
value: solid,
|
|
2239
|
-
specificity: 3
|
|
2240
|
-
}] : [];
|
|
2241
|
-
const current = isCurrent(state) && app.group === "active" ? [{
|
|
2242
|
-
value: gradient,
|
|
2243
|
-
specificity: 2
|
|
2244
|
-
}, ...currentHover] : [];
|
|
2245
|
-
return [
|
|
2246
|
-
{
|
|
2247
|
-
value: gradient,
|
|
2248
|
-
specificity: 1
|
|
2249
|
-
},
|
|
2250
|
-
...hover,
|
|
2251
|
-
...current
|
|
2252
|
-
];
|
|
2253
|
-
}
|
|
2254
|
-
function opacityCandidates(app, state) {
|
|
2255
|
-
if (!isNavHover(state)) return [];
|
|
2256
|
-
const current = isCurrent(state) && app.group === "active" ? [{
|
|
2257
|
-
value: app.effect,
|
|
2258
|
-
specificity: 3
|
|
2259
|
-
}] : [];
|
|
2260
|
-
return [{
|
|
2261
|
-
value: app.effect,
|
|
2262
|
-
specificity: 2
|
|
2263
|
-
}, ...current];
|
|
2526
|
+
text: text?.property === "text" ? text : null,
|
|
2527
|
+
opacity: opacity?.property === "opacity" && Number.isFinite(opacity.opacity) && opacity.opacity >= 0 && opacity.opacity <= 1 ? opacity.opacity : null
|
|
2528
|
+
};
|
|
2264
2529
|
}
|
|
2265
2530
|
/** Later declarations win equal specificity, just as they do in the emitted CSS. */
|
|
2266
2531
|
function winner(candidates) {
|
|
2267
|
-
return candidates.reduce((chosen, candidate) => chosen === null || candidate.specificity >= chosen.specificity ? candidate : chosen, null)?.
|
|
2532
|
+
return candidates.reduce((chosen, candidate) => chosen === null || candidate.specificity >= chosen.specificity ? candidate : chosen, null)?.paint ?? null;
|
|
2268
2533
|
}
|
|
2269
2534
|
//#endregion
|
|
2270
2535
|
//#region ../theme-core/src/header/navEffectPaint.ts
|
|
@@ -2328,7 +2593,7 @@ function planText(text, plainInk, state, context) {
|
|
|
2328
2593
|
rules: [],
|
|
2329
2594
|
inks: [plainInk]
|
|
2330
2595
|
};
|
|
2331
|
-
const stops =
|
|
2596
|
+
const stops = text.tokens.map((token) => resolveConcreteColorHex(token, context.palette));
|
|
2332
2597
|
if (decideNavEffectContrast(context.paint, plainInk, {
|
|
2333
2598
|
effect: "gradient-text",
|
|
2334
2599
|
option: stops,
|
|
@@ -2350,15 +2615,6 @@ function planText(text, plainInk, state, context) {
|
|
|
2350
2615
|
} : null)
|
|
2351
2616
|
};
|
|
2352
2617
|
}
|
|
2353
|
-
function renderedTextStops(text, palette) {
|
|
2354
|
-
if (text.fill === "solid") return [resolveConcreteColorHex("neutral-50", palette)];
|
|
2355
|
-
const colors = text.effect.options?.gradientColors;
|
|
2356
|
-
return (typeof colors === "string" && colors ? colors.split(",").map((token) => token.trim()) : [
|
|
2357
|
-
"primary-400",
|
|
2358
|
-
"secondary-400",
|
|
2359
|
-
"accent-400"
|
|
2360
|
-
]).map((token) => resolveConcreteColorHex(token, palette));
|
|
2361
|
-
}
|
|
2362
2618
|
function opacityRules(authored, inks, paint) {
|
|
2363
2619
|
if (authored === null || inks.length === 0 || inks.some((ink) => ink === null)) return [];
|
|
2364
2620
|
const decisions = inks.map((ink) => decideNavEffectContrast(paint, ink, {
|
|
@@ -2389,25 +2645,30 @@ function resolveInk(reference, palette) {
|
|
|
2389
2645
|
//#endregion
|
|
2390
2646
|
//#region ../theme-core/src/header/generateHeaderNavLinkStyles.ts
|
|
2391
2647
|
function generateHeaderNavLinkStyles(header, themeId, tokens, theme, contrastTreatment, navTextSize) {
|
|
2392
|
-
const style =
|
|
2648
|
+
const style = resolvedHeaderNavLinkStyle(header, contrastTreatment, navTextSize);
|
|
2393
2649
|
if (!style) {
|
|
2394
2650
|
console.warn(`[generateHeaderCss] Nav link preset not found: ${header.navStyle}`);
|
|
2395
2651
|
return "";
|
|
2396
2652
|
}
|
|
2397
|
-
const renderedStyle = mergeHeaderNavTypographyPreference(style, {
|
|
2398
|
-
typography: header.navFontRole ?? "inherit",
|
|
2399
|
-
fontSize: readHeaderNavFontSizePreference(header.navTextSize),
|
|
2400
|
-
interactionPalette: header.interactionPalette ?? "recommended"
|
|
2401
|
-
});
|
|
2402
2653
|
return generateNavLinkCSS({
|
|
2403
2654
|
themeId,
|
|
2404
2655
|
tokens,
|
|
2405
2656
|
theme,
|
|
2406
|
-
style
|
|
2657
|
+
style,
|
|
2407
2658
|
className: "header-nav-link",
|
|
2408
2659
|
surfaceDependent: true,
|
|
2409
2660
|
surfaceRestingColor: header.background?.contentOwner === siteChromeBackgroundOverrideOwner
|
|
2410
|
-
}) + generateHeaderNavEffectContrastCss(header,
|
|
2661
|
+
}) + generateHeaderNavEffectContrastCss(header, style, theme, themeId);
|
|
2662
|
+
}
|
|
2663
|
+
/** The top-level nav link style as it renders, with the owner's font role and size preferences applied. */
|
|
2664
|
+
function resolvedHeaderNavLinkStyle(header, contrastTreatment, navTextSize) {
|
|
2665
|
+
const style = effectiveHeaderNavLinkStyle(header, contrastTreatment, navTextSize);
|
|
2666
|
+
if (!style) return null;
|
|
2667
|
+
return mergeHeaderNavTypographyPreference(style, {
|
|
2668
|
+
typography: header.navFontRole ?? "inherit",
|
|
2669
|
+
fontSize: readHeaderNavFontSizePreference(header.navTextSize),
|
|
2670
|
+
interactionPalette: header.interactionPalette ?? "recommended"
|
|
2671
|
+
});
|
|
2411
2672
|
}
|
|
2412
2673
|
//#endregion
|
|
2413
2674
|
//#region ../theme-core/src/header/generateHeaderLogoStyles.ts
|
|
@@ -2479,7 +2740,8 @@ function generateHeaderCss(options) {
|
|
|
2479
2740
|
cssChunks.push(generateHeaderNavLinkStyles(header, themeId, tokens, theme, headerContrastTreatment, headerNavTextSize));
|
|
2480
2741
|
const dropdown = resolveDropdownSurface(header, theme, tokens, solvedInks);
|
|
2481
2742
|
cssChunks.push(generateDropdownContainerStyles(themeId, tokens, dropdown));
|
|
2482
|
-
|
|
2743
|
+
const navLinkStyle = resolvedHeaderNavLinkStyle(header, headerContrastTreatment, headerNavTextSize);
|
|
2744
|
+
cssChunks.push(generateDropdownLinkStyles(header, themeId, tokens, theme, dropdown, navLinkStyle));
|
|
2483
2745
|
cssChunks.push(generateDropdownCaretStyles(themeId));
|
|
2484
2746
|
cssChunks.push(generateDropdownTriggerOverrides(header, themeId));
|
|
2485
2747
|
cssChunks.push(generateMobilePanelStyles(themeId, dropdown));
|
|
@@ -2608,16 +2870,37 @@ function dropdownLinkEffects({ linkFill, linkText }, state) {
|
|
|
2608
2870
|
options: { hoverColorToken: text }
|
|
2609
2871
|
}] : []];
|
|
2610
2872
|
}
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2873
|
+
/**
|
|
2874
|
+
* The type the menu takes from the nav links above it: font, case and letter spacing follow the nav,
|
|
2875
|
+
* unless the header Look gives the menu its own case or spacing.
|
|
2876
|
+
*/
|
|
2877
|
+
function dropdownTypeFromNav(style, navLinkStyle) {
|
|
2878
|
+
const nav = navLinkStyle ?? {
|
|
2616
2879
|
typography: "body",
|
|
2617
|
-
|
|
2618
|
-
|
|
2880
|
+
textTransform: "none",
|
|
2881
|
+
letterSpacing: void 0
|
|
2882
|
+
};
|
|
2883
|
+
const ownCase = dropdownOwnCase(style);
|
|
2884
|
+
const followsNavSpacing = (style?.letterSpacing ?? "normal") === "normal";
|
|
2885
|
+
return {
|
|
2886
|
+
typography: nav.typography,
|
|
2887
|
+
textTransform: ownCase ?? nav.textTransform ?? "none",
|
|
2888
|
+
...followsNavSpacing && nav.letterSpacing ? { letterSpacing: nav.letterSpacing } : {}
|
|
2889
|
+
};
|
|
2890
|
+
}
|
|
2891
|
+
/** The case a header Look gives the menu itself, or null when the menu follows the nav. */
|
|
2892
|
+
function dropdownOwnCase(style) {
|
|
2893
|
+
const textTransform = style?.textTransform ?? "none";
|
|
2894
|
+
return textTransform === "none" ? null : textTransform;
|
|
2895
|
+
}
|
|
2896
|
+
/** The menu's links set in the nav links' type; size and weight stay the menu's. */
|
|
2897
|
+
function dropdownNavLinkStyle(header, surface, navLinkStyle) {
|
|
2898
|
+
return {
|
|
2899
|
+
name: "Dropdown",
|
|
2900
|
+
...dropdownTypeFromNav(surface.style, navLinkStyle),
|
|
2901
|
+
fontWeight: surface.style?.fontWeight ?? header.navWeight ?? "medium",
|
|
2619
2902
|
italic: false,
|
|
2620
|
-
colorToken: textToken,
|
|
2903
|
+
colorToken: surface.textToken,
|
|
2621
2904
|
padding: "compact",
|
|
2622
2905
|
borderRadius: "sm",
|
|
2623
2906
|
effects: {
|
|
@@ -2641,12 +2924,12 @@ function dropdownTypographyRules(style) {
|
|
|
2641
2924
|
};
|
|
2642
2925
|
return [...letterSpacing === "normal" ? [] : [`letter-spacing: ${spacing[letterSpacing]};`], `font-size: ${sizes[style?.textSize ?? "sm"]};`];
|
|
2643
2926
|
}
|
|
2644
|
-
function generateDropdownLinkStyles(header, themeId, tokens, theme, surface) {
|
|
2927
|
+
function generateDropdownLinkStyles(header, themeId, tokens, theme, surface, navLinkStyle) {
|
|
2645
2928
|
return generateNavLinkCSS({
|
|
2646
2929
|
themeId,
|
|
2647
2930
|
tokens,
|
|
2648
2931
|
theme,
|
|
2649
|
-
style: dropdownNavLinkStyle(header, surface),
|
|
2932
|
+
style: dropdownNavLinkStyle(header, surface, navLinkStyle),
|
|
2650
2933
|
className: "nav-dropdown-link"
|
|
2651
2934
|
}) + `\n${`:where([data-theme-scope="${themeId}"]) .nav-dropdown-link`} {\n ${dropdownTypographyRules(surface.style).join("\n ")}\n}\n`;
|
|
2652
2935
|
}
|
|
@@ -2944,6 +3227,11 @@ const waveMaskSvgPaths = {
|
|
|
2944
3227
|
*/
|
|
2945
3228
|
const arcShapePath = "M0 110V60Q720 -30 1440 60V110Z";
|
|
2946
3229
|
const arcEchoLinePaths = ["M0 84Q720 -6 1440 84", "M0 102Q720 12 1440 102"];
|
|
3230
|
+
/** The arc turned over: the next section's colour sits lowest in the middle, under the swell of the section above. */
|
|
3231
|
+
const arcBulgeShapePath = "M0 110V50Q720 140 1440 50V110Z";
|
|
3232
|
+
function arcBulgeMaskDataUrl() {
|
|
3233
|
+
return svgDataUrl(`<svg viewBox='0 0 1440 110' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'><path d='${arcBulgeShapePath}' fill='white'/></svg>`);
|
|
3234
|
+
}
|
|
2947
3235
|
function arcMaskDataUrl(echo) {
|
|
2948
3236
|
const lines = arcEchoLinePaths.map((d) => `<path d='${d}' fill='none' stroke='url(#fade)' stroke-width='1.5' vector-effect='non-scaling-stroke'/>`).join("");
|
|
2949
3237
|
return svgDataUrl(`<svg viewBox='0 0 1440 110' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'>${echo ? `<defs><linearGradient id='fade' gradientUnits='userSpaceOnUse' x1='0' y1='0' x2='1440' y2='0'><stop offset='0' stop-color='black' stop-opacity='0.42'/><stop offset='0.5' stop-color='black' stop-opacity='0'/><stop offset='1' stop-color='black' stop-opacity='0.42'/></linearGradient><mask id='lines'><rect width='1440' height='110' fill='white'/>${lines}</mask></defs><path d='${arcShapePath}' fill='white' mask='url(#lines)'/>` : `<path d='${arcShapePath}' fill='white'/>`}</svg>`);
|
|
@@ -3052,7 +3340,7 @@ function shapeDeclarations(entry) {
|
|
|
3052
3340
|
"background: linear-gradient(to bottom, transparent 0%, color-mix(in srgb, var(--boundary-shape-paint) 16%, transparent) 34%, color-mix(in srgb, var(--boundary-shape-paint) 68%, transparent) 78%, var(--boundary-shape-paint) 100%);"
|
|
3053
3341
|
];
|
|
3054
3342
|
case "wave": return maskDeclarations(waveMaskDataUrl(entry.shape.mask));
|
|
3055
|
-
case "arc": return [...maskDeclarations(arcMaskDataUrl(entry.shape.echo === true)), "height: calc(var(--boundary-height) + 2px);"];
|
|
3343
|
+
case "arc": return [...maskDeclarations(entry.shape.bulge ? arcBulgeMaskDataUrl() : arcMaskDataUrl(entry.shape.echo === true)), "height: calc(var(--boundary-height) + 2px);"];
|
|
3056
3344
|
case "angle": return [
|
|
3057
3345
|
"height: calc(var(--boundary-height) + 2px);",
|
|
3058
3346
|
"background: var(--boundary-shape-paint);",
|
|
@@ -3133,21 +3421,46 @@ function generateHeroTypographyCss(themeId, theme) {
|
|
|
3133
3421
|
if (microSubheadlineRules.length > 0) chunks.push(`${microSubheadlineSelector} {\n ${microSubheadlineRules.join("\n ")}\n}`);
|
|
3134
3422
|
const selectors = {
|
|
3135
3423
|
headline: headlineSelector,
|
|
3136
|
-
subheadline: subheadlineSelector
|
|
3424
|
+
subheadline: subheadlineSelector,
|
|
3425
|
+
microHeadline: microHeadlineSelector,
|
|
3426
|
+
microSubheadline: microSubheadlineSelector
|
|
3137
3427
|
};
|
|
3138
|
-
const
|
|
3428
|
+
const microSizes = {
|
|
3429
|
+
headlineSize: typography.microHeadlineSize,
|
|
3430
|
+
subheadlineSize: typography.microSubheadlineSize
|
|
3431
|
+
};
|
|
3432
|
+
const responsiveChunks = [responsiveHeroTypographyCss(MQ_TABLET_ONLY, selectors, typography.responsive?.tablet, microSizes), responsiveHeroTypographyCss(MQ_SM_DOWN, selectors, typography.responsive?.mobile, microSizes)];
|
|
3139
3433
|
for (const chunk of responsiveChunks) if (chunk) chunks.push(chunk);
|
|
3140
3434
|
return chunks.join("\n\n");
|
|
3141
3435
|
}
|
|
3142
|
-
function responsiveHeroTypographyCss(media, selectors, overrides) {
|
|
3436
|
+
function responsiveHeroTypographyCss(media, selectors, overrides, microSizes) {
|
|
3143
3437
|
if (!overrides) return null;
|
|
3144
3438
|
const headlineRules = buildTypographyRules("headline", overrides.headlineSize, overrides.headlineLineHeight);
|
|
3145
3439
|
const subheadlineRules = buildTypographyRules("subheadline", overrides.subheadlineSize, overrides.subheadlineLineHeight);
|
|
3146
3440
|
const mediaChunks = [];
|
|
3147
3441
|
if (headlineRules.length > 0) mediaChunks.push(`${selectors.headline} {\n ${headlineRules.join("\n ")}\n }`);
|
|
3148
3442
|
if (subheadlineRules.length > 0) mediaChunks.push(`${selectors.subheadline} {\n ${subheadlineRules.join("\n ")}\n }`);
|
|
3443
|
+
const microHeadlineSize = microSizeAtBreakpoint(microSizes.headlineSize, overrides.headlineSize);
|
|
3444
|
+
if (microHeadlineSize) {
|
|
3445
|
+
const rules = buildTypographyRules("headline", microHeadlineSize, overrides.headlineLineHeight);
|
|
3446
|
+
mediaChunks.push(`${selectors.microHeadline} {\n ${rules.join("\n ")}\n }`);
|
|
3447
|
+
}
|
|
3448
|
+
const microSubheadlineSize = microSizeAtBreakpoint(microSizes.subheadlineSize, overrides.subheadlineSize);
|
|
3449
|
+
if (microSubheadlineSize) {
|
|
3450
|
+
const rules = buildTypographyRules("subheadline", microSubheadlineSize, overrides.subheadlineLineHeight);
|
|
3451
|
+
mediaChunks.push(`${selectors.microSubheadline} {\n ${rules.join("\n ")}\n }`);
|
|
3452
|
+
}
|
|
3149
3453
|
return mediaChunks.length > 0 ? `@media ${media} {\n ${mediaChunks.join("\n\n ")}\n}` : null;
|
|
3150
3454
|
}
|
|
3455
|
+
/**
|
|
3456
|
+
* A micro hero steps down to the breakpoint's size, but a micro size that's
|
|
3457
|
+
* already smaller stays as it is. The editorial size is fluid, so it needs no step.
|
|
3458
|
+
*/
|
|
3459
|
+
function microSizeAtBreakpoint(microSize, breakpointSize) {
|
|
3460
|
+
if (!microSize || !breakpointSize || microSize === "editorial") return void 0;
|
|
3461
|
+
if (breakpointSize === "editorial") return breakpointSize;
|
|
3462
|
+
return HERO_SIZE_ORDER.indexOf(breakpointSize) < HERO_SIZE_ORDER.indexOf(microSize) ? breakpointSize : void 0;
|
|
3463
|
+
}
|
|
3151
3464
|
function buildTypographyRules(role, size, lineHeight) {
|
|
3152
3465
|
const rules = [];
|
|
3153
3466
|
if (size) rules.push(`font-size: ${toHeroSize(role, size)};`);
|
|
@@ -3171,6 +3484,17 @@ function generateBodyTextTypographyCss(themeId, theme) {
|
|
|
3171
3484
|
}`);
|
|
3172
3485
|
return chunks.join("\n\n");
|
|
3173
3486
|
}
|
|
3487
|
+
const HERO_SIZE_ORDER = [
|
|
3488
|
+
"sm",
|
|
3489
|
+
"base",
|
|
3490
|
+
"lg",
|
|
3491
|
+
"xl",
|
|
3492
|
+
"2xl",
|
|
3493
|
+
"3xl",
|
|
3494
|
+
"4xl",
|
|
3495
|
+
"5xl",
|
|
3496
|
+
"6xl"
|
|
3497
|
+
];
|
|
3174
3498
|
function toHeroSize(role, size) {
|
|
3175
3499
|
const baseMap = {
|
|
3176
3500
|
sm: "0.875rem",
|
|
@@ -3620,707 +3944,391 @@ function buildThemeCssVars(theme) {
|
|
|
3620
3944
|
...typography.headings.h2.colorToken ? { ["--hc-h2"]: rgbColorValue(typography.headings.h2.colorToken) } : {},
|
|
3621
3945
|
...typography.headings.h3.colorToken ? { ["--hc-h3"]: rgbColorValue(typography.headings.h3.colorToken) } : {},
|
|
3622
3946
|
...typography.headings.h4?.colorToken ? { ["--hc-h4"]: rgbColorValue(typography.headings.h4.colorToken) } : {},
|
|
3623
|
-
...typography.headings.h5?.colorToken ? { ["--hc-h5"]: rgbColorValue(typography.headings.h5.colorToken) } : {},
|
|
3624
|
-
...typography.headings.h6?.colorToken ? { ["--hc-h6"]: rgbColorValue(typography.headings.h6.colorToken) } : {},
|
|
3625
|
-
...proseLinkStyleToCssVars(typography.proseLinkStyle),
|
|
3626
|
-
["--fs-body"]: sized.body,
|
|
3627
|
-
["--fs-h3"]: sized.h3,
|
|
3628
|
-
["--fs-h2"]: sized.h2,
|
|
3629
|
-
["--fs-h1"]: sized.h1,
|
|
3630
|
-
["--fs-h1-fluid"]: sized.h1Fluid,
|
|
3631
|
-
["--fs-h2-fluid"]: sized.h2Fluid,
|
|
3632
|
-
["--fs-h3-fluid"]: sized.h3Fluid,
|
|
3633
|
-
["--fs-h1-display"]: sized.h1Display,
|
|
3634
|
-
["--fs-h1-display-fluid"]: sized.h1DisplayFluid,
|
|
3635
|
-
["--shadow-elev"]: mapShadow(shadow.elevation, shadow.softness, shadow.position || "bottom", shadow.colorToken),
|
|
3636
|
-
["--space-mult"]: mapSpaceMult(space),
|
|
3637
|
-
["--motion-duration"]: mapMotionDuration(motion.level),
|
|
3638
|
-
["--motion-ease"]: mapMotionEasing(motion.easing ?? "standard"),
|
|
3639
|
-
["--rt-space-y"]: mapRhythm(space),
|
|
3640
|
-
[THEME_RADIUS_CSS_VARS.block]: blockRadius,
|
|
3641
|
-
[THEME_RADIUS_CSS_VARS.panel]: panelRadius,
|
|
3642
|
-
["--rb-block-transition"]: mapBlockTransition(motion.level),
|
|
3643
|
-
[THEME_RADIUS_CSS_VARS.button]: buttonRadius,
|
|
3644
|
-
["--rb-border-width"]: mapBorderWidth(border.width),
|
|
3645
|
-
["--rb-border-style"]: mapBorderStyle(border.style),
|
|
3646
|
-
[THEME_RADIUS_CSS_VARS.input]: inputRadius,
|
|
3647
|
-
["--rb-input-focus-width"]: `${inputSystem.focus.ringWidth}px`,
|
|
3648
|
-
["--rb-input-focus-color"]: rgbColorValue(inputSystem.focus.ringColorToken),
|
|
3649
|
-
[THEME_RADIUS_CSS_VARS.legacyCard]: blockRadius,
|
|
3650
|
-
[THEME_RADIUS_CSS_VARS.legacyControl]: inputRadius
|
|
3651
|
-
};
|
|
3652
|
-
}
|
|
3653
|
-
/** Font roles use one formatter and weight mapping; absent small headings add no variables. */
|
|
3654
|
-
function typographyFontRoleCssVars(typography) {
|
|
3655
|
-
return {
|
|
3656
|
-
"--font-heading": formatFontFamily(typography.headings.default.family),
|
|
3657
|
-
"--font-body": formatFontFamily(typography.body.family),
|
|
3658
|
-
...typography.smallHeading ? {
|
|
3659
|
-
"--font-small-heading": formatFontFamily(typography.smallHeading.family),
|
|
3660
|
-
"--fw-small-heading": mapWeight(typography.smallHeading.weight)
|
|
3661
|
-
} : {}
|
|
3662
|
-
};
|
|
3663
|
-
}
|
|
3664
|
-
function mapWeight(w) {
|
|
3665
|
-
return {
|
|
3666
|
-
light: 300,
|
|
3667
|
-
regular: 400,
|
|
3668
|
-
medium: 500,
|
|
3669
|
-
semibold: 600,
|
|
3670
|
-
bold: 700
|
|
3671
|
-
}[w];
|
|
3672
|
-
}
|
|
3673
|
-
function mapShadow(level, softness, position = "bottom", colorToken) {
|
|
3674
|
-
if (level === "none") return "none";
|
|
3675
|
-
const tintVar = colorToken ? cssVarValue(colorToken) : null;
|
|
3676
|
-
const shadowColor = (a) => tintVar ? `rgb(${tintVar} / ${a})` : `rgba(0,0,0,${a})`;
|
|
3677
|
-
const offset = {
|
|
3678
|
-
low: 2,
|
|
3679
|
-
medium: 4,
|
|
3680
|
-
high: 6
|
|
3681
|
-
}[level];
|
|
3682
|
-
const xOffset = position === "bottom-right" ? offset : 0;
|
|
3683
|
-
if (softness === "hard") return `${xOffset}px ${offset}px 0 0 ${shadowColor("1")}`;
|
|
3684
|
-
const soft = softness !== "crisp";
|
|
3685
|
-
switch (level) {
|
|
3686
|
-
case "low": return soft ? `${xOffset}px 1px 2px ${shadowColor(".06")}` : `${xOffset}px 1px 1px ${shadowColor(".12")}`;
|
|
3687
|
-
case "medium": return soft ? `${xOffset}px 10px 20px ${shadowColor(".08")}` : `${xOffset}px 6px 12px ${shadowColor(".16")}`;
|
|
3688
|
-
case "high": return soft ? `${xOffset}px 25px 50px ${shadowColor(".18")}` : `${xOffset}px 20px 30px ${shadowColor(".28")}`;
|
|
3689
|
-
}
|
|
3690
|
-
}
|
|
3691
|
-
function mapSpaceMult(space) {
|
|
3692
|
-
return {
|
|
3693
|
-
comfortable: 1.15,
|
|
3694
|
-
standard: 1,
|
|
3695
|
-
dense: .88
|
|
3696
|
-
}[space];
|
|
3697
|
-
}
|
|
3698
|
-
function mapRhythm(space) {
|
|
3699
|
-
switch (space) {
|
|
3700
|
-
case "comfortable": return "1.2rem";
|
|
3701
|
-
case "dense": return "0.75rem";
|
|
3702
|
-
default: return "1rem";
|
|
3703
|
-
}
|
|
3704
|
-
}
|
|
3705
|
-
function mapMotionDuration(level) {
|
|
3706
|
-
return {
|
|
3707
|
-
off: "0ms",
|
|
3708
|
-
low: "120ms",
|
|
3709
|
-
medium: "180ms",
|
|
3710
|
-
high: "250ms"
|
|
3711
|
-
}[level];
|
|
3712
|
-
}
|
|
3713
|
-
function mapMotionEasing(e) {
|
|
3714
|
-
return {
|
|
3715
|
-
standard: "cubic-bezier(.2,.8,.2,1)",
|
|
3716
|
-
snappy: "cubic-bezier(.2,1,.2,1)",
|
|
3717
|
-
gentle: "cubic-bezier(.15,.85,.15,1)"
|
|
3718
|
-
}[e];
|
|
3719
|
-
}
|
|
3720
|
-
/**
|
|
3721
|
-
* Map corner style to block radius CSS value.
|
|
3722
|
-
* These are Tier 2 vars used consistently across blocks. The pill token is
|
|
3723
|
-
* intentionally capped for block surfaces: buttons can be fully pill-shaped,
|
|
3724
|
-
* but cards/panels with real content should not become capsules.
|
|
3725
|
-
*/
|
|
3726
|
-
function mapBlockRadius(corners) {
|
|
3727
|
-
return {
|
|
3728
|
-
square: "0",
|
|
3729
|
-
soft: "0.5rem",
|
|
3730
|
-
rounded: "0.75rem",
|
|
3731
|
-
pill: "1rem"
|
|
3732
|
-
}[corners];
|
|
3733
|
-
}
|
|
3734
|
-
/**
|
|
3735
|
-
* Map corner style to large-panel radius CSS value (Tier 2 `--rb-panel-radius`).
|
|
3736
|
-
* Derived from the same `corners` enum, one step more generous than the
|
|
3737
|
-
* block/card radius so large surfaces can carry a softer corner without a new
|
|
3738
|
-
* schema field. `rounded` lands on 20px (1.25rem), matching the physio mockup's
|
|
3739
|
-
* large-panel radius.
|
|
3740
|
-
*/
|
|
3741
|
-
function mapPanelRadius(corners) {
|
|
3742
|
-
return {
|
|
3743
|
-
square: "0",
|
|
3744
|
-
soft: "0.75rem",
|
|
3745
|
-
rounded: "1.25rem",
|
|
3746
|
-
pill: "2rem"
|
|
3747
|
-
}[corners];
|
|
3748
|
-
}
|
|
3749
|
-
/**
|
|
3750
|
-
* Map motion level to block transition duration.
|
|
3751
|
-
* These are Tier 2 vars used consistently across blocks.
|
|
3752
|
-
*/
|
|
3753
|
-
function mapBlockTransition(level) {
|
|
3754
|
-
return {
|
|
3755
|
-
off: "0ms",
|
|
3756
|
-
low: "120ms",
|
|
3757
|
-
medium: "150ms",
|
|
3758
|
-
high: "200ms"
|
|
3759
|
-
}[level];
|
|
3760
|
-
}
|
|
3761
|
-
/**
|
|
3762
|
-
* Map corner style to button radius CSS value.
|
|
3763
|
-
* Uses Tailwind-style button radius values that match the button system.
|
|
3764
|
-
* - square/soft → rounded-md (0.375rem) for subtle rounding
|
|
3765
|
-
* - rounded → rounded-lg (0.5rem) for moderate rounding
|
|
3766
|
-
* - pill → rounded-full (9999px) for pill shape
|
|
3767
|
-
*/
|
|
3768
|
-
function mapButtonRadius(corners) {
|
|
3769
|
-
return {
|
|
3770
|
-
square: "0.375rem",
|
|
3771
|
-
soft: "0.375rem",
|
|
3772
|
-
rounded: "0.5rem",
|
|
3773
|
-
pill: "9999px"
|
|
3774
|
-
}[corners];
|
|
3775
|
-
}
|
|
3776
|
-
function mapBorderWidth(width) {
|
|
3777
|
-
switch (width) {
|
|
3778
|
-
case "none": return "0px";
|
|
3779
|
-
case "thick": return "2px";
|
|
3780
|
-
default: return "1px";
|
|
3781
|
-
}
|
|
3782
|
-
}
|
|
3783
|
-
function mapBorderStyle(style) {
|
|
3784
|
-
return style;
|
|
3785
|
-
}
|
|
3786
|
-
function proseLinkStyleToCssVars(style) {
|
|
3787
|
-
if (!style) return {};
|
|
3788
|
-
return {
|
|
3789
|
-
...style.colorToken ? { ["--rb-prose-link-color"]: rgbColorValue(style.colorToken) } : {},
|
|
3790
|
-
...style.hoverColorToken ? { ["--rb-prose-link-hover-color"]: rgbColorValue(style.hoverColorToken) } : {},
|
|
3791
|
-
...style.decorationColorToken ? { ["--rb-prose-link-decoration-color"]: rgbColorValue(style.decorationColorToken) } : {},
|
|
3792
|
-
...style.hoverDecorationColorToken ? { ["--rb-prose-link-hover-decoration-color"]: rgbColorValue(style.hoverDecorationColorToken) } : {},
|
|
3793
|
-
...style.underline != null ? { ["--rb-prose-link-decoration-line"]: style.underline ? "underline" : "none" } : {},
|
|
3794
|
-
...style.underlineStyle ? { ["--rb-prose-link-underline-style"]: style.underlineStyle } : {},
|
|
3795
|
-
...style.underlineThickness ? { ["--rb-prose-link-underline-thickness"]: mapProseLinkUnderlineThickness(style.underlineThickness) } : {},
|
|
3796
|
-
...style.underlineOffset ? { ["--rb-prose-link-underline-offset"]: mapProseLinkUnderlineOffset(style.underlineOffset) } : {}
|
|
3797
|
-
};
|
|
3798
|
-
}
|
|
3799
|
-
/**
|
|
3800
|
-
* Generate structured block override CSS (separate from blockCustomVars).
|
|
3801
|
-
* This handles typed theme overrides, while blockCustomVars remains raw var passthrough.
|
|
3802
|
-
*/
|
|
3803
|
-
function generateBlockOverrideCss(themeId, theme) {
|
|
3804
|
-
const overrides = theme.blockOverrides;
|
|
3805
|
-
if (!overrides) return "";
|
|
3806
|
-
const cssBlocks = [];
|
|
3807
|
-
for (const [blockKind, blockOverride] of Object.entries(overrides)) {
|
|
3808
|
-
const blockSelectorKind = normalizeBlockKind(blockKind);
|
|
3809
|
-
const proseVars = proseLinkStyleToCssVars(blockOverride.typography?.proseLinkStyle);
|
|
3810
|
-
const declarations = Object.entries(proseVars).map(([key, value]) => ` ${key}: ${String(value)};`).join("\n");
|
|
3811
|
-
if (!declarations) continue;
|
|
3812
|
-
cssBlocks.push(`:where([data-theme-scope="${escapeAttrValue(themeId)}"]) :where([data-block="${escapeAttrValue(blockSelectorKind)}"]) {\n${declarations}\n}`);
|
|
3813
|
-
}
|
|
3814
|
-
return cssBlocks.join("\n");
|
|
3815
|
-
}
|
|
3816
|
-
function escapeAttrValue(value) {
|
|
3817
|
-
return value.replace(/\\/g, "\\\\").replace(/"/g, "\\\"");
|
|
3818
|
-
}
|
|
3819
|
-
function mapProseLinkUnderlineThickness(value) {
|
|
3820
|
-
switch (value) {
|
|
3821
|
-
case "fromFont": return "from-font";
|
|
3822
|
-
case "thin": return "1px";
|
|
3823
|
-
case "medium": return "2px";
|
|
3824
|
-
case "thick": return "3px";
|
|
3825
|
-
default: return "auto";
|
|
3826
|
-
}
|
|
3827
|
-
}
|
|
3828
|
-
function mapProseLinkUnderlineOffset(value) {
|
|
3829
|
-
switch (value) {
|
|
3830
|
-
case "tight": return "0.08em";
|
|
3831
|
-
case "loose": return "0.2em";
|
|
3832
|
-
case "normal": return "0.14em";
|
|
3833
|
-
default: return "auto";
|
|
3834
|
-
}
|
|
3835
|
-
}
|
|
3836
|
-
/**
|
|
3837
|
-
* Map input corners to CSS radius value for tier-2 input variables.
|
|
3838
|
-
* Falls back to theme corners if inputCorners is null.
|
|
3839
|
-
*/
|
|
3840
|
-
function mapInputRadius(inputCorners, themeFallback) {
|
|
3841
|
-
switch (inputCorners ?? themeFallback) {
|
|
3842
|
-
case "square": return "0";
|
|
3843
|
-
case "soft": return "0.25rem";
|
|
3844
|
-
case "rounded": return "0.5rem";
|
|
3845
|
-
case "pill": return "9999px";
|
|
3846
|
-
default: return "0.375rem";
|
|
3847
|
-
}
|
|
3848
|
-
}
|
|
3849
|
-
/**
|
|
3850
|
-
* Normalize scale name to handle both old and new naming conventions.
|
|
3851
|
-
* Old names (minorThird, majorThird, perfectFourth) map to new names (compact, balanced, spacious).
|
|
3852
|
-
*/
|
|
3853
|
-
function normalizeScaleName(scale) {
|
|
3854
|
-
return {
|
|
3855
|
-
minorThird: "compact",
|
|
3856
|
-
majorThird: "balanced",
|
|
3857
|
-
perfectFourth: "spacious",
|
|
3858
|
-
compact: "compact",
|
|
3859
|
-
balanced: "balanced",
|
|
3860
|
-
spacious: "spacious"
|
|
3861
|
-
}[scale] ?? "balanced";
|
|
3862
|
-
}
|
|
3863
|
-
/**
|
|
3864
|
-
* Compute base type scale sizes for headings.
|
|
3865
|
-
* Returns both static sizes and min/max for fluid typography.
|
|
3866
|
-
*/
|
|
3867
|
-
function computeTypeScale(scale, bodySize) {
|
|
3868
|
-
const base = {
|
|
3869
|
-
md: 16,
|
|
3870
|
-
lg: 17,
|
|
3871
|
-
xl: 18
|
|
3872
|
-
}[bodySize];
|
|
3873
|
-
const ratio = {
|
|
3874
|
-
compact: 1.2,
|
|
3875
|
-
balanced: 1.25,
|
|
3876
|
-
spacious: 1.333
|
|
3877
|
-
}[normalizeScaleName(scale)];
|
|
3878
|
-
const h3 = Math.round(base * ratio);
|
|
3879
|
-
const h2 = Math.round(h3 * ratio);
|
|
3880
|
-
const h1 = Math.round(h2 * ratio);
|
|
3881
|
-
const fluidMin = .7;
|
|
3882
|
-
const h2FluidMin = .9;
|
|
3883
|
-
const fluidMax = 1.3;
|
|
3884
|
-
return {
|
|
3885
|
-
["--fs-body"]: `${base}px`,
|
|
3886
|
-
["--fs-h3"]: `${h3}px`,
|
|
3887
|
-
["--fs-h2"]: `${h2}px`,
|
|
3888
|
-
["--fs-h1"]: `${h1}px`,
|
|
3889
|
-
["--fs-h1-min"]: `${Math.round(h1 * fluidMin)}px`,
|
|
3890
|
-
["--fs-h1-max"]: `${Math.round(h1 * fluidMax)}px`,
|
|
3891
|
-
["--fs-h2-min"]: `${Math.round(h2 * h2FluidMin)}px`,
|
|
3892
|
-
["--fs-h2-max"]: `${Math.round(h2 * fluidMax)}px`,
|
|
3893
|
-
["--fs-h3-min"]: `${Math.round(h3 * fluidMin)}px`,
|
|
3894
|
-
["--fs-h3-max"]: `${Math.round(h3 * fluidMax)}px`,
|
|
3895
|
-
["--fs-h1-fluid"]: `clamp(${Math.round(h1 * fluidMin)}px, calc(${Math.round(h1 * fluidMin)}px + ${Math.round(h1 * (fluidMax - fluidMin))} * ((100vw - 320px) / 880)), ${Math.round(h1 * fluidMax)}px)`,
|
|
3896
|
-
["--fs-h2-fluid"]: `clamp(${Math.round(h2 * h2FluidMin)}px, calc(${Math.round(h2 * h2FluidMin)}px + ${Math.round(h2 * (fluidMax - h2FluidMin))} * ((100vw - 320px) / 880)), ${Math.round(h2 * fluidMax)}px)`,
|
|
3897
|
-
["--fs-h3-fluid"]: `clamp(${Math.round(h3 * fluidMin)}px, calc(${Math.round(h3 * fluidMin)}px + ${Math.round(h3 * (fluidMax - fluidMin))} * ((100vw - 320px) / 880)), ${Math.round(h3 * fluidMax)}px)`,
|
|
3898
|
-
["--fs-h1-display"]: `${Math.round(h1 * 1.5)}px`,
|
|
3899
|
-
["--fs-h1-display-fluid"]: `clamp(${Math.round(h1 * fluidMin * 1.5)}px, calc(${Math.round(h1 * fluidMin * 1.5)}px + ${Math.round(h1 * (fluidMax - fluidMin) * 1.5)} * ((100vw - 320px) / 880)), ${Math.round(h1 * fluidMax * 1.5)}px)`
|
|
3900
|
-
};
|
|
3901
|
-
}
|
|
3902
|
-
/**
|
|
3903
|
-
* Size scale multipliers for heading size overrides.
|
|
3904
|
-
* Expanded from md/lg/xl to xs through 2xl for finer control.
|
|
3905
|
-
*/
|
|
3906
|
-
const SIZE_SCALE_MAP = {
|
|
3907
|
-
xs: .85,
|
|
3908
|
-
sm: .925,
|
|
3909
|
-
md: 1,
|
|
3910
|
-
lg: 1.1,
|
|
3911
|
-
xl: 1.2,
|
|
3912
|
-
"2xl": 1.35
|
|
3913
|
-
};
|
|
3914
|
-
function applyHeadingSizeOverrides(base, typography) {
|
|
3915
|
-
const body = base["--fs-body"];
|
|
3916
|
-
const h1Base = parseFloat(base["--fs-h1"].replace("px", ""));
|
|
3917
|
-
const h2Base = parseFloat(base["--fs-h2"].replace("px", ""));
|
|
3918
|
-
const h3Base = parseFloat(base["--fs-h3"].replace("px", ""));
|
|
3919
|
-
const h1Scale = typography.headings.h1.size ? SIZE_SCALE_MAP[typography.headings.h1.size] : 1;
|
|
3920
|
-
const h2Scale = typography.headings.h2.size ? SIZE_SCALE_MAP[typography.headings.h2.size] : 1;
|
|
3921
|
-
const h3Scale = typography.headings.h3.size ? SIZE_SCALE_MAP[typography.headings.h3.size] : 1;
|
|
3922
|
-
const h1 = Math.round(h1Base * h1Scale);
|
|
3923
|
-
const h2 = Math.round(h2Base * h2Scale);
|
|
3924
|
-
const h3 = Math.round(h3Base * h3Scale);
|
|
3925
|
-
const fluidMin = .7;
|
|
3926
|
-
const h2FluidMin = .9;
|
|
3927
|
-
const fluidMax = 1.3;
|
|
3928
|
-
return {
|
|
3929
|
-
body,
|
|
3930
|
-
h1: `${h1}px`,
|
|
3931
|
-
h2: `${h2}px`,
|
|
3932
|
-
h3: `${h3}px`,
|
|
3933
|
-
h1Fluid: `clamp(${Math.round(h1 * fluidMin)}px, calc(${Math.round(h1 * fluidMin)}px + ${Math.round(h1 * (fluidMax - fluidMin))} * ((100vw - 320px) / 880)), ${Math.round(h1 * fluidMax)}px)`,
|
|
3934
|
-
h2Fluid: `clamp(${Math.round(h2 * h2FluidMin)}px, calc(${Math.round(h2 * h2FluidMin)}px + ${Math.round(h2 * (fluidMax - h2FluidMin))} * ((100vw - 320px) / 880)), ${Math.round(h2 * fluidMax)}px)`,
|
|
3935
|
-
h3Fluid: `clamp(${Math.round(h3 * fluidMin)}px, calc(${Math.round(h3 * fluidMin)}px + ${Math.round(h3 * (fluidMax - fluidMin))} * ((100vw - 320px) / 880)), ${Math.round(h3 * fluidMax)}px)`,
|
|
3936
|
-
h1Display: `${Math.round(h1 * 1.5)}px`,
|
|
3937
|
-
h1DisplayFluid: `clamp(${Math.round(h1 * 1.5 * fluidMin)}px, calc(${Math.round(h1 * 1.5 * fluidMin)}px + ${Math.round(h1 * 1.5 * (fluidMax - fluidMin))} * ((100vw - 320px) / 880)), ${Math.round(h1 * 1.5 * fluidMax)}px)`
|
|
3947
|
+
...typography.headings.h5?.colorToken ? { ["--hc-h5"]: rgbColorValue(typography.headings.h5.colorToken) } : {},
|
|
3948
|
+
...typography.headings.h6?.colorToken ? { ["--hc-h6"]: rgbColorValue(typography.headings.h6.colorToken) } : {},
|
|
3949
|
+
...proseLinkStyleToCssVars(typography.proseLinkStyle),
|
|
3950
|
+
["--fs-body"]: sized.body,
|
|
3951
|
+
["--fs-h3"]: sized.h3,
|
|
3952
|
+
["--fs-h2"]: sized.h2,
|
|
3953
|
+
["--fs-h1"]: sized.h1,
|
|
3954
|
+
["--fs-h1-fluid"]: sized.h1Fluid,
|
|
3955
|
+
["--fs-h2-fluid"]: sized.h2Fluid,
|
|
3956
|
+
["--fs-h3-fluid"]: sized.h3Fluid,
|
|
3957
|
+
["--fs-h1-display"]: sized.h1Display,
|
|
3958
|
+
["--fs-h1-display-fluid"]: sized.h1DisplayFluid,
|
|
3959
|
+
["--shadow-elev"]: mapShadow(shadow.elevation, shadow.softness, shadow.position || "bottom", shadow.colorToken),
|
|
3960
|
+
["--space-mult"]: mapSpaceMult(space),
|
|
3961
|
+
["--motion-duration"]: mapMotionDuration(motion.level),
|
|
3962
|
+
["--motion-ease"]: mapMotionEasing(motion.easing ?? "standard"),
|
|
3963
|
+
["--rt-space-y"]: mapRhythm(space),
|
|
3964
|
+
[THEME_RADIUS_CSS_VARS.block]: blockRadius,
|
|
3965
|
+
[THEME_RADIUS_CSS_VARS.panel]: panelRadius,
|
|
3966
|
+
["--rb-block-transition"]: mapBlockTransition(motion.level),
|
|
3967
|
+
[THEME_RADIUS_CSS_VARS.button]: buttonRadius,
|
|
3968
|
+
["--rb-border-width"]: mapBorderWidth(border.width),
|
|
3969
|
+
["--rb-border-style"]: mapBorderStyle(border.style),
|
|
3970
|
+
[THEME_RADIUS_CSS_VARS.input]: inputRadius,
|
|
3971
|
+
["--rb-input-focus-width"]: `${inputSystem.focus.ringWidth}px`,
|
|
3972
|
+
["--rb-input-focus-color"]: rgbColorValue(inputSystem.focus.ringColorToken),
|
|
3973
|
+
[THEME_RADIUS_CSS_VARS.legacyCard]: blockRadius,
|
|
3974
|
+
[THEME_RADIUS_CSS_VARS.legacyControl]: inputRadius
|
|
3938
3975
|
};
|
|
3939
3976
|
}
|
|
3940
|
-
|
|
3977
|
+
/** Font roles use one formatter and weight mapping; absent small headings add no variables. */
|
|
3978
|
+
function typographyFontRoleCssVars(typography) {
|
|
3941
3979
|
return {
|
|
3942
|
-
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
|
-
|
|
3980
|
+
"--font-heading": formatFontFamily(typography.headings.default.family),
|
|
3981
|
+
"--font-body": formatFontFamily(typography.body.family),
|
|
3982
|
+
...typography.smallHeading ? {
|
|
3983
|
+
"--font-small-heading": formatFontFamily(typography.smallHeading.family),
|
|
3984
|
+
"--fw-small-heading": mapWeight(typography.smallHeading.weight)
|
|
3985
|
+
} : {}
|
|
3986
|
+
};
|
|
3946
3987
|
}
|
|
3947
|
-
function
|
|
3988
|
+
function mapWeight(w) {
|
|
3948
3989
|
return {
|
|
3949
|
-
|
|
3950
|
-
|
|
3951
|
-
|
|
3952
|
-
|
|
3990
|
+
light: 300,
|
|
3991
|
+
regular: 400,
|
|
3992
|
+
medium: 500,
|
|
3993
|
+
semibold: 600,
|
|
3994
|
+
bold: 700
|
|
3995
|
+
}[w];
|
|
3953
3996
|
}
|
|
3954
|
-
function
|
|
3997
|
+
function mapShadow(level, softness, position = "bottom", colorToken) {
|
|
3998
|
+
if (level === "none") return "none";
|
|
3999
|
+
const tintVar = colorToken ? cssVarValue(colorToken) : null;
|
|
4000
|
+
const shadowColor = (a) => tintVar ? `rgb(${tintVar} / ${a})` : `rgba(0,0,0,${a})`;
|
|
4001
|
+
const offset = {
|
|
4002
|
+
low: 2,
|
|
4003
|
+
medium: 4,
|
|
4004
|
+
high: 6
|
|
4005
|
+
}[level];
|
|
4006
|
+
const xOffset = position === "bottom-right" ? offset : 0;
|
|
4007
|
+
if (softness === "hard") return `${xOffset}px ${offset}px 0 0 ${shadowColor("1")}`;
|
|
4008
|
+
const soft = softness !== "crisp";
|
|
4009
|
+
switch (level) {
|
|
4010
|
+
case "low": return soft ? `${xOffset}px 1px 2px ${shadowColor(".06")}` : `${xOffset}px 1px 1px ${shadowColor(".12")}`;
|
|
4011
|
+
case "medium": return soft ? `${xOffset}px 10px 20px ${shadowColor(".08")}` : `${xOffset}px 6px 12px ${shadowColor(".16")}`;
|
|
4012
|
+
case "high": return soft ? `${xOffset}px 25px 50px ${shadowColor(".18")}` : `${xOffset}px 20px 30px ${shadowColor(".28")}`;
|
|
4013
|
+
}
|
|
4014
|
+
}
|
|
4015
|
+
function mapSpaceMult(space) {
|
|
3955
4016
|
return {
|
|
3956
|
-
|
|
3957
|
-
|
|
3958
|
-
|
|
3959
|
-
|
|
3960
|
-
}[s];
|
|
4017
|
+
comfortable: 1.15,
|
|
4018
|
+
standard: 1,
|
|
4019
|
+
dense: .88
|
|
4020
|
+
}[space];
|
|
3961
4021
|
}
|
|
3962
|
-
function
|
|
3963
|
-
|
|
4022
|
+
function mapRhythm(space) {
|
|
4023
|
+
switch (space) {
|
|
4024
|
+
case "comfortable": return "1.2rem";
|
|
4025
|
+
case "dense": return "0.75rem";
|
|
4026
|
+
default: return "1rem";
|
|
4027
|
+
}
|
|
3964
4028
|
}
|
|
3965
|
-
function
|
|
4029
|
+
function mapMotionDuration(level) {
|
|
3966
4030
|
return {
|
|
3967
|
-
|
|
3968
|
-
|
|
3969
|
-
|
|
3970
|
-
|
|
4031
|
+
off: "0ms",
|
|
4032
|
+
low: "120ms",
|
|
4033
|
+
medium: "180ms",
|
|
4034
|
+
high: "250ms"
|
|
4035
|
+
}[level];
|
|
4036
|
+
}
|
|
4037
|
+
function mapMotionEasing(e) {
|
|
4038
|
+
return {
|
|
4039
|
+
standard: "cubic-bezier(.2,.8,.2,1)",
|
|
4040
|
+
snappy: "cubic-bezier(.2,1,.2,1)",
|
|
4041
|
+
gentle: "cubic-bezier(.15,.85,.15,1)"
|
|
4042
|
+
}[e];
|
|
3971
4043
|
}
|
|
3972
4044
|
/**
|
|
3973
|
-
*
|
|
3974
|
-
*
|
|
3975
|
-
*
|
|
3976
|
-
*
|
|
3977
|
-
* display headings; body keeps `mapLineHeight`.
|
|
4045
|
+
* Map corner style to block radius CSS value.
|
|
4046
|
+
* These are Tier 2 vars used consistently across blocks. The pill token is
|
|
4047
|
+
* intentionally capped for block surfaces: buttons can be fully pill-shaped,
|
|
4048
|
+
* but cards/panels with real content should not become capsules.
|
|
3978
4049
|
*/
|
|
3979
|
-
function
|
|
4050
|
+
function mapBlockRadius(corners) {
|
|
3980
4051
|
return {
|
|
3981
|
-
|
|
3982
|
-
|
|
3983
|
-
|
|
3984
|
-
|
|
3985
|
-
|
|
3986
|
-
}[s];
|
|
3987
|
-
}
|
|
3988
|
-
function mapTextTransform(c) {
|
|
3989
|
-
if (c === "uppercase") return "uppercase";
|
|
3990
|
-
return "none";
|
|
3991
|
-
}
|
|
3992
|
-
function mapFontVariant(c) {
|
|
3993
|
-
if (c === "smallCaps") return "small-caps";
|
|
3994
|
-
return "normal";
|
|
3995
|
-
}
|
|
3996
|
-
function mapFontStyle(italic) {
|
|
3997
|
-
return italic ? "italic" : "normal";
|
|
3998
|
-
}
|
|
3999
|
-
/** Adapt the canonical default-card decision for the embedded registration. */
|
|
4000
|
-
function generateThemeBlockVarsCss(theme, themeId) {
|
|
4001
|
-
const card = resolveCardRole(theme, theme.cards ?? null, "default");
|
|
4002
|
-
return generateAllBlockVarsCss({
|
|
4003
|
-
theme,
|
|
4004
|
-
themeId,
|
|
4005
|
-
surface: opaqueSurfaceContextFromTheme(theme),
|
|
4006
|
-
embeddedRegistrationPaint: card.kind === "surface" ? cardSurfacePaint(card.variant) : { kind: "transparent" }
|
|
4007
|
-
});
|
|
4052
|
+
square: "0",
|
|
4053
|
+
soft: "0.5rem",
|
|
4054
|
+
rounded: "0.75rem",
|
|
4055
|
+
pill: "1rem"
|
|
4056
|
+
}[corners];
|
|
4008
4057
|
}
|
|
4009
|
-
//#endregion
|
|
4010
|
-
//#region ../calendar/src/lane-packing.ts
|
|
4011
4058
|
/**
|
|
4012
|
-
*
|
|
4013
|
-
*
|
|
4014
|
-
*
|
|
4015
|
-
*
|
|
4016
|
-
*
|
|
4059
|
+
* Map corner style to large-panel radius CSS value (Tier 2 `--rb-panel-radius`).
|
|
4060
|
+
* Derived from the same `corners` enum, one step more generous than the
|
|
4061
|
+
* block/card radius so large surfaces can carry a softer corner without a new
|
|
4062
|
+
* schema field. `rounded` lands on 20px (1.25rem), matching the physio mockup's
|
|
4063
|
+
* large-panel radius.
|
|
4017
4064
|
*/
|
|
4018
|
-
function
|
|
4019
|
-
|
|
4020
|
-
|
|
4021
|
-
|
|
4022
|
-
|
|
4023
|
-
|
|
4024
|
-
|
|
4025
|
-
const results = new Array(intervals.length);
|
|
4026
|
-
let cluster = [];
|
|
4027
|
-
let activeLaneEnds = [];
|
|
4028
|
-
let clusterMaxEnd = -Infinity;
|
|
4029
|
-
const closeCluster = () => {
|
|
4030
|
-
if (cluster.length === 0) return;
|
|
4031
|
-
const laneCount = Math.max(1, cluster.reduce((max, entry) => Math.max(max, entry.laneIndex + 1), 0));
|
|
4032
|
-
for (const entry of cluster) results[entry.index] = {
|
|
4033
|
-
laneIndex: entry.laneIndex,
|
|
4034
|
-
laneCount
|
|
4035
|
-
};
|
|
4036
|
-
cluster = [];
|
|
4037
|
-
activeLaneEnds = [];
|
|
4038
|
-
clusterMaxEnd = -Infinity;
|
|
4039
|
-
};
|
|
4040
|
-
for (const { interval, index } of indexed) {
|
|
4041
|
-
if (interval.start >= clusterMaxEnd) closeCluster();
|
|
4042
|
-
const laneIndex = firstAvailableLane(activeLaneEnds, interval.start);
|
|
4043
|
-
activeLaneEnds[laneIndex] = interval.end;
|
|
4044
|
-
clusterMaxEnd = Math.max(clusterMaxEnd, interval.end);
|
|
4045
|
-
cluster.push({
|
|
4046
|
-
index,
|
|
4047
|
-
laneIndex
|
|
4048
|
-
});
|
|
4049
|
-
}
|
|
4050
|
-
closeCluster();
|
|
4051
|
-
return results;
|
|
4052
|
-
}
|
|
4053
|
-
function firstAvailableLane(activeLaneEnds, start) {
|
|
4054
|
-
const laneIndex = activeLaneEnds.findIndex((end) => end <= start);
|
|
4055
|
-
return laneIndex >= 0 ? laneIndex : activeLaneEnds.length;
|
|
4065
|
+
function mapPanelRadius(corners) {
|
|
4066
|
+
return {
|
|
4067
|
+
square: "0",
|
|
4068
|
+
soft: "0.75rem",
|
|
4069
|
+
rounded: "1.25rem",
|
|
4070
|
+
pill: "2rem"
|
|
4071
|
+
}[corners];
|
|
4056
4072
|
}
|
|
4057
|
-
//#endregion
|
|
4058
|
-
//#region ../calendar/src/timetable.ts
|
|
4059
4073
|
/**
|
|
4060
|
-
*
|
|
4061
|
-
*
|
|
4062
|
-
* Generic over `T`. Takes a list of timed items + a viewport; returns a
|
|
4063
|
-
* day-by-day layout with overlap-packed lanes and percent-based positions
|
|
4064
|
-
* plus a diagnostics list for items dropped during processing.
|
|
4065
|
-
*
|
|
4066
|
-
* The function is pure: given identical input (including `now`), it returns
|
|
4067
|
-
* the same output. The model has no opinion on what an item is — pass
|
|
4068
|
-
* accessors.
|
|
4074
|
+
* Map motion level to block transition duration.
|
|
4075
|
+
* These are Tier 2 vars used consistently across blocks.
|
|
4069
4076
|
*/
|
|
4070
|
-
|
|
4071
|
-
minStartHour: 5,
|
|
4072
|
-
maxEndHour: 23,
|
|
4073
|
-
defaultStartHour: 6,
|
|
4074
|
-
defaultEndHour: 21,
|
|
4075
|
-
minHeightPercent: 2.5,
|
|
4076
|
-
marginMinutes: 0
|
|
4077
|
-
};
|
|
4078
|
-
function buildTimetableModel$1(input) {
|
|
4079
|
-
const bounds = resolveBounds(input.bounds);
|
|
4080
|
-
const viewportDays = getTimetableDays(input.viewDate, input.view ?? "week", input.startOfWeek);
|
|
4081
|
-
const viewportKeys = new Set(viewportDays.map(formatDateKey));
|
|
4082
|
-
const parsed = parseAllItems(input.items, input);
|
|
4083
|
-
const inViewport = deriveVisibleSegments(parsed.drafts, viewportKeys);
|
|
4084
|
-
const hourRange = input.hours === void 0 ? resolveHourRange(inViewport, bounds) : fixedHourRange(input.hours);
|
|
4085
|
-
const laid = layoutCellsByDate(inViewport, hourRange, bounds);
|
|
4077
|
+
function mapBlockTransition(level) {
|
|
4086
4078
|
return {
|
|
4087
|
-
|
|
4088
|
-
|
|
4089
|
-
|
|
4090
|
-
|
|
4091
|
-
|
|
4092
|
-
|
|
4093
|
-
|
|
4094
|
-
|
|
4079
|
+
off: "0ms",
|
|
4080
|
+
low: "120ms",
|
|
4081
|
+
medium: "150ms",
|
|
4082
|
+
high: "200ms"
|
|
4083
|
+
}[level];
|
|
4084
|
+
}
|
|
4085
|
+
/**
|
|
4086
|
+
* Map corner style to button radius CSS value.
|
|
4087
|
+
* Uses Tailwind-style button radius values that match the button system.
|
|
4088
|
+
* - square/soft → rounded-md (0.375rem) for subtle rounding
|
|
4089
|
+
* - rounded → rounded-lg (0.5rem) for moderate rounding
|
|
4090
|
+
* - pill → rounded-full (9999px) for pill shape
|
|
4091
|
+
*/
|
|
4092
|
+
function mapButtonRadius(corners) {
|
|
4093
|
+
return {
|
|
4094
|
+
square: "0.375rem",
|
|
4095
|
+
soft: "0.375rem",
|
|
4096
|
+
rounded: "0.5rem",
|
|
4097
|
+
pill: "9999px"
|
|
4098
|
+
}[corners];
|
|
4095
4099
|
}
|
|
4096
|
-
function
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
if (result.ok) drafts.push(result.draft);
|
|
4102
|
-
else diagnostics.push({
|
|
4103
|
-
item,
|
|
4104
|
-
reason: result.reason
|
|
4105
|
-
});
|
|
4100
|
+
function mapBorderWidth(width) {
|
|
4101
|
+
switch (width) {
|
|
4102
|
+
case "none": return "0px";
|
|
4103
|
+
case "thick": return "2px";
|
|
4104
|
+
default: return "1px";
|
|
4106
4105
|
}
|
|
4106
|
+
}
|
|
4107
|
+
function mapBorderStyle(style) {
|
|
4108
|
+
return style;
|
|
4109
|
+
}
|
|
4110
|
+
function proseLinkStyleToCssVars(style) {
|
|
4111
|
+
if (!style) return {};
|
|
4107
4112
|
return {
|
|
4108
|
-
|
|
4109
|
-
|
|
4113
|
+
...style.colorToken ? { ["--rb-prose-link-color"]: rgbColorValue(style.colorToken) } : {},
|
|
4114
|
+
...style.hoverColorToken ? { ["--rb-prose-link-hover-color"]: rgbColorValue(style.hoverColorToken) } : {},
|
|
4115
|
+
...style.decorationColorToken ? { ["--rb-prose-link-decoration-color"]: rgbColorValue(style.decorationColorToken) } : {},
|
|
4116
|
+
...style.hoverDecorationColorToken ? { ["--rb-prose-link-hover-decoration-color"]: rgbColorValue(style.hoverDecorationColorToken) } : {},
|
|
4117
|
+
...style.underline != null ? { ["--rb-prose-link-decoration-line"]: style.underline ? "underline" : "none" } : {},
|
|
4118
|
+
...style.underlineStyle ? { ["--rb-prose-link-underline-style"]: style.underlineStyle } : {},
|
|
4119
|
+
...style.underlineThickness ? { ["--rb-prose-link-underline-thickness"]: mapProseLinkUnderlineThickness(style.underlineThickness) } : {},
|
|
4120
|
+
...style.underlineOffset ? { ["--rb-prose-link-underline-offset"]: mapProseLinkUnderlineOffset(style.underlineOffset) } : {}
|
|
4110
4121
|
};
|
|
4111
4122
|
}
|
|
4112
|
-
|
|
4113
|
-
|
|
4114
|
-
|
|
4115
|
-
|
|
4116
|
-
|
|
4117
|
-
const
|
|
4118
|
-
|
|
4119
|
-
|
|
4120
|
-
|
|
4121
|
-
|
|
4122
|
-
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
reason: result.reason
|
|
4127
|
-
});
|
|
4128
|
-
}
|
|
4129
|
-
const laneResults = assignLanes(clipped.map((entry) => ({
|
|
4130
|
-
start: entry.visibleStart,
|
|
4131
|
-
end: entry.visibleEnd,
|
|
4132
|
-
orderKey: entry.segment.draft.orderKey
|
|
4133
|
-
})));
|
|
4134
|
-
cellsByDate.set(dateKey, clipped.map((entry, idx) => buildCell(entry, laneResults[idx] ?? {
|
|
4135
|
-
laneIndex: 0,
|
|
4136
|
-
laneCount: 1
|
|
4137
|
-
}, rangeStartMinutes, rangeMinutes, bounds.minHeightPercent)));
|
|
4123
|
+
/**
|
|
4124
|
+
* Generate structured block override CSS (separate from blockCustomVars).
|
|
4125
|
+
* This handles typed theme overrides, while blockCustomVars remains raw var passthrough.
|
|
4126
|
+
*/
|
|
4127
|
+
function generateBlockOverrideCss(themeId, theme) {
|
|
4128
|
+
const overrides = theme.blockOverrides;
|
|
4129
|
+
if (!overrides) return "";
|
|
4130
|
+
const cssBlocks = [];
|
|
4131
|
+
for (const [blockKind, blockOverride] of Object.entries(overrides)) {
|
|
4132
|
+
const blockSelectorKind = normalizeBlockKind(blockKind);
|
|
4133
|
+
const proseVars = proseLinkStyleToCssVars(blockOverride.typography?.proseLinkStyle);
|
|
4134
|
+
const declarations = Object.entries(proseVars).map(([key, value]) => ` ${key}: ${String(value)};`).join("\n");
|
|
4135
|
+
if (!declarations) continue;
|
|
4136
|
+
cssBlocks.push(`:where([data-theme-scope="${escapeAttrValue(themeId)}"]) :where([data-block="${escapeAttrValue(blockSelectorKind)}"]) {\n${declarations}\n}`);
|
|
4138
4137
|
}
|
|
4139
|
-
return
|
|
4140
|
-
cellsByDate,
|
|
4141
|
-
diagnostics
|
|
4142
|
-
};
|
|
4138
|
+
return cssBlocks.join("\n");
|
|
4143
4139
|
}
|
|
4144
|
-
function
|
|
4145
|
-
return
|
|
4146
|
-
const dateKey = formatDateKey(date);
|
|
4147
|
-
return {
|
|
4148
|
-
date,
|
|
4149
|
-
dateKey,
|
|
4150
|
-
isToday: isSameCalendarDay(date, today),
|
|
4151
|
-
cells: cellsByDate.get(dateKey) ?? []
|
|
4152
|
-
};
|
|
4153
|
-
});
|
|
4140
|
+
function escapeAttrValue(value) {
|
|
4141
|
+
return value.replace(/\\/g, "\\\\").replace(/"/g, "\\\"");
|
|
4154
4142
|
}
|
|
4155
|
-
function
|
|
4156
|
-
|
|
4157
|
-
|
|
4158
|
-
|
|
4159
|
-
|
|
4160
|
-
|
|
4161
|
-
|
|
4162
|
-
|
|
4163
|
-
};
|
|
4164
|
-
const startDateKey = getLocalDateKey(startsAtIso, timeZone);
|
|
4165
|
-
if (startDateKey == null) return {
|
|
4166
|
-
ok: false,
|
|
4167
|
-
reason: "invalid-timezone"
|
|
4168
|
-
};
|
|
4169
|
-
const endDateKey = getLocalDateKey(endsAtIso, timeZone);
|
|
4170
|
-
if (endDateKey == null) return {
|
|
4171
|
-
ok: false,
|
|
4172
|
-
reason: "invalid-end"
|
|
4173
|
-
};
|
|
4174
|
-
const endsAtMinutesRaw = getLocalMinuteOfDay(endsAtIso, timeZone);
|
|
4175
|
-
if (Number.isNaN(endsAtMinutesRaw)) return {
|
|
4176
|
-
ok: false,
|
|
4177
|
-
reason: "invalid-end"
|
|
4178
|
-
};
|
|
4179
|
-
const spansMultipleDays = startDateKey < endDateKey;
|
|
4180
|
-
const endsAtMinutes = spansMultipleDays || endsAtMinutesRaw > startsAtMinutes ? endsAtMinutesRaw : Math.min(1440, startsAtMinutes + 60);
|
|
4181
|
-
if (!spansMultipleDays && endsAtMinutes <= startsAtMinutes) return {
|
|
4182
|
-
ok: false,
|
|
4183
|
-
reason: "non-positive-duration"
|
|
4184
|
-
};
|
|
4185
|
-
return {
|
|
4186
|
-
ok: true,
|
|
4187
|
-
draft: {
|
|
4188
|
-
item,
|
|
4189
|
-
startDateKey,
|
|
4190
|
-
endDateKey,
|
|
4191
|
-
startsAtMinutes,
|
|
4192
|
-
endsAtMinutes,
|
|
4193
|
-
color: accessors.getColor?.(item) ?? null,
|
|
4194
|
-
orderKey: accessors.getOrderKey?.(item) ?? accessors.getId(item)
|
|
4195
|
-
}
|
|
4196
|
-
};
|
|
4143
|
+
function mapProseLinkUnderlineThickness(value) {
|
|
4144
|
+
switch (value) {
|
|
4145
|
+
case "fromFont": return "from-font";
|
|
4146
|
+
case "thin": return "1px";
|
|
4147
|
+
case "medium": return "2px";
|
|
4148
|
+
case "thick": return "3px";
|
|
4149
|
+
default: return "auto";
|
|
4150
|
+
}
|
|
4197
4151
|
}
|
|
4198
|
-
function
|
|
4199
|
-
|
|
4200
|
-
|
|
4201
|
-
|
|
4202
|
-
|
|
4203
|
-
|
|
4204
|
-
const startsAtMinutes = isStartDay ? draft.startsAtMinutes : 0;
|
|
4205
|
-
const endsAtMinutes = isEndDay ? draft.endsAtMinutes : 1440;
|
|
4206
|
-
if (endsAtMinutes <= startsAtMinutes) continue;
|
|
4207
|
-
segments.push({
|
|
4208
|
-
draft,
|
|
4209
|
-
dateKey,
|
|
4210
|
-
startsAtMinutes,
|
|
4211
|
-
endsAtMinutes,
|
|
4212
|
-
continuesBefore: !isStartDay,
|
|
4213
|
-
continuesAfter: !isEndDay
|
|
4214
|
-
});
|
|
4152
|
+
function mapProseLinkUnderlineOffset(value) {
|
|
4153
|
+
switch (value) {
|
|
4154
|
+
case "tight": return "0.08em";
|
|
4155
|
+
case "loose": return "0.2em";
|
|
4156
|
+
case "normal": return "0.14em";
|
|
4157
|
+
default: return "auto";
|
|
4215
4158
|
}
|
|
4216
|
-
return segments;
|
|
4217
4159
|
}
|
|
4218
|
-
|
|
4219
|
-
|
|
4220
|
-
|
|
4221
|
-
|
|
4222
|
-
|
|
4223
|
-
|
|
4160
|
+
/**
|
|
4161
|
+
* Map input corners to CSS radius value for tier-2 input variables.
|
|
4162
|
+
* Falls back to theme corners if inputCorners is null.
|
|
4163
|
+
*/
|
|
4164
|
+
function mapInputRadius(inputCorners, themeFallback) {
|
|
4165
|
+
switch (inputCorners ?? themeFallback) {
|
|
4166
|
+
case "square": return "0";
|
|
4167
|
+
case "soft": return "0.25rem";
|
|
4168
|
+
case "rounded": return "0.5rem";
|
|
4169
|
+
case "pill": return "9999px";
|
|
4170
|
+
default: return "0.375rem";
|
|
4171
|
+
}
|
|
4172
|
+
}
|
|
4173
|
+
/**
|
|
4174
|
+
* Normalize scale name to handle both old and new naming conventions.
|
|
4175
|
+
* Old names (minorThird, majorThird, perfectFourth) map to new names (compact, balanced, spacious).
|
|
4176
|
+
*/
|
|
4177
|
+
function normalizeScaleName(scale) {
|
|
4178
|
+
return {
|
|
4179
|
+
minorThird: "compact",
|
|
4180
|
+
majorThird: "balanced",
|
|
4181
|
+
perfectFourth: "spacious",
|
|
4182
|
+
compact: "compact",
|
|
4183
|
+
balanced: "balanced",
|
|
4184
|
+
spacious: "spacious"
|
|
4185
|
+
}[scale] ?? "balanced";
|
|
4186
|
+
}
|
|
4187
|
+
/**
|
|
4188
|
+
* Compute base type scale sizes for headings.
|
|
4189
|
+
* Returns both static sizes and min/max for fluid typography.
|
|
4190
|
+
*/
|
|
4191
|
+
function computeTypeScale(scale, bodySize) {
|
|
4192
|
+
const base = {
|
|
4193
|
+
md: 16,
|
|
4194
|
+
lg: 17,
|
|
4195
|
+
xl: 18
|
|
4196
|
+
}[bodySize];
|
|
4197
|
+
const ratio = {
|
|
4198
|
+
compact: 1.2,
|
|
4199
|
+
balanced: 1.25,
|
|
4200
|
+
spacious: 1.333
|
|
4201
|
+
}[normalizeScaleName(scale)];
|
|
4202
|
+
const h3 = Math.round(base * ratio);
|
|
4203
|
+
const h2 = Math.round(h3 * ratio);
|
|
4204
|
+
const h1 = Math.round(h2 * ratio);
|
|
4205
|
+
const fluidMin = .7;
|
|
4206
|
+
const h2FluidMin = .9;
|
|
4207
|
+
const fluidMax = 1.3;
|
|
4208
|
+
return {
|
|
4209
|
+
["--fs-body"]: `${base}px`,
|
|
4210
|
+
["--fs-h3"]: `${h3}px`,
|
|
4211
|
+
["--fs-h2"]: `${h2}px`,
|
|
4212
|
+
["--fs-h1"]: `${h1}px`,
|
|
4213
|
+
["--fs-h1-min"]: `${Math.round(h1 * fluidMin)}px`,
|
|
4214
|
+
["--fs-h1-max"]: `${Math.round(h1 * fluidMax)}px`,
|
|
4215
|
+
["--fs-h2-min"]: `${Math.round(h2 * h2FluidMin)}px`,
|
|
4216
|
+
["--fs-h2-max"]: `${Math.round(h2 * fluidMax)}px`,
|
|
4217
|
+
["--fs-h3-min"]: `${Math.round(h3 * fluidMin)}px`,
|
|
4218
|
+
["--fs-h3-max"]: `${Math.round(h3 * fluidMax)}px`,
|
|
4219
|
+
["--fs-h1-fluid"]: `clamp(${Math.round(h1 * fluidMin)}px, calc(${Math.round(h1 * fluidMin)}px + ${Math.round(h1 * (fluidMax - fluidMin))} * ((100vw - 320px) / 880)), ${Math.round(h1 * fluidMax)}px)`,
|
|
4220
|
+
["--fs-h2-fluid"]: `clamp(${Math.round(h2 * h2FluidMin)}px, calc(${Math.round(h2 * h2FluidMin)}px + ${Math.round(h2 * (fluidMax - h2FluidMin))} * ((100vw - 320px) / 880)), ${Math.round(h2 * fluidMax)}px)`,
|
|
4221
|
+
["--fs-h3-fluid"]: `clamp(${Math.round(h3 * fluidMin)}px, calc(${Math.round(h3 * fluidMin)}px + ${Math.round(h3 * (fluidMax - fluidMin))} * ((100vw - 320px) / 880)), ${Math.round(h3 * fluidMax)}px)`,
|
|
4222
|
+
["--fs-h1-display"]: `${Math.round(h1 * 1.5)}px`,
|
|
4223
|
+
["--fs-h1-display-fluid"]: `clamp(${Math.round(h1 * fluidMin * 1.5)}px, calc(${Math.round(h1 * fluidMin * 1.5)}px + ${Math.round(h1 * (fluidMax - fluidMin) * 1.5)} * ((100vw - 320px) / 880)), ${Math.round(h1 * fluidMax * 1.5)}px)`
|
|
4224
4224
|
};
|
|
4225
|
+
}
|
|
4226
|
+
/**
|
|
4227
|
+
* Size scale multipliers for heading size overrides.
|
|
4228
|
+
* Expanded from md/lg/xl to xs through 2xl for finer control.
|
|
4229
|
+
*/
|
|
4230
|
+
const SIZE_SCALE_MAP = {
|
|
4231
|
+
xs: .85,
|
|
4232
|
+
sm: .925,
|
|
4233
|
+
md: 1,
|
|
4234
|
+
lg: 1.1,
|
|
4235
|
+
xl: 1.2,
|
|
4236
|
+
"2xl": 1.35
|
|
4237
|
+
};
|
|
4238
|
+
function applyHeadingSizeOverrides(base, typography) {
|
|
4239
|
+
const body = base["--fs-body"];
|
|
4240
|
+
const h1Base = parseFloat(base["--fs-h1"].replace("px", ""));
|
|
4241
|
+
const h2Base = parseFloat(base["--fs-h2"].replace("px", ""));
|
|
4242
|
+
const h3Base = parseFloat(base["--fs-h3"].replace("px", ""));
|
|
4243
|
+
const h1Scale = typography.headings.h1.size ? SIZE_SCALE_MAP[typography.headings.h1.size] : 1;
|
|
4244
|
+
const h2Scale = typography.headings.h2.size ? SIZE_SCALE_MAP[typography.headings.h2.size] : 1;
|
|
4245
|
+
const h3Scale = typography.headings.h3.size ? SIZE_SCALE_MAP[typography.headings.h3.size] : 1;
|
|
4246
|
+
const h1 = Math.round(h1Base * h1Scale);
|
|
4247
|
+
const h2 = Math.round(h2Base * h2Scale);
|
|
4248
|
+
const h3 = Math.round(h3Base * h3Scale);
|
|
4249
|
+
const fluidMin = .7;
|
|
4250
|
+
const h2FluidMin = .9;
|
|
4251
|
+
const fluidMax = 1.3;
|
|
4225
4252
|
return {
|
|
4226
|
-
|
|
4227
|
-
|
|
4228
|
-
|
|
4229
|
-
|
|
4230
|
-
|
|
4231
|
-
}
|
|
4253
|
+
body,
|
|
4254
|
+
h1: `${h1}px`,
|
|
4255
|
+
h2: `${h2}px`,
|
|
4256
|
+
h3: `${h3}px`,
|
|
4257
|
+
h1Fluid: `clamp(${Math.round(h1 * fluidMin)}px, calc(${Math.round(h1 * fluidMin)}px + ${Math.round(h1 * (fluidMax - fluidMin))} * ((100vw - 320px) / 880)), ${Math.round(h1 * fluidMax)}px)`,
|
|
4258
|
+
h2Fluid: `clamp(${Math.round(h2 * h2FluidMin)}px, calc(${Math.round(h2 * h2FluidMin)}px + ${Math.round(h2 * (fluidMax - h2FluidMin))} * ((100vw - 320px) / 880)), ${Math.round(h2 * fluidMax)}px)`,
|
|
4259
|
+
h3Fluid: `clamp(${Math.round(h3 * fluidMin)}px, calc(${Math.round(h3 * fluidMin)}px + ${Math.round(h3 * (fluidMax - fluidMin))} * ((100vw - 320px) / 880)), ${Math.round(h3 * fluidMax)}px)`,
|
|
4260
|
+
h1Display: `${Math.round(h1 * 1.5)}px`,
|
|
4261
|
+
h1DisplayFluid: `clamp(${Math.round(h1 * 1.5 * fluidMin)}px, calc(${Math.round(h1 * 1.5 * fluidMin)}px + ${Math.round(h1 * 1.5 * (fluidMax - fluidMin))} * ((100vw - 320px) / 880)), ${Math.round(h1 * 1.5 * fluidMax)}px)`
|
|
4232
4262
|
};
|
|
4233
4263
|
}
|
|
4234
|
-
function
|
|
4235
|
-
const heightPercent = Math.max(minHeightPercent, toRangePercent(entry.visibleEnd - entry.visibleStart, rangeMinutes));
|
|
4236
|
-
const rawTopPercent = toRangePercent(entry.visibleStart - rangeStartMinutes, rangeMinutes);
|
|
4237
|
-
const topPercent = Math.min(rawTopPercent, 100 - heightPercent);
|
|
4264
|
+
function mapLetterSpacing(s) {
|
|
4238
4265
|
return {
|
|
4239
|
-
|
|
4240
|
-
|
|
4241
|
-
|
|
4242
|
-
|
|
4243
|
-
visibleStartsAtMinutes: entry.visibleStart,
|
|
4244
|
-
visibleEndsAtMinutes: entry.visibleEnd,
|
|
4245
|
-
topPercent,
|
|
4246
|
-
heightPercent,
|
|
4247
|
-
isClippedStart: entry.segment.continuesBefore || entry.segment.startsAtMinutes < entry.visibleStart,
|
|
4248
|
-
isClippedEnd: entry.segment.continuesAfter || entry.segment.endsAtMinutes > entry.visibleEnd,
|
|
4249
|
-
laneIndex: lane.laneIndex,
|
|
4250
|
-
laneCount: lane.laneCount,
|
|
4251
|
-
color: entry.segment.draft.color
|
|
4252
|
-
};
|
|
4266
|
+
tight: "-0.01em",
|
|
4267
|
+
normal: "0em",
|
|
4268
|
+
loose: "0.02em"
|
|
4269
|
+
}[s];
|
|
4253
4270
|
}
|
|
4254
|
-
function
|
|
4271
|
+
function mapEyebrowSize(s) {
|
|
4255
4272
|
return {
|
|
4256
|
-
|
|
4257
|
-
|
|
4258
|
-
|
|
4273
|
+
sm: "0.75rem",
|
|
4274
|
+
md: "0.875rem",
|
|
4275
|
+
lg: "1rem"
|
|
4276
|
+
}[s];
|
|
4259
4277
|
}
|
|
4260
|
-
function
|
|
4261
|
-
if (segments.length === 0) return {
|
|
4262
|
-
startHour: bounds.defaultStartHour,
|
|
4263
|
-
endHour: bounds.defaultEndHour
|
|
4264
|
-
};
|
|
4265
|
-
const earliestStart = Math.min(...segments.map((segment) => segment.startsAtMinutes));
|
|
4266
|
-
const latestEnd = Math.max(...segments.map((segment) => segment.endsAtMinutes));
|
|
4267
|
-
const startHour = Math.max(bounds.minStartHour, Math.floor((earliestStart - bounds.marginMinutes) / 60));
|
|
4268
|
-
const endHour = Math.min(bounds.maxEndHour, Math.ceil((latestEnd + bounds.marginMinutes) / 60));
|
|
4278
|
+
function mapEyebrowLetterSpacing(s) {
|
|
4269
4279
|
return {
|
|
4270
|
-
|
|
4271
|
-
|
|
4272
|
-
|
|
4280
|
+
tight: "0em",
|
|
4281
|
+
normal: "0.025em",
|
|
4282
|
+
loose: "0.06em",
|
|
4283
|
+
wide: "0.12em"
|
|
4284
|
+
}[s];
|
|
4273
4285
|
}
|
|
4274
|
-
function
|
|
4275
|
-
|
|
4276
|
-
return {
|
|
4277
|
-
startHour,
|
|
4278
|
-
endHour: Math.min(24, Math.max(startHour + 1, Math.ceil(hours.endHour)))
|
|
4279
|
-
};
|
|
4286
|
+
function mapEyebrowCase(c) {
|
|
4287
|
+
return c === "uppercase" ? "uppercase" : "none";
|
|
4280
4288
|
}
|
|
4281
|
-
function
|
|
4282
|
-
|
|
4283
|
-
|
|
4284
|
-
|
|
4289
|
+
function mapLineHeight(s) {
|
|
4290
|
+
return {
|
|
4291
|
+
normal: "1.5",
|
|
4292
|
+
relaxed: "1.65",
|
|
4293
|
+
loose: "1.8"
|
|
4294
|
+
}[s];
|
|
4285
4295
|
}
|
|
4286
|
-
|
|
4287
|
-
|
|
4288
|
-
|
|
4289
|
-
|
|
4290
|
-
|
|
4291
|
-
|
|
4292
|
-
|
|
4293
|
-
|
|
4296
|
+
/**
|
|
4297
|
+
* Headings get their own line-height scale, decoupled from body. `mapLineHeight`
|
|
4298
|
+
* is floored at 1.5 (a body leading) which reads as too airy on headings — the
|
|
4299
|
+
* more so as size drops. These values sit well under 1.5 and let presets taper
|
|
4300
|
+
* per level (larger headings tighter). `tight`/`snug` extend the token set for
|
|
4301
|
+
* display headings; body keeps `mapLineHeight`.
|
|
4302
|
+
*/
|
|
4303
|
+
function mapHeadingLineHeight(s) {
|
|
4304
|
+
return {
|
|
4305
|
+
tight: "1.1",
|
|
4306
|
+
snug: "1.15",
|
|
4307
|
+
normal: "1.2",
|
|
4308
|
+
relaxed: "1.3",
|
|
4309
|
+
loose: "1.4"
|
|
4310
|
+
}[s];
|
|
4294
4311
|
}
|
|
4295
|
-
function
|
|
4296
|
-
if (
|
|
4297
|
-
return
|
|
4312
|
+
function mapTextTransform(c) {
|
|
4313
|
+
if (c === "uppercase") return "uppercase";
|
|
4314
|
+
return "none";
|
|
4298
4315
|
}
|
|
4299
|
-
function
|
|
4300
|
-
if (
|
|
4301
|
-
return
|
|
4316
|
+
function mapFontVariant(c) {
|
|
4317
|
+
if (c === "smallCaps") return "small-caps";
|
|
4318
|
+
return "normal";
|
|
4302
4319
|
}
|
|
4303
|
-
function
|
|
4304
|
-
|
|
4305
|
-
const start = parseDateKey(startDateKey);
|
|
4306
|
-
parseDateKey(endDateKey);
|
|
4307
|
-
const keys = [];
|
|
4308
|
-
let cursor = start;
|
|
4309
|
-
while (formatDateKey(cursor) <= endDateKey) {
|
|
4310
|
-
keys.push(formatDateKey(cursor));
|
|
4311
|
-
cursor = addDays(cursor, 1);
|
|
4312
|
-
}
|
|
4313
|
-
return keys;
|
|
4320
|
+
function mapFontStyle(italic) {
|
|
4321
|
+
return italic ? "italic" : "normal";
|
|
4314
4322
|
}
|
|
4315
|
-
|
|
4316
|
-
|
|
4317
|
-
|
|
4318
|
-
|
|
4319
|
-
|
|
4320
|
-
|
|
4321
|
-
|
|
4322
|
-
|
|
4323
|
-
};
|
|
4323
|
+
/** Adapt the canonical default-card decision for the embedded registration. */
|
|
4324
|
+
function generateThemeBlockVarsCss(theme, themeId) {
|
|
4325
|
+
const card = resolveCardRole(theme, theme.cards ?? null, "default");
|
|
4326
|
+
return generateAllBlockVarsCss({
|
|
4327
|
+
theme,
|
|
4328
|
+
themeId,
|
|
4329
|
+
surface: opaqueSurfaceContextFromTheme(theme),
|
|
4330
|
+
embeddedRegistrationPaint: card.kind === "surface" ? cardSurfacePaint(card.variant) : { kind: "transparent" }
|
|
4331
|
+
});
|
|
4324
4332
|
}
|
|
4325
4333
|
//#endregion
|
|
4326
4334
|
//#region ../blocks/src/system/node/fragments/headingDecoration.ts
|
|
@@ -4490,26 +4498,6 @@ function selectEventDetailsCandidate(events, requested, nowIso) {
|
|
|
4490
4498
|
} : null;
|
|
4491
4499
|
}
|
|
4492
4500
|
//#endregion
|
|
4493
|
-
//#region ../blocks/src/system/runtime/nodes/events/domain/location.ts
|
|
4494
|
-
function formatEventLocation(event) {
|
|
4495
|
-
switch (event.deliveryMode) {
|
|
4496
|
-
case "online": return "Online";
|
|
4497
|
-
case "hybrid": return event.venue ? `${event.venue.name} + online` : "Hybrid";
|
|
4498
|
-
case "in_person": return event.venue?.name ?? "In person";
|
|
4499
|
-
}
|
|
4500
|
-
}
|
|
4501
|
-
/** The line under the venue name. A booked-only venue shows its area, and the address follows the booking. */
|
|
4502
|
-
function eventVenuePlace(venue) {
|
|
4503
|
-
if (venue.addressWithBooking) return {
|
|
4504
|
-
place: venue.area ?? null,
|
|
4505
|
-
addressWithBooking: true
|
|
4506
|
-
};
|
|
4507
|
-
return {
|
|
4508
|
-
place: venue.address,
|
|
4509
|
-
addressWithBooking: false
|
|
4510
|
-
};
|
|
4511
|
-
}
|
|
4512
|
-
//#endregion
|
|
4513
4501
|
//#region ../blocks/src/system/runtime/shared/utils/bookingRoute.ts
|
|
4514
4502
|
const BOOK_TARGET_PARAMS = {
|
|
4515
4503
|
service: "service",
|
|
@@ -8054,14 +8042,22 @@ function membershipCoversEvent(args, event) {
|
|
|
8054
8042
|
return isCategoryEligible(args.eligibleCategoryIds, event.eventCategoryId);
|
|
8055
8043
|
}
|
|
8056
8044
|
/**
|
|
8045
|
+
* Whether a pass or membership could get someone into this event at all. Nobody
|
|
8046
|
+
* books an event that takes no bookings, and a free one has nothing to pay. A
|
|
8047
|
+
* tiered event whose tickets are all free isn't `free`: the dashboard treats it
|
|
8048
|
+
* as priced, and the server refuses to spend anything on a free ticket.
|
|
8049
|
+
*/
|
|
8050
|
+
function eventCanUseProducts(event) {
|
|
8051
|
+
return event.requiresRegistration !== false && event.pricing.kind !== "free";
|
|
8052
|
+
}
|
|
8053
|
+
/**
|
|
8057
8054
|
* Filter site passes to only those that cover the selected event.
|
|
8058
8055
|
*
|
|
8059
8056
|
* Public purchasable products are a pre-auth proxy for whether the pass path is
|
|
8060
8057
|
* worth advertising; owned pass eligibility is checked later after portal auth.
|
|
8061
8058
|
*/
|
|
8062
8059
|
function filterPassesForEvent(sitePasses, event) {
|
|
8063
|
-
if (!sitePasses || !event) return [];
|
|
8064
|
-
if (event.requiresRegistration === false) return [];
|
|
8060
|
+
if (!sitePasses || !event || !eventCanUseProducts(event)) return [];
|
|
8065
8061
|
const eventCategoryId = event.eventCategory?.id ?? null;
|
|
8066
8062
|
return sitePasses.filter((pass) => pass.productUseCase === "event_pass" && passCoversEvent({ eligibleCategoryIds: pass.eligibleCategoryIds }, {
|
|
8067
8063
|
acceptsPasses: event.acceptsPasses,
|
|
@@ -8076,8 +8072,7 @@ function filterPassesForEvent(sitePasses, event) {
|
|
|
8076
8072
|
* after portal auth.
|
|
8077
8073
|
*/
|
|
8078
8074
|
function filterMembershipsForEvent(siteMemberships, event) {
|
|
8079
|
-
if (!siteMemberships || !event) return [];
|
|
8080
|
-
if (event.requiresRegistration === false) return [];
|
|
8075
|
+
if (!siteMemberships || !event || !eventCanUseProducts(event)) return [];
|
|
8081
8076
|
const eventCategoryId = event.eventCategory?.id ?? null;
|
|
8082
8077
|
return siteMemberships.filter((membership) => membershipCoversEvent({ eligibleCategoryIds: membership.eligibleCategoryIds }, {
|
|
8083
8078
|
acceptsMemberships: event.acceptsMemberships,
|
|
@@ -8236,7 +8231,11 @@ function resolveEventDetailsPresentation(input) {
|
|
|
8236
8231
|
function wholeSeriesPriceOptions(pricing) {
|
|
8237
8232
|
return pricing.kind === "tiered" ? pricing.options.filter((option) => option.isActive) : [];
|
|
8238
8233
|
}
|
|
8239
|
-
|
|
8234
|
+
/** The price, with any deposit option said beside it. */
|
|
8235
|
+
function PriceLine({ price, depositNote }) {
|
|
8236
|
+
return /* @__PURE__ */ jsxs("p", { children: [/* @__PURE__ */ jsx("strong", { children: price }), depositNote ? `, ${depositNote}` : null] });
|
|
8237
|
+
}
|
|
8238
|
+
function WholeSeriesPricingDisplay({ pricing, depositNote, acceptedItems }) {
|
|
8240
8239
|
const options = wholeSeriesPriceOptions(pricing);
|
|
8241
8240
|
return /* @__PURE__ */ jsxs("div", {
|
|
8242
8241
|
className: "rb-mt-6",
|
|
@@ -8256,7 +8255,14 @@ function WholeSeriesPricingDisplay({ pricing, acceptedItems }) {
|
|
|
8256
8255
|
className: "rb-caption status-muted",
|
|
8257
8256
|
children: option.description
|
|
8258
8257
|
}) : null] }, option.id))
|
|
8259
|
-
}) : /* @__PURE__ */ jsx(
|
|
8258
|
+
}) : /* @__PURE__ */ jsx(PriceLine, {
|
|
8259
|
+
price: formatBookingPriceDisplay(publicEventPricingDisplay(pricing), { decimals: "auto" }),
|
|
8260
|
+
depositNote
|
|
8261
|
+
}),
|
|
8262
|
+
depositNote && options.length > 1 ? /* @__PURE__ */ jsxs("p", {
|
|
8263
|
+
className: "rb-caption rb-mt-1",
|
|
8264
|
+
children: [depositNote.charAt(0).toUpperCase(), depositNote.slice(1)]
|
|
8265
|
+
}) : null,
|
|
8260
8266
|
acceptedItems.length > 0 ? /* @__PURE__ */ jsxs("p", {
|
|
8261
8267
|
className: "rb-caption rb-mt-1",
|
|
8262
8268
|
children: ["You can also attend with: ", acceptedItems.join(", ")]
|
|
@@ -8297,7 +8303,7 @@ function TicketTypePriceList({ ticketTypes, currency }) {
|
|
|
8297
8303
|
}, ticketType.id))
|
|
8298
8304
|
});
|
|
8299
8305
|
}
|
|
8300
|
-
function EventPricingDetails({ isDropIn, wholeSeriesPricingDisplay, acceptedItems, eventCostLabel, eventPricingCurrency, ticketTypes, autoApplyDiscount }) {
|
|
8306
|
+
function EventPricingDetails({ isDropIn, wholeSeriesPricingDisplay, acceptedItems, eventCostLabel, depositNote, eventPricingCurrency, ticketTypes, autoApplyDiscount }) {
|
|
8301
8307
|
if (isDropIn) return /* @__PURE__ */ jsxs("div", {
|
|
8302
8308
|
className: "rb-mt-6",
|
|
8303
8309
|
children: [/* @__PURE__ */ jsx("div", {
|
|
@@ -8310,6 +8316,7 @@ function EventPricingDetails({ isDropIn, wholeSeriesPricingDisplay, acceptedItem
|
|
|
8310
8316
|
});
|
|
8311
8317
|
if (wholeSeriesPricingDisplay) return /* @__PURE__ */ jsx(WholeSeriesPricingDisplay, {
|
|
8312
8318
|
pricing: wholeSeriesPricingDisplay,
|
|
8319
|
+
depositNote,
|
|
8313
8320
|
acceptedItems: [...acceptedItems]
|
|
8314
8321
|
});
|
|
8315
8322
|
if (eventCostLabel) return /* @__PURE__ */ jsxs("div", {
|
|
@@ -8319,7 +8326,10 @@ function EventPricingDetails({ isDropIn, wholeSeriesPricingDisplay, acceptedItem
|
|
|
8319
8326
|
className: "rb-label rb-mb-2",
|
|
8320
8327
|
children: "Cost"
|
|
8321
8328
|
}),
|
|
8322
|
-
/* @__PURE__ */ jsx(
|
|
8329
|
+
/* @__PURE__ */ jsx(PriceLine, {
|
|
8330
|
+
price: eventCostLabel,
|
|
8331
|
+
depositNote
|
|
8332
|
+
}),
|
|
8323
8333
|
autoApplyDiscount && eventPricingCurrency ? /* @__PURE__ */ jsx("p", {
|
|
8324
8334
|
className: "rb-caption rb-mt-1",
|
|
8325
8335
|
children: formatAutoApplyDiscountLine(autoApplyDiscount, eventPricingCurrency)
|
|
@@ -8342,7 +8352,7 @@ function EventPricingDetails({ isDropIn, wholeSeriesPricingDisplay, acceptedItem
|
|
|
8342
8352
|
})
|
|
8343
8353
|
}) : null;
|
|
8344
8354
|
}
|
|
8345
|
-
function EventFacts({ selection, selected, venue, teamMembers, pricing, showCapacity, lookSlots }) {
|
|
8355
|
+
function EventFacts({ selection, selected, venue, online, teamMembers, pricing, showCapacity, lookSlots }) {
|
|
8346
8356
|
const { date, timeRange } = formatEventDateParts({
|
|
8347
8357
|
startsAt: selected.startsAt,
|
|
8348
8358
|
endsAt: selected.endsAt,
|
|
@@ -8364,7 +8374,10 @@ function EventFacts({ selection, selected, venue, teamMembers, pricing, showCapa
|
|
|
8364
8374
|
children: timeRange
|
|
8365
8375
|
})
|
|
8366
8376
|
] }),
|
|
8367
|
-
/* @__PURE__ */ jsx(EventVenueFact, {
|
|
8377
|
+
/* @__PURE__ */ jsx(EventVenueFact, {
|
|
8378
|
+
venue,
|
|
8379
|
+
online
|
|
8380
|
+
}),
|
|
8368
8381
|
/* @__PURE__ */ jsx(EventTeacherFacts, { teamMembers }),
|
|
8369
8382
|
showCapacity && selected.capacity != null ? /* @__PURE__ */ jsxs("div", {
|
|
8370
8383
|
className: "rb-mt-6",
|
|
@@ -8381,8 +8394,26 @@ function EventFacts({ selection, selected, venue, teamMembers, pricing, showCapa
|
|
|
8381
8394
|
]
|
|
8382
8395
|
});
|
|
8383
8396
|
}
|
|
8384
|
-
|
|
8385
|
-
|
|
8397
|
+
const eventOnlinePlaceShown = (event, showVenue) => showVenue ? eventOnlinePlace(event) : null;
|
|
8398
|
+
/** An online event says so where a venue would go; a hybrid one adds it under the venue. */
|
|
8399
|
+
function EventVenueFact({ venue, online }) {
|
|
8400
|
+
if (!venue) {
|
|
8401
|
+
if (!online) return null;
|
|
8402
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
8403
|
+
className: "rb-mt-6",
|
|
8404
|
+
children: [
|
|
8405
|
+
/* @__PURE__ */ jsx("div", {
|
|
8406
|
+
className: "rb-label rb-mb-2",
|
|
8407
|
+
children: "Venue"
|
|
8408
|
+
}),
|
|
8409
|
+
/* @__PURE__ */ jsx("p", { children: /* @__PURE__ */ jsx("strong", { children: online.mode === "online" ? "Online" : "In person or online" }) }),
|
|
8410
|
+
online.note ? /* @__PURE__ */ jsx("p", {
|
|
8411
|
+
className: "rb-caption",
|
|
8412
|
+
children: online.note
|
|
8413
|
+
}) : null
|
|
8414
|
+
]
|
|
8415
|
+
});
|
|
8416
|
+
}
|
|
8386
8417
|
const { place, addressWithBooking } = eventVenuePlace(venue);
|
|
8387
8418
|
return /* @__PURE__ */ jsxs("div", {
|
|
8388
8419
|
className: "rb-mt-6",
|
|
@@ -8402,7 +8433,11 @@ function EventVenueFact({ venue }) {
|
|
|
8402
8433
|
}) : /* @__PURE__ */ jsx(LocationMapActions, {
|
|
8403
8434
|
location: venue.location,
|
|
8404
8435
|
addressText: venue.address
|
|
8405
|
-
})
|
|
8436
|
+
}),
|
|
8437
|
+
online ? /* @__PURE__ */ jsxs("p", {
|
|
8438
|
+
className: "rb-caption rb-mt-1",
|
|
8439
|
+
children: ["You can also join online.", online.note ? ` ${online.note}` : ""]
|
|
8440
|
+
}) : null
|
|
8406
8441
|
]
|
|
8407
8442
|
});
|
|
8408
8443
|
}
|
|
@@ -8554,21 +8589,27 @@ function EventVenueMap({ venue, drawing, showMap, mapHeight, mapClassName }) {
|
|
|
8554
8589
|
}
|
|
8555
8590
|
/** One pricing projection governs the selected panel, including drop-in and whole-series behavior. */
|
|
8556
8591
|
function selectedEventPricing(event, showCost) {
|
|
8557
|
-
const isDropIn = event
|
|
8558
|
-
const wholeSeriesPricing = event
|
|
8559
|
-
const showEventCost = showCost &&
|
|
8592
|
+
const isDropIn = isDropInEvent(event);
|
|
8593
|
+
const wholeSeriesPricing = wholeSeriesPricingOf(event);
|
|
8594
|
+
const showEventCost = showCost && !isDropIn && wholeSeriesPricing === null;
|
|
8560
8595
|
return {
|
|
8561
8596
|
isDropIn,
|
|
8562
8597
|
wholeSeriesPricingDisplay: showCost ? wholeSeriesPricing : null,
|
|
8563
8598
|
eventCostLabel: showEventCost ? formatEventPrice(event) : null,
|
|
8599
|
+
depositNote: showCost && !isDropIn ? paidDepositNote(event) : null,
|
|
8564
8600
|
eventPricingCurrency: publicEventPricingCurrency(event.pricing),
|
|
8565
|
-
ticketTypes: showEventCost ? getDisplayablePricingOptions(event) : []
|
|
8601
|
+
ticketTypes: showEventCost && isPaid(event) ? getDisplayablePricingOptions(event) : []
|
|
8566
8602
|
};
|
|
8567
8603
|
}
|
|
8604
|
+
const isDropInEvent = (event) => event.bookingScope === "single_occurrence" && event.requiresRegistration === false;
|
|
8605
|
+
const wholeSeriesPricingOf = (event) => event.bookingScope === "whole_series" && event.pricing.kind !== "external" ? event.pricing : null;
|
|
8606
|
+
const isPaid = (event) => publicEventPricingType(event.pricing) !== "free";
|
|
8607
|
+
const paidDepositNote = (event) => isPaid(event) ? formatEventDepositNote(event.pricing, event.paymentTerms, event) : null;
|
|
8568
8608
|
function SelectedEventDetailsView(props) {
|
|
8569
8609
|
const { selection, showVenue, showMap, showOtherDates, showTitle, showDescription, showCapacity, mapHeight, mapClassName, acceptedItems } = props;
|
|
8570
8610
|
const selected = selection.selected;
|
|
8571
8611
|
const venue = showVenue ? selected.venue : void 0;
|
|
8612
|
+
const online = eventOnlinePlaceShown(selected, showVenue);
|
|
8572
8613
|
const pricing = selectedEventPricing(selected, props.showCost);
|
|
8573
8614
|
return /* @__PURE__ */ jsxs("div", {
|
|
8574
8615
|
className: "rb-flex rb-flex-col rb-gap-6 rb-text-left",
|
|
@@ -8586,6 +8627,7 @@ function SelectedEventDetailsView(props) {
|
|
|
8586
8627
|
selection,
|
|
8587
8628
|
selected,
|
|
8588
8629
|
venue,
|
|
8630
|
+
online,
|
|
8589
8631
|
showCapacity,
|
|
8590
8632
|
teamMembers: selected.teamMembers ?? [],
|
|
8591
8633
|
pricing: /* @__PURE__ */ jsx(EventPricingDetails, {
|
|
@@ -8678,11 +8720,14 @@ function EventHeaderPanel(props) {
|
|
|
8678
8720
|
})
|
|
8679
8721
|
});
|
|
8680
8722
|
}
|
|
8681
|
-
function HeaderPanelFacts({ venue, teamMembers, pricing }) {
|
|
8723
|
+
function HeaderPanelFacts({ venue, online, teamMembers, pricing }) {
|
|
8682
8724
|
return /* @__PURE__ */ jsxs("div", {
|
|
8683
8725
|
className: "rb-flex rb-flex-col rb-gap-4",
|
|
8684
8726
|
children: [
|
|
8685
|
-
/* @__PURE__ */ jsx(EventVenueFact, {
|
|
8727
|
+
/* @__PURE__ */ jsx(EventVenueFact, {
|
|
8728
|
+
venue,
|
|
8729
|
+
online
|
|
8730
|
+
}),
|
|
8686
8731
|
/* @__PURE__ */ jsx(EventTeacherFacts, { teamMembers }),
|
|
8687
8732
|
pricing ? /* @__PURE__ */ jsx(EventPricingDetails, { ...pricing }) : null
|
|
8688
8733
|
]
|
|
@@ -8692,15 +8737,17 @@ function HeaderPanelFacts({ venue, teamMembers, pricing }) {
|
|
|
8692
8737
|
function headerPanelContent(props) {
|
|
8693
8738
|
const { selection } = props;
|
|
8694
8739
|
const venue = props.showVenue ? selection.selected.venue : void 0;
|
|
8740
|
+
const online = eventOnlinePlaceShown(selection.selected, props.showVenue);
|
|
8695
8741
|
const teamMembers = selection.selected.teamMembers ?? [];
|
|
8696
8742
|
const pricing = headerPanelPricing(props, selection.selected);
|
|
8697
8743
|
const scheduled = selection.kind === "wholeSeries" ? selection.sessions.length : selection.otherDates.length;
|
|
8698
8744
|
return {
|
|
8699
8745
|
venue,
|
|
8746
|
+
online,
|
|
8700
8747
|
teamMembers,
|
|
8701
8748
|
pricing,
|
|
8702
8749
|
hasMap: Boolean(props.showMap && venue && props.selectedVenueDrawing),
|
|
8703
|
-
hasFacts: Boolean(venue) || teamMembers.length > 0 || pricing !== null,
|
|
8750
|
+
hasFacts: Boolean(venue) || online !== null || teamMembers.length > 0 || pricing !== null,
|
|
8704
8751
|
hasDates: props.showOtherDates && scheduled > 0
|
|
8705
8752
|
};
|
|
8706
8753
|
}
|
|
@@ -8714,6 +8761,7 @@ function headerPanelPricing(props, event) {
|
|
|
8714
8761
|
if (pricing.isDropIn) return null;
|
|
8715
8762
|
const detail = {
|
|
8716
8763
|
...pricing,
|
|
8764
|
+
depositNote: null,
|
|
8717
8765
|
acceptedItems: acceptedProductNames(props),
|
|
8718
8766
|
autoApplyDiscount: props.autoApplyDiscount ?? null
|
|
8719
8767
|
};
|
|
@@ -10673,120 +10721,168 @@ function CheckoutSSR({ blockId, siteId, apiBaseUrl, stage, demoEmailSuppressed,
|
|
|
10673
10721
|
});
|
|
10674
10722
|
}
|
|
10675
10723
|
//#endregion
|
|
10724
|
+
//#region ../blocks/src/system/runtime/nodes/gifting.parts.tsx
|
|
10725
|
+
const CUSTOM_GIFT_AMOUNT = "custom";
|
|
10726
|
+
/** A Look's hook (and, for the panel, its surface) on one part of the gifting panel; nothing outside a Look. */
|
|
10727
|
+
function giftingSlot(look, slot) {
|
|
10728
|
+
return listLookSlot(look ?? {}, slot);
|
|
10729
|
+
}
|
|
10730
|
+
/** The word above the heading: only one kind on offer names it here, two kinds label their own groups. */
|
|
10731
|
+
function giftingEyebrow(offers, headings) {
|
|
10732
|
+
const giftCards = offers?.giftCards.length ?? 0;
|
|
10733
|
+
const vouchers = offers?.vouchers.length ?? 0;
|
|
10734
|
+
if (giftCards > 0 && vouchers === 0) return headings.giftCards;
|
|
10735
|
+
if (vouchers > 0 && giftCards === 0) return headings.vouchers;
|
|
10736
|
+
return null;
|
|
10737
|
+
}
|
|
10738
|
+
function GiftingPanelHead(props) {
|
|
10739
|
+
const { look } = props;
|
|
10740
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
10741
|
+
className: "gifting-panel-head",
|
|
10742
|
+
...giftingSlot(look, "head"),
|
|
10743
|
+
children: [
|
|
10744
|
+
props.eyebrow ? /* @__PURE__ */ jsx("span", {
|
|
10745
|
+
className: "gifting-eyebrow",
|
|
10746
|
+
...giftingSlot(look, "eyebrow"),
|
|
10747
|
+
children: props.eyebrow
|
|
10748
|
+
}) : null,
|
|
10749
|
+
/* @__PURE__ */ jsx("h2", {
|
|
10750
|
+
className: "gifting-heading",
|
|
10751
|
+
...giftingSlot(look, "heading"),
|
|
10752
|
+
children: props.heading
|
|
10753
|
+
}),
|
|
10754
|
+
props.intro ? /* @__PURE__ */ jsx("p", {
|
|
10755
|
+
className: "gifting-intro",
|
|
10756
|
+
...giftingSlot(look, "intro"),
|
|
10757
|
+
children: props.intro
|
|
10758
|
+
}) : null
|
|
10759
|
+
]
|
|
10760
|
+
});
|
|
10761
|
+
}
|
|
10762
|
+
/** Amount buttons are radios, so they keep working from the keyboard and post with the form. */
|
|
10763
|
+
function GiftCardAmounts(props) {
|
|
10764
|
+
const { offer, currency, disabled, onChoose } = props;
|
|
10765
|
+
const denominations = offer.giftCard.fixedDenominations;
|
|
10766
|
+
const checkedChoice = props.initialChoice ?? firstGiftAmountChoice(offer);
|
|
10767
|
+
const chip = (value, label) => /* @__PURE__ */ jsxs("label", {
|
|
10768
|
+
className: "gifting-amount",
|
|
10769
|
+
children: [/* @__PURE__ */ jsx("input", {
|
|
10770
|
+
type: "radio",
|
|
10771
|
+
name: props.groupName ?? "amountChoice",
|
|
10772
|
+
value,
|
|
10773
|
+
required: true,
|
|
10774
|
+
disabled,
|
|
10775
|
+
defaultChecked: value === checkedChoice,
|
|
10776
|
+
onChange: onChoose ? () => onChoose(value) : void 0
|
|
10777
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
10778
|
+
...giftingSlot(props.look, "chip"),
|
|
10779
|
+
children: label
|
|
10780
|
+
})]
|
|
10781
|
+
}, value);
|
|
10782
|
+
return /* @__PURE__ */ jsxs("fieldset", {
|
|
10783
|
+
className: "gifting-amounts",
|
|
10784
|
+
...giftingSlot(props.look, "chips"),
|
|
10785
|
+
children: [
|
|
10786
|
+
/* @__PURE__ */ jsx("legend", {
|
|
10787
|
+
className: "gifting-visually-hidden",
|
|
10788
|
+
children: "Amount"
|
|
10789
|
+
}),
|
|
10790
|
+
denominations.map((amount) => chip(String(amount), formatCurrencyAmount(amount, currency))),
|
|
10791
|
+
offer.giftCard.customAmountEnabled ? chip(CUSTOM_GIFT_AMOUNT, "Another amount") : null
|
|
10792
|
+
]
|
|
10793
|
+
});
|
|
10794
|
+
}
|
|
10795
|
+
function firstGiftAmountChoice(offer) {
|
|
10796
|
+
const first = offer.giftCard.fixedDenominations[0];
|
|
10797
|
+
return first === void 0 ? CUSTOM_GIFT_AMOUNT : String(first);
|
|
10798
|
+
}
|
|
10799
|
+
//#endregion
|
|
10676
10800
|
//#region ../blocks/src/system/runtime/nodes/gifting.server.tsx
|
|
10801
|
+
/** What shows until the island takes over: the same panel, with the details form still closed. */
|
|
10677
10802
|
function GiftingSSR({ blockId, ...rest }) {
|
|
10678
10803
|
const islandProps = buildGiftingInteractiveIslandProps(rest);
|
|
10679
|
-
const
|
|
10680
|
-
const
|
|
10804
|
+
const { display, hydration } = islandProps.render;
|
|
10805
|
+
const offers = hydration.offers;
|
|
10806
|
+
const giftCards = offers?.giftCards ?? [];
|
|
10807
|
+
const vouchers = offers?.vouchers ?? [];
|
|
10808
|
+
const hasOffers = giftCards.length > 0 || vouchers.length > 0;
|
|
10809
|
+
const eyebrow = giftingEyebrow(offers, {
|
|
10810
|
+
giftCards: display.giftCardsHeading,
|
|
10811
|
+
vouchers: display.vouchersHeading
|
|
10812
|
+
});
|
|
10681
10813
|
return /* @__PURE__ */ jsx(IslandRoot, {
|
|
10682
10814
|
kind: "gifting",
|
|
10683
10815
|
id: blockId,
|
|
10684
10816
|
as: "section",
|
|
10685
10817
|
attributes: {
|
|
10686
10818
|
className: rest.className ?? void 0,
|
|
10687
|
-
"data-block": "gifting"
|
|
10688
|
-
style: { color: "rgb(var(--tb-text, 17 24 39))" }
|
|
10819
|
+
"data-block": "gifting"
|
|
10689
10820
|
},
|
|
10690
10821
|
value: islandProps,
|
|
10691
10822
|
children: /* @__PURE__ */ jsxs("div", {
|
|
10692
|
-
className: "
|
|
10693
|
-
|
|
10694
|
-
children: [/* @__PURE__ */
|
|
10695
|
-
|
|
10696
|
-
|
|
10697
|
-
|
|
10698
|
-
|
|
10699
|
-
fontSize: "clamp(1.75rem, 3vw, 2.5rem)",
|
|
10700
|
-
fontWeight: 700,
|
|
10701
|
-
margin: 0
|
|
10702
|
-
},
|
|
10703
|
-
children: islandProps.render.display.heading
|
|
10704
|
-
}), islandProps.render.display.intro ? /* @__PURE__ */ jsx("p", {
|
|
10705
|
-
style: {
|
|
10706
|
-
margin: 0,
|
|
10707
|
-
color: "rgb(var(--tb-text, 17 24 39) / 0.72)"
|
|
10708
|
-
},
|
|
10709
|
-
children: islandProps.render.display.intro
|
|
10710
|
-
}) : null]
|
|
10823
|
+
className: "gifting-panel",
|
|
10824
|
+
...giftingSlot(display, "panel"),
|
|
10825
|
+
children: [/* @__PURE__ */ jsx(GiftingPanelHead, {
|
|
10826
|
+
eyebrow,
|
|
10827
|
+
heading: display.heading,
|
|
10828
|
+
intro: display.intro,
|
|
10829
|
+
look: display
|
|
10711
10830
|
}), hasOffers ? /* @__PURE__ */ jsxs("div", {
|
|
10712
|
-
className: "
|
|
10713
|
-
|
|
10714
|
-
|
|
10715
|
-
|
|
10716
|
-
|
|
10717
|
-
|
|
10718
|
-
|
|
10719
|
-
|
|
10720
|
-
|
|
10721
|
-
|
|
10722
|
-
|
|
10723
|
-
|
|
10724
|
-
|
|
10725
|
-
|
|
10726
|
-
|
|
10727
|
-
|
|
10728
|
-
|
|
10729
|
-
|
|
10730
|
-
|
|
10731
|
-
|
|
10732
|
-
|
|
10733
|
-
},
|
|
10734
|
-
|
|
10735
|
-
|
|
10736
|
-
|
|
10737
|
-
|
|
10738
|
-
|
|
10739
|
-
|
|
10740
|
-
|
|
10741
|
-
|
|
10742
|
-
|
|
10743
|
-
|
|
10744
|
-
|
|
10745
|
-
|
|
10746
|
-
|
|
10747
|
-
|
|
10748
|
-
|
|
10749
|
-
|
|
10750
|
-
|
|
10751
|
-
|
|
10752
|
-
|
|
10753
|
-
|
|
10754
|
-
|
|
10755
|
-
|
|
10756
|
-
|
|
10757
|
-
|
|
10758
|
-
|
|
10759
|
-
|
|
10760
|
-
|
|
10761
|
-
|
|
10762
|
-
|
|
10763
|
-
|
|
10764
|
-
style: {
|
|
10765
|
-
border: "1px solid rgb(var(--tb-text, 17 24 39) / 0.12)",
|
|
10766
|
-
borderRadius: "1rem",
|
|
10767
|
-
padding: "1rem",
|
|
10768
|
-
background: "rgb(var(--tb-surface, 255 255 255) / 0.92)"
|
|
10769
|
-
},
|
|
10770
|
-
children: [/* @__PURE__ */ jsx("h4", {
|
|
10771
|
-
style: {
|
|
10772
|
-
margin: 0,
|
|
10773
|
-
fontSize: "1.05rem",
|
|
10774
|
-
fontWeight: 700
|
|
10775
|
-
},
|
|
10776
|
-
children: offer.title
|
|
10777
|
-
}), offer.description ? /* @__PURE__ */ jsx("p", {
|
|
10778
|
-
style: {
|
|
10779
|
-
margin: "0.5rem 0 0",
|
|
10780
|
-
color: "rgb(var(--tb-text, 17 24 39) / 0.72)"
|
|
10781
|
-
},
|
|
10782
|
-
children: offer.description
|
|
10783
|
-
}) : null]
|
|
10784
|
-
}, offer.id))
|
|
10785
|
-
})]
|
|
10786
|
-
}) : null]
|
|
10831
|
+
className: "gifting-panel-offers",
|
|
10832
|
+
children: [giftCards.map((offer) => /* @__PURE__ */ jsxs("div", {
|
|
10833
|
+
className: "gifting-offer",
|
|
10834
|
+
"data-gift-offer": offer.id,
|
|
10835
|
+
children: [
|
|
10836
|
+
giftCards.length > 1 ? /* @__PURE__ */ jsx("h3", {
|
|
10837
|
+
className: "gifting-offer-title",
|
|
10838
|
+
children: offer.title
|
|
10839
|
+
}) : null,
|
|
10840
|
+
offer.description ? /* @__PURE__ */ jsx("p", {
|
|
10841
|
+
className: "gifting-offer-description",
|
|
10842
|
+
children: offer.description
|
|
10843
|
+
}) : null,
|
|
10844
|
+
/* @__PURE__ */ jsxs("div", {
|
|
10845
|
+
className: "gifting-offer-row",
|
|
10846
|
+
"data-gift-offer-row": "",
|
|
10847
|
+
children: [/* @__PURE__ */ jsx(GiftCardAmounts, {
|
|
10848
|
+
offer,
|
|
10849
|
+
currency: offers?.currency ?? "GBP",
|
|
10850
|
+
groupName: `amountChoice-${offer.id}`,
|
|
10851
|
+
look: display
|
|
10852
|
+
}), /* @__PURE__ */ jsx(ThemedButton, {
|
|
10853
|
+
...giftingSlot(display, "action"),
|
|
10854
|
+
type: "button",
|
|
10855
|
+
variant: "primary",
|
|
10856
|
+
size: "md",
|
|
10857
|
+
extraClassName: "gifting-buy",
|
|
10858
|
+
label: "Buy a gift card"
|
|
10859
|
+
})]
|
|
10860
|
+
})
|
|
10861
|
+
]
|
|
10862
|
+
}, offer.id)), vouchers.map((offer) => /* @__PURE__ */ jsxs("div", {
|
|
10863
|
+
className: "gifting-offer",
|
|
10864
|
+
children: [
|
|
10865
|
+
/* @__PURE__ */ jsx("h3", {
|
|
10866
|
+
className: "gifting-offer-title",
|
|
10867
|
+
children: offer.title
|
|
10868
|
+
}),
|
|
10869
|
+
offer.description ? /* @__PURE__ */ jsx("p", {
|
|
10870
|
+
className: "gifting-offer-description",
|
|
10871
|
+
children: offer.description
|
|
10872
|
+
}) : null,
|
|
10873
|
+
/* @__PURE__ */ jsx(ThemedButton, {
|
|
10874
|
+
...giftingSlot(display, "action"),
|
|
10875
|
+
type: "button",
|
|
10876
|
+
variant: "primary",
|
|
10877
|
+
size: "md",
|
|
10878
|
+
extraClassName: "gifting-buy",
|
|
10879
|
+
label: "Buy this voucher"
|
|
10880
|
+
})
|
|
10881
|
+
]
|
|
10882
|
+
}, offer.id))]
|
|
10787
10883
|
}) : /* @__PURE__ */ jsx("p", {
|
|
10788
|
-
|
|
10789
|
-
children:
|
|
10884
|
+
className: "gifting-empty",
|
|
10885
|
+
children: display.emptyStateText
|
|
10790
10886
|
})]
|
|
10791
10887
|
})
|
|
10792
10888
|
});
|
|
@@ -11120,6 +11216,10 @@ const WeekAgendaView = ({ days, events, showCapacity, showVenue = true, emptyMes
|
|
|
11120
11216
|
});
|
|
11121
11217
|
};
|
|
11122
11218
|
//#endregion
|
|
11219
|
+
//#region ../blocks/src/system/runtime/nodes/events/shared/CalendarLoadFailure.tsx
|
|
11220
|
+
/** The same words on the calendar and the week board. */
|
|
11221
|
+
const CALENDAR_LOAD_FAILURE_MESSAGE = "We couldn’t load the events for these dates.";
|
|
11222
|
+
//#endregion
|
|
11123
11223
|
//#region ../blocks/src/system/runtime/nodes/events/shared/CalendarNavigationChevron.tsx
|
|
11124
11224
|
function CalendarNavigationChevron({ direction }) {
|
|
11125
11225
|
return /* @__PURE__ */ jsx("svg", {
|
|
@@ -11281,7 +11381,7 @@ const WeekBoardLoadError = ({ navigation, buttonVariant }) => {
|
|
|
11281
11381
|
return /* @__PURE__ */ jsxs("div", {
|
|
11282
11382
|
className: "event-week-board-error",
|
|
11283
11383
|
role: "status",
|
|
11284
|
-
children: [/* @__PURE__ */ jsx("p", { children:
|
|
11384
|
+
children: [/* @__PURE__ */ jsx("p", { children: CALENDAR_LOAD_FAILURE_MESSAGE }), /* @__PURE__ */ jsx(ThemedButton, {
|
|
11285
11385
|
type: "button",
|
|
11286
11386
|
variant: buttonVariant,
|
|
11287
11387
|
size: "sm",
|
|
@@ -11889,6 +11989,16 @@ function EventBookingPanelView({ panel, pageKind, children }) {
|
|
|
11889
11989
|
function EventBookingPanelBody({ panel }) {
|
|
11890
11990
|
switch (panel.kind) {
|
|
11891
11991
|
case "registration": return null;
|
|
11992
|
+
case "cancelled": return /* @__PURE__ */ jsxs("div", {
|
|
11993
|
+
className: "event-booking-panel__cancelled",
|
|
11994
|
+
children: [/* @__PURE__ */ jsx("h2", {
|
|
11995
|
+
className: "card-title rb-mb-3",
|
|
11996
|
+
children: cancelledDateCopy.titleText
|
|
11997
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
11998
|
+
className: "status-muted rb-text-base rb-leading-relaxed",
|
|
11999
|
+
children: cancelledDateCopy.bodyText
|
|
12000
|
+
})]
|
|
12001
|
+
});
|
|
11892
12002
|
case "dropIn": return /* @__PURE__ */ jsx(DropInPanel, { panel: panel.panel });
|
|
11893
12003
|
case "bookingClosed": return /* @__PURE__ */ jsx(BookingClosedPanel, { detail: panel.detail });
|
|
11894
12004
|
case "closedRun": return /* @__PURE__ */ jsx(ClosedRunPanel, { reason: panel.reason });
|
|
@@ -11908,6 +12018,7 @@ function EventBookingPanelBody({ panel }) {
|
|
|
11908
12018
|
}
|
|
11909
12019
|
function SingleDateBooking({ run }) {
|
|
11910
12020
|
const href = getPublicEventCanonicalPath(run.representative);
|
|
12021
|
+
const coversAll = wholeCourseNote(run);
|
|
11911
12022
|
return /* @__PURE__ */ jsxs("div", {
|
|
11912
12023
|
className: "event-booking-panel__single-date",
|
|
11913
12024
|
children: [
|
|
@@ -11915,9 +12026,9 @@ function SingleDateBooking({ run }) {
|
|
|
11915
12026
|
className: "card-title rb-mb-3",
|
|
11916
12027
|
children: "Book your place"
|
|
11917
12028
|
}),
|
|
11918
|
-
/* @__PURE__ */
|
|
12029
|
+
/* @__PURE__ */ jsxs("p", {
|
|
11919
12030
|
className: "event-booking-panel__run-dates status-muted rb-mb-4 rb-text-base rb-leading-relaxed",
|
|
11920
|
-
children: describeRun(run)
|
|
12031
|
+
children: [describeRun(run), coversAll ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("br", {}), coversAll] }) : null]
|
|
11921
12032
|
}),
|
|
11922
12033
|
href ? /* @__PURE__ */ jsx(ThemedButtonLink, {
|
|
11923
12034
|
variant: "primary",
|
|
@@ -12011,11 +12122,11 @@ function RunChooser({ runs }) {
|
|
|
12011
12122
|
})]
|
|
12012
12123
|
});
|
|
12013
12124
|
}
|
|
12014
|
-
/** "12 sessions from 5 March" — enough to tell two runs apart in a list. */
|
|
12125
|
+
/** "12 sessions from 5 March" — enough to tell two runs apart in a list. Cancelled sessions aren't counted. */
|
|
12015
12126
|
function describeRun(run) {
|
|
12016
|
-
const
|
|
12017
|
-
const
|
|
12018
|
-
const
|
|
12127
|
+
const sessions = orderedLiveRunSessions(run.run.sessions);
|
|
12128
|
+
const first = sessions[0];
|
|
12129
|
+
const sessionLabel = sessionCountLabel(sessions.length);
|
|
12019
12130
|
if (!first) return sessionLabel;
|
|
12020
12131
|
return `${sessionLabel} from ${formatDate$1({
|
|
12021
12132
|
kind: "instant",
|
|
@@ -12028,6 +12139,12 @@ function describeRun(run) {
|
|
|
12028
12139
|
weekday: "long"
|
|
12029
12140
|
})}`;
|
|
12030
12141
|
}
|
|
12142
|
+
const sessionCountLabel = (count) => count === 1 ? "1 session" : `${count} sessions`;
|
|
12143
|
+
/** Said before booking, as the first step of booking says it: one place covers the whole course. */
|
|
12144
|
+
function wholeCourseNote(run) {
|
|
12145
|
+
const count = orderedLiveRunSessions(run.run.sessions).length;
|
|
12146
|
+
return count > 1 ? `One booking covers all ${count} sessions.` : null;
|
|
12147
|
+
}
|
|
12031
12148
|
//#endregion
|
|
12032
12149
|
//#region ../blocks/src/system/runtime/nodes/event-registration/bookingPanelSelection.ts
|
|
12033
12150
|
/** Adapt a loaded page surface to the existing page planners. Catalogues keep their picker. */
|
|
@@ -12086,6 +12203,10 @@ function selectOccurrenceForPanel(events, occurrenceId) {
|
|
|
12086
12203
|
} : null;
|
|
12087
12204
|
}
|
|
12088
12205
|
function planEventBookingPanel({ selection, subject }, now) {
|
|
12206
|
+
if (isCancelledDateSelection(selection)) return {
|
|
12207
|
+
kind: "cancelled",
|
|
12208
|
+
registration: null
|
|
12209
|
+
};
|
|
12089
12210
|
const nonBookingPanel = planNonBookingPanel(selection);
|
|
12090
12211
|
switch (selection.kind) {
|
|
12091
12212
|
case "occurrence":
|
|
@@ -12161,6 +12282,10 @@ function selectionRegistrationTarget(selection, subject) {
|
|
|
12161
12282
|
};
|
|
12162
12283
|
}
|
|
12163
12284
|
}
|
|
12285
|
+
/** Cancelled dates have no new-booking or recovery form, including old direct links. */
|
|
12286
|
+
function isCancelledDateSelection(selection) {
|
|
12287
|
+
return selection.kind === "occurrence" && hasCancelledRegistrationDate([selection.event]);
|
|
12288
|
+
}
|
|
12164
12289
|
//#endregion
|
|
12165
12290
|
//#region ../blocks/src/system/runtime/nodes/event-registration/RegistrationClosedState.tsx
|
|
12166
12291
|
function RegistrationClosedState({ title, body }) {
|
|
@@ -12955,14 +13080,14 @@ function NewsletterSubmitRow({ emailField, lookSlots, buttonVariant, buttonLabel
|
|
|
12955
13080
|
});
|
|
12956
13081
|
}
|
|
12957
13082
|
/** Visitor-chosen topics as toggle chips. Real checkboxes underneath. */
|
|
12958
|
-
function NewsletterTopicChips({ choices, disabled, error }) {
|
|
13083
|
+
function NewsletterTopicChips({ choices, question, disabled, error }) {
|
|
12959
13084
|
const errorId = `newsletter_${TOPIC_CHOICE_FIELD_ID}-error`;
|
|
12960
13085
|
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("fieldset", {
|
|
12961
13086
|
className: "newsletter-topics",
|
|
12962
13087
|
"aria-describedby": error ? errorId : void 0,
|
|
12963
13088
|
children: [/* @__PURE__ */ jsx("legend", {
|
|
12964
13089
|
className: "newsletter-topics-legend",
|
|
12965
|
-
children:
|
|
13090
|
+
children: question
|
|
12966
13091
|
}), /* @__PURE__ */ jsx("div", {
|
|
12967
13092
|
className: "newsletter-topic-chips",
|
|
12968
13093
|
children: choices.map((choice) => /* @__PURE__ */ jsxs("label", {
|
|
@@ -13035,7 +13160,10 @@ function NewsletterFormSSR(props) {
|
|
|
13035
13160
|
className: "newsletter-form-fields",
|
|
13036
13161
|
...listLookSlot(display, "grid"),
|
|
13037
13162
|
children: [
|
|
13038
|
-
islandProps.render.hydration.choicePresentation === "visitor_choice" ? /* @__PURE__ */ jsx(NewsletterTopicChips, {
|
|
13163
|
+
islandProps.render.hydration.choicePresentation === "visitor_choice" ? /* @__PURE__ */ jsx(NewsletterTopicChips, {
|
|
13164
|
+
choices: display.choices,
|
|
13165
|
+
question: display.topicsQuestion
|
|
13166
|
+
}) : null,
|
|
13039
13167
|
extraFields.length > 0 ? /* @__PURE__ */ jsx("div", {
|
|
13040
13168
|
className: "newsletter-extra-fields",
|
|
13041
13169
|
...listLookSlot(display, "items"),
|
|
@@ -14331,8 +14459,10 @@ function bindItemSurfacePresentation(node, context) {
|
|
|
14331
14459
|
if (!isPlainObject(content) || !isPlainObject(content._effectiveLook)) return context;
|
|
14332
14460
|
const look = content._effectiveLook;
|
|
14333
14461
|
if (!look.surfacePresentation) return context;
|
|
14334
|
-
const
|
|
14335
|
-
const
|
|
14462
|
+
const itemScope = context.scopes.reduce((found, scope) => scope.repeater ? scope : found, void 0);
|
|
14463
|
+
const repeater = itemScope?.repeater;
|
|
14464
|
+
const featured = isPlainObject(itemScope?.value) && itemScope.value.featured === true;
|
|
14465
|
+
const role = repeater ? itemRole(repeater.index, repeater.count, look.itemRoles, featured) : void 0;
|
|
14336
14466
|
return {
|
|
14337
14467
|
...context,
|
|
14338
14468
|
surfacePresentation: selectItemSurfacePresentation(look.surfacePresentation, role)
|
|
@@ -15577,13 +15707,15 @@ function prepareEntry(entry, input) {
|
|
|
15577
15707
|
}
|
|
15578
15708
|
}
|
|
15579
15709
|
/**
|
|
15580
|
-
* Editor admission validates
|
|
15581
|
-
* proof.
|
|
15710
|
+
* Editor admission validates what the owner still decides, without minting a
|
|
15711
|
+
* renderable proof. The Look's decisions are not authoring choices (a frame's
|
|
15712
|
+
* 4/5 is not on the block's ratio list), so the preview renders them unvalidated,
|
|
15713
|
+
* as a public page does, and a hidden stale value can't block it. Returns `null`
|
|
15714
|
+
* when even relaxed validation rejects the draft.
|
|
15582
15715
|
*/
|
|
15583
15716
|
function previewableEditorContent(entry) {
|
|
15584
15717
|
if (entry.block.presentationAdmission.kind !== "editor") return entry.renderableContent;
|
|
15585
|
-
|
|
15586
|
-
return draft.kind === "previewable" ? draft.data : null;
|
|
15718
|
+
return validateManifestDraft(compileManifestContentContract(entry.definition.manifest), entry.ownerEditableContent).kind === "previewable" ? entry.renderableContent : null;
|
|
15587
15719
|
}
|
|
15588
15720
|
function buildPreparedContent(entry, content, input) {
|
|
15589
15721
|
const { dataContext } = input;
|