@riverbankcms/sdk 0.160.0 → 0.162.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_dts/{BlocksIslandsHydrator-CoqeotCL.d.ts → BlocksIslandsHydrator-PZUoA872.d.ts} +1 -1
- package/dist/_dts/{Page-C0ENVLCF.d.ts → Page-CdQS6C7i.d.ts} +211 -9
- package/dist/_dts/{SdkPreviewMode-jZK0A49V.d.ts → SdkPreviewMode-CNGO-5f1.d.ts} +59 -92
- package/dist/_dts/{auth-contract-FPg0-2MC.d.ts → auth-contract-CgJ5nMaH.d.ts} +2 -0
- package/dist/_dts/{client-uMMuPq9V.d.ts → client-DGa53rjL.d.ts} +11 -3
- package/dist/_dts/{content-types-D6nXGqdQ.d.ts → content-types-K9R7P-KF.d.ts} +2 -2
- package/dist/_dts/{contracts-Bnmj1nxu.d.ts → contracts-CyBaPaIq.d.ts} +17 -5
- package/dist/_dts/{footerPageOutline-CeLjFX8b.d.ts → footerPageOutline-B6jmKmon.d.ts} +6 -6
- package/dist/_dts/{generatePageMetadata-nyU8q02J.d.ts → generatePageMetadata-iemoR3AN.d.ts} +2 -2
- package/dist/_dts/{index-BaaGBY1v.d.ts → index-8CN0Nd-Z.d.ts} +2 -2
- package/dist/_dts/{index-nVoi_74l.d.ts → index-BtnsA14K.d.ts} +10 -20
- package/dist/_dts/{index-lkpjIg5i.d.ts → index-C39F9KaB.d.ts} +13 -2
- package/dist/_dts/{index-C5xslEBn.d.ts → index-DEu85xBt.d.ts} +1 -1
- package/dist/_dts/{schema-D0bNcPWK.d.ts → index-DI2yaSPY.d.ts} +22873 -19918
- package/dist/_dts/{types-D8czmbQF.d.ts → index-Dbd0Sn0G.d.ts} +4356 -1827
- package/dist/_dts/{index-CEaKil7G.d.ts → index-Du1IRglc.d.ts} +2 -2
- package/dist/_dts/{index-DahMwisK.d.ts → index-Jlcq6w69.d.ts} +3 -3
- package/dist/_dts/{index-Bg64CkV-.d.ts → index-Wm62sXf2.d.ts} +4 -4
- package/dist/_dts/{loadContent-CYLmzvLq.d.ts → loadContent-BPfAAZDW.d.ts} +13 -10
- package/dist/_dts/{resolvePageContent-DqnxChOs.d.ts → resolvePageContent-DWbrtKf8.d.ts} +2 -2
- package/dist/_dts/sdk/src/bookings/index.d.ts +2 -2
- package/dist/_dts/sdk/src/client/types.d.ts +2 -2
- package/dist/_dts/sdk/src/client.d.ts +7 -7
- package/dist/_dts/sdk/src/config/index.d.ts +6 -6
- package/dist/_dts/sdk/src/config/template-validation.d.ts +1 -1
- package/dist/_dts/sdk/src/config/validation.d.ts +1 -1
- package/dist/_dts/sdk/src/index.d.ts +8 -8
- package/dist/_dts/sdk/src/manifest/index.d.ts +3 -3
- package/dist/_dts/sdk/src/metadata/index.d.ts +1 -1
- package/dist/_dts/sdk/src/navigation/index.d.ts +2 -2
- package/dist/_dts/sdk/src/next/index.d.ts +7 -7
- package/dist/_dts/sdk/src/next/middleware.d.ts +2 -2
- package/dist/_dts/sdk/src/page-converter/index.d.ts +3 -3
- package/dist/_dts/sdk/src/portal/client.d.ts +1 -1
- package/dist/_dts/sdk/src/prebuild/index.d.ts +1 -1
- package/dist/_dts/sdk/src/preview-next/before-render.d.ts +2 -2
- package/dist/_dts/sdk/src/preview-next/client/index.d.ts +2 -2
- package/dist/_dts/sdk/src/preview-next/client/runtime.d.ts +1 -1
- package/dist/_dts/sdk/src/preview-next/keep-alive.d.ts +1 -1
- package/dist/_dts/sdk/src/preview-next/session.d.ts +2 -2
- package/dist/_dts/sdk/src/rendering/client.d.ts +2 -2
- package/dist/_dts/sdk/src/rendering/index.d.ts +6 -6
- package/dist/_dts/sdk/src/rendering/islands/client.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/server.d.ts +2 -2
- package/dist/_dts/sdk/src/routing/index.d.ts +5 -5
- package/dist/_dts/sdk/src/server.d.ts +5 -5
- package/dist/_dts/sdk/src/theme/index.d.ts +1 -1
- package/dist/_dts/{session-Ba2CsnK5.d.ts → session-C_gtSFyZ.d.ts} +2 -1
- package/dist/_dts/{types-DSgmJ15W.d.ts → types-CVv2H4AT.d.ts} +7 -7
- package/dist/_dts/{types-CFrYuXYP.d.ts → types-CfNG5koF.d.ts} +4 -2
- package/dist/_dts/{types-Dm-KW7nj.d.ts → types-ClZ-BQL_.d.ts} +3 -3
- package/dist/_dts/{validation-Bmb4WnHg.d.ts → validation-BJ6Lf_Dr.d.ts} +4 -4
- package/dist/client/{BlocksIslandsHydrator-DZRKi6tT.mjs → BlocksIslandsHydrator-COqlgWYU.mjs} +23 -21
- package/dist/client/{BookingMailingListNote-C00sLLdL.mjs → BookingMailingListNote-CFYPDEHH.mjs} +1 -1
- package/dist/client/{CalendarNavigationChevron-CHSi9b3E.mjs → CalendarNavigationChevron-COBVxgHb.mjs} +6 -6
- package/dist/client/{CheckboxChoice-Bhm6RAUL.mjs → CheckboxChoice-C7X9dJ8A.mjs} +1 -1
- package/dist/client/{DemoBookingPortalAccess-CaN-7ui7.mjs → DemoBookingPortalAccess-CvT0E9AR.mjs} +26 -10
- package/dist/client/{DemoPortalSignInLink-ClxN5_xZ.mjs → DemoPortalSignInLink-EBOBN5dT.mjs} +1 -1
- package/dist/client/{EventCalendar.client-BncvSa1n.mjs → EventCalendar.client-U6pKcntV.mjs} +16 -17
- package/dist/client/{EventCombined.client-DluBxVVu.mjs → EventCombined.client-CNzwEHws.mjs} +8 -8
- package/dist/client/{EventEmbeddedCheckoutStep-BiJrMtfp.mjs → EventEmbeddedCheckoutStep-B9yAWV_k.mjs} +1 -1
- package/dist/client/{EventItem-CXhnT9pF.mjs → EventItem-M5rpaHxi.mjs} +4 -4
- package/dist/client/{EventListWeekNavigation-V-dtoDlD.mjs → EventListWeekNavigation-D4ieBLDY.mjs} +1 -1
- package/dist/client/{EventListing.client-DPO6SZbx.mjs → EventListing.client-B8F40Rmn.mjs} +3 -3
- package/dist/client/{EventListing.view-B-Yi5JZS.mjs → EventListing.view-k4lhuCn5.mjs} +15 -6
- package/dist/client/{EventRegistrationPayment-Dc3Fnlnw.mjs → EventRegistrationPayment-C3g8_Hqb.mjs} +25 -13
- package/dist/client/LocationMapActions-CAjt7qVo.mjs +62 -0
- package/dist/client/MapDrawingSvg-_aIK2ojv.mjs +200 -0
- package/dist/client/{Page-7PkzO04N.mjs → Page-DJBIQBOw.mjs} +2555 -536
- package/dist/client/{StepIndicator-DiD6euZ8.mjs → StepIndicator-CFacB1z6.mjs} +2 -2
- package/dist/client/{TabBarFragment-BHd8GN8y.mjs → TabBarFragment-BLsfQskO.mjs} +1 -1
- package/dist/client/ThemedButton-BWsDgjMC.mjs +2243 -0
- package/dist/client/{accordion-2m27DsIk.mjs → accordion-CtO2XF7M.mjs} +1 -1
- package/dist/client/{booking-form.client-BddWV5w1.mjs → booking-form.client-RICCQ0h2.mjs} +137 -60
- package/dist/client/{bookingForm-bcdXQjmw.mjs → bookingForm-SvjLPx8i.mjs} +4 -4
- package/dist/client/bookings.mjs +5 -5
- package/dist/client/{carousel-D7nj9I0y.mjs → carousel-BR-zCD3O.mjs} +2 -2
- package/dist/client/{carousel.client-AffDJo_s.mjs → carousel.client-CEWtoZd3.mjs} +1 -1
- package/dist/client/{cart-PN6yCw1H.mjs → cart-C6YpKbZZ.mjs} +3 -3
- package/dist/client/{cart.client-D4t1f0cJ.mjs → cart.client-dC938WrX.mjs} +1 -1
- package/dist/client/{checkout-CsTwXVSb.mjs → checkout-Dy9RlREI.mjs} +3 -3
- package/dist/client/{checkout.client-BhQE3zY7.mjs → checkout.client-CefG0d2F.mjs} +1 -1
- package/dist/client/client.mjs +37 -71
- package/dist/client/{context-BLAvalAa.mjs → context-BFwxgZpB.mjs} +28 -1
- package/dist/client/{cta-CUXhX_D7.mjs → cta-DtA42Xio.mjs} +1 -1
- package/dist/client/{dateFormatting-BHIHxNuo.mjs → dateFormatting-yP1B7F0O.mjs} +39 -2
- package/dist/client/{demoPortalMagicLink-R-awbk_0.mjs → demoPortalMagicLink-WOiT5Ryi.mjs} +1 -1
- package/dist/client/{enhanceHeaderSection-9Q93uvTo.mjs → enhanceHeaderSection-Dh8c_Lq-.mjs} +3 -3
- package/dist/client/{event-details.client-BS1WtG-a.mjs → event-details.client-BFgsLqTj.mjs} +3 -17
- package/dist/client/{event-registration.client-BXndwsET.mjs → event-registration.client-BaXZ1-Ky.mjs} +16 -16
- package/dist/client/{eventCalendar-HyoOt1Qz.mjs → eventCalendar-COLwF80U.mjs} +4 -4
- package/dist/client/{eventCombined-sdG5oEaH.mjs → eventCombined-D3Ltwu03.mjs} +4 -4
- package/dist/client/{eventDetails-FFAknE4w.mjs → eventDetails-CBrkimXu.mjs} +2 -2
- package/dist/client/{eventListing-CGK6urk3.mjs → eventListing-CedKVA1S.mjs} +4 -4
- package/dist/client/{eventRegistration-VhrvCs4l.mjs → eventRegistration-DkQQfR1b.mjs} +4 -4
- package/dist/client/{form-C-B5O_ko.mjs → form-XFy9uXSJ.mjs} +3 -3
- package/dist/client/{form.client-DoZVcl8d.mjs → form.client-B0iancFK.mjs} +4 -4
- package/dist/client/{form.parts-mttKpgif.mjs → form.parts-DMbolu9Y.mjs} +3 -3
- package/dist/client/{formatDate-xUSCknEO.mjs → formatDate-Jm5MQOCA.mjs} +1 -1
- package/dist/client/gifting/client.mjs +3 -3
- package/dist/client/{headerSection-BHUEXsaI.mjs → headerSection-WjlECjtV.mjs} +2 -2
- package/dist/client/{mediaAssets-BOj-Co0B.mjs → mediaAssets-BkoW_PEn.mjs} +1 -1
- package/dist/client/{mediaContext-DThoeEBU.mjs → mediaContext-CNzWmoA4.mjs} +1 -1
- package/dist/client/{newsletter-form.client-D_n0rftg.mjs → newsletter-form.client-D-XwJTjN.mjs} +5 -5
- package/dist/client/{newsletter-form.parts-DKHye4IE.mjs → newsletter-form.parts-H92f30y0.mjs} +2 -2
- package/dist/client/{newsletterForm-tEaYelzx.mjs → newsletterForm-DMuxzu6I.mjs} +3 -3
- package/dist/client/{noop-B610YKEx.mjs → noop-B3RNPVrt.mjs} +313 -3
- package/dist/client/portal/client.mjs +1116 -85
- package/dist/client/{product-detail.client-DUf5x5Jt.mjs → product-detail.client-B3HuuykE.mjs} +1 -1
- package/dist/client/{product-list.client-Cqp1BPTV.mjs → product-list.client-CzsDrHQO.mjs} +1 -1
- package/dist/client/{productDetail-B8bBiogP.mjs → productDetail-CbBUVWgd.mjs} +3 -3
- package/dist/client/{productList-BKN4D-1z.mjs → productList-vqOKH2mh.mjs} +3 -3
- package/dist/client/{propsDecoder-2nNZh2Oe.mjs → propsDecoder-CkSUep5a.mjs} +4 -28
- package/dist/client/{registry.server-BAm4RPNJ.mjs → registry.server-cZ24QwtW.mjs} +607 -210
- package/dist/client/rendering/client.mjs +28 -28
- package/dist/client/rendering/islands.mjs +1 -1
- package/dist/client/rendering.mjs +18 -9
- package/dist/client/{richText-coerce-Cv-qomNB.mjs → richText-coerce-DDcCKvBJ.mjs} +1 -1
- package/dist/client/{routeIslandApiConfig-C5u8MbAA.mjs → routeIslandApiConfig-DYBioANh.mjs} +1 -1
- package/dist/client/{ThemedButton-C22C9cCF.mjs → schema-DNHLlze-.mjs} +7307 -8363
- package/dist/client/{shop-DZNC0VKk.mjs → shop-CF0dhnfH.mjs} +3 -3
- package/dist/client/{shop-commerce-DdX4LSa3.mjs → shop-commerce-DQznNBEo.mjs} +11 -11
- package/dist/client/{shop-commerce-store-BJtrZov9.mjs → shop-commerce-store-Ba8zPlIg.mjs} +1 -1
- package/dist/client/{shop.client-DmDd-igg.mjs → shop.client-DqfYoqWH.mjs} +12 -12
- package/dist/client/{shop.interactive-5SnnDHz3.mjs → shop.interactive-CreQ0I7i.mjs} +38 -183
- package/dist/client/{shopShared-CPqUlAh9.mjs → shopShared-D-yh-P7g.mjs} +2 -2
- package/dist/client/site-styles-B9HgmY07.mjs +11619 -0
- package/dist/client/{timetableModel-C19rcHEw.mjs → timetableModel-DCdVErTJ.mjs} +149 -8
- package/dist/client/{useAvailableSlots-BjbJXotk.mjs → useAvailableSlots-Cvgdp2DH.mjs} +8 -11
- package/dist/client/{useBookingNowIso-CMgfL7YJ.mjs → useBookingNowIso-DrTnGNzD.mjs} +1 -1
- package/dist/client/{useDiscountApply-KG8jB7WC.mjs → useDiscountApply-CULjnXGl.mjs} +2 -2
- package/dist/client/{useDiscountCodeUi-DK2w_i0a.mjs → useDiscountCodeUi-Gn_m7e0o.mjs} +1 -1
- package/dist/client/{useEventPagination-DW6MCirb.mjs → useEventPagination-CsysCF22.mjs} +8 -21
- package/dist/client/{view-CseyBW07.mjs → view-BpBjo9Te.mjs} +71 -59
- package/dist/client/{view-CkUn3Y0Y.mjs → view-DMyTchi7.mjs} +4 -4
- package/dist/client/wizardSteps-BO2OmMO9.mjs +6604 -0
- package/dist/preview-next/before-render.mjs +7 -6
- package/dist/preview-next/chrome.css +2 -0
- package/dist/preview-next/client/{EventEmbeddedCheckoutStep-lUHBrzHv.mjs → EventEmbeddedCheckoutStep-DLsSmZbO.mjs} +2 -1
- package/dist/preview-next/client/LocationPickerEnvironment-QtSG2Bl-.mjs +138 -0
- package/dist/preview-next/client/MapLibreEditMap-B-rohNcG.mjs +488 -0
- package/dist/preview-next/client/{PreviewEditorSidebar-DWyUGCAG.mjs → PreviewEditorSidebar-ChrW9VEo.mjs} +269 -1100
- package/dist/preview-next/client/{PreviewEditorUI-Wq0b3Daw.mjs → PreviewEditorUI-VaHvYtrA.mjs} +10 -190
- package/dist/preview-next/client/{SdkPreviewModeRuntime-BtZPcwYV.mjs → SdkPreviewModeRuntime-Bz7jR6nl.mjs} +1 -1
- package/dist/preview-next/client/{SdkPreviewModeRuntime-wSI_R361.mjs → SdkPreviewModeRuntime-DWwktlWs.mjs} +639 -536
- package/dist/preview-next/client/{ThemedButton-DzeycIlD.mjs → ThemedButton-CHKOWXxl.mjs} +1706 -692
- package/dist/preview-next/client/lucide-react-CA9cpo0P.mjs +51984 -0
- package/dist/preview-next/client/maplibre-gl-DykfOYYn.mjs +34208 -0
- package/dist/preview-next/client/{SiteChromeCustomizeContext-Hc4pYnNe.mjs → previewAuthStore-C0VUwEHz.mjs} +81363 -136296
- package/dist/preview-next/client/{previewChromeSurface-Corq4AG7.mjs → previewChromeSurface-Dhyx2YrS.mjs} +1 -1
- package/dist/preview-next/client/result-BjJUoxUF.mjs +16 -0
- package/dist/preview-next/client/rolldown-runtime-CE6sIgz8.mjs +34 -0
- package/dist/preview-next/client/runtime.mjs +3 -3
- package/dist/preview-next/client/{sdk-runtime-CWymRWhK.mjs → sdk-runtime-C2GWOCyj.mjs} +1 -1
- package/dist/preview-next/client/siteStyleAccess-DHyzUpv4.mjs +12833 -0
- package/dist/preview-next/client/{spinner-C4If5Y-O.mjs → spinner-BeR2S8oG.mjs} +2 -1
- package/dist/preview-next/{constants-D8Ya7bO4.mjs → constants-Bf-vqdKH.mjs} +2 -1
- package/dist/preview-next/editor-base.css +2 -2
- package/dist/preview-next/keepAlive.mjs +3 -3
- package/dist/preview-next/middleware.mjs +7 -3
- package/dist/preview-next/{refresh-contract-CvmNqZ1Q.mjs → refresh-contract-uQ6BXgLJ.mjs} +5 -0
- package/dist/preview-next/{route-contract-8csADeIT.mjs → route-contract-CkrFDMrl.mjs} +434 -203
- package/dist/preview-next/{session-BgkrPqu0.mjs → session-P1R_ajT7.mjs} +12 -2
- package/dist/preview-next/session.mjs +1 -1
- package/dist/server/{Block.shared-D1_gonwM.mjs → Block.shared-DxvNGDig.mjs} +4 -4
- package/dist/server/{bindings-CFmJg5lm.mjs → bindings-BuhKvYkE.mjs} +2 -1
- package/dist/server/{client-DPsi0Dai.mjs → client-BobW6DOz.mjs} +39 -72
- package/dist/server/config-validation.mjs +1 -1
- package/dist/server/config.mjs +2 -2
- package/dist/server/{siteChromeOverlayClearance-DALIAMwo.mjs → effectiveNavLinkStyle-B-MKSt0p.mjs} +2060 -1680
- package/dist/server/index.mjs +3 -3
- package/dist/server/{loadContent-RMCcuVU_.mjs → loadContent-CCG_3mbY.mjs} +14 -5
- package/dist/server/loadPage-Bk9HDh9K.mjs +2 -0
- package/dist/server/{loadPage-DhDGzj7t.mjs → loadPage-jntGoMrf.mjs} +3 -2
- package/dist/server/next.mjs +9 -9
- package/dist/server/{overrideResolution-OxY5FMuy.mjs → overrideResolution-BBOlgn4Z.mjs} +1 -1
- package/dist/server/{overrides-Bz_A6sB9.mjs → overrides-DByQwIyW.mjs} +803 -412
- package/dist/server/page-converter.mjs +1 -1
- package/dist/server/{prebuild-B_1vrSru.mjs → prebuild-DrwcTk2t.mjs} +1 -1
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/{prefetchBlockData-B7ukYXXR.mjs → prefetchBlockData-LfgxSJYE.mjs} +156 -89
- package/dist/server/{publicProducts-Djbpc81A.mjs → publicProducts-8A3T5v4M.mjs} +685 -166
- package/dist/server/{registry-eFjKtEhF.mjs → registry-Digv02oV.mjs} +780 -1052
- package/dist/server/rendering/server.mjs +4 -4
- package/dist/server/rendering.mjs +8 -8
- package/dist/server/{resolveBlockData-DYvEa9c5.mjs → resolveBlockData-C23t8-77.mjs} +1 -1
- package/dist/server/routing.mjs +1 -1
- package/dist/server/{schema-C3dJ5UkL.mjs → schema-BiqpDRwB.mjs} +4805 -3561
- package/dist/server/server.mjs +3 -3
- package/dist/server/site-styles-DrkprQPL.mjs +755 -0
- package/dist/server/siteChromeOverlayClearance-BmKKkkbh.mjs +750 -0
- package/dist/server/{src-C5Mu-z0F.mjs → src-08GY1njw.mjs} +1060 -44
- package/dist/server/theme-bridge.mjs +1 -1
- package/dist/server/theme.mjs +1 -1
- package/dist/server/{themeAdmission-ruoyXb_0.mjs → themeAdmission-CSd_Vusz.mjs} +151 -53
- package/dist/server/{validation-B-Xar8QS.mjs → validation-DdUTkBOZ.mjs} +2 -2
- package/dist/server/{version-Bg7VHK3i.mjs → version-DdIOqIDe.mjs} +1 -1
- package/dist/styles/index.css +1029 -41
- package/package.json +1 -1
- package/dist/_dts/index-Blwl7yl6.d.ts +0 -13
- package/dist/client/LeafletStaticMap-ClZCCzAm.mjs +0 -135
- package/dist/client/location-map.client-Cylb_MHw.mjs +0 -28
- package/dist/client/location-map.view-Cx4Bl7ij.mjs +0 -345
- package/dist/client/locationMap-QnKJi-nZ.mjs +0 -15
- package/dist/client/renderableMediaAssetAdmission-DGjBr_e-.mjs +0 -152
- package/dist/client/wizardSteps-zgq10lN1.mjs +0 -17181
- package/dist/preview-next/client/siteStyleAccess-QZkJRHl5.mjs +0 -1359
- package/dist/server/loadPage-DUPP51C-.mjs +0 -2
- package/dist/server/media-CcHwZkdJ.mjs +0 -243
|
@@ -1,53 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { n as ok, t as err } from "./result-BjJUoxUF.mjs";
|
|
2
3
|
import "react";
|
|
3
4
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
4
5
|
import { z } from "zod";
|
|
5
|
-
//#region \0rolldown/runtime.js
|
|
6
|
-
var __create = Object.create;
|
|
7
|
-
var __defProp = Object.defineProperty;
|
|
8
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
9
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
10
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
11
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
12
|
-
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
|
|
13
|
-
var __exportAll = (all, no_symbols) => {
|
|
14
|
-
let target = {};
|
|
15
|
-
for (var name in all) __defProp(target, name, {
|
|
16
|
-
get: all[name],
|
|
17
|
-
enumerable: true
|
|
18
|
-
});
|
|
19
|
-
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
20
|
-
return target;
|
|
21
|
-
};
|
|
22
|
-
var __copyProps = (to, from, except, desc) => {
|
|
23
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
24
|
-
key = keys[i];
|
|
25
|
-
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
26
|
-
get: ((k) => from[k]).bind(null, key),
|
|
27
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
return to;
|
|
31
|
-
};
|
|
32
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
33
|
-
value: mod,
|
|
34
|
-
enumerable: true
|
|
35
|
-
}) : target, mod));
|
|
36
|
-
//#endregion
|
|
37
|
-
//#region ../core/src/result.ts
|
|
38
|
-
function ok(value) {
|
|
39
|
-
return {
|
|
40
|
-
ok: true,
|
|
41
|
-
value
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
function err(error) {
|
|
45
|
-
return {
|
|
46
|
-
ok: false,
|
|
47
|
-
error
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
//#endregion
|
|
51
6
|
//#region ../core/src/branded.ts
|
|
52
7
|
const UUID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
53
8
|
function parseUuidBrand(value, unsafeConstructor) {
|
|
@@ -66,6 +21,7 @@ const unsafeAsApiKeyId = (id) => id;
|
|
|
66
21
|
const unsafeAsPageId = (id) => id;
|
|
67
22
|
const unsafeAsPageSurfaceId = (id) => id;
|
|
68
23
|
const unsafeAsEditorClientId = (id) => id;
|
|
24
|
+
const unsafeAsEditorSessionGeneration = (id) => id;
|
|
69
25
|
const unsafeAsEventOfferingId = (id) => id;
|
|
70
26
|
const unsafeAsEventSeriesId = (id) => id;
|
|
71
27
|
const unsafeAsMediaAssetId = (id) => id;
|
|
@@ -87,6 +43,7 @@ const parseApiKeyId = (value) => parseUuidBrand(value, unsafeAsApiKeyId);
|
|
|
87
43
|
const parsePageId = (value) => parseUuidBrand(value, unsafeAsPageId);
|
|
88
44
|
const parsePageSurfaceId = (value) => parseUuidBrand(value, unsafeAsPageSurfaceId);
|
|
89
45
|
const parseEditorClientId = (value) => parseUuidBrand(value, unsafeAsEditorClientId);
|
|
46
|
+
const parseEditorSessionGeneration = (value) => parseUuidBrand(value, unsafeAsEditorSessionGeneration);
|
|
90
47
|
const parseEventOfferingId = (value) => parseUuidBrand(value, unsafeAsEventOfferingId);
|
|
91
48
|
const parseUserId = (value) => parseUuidBrand(value, unsafeAsUserId);
|
|
92
49
|
const parseMediaAssetId = (value) => parseUuidBrand(value, unsafeAsMediaAssetId);
|
|
@@ -776,66 +733,92 @@ const checkoutCopy = {
|
|
|
776
733
|
//#region ../commerce/src/purchase/event-registration-errors.ts
|
|
777
734
|
const eventRegistrationErrors = {
|
|
778
735
|
registrationClosed: {
|
|
736
|
+
endsCommand: false,
|
|
779
737
|
message: "Booking is currently closed for this event. Please contact the organiser if you’d like to find out more.",
|
|
780
738
|
action: "none"
|
|
781
739
|
},
|
|
782
740
|
paymentInvestigationRequired: {
|
|
741
|
+
endsCommand: false,
|
|
783
742
|
message: "We still can’t confirm your payment. Please don’t make another payment. Contact the organiser so they can check your booking.",
|
|
784
743
|
action: "none"
|
|
785
744
|
},
|
|
786
745
|
paymentProviderUnavailable: {
|
|
746
|
+
endsCommand: false,
|
|
787
747
|
message: "We couldn’t reach the payment provider. Please try again in a minute.",
|
|
788
748
|
action: "retry"
|
|
789
749
|
},
|
|
790
750
|
paymentHostUnavailable: {
|
|
751
|
+
endsCommand: false,
|
|
791
752
|
message: "Card payments aren’t available on this web address yet. Please contact the organiser to book.",
|
|
792
753
|
action: "none"
|
|
793
754
|
},
|
|
794
755
|
paymentPageUnavailable: {
|
|
756
|
+
endsCommand: false,
|
|
795
757
|
message: "We couldn’t open the payment page. Please refresh this page and try again. If this keeps happening, contact the organiser for help.",
|
|
796
758
|
action: "retry"
|
|
797
759
|
},
|
|
798
760
|
paymentUnavailable: {
|
|
761
|
+
endsCommand: false,
|
|
799
762
|
message: "Online payment is not available for this event right now. Please contact the organiser for help with booking.",
|
|
800
763
|
action: "none"
|
|
801
764
|
},
|
|
802
765
|
capacityChanged: {
|
|
766
|
+
endsCommand: false,
|
|
803
767
|
message: "Sorry, there aren’t enough places left for your selection. Please check the available places and choose again.",
|
|
804
768
|
action: "places"
|
|
805
769
|
},
|
|
806
770
|
selectionChanged: {
|
|
771
|
+
endsCommand: false,
|
|
807
772
|
message: "The booking options for this event have changed. Please check the latest options and choose your places again.",
|
|
808
773
|
action: "places"
|
|
809
774
|
},
|
|
775
|
+
paymentSetupFailed: {
|
|
776
|
+
endsCommand: true,
|
|
777
|
+
message: "We couldn't set up payment for this booking, so your place hasn't been reserved and you haven't been charged. Please try again in a few minutes, or contact the organiser if it keeps happening.",
|
|
778
|
+
action: "retry"
|
|
779
|
+
},
|
|
780
|
+
registrationAttemptEnded: {
|
|
781
|
+
endsCommand: true,
|
|
782
|
+
message: "That booking attempt has ended, so we couldn't finish it. You haven't been charged. Please start your booking again.",
|
|
783
|
+
action: "start"
|
|
784
|
+
},
|
|
810
785
|
registrationPreparationChanged: {
|
|
786
|
+
endsCommand: true,
|
|
811
787
|
message: "The booking options for this event have changed. Please check the latest options and choose your places again.",
|
|
812
788
|
action: "places"
|
|
813
789
|
},
|
|
814
790
|
registrationAlreadyExists: {
|
|
791
|
+
endsCommand: false,
|
|
815
792
|
message: "You already have a booking for this event. Please check your bookings to see its status. If you need help, contact the organiser.",
|
|
816
793
|
action: "portal"
|
|
817
794
|
},
|
|
818
795
|
holdExpired: {
|
|
796
|
+
endsCommand: false,
|
|
819
797
|
message: "Your reservation has timed out. Please check availability and choose your places again.",
|
|
820
798
|
action: "start"
|
|
821
799
|
},
|
|
822
800
|
waitlistUnavailable: {
|
|
801
|
+
endsCommand: false,
|
|
823
802
|
message: "Sorry, the waiting list place offered in this invitation is no longer available. Please check the event for available places or contact the organiser for help.",
|
|
824
803
|
action: "event"
|
|
825
804
|
},
|
|
826
805
|
paymentContextMismatch: {
|
|
806
|
+
endsCommand: false,
|
|
827
807
|
message: "The payment options for this event have changed. Please check the latest options before continuing.",
|
|
828
808
|
action: "payment-options"
|
|
829
809
|
},
|
|
830
810
|
verificationFailed: {
|
|
811
|
+
endsCommand: false,
|
|
831
812
|
message: "We couldn’t confirm this request came from a person. Please refresh the page and try again.",
|
|
832
813
|
action: "none"
|
|
833
814
|
},
|
|
834
815
|
idempotencyConflict: {
|
|
816
|
+
endsCommand: false,
|
|
835
817
|
message: "You’ve already started booking this event. Please finish in the other tab if it’s still open, or check your booking status before starting again.",
|
|
836
818
|
action: "portal"
|
|
837
819
|
},
|
|
838
820
|
invalidCommitInput: {
|
|
821
|
+
endsCommand: false,
|
|
839
822
|
message: "We couldn’t accept your booking details. Please check the information you entered and try again. If this keeps happening, contact the organiser for help.",
|
|
840
823
|
action: "details"
|
|
841
824
|
}
|
|
@@ -843,6 +826,11 @@ const eventRegistrationErrors = {
|
|
|
843
826
|
function parseEventRegistrationErrorReason(value) {
|
|
844
827
|
return typeof value === "string" && Object.prototype.hasOwnProperty.call(eventRegistrationErrors, value) ? value : null;
|
|
845
828
|
}
|
|
829
|
+
/** Only a server-confirmed refusal ends an identity; transport uncertainty retains it. */
|
|
830
|
+
function eventRegistrationErrorEndsCommand(value) {
|
|
831
|
+
const reason = parseEventRegistrationErrorReason(value);
|
|
832
|
+
return reason !== null && eventRegistrationErrors[reason].endsCommand;
|
|
833
|
+
}
|
|
846
834
|
//#endregion
|
|
847
835
|
//#region ../commerce/src/purchase/checkoutPresentation.ts
|
|
848
836
|
function publishableKeyMode(publishableKey) {
|
|
@@ -1266,6 +1254,14 @@ const buttonEffectApplicationSchema = z.discriminatedUnion("effectId", [
|
|
|
1266
1254
|
colourRole: z.literal("mark").optional()
|
|
1267
1255
|
}).optional()
|
|
1268
1256
|
}),
|
|
1257
|
+
z.strictObject({
|
|
1258
|
+
effectId: z.literal("inner-dashed-outline"),
|
|
1259
|
+
options: z.strictObject({
|
|
1260
|
+
colourRole: z.enum(["ink", "mark"]),
|
|
1261
|
+
width: z.number().finite().min(.5).max(4),
|
|
1262
|
+
inset: z.number().finite().min(0).max(16)
|
|
1263
|
+
})
|
|
1264
|
+
}),
|
|
1269
1265
|
z.strictObject({
|
|
1270
1266
|
effectId: z.literal("sketchy-border"),
|
|
1271
1267
|
options: z.strictObject({ intensity: buttonShadowIntensitySchema.optional() }).optional()
|
|
@@ -1596,10 +1592,11 @@ function getSiteFontsStorageUrl(supabaseUrl) {
|
|
|
1596
1592
|
/**
|
|
1597
1593
|
* Build a lightweight Google Fonts stylesheet URL for a family-name preview.
|
|
1598
1594
|
* The text subset keeps catalog rows cheap while still rendering the name in
|
|
1599
|
-
* the typeface being chosen.
|
|
1595
|
+
* the typeface being chosen. Pass `text` when the preview draws something
|
|
1596
|
+
* other than the name (a sample heading, "Aa"); its letters are deduplicated.
|
|
1600
1597
|
*/
|
|
1601
|
-
function buildFontPreviewUrl(family) {
|
|
1602
|
-
return `https://fonts.googleapis.com/css2?family=${encodeURIComponent(family).replace(/%20/gu, "+")}&display=swap&text=${encodeURIComponent(family)}`;
|
|
1598
|
+
function buildFontPreviewUrl(family, text = family) {
|
|
1599
|
+
return `https://fonts.googleapis.com/css2?family=${encodeURIComponent(family).replace(/%20/gu, "+")}&display=swap&text=${encodeURIComponent(text === family ? family : [...new Set(text)].join(""))}`;
|
|
1603
1600
|
}
|
|
1604
1601
|
/**
|
|
1605
1602
|
* Escape a string for use in CSS font-family declaration
|
|
@@ -1676,6 +1673,16 @@ const curatedFontWidths = {
|
|
|
1676
1673
|
function getFontWidthRange(family) {
|
|
1677
1674
|
return curatedFontWidths[(family.split(",")[0] ?? "").trim().replace(/^["']|["']$/g, "")];
|
|
1678
1675
|
}
|
|
1676
|
+
/** CSS2 axis tuples are sorted normal-first, then real italic weights. */
|
|
1677
|
+
function buildGoogleFontFamilyQuery(family, weights, italics = [], widthRange) {
|
|
1678
|
+
const name = encodeURIComponent(family.replace(/\s+/g, "+")).replace(/%2B/g, "+");
|
|
1679
|
+
const normal = [...new Set(weights)].sort((a, b) => a - b);
|
|
1680
|
+
const width = widthRange ? `${widthRange.min}..${widthRange.max},` : "";
|
|
1681
|
+
const axes = widthRange ? "wdth,wght" : "wght";
|
|
1682
|
+
if (italics.length === 0) return `family=${name}:${axes}@${normal.map((weight) => `${width}${weight}`).join(";")}`;
|
|
1683
|
+
const italic = [...new Set(italics)].sort((a, b) => a - b);
|
|
1684
|
+
return `family=${name}:ital,${axes}@${[...normal.map((weight) => `0,${width}${weight}`), ...italic.map((weight) => `1,${width}${weight}`)].join(";")}`;
|
|
1685
|
+
}
|
|
1679
1686
|
//#endregion
|
|
1680
1687
|
//#region ../theme-core/src/typography/schema.ts
|
|
1681
1688
|
const typographyStyleSchema = z.object({
|
|
@@ -1877,6 +1884,14 @@ const typographySchema = z.object({
|
|
|
1877
1884
|
});
|
|
1878
1885
|
//#endregion
|
|
1879
1886
|
//#region ../theme-core/src/site-styles/types.ts
|
|
1887
|
+
const arrangementModes = [
|
|
1888
|
+
"list",
|
|
1889
|
+
"calendar",
|
|
1890
|
+
"week"
|
|
1891
|
+
];
|
|
1892
|
+
function isArrangementMode(value) {
|
|
1893
|
+
return value === "list" || value === "calendar" || value === "week";
|
|
1894
|
+
}
|
|
1880
1895
|
/**
|
|
1881
1896
|
* Defines a literal-preserving catalog while rejecting top-level extra keys on
|
|
1882
1897
|
* each entry: `defineExactCatalog<Entry>()([{ ... }])`.
|
|
@@ -1890,9 +1905,6 @@ function asDesignBlockId(value) {
|
|
|
1890
1905
|
function asDesignPageId(value) {
|
|
1891
1906
|
return brandNonEmptyString(value, "DesignPageId");
|
|
1892
1907
|
}
|
|
1893
|
-
function asDesignEntryId(value) {
|
|
1894
|
-
return brandNonEmptyString(value, "DesignEntryId");
|
|
1895
|
-
}
|
|
1896
1908
|
function asBlockContentVersionId(value) {
|
|
1897
1909
|
return brandNonEmptyString(value, "BlockContentVersionId");
|
|
1898
1910
|
}
|
|
@@ -2524,7 +2536,7 @@ const cardSpacingAxesSchema = z.object({
|
|
|
2524
2536
|
/**
|
|
2525
2537
|
* A card's content padding: one value for both axes, or one per axis. Two
|
|
2526
2538
|
* fields would let a variant say both and leave the reader to guess, so this is
|
|
2527
|
-
* a union
|
|
2539
|
+
* a union.
|
|
2528
2540
|
*/
|
|
2529
2541
|
const cardSpacingValueSchema = z.union([cardSpacingSchema, cardSpacingAxesSchema]);
|
|
2530
2542
|
const gradientDirectionSchema = z.enum([
|
|
@@ -2552,23 +2564,6 @@ function normalizeCardRole(value) {
|
|
|
2552
2564
|
if (value === "open") return openCardRoleValue;
|
|
2553
2565
|
return normalizeCardVariantRole(value);
|
|
2554
2566
|
}
|
|
2555
|
-
const PRIORITY_ROLE_INFERENCE = {
|
|
2556
|
-
1: "default",
|
|
2557
|
-
2: "alternative"
|
|
2558
|
-
};
|
|
2559
|
-
/**
|
|
2560
|
-
* Role inference for legacy card systems authored before variants carried a
|
|
2561
|
-
* `role`. Priority 1 is the everyday card, priority 2 the statement card —
|
|
2562
|
-
* which is how variants are surfaced today. `open` is never inferred: a site
|
|
2563
|
-
* style has to opt into it.
|
|
2564
|
-
*/
|
|
2565
|
-
function inferCardVariantRoleFromPriority(priority) {
|
|
2566
|
-
return PRIORITY_ROLE_INFERENCE[priority] ?? null;
|
|
2567
|
-
}
|
|
2568
|
-
/** The role a variant implements, explicit or inferred. */
|
|
2569
|
-
function cardVariantRole(variant) {
|
|
2570
|
-
return variant.role ?? inferCardVariantRoleFromPriority(variant.priority);
|
|
2571
|
-
}
|
|
2572
2567
|
const cardBackgroundSchema = z.discriminatedUnion("type", [
|
|
2573
2568
|
z.object({
|
|
2574
2569
|
type: z.literal("solid"),
|
|
@@ -2600,21 +2595,6 @@ const cardEdgeSchema = z.enum([
|
|
|
2600
2595
|
"right",
|
|
2601
2596
|
"bottom"
|
|
2602
2597
|
]);
|
|
2603
|
-
/**
|
|
2604
|
-
* Legacy single accented card edge (e.g. a left accent bar). Persisted and
|
|
2605
|
-
* curated data may still carry it; it lifts into a one-element `decorations`
|
|
2606
|
-
* list at the parse boundary and has no representation after that.
|
|
2607
|
-
*/
|
|
2608
|
-
const cardAccentEdgeSchema = z.object({
|
|
2609
|
-
edge: cardEdgeSchema,
|
|
2610
|
-
colorToken: themeColorTokenSchema,
|
|
2611
|
-
width: z.enum([
|
|
2612
|
-
"thin",
|
|
2613
|
-
"medium",
|
|
2614
|
-
"thick",
|
|
2615
|
-
"heavy"
|
|
2616
|
-
])
|
|
2617
|
-
});
|
|
2618
2598
|
/** `hairline` (1px) is the widening the boxless `open` role needs. */
|
|
2619
2599
|
const cardEdgeRuleWidthSchema = z.enum([
|
|
2620
2600
|
"hairline",
|
|
@@ -2651,7 +2631,7 @@ const cardCornerRadiiSchema = z.object({
|
|
|
2651
2631
|
bottomLeft: cardCornerValueSchema.optional(),
|
|
2652
2632
|
bottomRight: cardCornerValueSchema.optional()
|
|
2653
2633
|
});
|
|
2654
|
-
const
|
|
2634
|
+
const cardVariantSchema = z.strictObject({
|
|
2655
2635
|
id: z.string(),
|
|
2656
2636
|
name: z.string().min(1).max(20),
|
|
2657
2637
|
enabled: z.boolean(),
|
|
@@ -2660,10 +2640,9 @@ const cardVariantInputSchema = z.object({
|
|
|
2660
2640
|
z.literal(2),
|
|
2661
2641
|
z.literal(3)
|
|
2662
2642
|
]),
|
|
2663
|
-
role: surfaceCardRoleSchema
|
|
2643
|
+
role: surfaceCardRoleSchema,
|
|
2664
2644
|
background: cardBackgroundSchema,
|
|
2665
2645
|
spacing: cardSpacingValueSchema,
|
|
2666
|
-
spacingAxes: cardSpacingAxesSchema.optional(),
|
|
2667
2646
|
foregroundToken: themeColorTokenSchema.optional(),
|
|
2668
2647
|
shadow: z.object({
|
|
2669
2648
|
elevation: z.enum([
|
|
@@ -2687,75 +2666,16 @@ const cardVariantInputSchema = z.object({
|
|
|
2687
2666
|
]).optional(),
|
|
2688
2667
|
cornerRadii: cardCornerRadiiSchema.optional(),
|
|
2689
2668
|
border: cardBorderSchema.optional(),
|
|
2690
|
-
decorations: cardDecorationsSchema.optional()
|
|
2691
|
-
accentEdge: cardAccentEdgeSchema.optional()
|
|
2669
|
+
decorations: cardDecorationsSchema.optional()
|
|
2692
2670
|
});
|
|
2693
2671
|
/**
|
|
2694
|
-
*
|
|
2695
|
-
* `border: 0` implicitly whenever an accent edge was present; conversion drops
|
|
2696
|
-
* the border instead, so the output is unchanged and the data says so.
|
|
2697
|
-
*/
|
|
2698
|
-
function normalizeLegacyAccentEdge(variant) {
|
|
2699
|
-
const { accentEdge, ...rest } = normalizeLegacySpacingAxes(variant);
|
|
2700
|
-
if (!accentEdge) return rest;
|
|
2701
|
-
const { border: _droppedByAccentEdgeReset, ...withoutBorder } = rest;
|
|
2702
|
-
return {
|
|
2703
|
-
...withoutBorder,
|
|
2704
|
-
decorations: [{
|
|
2705
|
-
...accentEdge,
|
|
2706
|
-
length: "full"
|
|
2707
|
-
}]
|
|
2708
|
-
};
|
|
2709
|
-
}
|
|
2710
|
-
/**
|
|
2711
|
-
* Lift a legacy `spacingAxes` into `spacing`. It always won over the flat value
|
|
2712
|
-
* when both were set, so the lift preserves the emitted padding exactly.
|
|
2713
|
-
*/
|
|
2714
|
-
function normalizeLegacySpacingAxes(variant) {
|
|
2715
|
-
const { spacingAxes, ...rest } = variant;
|
|
2716
|
-
return spacingAxes ? {
|
|
2717
|
-
...rest,
|
|
2718
|
-
spacing: spacingAxes
|
|
2719
|
-
} : variant;
|
|
2720
|
-
}
|
|
2721
|
-
function validateSingleDecorationSource(variant, ctx) {
|
|
2722
|
-
if (!variant.accentEdge || !variant.decorations) return;
|
|
2723
|
-
ctx.addIssue({
|
|
2724
|
-
code: "custom",
|
|
2725
|
-
path: ["decorations"],
|
|
2726
|
-
message: "A card variant carries either the legacy `accentEdge` or `decorations`, never both."
|
|
2727
|
-
});
|
|
2728
|
-
}
|
|
2729
|
-
const cardVariantSchema = cardVariantInputSchema.superRefine(validateSingleDecorationSource).transform(normalizeLegacyAccentEdge);
|
|
2730
|
-
/**
|
|
2731
|
-
* Fill in roles for legacy systems whose variants declare none. Inference is
|
|
2732
|
-
* collision-tolerant on purpose: first claimant wins and a later variant that
|
|
2733
|
-
* would infer a taken role simply gets no role. Legacy data is not obliged to
|
|
2734
|
-
* be well-formed, and a card system that fails to parse takes the whole theme
|
|
2735
|
-
* down with it.
|
|
2736
|
-
*/
|
|
2737
|
-
function withInferredRoles(variants) {
|
|
2738
|
-
const claimed = new Set(variants.flatMap((variant) => variant.role ? [variant.role] : []));
|
|
2739
|
-
return variants.map((variant) => {
|
|
2740
|
-
if (variant.role) return variant;
|
|
2741
|
-
const inferred = inferCardVariantRoleFromPriority(variant.priority);
|
|
2742
|
-
if (!inferred || claimed.has(inferred)) return variant;
|
|
2743
|
-
claimed.add(inferred);
|
|
2744
|
-
return {
|
|
2745
|
-
...variant,
|
|
2746
|
-
role: inferred
|
|
2747
|
-
};
|
|
2748
|
-
});
|
|
2749
|
-
}
|
|
2750
|
-
/**
|
|
2751
|
-
* Only *declared* roles are validated — a site style saying "these two
|
|
2672
|
+
* A site style saying "these two
|
|
2752
2673
|
* variants are both the default card" is an authoring error worth rejecting.
|
|
2753
2674
|
*/
|
|
2754
|
-
function
|
|
2675
|
+
function validateUniqueCardVariantRoles(system, ctx) {
|
|
2755
2676
|
const declared = /* @__PURE__ */ new Set();
|
|
2756
2677
|
system.variants.forEach((variant, index) => {
|
|
2757
2678
|
const role = variant.role;
|
|
2758
|
-
if (!role) return;
|
|
2759
2679
|
if (declared.has(role)) {
|
|
2760
2680
|
ctx.addIssue({
|
|
2761
2681
|
code: "custom",
|
|
@@ -2771,7 +2691,7 @@ function validateUniqueDeclaredCardVariantRoles(system, ctx) {
|
|
|
2771
2691
|
declared.add(role);
|
|
2772
2692
|
});
|
|
2773
2693
|
}
|
|
2774
|
-
const cardSystemSchema = z.object({ variants: z.array(cardVariantSchema).min(1).max(3) }).superRefine(
|
|
2694
|
+
const cardSystemSchema = z.object({ variants: z.array(cardVariantSchema).min(1).max(3) }).superRefine(validateUniqueCardVariantRoles);
|
|
2775
2695
|
//#endregion
|
|
2776
2696
|
//#region ../theme-core/src/cards/constants.ts
|
|
2777
2697
|
/**
|
|
@@ -3046,7 +2966,7 @@ function generateDefaultCardSystem(theme) {
|
|
|
3046
2966
|
//#endregion
|
|
3047
2967
|
//#region ../theme-core/src/cards/roles.ts
|
|
3048
2968
|
function findVariantForRole(cardSystem, role) {
|
|
3049
|
-
return cardSystem?.variants.find((variant) =>
|
|
2969
|
+
return cardSystem?.variants.find((variant) => variant.role === role) ?? null;
|
|
3050
2970
|
}
|
|
3051
2971
|
function findEnabledVariantForRole(cardSystem, role) {
|
|
3052
2972
|
const variant = findVariantForRole(cardSystem, role);
|
|
@@ -3175,12 +3095,16 @@ function surfaceForegroundDeclarations(input) {
|
|
|
3175
3095
|
}
|
|
3176
3096
|
function surfaceForegroundInputFromResolved(foreground, color) {
|
|
3177
3097
|
const { roles } = foreground;
|
|
3098
|
+
const value = (ink) => {
|
|
3099
|
+
const token = parseThemeColorToken(ink);
|
|
3100
|
+
return token ? color(token) : ink;
|
|
3101
|
+
};
|
|
3178
3102
|
return {
|
|
3179
|
-
text:
|
|
3180
|
-
heading:
|
|
3181
|
-
link:
|
|
3182
|
-
linkHover:
|
|
3183
|
-
supporting:
|
|
3103
|
+
text: value(roles.text),
|
|
3104
|
+
heading: value(roles.heading),
|
|
3105
|
+
link: value(roles.link),
|
|
3106
|
+
linkHover: value(roles.linkHover),
|
|
3107
|
+
supporting: value(roles.supporting),
|
|
3184
3108
|
hoverDecoration: foreground.hoverDecoration
|
|
3185
3109
|
};
|
|
3186
3110
|
}
|
|
@@ -3254,16 +3178,22 @@ function srgbToOklab(r, g, b) {
|
|
|
3254
3178
|
b: .0259040371 * l_ + .7827717662 * m_ - .808675766 * s_
|
|
3255
3179
|
};
|
|
3256
3180
|
}
|
|
3257
|
-
|
|
3181
|
+
/** OKLab to linear sRGB, unclamped. The one owner of this matrix. */
|
|
3182
|
+
function oklabToLinearSrgb(L, a, b) {
|
|
3258
3183
|
const l_ = Math.pow(L + .3963377774 * a + .2158037573 * b, 3);
|
|
3259
3184
|
const m_ = Math.pow(L - .1055613458 * a - .0638541728 * b, 3);
|
|
3260
3185
|
const s_ = Math.pow(L - .0894841775 * a - 1.291485548 * b, 3);
|
|
3261
|
-
const R = 4.0767416621 * l_ - 3.3077115913 * m_ + .2309699292 * s_;
|
|
3262
|
-
const G = -1.2684380046 * l_ + 2.6097574011 * m_ - .3413193965 * s_;
|
|
3263
|
-
const B = -.0041960863 * l_ - .7034186147 * m_ + 1.707614701 * s_;
|
|
3264
3186
|
return {
|
|
3265
|
-
r:
|
|
3266
|
-
g:
|
|
3187
|
+
r: 4.0767416621 * l_ - 3.3077115913 * m_ + .2309699292 * s_,
|
|
3188
|
+
g: -1.2684380046 * l_ + 2.6097574011 * m_ - .3413193965 * s_,
|
|
3189
|
+
b: -.0041960863 * l_ - .7034186147 * m_ + 1.707614701 * s_
|
|
3190
|
+
};
|
|
3191
|
+
}
|
|
3192
|
+
function oklabToSrgb(L, a, b) {
|
|
3193
|
+
const { r, g, b: B } = oklabToLinearSrgb(L, a, b);
|
|
3194
|
+
return {
|
|
3195
|
+
r: linearToSrgb(r),
|
|
3196
|
+
g: linearToSrgb(g),
|
|
3267
3197
|
b: linearToSrgb(B)
|
|
3268
3198
|
};
|
|
3269
3199
|
}
|
|
@@ -3323,6 +3253,16 @@ function featuresFromHex(hex) {
|
|
|
3323
3253
|
};
|
|
3324
3254
|
}
|
|
3325
3255
|
//#endregion
|
|
3256
|
+
//#region \0@oxc-project+runtime@0.137.0/helpers/esm/checkPrivateRedeclaration.js
|
|
3257
|
+
function _checkPrivateRedeclaration(e, t) {
|
|
3258
|
+
if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object");
|
|
3259
|
+
}
|
|
3260
|
+
//#endregion
|
|
3261
|
+
//#region \0@oxc-project+runtime@0.137.0/helpers/esm/classPrivateFieldInitSpec.js
|
|
3262
|
+
function _classPrivateFieldInitSpec(e, t, a) {
|
|
3263
|
+
_checkPrivateRedeclaration(e, t), t.set(e, a);
|
|
3264
|
+
}
|
|
3265
|
+
//#endregion
|
|
3326
3266
|
//#region ../theme-core/src/palette/utils/contrast.ts
|
|
3327
3267
|
const ORDINARY_TEXT_MIN_CONTRAST_RATIO = 4.5;
|
|
3328
3268
|
function relativeLuminance(r, g, b) {
|
|
@@ -3353,6 +3293,54 @@ function colourLuminance(hex) {
|
|
|
3353
3293
|
function indexedLuminance(hex, index) {
|
|
3354
3294
|
return (index && Object.prototype.hasOwnProperty.call(index, hex) ? index[hex] : void 0) ?? colourLuminance(hex);
|
|
3355
3295
|
}
|
|
3296
|
+
var _certified = /* @__PURE__ */ new WeakMap();
|
|
3297
|
+
/**
|
|
3298
|
+
* A closed luminance range with `lo <= hi`. The private field means only
|
|
3299
|
+
* `luminanceInterval` and `solidPaint` can make one, so the solver can trust
|
|
3300
|
+
* the ordering without checking it again. The class itself is not exported.
|
|
3301
|
+
*/
|
|
3302
|
+
var Interval = class {
|
|
3303
|
+
constructor(lo, hi) {
|
|
3304
|
+
this.lo = lo;
|
|
3305
|
+
this.hi = hi;
|
|
3306
|
+
_classPrivateFieldInitSpec(this, _certified, true);
|
|
3307
|
+
}
|
|
3308
|
+
};
|
|
3309
|
+
function toLuminance(y) {
|
|
3310
|
+
if (!Number.isFinite(y) || y < 0 || y > 1) throw new Error(`Luminance must be in [0, 1]: ${y}`);
|
|
3311
|
+
return y;
|
|
3312
|
+
}
|
|
3313
|
+
function luminanceInterval(lo, hi = lo) {
|
|
3314
|
+
if (toLuminance(lo) > toLuminance(hi)) throw new Error(`Empty luminance interval: [${lo}, ${hi}]`);
|
|
3315
|
+
return new Interval(lo, hi);
|
|
3316
|
+
}
|
|
3317
|
+
/** The relative luminance of a hex colour, read from the prepared index when given. */
|
|
3318
|
+
function hexLuminance(hex, index) {
|
|
3319
|
+
return toLuminance(indexedLuminance(hex, index));
|
|
3320
|
+
}
|
|
3321
|
+
/** The paint of a solid hex ground: a single point. */
|
|
3322
|
+
function solidPaint(hex, index) {
|
|
3323
|
+
const y = hexLuminance(hex, index);
|
|
3324
|
+
return new Interval(y, y);
|
|
3325
|
+
}
|
|
3326
|
+
/**
|
|
3327
|
+
* The one black-or-white rule: literal black or white, whichever contrasts more
|
|
3328
|
+
* with the whole paint (black on a tie). It always returns, even when neither
|
|
3329
|
+
* reaches the ratio a caller wants; callers decide what a shortfall means.
|
|
3330
|
+
* A style's preferred neutral is a separate input (`neutralInk`) and never
|
|
3331
|
+
* part of this rule.
|
|
3332
|
+
*/
|
|
3333
|
+
function maxContrastBlackOrWhite(paint) {
|
|
3334
|
+
const blackContrast = (paint.lo + .05) / .05;
|
|
3335
|
+
const whiteContrast = 1.05 / (paint.hi + .05);
|
|
3336
|
+
return blackContrast >= whiteContrast ? {
|
|
3337
|
+
ink: "black",
|
|
3338
|
+
ratio: blackContrast
|
|
3339
|
+
} : {
|
|
3340
|
+
ink: "white",
|
|
3341
|
+
ratio: whiteContrast
|
|
3342
|
+
};
|
|
3343
|
+
}
|
|
3356
3344
|
function contrastRatio(hex1, hex2, index) {
|
|
3357
3345
|
const L1 = indexedLuminance(hex1, index);
|
|
3358
3346
|
const L2 = indexedLuminance(hex2, index);
|
|
@@ -3508,10 +3496,10 @@ function resolveOpaqueSurfaceHex(reference, palette, underlayReference) {
|
|
|
3508
3496
|
const parts = parseColorTokenParts(reference);
|
|
3509
3497
|
if (parts.kind === "token" && parts.opacityPercent !== null) {
|
|
3510
3498
|
const foregroundHex = normalizePaletteHex(palette[parts.token] ?? "");
|
|
3511
|
-
return foregroundHex ? compositeHex$
|
|
3499
|
+
return foregroundHex ? compositeHex$2(foregroundHex, underlayHex, parts.opacityPercent / 100) : null;
|
|
3512
3500
|
}
|
|
3513
3501
|
const rgba = parseRgba(parts.kind === "raw" ? parts.value : reference);
|
|
3514
|
-
return rgba ? compositeHex$
|
|
3502
|
+
return rgba ? compositeHex$2(rgbToHex(rgba.r, rgba.g, rgba.b), underlayHex, rgba.alpha) : null;
|
|
3515
3503
|
}
|
|
3516
3504
|
/** Resolve a colour reference only when it is already fully opaque. */
|
|
3517
3505
|
function resolveConcreteColorHex(reference, palette) {
|
|
@@ -3527,7 +3515,7 @@ function resolveConcreteColorHex(reference, palette) {
|
|
|
3527
3515
|
if (literal.toLowerCase() === "white") return "#ffffff";
|
|
3528
3516
|
return normalizePaletteHex(literal);
|
|
3529
3517
|
}
|
|
3530
|
-
function compositeHex$
|
|
3518
|
+
function compositeHex$2(foregroundHex, underlayHex, alpha) {
|
|
3531
3519
|
const foreground = hexToRgb(foregroundHex);
|
|
3532
3520
|
const underlay = hexToRgb(underlayHex);
|
|
3533
3521
|
const channel = (foregroundValue, underlayValue) => Math.round(foregroundValue * alpha + underlayValue * (1 - alpha));
|
|
@@ -3601,10 +3589,10 @@ const CONTRAST_GLASS_ALPHA = .6;
|
|
|
3601
3589
|
*/
|
|
3602
3590
|
function worstCaseGlassBackdrop(tone) {
|
|
3603
3591
|
const [over, tint] = tone === "dark" ? ["#ffffff", "#000000"] : ["#000000", "#ffffff"];
|
|
3604
|
-
return compositeHex(tint, over, CONTRAST_GLASS_ALPHA);
|
|
3592
|
+
return compositeHex$1(tint, over, CONTRAST_GLASS_ALPHA);
|
|
3605
3593
|
}
|
|
3606
3594
|
/** Flatten `foreground` at `alpha` over `background` into an opaque hex. */
|
|
3607
|
-
function compositeHex(foreground, background, alpha) {
|
|
3595
|
+
function compositeHex$1(foreground, background, alpha) {
|
|
3608
3596
|
const f = hexToRgb(foreground);
|
|
3609
3597
|
const b = hexToRgb(background);
|
|
3610
3598
|
return rgbToHex(Math.round(mix$1(b.r, f.r, alpha)), Math.round(mix$1(b.g, f.g, alpha)), Math.round(mix$1(b.b, f.b, alpha)));
|
|
@@ -3617,14 +3605,15 @@ function compositeHex(foreground, background, alpha) {
|
|
|
3617
3605
|
*/
|
|
3618
3606
|
function planForegroundHover(input) {
|
|
3619
3607
|
const { restingToken, candidate, palette, backdrops } = input;
|
|
3620
|
-
if (candidate && candidate !== restingToken) {
|
|
3608
|
+
if (candidate && String(candidate) !== String(restingToken)) {
|
|
3621
3609
|
if (backdrops === null || survivesEveryBackdrop(candidate, palette, backdrops)) return {
|
|
3622
3610
|
kind: "candidate",
|
|
3623
3611
|
token: candidate,
|
|
3624
3612
|
decoration: "initial"
|
|
3625
3613
|
};
|
|
3626
3614
|
}
|
|
3627
|
-
const
|
|
3615
|
+
const resting = parseThemeColorToken(restingToken);
|
|
3616
|
+
const softened = resting ? deriveForegroundHoverToken(resting) : null;
|
|
3628
3617
|
if (softened && backdrops && survivesEveryBackdrop(softened, palette, backdrops)) return {
|
|
3629
3618
|
kind: "softened",
|
|
3630
3619
|
token: softened,
|
|
@@ -3643,6 +3632,44 @@ function survivesEveryBackdrop(token, palette, backdrops) {
|
|
|
3643
3632
|
});
|
|
3644
3633
|
}
|
|
3645
3634
|
//#endregion
|
|
3635
|
+
//#region ../theme-core/src/palette/utils/textColor.ts
|
|
3636
|
+
/**
|
|
3637
|
+
* Pick the better of black/white text for a given background using actual
|
|
3638
|
+
* contrast ratios, not a simple luminance cutoff. This is
|
|
3639
|
+
* `maxContrastBlackOrWhite` for a solid ground.
|
|
3640
|
+
*
|
|
3641
|
+
* @param background - Background color in hex or rgb/rgba format (e.g., '#FFFFFF' or 'rgb(255, 255, 255)')
|
|
3642
|
+
* @param _minContrast - Kept for callers. It cannot change the result: when
|
|
3643
|
+
* only one of black or white reaches it, that one is also the better of the two.
|
|
3644
|
+
* @returns '#000000' for light backgrounds, '#FFFFFF' for dark backgrounds
|
|
3645
|
+
*/
|
|
3646
|
+
function pickBlackOrWhiteTextColor(background, _minContrast = 4.5) {
|
|
3647
|
+
const { r, g, b } = parseColorToRgb(background);
|
|
3648
|
+
return maxContrastBlackOrWhite(luminanceInterval(relativeLuminance(r, g, b))).ink === "black" ? "#000000" : "#FFFFFF";
|
|
3649
|
+
}
|
|
3650
|
+
/**
|
|
3651
|
+
* Backwards-compatible alias for callers that want the best black/white text
|
|
3652
|
+
* color for a background.
|
|
3653
|
+
*/
|
|
3654
|
+
function getTextColorForBackground(background) {
|
|
3655
|
+
return pickBlackOrWhiteTextColor(background);
|
|
3656
|
+
}
|
|
3657
|
+
function parseColorToRgb(input) {
|
|
3658
|
+
const trimmed = input.trim();
|
|
3659
|
+
if (trimmed.startsWith("#")) return hexToRgb(trimmed);
|
|
3660
|
+
const rgbMatch = trimmed.match(/^rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})(?:\s*,\s*(?:0|1|0?\.\d+))?\s*\)$/i);
|
|
3661
|
+
if (rgbMatch?.[1] && rgbMatch[2] && rgbMatch[3]) return {
|
|
3662
|
+
r: clamp255(Number(rgbMatch[1])),
|
|
3663
|
+
g: clamp255(Number(rgbMatch[2])),
|
|
3664
|
+
b: clamp255(Number(rgbMatch[3]))
|
|
3665
|
+
};
|
|
3666
|
+
throw new Error("Unsupported color format");
|
|
3667
|
+
}
|
|
3668
|
+
function clamp255(value) {
|
|
3669
|
+
if (Number.isNaN(value)) return 0;
|
|
3670
|
+
return Math.max(0, Math.min(255, value));
|
|
3671
|
+
}
|
|
3672
|
+
//#endregion
|
|
3646
3673
|
//#region ../theme-core/src/palette/utils/onColor.ts
|
|
3647
3674
|
const BACKGROUND_ROLE_NAMES = /* @__PURE__ */ new Set([
|
|
3648
3675
|
"primary",
|
|
@@ -3747,47 +3774,6 @@ function mix(a, b, t) {
|
|
|
3747
3774
|
return a + (b - a) * Math.max(0, Math.min(1, t));
|
|
3748
3775
|
}
|
|
3749
3776
|
//#endregion
|
|
3750
|
-
//#region ../theme-core/src/palette/utils/textColor.ts
|
|
3751
|
-
/**
|
|
3752
|
-
* Pick the better of black/white text for a given background using actual
|
|
3753
|
-
* contrast ratios, not a simple luminance cutoff.
|
|
3754
|
-
*
|
|
3755
|
-
* @param background - Background color in hex or rgb/rgba format (e.g., '#FFFFFF' or 'rgb(255, 255, 255)')
|
|
3756
|
-
* @param minContrast - Preferred minimum contrast ratio for body-sized text
|
|
3757
|
-
* @returns '#000000' for light backgrounds, '#FFFFFF' for dark backgrounds
|
|
3758
|
-
*/
|
|
3759
|
-
function pickBlackOrWhiteTextColor(background, minContrast = 4.5) {
|
|
3760
|
-
const { r, g, b } = parseColorToRgb(background);
|
|
3761
|
-
const luminance = relativeLuminance(r, g, b);
|
|
3762
|
-
const blackContrast = (luminance + .05) / .05;
|
|
3763
|
-
const whiteContrast = 1.05 / (luminance + .05);
|
|
3764
|
-
if (blackContrast >= minContrast && whiteContrast < minContrast) return "#000000";
|
|
3765
|
-
if (whiteContrast >= minContrast && blackContrast < minContrast) return "#FFFFFF";
|
|
3766
|
-
return blackContrast >= whiteContrast ? "#000000" : "#FFFFFF";
|
|
3767
|
-
}
|
|
3768
|
-
/**
|
|
3769
|
-
* Backwards-compatible alias for callers that want the best black/white text
|
|
3770
|
-
* color for a background.
|
|
3771
|
-
*/
|
|
3772
|
-
function getTextColorForBackground(background) {
|
|
3773
|
-
return pickBlackOrWhiteTextColor(background);
|
|
3774
|
-
}
|
|
3775
|
-
function parseColorToRgb(input) {
|
|
3776
|
-
const trimmed = input.trim();
|
|
3777
|
-
if (trimmed.startsWith("#")) return hexToRgb(trimmed);
|
|
3778
|
-
const rgbMatch = trimmed.match(/^rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})(?:\s*,\s*(?:0|1|0?\.\d+))?\s*\)$/i);
|
|
3779
|
-
if (rgbMatch?.[1] && rgbMatch[2] && rgbMatch[3]) return {
|
|
3780
|
-
r: clamp255(Number(rgbMatch[1])),
|
|
3781
|
-
g: clamp255(Number(rgbMatch[2])),
|
|
3782
|
-
b: clamp255(Number(rgbMatch[3]))
|
|
3783
|
-
};
|
|
3784
|
-
throw new Error("Unsupported color format");
|
|
3785
|
-
}
|
|
3786
|
-
function clamp255(value) {
|
|
3787
|
-
if (Number.isNaN(value)) return 0;
|
|
3788
|
-
return Math.max(0, Math.min(255, value));
|
|
3789
|
-
}
|
|
3790
|
-
//#endregion
|
|
3791
3777
|
//#region ../theme-core/src/palette/expandPalette.ts
|
|
3792
3778
|
function colorsToMap(palette) {
|
|
3793
3779
|
const map = {};
|
|
@@ -3864,8 +3850,8 @@ function expandBasePalette(palette) {
|
|
|
3864
3850
|
function deriveSurfaceDecorationColors(ground, text, accent) {
|
|
3865
3851
|
const ink = getTextColorForBackground(ground);
|
|
3866
3852
|
return {
|
|
3867
|
-
line: firstContrastBlend(ground, text, ground, 1.5),
|
|
3868
|
-
mark: firstContrastBlend(accent, ink, ground, 3)
|
|
3853
|
+
line: firstContrastBlend$1(ground, text, ground, 1.5),
|
|
3854
|
+
mark: firstContrastBlend$1(accent, ink, ground, 3)
|
|
3869
3855
|
};
|
|
3870
3856
|
}
|
|
3871
3857
|
/** Secondary ink is blended toward its ground, with an ordinary-text contrast floor. */
|
|
@@ -3881,7 +3867,7 @@ function firstSafeMutedSample(sample, ground, low, high) {
|
|
|
3881
3867
|
const middle = Math.floor((low + high) / 2);
|
|
3882
3868
|
return contrastRatio(sample(middle), ground) >= 4.5 ? firstSafeMutedSample(sample, ground, low, middle) : firstSafeMutedSample(sample, ground, middle + 1, high);
|
|
3883
3869
|
}
|
|
3884
|
-
function firstContrastBlend(from, to, ground, threshold) {
|
|
3870
|
+
function firstContrastBlend$1(from, to, ground, threshold) {
|
|
3885
3871
|
const start = hexToRgb(from);
|
|
3886
3872
|
const end = hexToRgb(to);
|
|
3887
3873
|
return Array.from({ length: 101 }, (_, index) => {
|
|
@@ -3919,17 +3905,13 @@ const CANONICAL_EQUIVALENT_TOKEN_ORDER = [
|
|
|
3919
3905
|
"neutral-950",
|
|
3920
3906
|
"neutral-50"
|
|
3921
3907
|
];
|
|
3922
|
-
/**
|
|
3923
|
-
* Resolve the complete foreground contract for an effective page/section or
|
|
3924
|
-
* site-chrome background.
|
|
3925
|
-
*
|
|
3926
|
-
* Deterministic colour backgrounds are validated at ordinary-text WCAG AA.
|
|
3927
|
-
* Existing image/video/gradient treatments are trusted only when they already
|
|
3928
|
-
* carry a usable foreground token; this function deliberately does not claim
|
|
3929
|
-
* pixel-level contrast proof for media.
|
|
3930
|
-
*/
|
|
3931
3908
|
function resolveSurfaceForeground(background, palette, candidates = {}, options = {}) {
|
|
3932
3909
|
const authored = foregroundCandidates(background, candidates);
|
|
3910
|
+
if ("measuredBackdrop" in options) return resolveMeasuredForeground(background?.color ?? "background", options.measuredBackdrop, authored, palette);
|
|
3911
|
+
return resolveAuthoredBackground(background, palette, authored, options);
|
|
3912
|
+
}
|
|
3913
|
+
/** Legacy references may be measurable, inherited, or a trusted media treatment. */
|
|
3914
|
+
function resolveAuthoredBackground(background, palette, authored, options) {
|
|
3933
3915
|
if (background === null) return resolveDeterministicForeground("background", {
|
|
3934
3916
|
...authored,
|
|
3935
3917
|
text: authored.text ?? "text"
|
|
@@ -3956,14 +3938,16 @@ function candidateOrBackground(candidate, backgroundValue) {
|
|
|
3956
3938
|
function resolveDeterministicForeground(backgroundReference, candidates, palette, compositeBase) {
|
|
3957
3939
|
const backgroundHex = resolveOpaqueSurfaceHex(backgroundReference, palette, compositeBase);
|
|
3958
3940
|
if (!backgroundHex) return resolveTrustedTreatmentForeground(candidates, palette);
|
|
3941
|
+
return resolveMeasuredForeground(backgroundReference, backgroundHex, candidates, palette);
|
|
3942
|
+
}
|
|
3943
|
+
function resolveMeasuredForeground(backgroundReference, backgroundHex, candidates, palette) {
|
|
3959
3944
|
const backgroundToken = paletteToken(backgroundReference);
|
|
3960
3945
|
const derivedOnToken = backgroundToken ? onColorTokenName(backgroundToken) : null;
|
|
3961
3946
|
const text = firstSafeToken([
|
|
3962
3947
|
candidates.text,
|
|
3963
3948
|
derivedOnToken,
|
|
3964
3949
|
...FALLBACK_TEXT_TOKENS
|
|
3965
|
-
], backgroundHex, palette, derivedOnToken ? [derivedOnToken] : []);
|
|
3966
|
-
if (!text) return { kind: "unknown" };
|
|
3950
|
+
], backgroundHex, palette, derivedOnToken ? [derivedOnToken] : []) ?? pickBlackOrWhiteTextColor(backgroundHex);
|
|
3967
3951
|
return knownForeground({
|
|
3968
3952
|
text,
|
|
3969
3953
|
heading: safeTokenOr(candidates.heading, text, backgroundHex, palette),
|
|
@@ -4082,6 +4066,20 @@ function selectLogoVariant(tone, variants) {
|
|
|
4082
4066
|
return tone === "dark" ? forDarkBackgrounds ?? forLightBackgrounds : forLightBackgrounds ?? forDarkBackgrounds;
|
|
4083
4067
|
}
|
|
4084
4068
|
//#endregion
|
|
4069
|
+
//#region ../theme-core/src/site-styles/ownedThemeSnapshot.ts
|
|
4070
|
+
/** Copy before freezing: the editor still owns its source data. */
|
|
4071
|
+
function ownedThemeSnapshot(input) {
|
|
4072
|
+
return freezeOwnedThemeValue(structuredClone(input));
|
|
4073
|
+
}
|
|
4074
|
+
/** Only freshly owned data belongs here; no caller-owned object is frozen. */
|
|
4075
|
+
function freezeOwnedThemeValue(value) {
|
|
4076
|
+
if (typeof value === "object" && value !== null) {
|
|
4077
|
+
Object.values(value).forEach(freezeOwnedThemeValue);
|
|
4078
|
+
Object.freeze(value);
|
|
4079
|
+
}
|
|
4080
|
+
return value;
|
|
4081
|
+
}
|
|
4082
|
+
//#endregion
|
|
4085
4083
|
//#region ../theme-core/src/buttons/styles/domain.ts
|
|
4086
4084
|
const PUBLIC_BUTTON_ROLES = VARIANT_ROLES;
|
|
4087
4085
|
function defineButtonStyleRecipe(recipe) {
|
|
@@ -4737,6 +4735,7 @@ const BUTTON_EFFECT_POLICIES = {
|
|
|
4737
4735
|
pop: { classification: "non-colour" },
|
|
4738
4736
|
"border-bottom-grow": { classification: "non-colour" },
|
|
4739
4737
|
"sketchy-border": { classification: "decorative-colour" },
|
|
4738
|
+
"inner-dashed-outline": { classification: "decorative-colour" },
|
|
4740
4739
|
"pulse-animation": {
|
|
4741
4740
|
classification: "unsupported-colour",
|
|
4742
4741
|
reason: "changes_element_opacity"
|
|
@@ -4898,7 +4897,6 @@ const BUTTON_CONTRAST_POLICY = {
|
|
|
4898
4897
|
function formatButtonColourContractError(error) {
|
|
4899
4898
|
switch (error.tag) {
|
|
4900
4899
|
case "unknown_palette_token": return `Button "${error.variantId}" ${error.state} state uses unknown palette token "${error.token}".`;
|
|
4901
|
-
case "missing_on_colour": return `Button "${error.variantId}" ${error.state} state cannot derive ${error.foregroundToken} from ${error.backgroundToken}.`;
|
|
4902
4900
|
case "insufficient_contrast": return `Button "${error.variantId}" ${error.state} state has ${error.ratio.toFixed(2)}:1 contrast (${error.requiredRatio}:1 required).`;
|
|
4903
4901
|
case "insufficient_surface_contrast": return `Button "${error.variantId}" ${error.state} state is indistinguishable from its surface at ${error.ratio.toFixed(2)}:1 contrast (${error.requiredRatio}:1 required).`;
|
|
4904
4902
|
case "unsupported_colour_effect": return `Button "${error.variantId}" ${error.state} effect "${error.effectId}" is not contrast-safe (${error.reason}).`;
|
|
@@ -5290,30 +5288,26 @@ function resolveFocusIndicator(colour) {
|
|
|
5290
5288
|
function resolveSolid(input, backgroundToken, edge) {
|
|
5291
5289
|
const backgroundHex = paletteHex(input, backgroundToken);
|
|
5292
5290
|
if (!backgroundHex.ok) return backgroundHex;
|
|
5293
|
-
const
|
|
5294
|
-
const
|
|
5295
|
-
if (
|
|
5296
|
-
|
|
5297
|
-
|
|
5298
|
-
|
|
5299
|
-
variantId: input.variantId,
|
|
5300
|
-
state: input.state,
|
|
5301
|
-
backgroundToken,
|
|
5302
|
-
foregroundToken
|
|
5303
|
-
}
|
|
5291
|
+
const ink = resolveSolidInk(input, backgroundToken, backgroundHex.hex);
|
|
5292
|
+
const boundary = validateSolidBoundary(input, backgroundHex.hex, ink.foregroundHex, edge);
|
|
5293
|
+
if (!boundary.ok) return boundary;
|
|
5294
|
+
return {
|
|
5295
|
+
ok: true,
|
|
5296
|
+
colour: ink.colour
|
|
5304
5297
|
};
|
|
5305
|
-
|
|
5298
|
+
}
|
|
5299
|
+
/** Preserve checked on-colours; a solid state's last resort belongs to its actual fill. */
|
|
5300
|
+
function resolveSolidInk(input, backgroundToken, backgroundHex) {
|
|
5301
|
+
const foregroundToken = unsafeAsOpaqueButtonColourToken(solidForegroundToken(backgroundToken));
|
|
5302
|
+
const candidate = input.palette[foregroundToken];
|
|
5303
|
+
if ((typeof candidate === "string" ? validateButtonTextContrast({
|
|
5306
5304
|
...input,
|
|
5307
5305
|
background: backgroundToken,
|
|
5308
|
-
backgroundHex
|
|
5306
|
+
backgroundHex,
|
|
5309
5307
|
foreground: foregroundToken,
|
|
5310
|
-
foregroundHex
|
|
5311
|
-
})
|
|
5312
|
-
|
|
5313
|
-
const boundary = validateSolidBoundary(input, backgroundHex.hex, foregroundHex, edge);
|
|
5314
|
-
if (!boundary.ok) return boundary;
|
|
5315
|
-
return {
|
|
5316
|
-
ok: true,
|
|
5308
|
+
foregroundHex: candidate
|
|
5309
|
+
}) : null)?.ok === true && typeof candidate === "string") return {
|
|
5310
|
+
foregroundHex: candidate,
|
|
5317
5311
|
colour: {
|
|
5318
5312
|
kind: "solid",
|
|
5319
5313
|
backgroundToken,
|
|
@@ -5322,6 +5316,15 @@ function resolveSolid(input, backgroundToken, edge) {
|
|
|
5322
5316
|
foregroundCss: tokenCss(foregroundToken)
|
|
5323
5317
|
}
|
|
5324
5318
|
};
|
|
5319
|
+
const foregroundHex = pickBlackOrWhiteTextColor(backgroundHex);
|
|
5320
|
+
return {
|
|
5321
|
+
foregroundHex,
|
|
5322
|
+
colour: {
|
|
5323
|
+
kind: "known-solid",
|
|
5324
|
+
backgroundCss: tokenCss(backgroundToken),
|
|
5325
|
+
foregroundCss: foregroundHex
|
|
5326
|
+
}
|
|
5327
|
+
};
|
|
5325
5328
|
}
|
|
5326
5329
|
/** A declared border can identify a solid button whose fill misses ground contrast. */
|
|
5327
5330
|
function validateSolidBoundary(input, fill, foreground, edge) {
|
|
@@ -5417,6 +5420,19 @@ function interpolateHex(startHex, endHex, position) {
|
|
|
5417
5420
|
}
|
|
5418
5421
|
//#endregion
|
|
5419
5422
|
//#region ../theme-core/src/buttons/buttonSurfaceContext.ts
|
|
5423
|
+
/** The last resort, chosen by `maxContrastBlackOrWhite`. */
|
|
5424
|
+
const LITERAL_NEUTRALS = {
|
|
5425
|
+
black: {
|
|
5426
|
+
hex: "#000000",
|
|
5427
|
+
css: "#000000",
|
|
5428
|
+
source: "literal-css"
|
|
5429
|
+
},
|
|
5430
|
+
white: {
|
|
5431
|
+
hex: "#ffffff",
|
|
5432
|
+
css: "#ffffff",
|
|
5433
|
+
source: "literal-css"
|
|
5434
|
+
}
|
|
5435
|
+
};
|
|
5420
5436
|
/**
|
|
5421
5437
|
* Derive only what the rendered section can honestly prove about its backing.
|
|
5422
5438
|
* Images, gradients, alpha/composite layers and arbitrary CSS remain unknown.
|
|
@@ -5425,7 +5441,7 @@ function deriveButtonSurfaceContext(input, palette, fallbackToken, colourIndex)
|
|
|
5425
5441
|
const background = deriveKnownBackground(input, palette, fallbackToken);
|
|
5426
5442
|
if (background.kind === "unknown") return background;
|
|
5427
5443
|
const explicitForeground = resolveKnownColour(input.kind === "solid" || input.kind === "inherit" ? input.foreground ?? "" : "", palette);
|
|
5428
|
-
const foreground = explicitForeground && contrastRatio(background.colour.hex, explicitForeground.hex, colourIndex) >= 4.5 ? explicitForeground :
|
|
5444
|
+
const foreground = explicitForeground && contrastRatio(background.colour.hex, explicitForeground.hex, colourIndex) >= 4.5 ? explicitForeground : LITERAL_NEUTRALS[maxContrastBlackOrWhite(solidPaint(background.colour.hex, colourIndex)).ink];
|
|
5429
5445
|
return {
|
|
5430
5446
|
kind: "known-solid",
|
|
5431
5447
|
source: background.source,
|
|
@@ -5516,25 +5532,42 @@ function resolveSurfaceButtonContext(input) {
|
|
|
5516
5532
|
kind: "reset",
|
|
5517
5533
|
styles: contextualButtonSurfaceResetStyles()
|
|
5518
5534
|
};
|
|
5519
|
-
return {
|
|
5520
|
-
|
|
5521
|
-
styles: knownSurfaceButtonContextStyles({
|
|
5522
|
-
surface: context.surface,
|
|
5523
|
-
palette: input.palette,
|
|
5524
|
-
colourIndex: input.colourIndex,
|
|
5525
|
-
buttonSystem: surfaceButtonSystem(input.buttonSystem, input.primaryToken)
|
|
5526
|
-
})
|
|
5527
|
-
};
|
|
5528
|
-
}
|
|
5529
|
-
/** Every role's contextual styles against one proven solid surface. */
|
|
5530
|
-
function knownSurfaceButtonContextStyles(input) {
|
|
5531
|
-
return Object.fromEntries(VARIANT_ROLES.flatMap((role) => Object.entries(contextualButtonSurfaceStyles(resolveContextualButtonRole({
|
|
5532
|
-
role,
|
|
5533
|
-
buttonSystem: input.buttonSystem,
|
|
5535
|
+
return knownSurfaceButtonContext({
|
|
5536
|
+
surface: context.surface,
|
|
5534
5537
|
palette: input.palette,
|
|
5535
5538
|
colourIndex: input.colourIndex,
|
|
5536
|
-
|
|
5537
|
-
})
|
|
5539
|
+
buttonSystem: surfaceButtonSystem(input.buttonSystem, input.primaryToken)
|
|
5540
|
+
});
|
|
5541
|
+
}
|
|
5542
|
+
function knownSurfaceButtonContext(input) {
|
|
5543
|
+
const roles = freezeOwnedThemeValue({
|
|
5544
|
+
primary: resolveContextualButtonRole({
|
|
5545
|
+
...input,
|
|
5546
|
+
role: "primary"
|
|
5547
|
+
}),
|
|
5548
|
+
secondary: resolveContextualButtonRole({
|
|
5549
|
+
...input,
|
|
5550
|
+
role: "secondary"
|
|
5551
|
+
}),
|
|
5552
|
+
outline: resolveContextualButtonRole({
|
|
5553
|
+
...input,
|
|
5554
|
+
role: "outline"
|
|
5555
|
+
}),
|
|
5556
|
+
ghost: resolveContextualButtonRole({
|
|
5557
|
+
...input,
|
|
5558
|
+
role: "ghost"
|
|
5559
|
+
}),
|
|
5560
|
+
accent: resolveContextualButtonRole({
|
|
5561
|
+
...input,
|
|
5562
|
+
role: "accent"
|
|
5563
|
+
})
|
|
5564
|
+
});
|
|
5565
|
+
const styles = Object.fromEntries(VARIANT_ROLES.flatMap((role) => Object.entries(contextualButtonSurfaceStyles(roles[role]))));
|
|
5566
|
+
return Object.defineProperty({
|
|
5567
|
+
kind: "resolved",
|
|
5568
|
+
styles,
|
|
5569
|
+
roles
|
|
5570
|
+
}, "roles", { enumerable: false });
|
|
5538
5571
|
}
|
|
5539
5572
|
function resolveContextualButtonRole(input) {
|
|
5540
5573
|
const requested = findVariant(input.buttonSystem, input.role);
|
|
@@ -5557,15 +5590,18 @@ function preferredButtonResolution(requested, compiled, role) {
|
|
|
5557
5590
|
focusIndicator: compiled.focusIndicator,
|
|
5558
5591
|
boundary: boundaryForVariant(requested)
|
|
5559
5592
|
};
|
|
5560
|
-
|
|
5593
|
+
const boundaries = boundariesForVariant(requested);
|
|
5594
|
+
return compiled.contextualHoverRepair ? hideBoundaryEvidence({
|
|
5561
5595
|
...appearance,
|
|
5596
|
+
boundaries,
|
|
5562
5597
|
kind: "repaired",
|
|
5563
5598
|
candidate: "contextual-hover",
|
|
5564
5599
|
rejectedCandidates: []
|
|
5565
|
-
} : {
|
|
5600
|
+
}) : hideBoundaryEvidence({
|
|
5566
5601
|
...appearance,
|
|
5602
|
+
boundaries,
|
|
5567
5603
|
kind: "preferred"
|
|
5568
|
-
};
|
|
5604
|
+
});
|
|
5569
5605
|
}
|
|
5570
5606
|
/** Ordered, lazy fallback selection; the rejected evidence belongs to this decision. */
|
|
5571
5607
|
function resolveFallbackButtonRole(input, requested, fallbacks, rejected) {
|
|
@@ -5578,15 +5614,16 @@ function resolveFallbackButtonRole(input, requested, fallbacks, rejected) {
|
|
|
5578
5614
|
const candidate = candidateVariant(fallback, requested, input.buttonSystem);
|
|
5579
5615
|
if (!candidate) return resolveFallbackButtonRole(input, requested, remaining, rejected);
|
|
5580
5616
|
const compiled = compileCandidate(candidate.variant, input);
|
|
5581
|
-
return compiled.ok ? {
|
|
5617
|
+
return compiled.ok ? hideBoundaryEvidence({
|
|
5582
5618
|
kind: "repaired",
|
|
5583
5619
|
requestedRole: input.role,
|
|
5584
5620
|
candidate: candidate.name,
|
|
5621
|
+
boundaries: boundariesForVariant(candidate.variant),
|
|
5585
5622
|
states: candidate.name === "surface-outline" ? withSurfaceInversion(compiled.states, input.surface) : compiled.states,
|
|
5586
5623
|
focusIndicator: compiled.focusIndicator,
|
|
5587
5624
|
boundary: candidate.boundary,
|
|
5588
5625
|
rejectedCandidates: rejected
|
|
5589
|
-
} : resolveFallbackButtonRole(input, requested, remaining, [...rejected, {
|
|
5626
|
+
}) : resolveFallbackButtonRole(input, requested, remaining, [...rejected, {
|
|
5590
5627
|
candidate: candidate.name,
|
|
5591
5628
|
error: compiled.error
|
|
5592
5629
|
}]);
|
|
@@ -5693,6 +5730,25 @@ function candidateVariant(fallback, requested, system) {
|
|
|
5693
5730
|
}
|
|
5694
5731
|
};
|
|
5695
5732
|
}
|
|
5733
|
+
function hideBoundaryEvidence(value) {
|
|
5734
|
+
return Object.defineProperty(value, "boundaries", { enumerable: false });
|
|
5735
|
+
}
|
|
5736
|
+
function boundariesForVariant(variant) {
|
|
5737
|
+
const boundary = (state) => {
|
|
5738
|
+
const appearance = variant.visualStates?.[state];
|
|
5739
|
+
return boundaryForVariant(appearance ? {
|
|
5740
|
+
...variant,
|
|
5741
|
+
border: appearance.border === "none" ? void 0 : appearance.border
|
|
5742
|
+
} : variant);
|
|
5743
|
+
};
|
|
5744
|
+
return freezeOwnedThemeValue({
|
|
5745
|
+
base: boundary("base"),
|
|
5746
|
+
hover: boundary("hover"),
|
|
5747
|
+
focus: boundary("focus"),
|
|
5748
|
+
active: boundary("active"),
|
|
5749
|
+
disabled: boundary("disabled")
|
|
5750
|
+
});
|
|
5751
|
+
}
|
|
5696
5752
|
function boundaryForVariant(variant) {
|
|
5697
5753
|
if (!variant.border) return null;
|
|
5698
5754
|
return {
|
|
@@ -5780,17 +5836,6 @@ function normalizeOpaqueHex(value) {
|
|
|
5780
5836
|
if (!match?.[1]) return null;
|
|
5781
5837
|
return `#${(match[1].length === 3 ? match[1].split("").map((digit) => `${digit}${digit}`).join("") : match[1]).toLowerCase()}`;
|
|
5782
5838
|
}
|
|
5783
|
-
function safestBlackOrWhite(backgroundHex, colourIndex) {
|
|
5784
|
-
return contrastRatio(backgroundHex, "#000000", colourIndex) >= contrastRatio(backgroundHex, "#ffffff", colourIndex) ? {
|
|
5785
|
-
hex: "#000000",
|
|
5786
|
-
css: "#000000",
|
|
5787
|
-
source: "literal-css"
|
|
5788
|
-
} : {
|
|
5789
|
-
hex: "#ffffff",
|
|
5790
|
-
css: "#ffffff",
|
|
5791
|
-
source: "literal-css"
|
|
5792
|
-
};
|
|
5793
|
-
}
|
|
5794
5839
|
function readNonEmptyString(value) {
|
|
5795
5840
|
return typeof value === "string" && value.trim() ? value.trim() : null;
|
|
5796
5841
|
}
|
|
@@ -5805,260 +5850,75 @@ function contextualBoundaryStyles(boundary) {
|
|
|
5805
5850
|
};
|
|
5806
5851
|
}
|
|
5807
5852
|
//#endregion
|
|
5808
|
-
//#region ../theme-core/src/
|
|
5809
|
-
|
|
5810
|
-
|
|
5811
|
-
|
|
5812
|
-
|
|
5813
|
-
|
|
5814
|
-
|
|
5815
|
-
|
|
5853
|
+
//#region ../theme-core/src/palette/utils/scrimContrast.ts
|
|
5854
|
+
const WHITE = "#ffffff";
|
|
5855
|
+
const BLACK = "#000000";
|
|
5856
|
+
/** `top` at `alpha` over opaque `bottom`, blended as CSS paints an overlay. */
|
|
5857
|
+
function compositeHex(topHex, alpha, bottomHex) {
|
|
5858
|
+
const top = hexToRgb(topHex);
|
|
5859
|
+
const bottom = hexToRgb(bottomHex);
|
|
5860
|
+
const mix = (a, b) => Math.round(alpha * a + (1 - alpha) * b);
|
|
5861
|
+
return rgbToHex(mix(top.r, bottom.r), mix(top.g, bottom.g), mix(top.b, bottom.b));
|
|
5862
|
+
}
|
|
5863
|
+
/**
|
|
5864
|
+
* The lowest contrast `foreground` can reach over `scrim` at `alpha` laid on
|
|
5865
|
+
* any pixel. A foreground whose luminance falls inside the range the
|
|
5866
|
+
* composites can take has a worst case of 1:1.
|
|
5867
|
+
*/
|
|
5868
|
+
function worstCaseScrimContrast(input) {
|
|
5869
|
+
const overWhite = compositeHex(input.scrimHex, input.alpha, WHITE);
|
|
5870
|
+
const overBlack = compositeHex(input.scrimHex, input.alpha, BLACK);
|
|
5871
|
+
const luminance = (hex) => {
|
|
5872
|
+
const { r, g, b } = hexToRgb(hex);
|
|
5873
|
+
return relativeLuminance(r, g, b);
|
|
5816
5874
|
};
|
|
5875
|
+
const foreground = luminance(input.foregroundHex);
|
|
5876
|
+
const low = luminance(overBlack);
|
|
5877
|
+
const high = luminance(overWhite);
|
|
5878
|
+
if (foreground >= low && foreground <= high) return 1;
|
|
5879
|
+
return Math.min(contrastRatio(input.foregroundHex, overWhite), contrastRatio(input.foregroundHex, overBlack));
|
|
5817
5880
|
}
|
|
5818
5881
|
/**
|
|
5819
|
-
* The
|
|
5820
|
-
*
|
|
5821
|
-
*
|
|
5822
|
-
* inherit a band's light text or its band-resolved buttons.
|
|
5882
|
+
* The smallest scrim opacity, in hundredths, at which every foreground keeps
|
|
5883
|
+
* `threshold` contrast over any pixel. `null` when even an opaque scrim fails,
|
|
5884
|
+
* which means the foreground was never legible on the scrim colour itself.
|
|
5823
5885
|
*/
|
|
5824
|
-
function
|
|
5825
|
-
|
|
5826
|
-
|
|
5827
|
-
|
|
5828
|
-
|
|
5829
|
-
|
|
5830
|
-
|
|
5831
|
-
|
|
5832
|
-
|
|
5833
|
-
|
|
5834
|
-
|
|
5835
|
-
|
|
5836
|
-
|
|
5837
|
-
|
|
5838
|
-
|
|
5839
|
-
|
|
5840
|
-
|
|
5841
|
-
|
|
5842
|
-
|
|
5843
|
-
|
|
5844
|
-
}
|
|
5845
|
-
|
|
5846
|
-
function inheritedSurfaceDeclarations(arrangement) {
|
|
5847
|
-
return [
|
|
5848
|
-
"color",
|
|
5849
|
-
...Object.entries(SURFACE_FOREGROUND_CSS_VARS).filter(([role]) => arrangement || role !== "line" && role !== "mark" && role !== "muted").map(([, variable]) => variable),
|
|
5850
|
-
"--rb-surface-link-hover-decoration",
|
|
5851
|
-
...Object.keys(contextualButtonSurfaceResetStyles())
|
|
5852
|
-
].map((property) => `${property}: inherit;`);
|
|
5853
|
-
}
|
|
5854
|
-
//#endregion
|
|
5855
|
-
//#region ../theme-core/src/utils/colorStyles.ts
|
|
5856
|
-
const COLOR_VAR_PREFIX = "--tb-";
|
|
5857
|
-
function parseToken(source) {
|
|
5858
|
-
const parts = parseColorTokenParts(source);
|
|
5859
|
-
if (parts.kind === "raw") return {
|
|
5860
|
-
token: source,
|
|
5861
|
-
raw: parts.value
|
|
5862
|
-
};
|
|
5863
|
-
if (parts.kind === "invalid") return { token: source };
|
|
5864
|
-
return {
|
|
5865
|
-
token: parts.token,
|
|
5866
|
-
opacityPercent: parts.opacityPercent === null ? void 0 : parts.opacityPercent
|
|
5867
|
-
};
|
|
5868
|
-
}
|
|
5869
|
-
const SURFACE_TEXT_ROLE_BY_TOKEN = {
|
|
5870
|
-
text: "text",
|
|
5871
|
-
heading: "heading",
|
|
5872
|
-
mutedText: "supporting"
|
|
5873
|
-
};
|
|
5874
|
-
function surfaceRoleForTextToken(token) {
|
|
5875
|
-
return Object.prototype.hasOwnProperty.call(SURFACE_TEXT_ROLE_BY_TOKEN, token) ? SURFACE_TEXT_ROLE_BY_TOKEN[token] : null;
|
|
5876
|
-
}
|
|
5877
|
-
/**
|
|
5878
|
-
* Converts a theme color token to a CSS rgb value.
|
|
5879
|
-
* This is the primary function for applying theme colors to CSS properties.
|
|
5880
|
-
*
|
|
5881
|
-
* @param token - Theme color token (semantic, with opacity, or raw)
|
|
5882
|
-
* @returns CSS color value (rgb with optional alpha, or raw CSS value)
|
|
5883
|
-
*
|
|
5884
|
-
* @example
|
|
5885
|
-
* rgbColorValue('primary') // => 'rgb(var(--tb-primary))'
|
|
5886
|
-
* rgbColorValue('surface/95') // => 'rgb(var(--tb-surface) / 0.95)'
|
|
5887
|
-
* rgbColorValue('raw:transparent') // => 'transparent'
|
|
5888
|
-
*/
|
|
5889
|
-
function rgbColorValue(token) {
|
|
5890
|
-
const { token: baseToken, opacityPercent, raw } = parseToken(token);
|
|
5891
|
-
if (raw) return raw;
|
|
5892
|
-
const cssVar = `${COLOR_VAR_PREFIX}${baseToken}`;
|
|
5893
|
-
if (opacityPercent === void 0) return `rgb(var(${cssVar}))`;
|
|
5894
|
-
return `rgb(var(${cssVar}) / ${opacityPercent / 100})`;
|
|
5895
|
-
}
|
|
5896
|
-
/**
|
|
5897
|
-
* Converts a theme color token to a CSS variable reference.
|
|
5898
|
-
* Note: This returns the base variable without rgb() wrapper, ignoring opacity.
|
|
5899
|
-
*
|
|
5900
|
-
* @param token - Theme color token
|
|
5901
|
-
* @returns CSS variable reference
|
|
5902
|
-
*
|
|
5903
|
-
* @example
|
|
5904
|
-
* cssVarValue('primary') // => 'var(--tb-primary)'
|
|
5905
|
-
* cssVarValue('surface/95') // => 'var(--tb-surface)' (opacity ignored)
|
|
5906
|
-
*/
|
|
5907
|
-
function cssVarValue(token) {
|
|
5908
|
-
const { token: baseToken } = parseToken(token);
|
|
5909
|
-
return `var(${COLOR_VAR_PREFIX}${baseToken})`;
|
|
5910
|
-
}
|
|
5911
|
-
/**
|
|
5912
|
-
* Creates a backgroundColor style object from a theme token.
|
|
5913
|
-
*
|
|
5914
|
-
* @param token - Theme color token
|
|
5915
|
-
* @returns CSSProperties with backgroundColor
|
|
5916
|
-
*/
|
|
5917
|
-
function backgroundColorStyle(token) {
|
|
5918
|
-
return { backgroundColor: rgbColorValue(token) };
|
|
5919
|
-
}
|
|
5920
|
-
/**
|
|
5921
|
-
* Converts a text color token to a CSS color value that follows the enclosing
|
|
5922
|
-
* surface. The semantic text tokens (`text`, `heading`, `mutedText`) resolve
|
|
5923
|
-
* to the surface foreground variables, so text adapts when a section's
|
|
5924
|
-
* background changes; any other token is a fixed theme color.
|
|
5925
|
-
*
|
|
5926
|
-
* @param token - Theme color token
|
|
5927
|
-
* @returns CSS color value
|
|
5928
|
-
*/
|
|
5929
|
-
function textColorValue(token) {
|
|
5930
|
-
const parsed = parseToken(token);
|
|
5931
|
-
const surfaceRole = parsed.raw ? null : surfaceRoleForTextToken(parsed.token);
|
|
5932
|
-
if (!surfaceRole) return rgbColorValue(token);
|
|
5933
|
-
return parsed.opacityPercent === void 0 ? surfaceForegroundValue(surfaceRole) : surfaceForegroundValueWithOpacity(surfaceRole, parsed.opacityPercent);
|
|
5934
|
-
}
|
|
5935
|
-
/**
|
|
5936
|
-
* Creates a text color style object from a theme token.
|
|
5937
|
-
*
|
|
5938
|
-
* @param token - Theme color token
|
|
5939
|
-
* @returns CSSProperties with color
|
|
5940
|
-
*/
|
|
5941
|
-
function textColorStyle(token) {
|
|
5942
|
-
return { color: textColorValue(token) };
|
|
5943
|
-
}
|
|
5944
|
-
/**
|
|
5945
|
-
* Creates a border color style object from a theme token.
|
|
5946
|
-
*
|
|
5947
|
-
* @param token - Theme color token
|
|
5948
|
-
* @returns CSSProperties with borderColor
|
|
5949
|
-
*/
|
|
5950
|
-
function borderColorStyle(token) {
|
|
5951
|
-
return { borderColor: rgbColorValue(token) };
|
|
5952
|
-
}
|
|
5953
|
-
/**
|
|
5954
|
-
* Merges multiple CSSProperties objects into a single object.
|
|
5955
|
-
* Later styles override earlier ones. Undefined values are filtered out.
|
|
5956
|
-
* Returns undefined if the merged result is empty.
|
|
5957
|
-
*
|
|
5958
|
-
* @param styles - Variable number of CSSProperties objects (can be undefined)
|
|
5959
|
-
* @returns Merged CSSProperties object, or undefined if empty
|
|
5960
|
-
*
|
|
5961
|
-
* @example
|
|
5962
|
-
* mergeStyles(
|
|
5963
|
-
* backgroundColorStyle('surface'),
|
|
5964
|
-
* textColorStyle('text'),
|
|
5965
|
-
* borderColorStyle('border')
|
|
5966
|
-
* )
|
|
5967
|
-
* // => { backgroundColor: '...', color: '...', borderColor: '...' }
|
|
5968
|
-
*/
|
|
5969
|
-
function mergeStyles(...styles) {
|
|
5970
|
-
const merged = {};
|
|
5971
|
-
for (const style of styles) {
|
|
5972
|
-
if (!style) continue;
|
|
5973
|
-
Object.assign(merged, style);
|
|
5974
|
-
}
|
|
5975
|
-
return Object.keys(merged).length ? merged : void 0;
|
|
5886
|
+
function minimumScrimOpacity(input) {
|
|
5887
|
+
const passes = (alpha) => input.foregroundHexes.every((foregroundHex) => worstCaseScrimContrast({
|
|
5888
|
+
foregroundHex,
|
|
5889
|
+
scrimHex: input.scrimHex,
|
|
5890
|
+
alpha
|
|
5891
|
+
}) >= input.threshold);
|
|
5892
|
+
return Array.from({ length: 101 }, (_, hundredths) => hundredths / 100).find(passes) ?? null;
|
|
5893
|
+
}
|
|
5894
|
+
/** Shared samples for literal RGB washes and palette-token gradient veils. */
|
|
5895
|
+
function gradientScrimSamples(gradient, alpha, palette) {
|
|
5896
|
+
const literal = [...gradient.matchAll(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([\d.]+))?\s*\)/g)].map((stop) => ({
|
|
5897
|
+
hex: rgbToHex(Number(stop[1]), Number(stop[2]), Number(stop[3])),
|
|
5898
|
+
alpha: alpha * (stop[4] === void 0 ? 1 : Number(stop[4]))
|
|
5899
|
+
}));
|
|
5900
|
+
const tokens = [...gradient.matchAll(/var\(--tb-([\w-]+)\)/g)].flatMap((stop) => {
|
|
5901
|
+
const hex = stop[1] ? resolveConcreteColorHex(stop[1], palette) : null;
|
|
5902
|
+
return hex ? [{
|
|
5903
|
+
hex,
|
|
5904
|
+
alpha
|
|
5905
|
+
}] : [];
|
|
5906
|
+
});
|
|
5907
|
+
return [...literal, ...tokens];
|
|
5976
5908
|
}
|
|
5977
|
-
|
|
5978
|
-
|
|
5979
|
-
/**
|
|
5980
|
-
* Resolves theme tokens to CSS variables
|
|
5981
|
-
*
|
|
5982
|
-
* This resolver ensures all button styles use theme tokens (not hardcoded colors)
|
|
5983
|
-
* so that changing the palette automatically updates all buttons.
|
|
5909
|
+
/** The ink with the stronger worst-pixel guarantee identifies the veil tone.
|
|
5910
|
+
* No readable samples (or a tie) leaves classification to the foreground owner.
|
|
5984
5911
|
*/
|
|
5985
|
-
|
|
5986
|
-
|
|
5987
|
-
|
|
5988
|
-
|
|
5989
|
-
|
|
5990
|
-
|
|
5991
|
-
|
|
5992
|
-
|
|
5993
|
-
|
|
5994
|
-
|
|
5995
|
-
* Note: CSS variables are stored as RGB channels (e.g., "37 99 235") following Tailwind convention,
|
|
5996
|
-
* so we must wrap them with rgb() to create a valid color value.
|
|
5997
|
-
*
|
|
5998
|
-
* @example
|
|
5999
|
-
* resolver.getColor('primary-500') // => 'rgb(var(--tb-primary-500))'
|
|
6000
|
-
* resolver.getColor('white') // => 'rgb(var(--tb-white))'
|
|
6001
|
-
*/
|
|
6002
|
-
getColor(token) {
|
|
6003
|
-
if (!this.tokenExists(token)) console.warn(`[TokenResolver] Color token "${token}" not found in theme palette. Button may render incorrectly.`);
|
|
6004
|
-
return rgbColorValue(token);
|
|
6005
|
-
}
|
|
6006
|
-
/**
|
|
6007
|
-
* Adjust a color token's shade by a given amount
|
|
6008
|
-
*
|
|
6009
|
-
* @param token - Base token (e.g., 'primary-500')
|
|
6010
|
-
* @param amount - Shade adjustment (+100 = darker, -100 = lighter)
|
|
6011
|
-
* @returns Adjusted token name (e.g., 'primary-600')
|
|
6012
|
-
*
|
|
6013
|
-
* @example
|
|
6014
|
-
* resolver.adjustShade('primary-500', 100) // => 'primary-600' (darker)
|
|
6015
|
-
* resolver.adjustShade('primary-500', -100) // => 'primary-400' (lighter)
|
|
6016
|
-
*/
|
|
6017
|
-
adjustShade(token, amount) {
|
|
6018
|
-
const parts = token.split("-");
|
|
6019
|
-
if (parts.length < 2) return `${token}-${Math.max(100, Math.min(900, 500 + amount))}`;
|
|
6020
|
-
const base = parts.slice(0, -1).join("-");
|
|
6021
|
-
const shade = parseInt(parts[parts.length - 1] ?? "", 10);
|
|
6022
|
-
if (isNaN(shade)) {
|
|
6023
|
-
console.warn(`[TokenResolver] Cannot adjust shade for non-shade token "${token}". Returning original token.`);
|
|
6024
|
-
return token;
|
|
6025
|
-
}
|
|
6026
|
-
return `${base}-${Math.max(100, Math.min(900, shade + amount))}`;
|
|
6027
|
-
}
|
|
6028
|
-
/**
|
|
6029
|
-
* Check if a token exists in the theme palette
|
|
6030
|
-
*
|
|
6031
|
-
* @param token - Token name to check
|
|
6032
|
-
* @returns True if token exists in theme
|
|
6033
|
-
*/
|
|
6034
|
-
tokenExists(token) {
|
|
6035
|
-
if ([
|
|
6036
|
-
"white",
|
|
6037
|
-
"black",
|
|
6038
|
-
"transparent"
|
|
6039
|
-
].includes(token)) return true;
|
|
6040
|
-
const parts = token.split("-");
|
|
6041
|
-
if (parts.length >= 2) {
|
|
6042
|
-
const lastPart = parts[parts.length - 1] ?? "";
|
|
6043
|
-
const shade = parseInt(lastPart, 10);
|
|
6044
|
-
if (!isNaN(shade) && shade >= 100 && shade <= 900 && shade % 100 === 0) return true;
|
|
6045
|
-
}
|
|
6046
|
-
return true;
|
|
6047
|
-
}
|
|
6048
|
-
};
|
|
6049
|
-
//#endregion
|
|
6050
|
-
//#region ../theme-core/src/site-styles/ownedThemeSnapshot.ts
|
|
6051
|
-
/** Copy before freezing: the editor still owns its source data. */
|
|
6052
|
-
function ownedThemeSnapshot(input) {
|
|
6053
|
-
return freezeOwnedThemeValue(structuredClone(input));
|
|
6054
|
-
}
|
|
6055
|
-
/** Only freshly owned data belongs here; no caller-owned object is frozen. */
|
|
6056
|
-
function freezeOwnedThemeValue(value) {
|
|
6057
|
-
if (typeof value === "object" && value !== null) {
|
|
6058
|
-
Object.values(value).forEach(freezeOwnedThemeValue);
|
|
6059
|
-
Object.freeze(value);
|
|
6060
|
-
}
|
|
6061
|
-
return value;
|
|
5912
|
+
function scrimTone(samples) {
|
|
5913
|
+
if (samples.length === 0) return null;
|
|
5914
|
+
const worst = (foregroundHex) => Math.min(...samples.map((sample) => worstCaseScrimContrast({
|
|
5915
|
+
foregroundHex,
|
|
5916
|
+
scrimHex: sample.hex,
|
|
5917
|
+
alpha: sample.alpha
|
|
5918
|
+
})));
|
|
5919
|
+
const white = worst(WHITE);
|
|
5920
|
+
const black = worst(BLACK);
|
|
5921
|
+
return white === black ? null : white > black ? "dark" : "light";
|
|
6062
5922
|
}
|
|
6063
5923
|
//#endregion
|
|
6064
5924
|
//#region ../theme-core/src/site-styles/accessibleSurfaces.ts
|
|
@@ -6204,7 +6064,7 @@ const surfaceRecipes = {
|
|
|
6204
6064
|
inheritedBackground: false
|
|
6205
6065
|
}
|
|
6206
6066
|
};
|
|
6207
|
-
const
|
|
6067
|
+
const missingBackgroundTokens = {
|
|
6208
6068
|
background: "#ffffff",
|
|
6209
6069
|
foreground: "#000000"
|
|
6210
6070
|
};
|
|
@@ -6218,29 +6078,69 @@ function toAccessibleColorSurfaceIntent(surface) {
|
|
|
6218
6078
|
default: return assertNeverSurface(surface);
|
|
6219
6079
|
}
|
|
6220
6080
|
}
|
|
6081
|
+
/** Keep every successful legacy recipe; only exhausted candidates need neutral ink. */
|
|
6221
6082
|
function resolveAccessibleSurfaceRecipe(input) {
|
|
6222
|
-
const
|
|
6083
|
+
const result = tryAccessibleSurfaceRecipe(input);
|
|
6084
|
+
if (result.kind === "resolved-accessible-surface") return result;
|
|
6223
6085
|
const recipe = surfaceRecipes[input.surface];
|
|
6224
|
-
const
|
|
6225
|
-
|
|
6226
|
-
|
|
6227
|
-
|
|
6228
|
-
|
|
6229
|
-
|
|
6230
|
-
|
|
6231
|
-
|
|
6232
|
-
|
|
6233
|
-
|
|
6234
|
-
|
|
6235
|
-
|
|
6236
|
-
|
|
6237
|
-
|
|
6238
|
-
|
|
6239
|
-
|
|
6240
|
-
|
|
6241
|
-
|
|
6242
|
-
|
|
6243
|
-
|
|
6086
|
+
const token = recipe.backgroundCandidates.find((candidate) => resolveConcreteColorHex(candidate, input.palette) !== null);
|
|
6087
|
+
const hex = token ? resolveConcreteColorHex(token, input.palette) : null;
|
|
6088
|
+
if (!token || !hex) return result;
|
|
6089
|
+
const ink = pickBlackOrWhiteTextColor(hex);
|
|
6090
|
+
const foreground = (role) => ({
|
|
6091
|
+
kind: "safe-token",
|
|
6092
|
+
role,
|
|
6093
|
+
token: asAccessibleSurfaceToken(ink),
|
|
6094
|
+
hex: ink,
|
|
6095
|
+
contrastRatio: contrastRatio(ink, hex)
|
|
6096
|
+
});
|
|
6097
|
+
return {
|
|
6098
|
+
kind: "resolved-accessible-surface",
|
|
6099
|
+
surface: input.surface,
|
|
6100
|
+
background: {
|
|
6101
|
+
token: asAccessibleSurfaceToken(token),
|
|
6102
|
+
hex,
|
|
6103
|
+
inherited: recipe.inheritedBackground
|
|
6104
|
+
},
|
|
6105
|
+
heading: {
|
|
6106
|
+
...foreground("heading"),
|
|
6107
|
+
role: "heading"
|
|
6108
|
+
},
|
|
6109
|
+
text: {
|
|
6110
|
+
...foreground("text"),
|
|
6111
|
+
role: "text"
|
|
6112
|
+
},
|
|
6113
|
+
link: {
|
|
6114
|
+
...foreground("link"),
|
|
6115
|
+
role: "link"
|
|
6116
|
+
},
|
|
6117
|
+
supporting: foreground("supporting"),
|
|
6118
|
+
rejectedCandidates: result.rejectedCandidates
|
|
6119
|
+
};
|
|
6120
|
+
}
|
|
6121
|
+
function tryAccessibleSurfaceRecipe(input) {
|
|
6122
|
+
const rejectedCandidates = [];
|
|
6123
|
+
const recipe = surfaceRecipes[input.surface];
|
|
6124
|
+
const threshold = contrastThresholdByPolicy[input.policy ?? "body-aa"];
|
|
6125
|
+
for (const backgroundToken of recipe.backgroundCandidates) {
|
|
6126
|
+
const backgroundHex = readPaletteHex(input.palette, backgroundToken);
|
|
6127
|
+
if (!backgroundHex) {
|
|
6128
|
+
rejectedCandidates.push({
|
|
6129
|
+
kind: "background-candidate",
|
|
6130
|
+
token: backgroundToken,
|
|
6131
|
+
reason: "missing-token"
|
|
6132
|
+
});
|
|
6133
|
+
continue;
|
|
6134
|
+
}
|
|
6135
|
+
const heading = resolveRequiredForeground({
|
|
6136
|
+
role: "heading",
|
|
6137
|
+
candidates: recipe.headingCandidates,
|
|
6138
|
+
backgroundToken,
|
|
6139
|
+
backgroundHex,
|
|
6140
|
+
palette: input.palette,
|
|
6141
|
+
threshold,
|
|
6142
|
+
rejectedCandidates
|
|
6143
|
+
});
|
|
6244
6144
|
const text = resolveRequiredForeground({
|
|
6245
6145
|
role: "text",
|
|
6246
6146
|
candidates: recipe.textCandidates,
|
|
@@ -6383,20 +6283,20 @@ function asAccessibleSurfaceToken(token) {
|
|
|
6383
6283
|
function surfaceResolutionFailureReason(rejectedCandidates) {
|
|
6384
6284
|
return rejectedCandidates.some((candidate) => candidate.kind === "foreground-candidate") ? "no-safe-foreground-candidate" : "no-background-candidate";
|
|
6385
6285
|
}
|
|
6386
|
-
function
|
|
6387
|
-
const contrast = contrastRatio(
|
|
6286
|
+
function missingBackgroundSurface(input) {
|
|
6287
|
+
const contrast = contrastRatio(missingBackgroundTokens.foreground, missingBackgroundTokens.background);
|
|
6388
6288
|
const foreground = {
|
|
6389
6289
|
kind: "safe-token",
|
|
6390
|
-
token: asAccessibleSurfaceToken(
|
|
6391
|
-
hex:
|
|
6290
|
+
token: asAccessibleSurfaceToken(missingBackgroundTokens.foreground),
|
|
6291
|
+
hex: missingBackgroundTokens.foreground,
|
|
6392
6292
|
contrastRatio: contrast
|
|
6393
6293
|
};
|
|
6394
6294
|
return {
|
|
6395
6295
|
kind: "resolved-accessible-surface",
|
|
6396
6296
|
surface: input.surface,
|
|
6397
6297
|
background: {
|
|
6398
|
-
token: asAccessibleSurfaceToken(
|
|
6399
|
-
hex:
|
|
6298
|
+
token: asAccessibleSurfaceToken(missingBackgroundTokens.background),
|
|
6299
|
+
hex: missingBackgroundTokens.background,
|
|
6400
6300
|
inherited: false
|
|
6401
6301
|
},
|
|
6402
6302
|
heading: {
|
|
@@ -6421,8 +6321,73 @@ function terminalFallbackSurface(input) {
|
|
|
6421
6321
|
function assertNeverSurface(value) {
|
|
6422
6322
|
throw new Error(`Unhandled Theme V2 surface intent: ${String(value)}`);
|
|
6423
6323
|
}
|
|
6324
|
+
const resolvedSurfaceBrand = Symbol("ResolvedSurface");
|
|
6325
|
+
const surfaceOwners = /* @__PURE__ */ new WeakSet();
|
|
6326
|
+
const preparedIndexOwners = /* @__PURE__ */ new WeakSet();
|
|
6327
|
+
const surfaceTransports = /* @__PURE__ */ new WeakMap();
|
|
6328
|
+
const ownedRevisionInputs = /* @__PURE__ */ new WeakMap();
|
|
6329
|
+
const revisionOwners = /* @__PURE__ */ new WeakMap();
|
|
6330
|
+
const surfaceRevisionOwners = /* @__PURE__ */ new WeakMap();
|
|
6331
|
+
const surfaceTextPolicy = Object.freeze({
|
|
6332
|
+
heading: "large-text-aa",
|
|
6333
|
+
text: "body-aa",
|
|
6334
|
+
link: "body-aa",
|
|
6335
|
+
linkHover: "body-aa",
|
|
6336
|
+
supporting: "body-aa",
|
|
6337
|
+
muted: "body-aa"
|
|
6338
|
+
});
|
|
6339
|
+
function ownSurfaceRevision(context) {
|
|
6340
|
+
if (!ownedRevisionInputs.get(context.palette)?.has(context.buttonSystem)) {
|
|
6341
|
+
const revision = ownedThemeSnapshot({
|
|
6342
|
+
palette: context.palette,
|
|
6343
|
+
buttonSystem: context.buttonSystem
|
|
6344
|
+
});
|
|
6345
|
+
registerOwnedRevisionInputs(revision);
|
|
6346
|
+
surfaceRevisionOwners.set(revision, revision);
|
|
6347
|
+
revisionOwners.set(revision.palette, /* @__PURE__ */ new Map([[revision.buttonSystem, revision]]));
|
|
6348
|
+
return revision;
|
|
6349
|
+
}
|
|
6350
|
+
const revisions = revisionOwners.get(context.palette) ?? /* @__PURE__ */ new Map();
|
|
6351
|
+
const existing = revisions.get(context.buttonSystem);
|
|
6352
|
+
if (existing) return existing;
|
|
6353
|
+
const revision = Object.freeze({
|
|
6354
|
+
palette: context.palette,
|
|
6355
|
+
buttonSystem: context.buttonSystem
|
|
6356
|
+
});
|
|
6357
|
+
surfaceRevisionOwners.set(revision, revision);
|
|
6358
|
+
revisions.set(context.buttonSystem, revision);
|
|
6359
|
+
revisionOwners.set(context.palette, revisions);
|
|
6360
|
+
return revision;
|
|
6361
|
+
}
|
|
6362
|
+
/** Local computation keeps its colour index; transport references only the owning revision inputs. */
|
|
6363
|
+
function surfaceTransportContext(context) {
|
|
6364
|
+
const revision = ownSurfaceRevision(context);
|
|
6365
|
+
const result = Object.freeze({
|
|
6366
|
+
...revision,
|
|
6367
|
+
colourIndex: context.colourIndex
|
|
6368
|
+
});
|
|
6369
|
+
surfaceRevisionOwners.set(result, revision);
|
|
6370
|
+
return result;
|
|
6371
|
+
}
|
|
6372
|
+
/** Called only after copying and recursively freezing owner inputs. */
|
|
6373
|
+
function registerOwnedRevisionInputs(context) {
|
|
6374
|
+
const buttons = ownedRevisionInputs.get(context.palette) ?? /* @__PURE__ */ new Set();
|
|
6375
|
+
buttons.add(context.buttonSystem);
|
|
6376
|
+
ownedRevisionInputs.set(context.palette, buttons);
|
|
6377
|
+
}
|
|
6378
|
+
function isResolvedSurface(value) {
|
|
6379
|
+
return typeof value === "object" && value !== null && surfaceOwners.has(value) && "kind" in value && (value.kind === "owned" || value.kind === "inherit");
|
|
6380
|
+
}
|
|
6381
|
+
/** Opaque immutable surface/context values have no child DTOs to project. */
|
|
6382
|
+
function isSurfaceTransportLeaf(value) {
|
|
6383
|
+
return isResolvedSurface(value) || isSurfaceTreeRecord(value) && surfaceRevisionOwners.has(value);
|
|
6384
|
+
}
|
|
6385
|
+
/** Runtime serializers reject copies and forged structural objects, too. */
|
|
6386
|
+
function requireResolvedSurface(value) {
|
|
6387
|
+
if (!isResolvedSurface(value)) throw new Error("Surface must be produced by resolveSurface");
|
|
6388
|
+
}
|
|
6424
6389
|
function resolveSurface(spec, context) {
|
|
6425
|
-
return spec.kind === "section" ? resolveSectionSurface(spec.background, context) : preparedSurfaceValue(spec, context) ??
|
|
6390
|
+
return spec.kind === "section" ? resolveSectionSurface(spec.background, context) : preparedSurfaceValue(spec, context) ?? certifySurface(spec, context);
|
|
6426
6391
|
}
|
|
6427
6392
|
/** Own one theme revision; derive its surface decisions without copying its inputs again. */
|
|
6428
6393
|
function prepareThemeSurfaceRevision(inputTheme, selectSurfaces = () => []) {
|
|
@@ -6439,6 +6404,7 @@ function prepareThemeSurfaceRevision(inputTheme, selectSurfaces = () => []) {
|
|
|
6439
6404
|
colourIndex: preparePaletteColourIndex(palette),
|
|
6440
6405
|
buttonSystem: snapshot.buttons
|
|
6441
6406
|
});
|
|
6407
|
+
registerOwnedRevisionInputs(context);
|
|
6442
6408
|
const preparedSurfaces = declarations.length === 0 ? void 0 : surfaceIndexFromOwnedInputs(declarations, context);
|
|
6443
6409
|
return Object.freeze({
|
|
6444
6410
|
theme,
|
|
@@ -6450,24 +6416,27 @@ function prepareThemeSurfaceRevision(inputTheme, selectSurfaces = () => []) {
|
|
|
6450
6416
|
}
|
|
6451
6417
|
/** Private construction path: both entry points above own and freeze these inputs. */
|
|
6452
6418
|
function surfaceIndexFromOwnedInputs(specs, context) {
|
|
6419
|
+
registerOwnedRevisionInputs(context);
|
|
6453
6420
|
const entries = [...new Map(specs.map((spec) => [surfaceResolutionKey(spec, context), spec]))].flatMap(([key, spec]) => preparedSurfaceEntry(key, spec, context));
|
|
6454
|
-
|
|
6421
|
+
const index = Object.freeze({
|
|
6455
6422
|
palette: context.palette,
|
|
6456
6423
|
buttonSystem: context.buttonSystem,
|
|
6457
6424
|
colourIndex: context.colourIndex,
|
|
6458
6425
|
values: freezeOwnedThemeValue(Object.fromEntries(entries))
|
|
6459
6426
|
});
|
|
6427
|
+
preparedIndexOwners.add(index);
|
|
6428
|
+
return index;
|
|
6460
6429
|
}
|
|
6461
6430
|
function preparedSurfaceEntry(key, spec, context) {
|
|
6462
6431
|
try {
|
|
6463
|
-
return [[key,
|
|
6432
|
+
return [[key, certifySurface(spec, context)]];
|
|
6464
6433
|
} catch {
|
|
6465
6434
|
return [];
|
|
6466
6435
|
}
|
|
6467
6436
|
}
|
|
6468
6437
|
function preparedSurfaceValue(spec, context) {
|
|
6469
6438
|
const index = context.preparedSurfaces;
|
|
6470
|
-
if (!index || index.palette !== context.palette || index.buttonSystem !== context.buttonSystem || index.colourIndex !== context.colourIndex) return void 0;
|
|
6439
|
+
if (!index || !preparedIndexOwners.has(index) || index.palette !== context.palette || index.buttonSystem !== context.buttonSystem || index.colourIndex !== context.colourIndex) return void 0;
|
|
6471
6440
|
return index.values[surfaceResolutionKey(spec, context)];
|
|
6472
6441
|
}
|
|
6473
6442
|
function surfaceResolutionKey(spec, context) {
|
|
@@ -6487,7 +6456,7 @@ function resolveSurfaceSpec(spec, context) {
|
|
|
6487
6456
|
switch (spec.kind) {
|
|
6488
6457
|
case "recipe": return resolveRecipeSurface(spec.intent, context);
|
|
6489
6458
|
case "paint": return spec.paint.kind === "transparent" ? { kind: "inherit" } : resolveOwnedSurface(spec.paint, context);
|
|
6490
|
-
case "token": return
|
|
6459
|
+
case "token": return resolveDeclaredSolidSurface({
|
|
6491
6460
|
kind: "solid",
|
|
6492
6461
|
token: spec.token
|
|
6493
6462
|
}, {
|
|
@@ -6506,31 +6475,18 @@ function resolveRecipeSurface(intent, context) {
|
|
|
6506
6475
|
surface: intent,
|
|
6507
6476
|
palette: context.palette
|
|
6508
6477
|
});
|
|
6509
|
-
const recipe = result.kind === "resolved-accessible-surface" ? result :
|
|
6478
|
+
const recipe = result.kind === "resolved-accessible-surface" ? result : missingBackgroundSurface({
|
|
6510
6479
|
surface: intent,
|
|
6511
6480
|
rejectedCandidates: result.rejectedCandidates
|
|
6512
6481
|
});
|
|
6513
6482
|
if (recipe.background.inherited) return { kind: "inherit" };
|
|
6514
|
-
|
|
6515
|
-
|
|
6516
|
-
|
|
6517
|
-
|
|
6518
|
-
|
|
6519
|
-
|
|
6520
|
-
|
|
6521
|
-
}),
|
|
6522
|
-
paint: {
|
|
6523
|
-
kind: "solid",
|
|
6524
|
-
token: recipe.background.token
|
|
6525
|
-
}
|
|
6526
|
-
};
|
|
6527
|
-
return result.kind === "accessible-surface-resolution-failure" ? {
|
|
6528
|
-
...solid,
|
|
6529
|
-
contrast: {
|
|
6530
|
-
kind: "terminal-fallback",
|
|
6531
|
-
failure: result
|
|
6532
|
-
}
|
|
6533
|
-
} : solid;
|
|
6483
|
+
return resolveDeclaredSolidSurface({
|
|
6484
|
+
kind: "solid",
|
|
6485
|
+
token: recipe.background.token
|
|
6486
|
+
}, {
|
|
6487
|
+
...context,
|
|
6488
|
+
foreground: recipeForegroundCandidates(recipe, context)
|
|
6489
|
+
});
|
|
6534
6490
|
}
|
|
6535
6491
|
/** Style rules replace recipe candidates before the shared foreground check. */
|
|
6536
6492
|
function recipeForegroundCandidates(recipe, context) {
|
|
@@ -6543,27 +6499,50 @@ function recipeForegroundCandidates(recipe, context) {
|
|
|
6543
6499
|
linkHover: candidates.linkHover ?? context.linkHoverToken
|
|
6544
6500
|
};
|
|
6545
6501
|
}
|
|
6546
|
-
|
|
6502
|
+
/** Declared grounds are parsed once; legacy stored paints use the unmeasured value arm. */
|
|
6503
|
+
function resolveDeclaredSolidSurface(paint, context) {
|
|
6504
|
+
return resolveOwnedSurface(paint, context, hexColorSchema.parse(resolveOpaqueSurfaceHex(paint.token, context.palette, context.compositeBase)));
|
|
6505
|
+
}
|
|
6506
|
+
function resolveOwnedSurface(paint, context, measuredBackdrop) {
|
|
6547
6507
|
const text = paint.foregroundToken ?? "text";
|
|
6548
|
-
const
|
|
6508
|
+
const background = paint.kind === "solid" ? {
|
|
6549
6509
|
type: "color",
|
|
6550
6510
|
color: paint.token,
|
|
6551
6511
|
textColor: text
|
|
6552
6512
|
} : {
|
|
6553
6513
|
type: "gradient",
|
|
6554
6514
|
textColor: text
|
|
6555
|
-
}
|
|
6515
|
+
};
|
|
6516
|
+
const candidates = {
|
|
6556
6517
|
linkHover: context.linkHoverToken,
|
|
6557
6518
|
...context.foreground
|
|
6558
|
-
}
|
|
6559
|
-
|
|
6519
|
+
};
|
|
6520
|
+
const resolved = measuredBackdrop && background.type === "color" ? resolveSurfaceForeground(background, context.palette, candidates, { measuredBackdrop }) : resolveSurfaceForeground(background, context.palette, candidates, { compositeBase: context.compositeBase });
|
|
6521
|
+
const decision = {
|
|
6560
6522
|
kind: "owned",
|
|
6561
|
-
paint,
|
|
6562
6523
|
foreground: ownedForegroundRoles(resolved, text, context.foreground),
|
|
6563
6524
|
decorations: surfaceDecorationColors(resolved, context.palette),
|
|
6564
6525
|
hoverDecoration: resolved.kind === "known" ? resolved.hoverDecoration : "underline",
|
|
6565
|
-
buttonContext: resolveSurfaceButtons(paint, resolved, context)
|
|
6566
|
-
|
|
6526
|
+
buttonContext: resolveSurfaceButtons(paint, resolved, context)
|
|
6527
|
+
};
|
|
6528
|
+
if (paint.kind === "gradient") return {
|
|
6529
|
+
...decision,
|
|
6530
|
+
paint,
|
|
6531
|
+
contrast: { kind: "unmeasured" }
|
|
6532
|
+
};
|
|
6533
|
+
const contrast = surfaceContrast(resolved, context.palette, context.colourIndex);
|
|
6534
|
+
return contrast.kind === "measured" ? {
|
|
6535
|
+
...decision,
|
|
6536
|
+
paint,
|
|
6537
|
+
contrast
|
|
6538
|
+
} : {
|
|
6539
|
+
...decision,
|
|
6540
|
+
paint,
|
|
6541
|
+
contrast: {
|
|
6542
|
+
kind: "unmeasured",
|
|
6543
|
+
reason: "legacy-unresolvable-solid",
|
|
6544
|
+
source: "paint"
|
|
6545
|
+
}
|
|
6567
6546
|
};
|
|
6568
6547
|
}
|
|
6569
6548
|
/** Unprovable legacy paint retains its declared foreground instead of inventing one. */
|
|
@@ -6590,6 +6569,7 @@ function resolveSurfaceButtons(paint, foreground, context) {
|
|
|
6590
6569
|
palette: context.palette,
|
|
6591
6570
|
colourIndex: context.colourIndex,
|
|
6592
6571
|
buttonSystem: context.buttonSystem,
|
|
6572
|
+
fallbackToken: context.compositeBase,
|
|
6593
6573
|
primaryToken: context.buttonContext?.primary ?? (paint.kind === "solid" ? context.buttonSystem?.surfaceContexts?.[paint.token]?.primary : void 0),
|
|
6594
6574
|
withoutButtonSystem: "reset"
|
|
6595
6575
|
});
|
|
@@ -6597,7 +6577,7 @@ function resolveSurfaceButtons(paint, foreground, context) {
|
|
|
6597
6577
|
function surfaceContrast(foreground, palette, colourIndex) {
|
|
6598
6578
|
if (foreground.kind !== "known" || foreground.provenance.kind !== "measured") return { kind: "unmeasured" };
|
|
6599
6579
|
const backdrop = foreground.provenance.backdropHex;
|
|
6600
|
-
const ratio = (token) => contrastRatio(
|
|
6580
|
+
const ratio = (token) => contrastRatio(resolveOpaqueSurfaceHex(token, palette, backdrop) ?? backdrop, backdrop, colourIndex);
|
|
6601
6581
|
return {
|
|
6602
6582
|
kind: "measured",
|
|
6603
6583
|
ratios: {
|
|
@@ -6616,24 +6596,35 @@ function resolveSectionSurface(background, context) {
|
|
|
6616
6596
|
linkHover: context.linkHoverToken,
|
|
6617
6597
|
...context.foreground
|
|
6618
6598
|
}, { compositeBase: context.compositeBase });
|
|
6619
|
-
|
|
6599
|
+
const surface = background === null ? { kind: "inherit" } : background.type === "color" ? {
|
|
6600
|
+
kind: "solid",
|
|
6601
|
+
color: background.color,
|
|
6602
|
+
composited: false,
|
|
6603
|
+
foreground: foreground.kind === "known" ? foreground.roles.link : void 0
|
|
6604
|
+
} : background.type === "gradient" ? { kind: "gradient" } : { kind: "image" };
|
|
6605
|
+
const revision = ownSurfaceRevision(context);
|
|
6606
|
+
const result = {
|
|
6620
6607
|
kind: "section",
|
|
6621
6608
|
foreground,
|
|
6622
6609
|
buttonStyles: resolveSurfaceButtonContext({
|
|
6623
|
-
surface
|
|
6624
|
-
|
|
6625
|
-
|
|
6626
|
-
composited: false,
|
|
6627
|
-
foreground: foreground.kind === "known" ? foreground.roles.link : void 0
|
|
6628
|
-
} : background.type === "gradient" ? { kind: "gradient" } : { kind: "image" },
|
|
6629
|
-
palette: context.palette,
|
|
6630
|
-
colourIndex: context.colourIndex,
|
|
6631
|
-
buttonSystem: context.buttonSystem,
|
|
6610
|
+
surface,
|
|
6611
|
+
palette: revision.palette,
|
|
6612
|
+
buttonSystem: revision.buttonSystem,
|
|
6632
6613
|
primaryToken: sectionPrimaryButtonToken(background, context),
|
|
6633
6614
|
fallbackToken: context.compositeBase,
|
|
6634
6615
|
withoutButtonSystem: "inherit"
|
|
6635
|
-
}).styles
|
|
6616
|
+
}).styles,
|
|
6617
|
+
proof: sectionProof(background, foreground),
|
|
6618
|
+
revision,
|
|
6619
|
+
textPolicy: surfaceTextPolicy,
|
|
6620
|
+
[resolvedSurfaceBrand]: true
|
|
6636
6621
|
};
|
|
6622
|
+
Object.defineProperties(result, {
|
|
6623
|
+
proof: { enumerable: false },
|
|
6624
|
+
revision: { enumerable: false },
|
|
6625
|
+
textPolicy: { enumerable: false }
|
|
6626
|
+
});
|
|
6627
|
+
return freezeOwnedThemeValue(result);
|
|
6637
6628
|
}
|
|
6638
6629
|
function sectionPrimaryButtonToken(background, context) {
|
|
6639
6630
|
if (background?.type !== "color" || typeof background.color !== "string") return void 0;
|
|
@@ -6651,28 +6642,829 @@ function resolveTintSurface(spec, context) {
|
|
|
6651
6642
|
kind: "token",
|
|
6652
6643
|
token: spec.base
|
|
6653
6644
|
}, context);
|
|
6654
|
-
if (base.kind !== "owned") throw new Error(`Cannot derive tint on ${spec.base}`);
|
|
6655
6645
|
const source = spec.source === "text" ? base.foreground.text : base.decorations?.mark;
|
|
6656
6646
|
const token = source ? resolveOpaqueSurfaceHex(`${source}/${spec.opacity}`, context.palette, spec.base) : null;
|
|
6657
6647
|
const hex = source ? resolveConcreteColorHex(source, context.palette) : null;
|
|
6658
6648
|
const tinted = token ?? (hex ? resolveOpaqueSurfaceHex(hexToRgba(hex, spec.opacity / 100), context.palette, spec.base) : null);
|
|
6659
6649
|
if (!tinted) throw new Error(`Cannot derive tint on ${spec.base}`);
|
|
6660
|
-
const
|
|
6650
|
+
const solid = resolveDeclaredSolidSurface({
|
|
6661
6651
|
kind: "solid",
|
|
6662
6652
|
token: tinted
|
|
6663
6653
|
}, {
|
|
6664
6654
|
...context,
|
|
6665
6655
|
foreground: base.foreground
|
|
6666
6656
|
});
|
|
6667
|
-
|
|
6668
|
-
|
|
6657
|
+
if (spec.gradient !== "radial") return solid;
|
|
6658
|
+
assertTintSamples(solid, spec.base, context.palette);
|
|
6659
|
+
return {
|
|
6660
|
+
...solid,
|
|
6669
6661
|
tintBase: spec.base
|
|
6670
|
-
}
|
|
6662
|
+
};
|
|
6663
|
+
}
|
|
6664
|
+
/** A sampled gradient may never borrow a proof for just its painted endpoint. */
|
|
6665
|
+
function assertTintSamples(surface, base, palette) {
|
|
6666
|
+
const paint = resolveOpaqueSurfaceHex(surface.paint.token, palette, base);
|
|
6667
|
+
const underlay = resolveOpaqueSurfaceHex(base, palette, "background");
|
|
6668
|
+
if (!paint || !underlay) throw new Error("Tint needs a measurable underlay");
|
|
6669
|
+
const samples = [
|
|
6670
|
+
0,
|
|
6671
|
+
.25,
|
|
6672
|
+
.5,
|
|
6673
|
+
.75,
|
|
6674
|
+
1
|
|
6675
|
+
].map((alpha) => compositeHex(paint, alpha, underlay));
|
|
6676
|
+
Object.entries(surface.foreground).forEach(([role, token]) => {
|
|
6677
|
+
if (!samples.every((sample) => {
|
|
6678
|
+
const ink = resolveOpaqueSurfaceHex(token, palette, sample);
|
|
6679
|
+
return ink !== null && contrastRatio(ink, sample) >= (role === "heading" ? 3 : 4.5);
|
|
6680
|
+
})) throw new RangeError(`No checked tint gradient for ${role} on ${base}`);
|
|
6681
|
+
});
|
|
6671
6682
|
}
|
|
6672
6683
|
function hexToRgba(hex, alpha) {
|
|
6673
6684
|
const { r, g, b } = hexToRgb(hex);
|
|
6674
6685
|
return `rgba(${r}, ${g}, ${b}, ${alpha})`;
|
|
6675
6686
|
}
|
|
6687
|
+
const foregroundInputSchema = z.object({
|
|
6688
|
+
text: z.string().nullable().optional(),
|
|
6689
|
+
heading: z.string().nullable().optional(),
|
|
6690
|
+
link: z.string().nullable().optional(),
|
|
6691
|
+
linkHover: z.string().nullable().optional(),
|
|
6692
|
+
supporting: z.string().nullable().optional()
|
|
6693
|
+
});
|
|
6694
|
+
const paintInputSchema = z.discriminatedUnion("kind", [
|
|
6695
|
+
z.object({
|
|
6696
|
+
kind: z.literal("solid"),
|
|
6697
|
+
token: z.string(),
|
|
6698
|
+
foregroundToken: z.string().optional()
|
|
6699
|
+
}),
|
|
6700
|
+
z.object({
|
|
6701
|
+
kind: z.literal("gradient"),
|
|
6702
|
+
foregroundToken: z.string().optional()
|
|
6703
|
+
}),
|
|
6704
|
+
z.object({ kind: z.literal("transparent") })
|
|
6705
|
+
]);
|
|
6706
|
+
const buttonInputSchema = z.object({ primary: opaqueButtonColourTokenSchema });
|
|
6707
|
+
const surfaceSpecSchema = z.discriminatedUnion("kind", [
|
|
6708
|
+
z.object({
|
|
6709
|
+
kind: z.literal("recipe"),
|
|
6710
|
+
intent: z.enum([
|
|
6711
|
+
"base",
|
|
6712
|
+
"muted-band",
|
|
6713
|
+
"accent-band",
|
|
6714
|
+
"brand-depth-band"
|
|
6715
|
+
])
|
|
6716
|
+
}),
|
|
6717
|
+
z.object({
|
|
6718
|
+
kind: z.literal("paint"),
|
|
6719
|
+
paint: paintInputSchema
|
|
6720
|
+
}),
|
|
6721
|
+
z.object({
|
|
6722
|
+
kind: z.literal("token"),
|
|
6723
|
+
token: z.string(),
|
|
6724
|
+
foreground: foregroundInputSchema.optional(),
|
|
6725
|
+
buttonContext: buttonInputSchema.optional()
|
|
6726
|
+
}),
|
|
6727
|
+
z.object({
|
|
6728
|
+
kind: z.literal("tint"),
|
|
6729
|
+
base: z.string(),
|
|
6730
|
+
source: z.enum(["text", "mark"]),
|
|
6731
|
+
opacity: z.number().finite(),
|
|
6732
|
+
gradient: z.literal("radial").optional()
|
|
6733
|
+
})
|
|
6734
|
+
]);
|
|
6735
|
+
const surfaceTransportSchema = z.object({ $surface: z.object({
|
|
6736
|
+
spec: surfaceSpecSchema,
|
|
6737
|
+
context: z.object({
|
|
6738
|
+
palette: z.record(z.string(), z.string()),
|
|
6739
|
+
buttonSystem: buttonSystemSchema.optional(),
|
|
6740
|
+
foreground: foregroundInputSchema.optional(),
|
|
6741
|
+
linkHoverToken: z.string().optional(),
|
|
6742
|
+
compositeBase: z.string().optional(),
|
|
6743
|
+
buttonContext: buttonInputSchema.optional()
|
|
6744
|
+
})
|
|
6745
|
+
}) });
|
|
6746
|
+
/** Deserialised output is never evidence: parse the inputs and rerun their owner. */
|
|
6747
|
+
function parseResolvedSurface(value) {
|
|
6748
|
+
if (isResolvedSurface(value)) return value;
|
|
6749
|
+
const { spec, context } = surfaceTransportSchema.parse(value).$surface;
|
|
6750
|
+
return resolveSurface(spec, {
|
|
6751
|
+
...context,
|
|
6752
|
+
buttonSystem: context.buttonSystem
|
|
6753
|
+
});
|
|
6754
|
+
}
|
|
6755
|
+
/** Wire only the owner inputs; parsed CSS/results are recomputed, never trusted. */
|
|
6756
|
+
function serializeResolvedSurface(surface) {
|
|
6757
|
+
requireResolvedSurface(surface);
|
|
6758
|
+
const inputs = surfaceTransports.get(surface);
|
|
6759
|
+
if (!inputs) throw new Error("Missing surface inputs");
|
|
6760
|
+
return { $surface: inputs };
|
|
6761
|
+
}
|
|
6762
|
+
function certifySurface(spec, context) {
|
|
6763
|
+
const revision = ownSurfaceRevision(context);
|
|
6764
|
+
const inputs = {
|
|
6765
|
+
spec: ownedThemeSnapshot(spec),
|
|
6766
|
+
context: Object.freeze({
|
|
6767
|
+
...revision,
|
|
6768
|
+
...ownedThemeSnapshot({
|
|
6769
|
+
foreground: context.foreground,
|
|
6770
|
+
linkHoverToken: context.linkHoverToken,
|
|
6771
|
+
compositeBase: context.compositeBase,
|
|
6772
|
+
buttonContext: context.buttonContext
|
|
6773
|
+
})
|
|
6774
|
+
})
|
|
6775
|
+
};
|
|
6776
|
+
const decision = resolveSurfaceSpec(inputs.spec, inputs.context);
|
|
6777
|
+
const result = Object.assign(decision, {
|
|
6778
|
+
[resolvedSurfaceBrand]: true,
|
|
6779
|
+
proof: surfaceProof(decision, spec),
|
|
6780
|
+
revision,
|
|
6781
|
+
textPolicy: surfaceTextPolicy,
|
|
6782
|
+
$surface: inputs
|
|
6783
|
+
});
|
|
6784
|
+
Object.defineProperties(result, {
|
|
6785
|
+
proof: { enumerable: false },
|
|
6786
|
+
revision: { enumerable: false },
|
|
6787
|
+
textPolicy: { enumerable: false }
|
|
6788
|
+
});
|
|
6789
|
+
surfaceOwners.add(result);
|
|
6790
|
+
surfaceTransports.set(result, inputs);
|
|
6791
|
+
return freezeOwnedThemeValue(result);
|
|
6792
|
+
}
|
|
6793
|
+
function surfaceProof(decision, spec) {
|
|
6794
|
+
if (decision.kind === "inherit") return "inherit";
|
|
6795
|
+
if (decision.contrast.kind === "unmeasured") return "unproven-media";
|
|
6796
|
+
if (spec.kind === "tint") return spec.gradient === "radial" ? "checked-gradient-or-scrim" : "checked-composited";
|
|
6797
|
+
return decision.paint.kind === "solid" && /\/|rgba\(/.test(decision.paint.token) ? "checked-composited" : "checked-solid";
|
|
6798
|
+
}
|
|
6799
|
+
function sectionProof(background, foreground) {
|
|
6800
|
+
if (background === null) return "inherit";
|
|
6801
|
+
if (foreground.kind !== "known" || foreground.provenance.kind !== "measured") return "unproven-media";
|
|
6802
|
+
return /\/|rgba\(/.test(background.color ?? "") ? "checked-composited" : "checked-solid";
|
|
6803
|
+
}
|
|
6804
|
+
/** One theme revision per JSON envelope, shared by all nested Look slots. */
|
|
6805
|
+
function serializeSurfaceTree(value) {
|
|
6806
|
+
const revisions = [];
|
|
6807
|
+
const indices = /* @__PURE__ */ new Map();
|
|
6808
|
+
const revisionIndex = (revision) => {
|
|
6809
|
+
const index = indices.get(revision) ?? revisions.length;
|
|
6810
|
+
if (!indices.has(revision)) {
|
|
6811
|
+
indices.set(revision, index);
|
|
6812
|
+
revisions.push(revision);
|
|
6813
|
+
}
|
|
6814
|
+
return index;
|
|
6815
|
+
};
|
|
6816
|
+
const encode = (item) => {
|
|
6817
|
+
const revision = isSurfaceTreeRecord(item) ? surfaceRevisionOwners.get(item) : void 0;
|
|
6818
|
+
if (revision) return { $surfaceRevision: revisionIndex(revision) };
|
|
6819
|
+
if (isResolvedSurface(item)) {
|
|
6820
|
+
const input = serializeResolvedSurface(item).$surface;
|
|
6821
|
+
const index = revisionIndex(item.revision);
|
|
6822
|
+
const { palette: _palette, buttonSystem: _buttons, ...context } = input.context;
|
|
6823
|
+
return { $surface: {
|
|
6824
|
+
spec: input.spec,
|
|
6825
|
+
context,
|
|
6826
|
+
revision: index
|
|
6827
|
+
} };
|
|
6828
|
+
}
|
|
6829
|
+
return mapSurfaceTreeChildren(item, encode);
|
|
6830
|
+
};
|
|
6831
|
+
const encoded = encode(value);
|
|
6832
|
+
return revisions.length === 0 ? encoded : { $surfaceTransport: {
|
|
6833
|
+
revisions,
|
|
6834
|
+
value: encoded
|
|
6835
|
+
} };
|
|
6836
|
+
}
|
|
6837
|
+
const surfaceEnvelopeSchema = z.object({ $surfaceTransport: z.object({
|
|
6838
|
+
revisions: z.array(z.object({
|
|
6839
|
+
palette: z.record(z.string(), z.string()),
|
|
6840
|
+
buttonSystem: buttonSystemSchema.optional()
|
|
6841
|
+
})),
|
|
6842
|
+
value: z.unknown()
|
|
6843
|
+
}) });
|
|
6844
|
+
const surfaceReferenceSchema = z.object({ $surface: z.object({
|
|
6845
|
+
spec: surfaceSpecSchema,
|
|
6846
|
+
revision: z.number().int().nonnegative(),
|
|
6847
|
+
context: z.object({
|
|
6848
|
+
foreground: foregroundInputSchema.optional(),
|
|
6849
|
+
linkHoverToken: z.string().optional(),
|
|
6850
|
+
compositeBase: z.string().optional(),
|
|
6851
|
+
buttonContext: buttonInputSchema.optional()
|
|
6852
|
+
})
|
|
6853
|
+
}) });
|
|
6854
|
+
const surfaceRevisionReferenceSchema = z.object({ $surfaceRevision: z.number().int().nonnegative() });
|
|
6855
|
+
/** Recreate owner results before any island's ordinary schema consumes them. */
|
|
6856
|
+
function parseSurfaceTree(value) {
|
|
6857
|
+
if (isSurfaceTransportLeaf(value)) return value;
|
|
6858
|
+
if (!isSurfaceTreeRecord(value) || !("$surfaceTransport" in value)) return mapSurfaceTreeChildren(value, parseSurfaceTree);
|
|
6859
|
+
const envelope = surfaceEnvelopeSchema.parse(value).$surfaceTransport;
|
|
6860
|
+
const revisions = envelope.revisions.map((revision) => {
|
|
6861
|
+
const owned = ownedThemeSnapshot({
|
|
6862
|
+
palette: revision.palette,
|
|
6863
|
+
buttonSystem: revision.buttonSystem
|
|
6864
|
+
});
|
|
6865
|
+
registerOwnedRevisionInputs(owned);
|
|
6866
|
+
return ownSurfaceRevision(owned);
|
|
6867
|
+
});
|
|
6868
|
+
const decode = (item) => {
|
|
6869
|
+
if (isSurfaceTreeRecord(item) && "$surfaceRevision" in item) {
|
|
6870
|
+
const revision = revisions[surfaceRevisionReferenceSchema.parse(item).$surfaceRevision];
|
|
6871
|
+
if (!revision) throw new Error("Unknown surface revision");
|
|
6872
|
+
return revision;
|
|
6873
|
+
}
|
|
6874
|
+
if (isSurfaceTreeRecord(item) && "$surface" in item) {
|
|
6875
|
+
const request = surfaceReferenceSchema.parse(item).$surface;
|
|
6876
|
+
const revision = revisions[request.revision];
|
|
6877
|
+
if (!revision) throw new Error("Unknown surface revision");
|
|
6878
|
+
return resolveSurface(request.spec, {
|
|
6879
|
+
...revision,
|
|
6880
|
+
...request.context,
|
|
6881
|
+
buttonSystem: revision.buttonSystem
|
|
6882
|
+
});
|
|
6883
|
+
}
|
|
6884
|
+
return mapSurfaceTreeChildren(item, decode);
|
|
6885
|
+
};
|
|
6886
|
+
return decode(envelope.value);
|
|
6887
|
+
}
|
|
6888
|
+
function isSurfaceTreeRecord(value) {
|
|
6889
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
6890
|
+
}
|
|
6891
|
+
function mapSurfaceTreeChildren(value, map) {
|
|
6892
|
+
if (Array.isArray(value)) return value.map(map);
|
|
6893
|
+
if (value instanceof Date) return value;
|
|
6894
|
+
return isSurfaceTreeRecord(value) ? Object.fromEntries(Object.entries(value).map(([key, item]) => [key, map(item)])) : value;
|
|
6895
|
+
}
|
|
6896
|
+
//#endregion
|
|
6897
|
+
//#region ../theme-core/src/surfaces/opaqueSurface.ts
|
|
6898
|
+
function opaqueSurfaceContextFromTheme(theme) {
|
|
6899
|
+
const palette = expandPalette(theme.palette);
|
|
6900
|
+
return {
|
|
6901
|
+
palette,
|
|
6902
|
+
colourIndex: preparePaletteColourIndex(palette),
|
|
6903
|
+
buttonSystem: theme.buttons,
|
|
6904
|
+
linkHoverToken: theme.typography.proseLinkStyle?.hoverColorToken
|
|
6905
|
+
};
|
|
6906
|
+
}
|
|
6907
|
+
/**
|
|
6908
|
+
* The declarations that make an element own its surface: `color`, every
|
|
6909
|
+
* `--rb-surface-*` role and every `--rb-action-*` variable. Card roles and
|
|
6910
|
+
* opaque block panels both publish through this, so a nested surface can never
|
|
6911
|
+
* inherit a band's light text or its band-resolved buttons.
|
|
6912
|
+
*/
|
|
6913
|
+
function opaqueSurfaceDeclarations(surface, arrangement = false) {
|
|
6914
|
+
requireResolvedSurface(surface);
|
|
6915
|
+
if (surface.kind === "inherit") return inheritedSurfaceDeclarations(arrangement);
|
|
6916
|
+
const foreground = surface.foreground;
|
|
6917
|
+
return [
|
|
6918
|
+
...surfaceForegroundDeclarations({
|
|
6919
|
+
text: colorValue(foreground.text),
|
|
6920
|
+
heading: colorValue(foreground.heading),
|
|
6921
|
+
link: colorValue(foreground.link),
|
|
6922
|
+
linkHover: colorValue(foreground.linkHover),
|
|
6923
|
+
supporting: colorValue(foreground.supporting),
|
|
6924
|
+
...arrangement ? { muted: colorValue(foreground.muted) } : {},
|
|
6925
|
+
hoverDecoration: surface.hoverDecoration
|
|
6926
|
+
}),
|
|
6927
|
+
...arrangement && surface.decorations !== void 0 ? [`${SURFACE_FOREGROUND_CSS_VARS.line}: ${surface.decorations.line};`, `${SURFACE_FOREGROUND_CSS_VARS.mark}: ${surface.decorations.mark};`] : [],
|
|
6928
|
+
...Object.entries(surface.buttonContext.styles).map(([property, value]) => `${property}: ${value};`)
|
|
6929
|
+
];
|
|
6930
|
+
}
|
|
6931
|
+
function colorValue(token) {
|
|
6932
|
+
const parsed = parseThemeColorToken(token);
|
|
6933
|
+
return parsed ? rgbColorValue(parsed) : token;
|
|
6934
|
+
}
|
|
6935
|
+
/** Every property a surface publishes, set to `inherit`. */
|
|
6936
|
+
function inheritedSurfaceDeclarations(arrangement) {
|
|
6937
|
+
return [
|
|
6938
|
+
"color",
|
|
6939
|
+
...Object.entries(SURFACE_FOREGROUND_CSS_VARS).filter(([role]) => arrangement || role !== "line" && role !== "mark" && role !== "muted").map(([, variable]) => variable),
|
|
6940
|
+
"--rb-surface-link-hover-decoration",
|
|
6941
|
+
...Object.keys(contextualButtonSurfaceResetStyles())
|
|
6942
|
+
].map((property) => `${property}: inherit;`);
|
|
6943
|
+
}
|
|
6944
|
+
//#endregion
|
|
6945
|
+
//#region ../theme-core/src/surfaces/mapDrawingTokens.ts
|
|
6946
|
+
/**
|
|
6947
|
+
* The one map token contract (issue 1611). Drawings carry semantic classes only;
|
|
6948
|
+
* these variables are the only colours a map receives. Each value is resolved
|
|
6949
|
+
* from the section ground the map sits on, so the same geometry reads on light,
|
|
6950
|
+
* brand and dark grounds without regeneration.
|
|
6951
|
+
*/
|
|
6952
|
+
const MAP_DRAWING_COLOUR_VARS = {
|
|
6953
|
+
land: "--map-land",
|
|
6954
|
+
water: "--map-water",
|
|
6955
|
+
park: "--map-park",
|
|
6956
|
+
building: "--map-building",
|
|
6957
|
+
buildingEdge: "--map-building-edge",
|
|
6958
|
+
road: "--map-road",
|
|
6959
|
+
roadCasing: "--map-road-casing",
|
|
6960
|
+
roadMajor: "--map-road-major",
|
|
6961
|
+
roadMajorCasing: "--map-road-major-casing",
|
|
6962
|
+
path: "--map-path",
|
|
6963
|
+
label: "--map-label",
|
|
6964
|
+
labelHalo: "--map-label-halo",
|
|
6965
|
+
pin: "--map-pin",
|
|
6966
|
+
pinEdge: "--map-pin-edge",
|
|
6967
|
+
frame: "--map-frame-color"
|
|
6968
|
+
};
|
|
6969
|
+
const MAP_DRAWING_SHAPE_VARS = {
|
|
6970
|
+
frameRadius: "--map-frame-radius",
|
|
6971
|
+
frameWidth: "--map-frame-width",
|
|
6972
|
+
frameShadow: "--map-frame-shadow",
|
|
6973
|
+
labelFont: "--map-label-font",
|
|
6974
|
+
labelWeight: "--map-label-weight",
|
|
6975
|
+
casingScale: "--map-casing-scale"
|
|
6976
|
+
};
|
|
6977
|
+
const defaultMapDrawingTreatment = {
|
|
6978
|
+
land: .035,
|
|
6979
|
+
water: {
|
|
6980
|
+
roles: [
|
|
6981
|
+
"primary",
|
|
6982
|
+
"accent",
|
|
6983
|
+
"secondary"
|
|
6984
|
+
],
|
|
6985
|
+
amount: .2
|
|
6986
|
+
},
|
|
6987
|
+
park: {
|
|
6988
|
+
roles: [
|
|
6989
|
+
"success",
|
|
6990
|
+
"secondary",
|
|
6991
|
+
"primary"
|
|
6992
|
+
],
|
|
6993
|
+
amount: .16
|
|
6994
|
+
},
|
|
6995
|
+
building: .09,
|
|
6996
|
+
buildingEdge: .17,
|
|
6997
|
+
roadLift: .7,
|
|
6998
|
+
casingSink: .2,
|
|
6999
|
+
majorRoad: {
|
|
7000
|
+
roles: ["accent", "primary"],
|
|
7001
|
+
amount: .16
|
|
7002
|
+
},
|
|
7003
|
+
path: .42,
|
|
7004
|
+
labelContrast: 6,
|
|
7005
|
+
pin: [
|
|
7006
|
+
"primary",
|
|
7007
|
+
"accent",
|
|
7008
|
+
"secondary"
|
|
7009
|
+
],
|
|
7010
|
+
frame: {
|
|
7011
|
+
radius: "var(--rb-block-radius, 8px)",
|
|
7012
|
+
width: "1px",
|
|
7013
|
+
shadow: "none",
|
|
7014
|
+
colour: .16
|
|
7015
|
+
},
|
|
7016
|
+
labelWeight: 500,
|
|
7017
|
+
casingScale: 1
|
|
7018
|
+
};
|
|
7019
|
+
/** Per arrangement style (keyed by its skin). Legacy themes without a skin use the default. */
|
|
7020
|
+
const mapDrawingTreatments = {
|
|
7021
|
+
fulcrum: {
|
|
7022
|
+
...defaultMapDrawingTreatment,
|
|
7023
|
+
land: .025,
|
|
7024
|
+
water: {
|
|
7025
|
+
roles: ["primary", "secondary"],
|
|
7026
|
+
amount: .2
|
|
7027
|
+
},
|
|
7028
|
+
park: {
|
|
7029
|
+
roles: ["success", "primary"],
|
|
7030
|
+
amount: .12
|
|
7031
|
+
},
|
|
7032
|
+
building: .07,
|
|
7033
|
+
buildingEdge: .14,
|
|
7034
|
+
casingSink: .16,
|
|
7035
|
+
majorRoad: {
|
|
7036
|
+
roles: ["accent"],
|
|
7037
|
+
amount: .12
|
|
7038
|
+
},
|
|
7039
|
+
pin: ["accent", "primary"],
|
|
7040
|
+
frame: {
|
|
7041
|
+
radius: "var(--rb-skin-radius, 3px)",
|
|
7042
|
+
width: "var(--rb-skin-rule, 1px)",
|
|
7043
|
+
shadow: "none",
|
|
7044
|
+
colour: .16
|
|
7045
|
+
}
|
|
7046
|
+
},
|
|
7047
|
+
poster: {
|
|
7048
|
+
...defaultMapDrawingTreatment,
|
|
7049
|
+
land: 0,
|
|
7050
|
+
water: {
|
|
7051
|
+
roles: ["primary", "secondary"],
|
|
7052
|
+
amount: .32
|
|
7053
|
+
},
|
|
7054
|
+
park: {
|
|
7055
|
+
roles: ["success", "accent"],
|
|
7056
|
+
amount: .26
|
|
7057
|
+
},
|
|
7058
|
+
building: .12,
|
|
7059
|
+
buildingEdge: .3,
|
|
7060
|
+
roadLift: 1,
|
|
7061
|
+
casingSink: .55,
|
|
7062
|
+
majorRoad: {
|
|
7063
|
+
roles: ["accent", "primary"],
|
|
7064
|
+
amount: .55
|
|
7065
|
+
},
|
|
7066
|
+
path: .7,
|
|
7067
|
+
labelContrast: 9,
|
|
7068
|
+
pin: ["primary", "accent"],
|
|
7069
|
+
frame: {
|
|
7070
|
+
radius: "var(--rb-skin-radius, 0px)",
|
|
7071
|
+
width: "var(--rb-skin-rule, 3px)",
|
|
7072
|
+
shadow: "offset",
|
|
7073
|
+
colour: 1
|
|
7074
|
+
},
|
|
7075
|
+
labelWeight: 600,
|
|
7076
|
+
casingScale: 1.15
|
|
7077
|
+
},
|
|
7078
|
+
lantern: {
|
|
7079
|
+
...defaultMapDrawingTreatment,
|
|
7080
|
+
land: .04,
|
|
7081
|
+
water: {
|
|
7082
|
+
roles: ["secondary", "primary"],
|
|
7083
|
+
amount: .22
|
|
7084
|
+
},
|
|
7085
|
+
park: {
|
|
7086
|
+
roles: ["success", "secondary"],
|
|
7087
|
+
amount: .14
|
|
7088
|
+
},
|
|
7089
|
+
building: .08,
|
|
7090
|
+
buildingEdge: .14,
|
|
7091
|
+
casingSink: .35,
|
|
7092
|
+
majorRoad: {
|
|
7093
|
+
roles: ["accent", "primary"],
|
|
7094
|
+
amount: .24
|
|
7095
|
+
},
|
|
7096
|
+
path: .4,
|
|
7097
|
+
pin: ["accent", "primary"],
|
|
7098
|
+
frame: {
|
|
7099
|
+
radius: "var(--rb-skin-radius, 10px)",
|
|
7100
|
+
width: "var(--rb-skin-rule, 1px)",
|
|
7101
|
+
shadow: "none",
|
|
7102
|
+
colour: .18
|
|
7103
|
+
}
|
|
7104
|
+
},
|
|
7105
|
+
measure: {
|
|
7106
|
+
...defaultMapDrawingTreatment,
|
|
7107
|
+
land: .03,
|
|
7108
|
+
water: {
|
|
7109
|
+
roles: ["accent", "primary"],
|
|
7110
|
+
amount: .16
|
|
7111
|
+
},
|
|
7112
|
+
park: {
|
|
7113
|
+
roles: ["success"],
|
|
7114
|
+
amount: .12
|
|
7115
|
+
},
|
|
7116
|
+
building: .1,
|
|
7117
|
+
buildingEdge: .2,
|
|
7118
|
+
casingSink: .26,
|
|
7119
|
+
majorRoad: {
|
|
7120
|
+
roles: ["accent"],
|
|
7121
|
+
amount: 0
|
|
7122
|
+
},
|
|
7123
|
+
path: .5,
|
|
7124
|
+
pin: ["accent", "primary"],
|
|
7125
|
+
frame: {
|
|
7126
|
+
radius: "var(--rb-skin-radius, 0px)",
|
|
7127
|
+
width: "var(--rb-skin-rule, 2px)",
|
|
7128
|
+
shadow: "none",
|
|
7129
|
+
colour: .6
|
|
7130
|
+
},
|
|
7131
|
+
labelWeight: 600
|
|
7132
|
+
},
|
|
7133
|
+
folio: {
|
|
7134
|
+
...defaultMapDrawingTreatment,
|
|
7135
|
+
land: .03,
|
|
7136
|
+
water: {
|
|
7137
|
+
roles: ["secondary", "primary"],
|
|
7138
|
+
amount: .18
|
|
7139
|
+
},
|
|
7140
|
+
park: {
|
|
7141
|
+
roles: ["success", "primary"],
|
|
7142
|
+
amount: .18
|
|
7143
|
+
},
|
|
7144
|
+
building: .08,
|
|
7145
|
+
buildingEdge: .15,
|
|
7146
|
+
casingSink: .18,
|
|
7147
|
+
majorRoad: {
|
|
7148
|
+
roles: ["accent"],
|
|
7149
|
+
amount: .14
|
|
7150
|
+
},
|
|
7151
|
+
pin: ["primary", "accent"],
|
|
7152
|
+
frame: {
|
|
7153
|
+
radius: "var(--rb-skin-radius, 10px)",
|
|
7154
|
+
width: "var(--rb-skin-rule, 1px)",
|
|
7155
|
+
shadow: "none",
|
|
7156
|
+
colour: .18
|
|
7157
|
+
}
|
|
7158
|
+
}
|
|
7159
|
+
};
|
|
7160
|
+
function mapDrawingTreatmentFor(skin) {
|
|
7161
|
+
return (skin === void 0 ? void 0 : mapDrawingTreatments[skin]) ?? defaultMapDrawingTreatment;
|
|
7162
|
+
}
|
|
7163
|
+
const toLab = (hex) => {
|
|
7164
|
+
const { r, g, b } = hexToRgb(hex);
|
|
7165
|
+
return srgbToOklab(r, g, b);
|
|
7166
|
+
};
|
|
7167
|
+
const toHex = ({ L, a, b }) => {
|
|
7168
|
+
const rgb = oklabToSrgb(L, a, b);
|
|
7169
|
+
return rgbToHex(rgb.r, rgb.g, rgb.b);
|
|
7170
|
+
};
|
|
7171
|
+
const blend = (from, to, t) => ({
|
|
7172
|
+
L: from.L + (to.L - from.L) * t,
|
|
7173
|
+
a: from.a + (to.a - from.a) * t,
|
|
7174
|
+
b: from.b + (to.b - from.b) * t
|
|
7175
|
+
});
|
|
7176
|
+
const distance = (x, y) => Math.hypot(x.L - y.L, x.a - y.a, x.b - y.b);
|
|
7177
|
+
/** A nearly neutral pole in the ground's hue, so lifts and sinks stay in the site's temperature. */
|
|
7178
|
+
function pole(ground, L) {
|
|
7179
|
+
const { C, h } = oklabToOklch(ground.L, ground.a, ground.b);
|
|
7180
|
+
return toLab(oklchToHexGamut(L, Math.min(C, .012), h));
|
|
7181
|
+
}
|
|
7182
|
+
/** The first blend from `from` toward `to` that reaches the contrast floor against every backdrop. */
|
|
7183
|
+
function firstContrastBlend(from, to, backdrops, floor) {
|
|
7184
|
+
return Array.from({ length: 41 }, (_, index) => toHex(blend(from, to, index / 40))).find((hex) => backdrops.every((backdrop) => contrastRatio(hex, backdrop) >= floor)) ?? toHex(to);
|
|
7185
|
+
}
|
|
7186
|
+
/** A tint must stand apart from what it is drawn on (a brand river on a brand band would vanish); else a step toward the ink. */
|
|
7187
|
+
function tint(base, spec, palette, ink) {
|
|
7188
|
+
return spec.roles.flatMap((role) => {
|
|
7189
|
+
const hex = resolveConcreteColorHex(role, palette);
|
|
7190
|
+
return hex ? [blend(base, toLab(hex), spec.amount)] : [];
|
|
7191
|
+
}).find((candidate) => distance(candidate, base) >= .025) ?? blend(base, ink, Math.max(spec.amount * .6, .06));
|
|
7192
|
+
}
|
|
7193
|
+
/** Pure: one ground, one ink, one palette and one treatment decide every map colour. */
|
|
7194
|
+
function resolveMapDrawingColours(input) {
|
|
7195
|
+
const { treatment: t, palette } = input;
|
|
7196
|
+
const ground = toLab(input.ground);
|
|
7197
|
+
const ink = toLab(input.ink);
|
|
7198
|
+
const darkGround = ink.L > ground.L;
|
|
7199
|
+
const light = darkGround ? blend(ground, ink, .22) : pole(ground, Math.max(ground.L, .995));
|
|
7200
|
+
const dark = darkGround ? pole(ground, Math.max(ground.L - .22, .04)) : ink;
|
|
7201
|
+
const tinted = blend(ground, ink, t.land);
|
|
7202
|
+
const land = contrastRatio(toHex(tinted), input.ink) >= 4.5 ? tinted : ground;
|
|
7203
|
+
const landHex = toHex(land);
|
|
7204
|
+
const road = blend(land, light, t.roadLift);
|
|
7205
|
+
const casing = blend(land, dark, t.casingSink);
|
|
7206
|
+
const building = blend(land, ink, t.building);
|
|
7207
|
+
const majorTint = t.majorRoad.amount === 0 ? road : tint(road, t.majorRoad, palette, ink);
|
|
7208
|
+
const pinBackdrops = [
|
|
7209
|
+
landHex,
|
|
7210
|
+
toHex(road),
|
|
7211
|
+
toHex(building)
|
|
7212
|
+
];
|
|
7213
|
+
const pinRoles = t.pin.flatMap((role) => {
|
|
7214
|
+
const hex = resolveConcreteColorHex(role, palette);
|
|
7215
|
+
return hex ? [hex] : [];
|
|
7216
|
+
});
|
|
7217
|
+
const pin = [...pinRoles, input.ink].find((hex) => pinBackdrops.every((backdrop) => contrastRatio(hex, backdrop) >= 3)) ?? firstContrastBlend(toLab(pinRoles[0] ?? input.ink), ink, pinBackdrops, 3);
|
|
7218
|
+
const pinEdge = [
|
|
7219
|
+
toHex(light),
|
|
7220
|
+
toHex(dark),
|
|
7221
|
+
landHex
|
|
7222
|
+
].reduce((best, hex) => contrastRatio(hex, pin) > contrastRatio(best, pin) ? hex : best);
|
|
7223
|
+
return {
|
|
7224
|
+
land: landHex,
|
|
7225
|
+
water: toHex(tint(land, t.water, palette, ink)),
|
|
7226
|
+
park: toHex(tint(land, t.park, palette, ink)),
|
|
7227
|
+
building: toHex(building),
|
|
7228
|
+
buildingEdge: toHex(blend(land, ink, t.buildingEdge)),
|
|
7229
|
+
road: toHex(road),
|
|
7230
|
+
roadCasing: toHex(casing),
|
|
7231
|
+
roadMajor: toHex(majorTint),
|
|
7232
|
+
roadMajorCasing: toHex(blend(casing, dark, .15)),
|
|
7233
|
+
path: toHex(blend(land, ink, t.path)),
|
|
7234
|
+
label: firstContrastBlend(land, ink, [landHex], Math.max(4.5, t.labelContrast)),
|
|
7235
|
+
labelHalo: landHex,
|
|
7236
|
+
pin,
|
|
7237
|
+
pinEdge,
|
|
7238
|
+
frame: toHex(blend(ground, ink, t.frame.colour))
|
|
7239
|
+
};
|
|
7240
|
+
}
|
|
7241
|
+
function mapDrawingShapeStyle(treatment) {
|
|
7242
|
+
return {
|
|
7243
|
+
[MAP_DRAWING_SHAPE_VARS.frameRadius]: treatment.frame.radius,
|
|
7244
|
+
[MAP_DRAWING_SHAPE_VARS.frameWidth]: treatment.frame.width,
|
|
7245
|
+
[MAP_DRAWING_SHAPE_VARS.frameShadow]: treatment.frame.shadow === "offset" ? `var(--rb-skin-shadow-offset, 6px) var(--rb-skin-shadow-offset, 6px) 0 var(${MAP_DRAWING_COLOUR_VARS.frame})` : "none",
|
|
7246
|
+
[MAP_DRAWING_SHAPE_VARS.labelFont]: "var(--font-body, system-ui, sans-serif)",
|
|
7247
|
+
[MAP_DRAWING_SHAPE_VARS.labelWeight]: String(treatment.labelWeight),
|
|
7248
|
+
[MAP_DRAWING_SHAPE_VARS.casingScale]: String(treatment.casingScale)
|
|
7249
|
+
};
|
|
7250
|
+
}
|
|
7251
|
+
/**
|
|
7252
|
+
* Everything a map needs from the section it sits on. Unmeasured grounds
|
|
7253
|
+
* (photos, gradients) keep the structural fallbacks for colour; the style's
|
|
7254
|
+
* shape still applies.
|
|
7255
|
+
*/
|
|
7256
|
+
function mapDrawingStyle(input) {
|
|
7257
|
+
const treatment = mapDrawingTreatmentFor(input.skin);
|
|
7258
|
+
const shape = mapDrawingShapeStyle(treatment);
|
|
7259
|
+
if (input.foreground.kind !== "known" || input.foreground.provenance.kind !== "measured") return shape;
|
|
7260
|
+
const ink = resolveConcreteColorHex(input.foreground.roles.text, input.palette);
|
|
7261
|
+
if (ink === null) return shape;
|
|
7262
|
+
const colours = resolveMapDrawingColours({
|
|
7263
|
+
ground: input.foreground.provenance.backdropHex,
|
|
7264
|
+
ink,
|
|
7265
|
+
palette: input.palette,
|
|
7266
|
+
treatment
|
|
7267
|
+
});
|
|
7268
|
+
return {
|
|
7269
|
+
...shape,
|
|
7270
|
+
...Object.fromEntries(Object.entries(colours).map(([role, value]) => [MAP_DRAWING_COLOUR_VARS[role], value]))
|
|
7271
|
+
};
|
|
7272
|
+
}
|
|
7273
|
+
//#endregion
|
|
7274
|
+
//#region ../theme-core/src/utils/colorStyles.ts
|
|
7275
|
+
const COLOR_VAR_PREFIX = "--tb-";
|
|
7276
|
+
function parseToken(source) {
|
|
7277
|
+
const parts = parseColorTokenParts(source);
|
|
7278
|
+
if (parts.kind === "raw") return {
|
|
7279
|
+
token: source,
|
|
7280
|
+
raw: parts.value
|
|
7281
|
+
};
|
|
7282
|
+
if (parts.kind === "invalid") return { token: source };
|
|
7283
|
+
return {
|
|
7284
|
+
token: parts.token,
|
|
7285
|
+
opacityPercent: parts.opacityPercent === null ? void 0 : parts.opacityPercent
|
|
7286
|
+
};
|
|
7287
|
+
}
|
|
7288
|
+
const SURFACE_TEXT_ROLE_BY_TOKEN = {
|
|
7289
|
+
text: "text",
|
|
7290
|
+
heading: "heading",
|
|
7291
|
+
mutedText: "supporting"
|
|
7292
|
+
};
|
|
7293
|
+
function surfaceRoleForTextToken(token) {
|
|
7294
|
+
return Object.prototype.hasOwnProperty.call(SURFACE_TEXT_ROLE_BY_TOKEN, token) ? SURFACE_TEXT_ROLE_BY_TOKEN[token] : null;
|
|
7295
|
+
}
|
|
7296
|
+
/**
|
|
7297
|
+
* Converts a theme color token to a CSS rgb value.
|
|
7298
|
+
* This is the primary function for applying theme colors to CSS properties.
|
|
7299
|
+
*
|
|
7300
|
+
* @param token - Theme color token (semantic, with opacity, or raw)
|
|
7301
|
+
* @returns CSS color value (rgb with optional alpha, or raw CSS value)
|
|
7302
|
+
*
|
|
7303
|
+
* @example
|
|
7304
|
+
* rgbColorValue('primary') // => 'rgb(var(--tb-primary))'
|
|
7305
|
+
* rgbColorValue('surface/95') // => 'rgb(var(--tb-surface) / 0.95)'
|
|
7306
|
+
* rgbColorValue('raw:transparent') // => 'transparent'
|
|
7307
|
+
*/
|
|
7308
|
+
function rgbColorValue(token) {
|
|
7309
|
+
const { token: baseToken, opacityPercent, raw } = parseToken(token);
|
|
7310
|
+
if (raw) return raw;
|
|
7311
|
+
const cssVar = `${COLOR_VAR_PREFIX}${baseToken}`;
|
|
7312
|
+
if (opacityPercent === void 0) return `rgb(var(${cssVar}))`;
|
|
7313
|
+
return `rgb(var(${cssVar}) / ${opacityPercent / 100})`;
|
|
7314
|
+
}
|
|
7315
|
+
/**
|
|
7316
|
+
* Converts a theme color token to a CSS variable reference.
|
|
7317
|
+
* Note: This returns the base variable without rgb() wrapper, ignoring opacity.
|
|
7318
|
+
*
|
|
7319
|
+
* @param token - Theme color token
|
|
7320
|
+
* @returns CSS variable reference
|
|
7321
|
+
*
|
|
7322
|
+
* @example
|
|
7323
|
+
* cssVarValue('primary') // => 'var(--tb-primary)'
|
|
7324
|
+
* cssVarValue('surface/95') // => 'var(--tb-surface)' (opacity ignored)
|
|
7325
|
+
*/
|
|
7326
|
+
function cssVarValue(token) {
|
|
7327
|
+
const { token: baseToken } = parseToken(token);
|
|
7328
|
+
return `var(${COLOR_VAR_PREFIX}${baseToken})`;
|
|
7329
|
+
}
|
|
7330
|
+
/**
|
|
7331
|
+
* Creates a backgroundColor style object from a theme token.
|
|
7332
|
+
*
|
|
7333
|
+
* @param token - Theme color token
|
|
7334
|
+
* @returns CSSProperties with backgroundColor
|
|
7335
|
+
*/
|
|
7336
|
+
function backgroundColorStyle(token) {
|
|
7337
|
+
return { backgroundColor: rgbColorValue(token) };
|
|
7338
|
+
}
|
|
7339
|
+
/**
|
|
7340
|
+
* Converts a text color token to a CSS color value that follows the enclosing
|
|
7341
|
+
* surface. The semantic text tokens (`text`, `heading`, `mutedText`) resolve
|
|
7342
|
+
* to the surface foreground variables, so text adapts when a section's
|
|
7343
|
+
* background changes; any other token is a fixed theme color.
|
|
7344
|
+
*
|
|
7345
|
+
* @param token - Theme color token
|
|
7346
|
+
* @returns CSS color value
|
|
7347
|
+
*/
|
|
7348
|
+
function textColorValue(token) {
|
|
7349
|
+
const parsed = parseToken(token);
|
|
7350
|
+
const surfaceRole = parsed.raw ? null : surfaceRoleForTextToken(parsed.token);
|
|
7351
|
+
if (!surfaceRole) return rgbColorValue(token);
|
|
7352
|
+
return parsed.opacityPercent === void 0 ? surfaceForegroundValue(surfaceRole) : surfaceForegroundValueWithOpacity(surfaceRole, parsed.opacityPercent);
|
|
7353
|
+
}
|
|
7354
|
+
/**
|
|
7355
|
+
* Creates a text color style object from a theme token.
|
|
7356
|
+
*
|
|
7357
|
+
* @param token - Theme color token
|
|
7358
|
+
* @returns CSSProperties with color
|
|
7359
|
+
*/
|
|
7360
|
+
function textColorStyle(token) {
|
|
7361
|
+
return { color: textColorValue(token) };
|
|
7362
|
+
}
|
|
7363
|
+
/**
|
|
7364
|
+
* Creates a border color style object from a theme token.
|
|
7365
|
+
*
|
|
7366
|
+
* @param token - Theme color token
|
|
7367
|
+
* @returns CSSProperties with borderColor
|
|
7368
|
+
*/
|
|
7369
|
+
function borderColorStyle(token) {
|
|
7370
|
+
return { borderColor: rgbColorValue(token) };
|
|
7371
|
+
}
|
|
7372
|
+
/**
|
|
7373
|
+
* Merges multiple CSSProperties objects into a single object.
|
|
7374
|
+
* Later styles override earlier ones. Undefined values are filtered out.
|
|
7375
|
+
* Returns undefined if the merged result is empty.
|
|
7376
|
+
*
|
|
7377
|
+
* @param styles - Variable number of CSSProperties objects (can be undefined)
|
|
7378
|
+
* @returns Merged CSSProperties object, or undefined if empty
|
|
7379
|
+
*
|
|
7380
|
+
* @example
|
|
7381
|
+
* mergeStyles(
|
|
7382
|
+
* backgroundColorStyle('surface'),
|
|
7383
|
+
* textColorStyle('text'),
|
|
7384
|
+
* borderColorStyle('border')
|
|
7385
|
+
* )
|
|
7386
|
+
* // => { backgroundColor: '...', color: '...', borderColor: '...' }
|
|
7387
|
+
*/
|
|
7388
|
+
function mergeStyles(...styles) {
|
|
7389
|
+
const merged = {};
|
|
7390
|
+
for (const style of styles) {
|
|
7391
|
+
if (!style) continue;
|
|
7392
|
+
Object.assign(merged, style);
|
|
7393
|
+
}
|
|
7394
|
+
return Object.keys(merged).length ? merged : void 0;
|
|
7395
|
+
}
|
|
7396
|
+
//#endregion
|
|
7397
|
+
//#region ../theme-core/src/tokens/resolver.ts
|
|
7398
|
+
/**
|
|
7399
|
+
* Resolves theme tokens to CSS variables
|
|
7400
|
+
*
|
|
7401
|
+
* This resolver ensures all button styles use theme tokens (not hardcoded colors)
|
|
7402
|
+
* so that changing the palette automatically updates all buttons.
|
|
7403
|
+
*/
|
|
7404
|
+
var TokenResolver = class {
|
|
7405
|
+
constructor(theme) {
|
|
7406
|
+
this.theme = theme;
|
|
7407
|
+
}
|
|
7408
|
+
/**
|
|
7409
|
+
* Resolve a color token to a CSS variable reference wrapped in rgb()
|
|
7410
|
+
*
|
|
7411
|
+
* @param token - Token name (e.g., 'primary-500', 'white', 'text-900')
|
|
7412
|
+
* @returns CSS rgb() function with var reference (e.g., 'rgb(var(--tb-primary-500))')
|
|
7413
|
+
*
|
|
7414
|
+
* Note: CSS variables are stored as RGB channels (e.g., "37 99 235") following Tailwind convention,
|
|
7415
|
+
* so we must wrap them with rgb() to create a valid color value.
|
|
7416
|
+
*
|
|
7417
|
+
* @example
|
|
7418
|
+
* resolver.getColor('primary-500') // => 'rgb(var(--tb-primary-500))'
|
|
7419
|
+
* resolver.getColor('white') // => 'rgb(var(--tb-white))'
|
|
7420
|
+
*/
|
|
7421
|
+
getColor(token) {
|
|
7422
|
+
if (!this.tokenExists(token)) console.warn(`[TokenResolver] Color token "${token}" not found in theme palette. Button may render incorrectly.`);
|
|
7423
|
+
return rgbColorValue(token);
|
|
7424
|
+
}
|
|
7425
|
+
/**
|
|
7426
|
+
* Adjust a color token's shade by a given amount
|
|
7427
|
+
*
|
|
7428
|
+
* @param token - Base token (e.g., 'primary-500')
|
|
7429
|
+
* @param amount - Shade adjustment (+100 = darker, -100 = lighter)
|
|
7430
|
+
* @returns Adjusted token name (e.g., 'primary-600')
|
|
7431
|
+
*
|
|
7432
|
+
* @example
|
|
7433
|
+
* resolver.adjustShade('primary-500', 100) // => 'primary-600' (darker)
|
|
7434
|
+
* resolver.adjustShade('primary-500', -100) // => 'primary-400' (lighter)
|
|
7435
|
+
*/
|
|
7436
|
+
adjustShade(token, amount) {
|
|
7437
|
+
const parts = token.split("-");
|
|
7438
|
+
if (parts.length < 2) return `${token}-${Math.max(100, Math.min(900, 500 + amount))}`;
|
|
7439
|
+
const base = parts.slice(0, -1).join("-");
|
|
7440
|
+
const shade = parseInt(parts[parts.length - 1] ?? "", 10);
|
|
7441
|
+
if (isNaN(shade)) {
|
|
7442
|
+
console.warn(`[TokenResolver] Cannot adjust shade for non-shade token "${token}". Returning original token.`);
|
|
7443
|
+
return token;
|
|
7444
|
+
}
|
|
7445
|
+
return `${base}-${Math.max(100, Math.min(900, shade + amount))}`;
|
|
7446
|
+
}
|
|
7447
|
+
/**
|
|
7448
|
+
* Check if a token exists in the theme palette
|
|
7449
|
+
*
|
|
7450
|
+
* @param token - Token name to check
|
|
7451
|
+
* @returns True if token exists in theme
|
|
7452
|
+
*/
|
|
7453
|
+
tokenExists(token) {
|
|
7454
|
+
if ([
|
|
7455
|
+
"white",
|
|
7456
|
+
"black",
|
|
7457
|
+
"transparent"
|
|
7458
|
+
].includes(token)) return true;
|
|
7459
|
+
const parts = token.split("-");
|
|
7460
|
+
if (parts.length >= 2) {
|
|
7461
|
+
const lastPart = parts[parts.length - 1] ?? "";
|
|
7462
|
+
const shade = parseInt(lastPart, 10);
|
|
7463
|
+
if (!isNaN(shade) && shade >= 100 && shade <= 900 && shade % 100 === 0) return true;
|
|
7464
|
+
}
|
|
7465
|
+
return true;
|
|
7466
|
+
}
|
|
7467
|
+
};
|
|
6676
7468
|
//#endregion
|
|
6677
7469
|
//#region ../theme-core/src/utils/cssDeclarations.ts
|
|
6678
7470
|
/** Render CSS declarations whether callers provide terminators or fragments. */
|
|
@@ -7289,6 +8081,7 @@ const policiesById = {
|
|
|
7289
8081
|
"text-color-change": "text-colour",
|
|
7290
8082
|
"border-color-change": "other",
|
|
7291
8083
|
"sketchy-border": "other",
|
|
8084
|
+
"inner-dashed-outline": "other",
|
|
7292
8085
|
"pulse-animation": "other",
|
|
7293
8086
|
"nav-underline": "underline",
|
|
7294
8087
|
"nav-frosted-base": "other",
|
|
@@ -8416,13 +9209,13 @@ const boxRoundedSchema = z.enum([
|
|
|
8416
9209
|
"2xl",
|
|
8417
9210
|
"full"
|
|
8418
9211
|
]);
|
|
8419
|
-
const noHeadingDecorationSchema = z.
|
|
8420
|
-
const visibleHeadingDecorationSchema = z.
|
|
9212
|
+
const noHeadingDecorationSchema = z.strictObject({ family: z.literal("none") });
|
|
9213
|
+
const visibleHeadingDecorationSchema = z.strictObject({
|
|
8421
9214
|
family: z.enum(visibleHeadingDecorationFamilyValues),
|
|
8422
9215
|
colorToken: z.enum(headingDecorationColorTokenValues).optional()
|
|
8423
9216
|
});
|
|
8424
9217
|
const headingDecorationSchema = z.union([noHeadingDecorationSchema, visibleHeadingDecorationSchema]);
|
|
8425
|
-
const headingDecorationOverrideSchema = z.
|
|
9218
|
+
const headingDecorationOverrideSchema = z.enum(headingDecorationOverrideValues);
|
|
8426
9219
|
const accordionIconTreatmentSchema = z.object({
|
|
8427
9220
|
iconSet: z.enum(accordionIconSetValues),
|
|
8428
9221
|
colorToken: z.enum(accordionIconColorTokenValues),
|
|
@@ -9148,6 +9941,36 @@ function generateStateCSS(themeId, variantId, state, cssProperties) {
|
|
|
9148
9941
|
`;
|
|
9149
9942
|
}
|
|
9150
9943
|
//#endregion
|
|
9944
|
+
//#region ../theme-core/src/buttons/effects/presets/innerDashedOutline.ts
|
|
9945
|
+
/** Decorative stitching follows resolved button ink, including inverted grounds. */
|
|
9946
|
+
const innerDashedOutlineEffect = {
|
|
9947
|
+
id: "inner-dashed-outline",
|
|
9948
|
+
name: "Inner dashed outline",
|
|
9949
|
+
description: "A stitched edge inside the button",
|
|
9950
|
+
category: "overlay",
|
|
9951
|
+
pseudoElement: "before",
|
|
9952
|
+
applicableTo: ["button"],
|
|
9953
|
+
generateCSS: ({ themeId, variantId, stateGroup, options }) => {
|
|
9954
|
+
const effect = buttonEffectApplicationSchema.parse({
|
|
9955
|
+
effectId: "inner-dashed-outline",
|
|
9956
|
+
options
|
|
9957
|
+
});
|
|
9958
|
+
if (effect.effectId !== "inner-dashed-outline") return "";
|
|
9959
|
+
const { colourRole, width, inset } = effect.options;
|
|
9960
|
+
const colour = colourRole === "mark" ? "var(--rb-surface-mark-color, rgb(var(--tb-accent)))" : "currentColor";
|
|
9961
|
+
const selector = getStateSelector(themeId, variantId, stateGroup).split(",").map((part) => `${part.trim()}::before`).join(",\n");
|
|
9962
|
+
return `${generateStateCSS(themeId, variantId, stateGroup, "position: relative;")}
|
|
9963
|
+
${selector} {
|
|
9964
|
+
content: '';
|
|
9965
|
+
position: absolute;
|
|
9966
|
+
inset: ${inset}px;
|
|
9967
|
+
border: ${width}px dashed ${colour};
|
|
9968
|
+
border-radius: inherit;
|
|
9969
|
+
pointer-events: none;
|
|
9970
|
+
}`;
|
|
9971
|
+
}
|
|
9972
|
+
};
|
|
9973
|
+
//#endregion
|
|
9151
9974
|
//#region ../theme-core/src/buttons/effects/presets/background.ts
|
|
9152
9975
|
/**
|
|
9153
9976
|
* Darken background on hover
|
|
@@ -10062,6 +10885,7 @@ const EFFECT_PRESETS = [
|
|
|
10062
10885
|
`;
|
|
10063
10886
|
}
|
|
10064
10887
|
},
|
|
10888
|
+
innerDashedOutlineEffect,
|
|
10065
10889
|
{
|
|
10066
10890
|
id: "gradient-text",
|
|
10067
10891
|
name: "Gradient Text",
|
|
@@ -11046,6 +11870,131 @@ function normalizeAppearance(appearance) {
|
|
|
11046
11870
|
};
|
|
11047
11871
|
}
|
|
11048
11872
|
//#endregion
|
|
11873
|
+
//#region ../theme-core/src/buttons/styles/recipes/sewnLabel.ts
|
|
11874
|
+
const visual = {
|
|
11875
|
+
text: "treatment",
|
|
11876
|
+
borderRadius: "rounded-lg",
|
|
11877
|
+
sizes: {
|
|
11878
|
+
sm: {
|
|
11879
|
+
padding: "0.625rem 1.125rem",
|
|
11880
|
+
fontSize: "text-sm"
|
|
11881
|
+
},
|
|
11882
|
+
md: { padding: "0.875rem 1.5rem" },
|
|
11883
|
+
lg: {
|
|
11884
|
+
padding: "1rem 1.75rem",
|
|
11885
|
+
fontSize: "text-lg"
|
|
11886
|
+
},
|
|
11887
|
+
xl: {
|
|
11888
|
+
padding: "1.125rem 2rem",
|
|
11889
|
+
fontSize: "text-xl"
|
|
11890
|
+
}
|
|
11891
|
+
},
|
|
11892
|
+
typography: {
|
|
11893
|
+
fontWeight: 700,
|
|
11894
|
+
typography: "body",
|
|
11895
|
+
fontSize: null,
|
|
11896
|
+
letterSpacing: null,
|
|
11897
|
+
italic: false,
|
|
11898
|
+
textTransform: "none"
|
|
11899
|
+
},
|
|
11900
|
+
shadow: {
|
|
11901
|
+
elevation: "none",
|
|
11902
|
+
softness: null,
|
|
11903
|
+
position: "bottom"
|
|
11904
|
+
}
|
|
11905
|
+
};
|
|
11906
|
+
const stitch = {
|
|
11907
|
+
effectId: "inner-dashed-outline",
|
|
11908
|
+
options: {
|
|
11909
|
+
colourRole: "ink",
|
|
11910
|
+
width: 1.5,
|
|
11911
|
+
inset: 6
|
|
11912
|
+
}
|
|
11913
|
+
};
|
|
11914
|
+
const filled = {
|
|
11915
|
+
...visual,
|
|
11916
|
+
background: {
|
|
11917
|
+
type: "solid",
|
|
11918
|
+
colorToken: "primary"
|
|
11919
|
+
},
|
|
11920
|
+
border: "none",
|
|
11921
|
+
effects: [stitch]
|
|
11922
|
+
};
|
|
11923
|
+
const filledStates = {
|
|
11924
|
+
base: filled,
|
|
11925
|
+
hover: {
|
|
11926
|
+
...filled,
|
|
11927
|
+
effects: [stitch, {
|
|
11928
|
+
effectId: "darken-background",
|
|
11929
|
+
options: { amount: 100 }
|
|
11930
|
+
}]
|
|
11931
|
+
},
|
|
11932
|
+
focus: {
|
|
11933
|
+
...filled,
|
|
11934
|
+
shadow: "focus-indicator"
|
|
11935
|
+
},
|
|
11936
|
+
active: {
|
|
11937
|
+
...filled,
|
|
11938
|
+
effects: [stitch, {
|
|
11939
|
+
effectId: "darken-background",
|
|
11940
|
+
options: { amount: 100 }
|
|
11941
|
+
}]
|
|
11942
|
+
},
|
|
11943
|
+
disabled: {
|
|
11944
|
+
...filled,
|
|
11945
|
+
effects: []
|
|
11946
|
+
}
|
|
11947
|
+
};
|
|
11948
|
+
const quiet = {
|
|
11949
|
+
...visual,
|
|
11950
|
+
background: {
|
|
11951
|
+
type: "surface",
|
|
11952
|
+
role: "link"
|
|
11953
|
+
},
|
|
11954
|
+
border: { widthClass: "border-2" },
|
|
11955
|
+
effects: []
|
|
11956
|
+
};
|
|
11957
|
+
const quietStates = {
|
|
11958
|
+
base: quiet,
|
|
11959
|
+
hover: quiet,
|
|
11960
|
+
focus: {
|
|
11961
|
+
...quiet,
|
|
11962
|
+
shadow: "focus-indicator"
|
|
11963
|
+
},
|
|
11964
|
+
active: quiet,
|
|
11965
|
+
disabled: quiet
|
|
11966
|
+
};
|
|
11967
|
+
const ghost = {
|
|
11968
|
+
...quiet,
|
|
11969
|
+
border: "none"
|
|
11970
|
+
};
|
|
11971
|
+
const sewnLabelRecipe = defineStaticButtonStyleRecipe({
|
|
11972
|
+
id: "sewn-label",
|
|
11973
|
+
accessibilityLabel: "Filled buttons with a stitched inner edge",
|
|
11974
|
+
tags: {
|
|
11975
|
+
tone: "classic",
|
|
11976
|
+
energy: "calm",
|
|
11977
|
+
motion: "subtle",
|
|
11978
|
+
era: "organic"
|
|
11979
|
+
},
|
|
11980
|
+
system: { roles: {
|
|
11981
|
+
primary: { states: filledStates },
|
|
11982
|
+
secondary: { states: quietStates },
|
|
11983
|
+
outline: { states: quietStates },
|
|
11984
|
+
ghost: { states: {
|
|
11985
|
+
base: ghost,
|
|
11986
|
+
hover: ghost,
|
|
11987
|
+
focus: {
|
|
11988
|
+
...ghost,
|
|
11989
|
+
shadow: "focus-indicator"
|
|
11990
|
+
},
|
|
11991
|
+
active: ghost,
|
|
11992
|
+
disabled: ghost
|
|
11993
|
+
} },
|
|
11994
|
+
accent: { states: filledStates }
|
|
11995
|
+
} }
|
|
11996
|
+
});
|
|
11997
|
+
//#endregion
|
|
11049
11998
|
//#region ../theme-core/src/buttons/styles/recipes/lanternRecipes.ts
|
|
11050
11999
|
const flatShadow = {
|
|
11051
12000
|
elevation: "none",
|
|
@@ -11501,6 +12450,91 @@ const fulcrumRecipe = defineStaticButtonStyleRecipe({
|
|
|
11501
12450
|
} }
|
|
11502
12451
|
});
|
|
11503
12452
|
//#endregion
|
|
12453
|
+
//#region ../theme-core/src/buttons/styles/selection.ts
|
|
12454
|
+
const BUTTON_STYLE_IDS = [
|
|
12455
|
+
"soft-pill",
|
|
12456
|
+
"earth-pill",
|
|
12457
|
+
"confident-chip",
|
|
12458
|
+
"editorial-link",
|
|
12459
|
+
"pebble",
|
|
12460
|
+
"ink-stamp",
|
|
12461
|
+
"flat-ink",
|
|
12462
|
+
"brushed-wash",
|
|
12463
|
+
"showtime-pill",
|
|
12464
|
+
"joy-stamp",
|
|
12465
|
+
"ornate-ritual",
|
|
12466
|
+
"quiet-arrow",
|
|
12467
|
+
"offset-block",
|
|
12468
|
+
"ringed-pill",
|
|
12469
|
+
"square-outline",
|
|
12470
|
+
"fulcrum",
|
|
12471
|
+
"gilt-slab",
|
|
12472
|
+
"hairline-tab",
|
|
12473
|
+
"marquee",
|
|
12474
|
+
"sewn-label"
|
|
12475
|
+
];
|
|
12476
|
+
const quietArrowParametersSchema = z.object({
|
|
12477
|
+
secondaryTreatment: z.enum(["outlined", "solid-accent"]),
|
|
12478
|
+
size: z.enum(["comfortable"]).optional(),
|
|
12479
|
+
hoverTreatment: z.enum(["deep-and-sheet"]).optional()
|
|
12480
|
+
}).strict();
|
|
12481
|
+
const flatInkHoverTreatmentSchema = z.enum([
|
|
12482
|
+
"contextual",
|
|
12483
|
+
"secondary",
|
|
12484
|
+
"accent"
|
|
12485
|
+
]);
|
|
12486
|
+
const flatInkHoverPreferencesShape = Object.fromEntries(VARIANT_ROLES.map((role) => [role, flatInkHoverTreatmentSchema.optional()]));
|
|
12487
|
+
const flatInkHoverPreferencesSchema = z.strictObject(flatInkHoverPreferencesShape);
|
|
12488
|
+
const flatInkParametersSchema = z.strictObject({
|
|
12489
|
+
hoverPreferences: flatInkHoverPreferencesSchema.optional(),
|
|
12490
|
+
corners: z.enum(["nearly-square", "square"]).optional()
|
|
12491
|
+
});
|
|
12492
|
+
const squareOutlineParametersSchema = z.strictObject({
|
|
12493
|
+
corners: z.enum(["square", "soft"]).optional(),
|
|
12494
|
+
lineWeight: z.enum(["fine", "heavy"]).optional()
|
|
12495
|
+
});
|
|
12496
|
+
const editorialLinkParametersSchema = z.strictObject({ underline: z.enum(["animated", "persistent-mark"]).optional() });
|
|
12497
|
+
const emptyParametersSchema = z.object({}).strict();
|
|
12498
|
+
function selectionBranch(styleId, parameters) {
|
|
12499
|
+
return z.object({
|
|
12500
|
+
styleId: z.literal(styleId),
|
|
12501
|
+
parameters
|
|
12502
|
+
}).strict();
|
|
12503
|
+
}
|
|
12504
|
+
const buttonStyleSelectionSchema = z.discriminatedUnion("styleId", [
|
|
12505
|
+
selectionBranch("soft-pill", emptyParametersSchema),
|
|
12506
|
+
selectionBranch("earth-pill", emptyParametersSchema),
|
|
12507
|
+
selectionBranch("confident-chip", emptyParametersSchema),
|
|
12508
|
+
selectionBranch("editorial-link", editorialLinkParametersSchema),
|
|
12509
|
+
selectionBranch("pebble", emptyParametersSchema),
|
|
12510
|
+
selectionBranch("ink-stamp", emptyParametersSchema),
|
|
12511
|
+
selectionBranch("flat-ink", flatInkParametersSchema),
|
|
12512
|
+
selectionBranch("brushed-wash", emptyParametersSchema),
|
|
12513
|
+
selectionBranch("showtime-pill", emptyParametersSchema),
|
|
12514
|
+
selectionBranch("joy-stamp", emptyParametersSchema),
|
|
12515
|
+
selectionBranch("ornate-ritual", emptyParametersSchema),
|
|
12516
|
+
selectionBranch("quiet-arrow", quietArrowParametersSchema),
|
|
12517
|
+
selectionBranch("offset-block", emptyParametersSchema),
|
|
12518
|
+
selectionBranch("ringed-pill", emptyParametersSchema),
|
|
12519
|
+
selectionBranch("square-outline", squareOutlineParametersSchema),
|
|
12520
|
+
selectionBranch("fulcrum", emptyParametersSchema),
|
|
12521
|
+
selectionBranch("gilt-slab", emptyParametersSchema),
|
|
12522
|
+
selectionBranch("hairline-tab", emptyParametersSchema),
|
|
12523
|
+
selectionBranch("marquee", emptyParametersSchema),
|
|
12524
|
+
selectionBranch("sewn-label", emptyParametersSchema)
|
|
12525
|
+
]);
|
|
12526
|
+
/**
|
|
12527
|
+
* Stable identity for a validated style selection. Parsing first canonicalises
|
|
12528
|
+
* parameter key order, so future recipe parameters do not require editor-core
|
|
12529
|
+
* equality or key logic.
|
|
12530
|
+
*/
|
|
12531
|
+
function buttonStyleSelectionKey(selection) {
|
|
12532
|
+
return JSON.stringify(buttonStyleSelectionSchema.parse(selection));
|
|
12533
|
+
}
|
|
12534
|
+
function buttonStyleSelectionsEqual(a, b) {
|
|
12535
|
+
return buttonStyleSelectionKey(a) === buttonStyleSelectionKey(b);
|
|
12536
|
+
}
|
|
12537
|
+
//#endregion
|
|
11504
12538
|
//#region ../theme-core/src/buttons/styles/recipes/squareOutlineRecipe.ts
|
|
11505
12539
|
const squareOutlineSizes = {
|
|
11506
12540
|
sm: {
|
|
@@ -11623,7 +12657,7 @@ const squareOutlineState0 = {
|
|
|
11623
12657
|
},
|
|
11624
12658
|
effects: []
|
|
11625
12659
|
};
|
|
11626
|
-
const
|
|
12660
|
+
const defaultSquareOutlineRecipe = defineStaticButtonStyleRecipe({
|
|
11627
12661
|
id: "square-outline",
|
|
11628
12662
|
accessibilityLabel: "Square outline buttons with a clear ruled edge",
|
|
11629
12663
|
tags: {
|
|
@@ -11658,6 +12692,30 @@ const squareOutlineRecipe = defineStaticButtonStyleRecipe({
|
|
|
11658
12692
|
accent: { states: squareOutlineStates1 }
|
|
11659
12693
|
} }
|
|
11660
12694
|
});
|
|
12695
|
+
const squareOutlineRecipe = defineButtonStyleRecipe({
|
|
12696
|
+
...defaultSquareOutlineRecipe,
|
|
12697
|
+
parameterSchema: squareOutlineParametersSchema,
|
|
12698
|
+
defaultParameters: {},
|
|
12699
|
+
controls: [],
|
|
12700
|
+
defineSystem: (parameters) => {
|
|
12701
|
+
const system = defaultSquareOutlineRecipe.defineSystem({});
|
|
12702
|
+
if (parameters.corners === void 0 && parameters.lineWeight === void 0) return system;
|
|
12703
|
+
return {
|
|
12704
|
+
...system,
|
|
12705
|
+
roles: mapButtonRoleAppearances(system.roles, (appearance) => ({
|
|
12706
|
+
...appearance,
|
|
12707
|
+
states: mapButtonVisualAppearances(appearance.states, (state) => ({
|
|
12708
|
+
...state,
|
|
12709
|
+
borderRadius: parameters.corners === "soft" ? "rounded-lg" : state.borderRadius,
|
|
12710
|
+
border: parameters.lineWeight === "heavy" && state.border !== "none" ? {
|
|
12711
|
+
...state.border,
|
|
12712
|
+
widthClass: "border-2"
|
|
12713
|
+
} : state.border
|
|
12714
|
+
}))
|
|
12715
|
+
}))
|
|
12716
|
+
};
|
|
12717
|
+
}
|
|
12718
|
+
});
|
|
11661
12719
|
//#endregion
|
|
11662
12720
|
//#region ../theme-core/src/buttons/styles/recipes/ringedPillRecipe.ts
|
|
11663
12721
|
const ringedPillSizes = {
|
|
@@ -12051,84 +13109,6 @@ const offsetBlockRecipe = defineStaticButtonStyleRecipe({
|
|
|
12051
13109
|
} }
|
|
12052
13110
|
});
|
|
12053
13111
|
//#endregion
|
|
12054
|
-
//#region ../theme-core/src/buttons/styles/selection.ts
|
|
12055
|
-
const BUTTON_STYLE_IDS = [
|
|
12056
|
-
"soft-pill",
|
|
12057
|
-
"earth-pill",
|
|
12058
|
-
"confident-chip",
|
|
12059
|
-
"editorial-link",
|
|
12060
|
-
"pebble",
|
|
12061
|
-
"ink-stamp",
|
|
12062
|
-
"flat-ink",
|
|
12063
|
-
"brushed-wash",
|
|
12064
|
-
"showtime-pill",
|
|
12065
|
-
"joy-stamp",
|
|
12066
|
-
"ornate-ritual",
|
|
12067
|
-
"quiet-arrow",
|
|
12068
|
-
"offset-block",
|
|
12069
|
-
"ringed-pill",
|
|
12070
|
-
"square-outline",
|
|
12071
|
-
"fulcrum",
|
|
12072
|
-
"gilt-slab",
|
|
12073
|
-
"hairline-tab",
|
|
12074
|
-
"marquee"
|
|
12075
|
-
];
|
|
12076
|
-
const quietArrowParametersSchema = z.object({
|
|
12077
|
-
secondaryTreatment: z.enum(["outlined", "solid-accent"]),
|
|
12078
|
-
size: z.enum(["comfortable"]).optional(),
|
|
12079
|
-
hoverTreatment: z.enum(["deep-and-sheet"]).optional()
|
|
12080
|
-
}).strict();
|
|
12081
|
-
const flatInkHoverTreatmentSchema = z.enum([
|
|
12082
|
-
"contextual",
|
|
12083
|
-
"secondary",
|
|
12084
|
-
"accent"
|
|
12085
|
-
]);
|
|
12086
|
-
const flatInkHoverPreferencesShape = Object.fromEntries(VARIANT_ROLES.map((role) => [role, flatInkHoverTreatmentSchema.optional()]));
|
|
12087
|
-
const flatInkHoverPreferencesSchema = z.strictObject(flatInkHoverPreferencesShape);
|
|
12088
|
-
const flatInkParametersSchema = z.strictObject({
|
|
12089
|
-
hoverPreferences: flatInkHoverPreferencesSchema.optional(),
|
|
12090
|
-
corners: z.enum(["nearly-square", "square"]).optional()
|
|
12091
|
-
});
|
|
12092
|
-
const emptyParametersSchema = z.object({}).strict();
|
|
12093
|
-
function selectionBranch(styleId, parameters) {
|
|
12094
|
-
return z.object({
|
|
12095
|
-
styleId: z.literal(styleId),
|
|
12096
|
-
parameters
|
|
12097
|
-
}).strict();
|
|
12098
|
-
}
|
|
12099
|
-
const buttonStyleSelectionSchema = z.discriminatedUnion("styleId", [
|
|
12100
|
-
selectionBranch("soft-pill", emptyParametersSchema),
|
|
12101
|
-
selectionBranch("earth-pill", emptyParametersSchema),
|
|
12102
|
-
selectionBranch("confident-chip", emptyParametersSchema),
|
|
12103
|
-
selectionBranch("editorial-link", emptyParametersSchema),
|
|
12104
|
-
selectionBranch("pebble", emptyParametersSchema),
|
|
12105
|
-
selectionBranch("ink-stamp", emptyParametersSchema),
|
|
12106
|
-
selectionBranch("flat-ink", flatInkParametersSchema),
|
|
12107
|
-
selectionBranch("brushed-wash", emptyParametersSchema),
|
|
12108
|
-
selectionBranch("showtime-pill", emptyParametersSchema),
|
|
12109
|
-
selectionBranch("joy-stamp", emptyParametersSchema),
|
|
12110
|
-
selectionBranch("ornate-ritual", emptyParametersSchema),
|
|
12111
|
-
selectionBranch("quiet-arrow", quietArrowParametersSchema),
|
|
12112
|
-
selectionBranch("offset-block", emptyParametersSchema),
|
|
12113
|
-
selectionBranch("ringed-pill", emptyParametersSchema),
|
|
12114
|
-
selectionBranch("square-outline", emptyParametersSchema),
|
|
12115
|
-
selectionBranch("fulcrum", emptyParametersSchema),
|
|
12116
|
-
selectionBranch("gilt-slab", emptyParametersSchema),
|
|
12117
|
-
selectionBranch("hairline-tab", emptyParametersSchema),
|
|
12118
|
-
selectionBranch("marquee", emptyParametersSchema)
|
|
12119
|
-
]);
|
|
12120
|
-
/**
|
|
12121
|
-
* Stable identity for a validated style selection. Parsing first canonicalises
|
|
12122
|
-
* parameter key order, so future recipe parameters do not require editor-core
|
|
12123
|
-
* equality or key logic.
|
|
12124
|
-
*/
|
|
12125
|
-
function buttonStyleSelectionKey(selection) {
|
|
12126
|
-
return JSON.stringify(buttonStyleSelectionSchema.parse(selection));
|
|
12127
|
-
}
|
|
12128
|
-
function buttonStyleSelectionsEqual(a, b) {
|
|
12129
|
-
return buttonStyleSelectionKey(a) === buttonStyleSelectionKey(b);
|
|
12130
|
-
}
|
|
12131
|
-
//#endregion
|
|
12132
13112
|
//#region ../theme-core/src/buttons/styles/recipes/quietArrow.ts
|
|
12133
13113
|
const quietArrowSizes = {
|
|
12134
13114
|
sm: {
|
|
@@ -13956,7 +14936,7 @@ const editorialLinkState2 = {
|
|
|
13956
14936
|
},
|
|
13957
14937
|
effects: []
|
|
13958
14938
|
};
|
|
13959
|
-
const
|
|
14939
|
+
const defaultEditorialLinkRecipe = defineStaticButtonStyleRecipe({
|
|
13960
14940
|
id: "editorial-link",
|
|
13961
14941
|
accessibilityLabel: "Flat typographic buttons with an underline treatment",
|
|
13962
14942
|
tags: {
|
|
@@ -14019,6 +14999,38 @@ const editorialLinkRecipe = defineStaticButtonStyleRecipe({
|
|
|
14019
14999
|
accent: { states: editorialLinkStates0 }
|
|
14020
15000
|
} }
|
|
14021
15001
|
});
|
|
15002
|
+
const editorialLinkRecipe = defineButtonStyleRecipe({
|
|
15003
|
+
...defaultEditorialLinkRecipe,
|
|
15004
|
+
parameterSchema: editorialLinkParametersSchema,
|
|
15005
|
+
defaultParameters: {},
|
|
15006
|
+
controls: [],
|
|
15007
|
+
defineSystem: (parameters) => {
|
|
15008
|
+
const system = defaultEditorialLinkRecipe.defineSystem({});
|
|
15009
|
+
if (parameters.underline !== "persistent-mark") return system;
|
|
15010
|
+
return {
|
|
15011
|
+
...system,
|
|
15012
|
+
roles: mapButtonRoleAppearances(system.roles, (appearance) => ({
|
|
15013
|
+
...appearance,
|
|
15014
|
+
states: mapButtonVisualAppearances(appearance.states, (state) => ({
|
|
15015
|
+
...state,
|
|
15016
|
+
typography: {
|
|
15017
|
+
...state.typography,
|
|
15018
|
+
fontWeight: 700
|
|
15019
|
+
},
|
|
15020
|
+
effects: [{
|
|
15021
|
+
effectId: "border-bottom-grow",
|
|
15022
|
+
options: {
|
|
15023
|
+
height: 2,
|
|
15024
|
+
origin: "left",
|
|
15025
|
+
persistent: true,
|
|
15026
|
+
colourRole: "mark"
|
|
15027
|
+
}
|
|
15028
|
+
}]
|
|
15029
|
+
}))
|
|
15030
|
+
}))
|
|
15031
|
+
};
|
|
15032
|
+
}
|
|
15033
|
+
});
|
|
14022
15034
|
//#endregion
|
|
14023
15035
|
//#region ../theme-core/src/buttons/styles/recipes/pebble.ts
|
|
14024
15036
|
const pebbleSizes = {
|
|
@@ -15702,7 +16714,8 @@ const buttonStyleRecipes = [
|
|
|
15702
16714
|
fulcrumRecipe,
|
|
15703
16715
|
giltSlabRecipe,
|
|
15704
16716
|
hairlineTabRecipe,
|
|
15705
|
-
marqueeRecipe
|
|
16717
|
+
marqueeRecipe,
|
|
16718
|
+
sewnLabelRecipe
|
|
15706
16719
|
];
|
|
15707
16720
|
const recipesById = new Map(buttonStyleRecipes.map((recipe) => [recipe.id, recipe]));
|
|
15708
16721
|
function findButtonStyleRecipe(id) {
|
|
@@ -15712,6 +16725,7 @@ function findButtonStyleRecipe(id) {
|
|
|
15712
16725
|
}
|
|
15713
16726
|
function resolveButtonStyleSelection(selection) {
|
|
15714
16727
|
switch (selection.styleId) {
|
|
16728
|
+
case "sewn-label": return resolveButtonStyleRecipe(sewnLabelRecipe, selection.parameters);
|
|
15715
16729
|
case "soft-pill": return resolveButtonStyleRecipe(softPillRecipe, selection.parameters);
|
|
15716
16730
|
case "earth-pill": return resolveButtonStyleRecipe(earthPillRecipe, selection.parameters);
|
|
15717
16731
|
case "confident-chip": return resolveButtonStyleRecipe(confidentChipRecipe, selection.parameters);
|
|
@@ -17056,4 +18070,4 @@ function ThemedAuthoredButton({ label, href, variant, size, extraClassName, disa
|
|
|
17056
18070
|
});
|
|
17057
18071
|
}
|
|
17058
18072
|
//#endregion
|
|
17059
|
-
export { headerInteractionPalettePair as $,
|
|
18073
|
+
export { headerInteractionPalettePair as $, normalizeCardRole as $n, buildGoogleFontFamilyQuery as $r, cssVarValue as $t, resolveButtonStyleSelection as A, parseContentEntryId as Ai, getTextColorForBackground as An, assertNever as Ar, NAV_LINK_LETTER_SPACING_MAP as At, generateBaseInteractiveCSS as B, parseSiteTermsVersionId as Bi, featuresFromHex as Bn, introCompositionTreatmentValues as Br, INPUT_SPACING_MAP as Bt, FileTextIcon as C, resolveBookingCollectionOptionFacts as Ci, generateShadowValue as Cn, asDesignBlockId as Cr, resolveBrandDisplay as Ct, buttonStyleSelectionParameterValue as D, formatCurrencyAmount as Di, resolveSurfaceForeground as Dn, asLayoutVariantKey as Dr, parseBlockCustomCssRules as Dt, buttonStyleHoverPreferenceValue as E, getBookingInstalmentPlanIntervalCount as Ei, surfaceToneFromForegroundToken as En, asDesignSystemTemplateId as Er, getComponentShadowVar as Et, buttonStyleSelectionsEqual as F, parseEventSeriesId as Fi, resolveOpaqueSurfaceHex as Fn, eventListTreatmentValues as Fr, navLinkOwnsHoverForeground as Ft, containerStylesOverrideSchema as G, unsafeAsFormId as Gi, surfaceForegroundInputFromResolved as Gn, panelFrame as Gr, ACCORDION_TRIGGER_LETTER_SPACING as Gt, parseThemeButtonVariantId as H, unsafeAsAppointmentResourceId as Hi, DEFAULT_SURFACE_TEXT_COLOR as Hn, makeBoundaryId as Hr, ACCORDION_OPEN_ACCENT_THICKNESS as Ht, generateButtonActionLayoutCss as I, parseFormId as Ii, buildThemeTokens as In, eyebrowTreatmentValues as Ir, navLinkOwnsUnderline as It, sectionStylesOverrideSchema as J, unsafeAsPositiveByteCount as Ji, surfaceForegroundValueWithOpacity as Jn, testimonialsCompositionTreatmentValues as Jr, generateCardCss as Jt, corners as K, unsafeAsMediaAssetId as Ki, surfaceForegroundStyle as Kn, plainFrame as Kr, ICON_CONFIG as Kt, generateButtonCss as L, parsePageId as Li, defaultThemeTokens as Ln, featureCardCompositionTreatmentValues as Lr, navEffectPolicy as Lt, updateButtonStyleSelectionChoice as M, parseEditorClientId as Mi, planForegroundHover as Mn, defineExactCatalog as Mr, NAV_LINK_PADDING_X_MAP as Mt, buttonStyleSelectionKey as N, parseEditorSessionGeneration as Ni, worstCaseGlassBackdrop as Nn, defineFrameCapability as Nr, NAV_LINK_TEXT_SIZE_MAP as Nt, defaultButtonStyleSelectionFor as O, expectParsedBrandedId as Oi, safeTokenOr as On, asPageFlowPresetId as Or, parseCustomCssRules as Ot, buttonStyleSelectionSchema as P, parseEventOfferingId as Pi, resolveConcreteColorHex as Pn, designIssueSeverityForPolicy as Pr, navLinkHoverColorCandidate as Pt, runtimeBoxBackgroundSchema as Q, unsafeAsStoragePath as Qi, cardVariantRoleValues as Qn, buildFontPreviewUrl as Qr, borderColorStyle as Qt, generateDefaultButtonSystem as R, parsePageSurfaceId as Ri, ORDINARY_TEXT_MIN_CONTRAST_RATIO as Rn, flushPanelFrame as Rr, FONT_WEIGHT_MAP$1 as Rt, FileSpreadsheetIcon as S, resolveAvailableBookingCollectionOptions as Si, resolveTokenOrCssColorValue as Sn, asBoundaryOptionId as Sr, logoSizePolicyValues as St, PlusIcon as T, validateBookingPaymentOptionKinds as Ti, selectLogoVariant as Tn, asDesignPageId as Tr, getComponentBorderWidthPx as Tt, parseThemeForPersistence as U, unsafeAsAppointmentServiceId as Ui, SURFACE_FOREGROUND_CSS_VARS as Un, noHeadingDecoration as Ur, ACCORDION_SPACING_MAP as Ut, generateInteractiveChildInheritanceCSS as V, parseUserId as Vi, hexToRgb as Vn, isArrangementMode as Vr, LABEL_FONT_SIZE_MAP as Vt, cardStylesOverrideSchema as W, unsafeAsCustomerPassId as Wi, surfaceForegroundDeclarations as Wn, offeringsPreviewCompositionTreatmentValues as Wr, ACCORDION_TRIGGER_FONT_SCALE as Wt, boxBackgroundOverlaySchema as X, unsafeAsSiteId as Xi, cardRoleSchema as Xn, toNonEmptyReadonlyArray as Xr, TokenResolver as Xt, themeSchema as Y, unsafeAsPositiveSeconds as Yi, generateShadowValue$1 as Yn, tileTreatmentValues as Yr, renderCssDeclarations as Yt, boxBackgroundSchema as Z, unsafeAsStorageBucketName as Zi, cardRoleValues as Zn, visibleHeadingDecorationFamilyValues as Zr, backgroundColorStyle as Zt, CirclePlusIcon as _, confirmationPaymentSchema as _i, minimumScrimOpacity as _n, skinTokenCssVars as _r, siteChromeBackgroundOverrideOwner as _t, ThemedDownloadLink as a, parseThemeColorToken as ai, opaqueSurfaceContextFromTheme as an, paletteValueKey as ar, renderHeaderPaintTargetRules as at, FileArchiveIcon as b, isBookingCollectionEquivalentToUpfront as bi, resolveOnColorForThemeToken as bn, asBlockContentVersionId as br, brandDisplayModeValues as bt, isKnownIconName as c, parseColorTokenParts as ci, parseResolvedSurface as cn, imageMediaSchema as cr, MQ_LG_UP as ct, resolveIconPickerPreset as d, checkBrowserStripeKey as di, resolveSurface as dn, buildRenderableMediaAssetIndex as dr, MQ_SM_UP as dt, generateFontFaceCss as ei, mergeStyles as en, hexColorSchema as er, headerInteractionPaletteValues as et, SEMANTIC_ICON_DEFINITIONS as f, eventRegistrationErrorEndsCommand as fi, serializeSurfaceTree as fn, renderableMediaAssetSchema as fr, MQ_TABLET_ONLY as ft, CircleMinusIcon as g, getStripeMinimumChargeRequirement as gi, gradientScrimSamples as gn, parseCanonicalMediaIdentifier as gr, pageDesignEditorBackgroundOverrideOwner as gt, ChevronDownIcon as h, checkoutCopy as hi, toAccessibleColorSurfaceIntent as hn, mediaIdentifierSchema as hr, isThemeV2NormalEditorRawStylePath as ht, ThemedButtonSpecimen as i, unsafeAsOpaqueButtonColourToken as ii, mapDrawingStyle as in, paletteModeSchema as ir, getHeaderPaintTargets as it, updateButtonStyleHoverPreference as j, parseContentVersionId as ji, compositeHex$1 as jn, defineBlockDesignCapability as jr, NAV_LINK_PADDING_MAP as jt, findButtonStyleRecipe as k, parseApiKeyId as ki, expandPalette as kn, asSiteStyleId as kr, NAV_LINK_BORDER_RADIUS_MAP as kt, ICON_PICKER_PRESETS as l, SpinnerNode as li, parseSurfaceTree as ln, mediaSchema as lr, MQ_MD_DOWN as lt, ArrowDownIcon as m, parseEventRegistrationErrorReason as mi, surfaceTransportContext as mn, resolveManagedMediaReference as mr, isThemeV2NormalEditorRawStyleFieldName as mt, ThemedButton as n, getSiteFontsStorageUrl as ni, textColorStyle as nn, paletteColorsEqual as nr, generateHeaderScrollTreatmentStyles as nt, getIconComponent as o, themeColorShadeSteps as oi, opaqueSurfaceDeclarations as on, paletteValueKeySchema as or, BREAKPOINT_LG as ot, isSemanticIconId as p, eventRegistrationErrors as pi, surfaceDecorationColors as pn, indexRenderableMediaAssets as pr, headerVariantValues as pt, headerPositioningValues as q, unsafeAsPassId as qi, surfaceForegroundValue as qn, requireNonEmptyReadonlyArray as qr, ICON_SIZE_PX as qt, ThemedButtonLink as r, VARIANT_ROLES as ri, textColorValue as rn, paletteColorsSchema as rr, generateMobileOverlayBackdropFilterFix as rt, getIconPickerOptionsForPreset as s, parseBlockColorToken as si, contrastThresholdByPolicy as sn, requirePaletteColorsFromEntries as sr, BREAKPOINT_XL as st, ThemedAuthoredButton as t, getFontWidthRange as ti, rgbColorValue as tn, paletteColorEntries as tr, headerInteractionQuietPalette as tt, isIconPickerPreset as u, clsx as ui, prepareThemeSurfaceRevision as un, runtimeMediaSchema as ur, MQ_SM_DOWN as ut, ClockIcon as v, planCheckoutPaymentFlow as vi, scrimTone as vn, arrangementModes as vr, stripStaleTransitionStyleGroup as vt, MinusIcon as w, getBookingLaterInstalments as wi, PUBLIC_BUTTON_ROLES as wn, asDesignBoundaryId as wr, selectLogoAccommodation as wt, FileAudioIcon as x, repriceBookingCollectionOptions as xi, resolveThemeColorReferenceValue as xn, asBlockOrderIndex as xr, deterministicLogoFactsForShape as xt, ExternalLinkIcon as y, planFlexibleBalanceCreditFirst as yi, isCssColorLiteral as yn, asAppearancePresetId as yr, themeV2RuntimeStyleFieldNames as yt, generateEffectsCSS as z, parseSiteId as zi, _classPrivateFieldInitSpec as zn, headingDecorationColorTokenValues as zr, INPUT_FONT_SIZE_MAP as zt };
|