@riverbankcms/sdk 0.4.3 → 0.5.1
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 +3463 -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 +1379 -519
- package/dist/client/client.js.map +1 -1
- package/dist/client/client.mjs +1379 -519
- 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 +20 -14
- package/dist/client/rendering/client.js.map +1 -1
- package/dist/client/rendering/client.mjs +20 -14
- package/dist/client/rendering/client.mjs.map +1 -1
- package/dist/client/usePage-BTPnCuWC.d.mts +6511 -0
- package/dist/client/usePage-BXjk8BhD.d.mts +6704 -0
- package/dist/client/usePage-BafOS9UT.d.mts +6512 -0
- package/dist/client/usePage-BiOReg0_.d.ts +6704 -0
- package/dist/client/usePage-Bnx-kA6x.d.mts +6670 -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-CXI_VkhN.d.ts → Layout-BClXUTsd.d.mts} +4 -4
- package/dist/server/{Layout-p6f3TLw9.d.mts → Layout-UXGjXv8M.d.ts} +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-5STV4MWD.js +189 -0
- package/dist/server/chunk-5STV4MWD.js.map +1 -0
- package/dist/server/{chunk-VHDDXCK6.js → chunk-7UPVCT3K.js} +1206 -496
- 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-ES6QDZUX.mjs → chunk-C6FIJC7T.mjs} +2 -2
- package/dist/server/{chunk-N3PX76AP.mjs → chunk-CMABGYGI.mjs} +269 -135
- package/dist/server/chunk-CMABGYGI.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-R5B6IOFQ.js → chunk-KA74YRK6.js} +269 -135
- package/dist/server/chunk-KA74YRK6.js.map +1 -0
- 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-U2NI3TS3.mjs → chunk-LNOUXALA.mjs} +1135 -425
- package/dist/server/chunk-LNOUXALA.mjs.map +1 -0
- package/dist/server/{chunk-24F6FTCI.mjs → chunk-OSF34JTQ.mjs} +4 -4
- package/dist/server/{chunk-G35R7N7B.js → chunk-P3NNN73G.js} +3 -3
- package/dist/server/{chunk-G35R7N7B.js.map → chunk-P3NNN73G.js.map} +1 -1
- 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-2SSEBAHC.js → chunk-TT5JWA4X.js} +9 -9
- package/dist/server/{chunk-2SSEBAHC.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-Dhiemsjd.d.ts → components-BmaJxgCV.d.mts} +20 -75
- package/dist/server/{components-C75e4poV.d.mts → components-DppHY5oD.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-CAwBj3-A.d.ts → index-Bucs6UqG.d.mts} +2 -1
- package/dist/server/{index-C6o9LPvq.d.mts → index-Cp7tJuRt.d.ts} +2 -1
- package/dist/server/index.d.mts +84 -6
- package/dist/server/index.d.ts +84 -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-CdXfuCuE.d.mts → loadContent-BS-3wesN.d.mts} +4 -4
- package/dist/server/{loadContent-CsvQRoxb.d.ts → loadContent-Buvmudee.d.ts} +4 -4
- package/dist/server/{loadPage-p3AWwwrd.d.mts → loadPage-B8mQUUSo.d.mts} +5 -46
- package/dist/server/loadPage-DNQTTRHL.mjs +11 -0
- package/dist/server/{loadPage-BA0HiT-6.d.ts → loadPage-DP3nrHBi.d.ts} +5 -46
- package/dist/server/loadPage-IDGVDFBB.js +11 -0
- package/dist/server/{loadPage-DLC7DJZP.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.mts → schema-Z6-afHJG.d.mts} +1 -1
- package/dist/server/{schema-Bpy9N5ZI.d.ts → 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-Dj8B3QRb.d.ts → types-1cLz0vnq.d.mts} +55 -2
- package/dist/server/{types-txWsSxN7.d.mts → types-BjgZt8xJ.d.mts} +63 -2
- package/dist/server/{types-CdhKJrB0.d.mts → types-BvcJU7zk.d.ts} +55 -2
- package/dist/server/{types-BWQ-TohG.d.ts → types-CVykEqXN.d.ts} +289 -83
- package/dist/server/{types-CL916r6x.d.ts → types-DLBhEPSt.d.ts} +63 -2
- package/dist/server/{types-BLf-hE50.d.mts → types-Dsu9wsUh.d.mts} +289 -83
- 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 -1
- package/dist/server/chunk-6JBKKV3G.js.map +0 -1
- package/dist/server/chunk-7DS4Q3GA.mjs.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-LCYGQDAB.mjs +0 -835
- package/dist/server/chunk-LCYGQDAB.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-TNYU5EIO.js +0 -835
- package/dist/server/chunk-TNYU5EIO.js.map +0 -1
- package/dist/server/chunk-U2NI3TS3.mjs.map +0 -1
- package/dist/server/chunk-USQF2XTU.mjs.map +0 -1
- package/dist/server/chunk-VHDDXCK6.js.map +0 -1
- package/dist/server/loadPage-DLC7DJZP.js +0 -11
- package/dist/server/loadPage-GEGN4UAL.mjs +0 -11
- /package/dist/server/{chunk-ES6QDZUX.mjs.map → chunk-C6FIJC7T.mjs.map} +0 -0
- /package/dist/server/{chunk-24F6FTCI.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-GEGN4UAL.mjs.map → loadPage-DNQTTRHL.mjs.map} +0 -0
|
@@ -39,7 +39,7 @@ import {
|
|
|
39
39
|
testimonialsHeadingFragment,
|
|
40
40
|
textColorStyle,
|
|
41
41
|
uiTransforms
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-BYBJA6SP.mjs";
|
|
43
43
|
|
|
44
44
|
// ../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
|
|
45
45
|
function r(e) {
|
|
@@ -655,8 +655,8 @@ function getLabWhitePoint() {
|
|
|
655
655
|
var lab2rgb = (...args) => {
|
|
656
656
|
args = unpack_default(args, "lab");
|
|
657
657
|
const [L, a, b] = args;
|
|
658
|
-
const [x, y,
|
|
659
|
-
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);
|
|
660
660
|
return [r2, g, b_, args.length > 3 ? args[3] : 1];
|
|
661
661
|
};
|
|
662
662
|
var lab2xyz = (L, a, b) => {
|
|
@@ -671,15 +671,15 @@ var lab2xyz = (L, a, b) => {
|
|
|
671
671
|
const zr = fz3 > kE ? fz3 : (116 * fz - 16) / kK;
|
|
672
672
|
const x = xr * Xn;
|
|
673
673
|
const y = yr * Yn;
|
|
674
|
-
const
|
|
675
|
-
return [x, y,
|
|
674
|
+
const z7 = zr * Zn;
|
|
675
|
+
return [x, y, z7];
|
|
676
676
|
};
|
|
677
677
|
var compand = (linear) => {
|
|
678
678
|
const sign = Math.sign(linear);
|
|
679
679
|
linear = Math.abs(linear);
|
|
680
680
|
return (linear <= 31308e-7 ? linear * 12.92 : 1.055 * Math.pow(linear, 1 / 2.4) - 0.055) * sign;
|
|
681
681
|
};
|
|
682
|
-
var xyz2rgb = (x, y,
|
|
682
|
+
var xyz2rgb = (x, y, z7) => {
|
|
683
683
|
const { MtxAdaptMa, MtxAdaptMaI, MtxXYZ2RGB, RefWhiteRGB, Xn, Yn, Zn } = lab_constants_default;
|
|
684
684
|
const As = Xn * MtxAdaptMa.m00 + Yn * MtxAdaptMa.m10 + Zn * MtxAdaptMa.m20;
|
|
685
685
|
const Bs = Xn * MtxAdaptMa.m01 + Yn * MtxAdaptMa.m11 + Zn * MtxAdaptMa.m21;
|
|
@@ -687,9 +687,9 @@ var xyz2rgb = (x, y, z5) => {
|
|
|
687
687
|
const Ad = RefWhiteRGB.X * MtxAdaptMa.m00 + RefWhiteRGB.Y * MtxAdaptMa.m10 + RefWhiteRGB.Z * MtxAdaptMa.m20;
|
|
688
688
|
const Bd = RefWhiteRGB.X * MtxAdaptMa.m01 + RefWhiteRGB.Y * MtxAdaptMa.m11 + RefWhiteRGB.Z * MtxAdaptMa.m21;
|
|
689
689
|
const Cd = RefWhiteRGB.X * MtxAdaptMa.m02 + RefWhiteRGB.Y * MtxAdaptMa.m12 + RefWhiteRGB.Z * MtxAdaptMa.m22;
|
|
690
|
-
const X1 = (x * MtxAdaptMa.m00 + y * MtxAdaptMa.m10 +
|
|
691
|
-
const Y1 = (x * MtxAdaptMa.m01 + y * MtxAdaptMa.m11 +
|
|
692
|
-
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);
|
|
693
693
|
const X2 = X1 * MtxAdaptMaI.m00 + Y1 * MtxAdaptMaI.m10 + Z1 * MtxAdaptMaI.m20;
|
|
694
694
|
const Y2 = X1 * MtxAdaptMaI.m01 + Y1 * MtxAdaptMaI.m11 + Z1 * MtxAdaptMaI.m21;
|
|
695
695
|
const Z2 = X1 * MtxAdaptMaI.m02 + Y1 * MtxAdaptMaI.m12 + Z1 * MtxAdaptMaI.m22;
|
|
@@ -709,15 +709,15 @@ var lab2rgb_default = lab2rgb;
|
|
|
709
709
|
// ../../node_modules/.pnpm/chroma-js@3.1.2/node_modules/chroma-js/src/io/lab/rgb2lab.js
|
|
710
710
|
var rgb2lab = (...args) => {
|
|
711
711
|
const [r2, g, b, ...rest] = unpack_default(args, "rgb");
|
|
712
|
-
const [x, y,
|
|
713
|
-
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);
|
|
714
714
|
return [L, a, b_, ...rest.length > 0 && rest[0] < 1 ? [rest[0]] : []];
|
|
715
715
|
};
|
|
716
|
-
function xyz2lab(x, y,
|
|
716
|
+
function xyz2lab(x, y, z7) {
|
|
717
717
|
const { Xn, Yn, Zn, kE, kK } = lab_constants_default;
|
|
718
718
|
const xr = x / Xn;
|
|
719
719
|
const yr = y / Yn;
|
|
720
|
-
const zr =
|
|
720
|
+
const zr = z7 / Zn;
|
|
721
721
|
const fx = xr > kE ? Math.pow(xr, 1 / 3) : (kK * xr + 16) / 116;
|
|
722
722
|
const fy = yr > kE ? Math.pow(yr, 1 / 3) : (kK * yr + 16) / 116;
|
|
723
723
|
const fz = zr > kE ? Math.pow(zr, 1 / 3) : (kK * zr + 16) / 116;
|
|
@@ -736,20 +736,20 @@ var rgb2xyz = (r2, g, b) => {
|
|
|
736
736
|
const { MtxRGB2XYZ, MtxAdaptMa, MtxAdaptMaI, Xn, Yn, Zn, As, Bs, Cs } = lab_constants_default;
|
|
737
737
|
let x = r2 * MtxRGB2XYZ.m00 + g * MtxRGB2XYZ.m10 + b * MtxRGB2XYZ.m20;
|
|
738
738
|
let y = r2 * MtxRGB2XYZ.m01 + g * MtxRGB2XYZ.m11 + b * MtxRGB2XYZ.m21;
|
|
739
|
-
let
|
|
739
|
+
let z7 = r2 * MtxRGB2XYZ.m02 + g * MtxRGB2XYZ.m12 + b * MtxRGB2XYZ.m22;
|
|
740
740
|
const Ad = Xn * MtxAdaptMa.m00 + Yn * MtxAdaptMa.m10 + Zn * MtxAdaptMa.m20;
|
|
741
741
|
const Bd = Xn * MtxAdaptMa.m01 + Yn * MtxAdaptMa.m11 + Zn * MtxAdaptMa.m21;
|
|
742
742
|
const Cd = Xn * MtxAdaptMa.m02 + Yn * MtxAdaptMa.m12 + Zn * MtxAdaptMa.m22;
|
|
743
|
-
let X = x * MtxAdaptMa.m00 + y * MtxAdaptMa.m10 +
|
|
744
|
-
let Y = x * MtxAdaptMa.m01 + y * MtxAdaptMa.m11 +
|
|
745
|
-
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;
|
|
746
746
|
X *= Ad / As;
|
|
747
747
|
Y *= Bd / Bs;
|
|
748
748
|
Z *= Cd / Cs;
|
|
749
749
|
x = X * MtxAdaptMaI.m00 + Y * MtxAdaptMaI.m10 + Z * MtxAdaptMaI.m20;
|
|
750
750
|
y = X * MtxAdaptMaI.m01 + Y * MtxAdaptMaI.m11 + Z * MtxAdaptMaI.m21;
|
|
751
|
-
|
|
752
|
-
return [x, y,
|
|
751
|
+
z7 = X * MtxAdaptMaI.m02 + Y * MtxAdaptMaI.m12 + Z * MtxAdaptMaI.m22;
|
|
752
|
+
return [x, y, z7];
|
|
753
753
|
};
|
|
754
754
|
var rgb2lab_default = rgb2lab;
|
|
755
755
|
|
|
@@ -3078,7 +3078,7 @@ function generateShades(hexColor, name) {
|
|
|
3078
3078
|
900: 0.1,
|
|
3079
3079
|
950: 0.05
|
|
3080
3080
|
};
|
|
3081
|
-
const lightness = lightnessMap[shadeNumber];
|
|
3081
|
+
const lightness = lightnessMap[shadeNumber] ?? 0.5;
|
|
3082
3082
|
const shadeColor = base.luminance(lightness).hex();
|
|
3083
3083
|
return {
|
|
3084
3084
|
name: shadeName,
|
|
@@ -3149,7 +3149,7 @@ function expandPalette(palette) {
|
|
|
3149
3149
|
if (base.text) expanded.body = base.text;
|
|
3150
3150
|
const isDark = base.background ? isBackgroundDark(base.background) : false;
|
|
3151
3151
|
const isDarkMode = palette.meta?.mode === "dark" || isDark;
|
|
3152
|
-
expanded.mutedText = isDarkMode ? expanded["neutral-600"] : expanded["neutral-500"];
|
|
3152
|
+
expanded.mutedText = isDarkMode ? expanded["neutral-600"] ?? "#666" : expanded["neutral-500"] ?? "#888";
|
|
3153
3153
|
return expanded;
|
|
3154
3154
|
}
|
|
3155
3155
|
|
|
@@ -3217,6 +3217,83 @@ function generateShadowCssVars(theme) {
|
|
|
3217
3217
|
};
|
|
3218
3218
|
}
|
|
3219
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(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 = 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
|
+
|
|
3220
3297
|
// ../blocks/src/theme/buttons/effects/presets/background.ts
|
|
3221
3298
|
var darkenBackgroundEffect = {
|
|
3222
3299
|
id: "darken-background",
|
|
@@ -3224,6 +3301,7 @@ var darkenBackgroundEffect = {
|
|
|
3224
3301
|
description: "Darkens the background color on hover",
|
|
3225
3302
|
category: "background",
|
|
3226
3303
|
pseudoElement: "none",
|
|
3304
|
+
applicableTo: ["button"],
|
|
3227
3305
|
customizableOption: {
|
|
3228
3306
|
name: "amount",
|
|
3229
3307
|
type: "number",
|
|
@@ -3255,6 +3333,7 @@ var lightenBackgroundEffect = {
|
|
|
3255
3333
|
description: "Lightens the background color on hover",
|
|
3256
3334
|
category: "background",
|
|
3257
3335
|
pseudoElement: "none",
|
|
3336
|
+
applicableTo: ["button"],
|
|
3258
3337
|
customizableOption: {
|
|
3259
3338
|
name: "amount",
|
|
3260
3339
|
type: "number",
|
|
@@ -3286,6 +3365,7 @@ var fadeBackgroundEffect = {
|
|
|
3286
3365
|
description: "Reduces background opacity on hover",
|
|
3287
3366
|
category: "background",
|
|
3288
3367
|
pseudoElement: "none",
|
|
3368
|
+
applicableTo: ["button", "nav-link"],
|
|
3289
3369
|
customizableOption: {
|
|
3290
3370
|
name: "opacity",
|
|
3291
3371
|
type: "percentage",
|
|
@@ -3308,6 +3388,7 @@ var opacityReduceEffect = {
|
|
|
3308
3388
|
description: "Reduces button opacity on hover by a percentage",
|
|
3309
3389
|
category: "background",
|
|
3310
3390
|
pseudoElement: "none",
|
|
3391
|
+
applicableTo: ["button", "nav-link"],
|
|
3311
3392
|
customizableOption: {
|
|
3312
3393
|
name: "reduction",
|
|
3313
3394
|
type: "percentage",
|
|
@@ -3331,6 +3412,7 @@ var animatedGradientEffect = {
|
|
|
3331
3412
|
description: "Animates gradient position on hover",
|
|
3332
3413
|
category: "background",
|
|
3333
3414
|
pseudoElement: "none",
|
|
3415
|
+
applicableTo: ["button"],
|
|
3334
3416
|
customizableOption: {
|
|
3335
3417
|
name: "direction",
|
|
3336
3418
|
type: "select",
|
|
@@ -3370,6 +3452,7 @@ var backgroundOnHoverEffect = {
|
|
|
3370
3452
|
description: "Adds background color on hover",
|
|
3371
3453
|
category: "background",
|
|
3372
3454
|
pseudoElement: "none",
|
|
3455
|
+
applicableTo: ["button", "nav-link"],
|
|
3373
3456
|
customizableOption: {
|
|
3374
3457
|
name: "colorToken",
|
|
3375
3458
|
type: "select",
|
|
@@ -3395,6 +3478,7 @@ var backgroundOnHoverAlphaEffect = {
|
|
|
3395
3478
|
description: "Adds semi-transparent background on hover",
|
|
3396
3479
|
category: "background",
|
|
3397
3480
|
pseudoElement: "none",
|
|
3481
|
+
applicableTo: ["button", "nav-link"],
|
|
3398
3482
|
customizableOption: {
|
|
3399
3483
|
name: "opacity",
|
|
3400
3484
|
type: "percentage",
|
|
@@ -3416,6 +3500,33 @@ var backgroundOnHoverAlphaEffect = {
|
|
|
3416
3500
|
}
|
|
3417
3501
|
};
|
|
3418
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
|
+
|
|
3419
3530
|
// ../blocks/src/theme/buttons/effects/presets/shadow.ts
|
|
3420
3531
|
var borderGlowEffect = {
|
|
3421
3532
|
id: "border-glow",
|
|
@@ -3423,6 +3534,7 @@ var borderGlowEffect = {
|
|
|
3423
3534
|
description: "Adds a glowing shadow on hover",
|
|
3424
3535
|
category: "shadow",
|
|
3425
3536
|
pseudoElement: "none",
|
|
3537
|
+
applicableTo: ["button", "nav-link"],
|
|
3426
3538
|
customizableOption: {
|
|
3427
3539
|
name: "glowColorToken",
|
|
3428
3540
|
type: "colorToken",
|
|
@@ -3433,11 +3545,7 @@ var borderGlowEffect = {
|
|
|
3433
3545
|
const { themeId, variantId, options, tokens } = ctx;
|
|
3434
3546
|
const glowToken = options.glowColorToken || "primary-400";
|
|
3435
3547
|
const glowColor = tokens.getColor(glowToken);
|
|
3436
|
-
return `
|
|
3437
|
-
:where([data-theme-scope="${themeId}"]) .${variantId}:hover {
|
|
3438
|
-
box-shadow: 0 0 15px ${glowColor};
|
|
3439
|
-
}
|
|
3440
|
-
`;
|
|
3548
|
+
return generateStateCSS(themeId, variantId, "hover", `box-shadow: 0 0 15px ${glowColor};`);
|
|
3441
3549
|
}
|
|
3442
3550
|
};
|
|
3443
3551
|
var dropShadowEffect = {
|
|
@@ -3446,6 +3554,7 @@ var dropShadowEffect = {
|
|
|
3446
3554
|
description: "Adds an elevated shadow on hover",
|
|
3447
3555
|
category: "shadow",
|
|
3448
3556
|
pseudoElement: "none",
|
|
3557
|
+
applicableTo: ["button"],
|
|
3449
3558
|
customizableOption: {
|
|
3450
3559
|
name: "intensity",
|
|
3451
3560
|
type: "select",
|
|
@@ -3461,11 +3570,7 @@ var dropShadowEffect = {
|
|
|
3461
3570
|
medium: "0 10px 15px rgba(0, 0, 0, 0.15)",
|
|
3462
3571
|
strong: "0 20px 25px rgba(0, 0, 0, 0.2)"
|
|
3463
3572
|
};
|
|
3464
|
-
return `
|
|
3465
|
-
:where([data-theme-scope="${themeId}"]) .${variantId}:hover {
|
|
3466
|
-
box-shadow: ${shadows[intensity]};
|
|
3467
|
-
}
|
|
3468
|
-
`;
|
|
3573
|
+
return generateStateCSS(themeId, variantId, "hover", `box-shadow: ${shadows[intensity]};`);
|
|
3469
3574
|
}
|
|
3470
3575
|
};
|
|
3471
3576
|
var innerShadowEffect = {
|
|
@@ -3474,6 +3579,7 @@ var innerShadowEffect = {
|
|
|
3474
3579
|
description: "Adds an inset shadow for a pressed appearance",
|
|
3475
3580
|
category: "shadow",
|
|
3476
3581
|
pseudoElement: "none",
|
|
3582
|
+
applicableTo: ["button"],
|
|
3477
3583
|
generateCSS: (ctx) => {
|
|
3478
3584
|
const { themeId, variantId } = ctx;
|
|
3479
3585
|
return `
|
|
@@ -3489,6 +3595,7 @@ var neumorphicShadowEffect = {
|
|
|
3489
3595
|
description: "Dual shadows for soft UI design (raised or pressed)",
|
|
3490
3596
|
category: "shadow",
|
|
3491
3597
|
pseudoElement: "none",
|
|
3598
|
+
applicableTo: ["button", "nav-link"],
|
|
3492
3599
|
customizableOption: {
|
|
3493
3600
|
name: "mode",
|
|
3494
3601
|
type: "select",
|
|
@@ -3531,6 +3638,7 @@ var outerGlowEffect = {
|
|
|
3531
3638
|
description: "Creates an outer glow around the button",
|
|
3532
3639
|
category: "shadow",
|
|
3533
3640
|
pseudoElement: "none",
|
|
3641
|
+
applicableTo: ["button", "nav-link"],
|
|
3534
3642
|
customizableOption: {
|
|
3535
3643
|
name: "spread",
|
|
3536
3644
|
type: "number",
|
|
@@ -3565,6 +3673,7 @@ var retro3DShadowEffect = {
|
|
|
3565
3673
|
description: "3D pressed shadow with vertical movement (retro style)",
|
|
3566
3674
|
category: "shadow",
|
|
3567
3675
|
pseudoElement: "none",
|
|
3676
|
+
applicableTo: ["button"],
|
|
3568
3677
|
generateCSS: (ctx) => {
|
|
3569
3678
|
const { themeId, variantId } = ctx;
|
|
3570
3679
|
return `
|
|
@@ -3597,6 +3706,7 @@ var scaleUpEffect = {
|
|
|
3597
3706
|
description: "Slightly enlarges the button on hover",
|
|
3598
3707
|
category: "transform",
|
|
3599
3708
|
pseudoElement: "none",
|
|
3709
|
+
applicableTo: ["button", "nav-link"],
|
|
3600
3710
|
customizableOption: {
|
|
3601
3711
|
name: "scale",
|
|
3602
3712
|
type: "select",
|
|
@@ -3607,11 +3717,7 @@ var scaleUpEffect = {
|
|
|
3607
3717
|
generateCSS: (ctx) => {
|
|
3608
3718
|
const { themeId, variantId, options } = ctx;
|
|
3609
3719
|
const scale = options.scale || "1.05";
|
|
3610
|
-
return `
|
|
3611
|
-
:where([data-theme-scope="${themeId}"]) .${variantId}:hover {
|
|
3612
|
-
transform: scale(${scale});
|
|
3613
|
-
}
|
|
3614
|
-
`;
|
|
3720
|
+
return generateStateCSS(themeId, variantId, "hover", `transform: scale(${scale});`);
|
|
3615
3721
|
}
|
|
3616
3722
|
};
|
|
3617
3723
|
var scaleDownEffect = {
|
|
@@ -3620,6 +3726,7 @@ var scaleDownEffect = {
|
|
|
3620
3726
|
description: "Slightly shrinks the button when clicked",
|
|
3621
3727
|
category: "transform",
|
|
3622
3728
|
pseudoElement: "none",
|
|
3729
|
+
applicableTo: ["button", "nav-link"],
|
|
3623
3730
|
customizableOption: {
|
|
3624
3731
|
name: "scale",
|
|
3625
3732
|
type: "select",
|
|
@@ -3643,6 +3750,7 @@ var liftEffect = {
|
|
|
3643
3750
|
description: "Lifts the button upward on hover",
|
|
3644
3751
|
category: "transform",
|
|
3645
3752
|
pseudoElement: "none",
|
|
3753
|
+
applicableTo: ["button", "nav-link"],
|
|
3646
3754
|
customizableOption: {
|
|
3647
3755
|
name: "amount",
|
|
3648
3756
|
type: "select",
|
|
@@ -3653,11 +3761,7 @@ var liftEffect = {
|
|
|
3653
3761
|
generateCSS: (ctx) => {
|
|
3654
3762
|
const { themeId, variantId, options } = ctx;
|
|
3655
3763
|
const amount = options.amount || "0.5";
|
|
3656
|
-
return `
|
|
3657
|
-
:where([data-theme-scope="${themeId}"]) .${variantId}:hover {
|
|
3658
|
-
transform: translateY(-${amount}rem);
|
|
3659
|
-
}
|
|
3660
|
-
`;
|
|
3764
|
+
return generateStateCSS(themeId, variantId, "hover", `transform: translateY(-${amount}rem);`);
|
|
3661
3765
|
}
|
|
3662
3766
|
};
|
|
3663
3767
|
var pressDownEffect = {
|
|
@@ -3666,6 +3770,7 @@ var pressDownEffect = {
|
|
|
3666
3770
|
description: "Translates button to shadow position and removes shadow on hover",
|
|
3667
3771
|
category: "transform",
|
|
3668
3772
|
pseudoElement: "none",
|
|
3773
|
+
applicableTo: ["button"],
|
|
3669
3774
|
generateCSS: (ctx) => {
|
|
3670
3775
|
const { themeId, variantId, theme } = ctx;
|
|
3671
3776
|
const shadowConfig = theme.shadow;
|
|
@@ -3678,12 +3783,12 @@ var pressDownEffect = {
|
|
|
3678
3783
|
const offset = elevationOffsets[shadowConfig.elevation];
|
|
3679
3784
|
const xOffset = (shadowConfig.position || "bottom") === "bottom-right" ? offset : 0;
|
|
3680
3785
|
const yOffset = offset;
|
|
3681
|
-
return
|
|
3682
|
-
|
|
3683
|
-
|
|
3684
|
-
|
|
3685
|
-
}
|
|
3686
|
-
|
|
3786
|
+
return generateStateCSS(
|
|
3787
|
+
themeId,
|
|
3788
|
+
variantId,
|
|
3789
|
+
"hover",
|
|
3790
|
+
`transform: translate(${xOffset}px, ${yOffset}px); box-shadow: none;`
|
|
3791
|
+
);
|
|
3687
3792
|
}
|
|
3688
3793
|
};
|
|
3689
3794
|
var popEffect = {
|
|
@@ -3692,6 +3797,7 @@ var popEffect = {
|
|
|
3692
3797
|
description: "Scales up and tilts the button on hover for a playful pop effect",
|
|
3693
3798
|
category: "transform",
|
|
3694
3799
|
pseudoElement: "none",
|
|
3800
|
+
applicableTo: ["button"],
|
|
3695
3801
|
customizableOption: {
|
|
3696
3802
|
name: "intensity",
|
|
3697
3803
|
type: "select",
|
|
@@ -3708,11 +3814,12 @@ var popEffect = {
|
|
|
3708
3814
|
dramatic: { scale: 1.08, rotate: 3 }
|
|
3709
3815
|
};
|
|
3710
3816
|
const config = intensityConfig[intensity] || intensityConfig.medium;
|
|
3711
|
-
return
|
|
3712
|
-
|
|
3713
|
-
|
|
3714
|
-
|
|
3715
|
-
|
|
3817
|
+
return generateStateCSS(
|
|
3818
|
+
themeId,
|
|
3819
|
+
variantId,
|
|
3820
|
+
"hover",
|
|
3821
|
+
`transform: scale(${config.scale}) rotate(${config.rotate}deg);`
|
|
3822
|
+
);
|
|
3716
3823
|
}
|
|
3717
3824
|
};
|
|
3718
3825
|
|
|
@@ -3723,6 +3830,7 @@ var auroraGlowEffect = {
|
|
|
3723
3830
|
description: "Blurred gradient glow that appears on hover",
|
|
3724
3831
|
category: "overlay",
|
|
3725
3832
|
pseudoElement: "before",
|
|
3833
|
+
applicableTo: ["button"],
|
|
3726
3834
|
customizableOption: {
|
|
3727
3835
|
name: "intensity",
|
|
3728
3836
|
type: "percentage",
|
|
@@ -3735,8 +3843,8 @@ var auroraGlowEffect = {
|
|
|
3735
3843
|
let toColor;
|
|
3736
3844
|
if (buttonConfig.background.type === "gradient") {
|
|
3737
3845
|
const stops = buttonConfig.background.stops;
|
|
3738
|
-
fromColor = tokens.getColor(stops[0]);
|
|
3739
|
-
toColor = tokens.getColor(stops[stops.length - 1]);
|
|
3846
|
+
fromColor = tokens.getColor(stops[0] ?? "primary-500");
|
|
3847
|
+
toColor = tokens.getColor(stops[stops.length - 1] ?? "primary-300");
|
|
3740
3848
|
} else if (buttonConfig.background.type === "solid") {
|
|
3741
3849
|
fromColor = tokens.getColor(buttonConfig.background.colorToken);
|
|
3742
3850
|
const lighterToken = tokens.adjustShade(buttonConfig.background.colorToken, -200);
|
|
@@ -3779,6 +3887,7 @@ var cosmicStardustEffect = {
|
|
|
3779
3887
|
description: "Rotating rainbow gradient glow (always visible, intensifies on hover)",
|
|
3780
3888
|
category: "overlay",
|
|
3781
3889
|
pseudoElement: "before",
|
|
3890
|
+
applicableTo: ["button"],
|
|
3782
3891
|
customizableOption: {
|
|
3783
3892
|
name: "speed",
|
|
3784
3893
|
type: "select",
|
|
@@ -3841,6 +3950,7 @@ var gradientBorderFillEffect = {
|
|
|
3841
3950
|
description: "Gradient border that fills on hover using ::before pseudo-element",
|
|
3842
3951
|
category: "overlay",
|
|
3843
3952
|
pseudoElement: "before",
|
|
3953
|
+
applicableTo: ["button"],
|
|
3844
3954
|
customizableOption: {
|
|
3845
3955
|
name: "borderWidth",
|
|
3846
3956
|
type: "number",
|
|
@@ -3897,6 +4007,7 @@ var animatedGradientBorderFillEffect = {
|
|
|
3897
4007
|
description: "Rotating gradient border that fills on hover",
|
|
3898
4008
|
category: "overlay",
|
|
3899
4009
|
pseudoElement: "before",
|
|
4010
|
+
applicableTo: ["button"],
|
|
3900
4011
|
customizableOption: {
|
|
3901
4012
|
name: "speed",
|
|
3902
4013
|
type: "select",
|
|
@@ -3972,6 +4083,7 @@ var borderBottomGrowEffect = {
|
|
|
3972
4083
|
description: "Animated underline that grows on hover",
|
|
3973
4084
|
category: "overlay",
|
|
3974
4085
|
pseudoElement: "after",
|
|
4086
|
+
applicableTo: ["button", "nav-link"],
|
|
3975
4087
|
customizableOption: {
|
|
3976
4088
|
name: "height",
|
|
3977
4089
|
type: "number",
|
|
@@ -4019,6 +4131,7 @@ var gradientTextEffect = {
|
|
|
4019
4131
|
description: "Gradient text using background-clip",
|
|
4020
4132
|
category: "text",
|
|
4021
4133
|
pseudoElement: "none",
|
|
4134
|
+
applicableTo: ["button"],
|
|
4022
4135
|
customizableOption: {
|
|
4023
4136
|
name: "solidOnHover",
|
|
4024
4137
|
type: "select",
|
|
@@ -4070,6 +4183,7 @@ var textColorChangeEffect = {
|
|
|
4070
4183
|
description: "Changes text color on hover",
|
|
4071
4184
|
category: "text",
|
|
4072
4185
|
pseudoElement: "none",
|
|
4186
|
+
applicableTo: ["button", "nav-link"],
|
|
4073
4187
|
customizableOption: {
|
|
4074
4188
|
name: "hoverColorToken",
|
|
4075
4189
|
type: "select",
|
|
@@ -4097,6 +4211,7 @@ var borderColorChangeEffect = {
|
|
|
4097
4211
|
description: "Changes border color on hover",
|
|
4098
4212
|
category: "border",
|
|
4099
4213
|
pseudoElement: "none",
|
|
4214
|
+
applicableTo: ["button", "nav-link"],
|
|
4100
4215
|
customizableOption: {
|
|
4101
4216
|
name: "hoverColorToken",
|
|
4102
4217
|
type: "select",
|
|
@@ -4122,6 +4237,7 @@ var sketchyBorderEffect = {
|
|
|
4122
4237
|
description: "Hand-drawn style with imperfect edges",
|
|
4123
4238
|
category: "border",
|
|
4124
4239
|
pseudoElement: "none",
|
|
4240
|
+
applicableTo: ["button"],
|
|
4125
4241
|
customizableOption: {
|
|
4126
4242
|
name: "intensity",
|
|
4127
4243
|
type: "select",
|
|
@@ -4169,6 +4285,7 @@ var pulseAnimationEffect = {
|
|
|
4169
4285
|
description: "Continuous pulse animation (opacity fade)",
|
|
4170
4286
|
category: "animation",
|
|
4171
4287
|
pseudoElement: "none",
|
|
4288
|
+
applicableTo: ["button", "nav-link"],
|
|
4172
4289
|
customizableOption: {
|
|
4173
4290
|
name: "speed",
|
|
4174
4291
|
type: "select",
|
|
@@ -4197,6 +4314,138 @@ var pulseAnimationEffect = {
|
|
|
4197
4314
|
}
|
|
4198
4315
|
};
|
|
4199
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
|
+
|
|
4200
4449
|
// ../blocks/src/theme/buttons/effects/registry.ts
|
|
4201
4450
|
var EFFECT_PRESETS = [
|
|
4202
4451
|
// Background effects
|
|
@@ -4233,88 +4482,65 @@ var EFFECT_PRESETS = [
|
|
|
4233
4482
|
borderColorChangeEffect,
|
|
4234
4483
|
sketchyBorderEffect,
|
|
4235
4484
|
// Animation effects
|
|
4236
|
-
pulseAnimationEffect
|
|
4485
|
+
pulseAnimationEffect,
|
|
4486
|
+
// Nav-link specific effects
|
|
4487
|
+
navUnderlineEffect,
|
|
4488
|
+
navFrostedBaseEffect,
|
|
4489
|
+
navFrostedHoverEffect,
|
|
4490
|
+
navFrostedActiveEffect
|
|
4237
4491
|
];
|
|
4238
4492
|
function getEffectPreset(id) {
|
|
4239
4493
|
return EFFECT_PRESETS.find((preset) => preset.id === id);
|
|
4240
4494
|
}
|
|
4241
4495
|
|
|
4242
|
-
// ../blocks/src/theme/
|
|
4243
|
-
|
|
4244
|
-
|
|
4245
|
-
|
|
4246
|
-
|
|
4247
|
-
|
|
4248
|
-
|
|
4249
|
-
|
|
4250
|
-
|
|
4251
|
-
|
|
4252
|
-
|
|
4253
|
-
|
|
4254
|
-
|
|
4255
|
-
|
|
4256
|
-
|
|
4257
|
-
|
|
4258
|
-
|
|
4259
|
-
|
|
4260
|
-
|
|
4261
|
-
|
|
4262
|
-
|
|
4263
|
-
|
|
4264
|
-
);
|
|
4265
|
-
}
|
|
4266
|
-
return `rgb(var(--tb-${token}))`;
|
|
4267
|
-
}
|
|
4268
|
-
/**
|
|
4269
|
-
* Adjust a color token's shade by a given amount
|
|
4270
|
-
*
|
|
4271
|
-
* @param token - Base token (e.g., 'primary-500')
|
|
4272
|
-
* @param amount - Shade adjustment (+100 = darker, -100 = lighter)
|
|
4273
|
-
* @returns Adjusted token name (e.g., 'primary-600')
|
|
4274
|
-
*
|
|
4275
|
-
* @example
|
|
4276
|
-
* resolver.adjustShade('primary-500', 100) // => 'primary-600' (darker)
|
|
4277
|
-
* resolver.adjustShade('primary-500', -100) // => 'primary-400' (lighter)
|
|
4278
|
-
*/
|
|
4279
|
-
adjustShade(token, amount) {
|
|
4280
|
-
const parts = token.split("-");
|
|
4281
|
-
if (parts.length < 2) {
|
|
4282
|
-
const newShade2 = Math.max(100, Math.min(900, 500 + amount));
|
|
4283
|
-
return `${token}-${newShade2}`;
|
|
4284
|
-
}
|
|
4285
|
-
const base = parts.slice(0, -1).join("-");
|
|
4286
|
-
const shade = parseInt(parts[parts.length - 1], 10);
|
|
4287
|
-
if (isNaN(shade)) {
|
|
4288
|
-
console.warn(
|
|
4289
|
-
`[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
|
|
4290
4518
|
);
|
|
4291
|
-
|
|
4292
|
-
|
|
4293
|
-
const newShade = Math.max(100, Math.min(900, shade + amount));
|
|
4294
|
-
return `${base}-${newShade}`;
|
|
4295
|
-
}
|
|
4296
|
-
/**
|
|
4297
|
-
* Check if a token exists in the theme palette
|
|
4298
|
-
*
|
|
4299
|
-
* @param token - Token name to check
|
|
4300
|
-
* @returns True if token exists in theme
|
|
4301
|
-
*/
|
|
4302
|
-
tokenExists(token) {
|
|
4303
|
-
const commonTokens = ["white", "black", "transparent"];
|
|
4304
|
-
if (commonTokens.includes(token)) {
|
|
4305
|
-
return true;
|
|
4306
|
-
}
|
|
4307
|
-
const parts = token.split("-");
|
|
4308
|
-
if (parts.length >= 2) {
|
|
4309
|
-
const lastPart = parts[parts.length - 1];
|
|
4310
|
-
const shade = parseInt(lastPart, 10);
|
|
4311
|
-
if (!isNaN(shade) && shade >= 100 && shade <= 900 && shade % 100 === 0) {
|
|
4312
|
-
return true;
|
|
4519
|
+
if (css2) {
|
|
4520
|
+
cssChunks.push(css2);
|
|
4313
4521
|
}
|
|
4314
4522
|
}
|
|
4315
|
-
return true;
|
|
4316
4523
|
}
|
|
4317
|
-
|
|
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
|
+
}
|
|
4318
4544
|
|
|
4319
4545
|
// ../blocks/src/theme/buttons/constants.ts
|
|
4320
4546
|
var GRADIENT_DIRECTION_MAP = {
|
|
@@ -4373,6 +4599,11 @@ var FONT_SIZE_MAP = {
|
|
|
4373
4599
|
"text-xl": "1.25rem",
|
|
4374
4600
|
"text-2xl": "1.5rem"
|
|
4375
4601
|
};
|
|
4602
|
+
var BUTTON_PADDING_PRESETS = {
|
|
4603
|
+
compact: "0.375rem 0.75rem",
|
|
4604
|
+
default: "0.5rem 1rem",
|
|
4605
|
+
spacious: "0.75rem 1.5rem"
|
|
4606
|
+
};
|
|
4376
4607
|
|
|
4377
4608
|
// ../blocks/src/theme/buttons/utils/contrast.ts
|
|
4378
4609
|
function getContrastingTextColorToken(backgroundToken, theme) {
|
|
@@ -4382,7 +4613,7 @@ function getContrastingTextColorToken(backgroundToken, theme) {
|
|
|
4382
4613
|
}
|
|
4383
4614
|
if (backgroundToken.startsWith("neutral-")) {
|
|
4384
4615
|
const match = backgroundToken.match(/neutral-(\d+)/);
|
|
4385
|
-
if (match) {
|
|
4616
|
+
if (match?.[1]) {
|
|
4386
4617
|
const shade = parseInt(match[1], 10);
|
|
4387
4618
|
return shade >= 500 ? "neutral-50" : "neutral-950";
|
|
4388
4619
|
}
|
|
@@ -4391,16 +4622,6 @@ function getContrastingTextColorToken(backgroundToken, theme) {
|
|
|
4391
4622
|
}
|
|
4392
4623
|
|
|
4393
4624
|
// ../blocks/src/theme/buttons/generateDefaultButtonSystem.ts
|
|
4394
|
-
var CORNERS_TO_RADIUS_MAP = {
|
|
4395
|
-
square: "rounded-none",
|
|
4396
|
-
// 0px - sharp corners
|
|
4397
|
-
soft: "rounded-md",
|
|
4398
|
-
// 6px - subtle rounding
|
|
4399
|
-
rounded: "rounded-md",
|
|
4400
|
-
// 6px - standard rounded (same as soft for buttons)
|
|
4401
|
-
pill: "rounded-full"
|
|
4402
|
-
// 9999px - full pill shape
|
|
4403
|
-
};
|
|
4404
4625
|
var BORDER_WIDTH_TO_CLASS_MAP = {
|
|
4405
4626
|
none: "border-0",
|
|
4406
4627
|
// 0px
|
|
@@ -4412,7 +4633,6 @@ var BORDER_WIDTH_TO_CLASS_MAP = {
|
|
|
4412
4633
|
// 4px - clearly thick
|
|
4413
4634
|
};
|
|
4414
4635
|
function generateDefaultButtonSystem(theme) {
|
|
4415
|
-
const borderRadius = CORNERS_TO_RADIUS_MAP[theme.corners] || "rounded-lg";
|
|
4416
4636
|
const borderWidthClass = BORDER_WIDTH_TO_CLASS_MAP[theme.border.width] || "border-2";
|
|
4417
4637
|
const variants = [];
|
|
4418
4638
|
const primaryVariant = {
|
|
@@ -4422,10 +4642,11 @@ function generateDefaultButtonSystem(theme) {
|
|
|
4422
4642
|
priority: 1,
|
|
4423
4643
|
background: {
|
|
4424
4644
|
type: "solid",
|
|
4425
|
-
colorToken: "primary
|
|
4645
|
+
colorToken: "primary"
|
|
4426
4646
|
},
|
|
4427
|
-
textColorToken: getContrastingTextColorToken("primary
|
|
4428
|
-
borderRadius,
|
|
4647
|
+
textColorToken: getContrastingTextColorToken("primary", theme),
|
|
4648
|
+
borderRadius: "",
|
|
4649
|
+
// Empty string = inherit from global.cornerStyle
|
|
4429
4650
|
// Inherits shadow from theme
|
|
4430
4651
|
effects: {
|
|
4431
4652
|
hover: [
|
|
@@ -4447,7 +4668,8 @@ function generateDefaultButtonSystem(theme) {
|
|
|
4447
4668
|
colorToken: "neutral-700"
|
|
4448
4669
|
},
|
|
4449
4670
|
textColorToken: getContrastingTextColorToken("neutral-700", theme),
|
|
4450
|
-
borderRadius,
|
|
4671
|
+
borderRadius: "",
|
|
4672
|
+
// Empty string = inherit from global.cornerStyle
|
|
4451
4673
|
// Inherits shadow from theme
|
|
4452
4674
|
effects: {
|
|
4453
4675
|
hover: [
|
|
@@ -4467,12 +4689,13 @@ function generateDefaultButtonSystem(theme) {
|
|
|
4467
4689
|
background: {
|
|
4468
4690
|
type: "transparent"
|
|
4469
4691
|
},
|
|
4470
|
-
textColorToken: "primary
|
|
4471
|
-
borderRadius,
|
|
4692
|
+
textColorToken: "primary",
|
|
4693
|
+
borderRadius: "",
|
|
4694
|
+
// Empty string = inherit from global.cornerStyle
|
|
4472
4695
|
shadow: { elevation: "none", softness: null, position: "bottom" },
|
|
4473
4696
|
// Outline buttons typically don't have shadows
|
|
4474
4697
|
border: {
|
|
4475
|
-
colorToken: "primary
|
|
4698
|
+
colorToken: "primary",
|
|
4476
4699
|
widthClass: borderWidthClass
|
|
4477
4700
|
},
|
|
4478
4701
|
effects: {
|
|
@@ -4493,8 +4716,9 @@ function generateDefaultButtonSystem(theme) {
|
|
|
4493
4716
|
background: {
|
|
4494
4717
|
type: "transparent"
|
|
4495
4718
|
},
|
|
4496
|
-
textColorToken: "primary
|
|
4497
|
-
borderRadius,
|
|
4719
|
+
textColorToken: "primary",
|
|
4720
|
+
borderRadius: "",
|
|
4721
|
+
// Empty string = inherit from global.cornerStyle
|
|
4498
4722
|
shadow: { elevation: "none", softness: null, position: "bottom" },
|
|
4499
4723
|
// Ghost buttons have no shadow
|
|
4500
4724
|
// No border for ghost buttons
|
|
@@ -4560,6 +4784,10 @@ function generateButtonCss(options) {
|
|
|
4560
4784
|
if (!variant.enabled) continue;
|
|
4561
4785
|
const baseCSS = generateVariantBaseCSS(variant, buttonSystem.global, themeId, tokens, theme);
|
|
4562
4786
|
cssChunks.push(baseCSS);
|
|
4787
|
+
const hoverBgCSS = generateHoverBackgroundCSS(variant, buttonSystem.global, themeId, tokens);
|
|
4788
|
+
if (hoverBgCSS) {
|
|
4789
|
+
cssChunks.push(hoverBgCSS);
|
|
4790
|
+
}
|
|
4563
4791
|
const effectCSS = generateVariantEffectCSS(variant, themeId, tokens, theme);
|
|
4564
4792
|
if (effectCSS) {
|
|
4565
4793
|
cssChunks.push(effectCSS);
|
|
@@ -4578,7 +4806,7 @@ function generateVariantBaseCSS(variant, global, themeId, tokens, theme) {
|
|
|
4578
4806
|
const rules = [];
|
|
4579
4807
|
const borderWidth = variant.border ? BORDER_WIDTH_MAP[variant.border.widthClass] || "1px" : "0px";
|
|
4580
4808
|
const hasBorder = borderWidth !== "0px";
|
|
4581
|
-
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;
|
|
4582
4810
|
const paddingParts = padding.split(" ");
|
|
4583
4811
|
const verticalPadding = paddingParts[0] || "0.5rem";
|
|
4584
4812
|
const horizontalPadding = paddingParts[1] || paddingParts[0] || "1rem";
|
|
@@ -4591,6 +4819,15 @@ function generateVariantBaseCSS(variant, global, themeId, tokens, theme) {
|
|
|
4591
4819
|
rules.push(`padding: ${padding};`);
|
|
4592
4820
|
}
|
|
4593
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
|
+
}
|
|
4594
4831
|
if (variant.fontSize) {
|
|
4595
4832
|
const fontSize = FONT_SIZE_MAP[variant.fontSize] || "1rem";
|
|
4596
4833
|
rules.push(`font-size: ${fontSize};`);
|
|
@@ -4604,16 +4841,16 @@ function generateVariantBaseCSS(variant, global, themeId, tokens, theme) {
|
|
|
4604
4841
|
rules.push(`align-items: ${STRUCTURAL_BASE_STYLES.alignItems};`);
|
|
4605
4842
|
rules.push(`justify-content: ${STRUCTURAL_BASE_STYLES.justifyContent};`);
|
|
4606
4843
|
let borderRadius;
|
|
4607
|
-
if (variant.borderRadius) {
|
|
4608
|
-
borderRadius = BORDER_RADIUS_MAP[variant.borderRadius]
|
|
4844
|
+
if (variant.borderRadius && variant.borderRadius !== "") {
|
|
4845
|
+
borderRadius = BORDER_RADIUS_MAP[variant.borderRadius] ?? BORDER_RADIUS_MAP["rounded"] ?? "0.375rem";
|
|
4609
4846
|
} else {
|
|
4610
4847
|
const cornerStyleMap = {
|
|
4611
4848
|
"square": "rounded-none",
|
|
4612
4849
|
"rounded": "rounded-md",
|
|
4613
4850
|
"pill": "rounded-full"
|
|
4614
4851
|
};
|
|
4615
|
-
const fallbackRadius = cornerStyleMap[global.cornerStyle]
|
|
4616
|
-
borderRadius = BORDER_RADIUS_MAP[fallbackRadius]
|
|
4852
|
+
const fallbackRadius = cornerStyleMap[global.cornerStyle] ?? "rounded-md";
|
|
4853
|
+
borderRadius = BORDER_RADIUS_MAP[fallbackRadius] ?? BORDER_RADIUS_MAP["rounded"] ?? "0.375rem";
|
|
4617
4854
|
}
|
|
4618
4855
|
rules.push(`border-radius: ${borderRadius};`);
|
|
4619
4856
|
const shadowConfig = variant.shadow || shadowSizeToShadow(global.shadow, theme) || theme.shadow;
|
|
@@ -4640,41 +4877,43 @@ function generateVariantBaseCSS(variant, global, themeId, tokens, theme) {
|
|
|
4640
4877
|
const borderWidth2 = BORDER_WIDTH_MAP[variant.border.widthClass] || "1px";
|
|
4641
4878
|
rules.push(`border: ${borderWidth2} solid ${borderColor};`);
|
|
4642
4879
|
}
|
|
4643
|
-
if (rules.length === 0) return "";
|
|
4880
|
+
if (rules.length === 0) return "";
|
|
4881
|
+
return `
|
|
4882
|
+
${selector} {
|
|
4883
|
+
${rules.join("\n ")}
|
|
4884
|
+
}
|
|
4885
|
+
`.trim();
|
|
4886
|
+
}
|
|
4887
|
+
function generateVariantEffectCSS(variant, themeId, tokens, theme) {
|
|
4888
|
+
if (!variant.effects) return "";
|
|
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;
|
|
4907
|
+
}
|
|
4908
|
+
if (!hoverToken) return null;
|
|
4909
|
+
const selector = `:where([data-theme-scope="${themeId}"]) .${variant.id}:hover`;
|
|
4910
|
+
const hoverBgColor = tokens.getColor(hoverToken);
|
|
4644
4911
|
return `
|
|
4645
4912
|
${selector} {
|
|
4646
|
-
${
|
|
4913
|
+
background-color: ${hoverBgColor};
|
|
4647
4914
|
}
|
|
4648
4915
|
`.trim();
|
|
4649
4916
|
}
|
|
4650
|
-
function generateVariantEffectCSS(variant, themeId, tokens, theme) {
|
|
4651
|
-
if (!variant.effects) return "";
|
|
4652
|
-
const cssChunks = [];
|
|
4653
|
-
for (const [stateGroup, effectApps] of Object.entries(variant.effects)) {
|
|
4654
|
-
if (!effectApps || effectApps.length === 0) continue;
|
|
4655
|
-
for (const effectApp of effectApps) {
|
|
4656
|
-
const effectPreset = getEffectPreset(effectApp.effectId);
|
|
4657
|
-
if (!effectPreset) {
|
|
4658
|
-
console.warn(`[generateVariantEffectCSS] Unknown effect: ${effectApp.effectId}`);
|
|
4659
|
-
continue;
|
|
4660
|
-
}
|
|
4661
|
-
const ctx = {
|
|
4662
|
-
themeId,
|
|
4663
|
-
variantId: variant.id,
|
|
4664
|
-
stateGroup,
|
|
4665
|
-
options: effectApp.options || {},
|
|
4666
|
-
buttonConfig: variant,
|
|
4667
|
-
tokens,
|
|
4668
|
-
theme
|
|
4669
|
-
};
|
|
4670
|
-
const css2 = effectPreset.generateCSS(ctx);
|
|
4671
|
-
if (css2) {
|
|
4672
|
-
cssChunks.push(css2);
|
|
4673
|
-
}
|
|
4674
|
-
}
|
|
4675
|
-
}
|
|
4676
|
-
return cssChunks.join("\n\n");
|
|
4677
|
-
}
|
|
4678
4917
|
function generateDisabledCSS(variant, themeId) {
|
|
4679
4918
|
const selector = `:where([data-theme-scope="${themeId}"]) .${variant.id}:disabled`;
|
|
4680
4919
|
return `
|
|
@@ -5566,6 +5805,345 @@ function generateDefaultInputSystem(theme) {
|
|
|
5566
5805
|
};
|
|
5567
5806
|
}
|
|
5568
5807
|
|
|
5808
|
+
// ../blocks/src/theme/navigation/types.ts
|
|
5809
|
+
import { z as z4 } from "zod";
|
|
5810
|
+
|
|
5811
|
+
// ../blocks/src/theme/interactive/baseSchema.ts
|
|
5812
|
+
import { z as z3 } from "zod";
|
|
5813
|
+
var interactiveTypographySchema = z3.object({
|
|
5814
|
+
/** Font family source */
|
|
5815
|
+
typography: z3.enum(["body", "heading"]).default("body"),
|
|
5816
|
+
/** Font weight */
|
|
5817
|
+
fontWeight: z3.enum(["regular", "medium", "semibold", "bold"]).default("medium"),
|
|
5818
|
+
/** Text transform */
|
|
5819
|
+
textTransform: z3.enum(["none", "uppercase", "capitalize"]).default("none"),
|
|
5820
|
+
/** Italic style */
|
|
5821
|
+
italic: z3.boolean().default(false)
|
|
5822
|
+
});
|
|
5823
|
+
var effectApplicationSchema = z3.object({
|
|
5824
|
+
/** Effect preset ID */
|
|
5825
|
+
effectId: z3.string(),
|
|
5826
|
+
/** User-provided customization options */
|
|
5827
|
+
options: z3.record(z3.string(), z3.any()).optional()
|
|
5828
|
+
});
|
|
5829
|
+
var effectCompositionSchema = z3.object({
|
|
5830
|
+
/** Effects always applied */
|
|
5831
|
+
base: z3.array(effectApplicationSchema).optional(),
|
|
5832
|
+
/** Effects applied on hover */
|
|
5833
|
+
hover: z3.array(effectApplicationSchema).optional(),
|
|
5834
|
+
/** Effects applied on active/pressed */
|
|
5835
|
+
active: z3.array(effectApplicationSchema).optional(),
|
|
5836
|
+
/** Effects applied on focus */
|
|
5837
|
+
focus: z3.array(effectApplicationSchema).optional()
|
|
5838
|
+
});
|
|
5839
|
+
|
|
5840
|
+
// ../blocks/src/theme/navigation/types.ts
|
|
5841
|
+
var navLinkPaddingSchema = z4.enum(["none", "compact", "default"]);
|
|
5842
|
+
var navLinkBorderRadiusSchema = z4.enum(["none", "sm", "md", "full"]);
|
|
5843
|
+
var navLinkStyleSchema = z4.object({
|
|
5844
|
+
/** Display name for the style */
|
|
5845
|
+
name: z4.string().min(1).max(30).optional(),
|
|
5846
|
+
/** Typography settings (inherited from interactive base) */
|
|
5847
|
+
...interactiveTypographySchema.shape,
|
|
5848
|
+
/** Text color token */
|
|
5849
|
+
colorToken: z4.string().default("text"),
|
|
5850
|
+
/** Hover/active color token (for color-change effects) */
|
|
5851
|
+
hoverColorToken: z4.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 && !style.effects?.hover?.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
|
+
|
|
5569
6147
|
// ../blocks/src/theme/header/generateHeaderCss.ts
|
|
5570
6148
|
function generateHeaderCss(options) {
|
|
5571
6149
|
const { themeId, theme } = options;
|
|
@@ -5573,10 +6151,8 @@ function generateHeaderCss(options) {
|
|
|
5573
6151
|
const header = theme.header;
|
|
5574
6152
|
const cssChunks = [];
|
|
5575
6153
|
cssChunks.push(generateHeaderRootStyles(header, themeId, tokens, theme));
|
|
5576
|
-
|
|
5577
|
-
|
|
5578
|
-
}
|
|
5579
|
-
cssChunks.push(generateNavLinkStyles(header, themeId, tokens));
|
|
6154
|
+
cssChunks.push(generateLogoStyles(header.logo, themeId, tokens, header.textColor));
|
|
6155
|
+
cssChunks.push(generateNavLinkStyles(header, themeId, tokens, theme));
|
|
5580
6156
|
if (header.variant === "floating" && header.container) {
|
|
5581
6157
|
cssChunks.push(generateFloatingContainerStyles(header.container, themeId, tokens));
|
|
5582
6158
|
}
|
|
@@ -5632,32 +6208,36 @@ ${selector} {
|
|
|
5632
6208
|
}
|
|
5633
6209
|
`;
|
|
5634
6210
|
}
|
|
5635
|
-
function generateLogoStyles(logo, themeId, tokens) {
|
|
5636
|
-
if (!logo) return "";
|
|
6211
|
+
function generateLogoStyles(logo, themeId, tokens, textColor) {
|
|
5637
6212
|
const selector = `:where([data-theme-scope="${themeId}"]) .header-logo-text`;
|
|
5638
6213
|
const rules = [];
|
|
5639
6214
|
const primaryColor = tokens.getColor("primary");
|
|
5640
6215
|
const accentColor = tokens.getColor("accent");
|
|
5641
|
-
if (
|
|
5642
|
-
rules.push(`
|
|
5643
|
-
}
|
|
5644
|
-
|
|
5645
|
-
|
|
5646
|
-
|
|
5647
|
-
|
|
5648
|
-
|
|
5649
|
-
|
|
5650
|
-
|
|
5651
|
-
|
|
5652
|
-
|
|
5653
|
-
|
|
5654
|
-
|
|
5655
|
-
|
|
5656
|
-
|
|
5657
|
-
|
|
5658
|
-
|
|
5659
|
-
|
|
5660
|
-
|
|
6216
|
+
if (textColor && !logo?.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
|
+
}
|
|
5661
6241
|
}
|
|
5662
6242
|
if (rules.length === 0) return "";
|
|
5663
6243
|
return `
|
|
@@ -5666,129 +6246,82 @@ ${selector} {
|
|
|
5666
6246
|
}
|
|
5667
6247
|
`;
|
|
5668
6248
|
}
|
|
5669
|
-
function generateNavLinkStyles(header, themeId, tokens) {
|
|
5670
|
-
|
|
5671
|
-
|
|
5672
|
-
|
|
5673
|
-
|
|
5674
|
-
|
|
5675
|
-
|
|
5676
|
-
|
|
5677
|
-
|
|
5678
|
-
const usesGlassNavContainer = navContainerType === "glass";
|
|
5679
|
-
const navColorToken = header.navColor?.trim();
|
|
5680
|
-
const primaryColor = tokens.getColor("primary");
|
|
5681
|
-
const navWeight = header.navWeight ?? "medium";
|
|
5682
|
-
const navWeightMap = {
|
|
5683
|
-
regular: 400,
|
|
5684
|
-
medium: 500,
|
|
5685
|
-
semibold: 600,
|
|
5686
|
-
bold: 700
|
|
5687
|
-
};
|
|
5688
|
-
if (navColorToken) {
|
|
5689
|
-
baseRules.push(`color: ${tokens.getColor(navColorToken)};`);
|
|
5690
|
-
}
|
|
5691
|
-
if (navWeight) {
|
|
5692
|
-
baseRules.push(`font-weight: ${navWeightMap[navWeight]};`);
|
|
5693
|
-
}
|
|
5694
|
-
if (navWeight === "bold" && header.navStyle === "solid") {
|
|
5695
|
-
baseRules.push(`text-transform: uppercase;`);
|
|
5696
|
-
}
|
|
5697
|
-
switch (header.navStyle) {
|
|
5698
|
-
case "minimal":
|
|
5699
|
-
baseRules.push(`transition: color 200ms ease;`);
|
|
5700
|
-
hoverRules.push(`color: ${primaryColor};`);
|
|
5701
|
-
activeRules.push(`color: ${primaryColor};`);
|
|
5702
|
-
break;
|
|
5703
|
-
case "underline":
|
|
5704
|
-
baseRules.push(`transition: all 200ms ease;`);
|
|
5705
|
-
hoverRules.push(`text-decoration: underline;`);
|
|
5706
|
-
hoverRules.push(`text-underline-offset: 4px;`);
|
|
5707
|
-
activeRules.push(`text-decoration: underline;`);
|
|
5708
|
-
activeRules.push(`text-underline-offset: 4px;`);
|
|
5709
|
-
break;
|
|
5710
|
-
case "underline-grow":
|
|
5711
|
-
baseRules.push(`position: relative;`);
|
|
5712
|
-
baseRules.push(`transition: color 200ms ease;`);
|
|
5713
|
-
hoverRules.push(`color: ${primaryColor};`);
|
|
5714
|
-
activeRules.push(`color: ${primaryColor};`);
|
|
5715
|
-
cssChunks.push(generateUnderlineGrowCSS(themeId));
|
|
5716
|
-
break;
|
|
5717
|
-
case "capsule":
|
|
5718
|
-
baseRules.push(`border-radius: 9999px;`);
|
|
5719
|
-
baseRules.push(`transition: background-color 200ms ease;`);
|
|
5720
|
-
hoverRules.push(`background-color: color-mix(in srgb, ${primaryColor} 10%, transparent);`);
|
|
5721
|
-
activeRules.push(`background-color: color-mix(in srgb, ${primaryColor} 15%, transparent);`);
|
|
5722
|
-
break;
|
|
5723
|
-
case "solid":
|
|
5724
|
-
baseRules.push(`border-radius: 0;`);
|
|
5725
|
-
baseRules.push(`transition: background-color 200ms ease, color 200ms ease;`);
|
|
5726
|
-
hoverRules.push(`background-color: ${primaryColor};`);
|
|
5727
|
-
if (navColorToken) {
|
|
5728
|
-
hoverRules.push(`color: ${tokens.getColor(navColorToken)};`);
|
|
5729
|
-
}
|
|
5730
|
-
activeRules.push(`background-color: ${primaryColor};`);
|
|
5731
|
-
if (navColorToken) {
|
|
5732
|
-
activeRules.push(`color: ${tokens.getColor(navColorToken)};`);
|
|
5733
|
-
}
|
|
5734
|
-
break;
|
|
5735
|
-
case "scale":
|
|
5736
|
-
baseRules.push(`transition: all 200ms ease;`);
|
|
5737
|
-
hoverRules.push(`transform: scale(1.05);`);
|
|
5738
|
-
break;
|
|
5739
|
-
case "frosted":
|
|
5740
|
-
baseRules.push(`border-radius: 0.5rem;`);
|
|
5741
|
-
baseRules.push(`background-color: rgb(255 255 255 / 0.1);`);
|
|
5742
|
-
baseRules.push(`backdrop-filter: blur(8px);`);
|
|
5743
|
-
baseRules.push(`transition: background-color 200ms ease;`);
|
|
5744
|
-
hoverRules.push(`background-color: rgb(255 255 255 / 0.2);`);
|
|
5745
|
-
activeRules.push(`background-color: rgb(255 255 255 / 0.25);`);
|
|
5746
|
-
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
|
+
});
|
|
5747
6258
|
}
|
|
5748
|
-
|
|
5749
|
-
|
|
5750
|
-
|
|
5751
|
-
|
|
5752
|
-
|
|
5753
|
-
|
|
6259
|
+
const navStyle = 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: header.navWeight ?? basePreset.fontWeight,
|
|
6269
|
+
colorToken: (header.navColor ?? header.textColor)?.trim() || basePreset.colorToken
|
|
6270
|
+
};
|
|
6271
|
+
if (header.navWeight === "bold" && navStyle === "solid") {
|
|
6272
|
+
mergedStyle.textTransform = "uppercase";
|
|
5754
6273
|
}
|
|
5755
6274
|
if (header.navEffects) {
|
|
6275
|
+
mergedStyle.effects = {
|
|
6276
|
+
...mergedStyle.effects,
|
|
6277
|
+
hover: [...mergedStyle.effects?.hover || []],
|
|
6278
|
+
active: [...mergedStyle.effects?.active || []]
|
|
6279
|
+
};
|
|
5756
6280
|
if (header.navEffects.glow) {
|
|
5757
|
-
|
|
6281
|
+
mergedStyle.effects.hover.push({
|
|
6282
|
+
effectId: "outer-glow",
|
|
6283
|
+
options: { spread: 5 }
|
|
6284
|
+
});
|
|
5758
6285
|
}
|
|
5759
6286
|
if (header.navEffects.neumorphic) {
|
|
5760
|
-
|
|
5761
|
-
|
|
5762
|
-
|
|
5763
|
-
|
|
5764
|
-
|
|
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
|
+
});
|
|
5765
6295
|
}
|
|
5766
6296
|
if (header.navEffects.underlineGradient) {
|
|
5767
|
-
|
|
6297
|
+
mergedStyle.effects.hover.push({
|
|
6298
|
+
effectId: "border-bottom-grow",
|
|
6299
|
+
options: { origin: "center" }
|
|
6300
|
+
});
|
|
5768
6301
|
}
|
|
5769
6302
|
}
|
|
5770
|
-
|
|
5771
|
-
|
|
5772
|
-
|
|
5773
|
-
|
|
5774
|
-
|
|
5775
|
-
|
|
5776
|
-
|
|
5777
|
-
|
|
5778
|
-
|
|
5779
|
-
|
|
5780
|
-
|
|
5781
|
-
}
|
|
5782
|
-
|
|
5783
|
-
|
|
5784
|
-
if (activeRules.length > 0) {
|
|
5785
|
-
cssChunks.push(`
|
|
5786
|
-
${activeSelector} {
|
|
5787
|
-
${activeRules.join("\n ")}
|
|
5788
|
-
}
|
|
5789
|
-
`);
|
|
6303
|
+
const navContainerType = header.navContainer?.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
|
+
};
|
|
5790
6317
|
}
|
|
5791
|
-
return
|
|
6318
|
+
return generateNavLinkCSS({
|
|
6319
|
+
themeId,
|
|
6320
|
+
tokens,
|
|
6321
|
+
theme,
|
|
6322
|
+
style: mergedStyle,
|
|
6323
|
+
className: "header-nav-link"
|
|
6324
|
+
});
|
|
5792
6325
|
}
|
|
5793
6326
|
function generateNavContainerStyles(header, themeId, tokens) {
|
|
5794
6327
|
const navContainer = header.navContainer;
|
|
@@ -5825,52 +6358,6 @@ function generateNavContainerStyles(header, themeId, tokens) {
|
|
|
5825
6358
|
}
|
|
5826
6359
|
return "";
|
|
5827
6360
|
}
|
|
5828
|
-
function generateGradientUnderlineCSS(themeId, tokens) {
|
|
5829
|
-
const selector = `:where([data-theme-scope="${themeId}"]) .header-nav-link`;
|
|
5830
|
-
const primaryColor = tokens.getColor("primary");
|
|
5831
|
-
const accentColor = tokens.getColor("accent");
|
|
5832
|
-
return `
|
|
5833
|
-
${selector}::after {
|
|
5834
|
-
content: '';
|
|
5835
|
-
position: absolute;
|
|
5836
|
-
bottom: 0;
|
|
5837
|
-
left: 0;
|
|
5838
|
-
width: 100%;
|
|
5839
|
-
height: 2px;
|
|
5840
|
-
background: linear-gradient(to right, ${primaryColor}, ${accentColor});
|
|
5841
|
-
transform: scaleX(0);
|
|
5842
|
-
transform-origin: center;
|
|
5843
|
-
transition: transform 0.3s ease;
|
|
5844
|
-
}
|
|
5845
|
-
|
|
5846
|
-
${selector}:hover::after,
|
|
5847
|
-
${selector}[data-active="true"]::after {
|
|
5848
|
-
transform: scaleX(1);
|
|
5849
|
-
}
|
|
5850
|
-
`.trim();
|
|
5851
|
-
}
|
|
5852
|
-
function generateUnderlineGrowCSS(themeId) {
|
|
5853
|
-
const selector = `:where([data-theme-scope="${themeId}"]) .header-nav-link`;
|
|
5854
|
-
return `
|
|
5855
|
-
${selector}::after {
|
|
5856
|
-
content: '';
|
|
5857
|
-
position: absolute;
|
|
5858
|
-
bottom: 0;
|
|
5859
|
-
left: 0;
|
|
5860
|
-
width: 100%;
|
|
5861
|
-
height: 2px;
|
|
5862
|
-
background: currentColor;
|
|
5863
|
-
transform: scaleX(0);
|
|
5864
|
-
transform-origin: center;
|
|
5865
|
-
transition: transform 0.3s ease;
|
|
5866
|
-
}
|
|
5867
|
-
|
|
5868
|
-
${selector}:hover::after,
|
|
5869
|
-
${selector}[data-active="true"]::after {
|
|
5870
|
-
transform: scaleX(1);
|
|
5871
|
-
}
|
|
5872
|
-
`.trim();
|
|
5873
|
-
}
|
|
5874
6361
|
function generateFloatingContainerStyles(container, themeId, tokens) {
|
|
5875
6362
|
if (!container) return "";
|
|
5876
6363
|
const selector = `:where([data-theme-scope="${themeId}"]) .header-floating-container`;
|
|
@@ -5927,12 +6414,52 @@ function applyAlpha(color, opacity) {
|
|
|
5927
6414
|
const clamped = clampOpacity(opacity, 1);
|
|
5928
6415
|
if (color.startsWith("rgb(") && color.endsWith(")")) {
|
|
5929
6416
|
const inner = color.slice(4, -1).trim();
|
|
5930
|
-
const channels = inner.includes("/") ? inner.split("/")[0].trim() : inner;
|
|
6417
|
+
const channels = inner.includes("/") ? (inner.split("/")[0] ?? inner).trim() : inner;
|
|
5931
6418
|
return `rgb(${channels} / ${clamped})`;
|
|
5932
6419
|
}
|
|
5933
6420
|
return color;
|
|
5934
6421
|
}
|
|
5935
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 = 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: footer.navWeight ?? basePreset.fontWeight,
|
|
6452
|
+
colorToken: footer.navColor?.trim() || basePreset.colorToken
|
|
6453
|
+
};
|
|
6454
|
+
return generateNavLinkCSS({
|
|
6455
|
+
themeId,
|
|
6456
|
+
tokens,
|
|
6457
|
+
theme,
|
|
6458
|
+
style: mergedStyle,
|
|
6459
|
+
className: "footer-nav-link"
|
|
6460
|
+
});
|
|
6461
|
+
}
|
|
6462
|
+
|
|
5936
6463
|
// ../blocks/src/theme/layout/generateLayoutCss.ts
|
|
5937
6464
|
function generateLayoutCss(options) {
|
|
5938
6465
|
const { themeId } = options;
|
|
@@ -6086,6 +6613,105 @@ ${root} .step-connector {
|
|
|
6086
6613
|
return cssBlocks.join("\n\n");
|
|
6087
6614
|
}
|
|
6088
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
|
+
|
|
6089
6715
|
// ../blocks/src/system/theme/tokens.ts
|
|
6090
6716
|
var defaultThemeTokens = {
|
|
6091
6717
|
color: {
|
|
@@ -6170,6 +6796,10 @@ function buildThemeRuntime(theme, options) {
|
|
|
6170
6796
|
themeId,
|
|
6171
6797
|
theme
|
|
6172
6798
|
});
|
|
6799
|
+
const footerCss = generateFooterCss({
|
|
6800
|
+
themeId,
|
|
6801
|
+
theme
|
|
6802
|
+
});
|
|
6173
6803
|
const cardCss = generateCardCss({
|
|
6174
6804
|
themeId,
|
|
6175
6805
|
theme,
|
|
@@ -6199,8 +6829,12 @@ function buildThemeRuntime(theme, options) {
|
|
|
6199
6829
|
themeId,
|
|
6200
6830
|
theme
|
|
6201
6831
|
});
|
|
6832
|
+
const typographyCss = generateTypographyCss({
|
|
6833
|
+
themeId,
|
|
6834
|
+
theme
|
|
6835
|
+
});
|
|
6202
6836
|
const tokens = buildThemeTokens(hydrated, theme);
|
|
6203
|
-
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 };
|
|
6204
6838
|
}
|
|
6205
6839
|
function hydrateTheme(theme) {
|
|
6206
6840
|
return {
|
|
@@ -6230,17 +6864,39 @@ function buildThemeCssVars(theme) {
|
|
|
6230
6864
|
...typography.headings.h1.letterSpacing ? { ["--ls-h1"]: mapLetterSpacing(typography.headings.h1.letterSpacing) } : {},
|
|
6231
6865
|
...typography.headings.h2.letterSpacing ? { ["--ls-h2"]: mapLetterSpacing(typography.headings.h2.letterSpacing) } : {},
|
|
6232
6866
|
...typography.headings.h3.letterSpacing ? { ["--ls-h3"]: mapLetterSpacing(typography.headings.h3.letterSpacing) } : {},
|
|
6867
|
+
...typography.headings.h4?.letterSpacing ? { ["--ls-h4"]: mapLetterSpacing(typography.headings.h4.letterSpacing) } : {},
|
|
6868
|
+
...typography.headings.h5?.letterSpacing ? { ["--ls-h5"]: mapLetterSpacing(typography.headings.h5.letterSpacing) } : {},
|
|
6869
|
+
...typography.headings.h6?.letterSpacing ? { ["--ls-h6"]: mapLetterSpacing(typography.headings.h6.letterSpacing) } : {},
|
|
6233
6870
|
["--lh-heading"]: mapLineHeight(typography.headings.default.lineHeight),
|
|
6234
6871
|
["--lh-body"]: mapLineHeight(typography.body.lineHeight),
|
|
6235
6872
|
...typography.headings.h1.lineHeight ? { ["--lh-h1"]: mapLineHeight(typography.headings.h1.lineHeight) } : {},
|
|
6236
6873
|
...typography.headings.h2.lineHeight ? { ["--lh-h2"]: mapLineHeight(typography.headings.h2.lineHeight) } : {},
|
|
6237
6874
|
...typography.headings.h3.lineHeight ? { ["--lh-h3"]: mapLineHeight(typography.headings.h3.lineHeight) } : {},
|
|
6875
|
+
...typography.headings.h4?.lineHeight ? { ["--lh-h4"]: mapLineHeight(typography.headings.h4.lineHeight) } : {},
|
|
6876
|
+
...typography.headings.h5?.lineHeight ? { ["--lh-h5"]: mapLineHeight(typography.headings.h5.lineHeight) } : {},
|
|
6877
|
+
...typography.headings.h6?.lineHeight ? { ["--lh-h6"]: mapLineHeight(typography.headings.h6.lineHeight) } : {},
|
|
6238
6878
|
["--tt-heading"]: mapTextTransform(typography.headings.default.case),
|
|
6239
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
|
+
...typography.headings.h4?.italic != null ? { ["--fi-h4"]: mapFontStyle(typography.headings.h4.italic) } : {},
|
|
6886
|
+
...typography.headings.h5?.italic != null ? { ["--fi-h5"]: mapFontStyle(typography.headings.h5.italic) } : {},
|
|
6887
|
+
...typography.headings.h6?.italic != null ? { ["--fi-h6"]: mapFontStyle(typography.headings.h6.italic) } : {},
|
|
6888
|
+
// Static font sizes (fallback)
|
|
6240
6889
|
["--fs-body"]: sized.body,
|
|
6241
6890
|
["--fs-h3"]: sized.h3,
|
|
6242
6891
|
["--fs-h2"]: sized.h2,
|
|
6243
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,
|
|
6244
6900
|
["--shadow-elev"]: mapShadow(shadow.elevation, shadow.softness, shadow.position || "bottom"),
|
|
6245
6901
|
["--space-mult"]: mapSpaceMult(space),
|
|
6246
6902
|
["--motion-duration"]: mapMotionDuration(motion.level),
|
|
@@ -6346,33 +7002,81 @@ function mapMotionEasing(e) {
|
|
|
6346
7002
|
gentle: "cubic-bezier(.15,.85,.15,1)"
|
|
6347
7003
|
}[e];
|
|
6348
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 aliasMap[scale] ?? "balanced";
|
|
7015
|
+
}
|
|
6349
7016
|
function computeTypeScale(scale, bodySize) {
|
|
6350
7017
|
const base = { md: 16, lg: 17, xl: 18 }[bodySize];
|
|
6351
|
-
const
|
|
7018
|
+
const normalizedScale = normalizeScaleName(scale);
|
|
7019
|
+
const ratio = { compact: 1.2, balanced: 1.25, spacious: 1.333 }[normalizedScale];
|
|
6352
7020
|
const h3 = Math.round(base * ratio);
|
|
6353
7021
|
const h2 = Math.round(h3 * ratio);
|
|
6354
7022
|
const h1 = Math.round(h2 * ratio);
|
|
7023
|
+
const fluidMin = 0.7;
|
|
7024
|
+
const fluidMax = 1.3;
|
|
6355
7025
|
return {
|
|
7026
|
+
// Static sizes (fallback)
|
|
6356
7027
|
["--fs-body"]: `${base}px`,
|
|
6357
7028
|
["--fs-h3"]: `${h3}px`,
|
|
6358
7029
|
["--fs-h2"]: `${h2}px`,
|
|
6359
|
-
["--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)`
|
|
6360
7045
|
};
|
|
6361
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
|
+
};
|
|
6362
7055
|
function applyHeadingSizeOverrides(base, typography) {
|
|
6363
7056
|
const body = base["--fs-body"];
|
|
6364
7057
|
const h1Base = parseFloat(base["--fs-h1"].replace("px", ""));
|
|
6365
7058
|
const h2Base = parseFloat(base["--fs-h2"].replace("px", ""));
|
|
6366
7059
|
const h3Base = parseFloat(base["--fs-h3"].replace("px", ""));
|
|
6367
|
-
const
|
|
6368
|
-
const
|
|
6369
|
-
const
|
|
6370
|
-
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;
|
|
6371
7068
|
return {
|
|
6372
7069
|
body,
|
|
6373
|
-
h1: `${
|
|
6374
|
-
h2: `${
|
|
6375
|
-
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)`
|
|
6376
7080
|
};
|
|
6377
7081
|
}
|
|
6378
7082
|
function mapLetterSpacing(s) {
|
|
@@ -6389,29 +7093,32 @@ function mapFontVariant(c) {
|
|
|
6389
7093
|
if (c === "smallCaps") return "small-caps";
|
|
6390
7094
|
return "normal";
|
|
6391
7095
|
}
|
|
7096
|
+
function mapFontStyle(italic) {
|
|
7097
|
+
return italic ? "italic" : "normal";
|
|
7098
|
+
}
|
|
6392
7099
|
|
|
6393
7100
|
// ../blocks/src/PageRenderer.tsx
|
|
6394
7101
|
import * as React5 from "react";
|
|
6395
7102
|
|
|
6396
7103
|
// ../blocks/src/system/manifest/validation.ts
|
|
6397
|
-
import { z as
|
|
7104
|
+
import { z as z6 } from "zod";
|
|
6398
7105
|
|
|
6399
7106
|
// ../blocks/src/system/manifest/richTextSchema.ts
|
|
6400
|
-
import { z as
|
|
6401
|
-
var TipTapNodeSchema =
|
|
6402
|
-
() =>
|
|
6403
|
-
type:
|
|
6404
|
-
content:
|
|
6405
|
-
text:
|
|
6406
|
-
attrs:
|
|
6407
|
-
marks:
|
|
7107
|
+
import { z as z5 } from "zod";
|
|
7108
|
+
var TipTapNodeSchema = z5.lazy(
|
|
7109
|
+
() => z5.object({
|
|
7110
|
+
type: z5.string(),
|
|
7111
|
+
content: z5.array(TipTapNodeSchema).optional(),
|
|
7112
|
+
text: z5.string().optional(),
|
|
7113
|
+
attrs: z5.record(z5.string(), z5.any()).optional(),
|
|
7114
|
+
marks: z5.array(z5.any()).optional()
|
|
6408
7115
|
})
|
|
6409
7116
|
);
|
|
6410
|
-
var RichTextValueSchema =
|
|
7117
|
+
var RichTextValueSchema = z5.union([
|
|
6411
7118
|
// New format: TipTap document directly
|
|
6412
7119
|
TipTapNodeSchema,
|
|
6413
7120
|
// Legacy format: wrapped in { doc: {...} }
|
|
6414
|
-
|
|
7121
|
+
z5.object({
|
|
6415
7122
|
doc: TipTapNodeSchema
|
|
6416
7123
|
})
|
|
6417
7124
|
]);
|
|
@@ -6446,7 +7153,7 @@ function createManifestValidator(manifestOrFields, options = {}) {
|
|
|
6446
7153
|
for (const field of fields) {
|
|
6447
7154
|
shape[field.id] = buildFieldSchema(field, allowNull, allowIncomplete);
|
|
6448
7155
|
}
|
|
6449
|
-
return
|
|
7156
|
+
return z6.object(shape).catchall(z6.unknown()).passthrough();
|
|
6450
7157
|
}
|
|
6451
7158
|
function buildFieldSchema(field, allowNull, allowIncomplete = false) {
|
|
6452
7159
|
const required = Boolean(field.required);
|
|
@@ -6459,13 +7166,13 @@ function buildFieldSchema(field, allowNull, allowIncomplete = false) {
|
|
|
6459
7166
|
schema = buildRichTextSchema2();
|
|
6460
7167
|
break;
|
|
6461
7168
|
case "media": {
|
|
6462
|
-
const baseMediaSchema =
|
|
7169
|
+
const baseMediaSchema = z6.record(z6.string(), z6.unknown());
|
|
6463
7170
|
const isRequired = Boolean(field.required);
|
|
6464
7171
|
schema = isRequired ? baseMediaSchema : baseMediaSchema.nullable();
|
|
6465
7172
|
break;
|
|
6466
7173
|
}
|
|
6467
7174
|
case "boolean":
|
|
6468
|
-
schema =
|
|
7175
|
+
schema = z6.boolean();
|
|
6469
7176
|
break;
|
|
6470
7177
|
case "slug":
|
|
6471
7178
|
schema = buildSlugSchema(field);
|
|
@@ -6489,7 +7196,7 @@ function buildFieldSchema(field, allowNull, allowIncomplete = false) {
|
|
|
6489
7196
|
schema = buildGroupSchema(field, allowNull, allowIncomplete);
|
|
6490
7197
|
break;
|
|
6491
7198
|
default:
|
|
6492
|
-
schema =
|
|
7199
|
+
schema = z6.unknown();
|
|
6493
7200
|
break;
|
|
6494
7201
|
}
|
|
6495
7202
|
return finalizeSchema(schema, required, allowNull, allowIncomplete);
|
|
@@ -6499,11 +7206,11 @@ function buildTextSchema(field) {
|
|
|
6499
7206
|
const inputType = ui?.inputType;
|
|
6500
7207
|
let schema;
|
|
6501
7208
|
if (inputType === "number") {
|
|
6502
|
-
schema =
|
|
7209
|
+
schema = z6.coerce.number();
|
|
6503
7210
|
if (typeof ui?.min === "number") schema = schema.min(ui.min);
|
|
6504
7211
|
if (typeof ui?.max === "number") schema = schema.max(ui.max);
|
|
6505
7212
|
} else {
|
|
6506
|
-
schema =
|
|
7213
|
+
schema = z6.string();
|
|
6507
7214
|
if (inputType === "email") {
|
|
6508
7215
|
schema = schema.email(`${field.label} must be a valid email`);
|
|
6509
7216
|
}
|
|
@@ -6533,7 +7240,7 @@ function buildRichTextSchema2() {
|
|
|
6533
7240
|
var SLUG_PATTERN = /^(?:[a-z0-9]+(?:-[a-z0-9]+)*)(?:\/(?:[a-z0-9]+(?:-[a-z0-9]+)*))*$/;
|
|
6534
7241
|
function buildSlugSchema(field) {
|
|
6535
7242
|
const message = `${field.label} must contain lowercase letters, numbers, and dashes`;
|
|
6536
|
-
let schema =
|
|
7243
|
+
let schema = z6.string().regex(SLUG_PATTERN, message);
|
|
6537
7244
|
if (field.maxLength) {
|
|
6538
7245
|
schema = schema.max(field.maxLength, `${field.label} must be at most ${field.maxLength} characters`);
|
|
6539
7246
|
}
|
|
@@ -6559,19 +7266,19 @@ function buildUrlSchema(field) {
|
|
|
6559
7266
|
return false;
|
|
6560
7267
|
}
|
|
6561
7268
|
};
|
|
6562
|
-
let schema =
|
|
7269
|
+
let schema = z6.string().trim().refine(validate, message);
|
|
6563
7270
|
if (field.required) {
|
|
6564
7271
|
schema = schema.min(1, `${field.label} is required`);
|
|
6565
7272
|
}
|
|
6566
7273
|
return schema;
|
|
6567
7274
|
}
|
|
6568
7275
|
function buildLinkSchema() {
|
|
6569
|
-
const nullableString =
|
|
6570
|
-
const internal =
|
|
6571
|
-
kind:
|
|
6572
|
-
routeId:
|
|
6573
|
-
entityId:
|
|
6574
|
-
entityType:
|
|
7276
|
+
const nullableString = z6.union([z6.string().min(1), z6.null()]);
|
|
7277
|
+
const internal = z6.object({
|
|
7278
|
+
kind: z6.literal("internal"),
|
|
7279
|
+
routeId: z6.string().min(1),
|
|
7280
|
+
entityId: z6.string().min(1).optional(),
|
|
7281
|
+
entityType: z6.enum(["page", "content"]).optional(),
|
|
6575
7282
|
href: nullableString.optional(),
|
|
6576
7283
|
title: nullableString.optional(),
|
|
6577
7284
|
typeLabel: nullableString.optional(),
|
|
@@ -6579,36 +7286,36 @@ function buildLinkSchema() {
|
|
|
6579
7286
|
contentTypeName: nullableString.optional(),
|
|
6580
7287
|
updatedAt: nullableString.optional()
|
|
6581
7288
|
}).passthrough();
|
|
6582
|
-
const external =
|
|
6583
|
-
kind:
|
|
6584
|
-
href:
|
|
7289
|
+
const external = z6.object({
|
|
7290
|
+
kind: z6.literal("external"),
|
|
7291
|
+
href: z6.string().min(1)
|
|
6585
7292
|
}).passthrough();
|
|
6586
|
-
const custom =
|
|
6587
|
-
kind:
|
|
6588
|
-
href:
|
|
7293
|
+
const custom = z6.object({
|
|
7294
|
+
kind: z6.literal("url"),
|
|
7295
|
+
href: z6.string().min(1)
|
|
6589
7296
|
}).passthrough();
|
|
6590
|
-
return
|
|
7297
|
+
return z6.union([internal, external, custom]);
|
|
6591
7298
|
}
|
|
6592
7299
|
function buildSelectSchema(field) {
|
|
6593
7300
|
const ui = field.ui;
|
|
6594
7301
|
if (ui?.widget === "sdkSelect") {
|
|
6595
|
-
const anyStringSchema =
|
|
7302
|
+
const anyStringSchema = z6.string();
|
|
6596
7303
|
if (field.multiple) {
|
|
6597
|
-
const arraySchema =
|
|
7304
|
+
const arraySchema = z6.array(anyStringSchema);
|
|
6598
7305
|
return field.required ? arraySchema : arraySchema.nullable();
|
|
6599
7306
|
}
|
|
6600
7307
|
return field.required ? anyStringSchema : anyStringSchema.nullable();
|
|
6601
7308
|
}
|
|
6602
7309
|
const values = field.options.map((option) => option.value);
|
|
6603
|
-
const valueSchema =
|
|
7310
|
+
const valueSchema = z6.string().refine((value) => values.includes(value), `${field.label} must be one of: ${values.join(", ")}`);
|
|
6604
7311
|
if (field.multiple) {
|
|
6605
|
-
const arraySchema =
|
|
7312
|
+
const arraySchema = z6.array(valueSchema);
|
|
6606
7313
|
return field.required ? arraySchema : arraySchema.nullable();
|
|
6607
7314
|
}
|
|
6608
7315
|
return field.required ? valueSchema : valueSchema.nullable();
|
|
6609
7316
|
}
|
|
6610
7317
|
function buildReferenceSchema(field) {
|
|
6611
|
-
let schema =
|
|
7318
|
+
let schema = z6.string();
|
|
6612
7319
|
if (field.required) {
|
|
6613
7320
|
schema = schema.min(1, `${field.label} is required`);
|
|
6614
7321
|
}
|
|
@@ -6627,8 +7334,8 @@ function buildRepeaterSchema(field, allowNull, allowIncomplete) {
|
|
|
6627
7334
|
childShape[child.id] = buildFieldSchema(child, allowNull, allowIncomplete);
|
|
6628
7335
|
}
|
|
6629
7336
|
}
|
|
6630
|
-
let schema =
|
|
6631
|
-
let arraySchema =
|
|
7337
|
+
let schema = z6.object(childShape).catchall(z6.unknown()).passthrough();
|
|
7338
|
+
let arraySchema = z6.array(schema);
|
|
6632
7339
|
if (typeof field.minItems === "number") {
|
|
6633
7340
|
arraySchema = arraySchema.min(field.minItems);
|
|
6634
7341
|
}
|
|
@@ -6643,14 +7350,14 @@ function buildGroupSchema(field, allowNull, allowIncomplete) {
|
|
|
6643
7350
|
for (const child of parsed) {
|
|
6644
7351
|
childShape[child.id] = buildFieldSchema(child, allowNull, allowIncomplete);
|
|
6645
7352
|
}
|
|
6646
|
-
return
|
|
7353
|
+
return z6.object(childShape).catchall(z6.unknown()).passthrough();
|
|
6647
7354
|
}
|
|
6648
7355
|
function finalizeSchema(schema, required, allowNull, allowIncomplete = false) {
|
|
6649
7356
|
if (required) {
|
|
6650
7357
|
if (allowIncomplete) {
|
|
6651
|
-
return allowNull ? schema.or(
|
|
7358
|
+
return allowNull ? schema.or(z6.null()).optional() : schema.optional();
|
|
6652
7359
|
}
|
|
6653
|
-
return allowNull ? schema.or(
|
|
7360
|
+
return allowNull ? schema.or(z6.null()) : schema;
|
|
6654
7361
|
}
|
|
6655
7362
|
return allowNull ? schema.optional().nullable() : schema.optional();
|
|
6656
7363
|
}
|
|
@@ -6994,6 +7701,10 @@ var resolveLinkTransform = {
|
|
|
6994
7701
|
const href = link.href.trim();
|
|
6995
7702
|
return href.length > 0 ? href : null;
|
|
6996
7703
|
}
|
|
7704
|
+
if (!kind && typeof link.href === "string") {
|
|
7705
|
+
const href = link.href.trim();
|
|
7706
|
+
return href.length > 0 ? href : null;
|
|
7707
|
+
}
|
|
6997
7708
|
return null;
|
|
6998
7709
|
}
|
|
6999
7710
|
};
|
|
@@ -7705,7 +8416,7 @@ var COLUMN_CLASSES = {
|
|
|
7705
8416
|
"4": "sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4"
|
|
7706
8417
|
};
|
|
7707
8418
|
function formatDateForUrl(isoTimestamp) {
|
|
7708
|
-
return isoTimestamp.split("T")[0];
|
|
8419
|
+
return isoTimestamp.split("T")[0] ?? "";
|
|
7709
8420
|
}
|
|
7710
8421
|
function buildEventUrl(basePath, slug, startsAt) {
|
|
7711
8422
|
const date = formatDateForUrl(startsAt);
|
|
@@ -7890,7 +8601,7 @@ function getContainerClass(layout, columns) {
|
|
|
7890
8601
|
return `grid gap-6 ${COLUMN_CLASSES2[columns] || COLUMN_CLASSES2["3"]}`;
|
|
7891
8602
|
}
|
|
7892
8603
|
function formatDateForUrl2(isoTimestamp) {
|
|
7893
|
-
return isoTimestamp.split("T")[0];
|
|
8604
|
+
return isoTimestamp.split("T")[0] ?? "";
|
|
7894
8605
|
}
|
|
7895
8606
|
function buildEventUrl2(basePath, slug, startsAt) {
|
|
7896
8607
|
const date = formatDateForUrl2(startsAt);
|
|
@@ -8109,7 +8820,7 @@ function extractSegmentsFromPart(part) {
|
|
|
8109
8820
|
if (!part) return [];
|
|
8110
8821
|
const segments = [];
|
|
8111
8822
|
const baseMatch = part.match(/^([^\[]+)/);
|
|
8112
|
-
if (baseMatch) {
|
|
8823
|
+
if (baseMatch && baseMatch[1]) {
|
|
8113
8824
|
segments.push(baseMatch[1]);
|
|
8114
8825
|
}
|
|
8115
8826
|
const bracketMatches = Array.from(part.matchAll(BRACKET_ACCESS_REGEX));
|
|
@@ -9507,7 +10218,6 @@ function getDefaultInputSettings() {
|
|
|
9507
10218
|
}
|
|
9508
10219
|
|
|
9509
10220
|
export {
|
|
9510
|
-
buildRichTextSchema,
|
|
9511
10221
|
resolveImageUrl,
|
|
9512
10222
|
getDefaultComponentRegistry,
|
|
9513
10223
|
makeDefaultBlockComponent,
|
|
@@ -9541,4 +10251,4 @@ chroma-js/src/utils/contrastAPCA.js:
|
|
|
9541
10251
|
* https://readtech.org/ARC/
|
|
9542
10252
|
*)
|
|
9543
10253
|
*/
|
|
9544
|
-
//# sourceMappingURL=chunk-
|
|
10254
|
+
//# sourceMappingURL=chunk-LNOUXALA.mjs.map
|