@riverbankcms/sdk 0.181.0 → 0.182.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 (196) hide show
  1. package/dist/_dts/{BlocksIslandsHydrator-CVCasDPz.d.ts → BlocksIslandsHydrator-Bvw2bUif.d.ts} +1 -1
  2. package/dist/_dts/{Page-Dtj2Ui3S.d.ts → Page-B2EAT-bE.d.ts} +7 -7
  3. package/dist/_dts/{SdkPreviewMode-D1f_60WW.d.ts → SdkPreviewMode-D0vww6rh.d.ts} +2 -2
  4. package/dist/_dts/{client-Chr9pNVW.d.ts → client-D6T430bk.d.ts} +1 -3
  5. package/dist/_dts/{content-types-kjccgopX.d.ts → content-types-wZVWccC6.d.ts} +2 -2
  6. package/dist/_dts/{contracts-BodaiS00.d.ts → contracts-B-vtOcr8.d.ts} +3 -3
  7. package/dist/_dts/{generatePageMetadata-BS6kaJFp.d.ts → generatePageMetadata-CxfwHE6z.d.ts} +2 -2
  8. package/dist/_dts/{index-Brl6_I2j.d.ts → index-CEyYMhLJ.d.ts} +1 -1
  9. package/dist/_dts/{index-DG0OvBs0.d.ts → index-CQrb3Ccc.d.ts} +4 -4
  10. package/dist/_dts/{index-Dy50xUMK.d.ts → index-CciRW_w1.d.ts} +2 -2
  11. package/dist/_dts/{index-Diqt0PvG.d.ts → index-Cqxis-nv.d.ts} +1 -1
  12. package/dist/_dts/{index-CJkefwYh.d.ts → index-DIU-wL1M.d.ts} +2 -2
  13. package/dist/_dts/{index-D1WpKwQe.d.ts → index-DqPKdeTk.d.ts} +1 -1
  14. package/dist/_dts/{loadContent-BgxshKrA.d.ts → loadContent-D0wrxiSp.d.ts} +7 -7
  15. package/dist/_dts/{request-CA0izds5.d.ts → request-DEwxUSw8.d.ts} +130 -28
  16. package/dist/_dts/{resolveBlockData-ChQmwEd3.d.ts → resolveBlockData-VaG_MYbN.d.ts} +5 -5
  17. package/dist/_dts/{resolvePageContent-BvGyvblj.d.ts → resolvePageContent-DTwklC_v.d.ts} +1 -1
  18. package/dist/_dts/sdk/src/bookings/index.d.ts +2 -2
  19. package/dist/_dts/sdk/src/client/types.d.ts +2 -2
  20. package/dist/_dts/sdk/src/client.d.ts +7 -7
  21. package/dist/_dts/sdk/src/config/index.d.ts +6 -6
  22. package/dist/_dts/sdk/src/config/template-validation.d.ts +1 -1
  23. package/dist/_dts/sdk/src/config/validation.d.ts +1 -1
  24. package/dist/_dts/sdk/src/data/dataLoaderContext.d.ts +2 -2
  25. package/dist/_dts/sdk/src/data/resolveBlockData.d.ts +1 -1
  26. package/dist/_dts/sdk/src/data/types.d.ts +2 -2
  27. package/dist/_dts/sdk/src/gifting/client.d.ts +1 -1
  28. package/dist/_dts/sdk/src/index.d.ts +7 -7
  29. package/dist/_dts/sdk/src/manifest/index.d.ts +3 -3
  30. package/dist/_dts/sdk/src/metadata/index.d.ts +1 -1
  31. package/dist/_dts/sdk/src/navigation/index.d.ts +3 -3
  32. package/dist/_dts/sdk/src/next/index.d.ts +7 -7
  33. package/dist/_dts/sdk/src/next/middleware.d.ts +2 -2
  34. package/dist/_dts/sdk/src/page-converter/index.d.ts +3 -3
  35. package/dist/_dts/sdk/src/portal/client.d.ts +1 -1
  36. package/dist/_dts/sdk/src/portal/index.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 +6 -6
  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/{serviceBookingOutline-BgFbJQhU.d.ts → serviceBookingOutline-DtQuFlID.d.ts} +6 -6
  54. package/dist/_dts/{types-CgS3xLk8.d.ts → types-B3RjeBLV.d.ts} +2 -2
  55. package/dist/_dts/{types-CQrsP1x_.d.ts → types-BvUSGQrw.d.ts} +3 -3
  56. package/dist/_dts/{types-R65DKjPn.d.ts → types-CkRFtBqd.d.ts} +7 -7
  57. package/dist/_dts/{validation-6LTIbuBA.d.ts → validation-BZA3DhcV.d.ts} +4 -4
  58. package/dist/client/{BlocksIslandsHydrator-DqZPz6oW.mjs → BlocksIslandsHydrator-CQMf0HdN.mjs} +17 -17
  59. package/dist/client/{BookingMailingListNote-uWfR2kaG.mjs → BookingMailingListNote-7kdvuPow.mjs} +6 -6
  60. package/dist/client/{BookingQuestionFields-CyNIKw6k.mjs → BookingQuestionFields-BJI7mZuV.mjs} +1 -1
  61. package/dist/client/{CalendarNavigationChevron-BGCX3zwG.mjs → CalendarNavigationChevron-DPUD6wjy.mjs} +7 -7
  62. package/dist/client/{DemoBookingPortalAccess-DFLPyuqe.mjs → DemoBookingPortalAccess-8kwNF9HN.mjs} +4 -4
  63. package/dist/client/{EventCalendar.client-zDL4-t-B.mjs → EventCalendar.client-Dhb14bcC.mjs} +9 -9
  64. package/dist/client/{EventCombined.client-uciDKLID.mjs → EventCombined.client-C1jEZBN9.mjs} +8 -8
  65. package/dist/client/{EventItem-CwzrjcRw.mjs → EventItem-Bb0ppG2N.mjs} +8 -176
  66. package/dist/client/{EventListWeekNavigation-ChvcnPma.mjs → EventListWeekNavigation-DMryCaNV.mjs} +1 -1
  67. package/dist/client/{EventListing.client-DA57Qoyx.mjs → EventListing.client-BuH5kKA3.mjs} +3 -3
  68. package/dist/client/{EventListing.view-DZ0qMFF4.mjs → EventListing.view-DsqvuulZ.mjs} +7 -7
  69. package/dist/client/{EventRegistrationPayment-DSqCJL8E.mjs → EventRegistrationPayment-D4FvQSFF.mjs} +31 -164
  70. package/dist/client/{Page-C7mygH_f.mjs → Page-sV6BJkXX.mjs} +172 -102
  71. package/dist/client/{SiteTermsAgreementField-B4z-e4Wq.mjs → SiteTermsAgreementField-VfSd6JU-.mjs} +2 -2
  72. package/dist/client/{StepIndicator-Dn_DY4oY.mjs → StepIndicator-B6o5B7g3.mjs} +1 -1
  73. package/dist/client/{StepIndicator-atfDU82W.mjs → StepIndicator-BTqO7cJl.mjs} +220 -19
  74. package/dist/client/{accessibleSurfaces-n6kS6Hct.mjs → accessibleSurfaces-BogaGutk.mjs} +966 -693
  75. package/dist/client/{accordion-CsW8U3ff.mjs → accordion-6cuswD_s.mjs} +1 -1
  76. package/dist/client/{booking-form.client-cBWM392H.mjs → booking-form.client-BOMe_SKi.mjs} +15 -15
  77. package/dist/client/{bookingForm-DgySpp6C.mjs → bookingForm-DSCH-VHo.mjs} +4 -4
  78. package/dist/client/bookings.mjs +5 -5
  79. package/dist/client/{boxStyleClassNames-BpGVdLFD.mjs → boxStyleClassNames-BFuqZCfz.mjs} +2 -2
  80. package/dist/client/{carousel-DJoleFV3.mjs → carousel-CGyQVV1M.mjs} +1 -1
  81. package/dist/client/{cart-EO5o6uPH.mjs → cart-BYOe7MCh.mjs} +3 -3
  82. package/dist/client/{cart.client-D_gPw45z.mjs → cart.client-BKFkaXdV.mjs} +1 -1
  83. package/dist/client/{checkout-NVfZW0kR.mjs → checkout-Dwd7Di77.mjs} +3 -3
  84. package/dist/client/{checkout.client-DD3JuqOy.mjs → checkout.client-C25hpi-z.mjs} +1 -1
  85. package/dist/client/{checkoutUrls-z2gXvlGw.mjs → checkoutUrls-tG788sw0.mjs} +1 -1
  86. package/dist/client/client.mjs +25 -6
  87. package/dist/client/{constants-CoOkvw__.mjs → constants-DdxFG3Ic.mjs} +1 -1
  88. package/dist/client/{context-CRhn9qzS.mjs → context-Hi1RuYEM.mjs} +23 -5
  89. package/dist/client/{dateFormatting-BnWB4L1s.mjs → dateFormatting-C8vBCHuo.mjs} +1 -1
  90. package/dist/client/{demoPortalMagicLink-CWDGSTBu.mjs → demoPortalMagicLink-BAL5UIDG.mjs} +1 -1
  91. package/dist/client/{enhanceHeaderSection-tdP_-Z9o.mjs → enhanceHeaderSection-Dv1Lr9kJ.mjs} +3 -3
  92. package/dist/client/{event-registration.client-D7YYKySQ.mjs → event-registration.client-dB_Z7bb-.mjs} +12 -12
  93. package/dist/client/{eventCalendar-CsAfu5d0.mjs → eventCalendar-CQnRA4Ww.mjs} +4 -4
  94. package/dist/client/{eventCombined-VXJB5CoS.mjs → eventCombined-BDOG1hVp.mjs} +4 -4
  95. package/dist/client/{eventListing-B3KIZNfY.mjs → eventListing-DSVmhy9n.mjs} +4 -4
  96. package/dist/client/{eventRegistration-BP-dEk1c.mjs → eventRegistration-CD5mRtEH.mjs} +4 -4
  97. package/dist/client/{form-DM8Zbxbv.mjs → form-DWnlEVSK.mjs} +3 -3
  98. package/dist/client/{form.client-e2z_Tlgk.mjs → form.client-D7zmeqNI.mjs} +4 -4
  99. package/dist/client/{form.parts-Ctljy1a3.mjs → form.parts-C-G6N_MK.mjs} +1 -1
  100. package/dist/client/gifting/client.mjs +7 -7
  101. package/dist/client/{gifting-DWIsqQru.mjs → gifting-Cn0jidP5.mjs} +4 -4
  102. package/dist/client/{gifting.client-QsSWF0uA.mjs → gifting.client-DVo1YFLs.mjs} +4 -4
  103. package/dist/client/{gifting.parts-CedLgwa_.mjs → gifting.parts-Bak93gD2.mjs} +2 -2
  104. package/dist/client/{headerSection-DAkRkwb-.mjs → headerSection-DjQuj_6v.mjs} +2 -2
  105. package/dist/client/{newsletter-form.client-WYja9-WN.mjs → newsletter-form.client-rIYPziZC.mjs} +5 -5
  106. package/dist/client/{newsletter-form.interactive-RuM86VAv.mjs → newsletter-form.interactive-DVt3enLr.mjs} +162 -135
  107. package/dist/client/{newsletter-form.parts-2petDnWv.mjs → newsletter-form.parts-CH6dGfdn.mjs} +1 -1
  108. package/dist/client/{newsletterForm-BUbXdA_e.mjs → newsletterForm-Cg8cBDHd.mjs} +3 -3
  109. package/dist/client/{noop-Dl4mZ-rr.mjs → noop-jesvJXEE.mjs} +239 -229
  110. package/dist/client/portal/client.mjs +269 -83
  111. package/dist/client/{portalOrders-COGn4BKG.mjs → portalOrders-oEoTvzkW.mjs} +1 -1
  112. package/dist/client/{portalRoutes-D72yvtDh.mjs → portalRoutes-ByyVZfVq.mjs} +13 -2
  113. package/dist/client/{product-detail.client-pOAryevt.mjs → product-detail.client-5aHq-vuu.mjs} +1 -1
  114. package/dist/client/{product-list.client-CcUpUiud.mjs → product-list.client-CyAk5rnC.mjs} +1 -1
  115. package/dist/client/{productDetail-BZJCfqat.mjs → productDetail-B8aZ2mqY.mjs} +3 -3
  116. package/dist/client/{productList-CiRs3mNb.mjs → productList-BuLemmod.mjs} +3 -3
  117. package/dist/client/{propsDecoder--uHW4tFM.mjs → propsDecoder-0Unsqn3R.mjs} +2 -2
  118. package/dist/client/{registry.server-CDNNd8wC.mjs → registry.server-DzvtVVD0.mjs} +352 -166
  119. package/dist/client/rendering/client.mjs +23 -23
  120. package/dist/client/rendering/islands.mjs +1 -1
  121. package/dist/client/rendering.mjs +5 -5
  122. package/dist/client/{richText-coerce-CQGE_wHV.mjs → richText-coerce-Bnng7JFA.mjs} +2 -2
  123. package/dist/client/{routeIslandApiConfig-BtCg87-N.mjs → routeIslandApiConfig-BGfcc9sk.mjs} +1 -1
  124. package/dist/client/{runtimeResponse-Ds9cmBUf.mjs → runtimeResponse-DAPVRToN.mjs} +1 -1
  125. package/dist/client/{runtimeResponse-DL_ARBpa.mjs → runtimeResponse-nXT8VAMl.mjs} +1 -1
  126. package/dist/client/{shop-Rx_gEMK8.mjs → shop-GuMqnDL-.mjs} +3 -3
  127. package/dist/client/{shop-commerce-D8evQnMT.mjs → shop-commerce-D5bDY1o1.mjs} +12 -12
  128. package/dist/client/{shop-commerce-store-C9PcsSTj.mjs → shop-commerce-store-B7sHnLwI.mjs} +1 -1
  129. package/dist/client/{shop-discount-apply.state-D5CtGfJI.mjs → shop-discount-apply.state-Dos2zdC2.mjs} +2 -2
  130. package/dist/client/{shop.client-D4lzQ9oY.mjs → shop.client-uvj5GDZb.mjs} +11 -11
  131. package/dist/client/{shopShared-BVbq7Nm-.mjs → shopShared-3giNWE3H.mjs} +2 -2
  132. package/dist/client/{src-ZSqRK3dD.mjs → src-CmXh3JWs.mjs} +5 -1
  133. package/dist/client/{timetableModel-BQJrSK0K.mjs → timetableModel-GA-hn1qM.mjs} +8 -15
  134. package/dist/client/{useAvailableSlots-Dm3lKJKR.mjs → useAvailableSlots-CBneCxbG.mjs} +2 -2
  135. package/dist/client/{useDiscountCodeUi-klgfGn7f.mjs → useDiscountCodeUi-D0kGF0C7.mjs} +1 -1
  136. package/dist/client/{useEventPagination-Jnjt7_ly.mjs → useEventPagination-xX8n_Tuu.mjs} +7 -7
  137. package/dist/client/{view-CC_yQLSA.mjs → view-DOyZc-DF.mjs} +3 -3
  138. package/dist/client/{wizardSteps-BliJOzEX.mjs → wizardSteps-B952ify5.mjs} +303 -31
  139. package/dist/preview-next/client/{PageSectionToolbar-BhL0uADo.mjs → PageSectionToolbar-BI3UCdpu.mjs} +3 -3
  140. package/dist/preview-next/client/{PreviewEditorSidebar-Ct8eIm0i.mjs → PreviewEditorSidebar-jkfLVOgY.mjs} +12 -9
  141. package/dist/preview-next/client/{PreviewEditorUI-BS32G4V9.mjs → PreviewEditorUI-DwJQs4hM.mjs} +4 -4
  142. package/dist/preview-next/client/{PreviewShell-RL0WfZXD.mjs → PreviewShell-BAxAkuz8.mjs} +5 -5
  143. package/dist/preview-next/client/{SdkPreviewModeRuntime-MK_gHeGy.mjs → SdkPreviewModeRuntime-0UVB-39f.mjs} +44 -17
  144. package/dist/preview-next/client/{previewAssistantSlot-CQyS8pcq.mjs → previewAssistantSlot-BgiYk3PB.mjs} +2577 -1683
  145. package/dist/preview-next/client/{previewChromeRoot-BSxp3Mfu.mjs → previewChromeRoot-tieNdF3E.mjs} +1 -1
  146. package/dist/preview-next/client/runtime.mjs +3 -3
  147. package/dist/preview-next/client/{sdk-runtime-DKnTzy74.mjs → sdk-runtime-DXb_Evl0.mjs} +2 -2
  148. package/dist/preview-next/client/{siteStyleAccess-BlmbvbLN.mjs → siteStyleAccess-BlN0jt2c.mjs} +1 -1
  149. package/dist/preview-next/client/{useAutosaveStatus-D-7GwZOQ.mjs → useAutosaveStatus-BUEPA4oL.mjs} +1 -1
  150. package/dist/preview-next/client/{useOpenBlockForSetup-BNZtGM5g.mjs → useOpenBlockForSetup-BVfr5P--.mjs} +1 -1
  151. package/dist/preview-next/keepAlive.mjs +1 -1
  152. package/dist/preview-next/middleware.mjs +1 -1
  153. package/dist/preview-next/{route-contract-R3PcMmax.mjs → route-contract-BHTBA48n.mjs} +20 -1
  154. package/dist/server/{Block.shared-CniF9tSu.mjs → Block.shared-hGoyEdjJ.mjs} +5 -5
  155. package/dist/server/{ThemeScopeCore-BQWsnGT6.mjs → ThemeScopeCore-BfUCTOwj.mjs} +37 -25
  156. package/dist/server/{accessibleSurfaces-WPzUAHp4.mjs → accessibleSurfaces-Dskni4Xj.mjs} +94 -361
  157. package/dist/server/{bindings-DxojjtK3.mjs → bindings-DMJH4bvo.mjs} +4 -4
  158. package/dist/server/{client-CDndhbYO.mjs → client-DrwlRNAH.mjs} +22 -3
  159. package/dist/server/config-validation.mjs +1 -1
  160. package/dist/server/config.mjs +2 -2
  161. package/dist/server/{constants-VyF5nEhL.mjs → constants-CeMywaiD.mjs} +11 -0
  162. package/dist/server/data/resolveBlockData.mjs +1 -1
  163. package/dist/server/{resolveButtonColourStates-B0O1IM16.mjs → expandPalette-ehuW8r2g.mjs} +769 -227
  164. package/dist/server/index.mjs +2 -2
  165. package/dist/server/{loadContent-BKstMBmX.mjs → loadContent-D0prFflT.mjs} +4 -4
  166. package/dist/server/{loadPage-IgNnZaqr.mjs → loadPage-CBLke9pJ.mjs} +3 -3
  167. package/dist/server/{lookMediaFrame-TFjgNG61.mjs → lookMediaFrame-H0fi4bJk.mjs} +2 -2
  168. package/dist/server/{navigation-quBYlSKD.mjs → navigation-wrcuWmgp.mjs} +1 -1
  169. package/dist/server/navigation.mjs +1 -1
  170. package/dist/server/next.mjs +8 -8
  171. package/dist/server/{overrideResolution-CCaAPpIa.mjs → overrideResolution-DUgCEH8z.mjs} +1 -1
  172. package/dist/server/page-converter.mjs +1 -1
  173. package/dist/server/{pageRenderPlan-B7iULvKe.mjs → pageRenderPlan-BHrmogsW.mjs} +161 -244
  174. package/dist/server/{pageRuntimeSupport-BytMroxn.mjs → pageRuntimeSupport-D2-YMRei.mjs} +1 -1
  175. package/dist/server/{pageShared-Dcs_XTIO.mjs → pageShared-CG8O31Eo.mjs} +1265 -1032
  176. package/dist/server/{parseThemeForPersistence-Bihl4W5K.mjs → parseThemeForPersistence-CrPlbJEN.mjs} +1 -1
  177. package/dist/server/{portal-CMW_b9mG.mjs → portal-pG_uhsI2.mjs} +1 -1
  178. package/dist/server/portal.mjs +2 -2
  179. package/dist/server/{prebuild-agaH-vZV.mjs → prebuild-C8Amvzce.mjs} +1 -1
  180. package/dist/server/prebuild.mjs +1 -1
  181. package/dist/server/{prefetchBlockData-DwpRjqw4.mjs → prefetchBlockData-BxUETRIZ.mjs} +2 -2
  182. package/dist/server/{registry-DM9dHfDC.mjs → registry-Cc88-23f.mjs} +1173 -745
  183. package/dist/server/rendering/components/pageShared.mjs +1 -1
  184. package/dist/server/rendering/helpers/loadPage.mjs +1 -1
  185. package/dist/server/rendering/helpers/pageRuntimeSupport.mjs +1 -1
  186. package/dist/server/rendering/server.mjs +4 -4
  187. package/dist/server/rendering.mjs +8 -8
  188. package/dist/server/{resolveBlockData-CinHGf8l.mjs → resolveBlockData-OG3KOkig.mjs} +1 -1
  189. package/dist/server/server.mjs +3 -3
  190. package/dist/server/{servicePageContent-BBBhOtdE.mjs → servicePageContent-BcFuhhD7.mjs} +5 -5
  191. package/dist/server/theme-bridge.mjs +33 -8
  192. package/dist/server/theme.mjs +1 -1
  193. package/dist/server/{validation-DG5jX3jH.mjs → validation-BovmbS8N.mjs} +3 -3
  194. package/dist/server/{version-CipbxPHL.mjs → version-hws4hgyX.mjs} +1 -1
  195. package/dist/styles/index.css +86 -46
  196. package/package.json +1 -1
