@riverbankcms/sdk 0.169.0 → 0.170.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.
Files changed (203) hide show
  1. package/dist/_dts/{BlocksIslandsHydrator-DpROiz12.d.ts → BlocksIslandsHydrator-B2i5CY_X.d.ts} +1 -1
  2. package/dist/_dts/{Page-DHBBDRC_.d.ts → Page-BSZjbeRK.d.ts} +7 -7
  3. package/dist/_dts/{SdkPreviewMode-CG7Qib7u.d.ts → SdkPreviewMode-BZpPBMcu.d.ts} +2 -2
  4. package/dist/_dts/{client-MURxFla9.d.ts → client-x82SZgwK.d.ts} +1 -1
  5. package/dist/_dts/{content-types-ClBGjxBV.d.ts → content-types-CODkxsZy.d.ts} +2 -2
  6. package/dist/_dts/{contracts-CHNvzh0y.d.ts → contracts-Lyfhmbjf.d.ts} +3 -3
  7. package/dist/_dts/{footerPageOutline-DQM934Fm.d.ts → footerPageOutline-BShG2GAV.d.ts} +6 -6
  8. package/dist/_dts/{generatePageMetadata-ConZaEqB.d.ts → generatePageMetadata-DLhUW3xK.d.ts} +2 -2
  9. package/dist/_dts/{index-BaDqRekr.d.ts → index-B7Mq5M6P.d.ts} +4 -4
  10. package/dist/_dts/{index-CovKPftP.d.ts → index-B82pqQAC.d.ts} +2 -2
  11. package/dist/_dts/{index-CiR_oPYT.d.ts → index-BisbMZTW.d.ts} +1 -1
  12. package/dist/_dts/{index-CVB5wgbz.d.ts → index-C3rMEJ5a.d.ts} +2 -2
  13. package/dist/_dts/{index-DDaX-K2D.d.ts → index-CCugONHM.d.ts} +1 -1
  14. package/dist/_dts/{index-rfAssXq0.d.ts → index-CstY6ZMa.d.ts} +3 -3
  15. package/dist/_dts/{index-DCw8LO4M.d.ts → index-DXc_ewhR.d.ts} +1 -1
  16. package/dist/_dts/{loadContent-CRLKVVDP.d.ts → loadContent-BoqtbbhP.d.ts} +7 -7
  17. package/dist/_dts/{request-DeVetKBr.d.ts → request-CJ_ClHLv.d.ts} +39255 -37305
  18. package/dist/_dts/{resolveBlockData-C5KYFeig.d.ts → resolveBlockData-DFExYkJ4.d.ts} +5 -5
  19. package/dist/_dts/{resolvePageContent-D8MZWyNO.d.ts → resolvePageContent-D-WvpC_d.d.ts} +2 -2
  20. package/dist/_dts/sdk/src/bookings/index.d.ts +2 -2
  21. package/dist/_dts/sdk/src/client/types.d.ts +2 -2
  22. package/dist/_dts/sdk/src/client.d.ts +7 -7
  23. package/dist/_dts/sdk/src/config/index.d.ts +6 -6
  24. package/dist/_dts/sdk/src/config/template-validation.d.ts +1 -1
  25. package/dist/_dts/sdk/src/config/validation.d.ts +1 -1
  26. package/dist/_dts/sdk/src/data/dataLoaderContext.d.ts +2 -2
  27. package/dist/_dts/sdk/src/data/resolveBlockData.d.ts +1 -1
  28. package/dist/_dts/sdk/src/data/types.d.ts +2 -2
  29. package/dist/_dts/sdk/src/index.d.ts +8 -8
  30. package/dist/_dts/sdk/src/manifest/index.d.ts +3 -3
  31. package/dist/_dts/sdk/src/metadata/index.d.ts +1 -1
  32. package/dist/_dts/sdk/src/navigation/index.d.ts +2 -2
  33. package/dist/_dts/sdk/src/next/index.d.ts +7 -7
  34. package/dist/_dts/sdk/src/next/middleware.d.ts +2 -2
  35. package/dist/_dts/sdk/src/page-converter/index.d.ts +3 -3
  36. package/dist/_dts/sdk/src/portal/client.d.ts +1 -1
  37. package/dist/_dts/sdk/src/prebuild/index.d.ts +1 -1
  38. package/dist/_dts/sdk/src/preview-next/before-render.d.ts +2 -2
  39. package/dist/_dts/sdk/src/preview-next/client/index.d.ts +2 -2
  40. package/dist/_dts/sdk/src/preview-next/client/runtime.d.ts +1 -1
  41. package/dist/_dts/sdk/src/rendering/client.d.ts +2 -2
  42. package/dist/_dts/sdk/src/rendering/components/pageShared.d.ts +1 -1
  43. package/dist/_dts/sdk/src/rendering/helpers/loadPage.d.ts +1 -1
  44. package/dist/_dts/sdk/src/rendering/helpers/pageRuntimeSupport.d.ts +4 -4
  45. package/dist/_dts/sdk/src/rendering/index.d.ts +6 -6
  46. package/dist/_dts/sdk/src/rendering/islands/client.d.ts +1 -1
  47. package/dist/_dts/sdk/src/rendering/server.d.ts +2 -2
  48. package/dist/_dts/sdk/src/rendering/themeAdmission.d.ts +1 -1
  49. package/dist/_dts/sdk/src/routing/index.d.ts +5 -5
  50. package/dist/_dts/sdk/src/server.d.ts +5 -5
  51. package/dist/_dts/sdk/src/spam-protection/index.d.ts +2 -2
  52. package/dist/_dts/sdk/src/theme/index.d.ts +1 -1
  53. package/dist/_dts/{types-Fj31kIi2.d.ts → types-990t4t99.d.ts} +7 -7
  54. package/dist/_dts/{types-B4MBlP_B.d.ts → types-CbjK5ZLy.d.ts} +2 -2
  55. package/dist/_dts/{types-OwqfS8Gn.d.ts → types-CpuxuS40.d.ts} +3 -3
  56. package/dist/_dts/{validation-B1Fa8o_b.d.ts → validation-BN95LiS0.d.ts} +4 -4
  57. package/dist/client/BlocksIslandsHydrator-B1Tkg-ZW.mjs +410 -0
  58. package/dist/client/{BookingMailingListNote-y3qWjnOo.mjs → BookingMailingListNote-Br1VyHkP.mjs} +5 -5
  59. package/dist/client/{BookingQuestionFields-DjLjd0vc.mjs → BookingQuestionFields-LLGCWjvU.mjs} +1 -1
  60. package/dist/client/{CalendarNavigationChevron-VM7C2fdh.mjs → CalendarNavigationChevron-CH7z2m47.mjs} +4 -4
  61. package/dist/client/{DemoBookingPortalAccess-C2QCj_Ta.mjs → DemoBookingPortalAccess-Cilv5zdS.mjs} +3 -3
  62. package/dist/client/{EventCalendar.client-DDjz7tuX.mjs → EventCalendar.client-LXUHJEi7.mjs} +7 -7
  63. package/dist/client/{EventCombined.client-CeYbNsch.mjs → EventCombined.client-DpugEJLB.mjs} +5 -5
  64. package/dist/client/{EventItem-B5J0IeF4.mjs → EventItem-gFuZn-dE.mjs} +7 -6
  65. package/dist/client/{EventListWeekNavigation-eH04D8-V.mjs → EventListWeekNavigation-D-kLg1jQ.mjs} +2 -1
  66. package/dist/client/{EventListing.client-slpvrTrM.mjs → EventListing.client-BNACUaxV.mjs} +3 -3
  67. package/dist/client/{EventListing.view-BYBaElec.mjs → EventListing.view-CtVfe3VG.mjs} +5 -6
  68. package/dist/client/{EventRegistrationPayment-Do7Q0wRG.mjs → EventRegistrationPayment-CqH3hE-k.mjs} +18 -10
  69. package/dist/client/Page-PW4Ojv9r.mjs +29977 -0
  70. package/dist/client/{StepIndicator-BZNUd0-v.mjs → StepIndicator-CR7_0yu4.mjs} +4 -3
  71. package/dist/client/{accessibleSurfaces-chpD4C2c.mjs → accessibleSurfaces-_7jkuinl.mjs} +56 -8
  72. package/dist/client/{accordion-BCtVxnDZ.mjs → accordion-DMItWylU.mjs} +6 -1
  73. package/dist/client/{booking-form.client-Cr5G-HHO.mjs → booking-form.client-wd71DG19.mjs} +10 -10
  74. package/dist/client/bookingForm-Cyr2qeS1.mjs +31 -0
  75. package/dist/client/bookings.mjs +4 -4
  76. package/dist/client/{carousel-DW-HgjvT.mjs → carousel-B5-Hzzif.mjs} +7 -9
  77. package/dist/client/{carousel.client-BD4DXMtI.mjs → carousel.client-eSSr1oYA.mjs} +2 -2
  78. package/dist/client/{cart-D1zWe4R7.mjs → cart-wlRXnOjO.mjs} +3 -3
  79. package/dist/client/{cart.client-CIfbTLHS.mjs → cart.client-CfpnxTUZ.mjs} +1 -1
  80. package/dist/client/{checkout-fDCNZ3IT.mjs → checkout-Dnu9W8IA.mjs} +3 -3
  81. package/dist/client/{checkout.client-C4l2KjtV.mjs → checkout.client-ovtyXyn0.mjs} +1 -1
  82. package/dist/client/{checkoutUrls-cWL6I-Vz.mjs → checkoutUrls-CY8qywXl.mjs} +1 -1
  83. package/dist/client/client.mjs +40 -12
  84. package/dist/client/{createLucideIcon-CIbxe9em.mjs → createLucideIcon-BrXgHVKN.mjs} +9 -9
  85. package/dist/client/{cta-Bj5WHgcv.mjs → cta-CfuyGqXL.mjs} +1 -1
  86. package/dist/client/{demoPortalMagicLink-3uVu3WgG.mjs → demoPortalMagicLink-DQtwf_s2.mjs} +1 -1
  87. package/dist/client/{display-CT8KMSpH.mjs → display-DDNmyb0z.mjs} +18 -793
  88. package/dist/client/{enhanceHeaderSection-B27KFGDv.mjs → enhanceHeaderSection-D7gRy-pL.mjs} +3 -3
  89. package/dist/client/{event-details.client-CL4Lqz2c.mjs → event-details.client-DZZaoCUc.mjs} +1 -1
  90. package/dist/client/{event-registration.client-Dj3Kyp5X.mjs → event-registration.client-CLBdHUfd.mjs} +12 -11
  91. package/dist/client/{eventCalendar-DGsdSF8J.mjs → eventCalendar-B4VbblGN.mjs} +14 -17
  92. package/dist/client/eventCombined-e2AvbA0u.mjs +25 -0
  93. package/dist/client/{eventDetails-DzMskXYA.mjs → eventDetails-DIJYMzVg.mjs} +4 -6
  94. package/dist/client/eventListing-C0bpAR1t.mjs +26 -0
  95. package/dist/client/eventRegistration-DyseP_sY.mjs +31 -0
  96. package/dist/client/flightRegistrations-DjYm0Wz6.mjs +45 -0
  97. package/dist/client/form-Cfl8d6qc.mjs +27 -0
  98. package/dist/client/{form.client-CCl6CpRJ.mjs → form.client-D3_RF29v.mjs} +3 -3
  99. package/dist/client/{form.parts-BOJ1yDDf.mjs → form.parts-DWLf_3PF.mjs} +1 -1
  100. package/dist/client/formSnapshot-Cy4abc0T.mjs +73 -0
  101. package/dist/client/gifting/client.mjs +1 -1
  102. package/dist/client/{headerSection-q_bEzfhW.mjs → headerSection-CyNGt23J.mjs} +2 -2
  103. package/dist/client/{newsletter-form.client-CiqKAmPs.mjs → newsletter-form.client-IfLup4o0.mjs} +4 -4
  104. package/dist/client/{newsletter-form.parts-x1RzAMNO.mjs → newsletter-form.parts-DDD-LRyW.mjs} +1 -1
  105. package/dist/client/newsletterForm-Bn7HVbuq.mjs +27 -0
  106. package/dist/client/portal/client.mjs +5 -5
  107. package/dist/client/{product-detail.client-rWUvpVvZ.mjs → product-detail.client-BXeLqkCE.mjs} +1 -1
  108. package/dist/client/{product-list.client-J0wDOmKv.mjs → product-list.client-C627X8DQ.mjs} +1 -1
  109. package/dist/client/{productDetail-LtCkMrJ0.mjs → productDetail-B-K_hd7Y.mjs} +3 -3
  110. package/dist/client/{productList-C0MLeh-v.mjs → productList-BNZAsfaP.mjs} +3 -3
  111. package/dist/client/{propsDecoder-CAmEkJ6Y.mjs → propsDecoder-Dc8j5i79.mjs} +2 -2
  112. package/dist/client/reactMount-DFQy3CmO.mjs +51 -0
  113. package/dist/client/{registry.server-Bf2YX_4v.mjs → registry.server-CBg2M6Uj.mjs} +352 -288
  114. package/dist/client/rendering/client.mjs +36 -36
  115. package/dist/client/rendering/islandDelivery.flight.mjs +132 -0
  116. package/dist/client/rendering/islands.mjs +1 -1
  117. package/dist/client/rendering.mjs +4 -4
  118. package/dist/client/{routeIslandApiConfig-UdAlnZGQ.mjs → routeIslandApiConfig-DFjRKvzM.mjs} +1 -1
  119. package/dist/client/{runtimeResponse-Dg4XFsuM.mjs → runtimeResponse-BGU8sMZY.mjs} +1 -1
  120. package/dist/client/runtimeResponse-D2LT--Gj.mjs +3 -0
  121. package/dist/client/{shop-Dkn6EasY.mjs → shop-PgmiVKSV.mjs} +3 -3
  122. package/dist/client/{shop-commerce-bo0Z6kwf.mjs → shop-commerce-DkgvZAQS.mjs} +10 -10
  123. package/dist/client/{shop-commerce-store-Ckxa4_jI.mjs → shop-commerce-store-D9CHihQv.mjs} +1 -1
  124. package/dist/client/{shop.client-B_GqU6_U.mjs → shop.client-DDFRt6OU.mjs} +10 -10
  125. package/dist/client/{shop.interactive-C6L_Ig5F.mjs → shop.interactive-BH0xDlMF.mjs} +37 -12
  126. package/dist/client/{shopShared-CO1Y8lFd.mjs → shopShared-BEfD0e4m.mjs} +12 -15
  127. package/dist/client/{timetableModel-D62jfOxZ.mjs → timetableModel-GsDrJxxw.mjs} +6 -6
  128. package/dist/client/{useAvailableSlots-CStfVmyY.mjs → useAvailableSlots-GP8tnAVW.mjs} +1 -1
  129. package/dist/client/{useDiscountApply-Ca2pHUDu.mjs → useDiscountApply-Cq07nTyG.mjs} +1 -1
  130. package/dist/client/{useDiscountCodeUi-AEifktGO.mjs → useDiscountCodeUi-CD82QX5i.mjs} +1 -1
  131. package/dist/client/{useEventPagination-uxnUWI2v.mjs → useEventPagination-DGl4Jeuz.mjs} +5 -5
  132. package/dist/client/{view-SVnWic7i.mjs → view-CgComegl.mjs} +2 -2
  133. package/dist/client/{view-B6KSxQMO.mjs → view-oToSpu1N.mjs} +3 -3
  134. package/dist/preview-next/chrome.css +4 -0
  135. package/dist/preview-next/client/{ArrangementLookControls-kbdqYkWM.mjs → ArrangementLookControls-DJQrgD5f.mjs} +12 -19
  136. package/dist/preview-next/client/{LocationPickerEnvironment-CZQ4vkRe.mjs → LocationPickerEnvironment-CwxRbAs2.mjs} +1 -1
  137. package/dist/preview-next/client/{MapLibreEditMap-CP4w7T_0.mjs → MapLibreEditMap-CKjYUp_E.mjs} +2 -2
  138. package/dist/preview-next/client/{PreviewEditorSidebar-DI_LhsMQ.mjs → PreviewEditorSidebar-DWU6X6Y-.mjs} +119 -133
  139. package/dist/preview-next/client/{PreviewEditorUI-yyD-ZREP.mjs → PreviewEditorUI-C-X0ptC3.mjs} +7 -39
  140. package/dist/preview-next/client/{PreviewShell-YauP65Gi.mjs → PreviewShell-C1WUNsj9.mjs} +40 -46
  141. package/dist/preview-next/client/{SdkPreviewModeRuntime-Bl7jQMI1.mjs → SdkPreviewModeRuntime-Cs2QFT7k.mjs} +11 -9
  142. package/dist/preview-next/client/{SiteChromeCustomizeButton-CQFRP9aM.mjs → SiteChromeCustomizeButton-CcZ_ERvZ.mjs} +844 -23038
  143. package/dist/preview-next/client/{lucide-react-DkZ8fO-G.mjs → lucide-react-DbC1o6_9.mjs} +11 -11
  144. package/dist/preview-next/client/{previewAssistantSlot-DSR0IdAw.mjs → previewAssistantSlot-CSs9S8wr.mjs} +357 -924
  145. package/dist/preview-next/client/{previewChromeSurface-uSnVzeNs.mjs → previewChromeRoot-B2OTurZH.mjs} +52 -14
  146. package/dist/preview-next/client/runtime.mjs +3 -3
  147. package/dist/preview-next/client/{sdk-runtime-6Q0RVJTQ.mjs → sdk-runtime-CBIwYDyi.mjs} +2 -2
  148. package/dist/preview-next/client/{useAutosaveStatus-Cdx3kAGm.mjs → useAutosaveStatus-DoWvGNPA.mjs} +3 -3
  149. package/dist/preview-next/client/{useBlockCustomizeControls-ZrWdhcB6.mjs → useBlockCustomizeControls-WOs8Atje.mjs} +17 -23
  150. package/dist/preview-next/client/{useOpenBlockForSetup-CK-GWb9k.mjs → useOpenBlockForSetup-CipKCK2O.mjs} +1 -1
  151. package/dist/preview-next/container-responsive.css +3050 -0
  152. package/dist/preview-next/editor-base.css +90 -178
  153. package/dist/preview-next/editor-chrome.css +25 -8
  154. package/dist/preview-next/keepAlive.mjs +1 -1
  155. package/dist/preview-next/middleware.mjs +3 -4
  156. package/dist/preview-next/{route-contract-BU1m9SV3.mjs → route-contract-BLYaenrK.mjs} +36 -8
  157. package/dist/server/{Block.shared-4vx7wzxj.mjs → Block.shared-Dx4j9CJT.mjs} +4 -4
  158. package/dist/server/ThemeScopeCore-B0IfeNNZ.mjs +1983 -0
  159. package/dist/server/{accessibleSurfaces-108nxyGc.mjs → accessibleSurfaces-D0q5tLSW.mjs} +56 -8
  160. package/dist/server/{bindings-TAQbo2P5.mjs → bindings-C1-MNwwS.mjs} +1 -1
  161. package/dist/server/{client-DzCxEl3L.mjs → client-Djjv-NuA.mjs} +38 -10
  162. package/dist/server/config-validation.mjs +1 -1
  163. package/dist/server/config.mjs +1 -1
  164. package/dist/server/data/resolveBlockData.mjs +1 -1
  165. package/dist/server/index.mjs +2 -2
  166. package/dist/server/{loadContent-BO1M9Hdf.mjs → loadContent-DhraQ_Fi.mjs} +4 -4
  167. package/dist/server/{loadPage-BvWzmZcD.mjs → loadPage-QXSdPSYY.mjs} +2 -2
  168. package/dist/server/next.mjs +6 -6
  169. package/dist/server/{opaqueSurface-BawlEAd_.mjs → opaqueSurface-Yltv_u7r.mjs} +1 -1
  170. package/dist/server/{overrideResolution-fxuB1zZg.mjs → overrideResolution-CMNx5tQg.mjs} +1 -1
  171. package/dist/server/page-converter.mjs +1 -1
  172. package/dist/server/{pageRenderPlan-DzduDSqY.mjs → pageRenderPlan-Bv6NbFeM.mjs} +11 -9
  173. package/dist/server/{pageRuntimeSupport-BU8pwTNx.mjs → pageRuntimeSupport-B2laBtff.mjs} +1 -1
  174. package/dist/server/{pageShared-CSOJ8p8E.mjs → pageShared-CE9EBNSH.mjs} +352 -290
  175. package/dist/server/{prebuild-C5ZYo7wA.mjs → prebuild-FBA6Y1K7.mjs} +1 -1
  176. package/dist/server/prebuild.mjs +1 -1
  177. package/dist/server/{prefetchBlockData-BvbxqeKn.mjs → prefetchBlockData-yL2hB2l_.mjs} +2 -2
  178. package/dist/server/{registry-Fv-7D8o2.mjs → registry-Djrj9gWy.mjs} +56 -816
  179. package/dist/server/rendering/components/pageShared.mjs +1 -1
  180. package/dist/server/rendering/helpers/loadPage.mjs +1 -1
  181. package/dist/server/rendering/helpers/pageRuntimeSupport.mjs +1 -1
  182. package/dist/server/rendering/islandDelivery.script.mjs +19 -0
  183. package/dist/server/rendering/server.mjs +3 -3
  184. package/dist/server/rendering.mjs +7 -7
  185. package/dist/server/{resolveBlockData-xPgkvoWS.mjs → resolveBlockData-CyeIjmqx.mjs} +1 -1
  186. package/dist/server/server.mjs +3 -3
  187. package/dist/server/theme-bridge.mjs +2 -2
  188. package/dist/server/{validation-DddhgNdb.mjs → validation-Dh8htd6l.mjs} +3 -3
  189. package/dist/server/{version-D_W2mt8w.mjs → version-LMwnoksN.mjs} +1 -1
  190. package/dist/styles/index.css +122 -49
  191. package/package.json +10 -6
  192. package/dist/client/BlocksIslandsHydrator-qq4Vhs7k.mjs +0 -296
  193. package/dist/client/Page-Dv9eIOGr.mjs +0 -52213
  194. package/dist/client/bookingForm-B1Fc62Sl.mjs +0 -34
  195. package/dist/client/eventCombined-DFSVDJ3D.mjs +0 -28
  196. package/dist/client/eventListing-CpFFcAUr.mjs +0 -29
  197. package/dist/client/eventRegistration-BipMUOCw.mjs +0 -34
  198. package/dist/client/form-57k2JQnm.mjs +0 -90
  199. package/dist/client/newsletterForm-Cn7h4zFe.mjs +0 -53
  200. package/dist/client/reactMount-BGJVsHRb.mjs +0 -28
  201. package/dist/client/runtimeResponse-BP-L6exS.mjs +0 -3
  202. package/dist/server/ThemeScopeCore-C3HLgqBF.mjs +0 -24213
  203. package/dist/client/{context-DQnTyApV.mjs → context-Xhf81Q-c.mjs} +1 -1
