@sonordev/site-kit 2.7.0 → 2.7.2

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.
@@ -5025,6 +5025,31 @@ function loadSquareSDK2(environment) {
5025
5025
  document.head.appendChild(script);
5026
5026
  });
5027
5027
  }
5028
+ function resolveCssVar(name, fallback) {
5029
+ if (typeof window === "undefined") return fallback;
5030
+ const raw = getComputedStyle(document.documentElement).getPropertyValue(name).trim();
5031
+ if (!raw) return fallback;
5032
+ return normalizeColorForSquare(raw) ?? fallback;
5033
+ }
5034
+ function normalizeColorForSquare(value) {
5035
+ const v = value.trim();
5036
+ if (!v) return null;
5037
+ if (/^#[0-9a-f]{6}$/i.test(v)) return v;
5038
+ const eightDigit = /^(#[0-9a-f]{6})[0-9a-f]{2}$/i.exec(v);
5039
+ if (eightDigit) return eightDigit[1];
5040
+ const threeDigit = /^#([0-9a-f])([0-9a-f])([0-9a-f])$/i.exec(v);
5041
+ if (threeDigit) {
5042
+ const [, r, g, b] = threeDigit;
5043
+ return `#${r}${r}${g}${g}${b}${b}`;
5044
+ }
5045
+ const rgb = /^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i.exec(v);
5046
+ if (rgb) {
5047
+ const [, r, g, b] = rgb;
5048
+ const toHex = (n) => Number(n).toString(16).padStart(2, "0");
5049
+ return `#${toHex(r)}${toHex(g)}${toHex(b)}`;
5050
+ }
5051
+ return null;
5052
+ }
5028
5053
  var SINGLE_TICKET_KEY = "__single__";
5029
5054
  function EventCheckout({
5030
5055
  event,
@@ -5115,11 +5140,11 @@ function EventCheckout({
5115
5140
  const card = await payments.card({
5116
5141
  style: {
5117
5142
  ".input-container": {
5118
- borderColor: "var(--sk-border, #d1d5db)",
5143
+ borderColor: resolveCssVar("--sk-border", "#d1d5db"),
5119
5144
  borderRadius: "6px"
5120
5145
  },
5121
5146
  ".input-container.is-focus": {
5122
- borderColor: "var(--sk-primary, #2563eb)"
5147
+ borderColor: resolveCssVar("--sk-primary", "#2563eb")
5123
5148
  },
5124
5149
  ".input-container.is-error": {
5125
5150
  borderColor: "#dc2626"
@@ -7784,5 +7809,5 @@ exports.registerForEvent = registerForEvent;
7784
7809
  exports.useEventModal = useEventModal;
7785
7810
  exports.validateAddress = validateAddress;
7786
7811
  exports.validateDiscountCode = validateDiscountCode;
7787
- //# sourceMappingURL=chunk-KCA5OLS4.js.map
7788
- //# sourceMappingURL=chunk-KCA5OLS4.js.map
7812
+ //# sourceMappingURL=chunk-5OX347TD.js.map
7813
+ //# sourceMappingURL=chunk-5OX347TD.js.map