@riverbankcms/sdk 0.4.2 → 0.5.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/README.md +84 -0
- package/dist/cli/index.js +3104 -120
- package/dist/cli/index.js.map +1 -1
- package/dist/client/analytics.js +1 -1
- package/dist/client/analytics.js.map +1 -1
- package/dist/client/analytics.mjs +1 -1
- package/dist/client/analytics.mjs.map +1 -1
- package/dist/client/bookings.js +6 -6
- package/dist/client/bookings.js.map +1 -1
- package/dist/client/bookings.mjs +6 -6
- package/dist/client/bookings.mjs.map +1 -1
- package/dist/client/client.d.mts +2 -2
- package/dist/client/client.d.ts +2 -2
- package/dist/client/client.js +1368 -520
- package/dist/client/client.js.map +1 -1
- package/dist/client/client.mjs +1368 -520
- package/dist/client/client.mjs.map +1 -1
- package/dist/client/hooks.d.mts +2 -2
- package/dist/client/hooks.d.ts +2 -2
- package/dist/client/hooks.js +26 -11
- package/dist/client/hooks.js.map +1 -1
- package/dist/client/hooks.mjs +26 -11
- package/dist/client/hooks.mjs.map +1 -1
- package/dist/client/rendering/client.js +24 -14
- package/dist/client/rendering/client.js.map +1 -1
- package/dist/client/rendering/client.mjs +24 -14
- package/dist/client/rendering/client.mjs.map +1 -1
- package/dist/client/usePage--fGlyrgj.d.mts +6439 -0
- package/dist/client/usePage-BTPnCuWC.d.mts +6511 -0
- package/dist/client/usePage-BafOS9UT.d.mts +6512 -0
- package/dist/client/usePage-Bnx-kA6x.d.mts +6670 -0
- package/dist/client/usePage-CE7X5NcN.d.ts +6439 -0
- package/dist/client/usePage-DoPI6b8V.d.ts +6511 -0
- package/dist/client/usePage-QNWArrVO.d.ts +6670 -0
- package/dist/client/usePage-fBgPB6Oq.d.ts +6512 -0
- package/dist/server/{Layout-kRv5sU81.d.ts → Layout-B-q2Py4v.d.ts} +4 -4
- package/dist/server/{Layout-ByUnm35V.d.mts → Layout-Cc5HUXAH.d.mts} +4 -4
- package/dist/server/{chunk-6JBKKV3G.js → chunk-2KCF2DNK.js} +30 -10
- package/dist/server/chunk-2KCF2DNK.js.map +1 -0
- package/dist/server/{chunk-N3PX76AP.mjs → chunk-4HIRA33Z.mjs} +247 -135
- package/dist/server/chunk-4HIRA33Z.mjs.map +1 -0
- package/dist/server/chunk-5STV4MWD.js +189 -0
- package/dist/server/chunk-5STV4MWD.js.map +1 -0
- package/dist/server/{chunk-R5B6IOFQ.js → chunk-6OSNCH4F.js} +247 -135
- package/dist/server/chunk-6OSNCH4F.js.map +1 -0
- package/dist/server/{chunk-TKMA6D6U.js → chunk-7UPVCT3K.js} +1215 -497
- package/dist/server/chunk-7UPVCT3K.js.map +1 -0
- package/dist/server/{chunk-7DS4Q3GA.mjs → chunk-AEFWG657.mjs} +3 -3
- package/dist/server/chunk-AEFWG657.mjs.map +1 -0
- package/dist/server/{chunk-USQF2XTU.mjs → chunk-BYBJA6SP.mjs} +26 -11
- package/dist/server/chunk-BYBJA6SP.mjs.map +1 -0
- package/dist/server/{chunk-ZEAJW6T3.mjs → chunk-C6FIJC7T.mjs} +4 -3
- package/dist/server/chunk-C6FIJC7T.mjs.map +1 -0
- package/dist/server/{chunk-TO7FD6TQ.js → chunk-I2D7KOEA.js} +4 -4
- package/dist/server/{chunk-TO7FD6TQ.js.map → chunk-I2D7KOEA.js.map} +1 -1
- package/dist/server/chunk-KFLZGNPO.mjs +189 -0
- package/dist/server/chunk-KFLZGNPO.mjs.map +1 -0
- package/dist/server/chunk-L5EA4FXU.mjs +134 -0
- package/dist/server/chunk-L5EA4FXU.mjs.map +1 -0
- package/dist/server/{chunk-TNRADRPH.mjs → chunk-LNOUXALA.mjs} +1137 -419
- package/dist/server/chunk-LNOUXALA.mjs.map +1 -0
- package/dist/server/{chunk-SPXMMX3C.mjs → chunk-OSF34JTQ.mjs} +4 -4
- package/dist/server/{chunk-SWPHIUVE.js → chunk-P3NNN73G.js} +5 -4
- package/dist/server/chunk-P3NNN73G.js.map +1 -0
- package/dist/server/{chunk-I6K5REFT.mjs → chunk-P4K63SBZ.mjs} +24 -4
- package/dist/server/chunk-P4K63SBZ.mjs.map +1 -0
- package/dist/server/{chunk-HOY77YBF.js → chunk-RVDS7VSP.js} +5 -5
- package/dist/server/chunk-RVDS7VSP.js.map +1 -0
- package/dist/server/{chunk-NW5KHH4A.js → chunk-TT5JWA4X.js} +9 -9
- package/dist/server/{chunk-NW5KHH4A.js.map → chunk-TT5JWA4X.js.map} +1 -1
- package/dist/server/chunk-VSFQRHYZ.js +134 -0
- package/dist/server/chunk-VSFQRHYZ.js.map +1 -0
- package/dist/server/{chunk-EGTDJ4PL.js → chunk-YYO3RIFO.js} +26 -11
- package/dist/server/chunk-YYO3RIFO.js.map +1 -0
- package/dist/server/{chunk-OP2GHK27.mjs → chunk-Z5ZA6Q4D.mjs} +2 -2
- package/dist/server/{components-D1Z2mSDr.d.ts → components-CU46ZkAv.d.mts} +20 -75
- package/dist/server/{components-CY8jDQjv.d.mts → components-DvozDwRN.d.ts} +20 -75
- package/dist/server/components.d.mts +11 -8
- package/dist/server/components.d.ts +11 -8
- package/dist/server/components.js +5 -4
- package/dist/server/components.js.map +1 -1
- package/dist/server/components.mjs +4 -3
- package/dist/server/config-validation.d.mts +3 -3
- package/dist/server/config-validation.d.ts +3 -3
- package/dist/server/config-validation.js +9 -5
- package/dist/server/config-validation.js.map +1 -1
- package/dist/server/config-validation.mjs +8 -4
- package/dist/server/config.d.mts +243 -5
- package/dist/server/config.d.ts +243 -5
- package/dist/server/config.js +72 -5
- package/dist/server/config.js.map +1 -1
- package/dist/server/config.mjs +72 -5
- package/dist/server/config.mjs.map +1 -1
- package/dist/server/core-DsNWrl3o.d.mts +44 -0
- package/dist/server/core-DsNWrl3o.d.ts +44 -0
- package/dist/server/data.d.mts +4 -3
- package/dist/server/data.d.ts +4 -3
- package/dist/server/data.js +3 -3
- package/dist/server/data.mjs +2 -2
- package/dist/server/{index-DCIz9Ptv.d.ts → index-CJfMXZQr.d.ts} +2 -1
- package/dist/server/{index-DFQwtj3J.d.mts → index-Q7RLMAQ6.d.mts} +2 -1
- package/dist/server/index.d.mts +63 -6
- package/dist/server/index.d.ts +63 -6
- package/dist/server/index.js +91 -2
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +90 -1
- package/dist/server/index.mjs.map +1 -1
- package/dist/server/link-DjxLyC82.d.mts +23 -0
- package/dist/server/link-DjxLyC82.d.ts +23 -0
- package/dist/server/{loadContent-CWuE8FCx.d.mts → loadContent-DgpSKWqY.d.mts} +4 -4
- package/dist/server/{loadContent-DynBuR5f.d.ts → loadContent-GPvUI1bN.d.ts} +4 -4
- package/dist/server/{loadPage-B8RmlYgV.d.mts → loadPage-DGnIK7s4.d.mts} +17 -47
- package/dist/server/loadPage-DNQTTRHL.mjs +11 -0
- package/dist/server/{loadPage-BTkKpizX.d.ts → loadPage-DW9WB-u9.d.ts} +17 -47
- package/dist/server/loadPage-IDGVDFBB.js +11 -0
- package/dist/server/{loadPage-DUHBXDEW.js.map → loadPage-IDGVDFBB.js.map} +1 -1
- package/dist/server/metadata.d.mts +6 -4
- package/dist/server/metadata.d.ts +6 -4
- package/dist/server/navigation.d.mts +199 -29
- package/dist/server/navigation.d.ts +199 -29
- package/dist/server/navigation.js +27 -43
- package/dist/server/navigation.js.map +1 -1
- package/dist/server/navigation.mjs +20 -36
- package/dist/server/navigation.mjs.map +1 -1
- package/dist/server/rendering/server.d.mts +8 -6
- package/dist/server/rendering/server.d.ts +8 -6
- package/dist/server/rendering/server.js +7 -6
- package/dist/server/rendering/server.js.map +1 -1
- package/dist/server/rendering/server.mjs +6 -5
- package/dist/server/rendering.d.mts +14 -10
- package/dist/server/rendering.d.ts +14 -10
- package/dist/server/rendering.js +9 -8
- package/dist/server/rendering.js.map +1 -1
- package/dist/server/rendering.mjs +8 -7
- package/dist/server/richTextSchema-DURiozvD.d.mts +62 -0
- package/dist/server/richTextSchema-DURiozvD.d.ts +62 -0
- package/dist/server/routing.d.mts +178 -11
- package/dist/server/routing.d.ts +178 -11
- package/dist/server/routing.js +95 -2
- package/dist/server/routing.js.map +1 -1
- package/dist/server/routing.mjs +94 -1
- package/dist/server/routing.mjs.map +1 -1
- package/dist/server/{schema-Bpy9N5ZI.d.ts → schema-Z6-afHJG.d.mts} +1 -1
- package/dist/server/{schema-Bpy9N5ZI.d.mts → schema-Z6-afHJG.d.ts} +1 -1
- package/dist/server/server.d.mts +9 -7
- package/dist/server/server.d.ts +9 -7
- package/dist/server/server.js +6 -6
- package/dist/server/server.mjs +5 -5
- package/dist/server/theme-bridge.js +8 -8
- package/dist/server/theme-bridge.mjs +2 -2
- package/dist/server/{types-oCM-fw4O.d.ts → types-0f4PIlgx.d.mts} +55 -2
- package/dist/server/{types-txWsSxN7.d.mts → types-BjgZt8xJ.d.mts} +63 -2
- package/dist/server/{types-BiRZnxDx.d.ts → types-C28kMfa1.d.ts} +256 -82
- package/dist/server/{types-CL916r6x.d.ts → types-DLBhEPSt.d.ts} +63 -2
- package/dist/server/{types-CdrJqlKx.d.mts → types-DuzJZKJI.d.mts} +256 -82
- package/dist/server/{types-DkKEctWn.d.mts → types-kOQyCFXO.d.ts} +55 -2
- package/dist/server/{validation-DzvDwwRo.d.mts → validation-BGuRo8P1.d.mts} +18 -5
- package/dist/server/{validation-CoU8uAiu.d.ts → validation-DU2YE7u5.d.ts} +18 -5
- package/package.json +5 -3
- package/dist/server/chunk-6JBKKV3G.js.map +0 -1
- package/dist/server/chunk-7BOIO2S7.mjs +0 -833
- package/dist/server/chunk-7BOIO2S7.mjs.map +0 -1
- package/dist/server/chunk-7DS4Q3GA.mjs.map +0 -1
- package/dist/server/chunk-BLKVTULP.js +0 -833
- package/dist/server/chunk-BLKVTULP.js.map +0 -1
- package/dist/server/chunk-EGTDJ4PL.js.map +0 -1
- package/dist/server/chunk-HOY77YBF.js.map +0 -1
- package/dist/server/chunk-I6K5REFT.mjs.map +0 -1
- package/dist/server/chunk-N3PX76AP.mjs.map +0 -1
- package/dist/server/chunk-R5B6IOFQ.js.map +0 -1
- package/dist/server/chunk-SWPHIUVE.js.map +0 -1
- package/dist/server/chunk-TKMA6D6U.js.map +0 -1
- package/dist/server/chunk-TNRADRPH.mjs.map +0 -1
- package/dist/server/chunk-USQF2XTU.mjs.map +0 -1
- package/dist/server/chunk-ZEAJW6T3.mjs.map +0 -1
- package/dist/server/loadPage-DUHBXDEW.js +0 -11
- package/dist/server/loadPage-LYVKY3WZ.mjs +0 -11
- /package/dist/server/{chunk-SPXMMX3C.mjs.map → chunk-OSF34JTQ.mjs.map} +0 -0
- /package/dist/server/{chunk-OP2GHK27.mjs.map → chunk-Z5ZA6Q4D.mjs.map} +0 -0
- /package/dist/server/{loadPage-LYVKY3WZ.mjs.map → loadPage-DNQTTRHL.mjs.map} +0 -0
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
|
|
42
|
-
var
|
|
42
|
+
var _chunkYYO3RIFOjs = require('./chunk-YYO3RIFO.js');
|
|
43
43
|
|
|
44
44
|
// ../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
|
|
45
45
|
function r(e) {
|
|
@@ -75,7 +75,14 @@ function getDirectImageUrl(supabaseUrl, storagePath, storageBucket = "media", op
|
|
|
75
75
|
|
|
76
76
|
// ../blocks/src/system/runtime/nodes/media.tsx
|
|
77
77
|
var _jsxruntime = require('react/jsx-runtime');
|
|
78
|
+
var _contextSupabaseUrl;
|
|
79
|
+
function setContextSupabaseUrl(url) {
|
|
80
|
+
_contextSupabaseUrl = _optionalChain([url, 'optionalAccess', _2 => _2.replace, 'call', _3 => _3(/\/$/, "")]);
|
|
81
|
+
}
|
|
78
82
|
function getSupabaseUrl() {
|
|
83
|
+
if (_contextSupabaseUrl) {
|
|
84
|
+
return _contextSupabaseUrl;
|
|
85
|
+
}
|
|
79
86
|
const url = process.env.NEXT_PUBLIC_SUPABASE_URL;
|
|
80
87
|
if (!url) {
|
|
81
88
|
throw new Error(
|
|
@@ -102,19 +109,19 @@ var MediaNode = ({ value, className, style }) => {
|
|
|
102
109
|
"div",
|
|
103
110
|
{
|
|
104
111
|
className: clsx_default("flex h-48 w-full items-center justify-center", className),
|
|
105
|
-
style:
|
|
106
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm", style:
|
|
112
|
+
style: _chunkYYO3RIFOjs.mergeStyles.call(void 0, _chunkYYO3RIFOjs.backgroundColorStyle.call(void 0, "neutral-200"), style),
|
|
113
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm", style: _chunkYYO3RIFOjs.textColorStyle.call(void 0, "neutral-600"), children: "Image unavailable" })
|
|
107
114
|
}
|
|
108
115
|
);
|
|
109
116
|
}
|
|
110
|
-
const hotspotStyle = _optionalChain([value, 'access',
|
|
117
|
+
const hotspotStyle = _optionalChain([value, 'access', _4 => _4.transform, 'optionalAccess', _5 => _5.hotspot]) ? { objectPosition: `${value.transform.hotspot.x * 100}% ${value.transform.hotspot.y * 100}%` } : void 0;
|
|
111
118
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
112
119
|
"img",
|
|
113
120
|
{
|
|
114
121
|
src: imageUrl,
|
|
115
122
|
alt: _nullishCoalesce(value.alt, () => ( "")),
|
|
116
123
|
className,
|
|
117
|
-
style:
|
|
124
|
+
style: _chunkYYO3RIFOjs.mergeStyles.call(void 0, style, hotspotStyle),
|
|
118
125
|
loading: "lazy"
|
|
119
126
|
}
|
|
120
127
|
);
|
|
@@ -648,8 +655,8 @@ function getLabWhitePoint() {
|
|
|
648
655
|
var lab2rgb = (...args) => {
|
|
649
656
|
args = unpack_default(args, "lab");
|
|
650
657
|
const [L, a, b] = args;
|
|
651
|
-
const [x, y,
|
|
652
|
-
const [r2, g, b_] = xyz2rgb(x, y,
|
|
658
|
+
const [x, y, z7] = lab2xyz(L, a, b);
|
|
659
|
+
const [r2, g, b_] = xyz2rgb(x, y, z7);
|
|
653
660
|
return [r2, g, b_, args.length > 3 ? args[3] : 1];
|
|
654
661
|
};
|
|
655
662
|
var lab2xyz = (L, a, b) => {
|
|
@@ -664,15 +671,15 @@ var lab2xyz = (L, a, b) => {
|
|
|
664
671
|
const zr = fz3 > kE ? fz3 : (116 * fz - 16) / kK;
|
|
665
672
|
const x = xr * Xn;
|
|
666
673
|
const y = yr * Yn;
|
|
667
|
-
const
|
|
668
|
-
return [x, y,
|
|
674
|
+
const z7 = zr * Zn;
|
|
675
|
+
return [x, y, z7];
|
|
669
676
|
};
|
|
670
677
|
var compand = (linear) => {
|
|
671
678
|
const sign = Math.sign(linear);
|
|
672
679
|
linear = Math.abs(linear);
|
|
673
680
|
return (linear <= 31308e-7 ? linear * 12.92 : 1.055 * Math.pow(linear, 1 / 2.4) - 0.055) * sign;
|
|
674
681
|
};
|
|
675
|
-
var xyz2rgb = (x, y,
|
|
682
|
+
var xyz2rgb = (x, y, z7) => {
|
|
676
683
|
const { MtxAdaptMa, MtxAdaptMaI, MtxXYZ2RGB, RefWhiteRGB, Xn, Yn, Zn } = lab_constants_default;
|
|
677
684
|
const As = Xn * MtxAdaptMa.m00 + Yn * MtxAdaptMa.m10 + Zn * MtxAdaptMa.m20;
|
|
678
685
|
const Bs = Xn * MtxAdaptMa.m01 + Yn * MtxAdaptMa.m11 + Zn * MtxAdaptMa.m21;
|
|
@@ -680,9 +687,9 @@ var xyz2rgb = (x, y, z5) => {
|
|
|
680
687
|
const Ad = RefWhiteRGB.X * MtxAdaptMa.m00 + RefWhiteRGB.Y * MtxAdaptMa.m10 + RefWhiteRGB.Z * MtxAdaptMa.m20;
|
|
681
688
|
const Bd = RefWhiteRGB.X * MtxAdaptMa.m01 + RefWhiteRGB.Y * MtxAdaptMa.m11 + RefWhiteRGB.Z * MtxAdaptMa.m21;
|
|
682
689
|
const Cd = RefWhiteRGB.X * MtxAdaptMa.m02 + RefWhiteRGB.Y * MtxAdaptMa.m12 + RefWhiteRGB.Z * MtxAdaptMa.m22;
|
|
683
|
-
const X1 = (x * MtxAdaptMa.m00 + y * MtxAdaptMa.m10 +
|
|
684
|
-
const Y1 = (x * MtxAdaptMa.m01 + y * MtxAdaptMa.m11 +
|
|
685
|
-
const Z1 = (x * MtxAdaptMa.m02 + y * MtxAdaptMa.m12 +
|
|
690
|
+
const X1 = (x * MtxAdaptMa.m00 + y * MtxAdaptMa.m10 + z7 * MtxAdaptMa.m20) * (Ad / As);
|
|
691
|
+
const Y1 = (x * MtxAdaptMa.m01 + y * MtxAdaptMa.m11 + z7 * MtxAdaptMa.m21) * (Bd / Bs);
|
|
692
|
+
const Z1 = (x * MtxAdaptMa.m02 + y * MtxAdaptMa.m12 + z7 * MtxAdaptMa.m22) * (Cd / Cs);
|
|
686
693
|
const X2 = X1 * MtxAdaptMaI.m00 + Y1 * MtxAdaptMaI.m10 + Z1 * MtxAdaptMaI.m20;
|
|
687
694
|
const Y2 = X1 * MtxAdaptMaI.m01 + Y1 * MtxAdaptMaI.m11 + Z1 * MtxAdaptMaI.m21;
|
|
688
695
|
const Z2 = X1 * MtxAdaptMaI.m02 + Y1 * MtxAdaptMaI.m12 + Z1 * MtxAdaptMaI.m22;
|
|
@@ -702,15 +709,15 @@ var lab2rgb_default = lab2rgb;
|
|
|
702
709
|
// ../../node_modules/.pnpm/chroma-js@3.1.2/node_modules/chroma-js/src/io/lab/rgb2lab.js
|
|
703
710
|
var rgb2lab = (...args) => {
|
|
704
711
|
const [r2, g, b, ...rest] = unpack_default(args, "rgb");
|
|
705
|
-
const [x, y,
|
|
706
|
-
const [L, a, b_] = xyz2lab(x, y,
|
|
712
|
+
const [x, y, z7] = rgb2xyz(r2, g, b);
|
|
713
|
+
const [L, a, b_] = xyz2lab(x, y, z7);
|
|
707
714
|
return [L, a, b_, ...rest.length > 0 && rest[0] < 1 ? [rest[0]] : []];
|
|
708
715
|
};
|
|
709
|
-
function xyz2lab(x, y,
|
|
716
|
+
function xyz2lab(x, y, z7) {
|
|
710
717
|
const { Xn, Yn, Zn, kE, kK } = lab_constants_default;
|
|
711
718
|
const xr = x / Xn;
|
|
712
719
|
const yr = y / Yn;
|
|
713
|
-
const zr =
|
|
720
|
+
const zr = z7 / Zn;
|
|
714
721
|
const fx = xr > kE ? Math.pow(xr, 1 / 3) : (kK * xr + 16) / 116;
|
|
715
722
|
const fy = yr > kE ? Math.pow(yr, 1 / 3) : (kK * yr + 16) / 116;
|
|
716
723
|
const fz = zr > kE ? Math.pow(zr, 1 / 3) : (kK * zr + 16) / 116;
|
|
@@ -729,20 +736,20 @@ var rgb2xyz = (r2, g, b) => {
|
|
|
729
736
|
const { MtxRGB2XYZ, MtxAdaptMa, MtxAdaptMaI, Xn, Yn, Zn, As, Bs, Cs } = lab_constants_default;
|
|
730
737
|
let x = r2 * MtxRGB2XYZ.m00 + g * MtxRGB2XYZ.m10 + b * MtxRGB2XYZ.m20;
|
|
731
738
|
let y = r2 * MtxRGB2XYZ.m01 + g * MtxRGB2XYZ.m11 + b * MtxRGB2XYZ.m21;
|
|
732
|
-
let
|
|
739
|
+
let z7 = r2 * MtxRGB2XYZ.m02 + g * MtxRGB2XYZ.m12 + b * MtxRGB2XYZ.m22;
|
|
733
740
|
const Ad = Xn * MtxAdaptMa.m00 + Yn * MtxAdaptMa.m10 + Zn * MtxAdaptMa.m20;
|
|
734
741
|
const Bd = Xn * MtxAdaptMa.m01 + Yn * MtxAdaptMa.m11 + Zn * MtxAdaptMa.m21;
|
|
735
742
|
const Cd = Xn * MtxAdaptMa.m02 + Yn * MtxAdaptMa.m12 + Zn * MtxAdaptMa.m22;
|
|
736
|
-
let X = x * MtxAdaptMa.m00 + y * MtxAdaptMa.m10 +
|
|
737
|
-
let Y = x * MtxAdaptMa.m01 + y * MtxAdaptMa.m11 +
|
|
738
|
-
let Z = x * MtxAdaptMa.m02 + y * MtxAdaptMa.m12 +
|
|
743
|
+
let X = x * MtxAdaptMa.m00 + y * MtxAdaptMa.m10 + z7 * MtxAdaptMa.m20;
|
|
744
|
+
let Y = x * MtxAdaptMa.m01 + y * MtxAdaptMa.m11 + z7 * MtxAdaptMa.m21;
|
|
745
|
+
let Z = x * MtxAdaptMa.m02 + y * MtxAdaptMa.m12 + z7 * MtxAdaptMa.m22;
|
|
739
746
|
X *= Ad / As;
|
|
740
747
|
Y *= Bd / Bs;
|
|
741
748
|
Z *= Cd / Cs;
|
|
742
749
|
x = X * MtxAdaptMaI.m00 + Y * MtxAdaptMaI.m10 + Z * MtxAdaptMaI.m20;
|
|
743
750
|
y = X * MtxAdaptMaI.m01 + Y * MtxAdaptMaI.m11 + Z * MtxAdaptMaI.m21;
|
|
744
|
-
|
|
745
|
-
return [x, y,
|
|
751
|
+
z7 = X * MtxAdaptMaI.m02 + Y * MtxAdaptMaI.m12 + Z * MtxAdaptMaI.m22;
|
|
752
|
+
return [x, y, z7];
|
|
746
753
|
};
|
|
747
754
|
var rgb2lab_default = rgb2lab;
|
|
748
755
|
|
|
@@ -3071,7 +3078,7 @@ function generateShades(hexColor, name) {
|
|
|
3071
3078
|
900: 0.1,
|
|
3072
3079
|
950: 0.05
|
|
3073
3080
|
};
|
|
3074
|
-
const lightness = lightnessMap[shadeNumber];
|
|
3081
|
+
const lightness = _nullishCoalesce(lightnessMap[shadeNumber], () => ( 0.5));
|
|
3075
3082
|
const shadeColor = base.luminance(lightness).hex();
|
|
3076
3083
|
return {
|
|
3077
3084
|
name: shadeName,
|
|
@@ -3098,7 +3105,7 @@ function generateNeutralScale({
|
|
|
3098
3105
|
for (let i = 0; i < count; i++) {
|
|
3099
3106
|
const t = i / (count - 1);
|
|
3100
3107
|
const tone = isDark ? mix(0.06, 0.92, t) : mix(0.98, 0.1, t);
|
|
3101
|
-
const hex2 =
|
|
3108
|
+
const hex2 = _chunkYYO3RIFOjs.oklchToHexGamut.call(void 0, tone, 0.02, warm ? 85 : 250);
|
|
3102
3109
|
const name = `neutral-${shadeNames[i]}`;
|
|
3103
3110
|
scale.push({ name, hex: hex2 });
|
|
3104
3111
|
}
|
|
@@ -3118,7 +3125,7 @@ function colorsToMap(palette) {
|
|
|
3118
3125
|
}
|
|
3119
3126
|
function isBackgroundDark(hex2) {
|
|
3120
3127
|
try {
|
|
3121
|
-
return
|
|
3128
|
+
return _chunkYYO3RIFOjs.featuresFromHex.call(void 0, hex2).Y < 0.5;
|
|
3122
3129
|
} catch (e2) {
|
|
3123
3130
|
return false;
|
|
3124
3131
|
}
|
|
@@ -3141,8 +3148,8 @@ function expandPalette(palette) {
|
|
|
3141
3148
|
}
|
|
3142
3149
|
if (base.text) expanded.body = base.text;
|
|
3143
3150
|
const isDark = base.background ? isBackgroundDark(base.background) : false;
|
|
3144
|
-
const isDarkMode = _optionalChain([palette, 'access',
|
|
3145
|
-
expanded.mutedText = isDarkMode ? expanded["neutral-600"] : expanded["neutral-500"];
|
|
3151
|
+
const isDarkMode = _optionalChain([palette, 'access', _6 => _6.meta, 'optionalAccess', _7 => _7.mode]) === "dark" || isDark;
|
|
3152
|
+
expanded.mutedText = isDarkMode ? _nullishCoalesce(expanded["neutral-600"], () => ( "#666")) : _nullishCoalesce(expanded["neutral-500"], () => ( "#888"));
|
|
3146
3153
|
return expanded;
|
|
3147
3154
|
}
|
|
3148
3155
|
|
|
@@ -3151,7 +3158,7 @@ function generateCssVars(palette) {
|
|
|
3151
3158
|
const cssVars = {};
|
|
3152
3159
|
Object.entries(palette).forEach(([key, value]) => {
|
|
3153
3160
|
if (value !== null && value !== void 0) {
|
|
3154
|
-
const { r: r2, g, b } =
|
|
3161
|
+
const { r: r2, g, b } = _chunkYYO3RIFOjs.hexToRgb.call(void 0, value);
|
|
3155
3162
|
cssVars[`--tb-${key}`] = `${r2} ${g} ${b}`;
|
|
3156
3163
|
}
|
|
3157
3164
|
});
|
|
@@ -3210,6 +3217,83 @@ function generateShadowCssVars(theme) {
|
|
|
3210
3217
|
};
|
|
3211
3218
|
}
|
|
3212
3219
|
|
|
3220
|
+
// ../blocks/src/theme/tokens/resolver.ts
|
|
3221
|
+
var TokenResolver = class {
|
|
3222
|
+
constructor(theme) {
|
|
3223
|
+
this.theme = theme;
|
|
3224
|
+
}
|
|
3225
|
+
/**
|
|
3226
|
+
* Resolve a color token to a CSS variable reference wrapped in rgb()
|
|
3227
|
+
*
|
|
3228
|
+
* @param token - Token name (e.g., 'primary-500', 'white', 'text-900')
|
|
3229
|
+
* @returns CSS rgb() function with var reference (e.g., 'rgb(var(--tb-primary-500))')
|
|
3230
|
+
*
|
|
3231
|
+
* Note: CSS variables are stored as RGB channels (e.g., "37 99 235") following Tailwind convention,
|
|
3232
|
+
* so we must wrap them with rgb() to create a valid color value.
|
|
3233
|
+
*
|
|
3234
|
+
* @example
|
|
3235
|
+
* resolver.getColor('primary-500') // => 'rgb(var(--tb-primary-500))'
|
|
3236
|
+
* resolver.getColor('white') // => 'rgb(var(--tb-white))'
|
|
3237
|
+
*/
|
|
3238
|
+
getColor(token) {
|
|
3239
|
+
if (!this.tokenExists(token)) {
|
|
3240
|
+
console.warn(
|
|
3241
|
+
`[TokenResolver] Color token "${token}" not found in theme palette. Button may render incorrectly.`
|
|
3242
|
+
);
|
|
3243
|
+
}
|
|
3244
|
+
return `rgb(var(--tb-${token}))`;
|
|
3245
|
+
}
|
|
3246
|
+
/**
|
|
3247
|
+
* Adjust a color token's shade by a given amount
|
|
3248
|
+
*
|
|
3249
|
+
* @param token - Base token (e.g., 'primary-500')
|
|
3250
|
+
* @param amount - Shade adjustment (+100 = darker, -100 = lighter)
|
|
3251
|
+
* @returns Adjusted token name (e.g., 'primary-600')
|
|
3252
|
+
*
|
|
3253
|
+
* @example
|
|
3254
|
+
* resolver.adjustShade('primary-500', 100) // => 'primary-600' (darker)
|
|
3255
|
+
* resolver.adjustShade('primary-500', -100) // => 'primary-400' (lighter)
|
|
3256
|
+
*/
|
|
3257
|
+
adjustShade(token, amount) {
|
|
3258
|
+
const parts = token.split("-");
|
|
3259
|
+
if (parts.length < 2) {
|
|
3260
|
+
const newShade2 = Math.max(100, Math.min(900, 500 + amount));
|
|
3261
|
+
return `${token}-${newShade2}`;
|
|
3262
|
+
}
|
|
3263
|
+
const base = parts.slice(0, -1).join("-");
|
|
3264
|
+
const shade = parseInt(_nullishCoalesce(parts[parts.length - 1], () => ( "")), 10);
|
|
3265
|
+
if (isNaN(shade)) {
|
|
3266
|
+
console.warn(
|
|
3267
|
+
`[TokenResolver] Cannot adjust shade for non-shade token "${token}". Returning original token.`
|
|
3268
|
+
);
|
|
3269
|
+
return token;
|
|
3270
|
+
}
|
|
3271
|
+
const newShade = Math.max(100, Math.min(900, shade + amount));
|
|
3272
|
+
return `${base}-${newShade}`;
|
|
3273
|
+
}
|
|
3274
|
+
/**
|
|
3275
|
+
* Check if a token exists in the theme palette
|
|
3276
|
+
*
|
|
3277
|
+
* @param token - Token name to check
|
|
3278
|
+
* @returns True if token exists in theme
|
|
3279
|
+
*/
|
|
3280
|
+
tokenExists(token) {
|
|
3281
|
+
const commonTokens = ["white", "black", "transparent"];
|
|
3282
|
+
if (commonTokens.includes(token)) {
|
|
3283
|
+
return true;
|
|
3284
|
+
}
|
|
3285
|
+
const parts = token.split("-");
|
|
3286
|
+
if (parts.length >= 2) {
|
|
3287
|
+
const lastPart = _nullishCoalesce(parts[parts.length - 1], () => ( ""));
|
|
3288
|
+
const shade = parseInt(lastPart, 10);
|
|
3289
|
+
if (!isNaN(shade) && shade >= 100 && shade <= 900 && shade % 100 === 0) {
|
|
3290
|
+
return true;
|
|
3291
|
+
}
|
|
3292
|
+
}
|
|
3293
|
+
return true;
|
|
3294
|
+
}
|
|
3295
|
+
};
|
|
3296
|
+
|
|
3213
3297
|
// ../blocks/src/theme/buttons/effects/presets/background.ts
|
|
3214
3298
|
var darkenBackgroundEffect = {
|
|
3215
3299
|
id: "darken-background",
|
|
@@ -3217,6 +3301,7 @@ var darkenBackgroundEffect = {
|
|
|
3217
3301
|
description: "Darkens the background color on hover",
|
|
3218
3302
|
category: "background",
|
|
3219
3303
|
pseudoElement: "none",
|
|
3304
|
+
applicableTo: ["button"],
|
|
3220
3305
|
customizableOption: {
|
|
3221
3306
|
name: "amount",
|
|
3222
3307
|
type: "number",
|
|
@@ -3248,6 +3333,7 @@ var lightenBackgroundEffect = {
|
|
|
3248
3333
|
description: "Lightens the background color on hover",
|
|
3249
3334
|
category: "background",
|
|
3250
3335
|
pseudoElement: "none",
|
|
3336
|
+
applicableTo: ["button"],
|
|
3251
3337
|
customizableOption: {
|
|
3252
3338
|
name: "amount",
|
|
3253
3339
|
type: "number",
|
|
@@ -3279,6 +3365,7 @@ var fadeBackgroundEffect = {
|
|
|
3279
3365
|
description: "Reduces background opacity on hover",
|
|
3280
3366
|
category: "background",
|
|
3281
3367
|
pseudoElement: "none",
|
|
3368
|
+
applicableTo: ["button", "nav-link"],
|
|
3282
3369
|
customizableOption: {
|
|
3283
3370
|
name: "opacity",
|
|
3284
3371
|
type: "percentage",
|
|
@@ -3301,6 +3388,7 @@ var opacityReduceEffect = {
|
|
|
3301
3388
|
description: "Reduces button opacity on hover by a percentage",
|
|
3302
3389
|
category: "background",
|
|
3303
3390
|
pseudoElement: "none",
|
|
3391
|
+
applicableTo: ["button", "nav-link"],
|
|
3304
3392
|
customizableOption: {
|
|
3305
3393
|
name: "reduction",
|
|
3306
3394
|
type: "percentage",
|
|
@@ -3324,6 +3412,7 @@ var animatedGradientEffect = {
|
|
|
3324
3412
|
description: "Animates gradient position on hover",
|
|
3325
3413
|
category: "background",
|
|
3326
3414
|
pseudoElement: "none",
|
|
3415
|
+
applicableTo: ["button"],
|
|
3327
3416
|
customizableOption: {
|
|
3328
3417
|
name: "direction",
|
|
3329
3418
|
type: "select",
|
|
@@ -3363,6 +3452,7 @@ var backgroundOnHoverEffect = {
|
|
|
3363
3452
|
description: "Adds background color on hover",
|
|
3364
3453
|
category: "background",
|
|
3365
3454
|
pseudoElement: "none",
|
|
3455
|
+
applicableTo: ["button", "nav-link"],
|
|
3366
3456
|
customizableOption: {
|
|
3367
3457
|
name: "colorToken",
|
|
3368
3458
|
type: "select",
|
|
@@ -3388,6 +3478,7 @@ var backgroundOnHoverAlphaEffect = {
|
|
|
3388
3478
|
description: "Adds semi-transparent background on hover",
|
|
3389
3479
|
category: "background",
|
|
3390
3480
|
pseudoElement: "none",
|
|
3481
|
+
applicableTo: ["button", "nav-link"],
|
|
3391
3482
|
customizableOption: {
|
|
3392
3483
|
name: "opacity",
|
|
3393
3484
|
type: "percentage",
|
|
@@ -3409,6 +3500,33 @@ var backgroundOnHoverAlphaEffect = {
|
|
|
3409
3500
|
}
|
|
3410
3501
|
};
|
|
3411
3502
|
|
|
3503
|
+
// ../blocks/src/theme/buttons/effects/cssUtils.ts
|
|
3504
|
+
var STATE_SELECTORS = {
|
|
3505
|
+
hover: ':hover, [data-force-hover="true"]',
|
|
3506
|
+
active: ":active",
|
|
3507
|
+
focus: ":focus-visible",
|
|
3508
|
+
base: ""
|
|
3509
|
+
};
|
|
3510
|
+
function getStateSelector(themeId, variantId, state) {
|
|
3511
|
+
const stateSelector = STATE_SELECTORS[state];
|
|
3512
|
+
if (state === "base") {
|
|
3513
|
+
return `:where([data-theme-scope="${themeId}"]) .${variantId}`;
|
|
3514
|
+
}
|
|
3515
|
+
if (state === "hover") {
|
|
3516
|
+
return `:where([data-theme-scope="${themeId}"]) .${variantId}:hover,
|
|
3517
|
+
:where([data-theme-scope="${themeId}"]) .${variantId}[data-force-hover="true"]`;
|
|
3518
|
+
}
|
|
3519
|
+
return `:where([data-theme-scope="${themeId}"]) .${variantId}${stateSelector}`;
|
|
3520
|
+
}
|
|
3521
|
+
function generateStateCSS(themeId, variantId, state, cssProperties) {
|
|
3522
|
+
const selector = getStateSelector(themeId, variantId, state);
|
|
3523
|
+
return `
|
|
3524
|
+
${selector} {
|
|
3525
|
+
${cssProperties}
|
|
3526
|
+
}
|
|
3527
|
+
`;
|
|
3528
|
+
}
|
|
3529
|
+
|
|
3412
3530
|
// ../blocks/src/theme/buttons/effects/presets/shadow.ts
|
|
3413
3531
|
var borderGlowEffect = {
|
|
3414
3532
|
id: "border-glow",
|
|
@@ -3416,6 +3534,7 @@ var borderGlowEffect = {
|
|
|
3416
3534
|
description: "Adds a glowing shadow on hover",
|
|
3417
3535
|
category: "shadow",
|
|
3418
3536
|
pseudoElement: "none",
|
|
3537
|
+
applicableTo: ["button", "nav-link"],
|
|
3419
3538
|
customizableOption: {
|
|
3420
3539
|
name: "glowColorToken",
|
|
3421
3540
|
type: "colorToken",
|
|
@@ -3426,11 +3545,7 @@ var borderGlowEffect = {
|
|
|
3426
3545
|
const { themeId, variantId, options, tokens } = ctx;
|
|
3427
3546
|
const glowToken = options.glowColorToken || "primary-400";
|
|
3428
3547
|
const glowColor = tokens.getColor(glowToken);
|
|
3429
|
-
return `
|
|
3430
|
-
:where([data-theme-scope="${themeId}"]) .${variantId}:hover {
|
|
3431
|
-
box-shadow: 0 0 15px ${glowColor};
|
|
3432
|
-
}
|
|
3433
|
-
`;
|
|
3548
|
+
return generateStateCSS(themeId, variantId, "hover", `box-shadow: 0 0 15px ${glowColor};`);
|
|
3434
3549
|
}
|
|
3435
3550
|
};
|
|
3436
3551
|
var dropShadowEffect = {
|
|
@@ -3439,6 +3554,7 @@ var dropShadowEffect = {
|
|
|
3439
3554
|
description: "Adds an elevated shadow on hover",
|
|
3440
3555
|
category: "shadow",
|
|
3441
3556
|
pseudoElement: "none",
|
|
3557
|
+
applicableTo: ["button"],
|
|
3442
3558
|
customizableOption: {
|
|
3443
3559
|
name: "intensity",
|
|
3444
3560
|
type: "select",
|
|
@@ -3454,11 +3570,7 @@ var dropShadowEffect = {
|
|
|
3454
3570
|
medium: "0 10px 15px rgba(0, 0, 0, 0.15)",
|
|
3455
3571
|
strong: "0 20px 25px rgba(0, 0, 0, 0.2)"
|
|
3456
3572
|
};
|
|
3457
|
-
return `
|
|
3458
|
-
:where([data-theme-scope="${themeId}"]) .${variantId}:hover {
|
|
3459
|
-
box-shadow: ${shadows[intensity]};
|
|
3460
|
-
}
|
|
3461
|
-
`;
|
|
3573
|
+
return generateStateCSS(themeId, variantId, "hover", `box-shadow: ${shadows[intensity]};`);
|
|
3462
3574
|
}
|
|
3463
3575
|
};
|
|
3464
3576
|
var innerShadowEffect = {
|
|
@@ -3467,6 +3579,7 @@ var innerShadowEffect = {
|
|
|
3467
3579
|
description: "Adds an inset shadow for a pressed appearance",
|
|
3468
3580
|
category: "shadow",
|
|
3469
3581
|
pseudoElement: "none",
|
|
3582
|
+
applicableTo: ["button"],
|
|
3470
3583
|
generateCSS: (ctx) => {
|
|
3471
3584
|
const { themeId, variantId } = ctx;
|
|
3472
3585
|
return `
|
|
@@ -3482,6 +3595,7 @@ var neumorphicShadowEffect = {
|
|
|
3482
3595
|
description: "Dual shadows for soft UI design (raised or pressed)",
|
|
3483
3596
|
category: "shadow",
|
|
3484
3597
|
pseudoElement: "none",
|
|
3598
|
+
applicableTo: ["button", "nav-link"],
|
|
3485
3599
|
customizableOption: {
|
|
3486
3600
|
name: "mode",
|
|
3487
3601
|
type: "select",
|
|
@@ -3524,6 +3638,7 @@ var outerGlowEffect = {
|
|
|
3524
3638
|
description: "Creates an outer glow around the button",
|
|
3525
3639
|
category: "shadow",
|
|
3526
3640
|
pseudoElement: "none",
|
|
3641
|
+
applicableTo: ["button", "nav-link"],
|
|
3527
3642
|
customizableOption: {
|
|
3528
3643
|
name: "spread",
|
|
3529
3644
|
type: "number",
|
|
@@ -3536,7 +3651,7 @@ var outerGlowEffect = {
|
|
|
3536
3651
|
let glowColor;
|
|
3537
3652
|
if (options.glowColorToken && typeof options.glowColorToken === "string") {
|
|
3538
3653
|
glowColor = tokens.getColor(options.glowColorToken);
|
|
3539
|
-
} else if (_optionalChain([buttonConfig, 'access',
|
|
3654
|
+
} else if (_optionalChain([buttonConfig, 'access', _8 => _8.border, 'optionalAccess', _9 => _9.colorToken])) {
|
|
3540
3655
|
glowColor = tokens.getColor(buttonConfig.border.colorToken);
|
|
3541
3656
|
} else if (buttonConfig.background.type === "solid") {
|
|
3542
3657
|
glowColor = tokens.getColor(buttonConfig.background.colorToken);
|
|
@@ -3558,6 +3673,7 @@ var retro3DShadowEffect = {
|
|
|
3558
3673
|
description: "3D pressed shadow with vertical movement (retro style)",
|
|
3559
3674
|
category: "shadow",
|
|
3560
3675
|
pseudoElement: "none",
|
|
3676
|
+
applicableTo: ["button"],
|
|
3561
3677
|
generateCSS: (ctx) => {
|
|
3562
3678
|
const { themeId, variantId } = ctx;
|
|
3563
3679
|
return `
|
|
@@ -3590,6 +3706,7 @@ var scaleUpEffect = {
|
|
|
3590
3706
|
description: "Slightly enlarges the button on hover",
|
|
3591
3707
|
category: "transform",
|
|
3592
3708
|
pseudoElement: "none",
|
|
3709
|
+
applicableTo: ["button", "nav-link"],
|
|
3593
3710
|
customizableOption: {
|
|
3594
3711
|
name: "scale",
|
|
3595
3712
|
type: "select",
|
|
@@ -3600,11 +3717,7 @@ var scaleUpEffect = {
|
|
|
3600
3717
|
generateCSS: (ctx) => {
|
|
3601
3718
|
const { themeId, variantId, options } = ctx;
|
|
3602
3719
|
const scale = options.scale || "1.05";
|
|
3603
|
-
return `
|
|
3604
|
-
:where([data-theme-scope="${themeId}"]) .${variantId}:hover {
|
|
3605
|
-
transform: scale(${scale});
|
|
3606
|
-
}
|
|
3607
|
-
`;
|
|
3720
|
+
return generateStateCSS(themeId, variantId, "hover", `transform: scale(${scale});`);
|
|
3608
3721
|
}
|
|
3609
3722
|
};
|
|
3610
3723
|
var scaleDownEffect = {
|
|
@@ -3613,6 +3726,7 @@ var scaleDownEffect = {
|
|
|
3613
3726
|
description: "Slightly shrinks the button when clicked",
|
|
3614
3727
|
category: "transform",
|
|
3615
3728
|
pseudoElement: "none",
|
|
3729
|
+
applicableTo: ["button", "nav-link"],
|
|
3616
3730
|
customizableOption: {
|
|
3617
3731
|
name: "scale",
|
|
3618
3732
|
type: "select",
|
|
@@ -3636,6 +3750,7 @@ var liftEffect = {
|
|
|
3636
3750
|
description: "Lifts the button upward on hover",
|
|
3637
3751
|
category: "transform",
|
|
3638
3752
|
pseudoElement: "none",
|
|
3753
|
+
applicableTo: ["button", "nav-link"],
|
|
3639
3754
|
customizableOption: {
|
|
3640
3755
|
name: "amount",
|
|
3641
3756
|
type: "select",
|
|
@@ -3646,11 +3761,7 @@ var liftEffect = {
|
|
|
3646
3761
|
generateCSS: (ctx) => {
|
|
3647
3762
|
const { themeId, variantId, options } = ctx;
|
|
3648
3763
|
const amount = options.amount || "0.5";
|
|
3649
|
-
return `
|
|
3650
|
-
:where([data-theme-scope="${themeId}"]) .${variantId}:hover {
|
|
3651
|
-
transform: translateY(-${amount}rem);
|
|
3652
|
-
}
|
|
3653
|
-
`;
|
|
3764
|
+
return generateStateCSS(themeId, variantId, "hover", `transform: translateY(-${amount}rem);`);
|
|
3654
3765
|
}
|
|
3655
3766
|
};
|
|
3656
3767
|
var pressDownEffect = {
|
|
@@ -3659,6 +3770,7 @@ var pressDownEffect = {
|
|
|
3659
3770
|
description: "Translates button to shadow position and removes shadow on hover",
|
|
3660
3771
|
category: "transform",
|
|
3661
3772
|
pseudoElement: "none",
|
|
3773
|
+
applicableTo: ["button"],
|
|
3662
3774
|
generateCSS: (ctx) => {
|
|
3663
3775
|
const { themeId, variantId, theme } = ctx;
|
|
3664
3776
|
const shadowConfig = theme.shadow;
|
|
@@ -3671,12 +3783,12 @@ var pressDownEffect = {
|
|
|
3671
3783
|
const offset = elevationOffsets[shadowConfig.elevation];
|
|
3672
3784
|
const xOffset = (shadowConfig.position || "bottom") === "bottom-right" ? offset : 0;
|
|
3673
3785
|
const yOffset = offset;
|
|
3674
|
-
return
|
|
3675
|
-
|
|
3676
|
-
|
|
3677
|
-
|
|
3678
|
-
}
|
|
3679
|
-
|
|
3786
|
+
return generateStateCSS(
|
|
3787
|
+
themeId,
|
|
3788
|
+
variantId,
|
|
3789
|
+
"hover",
|
|
3790
|
+
`transform: translate(${xOffset}px, ${yOffset}px); box-shadow: none;`
|
|
3791
|
+
);
|
|
3680
3792
|
}
|
|
3681
3793
|
};
|
|
3682
3794
|
var popEffect = {
|
|
@@ -3685,6 +3797,7 @@ var popEffect = {
|
|
|
3685
3797
|
description: "Scales up and tilts the button on hover for a playful pop effect",
|
|
3686
3798
|
category: "transform",
|
|
3687
3799
|
pseudoElement: "none",
|
|
3800
|
+
applicableTo: ["button"],
|
|
3688
3801
|
customizableOption: {
|
|
3689
3802
|
name: "intensity",
|
|
3690
3803
|
type: "select",
|
|
@@ -3701,11 +3814,12 @@ var popEffect = {
|
|
|
3701
3814
|
dramatic: { scale: 1.08, rotate: 3 }
|
|
3702
3815
|
};
|
|
3703
3816
|
const config = intensityConfig[intensity] || intensityConfig.medium;
|
|
3704
|
-
return
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
|
|
3708
|
-
|
|
3817
|
+
return generateStateCSS(
|
|
3818
|
+
themeId,
|
|
3819
|
+
variantId,
|
|
3820
|
+
"hover",
|
|
3821
|
+
`transform: scale(${config.scale}) rotate(${config.rotate}deg);`
|
|
3822
|
+
);
|
|
3709
3823
|
}
|
|
3710
3824
|
};
|
|
3711
3825
|
|
|
@@ -3716,6 +3830,7 @@ var auroraGlowEffect = {
|
|
|
3716
3830
|
description: "Blurred gradient glow that appears on hover",
|
|
3717
3831
|
category: "overlay",
|
|
3718
3832
|
pseudoElement: "before",
|
|
3833
|
+
applicableTo: ["button"],
|
|
3719
3834
|
customizableOption: {
|
|
3720
3835
|
name: "intensity",
|
|
3721
3836
|
type: "percentage",
|
|
@@ -3728,8 +3843,8 @@ var auroraGlowEffect = {
|
|
|
3728
3843
|
let toColor;
|
|
3729
3844
|
if (buttonConfig.background.type === "gradient") {
|
|
3730
3845
|
const stops = buttonConfig.background.stops;
|
|
3731
|
-
fromColor = tokens.getColor(stops[0]);
|
|
3732
|
-
toColor = tokens.getColor(stops[stops.length - 1]);
|
|
3846
|
+
fromColor = tokens.getColor(_nullishCoalesce(stops[0], () => ( "primary-500")));
|
|
3847
|
+
toColor = tokens.getColor(_nullishCoalesce(stops[stops.length - 1], () => ( "primary-300")));
|
|
3733
3848
|
} else if (buttonConfig.background.type === "solid") {
|
|
3734
3849
|
fromColor = tokens.getColor(buttonConfig.background.colorToken);
|
|
3735
3850
|
const lighterToken = tokens.adjustShade(buttonConfig.background.colorToken, -200);
|
|
@@ -3772,6 +3887,7 @@ var cosmicStardustEffect = {
|
|
|
3772
3887
|
description: "Rotating rainbow gradient glow (always visible, intensifies on hover)",
|
|
3773
3888
|
category: "overlay",
|
|
3774
3889
|
pseudoElement: "before",
|
|
3890
|
+
applicableTo: ["button"],
|
|
3775
3891
|
customizableOption: {
|
|
3776
3892
|
name: "speed",
|
|
3777
3893
|
type: "select",
|
|
@@ -3834,6 +3950,7 @@ var gradientBorderFillEffect = {
|
|
|
3834
3950
|
description: "Gradient border that fills on hover using ::before pseudo-element",
|
|
3835
3951
|
category: "overlay",
|
|
3836
3952
|
pseudoElement: "before",
|
|
3953
|
+
applicableTo: ["button"],
|
|
3837
3954
|
customizableOption: {
|
|
3838
3955
|
name: "borderWidth",
|
|
3839
3956
|
type: "number",
|
|
@@ -3890,6 +4007,7 @@ var animatedGradientBorderFillEffect = {
|
|
|
3890
4007
|
description: "Rotating gradient border that fills on hover",
|
|
3891
4008
|
category: "overlay",
|
|
3892
4009
|
pseudoElement: "before",
|
|
4010
|
+
applicableTo: ["button"],
|
|
3893
4011
|
customizableOption: {
|
|
3894
4012
|
name: "speed",
|
|
3895
4013
|
type: "select",
|
|
@@ -3965,6 +4083,7 @@ var borderBottomGrowEffect = {
|
|
|
3965
4083
|
description: "Animated underline that grows on hover",
|
|
3966
4084
|
category: "overlay",
|
|
3967
4085
|
pseudoElement: "after",
|
|
4086
|
+
applicableTo: ["button", "nav-link"],
|
|
3968
4087
|
customizableOption: {
|
|
3969
4088
|
name: "height",
|
|
3970
4089
|
type: "number",
|
|
@@ -4012,6 +4131,7 @@ var gradientTextEffect = {
|
|
|
4012
4131
|
description: "Gradient text using background-clip",
|
|
4013
4132
|
category: "text",
|
|
4014
4133
|
pseudoElement: "none",
|
|
4134
|
+
applicableTo: ["button"],
|
|
4015
4135
|
customizableOption: {
|
|
4016
4136
|
name: "solidOnHover",
|
|
4017
4137
|
type: "select",
|
|
@@ -4063,6 +4183,7 @@ var textColorChangeEffect = {
|
|
|
4063
4183
|
description: "Changes text color on hover",
|
|
4064
4184
|
category: "text",
|
|
4065
4185
|
pseudoElement: "none",
|
|
4186
|
+
applicableTo: ["button", "nav-link"],
|
|
4066
4187
|
customizableOption: {
|
|
4067
4188
|
name: "hoverColorToken",
|
|
4068
4189
|
type: "select",
|
|
@@ -4090,6 +4211,7 @@ var borderColorChangeEffect = {
|
|
|
4090
4211
|
description: "Changes border color on hover",
|
|
4091
4212
|
category: "border",
|
|
4092
4213
|
pseudoElement: "none",
|
|
4214
|
+
applicableTo: ["button", "nav-link"],
|
|
4093
4215
|
customizableOption: {
|
|
4094
4216
|
name: "hoverColorToken",
|
|
4095
4217
|
type: "select",
|
|
@@ -4115,6 +4237,7 @@ var sketchyBorderEffect = {
|
|
|
4115
4237
|
description: "Hand-drawn style with imperfect edges",
|
|
4116
4238
|
category: "border",
|
|
4117
4239
|
pseudoElement: "none",
|
|
4240
|
+
applicableTo: ["button"],
|
|
4118
4241
|
customizableOption: {
|
|
4119
4242
|
name: "intensity",
|
|
4120
4243
|
type: "select",
|
|
@@ -4162,6 +4285,7 @@ var pulseAnimationEffect = {
|
|
|
4162
4285
|
description: "Continuous pulse animation (opacity fade)",
|
|
4163
4286
|
category: "animation",
|
|
4164
4287
|
pseudoElement: "none",
|
|
4288
|
+
applicableTo: ["button", "nav-link"],
|
|
4165
4289
|
customizableOption: {
|
|
4166
4290
|
name: "speed",
|
|
4167
4291
|
type: "select",
|
|
@@ -4190,6 +4314,138 @@ var pulseAnimationEffect = {
|
|
|
4190
4314
|
}
|
|
4191
4315
|
};
|
|
4192
4316
|
|
|
4317
|
+
// ../blocks/src/theme/interactive/effects/nav-underline.ts
|
|
4318
|
+
var navUnderlineEffect = {
|
|
4319
|
+
id: "nav-underline",
|
|
4320
|
+
name: "Nav Underline",
|
|
4321
|
+
description: "Underline that appears or grows on hover",
|
|
4322
|
+
category: "overlay",
|
|
4323
|
+
pseudoElement: "after",
|
|
4324
|
+
applicableTo: ["nav-link"],
|
|
4325
|
+
customizableOption: {
|
|
4326
|
+
name: "style",
|
|
4327
|
+
type: "select",
|
|
4328
|
+
label: "Underline Style",
|
|
4329
|
+
default: "static",
|
|
4330
|
+
options: ["static", "grow"]
|
|
4331
|
+
},
|
|
4332
|
+
generateCSS: (ctx) => {
|
|
4333
|
+
const { themeId, variantId, options, tokens } = ctx;
|
|
4334
|
+
const style = options.style || "static";
|
|
4335
|
+
const colorToken = options.colorToken || "primary";
|
|
4336
|
+
const color = tokens.getColor(colorToken);
|
|
4337
|
+
const height = options.height || 2;
|
|
4338
|
+
if (style === "grow") {
|
|
4339
|
+
return `
|
|
4340
|
+
/* Setup nav link for pseudo-element */
|
|
4341
|
+
:where([data-theme-scope="${themeId}"]) .${variantId} {
|
|
4342
|
+
position: relative;
|
|
4343
|
+
}
|
|
4344
|
+
|
|
4345
|
+
/* Underline using ::after - starts at 0 width */
|
|
4346
|
+
:where([data-theme-scope="${themeId}"]) .${variantId}::after {
|
|
4347
|
+
content: '';
|
|
4348
|
+
position: absolute;
|
|
4349
|
+
bottom: 0;
|
|
4350
|
+
left: 50%;
|
|
4351
|
+
width: 0;
|
|
4352
|
+
height: ${height}px;
|
|
4353
|
+
background: ${color};
|
|
4354
|
+
transform: translateX(-50%);
|
|
4355
|
+
transition: width 200ms ease-in-out;
|
|
4356
|
+
}
|
|
4357
|
+
|
|
4358
|
+
/* Grow underline on hover */
|
|
4359
|
+
:where([data-theme-scope="${themeId}"]) .${variantId}:hover::after {
|
|
4360
|
+
width: 100%;
|
|
4361
|
+
}
|
|
4362
|
+
`;
|
|
4363
|
+
}
|
|
4364
|
+
return `
|
|
4365
|
+
/* Setup nav link for pseudo-element */
|
|
4366
|
+
:where([data-theme-scope="${themeId}"]) .${variantId} {
|
|
4367
|
+
position: relative;
|
|
4368
|
+
}
|
|
4369
|
+
|
|
4370
|
+
/* Hidden underline using ::after */
|
|
4371
|
+
:where([data-theme-scope="${themeId}"]) .${variantId}::after {
|
|
4372
|
+
content: '';
|
|
4373
|
+
position: absolute;
|
|
4374
|
+
bottom: 0;
|
|
4375
|
+
left: 0;
|
|
4376
|
+
width: 100%;
|
|
4377
|
+
height: ${height}px;
|
|
4378
|
+
background: ${color};
|
|
4379
|
+
opacity: 0;
|
|
4380
|
+
transition: opacity 150ms ease-in-out;
|
|
4381
|
+
}
|
|
4382
|
+
|
|
4383
|
+
/* Show underline on hover */
|
|
4384
|
+
:where([data-theme-scope="${themeId}"]) .${variantId}:hover::after {
|
|
4385
|
+
opacity: 1;
|
|
4386
|
+
}
|
|
4387
|
+
`;
|
|
4388
|
+
}
|
|
4389
|
+
};
|
|
4390
|
+
|
|
4391
|
+
// ../blocks/src/theme/interactive/effects/nav-frosted.ts
|
|
4392
|
+
var navFrostedBaseEffect = {
|
|
4393
|
+
id: "nav-frosted-base",
|
|
4394
|
+
name: "Nav Frosted Base",
|
|
4395
|
+
description: "Base frosted glass styling for nav links",
|
|
4396
|
+
category: "background",
|
|
4397
|
+
pseudoElement: "none",
|
|
4398
|
+
applicableTo: ["nav-link"],
|
|
4399
|
+
generateCSS: (ctx) => {
|
|
4400
|
+
const { themeId, variantId } = ctx;
|
|
4401
|
+
return `
|
|
4402
|
+
/* Frosted glass base state */
|
|
4403
|
+
:where([data-theme-scope="${themeId}"]) .${variantId} {
|
|
4404
|
+
background: rgba(255, 255, 255, 0.05);
|
|
4405
|
+
backdrop-filter: blur(4px);
|
|
4406
|
+
-webkit-backdrop-filter: blur(4px);
|
|
4407
|
+
transition: background 150ms ease, backdrop-filter 150ms ease;
|
|
4408
|
+
}
|
|
4409
|
+
`;
|
|
4410
|
+
}
|
|
4411
|
+
};
|
|
4412
|
+
var navFrostedHoverEffect = {
|
|
4413
|
+
id: "nav-frosted-hover",
|
|
4414
|
+
name: "Nav Frosted Hover",
|
|
4415
|
+
description: "Enhanced frosted glass on hover",
|
|
4416
|
+
category: "background",
|
|
4417
|
+
pseudoElement: "none",
|
|
4418
|
+
applicableTo: ["nav-link"],
|
|
4419
|
+
generateCSS: (ctx) => {
|
|
4420
|
+
const { themeId, variantId } = ctx;
|
|
4421
|
+
return `
|
|
4422
|
+
/* Frosted glass hover state */
|
|
4423
|
+
:where([data-theme-scope="${themeId}"]) .${variantId}:hover {
|
|
4424
|
+
background: rgba(255, 255, 255, 0.1);
|
|
4425
|
+
backdrop-filter: blur(8px);
|
|
4426
|
+
-webkit-backdrop-filter: blur(8px);
|
|
4427
|
+
}
|
|
4428
|
+
`;
|
|
4429
|
+
}
|
|
4430
|
+
};
|
|
4431
|
+
var navFrostedActiveEffect = {
|
|
4432
|
+
id: "nav-frosted-active",
|
|
4433
|
+
name: "Nav Frosted Active",
|
|
4434
|
+
description: "Frosted glass active/pressed state",
|
|
4435
|
+
category: "background",
|
|
4436
|
+
pseudoElement: "none",
|
|
4437
|
+
applicableTo: ["nav-link"],
|
|
4438
|
+
generateCSS: (ctx) => {
|
|
4439
|
+
const { themeId, variantId } = ctx;
|
|
4440
|
+
return `
|
|
4441
|
+
/* Frosted glass active state */
|
|
4442
|
+
:where([data-theme-scope="${themeId}"]) .${variantId}:active {
|
|
4443
|
+
background: rgba(255, 255, 255, 0.15);
|
|
4444
|
+
}
|
|
4445
|
+
`;
|
|
4446
|
+
}
|
|
4447
|
+
};
|
|
4448
|
+
|
|
4193
4449
|
// ../blocks/src/theme/buttons/effects/registry.ts
|
|
4194
4450
|
var EFFECT_PRESETS = [
|
|
4195
4451
|
// Background effects
|
|
@@ -4226,88 +4482,65 @@ var EFFECT_PRESETS = [
|
|
|
4226
4482
|
borderColorChangeEffect,
|
|
4227
4483
|
sketchyBorderEffect,
|
|
4228
4484
|
// Animation effects
|
|
4229
|
-
pulseAnimationEffect
|
|
4485
|
+
pulseAnimationEffect,
|
|
4486
|
+
// Nav-link specific effects
|
|
4487
|
+
navUnderlineEffect,
|
|
4488
|
+
navFrostedBaseEffect,
|
|
4489
|
+
navFrostedHoverEffect,
|
|
4490
|
+
navFrostedActiveEffect
|
|
4230
4491
|
];
|
|
4231
4492
|
function getEffectPreset(id) {
|
|
4232
4493
|
return EFFECT_PRESETS.find((preset) => preset.id === id);
|
|
4233
4494
|
}
|
|
4234
4495
|
|
|
4235
|
-
// ../blocks/src/theme/
|
|
4236
|
-
|
|
4237
|
-
|
|
4238
|
-
|
|
4239
|
-
|
|
4240
|
-
|
|
4241
|
-
|
|
4242
|
-
|
|
4243
|
-
|
|
4244
|
-
|
|
4245
|
-
|
|
4246
|
-
|
|
4247
|
-
|
|
4248
|
-
|
|
4249
|
-
|
|
4250
|
-
|
|
4251
|
-
|
|
4252
|
-
|
|
4253
|
-
|
|
4254
|
-
|
|
4255
|
-
|
|
4256
|
-
|
|
4257
|
-
);
|
|
4258
|
-
}
|
|
4259
|
-
return `rgb(var(--tb-${token}))`;
|
|
4260
|
-
}
|
|
4261
|
-
/**
|
|
4262
|
-
* Adjust a color token's shade by a given amount
|
|
4263
|
-
*
|
|
4264
|
-
* @param token - Base token (e.g., 'primary-500')
|
|
4265
|
-
* @param amount - Shade adjustment (+100 = darker, -100 = lighter)
|
|
4266
|
-
* @returns Adjusted token name (e.g., 'primary-600')
|
|
4267
|
-
*
|
|
4268
|
-
* @example
|
|
4269
|
-
* resolver.adjustShade('primary-500', 100) // => 'primary-600' (darker)
|
|
4270
|
-
* resolver.adjustShade('primary-500', -100) // => 'primary-400' (lighter)
|
|
4271
|
-
*/
|
|
4272
|
-
adjustShade(token, amount) {
|
|
4273
|
-
const parts = token.split("-");
|
|
4274
|
-
if (parts.length < 2) {
|
|
4275
|
-
const newShade2 = Math.max(100, Math.min(900, 500 + amount));
|
|
4276
|
-
return `${token}-${newShade2}`;
|
|
4277
|
-
}
|
|
4278
|
-
const base = parts.slice(0, -1).join("-");
|
|
4279
|
-
const shade = parseInt(parts[parts.length - 1], 10);
|
|
4280
|
-
if (isNaN(shade)) {
|
|
4281
|
-
console.warn(
|
|
4282
|
-
`[TokenResolver] Cannot adjust shade for non-shade token "${token}". Returning original token.`
|
|
4496
|
+
// ../blocks/src/theme/interactive/generateEffectsCSS.ts
|
|
4497
|
+
function generateEffectsCSS(options) {
|
|
4498
|
+
const { themeId, variantId, effects, elementConfig, tokens, theme } = options;
|
|
4499
|
+
if (!effects) return "";
|
|
4500
|
+
const cssChunks = [];
|
|
4501
|
+
const stateGroups = [
|
|
4502
|
+
["base", effects.base],
|
|
4503
|
+
["hover", effects.hover],
|
|
4504
|
+
["active", effects.active],
|
|
4505
|
+
["focus", effects.focus]
|
|
4506
|
+
];
|
|
4507
|
+
for (const [stateGroup, effectApps] of stateGroups) {
|
|
4508
|
+
if (!effectApps || effectApps.length === 0) continue;
|
|
4509
|
+
for (const effectApp of effectApps) {
|
|
4510
|
+
const css2 = generateSingleEffectCSS(
|
|
4511
|
+
themeId,
|
|
4512
|
+
variantId,
|
|
4513
|
+
stateGroup,
|
|
4514
|
+
effectApp,
|
|
4515
|
+
elementConfig,
|
|
4516
|
+
tokens,
|
|
4517
|
+
theme
|
|
4283
4518
|
);
|
|
4284
|
-
|
|
4285
|
-
|
|
4286
|
-
const newShade = Math.max(100, Math.min(900, shade + amount));
|
|
4287
|
-
return `${base}-${newShade}`;
|
|
4288
|
-
}
|
|
4289
|
-
/**
|
|
4290
|
-
* Check if a token exists in the theme palette
|
|
4291
|
-
*
|
|
4292
|
-
* @param token - Token name to check
|
|
4293
|
-
* @returns True if token exists in theme
|
|
4294
|
-
*/
|
|
4295
|
-
tokenExists(token) {
|
|
4296
|
-
const commonTokens = ["white", "black", "transparent"];
|
|
4297
|
-
if (commonTokens.includes(token)) {
|
|
4298
|
-
return true;
|
|
4299
|
-
}
|
|
4300
|
-
const parts = token.split("-");
|
|
4301
|
-
if (parts.length >= 2) {
|
|
4302
|
-
const lastPart = parts[parts.length - 1];
|
|
4303
|
-
const shade = parseInt(lastPart, 10);
|
|
4304
|
-
if (!isNaN(shade) && shade >= 100 && shade <= 900 && shade % 100 === 0) {
|
|
4305
|
-
return true;
|
|
4519
|
+
if (css2) {
|
|
4520
|
+
cssChunks.push(css2);
|
|
4306
4521
|
}
|
|
4307
4522
|
}
|
|
4308
|
-
return true;
|
|
4309
4523
|
}
|
|
4310
|
-
|
|
4524
|
+
return cssChunks.join("\n\n");
|
|
4525
|
+
}
|
|
4526
|
+
function generateSingleEffectCSS(themeId, variantId, stateGroup, effectApp, elementConfig, tokens, theme) {
|
|
4527
|
+
const effectPreset = getEffectPreset(effectApp.effectId);
|
|
4528
|
+
if (!effectPreset) {
|
|
4529
|
+
console.warn(`[generateEffectsCSS] Unknown effect: ${effectApp.effectId}`);
|
|
4530
|
+
return "";
|
|
4531
|
+
}
|
|
4532
|
+
const ctx = {
|
|
4533
|
+
themeId,
|
|
4534
|
+
variantId,
|
|
4535
|
+
stateGroup,
|
|
4536
|
+
options: effectApp.options || {},
|
|
4537
|
+
buttonConfig: elementConfig,
|
|
4538
|
+
// Effects access .background, .textColorToken, .border
|
|
4539
|
+
tokens,
|
|
4540
|
+
theme
|
|
4541
|
+
};
|
|
4542
|
+
return effectPreset.generateCSS(ctx);
|
|
4543
|
+
}
|
|
4311
4544
|
|
|
4312
4545
|
// ../blocks/src/theme/buttons/constants.ts
|
|
4313
4546
|
var GRADIENT_DIRECTION_MAP = {
|
|
@@ -4366,6 +4599,11 @@ var FONT_SIZE_MAP = {
|
|
|
4366
4599
|
"text-xl": "1.25rem",
|
|
4367
4600
|
"text-2xl": "1.5rem"
|
|
4368
4601
|
};
|
|
4602
|
+
var BUTTON_PADDING_PRESETS = {
|
|
4603
|
+
compact: "0.375rem 0.75rem",
|
|
4604
|
+
default: "0.5rem 1rem",
|
|
4605
|
+
spacious: "0.75rem 1.5rem"
|
|
4606
|
+
};
|
|
4369
4607
|
|
|
4370
4608
|
// ../blocks/src/theme/buttons/utils/contrast.ts
|
|
4371
4609
|
function getContrastingTextColorToken(backgroundToken, theme) {
|
|
@@ -4375,7 +4613,7 @@ function getContrastingTextColorToken(backgroundToken, theme) {
|
|
|
4375
4613
|
}
|
|
4376
4614
|
if (backgroundToken.startsWith("neutral-")) {
|
|
4377
4615
|
const match = backgroundToken.match(/neutral-(\d+)/);
|
|
4378
|
-
if (match) {
|
|
4616
|
+
if (_optionalChain([match, 'optionalAccess', _10 => _10[1]])) {
|
|
4379
4617
|
const shade = parseInt(match[1], 10);
|
|
4380
4618
|
return shade >= 500 ? "neutral-50" : "neutral-950";
|
|
4381
4619
|
}
|
|
@@ -4384,16 +4622,6 @@ function getContrastingTextColorToken(backgroundToken, theme) {
|
|
|
4384
4622
|
}
|
|
4385
4623
|
|
|
4386
4624
|
// ../blocks/src/theme/buttons/generateDefaultButtonSystem.ts
|
|
4387
|
-
var CORNERS_TO_RADIUS_MAP = {
|
|
4388
|
-
square: "rounded-none",
|
|
4389
|
-
// 0px - sharp corners
|
|
4390
|
-
soft: "rounded-md",
|
|
4391
|
-
// 6px - subtle rounding
|
|
4392
|
-
rounded: "rounded-md",
|
|
4393
|
-
// 6px - standard rounded (same as soft for buttons)
|
|
4394
|
-
pill: "rounded-full"
|
|
4395
|
-
// 9999px - full pill shape
|
|
4396
|
-
};
|
|
4397
4625
|
var BORDER_WIDTH_TO_CLASS_MAP = {
|
|
4398
4626
|
none: "border-0",
|
|
4399
4627
|
// 0px
|
|
@@ -4405,7 +4633,6 @@ var BORDER_WIDTH_TO_CLASS_MAP = {
|
|
|
4405
4633
|
// 4px - clearly thick
|
|
4406
4634
|
};
|
|
4407
4635
|
function generateDefaultButtonSystem(theme) {
|
|
4408
|
-
const borderRadius = CORNERS_TO_RADIUS_MAP[theme.corners] || "rounded-lg";
|
|
4409
4636
|
const borderWidthClass = BORDER_WIDTH_TO_CLASS_MAP[theme.border.width] || "border-2";
|
|
4410
4637
|
const variants = [];
|
|
4411
4638
|
const primaryVariant = {
|
|
@@ -4415,10 +4642,11 @@ function generateDefaultButtonSystem(theme) {
|
|
|
4415
4642
|
priority: 1,
|
|
4416
4643
|
background: {
|
|
4417
4644
|
type: "solid",
|
|
4418
|
-
colorToken: "primary
|
|
4645
|
+
colorToken: "primary"
|
|
4419
4646
|
},
|
|
4420
|
-
textColorToken: getContrastingTextColorToken("primary
|
|
4421
|
-
borderRadius,
|
|
4647
|
+
textColorToken: getContrastingTextColorToken("primary", theme),
|
|
4648
|
+
borderRadius: "",
|
|
4649
|
+
// Empty string = inherit from global.cornerStyle
|
|
4422
4650
|
// Inherits shadow from theme
|
|
4423
4651
|
effects: {
|
|
4424
4652
|
hover: [
|
|
@@ -4440,7 +4668,8 @@ function generateDefaultButtonSystem(theme) {
|
|
|
4440
4668
|
colorToken: "neutral-700"
|
|
4441
4669
|
},
|
|
4442
4670
|
textColorToken: getContrastingTextColorToken("neutral-700", theme),
|
|
4443
|
-
borderRadius,
|
|
4671
|
+
borderRadius: "",
|
|
4672
|
+
// Empty string = inherit from global.cornerStyle
|
|
4444
4673
|
// Inherits shadow from theme
|
|
4445
4674
|
effects: {
|
|
4446
4675
|
hover: [
|
|
@@ -4460,12 +4689,13 @@ function generateDefaultButtonSystem(theme) {
|
|
|
4460
4689
|
background: {
|
|
4461
4690
|
type: "transparent"
|
|
4462
4691
|
},
|
|
4463
|
-
textColorToken: "primary
|
|
4464
|
-
borderRadius,
|
|
4692
|
+
textColorToken: "primary",
|
|
4693
|
+
borderRadius: "",
|
|
4694
|
+
// Empty string = inherit from global.cornerStyle
|
|
4465
4695
|
shadow: { elevation: "none", softness: null, position: "bottom" },
|
|
4466
4696
|
// Outline buttons typically don't have shadows
|
|
4467
4697
|
border: {
|
|
4468
|
-
colorToken: "primary
|
|
4698
|
+
colorToken: "primary",
|
|
4469
4699
|
widthClass: borderWidthClass
|
|
4470
4700
|
},
|
|
4471
4701
|
effects: {
|
|
@@ -4486,8 +4716,9 @@ function generateDefaultButtonSystem(theme) {
|
|
|
4486
4716
|
background: {
|
|
4487
4717
|
type: "transparent"
|
|
4488
4718
|
},
|
|
4489
|
-
textColorToken: "primary
|
|
4490
|
-
borderRadius,
|
|
4719
|
+
textColorToken: "primary",
|
|
4720
|
+
borderRadius: "",
|
|
4721
|
+
// Empty string = inherit from global.cornerStyle
|
|
4491
4722
|
shadow: { elevation: "none", softness: null, position: "bottom" },
|
|
4492
4723
|
// Ghost buttons have no shadow
|
|
4493
4724
|
// No border for ghost buttons
|
|
@@ -4553,6 +4784,10 @@ function generateButtonCss(options) {
|
|
|
4553
4784
|
if (!variant.enabled) continue;
|
|
4554
4785
|
const baseCSS = generateVariantBaseCSS(variant, buttonSystem.global, themeId, tokens, theme);
|
|
4555
4786
|
cssChunks.push(baseCSS);
|
|
4787
|
+
const hoverBgCSS = generateHoverBackgroundCSS(variant, buttonSystem.global, themeId, tokens);
|
|
4788
|
+
if (hoverBgCSS) {
|
|
4789
|
+
cssChunks.push(hoverBgCSS);
|
|
4790
|
+
}
|
|
4556
4791
|
const effectCSS = generateVariantEffectCSS(variant, themeId, tokens, theme);
|
|
4557
4792
|
if (effectCSS) {
|
|
4558
4793
|
cssChunks.push(effectCSS);
|
|
@@ -4571,7 +4806,7 @@ function generateVariantBaseCSS(variant, global, themeId, tokens, theme) {
|
|
|
4571
4806
|
const rules = [];
|
|
4572
4807
|
const borderWidth = variant.border ? BORDER_WIDTH_MAP[variant.border.widthClass] || "1px" : "0px";
|
|
4573
4808
|
const hasBorder = borderWidth !== "0px";
|
|
4574
|
-
const padding = variant.padding || STRUCTURAL_BASE_STYLES.padding;
|
|
4809
|
+
const padding = variant.padding || (global.paddingPreset ? BUTTON_PADDING_PRESETS[global.paddingPreset] : null) || STRUCTURAL_BASE_STYLES.padding;
|
|
4575
4810
|
const paddingParts = padding.split(" ");
|
|
4576
4811
|
const verticalPadding = paddingParts[0] || "0.5rem";
|
|
4577
4812
|
const horizontalPadding = paddingParts[1] || paddingParts[0] || "1rem";
|
|
@@ -4584,6 +4819,15 @@ function generateVariantBaseCSS(variant, global, themeId, tokens, theme) {
|
|
|
4584
4819
|
rules.push(`padding: ${padding};`);
|
|
4585
4820
|
}
|
|
4586
4821
|
rules.push(`font-weight: ${global.fontWeight};`);
|
|
4822
|
+
if (global.typography === "heading") {
|
|
4823
|
+
rules.push(`font-family: var(--font-heading);`);
|
|
4824
|
+
rules.push(`letter-spacing: var(--ls-heading);`);
|
|
4825
|
+
} else {
|
|
4826
|
+
rules.push(`font-family: var(--font-body);`);
|
|
4827
|
+
}
|
|
4828
|
+
if (global.italic) {
|
|
4829
|
+
rules.push(`font-style: italic;`);
|
|
4830
|
+
}
|
|
4587
4831
|
if (variant.fontSize) {
|
|
4588
4832
|
const fontSize = FONT_SIZE_MAP[variant.fontSize] || "1rem";
|
|
4589
4833
|
rules.push(`font-size: ${fontSize};`);
|
|
@@ -4597,16 +4841,16 @@ function generateVariantBaseCSS(variant, global, themeId, tokens, theme) {
|
|
|
4597
4841
|
rules.push(`align-items: ${STRUCTURAL_BASE_STYLES.alignItems};`);
|
|
4598
4842
|
rules.push(`justify-content: ${STRUCTURAL_BASE_STYLES.justifyContent};`);
|
|
4599
4843
|
let borderRadius;
|
|
4600
|
-
if (variant.borderRadius) {
|
|
4601
|
-
borderRadius = BORDER_RADIUS_MAP[variant.borderRadius]
|
|
4844
|
+
if (variant.borderRadius && variant.borderRadius !== "") {
|
|
4845
|
+
borderRadius = _nullishCoalesce(_nullishCoalesce(BORDER_RADIUS_MAP[variant.borderRadius], () => ( BORDER_RADIUS_MAP["rounded"])), () => ( "0.375rem"));
|
|
4602
4846
|
} else {
|
|
4603
4847
|
const cornerStyleMap = {
|
|
4604
4848
|
"square": "rounded-none",
|
|
4605
4849
|
"rounded": "rounded-md",
|
|
4606
4850
|
"pill": "rounded-full"
|
|
4607
4851
|
};
|
|
4608
|
-
const fallbackRadius = cornerStyleMap[global.cornerStyle]
|
|
4609
|
-
borderRadius = BORDER_RADIUS_MAP[fallbackRadius]
|
|
4852
|
+
const fallbackRadius = _nullishCoalesce(cornerStyleMap[global.cornerStyle], () => ( "rounded-md"));
|
|
4853
|
+
borderRadius = _nullishCoalesce(_nullishCoalesce(BORDER_RADIUS_MAP[fallbackRadius], () => ( BORDER_RADIUS_MAP["rounded"])), () => ( "0.375rem"));
|
|
4610
4854
|
}
|
|
4611
4855
|
rules.push(`border-radius: ${borderRadius};`);
|
|
4612
4856
|
const shadowConfig = variant.shadow || shadowSizeToShadow(global.shadow, theme) || theme.shadow;
|
|
@@ -4642,31 +4886,33 @@ ${selector} {
|
|
|
4642
4886
|
}
|
|
4643
4887
|
function generateVariantEffectCSS(variant, themeId, tokens, theme) {
|
|
4644
4888
|
if (!variant.effects) return "";
|
|
4645
|
-
const
|
|
4646
|
-
|
|
4647
|
-
|
|
4648
|
-
|
|
4649
|
-
|
|
4650
|
-
|
|
4651
|
-
|
|
4652
|
-
|
|
4653
|
-
|
|
4654
|
-
|
|
4655
|
-
|
|
4656
|
-
|
|
4657
|
-
|
|
4658
|
-
|
|
4659
|
-
|
|
4660
|
-
|
|
4661
|
-
|
|
4662
|
-
|
|
4663
|
-
const css2 = effectPreset.generateCSS(ctx);
|
|
4664
|
-
if (css2) {
|
|
4665
|
-
cssChunks.push(css2);
|
|
4666
|
-
}
|
|
4667
|
-
}
|
|
4889
|
+
const elementConfig = {
|
|
4890
|
+
background: variant.background,
|
|
4891
|
+
textColorToken: variant.textColorToken,
|
|
4892
|
+
border: variant.border ? { colorToken: variant.border.colorToken } : void 0
|
|
4893
|
+
};
|
|
4894
|
+
return generateEffectsCSS({
|
|
4895
|
+
themeId,
|
|
4896
|
+
variantId: variant.id,
|
|
4897
|
+
effects: variant.effects,
|
|
4898
|
+
elementConfig,
|
|
4899
|
+
tokens,
|
|
4900
|
+
theme
|
|
4901
|
+
});
|
|
4902
|
+
}
|
|
4903
|
+
function generateHoverBackgroundCSS(variant, global, themeId, tokens) {
|
|
4904
|
+
let hoverToken = variant.hoverBackgroundToken;
|
|
4905
|
+
if (!hoverToken && global.hoverColor === "token" && global.hoverColorToken) {
|
|
4906
|
+
hoverToken = global.hoverColorToken;
|
|
4668
4907
|
}
|
|
4669
|
-
|
|
4908
|
+
if (!hoverToken) return null;
|
|
4909
|
+
const selector = `:where([data-theme-scope="${themeId}"]) .${variant.id}:hover`;
|
|
4910
|
+
const hoverBgColor = tokens.getColor(hoverToken);
|
|
4911
|
+
return `
|
|
4912
|
+
${selector} {
|
|
4913
|
+
background-color: ${hoverBgColor};
|
|
4914
|
+
}
|
|
4915
|
+
`.trim();
|
|
4670
4916
|
}
|
|
4671
4917
|
function generateDisabledCSS(variant, themeId) {
|
|
4672
4918
|
const selector = `:where([data-theme-scope="${themeId}"]) .${variant.id}:disabled`;
|
|
@@ -5059,8 +5305,8 @@ function generateAccordionCss({
|
|
|
5059
5305
|
if (accordionSystem.hover.shadowElevation) {
|
|
5060
5306
|
const hoverShadowValue = generateShadowValue(
|
|
5061
5307
|
accordionSystem.hover.shadowElevation,
|
|
5062
|
-
_nullishCoalesce(_optionalChain([accordionSystem, 'access',
|
|
5063
|
-
_nullishCoalesce(_optionalChain([accordionSystem, 'access',
|
|
5308
|
+
_nullishCoalesce(_optionalChain([accordionSystem, 'access', _11 => _11.shadow, 'optionalAccess', _12 => _12.softness]), () => ( "soft")),
|
|
5309
|
+
_nullishCoalesce(_optionalChain([accordionSystem, 'access', _13 => _13.shadow, 'optionalAccess', _14 => _14.position]), () => ( "bottom"))
|
|
5064
5310
|
);
|
|
5065
5311
|
triggerHoverRules.push(`box-shadow: ${hoverShadowValue}`);
|
|
5066
5312
|
}
|
|
@@ -5559,6 +5805,345 @@ function generateDefaultInputSystem(theme) {
|
|
|
5559
5805
|
};
|
|
5560
5806
|
}
|
|
5561
5807
|
|
|
5808
|
+
// ../blocks/src/theme/navigation/types.ts
|
|
5809
|
+
|
|
5810
|
+
|
|
5811
|
+
// ../blocks/src/theme/interactive/baseSchema.ts
|
|
5812
|
+
|
|
5813
|
+
var interactiveTypographySchema = _zod.z.object({
|
|
5814
|
+
/** Font family source */
|
|
5815
|
+
typography: _zod.z.enum(["body", "heading"]).default("body"),
|
|
5816
|
+
/** Font weight */
|
|
5817
|
+
fontWeight: _zod.z.enum(["regular", "medium", "semibold", "bold"]).default("medium"),
|
|
5818
|
+
/** Text transform */
|
|
5819
|
+
textTransform: _zod.z.enum(["none", "uppercase", "capitalize"]).default("none"),
|
|
5820
|
+
/** Italic style */
|
|
5821
|
+
italic: _zod.z.boolean().default(false)
|
|
5822
|
+
});
|
|
5823
|
+
var effectApplicationSchema = _zod.z.object({
|
|
5824
|
+
/** Effect preset ID */
|
|
5825
|
+
effectId: _zod.z.string(),
|
|
5826
|
+
/** User-provided customization options */
|
|
5827
|
+
options: _zod.z.record(_zod.z.string(), _zod.z.any()).optional()
|
|
5828
|
+
});
|
|
5829
|
+
var effectCompositionSchema = _zod.z.object({
|
|
5830
|
+
/** Effects always applied */
|
|
5831
|
+
base: _zod.z.array(effectApplicationSchema).optional(),
|
|
5832
|
+
/** Effects applied on hover */
|
|
5833
|
+
hover: _zod.z.array(effectApplicationSchema).optional(),
|
|
5834
|
+
/** Effects applied on active/pressed */
|
|
5835
|
+
active: _zod.z.array(effectApplicationSchema).optional(),
|
|
5836
|
+
/** Effects applied on focus */
|
|
5837
|
+
focus: _zod.z.array(effectApplicationSchema).optional()
|
|
5838
|
+
});
|
|
5839
|
+
|
|
5840
|
+
// ../blocks/src/theme/navigation/types.ts
|
|
5841
|
+
var navLinkPaddingSchema = _zod.z.enum(["none", "compact", "default"]);
|
|
5842
|
+
var navLinkBorderRadiusSchema = _zod.z.enum(["none", "sm", "md", "full"]);
|
|
5843
|
+
var navLinkStyleSchema = _zod.z.object({
|
|
5844
|
+
/** Display name for the style */
|
|
5845
|
+
name: _zod.z.string().min(1).max(30).optional(),
|
|
5846
|
+
/** Typography settings (inherited from interactive base) */
|
|
5847
|
+
...interactiveTypographySchema.shape,
|
|
5848
|
+
/** Text color token */
|
|
5849
|
+
colorToken: _zod.z.string().default("text"),
|
|
5850
|
+
/** Hover/active color token (for color-change effects) */
|
|
5851
|
+
hoverColorToken: _zod.z.string().nullable().optional(),
|
|
5852
|
+
/** Padding preset */
|
|
5853
|
+
padding: navLinkPaddingSchema.default("compact"),
|
|
5854
|
+
/** Border radius (for capsule/pill styles) */
|
|
5855
|
+
borderRadius: navLinkBorderRadiusSchema.default("none"),
|
|
5856
|
+
/** Composable effects */
|
|
5857
|
+
effects: effectCompositionSchema.optional()
|
|
5858
|
+
});
|
|
5859
|
+
var NAV_LINK_PADDING_MAP = {
|
|
5860
|
+
none: "0",
|
|
5861
|
+
compact: "0.5rem 1rem",
|
|
5862
|
+
default: "0.75rem 1.25rem"
|
|
5863
|
+
};
|
|
5864
|
+
var NAV_LINK_BORDER_RADIUS_MAP = {
|
|
5865
|
+
none: "0",
|
|
5866
|
+
sm: "0.25rem",
|
|
5867
|
+
md: "0.5rem",
|
|
5868
|
+
full: "9999px"
|
|
5869
|
+
};
|
|
5870
|
+
|
|
5871
|
+
// ../blocks/src/theme/interactive/generateBaseCSS.ts
|
|
5872
|
+
var FONT_WEIGHT_MAP2 = {
|
|
5873
|
+
regular: 400,
|
|
5874
|
+
medium: 500,
|
|
5875
|
+
semibold: 600,
|
|
5876
|
+
bold: 700
|
|
5877
|
+
};
|
|
5878
|
+
function generateBaseInteractiveCSS(options) {
|
|
5879
|
+
const {
|
|
5880
|
+
typography,
|
|
5881
|
+
padding,
|
|
5882
|
+
borderRadius,
|
|
5883
|
+
includeTransition = true,
|
|
5884
|
+
includeFlexCenter = false,
|
|
5885
|
+
borderWidth
|
|
5886
|
+
} = options;
|
|
5887
|
+
const rules = [];
|
|
5888
|
+
if (typography.fontWeight !== void 0) {
|
|
5889
|
+
const weight = typeof typography.fontWeight === "number" ? typography.fontWeight : FONT_WEIGHT_MAP2[typography.fontWeight];
|
|
5890
|
+
rules.push(`font-weight: ${weight};`);
|
|
5891
|
+
}
|
|
5892
|
+
if (typography.typography === "heading") {
|
|
5893
|
+
rules.push(`font-family: var(--font-heading);`);
|
|
5894
|
+
rules.push(`letter-spacing: var(--ls-heading);`);
|
|
5895
|
+
} else if (typography.typography === "body") {
|
|
5896
|
+
rules.push(`font-family: var(--font-body);`);
|
|
5897
|
+
}
|
|
5898
|
+
if (typography.italic) {
|
|
5899
|
+
rules.push(`font-style: italic;`);
|
|
5900
|
+
}
|
|
5901
|
+
if (typography.textTransform && typography.textTransform !== "none") {
|
|
5902
|
+
rules.push(`text-transform: ${typography.textTransform};`);
|
|
5903
|
+
}
|
|
5904
|
+
if (padding) {
|
|
5905
|
+
if (borderWidth && borderWidth !== "0px") {
|
|
5906
|
+
const paddingParts = padding.split(" ");
|
|
5907
|
+
const verticalPadding = paddingParts[0] || "0.5rem";
|
|
5908
|
+
const horizontalPadding = paddingParts[1] || paddingParts[0] || "1rem";
|
|
5909
|
+
rules.push(`padding-top: calc(${verticalPadding} - ${borderWidth} - 1px);`);
|
|
5910
|
+
rules.push(`padding-bottom: calc(${verticalPadding} - ${borderWidth} - 1px);`);
|
|
5911
|
+
rules.push(`padding-left: calc(${horizontalPadding} - ${borderWidth});`);
|
|
5912
|
+
rules.push(`padding-right: calc(${horizontalPadding} - ${borderWidth});`);
|
|
5913
|
+
} else {
|
|
5914
|
+
rules.push(`padding: ${padding};`);
|
|
5915
|
+
}
|
|
5916
|
+
}
|
|
5917
|
+
if (borderRadius) {
|
|
5918
|
+
rules.push(`border-radius: ${borderRadius};`);
|
|
5919
|
+
}
|
|
5920
|
+
if (includeTransition) {
|
|
5921
|
+
rules.push(`transition: all 200ms ease;`);
|
|
5922
|
+
}
|
|
5923
|
+
if (includeFlexCenter) {
|
|
5924
|
+
rules.push(`display: inline-flex;`);
|
|
5925
|
+
rules.push(`align-items: center;`);
|
|
5926
|
+
rules.push(`justify-content: center;`);
|
|
5927
|
+
rules.push(`cursor: pointer;`);
|
|
5928
|
+
}
|
|
5929
|
+
return rules;
|
|
5930
|
+
}
|
|
5931
|
+
|
|
5932
|
+
// ../blocks/src/theme/navigation/generateNavLinkCSS.ts
|
|
5933
|
+
function generateNavLinkCSS(options) {
|
|
5934
|
+
const { themeId, tokens, theme, style, className } = options;
|
|
5935
|
+
const selector = `:where([data-theme-scope="${themeId}"]) .${className}`;
|
|
5936
|
+
const hoverSelector = `${selector}:hover`;
|
|
5937
|
+
const activeSelector = `${selector}:active, ${selector}[data-active="true"]`;
|
|
5938
|
+
const cssChunks = [];
|
|
5939
|
+
const hoverRules = [];
|
|
5940
|
+
const activeRules = [];
|
|
5941
|
+
const baseRules = generateBaseInteractiveCSS({
|
|
5942
|
+
typography: {
|
|
5943
|
+
typography: style.typography,
|
|
5944
|
+
fontWeight: style.fontWeight,
|
|
5945
|
+
textTransform: style.textTransform,
|
|
5946
|
+
italic: style.italic
|
|
5947
|
+
},
|
|
5948
|
+
padding: style.padding ? NAV_LINK_PADDING_MAP[style.padding] : void 0,
|
|
5949
|
+
borderRadius: style.borderRadius ? NAV_LINK_BORDER_RADIUS_MAP[style.borderRadius] : void 0,
|
|
5950
|
+
includeTransition: true,
|
|
5951
|
+
includeFlexCenter: false
|
|
5952
|
+
});
|
|
5953
|
+
if (style.colorToken) {
|
|
5954
|
+
baseRules.push(`color: ${tokens.getColor(style.colorToken)};`);
|
|
5955
|
+
}
|
|
5956
|
+
if (style.hoverColorToken && !_optionalChain([style, 'access', _15 => _15.effects, 'optionalAccess', _16 => _16.hover, 'optionalAccess', _17 => _17.length])) {
|
|
5957
|
+
hoverRules.push(`color: ${tokens.getColor(style.hoverColorToken)};`);
|
|
5958
|
+
}
|
|
5959
|
+
const elementConfig = {
|
|
5960
|
+
background: { type: "transparent" },
|
|
5961
|
+
textColorToken: style.colorToken || "text"
|
|
5962
|
+
};
|
|
5963
|
+
if (style.effects) {
|
|
5964
|
+
const effectsCss = generateEffectsCSS({
|
|
5965
|
+
themeId,
|
|
5966
|
+
variantId: className,
|
|
5967
|
+
effects: style.effects,
|
|
5968
|
+
elementConfig,
|
|
5969
|
+
tokens,
|
|
5970
|
+
theme
|
|
5971
|
+
});
|
|
5972
|
+
if (effectsCss) {
|
|
5973
|
+
cssChunks.push(effectsCss);
|
|
5974
|
+
}
|
|
5975
|
+
}
|
|
5976
|
+
if (baseRules.length > 0) {
|
|
5977
|
+
cssChunks.unshift(`
|
|
5978
|
+
${selector} {
|
|
5979
|
+
${baseRules.join("\n ")}
|
|
5980
|
+
}
|
|
5981
|
+
`);
|
|
5982
|
+
}
|
|
5983
|
+
if (hoverRules.length > 0) {
|
|
5984
|
+
cssChunks.push(`
|
|
5985
|
+
${hoverSelector} {
|
|
5986
|
+
${hoverRules.join("\n ")}
|
|
5987
|
+
}
|
|
5988
|
+
`);
|
|
5989
|
+
}
|
|
5990
|
+
if (activeRules.length > 0) {
|
|
5991
|
+
cssChunks.push(`
|
|
5992
|
+
${activeSelector} {
|
|
5993
|
+
${activeRules.join("\n ")}
|
|
5994
|
+
}
|
|
5995
|
+
`);
|
|
5996
|
+
}
|
|
5997
|
+
return cssChunks.join("");
|
|
5998
|
+
}
|
|
5999
|
+
|
|
6000
|
+
// ../blocks/src/theme/navigation/presets.ts
|
|
6001
|
+
var NAV_LINK_PRESETS = {
|
|
6002
|
+
/**
|
|
6003
|
+
* Minimal - subtle color change on hover
|
|
6004
|
+
*/
|
|
6005
|
+
minimal: {
|
|
6006
|
+
name: "Minimal",
|
|
6007
|
+
typography: "body",
|
|
6008
|
+
fontWeight: "medium",
|
|
6009
|
+
textTransform: "none",
|
|
6010
|
+
italic: false,
|
|
6011
|
+
colorToken: "text",
|
|
6012
|
+
hoverColorToken: "primary",
|
|
6013
|
+
padding: "none",
|
|
6014
|
+
borderRadius: "none",
|
|
6015
|
+
effects: {
|
|
6016
|
+
hover: [
|
|
6017
|
+
{ effectId: "text-color-change", options: { colorToken: "primary" } }
|
|
6018
|
+
]
|
|
6019
|
+
}
|
|
6020
|
+
},
|
|
6021
|
+
/**
|
|
6022
|
+
* Underline - static underline appears on hover
|
|
6023
|
+
*/
|
|
6024
|
+
underline: {
|
|
6025
|
+
name: "Underline",
|
|
6026
|
+
typography: "body",
|
|
6027
|
+
fontWeight: "medium",
|
|
6028
|
+
textTransform: "none",
|
|
6029
|
+
italic: false,
|
|
6030
|
+
colorToken: "text",
|
|
6031
|
+
padding: "none",
|
|
6032
|
+
borderRadius: "none",
|
|
6033
|
+
effects: {
|
|
6034
|
+
hover: [
|
|
6035
|
+
{ effectId: "nav-underline", options: { style: "static" } }
|
|
6036
|
+
]
|
|
6037
|
+
}
|
|
6038
|
+
},
|
|
6039
|
+
/**
|
|
6040
|
+
* Underline Grow - animated underline grows from center on hover
|
|
6041
|
+
*/
|
|
6042
|
+
"underline-grow": {
|
|
6043
|
+
name: "Underline Grow",
|
|
6044
|
+
typography: "body",
|
|
6045
|
+
fontWeight: "medium",
|
|
6046
|
+
textTransform: "none",
|
|
6047
|
+
italic: false,
|
|
6048
|
+
colorToken: "text",
|
|
6049
|
+
padding: "none",
|
|
6050
|
+
borderRadius: "none",
|
|
6051
|
+
effects: {
|
|
6052
|
+
hover: [
|
|
6053
|
+
{ effectId: "nav-underline", options: { style: "grow" } }
|
|
6054
|
+
]
|
|
6055
|
+
}
|
|
6056
|
+
},
|
|
6057
|
+
/**
|
|
6058
|
+
* Capsule - pill-shaped background on hover
|
|
6059
|
+
*/
|
|
6060
|
+
capsule: {
|
|
6061
|
+
name: "Capsule",
|
|
6062
|
+
typography: "body",
|
|
6063
|
+
fontWeight: "medium",
|
|
6064
|
+
textTransform: "none",
|
|
6065
|
+
italic: false,
|
|
6066
|
+
colorToken: "text",
|
|
6067
|
+
padding: "compact",
|
|
6068
|
+
borderRadius: "full",
|
|
6069
|
+
effects: {
|
|
6070
|
+
hover: [
|
|
6071
|
+
{ effectId: "background-on-hover-alpha", options: { colorToken: "primary", opacity: 0.1 } }
|
|
6072
|
+
],
|
|
6073
|
+
active: [
|
|
6074
|
+
{ effectId: "background-on-hover-alpha", options: { colorToken: "primary", opacity: 0.15 } }
|
|
6075
|
+
]
|
|
6076
|
+
}
|
|
6077
|
+
},
|
|
6078
|
+
/**
|
|
6079
|
+
* Solid - solid background color on hover
|
|
6080
|
+
*/
|
|
6081
|
+
solid: {
|
|
6082
|
+
name: "Solid",
|
|
6083
|
+
typography: "body",
|
|
6084
|
+
fontWeight: "medium",
|
|
6085
|
+
textTransform: "none",
|
|
6086
|
+
italic: false,
|
|
6087
|
+
colorToken: "text",
|
|
6088
|
+
padding: "compact",
|
|
6089
|
+
borderRadius: "none",
|
|
6090
|
+
effects: {
|
|
6091
|
+
hover: [
|
|
6092
|
+
{ effectId: "background-on-hover", options: { colorToken: "primary" } }
|
|
6093
|
+
],
|
|
6094
|
+
active: [
|
|
6095
|
+
{ effectId: "background-on-hover", options: { colorToken: "primary" } }
|
|
6096
|
+
]
|
|
6097
|
+
}
|
|
6098
|
+
},
|
|
6099
|
+
/**
|
|
6100
|
+
* Scale - gentle scale-up on hover
|
|
6101
|
+
*/
|
|
6102
|
+
scale: {
|
|
6103
|
+
name: "Scale",
|
|
6104
|
+
typography: "body",
|
|
6105
|
+
fontWeight: "medium",
|
|
6106
|
+
textTransform: "none",
|
|
6107
|
+
italic: false,
|
|
6108
|
+
colorToken: "text",
|
|
6109
|
+
padding: "none",
|
|
6110
|
+
borderRadius: "none",
|
|
6111
|
+
effects: {
|
|
6112
|
+
hover: [
|
|
6113
|
+
{ effectId: "scale-up", options: { scale: 1.05 } }
|
|
6114
|
+
]
|
|
6115
|
+
}
|
|
6116
|
+
},
|
|
6117
|
+
/**
|
|
6118
|
+
* Frosted - semi-transparent glass-like background
|
|
6119
|
+
*/
|
|
6120
|
+
frosted: {
|
|
6121
|
+
name: "Frosted",
|
|
6122
|
+
typography: "body",
|
|
6123
|
+
fontWeight: "medium",
|
|
6124
|
+
textTransform: "none",
|
|
6125
|
+
italic: false,
|
|
6126
|
+
colorToken: "text",
|
|
6127
|
+
padding: "compact",
|
|
6128
|
+
borderRadius: "md",
|
|
6129
|
+
effects: {
|
|
6130
|
+
base: [
|
|
6131
|
+
{ effectId: "nav-frosted-base" }
|
|
6132
|
+
],
|
|
6133
|
+
hover: [
|
|
6134
|
+
{ effectId: "nav-frosted-hover" }
|
|
6135
|
+
],
|
|
6136
|
+
active: [
|
|
6137
|
+
{ effectId: "nav-frosted-active" }
|
|
6138
|
+
]
|
|
6139
|
+
}
|
|
6140
|
+
}
|
|
6141
|
+
};
|
|
6142
|
+
function getNavLinkPreset(presetId) {
|
|
6143
|
+
return NAV_LINK_PRESETS[presetId];
|
|
6144
|
+
}
|
|
6145
|
+
var NAV_LINK_PRESET_IDS = Object.keys(NAV_LINK_PRESETS);
|
|
6146
|
+
|
|
5562
6147
|
// ../blocks/src/theme/header/generateHeaderCss.ts
|
|
5563
6148
|
function generateHeaderCss(options) {
|
|
5564
6149
|
const { themeId, theme } = options;
|
|
@@ -5566,10 +6151,8 @@ function generateHeaderCss(options) {
|
|
|
5566
6151
|
const header = theme.header;
|
|
5567
6152
|
const cssChunks = [];
|
|
5568
6153
|
cssChunks.push(generateHeaderRootStyles(header, themeId, tokens, theme));
|
|
5569
|
-
|
|
5570
|
-
|
|
5571
|
-
}
|
|
5572
|
-
cssChunks.push(generateNavLinkStyles(header, themeId, tokens));
|
|
6154
|
+
cssChunks.push(generateLogoStyles(header.logo, themeId, tokens, header.textColor));
|
|
6155
|
+
cssChunks.push(generateNavLinkStyles(header, themeId, tokens, theme));
|
|
5573
6156
|
if (header.variant === "floating" && header.container) {
|
|
5574
6157
|
cssChunks.push(generateFloatingContainerStyles(header.container, themeId, tokens));
|
|
5575
6158
|
}
|
|
@@ -5579,7 +6162,7 @@ function generateHeaderCss(options) {
|
|
|
5579
6162
|
function generateHeaderRootStyles(header, themeId, tokens, _theme) {
|
|
5580
6163
|
const selector = `:where([data-theme-scope="${themeId}"]) .header-root`;
|
|
5581
6164
|
const rules = [];
|
|
5582
|
-
const navContainerType = _nullishCoalesce(_optionalChain([header, 'access',
|
|
6165
|
+
const navContainerType = _nullishCoalesce(_optionalChain([header, 'access', _18 => _18.navContainer, 'optionalAccess', _19 => _19.type]), () => ( "none"));
|
|
5583
6166
|
const isContainedNav = navContainerType === "pill" || navContainerType === "glass";
|
|
5584
6167
|
if (isContainedNav) {
|
|
5585
6168
|
} else {
|
|
@@ -5602,7 +6185,7 @@ function generateHeaderRootStyles(header, themeId, tokens, _theme) {
|
|
|
5602
6185
|
"thick": "4px"
|
|
5603
6186
|
}[header.border.width];
|
|
5604
6187
|
if (borderWidth !== "0") {
|
|
5605
|
-
const borderToken = _optionalChain([header, 'access',
|
|
6188
|
+
const borderToken = _optionalChain([header, 'access', _20 => _20.border, 'optionalAccess', _21 => _21.color, 'optionalAccess', _22 => _22.trim, 'call', _23 => _23()]) || "border";
|
|
5606
6189
|
const borderColor = tokens.getColor(borderToken);
|
|
5607
6190
|
const borderStyle = header.border.style === "dashed" ? "dashed" : "solid";
|
|
5608
6191
|
if (header.border.position === "bottom") {
|
|
@@ -5625,32 +6208,36 @@ ${selector} {
|
|
|
5625
6208
|
}
|
|
5626
6209
|
`;
|
|
5627
6210
|
}
|
|
5628
|
-
function generateLogoStyles(logo, themeId, tokens) {
|
|
5629
|
-
if (!logo) return "";
|
|
6211
|
+
function generateLogoStyles(logo, themeId, tokens, textColor) {
|
|
5630
6212
|
const selector = `:where([data-theme-scope="${themeId}"]) .header-logo-text`;
|
|
5631
6213
|
const rules = [];
|
|
5632
6214
|
const primaryColor = tokens.getColor("primary");
|
|
5633
6215
|
const accentColor = tokens.getColor("accent");
|
|
5634
|
-
if (logo
|
|
5635
|
-
rules.push(`
|
|
5636
|
-
}
|
|
5637
|
-
|
|
5638
|
-
|
|
5639
|
-
|
|
5640
|
-
|
|
5641
|
-
|
|
5642
|
-
|
|
5643
|
-
|
|
5644
|
-
|
|
5645
|
-
|
|
5646
|
-
|
|
5647
|
-
|
|
5648
|
-
|
|
5649
|
-
|
|
5650
|
-
|
|
5651
|
-
|
|
5652
|
-
|
|
5653
|
-
|
|
6216
|
+
if (textColor && !_optionalChain([logo, 'optionalAccess', _24 => _24.gradient])) {
|
|
6217
|
+
rules.push(`color: ${tokens.getColor(textColor)};`);
|
|
6218
|
+
}
|
|
6219
|
+
if (logo) {
|
|
6220
|
+
if (logo.fontFamily === "mono") {
|
|
6221
|
+
rules.push(`font-family: ui-monospace, monospace;`);
|
|
6222
|
+
} else if (logo.fontFamily === "serif") {
|
|
6223
|
+
rules.push(`font-family: ui-serif, serif;`);
|
|
6224
|
+
}
|
|
6225
|
+
if (logo.letterSpacing && logo.letterSpacing !== "normal") {
|
|
6226
|
+
const spacingMap = {
|
|
6227
|
+
"normal": "0em",
|
|
6228
|
+
"wide": "0.05em",
|
|
6229
|
+
"wider": "0.1em",
|
|
6230
|
+
"widest": "0.15em"
|
|
6231
|
+
};
|
|
6232
|
+
rules.push(`letter-spacing: ${spacingMap[logo.letterSpacing]};`);
|
|
6233
|
+
}
|
|
6234
|
+
if (logo.gradient) {
|
|
6235
|
+
rules.push(`background: linear-gradient(to right, ${primaryColor}, ${accentColor});`);
|
|
6236
|
+
rules.push(`-webkit-background-clip: text;`);
|
|
6237
|
+
rules.push(`-webkit-text-fill-color: transparent;`);
|
|
6238
|
+
rules.push(`background-clip: text;`);
|
|
6239
|
+
rules.push(`color: transparent;`);
|
|
6240
|
+
}
|
|
5654
6241
|
}
|
|
5655
6242
|
if (rules.length === 0) return "";
|
|
5656
6243
|
return `
|
|
@@ -5659,133 +6246,86 @@ ${selector} {
|
|
|
5659
6246
|
}
|
|
5660
6247
|
`;
|
|
5661
6248
|
}
|
|
5662
|
-
function generateNavLinkStyles(header, themeId, tokens) {
|
|
5663
|
-
|
|
5664
|
-
|
|
5665
|
-
|
|
5666
|
-
|
|
5667
|
-
|
|
5668
|
-
|
|
5669
|
-
|
|
5670
|
-
|
|
5671
|
-
const usesGlassNavContainer = navContainerType === "glass";
|
|
5672
|
-
const navColorToken = _optionalChain([header, 'access', _20 => _20.navColor, 'optionalAccess', _21 => _21.trim, 'call', _22 => _22()]);
|
|
5673
|
-
const primaryColor = tokens.getColor("primary");
|
|
5674
|
-
const navWeight = _nullishCoalesce(header.navWeight, () => ( "medium"));
|
|
5675
|
-
const navWeightMap = {
|
|
5676
|
-
regular: 400,
|
|
5677
|
-
medium: 500,
|
|
5678
|
-
semibold: 600,
|
|
5679
|
-
bold: 700
|
|
5680
|
-
};
|
|
5681
|
-
if (navColorToken) {
|
|
5682
|
-
baseRules.push(`color: ${tokens.getColor(navColorToken)};`);
|
|
5683
|
-
}
|
|
5684
|
-
if (navWeight) {
|
|
5685
|
-
baseRules.push(`font-weight: ${navWeightMap[navWeight]};`);
|
|
5686
|
-
}
|
|
5687
|
-
if (navWeight === "bold" && header.navStyle === "solid") {
|
|
5688
|
-
baseRules.push(`text-transform: uppercase;`);
|
|
5689
|
-
}
|
|
5690
|
-
switch (header.navStyle) {
|
|
5691
|
-
case "minimal":
|
|
5692
|
-
baseRules.push(`transition: color 200ms ease;`);
|
|
5693
|
-
hoverRules.push(`color: ${primaryColor};`);
|
|
5694
|
-
activeRules.push(`color: ${primaryColor};`);
|
|
5695
|
-
break;
|
|
5696
|
-
case "underline":
|
|
5697
|
-
baseRules.push(`transition: all 200ms ease;`);
|
|
5698
|
-
hoverRules.push(`text-decoration: underline;`);
|
|
5699
|
-
hoverRules.push(`text-underline-offset: 4px;`);
|
|
5700
|
-
activeRules.push(`text-decoration: underline;`);
|
|
5701
|
-
activeRules.push(`text-underline-offset: 4px;`);
|
|
5702
|
-
break;
|
|
5703
|
-
case "underline-grow":
|
|
5704
|
-
baseRules.push(`position: relative;`);
|
|
5705
|
-
baseRules.push(`transition: color 200ms ease;`);
|
|
5706
|
-
hoverRules.push(`color: ${primaryColor};`);
|
|
5707
|
-
activeRules.push(`color: ${primaryColor};`);
|
|
5708
|
-
cssChunks.push(generateUnderlineGrowCSS(themeId));
|
|
5709
|
-
break;
|
|
5710
|
-
case "capsule":
|
|
5711
|
-
baseRules.push(`border-radius: 9999px;`);
|
|
5712
|
-
baseRules.push(`transition: background-color 200ms ease;`);
|
|
5713
|
-
hoverRules.push(`background-color: color-mix(in srgb, ${primaryColor} 10%, transparent);`);
|
|
5714
|
-
activeRules.push(`background-color: color-mix(in srgb, ${primaryColor} 15%, transparent);`);
|
|
5715
|
-
break;
|
|
5716
|
-
case "solid":
|
|
5717
|
-
baseRules.push(`border-radius: 0;`);
|
|
5718
|
-
baseRules.push(`transition: background-color 200ms ease, color 200ms ease;`);
|
|
5719
|
-
hoverRules.push(`background-color: ${primaryColor};`);
|
|
5720
|
-
if (navColorToken) {
|
|
5721
|
-
hoverRules.push(`color: ${tokens.getColor(navColorToken)};`);
|
|
5722
|
-
}
|
|
5723
|
-
activeRules.push(`background-color: ${primaryColor};`);
|
|
5724
|
-
if (navColorToken) {
|
|
5725
|
-
activeRules.push(`color: ${tokens.getColor(navColorToken)};`);
|
|
5726
|
-
}
|
|
5727
|
-
break;
|
|
5728
|
-
case "scale":
|
|
5729
|
-
baseRules.push(`transition: all 200ms ease;`);
|
|
5730
|
-
hoverRules.push(`transform: scale(1.05);`);
|
|
5731
|
-
break;
|
|
5732
|
-
case "frosted":
|
|
5733
|
-
baseRules.push(`border-radius: 0.5rem;`);
|
|
5734
|
-
baseRules.push(`background-color: rgb(255 255 255 / 0.1);`);
|
|
5735
|
-
baseRules.push(`backdrop-filter: blur(8px);`);
|
|
5736
|
-
baseRules.push(`transition: background-color 200ms ease;`);
|
|
5737
|
-
hoverRules.push(`background-color: rgb(255 255 255 / 0.2);`);
|
|
5738
|
-
activeRules.push(`background-color: rgb(255 255 255 / 0.25);`);
|
|
5739
|
-
break;
|
|
6249
|
+
function generateNavLinkStyles(header, themeId, tokens, theme) {
|
|
6250
|
+
if (header.navLinkStyle) {
|
|
6251
|
+
return generateNavLinkCSS({
|
|
6252
|
+
themeId,
|
|
6253
|
+
tokens,
|
|
6254
|
+
theme,
|
|
6255
|
+
style: header.navLinkStyle,
|
|
6256
|
+
className: "header-nav-link"
|
|
6257
|
+
});
|
|
5740
6258
|
}
|
|
5741
|
-
|
|
5742
|
-
|
|
5743
|
-
|
|
5744
|
-
|
|
5745
|
-
|
|
5746
|
-
|
|
6259
|
+
const navStyle = _nullishCoalesce(header.navStyle, () => ( "minimal"));
|
|
6260
|
+
const basePreset = getNavLinkPreset(navStyle);
|
|
6261
|
+
if (!basePreset) {
|
|
6262
|
+
console.warn(`[generateHeaderCss] Nav link preset not found: ${navStyle}`);
|
|
6263
|
+
return "";
|
|
6264
|
+
}
|
|
6265
|
+
const mergedStyle = {
|
|
6266
|
+
...basePreset,
|
|
6267
|
+
// Override with legacy settings
|
|
6268
|
+
fontWeight: _nullishCoalesce(header.navWeight, () => ( basePreset.fontWeight)),
|
|
6269
|
+
colorToken: _optionalChain([(_nullishCoalesce(header.navColor, () => ( header.textColor))), 'optionalAccess', _25 => _25.trim, 'call', _26 => _26()]) || basePreset.colorToken
|
|
6270
|
+
};
|
|
6271
|
+
if (header.navWeight === "bold" && navStyle === "solid") {
|
|
6272
|
+
mergedStyle.textTransform = "uppercase";
|
|
5747
6273
|
}
|
|
5748
6274
|
if (header.navEffects) {
|
|
6275
|
+
mergedStyle.effects = {
|
|
6276
|
+
...mergedStyle.effects,
|
|
6277
|
+
hover: [..._optionalChain([mergedStyle, 'access', _27 => _27.effects, 'optionalAccess', _28 => _28.hover]) || []],
|
|
6278
|
+
active: [..._optionalChain([mergedStyle, 'access', _29 => _29.effects, 'optionalAccess', _30 => _30.active]) || []]
|
|
6279
|
+
};
|
|
5749
6280
|
if (header.navEffects.glow) {
|
|
5750
|
-
|
|
6281
|
+
mergedStyle.effects.hover.push({
|
|
6282
|
+
effectId: "outer-glow",
|
|
6283
|
+
options: { spread: 5 }
|
|
6284
|
+
});
|
|
5751
6285
|
}
|
|
5752
6286
|
if (header.navEffects.neumorphic) {
|
|
5753
|
-
|
|
5754
|
-
|
|
5755
|
-
|
|
5756
|
-
|
|
5757
|
-
|
|
6287
|
+
mergedStyle.effects.hover.push({
|
|
6288
|
+
effectId: "neumorphic-shadow",
|
|
6289
|
+
options: { mode: "pressed" }
|
|
6290
|
+
});
|
|
6291
|
+
mergedStyle.effects.hover.push({
|
|
6292
|
+
effectId: "text-color-change",
|
|
6293
|
+
options: { hoverColorToken: "primary" }
|
|
6294
|
+
});
|
|
5758
6295
|
}
|
|
5759
6296
|
if (header.navEffects.underlineGradient) {
|
|
5760
|
-
|
|
6297
|
+
mergedStyle.effects.hover.push({
|
|
6298
|
+
effectId: "border-bottom-grow",
|
|
6299
|
+
options: { origin: "center" }
|
|
6300
|
+
});
|
|
5761
6301
|
}
|
|
5762
6302
|
}
|
|
5763
|
-
|
|
5764
|
-
|
|
5765
|
-
|
|
5766
|
-
|
|
5767
|
-
|
|
5768
|
-
|
|
5769
|
-
|
|
5770
|
-
|
|
5771
|
-
|
|
5772
|
-
|
|
5773
|
-
|
|
5774
|
-
}
|
|
5775
|
-
|
|
5776
|
-
|
|
5777
|
-
if (activeRules.length > 0) {
|
|
5778
|
-
cssChunks.push(`
|
|
5779
|
-
${activeSelector} {
|
|
5780
|
-
${activeRules.join("\n ")}
|
|
5781
|
-
}
|
|
5782
|
-
`);
|
|
6303
|
+
const navContainerType = _nullishCoalesce(_optionalChain([header, 'access', _31 => _31.navContainer, 'optionalAccess', _32 => _32.type]), () => ( "none"));
|
|
6304
|
+
if (navContainerType === "glass" && navStyle === "minimal") {
|
|
6305
|
+
mergedStyle.borderRadius = "full";
|
|
6306
|
+
mergedStyle.effects = {
|
|
6307
|
+
...mergedStyle.effects,
|
|
6308
|
+
hover: [
|
|
6309
|
+
{ effectId: "background-on-hover-alpha", options: { colorToken: "neutral-50", opacity: 10 } },
|
|
6310
|
+
{ effectId: "text-color-change", options: { hoverColorToken: "neutral-50" } }
|
|
6311
|
+
],
|
|
6312
|
+
active: [
|
|
6313
|
+
{ effectId: "background-on-hover-alpha", options: { colorToken: "neutral-50", opacity: 18 } },
|
|
6314
|
+
{ effectId: "text-color-change", options: { hoverColorToken: "neutral-50" } }
|
|
6315
|
+
]
|
|
6316
|
+
};
|
|
5783
6317
|
}
|
|
5784
|
-
return
|
|
6318
|
+
return generateNavLinkCSS({
|
|
6319
|
+
themeId,
|
|
6320
|
+
tokens,
|
|
6321
|
+
theme,
|
|
6322
|
+
style: mergedStyle,
|
|
6323
|
+
className: "header-nav-link"
|
|
6324
|
+
});
|
|
5785
6325
|
}
|
|
5786
6326
|
function generateNavContainerStyles(header, themeId, tokens) {
|
|
5787
6327
|
const navContainer = header.navContainer;
|
|
5788
|
-
const navContainerType = _nullishCoalesce(_optionalChain([navContainer, 'optionalAccess',
|
|
6328
|
+
const navContainerType = _nullishCoalesce(_optionalChain([navContainer, 'optionalAccess', _33 => _33.type]), () => ( "none"));
|
|
5789
6329
|
if (!navContainer || navContainerType === "none") return "";
|
|
5790
6330
|
const selector = `:where([data-theme-scope="${themeId}"]) .header-nav-row`;
|
|
5791
6331
|
const rules = [];
|
|
@@ -5818,52 +6358,6 @@ function generateNavContainerStyles(header, themeId, tokens) {
|
|
|
5818
6358
|
}
|
|
5819
6359
|
return "";
|
|
5820
6360
|
}
|
|
5821
|
-
function generateGradientUnderlineCSS(themeId, tokens) {
|
|
5822
|
-
const selector = `:where([data-theme-scope="${themeId}"]) .header-nav-link`;
|
|
5823
|
-
const primaryColor = tokens.getColor("primary");
|
|
5824
|
-
const accentColor = tokens.getColor("accent");
|
|
5825
|
-
return `
|
|
5826
|
-
${selector}::after {
|
|
5827
|
-
content: '';
|
|
5828
|
-
position: absolute;
|
|
5829
|
-
bottom: 0;
|
|
5830
|
-
left: 0;
|
|
5831
|
-
width: 100%;
|
|
5832
|
-
height: 2px;
|
|
5833
|
-
background: linear-gradient(to right, ${primaryColor}, ${accentColor});
|
|
5834
|
-
transform: scaleX(0);
|
|
5835
|
-
transform-origin: center;
|
|
5836
|
-
transition: transform 0.3s ease;
|
|
5837
|
-
}
|
|
5838
|
-
|
|
5839
|
-
${selector}:hover::after,
|
|
5840
|
-
${selector}[data-active="true"]::after {
|
|
5841
|
-
transform: scaleX(1);
|
|
5842
|
-
}
|
|
5843
|
-
`.trim();
|
|
5844
|
-
}
|
|
5845
|
-
function generateUnderlineGrowCSS(themeId) {
|
|
5846
|
-
const selector = `:where([data-theme-scope="${themeId}"]) .header-nav-link`;
|
|
5847
|
-
return `
|
|
5848
|
-
${selector}::after {
|
|
5849
|
-
content: '';
|
|
5850
|
-
position: absolute;
|
|
5851
|
-
bottom: 0;
|
|
5852
|
-
left: 0;
|
|
5853
|
-
width: 100%;
|
|
5854
|
-
height: 2px;
|
|
5855
|
-
background: currentColor;
|
|
5856
|
-
transform: scaleX(0);
|
|
5857
|
-
transform-origin: center;
|
|
5858
|
-
transition: transform 0.3s ease;
|
|
5859
|
-
}
|
|
5860
|
-
|
|
5861
|
-
${selector}:hover::after,
|
|
5862
|
-
${selector}[data-active="true"]::after {
|
|
5863
|
-
transform: scaleX(1);
|
|
5864
|
-
}
|
|
5865
|
-
`.trim();
|
|
5866
|
-
}
|
|
5867
6361
|
function generateFloatingContainerStyles(container, themeId, tokens) {
|
|
5868
6362
|
if (!container) return "";
|
|
5869
6363
|
const selector = `:where([data-theme-scope="${themeId}"]) .header-floating-container`;
|
|
@@ -5920,12 +6414,52 @@ function applyAlpha(color, opacity) {
|
|
|
5920
6414
|
const clamped = clampOpacity(opacity, 1);
|
|
5921
6415
|
if (color.startsWith("rgb(") && color.endsWith(")")) {
|
|
5922
6416
|
const inner = color.slice(4, -1).trim();
|
|
5923
|
-
const channels = inner.includes("/") ? inner.split("/")[0].trim() : inner;
|
|
6417
|
+
const channels = inner.includes("/") ? (_nullishCoalesce(inner.split("/")[0], () => ( inner))).trim() : inner;
|
|
5924
6418
|
return `rgb(${channels} / ${clamped})`;
|
|
5925
6419
|
}
|
|
5926
6420
|
return color;
|
|
5927
6421
|
}
|
|
5928
6422
|
|
|
6423
|
+
// ../blocks/src/theme/footer/generateFooterCss.ts
|
|
6424
|
+
function generateFooterCss(options) {
|
|
6425
|
+
const { themeId, theme } = options;
|
|
6426
|
+
const tokens = new TokenResolver(theme);
|
|
6427
|
+
const footer = theme.footer;
|
|
6428
|
+
const cssChunks = [];
|
|
6429
|
+
cssChunks.push(generateFooterNavLinkStyles(footer, themeId, tokens, theme));
|
|
6430
|
+
return cssChunks.filter(Boolean).join("\n\n");
|
|
6431
|
+
}
|
|
6432
|
+
function generateFooterNavLinkStyles(footer, themeId, tokens, theme) {
|
|
6433
|
+
if (footer.navLinkStyle) {
|
|
6434
|
+
return generateNavLinkCSS({
|
|
6435
|
+
themeId,
|
|
6436
|
+
tokens,
|
|
6437
|
+
theme,
|
|
6438
|
+
style: footer.navLinkStyle,
|
|
6439
|
+
className: "footer-nav-link"
|
|
6440
|
+
});
|
|
6441
|
+
}
|
|
6442
|
+
const navStyle = _nullishCoalesce(footer.navStyle, () => ( "minimal"));
|
|
6443
|
+
const basePreset = getNavLinkPreset(navStyle);
|
|
6444
|
+
if (!basePreset) {
|
|
6445
|
+
console.warn(`[generateFooterCss] Nav link preset not found: ${navStyle}`);
|
|
6446
|
+
return "";
|
|
6447
|
+
}
|
|
6448
|
+
const mergedStyle = {
|
|
6449
|
+
...basePreset,
|
|
6450
|
+
// Override with legacy settings
|
|
6451
|
+
fontWeight: _nullishCoalesce(footer.navWeight, () => ( basePreset.fontWeight)),
|
|
6452
|
+
colorToken: _optionalChain([footer, 'access', _34 => _34.navColor, 'optionalAccess', _35 => _35.trim, 'call', _36 => _36()]) || basePreset.colorToken
|
|
6453
|
+
};
|
|
6454
|
+
return generateNavLinkCSS({
|
|
6455
|
+
themeId,
|
|
6456
|
+
tokens,
|
|
6457
|
+
theme,
|
|
6458
|
+
style: mergedStyle,
|
|
6459
|
+
className: "footer-nav-link"
|
|
6460
|
+
});
|
|
6461
|
+
}
|
|
6462
|
+
|
|
5929
6463
|
// ../blocks/src/theme/layout/generateLayoutCss.ts
|
|
5930
6464
|
function generateLayoutCss(options) {
|
|
5931
6465
|
const { themeId } = options;
|
|
@@ -6079,6 +6613,105 @@ ${root} .step-connector {
|
|
|
6079
6613
|
return cssBlocks.join("\n\n");
|
|
6080
6614
|
}
|
|
6081
6615
|
|
|
6616
|
+
// ../blocks/src/theme/typography/generateTypographyCss.ts
|
|
6617
|
+
function generateTypographyCss({ themeId }) {
|
|
6618
|
+
const root = `:where([data-theme-scope="${themeId}"])`;
|
|
6619
|
+
const cssBlocks = [];
|
|
6620
|
+
cssBlocks.push(`/* Base heading styles */
|
|
6621
|
+
${root} :where(h1, h2, h3, h4, h5, h6) {
|
|
6622
|
+
font-family: var(--font-heading);
|
|
6623
|
+
font-style: var(--fi-heading, normal);
|
|
6624
|
+
text-transform: var(--tt-heading, none);
|
|
6625
|
+
font-variant: var(--fv-heading, normal);
|
|
6626
|
+
margin: 0;
|
|
6627
|
+
}`);
|
|
6628
|
+
cssBlocks.push(`/* Heading level styles with fluid typography */
|
|
6629
|
+
${root} :where(h1) {
|
|
6630
|
+
font-size: var(--fs-h1-fluid, var(--fs-h1));
|
|
6631
|
+
font-weight: var(--fw-h1, var(--font-weight-heading));
|
|
6632
|
+
font-style: var(--fi-h1, var(--fi-heading, normal));
|
|
6633
|
+
letter-spacing: var(--ls-h1, var(--ls-heading));
|
|
6634
|
+
line-height: var(--lh-h1, var(--lh-heading));
|
|
6635
|
+
}
|
|
6636
|
+
|
|
6637
|
+
${root} :where(h2) {
|
|
6638
|
+
font-size: var(--fs-h2-fluid, var(--fs-h2));
|
|
6639
|
+
font-weight: var(--fw-h2, var(--font-weight-heading));
|
|
6640
|
+
font-style: var(--fi-h2, var(--fi-heading, normal));
|
|
6641
|
+
letter-spacing: var(--ls-h2, var(--ls-heading));
|
|
6642
|
+
line-height: var(--lh-h2, var(--lh-heading));
|
|
6643
|
+
}
|
|
6644
|
+
|
|
6645
|
+
${root} :where(h3) {
|
|
6646
|
+
font-size: var(--fs-h3-fluid, var(--fs-h3));
|
|
6647
|
+
font-weight: var(--fw-h3, var(--font-weight-heading));
|
|
6648
|
+
font-style: var(--fi-h3, var(--fi-heading, normal));
|
|
6649
|
+
letter-spacing: var(--ls-h3, var(--ls-heading));
|
|
6650
|
+
line-height: var(--lh-h3, var(--lh-heading));
|
|
6651
|
+
}
|
|
6652
|
+
|
|
6653
|
+
${root} :where(h4) {
|
|
6654
|
+
font-size: var(--fs-h4-fluid, var(--fs-h4, var(--fs-h3)));
|
|
6655
|
+
font-weight: var(--fw-h4, var(--font-weight-heading));
|
|
6656
|
+
font-style: var(--fi-h4, var(--fi-heading, normal));
|
|
6657
|
+
letter-spacing: var(--ls-h4, var(--ls-heading));
|
|
6658
|
+
line-height: var(--lh-h4, var(--lh-heading));
|
|
6659
|
+
}
|
|
6660
|
+
|
|
6661
|
+
${root} :where(h5) {
|
|
6662
|
+
font-size: var(--fs-h5-fluid, var(--fs-h5, var(--fs-body)));
|
|
6663
|
+
font-weight: var(--fw-h5, var(--font-weight-heading));
|
|
6664
|
+
font-style: var(--fi-h5, var(--fi-heading, normal));
|
|
6665
|
+
letter-spacing: var(--ls-h5, var(--ls-heading));
|
|
6666
|
+
line-height: var(--lh-h5, var(--lh-heading));
|
|
6667
|
+
}
|
|
6668
|
+
|
|
6669
|
+
${root} :where(h6) {
|
|
6670
|
+
font-size: var(--fs-h6-fluid, var(--fs-h6, var(--fs-body)));
|
|
6671
|
+
font-weight: var(--fw-h6, var(--font-weight-heading));
|
|
6672
|
+
font-style: var(--fi-h6, var(--fi-heading, normal));
|
|
6673
|
+
letter-spacing: var(--ls-h6, var(--ls-heading));
|
|
6674
|
+
line-height: var(--lh-h6, var(--lh-heading));
|
|
6675
|
+
}`);
|
|
6676
|
+
cssBlocks.push(`/* Display variant for hero/splash headings */
|
|
6677
|
+
${root} :where(.heading-display) {
|
|
6678
|
+
font-size: var(--fs-display-fluid, var(--fs-display));
|
|
6679
|
+
}
|
|
6680
|
+
|
|
6681
|
+
${root} :where(h1.heading-display) {
|
|
6682
|
+
font-size: var(--fs-h1-display-fluid, var(--fs-h1-display, calc(var(--fs-h1) * 1.5)));
|
|
6683
|
+
}
|
|
6684
|
+
|
|
6685
|
+
${root} :where(h2.heading-display) {
|
|
6686
|
+
font-size: var(--fs-h2-display-fluid, var(--fs-h2-display, calc(var(--fs-h2) * 1.35)));
|
|
6687
|
+
}`);
|
|
6688
|
+
cssBlocks.push(`/* Compact variant for cards/sidebars */
|
|
6689
|
+
${root} :where(.heading-compact) {
|
|
6690
|
+
font-size: var(--fs-compact);
|
|
6691
|
+
}
|
|
6692
|
+
|
|
6693
|
+
${root} :where(h1.heading-compact) {
|
|
6694
|
+
font-size: calc(var(--fs-h1) * 0.75);
|
|
6695
|
+
}
|
|
6696
|
+
|
|
6697
|
+
${root} :where(h2.heading-compact) {
|
|
6698
|
+
font-size: calc(var(--fs-h2) * 0.8);
|
|
6699
|
+
}
|
|
6700
|
+
|
|
6701
|
+
${root} :where(h3.heading-compact) {
|
|
6702
|
+
font-size: calc(var(--fs-h3) * 0.85);
|
|
6703
|
+
}`);
|
|
6704
|
+
cssBlocks.push(`/* Body text base styles */
|
|
6705
|
+
${root} :where(p, li, td, th, label, span) {
|
|
6706
|
+
font-family: var(--font-body);
|
|
6707
|
+
font-weight: var(--font-weight-body);
|
|
6708
|
+
font-size: var(--fs-body);
|
|
6709
|
+
letter-spacing: var(--ls-body);
|
|
6710
|
+
line-height: var(--lh-body);
|
|
6711
|
+
}`);
|
|
6712
|
+
return cssBlocks.join("\n\n");
|
|
6713
|
+
}
|
|
6714
|
+
|
|
6082
6715
|
// ../blocks/src/system/theme/tokens.ts
|
|
6083
6716
|
var defaultThemeTokens = {
|
|
6084
6717
|
color: {
|
|
@@ -6153,7 +6786,7 @@ var defaultThemeTokens = {
|
|
|
6153
6786
|
function buildThemeRuntime(theme, options) {
|
|
6154
6787
|
const hydrated = hydrateTheme(theme);
|
|
6155
6788
|
const cssVars = buildThemeCssVars(hydrated);
|
|
6156
|
-
const themeId = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
6789
|
+
const themeId = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _37 => _37.themeId]), () => ( "theme-default"));
|
|
6157
6790
|
const buttonCss = generateButtonCss({
|
|
6158
6791
|
themeId,
|
|
6159
6792
|
theme,
|
|
@@ -6163,6 +6796,10 @@ function buildThemeRuntime(theme, options) {
|
|
|
6163
6796
|
themeId,
|
|
6164
6797
|
theme
|
|
6165
6798
|
});
|
|
6799
|
+
const footerCss = generateFooterCss({
|
|
6800
|
+
themeId,
|
|
6801
|
+
theme
|
|
6802
|
+
});
|
|
6166
6803
|
const cardCss = generateCardCss({
|
|
6167
6804
|
themeId,
|
|
6168
6805
|
theme,
|
|
@@ -6192,8 +6829,12 @@ function buildThemeRuntime(theme, options) {
|
|
|
6192
6829
|
themeId,
|
|
6193
6830
|
theme
|
|
6194
6831
|
});
|
|
6832
|
+
const typographyCss = generateTypographyCss({
|
|
6833
|
+
themeId,
|
|
6834
|
+
theme
|
|
6835
|
+
});
|
|
6195
6836
|
const tokens = buildThemeTokens(hydrated, theme);
|
|
6196
|
-
return { hydrated, cssVars, tokens, paletteTokens: hydrated.palette, buttonCss, headerCss, cardCss, accordionCss, inputCss, layoutCss, statusCss, progressCss };
|
|
6837
|
+
return { hydrated, cssVars, tokens, paletteTokens: hydrated.palette, buttonCss, headerCss, footerCss, cardCss, accordionCss, inputCss, layoutCss, statusCss, progressCss, typographyCss };
|
|
6197
6838
|
}
|
|
6198
6839
|
function hydrateTheme(theme) {
|
|
6199
6840
|
return {
|
|
@@ -6215,25 +6856,47 @@ function buildThemeCssVars(theme) {
|
|
|
6215
6856
|
...typography.headings.h1.weight ? { ["--fw-h1"]: mapWeight(typography.headings.h1.weight) } : {},
|
|
6216
6857
|
...typography.headings.h2.weight ? { ["--fw-h2"]: mapWeight(typography.headings.h2.weight) } : {},
|
|
6217
6858
|
...typography.headings.h3.weight ? { ["--fw-h3"]: mapWeight(typography.headings.h3.weight) } : {},
|
|
6218
|
-
..._optionalChain([typography, 'access',
|
|
6219
|
-
..._optionalChain([typography, 'access',
|
|
6220
|
-
..._optionalChain([typography, 'access',
|
|
6859
|
+
..._optionalChain([typography, 'access', _38 => _38.headings, 'access', _39 => _39.h4, 'optionalAccess', _40 => _40.weight]) ? { ["--fw-h4"]: mapWeight(typography.headings.h4.weight) } : {},
|
|
6860
|
+
..._optionalChain([typography, 'access', _41 => _41.headings, 'access', _42 => _42.h5, 'optionalAccess', _43 => _43.weight]) ? { ["--fw-h5"]: mapWeight(typography.headings.h5.weight) } : {},
|
|
6861
|
+
..._optionalChain([typography, 'access', _44 => _44.headings, 'access', _45 => _45.h6, 'optionalAccess', _46 => _46.weight]) ? { ["--fw-h6"]: mapWeight(typography.headings.h6.weight) } : {},
|
|
6221
6862
|
["--ls-heading"]: mapLetterSpacing(typography.headings.default.letterSpacing),
|
|
6222
6863
|
["--ls-body"]: mapLetterSpacing(typography.body.letterSpacing),
|
|
6223
6864
|
...typography.headings.h1.letterSpacing ? { ["--ls-h1"]: mapLetterSpacing(typography.headings.h1.letterSpacing) } : {},
|
|
6224
6865
|
...typography.headings.h2.letterSpacing ? { ["--ls-h2"]: mapLetterSpacing(typography.headings.h2.letterSpacing) } : {},
|
|
6225
6866
|
...typography.headings.h3.letterSpacing ? { ["--ls-h3"]: mapLetterSpacing(typography.headings.h3.letterSpacing) } : {},
|
|
6867
|
+
..._optionalChain([typography, 'access', _47 => _47.headings, 'access', _48 => _48.h4, 'optionalAccess', _49 => _49.letterSpacing]) ? { ["--ls-h4"]: mapLetterSpacing(typography.headings.h4.letterSpacing) } : {},
|
|
6868
|
+
..._optionalChain([typography, 'access', _50 => _50.headings, 'access', _51 => _51.h5, 'optionalAccess', _52 => _52.letterSpacing]) ? { ["--ls-h5"]: mapLetterSpacing(typography.headings.h5.letterSpacing) } : {},
|
|
6869
|
+
..._optionalChain([typography, 'access', _53 => _53.headings, 'access', _54 => _54.h6, 'optionalAccess', _55 => _55.letterSpacing]) ? { ["--ls-h6"]: mapLetterSpacing(typography.headings.h6.letterSpacing) } : {},
|
|
6226
6870
|
["--lh-heading"]: mapLineHeight(typography.headings.default.lineHeight),
|
|
6227
6871
|
["--lh-body"]: mapLineHeight(typography.body.lineHeight),
|
|
6228
6872
|
...typography.headings.h1.lineHeight ? { ["--lh-h1"]: mapLineHeight(typography.headings.h1.lineHeight) } : {},
|
|
6229
6873
|
...typography.headings.h2.lineHeight ? { ["--lh-h2"]: mapLineHeight(typography.headings.h2.lineHeight) } : {},
|
|
6230
6874
|
...typography.headings.h3.lineHeight ? { ["--lh-h3"]: mapLineHeight(typography.headings.h3.lineHeight) } : {},
|
|
6875
|
+
..._optionalChain([typography, 'access', _56 => _56.headings, 'access', _57 => _57.h4, 'optionalAccess', _58 => _58.lineHeight]) ? { ["--lh-h4"]: mapLineHeight(typography.headings.h4.lineHeight) } : {},
|
|
6876
|
+
..._optionalChain([typography, 'access', _59 => _59.headings, 'access', _60 => _60.h5, 'optionalAccess', _61 => _61.lineHeight]) ? { ["--lh-h5"]: mapLineHeight(typography.headings.h5.lineHeight) } : {},
|
|
6877
|
+
..._optionalChain([typography, 'access', _62 => _62.headings, 'access', _63 => _63.h6, 'optionalAccess', _64 => _64.lineHeight]) ? { ["--lh-h6"]: mapLineHeight(typography.headings.h6.lineHeight) } : {},
|
|
6231
6878
|
["--tt-heading"]: mapTextTransform(typography.headings.default.case),
|
|
6232
6879
|
["--fv-heading"]: mapFontVariant(typography.headings.default.case),
|
|
6880
|
+
["--fi-heading"]: mapFontStyle(typography.headings.default.italic),
|
|
6881
|
+
// Per-level italic overrides
|
|
6882
|
+
...typography.headings.h1.italic != null ? { ["--fi-h1"]: mapFontStyle(typography.headings.h1.italic) } : {},
|
|
6883
|
+
...typography.headings.h2.italic != null ? { ["--fi-h2"]: mapFontStyle(typography.headings.h2.italic) } : {},
|
|
6884
|
+
...typography.headings.h3.italic != null ? { ["--fi-h3"]: mapFontStyle(typography.headings.h3.italic) } : {},
|
|
6885
|
+
..._optionalChain([typography, 'access', _65 => _65.headings, 'access', _66 => _66.h4, 'optionalAccess', _67 => _67.italic]) != null ? { ["--fi-h4"]: mapFontStyle(typography.headings.h4.italic) } : {},
|
|
6886
|
+
..._optionalChain([typography, 'access', _68 => _68.headings, 'access', _69 => _69.h5, 'optionalAccess', _70 => _70.italic]) != null ? { ["--fi-h5"]: mapFontStyle(typography.headings.h5.italic) } : {},
|
|
6887
|
+
..._optionalChain([typography, 'access', _71 => _71.headings, 'access', _72 => _72.h6, 'optionalAccess', _73 => _73.italic]) != null ? { ["--fi-h6"]: mapFontStyle(typography.headings.h6.italic) } : {},
|
|
6888
|
+
// Static font sizes (fallback)
|
|
6233
6889
|
["--fs-body"]: sized.body,
|
|
6234
6890
|
["--fs-h3"]: sized.h3,
|
|
6235
6891
|
["--fs-h2"]: sized.h2,
|
|
6236
6892
|
["--fs-h1"]: sized.h1,
|
|
6893
|
+
// Fluid font sizes (responsive with clamp)
|
|
6894
|
+
["--fs-h1-fluid"]: sized.h1Fluid,
|
|
6895
|
+
["--fs-h2-fluid"]: sized.h2Fluid,
|
|
6896
|
+
["--fs-h3-fluid"]: sized.h3Fluid,
|
|
6897
|
+
// Display variant (for hero/splash headings)
|
|
6898
|
+
["--fs-h1-display"]: sized.h1Display,
|
|
6899
|
+
["--fs-h1-display-fluid"]: sized.h1DisplayFluid,
|
|
6237
6900
|
["--shadow-elev"]: mapShadow(shadow.elevation, shadow.softness, shadow.position || "bottom"),
|
|
6238
6901
|
["--space-mult"]: mapSpaceMult(space),
|
|
6239
6902
|
["--motion-duration"]: mapMotionDuration(motion.level),
|
|
@@ -6339,33 +7002,81 @@ function mapMotionEasing(e) {
|
|
|
6339
7002
|
gentle: "cubic-bezier(.15,.85,.15,1)"
|
|
6340
7003
|
}[e];
|
|
6341
7004
|
}
|
|
7005
|
+
function normalizeScaleName(scale) {
|
|
7006
|
+
const aliasMap = {
|
|
7007
|
+
minorThird: "compact",
|
|
7008
|
+
majorThird: "balanced",
|
|
7009
|
+
perfectFourth: "spacious",
|
|
7010
|
+
compact: "compact",
|
|
7011
|
+
balanced: "balanced",
|
|
7012
|
+
spacious: "spacious"
|
|
7013
|
+
};
|
|
7014
|
+
return _nullishCoalesce(aliasMap[scale], () => ( "balanced"));
|
|
7015
|
+
}
|
|
6342
7016
|
function computeTypeScale(scale, bodySize) {
|
|
6343
7017
|
const base = { md: 16, lg: 17, xl: 18 }[bodySize];
|
|
6344
|
-
const
|
|
7018
|
+
const normalizedScale = normalizeScaleName(scale);
|
|
7019
|
+
const ratio = { compact: 1.2, balanced: 1.25, spacious: 1.333 }[normalizedScale];
|
|
6345
7020
|
const h3 = Math.round(base * ratio);
|
|
6346
7021
|
const h2 = Math.round(h3 * ratio);
|
|
6347
7022
|
const h1 = Math.round(h2 * ratio);
|
|
7023
|
+
const fluidMin = 0.7;
|
|
7024
|
+
const fluidMax = 1.3;
|
|
6348
7025
|
return {
|
|
7026
|
+
// Static sizes (fallback)
|
|
6349
7027
|
["--fs-body"]: `${base}px`,
|
|
6350
7028
|
["--fs-h3"]: `${h3}px`,
|
|
6351
7029
|
["--fs-h2"]: `${h2}px`,
|
|
6352
|
-
["--fs-h1"]: `${h1}px
|
|
7030
|
+
["--fs-h1"]: `${h1}px`,
|
|
7031
|
+
// Fluid typography min/max values
|
|
7032
|
+
["--fs-h1-min"]: `${Math.round(h1 * fluidMin)}px`,
|
|
7033
|
+
["--fs-h1-max"]: `${Math.round(h1 * fluidMax)}px`,
|
|
7034
|
+
["--fs-h2-min"]: `${Math.round(h2 * fluidMin)}px`,
|
|
7035
|
+
["--fs-h2-max"]: `${Math.round(h2 * fluidMax)}px`,
|
|
7036
|
+
["--fs-h3-min"]: `${Math.round(h3 * fluidMin)}px`,
|
|
7037
|
+
["--fs-h3-max"]: `${Math.round(h3 * fluidMax)}px`,
|
|
7038
|
+
// Fluid clamp values (320px to 1200px viewport range = 880px)
|
|
7039
|
+
["--fs-h1-fluid"]: `clamp(${Math.round(h1 * fluidMin)}px, calc(${Math.round(h1 * fluidMin)}px + ${Math.round(h1 * (fluidMax - fluidMin))} * ((100vw - 320px) / 880)), ${Math.round(h1 * fluidMax)}px)`,
|
|
7040
|
+
["--fs-h2-fluid"]: `clamp(${Math.round(h2 * fluidMin)}px, calc(${Math.round(h2 * fluidMin)}px + ${Math.round(h2 * (fluidMax - fluidMin))} * ((100vw - 320px) / 880)), ${Math.round(h2 * fluidMax)}px)`,
|
|
7041
|
+
["--fs-h3-fluid"]: `clamp(${Math.round(h3 * fluidMin)}px, calc(${Math.round(h3 * fluidMin)}px + ${Math.round(h3 * (fluidMax - fluidMin))} * ((100vw - 320px) / 880)), ${Math.round(h3 * fluidMax)}px)`,
|
|
7042
|
+
// Display variant sizes (1.5x for hero headings)
|
|
7043
|
+
["--fs-h1-display"]: `${Math.round(h1 * 1.5)}px`,
|
|
7044
|
+
["--fs-h1-display-fluid"]: `clamp(${Math.round(h1 * fluidMin * 1.5)}px, calc(${Math.round(h1 * fluidMin * 1.5)}px + ${Math.round(h1 * (fluidMax - fluidMin) * 1.5)} * ((100vw - 320px) / 880)), ${Math.round(h1 * fluidMax * 1.5)}px)`
|
|
6353
7045
|
};
|
|
6354
7046
|
}
|
|
7047
|
+
var SIZE_SCALE_MAP = {
|
|
7048
|
+
xs: 0.85,
|
|
7049
|
+
sm: 0.925,
|
|
7050
|
+
md: 1,
|
|
7051
|
+
lg: 1.1,
|
|
7052
|
+
xl: 1.2,
|
|
7053
|
+
"2xl": 1.35
|
|
7054
|
+
};
|
|
6355
7055
|
function applyHeadingSizeOverrides(base, typography) {
|
|
6356
7056
|
const body = base["--fs-body"];
|
|
6357
7057
|
const h1Base = parseFloat(base["--fs-h1"].replace("px", ""));
|
|
6358
7058
|
const h2Base = parseFloat(base["--fs-h2"].replace("px", ""));
|
|
6359
7059
|
const h3Base = parseFloat(base["--fs-h3"].replace("px", ""));
|
|
6360
|
-
const
|
|
6361
|
-
const
|
|
6362
|
-
const
|
|
6363
|
-
const
|
|
7060
|
+
const h1Scale = typography.headings.h1.size ? SIZE_SCALE_MAP[typography.headings.h1.size] : 1;
|
|
7061
|
+
const h2Scale = typography.headings.h2.size ? SIZE_SCALE_MAP[typography.headings.h2.size] : 1;
|
|
7062
|
+
const h3Scale = typography.headings.h3.size ? SIZE_SCALE_MAP[typography.headings.h3.size] : 1;
|
|
7063
|
+
const h1 = Math.round(h1Base * h1Scale);
|
|
7064
|
+
const h2 = Math.round(h2Base * h2Scale);
|
|
7065
|
+
const h3 = Math.round(h3Base * h3Scale);
|
|
7066
|
+
const fluidMin = 0.7;
|
|
7067
|
+
const fluidMax = 1.3;
|
|
6364
7068
|
return {
|
|
6365
7069
|
body,
|
|
6366
|
-
h1: `${
|
|
6367
|
-
h2: `${
|
|
6368
|
-
h3: `${
|
|
7070
|
+
h1: `${h1}px`,
|
|
7071
|
+
h2: `${h2}px`,
|
|
7072
|
+
h3: `${h3}px`,
|
|
7073
|
+
// Fluid versions with size overrides applied
|
|
7074
|
+
h1Fluid: `clamp(${Math.round(h1 * fluidMin)}px, calc(${Math.round(h1 * fluidMin)}px + ${Math.round(h1 * (fluidMax - fluidMin))} * ((100vw - 320px) / 880)), ${Math.round(h1 * fluidMax)}px)`,
|
|
7075
|
+
h2Fluid: `clamp(${Math.round(h2 * fluidMin)}px, calc(${Math.round(h2 * fluidMin)}px + ${Math.round(h2 * (fluidMax - fluidMin))} * ((100vw - 320px) / 880)), ${Math.round(h2 * fluidMax)}px)`,
|
|
7076
|
+
h3Fluid: `clamp(${Math.round(h3 * fluidMin)}px, calc(${Math.round(h3 * fluidMin)}px + ${Math.round(h3 * (fluidMax - fluidMin))} * ((100vw - 320px) / 880)), ${Math.round(h3 * fluidMax)}px)`,
|
|
7077
|
+
// Display variant (1.5x scale for hero headings)
|
|
7078
|
+
h1Display: `${Math.round(h1 * 1.5)}px`,
|
|
7079
|
+
h1DisplayFluid: `clamp(${Math.round(h1 * 1.5 * fluidMin)}px, calc(${Math.round(h1 * 1.5 * fluidMin)}px + ${Math.round(h1 * 1.5 * (fluidMax - fluidMin))} * ((100vw - 320px) / 880)), ${Math.round(h1 * 1.5 * fluidMax)}px)`
|
|
6369
7080
|
};
|
|
6370
7081
|
}
|
|
6371
7082
|
function mapLetterSpacing(s) {
|
|
@@ -6382,6 +7093,9 @@ function mapFontVariant(c) {
|
|
|
6382
7093
|
if (c === "smallCaps") return "small-caps";
|
|
6383
7094
|
return "normal";
|
|
6384
7095
|
}
|
|
7096
|
+
function mapFontStyle(italic) {
|
|
7097
|
+
return italic ? "italic" : "normal";
|
|
7098
|
+
}
|
|
6385
7099
|
|
|
6386
7100
|
// ../blocks/src/PageRenderer.tsx
|
|
6387
7101
|
var _react = require('react'); var React5 = _interopRequireWildcard(_react);
|
|
@@ -6410,12 +7124,12 @@ var RichTextValueSchema = _zod.z.union([
|
|
|
6410
7124
|
]);
|
|
6411
7125
|
function buildRichTextSchema(options) {
|
|
6412
7126
|
let schema = RichTextValueSchema;
|
|
6413
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
7127
|
+
if (_optionalChain([options, 'optionalAccess', _74 => _74.required])) {
|
|
6414
7128
|
const label = _nullishCoalesce(options.label, () => ( "This field"));
|
|
6415
7129
|
schema = schema.refine(
|
|
6416
7130
|
(val) => {
|
|
6417
7131
|
const doc = _nullishCoalesce(val.doc, () => ( val));
|
|
6418
|
-
const content = _optionalChain([doc, 'optionalAccess',
|
|
7132
|
+
const content = _optionalChain([doc, 'optionalAccess', _75 => _75.content]);
|
|
6419
7133
|
if (!content || content.length === 0) return false;
|
|
6420
7134
|
if (content.length === 1 && content[0].type === "paragraph" && !content[0].content) {
|
|
6421
7135
|
return false;
|
|
@@ -6488,13 +7202,13 @@ function buildFieldSchema(field, allowNull, allowIncomplete = false) {
|
|
|
6488
7202
|
return finalizeSchema(schema, required, allowNull, allowIncomplete);
|
|
6489
7203
|
}
|
|
6490
7204
|
function buildTextSchema(field) {
|
|
6491
|
-
const ui = _nullishCoalesce(_optionalChain([field, 'optionalAccess',
|
|
6492
|
-
const inputType = _optionalChain([ui, 'optionalAccess',
|
|
7205
|
+
const ui = _nullishCoalesce(_optionalChain([field, 'optionalAccess', _76 => _76.ui]), () => ( {}));
|
|
7206
|
+
const inputType = _optionalChain([ui, 'optionalAccess', _77 => _77.inputType]);
|
|
6493
7207
|
let schema;
|
|
6494
7208
|
if (inputType === "number") {
|
|
6495
7209
|
schema = _zod.z.coerce.number();
|
|
6496
|
-
if (typeof _optionalChain([ui, 'optionalAccess',
|
|
6497
|
-
if (typeof _optionalChain([ui, 'optionalAccess',
|
|
7210
|
+
if (typeof _optionalChain([ui, 'optionalAccess', _78 => _78.min]) === "number") schema = schema.min(ui.min);
|
|
7211
|
+
if (typeof _optionalChain([ui, 'optionalAccess', _79 => _79.max]) === "number") schema = schema.max(ui.max);
|
|
6498
7212
|
} else {
|
|
6499
7213
|
schema = _zod.z.string();
|
|
6500
7214
|
if (inputType === "email") {
|
|
@@ -6504,7 +7218,7 @@ function buildTextSchema(field) {
|
|
|
6504
7218
|
const TEL_RE = /^[+()0-9\s\-]{3,}$/;
|
|
6505
7219
|
schema = schema.regex(TEL_RE, `${field.label} must be a valid phone number`);
|
|
6506
7220
|
}
|
|
6507
|
-
if (_optionalChain([ui, 'optionalAccess',
|
|
7221
|
+
if (_optionalChain([ui, 'optionalAccess', _80 => _80.pattern])) {
|
|
6508
7222
|
try {
|
|
6509
7223
|
const re = new RegExp(ui.pattern);
|
|
6510
7224
|
schema = schema.regex(re, `${field.label} is not in the correct format`);
|
|
@@ -6584,7 +7298,7 @@ function buildLinkSchema() {
|
|
|
6584
7298
|
}
|
|
6585
7299
|
function buildSelectSchema(field) {
|
|
6586
7300
|
const ui = field.ui;
|
|
6587
|
-
if (_optionalChain([ui, 'optionalAccess',
|
|
7301
|
+
if (_optionalChain([ui, 'optionalAccess', _81 => _81.widget]) === "sdkSelect") {
|
|
6588
7302
|
const anyStringSchema = _zod.z.string();
|
|
6589
7303
|
if (field.multiple) {
|
|
6590
7304
|
const arraySchema = _zod.z.array(anyStringSchema);
|
|
@@ -6608,11 +7322,11 @@ function buildReferenceSchema(field) {
|
|
|
6608
7322
|
return schema;
|
|
6609
7323
|
}
|
|
6610
7324
|
function buildRepeaterSchema(field, allowNull, allowIncomplete) {
|
|
6611
|
-
const parsed =
|
|
7325
|
+
const parsed = _chunkYYO3RIFOjs.fieldSchema.array().parse(_nullishCoalesce(_optionalChain([field, 'access', _82 => _82.schema, 'optionalAccess', _83 => _83.fields]), () => ( [])));
|
|
6612
7326
|
const childShape = {};
|
|
6613
7327
|
for (const child of parsed) {
|
|
6614
|
-
if (child.type === "group" && _optionalChain([child, 'access',
|
|
6615
|
-
const groupParsed =
|
|
7328
|
+
if (child.type === "group" && _optionalChain([child, 'access', _84 => _84.ui, 'optionalAccess', _85 => _85.flattenInRepeater])) {
|
|
7329
|
+
const groupParsed = _chunkYYO3RIFOjs.fieldSchema.array().parse(_nullishCoalesce(_optionalChain([child, 'access', _86 => _86.schema, 'optionalAccess', _87 => _87.fields]), () => ( [])));
|
|
6616
7330
|
for (const gc of groupParsed) {
|
|
6617
7331
|
childShape[gc.id] = buildFieldSchema(gc, allowNull, allowIncomplete);
|
|
6618
7332
|
}
|
|
@@ -6631,7 +7345,7 @@ function buildRepeaterSchema(field, allowNull, allowIncomplete) {
|
|
|
6631
7345
|
return arraySchema;
|
|
6632
7346
|
}
|
|
6633
7347
|
function buildGroupSchema(field, allowNull, allowIncomplete) {
|
|
6634
|
-
const parsed =
|
|
7348
|
+
const parsed = _chunkYYO3RIFOjs.fieldSchema.array().parse(_nullishCoalesce(_optionalChain([field, 'access', _88 => _88.schema, 'optionalAccess', _89 => _89.fields]), () => ( [])));
|
|
6635
7349
|
const childShape = {};
|
|
6636
7350
|
for (const child of parsed) {
|
|
6637
7351
|
childShape[child.id] = buildFieldSchema(child, allowNull, allowIncomplete);
|
|
@@ -6649,7 +7363,7 @@ function finalizeSchema(schema, required, allowNull, allowIncomplete = false) {
|
|
|
6649
7363
|
}
|
|
6650
7364
|
|
|
6651
7365
|
// ../blocks/src/system/fragments/library/headerCta.ts
|
|
6652
|
-
var headerCtaFragment =
|
|
7366
|
+
var headerCtaFragment = _chunkYYO3RIFOjs.defineFragment.call(void 0, {
|
|
6653
7367
|
id: "headerCta",
|
|
6654
7368
|
title: "Header CTA",
|
|
6655
7369
|
description: "Single call-to-action button for the site header.",
|
|
@@ -6689,7 +7403,7 @@ var headerCtaFragment = _chunkEGTDJ4PLjs.defineFragment.call(void 0, {
|
|
|
6689
7403
|
}
|
|
6690
7404
|
],
|
|
6691
7405
|
layout: [
|
|
6692
|
-
|
|
7406
|
+
_chunkYYO3RIFOjs.ctaButton.call(void 0, {
|
|
6693
7407
|
basePath: "cta",
|
|
6694
7408
|
// Relative path
|
|
6695
7409
|
whenPath: "cta.label"
|
|
@@ -6699,7 +7413,7 @@ var headerCtaFragment = _chunkEGTDJ4PLjs.defineFragment.call(void 0, {
|
|
|
6699
7413
|
});
|
|
6700
7414
|
|
|
6701
7415
|
// ../blocks/src/system/fragments/library/singleButton.ts
|
|
6702
|
-
var singleButtonFragment =
|
|
7416
|
+
var singleButtonFragment = _chunkYYO3RIFOjs.defineFragment.call(void 0, {
|
|
6703
7417
|
id: "singleButton",
|
|
6704
7418
|
title: "Single Button Content",
|
|
6705
7419
|
description: "Heading and primary button for the single button block.",
|
|
@@ -6711,7 +7425,7 @@ var singleButtonFragment = _chunkEGTDJ4PLjs.defineFragment.call(void 0, {
|
|
|
6711
7425
|
required: true,
|
|
6712
7426
|
maxLength: 120
|
|
6713
7427
|
},
|
|
6714
|
-
|
|
7428
|
+
_chunkYYO3RIFOjs.createButtonGroup.call(void 0, {
|
|
6715
7429
|
showGroupLabel: true,
|
|
6716
7430
|
groupId: "button",
|
|
6717
7431
|
groupLabel: "Button",
|
|
@@ -6719,9 +7433,9 @@ var singleButtonFragment = _chunkEGTDJ4PLjs.defineFragment.call(void 0, {
|
|
|
6719
7433
|
})
|
|
6720
7434
|
],
|
|
6721
7435
|
layout: [
|
|
6722
|
-
|
|
7436
|
+
_chunkYYO3RIFOjs.headingGroup.call(void 0, { titlePath: "title" }),
|
|
6723
7437
|
// Relative path
|
|
6724
|
-
|
|
7438
|
+
_chunkYYO3RIFOjs.ctaButton.call(void 0, { basePath: "button" })
|
|
6725
7439
|
// Relative path
|
|
6726
7440
|
]
|
|
6727
7441
|
});
|
|
@@ -6729,26 +7443,26 @@ var singleButtonFragment = _chunkEGTDJ4PLjs.defineFragment.call(void 0, {
|
|
|
6729
7443
|
// ../blocks/src/system/fragments/lazyInit.ts
|
|
6730
7444
|
var initialized = false;
|
|
6731
7445
|
var ALL_FRAGMENTS = [
|
|
6732
|
-
|
|
6733
|
-
|
|
6734
|
-
|
|
6735
|
-
|
|
6736
|
-
|
|
6737
|
-
|
|
6738
|
-
|
|
6739
|
-
|
|
6740
|
-
|
|
6741
|
-
|
|
7446
|
+
_chunkYYO3RIFOjs.bodyCopyFragment,
|
|
7447
|
+
_chunkYYO3RIFOjs.heroCopyFragment,
|
|
7448
|
+
_chunkYYO3RIFOjs.ctaRowFragment,
|
|
7449
|
+
_chunkYYO3RIFOjs.ctaCopyFragment,
|
|
7450
|
+
_chunkYYO3RIFOjs.testimonialsHeadingFragment,
|
|
7451
|
+
_chunkYYO3RIFOjs.testimonialsCarouselFragment,
|
|
7452
|
+
_chunkYYO3RIFOjs.formCopyFragment,
|
|
7453
|
+
_chunkYYO3RIFOjs.formEmbedFragment,
|
|
7454
|
+
_chunkYYO3RIFOjs.footerBottomTextFragment,
|
|
7455
|
+
_chunkYYO3RIFOjs.footerLinkGroupsFragment,
|
|
6742
7456
|
headerCtaFragment,
|
|
6743
7457
|
singleButtonFragment,
|
|
6744
|
-
|
|
6745
|
-
|
|
6746
|
-
|
|
6747
|
-
|
|
6748
|
-
|
|
6749
|
-
|
|
6750
|
-
|
|
6751
|
-
|
|
7458
|
+
_chunkYYO3RIFOjs.blogFeaturedPostFragment,
|
|
7459
|
+
_chunkYYO3RIFOjs.blogListGridFragment,
|
|
7460
|
+
_chunkYYO3RIFOjs.blogListStackFragment,
|
|
7461
|
+
_chunkYYO3RIFOjs.faqHeadingFragment,
|
|
7462
|
+
_chunkYYO3RIFOjs.faqAccordionFragment,
|
|
7463
|
+
_chunkYYO3RIFOjs.cardFragment,
|
|
7464
|
+
_chunkYYO3RIFOjs.headingFragment,
|
|
7465
|
+
_chunkYYO3RIFOjs.richTextFragment
|
|
6752
7466
|
];
|
|
6753
7467
|
function lazyRegisterFragments(registerFn) {
|
|
6754
7468
|
if (initialized) return;
|
|
@@ -6772,7 +7486,7 @@ function getFragmentRegistry() {
|
|
|
6772
7486
|
|
|
6773
7487
|
// ../blocks/src/system/transforms/registry/core.ts
|
|
6774
7488
|
function runTransforms(value, transforms, context, registry) {
|
|
6775
|
-
if (!_optionalChain([transforms, 'optionalAccess',
|
|
7489
|
+
if (!_optionalChain([transforms, 'optionalAccess', _90 => _90.length])) return value;
|
|
6776
7490
|
return transforms.reduce((acc, step) => {
|
|
6777
7491
|
const transform = registry.get(step.id);
|
|
6778
7492
|
if (!transform) {
|
|
@@ -6844,7 +7558,7 @@ var resolveImageStyleTransform = {
|
|
|
6844
7558
|
style.width = scaleValue;
|
|
6845
7559
|
style.height = scaleValue;
|
|
6846
7560
|
}
|
|
6847
|
-
if (position && !
|
|
7561
|
+
if (position && !_chunkYYO3RIFOjs.BACKGROUND_POSITION_PRESET_VALUES.includes(position)) {
|
|
6848
7562
|
style.objectPosition = position;
|
|
6849
7563
|
}
|
|
6850
7564
|
return style;
|
|
@@ -6855,7 +7569,7 @@ var resolveImageClassNameTransform = {
|
|
|
6855
7569
|
kind: "string",
|
|
6856
7570
|
summary: "Resolve className for background image based on objectFit, scale and position",
|
|
6857
7571
|
run: (value, options, _context) => {
|
|
6858
|
-
const baseClass = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
7572
|
+
const baseClass = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _91 => _91.baseClass]), () => ( "absolute -z-10"));
|
|
6859
7573
|
if (!value || typeof value !== "object") return `${baseClass} inset-0 h-full w-full`;
|
|
6860
7574
|
const input = value;
|
|
6861
7575
|
const objectFit = isString(input.objectFit) ? input.objectFit.trim() : null;
|
|
@@ -6875,12 +7589,12 @@ var resolveImageClassNameTransform = {
|
|
|
6875
7589
|
if (!needsAnchoring) {
|
|
6876
7590
|
return `${baseClass} inset-0 h-full w-full`;
|
|
6877
7591
|
}
|
|
6878
|
-
const isPreset = position &&
|
|
7592
|
+
const isPreset = position && _chunkYYO3RIFOjs.BACKGROUND_POSITION_PRESET_VALUES.includes(position);
|
|
6879
7593
|
const isCustom = position && !isPreset;
|
|
6880
7594
|
if (isCustom) {
|
|
6881
7595
|
return baseClass;
|
|
6882
7596
|
}
|
|
6883
|
-
const anchorClasses =
|
|
7597
|
+
const anchorClasses = _chunkYYO3RIFOjs.getAnchorClasses.call(void 0, position);
|
|
6884
7598
|
return `${baseClass} ${anchorClasses}`;
|
|
6885
7599
|
}
|
|
6886
7600
|
};
|
|
@@ -6897,7 +7611,7 @@ var backgroundTransforms = [
|
|
|
6897
7611
|
const opacity = isNumber(input.opacity) ? input.opacity : isString(input.opacity) ? parseFloat(input.opacity) : null;
|
|
6898
7612
|
const style = {};
|
|
6899
7613
|
if (color) {
|
|
6900
|
-
const isToken = Boolean(_optionalChain([context, 'optionalAccess',
|
|
7614
|
+
const isToken = Boolean(_optionalChain([context, 'optionalAccess', _92 => _92.theme, 'optionalAccess', _93 => _93.palette, 'optionalAccess', _94 => _94[color]]) || color === "transparent" || color === "surface");
|
|
6901
7615
|
if (!isToken) {
|
|
6902
7616
|
style.backgroundColor = color;
|
|
6903
7617
|
}
|
|
@@ -6916,7 +7630,7 @@ var backgroundTransforms = [
|
|
|
6916
7630
|
kind: "string",
|
|
6917
7631
|
summary: "Map background color token to Tailwind class with auto-overflow for custom sizing",
|
|
6918
7632
|
run: (value, options, context) => {
|
|
6919
|
-
const baseClass = _optionalChain([options, 'optionalAccess',
|
|
7633
|
+
const baseClass = _optionalChain([options, 'optionalAccess', _95 => _95.baseClass]);
|
|
6920
7634
|
const base = typeof baseClass === "string" && baseClass.trim().length > 0 ? baseClass.trim() : "";
|
|
6921
7635
|
if (!value || typeof value !== "object") return base;
|
|
6922
7636
|
const input = value;
|
|
@@ -6925,7 +7639,7 @@ var backgroundTransforms = [
|
|
|
6925
7639
|
const classes = [];
|
|
6926
7640
|
if (base) classes.push(base);
|
|
6927
7641
|
if (color) {
|
|
6928
|
-
const isToken = Boolean(_optionalChain([context, 'optionalAccess',
|
|
7642
|
+
const isToken = Boolean(_optionalChain([context, 'optionalAccess', _96 => _96.theme, 'optionalAccess', _97 => _97.palette, 'optionalAccess', _98 => _98[color]]) || color === "transparent" || color === "surface");
|
|
6929
7643
|
if (isToken) {
|
|
6930
7644
|
classes.push(`bg-${color}`);
|
|
6931
7645
|
}
|
|
@@ -6987,6 +7701,10 @@ var resolveLinkTransform = {
|
|
|
6987
7701
|
const href = link.href.trim();
|
|
6988
7702
|
return href.length > 0 ? href : null;
|
|
6989
7703
|
}
|
|
7704
|
+
if (!kind && typeof link.href === "string") {
|
|
7705
|
+
const href = link.href.trim();
|
|
7706
|
+
return href.length > 0 ? href : null;
|
|
7707
|
+
}
|
|
6990
7708
|
return null;
|
|
6991
7709
|
}
|
|
6992
7710
|
};
|
|
@@ -6998,19 +7716,19 @@ var spacingTransform = {
|
|
|
6998
7716
|
kind: "string",
|
|
6999
7717
|
summary: "Map semantic spacing value to Tailwind padding classes",
|
|
7000
7718
|
run: (value, options, _context) => {
|
|
7001
|
-
const axis = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
7002
|
-
const baseClass = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
7719
|
+
const axis = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _99 => _99.axis]), () => ( "all"));
|
|
7720
|
+
const baseClass = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _100 => _100.baseClass]), () => ( ""));
|
|
7003
7721
|
if (!value || typeof value !== "string") {
|
|
7004
7722
|
return baseClass.trim() || "";
|
|
7005
7723
|
}
|
|
7006
7724
|
const trimmed = value.trim();
|
|
7007
|
-
if (!
|
|
7725
|
+
if (!_chunkYYO3RIFOjs.isSemanticSpacing.call(void 0, trimmed)) {
|
|
7008
7726
|
if (process.env.NODE_ENV !== "production") {
|
|
7009
7727
|
console.warn(`[spacing] Invalid spacing value: "${trimmed}". Expected one of: none, compact, cozy, medium, comfortable, spacious.`);
|
|
7010
7728
|
}
|
|
7011
7729
|
return baseClass.trim() || "";
|
|
7012
7730
|
}
|
|
7013
|
-
const spacingClass =
|
|
7731
|
+
const spacingClass = _chunkYYO3RIFOjs.resolveSpacing.call(void 0, trimmed, axis);
|
|
7014
7732
|
return baseClass ? `${baseClass.trim()} ${spacingClass}` : spacingClass;
|
|
7015
7733
|
}
|
|
7016
7734
|
};
|
|
@@ -7023,7 +7741,7 @@ var raisedTransform = {
|
|
|
7023
7741
|
if (value !== true) {
|
|
7024
7742
|
return baseClass.trim() || "";
|
|
7025
7743
|
}
|
|
7026
|
-
const shadowValue = _optionalChain([context, 'access',
|
|
7744
|
+
const shadowValue = _optionalChain([context, 'access', _101 => _101.theme, 'optionalAccess', _102 => _102.shadow, 'optionalAccess', _103 => _103.medium]);
|
|
7027
7745
|
if (!shadowValue || shadowValue === "none") {
|
|
7028
7746
|
return baseClass.trim() || "";
|
|
7029
7747
|
}
|
|
@@ -7065,7 +7783,7 @@ var boxStylesCompositeTransform = {
|
|
|
7065
7783
|
summary: "Composite transform for all box style properties",
|
|
7066
7784
|
run: (value, options, context) => {
|
|
7067
7785
|
if (!value || typeof value !== "object") {
|
|
7068
|
-
return _optionalChain([options, 'access',
|
|
7786
|
+
return _optionalChain([options, 'access', _104 => _104.baseClass, 'optionalAccess', _105 => _105.trim, 'call', _106 => _106()]) || "";
|
|
7069
7787
|
}
|
|
7070
7788
|
const input = value;
|
|
7071
7789
|
const axis = _nullishCoalesce(options.axis, () => ( "all"));
|
|
@@ -7100,12 +7818,12 @@ var sectionClassNameTransform = {
|
|
|
7100
7818
|
kind: "string",
|
|
7101
7819
|
summary: "Resolve section className from spacing and fullWidth setting",
|
|
7102
7820
|
run: (value, options, context) => {
|
|
7103
|
-
const baseClass = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
7104
|
-
const containerStylesPath = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
7105
|
-
const defaultSpacing = _optionalChain([options, 'optionalAccess',
|
|
7821
|
+
const baseClass = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _107 => _107.baseClass]), () => ( ""));
|
|
7822
|
+
const containerStylesPath = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _108 => _108.containerStylesPath]), () => ( "_containerStyles"));
|
|
7823
|
+
const defaultSpacing = _optionalChain([options, 'optionalAccess', _109 => _109.defaultSpacing]);
|
|
7106
7824
|
const contextData = context.data;
|
|
7107
|
-
const containerStyles = _optionalChain([contextData, 'optionalAccess',
|
|
7108
|
-
const fullWidth = _optionalChain([containerStyles, 'optionalAccess',
|
|
7825
|
+
const containerStyles = _optionalChain([contextData, 'optionalAccess', _110 => _110[containerStylesPath]]);
|
|
7826
|
+
const fullWidth = _optionalChain([containerStyles, 'optionalAccess', _111 => _111.fullWidth]) === true;
|
|
7109
7827
|
let adjustedBaseClass = baseClass;
|
|
7110
7828
|
if (fullWidth && baseClass) {
|
|
7111
7829
|
adjustedBaseClass = baseClass.split(" ").filter((cls) => !cls.startsWith("px-")).join(" ").trim();
|
|
@@ -7115,7 +7833,7 @@ var sectionClassNameTransform = {
|
|
|
7115
7833
|
if (value && typeof value === "object") {
|
|
7116
7834
|
const input = value;
|
|
7117
7835
|
if (typeof input.spacing === "string") {
|
|
7118
|
-
if (
|
|
7836
|
+
if (_chunkYYO3RIFOjs.isSemanticSpacing.call(void 0, input.spacing)) {
|
|
7119
7837
|
spacing = input.spacing;
|
|
7120
7838
|
} else if (process.env.NODE_ENV !== "production") {
|
|
7121
7839
|
console.warn(`[sectionStyles] Invalid spacing value in _sectionStyles: "${input.spacing}". Expected one of: none, compact, cozy, medium, comfortable, spacious.`);
|
|
@@ -7125,7 +7843,7 @@ var sectionClassNameTransform = {
|
|
|
7125
7843
|
if (adjustedBaseClass) classes.push(adjustedBaseClass);
|
|
7126
7844
|
const effectiveSpacing = _nullishCoalesce(spacing, () => ( defaultSpacing));
|
|
7127
7845
|
if (effectiveSpacing) {
|
|
7128
|
-
const spacingClass =
|
|
7846
|
+
const spacingClass = _chunkYYO3RIFOjs.resolveSpacing.call(void 0, effectiveSpacing, "y");
|
|
7129
7847
|
classes.push(spacingClass);
|
|
7130
7848
|
}
|
|
7131
7849
|
return classes.join(" ").trim();
|
|
@@ -7136,7 +7854,7 @@ var containerStylesResolveClassName = {
|
|
|
7136
7854
|
kind: "string",
|
|
7137
7855
|
summary: "Resolve container className based on fullWidth setting",
|
|
7138
7856
|
run: (value, options, _context) => {
|
|
7139
|
-
const baseClass = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
7857
|
+
const baseClass = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _112 => _112.baseClass]), () => ( ""));
|
|
7140
7858
|
if (!value || typeof value !== "object") {
|
|
7141
7859
|
const defaultClass = "container mx-auto";
|
|
7142
7860
|
return baseClass ? `${baseClass} ${defaultClass}`.trim() : defaultClass;
|
|
@@ -7164,10 +7882,10 @@ var boxStylesTransforms = [
|
|
|
7164
7882
|
|
|
7165
7883
|
// ../blocks/src/system/transforms/registry/index.ts
|
|
7166
7884
|
var builtinTransformDefinitions = [
|
|
7167
|
-
...
|
|
7168
|
-
...
|
|
7169
|
-
...
|
|
7170
|
-
...
|
|
7885
|
+
..._chunkYYO3RIFOjs.formattingTransforms,
|
|
7886
|
+
..._chunkYYO3RIFOjs.layoutTransforms,
|
|
7887
|
+
..._chunkYYO3RIFOjs.uiTransforms,
|
|
7888
|
+
..._chunkYYO3RIFOjs.mediaTransforms,
|
|
7171
7889
|
...backgroundTransforms,
|
|
7172
7890
|
...linksTransforms,
|
|
7173
7891
|
...boxStylesTransforms
|
|
@@ -7190,8 +7908,8 @@ function Section({
|
|
|
7190
7908
|
}) {
|
|
7191
7909
|
const overflowClass = allowOverflow ? "overflow-visible" : "overflow-hidden";
|
|
7192
7910
|
const alwaysClass = clsx_default("relative isolate", overflowClass, className);
|
|
7193
|
-
const backgroundStyle = background ?
|
|
7194
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Comp, { className: alwaysClass, style:
|
|
7911
|
+
const backgroundStyle = background ? _chunkYYO3RIFOjs.backgroundColorStyle.call(void 0, background) : void 0;
|
|
7912
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Comp, { className: alwaysClass, style: _chunkYYO3RIFOjs.mergeStyles.call(void 0, backgroundStyle, style), "data-slot": _nullishCoalesce(dataSlot, () => ( "section")), children });
|
|
7195
7913
|
}
|
|
7196
7914
|
|
|
7197
7915
|
// ../blocks/src/primitives/layout/Stack.tsx
|
|
@@ -7342,7 +8060,7 @@ function renderMarks(text, marks, key) {
|
|
|
7342
8060
|
}
|
|
7343
8061
|
function renderDoc(node, key) {
|
|
7344
8062
|
if (!node || !node.type) return null;
|
|
7345
|
-
const children = _optionalChain([node, 'access',
|
|
8063
|
+
const children = _optionalChain([node, 'access', _113 => _113.content, 'optionalAccess', _114 => _114.map, 'call', _115 => _115((child, index) => renderDoc(child, `${key}-${index}`))]);
|
|
7346
8064
|
switch (node.type) {
|
|
7347
8065
|
case "doc":
|
|
7348
8066
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children });
|
|
@@ -7350,7 +8068,7 @@ function renderDoc(node, key) {
|
|
|
7350
8068
|
if (!children && !node.text) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", {}, key);
|
|
7351
8069
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { children: _nullishCoalesce(children, () => ( renderMarks(_nullishCoalesce(node.text, () => ( "")), node.marks, key))) }, key);
|
|
7352
8070
|
case "heading": {
|
|
7353
|
-
const level = Math.min(Math.max(_nullishCoalesce(_optionalChain([node, 'access',
|
|
8071
|
+
const level = Math.min(Math.max(_nullishCoalesce(_optionalChain([node, 'access', _116 => _116.attrs, 'optionalAccess', _117 => _117.level]), () => ( 2)), 1), 6);
|
|
7354
8072
|
const headingTag = `h${level}`;
|
|
7355
8073
|
return React5.default.createElement(headingTag, { key }, children);
|
|
7356
8074
|
}
|
|
@@ -7389,7 +8107,7 @@ var TextNode = ({ value, children, blockId: _blockId, blockKind: _blockKind, blo
|
|
|
7389
8107
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Text, { ...rest, children: _nullishCoalesce(value, () => ( children)) });
|
|
7390
8108
|
};
|
|
7391
8109
|
var RichTextNode = ({ value, blockId: _blockId, blockKind: _blockKind, blockContent: _blockContent, fragmentRegistry: _fragmentRegistry, pathBase: _pathBase, ...rest }) => {
|
|
7392
|
-
const doc = _nullishCoalesce(_optionalChain([value, 'optionalAccess',
|
|
8110
|
+
const doc = _nullishCoalesce(_optionalChain([value, 'optionalAccess', _118 => _118.doc]), () => ( value));
|
|
7393
8111
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, RichText, { doc, ...rest });
|
|
7394
8112
|
};
|
|
7395
8113
|
var ButtonNode = ({
|
|
@@ -7458,16 +8176,16 @@ var FormNodeSSR = ({ value, submitLabel, successMessage: _successMessage, classN
|
|
|
7458
8176
|
"div",
|
|
7459
8177
|
{
|
|
7460
8178
|
className: clsx_default("rounded-md border border-dashed p-6 text-sm", className),
|
|
7461
|
-
style:
|
|
7462
|
-
|
|
7463
|
-
|
|
7464
|
-
|
|
8179
|
+
style: _chunkYYO3RIFOjs.mergeStyles.call(void 0,
|
|
8180
|
+
_chunkYYO3RIFOjs.backgroundColorStyle.call(void 0, "surface"),
|
|
8181
|
+
_chunkYYO3RIFOjs.borderColorStyle.call(void 0, "border"),
|
|
8182
|
+
_chunkYYO3RIFOjs.textColorStyle.call(void 0, "mutedText")
|
|
7465
8183
|
),
|
|
7466
8184
|
children: "Missing or unknown form."
|
|
7467
8185
|
}
|
|
7468
8186
|
);
|
|
7469
8187
|
}
|
|
7470
|
-
const fields = _optionalChain([form, 'optionalAccess',
|
|
8188
|
+
const fields = _optionalChain([form, 'optionalAccess', _119 => _119.schemaJson, 'optionalAccess', _120 => _120.fields]);
|
|
7471
8189
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "form", { method: "POST", action: "/api/forms/submit", className: clsx_default("space-y-4", className), children: [
|
|
7472
8190
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "input", { type: "hidden", name: "form_id", value: form.id }),
|
|
7473
8191
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "input", { type: "text", name: "company", className: "hidden", tabIndex: -1, autoComplete: "off" }),
|
|
@@ -7698,7 +8416,7 @@ var COLUMN_CLASSES = {
|
|
|
7698
8416
|
"4": "sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4"
|
|
7699
8417
|
};
|
|
7700
8418
|
function formatDateForUrl(isoTimestamp) {
|
|
7701
|
-
return isoTimestamp.split("T")[0];
|
|
8419
|
+
return _nullishCoalesce(isoTimestamp.split("T")[0], () => ( ""));
|
|
7702
8420
|
}
|
|
7703
8421
|
function buildEventUrl(basePath, slug, startsAt) {
|
|
7704
8422
|
const date = formatDateForUrl(startsAt);
|
|
@@ -7883,7 +8601,7 @@ function getContainerClass(layout, columns) {
|
|
|
7883
8601
|
return `grid gap-6 ${COLUMN_CLASSES2[columns] || COLUMN_CLASSES2["3"]}`;
|
|
7884
8602
|
}
|
|
7885
8603
|
function formatDateForUrl2(isoTimestamp) {
|
|
7886
|
-
return isoTimestamp.split("T")[0];
|
|
8604
|
+
return _nullishCoalesce(isoTimestamp.split("T")[0], () => ( ""));
|
|
7887
8605
|
}
|
|
7888
8606
|
function buildEventUrl2(basePath, slug, startsAt) {
|
|
7889
8607
|
const date = formatDateForUrl2(startsAt);
|
|
@@ -8102,11 +8820,11 @@ function extractSegmentsFromPart(part) {
|
|
|
8102
8820
|
if (!part) return [];
|
|
8103
8821
|
const segments = [];
|
|
8104
8822
|
const baseMatch = part.match(/^([^\[]+)/);
|
|
8105
|
-
if (baseMatch) {
|
|
8823
|
+
if (baseMatch && baseMatch[1]) {
|
|
8106
8824
|
segments.push(baseMatch[1]);
|
|
8107
8825
|
}
|
|
8108
8826
|
const bracketMatches = Array.from(part.matchAll(BRACKET_ACCESS_REGEX));
|
|
8109
|
-
const bracketSegments = bracketMatches.map((match) => _nullishCoalesce(_optionalChain([match, 'access',
|
|
8827
|
+
const bracketSegments = bracketMatches.map((match) => _nullishCoalesce(_optionalChain([match, 'access', _121 => _121.groups, 'optionalAccess', _122 => _122.token]), () => ( ""))).filter((token) => token.length > 0).map(parseBracketToken);
|
|
8110
8828
|
segments.push(...bracketSegments);
|
|
8111
8829
|
if (!baseMatch && !part.includes("[")) {
|
|
8112
8830
|
return [part];
|
|
@@ -8129,7 +8847,7 @@ function getAbsoluteSegments(fromPath, context) {
|
|
|
8129
8847
|
return [first === "$root" ? "$root" : "content", ...rest];
|
|
8130
8848
|
}
|
|
8131
8849
|
const scoped = context.scopes.find((entry) => entry.name === first);
|
|
8132
|
-
if (_optionalChain([scoped, 'optionalAccess',
|
|
8850
|
+
if (_optionalChain([scoped, 'optionalAccess', _123 => _123.basePathSegments]) && scoped.basePathSegments.length > 0) {
|
|
8133
8851
|
return [...scoped.basePathSegments, ...rest];
|
|
8134
8852
|
}
|
|
8135
8853
|
return void 0;
|
|
@@ -8173,7 +8891,7 @@ function extractRouteMapFromViewModel(viewModel) {
|
|
|
8173
8891
|
}
|
|
8174
8892
|
function parseBinding(raw, origin) {
|
|
8175
8893
|
try {
|
|
8176
|
-
return
|
|
8894
|
+
return _chunkYYO3RIFOjs.bindingSchema.parse(raw);
|
|
8177
8895
|
} catch (error) {
|
|
8178
8896
|
const message = error instanceof Error ? error.message : String(error);
|
|
8179
8897
|
throw new Error(`Failed to parse binding (${origin}): ${message}`);
|
|
@@ -8184,7 +8902,7 @@ function applyTransformsAndFallback(value, binding, context) {
|
|
|
8184
8902
|
const routeMap = _nullishCoalesce(context.routes, () => ( extractRouteMapFromViewModel(context.viewModel)));
|
|
8185
8903
|
const transformed = runTransforms(
|
|
8186
8904
|
value,
|
|
8187
|
-
_nullishCoalesce(_optionalChain([binding, 'access',
|
|
8905
|
+
_nullishCoalesce(_optionalChain([binding, 'access', _124 => _124.transforms, 'optionalAccess', _125 => _125.map, 'call', _126 => _126((step) => ({ id: step.id, options: step.options }))]), () => ( [])),
|
|
8188
8906
|
{ theme: _nullishCoalesce(context.theme, () => ( defaultThemeTokens)), routes: routeMap },
|
|
8189
8907
|
transforms
|
|
8190
8908
|
);
|
|
@@ -8262,7 +8980,7 @@ function applyScopes(node, context) {
|
|
|
8262
8980
|
if (!node.$scopes) return context;
|
|
8263
8981
|
const scopeContext = { ...context, scopes: [...context.scopes] };
|
|
8264
8982
|
for (const scope of node.$scopes) {
|
|
8265
|
-
const binding =
|
|
8983
|
+
const binding = _chunkYYO3RIFOjs.bindingSchema.parse(scope.from);
|
|
8266
8984
|
const value = resolveBindingValue(binding, scopeContext);
|
|
8267
8985
|
scopeContext.scopes.push({ name: scope.name, value });
|
|
8268
8986
|
}
|
|
@@ -8368,7 +9086,7 @@ function injectEditorPath(props, node, parsedBinding, context) {
|
|
|
8368
9086
|
};
|
|
8369
9087
|
}
|
|
8370
9088
|
function resolveChildren(nodes, context) {
|
|
8371
|
-
if (!_optionalChain([nodes, 'optionalAccess',
|
|
9089
|
+
if (!_optionalChain([nodes, 'optionalAccess', _127 => _127.length])) return [];
|
|
8372
9090
|
return nodes.flatMap((child, index) => {
|
|
8373
9091
|
const childContext = { ...context, scopes: [...context.scopes] };
|
|
8374
9092
|
const resolved = resolveNode2(child, childContext, index);
|
|
@@ -8390,7 +9108,7 @@ function resolveNode2(node, context, indexFallback) {
|
|
|
8390
9108
|
const normalizedType = node.type.toLowerCase();
|
|
8391
9109
|
const component = _nullishCoalesce(_nullishCoalesce(registry[node.type], () => ( registry[normalizedType])), () => ( (normalizedType === "section" ? SectionNode : void 0)));
|
|
8392
9110
|
if (!component) {
|
|
8393
|
-
if (_optionalChain([globalThis, 'optionalAccess',
|
|
9111
|
+
if (_optionalChain([globalThis, 'optionalAccess', _128 => _128.process, 'optionalAccess', _129 => _129.env, 'optionalAccess', _130 => _130.NODE_ENV]) !== "production") {
|
|
8394
9112
|
console.warn(`[block-system] Missing renderer for node type: ${node.type}`);
|
|
8395
9113
|
}
|
|
8396
9114
|
return null;
|
|
@@ -8489,11 +9207,11 @@ function resolveBlockLayout(manifest, content) {
|
|
|
8489
9207
|
if (!manifest.variants) {
|
|
8490
9208
|
return _nullishCoalesce(manifest.layout, () => ( null));
|
|
8491
9209
|
}
|
|
8492
|
-
const contentVariant = _optionalChain([content, 'optionalAccess',
|
|
9210
|
+
const contentVariant = _optionalChain([content, 'optionalAccess', _131 => _131.variant]);
|
|
8493
9211
|
if (typeof contentVariant === "string" && manifest.variants[contentVariant]) {
|
|
8494
9212
|
return manifest.variants[contentVariant];
|
|
8495
9213
|
}
|
|
8496
|
-
const contentLayout = _optionalChain([content, 'optionalAccess',
|
|
9214
|
+
const contentLayout = _optionalChain([content, 'optionalAccess', _132 => _132.layout]);
|
|
8497
9215
|
if (typeof contentLayout === "string" && manifest.variants[contentLayout]) {
|
|
8498
9216
|
return manifest.variants[contentLayout];
|
|
8499
9217
|
}
|
|
@@ -8550,7 +9268,7 @@ function makeDefaultBlockComponent(args) {
|
|
|
8550
9268
|
...typeof themeConfig !== "undefined" ? { theme: themeConfig } : {}
|
|
8551
9269
|
}
|
|
8552
9270
|
};
|
|
8553
|
-
const themeForTransforms = _optionalChain([themeConfig, 'optionalAccess',
|
|
9271
|
+
const themeForTransforms = _optionalChain([themeConfig, 'optionalAccess', _133 => _133.buttons]) ? { ...theme, buttons: themeConfig.buttons } : theme;
|
|
8554
9272
|
return resolveTree(layout, {
|
|
8555
9273
|
registry,
|
|
8556
9274
|
viewModel,
|
|
@@ -8589,7 +9307,7 @@ function renderBlock(manifest, content, options = {}) {
|
|
|
8589
9307
|
|
|
8590
9308
|
// ../blocks/src/system/manifest/hydrateLinks.ts
|
|
8591
9309
|
function hydrateManifestLinks(manifest, content, routes) {
|
|
8592
|
-
if (!routes || !_optionalChain([manifest, 'optionalAccess',
|
|
9310
|
+
if (!routes || !_optionalChain([manifest, 'optionalAccess', _134 => _134.fields, 'optionalAccess', _135 => _135.length])) {
|
|
8593
9311
|
return content;
|
|
8594
9312
|
}
|
|
8595
9313
|
const hydrated = hydrateValue(content, routes);
|
|
@@ -8732,8 +9450,9 @@ function PageRenderer({
|
|
|
8732
9450
|
blockOverrides,
|
|
8733
9451
|
sdkConfig
|
|
8734
9452
|
}) {
|
|
9453
|
+
setContextSupabaseUrl(_optionalChain([dataContext, 'optionalAccess', _136 => _136.supabaseUrl]));
|
|
8735
9454
|
if (!page || page.blocks.length === 0) {
|
|
8736
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "p-6 text-sm", style:
|
|
9455
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "p-6 text-sm", style: _chunkYYO3RIFOjs.textColorStyle.call(void 0, "mutedText"), children: "No blocks found." });
|
|
8737
9456
|
}
|
|
8738
9457
|
const themeTokens = _nullishCoalesce(providedThemeTokens, () => ( buildThemeRuntime(theme).tokens));
|
|
8739
9458
|
const resolvedRegistry = _nullishCoalesce(registry, () => ( getDefaultComponentRegistry()));
|
|
@@ -8801,8 +9520,8 @@ var MemoBlockSection = React5.memo(function MemoBlockSection2({
|
|
|
8801
9520
|
sdkConfig
|
|
8802
9521
|
}) {
|
|
8803
9522
|
const OverrideComponent = getBlockOverride(block.kind, blockOverrides);
|
|
8804
|
-
let definition =
|
|
8805
|
-
if (!definition && block.kind.startsWith("custom.") && _optionalChain([sdkConfig, 'optionalAccess',
|
|
9523
|
+
let definition = _chunkYYO3RIFOjs.getBlockDefinition.call(void 0, block.kind);
|
|
9524
|
+
if (!definition && block.kind.startsWith("custom.") && _optionalChain([sdkConfig, 'optionalAccess', _137 => _137.customBlocks])) {
|
|
8806
9525
|
const sdkBlock = sdkConfig.customBlocks.find((b) => b.id === block.kind);
|
|
8807
9526
|
if (sdkBlock) {
|
|
8808
9527
|
definition = transformSdkBlockToDefinition(sdkBlock);
|
|
@@ -8816,14 +9535,14 @@ var MemoBlockSection = React5.memo(function MemoBlockSection2({
|
|
|
8816
9535
|
const validator = createManifestValidator(definition.manifest, { allowNull: false });
|
|
8817
9536
|
const parsed = validator.safeParse(content);
|
|
8818
9537
|
try {
|
|
8819
|
-
const env = _optionalChain([globalThis, 'access',
|
|
9538
|
+
const env = _optionalChain([globalThis, 'access', _138 => _138.process, 'optionalAccess', _139 => _139.env, 'optionalAccess', _140 => _140.NODE_ENV]);
|
|
8820
9539
|
if (env !== "production" && !parsed.success && !usePlaceholders) {
|
|
8821
9540
|
console.warn("[blocks:PageRenderer] manifest validation failed", {
|
|
8822
9541
|
blockId: _nullishCoalesce(block.id, () => ( null)),
|
|
8823
9542
|
blockKind: block.kind,
|
|
8824
9543
|
content: summarizeValue(content),
|
|
8825
9544
|
expectedFields: (_nullishCoalesce(definition.manifest.fields, () => ( []))).map((f) => ({ id: f.id, type: f.type, required: !!f.required })),
|
|
8826
|
-
issues: _nullishCoalesce(_optionalChain([parsed, 'optionalAccess',
|
|
9545
|
+
issues: _nullishCoalesce(_optionalChain([parsed, 'optionalAccess', _141 => _141.error, 'optionalAccess', _142 => _142.issues]), () => ( null))
|
|
8827
9546
|
});
|
|
8828
9547
|
}
|
|
8829
9548
|
} catch (e6) {
|
|
@@ -8844,7 +9563,7 @@ var MemoBlockSection = React5.memo(function MemoBlockSection2({
|
|
|
8844
9563
|
return wrapBlock && block.id ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children: wrapBlock(block.id, rendered) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children: rendered });
|
|
8845
9564
|
}
|
|
8846
9565
|
try {
|
|
8847
|
-
const routes = _nullishCoalesce(routeMap, () => ( _optionalChain([dataContext, 'optionalAccess',
|
|
9566
|
+
const routes = _nullishCoalesce(routeMap, () => ( _optionalChain([dataContext, 'optionalAccess', _143 => _143.routes])));
|
|
8848
9567
|
const hydratedContent = routes ? hydrateManifestLinks(definition.manifest, data, routes) : data;
|
|
8849
9568
|
const resolved = resolveBlockData({
|
|
8850
9569
|
block,
|
|
@@ -8867,13 +9586,13 @@ var MemoBlockSection = React5.memo(function MemoBlockSection2({
|
|
|
8867
9586
|
const pathBase = typeof block.id === "string" && block.id.length > 0 ? `blocks.${block.id}.` : void 0;
|
|
8868
9587
|
const rootContext = {
|
|
8869
9588
|
$root: {
|
|
8870
|
-
siteId: _nullishCoalesce(_optionalChain([dataContext, 'optionalAccess',
|
|
8871
|
-
pageId: _nullishCoalesce(_optionalChain([dataContext, 'optionalAccess',
|
|
8872
|
-
previewStage: _nullishCoalesce(_optionalChain([dataContext, 'optionalAccess',
|
|
9589
|
+
siteId: _nullishCoalesce(_optionalChain([dataContext, 'optionalAccess', _144 => _144.siteId]), () => ( null)),
|
|
9590
|
+
pageId: _nullishCoalesce(_optionalChain([dataContext, 'optionalAccess', _145 => _145.pageId]), () => ( null)),
|
|
9591
|
+
previewStage: _nullishCoalesce(_optionalChain([dataContext, 'optionalAccess', _146 => _146.previewStage]), () => ( "published")),
|
|
8873
9592
|
...routes ? { routes } : {},
|
|
8874
9593
|
// Occurrence and content entry context for template pages
|
|
8875
|
-
occurrenceContext: _nullishCoalesce(_optionalChain([dataContext, 'optionalAccess',
|
|
8876
|
-
contentEntry: _nullishCoalesce(_optionalChain([dataContext, 'optionalAccess',
|
|
9594
|
+
occurrenceContext: _nullishCoalesce(_optionalChain([dataContext, 'optionalAccess', _147 => _147.occurrenceContext]), () => ( null)),
|
|
9595
|
+
contentEntry: _nullishCoalesce(_optionalChain([dataContext, 'optionalAccess', _148 => _148.contentEntry]), () => ( null))
|
|
8877
9596
|
}
|
|
8878
9597
|
};
|
|
8879
9598
|
const blockBindings = _nullishCoalesce(block.bindings, () => ( void 0));
|
|
@@ -8902,7 +9621,7 @@ var MemoBlockSection = React5.memo(function MemoBlockSection2({
|
|
|
8902
9621
|
return prev.block === next.block && prev.registry === next.registry && prev.dataContext === next.dataContext && prev.themeTokens === next.themeTokens && prev.themeConfig === next.themeConfig && prev.routeMap === next.routeMap && prev.usePlaceholders === next.usePlaceholders && prev.wrapBlock === next.wrapBlock && prev.blockOverrides === next.blockOverrides && prev.sdkConfig === next.sdkConfig;
|
|
8903
9622
|
});
|
|
8904
9623
|
function fallback(message) {
|
|
8905
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "p-6 text-sm", style:
|
|
9624
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "p-6 text-sm", style: _chunkYYO3RIFOjs.textColorStyle.call(void 0, "mutedText"), children: message });
|
|
8906
9625
|
}
|
|
8907
9626
|
function resolveBlockData({ block, definition, dataContext }) {
|
|
8908
9627
|
if (!definition.dataLoaders || Object.keys(definition.dataLoaders).length === 0) {
|
|
@@ -8910,7 +9629,7 @@ function resolveBlockData({ block, definition, dataContext }) {
|
|
|
8910
9629
|
}
|
|
8911
9630
|
const blockId = _nullishCoalesce(block.id, () => ( null));
|
|
8912
9631
|
if (!blockId) return void 0;
|
|
8913
|
-
const raw = _optionalChain([dataContext, 'optionalAccess',
|
|
9632
|
+
const raw = _optionalChain([dataContext, 'optionalAccess', _149 => _149.resolvedData, 'optionalAccess', _150 => _150[blockId]]);
|
|
8914
9633
|
if (!raw || typeof raw !== "object") {
|
|
8915
9634
|
return {};
|
|
8916
9635
|
}
|
|
@@ -8964,11 +9683,11 @@ var isNumber2 = (value) => typeof value === "number" && !isNaN(value);
|
|
|
8964
9683
|
function resolveColor(color, theme) {
|
|
8965
9684
|
if (!color || !isString2(color)) return null;
|
|
8966
9685
|
const trimmed = color.trim();
|
|
8967
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
9686
|
+
if (_optionalChain([theme, 'optionalAccess', _151 => _151.palette, 'optionalAccess', _152 => _152[trimmed]])) {
|
|
8968
9687
|
return theme.palette[trimmed];
|
|
8969
9688
|
}
|
|
8970
9689
|
if (trimmed === "transparent") return "transparent";
|
|
8971
|
-
if (trimmed === "surface" && _optionalChain([theme, 'optionalAccess',
|
|
9690
|
+
if (trimmed === "surface" && _optionalChain([theme, 'optionalAccess', _153 => _153.palette, 'optionalAccess', _154 => _154.surface])) {
|
|
8972
9691
|
return theme.palette.surface;
|
|
8973
9692
|
}
|
|
8974
9693
|
return trimmed;
|
|
@@ -9042,7 +9761,7 @@ function resolveBackground(background, theme) {
|
|
|
9042
9761
|
imageStyle.width = scaleValue;
|
|
9043
9762
|
imageStyle.height = scaleValue;
|
|
9044
9763
|
}
|
|
9045
|
-
const isPresetPosition = position &&
|
|
9764
|
+
const isPresetPosition = position && _chunkYYO3RIFOjs.BACKGROUND_POSITION_PRESET_VALUES.includes(position);
|
|
9046
9765
|
if (position && !isPresetPosition) {
|
|
9047
9766
|
imageStyle.objectPosition = position;
|
|
9048
9767
|
}
|
|
@@ -9066,11 +9785,11 @@ function buildImageClassName(objectFit, position, scaleValue) {
|
|
|
9066
9785
|
return `${baseClass} inset-0 h-full w-full ${fitClass}`;
|
|
9067
9786
|
}
|
|
9068
9787
|
if ((objectFit === "custom" || objectFit === "original") && scaleValue) {
|
|
9069
|
-
const isPresetPosition = position &&
|
|
9788
|
+
const isPresetPosition = position && _chunkYYO3RIFOjs.BACKGROUND_POSITION_PRESET_VALUES.includes(position);
|
|
9070
9789
|
if (position && !isPresetPosition) {
|
|
9071
9790
|
return baseClass;
|
|
9072
9791
|
}
|
|
9073
|
-
const anchorClasses =
|
|
9792
|
+
const anchorClasses = _chunkYYO3RIFOjs.getAnchorClasses.call(void 0, position);
|
|
9074
9793
|
return `${baseClass} ${anchorClasses}`;
|
|
9075
9794
|
}
|
|
9076
9795
|
return `${baseClass} inset-0 h-full w-full`;
|
|
@@ -9514,8 +10233,7 @@ function getDefaultInputSettings() {
|
|
|
9514
10233
|
|
|
9515
10234
|
|
|
9516
10235
|
|
|
9517
|
-
|
|
9518
|
-
exports.buildRichTextSchema = buildRichTextSchema; exports.resolveImageUrl = resolveImageUrl; exports.getDefaultComponentRegistry = getDefaultComponentRegistry; exports.makeDefaultBlockComponent = makeDefaultBlockComponent; exports.renderBlock = renderBlock; exports.buildThemeRuntime = buildThemeRuntime; exports.PageRenderer = PageRenderer; exports.generateButtonCoreCss = generateButtonCoreCss; exports.getDefaultButtonVariants = getDefaultButtonVariants; exports.generateCardCoreCss = generateCardCoreCss; exports.getDefaultCardVariants = getDefaultCardVariants; exports.generateInputCoreCss = generateInputCoreCss; exports.getDefaultInputSettings = getDefaultInputSettings; exports.RichText = RichText2; exports.resolveBackground = resolveBackground; exports.SectionBackground = SectionBackground;
|
|
10236
|
+
exports.resolveImageUrl = resolveImageUrl; exports.getDefaultComponentRegistry = getDefaultComponentRegistry; exports.makeDefaultBlockComponent = makeDefaultBlockComponent; exports.renderBlock = renderBlock; exports.buildThemeRuntime = buildThemeRuntime; exports.PageRenderer = PageRenderer; exports.generateButtonCoreCss = generateButtonCoreCss; exports.getDefaultButtonVariants = getDefaultButtonVariants; exports.generateCardCoreCss = generateCardCoreCss; exports.getDefaultCardVariants = getDefaultCardVariants; exports.generateInputCoreCss = generateInputCoreCss; exports.getDefaultInputSettings = getDefaultInputSettings; exports.RichText = RichText2; exports.resolveBackground = resolveBackground; exports.SectionBackground = SectionBackground;
|
|
9519
10237
|
/*! Bundled license information:
|
|
9520
10238
|
|
|
9521
10239
|
chroma-js/src/utils/contrastAPCA.js:
|
|
@@ -9533,4 +10251,4 @@ chroma-js/src/utils/contrastAPCA.js:
|
|
|
9533
10251
|
* https://readtech.org/ARC/
|
|
9534
10252
|
*)
|
|
9535
10253
|
*/
|
|
9536
|
-
//# sourceMappingURL=chunk-
|
|
10254
|
+
//# sourceMappingURL=chunk-7UPVCT3K.js.map
|