@@ -0,0 +1,1983 @@
1
+ import { $ as SURFACE_INK_CSS_VARS, Et as parseThemeColorToken, Q as SURFACE_FOREGROUND_CSS_VARS, Tt as parseColorTokenParts, Z as DEFAULT_SURFACE_TEXT_COLOR, at as surfaceForegroundValueWithOpacity, ft as rgbColorValue, it as surfaceForegroundValue, ot as surfaceInkDeclarations, ut as cssVarValue } from "./resolveButtonColourStates-Cn6j8Ee0.mjs";
2
+ import { M as safeTokenOr, N as surfaceInkPublication, P as solveSurfaceInks, V as resolveOpaqueSurfaceHex, a as resolveSurface, f as actionVariableFallback, j as resolveSurfaceForeground, r as prepareSurfaceIndex } from "./accessibleSurfaces-D0q5tLSW.mjs";
3
+ import { r as customCssRuleSchema, t as blockCustomCssRuleSchema } from "./customCss-QymcmOZ-.mjs";
4
+ import { n as opaqueSurfaceDeclarations } from "./opaqueSurface-Yltv_u7r.mjs";
5
+ import "react";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ //#region ../theme-core/src/cards/decorations.ts
8
+ const CARD_EDGE_RULE_WIDTH_MAP = {
9
+ hairline: "1px",
10
+ thin: "2px",
11
+ medium: "3px",
12
+ thick: "4px",
13
+ heavy: "5px"
14
+ };
15
+ const CARD_EDGE_BORDER_PROPERTY_MAP = {
16
+ left: "border-left",
17
+ top: "border-top",
18
+ right: "border-right",
19
+ bottom: "border-bottom"
20
+ };
21
+ /**
22
+ * The one short-rule length in the corpus (the editorial-rule accent). A fixed
23
+ * constant keeps `length: 'short'` a semantic choice rather than a free number.
24
+ */
25
+ const SHORT_CARD_EDGE_RULE_LENGTH = "2.75rem";
26
+ function isFullLength(rule) {
27
+ return (rule.length ?? "full") === "full";
28
+ }
29
+ /** Apply a decoration's optional alpha to its resolved colour. */
30
+ function cardDecorationColor(rule, resolveColor) {
31
+ const color = resolveColor(rule.colorToken);
32
+ if (rule.alpha === void 0 || rule.alpha >= 1) return color;
33
+ return `color-mix(in oklab, ${color}, transparent ${Math.round((1 - rule.alpha) * 100)}%)`;
34
+ }
35
+ /**
36
+ * Container border declarations for a variant's border and its full-length
37
+ * edge rules. The two are independent: a card may be outlined *and* carry an
38
+ * accent edge. A variant with edge rules and no border still zeroes the box so
39
+ * only the decorated sides draw.
40
+ */
41
+ function cardBorderDeclarations(borderDeclaration, decorations, resolveColor) {
42
+ const fullLengthRules = (decorations ?? []).filter(isFullLength);
43
+ const declarations = [];
44
+ if (borderDeclaration) declarations.push(borderDeclaration);
45
+ else if (fullLengthRules.length > 0) declarations.push("border: 0");
46
+ for (const rule of fullLengthRules) {
47
+ const side = CARD_EDGE_BORDER_PROPERTY_MAP[rule.edge];
48
+ const width = CARD_EDGE_RULE_WIDTH_MAP[rule.width];
49
+ declarations.push(`${side}: ${width} solid ${cardDecorationColor(rule, resolveColor)}`);
50
+ }
51
+ return declarations;
52
+ }
53
+ function horizontalAlignDeclarations(align) {
54
+ switch (align ?? "start") {
55
+ case "start": return ["left: 0"];
56
+ case "center": return ["left: 50%", "transform: translateX(-50%)"];
57
+ case "end": return ["right: 0"];
58
+ }
59
+ }
60
+ function verticalAlignDeclarations(align) {
61
+ switch (align ?? "start") {
62
+ case "start": return ["top: 0"];
63
+ case "center": return ["top: 50%", "transform: translateY(-50%)"];
64
+ case "end": return ["bottom: 0"];
65
+ }
66
+ }
67
+ function shortEdgeRuleDeclarations(rule, resolveColor) {
68
+ const thickness = CARD_EDGE_RULE_WIDTH_MAP[rule.width];
69
+ const isHorizontal = rule.edge === "top" || rule.edge === "bottom";
70
+ return [
71
+ "content: \"\"",
72
+ "position: absolute",
73
+ `${rule.edge}: 0`,
74
+ ...isHorizontal ? horizontalAlignDeclarations(rule.align) : verticalAlignDeclarations(rule.align),
75
+ `width: ${isHorizontal ? SHORT_CARD_EDGE_RULE_LENGTH : thickness}`,
76
+ `height: ${isHorizontal ? thickness : SHORT_CARD_EDGE_RULE_LENGTH}`,
77
+ `background: ${cardDecorationColor(rule, resolveColor)}`
78
+ ];
79
+ }
80
+ /**
81
+ * The pseudo-elements a card container can lend to short edge rules. A short
82
+ * rule cannot be a border, so it is drawn on `::before` / `::after` against the
83
+ * container (which always sets `position: relative`) — and a card has exactly
84
+ * two of those.
85
+ */
86
+ const CARD_DECORATION_PSEUDOS = ["::before", "::after"];
87
+ /**
88
+ * Complete pseudo-element rules for a variant's short edge rules.
89
+ *
90
+ * `cardDecorationsSchema` caps the list at two, which makes the two pseudos
91
+ * sufficient for anything that parsed. The dependency-free core types carry a
92
+ * plain array with no such cap, so short rules past the second are dropped
93
+ * here rather than silently overwriting `::after`.
94
+ */
95
+ function cardDecorationPseudoRules(containerSelectors, decorations, resolveColor) {
96
+ const shortRules = (decorations ?? []).filter((rule) => !isFullLength(rule));
97
+ return CARD_DECORATION_PSEUDOS.flatMap((pseudo, index) => {
98
+ const rule = shortRules[index];
99
+ if (!rule) return [];
100
+ return [`${containerSelectors.map((containerSelector) => `${containerSelector}${pseudo}`).join(",\n")} {\n ${shortEdgeRuleDeclarations(rule, resolveColor).join(";\n ")};\n}`];
101
+ });
102
+ }
103
+ //#endregion
104
+ //#region ../theme-core/src/utils/cssDeclarations.ts
105
+ /** Render CSS declarations whether callers provide terminators or fragments. */
106
+ function renderCssDeclarations(declarations) {
107
+ return declarations.map((declaration) => declaration.endsWith(";") ? declaration : `${declaration};`).join("\n ");
108
+ }
109
+ //#endregion
110
+ //#region ../theme-core/src/styles/shadow.ts
111
+ function generateShadowCssVars(theme) {
112
+ const level = theme.shadow.elevation;
113
+ const soft = theme.shadow.softness !== "crisp";
114
+ const tintVar = theme.shadow.colorToken ? cssVarValue(theme.shadow.colorToken) : null;
115
+ const shadowColor = (a) => tintVar ? `rgb(${tintVar} / ${a})` : `rgba(0, 0, 0, ${a})`;
116
+ const base = {
117
+ sm: [{
118
+ y: 1,
119
+ blur: 2,
120
+ spread: 0,
121
+ a: .08
122
+ }],
123
+ md: [{
124
+ y: 4,
125
+ blur: 6,
126
+ spread: -1,
127
+ a: .1
128
+ }, {
129
+ y: 2,
130
+ blur: 4,
131
+ spread: -2,
132
+ a: .1
133
+ }],
134
+ lg: [{
135
+ y: 10,
136
+ blur: 15,
137
+ spread: -3,
138
+ a: .1
139
+ }, {
140
+ y: 4,
141
+ blur: 6,
142
+ spread: -4,
143
+ a: .1
144
+ }],
145
+ xl: [{
146
+ y: 20,
147
+ blur: 25,
148
+ spread: -5,
149
+ a: .1
150
+ }, {
151
+ y: 8,
152
+ blur: 10,
153
+ spread: -6,
154
+ a: .1
155
+ }],
156
+ x2l: [{
157
+ y: 25,
158
+ blur: 50,
159
+ spread: -12,
160
+ a: .25
161
+ }]
162
+ };
163
+ const scale = (() => {
164
+ switch (level) {
165
+ case "none": return .8;
166
+ case "low": return 1;
167
+ case "medium": return 1.25;
168
+ case "high": return 1.5;
169
+ default: return 1;
170
+ }
171
+ })();
172
+ const blurMul = soft ? 1.2 : 1;
173
+ const alphaMul = soft ? .9 : 1.05;
174
+ const fmt = (layers) => layers.map((l) => {
175
+ return `0 ${Math.round(l.y * scale)}px ${Math.round(l.blur * scale * blurMul)}px ${Math.round(l.spread * scale)}px ${shadowColor(Math.max(0, Math.min(1, +(l.a * alphaMul).toFixed(3))))}`;
176
+ }).join(", ");
177
+ return {
178
+ "--shadow-sm": fmt(base.sm),
179
+ "--shadow-md": fmt(base.md),
180
+ "--shadow-lg": fmt(base.lg),
181
+ "--shadow-xl": fmt(base.xl),
182
+ "--shadow-2xl": fmt(base.x2l)
183
+ };
184
+ }
185
+ //#endregion
186
+ //#region ../theme-core/src/buttons/resolvedButtonCss.ts
187
+ /**
188
+ * Canonical colour declaration mapping shared by full themes and ThemeBridge.
189
+ * Both background properties are always emitted so transitions cannot retain
190
+ * a stale gradient or solid layer.
191
+ */
192
+ function resolvedButtonColourDeclarations(colour, action) {
193
+ const value = (property, fallback) => action ? actionVariableFallback(action.role, action.state, property, fallback) : fallback;
194
+ switch (colour.kind) {
195
+ case "solid":
196
+ case "known-solid": return [
197
+ ["background-color", value("background-color", colour.backgroundCss)],
198
+ ["background-image", value("background-image", "none")],
199
+ ["color", value("color", colour.foregroundCss)]
200
+ ];
201
+ case "gradient": return [
202
+ ["background-color", value("background-color", "transparent")],
203
+ ["background-image", value("background-image", colour.backgroundCss)],
204
+ ["color", value("color", colour.foregroundCss)]
205
+ ];
206
+ case "surface": return [
207
+ ["background-color", value("background-color", colour.backgroundCss)],
208
+ ["background-image", value("background-image", "none")],
209
+ ["color", value("color", colour.foregroundCss)]
210
+ ];
211
+ }
212
+ }
213
+ function resolvedButtonFocusDeclarations(indicator, role) {
214
+ const value = (property, fallback) => role ? actionVariableFallback(role, "focus", property, fallback) : fallback;
215
+ return indicator.kind === "two-tone" ? [
216
+ ["outline", value("outline", `2px solid ${indicator.innerCss}`)],
217
+ ["outline-offset", value("outline-offset", "2px")],
218
+ ["box-shadow", value("box-shadow", `0 0 0 4px ${indicator.outerCss}`)]
219
+ ] : [["outline", value("outline", `${indicator.width ?? 3}px solid ${indicator.colorCss}`)], ["outline-offset", value("outline-offset", `${indicator.offset ?? 3}px`)]];
220
+ }
221
+ /**
222
+ * Disabled buttons are deliberately muted as unavailable controls. Native
223
+ * disabled controls are exempt from active-control contrast requirements;
224
+ * opacity distinguishes the state without introducing a focus-like outline.
225
+ * Retaining pointer events lets the not-allowed cursor remain observable.
226
+ */
227
+ const RESOLVED_BUTTON_DISABLED_DECLARATIONS = [
228
+ ["cursor", "not-allowed"],
229
+ ["transform", "none"],
230
+ ["box-shadow", "none"],
231
+ ["opacity", "0.55"]
232
+ ];
233
+ //#endregion
234
+ //#region ../theme-core/src/blocks/opaquePanels.ts
235
+ /**
236
+ * Every element in `blocks-static/` CSS that paints its own background behind
237
+ * text or buttons, with the palette token it paints.
238
+ *
239
+ * The CSS owns layout and the paint itself; this registry owns what the paint
240
+ * implies. `generateOpaquePanelCss` publishes each panel's foreground contract
241
+ * and button context from the theme, exactly as card roles and section
242
+ * backgrounds do, so a white panel inside a dark band never inherits the band's
243
+ * light text or its band-resolved buttons. `opaquePanels.test.ts` scans the
244
+ * static CSS and fails when a rule paints a surface token without an entry
245
+ * here, or when a registered rule declares the contract by hand.
246
+ *
247
+ * Selectors are written without the theme-scope prefix; the generator adds it.
248
+ * A `transparent` entry is a treatment that turns a surface-owning class into
249
+ * a boxless row, so it hands the surrounding surface's contract back.
250
+ */
251
+ const BOOKING_BAR_SELECTOR = ":where([data-block='event-registration']) .er-booking-bar";
252
+ const opaquePanels = [
253
+ {
254
+ selector: ":where([data-block='offerings-preview']) .event-quick-date",
255
+ paint: {
256
+ kind: "solid",
257
+ token: "surface"
258
+ }
259
+ },
260
+ {
261
+ selector: ":where([data-block='offerings-preview']) .offerings-preview-card--default",
262
+ paint: {
263
+ kind: "solid",
264
+ token: "surface"
265
+ }
266
+ },
267
+ {
268
+ selector: ":where([data-block=\"event-registration\"], [data-block=\"appointment-booking\"]) .rb-reg-surface",
269
+ paint: {
270
+ kind: "solid",
271
+ token: "surface"
272
+ }
273
+ },
274
+ {
275
+ selector: ":where([data-block='event-registration'].event-registration--embedded) .er-container",
276
+ contract: "inks-only",
277
+ paint: { kind: "transparent" }
278
+ },
279
+ {
280
+ selector: ":where([data-block='event-registration']) .er-booking-card",
281
+ paint: {
282
+ kind: "solid",
283
+ token: "surface"
284
+ }
285
+ },
286
+ {
287
+ selector: BOOKING_BAR_SELECTOR,
288
+ paint: {
289
+ kind: "solid",
290
+ token: "surface"
291
+ }
292
+ },
293
+ {
294
+ selector: ":where([data-block='event-registration']) .er-modal",
295
+ paint: {
296
+ kind: "solid",
297
+ token: "background"
298
+ }
299
+ },
300
+ {
301
+ selector: ":where([data-block=\"event-registration\"], [data-block=\"appointment-booking\"]) .rb-reg-modal",
302
+ paint: {
303
+ kind: "solid",
304
+ token: "background"
305
+ }
306
+ },
307
+ {
308
+ selector: ":where([data-block='event-registration']) .er-booking-overlay__panel",
309
+ paint: {
310
+ kind: "solid",
311
+ token: "surface"
312
+ }
313
+ },
314
+ {
315
+ selector: ":where([data-block='event-calendar']) .event-agenda-card",
316
+ paint: {
317
+ kind: "solid",
318
+ token: "surface"
319
+ }
320
+ },
321
+ {
322
+ selector: ":where([data-block='event-calendar']) .event-timetable-event",
323
+ paint: {
324
+ kind: "solid",
325
+ token: "surface"
326
+ }
327
+ },
328
+ {
329
+ selector: ":where([data-block='event-calendar']) .event-week-board",
330
+ paint: {
331
+ kind: "solid",
332
+ token: "surface"
333
+ }
334
+ },
335
+ {
336
+ selector: ":where([data-block='event-calendar']) .event-week-board-top",
337
+ paint: {
338
+ kind: "solid",
339
+ token: "surfaceAlt"
340
+ }
341
+ },
342
+ {
343
+ selector: ":where([data-block='event-calendar']) .event-week-board-foot",
344
+ paint: {
345
+ kind: "solid",
346
+ token: "surfaceAlt"
347
+ }
348
+ },
349
+ {
350
+ selector: ":where([data-block='event-calendar']) .ec-modal",
351
+ paint: {
352
+ kind: "solid",
353
+ token: "surface"
354
+ }
355
+ },
356
+ {
357
+ selector: ".event-listing-compact-container",
358
+ paint: {
359
+ kind: "solid",
360
+ token: "surface"
361
+ }
362
+ },
363
+ {
364
+ selector: ".shop__card",
365
+ paint: {
366
+ kind: "solid",
367
+ token: "surface"
368
+ }
369
+ },
370
+ {
371
+ selector: ".shop--register .shop__card",
372
+ paint: { kind: "transparent" }
373
+ },
374
+ {
375
+ selector: ":where([data-block=\"shop\"]) .shop__return",
376
+ paint: {
377
+ kind: "solid",
378
+ token: "surface"
379
+ }
380
+ },
381
+ {
382
+ selector: "[data-block=\"feature-cards\"][data-block-composition=\"asymmetric-emphasis\"] .rb-feature-card:nth-child(even)",
383
+ paint: {
384
+ kind: "solid",
385
+ token: "secondary"
386
+ }
387
+ },
388
+ {
389
+ selector: ".rb-feature-cards-grid--editorial-diptych .rb-feature-card[data-surface-role=\"panel\"]",
390
+ paint: {
391
+ kind: "solid",
392
+ token: "primary"
393
+ }
394
+ },
395
+ {
396
+ selector: ":is(.rb-event-list-treatment-ruled-register, .rb-event-list-treatment-editorial-register, .rb-event-list-treatment-dense-index) .event-card.event-card",
397
+ paint: { kind: "transparent" }
398
+ },
399
+ {
400
+ selector: ".feedback-callout",
401
+ paint: {
402
+ kind: "solid",
403
+ token: "surface"
404
+ }
405
+ },
406
+ {
407
+ selector: "[data-block=\"gifting\"] .gifting-feedback",
408
+ paint: {
409
+ kind: "solid",
410
+ token: "surface"
411
+ }
412
+ }
413
+ ];
414
+ /**
415
+ * Publishes every registered panel's surface contract. Emitted after the card
416
+ * CSS in both the theme runtime and the SDK theme bridge, so a composition
417
+ * that recolours a card role (the feature-card diptych panel) or a treatment
418
+ * that empties one (the event registers) wins over the role's own contract.
419
+ */
420
+ function generateOpaquePanelCss(input) {
421
+ const panels = opaquePanels.map((panel) => {
422
+ const styledBar = panel.selector === BOOKING_BAR_SELECTOR ? input.bookingBar : void 0;
423
+ return {
424
+ panel,
425
+ styledBar,
426
+ spec: {
427
+ kind: "paint",
428
+ paint: styledBar ? {
429
+ kind: "solid",
430
+ token: styledBar.token
431
+ } : panel.paint
432
+ }
433
+ };
434
+ });
435
+ const index = prepareSurfaceIndex(panels.map(({ spec }) => spec), input.surface);
436
+ const surface = {
437
+ ...input.surface,
438
+ palette: index.palette,
439
+ buttonSystem: index.buttonSystem,
440
+ colourIndex: index.colourIndex,
441
+ preparedSurfaces: index
442
+ };
443
+ return panels.map(({ panel, styledBar, spec }) => {
444
+ const declarations = [...opaqueSurfaceDeclarations(resolveSurface(spec, surface)).filter((declaration) => !("contract" in panel) || Object.values(SURFACE_INK_CSS_VARS).some((variable) => declaration.startsWith(`${variable}:`))), ...styledBar ? bookingBarDeclarations(styledBar) : []];
445
+ return `:where([data-theme-scope="${input.themeId}"]) ${panel.selector} {\n ${renderCssDeclarations(declarations)}\n}`;
446
+ }).join("\n\n");
447
+ }
448
+ /**
449
+ * A style's booking bar (issue 1659): its paint together with the contract
450
+ * above, so inks and paint never disagree, and a field's inset and radius.
451
+ * `event-registration.css` reads these with today's bar as the fallback.
452
+ */
453
+ function bookingBarDeclarations(bar) {
454
+ return [
455
+ `--er-bar-paint: rgb(var(--tb-${bar.token}));`,
456
+ "--er-bar-border: 0 none;",
457
+ ...bar.shape === "field" ? ["--er-bar-inset: clamp(12px, 3vw, var(--rb-skin-margin, 20px));", "--er-bar-radius: var(--rb-skin-radius, 0px);"] : []
458
+ ];
459
+ }
460
+ //#endregion
461
+ //#region ../theme-core/src/inputs/checkable.ts
462
+ /**
463
+ * Checkbox and radio CSS shared by the full theme generator and the SDK
464
+ * theme bridge, so both render the same customer-facing controls.
465
+ *
466
+ * Emits:
467
+ * - .form-checkbox / .form-radio: the controls themselves. The tick and dot
468
+ * are drawn with ::before so their colour comes from theme tokens rather
469
+ * than a baked-in SVG.
470
+ * - .form-check: a label row holding a control and its text. The control
471
+ * lines up with the first line of text, so long labels wrap cleanly.
472
+ * - .form-check--tile: a bordered, fully clickable panel for agreements
473
+ * (booking consent, consent fields) that tints when ticked.
474
+ * - .form-check--linked: a label with a link in it. The text stays ordinary
475
+ * inline text; the native label is stretched over the whole row or tile so
476
+ * every part of it except the link ticks the box.
477
+ * - .form-check-link: the link in a checkable label, and in lines that stand
478
+ * in for one (the "already agreed" line), drawn from the surface's link
479
+ * colour with an accent underline.
480
+ */
481
+ const CHECKABLE_SIZE = "1.375rem";
482
+ /** Never fully round: a round checkbox reads as a radio. */
483
+ const CHECKBOX_RADIUS = {
484
+ square: "0",
485
+ soft: "0.25rem",
486
+ rounded: "0.375rem",
487
+ pill: "0.375rem"
488
+ };
489
+ /** Tiles hold wrapping text, so pill themes get a generous radius, not a capsule. */
490
+ const TILE_RADIUS = {
491
+ square: "0",
492
+ soft: "0.5rem",
493
+ rounded: "0.75rem",
494
+ pill: "1rem"
495
+ };
496
+ const ON_ACCENT_TOKENS = {
497
+ primary: "onPrimary",
498
+ secondary: "onSecondary",
499
+ accent: "onAccent"
500
+ };
501
+ /**
502
+ * Colour for the tick/dot drawn on top of the accent fill. Uses the palette's
503
+ * matching "on" token where there is one, falling back to white.
504
+ */
505
+ /** The accent at full strength: `primary/70` becomes `primary`. */
506
+ function solidAccentToken(accentToken) {
507
+ const parsed = parseColorTokenParts(accentToken);
508
+ return parsed.kind === "token" ? parsed.token : accentToken;
509
+ }
510
+ function checkableMarkColor(accentToken) {
511
+ const parsed = parseColorTokenParts(accentToken);
512
+ const onToken = parsed.kind === "token" ? ON_ACCENT_TOKENS[parsed.token] : void 0;
513
+ return onToken ? `rgb(var(--tb-${onToken}, 255 255 255))` : "rgb(255 255 255)";
514
+ }
515
+ function checkableSelectors(root) {
516
+ return {
517
+ checkbox: `${root} .form-checkbox`,
518
+ radio: `${root} .form-radio`,
519
+ check: `${root} .form-check`,
520
+ tile: `${root} .form-check--tile`,
521
+ link: `${root} .form-check-link`
522
+ };
523
+ }
524
+ /** The box and circle themselves, unchecked. */
525
+ function controlBaseCss(sel, input) {
526
+ const border = input.borderWidth === "0" ? "1px" : input.borderWidth;
527
+ return [
528
+ `${sel.checkbox},
529
+ ${sel.radio} {
530
+ appearance: none;
531
+ display: inline-grid;
532
+ place-content: center;
533
+ width: ${CHECKABLE_SIZE};
534
+ height: ${CHECKABLE_SIZE};
535
+ margin: 0;
536
+ flex-shrink: 0;
537
+ border: ${border} solid ${input.borderColor};
538
+ background-color: ${input.background};
539
+ color: inherit;
540
+ cursor: pointer;
541
+ transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
542
+ }`,
543
+ `${sel.checkbox} {
544
+ border-radius: ${CHECKBOX_RADIUS[input.corners]};
545
+ }`,
546
+ `${sel.radio} {
547
+ border-radius: 9999px;
548
+ }`
549
+ ];
550
+ }
551
+ /** The tick and dot, drawn with ::before so their colour is a theme token. */
552
+ function controlMarkCss(sel, accentToken) {
553
+ return [
554
+ `${sel.checkbox}::before,
555
+ ${sel.radio}::before {
556
+ content: "";
557
+ background-color: ${checkableMarkColor(accentToken)};
558
+ transform: scale(0);
559
+ transition: transform 0.12s ease;
560
+ }`,
561
+ `${sel.checkbox}::before {
562
+ width: 0.75rem;
563
+ height: 0.75rem;
564
+ clip-path: polygon(14% 52%, 0 67%, 38% 100%, 100% 22%, 85% 8%, 37% 70%);
565
+ }`,
566
+ `${sel.radio}::before {
567
+ width: 0.5rem;
568
+ height: 0.5rem;
569
+ border-radius: 9999px;
570
+ }`
571
+ ];
572
+ }
573
+ function controlStateCss(sel, input) {
574
+ const accent = rgbColorValue(solidAccentToken(input.accentToken));
575
+ return [
576
+ `${sel.checkbox}:hover,
577
+ ${sel.radio}:hover,
578
+ ${sel.check}:hover > .form-checkbox,
579
+ ${sel.check}:hover > .form-radio {
580
+ border-color: ${accent};
581
+ }`,
582
+ `${sel.checkbox}:checked,
583
+ ${sel.radio}:checked {
584
+ background-color: ${accent};
585
+ border-color: ${accent};
586
+ }`,
587
+ `${sel.checkbox}:checked::before,
588
+ ${sel.radio}:checked::before {
589
+ transform: scale(1);
590
+ }`,
591
+ `${sel.checkbox}:focus-visible,
592
+ ${sel.radio}:focus-visible {
593
+ outline: 2px solid ${accent};
594
+ outline-offset: 2px;
595
+ }`,
596
+ `${sel.checkbox}:disabled,
597
+ ${sel.radio}:disabled {
598
+ opacity: 0.5;
599
+ cursor: not-allowed;
600
+ }`
601
+ ];
602
+ }
603
+ /** Label row: control lined up with the first line of wrapping text. */
604
+ function checkRowCss(sel) {
605
+ return [
606
+ `${sel.check} {
607
+ display: flex;
608
+ align-items: flex-start;
609
+ gap: 0.75rem;
610
+ line-height: 1.5;
611
+ cursor: pointer;
612
+ }`,
613
+ `${sel.check} > .form-checkbox,
614
+ ${sel.check} > .form-radio {
615
+ margin-top: 0.0625rem;
616
+ margin-top: max(0px, calc((1lh - ${CHECKABLE_SIZE}) / 2));
617
+ }`,
618
+ `${sel.check}:has(> :disabled) {
619
+ cursor: not-allowed;
620
+ }`
621
+ ];
622
+ }
623
+ /**
624
+ * A label holding a link keeps the link outside the native <label>, so the
625
+ * label is stretched over the whole row instead: the row (a 44px tile for
626
+ * agreements) is the tap target, the link sits above it, and the text keeps
627
+ * flowing inline, so spaces survive and wrapped lines keep their height.
628
+ */
629
+ function linkedCheckCss(sel, input) {
630
+ const accent = rgbColorValue(solidAccentToken(input.accentToken));
631
+ return [
632
+ `${sel.check}.form-check--linked {
633
+ position: relative;
634
+ }`,
635
+ `${sel.check}.form-check--linked .form-check-label > label {
636
+ cursor: pointer;
637
+ }`,
638
+ `${sel.check}.form-check--linked .form-check-label > label::after {
639
+ content: "";
640
+ position: absolute;
641
+ inset: 0;
642
+ }`,
643
+ `${sel.check}.form-check--linked:has(> :disabled) .form-check-label > label {
644
+ cursor: not-allowed;
645
+ }`,
646
+ `${sel.check}.form-check--linked > .form-checkbox,
647
+ ${sel.check}.form-check--linked .form-check-label a {
648
+ position: relative;
649
+ z-index: 1;
650
+ }`,
651
+ `${sel.link} {
652
+ color: ${surfaceForegroundValue("link", accent)};
653
+ font-weight: 600;
654
+ text-decoration-line: underline;
655
+ text-decoration-color: var(${SURFACE_FOREGROUND_CSS_VARS.mark}, ${accent});
656
+ text-decoration-thickness: from-font;
657
+ text-underline-offset: 0.18em;
658
+ }`,
659
+ `${sel.link}:hover {
660
+ color: ${surfaceForegroundValue("linkHover", accent)};
661
+ text-decoration-thickness: 2px;
662
+ }`,
663
+ `${sel.link}:focus-visible {
664
+ outline: 2px solid ${accent};
665
+ outline-offset: 2px;
666
+ border-radius: 2px;
667
+ }`
668
+ ];
669
+ }
670
+ function agreementTileCss(sel, input) {
671
+ const accent = rgbColorValue(solidAccentToken(input.accentToken));
672
+ return [
673
+ `${sel.tile} {
674
+ min-height: 44px;
675
+ padding: 0.875rem 1rem;
676
+ border: 1px solid color-mix(in srgb, currentColor 22%, transparent);
677
+ border-radius: ${TILE_RADIUS[input.corners]};
678
+ transition: border-color 0.15s ease, background-color 0.15s ease;
679
+ }`,
680
+ `${sel.tile}:hover {
681
+ border-color: color-mix(in srgb, ${accent} 55%, transparent);
682
+ }`,
683
+ `${sel.tile}:has(> .form-checkbox:checked) {
684
+ border-color: ${accent};
685
+ background-color: color-mix(in srgb, ${accent} 7%, transparent);
686
+ }`,
687
+ `${sel.tile}:has(> .form-checkbox[aria-invalid="true"]) {
688
+ border-color: ${input.errorColor};
689
+ }`
690
+ ];
691
+ }
692
+ function checkableMediaCss(sel) {
693
+ return [`@media (prefers-reduced-motion: reduce) {
694
+ ${sel.checkbox}, ${sel.radio}, ${sel.checkbox}::before, ${sel.radio}::before, ${sel.tile} {
695
+ transition: none;
696
+ }
697
+ }`, `@media (forced-colors: active) {
698
+ ${sel.checkbox}::before,
699
+ ${sel.radio}::before {
700
+ background-color: CanvasText;
701
+ }
702
+ }`];
703
+ }
704
+ /**
705
+ * Exposes the accent and mark colours so other choice controls (newsletter
706
+ * topic chips) match the checkboxes without re-deriving the theme tokens.
707
+ */
708
+ function checkableVarsCss(input) {
709
+ return [`${input.root} {
710
+ --rb-check-accent: ${rgbColorValue(solidAccentToken(input.accentToken))};
711
+ --rb-check-mark: ${checkableMarkColor(input.accentToken)};
712
+ }`];
713
+ }
714
+ function generateCheckableCss(input) {
715
+ const sel = checkableSelectors(input.root);
716
+ return [
717
+ ...checkableVarsCss(input),
718
+ ...controlBaseCss(sel, input),
719
+ ...controlMarkCss(sel, input.accentToken),
720
+ ...controlStateCss(sel, input),
721
+ ...checkRowCss(sel),
722
+ ...linkedCheckCss(sel, input),
723
+ ...agreementTileCss(sel, input),
724
+ ...checkableMediaCss(sel)
725
+ ].join("\n\n");
726
+ }
727
+ //#endregion
728
+ //#region ../theme-core/src/inputs/inputGroup.ts
729
+ /**
730
+ * Input group: a field and an action (usually a themed button) sharing one
731
+ * input-styled shell, e.g. the newsletter email + Sign up row.
732
+ *
733
+ * The shell `.form-input-group` takes the theme's `.form-input` rules (the
734
+ * generators add it to that selector list, plus focus and error), so it
735
+ * follows the site's input background, border, corners and shadow. This file
736
+ * only adds the layout overrides and the borderless inner field.
737
+ *
738
+ * A shell with a solid background is a ground of its own, so each runtime
739
+ * passes in the surface it publishes there, the same way it publishes a card's:
740
+ * the button beside the field then reads from the shell, not from the section
741
+ * around it (a light field in a dark footer would otherwise get a quiet button
742
+ * inked for the footer). A transparent shell passes none.
743
+ */
744
+ const INPUT_GROUP_SELECTOR = ".form-input-group";
745
+ /** Shell focus ring follows the field only, not the button beside it. */
746
+ const INPUT_GROUP_FOCUS_SELECTOR = ".form-input-group:has(> .form-input-group-field:focus-visible)";
747
+ const INPUT_GROUP_ERROR_SELECTOR = ".form-input-group:has(> .form-input-group-field[aria-invalid=\"true\"])";
748
+ const GROUP_INSET = "0.25rem";
749
+ /**
750
+ * @param root - scoped root selector
751
+ * @param padding - the theme's input padding shorthand (`block inline`), so the
752
+ * inner field's text sits where a plain input's text would.
753
+ * @param shellSurface - the declarations that make the shell own its fill's
754
+ * surface, from the runtime's surface owner; empty for a transparent shell.
755
+ */
756
+ function generateInputGroupCss(root, padding, shellSurface) {
757
+ const [block = padding, inline = block] = padding.trim().split(/\s+/);
758
+ return `${root} .form-input-group {
759
+ ${[
760
+ "display: flex;",
761
+ "align-items: stretch;",
762
+ `gap: ${GROUP_INSET};`,
763
+ `padding: ${GROUP_INSET};`,
764
+ ...shellSurface
765
+ ].join("\n ")}
766
+ }
767
+
768
+ ${root} .form-input-group-field {
769
+ flex: 1 1 auto;
770
+ min-width: 0;
771
+ margin: 0;
772
+ border: 0;
773
+ border-radius: 0;
774
+ background: transparent;
775
+ box-shadow: none;
776
+ outline: none;
777
+ color: inherit;
778
+ font: inherit;
779
+ padding: calc(${block} - ${GROUP_INSET}) calc(${inline} - ${GROUP_INSET});
780
+ }
781
+
782
+ ${root} .form-input-group-field::placeholder {
783
+ color: inherit;
784
+ opacity: 0.6;
785
+ }
786
+
787
+ ${root} .form-input-group > :not(.form-input-group-field) {
788
+ flex-shrink: 0;
789
+ }`;
790
+ }
791
+ //#endregion
792
+ //#region ../theme-core/src/responsiveMode.ts
793
+ const DEFAULT_THEME_RESPONSIVE_MODE = "viewport";
794
+ const THEME_RESPONSIVE_CONTAINER_NAME = "rb-site";
795
+ const THEME_RESPONSIVE_MODE_ATTR = "data-rb-responsive-mode";
796
+ function getResponsiveScopeSpec(mode = DEFAULT_THEME_RESPONSIVE_MODE) {
797
+ if (mode === "container") return {
798
+ kind: "container",
799
+ selector: `[${THEME_RESPONSIVE_MODE_ATTR}="container"]`,
800
+ containerName: THEME_RESPONSIVE_CONTAINER_NAME
801
+ };
802
+ return {
803
+ kind: "viewport",
804
+ selector: `[${THEME_RESPONSIVE_MODE_ATTR}="viewport"]`
805
+ };
806
+ }
807
+ function escapeRegExp(value) {
808
+ return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
809
+ }
810
+ new RegExp(buildResponsiveScopeRulePatternSource(), "g");
811
+ new RegExp(buildResponsiveScopeRulePatternSource(), "y");
812
+ function buildResponsiveScopeRulePatternSource() {
813
+ return [
814
+ "@scope",
815
+ "\\(\\[",
816
+ escapeRegExp(THEME_RESPONSIVE_MODE_ATTR),
817
+ "=\"(?:viewport|container)\"\\]\\)",
818
+ "to",
819
+ "\\((?::scope )?\\[",
820
+ escapeRegExp(THEME_RESPONSIVE_MODE_ATTR),
821
+ "\\]\\)",
822
+ "\\{"
823
+ ].join("\\s*");
824
+ }
825
+ //#endregion
826
+ //#region ../theme-core/src/status/generateStatusCss.ts
827
+ /**
828
+ * Corner radius map - derives alert border-radius from theme.corners
829
+ */
830
+ const CORNER_MAP = {
831
+ square: "0",
832
+ soft: "0.375rem",
833
+ rounded: "0.5rem",
834
+ pill: "1rem"
835
+ };
836
+ /**
837
+ * Generate status and alert CSS from theme settings.
838
+ *
839
+ * Creates scoped CSS classes for:
840
+ * - .status-error, .status-success, .status-warning, .status-info, .status-muted (text colors)
841
+ * - .alert, .alert-error, .alert-success, .alert-warning, .alert-info (styled containers)
842
+ * - .alert-neutral: a notice in the surface's own text colour, for news that
843
+ * is neither good nor bad (status tokens can be unreadable as text)
844
+ * - .feedback-note, .feedback-note-* (the "field-note" feedback treatment)
845
+ * - .required-marker (required field indicator)
846
+ * - .button-link (text-styled button)
847
+ *
848
+ * Selectors use :where() for zero specificity, allowing site styles to override easily.
849
+ */
850
+ function generateStatusCss({ themeId, theme, palette }) {
851
+ const root = `:where([data-theme-scope="${themeId}"])`;
852
+ return [
853
+ generateStatusTextCss(root),
854
+ generateAlertCss(root, CORNER_MAP[theme.corners], palette),
855
+ generateFieldNoteCss(root),
856
+ generateRequiredMarkerCss(root),
857
+ generateButtonLinkCss(root)
858
+ ].join("\n\n");
859
+ }
860
+ function generateStatusTextCss(root) {
861
+ return `/* Status text indicators */
862
+ ${root} .status-error { color: rgb(var(--tb-destructive)); }
863
+ ${root} .status-success { color: rgb(var(--tb-success)); }
864
+ ${root} .status-warning { color: rgb(var(--tb-warning)); }
865
+ ${root} .status-info { color: rgb(var(--tb-info)); }
866
+ ${root} .status-muted { color: ${surfaceForegroundValue("supporting")}; }`;
867
+ }
868
+ function generateAlertCss(root, borderRadius, palette) {
869
+ return `/* Alert containers */
870
+ ${root} .alert {
871
+ padding: 1rem;
872
+ border-radius: ${borderRadius};
873
+ border-width: 1px;
874
+ border-style: solid;
875
+ }
876
+
877
+ ${root} .alert-error {
878
+ border-color: rgb(var(--tb-destructive));
879
+ background-color: rgb(var(--tb-destructive) / 0.1);
880
+ color: ${noticeTextColor("destructive", palette)};
881
+ }
882
+
883
+ ${root} .alert-success {
884
+ border-color: rgb(var(--tb-success));
885
+ background-color: rgb(var(--tb-success) / 0.1);
886
+ color: rgb(var(--tb-success));
887
+ }
888
+
889
+ ${warningAlertCss(root, palette)}
890
+
891
+ ${root} .alert-info {
892
+ border-color: rgb(var(--tb-info));
893
+ background-color: rgb(var(--tb-info) / 0.1);
894
+ color: ${noticeTextColor("info", palette)};
895
+ }
896
+
897
+ ${root} .alert-neutral {
898
+ border-color: ${surfaceForegroundValueWithOpacity("text", 22)};
899
+ background-color: ${surfaceForegroundValueWithOpacity("text", 5)};
900
+ color: ${surfaceForegroundValue("text")};
901
+ }`;
902
+ }
903
+ function generateFieldNoteCss(root) {
904
+ return `/* Field-note feedback treatment */
905
+ ${root} .feedback-note {
906
+ --tb-feedback-note-rule: currentColor;
907
+ display: grid;
908
+ grid-template-columns: auto minmax(0, 1fr);
909
+ column-gap: 0.6875rem;
910
+ margin-top: 0.875rem;
911
+ font-size: 0.875rem;
912
+ /* Deliberately looser than .rb-caption's 1.25rem: validation notes wrap. */
913
+ line-height: 1.5;
914
+ color: ${surfaceForegroundValue("text")};
915
+ }
916
+
917
+ ${root} .feedback-note::before {
918
+ content: '';
919
+ grid-column: 1;
920
+ grid-row: 1;
921
+ align-self: start;
922
+ width: 1.375rem;
923
+ height: 2px;
924
+ margin-top: 0.62em;
925
+ background-color: var(--tb-feedback-note-rule);
926
+ }
927
+
928
+ ${root} .feedback-note > * {
929
+ grid-column: 2;
930
+ margin: 0;
931
+ }
932
+
933
+ ${root} .feedback-note p {
934
+ margin: 0;
935
+ }
936
+
937
+ ${root} .feedback-note p + p {
938
+ margin-top: 0.25rem;
939
+ }
940
+
941
+ ${root} .feedback-note[data-feedback-tone="error"] { --tb-feedback-note-rule: rgb(var(--tb-accent)); }
942
+ ${root} .feedback-note[data-feedback-tone="warning"] { --tb-feedback-note-rule: rgb(var(--tb-warning)); }
943
+ ${root} .feedback-note[data-feedback-tone="success"] { --tb-feedback-note-rule: rgb(var(--tb-success)); }
944
+ ${root} .feedback-note[data-feedback-tone="info"] { --tb-feedback-note-rule: rgb(var(--tb-info)); }`;
945
+ }
946
+ function generateRequiredMarkerCss(root) {
947
+ return `/* Required field indicator */
948
+ ${root} .required-marker {
949
+ color: rgb(var(--tb-destructive));
950
+ margin-left: 0.25rem;
951
+ }`;
952
+ }
953
+ function generateButtonLinkCss(root) {
954
+ return `/* Link button */
955
+ ${root} .button-link {
956
+ color: rgb(var(--tb-primary));
957
+ background: transparent;
958
+ border: none;
959
+ padding: 0;
960
+ cursor: pointer;
961
+ text-decoration: none;
962
+ transition: color 0.15s ease;
963
+ }
964
+
965
+ ${root} .button-link:hover {
966
+ text-decoration: underline;
967
+ }`;
968
+ }
969
+ /** Measure the existing 10% status tint over the theme's ground. */
970
+ function noticeTextColor(status, palette) {
971
+ const ground = resolveOpaqueSurfaceHex(`${status}/10`, palette, "background");
972
+ const text = parseThemeColorToken("text");
973
+ return ground && text ? rgbColorValue(safeTokenOr(status, text, ground, palette)) : `rgb(var(--tb-${status}))`;
974
+ }
975
+ /** The warning tint owns an unmeasured paint, so descendants retain their authored inks. */
976
+ function warningAlertCss(root, palette) {
977
+ const inks = surfaceInkDeclarations({ kind: "reset" }).join("\n ");
978
+ return `${root} .alert-warning {
979
+ border-color: rgb(var(--tb-warning));
980
+ background-color: rgb(var(--tb-warning) / 0.1);
981
+ color: ${noticeTextColor("warning", palette)};
982
+ ${inks}
983
+ }`;
984
+ }
985
+ //#endregion
986
+ //#region ../theme-core/src/progress/generateProgressCss.ts
987
+ /**
988
+ * Generate progress indicator CSS from theme settings.
989
+ *
990
+ * Creates scoped CSS classes for:
991
+ * - .progress-bar, .progress-fill (bar-style progress)
992
+ * - .step-dot, .step-dot-active, .step-dot-complete (dot indicators)
993
+ * - .step-circle, .step-circle-active, .step-circle-complete (numbered steps)
994
+ * - .step-connector (line between steps)
995
+ *
996
+ * Selectors use :where() for zero specificity, allowing site styles to override easily.
997
+ * Progress indicators always use pill/rounded shapes for visual consistency.
998
+ * Transitions respect theme.motion.level settings.
999
+ */
1000
+ function generateProgressCss({ themeId, theme }) {
1001
+ const root = `:where([data-theme-scope="${themeId}"])`;
1002
+ const hasMotion = theme.motion.level !== "off";
1003
+ const fillTransition = hasMotion ? "transition: width 0.3s ease-out" : "transition: none";
1004
+ const elementTransition = hasMotion ? "transition: all 0.2s ease" : "transition: none";
1005
+ const cssBlocks = [];
1006
+ cssBlocks.push(`/* Progress bar */
1007
+ ${root} .progress-bar {
1008
+ height: 0.5rem;
1009
+ background-color: rgb(var(--tb-muted));
1010
+ border-radius: 9999px;
1011
+ overflow: hidden;
1012
+ }
1013
+
1014
+ ${root} .progress-fill {
1015
+ height: 100%;
1016
+ background-color: rgb(var(--tb-primary));
1017
+ ${fillTransition};
1018
+ }`);
1019
+ cssBlocks.push(`/* Step dots */
1020
+ ${root} .step-dot {
1021
+ width: 0.5rem;
1022
+ height: 0.5rem;
1023
+ border-radius: 9999px;
1024
+ background-color: rgb(var(--tb-muted));
1025
+ ${elementTransition};
1026
+ }
1027
+
1028
+ ${root} .step-dot-active {
1029
+ width: 2rem;
1030
+ background-color: rgb(var(--tb-primary));
1031
+ }
1032
+
1033
+ ${root} .step-dot-complete {
1034
+ background-color: rgb(var(--tb-primary) / 0.6);
1035
+ }`);
1036
+ cssBlocks.push(`/* Step circles (numbered) */
1037
+ ${root} .step-circle {
1038
+ width: 2rem;
1039
+ height: 2rem;
1040
+ border-radius: 9999px;
1041
+ display: flex;
1042
+ align-items: center;
1043
+ justify-content: center;
1044
+ font-size: 0.875rem;
1045
+ font-weight: 500;
1046
+ background-color: rgb(var(--tb-muted));
1047
+ color: rgb(var(--tb-mutedText));
1048
+ ${elementTransition};
1049
+ }
1050
+
1051
+ ${root} .step-circle-active {
1052
+ background-color: rgb(var(--tb-primary));
1053
+ color: rgb(var(--tb-primaryForeground));
1054
+ }
1055
+
1056
+ ${root} .step-circle-complete {
1057
+ background-color: rgb(var(--tb-primary) / 0.6);
1058
+ color: rgb(var(--tb-primaryForeground));
1059
+ }`);
1060
+ cssBlocks.push(`/* Step connector */
1061
+ ${root} .step-connector {
1062
+ height: 1px;
1063
+ background-color: rgb(var(--tb-border));
1064
+ flex: 1;
1065
+ }`);
1066
+ return cssBlocks.join("\n\n");
1067
+ }
1068
+ //#endregion
1069
+ //#region ../theme-core/src/typography/generateTypographyCss.ts
1070
+ function globalHeadingColorFallback(level) {
1071
+ return `var(--hc-h${level}, var(--hc-heading, ${DEFAULT_SURFACE_TEXT_COLOR}))`;
1072
+ }
1073
+ /** Compile each typography responsibility through the shared scoped stylesheet. */
1074
+ function generateTypographyCss({ themeId, theme }) {
1075
+ const root = `:where([data-theme-scope="${themeId}"])`;
1076
+ return `@layer rb-theme {\n${[
1077
+ baseHeadingCss(root),
1078
+ headingLevelsCss(root),
1079
+ displayHeadingCss(root),
1080
+ compactHeadingCss(root),
1081
+ bodyCss(root),
1082
+ generateFontWidthCss(root, theme?.typography)
1083
+ ].filter(Boolean).join("\n\n")}\n}${smallHeadingCss(`[data-theme-scope="${themeId}"]`, theme?.typography.smallHeading)}`;
1084
+ }
1085
+ function baseHeadingCss(root) {
1086
+ return `/* Base heading styles */
1087
+ ${root} :where(h1, h2, h3, h4, h5, h6) {
1088
+ font-family: var(--font-heading);
1089
+ font-style: var(--fi-heading, normal);
1090
+ text-transform: var(--tt-heading, none);
1091
+ font-variant: var(--fv-heading, normal);
1092
+ margin: 0;
1093
+ }`;
1094
+ }
1095
+ function displayHeadingCss(root) {
1096
+ return `/* Display variant for hero/splash headings */
1097
+ ${root} :where(.heading-display) {
1098
+ font-size: var(--fs-display-fluid, var(--fs-display));
1099
+ }
1100
+
1101
+ ${root} :where(h1.heading-display) {
1102
+ font-size: var(--fs-h1-display-fluid, var(--fs-h1-display, calc(var(--fs-h1) * 1.5)));
1103
+ }
1104
+
1105
+ ${root} :where(h2.heading-display) {
1106
+ font-size: var(--fs-h2-display-fluid, var(--fs-h2-display, calc(var(--fs-h2) * 1.35)));
1107
+ }`;
1108
+ }
1109
+ function compactHeadingCss(root) {
1110
+ return `/* Compact variant for cards/sidebars */
1111
+ ${root} :where(.heading-compact) {
1112
+ font-size: var(--fs-compact);
1113
+ }
1114
+
1115
+ ${root} :where(h1.heading-compact) {
1116
+ font-size: calc(var(--fs-h1) * 0.75);
1117
+ }
1118
+
1119
+ ${root} :where(h2.heading-compact) {
1120
+ font-size: calc(var(--fs-h2) * 0.8);
1121
+ }
1122
+
1123
+ ${root} :where(h3.heading-compact) {
1124
+ font-size: calc(var(--fs-h3) * 0.85);
1125
+ }`;
1126
+ }
1127
+ function bodyCss(root) {
1128
+ return `/* Body text base styles */
1129
+ ${root} {
1130
+ font-family: var(--font-body);
1131
+ font-weight: var(--font-weight-body);
1132
+ font-size: var(--fs-body);
1133
+ letter-spacing: var(--ls-body);
1134
+ line-height: var(--lh-body);
1135
+ }
1136
+
1137
+ ${root} :where(p, li, td, th, label, span) {
1138
+ font-family: var(--font-body);
1139
+ font-weight: var(--font-weight-body);
1140
+ letter-spacing: var(--ls-body);
1141
+ font-size: inherit;
1142
+ line-height: inherit;
1143
+ }`;
1144
+ }
1145
+ function headingLevelsCss(root) {
1146
+ return `/* Heading level styles with fluid typography */\n${[
1147
+ 1,
1148
+ 2,
1149
+ 3,
1150
+ 4,
1151
+ 5,
1152
+ 6
1153
+ ].map((level) => {
1154
+ return `${root} :where(h${level}) {
1155
+ font-size: var(--fs-h${level}-fluid, ${level < 4 ? `var(--fs-h${level})` : `var(--fs-h${level}, ${level === 4 ? "var(--fs-h3)" : "var(--fs-body)"})`});
1156
+ font-weight: var(--fw-h${level}, var(--font-weight-heading));
1157
+ font-style: var(--fi-h${level}, var(--fi-heading, normal));
1158
+ letter-spacing: var(--ls-h${level}, var(--ls-heading));
1159
+ line-height: var(--lh-h${level}, var(--lh-heading));
1160
+ color: ${surfaceForegroundValue("heading", globalHeadingColorFallback(level))};
1161
+ }`;
1162
+ }).join("\n\n")}`;
1163
+ }
1164
+ /** Optional width rules leave the historical CSS bytes unchanged. */
1165
+ function generateFontWidthCss(root, typography) {
1166
+ if (!typography) return "";
1167
+ if (![
1168
+ typography.body,
1169
+ typography.headings.default,
1170
+ typography.eyebrow,
1171
+ ...[
1172
+ "h1",
1173
+ "h2",
1174
+ "h3",
1175
+ "h4",
1176
+ "h5",
1177
+ "h6"
1178
+ ].map((level) => typography.headings[level])
1179
+ ].some((role) => role?.width != null)) return "";
1180
+ const bodyWidth = typography.body.width ?? 100;
1181
+ const headingWidth = typography.headings.default.width ?? 100;
1182
+ const rule = (selector, width, variable) => width == null ? "" : `${selector} { ${variable ? `${variable}: ${width}%; ` : ""}font-stretch: ${width}%; }`;
1183
+ return [
1184
+ rule(root, bodyWidth, "--font-stretch-body"),
1185
+ rule(`${root} :where(p, li, td, th, label, span)`, bodyWidth),
1186
+ rule(`${root} :where(h1, h2, h3, h4, h5, h6)`, headingWidth),
1187
+ typography.headings.default.width == null ? "" : `${root} { --font-stretch-heading: ${typography.headings.default.width}%; }`,
1188
+ ...[
1189
+ "h1",
1190
+ "h2",
1191
+ "h3",
1192
+ "h4",
1193
+ "h5",
1194
+ "h6"
1195
+ ].map((level) => rule(`${root} :where(${level})`, typography.headings[level]?.width)),
1196
+ `${root} :where(h1, h2, h3, h4, h5, h6) :where(span) { font-stretch: inherit; }`,
1197
+ rule(`${root} :where(.rb-eyebrow)`, typography.eyebrow ? typography.eyebrow.width ?? 100 : bodyWidth)
1198
+ ].filter(Boolean).join("\n");
1199
+ }
1200
+ /** Emit existing small-name consumers only when the runtime owns the authored role. */
1201
+ function smallHeadingCss(root, role) {
1202
+ if (!role) return "";
1203
+ return `\n${root} .shop__card-name, ${root} .shop--register .shop__card-name, ${root} .recurring-schedule-title, ${root} .block-site-footer .rb-label {
1204
+ font-family: var(--font-small-heading, var(--font-heading));
1205
+ font-weight: var(--fw-small-heading, 500);
1206
+ }`;
1207
+ }
1208
+ //#endregion
1209
+ //#region ../theme-core/src/blocks/vars/event-registration.ts
1210
+ /**
1211
+ * Generate CSS variables for the event-registration block.
1212
+ *
1213
+ * Variables defined:
1214
+ * - Step indicator colors (active, inactive, completed, text, connector)
1215
+ * - Success/error/waitlist state backgrounds and text colors
1216
+ * - Capacity badge colors (available, low, sold-out)
1217
+ * - Border colors for various interaction states
1218
+ * - Payment option card styling
1219
+ * - Checkmark indicator colors
1220
+ * - Order summary styling
1221
+ */
1222
+ function generateEventRegistrationVars({ themeId, surface, embeddedRegistrationPaint }) {
1223
+ const root = `:where([data-theme-scope="${themeId}"]) :where([data-block="event-registration"])`;
1224
+ return `
1225
+ ${root} {${registrationSurfaceVars}
1226
+ }
1227
+ ${includedSummaryInkCss(root, surface, embeddedRegistrationPaint)}
1228
+ `;
1229
+ }
1230
+ /** Static control roles are data; only the authored summary ink needs solving. */
1231
+ const registrationSurfaceVars = `
1232
+ /* Event selection cards should remain surfaced form controls even when the
1233
+ theme defines a more opinionated shared tile treatment elsewhere. */
1234
+ --er-event-card-bg: rgb(var(--tb-surface));
1235
+ --er-event-card-border-width: var(--rb-border-width, 1px);
1236
+ --er-event-card-hover-opacity: 1;
1237
+ --er-control-bg: rgb(var(--tb-background, var(--tb-surface)));
1238
+ --er-control-text: rgb(var(--tb-foreground, var(--tb-text)));
1239
+ --er-radius: var(--rb-block-radius);
1240
+ --er-surface-muted: rgb(var(--tb-muted, 241 245 249) / 0.42);
1241
+ --er-shell-line: rgb(var(--tb-mutedText, 100 116 139) / 0.22);
1242
+
1243
+ /* Step indicator */
1244
+ --er-step-active: rgb(var(--tb-primary));
1245
+
1246
+ /* Step title */
1247
+ --er-step-title-size: 1.75rem;
1248
+
1249
+ /* State backgrounds with alpha */
1250
+ --er-info-bg: rgb(var(--tb-primary) / 0.1);
1251
+ --er-info-text: rgb(var(--tb-primary));
1252
+ --er-error-bg: rgb(var(--tb-destructive, 239 68 68) / 0.1);
1253
+ --er-error-text: rgb(var(--tb-destructive, 239 68 68));
1254
+ --er-waitlist-bg: rgb(var(--tb-warning) / 0.1);
1255
+ --er-waitlist-text: rgb(var(--tb-warning));
1256
+
1257
+ /* Capacity badges */
1258
+ --er-capacity-available-bg: rgb(var(--tb-success) / 0.1);
1259
+ --er-capacity-available-text: rgb(var(--tb-success));
1260
+ --er-capacity-low-bg: rgb(var(--tb-warning) / 0.1);
1261
+ --er-capacity-low-text: rgb(var(--tb-warning));
1262
+ --er-capacity-soldout-bg: rgb(var(--tb-destructive, 239 68 68) / 0.1);
1263
+ --er-capacity-soldout-text: rgb(var(--tb-destructive, 239 68 68));
1264
+
1265
+ /* Borders */
1266
+ --er-border: rgb(var(--tb-border));
1267
+ --er-border-hover: rgb(var(--tb-primary) / 0.5);
1268
+ --er-border-selected: rgb(var(--tb-primary));
1269
+ --er-border-error: rgb(var(--tb-destructive, 239 68 68));
1270
+
1271
+ /* Input focus */
1272
+ --er-focus-ring: rgb(var(--tb-primary) / 0.3);
1273
+
1274
+ /* Payment option cards */
1275
+ --er-payment-border: rgb(var(--tb-border));
1276
+ --er-payment-border-hover: rgb(var(--tb-primary) / 0.5);
1277
+ --er-payment-border-selected: rgb(var(--tb-primary));
1278
+ --er-payment-bg-selected: rgb(var(--tb-primary) / 0.08);
1279
+
1280
+ /* Checkmark indicator */
1281
+ --er-check-bg: rgb(var(--tb-primary));
1282
+ --er-check-text: rgb(var(--tb-onPrimary, 255 255 255));
1283
+
1284
+ /* Order summary */
1285
+ --er-summary-bg: rgb(var(--tb-primary) / 0.1);
1286
+ --er-summary-border: rgb(var(--tb-border));
1287
+
1288
+ /* Shared registration-surface mappings (issue 1174).
1289
+ Route the shared --rb-reg-* contract through this block's documented
1290
+ Tier 3 vars so existing --er-* overrides keep working unchanged. */
1291
+ --rb-reg-radius: var(--er-radius);
1292
+ --rb-reg-border: var(--er-border);
1293
+ --rb-reg-border-hover: var(--er-border-hover);
1294
+ --rb-reg-border-selected: var(--er-border-selected);
1295
+ --rb-reg-bg-selected: var(--er-payment-bg-selected);
1296
+ --rb-reg-option-bg: var(--er-control-bg);
1297
+ --rb-reg-option-hover-shadow: 0 8px 18px rgb(var(--tb-shadow, 15 23 42) / 0.08);
1298
+ --rb-reg-surface-bg: rgb(var(--tb-surface));
1299
+ --rb-reg-on-surface: var(--er-on-surface);
1300
+ --rb-reg-on-surface-muted: var(--er-on-surface-muted);
1301
+ --rb-reg-on-surface-subtle: var(--er-on-surface-subtle);
1302
+ --rb-reg-on-surface-faint: var(--er-on-surface-faint);
1303
+ --rb-reg-check-bg: var(--er-check-bg);
1304
+ --rb-reg-check-text: var(--er-check-text);
1305
+ --rb-reg-step-active: var(--er-step-active);
1306
+ --rb-reg-summary-bg: var(--er-surface-muted);
1307
+ --rb-reg-summary-border: var(--er-border);
1308
+ --rb-reg-focus-ring: var(--er-focus-ring);
1309
+ --rb-reg-shell-line: var(--er-shell-line);`;
1310
+ /** Ordinary/overlay panels own surface; transparent embedded forms use the default card. */
1311
+ function includedSummaryInkCss(root, surface, embeddedPaint) {
1312
+ if (surface?.solvedInks !== "publish") return "";
1313
+ return `${root}:not(.event-registration--embedded) .er-summary-bar-included,
1314
+ ${root} .er-container--overlay .er-summary-bar-included {
1315
+ ${summaryInkDeclarations({
1316
+ kind: "solid",
1317
+ token: "surface"
1318
+ }, surface)}
1319
+ }
1320
+ ${root}.event-registration--embedded .er-container:not(.er-container--overlay) .er-summary-bar-included {
1321
+ ${summaryInkDeclarations(embeddedPaint, surface)}
1322
+ }`;
1323
+ }
1324
+ function summaryInkDeclarations(paint, surface) {
1325
+ const foreground = paint?.kind === "solid" ? resolveSurfaceForeground({
1326
+ type: "color",
1327
+ color: paint.token,
1328
+ textColor: paint.foregroundToken
1329
+ }, surface.palette) : { kind: "unmeasured-paint" };
1330
+ return surfaceInkDeclarations(foreground.kind === "known" && foreground.provenance.kind === "measured" ? {
1331
+ kind: "solved",
1332
+ inks: solveSurfaceInks(foreground.provenance.backdropHex, foreground.roles.text, surface.palette, { brand: "primary-600" })
1333
+ } : { kind: "reset" }).filter((declaration) => declaration.startsWith("--rb-surface-brand-color:")).join("\n");
1334
+ }
1335
+ //#endregion
1336
+ //#region ../theme-core/src/blocks/vars/event-card-vars.ts
1337
+ /**
1338
+ * Shared CSS variables for the EventCard component.
1339
+ *
1340
+ * These vars are defined at the block root (Tier 3) so SDK themes can override them
1341
+ * via `blockCustomVars` and `blockCustomCss`.
1342
+ */
1343
+ function getEventCardCssVars(indent = " ") {
1344
+ return [
1345
+ "--rb-event-card-media-height: 20rem;",
1346
+ "--rb-event-card-image-hover-scale: 1.08;",
1347
+ "--rb-event-card-image-transition-duration: 700ms;",
1348
+ "--rb-event-card-hover-translate-y: 0px;",
1349
+ "--rb-event-card-overlay-color: rgb(var(--tb-primary));",
1350
+ "--rb-event-card-overlay-opacity: 0;",
1351
+ "--rb-event-card-overlay-hover-opacity: 0;",
1352
+ "--rb-event-card-overlay-blend-mode: multiply;",
1353
+ "--rb-event-card-horizontal-image-width: 33.333%;",
1354
+ "--rb-event-card-horizontal-gap: 1rem;"
1355
+ ].map((line) => `${indent}${line}`).join("\n");
1356
+ }
1357
+ //#endregion
1358
+ //#region ../theme-core/src/blocks/vars/event-calendar.ts
1359
+ /**
1360
+ * Generate CSS variables for the event-calendar block.
1361
+ *
1362
+ * Variables defined:
1363
+ * - Day cell colors (today highlight, other-month fade)
1364
+ * - Event item colors (background, hover)
1365
+ * - Navigation button hover
1366
+ * - Day header background
1367
+ * - Border and separator colors
1368
+ * - Surface and text colors (for inputs/dropdowns)
1369
+ */
1370
+ function generateEventCalendarVars({ themeId }) {
1371
+ return `
1372
+ ${`:where([data-theme-scope="${themeId}"]) :where([data-block="event-calendar"])`} {
1373
+ /* Day cell states */
1374
+ --ec-today-bg: rgb(var(--tb-primary) / 0.05);
1375
+ --ec-today-text: rgb(var(--tb-primary));
1376
+ --ec-other-month-opacity: 0.4;
1377
+
1378
+ /* Event items - subtle style (legacy) */
1379
+ --ec-event-bg: rgb(var(--tb-primary) / 0.1);
1380
+ --ec-event-hover-bg: rgb(var(--tb-primary) / 0.2);
1381
+
1382
+ /* Event items - solid style (default) */
1383
+ --ec-event-solid-bg: rgb(var(--tb-primary));
1384
+ --ec-event-solid-hover-bg: rgb(var(--tb-primary-600, var(--tb-primary)));
1385
+ --ec-event-solid-text: rgb(var(--tb-neutral-50, 255 255 255));
1386
+
1387
+ /* Navigation */
1388
+ --ec-nav-hover-bg: rgb(var(--tb-text) / 0.1);
1389
+
1390
+ /* Day headers */
1391
+ --ec-header-bg: rgb(var(--tb-text) / 0.05);
1392
+ --ec-header-opacity: 0.7;
1393
+
1394
+ /* Borders */
1395
+ --ec-border: rgb(var(--tb-border));
1396
+ --ec-border-subtle: rgb(var(--tb-border) / 0.5);
1397
+
1398
+ /* Surface and text (for inputs/dropdowns) */
1399
+ --ec-surface: rgb(var(--tb-surface));
1400
+ --ec-text: rgb(var(--tb-text));
1401
+
1402
+ /* Text colors */
1403
+ --ec-day-number-opacity: 0.7;
1404
+ --ec-time-opacity: 0.7;
1405
+ --ec-more-opacity: 0.6;
1406
+ --ec-empty-opacity: 0.6;
1407
+
1408
+ /* Tab bar (List/Calendar tabs in Combined mode) */
1409
+ --ec-tab-border-width: 1px;
1410
+ --ec-tab-border-color: var(--ec-border);
1411
+ --ec-tab-active-border-width: 2px;
1412
+ --ec-tab-active-color: rgb(var(--tb-primary));
1413
+ --rb-tab-border-width: var(--ec-tab-border-width);
1414
+ --rb-tab-border-color: var(--ec-tab-border-color);
1415
+ --rb-tab-active-border-width: var(--ec-tab-active-border-width);
1416
+ --rb-tab-active-color: var(--ec-tab-active-color);
1417
+ --rb-tab-text: var(--ec-text);
1418
+ --rb-tab-opacity: 0.7;
1419
+
1420
+ /* Modal */
1421
+ --ec-modal-overlay-bg: rgba(0, 0, 0, 0.5);
1422
+ --ec-modal-bg: rgb(var(--tb-surface, 255 255 255));
1423
+ --ec-modal-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
1424
+
1425
+ /* Event cards (list/spotlight views rendered inside event-calendar) */
1426
+ ${getEventCardCssVars(" ")}
1427
+ }
1428
+ `;
1429
+ }
1430
+ //#endregion
1431
+ //#region ../theme-core/src/blocks/vars/event-cards.ts
1432
+ function generateEventCardVarsForBlock(themeId, blockKind) {
1433
+ return `
1434
+ ${`:where([data-theme-scope="${themeId}"]) :where([data-block="${blockKind}"])`} {
1435
+ ${getEventCardCssVars(" ")}
1436
+ }
1437
+ `;
1438
+ }
1439
+ function generateEventListingVars({ themeId }) {
1440
+ return generateEventCardVarsForBlock(themeId, "event-listing");
1441
+ }
1442
+ function generateEventSpotlightVars({ themeId }) {
1443
+ return generateEventCardVarsForBlock(themeId, "event-spotlight");
1444
+ }
1445
+ function generateEventCombinedVars({ themeId }) {
1446
+ return generateEventCardVarsForBlock(themeId, "event-combined");
1447
+ }
1448
+ //#endregion
1449
+ //#region ../theme-core/src/blocks/vars/appointment-booking.ts
1450
+ /**
1451
+ * Generate CSS variables for the appointment-booking block.
1452
+ *
1453
+ * Variables defined:
1454
+ * - Selection card states (background, border, selected)
1455
+ * - Success/error state colors
1456
+ * - Loading spinner color
1457
+ * - Text opacity levels
1458
+ * - Form element colors
1459
+ */
1460
+ function generateAppointmentBookingVars({ themeId }) {
1461
+ return `
1462
+ ${`:where([data-theme-scope="${themeId}"]) :where([data-block="appointment-booking"])`} {
1463
+ /* Selection cards (service/resource/time) */
1464
+ --ab-card-border: rgb(var(--tb-border));
1465
+ --ab-card-border-hover: rgb(var(--tb-primary) / 0.5);
1466
+ --ab-card-border-selected: rgb(var(--tb-primary));
1467
+ --ab-card-bg-selected: rgb(var(--tb-primary) / 0.05);
1468
+
1469
+ /* Checkmark indicator */
1470
+ --ab-check-bg: rgb(var(--tb-primary));
1471
+ --ab-check-text: rgb(var(--tb-background));
1472
+
1473
+ /* State backgrounds */
1474
+ --ab-error-bg: rgb(var(--tb-destructive) / 0.1);
1475
+ --ab-error-text: rgb(var(--tb-destructive));
1476
+ --ab-warning-bg: rgb(var(--tb-warning) / 0.1);
1477
+ --ab-warning-text: rgb(var(--tb-warning));
1478
+ --ab-info-bg: rgb(var(--tb-info) / 0.1);
1479
+ --ab-info-text: rgb(var(--tb-info));
1480
+
1481
+ /* Muted summary state */
1482
+ --ab-muted-bg: rgb(var(--tb-text) / 0.05);
1483
+
1484
+ /* Focus ring used by shared registration-surface controls */
1485
+ --ab-input-focus-ring: rgb(var(--tb-primary) / 0.3);
1486
+
1487
+ /* Shared registration-surface mappings (issue 1174).
1488
+ Route the shared --rb-reg-* contract through this block's Tier 3 vars
1489
+ (palette tokens where no --ab-* var exists) so --ab-* overrides keep
1490
+ working as the block adopts the shared classes. */
1491
+ --rb-reg-radius: var(--ab-card-radius, var(--rb-block-radius));
1492
+ --rb-reg-border: var(--ab-card-border);
1493
+ --rb-reg-border-hover: var(--ab-card-border-hover);
1494
+ --rb-reg-border-selected: var(--ab-card-border-selected);
1495
+ --rb-reg-bg-selected: var(--ab-card-bg-selected);
1496
+ --rb-reg-option-bg: transparent;
1497
+ --rb-reg-option-hover-shadow: 0 8px 18px rgb(var(--tb-shadow, 15 23 42) / 0.08);
1498
+ --rb-reg-surface-bg: rgb(var(--tb-surface));
1499
+ --rb-reg-on-surface: rgb(var(--tb-onSurface, var(--tb-text)));
1500
+ --rb-reg-on-surface-muted: rgb(var(--tb-onSurface, var(--tb-text)) / 0.7);
1501
+ --rb-reg-on-surface-subtle: rgb(var(--tb-onSurface, var(--tb-text)) / 0.6);
1502
+ --rb-reg-on-surface-faint: rgb(var(--tb-onSurface, var(--tb-text)) / 0.5);
1503
+ --rb-reg-check-bg: var(--ab-check-bg);
1504
+ --rb-reg-check-text: var(--ab-check-text);
1505
+ --rb-reg-step-active: rgb(var(--tb-primary));
1506
+ --rb-reg-summary-bg: var(--ab-muted-bg);
1507
+ --rb-reg-summary-border: var(--ab-card-border);
1508
+ --rb-reg-focus-ring: var(--ab-input-focus-ring);
1509
+ --rb-reg-shell-line: rgb(var(--tb-mutedText, 100 116 139) / 0.22);
1510
+ }
1511
+ `;
1512
+ }
1513
+ //#endregion
1514
+ //#region ../theme-core/src/blocks/vars/form-block.ts
1515
+ /**
1516
+ * Generate CSS variables for the form block.
1517
+ *
1518
+ * Variables defined:
1519
+ * - Success state colors (background, text, border)
1520
+ * - Error state colors (background, text, border)
1521
+ * - Empty state colors
1522
+ * - Container styling
1523
+ */
1524
+ function generateFormBlockVars({ themeId }) {
1525
+ return `
1526
+ ${`:where([data-theme-scope="${themeId}"]) :where([data-block="form"])`} {
1527
+ /* Success state */
1528
+ --fb-success-bg: rgb(var(--tb-success) / 0.1);
1529
+ --fb-success-text: rgb(var(--tb-success));
1530
+ --fb-success-border: rgb(var(--tb-success) / 0.3);
1531
+
1532
+ /* Error state */
1533
+ --fb-error-bg: rgb(var(--tb-destructive) / 0.1);
1534
+ --fb-error-text: rgb(var(--tb-destructive));
1535
+ --fb-error-border: rgb(var(--tb-destructive) / 0.3);
1536
+
1537
+ /* Empty state */
1538
+ --fb-empty-bg: rgb(var(--tb-surface));
1539
+ --fb-empty-border: rgb(var(--tb-border));
1540
+ --fb-empty-text: rgb(var(--tb-mutedText));
1541
+
1542
+ /* Submit button inherits from button system */
1543
+ }
1544
+ `;
1545
+ }
1546
+ //#endregion
1547
+ //#region ../theme-core/src/runtime/themeCssVarNames.ts
1548
+ const THEME_RADIUS_CSS_VARS = {
1549
+ block: "--rb-block-radius",
1550
+ button: "--rb-button-radius",
1551
+ input: "--rb-input-radius",
1552
+ panel: "--rb-panel-radius",
1553
+ legacyCard: "--radius-card",
1554
+ legacyControl: "--radius-control"
1555
+ };
1556
+ //#endregion
1557
+ //#region ../theme-core/src/blocks/vars/customer-portal.ts
1558
+ /**
1559
+ * Generate CSS variables for the customer-portal block.
1560
+ *
1561
+ * Variables defined:
1562
+ * - Container styling (background, border, shadow)
1563
+ * - Input and form control styling
1564
+ * - Tab navigation colors
1565
+ * - Status badges (success, warning, error, info, default)
1566
+ * - Progress indicators for credit bars
1567
+ * - Card styling
1568
+ * - Alert/notification styling
1569
+ *
1570
+ * Note: Buttons use theme button classes (primary, secondary) - no custom button vars needed.
1571
+ */
1572
+ function generateCustomerPortalVars({ themeId, surface }) {
1573
+ const root = `:where([data-theme-scope="${themeId}"]) :where([data-block="customer-portal"])`;
1574
+ return `
1575
+ ${root} {${customerPortalVars}
1576
+ }
1577
+ ${root} .cp-login {
1578
+ ${surfaceInkDeclarations(surfaceInkPublication(surface ? resolveSurfaceForeground({
1579
+ type: "color",
1580
+ color: "surface"
1581
+ }, surface.palette) : { kind: "unmeasured-paint" }, surface?.solvedInks ?? "withhold")).join("\n ")}
1582
+ }
1583
+ `;
1584
+ }
1585
+ const customerPortalVars = `
1586
+ /* Container */
1587
+ --cp-bg: rgb(var(--tb-surface));
1588
+ --cp-text: rgb(var(--tb-text));
1589
+ --cp-muted: rgb(var(--tb-mutedText));
1590
+ --cp-border: rgb(var(--tb-border));
1591
+ --cp-shadow: var(--shadow-elev);
1592
+ --cp-primary: rgb(var(--tb-primary));
1593
+ --cp-primary-hover: rgb(var(--tb-primary-700, var(--tb-primary)));
1594
+ --cp-error: rgb(var(--tb-destructive));
1595
+ --cp-card-radius: var(${THEME_RADIUS_CSS_VARS.block}, var(${THEME_RADIUS_CSS_VARS.legacyCard}, 0.75rem));
1596
+ --cp-control-radius: var(${THEME_RADIUS_CSS_VARS.input}, var(${THEME_RADIUS_CSS_VARS.legacyControl}, 0.5rem));
1597
+
1598
+ /* Shared tab bar (underline style) */
1599
+ --rb-tab-border-width: 1px;
1600
+ --rb-tab-border-color: rgb(var(--tb-border));
1601
+ --rb-tab-active-border-width: 2px;
1602
+ --rb-tab-active-color: rgb(var(--tb-primary));
1603
+ --rb-tab-text: rgb(var(--tb-text));
1604
+ --rb-tab-opacity: 0.7;
1605
+
1606
+ /* Badge - Success (active, confirmed) */
1607
+ --cp-badge-success-bg: rgb(var(--tb-success) / 0.1);
1608
+ --cp-badge-success-text: rgb(var(--tb-success));
1609
+
1610
+ /* Badge - Warning (paused, low credits, waitlist) */
1611
+ --cp-badge-warning-bg: rgb(var(--tb-warning) / 0.1);
1612
+ --cp-badge-warning-text: rgb(var(--tb-warning));
1613
+
1614
+ /* Badge - Error (canceled, expired, past_due) */
1615
+ --cp-badge-error-bg: rgb(var(--tb-destructive) / 0.1);
1616
+ --cp-badge-error-text: rgb(var(--tb-destructive));
1617
+
1618
+ /* Badge - Info (trialing, scheduled) */
1619
+ --cp-badge-info-bg: rgb(var(--tb-primary) / 0.1);
1620
+ --cp-badge-info-text: rgb(var(--tb-primary));
1621
+
1622
+ /* Badge - Default (neutral states) */
1623
+ --cp-badge-default-bg: rgb(var(--tb-mutedText) / 0.1);
1624
+ --cp-badge-default-text: rgb(var(--tb-mutedText));
1625
+
1626
+ /* Progress bar (for credit display) */
1627
+ --cp-progress-bg: rgb(var(--tb-border));
1628
+ --cp-progress-fill: rgb(var(--tb-primary));
1629
+
1630
+ /* Card styling */
1631
+ --cp-card-bg: rgb(var(--tb-surface));
1632
+ --cp-card-border: rgb(var(--tb-border));
1633
+
1634
+ /* Alert/notification */
1635
+ --cp-alert-success-bg: rgb(var(--tb-success) / 0.1);
1636
+ --cp-alert-success-text: rgb(var(--tb-success));
1637
+ --cp-alert-success-border: rgb(var(--tb-success));
1638
+ --cp-alert-error-bg: rgb(var(--tb-destructive) / 0.1);
1639
+ --cp-alert-error-text: rgb(var(--tb-destructive));
1640
+ --cp-alert-error-border: rgb(var(--tb-destructive));
1641
+
1642
+ /* Modal (shared rb-modal classes) */
1643
+ --rb-modal-overlay-bg: rgb(var(--tb-text, 0 0 0) / 0.35);
1644
+ --rb-modal-bg: var(--cp-card-bg);
1645
+ --rb-modal-text: var(--cp-text);
1646
+ --rb-modal-heading: var(--cp-text);
1647
+ --rb-modal-link: var(--cp-primary);
1648
+ --rb-modal-supporting: var(--cp-muted);
1649
+ --rb-modal-border: var(--cp-card-border);
1650
+ --rb-modal-shadow: var(--shadow-lg, var(--shadow-elev));
1651
+ --rb-modal-radius: var(--cp-card-radius);
1652
+ --rb-modal-max-width: 560px;
1653
+
1654
+ /* Header */
1655
+ --cp-header-bg: transparent;
1656
+ --cp-header-border: rgb(var(--tb-border));
1657
+
1658
+ /* Section */
1659
+ --cp-section-bg: transparent;`;
1660
+ //#endregion
1661
+ //#region ../theme-core/src/blocks/vars/testimonials.ts
1662
+ const QUOTE_SCALE_SIZE = {
1663
+ sm: "2.5rem",
1664
+ md: "3.5rem",
1665
+ lg: "4.375rem",
1666
+ xl: "clamp(3.5rem, 2rem + 4vw, 5.5rem)"
1667
+ };
1668
+ /**
1669
+ * Resolve the quote-mark CSS values from the site-style treatment. `style`
1670
+ * gives the base; explicit fields override. Undefined keeps the historical
1671
+ * faint primary watermark so themes without a treatment are unchanged.
1672
+ */
1673
+ function resolveTestimonialQuoteVars(treatment) {
1674
+ if (!treatment) return {
1675
+ size: QUOTE_SCALE_SIZE.md,
1676
+ opacity: "0.08",
1677
+ color: "rgb(var(--tb-primary))",
1678
+ font: "inherit",
1679
+ weight: "700",
1680
+ display: "block"
1681
+ };
1682
+ if (treatment.style === "none") return {
1683
+ size: QUOTE_SCALE_SIZE.md,
1684
+ opacity: "0",
1685
+ color: "rgb(var(--tb-primary))",
1686
+ font: "inherit",
1687
+ weight: "700",
1688
+ display: "none"
1689
+ };
1690
+ const base = treatment.style === "serif-display" ? {
1691
+ fontFamily: "heading",
1692
+ scale: "xl",
1693
+ colorToken: "primary",
1694
+ opacity: 1
1695
+ } : {
1696
+ fontFamily: "body",
1697
+ scale: "lg",
1698
+ colorToken: "secondary",
1699
+ opacity: 1
1700
+ };
1701
+ const fontFamily = treatment.fontFamily ?? base.fontFamily;
1702
+ const scale = treatment.scale ?? base.scale;
1703
+ const colorToken = treatment.colorToken ?? base.colorToken;
1704
+ const opacity = treatment.opacity ?? base.opacity;
1705
+ return {
1706
+ size: QUOTE_SCALE_SIZE[scale],
1707
+ opacity: String(opacity),
1708
+ color: rgbColorValue(colorToken),
1709
+ font: fontFamily === "heading" ? "var(--font-heading)" : "var(--font-body, inherit)",
1710
+ weight: fontFamily === "heading" ? "400" : "700",
1711
+ display: "block"
1712
+ };
1713
+ }
1714
+ function generateTestimonialsVars({ themeId, theme }) {
1715
+ const root = `:where([data-theme-scope="${themeId}"]) :where([data-block="testimonials"])`;
1716
+ const quote = resolveTestimonialQuoteVars(theme.testimonialQuote);
1717
+ return `
1718
+ ${root} {
1719
+ --rb-testimonial-avatar-size: 3rem;
1720
+ --rb-testimonial-avatar-border-radius: 9999px;
1721
+ --rb-testimonial-quote-size: ${quote.size};
1722
+ --rb-testimonial-quote-opacity: ${quote.opacity};
1723
+ --rb-testimonial-quote-color: ${quote.color};
1724
+ --rb-testimonial-quote-font: ${quote.font};
1725
+ --rb-testimonial-quote-weight: ${quote.weight};
1726
+ --rb-testimonial-quote-display: ${quote.display};
1727
+
1728
+ /* Carousel arrows: use the secondary chip so accent-band sections retain contrast. */
1729
+ --rb-testimonial-carousel-arrow-bg: rgb(var(--tb-secondary));
1730
+ --rb-testimonial-carousel-arrow-bg-hover: color-mix(in oklab, rgb(var(--tb-secondary)), rgb(var(--tb-text)) 14%);
1731
+ --rb-testimonial-carousel-arrow-color: rgb(var(--tb-onSecondary));
1732
+ --rb-testimonial-carousel-arrow-border-color: rgb(var(--tb-onSecondary) / 0.22);
1733
+ --rb-testimonial-carousel-arrow-size: 2.75rem;
1734
+ --rb-testimonial-carousel-arrow-icon-size: 1.25rem;
1735
+ --rb-testimonial-carousel-arrow-icon-stroke-width: 2.5;
1736
+
1737
+ /* Layout tuning */
1738
+ --rb-testimonial-carousel-shadow-pad: 0.5rem;
1739
+ }
1740
+ `;
1741
+ }
1742
+ //#endregion
1743
+ //#region ../theme-core/src/blocks/registry.ts
1744
+ /**
1745
+ * Global registry of block var generators.
1746
+ */
1747
+ const blockVarRegistry = /* @__PURE__ */ new Map();
1748
+ blockVarRegistry.set("event-registration", generateEventRegistrationVars);
1749
+ blockVarRegistry.set("event-calendar", generateEventCalendarVars);
1750
+ blockVarRegistry.set("event-listing", generateEventListingVars);
1751
+ blockVarRegistry.set("event-spotlight", generateEventSpotlightVars);
1752
+ blockVarRegistry.set("event-combined", generateEventCombinedVars);
1753
+ blockVarRegistry.set("appointment-booking", generateAppointmentBookingVars);
1754
+ blockVarRegistry.set("form", generateFormBlockVars);
1755
+ blockVarRegistry.set("customer-portal", generateCustomerPortalVars);
1756
+ blockVarRegistry.set("testimonials", generateTestimonialsVars);
1757
+ /**
1758
+ * Generate all Tier 3 block-specific CSS variables.
1759
+ *
1760
+ * @param context - Theme and themeId for scoped CSS generation
1761
+ * @returns CSS string with all registered block vars
1762
+ */
1763
+ function generateAllBlockVarsCss(context) {
1764
+ const cssChunks = [];
1765
+ for (const generator of blockVarRegistry.values()) {
1766
+ const css = generator(context);
1767
+ if (css) cssChunks.push(css.trim());
1768
+ }
1769
+ return cssChunks.join("\n\n");
1770
+ }
1771
+ /**
1772
+ * Generate CSS for user-defined block custom variables.
1773
+ *
1774
+ * Uses descendant selectors to properly scope variables:
1775
+ * :where([data-theme-scope="themeId"]) :where([data-block="blockKind"]) { ... }
1776
+ *
1777
+ * @param themeId - Theme scope ID
1778
+ * @param blockCustomVars - User-defined custom vars by block kind
1779
+ * @returns CSS string with custom var definitions
1780
+ */
1781
+ function generateBlockCustomVarsCss(themeId, blockCustomVars) {
1782
+ if (!blockCustomVars || Object.keys(blockCustomVars).length === 0) return "";
1783
+ const cssChunks = [];
1784
+ for (const [blockKind, vars] of Object.entries(blockCustomVars)) {
1785
+ if (!vars || Object.keys(vars).length === 0) continue;
1786
+ const varLines = Object.entries(vars).map(([varName, value]) => ` ${varName}: ${value};`).join("\n");
1787
+ cssChunks.push(`:where([data-theme-scope="${themeId}"]) :where([data-block="${blockKind}"]) {\n${varLines}\n}`);
1788
+ }
1789
+ return cssChunks.join("\n\n");
1790
+ }
1791
+ //#endregion
1792
+ //#region ../theme-core/src/customCss/validation.ts
1793
+ function toValidatedCssSelector(value) {
1794
+ return value;
1795
+ }
1796
+ function toValidatedCssDeclarationValue(value) {
1797
+ return value;
1798
+ }
1799
+ function toValidatedCssDeclarations(declarations) {
1800
+ return Object.fromEntries(Object.entries(declarations).map(([property, value]) => [property, toValidatedCssDeclarationValue(value)]));
1801
+ }
1802
+ function parseCustomCssRule(rule) {
1803
+ const parsed = customCssRuleSchema.parse(rule);
1804
+ return {
1805
+ id: parsed.id,
1806
+ selector: toValidatedCssSelector(parsed.selector),
1807
+ declarations: toValidatedCssDeclarations(parsed.declarations)
1808
+ };
1809
+ }
1810
+ function parseCustomCssRules(rules) {
1811
+ return rules?.map((rule) => parseCustomCssRule(rule));
1812
+ }
1813
+ function parseBlockCustomCssRule(rule) {
1814
+ const parsed = blockCustomCssRuleSchema.parse(rule);
1815
+ return {
1816
+ id: parsed.id,
1817
+ selector: toValidatedCssSelector(parsed.selector),
1818
+ declarations: toValidatedCssDeclarations(parsed.declarations),
1819
+ blockKind: parsed.blockKind
1820
+ };
1821
+ }
1822
+ function parseBlockCustomCssRules(rules) {
1823
+ return rules?.map((rule) => parseBlockCustomCssRule(rule));
1824
+ }
1825
+ //#endregion
1826
+ //#region ../theme-core/src/customCss/selectorUtils.ts
1827
+ /**
1828
+ * Shared CSS Selector Utilities
1829
+ *
1830
+ * Common functions for prefixing and manipulating CSS selectors.
1831
+ * Used by both compile.ts and compileAtRules.ts.
1832
+ */
1833
+ /**
1834
+ * Prefix a selector with the theme scope.
1835
+ * Handles special cases:
1836
+ * - `&` or `&...` → self-targeting (applies to scope element itself)
1837
+ * - Comma-separated selectors → each part gets prefixed
1838
+ * - Regular selectors → descendant selector (scope space selector)
1839
+ *
1840
+ * @param selector - Original CSS selector
1841
+ * @param scopePrefix - Theme scope prefix
1842
+ * @returns Prefixed selector
1843
+ */
1844
+ function prefixSelector(selector, scopePrefix) {
1845
+ return selector.split(",").map((s) => s.trim()).filter(Boolean).map((s) => {
1846
+ for (const alias of [".theme-scope", ":where(.theme-scope)"]) {
1847
+ if (s === alias) return scopePrefix;
1848
+ if (s.startsWith(alias)) return scopePrefix + s.slice(alias.length);
1849
+ }
1850
+ if (s === "&") return scopePrefix;
1851
+ if (s.startsWith("&")) return scopePrefix + s.slice(1);
1852
+ return `${scopePrefix} ${s}`;
1853
+ }).join(", ");
1854
+ }
1855
+ /**
1856
+ * Convert camelCase to kebab-case for CSS properties.
1857
+ * Examples: fontFamily → font-family, backgroundColor → background-color
1858
+ */
1859
+ function toKebabCase(str) {
1860
+ return str.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`);
1861
+ }
1862
+ /**
1863
+ * Escape content that could break out of a <style> tag.
1864
+ * Prevents XSS via CSS injection in dangerouslySetInnerHTML.
1865
+ */
1866
+ function escapeStyleContent(css) {
1867
+ return css.replace(/<\/style/gi, "<\\/style");
1868
+ }
1869
+ //#endregion
1870
+ //#region ../theme-core/src/customCss/compile.ts
1871
+ /**
1872
+ * Compile an array of custom CSS rules to a scoped CSS string.
1873
+ *
1874
+ * @param rules - Array of custom CSS rules
1875
+ * @param themeId - Theme scope ID for selector prefixing
1876
+ * @returns Scoped CSS string
1877
+ */
1878
+ function compileCustomCssRules(rules, themeId) {
1879
+ if (!rules || rules.length === 0) return "";
1880
+ const scopePrefix = `:where([data-theme-scope="${themeId}"])`;
1881
+ return rules.map((rule) => compileRule(rule.selector, rule.declarations, scopePrefix)).filter(Boolean).join("\n\n");
1882
+ }
1883
+ /**
1884
+ * Compile an array of block-specific CSS rules to a scoped CSS string.
1885
+ * Rules are grouped by block kind for cleaner output.
1886
+ *
1887
+ * @param rules - Array of block CSS rules
1888
+ * @param themeId - Theme scope ID for selector prefixing
1889
+ * @returns Scoped CSS string grouped by block
1890
+ */
1891
+ function compileBlockCustomCssRules(rules, themeId) {
1892
+ if (!rules || rules.length === 0) return "";
1893
+ const rulesByBlock = /* @__PURE__ */ new Map();
1894
+ for (const rule of rules) {
1895
+ const existing = rulesByBlock.get(rule.blockKind) || [];
1896
+ existing.push(rule);
1897
+ rulesByBlock.set(rule.blockKind, existing);
1898
+ }
1899
+ const cssChunks = [];
1900
+ for (const [blockKind, blockRules] of rulesByBlock) {
1901
+ const scopePrefix = `:where([data-theme-scope="${themeId}"]) :where([data-block="${blockKind}"])`;
1902
+ const blockCss = blockRules.map((rule) => compileRule(rule.selector, rule.declarations, scopePrefix)).filter(Boolean).join("\n");
1903
+ if (blockCss) cssChunks.push(`/* Block: ${blockKind} */\n${blockCss}`);
1904
+ }
1905
+ return cssChunks.join("\n\n");
1906
+ }
1907
+ /**
1908
+ * Compile a single rule to CSS.
1909
+ * Converts camelCase property names to kebab-case.
1910
+ *
1911
+ * @param selector - CSS selector (may contain comma-separated selectors)
1912
+ * @param declarations - CSS property-value map
1913
+ * @param scopePrefix - Prefix to prepend to selectors
1914
+ * @returns Compiled CSS rule string
1915
+ */
1916
+ function compileRule(selector, declarations, scopePrefix) {
1917
+ const declarationLines = Object.entries(declarations).map(([prop, value]) => ` ${toKebabCase(prop)}: ${value};`).join("\n");
1918
+ if (!declarationLines) return "";
1919
+ return `${prefixSelector(selector, scopePrefix)} {\n${declarationLines}\n}`;
1920
+ }
1921
+ //#endregion
1922
+ //#region ../theme-core/src/runtime/themeStylesheet.ts
1923
+ const channels = [
1924
+ ["layoutCss", "data-layout-styles"],
1925
+ ["buttonCss", "data-button-effects"],
1926
+ ["headerCss", "data-header-styles"],
1927
+ ["footerCss", "data-footer-styles"],
1928
+ ["cardCss", "data-card-styles"],
1929
+ ["accordionCss", "data-accordion-styles"],
1930
+ ["inputCss", "data-input-styles"],
1931
+ ["statusCss", "data-status-styles"],
1932
+ ["progressCss", "data-progress-styles"],
1933
+ ["typographyCss", "data-typography-styles"],
1934
+ ["eventCalendarCss", "data-event-calendar-styles"],
1935
+ ["blockVarsCss", "data-block-vars-styles"],
1936
+ ["blockCustomVarsCss", "data-block-custom-vars-styles"],
1937
+ ["blockCustomCss", "data-block-custom-styles"],
1938
+ ["atRulesCss", "data-at-rules-styles"],
1939
+ ["customCss", "data-custom-theme-styles"]
1940
+ ];
1941
+ /** The scope's cascade order and style-content escaping have one owner. */
1942
+ function projectThemeStyles(runtime) {
1943
+ return channels.flatMap(([key, attribute]) => {
1944
+ const css = runtime[key];
1945
+ return css ? [{
1946
+ attribute,
1947
+ text: escapeStyleContent(css)
1948
+ }] : [];
1949
+ });
1950
+ }
1951
+ //#endregion
1952
+ //#region ../theme-core/src/ThemeScopeCore.tsx
1953
+ /**
1954
+ * Shared presentational component for theme scope rendering.
1955
+ *
1956
+ * This component handles the actual DOM structure for theme injection:
1957
+ * 1. Wrapper div with CSS variables as inline styles
1958
+ * 2. Data attributes for theme axis selectors
1959
+ * 3. Style tags for layout, buttons, accordions, inputs, and custom CSS
1960
+ *
1961
+ * Used by both ThemeScope (server) and ClientThemeScope (client).
1962
+ */
1963
+ function ThemeScopeCore({ cssVars, dataAttrs, responsiveMode = DEFAULT_THEME_RESPONSIVE_MODE, suppressHydrationWarning, children, className, ...css }) {
1964
+ const responsiveScope = getResponsiveScopeSpec(responsiveMode);
1965
+ const wrapperStyle = responsiveScope.kind === "container" ? {
1966
+ ...cssVars,
1967
+ containerType: "inline-size",
1968
+ containerName: responsiveScope.containerName
1969
+ } : cssVars;
1970
+ return /* @__PURE__ */ jsxs("div", {
1971
+ className: className ? `theme-scope ${className}` : "theme-scope",
1972
+ style: wrapperStyle,
1973
+ "data-rb-responsive-mode": responsiveScope.kind,
1974
+ ...dataAttrs,
1975
+ suppressHydrationWarning,
1976
+ children: [projectThemeStyles(css).map(({ attribute, text }) => /* @__PURE__ */ jsx("style", {
1977
+ [attribute]: true,
1978
+ dangerouslySetInnerHTML: { __html: text }
1979
+ }, attribute)), children]
1980
+ });
1981
+ }
1982
+ //#endregion
1983
+ export { cardDecorationPseudoRules as A, generateOpaquePanelCss as C, generateShadowCssVars as D, resolvedButtonFocusDeclarations as E, renderCssDeclarations as O, generateCheckableCss as S, resolvedButtonColourDeclarations as T, getResponsiveScopeSpec as _, prefixSelector as a, INPUT_GROUP_SELECTOR as b, parseCustomCssRules as c, THEME_RADIUS_CSS_VARS as d, generateTypographyCss as f, THEME_RESPONSIVE_CONTAINER_NAME as g, DEFAULT_THEME_RESPONSIVE_MODE as h, escapeStyleContent as i, cardBorderDeclarations as k, generateAllBlockVarsCss as l, generateStatusCss as m, compileBlockCustomCssRules as n, toKebabCase as o, generateProgressCss as p, compileCustomCssRules as r, parseBlockCustomCssRules as s, ThemeScopeCore as t, generateBlockCustomVarsCss as u, INPUT_GROUP_ERROR_SELECTOR as v, RESOLVED_BUTTON_DISABLED_DECLARATIONS as w, generateInputGroupCss as x, INPUT_GROUP_FOCUS_SELECTOR as y };