@@ -1,117 +1,6 @@
1
- import { G as paletteColorsFromEntries, J as parseColorTokenParts, N as rgbColorValue, U as normalizePaletteHex, V as hexColorSchema, Y as parseThemeColorToken, b as completeSurfaceForegrounds, g as VARIANT_ROLES, n as STANDARD_BUTTON_SURFACE_POLICY, p as opaqueButtonColourTokenSchema, q as paletteModeSchema, u as buttonSystemSchema, z as PALETTE_TOKEN_NAMES } from "./types-BKaBZFjD.mjs";
2
- import { A as featuresFromHex, C as contrastRatio, D as relativeLuminance, E as preparePaletteColourIndex, F as oklchToOklab, I as rgbToHex, N as oklabToSrgb, O as solidPaint, S as assertContrastRatio, T as maxContrastBlackOrWhite, b as pickBlackOrWhiteTextColor, d as generateShadowValue, f as colourFamily, g as expandPalette, h as deriveSurfaceMutedColor, j as hexToRgb, k as worstContrast, l as ELEVATION_OFFSET, m as deriveSurfaceDecorationColors, n as compileButtonColourStates, o as BORDER_RADIUS_MAP, p as oklabDistance, s as BORDER_WIDTH_MAP, t as buttonStateBorder, u as FONT_SIZE_MAP, v as onColorTokenName, w as hexLuminance, x as ORDINARY_TEXT_MIN_CONTRAST_RATIO } from "./resolveButtonColourStates-B0O1IM16.mjs";
1
+ import { J as parseColorTokenParts, N as rgbColorValue, V as hexColorSchema, Y as parseThemeColorToken, b as completeSurfaceForegrounds, g as VARIANT_ROLES, n as STANDARD_BUTTON_SURFACE_POLICY, p as opaqueButtonColourTokenSchema, u as buttonSystemSchema } from "./types-BKaBZFjD.mjs";
2
+ import { A as onColorTokenName, B as preparePaletteColourIndex, C as paletteInk, D as paletteMutedInkOnSolid, E as paletteInkToken, G as oklabToSrgb, H as featuresFromHex, I as ORDINARY_TEXT_MIN_CONTRAST_RATIO, J as rgbToHex, L as contrastRatio, M as resolveOpaqueSurfaceHex, O as colourFamily, R as hexLuminance, T as paletteInkRoles, U as hexToRgb, V as solidPaint, _ as ELEVATION_OFFSET, a as compositeHex, b as pickBlackOrWhiteTextColor, h as BORDER_WIDTH_MAP, j as resolveConcreteColorHex, l as buttonStateBorder, m as BORDER_RADIUS_MAP, n as deriveSurfaceDecorationColors, q as oklchToOklab, r as expandPalette, u as compileButtonColourStates, v as FONT_SIZE_MAP, w as paletteInkOnSolid, x as inkFrom, y as generateShadowValue, z as luminanceInterval } from "./expandPalette-ehuW8r2g.mjs";
3
3
  import { z } from "zod";
