@riverbankcms/sdk 0.4.2 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (180) hide show
  1. package/README.md +84 -0
  2. package/dist/cli/index.js +3104 -120
  3. package/dist/cli/index.js.map +1 -1
  4. package/dist/client/analytics.js +1 -1
  5. package/dist/client/analytics.js.map +1 -1
  6. package/dist/client/analytics.mjs +1 -1
  7. package/dist/client/analytics.mjs.map +1 -1
  8. package/dist/client/bookings.js +6 -6
  9. package/dist/client/bookings.js.map +1 -1
  10. package/dist/client/bookings.mjs +6 -6
  11. package/dist/client/bookings.mjs.map +1 -1
  12. package/dist/client/client.d.mts +2 -2
  13. package/dist/client/client.d.ts +2 -2
  14. package/dist/client/client.js +1368 -520
  15. package/dist/client/client.js.map +1 -1
  16. package/dist/client/client.mjs +1368 -520
  17. package/dist/client/client.mjs.map +1 -1
  18. package/dist/client/hooks.d.mts +2 -2
  19. package/dist/client/hooks.d.ts +2 -2
  20. package/dist/client/hooks.js +26 -11
  21. package/dist/client/hooks.js.map +1 -1
  22. package/dist/client/hooks.mjs +26 -11
  23. package/dist/client/hooks.mjs.map +1 -1
  24. package/dist/client/rendering/client.js +24 -14
  25. package/dist/client/rendering/client.js.map +1 -1
  26. package/dist/client/rendering/client.mjs +24 -14
  27. package/dist/client/rendering/client.mjs.map +1 -1
  28. package/dist/client/usePage--fGlyrgj.d.mts +6439 -0
  29. package/dist/client/usePage-BTPnCuWC.d.mts +6511 -0
  30. package/dist/client/usePage-BafOS9UT.d.mts +6512 -0
  31. package/dist/client/usePage-Bnx-kA6x.d.mts +6670 -0
  32. package/dist/client/usePage-CE7X5NcN.d.ts +6439 -0
  33. package/dist/client/usePage-DoPI6b8V.d.ts +6511 -0
  34. package/dist/client/usePage-QNWArrVO.d.ts +6670 -0
  35. package/dist/client/usePage-fBgPB6Oq.d.ts +6512 -0
  36. package/dist/server/{Layout-kRv5sU81.d.ts → Layout-B-q2Py4v.d.ts} +4 -4
  37. package/dist/server/{Layout-ByUnm35V.d.mts → Layout-Cc5HUXAH.d.mts} +4 -4
  38. package/dist/server/{chunk-6JBKKV3G.js → chunk-2KCF2DNK.js} +30 -10
  39. package/dist/server/chunk-2KCF2DNK.js.map +1 -0
  40. package/dist/server/{chunk-N3PX76AP.mjs → chunk-4HIRA33Z.mjs} +247 -135
  41. package/dist/server/chunk-4HIRA33Z.mjs.map +1 -0
  42. package/dist/server/chunk-5STV4MWD.js +189 -0
  43. package/dist/server/chunk-5STV4MWD.js.map +1 -0
  44. package/dist/server/{chunk-R5B6IOFQ.js → chunk-6OSNCH4F.js} +247 -135
  45. package/dist/server/chunk-6OSNCH4F.js.map +1 -0
  46. package/dist/server/{chunk-TKMA6D6U.js → chunk-7UPVCT3K.js} +1215 -497
  47. package/dist/server/chunk-7UPVCT3K.js.map +1 -0
  48. package/dist/server/{chunk-7DS4Q3GA.mjs → chunk-AEFWG657.mjs} +3 -3
  49. package/dist/server/chunk-AEFWG657.mjs.map +1 -0
  50. package/dist/server/{chunk-USQF2XTU.mjs → chunk-BYBJA6SP.mjs} +26 -11
  51. package/dist/server/chunk-BYBJA6SP.mjs.map +1 -0
  52. package/dist/server/{chunk-ZEAJW6T3.mjs → chunk-C6FIJC7T.mjs} +4 -3
  53. package/dist/server/chunk-C6FIJC7T.mjs.map +1 -0
  54. package/dist/server/{chunk-TO7FD6TQ.js → chunk-I2D7KOEA.js} +4 -4
  55. package/dist/server/{chunk-TO7FD6TQ.js.map → chunk-I2D7KOEA.js.map} +1 -1
  56. package/dist/server/chunk-KFLZGNPO.mjs +189 -0
  57. package/dist/server/chunk-KFLZGNPO.mjs.map +1 -0
  58. package/dist/server/chunk-L5EA4FXU.mjs +134 -0
  59. package/dist/server/chunk-L5EA4FXU.mjs.map +1 -0
  60. package/dist/server/{chunk-TNRADRPH.mjs → chunk-LNOUXALA.mjs} +1137 -419
  61. package/dist/server/chunk-LNOUXALA.mjs.map +1 -0
  62. package/dist/server/{chunk-SPXMMX3C.mjs → chunk-OSF34JTQ.mjs} +4 -4
  63. package/dist/server/{chunk-SWPHIUVE.js → chunk-P3NNN73G.js} +5 -4
  64. package/dist/server/chunk-P3NNN73G.js.map +1 -0
  65. package/dist/server/{chunk-I6K5REFT.mjs → chunk-P4K63SBZ.mjs} +24 -4
  66. package/dist/server/chunk-P4K63SBZ.mjs.map +1 -0
  67. package/dist/server/{chunk-HOY77YBF.js → chunk-RVDS7VSP.js} +5 -5
  68. package/dist/server/chunk-RVDS7VSP.js.map +1 -0
  69. package/dist/server/{chunk-NW5KHH4A.js → chunk-TT5JWA4X.js} +9 -9
  70. package/dist/server/{chunk-NW5KHH4A.js.map → chunk-TT5JWA4X.js.map} +1 -1
  71. package/dist/server/chunk-VSFQRHYZ.js +134 -0
  72. package/dist/server/chunk-VSFQRHYZ.js.map +1 -0
  73. package/dist/server/{chunk-EGTDJ4PL.js → chunk-YYO3RIFO.js} +26 -11
  74. package/dist/server/chunk-YYO3RIFO.js.map +1 -0
  75. package/dist/server/{chunk-OP2GHK27.mjs → chunk-Z5ZA6Q4D.mjs} +2 -2
  76. package/dist/server/{components-D1Z2mSDr.d.ts → components-CU46ZkAv.d.mts} +20 -75
  77. package/dist/server/{components-CY8jDQjv.d.mts → components-DvozDwRN.d.ts} +20 -75
  78. package/dist/server/components.d.mts +11 -8
  79. package/dist/server/components.d.ts +11 -8
  80. package/dist/server/components.js +5 -4
  81. package/dist/server/components.js.map +1 -1
  82. package/dist/server/components.mjs +4 -3
  83. package/dist/server/config-validation.d.mts +3 -3
  84. package/dist/server/config-validation.d.ts +3 -3
  85. package/dist/server/config-validation.js +9 -5
  86. package/dist/server/config-validation.js.map +1 -1
  87. package/dist/server/config-validation.mjs +8 -4
  88. package/dist/server/config.d.mts +243 -5
  89. package/dist/server/config.d.ts +243 -5
  90. package/dist/server/config.js +72 -5
  91. package/dist/server/config.js.map +1 -1
  92. package/dist/server/config.mjs +72 -5
  93. package/dist/server/config.mjs.map +1 -1
  94. package/dist/server/core-DsNWrl3o.d.mts +44 -0
  95. package/dist/server/core-DsNWrl3o.d.ts +44 -0
  96. package/dist/server/data.d.mts +4 -3
  97. package/dist/server/data.d.ts +4 -3
  98. package/dist/server/data.js +3 -3
  99. package/dist/server/data.mjs +2 -2
  100. package/dist/server/{index-DCIz9Ptv.d.ts → index-CJfMXZQr.d.ts} +2 -1
  101. package/dist/server/{index-DFQwtj3J.d.mts → index-Q7RLMAQ6.d.mts} +2 -1
  102. package/dist/server/index.d.mts +63 -6
  103. package/dist/server/index.d.ts +63 -6
  104. package/dist/server/index.js +91 -2
  105. package/dist/server/index.js.map +1 -1
  106. package/dist/server/index.mjs +90 -1
  107. package/dist/server/index.mjs.map +1 -1
  108. package/dist/server/link-DjxLyC82.d.mts +23 -0
  109. package/dist/server/link-DjxLyC82.d.ts +23 -0
  110. package/dist/server/{loadContent-CWuE8FCx.d.mts → loadContent-DgpSKWqY.d.mts} +4 -4
  111. package/dist/server/{loadContent-DynBuR5f.d.ts → loadContent-GPvUI1bN.d.ts} +4 -4
  112. package/dist/server/{loadPage-B8RmlYgV.d.mts → loadPage-DGnIK7s4.d.mts} +17 -47
  113. package/dist/server/loadPage-DNQTTRHL.mjs +11 -0
  114. package/dist/server/{loadPage-BTkKpizX.d.ts → loadPage-DW9WB-u9.d.ts} +17 -47
  115. package/dist/server/loadPage-IDGVDFBB.js +11 -0
  116. package/dist/server/{loadPage-DUHBXDEW.js.map → loadPage-IDGVDFBB.js.map} +1 -1
  117. package/dist/server/metadata.d.mts +6 -4
  118. package/dist/server/metadata.d.ts +6 -4
  119. package/dist/server/navigation.d.mts +199 -29
  120. package/dist/server/navigation.d.ts +199 -29
  121. package/dist/server/navigation.js +27 -43
  122. package/dist/server/navigation.js.map +1 -1
  123. package/dist/server/navigation.mjs +20 -36
  124. package/dist/server/navigation.mjs.map +1 -1
  125. package/dist/server/rendering/server.d.mts +8 -6
  126. package/dist/server/rendering/server.d.ts +8 -6
  127. package/dist/server/rendering/server.js +7 -6
  128. package/dist/server/rendering/server.js.map +1 -1
  129. package/dist/server/rendering/server.mjs +6 -5
  130. package/dist/server/rendering.d.mts +14 -10
  131. package/dist/server/rendering.d.ts +14 -10
  132. package/dist/server/rendering.js +9 -8
  133. package/dist/server/rendering.js.map +1 -1
  134. package/dist/server/rendering.mjs +8 -7
  135. package/dist/server/richTextSchema-DURiozvD.d.mts +62 -0
  136. package/dist/server/richTextSchema-DURiozvD.d.ts +62 -0
  137. package/dist/server/routing.d.mts +178 -11
  138. package/dist/server/routing.d.ts +178 -11
  139. package/dist/server/routing.js +95 -2
  140. package/dist/server/routing.js.map +1 -1
  141. package/dist/server/routing.mjs +94 -1
  142. package/dist/server/routing.mjs.map +1 -1
  143. package/dist/server/{schema-Bpy9N5ZI.d.ts → schema-Z6-afHJG.d.mts} +1 -1
  144. package/dist/server/{schema-Bpy9N5ZI.d.mts → schema-Z6-afHJG.d.ts} +1 -1
  145. package/dist/server/server.d.mts +9 -7
  146. package/dist/server/server.d.ts +9 -7
  147. package/dist/server/server.js +6 -6
  148. package/dist/server/server.mjs +5 -5
  149. package/dist/server/theme-bridge.js +8 -8
  150. package/dist/server/theme-bridge.mjs +2 -2
  151. package/dist/server/{types-oCM-fw4O.d.ts → types-0f4PIlgx.d.mts} +55 -2
  152. package/dist/server/{types-txWsSxN7.d.mts → types-BjgZt8xJ.d.mts} +63 -2
  153. package/dist/server/{types-BiRZnxDx.d.ts → types-C28kMfa1.d.ts} +256 -82
  154. package/dist/server/{types-CL916r6x.d.ts → types-DLBhEPSt.d.ts} +63 -2
  155. package/dist/server/{types-CdrJqlKx.d.mts → types-DuzJZKJI.d.mts} +256 -82
  156. package/dist/server/{types-DkKEctWn.d.mts → types-kOQyCFXO.d.ts} +55 -2
  157. package/dist/server/{validation-DzvDwwRo.d.mts → validation-BGuRo8P1.d.mts} +18 -5
  158. package/dist/server/{validation-CoU8uAiu.d.ts → validation-DU2YE7u5.d.ts} +18 -5
  159. package/package.json +5 -3
  160. package/dist/server/chunk-6JBKKV3G.js.map +0 -1
  161. package/dist/server/chunk-7BOIO2S7.mjs +0 -833
  162. package/dist/server/chunk-7BOIO2S7.mjs.map +0 -1
  163. package/dist/server/chunk-7DS4Q3GA.mjs.map +0 -1
  164. package/dist/server/chunk-BLKVTULP.js +0 -833
  165. package/dist/server/chunk-BLKVTULP.js.map +0 -1
  166. package/dist/server/chunk-EGTDJ4PL.js.map +0 -1
  167. package/dist/server/chunk-HOY77YBF.js.map +0 -1
  168. package/dist/server/chunk-I6K5REFT.mjs.map +0 -1
  169. package/dist/server/chunk-N3PX76AP.mjs.map +0 -1
  170. package/dist/server/chunk-R5B6IOFQ.js.map +0 -1
  171. package/dist/server/chunk-SWPHIUVE.js.map +0 -1
  172. package/dist/server/chunk-TKMA6D6U.js.map +0 -1
  173. package/dist/server/chunk-TNRADRPH.mjs.map +0 -1
  174. package/dist/server/chunk-USQF2XTU.mjs.map +0 -1
  175. package/dist/server/chunk-ZEAJW6T3.mjs.map +0 -1
  176. package/dist/server/loadPage-DUHBXDEW.js +0 -11
  177. package/dist/server/loadPage-LYVKY3WZ.mjs +0 -11
  178. /package/dist/server/{chunk-SPXMMX3C.mjs.map → chunk-OSF34JTQ.mjs.map} +0 -0
  179. /package/dist/server/{chunk-OP2GHK27.mjs.map → chunk-Z5ZA6Q4D.mjs.map} +0 -0
  180. /package/dist/server/{loadPage-LYVKY3WZ.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-USQF2XTU.mjs";
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) {
@@ -75,7 +75,14 @@ function getDirectImageUrl(supabaseUrl, storagePath, storageBucket = "media", op
75
75
 
76
76
  // ../blocks/src/system/runtime/nodes/media.tsx
77
77
  import { jsx } from "react/jsx-runtime";
78
+ var _contextSupabaseUrl;
79
+ function setContextSupabaseUrl(url) {
80
+ _contextSupabaseUrl = url?.replace(/\/$/, "");
81
+ }
78
82
  function getSupabaseUrl() {
83
+ if (_contextSupabaseUrl) {
84
+ return _contextSupabaseUrl;
85
+ }
79
86
  const url = process.env.NEXT_PUBLIC_SUPABASE_URL;
80
87
  if (!url) {
81
88
  throw new Error(
@@ -648,8 +655,8 @@ function getLabWhitePoint() {
648
655
  var lab2rgb = (...args) => {
649
656
  args = unpack_default(args, "lab");
650
657
  const [L, a, b] = args;
651
- const [x, y, z5] = lab2xyz(L, a, b);
652
- const [r2, g, b_] = xyz2rgb(x, y, z5);
658
+ const [x, y, z7] = lab2xyz(L, a, b);
659
+ const [r2, g, b_] = xyz2rgb(x, y, z7);
653
660
  return [r2, g, b_, args.length > 3 ? args[3] : 1];
654
661
  };
655
662
  var lab2xyz = (L, a, b) => {
@@ -664,15 +671,15 @@ var lab2xyz = (L, a, b) => {
664
671
  const zr = fz3 > kE ? fz3 : (116 * fz - 16) / kK;
665
672
  const x = xr * Xn;
666
673
  const y = yr * Yn;
667
- const z5 = zr * Zn;
668
- return [x, y, z5];
674
+ const z7 = zr * Zn;
675
+ return [x, y, z7];
669
676
  };
670
677
  var compand = (linear) => {
671
678
  const sign = Math.sign(linear);
672
679
  linear = Math.abs(linear);
673
680
  return (linear <= 31308e-7 ? linear * 12.92 : 1.055 * Math.pow(linear, 1 / 2.4) - 0.055) * sign;
674
681
  };
675
- var xyz2rgb = (x, y, z5) => {
682
+ var xyz2rgb = (x, y, z7) => {
676
683
  const { MtxAdaptMa, MtxAdaptMaI, MtxXYZ2RGB, RefWhiteRGB, Xn, Yn, Zn } = lab_constants_default;
677
684
  const As = Xn * MtxAdaptMa.m00 + Yn * MtxAdaptMa.m10 + Zn * MtxAdaptMa.m20;
678
685
  const Bs = Xn * MtxAdaptMa.m01 + Yn * MtxAdaptMa.m11 + Zn * MtxAdaptMa.m21;
@@ -680,9 +687,9 @@ var xyz2rgb = (x, y, z5) => {
680
687
  const Ad = RefWhiteRGB.X * MtxAdaptMa.m00 + RefWhiteRGB.Y * MtxAdaptMa.m10 + RefWhiteRGB.Z * MtxAdaptMa.m20;
681
688
  const Bd = RefWhiteRGB.X * MtxAdaptMa.m01 + RefWhiteRGB.Y * MtxAdaptMa.m11 + RefWhiteRGB.Z * MtxAdaptMa.m21;
682
689
  const Cd = RefWhiteRGB.X * MtxAdaptMa.m02 + RefWhiteRGB.Y * MtxAdaptMa.m12 + RefWhiteRGB.Z * MtxAdaptMa.m22;
683
- const X1 = (x * MtxAdaptMa.m00 + y * MtxAdaptMa.m10 + z5 * MtxAdaptMa.m20) * (Ad / As);
684
- const Y1 = (x * MtxAdaptMa.m01 + y * MtxAdaptMa.m11 + z5 * MtxAdaptMa.m21) * (Bd / Bs);
685
- const Z1 = (x * MtxAdaptMa.m02 + y * MtxAdaptMa.m12 + z5 * MtxAdaptMa.m22) * (Cd / Cs);
690
+ const X1 = (x * MtxAdaptMa.m00 + y * MtxAdaptMa.m10 + z7 * MtxAdaptMa.m20) * (Ad / As);
691
+ const Y1 = (x * MtxAdaptMa.m01 + y * MtxAdaptMa.m11 + z7 * MtxAdaptMa.m21) * (Bd / Bs);
692
+ const Z1 = (x * MtxAdaptMa.m02 + y * MtxAdaptMa.m12 + z7 * MtxAdaptMa.m22) * (Cd / Cs);
686
693
  const X2 = X1 * MtxAdaptMaI.m00 + Y1 * MtxAdaptMaI.m10 + Z1 * MtxAdaptMaI.m20;
687
694
  const Y2 = X1 * MtxAdaptMaI.m01 + Y1 * MtxAdaptMaI.m11 + Z1 * MtxAdaptMaI.m21;
688
695
  const Z2 = X1 * MtxAdaptMaI.m02 + Y1 * MtxAdaptMaI.m12 + Z1 * MtxAdaptMaI.m22;
@@ -702,15 +709,15 @@ var lab2rgb_default = lab2rgb;
702
709
  // ../../node_modules/.pnpm/chroma-js@3.1.2/node_modules/chroma-js/src/io/lab/rgb2lab.js
703
710
  var rgb2lab = (...args) => {
704
711
  const [r2, g, b, ...rest] = unpack_default(args, "rgb");
705
- const [x, y, z5] = rgb2xyz(r2, g, b);
706
- const [L, a, b_] = xyz2lab(x, y, z5);
712
+ const [x, y, z7] = rgb2xyz(r2, g, b);
713
+ const [L, a, b_] = xyz2lab(x, y, z7);
707
714
  return [L, a, b_, ...rest.length > 0 && rest[0] < 1 ? [rest[0]] : []];
708
715
  };
709
- function xyz2lab(x, y, z5) {
716
+ function xyz2lab(x, y, z7) {
710
717
  const { Xn, Yn, Zn, kE, kK } = lab_constants_default;
711
718
  const xr = x / Xn;
712
719
  const yr = y / Yn;
713
- const zr = z5 / Zn;
720
+ const zr = z7 / Zn;
714
721
  const fx = xr > kE ? Math.pow(xr, 1 / 3) : (kK * xr + 16) / 116;
715
722
  const fy = yr > kE ? Math.pow(yr, 1 / 3) : (kK * yr + 16) / 116;
716
723
  const fz = zr > kE ? Math.pow(zr, 1 / 3) : (kK * zr + 16) / 116;
@@ -729,20 +736,20 @@ var rgb2xyz = (r2, g, b) => {
729
736
  const { MtxRGB2XYZ, MtxAdaptMa, MtxAdaptMaI, Xn, Yn, Zn, As, Bs, Cs } = lab_constants_default;
730
737
  let x = r2 * MtxRGB2XYZ.m00 + g * MtxRGB2XYZ.m10 + b * MtxRGB2XYZ.m20;
731
738
  let y = r2 * MtxRGB2XYZ.m01 + g * MtxRGB2XYZ.m11 + b * MtxRGB2XYZ.m21;
732
- let z5 = r2 * MtxRGB2XYZ.m02 + g * MtxRGB2XYZ.m12 + b * MtxRGB2XYZ.m22;
739
+ let z7 = r2 * MtxRGB2XYZ.m02 + g * MtxRGB2XYZ.m12 + b * MtxRGB2XYZ.m22;
733
740
  const Ad = Xn * MtxAdaptMa.m00 + Yn * MtxAdaptMa.m10 + Zn * MtxAdaptMa.m20;
734
741
  const Bd = Xn * MtxAdaptMa.m01 + Yn * MtxAdaptMa.m11 + Zn * MtxAdaptMa.m21;
735
742
  const Cd = Xn * MtxAdaptMa.m02 + Yn * MtxAdaptMa.m12 + Zn * MtxAdaptMa.m22;
736
- let X = x * MtxAdaptMa.m00 + y * MtxAdaptMa.m10 + z5 * MtxAdaptMa.m20;
737
- let Y = x * MtxAdaptMa.m01 + y * MtxAdaptMa.m11 + z5 * MtxAdaptMa.m21;
738
- let Z = x * MtxAdaptMa.m02 + y * MtxAdaptMa.m12 + z5 * MtxAdaptMa.m22;
743
+ let X = x * MtxAdaptMa.m00 + y * MtxAdaptMa.m10 + z7 * MtxAdaptMa.m20;
744
+ let Y = x * MtxAdaptMa.m01 + y * MtxAdaptMa.m11 + z7 * MtxAdaptMa.m21;
745
+ let Z = x * MtxAdaptMa.m02 + y * MtxAdaptMa.m12 + z7 * MtxAdaptMa.m22;
739
746
  X *= Ad / As;
740
747
  Y *= Bd / Bs;
741
748
  Z *= Cd / Cs;
742
749
  x = X * MtxAdaptMaI.m00 + Y * MtxAdaptMaI.m10 + Z * MtxAdaptMaI.m20;
743
750
  y = X * MtxAdaptMaI.m01 + Y * MtxAdaptMaI.m11 + Z * MtxAdaptMaI.m21;
744
- z5 = X * MtxAdaptMaI.m02 + Y * MtxAdaptMaI.m12 + Z * MtxAdaptMaI.m22;
745
- return [x, y, z5];
751
+ z7 = X * MtxAdaptMaI.m02 + Y * MtxAdaptMaI.m12 + Z * MtxAdaptMaI.m22;
752
+ return [x, y, z7];
746
753
  };
747
754
  var rgb2lab_default = rgb2lab;
748
755
 
@@ -3071,7 +3078,7 @@ function generateShades(hexColor, name) {
3071
3078
  900: 0.1,
3072
3079
  950: 0.05
3073
3080
  };
3074
- const lightness = lightnessMap[shadeNumber];
3081
+ const lightness = lightnessMap[shadeNumber] ?? 0.5;
3075
3082
  const shadeColor = base.luminance(lightness).hex();
3076
3083
  return {
3077
3084
  name: shadeName,
@@ -3142,7 +3149,7 @@ function expandPalette(palette) {
3142
3149
  if (base.text) expanded.body = base.text;
3143
3150
  const isDark = base.background ? isBackgroundDark(base.background) : false;
3144
3151
  const isDarkMode = palette.meta?.mode === "dark" || isDark;
3145
- expanded.mutedText = isDarkMode ? expanded["neutral-600"] : expanded["neutral-500"];
3152
+ expanded.mutedText = isDarkMode ? expanded["neutral-600"] ?? "#666" : expanded["neutral-500"] ?? "#888";
3146
3153
  return expanded;
3147
3154
  }
3148
3155
 
@@ -3210,6 +3217,83 @@ function generateShadowCssVars(theme) {
3210
3217
  };
3211
3218
  }
3212
3219
 
3220
+ // ../blocks/src/theme/tokens/resolver.ts
3221
+ var TokenResolver = class {
3222
+ constructor(theme) {
3223
+ this.theme = theme;
3224
+ }
3225
+ /**
3226
+ * Resolve a color token to a CSS variable reference wrapped in rgb()
3227
+ *
3228
+ * @param token - Token name (e.g., 'primary-500', 'white', 'text-900')
3229
+ * @returns CSS rgb() function with var reference (e.g., 'rgb(var(--tb-primary-500))')
3230
+ *
3231
+ * Note: CSS variables are stored as RGB channels (e.g., "37 99 235") following Tailwind convention,
3232
+ * so we must wrap them with rgb() to create a valid color value.
3233
+ *
3234
+ * @example
3235
+ * resolver.getColor('primary-500') // => 'rgb(var(--tb-primary-500))'
3236
+ * resolver.getColor('white') // => 'rgb(var(--tb-white))'
3237
+ */
3238
+ getColor(token) {
3239
+ if (!this.tokenExists(token)) {
3240
+ console.warn(
3241
+ `[TokenResolver] Color token "${token}" not found in theme palette. Button may render incorrectly.`
3242
+ );
3243
+ }
3244
+ return `rgb(var(--tb-${token}))`;
3245
+ }
3246
+ /**
3247
+ * Adjust a color token's shade by a given amount
3248
+ *
3249
+ * @param token - Base token (e.g., 'primary-500')
3250
+ * @param amount - Shade adjustment (+100 = darker, -100 = lighter)
3251
+ * @returns Adjusted token name (e.g., 'primary-600')
3252
+ *
3253
+ * @example
3254
+ * resolver.adjustShade('primary-500', 100) // => 'primary-600' (darker)
3255
+ * resolver.adjustShade('primary-500', -100) // => 'primary-400' (lighter)
3256
+ */
3257
+ adjustShade(token, amount) {
3258
+ const parts = token.split("-");
3259
+ if (parts.length < 2) {
3260
+ const newShade2 = Math.max(100, Math.min(900, 500 + amount));
3261
+ return `${token}-${newShade2}`;
3262
+ }
3263
+ const base = parts.slice(0, -1).join("-");
3264
+ const shade = parseInt(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
+
3213
3297
  // ../blocks/src/theme/buttons/effects/presets/background.ts
3214
3298
  var darkenBackgroundEffect = {
3215
3299
  id: "darken-background",
@@ -3217,6 +3301,7 @@ var darkenBackgroundEffect = {
3217
3301
  description: "Darkens the background color on hover",
3218
3302
  category: "background",
3219
3303
  pseudoElement: "none",
3304
+ applicableTo: ["button"],
3220
3305
  customizableOption: {
3221
3306
  name: "amount",
3222
3307
  type: "number",
@@ -3248,6 +3333,7 @@ var lightenBackgroundEffect = {
3248
3333
  description: "Lightens the background color on hover",
3249
3334
  category: "background",
3250
3335
  pseudoElement: "none",
3336
+ applicableTo: ["button"],
3251
3337
  customizableOption: {
3252
3338
  name: "amount",
3253
3339
  type: "number",
@@ -3279,6 +3365,7 @@ var fadeBackgroundEffect = {
3279
3365
  description: "Reduces background opacity on hover",
3280
3366
  category: "background",
3281
3367
  pseudoElement: "none",
3368
+ applicableTo: ["button", "nav-link"],
3282
3369
  customizableOption: {
3283
3370
  name: "opacity",
3284
3371
  type: "percentage",
@@ -3301,6 +3388,7 @@ var opacityReduceEffect = {
3301
3388
  description: "Reduces button opacity on hover by a percentage",
3302
3389
  category: "background",
3303
3390
  pseudoElement: "none",
3391
+ applicableTo: ["button", "nav-link"],
3304
3392
  customizableOption: {
3305
3393
  name: "reduction",
3306
3394
  type: "percentage",
@@ -3324,6 +3412,7 @@ var animatedGradientEffect = {
3324
3412
  description: "Animates gradient position on hover",
3325
3413
  category: "background",
3326
3414
  pseudoElement: "none",
3415
+ applicableTo: ["button"],
3327
3416
  customizableOption: {
3328
3417
  name: "direction",
3329
3418
  type: "select",
@@ -3363,6 +3452,7 @@ var backgroundOnHoverEffect = {
3363
3452
  description: "Adds background color on hover",
3364
3453
  category: "background",
3365
3454
  pseudoElement: "none",
3455
+ applicableTo: ["button", "nav-link"],
3366
3456
  customizableOption: {
3367
3457
  name: "colorToken",
3368
3458
  type: "select",
@@ -3388,6 +3478,7 @@ var backgroundOnHoverAlphaEffect = {
3388
3478
  description: "Adds semi-transparent background on hover",
3389
3479
  category: "background",
3390
3480
  pseudoElement: "none",
3481
+ applicableTo: ["button", "nav-link"],
3391
3482
  customizableOption: {
3392
3483
  name: "opacity",
3393
3484
  type: "percentage",
@@ -3409,6 +3500,33 @@ var backgroundOnHoverAlphaEffect = {
3409
3500
  }
3410
3501
  };
3411
3502
 
3503
+ // ../blocks/src/theme/buttons/effects/cssUtils.ts
3504
+ var STATE_SELECTORS = {
3505
+ hover: ':hover, [data-force-hover="true"]',
3506
+ active: ":active",
3507
+ focus: ":focus-visible",
3508
+ base: ""
3509
+ };
3510
+ function getStateSelector(themeId, variantId, state) {
3511
+ const stateSelector = STATE_SELECTORS[state];
3512
+ if (state === "base") {
3513
+ return `:where([data-theme-scope="${themeId}"]) .${variantId}`;
3514
+ }
3515
+ if (state === "hover") {
3516
+ return `:where([data-theme-scope="${themeId}"]) .${variantId}:hover,
3517
+ :where([data-theme-scope="${themeId}"]) .${variantId}[data-force-hover="true"]`;
3518
+ }
3519
+ return `:where([data-theme-scope="${themeId}"]) .${variantId}${stateSelector}`;
3520
+ }
3521
+ function generateStateCSS(themeId, variantId, state, cssProperties) {
3522
+ const selector = getStateSelector(themeId, variantId, state);
3523
+ return `
3524
+ ${selector} {
3525
+ ${cssProperties}
3526
+ }
3527
+ `;
3528
+ }
3529
+
3412
3530
  // ../blocks/src/theme/buttons/effects/presets/shadow.ts
3413
3531
  var borderGlowEffect = {
3414
3532
  id: "border-glow",
@@ -3416,6 +3534,7 @@ var borderGlowEffect = {
3416
3534
  description: "Adds a glowing shadow on hover",
3417
3535
  category: "shadow",
3418
3536
  pseudoElement: "none",
3537
+ applicableTo: ["button", "nav-link"],
3419
3538
  customizableOption: {
3420
3539
  name: "glowColorToken",
3421
3540
  type: "colorToken",
@@ -3426,11 +3545,7 @@ var borderGlowEffect = {
3426
3545
  const { themeId, variantId, options, tokens } = ctx;
3427
3546
  const glowToken = options.glowColorToken || "primary-400";
3428
3547
  const glowColor = tokens.getColor(glowToken);
3429
- return `
3430
- :where([data-theme-scope="${themeId}"]) .${variantId}:hover {
3431
- box-shadow: 0 0 15px ${glowColor};
3432
- }
3433
- `;
3548
+ return generateStateCSS(themeId, variantId, "hover", `box-shadow: 0 0 15px ${glowColor};`);
3434
3549
  }
3435
3550
  };
3436
3551
  var dropShadowEffect = {
@@ -3439,6 +3554,7 @@ var dropShadowEffect = {
3439
3554
  description: "Adds an elevated shadow on hover",
3440
3555
  category: "shadow",
3441
3556
  pseudoElement: "none",
3557
+ applicableTo: ["button"],
3442
3558
  customizableOption: {
3443
3559
  name: "intensity",
3444
3560
  type: "select",
@@ -3454,11 +3570,7 @@ var dropShadowEffect = {
3454
3570
  medium: "0 10px 15px rgba(0, 0, 0, 0.15)",
3455
3571
  strong: "0 20px 25px rgba(0, 0, 0, 0.2)"
3456
3572
  };
3457
- return `
3458
- :where([data-theme-scope="${themeId}"]) .${variantId}:hover {
3459
- box-shadow: ${shadows[intensity]};
3460
- }
3461
- `;
3573
+ return generateStateCSS(themeId, variantId, "hover", `box-shadow: ${shadows[intensity]};`);
3462
3574
  }
3463
3575
  };
3464
3576
  var innerShadowEffect = {
@@ -3467,6 +3579,7 @@ var innerShadowEffect = {
3467
3579
  description: "Adds an inset shadow for a pressed appearance",
3468
3580
  category: "shadow",
3469
3581
  pseudoElement: "none",
3582
+ applicableTo: ["button"],
3470
3583
  generateCSS: (ctx) => {
3471
3584
  const { themeId, variantId } = ctx;
3472
3585
  return `
@@ -3482,6 +3595,7 @@ var neumorphicShadowEffect = {
3482
3595
  description: "Dual shadows for soft UI design (raised or pressed)",
3483
3596
  category: "shadow",
3484
3597
  pseudoElement: "none",
3598
+ applicableTo: ["button", "nav-link"],
3485
3599
  customizableOption: {
3486
3600
  name: "mode",
3487
3601
  type: "select",
@@ -3524,6 +3638,7 @@ var outerGlowEffect = {
3524
3638
  description: "Creates an outer glow around the button",
3525
3639
  category: "shadow",
3526
3640
  pseudoElement: "none",
3641
+ applicableTo: ["button", "nav-link"],
3527
3642
  customizableOption: {
3528
3643
  name: "spread",
3529
3644
  type: "number",
@@ -3558,6 +3673,7 @@ var retro3DShadowEffect = {
3558
3673
  description: "3D pressed shadow with vertical movement (retro style)",
3559
3674
  category: "shadow",
3560
3675
  pseudoElement: "none",
3676
+ applicableTo: ["button"],
3561
3677
  generateCSS: (ctx) => {
3562
3678
  const { themeId, variantId } = ctx;
3563
3679
  return `
@@ -3590,6 +3706,7 @@ var scaleUpEffect = {
3590
3706
  description: "Slightly enlarges the button on hover",
3591
3707
  category: "transform",
3592
3708
  pseudoElement: "none",
3709
+ applicableTo: ["button", "nav-link"],
3593
3710
  customizableOption: {
3594
3711
  name: "scale",
3595
3712
  type: "select",
@@ -3600,11 +3717,7 @@ var scaleUpEffect = {
3600
3717
  generateCSS: (ctx) => {
3601
3718
  const { themeId, variantId, options } = ctx;
3602
3719
  const scale = options.scale || "1.05";
3603
- return `
3604
- :where([data-theme-scope="${themeId}"]) .${variantId}:hover {
3605
- transform: scale(${scale});
3606
- }
3607
- `;
3720
+ return generateStateCSS(themeId, variantId, "hover", `transform: scale(${scale});`);
3608
3721
  }
3609
3722
  };
3610
3723
  var scaleDownEffect = {
@@ -3613,6 +3726,7 @@ var scaleDownEffect = {
3613
3726
  description: "Slightly shrinks the button when clicked",
3614
3727
  category: "transform",
3615
3728
  pseudoElement: "none",
3729
+ applicableTo: ["button", "nav-link"],
3616
3730
  customizableOption: {
3617
3731
  name: "scale",
3618
3732
  type: "select",
@@ -3636,6 +3750,7 @@ var liftEffect = {
3636
3750
  description: "Lifts the button upward on hover",
3637
3751
  category: "transform",
3638
3752
  pseudoElement: "none",
3753
+ applicableTo: ["button", "nav-link"],
3639
3754
  customizableOption: {
3640
3755
  name: "amount",
3641
3756
  type: "select",
@@ -3646,11 +3761,7 @@ var liftEffect = {
3646
3761
  generateCSS: (ctx) => {
3647
3762
  const { themeId, variantId, options } = ctx;
3648
3763
  const amount = options.amount || "0.5";
3649
- return `
3650
- :where([data-theme-scope="${themeId}"]) .${variantId}:hover {
3651
- transform: translateY(-${amount}rem);
3652
- }
3653
- `;
3764
+ return generateStateCSS(themeId, variantId, "hover", `transform: translateY(-${amount}rem);`);
3654
3765
  }
3655
3766
  };
3656
3767
  var pressDownEffect = {
@@ -3659,6 +3770,7 @@ var pressDownEffect = {
3659
3770
  description: "Translates button to shadow position and removes shadow on hover",
3660
3771
  category: "transform",
3661
3772
  pseudoElement: "none",
3773
+ applicableTo: ["button"],
3662
3774
  generateCSS: (ctx) => {
3663
3775
  const { themeId, variantId, theme } = ctx;
3664
3776
  const shadowConfig = theme.shadow;
@@ -3671,12 +3783,12 @@ var pressDownEffect = {
3671
3783
  const offset = elevationOffsets[shadowConfig.elevation];
3672
3784
  const xOffset = (shadowConfig.position || "bottom") === "bottom-right" ? offset : 0;
3673
3785
  const yOffset = offset;
3674
- return `
3675
- :where([data-theme-scope="${themeId}"]) .${variantId}:hover {
3676
- transform: translate(${xOffset}px, ${yOffset}px);
3677
- box-shadow: none;
3678
- }
3679
- `;
3786
+ return generateStateCSS(
3787
+ themeId,
3788
+ variantId,
3789
+ "hover",
3790
+ `transform: translate(${xOffset}px, ${yOffset}px); box-shadow: none;`
3791
+ );
3680
3792
  }
3681
3793
  };
3682
3794
  var popEffect = {
@@ -3685,6 +3797,7 @@ var popEffect = {
3685
3797
  description: "Scales up and tilts the button on hover for a playful pop effect",
3686
3798
  category: "transform",
3687
3799
  pseudoElement: "none",
3800
+ applicableTo: ["button"],
3688
3801
  customizableOption: {
3689
3802
  name: "intensity",
3690
3803
  type: "select",
@@ -3701,11 +3814,12 @@ var popEffect = {
3701
3814
  dramatic: { scale: 1.08, rotate: 3 }
3702
3815
  };
3703
3816
  const config = intensityConfig[intensity] || intensityConfig.medium;
3704
- return `
3705
- :where([data-theme-scope="${themeId}"]) .${variantId}:hover {
3706
- transform: scale(${config.scale}) rotate(${config.rotate}deg);
3707
- }
3708
- `;
3817
+ return generateStateCSS(
3818
+ themeId,
3819
+ variantId,
3820
+ "hover",
3821
+ `transform: scale(${config.scale}) rotate(${config.rotate}deg);`
3822
+ );
3709
3823
  }
3710
3824
  };
3711
3825
 
@@ -3716,6 +3830,7 @@ var auroraGlowEffect = {
3716
3830
  description: "Blurred gradient glow that appears on hover",
3717
3831
  category: "overlay",
3718
3832
  pseudoElement: "before",
3833
+ applicableTo: ["button"],
3719
3834
  customizableOption: {
3720
3835
  name: "intensity",
3721
3836
  type: "percentage",
@@ -3728,8 +3843,8 @@ var auroraGlowEffect = {
3728
3843
  let toColor;
3729
3844
  if (buttonConfig.background.type === "gradient") {
3730
3845
  const stops = buttonConfig.background.stops;
3731
- fromColor = tokens.getColor(stops[0]);
3732
- toColor = tokens.getColor(stops[stops.length - 1]);
3846
+ fromColor = tokens.getColor(stops[0] ?? "primary-500");
3847
+ toColor = tokens.getColor(stops[stops.length - 1] ?? "primary-300");
3733
3848
  } else if (buttonConfig.background.type === "solid") {
3734
3849
  fromColor = tokens.getColor(buttonConfig.background.colorToken);
3735
3850
  const lighterToken = tokens.adjustShade(buttonConfig.background.colorToken, -200);
@@ -3772,6 +3887,7 @@ var cosmicStardustEffect = {
3772
3887
  description: "Rotating rainbow gradient glow (always visible, intensifies on hover)",
3773
3888
  category: "overlay",
3774
3889
  pseudoElement: "before",
3890
+ applicableTo: ["button"],
3775
3891
  customizableOption: {
3776
3892
  name: "speed",
3777
3893
  type: "select",
@@ -3834,6 +3950,7 @@ var gradientBorderFillEffect = {
3834
3950
  description: "Gradient border that fills on hover using ::before pseudo-element",
3835
3951
  category: "overlay",
3836
3952
  pseudoElement: "before",
3953
+ applicableTo: ["button"],
3837
3954
  customizableOption: {
3838
3955
  name: "borderWidth",
3839
3956
  type: "number",
@@ -3890,6 +4007,7 @@ var animatedGradientBorderFillEffect = {
3890
4007
  description: "Rotating gradient border that fills on hover",
3891
4008
  category: "overlay",
3892
4009
  pseudoElement: "before",
4010
+ applicableTo: ["button"],
3893
4011
  customizableOption: {
3894
4012
  name: "speed",
3895
4013
  type: "select",
@@ -3965,6 +4083,7 @@ var borderBottomGrowEffect = {
3965
4083
  description: "Animated underline that grows on hover",
3966
4084
  category: "overlay",
3967
4085
  pseudoElement: "after",
4086
+ applicableTo: ["button", "nav-link"],
3968
4087
  customizableOption: {
3969
4088
  name: "height",
3970
4089
  type: "number",
@@ -4012,6 +4131,7 @@ var gradientTextEffect = {
4012
4131
  description: "Gradient text using background-clip",
4013
4132
  category: "text",
4014
4133
  pseudoElement: "none",
4134
+ applicableTo: ["button"],
4015
4135
  customizableOption: {
4016
4136
  name: "solidOnHover",
4017
4137
  type: "select",
@@ -4063,6 +4183,7 @@ var textColorChangeEffect = {
4063
4183
  description: "Changes text color on hover",
4064
4184
  category: "text",
4065
4185
  pseudoElement: "none",
4186
+ applicableTo: ["button", "nav-link"],
4066
4187
  customizableOption: {
4067
4188
  name: "hoverColorToken",
4068
4189
  type: "select",
@@ -4090,6 +4211,7 @@ var borderColorChangeEffect = {
4090
4211
  description: "Changes border color on hover",
4091
4212
  category: "border",
4092
4213
  pseudoElement: "none",
4214
+ applicableTo: ["button", "nav-link"],
4093
4215
  customizableOption: {
4094
4216
  name: "hoverColorToken",
4095
4217
  type: "select",
@@ -4115,6 +4237,7 @@ var sketchyBorderEffect = {
4115
4237
  description: "Hand-drawn style with imperfect edges",
4116
4238
  category: "border",
4117
4239
  pseudoElement: "none",
4240
+ applicableTo: ["button"],
4118
4241
  customizableOption: {
4119
4242
  name: "intensity",
4120
4243
  type: "select",
@@ -4162,6 +4285,7 @@ var pulseAnimationEffect = {
4162
4285
  description: "Continuous pulse animation (opacity fade)",
4163
4286
  category: "animation",
4164
4287
  pseudoElement: "none",
4288
+ applicableTo: ["button", "nav-link"],
4165
4289
  customizableOption: {
4166
4290
  name: "speed",
4167
4291
  type: "select",
@@ -4190,6 +4314,138 @@ var pulseAnimationEffect = {
4190
4314
  }
4191
4315
  };
4192
4316
 
4317
+ // ../blocks/src/theme/interactive/effects/nav-underline.ts
4318
+ var navUnderlineEffect = {
4319
+ id: "nav-underline",
4320
+ name: "Nav Underline",
4321
+ description: "Underline that appears or grows on hover",
4322
+ category: "overlay",
4323
+ pseudoElement: "after",
4324
+ applicableTo: ["nav-link"],
4325
+ customizableOption: {
4326
+ name: "style",
4327
+ type: "select",
4328
+ label: "Underline Style",
4329
+ default: "static",
4330
+ options: ["static", "grow"]
4331
+ },
4332
+ generateCSS: (ctx) => {
4333
+ const { themeId, variantId, options, tokens } = ctx;
4334
+ const style = options.style || "static";
4335
+ const colorToken = options.colorToken || "primary";
4336
+ const color = tokens.getColor(colorToken);
4337
+ const height = options.height || 2;
4338
+ if (style === "grow") {
4339
+ return `
4340
+ /* Setup nav link for pseudo-element */
4341
+ :where([data-theme-scope="${themeId}"]) .${variantId} {
4342
+ position: relative;
4343
+ }
4344
+
4345
+ /* Underline using ::after - starts at 0 width */
4346
+ :where([data-theme-scope="${themeId}"]) .${variantId}::after {
4347
+ content: '';
4348
+ position: absolute;
4349
+ bottom: 0;
4350
+ left: 50%;
4351
+ width: 0;
4352
+ height: ${height}px;
4353
+ background: ${color};
4354
+ transform: translateX(-50%);
4355
+ transition: width 200ms ease-in-out;
4356
+ }
4357
+
4358
+ /* Grow underline on hover */
4359
+ :where([data-theme-scope="${themeId}"]) .${variantId}:hover::after {
4360
+ width: 100%;
4361
+ }
4362
+ `;
4363
+ }
4364
+ return `
4365
+ /* Setup nav link for pseudo-element */
4366
+ :where([data-theme-scope="${themeId}"]) .${variantId} {
4367
+ position: relative;
4368
+ }
4369
+
4370
+ /* Hidden underline using ::after */
4371
+ :where([data-theme-scope="${themeId}"]) .${variantId}::after {
4372
+ content: '';
4373
+ position: absolute;
4374
+ bottom: 0;
4375
+ left: 0;
4376
+ width: 100%;
4377
+ height: ${height}px;
4378
+ background: ${color};
4379
+ opacity: 0;
4380
+ transition: opacity 150ms ease-in-out;
4381
+ }
4382
+
4383
+ /* Show underline on hover */
4384
+ :where([data-theme-scope="${themeId}"]) .${variantId}:hover::after {
4385
+ opacity: 1;
4386
+ }
4387
+ `;
4388
+ }
4389
+ };
4390
+
4391
+ // ../blocks/src/theme/interactive/effects/nav-frosted.ts
4392
+ var navFrostedBaseEffect = {
4393
+ id: "nav-frosted-base",
4394
+ name: "Nav Frosted Base",
4395
+ description: "Base frosted glass styling for nav links",
4396
+ category: "background",
4397
+ pseudoElement: "none",
4398
+ applicableTo: ["nav-link"],
4399
+ generateCSS: (ctx) => {
4400
+ const { themeId, variantId } = ctx;
4401
+ return `
4402
+ /* Frosted glass base state */
4403
+ :where([data-theme-scope="${themeId}"]) .${variantId} {
4404
+ background: rgba(255, 255, 255, 0.05);
4405
+ backdrop-filter: blur(4px);
4406
+ -webkit-backdrop-filter: blur(4px);
4407
+ transition: background 150ms ease, backdrop-filter 150ms ease;
4408
+ }
4409
+ `;
4410
+ }
4411
+ };
4412
+ var navFrostedHoverEffect = {
4413
+ id: "nav-frosted-hover",
4414
+ name: "Nav Frosted Hover",
4415
+ description: "Enhanced frosted glass on hover",
4416
+ category: "background",
4417
+ pseudoElement: "none",
4418
+ applicableTo: ["nav-link"],
4419
+ generateCSS: (ctx) => {
4420
+ const { themeId, variantId } = ctx;
4421
+ return `
4422
+ /* Frosted glass hover state */
4423
+ :where([data-theme-scope="${themeId}"]) .${variantId}:hover {
4424
+ background: rgba(255, 255, 255, 0.1);
4425
+ backdrop-filter: blur(8px);
4426
+ -webkit-backdrop-filter: blur(8px);
4427
+ }
4428
+ `;
4429
+ }
4430
+ };
4431
+ var navFrostedActiveEffect = {
4432
+ id: "nav-frosted-active",
4433
+ name: "Nav Frosted Active",
4434
+ description: "Frosted glass active/pressed state",
4435
+ category: "background",
4436
+ pseudoElement: "none",
4437
+ applicableTo: ["nav-link"],
4438
+ generateCSS: (ctx) => {
4439
+ const { themeId, variantId } = ctx;
4440
+ return `
4441
+ /* Frosted glass active state */
4442
+ :where([data-theme-scope="${themeId}"]) .${variantId}:active {
4443
+ background: rgba(255, 255, 255, 0.15);
4444
+ }
4445
+ `;
4446
+ }
4447
+ };
4448
+
4193
4449
  // ../blocks/src/theme/buttons/effects/registry.ts
4194
4450
  var EFFECT_PRESETS = [
4195
4451
  // Background effects
@@ -4226,88 +4482,65 @@ var EFFECT_PRESETS = [
4226
4482
  borderColorChangeEffect,
4227
4483
  sketchyBorderEffect,
4228
4484
  // Animation effects
4229
- pulseAnimationEffect
4485
+ pulseAnimationEffect,
4486
+ // Nav-link specific effects
4487
+ navUnderlineEffect,
4488
+ navFrostedBaseEffect,
4489
+ navFrostedHoverEffect,
4490
+ navFrostedActiveEffect
4230
4491
  ];
4231
4492
  function getEffectPreset(id) {
4232
4493
  return EFFECT_PRESETS.find((preset) => preset.id === id);
4233
4494
  }
4234
4495
 
4235
- // ../blocks/src/theme/tokens/resolver.ts
4236
- var TokenResolver = class {
4237
- constructor(theme) {
4238
- this.theme = theme;
4239
- }
4240
- /**
4241
- * Resolve a color token to a CSS variable reference wrapped in rgb()
4242
- *
4243
- * @param token - Token name (e.g., 'primary-500', 'white', 'text-900')
4244
- * @returns CSS rgb() function with var reference (e.g., 'rgb(var(--tb-primary-500))')
4245
- *
4246
- * Note: CSS variables are stored as RGB channels (e.g., "37 99 235") following Tailwind convention,
4247
- * so we must wrap them with rgb() to create a valid color value.
4248
- *
4249
- * @example
4250
- * resolver.getColor('primary-500') // => 'rgb(var(--tb-primary-500))'
4251
- * resolver.getColor('white') // => 'rgb(var(--tb-white))'
4252
- */
4253
- getColor(token) {
4254
- if (!this.tokenExists(token)) {
4255
- console.warn(
4256
- `[TokenResolver] Color token "${token}" not found in theme palette. Button may render incorrectly.`
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
4257
4518
  );
4519
+ if (css2) {
4520
+ cssChunks.push(css2);
4521
+ }
4258
4522
  }
4259
- return `rgb(var(--tb-${token}))`;
4260
4523
  }
4261
- /**
4262
- * Adjust a color token's shade by a given amount
4263
- *
4264
- * @param token - Base token (e.g., 'primary-500')
4265
- * @param amount - Shade adjustment (+100 = darker, -100 = lighter)
4266
- * @returns Adjusted token name (e.g., 'primary-600')
4267
- *
4268
- * @example
4269
- * resolver.adjustShade('primary-500', 100) // => 'primary-600' (darker)
4270
- * resolver.adjustShade('primary-500', -100) // => 'primary-400' (lighter)
4271
- */
4272
- adjustShade(token, amount) {
4273
- const parts = token.split("-");
4274
- if (parts.length < 2) {
4275
- const newShade2 = Math.max(100, Math.min(900, 500 + amount));
4276
- return `${token}-${newShade2}`;
4277
- }
4278
- const base = parts.slice(0, -1).join("-");
4279
- const shade = parseInt(parts[parts.length - 1], 10);
4280
- if (isNaN(shade)) {
4281
- console.warn(
4282
- `[TokenResolver] Cannot adjust shade for non-shade token "${token}". Returning original token.`
4283
- );
4284
- return token;
4285
- }
4286
- const newShade = Math.max(100, Math.min(900, shade + amount));
4287
- return `${base}-${newShade}`;
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 "";
4288
4531
  }
4289
- /**
4290
- * Check if a token exists in the theme palette
4291
- *
4292
- * @param token - Token name to check
4293
- * @returns True if token exists in theme
4294
- */
4295
- tokenExists(token) {
4296
- const commonTokens = ["white", "black", "transparent"];
4297
- if (commonTokens.includes(token)) {
4298
- return true;
4299
- }
4300
- const parts = token.split("-");
4301
- if (parts.length >= 2) {
4302
- const lastPart = parts[parts.length - 1];
4303
- const shade = parseInt(lastPart, 10);
4304
- if (!isNaN(shade) && shade >= 100 && shade <= 900 && shade % 100 === 0) {
4305
- return true;
4306
- }
4307
- }
4308
- return true;
4309
- }
4310
- };
4532
+ const ctx = {
4533
+ themeId,
4534
+ variantId,
4535
+ stateGroup,
4536
+ options: effectApp.options || {},
4537
+ buttonConfig: elementConfig,
4538
+ // Effects access .background, .textColorToken, .border
4539
+ tokens,
4540
+ theme
4541
+ };
4542
+ return effectPreset.generateCSS(ctx);
4543
+ }
4311
4544
 
4312
4545
  // ../blocks/src/theme/buttons/constants.ts
4313
4546
  var GRADIENT_DIRECTION_MAP = {
@@ -4366,6 +4599,11 @@ var FONT_SIZE_MAP = {
4366
4599
  "text-xl": "1.25rem",
4367
4600
  "text-2xl": "1.5rem"
4368
4601
  };
4602
+ var BUTTON_PADDING_PRESETS = {
4603
+ compact: "0.375rem 0.75rem",
4604
+ default: "0.5rem 1rem",
4605
+ spacious: "0.75rem 1.5rem"
4606
+ };
4369
4607
 
4370
4608
  // ../blocks/src/theme/buttons/utils/contrast.ts
4371
4609
  function getContrastingTextColorToken(backgroundToken, theme) {
@@ -4375,7 +4613,7 @@ function getContrastingTextColorToken(backgroundToken, theme) {
4375
4613
  }
4376
4614
  if (backgroundToken.startsWith("neutral-")) {
4377
4615
  const match = backgroundToken.match(/neutral-(\d+)/);
4378
- if (match) {
4616
+ if (match?.[1]) {
4379
4617
  const shade = parseInt(match[1], 10);
4380
4618
  return shade >= 500 ? "neutral-50" : "neutral-950";
4381
4619
  }
@@ -4384,16 +4622,6 @@ function getContrastingTextColorToken(backgroundToken, theme) {
4384
4622
  }
4385
4623
 
4386
4624
  // ../blocks/src/theme/buttons/generateDefaultButtonSystem.ts
4387
- var CORNERS_TO_RADIUS_MAP = {
4388
- square: "rounded-none",
4389
- // 0px - sharp corners
4390
- soft: "rounded-md",
4391
- // 6px - subtle rounding
4392
- rounded: "rounded-md",
4393
- // 6px - standard rounded (same as soft for buttons)
4394
- pill: "rounded-full"
4395
- // 9999px - full pill shape
4396
- };
4397
4625
  var BORDER_WIDTH_TO_CLASS_MAP = {
4398
4626
  none: "border-0",
4399
4627
  // 0px
@@ -4405,7 +4633,6 @@ var BORDER_WIDTH_TO_CLASS_MAP = {
4405
4633
  // 4px - clearly thick
4406
4634
  };
4407
4635
  function generateDefaultButtonSystem(theme) {
4408
- const borderRadius = CORNERS_TO_RADIUS_MAP[theme.corners] || "rounded-lg";
4409
4636
  const borderWidthClass = BORDER_WIDTH_TO_CLASS_MAP[theme.border.width] || "border-2";
4410
4637
  const variants = [];
4411
4638
  const primaryVariant = {
@@ -4415,10 +4642,11 @@ function generateDefaultButtonSystem(theme) {
4415
4642
  priority: 1,
4416
4643
  background: {
4417
4644
  type: "solid",
4418
- colorToken: "primary-500"
4645
+ colorToken: "primary"
4419
4646
  },
4420
- textColorToken: getContrastingTextColorToken("primary-500", theme),
4421
- borderRadius,
4647
+ textColorToken: getContrastingTextColorToken("primary", theme),
4648
+ borderRadius: "",
4649
+ // Empty string = inherit from global.cornerStyle
4422
4650
  // Inherits shadow from theme
4423
4651
  effects: {
4424
4652
  hover: [
@@ -4440,7 +4668,8 @@ function generateDefaultButtonSystem(theme) {
4440
4668
  colorToken: "neutral-700"
4441
4669
  },
4442
4670
  textColorToken: getContrastingTextColorToken("neutral-700", theme),
4443
- borderRadius,
4671
+ borderRadius: "",
4672
+ // Empty string = inherit from global.cornerStyle
4444
4673
  // Inherits shadow from theme
4445
4674
  effects: {
4446
4675
  hover: [
@@ -4460,12 +4689,13 @@ function generateDefaultButtonSystem(theme) {
4460
4689
  background: {
4461
4690
  type: "transparent"
4462
4691
  },
4463
- textColorToken: "primary-600",
4464
- borderRadius,
4692
+ textColorToken: "primary",
4693
+ borderRadius: "",
4694
+ // Empty string = inherit from global.cornerStyle
4465
4695
  shadow: { elevation: "none", softness: null, position: "bottom" },
4466
4696
  // Outline buttons typically don't have shadows
4467
4697
  border: {
4468
- colorToken: "primary-500",
4698
+ colorToken: "primary",
4469
4699
  widthClass: borderWidthClass
4470
4700
  },
4471
4701
  effects: {
@@ -4486,8 +4716,9 @@ function generateDefaultButtonSystem(theme) {
4486
4716
  background: {
4487
4717
  type: "transparent"
4488
4718
  },
4489
- textColorToken: "primary-600",
4490
- borderRadius,
4719
+ textColorToken: "primary",
4720
+ borderRadius: "",
4721
+ // Empty string = inherit from global.cornerStyle
4491
4722
  shadow: { elevation: "none", softness: null, position: "bottom" },
4492
4723
  // Ghost buttons have no shadow
4493
4724
  // No border for ghost buttons
@@ -4553,6 +4784,10 @@ function generateButtonCss(options) {
4553
4784
  if (!variant.enabled) continue;
4554
4785
  const baseCSS = generateVariantBaseCSS(variant, buttonSystem.global, themeId, tokens, theme);
4555
4786
  cssChunks.push(baseCSS);
4787
+ const hoverBgCSS = generateHoverBackgroundCSS(variant, buttonSystem.global, themeId, tokens);
4788
+ if (hoverBgCSS) {
4789
+ cssChunks.push(hoverBgCSS);
4790
+ }
4556
4791
  const effectCSS = generateVariantEffectCSS(variant, themeId, tokens, theme);
4557
4792
  if (effectCSS) {
4558
4793
  cssChunks.push(effectCSS);
@@ -4571,7 +4806,7 @@ function generateVariantBaseCSS(variant, global, themeId, tokens, theme) {
4571
4806
  const rules = [];
4572
4807
  const borderWidth = variant.border ? BORDER_WIDTH_MAP[variant.border.widthClass] || "1px" : "0px";
4573
4808
  const hasBorder = borderWidth !== "0px";
4574
- const padding = variant.padding || STRUCTURAL_BASE_STYLES.padding;
4809
+ const padding = variant.padding || (global.paddingPreset ? BUTTON_PADDING_PRESETS[global.paddingPreset] : null) || STRUCTURAL_BASE_STYLES.padding;
4575
4810
  const paddingParts = padding.split(" ");
4576
4811
  const verticalPadding = paddingParts[0] || "0.5rem";
4577
4812
  const horizontalPadding = paddingParts[1] || paddingParts[0] || "1rem";
@@ -4584,6 +4819,15 @@ function generateVariantBaseCSS(variant, global, themeId, tokens, theme) {
4584
4819
  rules.push(`padding: ${padding};`);
4585
4820
  }
4586
4821
  rules.push(`font-weight: ${global.fontWeight};`);
4822
+ if (global.typography === "heading") {
4823
+ rules.push(`font-family: var(--font-heading);`);
4824
+ rules.push(`letter-spacing: var(--ls-heading);`);
4825
+ } else {
4826
+ rules.push(`font-family: var(--font-body);`);
4827
+ }
4828
+ if (global.italic) {
4829
+ rules.push(`font-style: italic;`);
4830
+ }
4587
4831
  if (variant.fontSize) {
4588
4832
  const fontSize = FONT_SIZE_MAP[variant.fontSize] || "1rem";
4589
4833
  rules.push(`font-size: ${fontSize};`);
@@ -4597,16 +4841,16 @@ function generateVariantBaseCSS(variant, global, themeId, tokens, theme) {
4597
4841
  rules.push(`align-items: ${STRUCTURAL_BASE_STYLES.alignItems};`);
4598
4842
  rules.push(`justify-content: ${STRUCTURAL_BASE_STYLES.justifyContent};`);
4599
4843
  let borderRadius;
4600
- if (variant.borderRadius) {
4601
- borderRadius = BORDER_RADIUS_MAP[variant.borderRadius] || BORDER_RADIUS_MAP["rounded"];
4844
+ if (variant.borderRadius && variant.borderRadius !== "") {
4845
+ borderRadius = BORDER_RADIUS_MAP[variant.borderRadius] ?? BORDER_RADIUS_MAP["rounded"] ?? "0.375rem";
4602
4846
  } else {
4603
4847
  const cornerStyleMap = {
4604
4848
  "square": "rounded-none",
4605
4849
  "rounded": "rounded-md",
4606
4850
  "pill": "rounded-full"
4607
4851
  };
4608
- const fallbackRadius = cornerStyleMap[global.cornerStyle] || "rounded-md";
4609
- borderRadius = BORDER_RADIUS_MAP[fallbackRadius] || BORDER_RADIUS_MAP["rounded"];
4852
+ const fallbackRadius = cornerStyleMap[global.cornerStyle] ?? "rounded-md";
4853
+ borderRadius = BORDER_RADIUS_MAP[fallbackRadius] ?? BORDER_RADIUS_MAP["rounded"] ?? "0.375rem";
4610
4854
  }
4611
4855
  rules.push(`border-radius: ${borderRadius};`);
4612
4856
  const shadowConfig = variant.shadow || shadowSizeToShadow(global.shadow, theme) || theme.shadow;
@@ -4642,31 +4886,33 @@ ${selector} {
4642
4886
  }
4643
4887
  function generateVariantEffectCSS(variant, themeId, tokens, theme) {
4644
4888
  if (!variant.effects) return "";
4645
- const cssChunks = [];
4646
- for (const [stateGroup, effectApps] of Object.entries(variant.effects)) {
4647
- if (!effectApps || effectApps.length === 0) continue;
4648
- for (const effectApp of effectApps) {
4649
- const effectPreset = getEffectPreset(effectApp.effectId);
4650
- if (!effectPreset) {
4651
- console.warn(`[generateVariantEffectCSS] Unknown effect: ${effectApp.effectId}`);
4652
- continue;
4653
- }
4654
- const ctx = {
4655
- themeId,
4656
- variantId: variant.id,
4657
- stateGroup,
4658
- options: effectApp.options || {},
4659
- buttonConfig: variant,
4660
- tokens,
4661
- theme
4662
- };
4663
- const css2 = effectPreset.generateCSS(ctx);
4664
- if (css2) {
4665
- cssChunks.push(css2);
4666
- }
4667
- }
4889
+ const elementConfig = {
4890
+ background: variant.background,
4891
+ textColorToken: variant.textColorToken,
4892
+ border: variant.border ? { colorToken: variant.border.colorToken } : void 0
4893
+ };
4894
+ return generateEffectsCSS({
4895
+ themeId,
4896
+ variantId: variant.id,
4897
+ effects: variant.effects,
4898
+ elementConfig,
4899
+ tokens,
4900
+ theme
4901
+ });
4902
+ }
4903
+ function generateHoverBackgroundCSS(variant, global, themeId, tokens) {
4904
+ let hoverToken = variant.hoverBackgroundToken;
4905
+ if (!hoverToken && global.hoverColor === "token" && global.hoverColorToken) {
4906
+ hoverToken = global.hoverColorToken;
4668
4907
  }
4669
- return cssChunks.join("\n\n");
4908
+ if (!hoverToken) return null;
4909
+ const selector = `:where([data-theme-scope="${themeId}"]) .${variant.id}:hover`;
4910
+ const hoverBgColor = tokens.getColor(hoverToken);
4911
+ return `
4912
+ ${selector} {
4913
+ background-color: ${hoverBgColor};
4914
+ }
4915
+ `.trim();
4670
4916
  }
4671
4917
  function generateDisabledCSS(variant, themeId) {
4672
4918
  const selector = `:where([data-theme-scope="${themeId}"]) .${variant.id}:disabled`;
@@ -5559,6 +5805,345 @@ function generateDefaultInputSystem(theme) {
5559
5805
  };
5560
5806
  }
5561
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
+
5562
6147
  // ../blocks/src/theme/header/generateHeaderCss.ts
5563
6148
  function generateHeaderCss(options) {
5564
6149
  const { themeId, theme } = options;
@@ -5566,10 +6151,8 @@ function generateHeaderCss(options) {
5566
6151
  const header = theme.header;
5567
6152
  const cssChunks = [];
5568
6153
  cssChunks.push(generateHeaderRootStyles(header, themeId, tokens, theme));
5569
- if (header.logo) {
5570
- cssChunks.push(generateLogoStyles(header.logo, themeId, tokens));
5571
- }
5572
- cssChunks.push(generateNavLinkStyles(header, themeId, tokens));
6154
+ cssChunks.push(generateLogoStyles(header.logo, themeId, tokens, header.textColor));
6155
+ cssChunks.push(generateNavLinkStyles(header, themeId, tokens, theme));
5573
6156
  if (header.variant === "floating" && header.container) {
5574
6157
  cssChunks.push(generateFloatingContainerStyles(header.container, themeId, tokens));
5575
6158
  }
@@ -5625,32 +6208,36 @@ ${selector} {
5625
6208
  }
5626
6209
  `;
5627
6210
  }
5628
- function generateLogoStyles(logo, themeId, tokens) {
5629
- if (!logo) return "";
6211
+ function generateLogoStyles(logo, themeId, tokens, textColor) {
5630
6212
  const selector = `:where([data-theme-scope="${themeId}"]) .header-logo-text`;
5631
6213
  const rules = [];
5632
6214
  const primaryColor = tokens.getColor("primary");
5633
6215
  const accentColor = tokens.getColor("accent");
5634
- if (logo.fontFamily === "mono") {
5635
- rules.push(`font-family: ui-monospace, monospace;`);
5636
- } else if (logo.fontFamily === "serif") {
5637
- rules.push(`font-family: ui-serif, serif;`);
5638
- }
5639
- if (logo.letterSpacing && logo.letterSpacing !== "normal") {
5640
- const spacingMap = {
5641
- "normal": "0em",
5642
- "wide": "0.05em",
5643
- "wider": "0.1em",
5644
- "widest": "0.15em"
5645
- };
5646
- rules.push(`letter-spacing: ${spacingMap[logo.letterSpacing]};`);
5647
- }
5648
- if (logo.gradient) {
5649
- rules.push(`background: linear-gradient(to right, ${primaryColor}, ${accentColor});`);
5650
- rules.push(`-webkit-background-clip: text;`);
5651
- rules.push(`-webkit-text-fill-color: transparent;`);
5652
- rules.push(`background-clip: text;`);
5653
- rules.push(`color: transparent;`);
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
+ }
5654
6241
  }
5655
6242
  if (rules.length === 0) return "";
5656
6243
  return `
@@ -5659,129 +6246,82 @@ ${selector} {
5659
6246
  }
5660
6247
  `;
5661
6248
  }
5662
- function generateNavLinkStyles(header, themeId, tokens) {
5663
- const selector = `:where([data-theme-scope="${themeId}"]) .header-nav-link`;
5664
- const hoverSelector = `${selector}:hover`;
5665
- const activeSelector = `${selector}[data-active="true"]`;
5666
- const cssChunks = [];
5667
- const baseRules = [];
5668
- const hoverRules = [];
5669
- const activeRules = [];
5670
- const navContainerType = header.navContainer?.type ?? "none";
5671
- const usesGlassNavContainer = navContainerType === "glass";
5672
- const navColorToken = header.navColor?.trim();
5673
- const primaryColor = tokens.getColor("primary");
5674
- const navWeight = header.navWeight ?? "medium";
5675
- const navWeightMap = {
5676
- regular: 400,
5677
- medium: 500,
5678
- semibold: 600,
5679
- bold: 700
5680
- };
5681
- if (navColorToken) {
5682
- baseRules.push(`color: ${tokens.getColor(navColorToken)};`);
5683
- }
5684
- if (navWeight) {
5685
- baseRules.push(`font-weight: ${navWeightMap[navWeight]};`);
5686
- }
5687
- if (navWeight === "bold" && header.navStyle === "solid") {
5688
- baseRules.push(`text-transform: uppercase;`);
5689
- }
5690
- switch (header.navStyle) {
5691
- case "minimal":
5692
- baseRules.push(`transition: color 200ms ease;`);
5693
- hoverRules.push(`color: ${primaryColor};`);
5694
- activeRules.push(`color: ${primaryColor};`);
5695
- break;
5696
- case "underline":
5697
- baseRules.push(`transition: all 200ms ease;`);
5698
- hoverRules.push(`text-decoration: underline;`);
5699
- hoverRules.push(`text-underline-offset: 4px;`);
5700
- activeRules.push(`text-decoration: underline;`);
5701
- activeRules.push(`text-underline-offset: 4px;`);
5702
- break;
5703
- case "underline-grow":
5704
- baseRules.push(`position: relative;`);
5705
- baseRules.push(`transition: color 200ms ease;`);
5706
- hoverRules.push(`color: ${primaryColor};`);
5707
- activeRules.push(`color: ${primaryColor};`);
5708
- cssChunks.push(generateUnderlineGrowCSS(themeId));
5709
- break;
5710
- case "capsule":
5711
- baseRules.push(`border-radius: 9999px;`);
5712
- baseRules.push(`transition: background-color 200ms ease;`);
5713
- hoverRules.push(`background-color: color-mix(in srgb, ${primaryColor} 10%, transparent);`);
5714
- activeRules.push(`background-color: color-mix(in srgb, ${primaryColor} 15%, transparent);`);
5715
- break;
5716
- case "solid":
5717
- baseRules.push(`border-radius: 0;`);
5718
- baseRules.push(`transition: background-color 200ms ease, color 200ms ease;`);
5719
- hoverRules.push(`background-color: ${primaryColor};`);
5720
- if (navColorToken) {
5721
- hoverRules.push(`color: ${tokens.getColor(navColorToken)};`);
5722
- }
5723
- activeRules.push(`background-color: ${primaryColor};`);
5724
- if (navColorToken) {
5725
- activeRules.push(`color: ${tokens.getColor(navColorToken)};`);
5726
- }
5727
- break;
5728
- case "scale":
5729
- baseRules.push(`transition: all 200ms ease;`);
5730
- hoverRules.push(`transform: scale(1.05);`);
5731
- break;
5732
- case "frosted":
5733
- baseRules.push(`border-radius: 0.5rem;`);
5734
- baseRules.push(`background-color: rgb(255 255 255 / 0.1);`);
5735
- baseRules.push(`backdrop-filter: blur(8px);`);
5736
- baseRules.push(`transition: background-color 200ms ease;`);
5737
- hoverRules.push(`background-color: rgb(255 255 255 / 0.2);`);
5738
- activeRules.push(`background-color: rgb(255 255 255 / 0.25);`);
5739
- break;
6249
+ function generateNavLinkStyles(header, themeId, tokens, theme) {
6250
+ if (header.navLinkStyle) {
6251
+ return generateNavLinkCSS({
6252
+ themeId,
6253
+ tokens,
6254
+ theme,
6255
+ style: header.navLinkStyle,
6256
+ className: "header-nav-link"
6257
+ });
5740
6258
  }
5741
- if (usesGlassNavContainer && header.navStyle === "minimal") {
5742
- baseRules.push(`border-radius: 9999px;`);
5743
- hoverRules.push(`background-color: rgba(255, 255, 255, 0.1);`);
5744
- activeRules.push(`background-color: rgba(255, 255, 255, 0.18);`);
5745
- hoverRules.push(`color: #fff;`);
5746
- activeRules.push(`color: #fff;`);
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";
5747
6273
  }
5748
6274
  if (header.navEffects) {
6275
+ mergedStyle.effects = {
6276
+ ...mergedStyle.effects,
6277
+ hover: [...mergedStyle.effects?.hover || []],
6278
+ active: [...mergedStyle.effects?.active || []]
6279
+ };
5749
6280
  if (header.navEffects.glow) {
5750
- hoverRules.push(`filter: drop-shadow(0 0 5px currentColor);`);
6281
+ mergedStyle.effects.hover.push({
6282
+ effectId: "outer-glow",
6283
+ options: { spread: 5 }
6284
+ });
5751
6285
  }
5752
6286
  if (header.navEffects.neumorphic) {
5753
- console.log("[generateHeaderCss] Generating neumorphic styles for theme:", themeId);
5754
- baseRules.push(`transition: all 200ms ease;`);
5755
- baseRules.push(`border-radius: 0.5rem;`);
5756
- hoverRules.push(`box-shadow: inset 4px 4px 8px #c7c7c7, inset -4px -4px 8px #ffffff;`);
5757
- hoverRules.push(`color: ${primaryColor};`);
6287
+ mergedStyle.effects.hover.push({
6288
+ effectId: "neumorphic-shadow",
6289
+ options: { mode: "pressed" }
6290
+ });
6291
+ mergedStyle.effects.hover.push({
6292
+ effectId: "text-color-change",
6293
+ options: { hoverColorToken: "primary" }
6294
+ });
5758
6295
  }
5759
6296
  if (header.navEffects.underlineGradient) {
5760
- cssChunks.push(generateGradientUnderlineCSS(themeId, tokens));
6297
+ mergedStyle.effects.hover.push({
6298
+ effectId: "border-bottom-grow",
6299
+ options: { origin: "center" }
6300
+ });
5761
6301
  }
5762
6302
  }
5763
- if (baseRules.length > 0) {
5764
- cssChunks.push(`
5765
- ${selector} {
5766
- ${baseRules.join("\n ")}
5767
- }
5768
- `);
5769
- }
5770
- if (hoverRules.length > 0) {
5771
- cssChunks.push(`
5772
- ${hoverSelector} {
5773
- ${hoverRules.join("\n ")}
5774
- }
5775
- `);
5776
- }
5777
- if (activeRules.length > 0) {
5778
- cssChunks.push(`
5779
- ${activeSelector} {
5780
- ${activeRules.join("\n ")}
5781
- }
5782
- `);
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
+ };
5783
6317
  }
5784
- return cssChunks.join("");
6318
+ return generateNavLinkCSS({
6319
+ themeId,
6320
+ tokens,
6321
+ theme,
6322
+ style: mergedStyle,
6323
+ className: "header-nav-link"
6324
+ });
5785
6325
  }
5786
6326
  function generateNavContainerStyles(header, themeId, tokens) {
5787
6327
  const navContainer = header.navContainer;
@@ -5818,52 +6358,6 @@ function generateNavContainerStyles(header, themeId, tokens) {
5818
6358
  }
5819
6359
  return "";
5820
6360
  }
5821
- function generateGradientUnderlineCSS(themeId, tokens) {
5822
- const selector = `:where([data-theme-scope="${themeId}"]) .header-nav-link`;
5823
- const primaryColor = tokens.getColor("primary");
5824
- const accentColor = tokens.getColor("accent");
5825
- return `
5826
- ${selector}::after {
5827
- content: '';
5828
- position: absolute;
5829
- bottom: 0;
5830
- left: 0;
5831
- width: 100%;
5832
- height: 2px;
5833
- background: linear-gradient(to right, ${primaryColor}, ${accentColor});
5834
- transform: scaleX(0);
5835
- transform-origin: center;
5836
- transition: transform 0.3s ease;
5837
- }
5838
-
5839
- ${selector}:hover::after,
5840
- ${selector}[data-active="true"]::after {
5841
- transform: scaleX(1);
5842
- }
5843
- `.trim();
5844
- }
5845
- function generateUnderlineGrowCSS(themeId) {
5846
- const selector = `:where([data-theme-scope="${themeId}"]) .header-nav-link`;
5847
- return `
5848
- ${selector}::after {
5849
- content: '';
5850
- position: absolute;
5851
- bottom: 0;
5852
- left: 0;
5853
- width: 100%;
5854
- height: 2px;
5855
- background: currentColor;
5856
- transform: scaleX(0);
5857
- transform-origin: center;
5858
- transition: transform 0.3s ease;
5859
- }
5860
-
5861
- ${selector}:hover::after,
5862
- ${selector}[data-active="true"]::after {
5863
- transform: scaleX(1);
5864
- }
5865
- `.trim();
5866
- }
5867
6361
  function generateFloatingContainerStyles(container, themeId, tokens) {
5868
6362
  if (!container) return "";
5869
6363
  const selector = `:where([data-theme-scope="${themeId}"]) .header-floating-container`;
@@ -5920,12 +6414,52 @@ function applyAlpha(color, opacity) {
5920
6414
  const clamped = clampOpacity(opacity, 1);
5921
6415
  if (color.startsWith("rgb(") && color.endsWith(")")) {
5922
6416
  const inner = color.slice(4, -1).trim();
5923
- const channels = inner.includes("/") ? inner.split("/")[0].trim() : inner;
6417
+ const channels = inner.includes("/") ? (inner.split("/")[0] ?? inner).trim() : inner;
5924
6418
  return `rgb(${channels} / ${clamped})`;
5925
6419
  }
5926
6420
  return color;
5927
6421
  }
5928
6422
 
6423
+ // ../blocks/src/theme/footer/generateFooterCss.ts
6424
+ function generateFooterCss(options) {
6425
+ const { themeId, theme } = options;
6426
+ const tokens = new TokenResolver(theme);
6427
+ const footer = theme.footer;
6428
+ const cssChunks = [];
6429
+ cssChunks.push(generateFooterNavLinkStyles(footer, themeId, tokens, theme));
6430
+ return cssChunks.filter(Boolean).join("\n\n");
6431
+ }
6432
+ function generateFooterNavLinkStyles(footer, themeId, tokens, theme) {
6433
+ if (footer.navLinkStyle) {
6434
+ return generateNavLinkCSS({
6435
+ themeId,
6436
+ tokens,
6437
+ theme,
6438
+ style: footer.navLinkStyle,
6439
+ className: "footer-nav-link"
6440
+ });
6441
+ }
6442
+ const navStyle = 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
+
5929
6463
  // ../blocks/src/theme/layout/generateLayoutCss.ts
5930
6464
  function generateLayoutCss(options) {
5931
6465
  const { themeId } = options;
@@ -6079,6 +6613,105 @@ ${root} .step-connector {
6079
6613
  return cssBlocks.join("\n\n");
6080
6614
  }
6081
6615
 
6616
+ // ../blocks/src/theme/typography/generateTypographyCss.ts
6617
+ function generateTypographyCss({ themeId }) {
6618
+ const root = `:where([data-theme-scope="${themeId}"])`;
6619
+ const cssBlocks = [];
6620
+ cssBlocks.push(`/* Base heading styles */
6621
+ ${root} :where(h1, h2, h3, h4, h5, h6) {
6622
+ font-family: var(--font-heading);
6623
+ font-style: var(--fi-heading, normal);
6624
+ text-transform: var(--tt-heading, none);
6625
+ font-variant: var(--fv-heading, normal);
6626
+ margin: 0;
6627
+ }`);
6628
+ cssBlocks.push(`/* Heading level styles with fluid typography */
6629
+ ${root} :where(h1) {
6630
+ font-size: var(--fs-h1-fluid, var(--fs-h1));
6631
+ font-weight: var(--fw-h1, var(--font-weight-heading));
6632
+ font-style: var(--fi-h1, var(--fi-heading, normal));
6633
+ letter-spacing: var(--ls-h1, var(--ls-heading));
6634
+ line-height: var(--lh-h1, var(--lh-heading));
6635
+ }
6636
+
6637
+ ${root} :where(h2) {
6638
+ font-size: var(--fs-h2-fluid, var(--fs-h2));
6639
+ font-weight: var(--fw-h2, var(--font-weight-heading));
6640
+ font-style: var(--fi-h2, var(--fi-heading, normal));
6641
+ letter-spacing: var(--ls-h2, var(--ls-heading));
6642
+ line-height: var(--lh-h2, var(--lh-heading));
6643
+ }
6644
+
6645
+ ${root} :where(h3) {
6646
+ font-size: var(--fs-h3-fluid, var(--fs-h3));
6647
+ font-weight: var(--fw-h3, var(--font-weight-heading));
6648
+ font-style: var(--fi-h3, var(--fi-heading, normal));
6649
+ letter-spacing: var(--ls-h3, var(--ls-heading));
6650
+ line-height: var(--lh-h3, var(--lh-heading));
6651
+ }
6652
+
6653
+ ${root} :where(h4) {
6654
+ font-size: var(--fs-h4-fluid, var(--fs-h4, var(--fs-h3)));
6655
+ font-weight: var(--fw-h4, var(--font-weight-heading));
6656
+ font-style: var(--fi-h4, var(--fi-heading, normal));
6657
+ letter-spacing: var(--ls-h4, var(--ls-heading));
6658
+ line-height: var(--lh-h4, var(--lh-heading));
6659
+ }
6660
+
6661
+ ${root} :where(h5) {
6662
+ font-size: var(--fs-h5-fluid, var(--fs-h5, var(--fs-body)));
6663
+ font-weight: var(--fw-h5, var(--font-weight-heading));
6664
+ font-style: var(--fi-h5, var(--fi-heading, normal));
6665
+ letter-spacing: var(--ls-h5, var(--ls-heading));
6666
+ line-height: var(--lh-h5, var(--lh-heading));
6667
+ }
6668
+
6669
+ ${root} :where(h6) {
6670
+ font-size: var(--fs-h6-fluid, var(--fs-h6, var(--fs-body)));
6671
+ font-weight: var(--fw-h6, var(--font-weight-heading));
6672
+ font-style: var(--fi-h6, var(--fi-heading, normal));
6673
+ letter-spacing: var(--ls-h6, var(--ls-heading));
6674
+ line-height: var(--lh-h6, var(--lh-heading));
6675
+ }`);
6676
+ cssBlocks.push(`/* Display variant for hero/splash headings */
6677
+ ${root} :where(.heading-display) {
6678
+ font-size: var(--fs-display-fluid, var(--fs-display));
6679
+ }
6680
+
6681
+ ${root} :where(h1.heading-display) {
6682
+ font-size: var(--fs-h1-display-fluid, var(--fs-h1-display, calc(var(--fs-h1) * 1.5)));
6683
+ }
6684
+
6685
+ ${root} :where(h2.heading-display) {
6686
+ font-size: var(--fs-h2-display-fluid, var(--fs-h2-display, calc(var(--fs-h2) * 1.35)));
6687
+ }`);
6688
+ cssBlocks.push(`/* Compact variant for cards/sidebars */
6689
+ ${root} :where(.heading-compact) {
6690
+ font-size: var(--fs-compact);
6691
+ }
6692
+
6693
+ ${root} :where(h1.heading-compact) {
6694
+ font-size: calc(var(--fs-h1) * 0.75);
6695
+ }
6696
+
6697
+ ${root} :where(h2.heading-compact) {
6698
+ font-size: calc(var(--fs-h2) * 0.8);
6699
+ }
6700
+
6701
+ ${root} :where(h3.heading-compact) {
6702
+ font-size: calc(var(--fs-h3) * 0.85);
6703
+ }`);
6704
+ cssBlocks.push(`/* Body text base styles */
6705
+ ${root} :where(p, li, td, th, label, span) {
6706
+ font-family: var(--font-body);
6707
+ font-weight: var(--font-weight-body);
6708
+ font-size: var(--fs-body);
6709
+ letter-spacing: var(--ls-body);
6710
+ line-height: var(--lh-body);
6711
+ }`);
6712
+ return cssBlocks.join("\n\n");
6713
+ }
6714
+
6082
6715
  // ../blocks/src/system/theme/tokens.ts
6083
6716
  var defaultThemeTokens = {
6084
6717
  color: {
@@ -6163,6 +6796,10 @@ function buildThemeRuntime(theme, options) {
6163
6796
  themeId,
6164
6797
  theme
6165
6798
  });
6799
+ const footerCss = generateFooterCss({
6800
+ themeId,
6801
+ theme
6802
+ });
6166
6803
  const cardCss = generateCardCss({
6167
6804
  themeId,
6168
6805
  theme,
@@ -6192,8 +6829,12 @@ function buildThemeRuntime(theme, options) {
6192
6829
  themeId,
6193
6830
  theme
6194
6831
  });
6832
+ const typographyCss = generateTypographyCss({
6833
+ themeId,
6834
+ theme
6835
+ });
6195
6836
  const tokens = buildThemeTokens(hydrated, theme);
6196
- return { hydrated, cssVars, tokens, paletteTokens: hydrated.palette, buttonCss, headerCss, cardCss, accordionCss, inputCss, layoutCss, statusCss, progressCss };
6837
+ return { hydrated, cssVars, tokens, paletteTokens: hydrated.palette, buttonCss, headerCss, footerCss, cardCss, accordionCss, inputCss, layoutCss, statusCss, progressCss, typographyCss };
6197
6838
  }
6198
6839
  function hydrateTheme(theme) {
6199
6840
  return {
@@ -6223,17 +6864,39 @@ function buildThemeCssVars(theme) {
6223
6864
  ...typography.headings.h1.letterSpacing ? { ["--ls-h1"]: mapLetterSpacing(typography.headings.h1.letterSpacing) } : {},
6224
6865
  ...typography.headings.h2.letterSpacing ? { ["--ls-h2"]: mapLetterSpacing(typography.headings.h2.letterSpacing) } : {},
6225
6866
  ...typography.headings.h3.letterSpacing ? { ["--ls-h3"]: mapLetterSpacing(typography.headings.h3.letterSpacing) } : {},
6867
+ ...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) } : {},
6226
6870
  ["--lh-heading"]: mapLineHeight(typography.headings.default.lineHeight),
6227
6871
  ["--lh-body"]: mapLineHeight(typography.body.lineHeight),
6228
6872
  ...typography.headings.h1.lineHeight ? { ["--lh-h1"]: mapLineHeight(typography.headings.h1.lineHeight) } : {},
6229
6873
  ...typography.headings.h2.lineHeight ? { ["--lh-h2"]: mapLineHeight(typography.headings.h2.lineHeight) } : {},
6230
6874
  ...typography.headings.h3.lineHeight ? { ["--lh-h3"]: mapLineHeight(typography.headings.h3.lineHeight) } : {},
6875
+ ...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) } : {},
6231
6878
  ["--tt-heading"]: mapTextTransform(typography.headings.default.case),
6232
6879
  ["--fv-heading"]: mapFontVariant(typography.headings.default.case),
6880
+ ["--fi-heading"]: mapFontStyle(typography.headings.default.italic),
6881
+ // Per-level italic overrides
6882
+ ...typography.headings.h1.italic != null ? { ["--fi-h1"]: mapFontStyle(typography.headings.h1.italic) } : {},
6883
+ ...typography.headings.h2.italic != null ? { ["--fi-h2"]: mapFontStyle(typography.headings.h2.italic) } : {},
6884
+ ...typography.headings.h3.italic != null ? { ["--fi-h3"]: mapFontStyle(typography.headings.h3.italic) } : {},
6885
+ ...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)
6233
6889
  ["--fs-body"]: sized.body,
6234
6890
  ["--fs-h3"]: sized.h3,
6235
6891
  ["--fs-h2"]: sized.h2,
6236
6892
  ["--fs-h1"]: sized.h1,
6893
+ // Fluid font sizes (responsive with clamp)
6894
+ ["--fs-h1-fluid"]: sized.h1Fluid,
6895
+ ["--fs-h2-fluid"]: sized.h2Fluid,
6896
+ ["--fs-h3-fluid"]: sized.h3Fluid,
6897
+ // Display variant (for hero/splash headings)
6898
+ ["--fs-h1-display"]: sized.h1Display,
6899
+ ["--fs-h1-display-fluid"]: sized.h1DisplayFluid,
6237
6900
  ["--shadow-elev"]: mapShadow(shadow.elevation, shadow.softness, shadow.position || "bottom"),
6238
6901
  ["--space-mult"]: mapSpaceMult(space),
6239
6902
  ["--motion-duration"]: mapMotionDuration(motion.level),
@@ -6339,33 +7002,81 @@ function mapMotionEasing(e) {
6339
7002
  gentle: "cubic-bezier(.15,.85,.15,1)"
6340
7003
  }[e];
6341
7004
  }
7005
+ function normalizeScaleName(scale) {
7006
+ const aliasMap = {
7007
+ minorThird: "compact",
7008
+ majorThird: "balanced",
7009
+ perfectFourth: "spacious",
7010
+ compact: "compact",
7011
+ balanced: "balanced",
7012
+ spacious: "spacious"
7013
+ };
7014
+ return aliasMap[scale] ?? "balanced";
7015
+ }
6342
7016
  function computeTypeScale(scale, bodySize) {
6343
7017
  const base = { md: 16, lg: 17, xl: 18 }[bodySize];
6344
- const ratio = { minorThird: 1.2, majorThird: 1.25, perfectFourth: 1.333 }[scale];
7018
+ const normalizedScale = normalizeScaleName(scale);
7019
+ const ratio = { compact: 1.2, balanced: 1.25, spacious: 1.333 }[normalizedScale];
6345
7020
  const h3 = Math.round(base * ratio);
6346
7021
  const h2 = Math.round(h3 * ratio);
6347
7022
  const h1 = Math.round(h2 * ratio);
7023
+ const fluidMin = 0.7;
7024
+ const fluidMax = 1.3;
6348
7025
  return {
7026
+ // Static sizes (fallback)
6349
7027
  ["--fs-body"]: `${base}px`,
6350
7028
  ["--fs-h3"]: `${h3}px`,
6351
7029
  ["--fs-h2"]: `${h2}px`,
6352
- ["--fs-h1"]: `${h1}px`
7030
+ ["--fs-h1"]: `${h1}px`,
7031
+ // Fluid typography min/max values
7032
+ ["--fs-h1-min"]: `${Math.round(h1 * fluidMin)}px`,
7033
+ ["--fs-h1-max"]: `${Math.round(h1 * fluidMax)}px`,
7034
+ ["--fs-h2-min"]: `${Math.round(h2 * fluidMin)}px`,
7035
+ ["--fs-h2-max"]: `${Math.round(h2 * fluidMax)}px`,
7036
+ ["--fs-h3-min"]: `${Math.round(h3 * fluidMin)}px`,
7037
+ ["--fs-h3-max"]: `${Math.round(h3 * fluidMax)}px`,
7038
+ // Fluid clamp values (320px to 1200px viewport range = 880px)
7039
+ ["--fs-h1-fluid"]: `clamp(${Math.round(h1 * fluidMin)}px, calc(${Math.round(h1 * fluidMin)}px + ${Math.round(h1 * (fluidMax - fluidMin))} * ((100vw - 320px) / 880)), ${Math.round(h1 * fluidMax)}px)`,
7040
+ ["--fs-h2-fluid"]: `clamp(${Math.round(h2 * fluidMin)}px, calc(${Math.round(h2 * fluidMin)}px + ${Math.round(h2 * (fluidMax - fluidMin))} * ((100vw - 320px) / 880)), ${Math.round(h2 * fluidMax)}px)`,
7041
+ ["--fs-h3-fluid"]: `clamp(${Math.round(h3 * fluidMin)}px, calc(${Math.round(h3 * fluidMin)}px + ${Math.round(h3 * (fluidMax - fluidMin))} * ((100vw - 320px) / 880)), ${Math.round(h3 * fluidMax)}px)`,
7042
+ // Display variant sizes (1.5x for hero headings)
7043
+ ["--fs-h1-display"]: `${Math.round(h1 * 1.5)}px`,
7044
+ ["--fs-h1-display-fluid"]: `clamp(${Math.round(h1 * fluidMin * 1.5)}px, calc(${Math.round(h1 * fluidMin * 1.5)}px + ${Math.round(h1 * (fluidMax - fluidMin) * 1.5)} * ((100vw - 320px) / 880)), ${Math.round(h1 * fluidMax * 1.5)}px)`
6353
7045
  };
6354
7046
  }
7047
+ var SIZE_SCALE_MAP = {
7048
+ xs: 0.85,
7049
+ sm: 0.925,
7050
+ md: 1,
7051
+ lg: 1.1,
7052
+ xl: 1.2,
7053
+ "2xl": 1.35
7054
+ };
6355
7055
  function applyHeadingSizeOverrides(base, typography) {
6356
7056
  const body = base["--fs-body"];
6357
7057
  const h1Base = parseFloat(base["--fs-h1"].replace("px", ""));
6358
7058
  const h2Base = parseFloat(base["--fs-h2"].replace("px", ""));
6359
7059
  const h3Base = parseFloat(base["--fs-h3"].replace("px", ""));
6360
- const scaleMap = { md: 1, lg: 1.1, xl: 1.2 };
6361
- const h1Scale = typography.headings.h1.size ? scaleMap[typography.headings.h1.size] : 1;
6362
- const h2Scale = typography.headings.h2.size ? scaleMap[typography.headings.h2.size] : 1;
6363
- const h3Scale = typography.headings.h3.size ? scaleMap[typography.headings.h3.size] : 1;
7060
+ const h1Scale = typography.headings.h1.size ? SIZE_SCALE_MAP[typography.headings.h1.size] : 1;
7061
+ const h2Scale = typography.headings.h2.size ? SIZE_SCALE_MAP[typography.headings.h2.size] : 1;
7062
+ const h3Scale = typography.headings.h3.size ? SIZE_SCALE_MAP[typography.headings.h3.size] : 1;
7063
+ const h1 = Math.round(h1Base * h1Scale);
7064
+ const h2 = Math.round(h2Base * h2Scale);
7065
+ const h3 = Math.round(h3Base * h3Scale);
7066
+ const fluidMin = 0.7;
7067
+ const fluidMax = 1.3;
6364
7068
  return {
6365
7069
  body,
6366
- h1: `${Math.round(h1Base * h1Scale)}px`,
6367
- h2: `${Math.round(h2Base * h2Scale)}px`,
6368
- h3: `${Math.round(h3Base * h3Scale)}px`
7070
+ h1: `${h1}px`,
7071
+ h2: `${h2}px`,
7072
+ h3: `${h3}px`,
7073
+ // Fluid versions with size overrides applied
7074
+ h1Fluid: `clamp(${Math.round(h1 * fluidMin)}px, calc(${Math.round(h1 * fluidMin)}px + ${Math.round(h1 * (fluidMax - fluidMin))} * ((100vw - 320px) / 880)), ${Math.round(h1 * fluidMax)}px)`,
7075
+ h2Fluid: `clamp(${Math.round(h2 * fluidMin)}px, calc(${Math.round(h2 * fluidMin)}px + ${Math.round(h2 * (fluidMax - fluidMin))} * ((100vw - 320px) / 880)), ${Math.round(h2 * fluidMax)}px)`,
7076
+ h3Fluid: `clamp(${Math.round(h3 * fluidMin)}px, calc(${Math.round(h3 * fluidMin)}px + ${Math.round(h3 * (fluidMax - fluidMin))} * ((100vw - 320px) / 880)), ${Math.round(h3 * fluidMax)}px)`,
7077
+ // Display variant (1.5x scale for hero headings)
7078
+ h1Display: `${Math.round(h1 * 1.5)}px`,
7079
+ h1DisplayFluid: `clamp(${Math.round(h1 * 1.5 * fluidMin)}px, calc(${Math.round(h1 * 1.5 * fluidMin)}px + ${Math.round(h1 * 1.5 * (fluidMax - fluidMin))} * ((100vw - 320px) / 880)), ${Math.round(h1 * 1.5 * fluidMax)}px)`
6369
7080
  };
6370
7081
  }
6371
7082
  function mapLetterSpacing(s) {
@@ -6382,29 +7093,32 @@ function mapFontVariant(c) {
6382
7093
  if (c === "smallCaps") return "small-caps";
6383
7094
  return "normal";
6384
7095
  }
7096
+ function mapFontStyle(italic) {
7097
+ return italic ? "italic" : "normal";
7098
+ }
6385
7099
 
6386
7100
  // ../blocks/src/PageRenderer.tsx
6387
7101
  import * as React5 from "react";
6388
7102
 
6389
7103
  // ../blocks/src/system/manifest/validation.ts
6390
- import { z as z4 } from "zod";
7104
+ import { z as z6 } from "zod";
6391
7105
 
6392
7106
  // ../blocks/src/system/manifest/richTextSchema.ts
6393
- import { z as z3 } from "zod";
6394
- var TipTapNodeSchema = z3.lazy(
6395
- () => z3.object({
6396
- type: z3.string(),
6397
- content: z3.array(TipTapNodeSchema).optional(),
6398
- text: z3.string().optional(),
6399
- attrs: z3.record(z3.string(), z3.any()).optional(),
6400
- marks: z3.array(z3.any()).optional()
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()
6401
7115
  })
6402
7116
  );
6403
- var RichTextValueSchema = z3.union([
7117
+ var RichTextValueSchema = z5.union([
6404
7118
  // New format: TipTap document directly
6405
7119
  TipTapNodeSchema,
6406
7120
  // Legacy format: wrapped in { doc: {...} }
6407
- z3.object({
7121
+ z5.object({
6408
7122
  doc: TipTapNodeSchema
6409
7123
  })
6410
7124
  ]);
@@ -6439,7 +7153,7 @@ function createManifestValidator(manifestOrFields, options = {}) {
6439
7153
  for (const field of fields) {
6440
7154
  shape[field.id] = buildFieldSchema(field, allowNull, allowIncomplete);
6441
7155
  }
6442
- return z4.object(shape).catchall(z4.unknown()).passthrough();
7156
+ return z6.object(shape).catchall(z6.unknown()).passthrough();
6443
7157
  }
6444
7158
  function buildFieldSchema(field, allowNull, allowIncomplete = false) {
6445
7159
  const required = Boolean(field.required);
@@ -6452,13 +7166,13 @@ function buildFieldSchema(field, allowNull, allowIncomplete = false) {
6452
7166
  schema = buildRichTextSchema2();
6453
7167
  break;
6454
7168
  case "media": {
6455
- const baseMediaSchema = z4.record(z4.string(), z4.unknown());
7169
+ const baseMediaSchema = z6.record(z6.string(), z6.unknown());
6456
7170
  const isRequired = Boolean(field.required);
6457
7171
  schema = isRequired ? baseMediaSchema : baseMediaSchema.nullable();
6458
7172
  break;
6459
7173
  }
6460
7174
  case "boolean":
6461
- schema = z4.boolean();
7175
+ schema = z6.boolean();
6462
7176
  break;
6463
7177
  case "slug":
6464
7178
  schema = buildSlugSchema(field);
@@ -6482,7 +7196,7 @@ function buildFieldSchema(field, allowNull, allowIncomplete = false) {
6482
7196
  schema = buildGroupSchema(field, allowNull, allowIncomplete);
6483
7197
  break;
6484
7198
  default:
6485
- schema = z4.unknown();
7199
+ schema = z6.unknown();
6486
7200
  break;
6487
7201
  }
6488
7202
  return finalizeSchema(schema, required, allowNull, allowIncomplete);
@@ -6492,11 +7206,11 @@ function buildTextSchema(field) {
6492
7206
  const inputType = ui?.inputType;
6493
7207
  let schema;
6494
7208
  if (inputType === "number") {
6495
- schema = z4.coerce.number();
7209
+ schema = z6.coerce.number();
6496
7210
  if (typeof ui?.min === "number") schema = schema.min(ui.min);
6497
7211
  if (typeof ui?.max === "number") schema = schema.max(ui.max);
6498
7212
  } else {
6499
- schema = z4.string();
7213
+ schema = z6.string();
6500
7214
  if (inputType === "email") {
6501
7215
  schema = schema.email(`${field.label} must be a valid email`);
6502
7216
  }
@@ -6526,7 +7240,7 @@ function buildRichTextSchema2() {
6526
7240
  var SLUG_PATTERN = /^(?:[a-z0-9]+(?:-[a-z0-9]+)*)(?:\/(?:[a-z0-9]+(?:-[a-z0-9]+)*))*$/;
6527
7241
  function buildSlugSchema(field) {
6528
7242
  const message = `${field.label} must contain lowercase letters, numbers, and dashes`;
6529
- let schema = z4.string().regex(SLUG_PATTERN, message);
7243
+ let schema = z6.string().regex(SLUG_PATTERN, message);
6530
7244
  if (field.maxLength) {
6531
7245
  schema = schema.max(field.maxLength, `${field.label} must be at most ${field.maxLength} characters`);
6532
7246
  }
@@ -6552,19 +7266,19 @@ function buildUrlSchema(field) {
6552
7266
  return false;
6553
7267
  }
6554
7268
  };
6555
- let schema = z4.string().trim().refine(validate, message);
7269
+ let schema = z6.string().trim().refine(validate, message);
6556
7270
  if (field.required) {
6557
7271
  schema = schema.min(1, `${field.label} is required`);
6558
7272
  }
6559
7273
  return schema;
6560
7274
  }
6561
7275
  function buildLinkSchema() {
6562
- const nullableString = z4.union([z4.string().min(1), z4.null()]);
6563
- const internal = z4.object({
6564
- kind: z4.literal("internal"),
6565
- routeId: z4.string().min(1),
6566
- entityId: z4.string().min(1).optional(),
6567
- entityType: z4.enum(["page", "content"]).optional(),
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(),
6568
7282
  href: nullableString.optional(),
6569
7283
  title: nullableString.optional(),
6570
7284
  typeLabel: nullableString.optional(),
@@ -6572,36 +7286,36 @@ function buildLinkSchema() {
6572
7286
  contentTypeName: nullableString.optional(),
6573
7287
  updatedAt: nullableString.optional()
6574
7288
  }).passthrough();
6575
- const external = z4.object({
6576
- kind: z4.literal("external"),
6577
- href: z4.string().min(1)
7289
+ const external = z6.object({
7290
+ kind: z6.literal("external"),
7291
+ href: z6.string().min(1)
6578
7292
  }).passthrough();
6579
- const custom = z4.object({
6580
- kind: z4.literal("url"),
6581
- href: z4.string().min(1)
7293
+ const custom = z6.object({
7294
+ kind: z6.literal("url"),
7295
+ href: z6.string().min(1)
6582
7296
  }).passthrough();
6583
- return z4.union([internal, external, custom]);
7297
+ return z6.union([internal, external, custom]);
6584
7298
  }
6585
7299
  function buildSelectSchema(field) {
6586
7300
  const ui = field.ui;
6587
7301
  if (ui?.widget === "sdkSelect") {
6588
- const anyStringSchema = z4.string();
7302
+ const anyStringSchema = z6.string();
6589
7303
  if (field.multiple) {
6590
- const arraySchema = z4.array(anyStringSchema);
7304
+ const arraySchema = z6.array(anyStringSchema);
6591
7305
  return field.required ? arraySchema : arraySchema.nullable();
6592
7306
  }
6593
7307
  return field.required ? anyStringSchema : anyStringSchema.nullable();
6594
7308
  }
6595
7309
  const values = field.options.map((option) => option.value);
6596
- const valueSchema = z4.string().refine((value) => values.includes(value), `${field.label} must be one of: ${values.join(", ")}`);
7310
+ const valueSchema = z6.string().refine((value) => values.includes(value), `${field.label} must be one of: ${values.join(", ")}`);
6597
7311
  if (field.multiple) {
6598
- const arraySchema = z4.array(valueSchema);
7312
+ const arraySchema = z6.array(valueSchema);
6599
7313
  return field.required ? arraySchema : arraySchema.nullable();
6600
7314
  }
6601
7315
  return field.required ? valueSchema : valueSchema.nullable();
6602
7316
  }
6603
7317
  function buildReferenceSchema(field) {
6604
- let schema = z4.string();
7318
+ let schema = z6.string();
6605
7319
  if (field.required) {
6606
7320
  schema = schema.min(1, `${field.label} is required`);
6607
7321
  }
@@ -6620,8 +7334,8 @@ function buildRepeaterSchema(field, allowNull, allowIncomplete) {
6620
7334
  childShape[child.id] = buildFieldSchema(child, allowNull, allowIncomplete);
6621
7335
  }
6622
7336
  }
6623
- let schema = z4.object(childShape).catchall(z4.unknown()).passthrough();
6624
- let arraySchema = z4.array(schema);
7337
+ let schema = z6.object(childShape).catchall(z6.unknown()).passthrough();
7338
+ let arraySchema = z6.array(schema);
6625
7339
  if (typeof field.minItems === "number") {
6626
7340
  arraySchema = arraySchema.min(field.minItems);
6627
7341
  }
@@ -6636,14 +7350,14 @@ function buildGroupSchema(field, allowNull, allowIncomplete) {
6636
7350
  for (const child of parsed) {
6637
7351
  childShape[child.id] = buildFieldSchema(child, allowNull, allowIncomplete);
6638
7352
  }
6639
- return z4.object(childShape).catchall(z4.unknown()).passthrough();
7353
+ return z6.object(childShape).catchall(z6.unknown()).passthrough();
6640
7354
  }
6641
7355
  function finalizeSchema(schema, required, allowNull, allowIncomplete = false) {
6642
7356
  if (required) {
6643
7357
  if (allowIncomplete) {
6644
- return allowNull ? schema.or(z4.null()).optional() : schema.optional();
7358
+ return allowNull ? schema.or(z6.null()).optional() : schema.optional();
6645
7359
  }
6646
- return allowNull ? schema.or(z4.null()) : schema;
7360
+ return allowNull ? schema.or(z6.null()) : schema;
6647
7361
  }
6648
7362
  return allowNull ? schema.optional().nullable() : schema.optional();
6649
7363
  }
@@ -6987,6 +7701,10 @@ var resolveLinkTransform = {
6987
7701
  const href = link.href.trim();
6988
7702
  return href.length > 0 ? href : null;
6989
7703
  }
7704
+ if (!kind && typeof link.href === "string") {
7705
+ const href = link.href.trim();
7706
+ return href.length > 0 ? href : null;
7707
+ }
6990
7708
  return null;
6991
7709
  }
6992
7710
  };
@@ -7698,7 +8416,7 @@ var COLUMN_CLASSES = {
7698
8416
  "4": "sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4"
7699
8417
  };
7700
8418
  function formatDateForUrl(isoTimestamp) {
7701
- return isoTimestamp.split("T")[0];
8419
+ return isoTimestamp.split("T")[0] ?? "";
7702
8420
  }
7703
8421
  function buildEventUrl(basePath, slug, startsAt) {
7704
8422
  const date = formatDateForUrl(startsAt);
@@ -7883,7 +8601,7 @@ function getContainerClass(layout, columns) {
7883
8601
  return `grid gap-6 ${COLUMN_CLASSES2[columns] || COLUMN_CLASSES2["3"]}`;
7884
8602
  }
7885
8603
  function formatDateForUrl2(isoTimestamp) {
7886
- return isoTimestamp.split("T")[0];
8604
+ return isoTimestamp.split("T")[0] ?? "";
7887
8605
  }
7888
8606
  function buildEventUrl2(basePath, slug, startsAt) {
7889
8607
  const date = formatDateForUrl2(startsAt);
@@ -8102,7 +8820,7 @@ function extractSegmentsFromPart(part) {
8102
8820
  if (!part) return [];
8103
8821
  const segments = [];
8104
8822
  const baseMatch = part.match(/^([^\[]+)/);
8105
- if (baseMatch) {
8823
+ if (baseMatch && baseMatch[1]) {
8106
8824
  segments.push(baseMatch[1]);
8107
8825
  }
8108
8826
  const bracketMatches = Array.from(part.matchAll(BRACKET_ACCESS_REGEX));
@@ -8732,6 +9450,7 @@ function PageRenderer({
8732
9450
  blockOverrides,
8733
9451
  sdkConfig
8734
9452
  }) {
9453
+ setContextSupabaseUrl(dataContext?.supabaseUrl);
8735
9454
  if (!page || page.blocks.length === 0) {
8736
9455
  return /* @__PURE__ */ jsx21("div", { className: "p-6 text-sm", style: textColorStyle("mutedText"), children: "No blocks found." });
8737
9456
  }
@@ -9499,7 +10218,6 @@ function getDefaultInputSettings() {
9499
10218
  }
9500
10219
 
9501
10220
  export {
9502
- buildRichTextSchema,
9503
10221
  resolveImageUrl,
9504
10222
  getDefaultComponentRegistry,
9505
10223
  makeDefaultBlockComponent,
@@ -9533,4 +10251,4 @@ chroma-js/src/utils/contrastAPCA.js:
9533
10251
  * https://readtech.org/ARC/
9534
10252
  *)
9535
10253
  */
9536
- //# sourceMappingURL=chunk-TNRADRPH.mjs.map
10254
+ //# sourceMappingURL=chunk-LNOUXALA.mjs.map