4
- //#region ../theme-core/src/palette/colors.ts
5
- const PALETTE_VALUE_KEY_PREFIX = "palette-value:v1|";
6
- z.string().regex(/^[0-9a-f]{64}$/, "Palette hash must be a lowercase SHA-256 value").transform((value) => value);
7
- function requirePaletteColorsFromEntries(entries) {
8
- const result = paletteColorsFromEntries(entries);
9
- if (result.ok) return result.colors;
10
- throw new Error(`Invalid complete palette: ${result.error.kind}`);
11
- }
12
- function paletteColorFingerprint(colors) {
13
- return PALETTE_TOKEN_NAMES.map((name) => `${name}:${colors[name]}`).join("|");
14
- }
15
- function canonicalPaletteHashInput(colors, mode) {
16
- return `${mode}|${paletteColorFingerprint(colors)}`;
17
- }
18
- /**
19
- * Stable curated-catalogue identity. Do not reorder roles: the order comes
20
- * from PALETTE_TOKEN_NAMES through canonicalPaletteHashInput.
21
- */
22
- function paletteValueKey(colors, mode) {
23
- return `${PALETTE_VALUE_KEY_PREFIX}${canonicalPaletteHashInput(colors, mode)}`;
24
- }
25
- /** Parses only the exact v1 canonical form emitted by paletteValueKey. */
26
- function parsePaletteValueKey(value) {
27
- if (typeof value !== "string" || !value.startsWith(PALETTE_VALUE_KEY_PREFIX)) return null;
28
- const [rawMode, ...rawRoles] = value.slice(17).split("|");
29
- const mode = paletteModeSchema.safeParse(rawMode);
30
- if (!mode.success || rawRoles.length !== PALETTE_TOKEN_NAMES.length) return null;
31
- const colors = paletteColorsFromEntries(rawRoles.map((roleValue) => {
32
- const separator = roleValue.indexOf(":");
33
- return separator === -1 ? {
34
- name: "",
35
- hex: ""
36
- } : {
37
- name: roleValue.slice(0, separator),
38
- hex: roleValue.slice(separator + 1)
39
- };
40
- }));
41
- if (!colors.ok || paletteValueKey(colors.colors, mode.data) !== value) return null;
42
- return value;
43
- }
44
- const paletteValueKeySchema = z.string().transform((value, ctx) => {
45
- const parsed = parsePaletteValueKey(value);
46
- if (parsed) return parsed;
47
- ctx.addIssue({
48
- code: "custom",
49
- message: "Invalid canonical palette value key"
50
- });
51
- return z.NEVER;
52
- });
53
- //#endregion
54
- //#region ../theme-core/src/palette/utils/opaqueSurfaceColor.ts
55
- /** Resolve an opaque colour, compositing alpha against an explicit underlay. */
56
- function resolveOpaqueSurfaceHex(reference, palette, underlayReference) {
57
- const opaque = resolveConcreteColorHex(reference, palette);
58
- if (opaque) return opaque;
59
- if (!underlayReference) return null;
60
- const underlayHex = resolveConcreteColorHex(underlayReference, palette);
61
- if (!underlayHex) return null;
62
- const parts = parseColorTokenParts(reference);
63
- if (parts.kind === "token" && parts.opacityPercent !== null) {
64
- const foregroundHex = normalizePaletteHex(palette[parts.token] ?? "");
65
- return foregroundHex ? compositeHex$1(foregroundHex, underlayHex, parts.opacityPercent / 100) : null;
66
- }
67
- const rgba = parseRgba(parts.kind === "raw" ? parts.value : reference);
68
- return rgba ? compositeHex$1(rgbToHex(rgba.r, rgba.g, rgba.b), underlayHex, rgba.alpha) : null;
69
- }
70
- /** Resolve a colour reference only when it is already fully opaque. */
71
- function resolveConcreteColorHex(reference, palette) {
72
- const literalHex = normalizePaletteHex(reference);
73
- if (literalHex) return literalHex;
74
- const parts = parseColorTokenParts(reference);
75
- if (parts.kind === "token") {
76
- if (parts.opacityPercent !== null) return null;
77
- return normalizePaletteHex(palette[parts.token] ?? "");
78
- }
79
- const literal = parts.kind === "raw" ? parts.value : reference;
80
- if (literal.toLowerCase() === "black") return "#000000";
81
- if (literal.toLowerCase() === "white") return "#ffffff";
82
- return normalizePaletteHex(literal);
83
- }
84
- function compositeHex$1(foregroundHex, underlayHex, alpha) {
85
- const foreground = hexToRgb(foregroundHex);
86
- const underlay = hexToRgb(underlayHex);
87
- const channel = (foregroundValue, underlayValue) => Math.round(foregroundValue * alpha + underlayValue * (1 - alpha));
88
- return rgbToHex(channel(foreground.r, underlay.r), channel(foreground.g, underlay.g), channel(foreground.b, underlay.b));
89
- }
90
- function parseRgba(value) {
91
- const match = value.trim().match(/^rgba?\(\s*([\d.]+)(?:\s*,\s*|\s+)([\d.]+)(?:\s*,\s*|\s+)([\d.]+)(?:\s*(?:,|\/)\s*([\d.]+%?))?\s*\)$/i);
92
- if (!match) return null;
93
- const [, rSource, gSource, bSource] = match;
94
- if (!rSource || !gSource || !bSource) return null;
95
- const r = Number(rSource);
96
- const g = Number(gSource);
97
- const b = Number(bSource);
98
- const alpha = parseAlpha(match[4]);
99
- if (alpha === null || !isRgbChannel(r) || !isRgbChannel(g) || !isRgbChannel(b)) return null;
100
- return {
101
- r,
102
- g,
103
- b,
104
- alpha
105
- };
106
- }
107
- function parseAlpha(source) {
108
- if (!source) return 1;
109
- const value = source.endsWith("%") ? Number(source.slice(0, -1)) / 100 : Number(source);
110
- return Number.isFinite(value) && value >= 0 && value <= 1 ? value : null;
111
- }
112
- function isRgbChannel(value) {
113
- return Number.isFinite(value) && value >= 0 && value <= 255;
114
- }
115
4
  /**
116
5
  * Derive the hover foreground that belongs with a resolved resting foreground.
117
6
  *
@@ -185,7 +74,8 @@ const BUTTON_VISUAL_STATES = [
185
74
  /**
186
75
  * The ink certificate: every colour the site paints text or a mark on is held to
187
76
  * its threshold here, on every backdrop it shows. An ink that misses takes the
188
- * black/white ink that clears all of them; inks that pass are kept as they are,
77
+ * palette ink that clears all of them (the site's background or text colour,
78
+ * else black or white); inks that pass are kept as they are,
189
79
  * so a palette that already passes paints exactly what it declared. It never
190
80
  * throws, because owner palettes are arbitrary.
191
81
  *
@@ -224,10 +114,16 @@ function inkClearsBackdrops(ink, threshold, backdrops, measurement) {
224
114
  return hex !== null && contrastRatio(hex, backdrop, measurement.colourIndex) >= threshold;
225
115
  });
226
116
  }
227
- /** The black/white ink that clears every backdrop at ordinary-text contrast, preferring the best one for the painted end. */
117
+ /** The palette ink that clears every backdrop at ordinary-text contrast, or null when not even black or white does. */
228
118
  function fallbackInk(backdrops, measurement) {
229
- const [endpoint] = backdrops.slice(-1);
230
- return [...endpoint ? [pickBlackOrWhiteTextColor(endpoint)] : [], ...FALLBACK_INKS].find((candidate) => inkClearsBackdrops(candidate, contrastThresholdByPolicy["body-aa"], backdrops, measurement)) ?? null;
119
+ const ys = backdrops.map((backdrop) => hexLuminance(backdrop, measurement.colourIndex));
120
+ if (ys.length === 0) return null;
121
+ const ink = paletteInk(luminanceInterval(Math.min(...ys), Math.max(...ys)), paletteInkRoles(measurement.palette), contrastThresholdByPolicy["body-aa"]);
122
+ return ink.kind === "unpaintable" ? null : paletteInkToken(ink);
123
+ }
124
+ /** One solid backdrop: total, because black or white always clears it. */
125
+ function solidFallbackInk(backdrop, measurement) {
126
+ return paletteInkToken(paletteInkOnSolid(backdrop, paletteInkRoles(measurement.palette)));
231
127
  }
232
128
  function failingInks(inks, backdrops, measurement) {
233
129
  return {
@@ -267,9 +163,9 @@ function certifySolidSurfaceInks(inks, backdrop, measurement) {
267
163
  ...inks,
268
164
  fallback: []
269
165
  };
270
- return replaceFailing(inks, failing, pickBlackOrWhiteTextColor(backdrop));
166
+ return replaceFailing(inks, failing, solidFallbackInk(backdrop, measurement));
271
167
  }
272
- /** Kept when the ink clears the threshold, otherwise the black/white ink, which always clears a solid backdrop. */
168
+ /** Kept when the ink clears the threshold, otherwise the palette ink, which always clears a solid backdrop. */
273
169
  function certifyPaint(place, ink, threshold, backdrop, measurement) {
274
170
  return inkClearsBackdrops(ink, threshold, [backdrop], measurement) ? {
275
171
  place,
@@ -279,7 +175,7 @@ function certifyPaint(place, ink, threshold, backdrop, measurement) {
279
175
  fallback: false
280
176
  } : {
281
177
  place,
282
- ink: pickBlackOrWhiteTextColor(backdrop),
178
+ ink: solidFallbackInk(backdrop, measurement),
283
179
  backdrop,
284
180
  threshold,
285
181
  fallback: true,
@@ -287,91 +183,6 @@ function certifyPaint(place, ink, threshold, backdrop, measurement) {
287
183
  };
288
184
  }
289
185
  //#endregion
290
- //#region ../theme-core/src/palette/utils/inkSolver.ts
291
- /**
292
- * How far (OKLab ΔE) a brand colour drawn as ink may be nudged along its own
293
- * family before it stops reading as that colour. Past this the caller uses
294
- * neutral or palette text instead (Will, 2026-10-14).
295
- */
296
- const BRAND_INK_MAX_DELTA_E = .08;
297
- /**
298
- * The seed itself when it clears `paint`, otherwise the family member nearest
299
- * the seed (OKLab ΔE) that clears. On a light ground that is darker, on a dark
300
- * one lighter. A passing member further than `maxDistance` from the seed is
301
- * refused as `too-far`, which is distinct from `unpaintable`: the family runs
302
- * from black to white, so if no member clears, neither does black or white.
303
- */
304
- function inkFrom(family, paint, ratio, maxDistance = BRAND_INK_MAX_DELTA_E) {
305
- assertContrastRatio(ratio);
306
- if (!Number.isFinite(maxDistance) || maxDistance < 0) throw new RangeError(`Maximum ink distance must be finite and not negative: ${maxDistance}`);
307
- const seedRatio = worstContrast(family.seed.y, paint);
308
- if (seedRatio >= ratio) return {
309
- kind: "ink",
310
- hex: family.seed.hex,
311
- ratio: seedRatio,
312
- source: "exact"
313
- };
314
- const nearest = family.members.reduce((best, member) => {
315
- const achieved = worstContrast(member.y, paint);
316
- if (achieved < ratio) return best;
317
- const distance = oklabDistance(member.oklab, family.seed.oklab);
318
- return best === null || distance < best.distance ? {
319
- hex: member.hex,
320
- distance,
321
- ratio: achieved
322
- } : best;
323
- }, null);
324
- if (nearest === null) return {
325
- kind: "unpaintable",
326
- interval: paint,
327
- ratio
328
- };
329
- if (nearest.distance > maxDistance) return {
330
- kind: "too-far",
331
- nearest: {
332
- hex: nearest.hex,
333
- distance: nearest.distance
334
- },
335
- maxDistance
336
- };
337
- return {
338
- kind: "ink",
339
- hex: nearest.hex,
340
- ratio: nearest.ratio,
341
- source: "family"
342
- };
343
- }
344
- /**
345
- * Neutral text for a paint. The style's preferred neutral wins when one of its
346
- * pair clears (the higher-contrast one, dark on a tie); otherwise literal black
347
- * or white by `maxContrastBlackOrWhite`; otherwise `unpaintable`.
348
- */
349
- function neutralInk(paint, ratio, preferred) {
350
- assertContrastRatio(ratio);
351
- if (preferred) {
352
- const dark = worstContrast(hexLuminance(preferred.dark), paint);
353
- const light = worstContrast(hexLuminance(preferred.light), paint);
354
- const [hex, achieved] = dark >= light ? [preferred.dark, dark] : [preferred.light, light];
355
- if (achieved >= ratio) return {
356
- kind: "ink",
357
- hex,
358
- ratio: achieved,
359
- source: "neutral"
360
- };
361
- }
362
- const literal = maxContrastBlackOrWhite(paint);
363
- return literal.ratio >= ratio ? {
364
- kind: "ink",
365
- hex: literal.ink === "black" ? "#000000" : "#ffffff",
366
- ratio: literal.ratio,
367
- source: "neutral"
368
- } : {
369
- kind: "unpaintable",
370
- interval: paint,
371
- ratio
372
- };
373
- }
374
- //#endregion
375
186
  //#region ../theme-core/src/surfaces/surfaceInks.ts
376
187
  /** Lines and focus rings are graphics: WCAG non-text contrast. */
377
188
  const GRAPHIC_MIN_CONTRAST_RATIO = 3;
@@ -408,7 +219,7 @@ const INK_SEEDS = {
408
219
  */
409
220
  function solveSurfaceInks(backdropHex, textInk, palette, candidates = {}) {
410
221
  const paint = solidPaint(backdropHex);
411
- const fallback = literalInk(resolveConcreteColorHex(textInk, palette) ?? pickBlackOrWhiteTextColor(backdropHex));
222
+ const fallback = literalInk$1(resolveConcreteColorHex(textInk, palette) ?? pickBlackOrWhiteTextColor(backdropHex));
412
223
  return {
413
224
  brand: solveInk({
414
225
  ...INK_SEEDS.brand,
@@ -434,12 +245,12 @@ function solveInk(seed, paint, palette, fallback) {
434
245
  if (!token || !seedHex.success) return fallback;
435
246
  const solved = inkFrom(familyOf(seedHex.data), paint, seed.ratio, seed.maxDistance);
436
247
  switch (solved.kind) {
437
- case "ink": return solved.source === "exact" ? token : literalInk(solved.hex);
248
+ case "ink": return solved.source === "exact" ? token : literalInk$1(solved.hex);
438
249
  case "too-far":
439
250
  case "unpaintable": return fallback;
440
251
  }
441
252
  }
442
- function literalInk(hex) {
253
+ function literalInk$1(hex) {
443
254
  return hexColorSchema.parse(hex.toLowerCase());
444
255
  }
445
256
  const FAMILY_CACHE_LIMIT = 64;
@@ -454,14 +265,6 @@ function familyOf(seed) {
454
265
  }
455
266
  //#endregion
456
267
  //#region ../theme-core/src/surfaces/resolveSurfaceForeground.ts
457
- const FALLBACK_TEXT_TOKENS = [
458
- "text",
459
- "primaryForeground",
460
- "secondaryForeground",
461
- "accentForeground",
462
- "neutral-950",
463
- "neutral-50"
464
- ];
465
268
  const CANONICAL_EQUIVALENT_TOKEN_ORDER = [
466
269
  "text",
467
270
  "primaryForeground",
@@ -512,11 +315,7 @@ function resolveDeterministicForeground(backgroundReference, candidates, palette
512
315
  function resolveMeasuredForeground(backgroundReference, backgroundHex, candidates, palette) {
513
316
  const backgroundToken = paletteToken(backgroundReference);
514
317
  const derivedOnToken = backgroundToken ? onColorTokenName(backgroundToken) : null;
515
- const text = firstSafeToken([
516
- candidates.text,
517
- derivedOnToken,
518
- ...FALLBACK_TEXT_TOKENS
519
- ], backgroundHex, palette, derivedOnToken ? [derivedOnToken] : []) ?? pickBlackOrWhiteTextColor(backgroundHex);
318
+ const text = firstSafeToken([candidates.text, derivedOnToken], backgroundHex, palette, derivedOnToken ? [derivedOnToken] : []) ?? paletteTextInk(backgroundHex, palette);
520
319
  return certifiedForeground(knownForeground({
521
320
  text,
522
321
  heading: safeTokenOr(candidates.heading, text, backgroundHex, palette),
@@ -528,6 +327,10 @@ function resolveMeasuredForeground(backgroundReference, backgroundHex, candidate
528
327
  inks: solveSurfaceInks(backgroundHex, text, palette)
529
328
  }, candidates.linkHover, palette), palette);
530
329
  }
330
+ /** The automatic text when neither the authored ink nor the ground's on-colour reads: the palette's own pair, then black or white. */
331
+ function paletteTextInk(backgroundHex, palette) {
332
+ return paletteInkToken(paletteInkOnSolid(backgroundHex, paletteInkRoles(palette)));
333
+ }
531
334
  /**
532
335
  * Every measured foreground goes through the ink certificate, whoever paints it
533
336
  * (sections, cards, header, footer, accordions). The candidates above are chosen
@@ -550,13 +353,13 @@ function certifiedForeground(foreground, palette) {
550
353
  };
551
354
  }
552
355
  function resolveTrustedTreatmentForeground(candidates, palette) {
553
- const text = canonicalToken(candidates.text, palette);
356
+ const text = canonicalInk(candidates.text, palette);
554
357
  if (!text) return { kind: "unmeasured-paint" };
555
358
  return knownForeground({
556
359
  text,
557
- heading: canonicalToken(candidates.heading, palette) ?? text,
558
- link: canonicalToken(candidates.link, palette) ?? text,
559
- supporting: canonicalToken(candidates.supporting, palette) ?? text
360
+ heading: canonicalInk(candidates.heading, palette) ?? text,
361
+ link: canonicalInk(candidates.link, palette) ?? text,
362
+ supporting: canonicalInk(candidates.supporting, palette) ?? text
560
363
  }, { kind: "trusted-treatment" }, candidates.linkHover, palette);
561
364
  }
562
365
  function knownForeground(roles, provenance, hoverCandidate, palette) {
@@ -572,7 +375,7 @@ function knownForeground(roles, provenance, hoverCandidate, palette) {
572
375
  roles: {
573
376
  ...roles,
574
377
  linkHover: hover.token,
575
- muted: provenance.kind === "measured" ? deriveSurfaceMutedColor(provenance.backdropHex, resolveConcreteColorHex(roles.text, palette) ?? provenance.backdropHex) : roles.text
378
+ muted: provenance.kind === "measured" ? paletteMutedInkOnSolid(provenance.backdropHex, resolveConcreteColorHex(roles.text, palette), paletteInkRoles(palette)) : roles.text
576
379
  },
577
380
  hoverDecoration: hover.decoration
578
381
  };
@@ -615,6 +418,21 @@ function firstSafeToken(candidates, backgroundHex, palette, preferredEquivalentT
615
418
  }
616
419
  return null;
617
420
  }
421
+ /**
422
+ * A media treatment's ink as the resolved contract spells it. Nothing measures
423
+ * the paint, so literal black or white (the photo tint's fallback) stays that
424
+ * literal colour rather than borrowing whichever palette token shares its value
425
+ * today, or being dropped when none does. Any other reference is a palette token.
426
+ * Measured solids keep `firstSafeToken`, whose equivalent on-colour carries the
427
+ * ground's own hover softening.
428
+ */
429
+ function canonicalInk(reference, palette) {
430
+ return literalInk(reference) ?? canonicalToken(reference, palette);
431
+ }
432
+ function literalInk(reference) {
433
+ const normalized = normalizedReference(reference)?.toUpperCase();
434
+ return normalized === "#000000" || normalized === "#FFFFFF" ? normalized : null;
435
+ }
618
436
  function canonicalToken(reference, palette, preferredEquivalentTokens = []) {
619
437
  const normalized = normalizedReference(reference);
620
438
  if (!normalized || normalized === "transparent") return null;
@@ -1008,7 +826,7 @@ function paddingDeclarations(padding, borderWidth) {
1008
826
  }
1009
827
  //#endregion
1010
828
  //#region ../theme-core/src/buttons/buttonSurfaceContext.ts
1011
- /** The last resort, chosen by `maxContrastBlackOrWhite`. */
829
+ /** The last resort, when neither palette role reads (`paletteInkOnSolid`). */
1012
830
  const LITERAL_NEUTRALS = {
1013
831
  black: {
1014
832
  hex: "#000000",
@@ -1029,7 +847,7 @@ function deriveButtonSurfaceContext(input, palette, fallbackToken, colourIndex)
1029
847
  const background = deriveKnownBackground(input, palette, fallbackToken);
1030
848
  if (background.kind === "unknown") return background;
1031
849
  const explicitForeground = resolveKnownColour(input.kind === "solid" || input.kind === "inherit" ? input.foreground ?? "" : "", palette);
1032
- const foreground = explicitForeground && contrastRatio(background.colour.hex, explicitForeground.hex, colourIndex) >= 4.5 ? explicitForeground : LITERAL_NEUTRALS[maxContrastBlackOrWhite(solidPaint(background.colour.hex, colourIndex)).ink];
850
+ const foreground = explicitForeground && contrastRatio(background.colour.hex, explicitForeground.hex, colourIndex) >= 4.5 ? explicitForeground : automaticForeground(background.colour.hex, palette);
1033
851
  return {
1034
852
  kind: "known-solid",
1035
853
  source: background.source,
@@ -1334,6 +1152,16 @@ function boundaryForVariant(variant) {
1334
1152
  function findVariant(system, role) {
1335
1153
  return system.variants.find((variant) => variant.enabled && variant.id === role);
1336
1154
  }
1155
+ /** The surface's automatic text: the palette's own background or text where it reads, else black or white. */
1156
+ function automaticForeground(backgroundHex, palette) {
1157
+ const ink = paletteInkOnSolid(backgroundHex, paletteInkRoles(palette));
1158
+ if (ink.kind === "literal") return LITERAL_NEUTRALS[ink.hex === "#000000" ? "black" : "white"];
1159
+ return resolveKnownColour(ink.role, palette) ?? {
1160
+ hex: ink.hex,
1161
+ css: ink.hex,
1162
+ source: "literal-css"
1163
+ };
1164
+ }
1337
1165
  function resolveKnownColour(value, palette) {
1338
1166
  const reference = parseThemeColorReference(value, { palette });
1339
1167
  if (reference.kind !== "literal-css") {
@@ -1424,77 +1252,6 @@ function contextualBoundaryStyles(boundary) {
1424
1252
  };
1425
1253
  }
1426
1254
  //#endregion
1427
- //#region ../theme-core/src/palette/utils/scrimContrast.ts
1428
- const WHITE = "#ffffff";
1429
- const BLACK = "#000000";
1430
- /** `top` at `alpha` over opaque `bottom`, blended as CSS paints an overlay. */
1431
- function compositeHex(topHex, alpha, bottomHex) {
1432
- const top = hexToRgb(topHex);
1433
- const bottom = hexToRgb(bottomHex);
1434
- const mix = (a, b) => Math.round(alpha * a + (1 - alpha) * b);
1435
- return rgbToHex(mix(top.r, bottom.r), mix(top.g, bottom.g), mix(top.b, bottom.b));
1436
- }
1437
- /**
1438
- * The lowest contrast `foreground` can reach over `scrim` at `alpha` laid on
1439
- * any pixel. A foreground whose luminance falls inside the range the
1440
- * composites can take has a worst case of 1:1.
1441
- */
1442
- function worstCaseScrimContrast(input) {
1443
- const overWhite = compositeHex(input.scrimHex, input.alpha, WHITE);
1444
- const overBlack = compositeHex(input.scrimHex, input.alpha, BLACK);
1445
- const luminance = (hex) => {
1446
- const { r, g, b } = hexToRgb(hex);
1447
- return relativeLuminance(r, g, b);
1448
- };
1449
- const foreground = luminance(input.foregroundHex);
1450
- const low = luminance(overBlack);
1451
- const high = luminance(overWhite);
1452
- if (foreground >= low && foreground <= high) return 1;
1453
- return Math.min(contrastRatio(input.foregroundHex, overWhite), contrastRatio(input.foregroundHex, overBlack));
1454
- }
1455
- /**
1456
- * The smallest scrim opacity, in hundredths, at which every foreground keeps
1457
- * `threshold` contrast over any pixel. `null` when even an opaque scrim fails,
1458
- * which means the foreground was never legible on the scrim colour itself.
1459
- */
1460
- function minimumScrimOpacity(input) {
1461
- const passes = (alpha) => input.foregroundHexes.every((foregroundHex) => worstCaseScrimContrast({
1462
- foregroundHex,
1463
- scrimHex: input.scrimHex,
1464
- alpha
1465
- }) >= input.threshold);
1466
- return Array.from({ length: 101 }, (_, hundredths) => hundredths / 100).find(passes) ?? null;
1467
- }
1468
- /** Shared samples for literal RGB washes and palette-token gradient veils. */
1469
- function gradientScrimSamples(gradient, alpha, palette) {
1470
- const literal = [...gradient.matchAll(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([\d.]+))?\s*\)/g)].map((stop) => ({
1471
- hex: rgbToHex(Number(stop[1]), Number(stop[2]), Number(stop[3])),
1472
- alpha: alpha * (stop[4] === void 0 ? 1 : Number(stop[4]))
1473
- }));
1474
- const tokens = [...gradient.matchAll(/var\(--tb-([\w-]+)\)/g)].flatMap((stop) => {
1475
- const hex = stop[1] ? resolveConcreteColorHex(stop[1], palette) : null;
1476
- return hex ? [{
1477
- hex,
1478
- alpha
1479
- }] : [];
1480
- });
1481
- return [...literal, ...tokens];
1482
- }
1483
- /** The ink with the stronger worst-pixel guarantee identifies the veil tone.
1484
- * No readable samples (or a tie) leaves classification to the foreground owner.
1485
- */
1486
- function scrimTone(samples) {
1487
- if (samples.length === 0) return null;
1488
- const worst = (foregroundHex) => Math.min(...samples.map((sample) => worstCaseScrimContrast({
1489
- foregroundHex,
1490
- scrimHex: sample.hex,
1491
- alpha: sample.alpha
1492
- })));
1493
- const white = worst(WHITE);
1494
- const black = worst(BLACK);
1495
- return white === black ? null : white > black ? "dark" : "light";
1496
- }
1497
- //#endregion
1498
1255
  //#region ../theme-core/src/site-styles/surfaceTransportMarker.ts
1499
1256
  /**
1500
1257
  * The envelope key `serializeSurfaceTree` writes and `parseSurfaceTree` reads.
@@ -1510,24 +1267,12 @@ const ON_BACKGROUND = { kind: "on-background" };
1510
1267
  const surfaceRecipes = {
1511
1268
  base: {
1512
1269
  backgroundCandidates: ["background", "surface"],
1513
- headingCandidates: [
1514
- "text",
1515
- ON_BACKGROUND,
1516
- "neutral-950",
1517
- "neutral-50"
1518
- ],
1519
- textCandidates: [
1520
- "text",
1521
- ON_BACKGROUND,
1522
- "neutral-950",
1523
- "neutral-50"
1524
- ],
1270
+ headingCandidates: ["text", ON_BACKGROUND],
1271
+ textCandidates: ["text", ON_BACKGROUND],
1525
1272
  linkCandidates: [
1526
1273
  "primary",
1527
1274
  "text",
1528
- ON_BACKGROUND,
1529
- "neutral-950",
1530
- "neutral-50"
1275
+ ON_BACKGROUND
1531
1276
  ],
1532
1277
  supportingCandidates: ["mutedText"],
1533
1278
  inheritedBackground: true
@@ -1539,24 +1284,12 @@ const surfaceRecipes = {
1539
1284
  "surface",
1540
1285
  "background"
1541
1286
  ],
1542
- headingCandidates: [
1543
- ON_BACKGROUND,
1544
- "text",
1545
- "neutral-950",
1546
- "neutral-50"
1547
- ],
1548
- textCandidates: [
1549
- ON_BACKGROUND,
1550
- "text",
1551
- "neutral-950",
1552
- "neutral-50"
1553
- ],
1287
+ headingCandidates: [ON_BACKGROUND, "text"],
1288
+ textCandidates: [ON_BACKGROUND, "text"],
1554
1289
  linkCandidates: [
1555
1290
  "primary",
1556
1291
  ON_BACKGROUND,
1557
- "text",
1558
- "neutral-950",
1559
- "neutral-50"
1292
+ "text"
1560
1293
  ],
1561
1294
  supportingCandidates: [
1562
1295
  "mutedText",
@@ -1575,25 +1308,19 @@ const surfaceRecipes = {
1575
1308
  ON_BACKGROUND,
1576
1309
  "primaryForeground",
1577
1310
  "background",
1578
- "surface",
1579
- "neutral-50",
1580
- "neutral-950"
1311
+ "surface"
1581
1312
  ],
1582
1313
  textCandidates: [
1583
1314
  ON_BACKGROUND,
1584
1315
  "primaryForeground",
1585
1316
  "background",
1586
- "surface",
1587
- "neutral-50",
1588
- "neutral-950"
1317
+ "surface"
1589
1318
  ],
1590
1319
  linkCandidates: [
1591
1320
  ON_BACKGROUND,
1592
1321
  "primaryForeground",
1593
1322
  "background",
1594
- "surface",
1595
- "neutral-50",
1596
- "neutral-950"
1323
+ "surface"
1597
1324
  ],
1598
1325
  supportingCandidates: [
1599
1326
  ON_BACKGROUND,
@@ -1614,25 +1341,19 @@ const surfaceRecipes = {
1614
1341
  ON_BACKGROUND,
1615
1342
  "primaryForeground",
1616
1343
  "background",
1617
- "surface",
1618
- "neutral-50",
1619
- "neutral-950"
1344
+ "surface"
1620
1345
  ],
1621
1346
  textCandidates: [
1622
1347
  ON_BACKGROUND,
1623
1348
  "primaryForeground",
1624
1349
  "background",
1625
- "surface",
1626
- "neutral-50",
1627
- "neutral-950"
1350
+ "surface"
1628
1351
  ],
1629
1352
  linkCandidates: [
1630
1353
  ON_BACKGROUND,
1631
1354
  "primaryForeground",
1632
1355
  "background",
1633
- "surface",
1634
- "neutral-50",
1635
- "neutral-950"
1356
+ "surface"
1636
1357
  ],
1637
1358
  supportingCandidates: [
1638
1359
  ON_BACKGROUND,
@@ -1657,7 +1378,11 @@ function toAccessibleColorSurfaceIntent(surface) {
1657
1378
  default: return assertNeverSurface(surface);
1658
1379
  }
1659
1380
  }
1660
- /** Keep every successful legacy recipe; only exhausted candidates need neutral ink. */
1381
+ /**
1382
+ * Keep every successful recipe. When no ground has a passing ink, the first
1383
+ * ground present takes the palette's own ink there (the shared owner), which
1384
+ * always reaches ordinary-text contrast on a solid.
1385
+ */
1661
1386
  function resolveAccessibleSurfaceRecipe(input) {
1662
1387
  const result = tryAccessibleSurfaceRecipe(input);
1663
1388
  if (result.kind === "resolved-accessible-surface") return result;
@@ -1665,13 +1390,13 @@ function resolveAccessibleSurfaceRecipe(input) {
1665
1390
  const token = recipe.backgroundCandidates.find((candidate) => resolveConcreteColorHex(candidate, input.palette) !== null);
1666
1391
  const hex = token ? resolveConcreteColorHex(token, input.palette) : null;
1667
1392
  if (!token || !hex) return result;
1668
- const ink = pickBlackOrWhiteTextColor(hex);
1393
+ const ink = paletteInkOnSolid(hex, paletteInkRoles(input.palette));
1669
1394
  const foreground = (role) => ({
1670
1395
  kind: "safe-token",
1671
1396
  role,
1672
- token: asAccessibleSurfaceToken(ink),
1673
- hex: ink,
1674
- contrastRatio: contrastRatio(ink, hex)
1397
+ token: asAccessibleSurfaceToken(paletteInkToken(ink)),
1398
+ hex: ink.hex,
1399
+ contrastRatio: ink.ratio
1675
1400
  });
1676
1401
  return {
1677
1402
  kind: "resolved-accessible-surface",
@@ -1770,16 +1495,24 @@ function tryAccessibleSurfaceRecipe(input) {
1770
1495
  rejectedCandidates
1771
1496
  };
1772
1497
  }
1498
+ /**
1499
+ * The recipe's explicit candidates first; when none reads, the palette's own
1500
+ * ink on this ground at the recipe's threshold (the shared owner, which tries
1501
+ * the palette's text and background before black or white). Null only when
1502
+ * even black or white misses the threshold, so the recipe tries its next ground.
1503
+ */
1773
1504
  function resolveRequiredForeground(input) {
1774
- return resolveSafeToken({
1505
+ const explicit = resolveSafeToken(input);
1506
+ if (explicit) return explicit;
1507
+ const ink = paletteInk(solidPaint(input.backgroundHex), paletteInkRoles(input.palette), input.threshold);
1508
+ if (ink.kind === "unpaintable") return null;
1509
+ return {
1510
+ kind: "safe-token",
1775
1511
  role: input.role,
1776
- candidates: input.candidates,
1777
- backgroundToken: input.backgroundToken,
1778
- backgroundHex: input.backgroundHex,
1779
- palette: input.palette,
1780
- threshold: input.threshold,
1781
- rejectedCandidates: input.rejectedCandidates
1782
- });
1512
+ token: asAccessibleSurfaceToken(paletteInkToken(ink)),
1513
+ hex: ink.hex,
1514
+ contrastRatio: ink.ratio
1515
+ };
1783
1516
  }
1784
1517
  function resolveSupportingForeground(input) {
1785
1518
  const resolved = resolveSafeToken({
@@ -2637,4 +2370,4 @@ function mapSurfaceTreeChildren(value, map) {
2637
2370
  return isSurfaceTreeRecord(value) ? Object.fromEntries(Object.entries(value).map(([key, item]) => [key, map(item)])) : value;
2638
2371
  }
2639
2372
  //#endregion
2640
- export { resolveOnColorForThemeToken as A, neutralInk as B, materializeRuntimeButtonAppearance as C, mapButtonRoleAppearances as D, defineButtonStyleRecipe as E, resolveSurfaceForeground as F, planForegroundHover as G, certifyPaint as H, safeTokenOr as I, paletteValueKey as J, resolveConcreteColorHex as K, surfaceInkPublication as L, resolveTokenOrCssColorValue as M, freezeOwnedThemeValue as N, mapButtonVisualAppearances as O, ownedThemeSnapshot as P, CONTROL_EDGE_SEED_TOKEN as R, buttonTypographyDeclarations as S, PUBLIC_BUTTON_ROLES as T, contrastThresholdByPolicy as U, HOVER_TEXT_THRESHOLD as V, inkReference as W, requirePaletteColorsFromEntries as X, paletteValueKeySchema as Y, contextualButtonSurfaceResetStyles as _, requireResolvedSurface as a, buttonShadow as b, surfaceButtonRequest as c, toAccessibleColorSurfaceIntent as d, compositeHex as f, actionVariableFallback as g, scrimTone as h, prepareThemeSurfaceRevision as i, resolveThemeColorReferenceValue as j, isCssColorLiteral as k, surfaceDecorationColors as l, minimumScrimOpacity as m, parseSurfaceTree as n, resolveSurface as o, gradientScrimSamples as p, resolveOpaqueSurfaceHex as q, prepareSurfaceIndex as r, serializeSurfaceTree as s, parseResolvedSurface as t, surfaceTransportContext as u, buttonBorder as v, paddingDeclarations as w, buttonStateAppearanceDeclarations as x, buttonRadius as y, solveSurfaceInks as z };
2373
+ export { ownedThemeSnapshot as A, planForegroundHover as B, mapButtonRoleAppearances as C, resolveThemeColorReferenceValue as D, resolveOnColorForThemeToken as E, solveSurfaceInks as F, HOVER_TEXT_THRESHOLD as I, certifyPaint as L, safeTokenOr as M, surfaceInkPublication as N, resolveTokenOrCssColorValue as O, CONTROL_EDGE_SEED_TOKEN as P, contrastThresholdByPolicy as R, defineButtonStyleRecipe as S, isCssColorLiteral as T, buttonStateAppearanceDeclarations as _, requireResolvedSurface as a, paddingDeclarations as b, surfaceButtonRequest as c, toAccessibleColorSurfaceIntent as d, actionVariableFallback as f, buttonShadow as g, buttonRadius as h, prepareThemeSurfaceRevision as i, resolveSurfaceForeground as j, freezeOwnedThemeValue as k, surfaceDecorationColors as l, buttonBorder as m, parseSurfaceTree as n, resolveSurface as o, contextualButtonSurfaceResetStyles as p, prepareSurfaceIndex as r, serializeSurfaceTree as s, parseResolvedSurface as t, surfaceTransportContext as u, buttonTypographyDeclarations as v, mapButtonVisualAppearances as w, PUBLIC_BUTTON_ROLES as x, materializeRuntimeButtonAppearance as y, inkReference as z };