@schematichq/schematic-components 2.23.0 → 2.24.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.
@@ -5866,9 +5866,9 @@ function prefixer(element, index, children, callback) {
5866
5866
  var r;
5867
5867
  var i;
5868
5868
  var l = "undefined" != typeof process && void 0 !== process.env && (process.env.REACT_APP_SC_ATTR || process.env.SC_ATTR) || "data-styled";
5869
- var c = "active";
5870
- var a = "data-styled-version";
5871
- var u = "6.5.0";
5869
+ var a = "active";
5870
+ var c = "data-styled-version";
5871
+ var u = "6.5.3";
5872
5872
  var d = "/*!sc*/\n";
5873
5873
  var h = "undefined" != typeof window && "undefined" != typeof document;
5874
5874
  var p = void 0 === t2.createContext;
@@ -6003,10 +6003,10 @@ function ie(e2) {
6003
6003
  return "function" == typeof e2;
6004
6004
  }
6005
6005
  var le = /* @__PURE__ */ Symbol.for("react.forward_ref");
6006
- function ce(e2) {
6006
+ function ae(e2) {
6007
6007
  return null != e2 && ("object" == typeof e2 || "function" == typeof e2) && e2.$$typeof === le && "styledComponentId" in e2;
6008
6008
  }
6009
- function ae(e2, t3) {
6009
+ function ce(e2, t3) {
6010
6010
  return e2 && t3 ? e2 + " " + t3 : e2 || t3 || "";
6011
6011
  }
6012
6012
  function ue(e2, t3) {
@@ -6076,7 +6076,7 @@ var ye = class {
6076
6076
  return t3;
6077
6077
  }
6078
6078
  };
6079
- var ve = `style[${l}][${a}="${u}"]`;
6079
+ var ve = `style[${l}][${c}="${u}"]`;
6080
6080
  var Se = new RegExp(`^${l}\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)`);
6081
6081
  var be = (e2) => "undefined" != typeof ShadowRoot && e2 instanceof ShadowRoot || "host" in e2 && 11 === e2.nodeType;
6082
6082
  var we = (e2) => {
@@ -6110,7 +6110,7 @@ var Pe = (e2) => {
6110
6110
  const t3 = we(e2.options.target).querySelectorAll(ve);
6111
6111
  for (let n2 = 0, o = t3.length; n2 < o; n2++) {
6112
6112
  const o2 = t3[n2];
6113
- o2 && o2.getAttribute(l) !== c && (Ce(e2, o2), o2.parentNode && o2.parentNode.removeChild(o2));
6113
+ o2 && o2.getAttribute(l) !== a && (Ce(e2, o2), o2.parentNode && o2.parentNode.removeChild(o2));
6114
6114
  }
6115
6115
  };
6116
6116
  var Oe = false;
@@ -6129,7 +6129,7 @@ var Ie = (e2, t3) => {
6129
6129
  const t4 = Array.from(e3.querySelectorAll(`style[${l}]`));
6130
6130
  return t4[t4.length - 1];
6131
6131
  })(o), i2 = void 0 !== r2 ? r2.nextSibling : null;
6132
- s.setAttribute(l, c), s.setAttribute(a, u);
6132
+ s.setAttribute(l, a), s.setAttribute(c, u);
6133
6133
  const d2 = t3 || Ee();
6134
6134
  return d2 && s.setAttribute("nonce", d2), o.insertBefore(s, i2), s;
6135
6135
  };
@@ -6210,10 +6210,10 @@ var je = class _je {
6210
6210
  if (void 0 === r2 || !r2.size) continue;
6211
6211
  const i2 = t4.getGroup(s);
6212
6212
  if (0 === i2.length) continue;
6213
- const c2 = l + ".g" + s + '[id="' + n4 + '"]';
6214
- let a2 = "";
6215
- for (const e4 of r2) e4.length > 0 && (a2 += e4 + ",");
6216
- o += i2 + c2 + '{content:"' + a2 + '"}' + d;
6213
+ const a2 = l + ".g" + s + '[id="' + n4 + '"]';
6214
+ let c2 = "";
6215
+ for (const e4 of r2) e4.length > 0 && (c2 += e4 + ",");
6216
+ o += i2 + a2 + '{content:"' + c2 + '"}' + d;
6217
6217
  }
6218
6218
  return o;
6219
6219
  })(this));
@@ -6307,7 +6307,7 @@ function Ye(e2, t3, n2, o, s = []) {
6307
6307
  for (let r3 = 0; r3 < e2.length; r3++) Ye(e2[r3], t3, n2, o, s);
6308
6308
  return s;
6309
6309
  }
6310
- return ce(e2) ? (s.push(`.${e2.styledComponentId}`), s) : Fe(e2) ? (n2 ? (e2.inject(n2, o), s.push(e2.getName(o))) : s.push(e2), s) : Le(e2) ? (qe(e2), s) : pe(e2) ? e2.toString !== Object.prototype.toString ? (s.push(e2.toString()), s) : (He(e2, s), s) : (s.push(e2.toString()), s);
6310
+ return ae(e2) ? (s.push(`.${e2.styledComponentId}`), s) : Fe(e2) ? (n2 ? (e2.inject(n2, o), s.push(e2.getName(o))) : s.push(e2), s) : Le(e2) ? (qe(e2), s) : pe(e2) ? e2.toString !== Object.prototype.toString ? (s.push(e2.toString()), s) : (He(e2, s), s) : (s.push(e2.toString()), s);
6311
6311
  }
6312
6312
  var Ue = z(u);
6313
6313
  var Je = p ? /* @__PURE__ */ new WeakMap() : null;
@@ -6364,7 +6364,7 @@ var Ze = class {
6364
6364
  o2 || (o2 = /* @__PURE__ */ new Map(), Je.set(e5, o2)), o2.set(t4, de(n3));
6365
6365
  })(this, r2, e4), t3.insertRules(this.componentId, r2, e4);
6366
6366
  }
6367
- o = ae(o, r2);
6367
+ o = ce(o, r2);
6368
6368
  }
6369
6369
  }
6370
6370
  return o;
@@ -6379,27 +6379,27 @@ function Qe(e2, t3) {
6379
6379
  function et(e2) {
6380
6380
  const t3 = e2.length;
6381
6381
  let n2 = "", o = 0, s = 0, r2 = 0, i2 = false, l2 = false;
6382
- for (let c2 = 0; c2 < t3; c2++) {
6383
- const a2 = e2.charCodeAt(c2);
6384
- if (0 !== r2 || i2 || a2 !== Me || 42 !== e2.charCodeAt(c2 + 1)) if (i2) 42 === a2 && e2.charCodeAt(c2 + 1) === Me && (i2 = false, c2++);
6385
- else if (34 !== a2 && 39 !== a2 || Qe(e2, c2)) {
6386
- if (0 === r2) if (123 === a2) s++;
6387
- else if (125 === a2) {
6382
+ for (let a2 = 0; a2 < t3; a2++) {
6383
+ const c2 = e2.charCodeAt(a2);
6384
+ if (0 !== r2 || i2 || c2 !== Me || 42 !== e2.charCodeAt(a2 + 1)) if (i2) 42 === c2 && e2.charCodeAt(a2 + 1) === Me && (i2 = false, a2++);
6385
+ else if (34 !== c2 && 39 !== c2 || Qe(e2, a2)) {
6386
+ if (0 === r2) if (123 === c2) s++;
6387
+ else if (125 === c2) {
6388
6388
  if (s--, s < 0) {
6389
6389
  l2 = true;
6390
- let n3 = c2 + 1;
6390
+ let n3 = a2 + 1;
6391
6391
  for (; n3 < t3; ) {
6392
6392
  const t4 = e2.charCodeAt(n3);
6393
6393
  if (59 === t4 || 10 === t4) break;
6394
6394
  n3++;
6395
6395
  }
6396
- n3 < t3 && 59 === e2.charCodeAt(n3) && n3++, s = 0, c2 = n3 - 1, o = n3;
6396
+ n3 < t3 && 59 === e2.charCodeAt(n3) && n3++, s = 0, a2 = n3 - 1, o = n3;
6397
6397
  continue;
6398
6398
  }
6399
- 0 === s && (n2 += e2.substring(o, c2 + 1), o = c2 + 1);
6400
- } else 59 === a2 && 0 === s && (n2 += e2.substring(o, c2 + 1), o = c2 + 1);
6401
- } else 0 === r2 ? r2 = a2 : r2 === a2 && (r2 = 0);
6402
- else i2 = true, c2++;
6399
+ 0 === s && (n2 += e2.substring(o, a2 + 1), o = a2 + 1);
6400
+ } else 59 === c2 && 0 === s && (n2 += e2.substring(o, a2 + 1), o = a2 + 1);
6401
+ } else 0 === r2 ? r2 = c2 : r2 === c2 && (r2 = 0);
6402
+ else i2 = true, a2++;
6403
6403
  }
6404
6404
  return l2 || 0 !== s || 0 !== r2 ? (o < t3 && 0 === s && 0 === r2 && (n2 += e2.substring(o)), n2) : e2;
6405
6405
  }
@@ -6423,35 +6423,35 @@ function nt({ options: e2 = $, plugins: t3 = x } = $) {
6423
6423
  l2.push((e3) => {
6424
6424
  e3.type === RULESET && e3.value.includes("&") && (r2 || (r2 = new RegExp(`\\${s}\\b`, "g")), e3.props[0] = e3.props[0].replace(Ke, s).replace(r2, i2));
6425
6425
  }), e2.prefix && l2.push(prefixer), l2.push(stringify);
6426
- let c2 = [];
6427
- const a2 = middleware(l2.concat(rulesheet((e3) => c2.push(e3)))), u2 = (t4, i3 = "", l3 = "", u3 = "&") => {
6426
+ let a2 = [];
6427
+ const c2 = middleware(l2.concat(rulesheet((e3) => a2.push(e3)))), u2 = (t4, i3 = "", l3 = "", u3 = "&") => {
6428
6428
  n2 = u3, s = i3, r2 = void 0;
6429
6429
  const d3 = (function(e3) {
6430
6430
  const t5 = -1 !== e3.indexOf("//"), n3 = -1 !== e3.indexOf("}");
6431
6431
  if (!t5 && !n3) return e3;
6432
6432
  if (!t5) return et(e3);
6433
6433
  const o = e3.length;
6434
- let s2 = "", r3 = 0, i4 = 0, l4 = 0, c3 = 0, a3 = 0, u4 = false;
6434
+ let s2 = "", r3 = 0, i4 = 0, l4 = 0, a3 = 0, c3 = 0, u4 = false;
6435
6435
  for (; i4 < o; ) {
6436
6436
  const t6 = e3.charCodeAt(i4);
6437
6437
  if (34 !== t6 && 39 !== t6 || Qe(e3, i4)) if (0 === l4) if (t6 === Me && i4 + 1 < o && 42 === e3.charCodeAt(i4 + 1)) {
6438
6438
  for (i4 += 2; i4 + 1 < o && (42 !== e3.charCodeAt(i4) || e3.charCodeAt(i4 + 1) !== Me); ) i4++;
6439
6439
  i4 += 2;
6440
- } else if (40 !== t6) if (41 !== t6) if (c3 > 0) i4++;
6440
+ } else if (40 !== t6) if (41 !== t6) if (a3 > 0) i4++;
6441
6441
  else if (42 === t6 && i4 + 1 < o && e3.charCodeAt(i4 + 1) === Me) s2 += e3.substring(r3, i4), i4 += 2, r3 = i4, u4 = true;
6442
6442
  else if (t6 === Me && i4 + 1 < o && e3.charCodeAt(i4 + 1) === Me) {
6443
6443
  for (s2 += e3.substring(r3, i4); i4 < o && 10 !== e3.charCodeAt(i4); ) i4++;
6444
6444
  r3 = i4, u4 = true;
6445
- } else 123 === t6 ? a3++ : 125 === t6 && a3--, i4++;
6446
- else c3 > 0 && c3--, i4++;
6447
- else c3++, i4++;
6445
+ } else 123 === t6 ? c3++ : 125 === t6 && c3--, i4++;
6446
+ else a3 > 0 && a3--, i4++;
6447
+ else a3++, i4++;
6448
6448
  else i4++;
6449
6449
  else 0 === l4 ? l4 = t6 : l4 === t6 && (l4 = 0), i4++;
6450
6450
  }
6451
- return u4 ? (r3 < o && (s2 += e3.substring(r3)), 0 === a3 ? s2 : et(s2)) : 0 === a3 ? e3 : et(e3);
6451
+ return u4 ? (r3 < o && (s2 += e3.substring(r3)), 0 === c3 ? s2 : et(s2)) : 0 === c3 ? e3 : et(e3);
6452
6452
  })(t4);
6453
6453
  let h3 = compile(l3 || i3 ? l3 + " " + i3 + " { " + d3 + " }" : d3);
6454
- return e2.namespace && (h3 = tt(h3, e2.namespace)), c2 = [], serialize(h3, a2), c2;
6454
+ return e2.namespace && (h3 = tt(h3, e2.namespace)), a2 = [], serialize(h3, c2), a2;
6455
6455
  }, d2 = e2;
6456
6456
  let h2 = G;
6457
6457
  for (let e3 = 0; e3 < t3.length; e3++) t3[e3].name || S(15), h2 = F(h2, t3[e3].name);
@@ -6462,15 +6462,15 @@ var st;
6462
6462
  var rt;
6463
6463
  var it = new je();
6464
6464
  var lt = nt();
6465
- var at = null;
6465
+ var ct = null;
6466
6466
  var dt = p && null !== (rt = null === (st = (ot = t2).cache) || void 0 === st ? void 0 : st.call(ot, () => {
6467
- it.names.clear(), it.keyframeIds.clear(), it.clearTag(), at = null;
6467
+ it.names.clear(), it.keyframeIds.clear(), it.clearTag(), ct = null;
6468
6468
  })) && void 0 !== rt ? rt : null;
6469
6469
  var ht = { shouldForwardProp: void 0, styleSheet: it, stylis: lt, stylisPlugins: void 0 };
6470
6470
  var pt = p ? { Provider: ({ children: e2 }) => e2, Consumer: ({ children: e2 }) => e2(ht) } : t2.createContext(ht);
6471
6471
  var ft = pt.Consumer;
6472
6472
  function mt() {
6473
- return p ? (dt && dt(), at || ht) : t2.useContext(pt);
6473
+ return p ? (dt && dt(), ct || ht) : t2.useContext(pt);
6474
6474
  }
6475
6475
  var yt = p ? { Provider: ({ children: e2 }) => e2, Consumer: ({ children: e2 }) => e2(void 0) } : t2.createContext(void 0);
6476
6476
  var vt = yt.Consumer;
@@ -6511,44 +6511,41 @@ function It(e2, t3, n2) {
6511
6511
  return e2;
6512
6512
  }
6513
6513
  function At(o, s, r2) {
6514
- const i2 = ce(o), c2 = o, a2 = !L(o), { attrs: u2 = x, componentId: h2 = Nt(s.displayName, s.parentComponentId), displayName: f2 = q(o) } = s, m2 = s.displayName && s.componentId ? T(s.displayName) + "-" + s.componentId : s.componentId || h2, g2 = i2 && c2.attrs ? c2.attrs.concat(u2).filter(Boolean) : u2;
6514
+ const i2 = ae(o), a2 = o, c2 = !L(o), { attrs: u2 = x, componentId: h2 = Nt(s.displayName, s.parentComponentId), displayName: f2 = q(o) } = s, m2 = s.displayName && s.componentId ? T(s.displayName) + "-" + s.componentId : s.componentId || h2, g2 = i2 && a2.attrs ? a2.attrs.concat(u2).filter(Boolean) : u2;
6515
6515
  let { shouldForwardProp: y2 } = s;
6516
- if (i2 && c2.shouldForwardProp) {
6517
- const e2 = c2.shouldForwardProp;
6516
+ if (i2 && a2.shouldForwardProp) {
6517
+ const e2 = a2.shouldForwardProp;
6518
6518
  if (s.shouldForwardProp) {
6519
6519
  const t3 = s.shouldForwardProp;
6520
6520
  y2 = (n2, o2) => e2(n2, o2) && t3(n2, o2);
6521
6521
  } else y2 = e2;
6522
6522
  }
6523
- const v2 = new Ze(r2, m2, i2 ? c2.componentStyle : void 0);
6523
+ const v2 = new Ze(r2, m2, i2 ? a2.componentStyle : void 0);
6524
6524
  function S2(o2, s2) {
6525
6525
  return (function(o3, s3, r3) {
6526
- const { attrs: i3, componentStyle: c3, defaultProps: a3, foldedComponentIds: u3, styledComponentId: h3, target: f3 } = o3, m3 = p ? void 0 : t2.useContext(yt), g3 = mt(), y3 = o3.shouldForwardProp || g3.shouldForwardProp;
6526
+ const { attrs: i3, componentStyle: a3, defaultProps: c3, foldedComponentIds: u3, styledComponentId: h3, target: f3 } = o3, m3 = p ? void 0 : t2.useContext(yt), g3 = mt(), y3 = o3.shouldForwardProp || g3.shouldForwardProp;
6527
6527
  t2.useDebugValue && t2.useDebugValue(h3);
6528
- const v3 = R(s3, m3, a3) || (p ? void 0 : $);
6528
+ const v3 = R(s3, m3, c3) || (p ? void 0 : $);
6529
6529
  let S3, b3;
6530
6530
  S3 = (function(e2, t3, n2) {
6531
6531
  const o4 = Object.assign(Object.assign({}, t3), { className: void 0, theme: n2 }), s4 = e2.length > 1;
6532
6532
  for (let n3 = 0; n3 < e2.length; n3++) {
6533
6533
  const r4 = e2[n3], i4 = ie(r4) ? r4(s4 ? Object.assign({}, o4) : o4) : r4;
6534
- for (const e3 in i4) "className" === e3 ? o4.className = ae(o4.className, i4[e3]) : "style" === e3 ? o4.style = Object.assign(Object.assign({}, o4.style), i4[e3]) : e3 in t3 && void 0 === t3[e3] || (o4[e3] = i4[e3]);
6534
+ for (const e3 in i4) "className" === e3 ? o4.className = ce(o4.className, i4[e3]) : "style" === e3 ? o4.style = Object.assign(Object.assign({}, o4.style), i4[e3]) : e3 in t3 && void 0 === t3[e3] || (o4[e3] = i4[e3]);
6535
6535
  }
6536
- return "className" in t3 && "string" == typeof t3.className && (o4.className = ae(o4.className, t3.className)), o4;
6537
- })(i3, s3, v3), b3 = (function(e2, n2, o4, s4) {
6538
- const r4 = e2.generateAndInjectStyles(n2, o4, s4);
6539
- return t2.useDebugValue && t2.useDebugValue(r4), r4;
6540
- })(c3, S3, g3.styleSheet, g3.stylis), o3.warnTooManyClasses && o3.warnTooManyClasses(b3);
6536
+ return "className" in t3 && "string" == typeof t3.className && (o4.className = ce(o4.className, t3.className)), o4;
6537
+ })(i3, s3, v3), b3 = a3.generateAndInjectStyles(S3, g3.styleSheet, g3.stylis), t2.useDebugValue && t2.useDebugValue(b3), o3.warnTooManyClasses && o3.warnTooManyClasses(b3);
6541
6538
  const w2 = S3.as || f3, N2 = (function(t3, n2, o4, s4) {
6542
6539
  const r4 = {};
6543
6540
  for (const i4 in t3) void 0 === t3[i4] || "$" === i4[0] || "as" === i4 || "theme" === i4 && t3.theme === o4 || ("forwardedAs" === i4 ? r4.as = t3.forwardedAs : s4 && !s4(i4, n2) || (r4[i4] = t3[i4], s4 || false || isPropValid(i4) || (Ct || (Ct = /* @__PURE__ */ new Set())).has(i4) || !L(n2) || n2.includes("-") || (Ct.add(i4), console.warn(`styled-components: it looks like an unknown prop "${i4}" is being sent through to the DOM, which will likely trigger a React console error. If you would like automatic filtering of unknown props, you can opt-into that behavior via \`<StyleSheetManager shouldForwardProp={...}>\` (connect an API like \`@emotion/is-prop-valid\`) or consider using transient props (\`$\` prefix for automatic filtering.)`))));
6544
6541
  return r4;
6545
6542
  })(S3, w2, v3, y3);
6546
- let C2 = ae(u3, h3);
6543
+ let C2 = ce(u3, h3);
6547
6544
  b3 && (C2 += " " + b3), S3.className && (C2 += " " + S3.className), N2[L(w2) && w2.includes("-") ? "class" : "className"] = C2, r3 && (N2.ref = r3);
6548
6545
  const O2 = n(w2, N2);
6549
6546
  if (p) {
6550
6547
  const e2 = Pt ? Pt() : null;
6551
- let n2 = null, o4 = 0, s4 = "", r4 = true, i4 = c3;
6548
+ let n2 = null, o4 = 0, s4 = "", r4 = true, i4 = a3;
6552
6549
  for (; i4; ) {
6553
6550
  const t3 = g3.styleSheet.names.get(i4.componentId);
6554
6551
  if (t3) {
@@ -6557,26 +6554,26 @@ function At(o, s, r2) {
6557
6554
  }
6558
6555
  if (n2 && r4) {
6559
6556
  let e3 = Xe(i4, g3.styleSheet);
6560
- null === e3 ? r4 = false : (i4 !== c3 && (e3 = It(e3, i4.componentId, g3.styleSheet)), s4 = e3 + s4);
6557
+ null === e3 ? r4 = false : (i4 !== a3 && (e3 = It(e3, i4.componentId, g3.styleSheet)), s4 = e3 + s4);
6561
6558
  }
6562
6559
  i4 = i4.baseStyle;
6563
6560
  }
6564
6561
  if (n2 && !r4) {
6565
6562
  s4 = "";
6566
6563
  const e3 = g3.styleSheet.getTag();
6567
- let t3 = c3;
6564
+ let t3 = a3;
6568
6565
  for (; t3; ) {
6569
6566
  let n3 = e3.getGroup(P(t3.componentId));
6570
- n3 && t3 !== c3 && (n3 = It(n3, t3.componentId, g3.styleSheet)), s4 = n3 + s4, t3 = t3.baseStyle;
6567
+ n3 && t3 !== a3 && (n3 = It(n3, t3.componentId, g3.styleSheet)), s4 = n3 + s4, t3 = t3.baseStyle;
6571
6568
  }
6572
6569
  }
6573
- let a4 = "";
6570
+ let c4 = "";
6574
6571
  if (g3.styleSheet.keyframeIds.size > 0) {
6575
6572
  const t3 = g3.styleSheet.getTag();
6576
6573
  for (const n3 of g3.styleSheet.keyframeIds) {
6577
6574
  if (e2 && e2.has(n3)) continue;
6578
6575
  const o5 = t3.getGroup(P(n3));
6579
- o5 && (a4 += o5, e2 && e2.add(n3));
6576
+ o5 && (c4 += o5, e2 && e2.add(n3));
6580
6577
  }
6581
6578
  }
6582
6579
  if (s4 && e2 && n2 && n2.length < o4) {
@@ -6594,9 +6591,9 @@ function At(o, s, r2) {
6594
6591
  }
6595
6592
  s4 = t3;
6596
6593
  }
6597
- const u4 = he(a4 + s4);
6594
+ const u4 = he(c4 + s4);
6598
6595
  if (u4) {
6599
- const e3 = t2.createElement("style", { [l]: "", key: "sc-" + c3.componentId, children: u4 });
6596
+ const e3 = t2.createElement("style", { [l]: "", key: "sc-" + a3.componentId, children: u4 });
6600
6597
  return t2.createElement(t2.Fragment, null, e3, O2);
6601
6598
  }
6602
6599
  }
@@ -6605,13 +6602,13 @@ function At(o, s, r2) {
6605
6602
  }
6606
6603
  S2.displayName = f2;
6607
6604
  let b2 = t2.forwardRef(S2);
6608
- return b2.attrs = g2, b2.componentStyle = v2, b2.displayName = f2, b2.shouldForwardProp = y2, b2.foldedComponentIds = i2 ? ae(c2.foldedComponentIds, c2.styledComponentId) : "", b2.styledComponentId = m2, b2.target = i2 ? c2.target : o, Object.defineProperty(b2, "defaultProps", { get() {
6605
+ return b2.attrs = g2, b2.componentStyle = v2, b2.displayName = f2, b2.shouldForwardProp = y2, b2.foldedComponentIds = i2 ? ce(a2.foldedComponentIds, a2.styledComponentId) : "", b2.styledComponentId = m2, b2.target = i2 ? a2.target : o, Object.defineProperty(b2, "defaultProps", { get() {
6609
6606
  return this._foldedDefaultProps;
6610
6607
  }, set(e2) {
6611
6608
  this._foldedDefaultProps = i2 ? (function(e3, ...t3) {
6612
6609
  for (const n2 of t3) fe(e3, n2, true);
6613
6610
  return e3;
6614
- })({}, c2.defaultProps, e2) : e2;
6611
+ })({}, a2.defaultProps, e2) : e2;
6615
6612
  } }), _(f2, m2), b2.warnTooManyClasses = /* @__PURE__ */ ((e2, t3) => {
6616
6613
  let n2 = {}, o2 = false;
6617
6614
  return (s2) => {
@@ -6626,7 +6623,7 @@ Example:
6626
6623
 
6627
6624
  <Component />`), o2 = true, n2 = {});
6628
6625
  };
6629
- })(f2, m2), ge(b2, () => `.${b2.styledComponentId}`), a2 && re(b2, o, { attrs: true, componentStyle: true, displayName: true, foldedComponentIds: true, shouldForwardProp: true, styledComponentId: true, target: true }), b2;
6626
+ })(f2, m2), ge(b2, () => `.${b2.styledComponentId}`), c2 && re(b2, o, { attrs: true, componentStyle: true, displayName: true, foldedComponentIds: true, shouldForwardProp: true, styledComponentId: true, target: true }), b2;
6630
6627
  }
6631
6628
  var _t = /* @__PURE__ */ new Set(["a", "abbr", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "blockquote", "body", "button", "br", "canvas", "caption", "cite", "code", "col", "colgroup", "data", "datalist", "dd", "del", "details", "dfn", "dialog", "div", "dl", "dt", "em", "embed", "fieldset", "figcaption", "figure", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "header", "hgroup", "hr", "html", "i", "iframe", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "menu", "meter", "nav", "object", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "search", "section", "select", "slot", "small", "span", "strong", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "u", "ul", "var", "video", "wbr", "circle", "clipPath", "defs", "ellipse", "feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence", "filter", "foreignObject", "g", "image", "line", "linearGradient", "marker", "mask", "path", "pattern", "polygon", "polyline", "radialGradient", "rect", "stop", "svg", "switch", "symbol", "text", "textPath", "tspan", "use"]);
6632
6629
  function xt(e2, t3) {
@@ -6655,7 +6652,7 @@ var Dt = class {
6655
6652
  this.instanceRules = /* @__PURE__ */ new Map(), this.rules = e2, this.componentId = t3, this.isStatic = (function(e3) {
6656
6653
  for (let t4 = 0; t4 < e3.length; t4 += 1) {
6657
6654
  const n2 = e3[t4];
6658
- if (ie(n2) && !ce(n2)) return false;
6655
+ if (ie(n2) && !ae(n2)) return false;
6659
6656
  }
6660
6657
  return true;
6661
6658
  })(e2), je.registerId(this.componentId);
@@ -6703,27 +6700,27 @@ function Vt(e2, ...n2) {
6703
6700
  _(s);
6704
6701
  const i2 = (e3) => {
6705
6702
  const n3 = mt(), l2 = p ? void 0 : t2.useContext(yt);
6706
- let c2;
6707
- if (c2 = n3.styleSheet.allocateGSInstance(s), t2.Children.count(e3.children) && console.warn(`The global style component ${s} was given child JSX. createGlobalStyle does not render children.`), o.some((e4) => "string" == typeof e4 && -1 !== e4.indexOf("@import")) && console.warn("Please do not use @import CSS syntax in createGlobalStyle at this time, as the CSSOM APIs we use in production do not handle it well. Instead, we recommend using a library such as react-helmet to inject a typical <link> meta tag to the stylesheet, or simply embedding it manually in your index.html <head> section for a simpler app."), (p || n3.styleSheet.server) && (function(e4, t3, n4, o2, s2) {
6703
+ let a2;
6704
+ if (a2 = n3.styleSheet.allocateGSInstance(s), t2.Children.count(e3.children) && console.warn(`The global style component ${s} was given child JSX. createGlobalStyle does not render children.`), o.some((e4) => "string" == typeof e4 && -1 !== e4.indexOf("@import")) && console.warn("Please do not use @import CSS syntax in createGlobalStyle at this time, as the CSSOM APIs we use in production do not handle it well. Instead, we recommend using a library such as react-helmet to inject a typical <link> meta tag to the stylesheet, or simply embedding it manually in your index.html <head> section for a simpler app."), (p || n3.styleSheet.server) && (function(e4, t3, n4, o2, s2) {
6708
6705
  if (r2.isStatic) r2.renderStyles(e4, y, n4, s2);
6709
6706
  else {
6710
6707
  const l3 = Object.assign(Object.assign({}, t3), { theme: R(t3, o2, i2.defaultProps) });
6711
6708
  r2.renderStyles(e4, l3, n4, s2);
6712
6709
  }
6713
- })(c2, e3, n3.styleSheet, l2, n3.stylis), p) {
6714
- const e4 = "undefined" == typeof window ? r2.instanceRules.get(c2) : void 0, o2 = e4 ? de(e4.rules) : "";
6710
+ })(a2, e3, n3.styleSheet, l2, n3.stylis), p) {
6711
+ const e4 = "undefined" == typeof window ? r2.instanceRules.get(a2) : void 0, o2 = e4 ? de(e4.rules) : "";
6715
6712
  if (o2) {
6716
- r2.instanceRules.delete(c2);
6713
+ r2.instanceRules.delete(a2);
6717
6714
  const e5 = Mt ? Mt() : null;
6718
6715
  if (e5) {
6719
6716
  const t3 = r2.isStatic ? s + n3.stylis.hash : o2;
6720
6717
  if (e5.has(t3)) return null;
6721
6718
  e5.add(t3);
6722
6719
  }
6723
- return t2.createElement("style", { key: s + "-" + c2, "data-styled-global": s, children: he(o2) });
6720
+ return t2.createElement("style", { key: s + "-" + a2, "data-styled-global": s, children: he(o2) });
6724
6721
  }
6725
6722
  }
6726
- return r2.instanceRules.delete(c2), null;
6723
+ return r2.instanceRules.delete(a2), null;
6727
6724
  };
6728
6725
  return t2.memo(i2);
6729
6726
  }
@@ -13220,30 +13217,29 @@ function isAutoTopupOff(grant) {
13220
13217
  function isSelfServiceAutoTopupAvailable(grant) {
13221
13218
  return !!grant?.billingCreditAutoTopupSelfService && !isAutoTopupOff(grant);
13222
13219
  }
13223
- function isBundlePurchaseOff(grant) {
13224
- return grant?.billingCreditCanBuyBundles === false;
13225
- }
13226
- function getBundleOffCreditIds(grants) {
13227
- const ids = /* @__PURE__ */ new Set();
13228
- (grants ?? []).forEach((grant) => {
13229
- if (isBundlePurchaseOff(grant)) {
13230
- ids.add(grant.creditId);
13231
- }
13232
- });
13233
- return ids;
13220
+ function isBundleCompatibleWithPlan(bundle, planId) {
13221
+ const compatiblePlanIds = bundle.compatiblePlanIds ?? [];
13222
+ if (compatiblePlanIds.length === 0) {
13223
+ return true;
13224
+ }
13225
+ return !!planId && compatiblePlanIds.includes(planId);
13234
13226
  }
13235
- function filterCreditBundles(grants, bundles) {
13236
- const bundleOffCreditIds = getBundleOffCreditIds(grants);
13227
+ function filterCreditBundles(bundles, planId) {
13237
13228
  return (bundles ?? []).filter(
13238
- (bundle) => !bundleOffCreditIds.has(bundle.creditId)
13229
+ (bundle) => isBundleCompatibleWithPlan(bundle, planId)
13239
13230
  );
13240
13231
  }
13241
- function deriveCreditBundles(grants, bundles, counts) {
13242
- return filterCreditBundles(grants, bundles).map((bundle) => ({
13232
+ function deriveCreditBundles(bundles, planId, counts) {
13233
+ return filterCreditBundles(bundles, planId).map((bundle) => ({
13243
13234
  ...bundle,
13244
13235
  count: counts[bundle.id] ?? 0
13245
13236
  }));
13246
13237
  }
13238
+ function getPurchasableCreditIds(bundles, planId) {
13239
+ return new Set(
13240
+ filterCreditBundles(bundles, planId).map((bundle) => bundle.creditId)
13241
+ );
13242
+ }
13247
13243
  function getAutoTopupThresholdCredits(grant) {
13248
13244
  return grant?.companyAutoTopupThresholdCredits ?? grant?.billingCreditAutoTopupThresholdCredits;
13249
13245
  }
@@ -14566,7 +14562,7 @@ var reducer = (state, action) => {
14566
14562
  // src/context/EmbedProvider.tsx
14567
14563
  import { jsx as jsx2, jsxs } from "react/jsx-runtime";
14568
14564
  var getCustomHeaders = (sessionId) => ({
14569
- "X-Schematic-Components-Version": "2.23.0",
14565
+ "X-Schematic-Components-Version": "2.24.0",
14570
14566
  "X-Schematic-Session-ID": sessionId
14571
14567
  });
14572
14568
  var normalizeCurrencyFilter = (filter2) => {
@@ -18956,14 +18952,14 @@ var CheckoutDialog = ({ top }) => {
18956
18952
  const isIndividualBundlePurchase = data?.checkoutSettings.bundlePurchaseBehavior === CheckoutBundlePurchaseBehavior.Individual;
18957
18953
  const [bundleCounts, setBundleCounts] = useState9({});
18958
18954
  const bundleCountsRef = useRef6(bundleCounts);
18959
- const bundleGatingGrants = selectedPlan?.includedCreditGrants ?? data?.company?.plan?.includedCreditGrants;
18955
+ const bundleGatingPlanId = selectedPlan?.id ?? data?.company?.plan?.id;
18960
18956
  const creditBundles = useMemo15(() => {
18961
18957
  return deriveCreditBundles(
18962
- bundleGatingGrants,
18963
18958
  data?.creditBundles,
18959
+ bundleGatingPlanId,
18964
18960
  bundleCounts
18965
18961
  );
18966
- }, [bundleGatingGrants, data?.creditBundles, bundleCounts]);
18962
+ }, [bundleGatingPlanId, data?.creditBundles, bundleCounts]);
18967
18963
  const selectedPlanPriceId = useMemo15(() => {
18968
18964
  if (!selectedPlan) {
18969
18965
  return void 0;
@@ -19294,8 +19290,8 @@ var CheckoutDialog = ({ top }) => {
19294
19290
  const code = typeof updates.promoCode !== "undefined" ? updates.promoCode : promoCode;
19295
19291
  const skipTrial = !(updates.shouldTrial ?? shouldTrial);
19296
19292
  const resolvedCreditBundles = filterCreditBundles(
19297
- plan?.includedCreditGrants ?? data?.company?.plan?.includedCreditGrants,
19298
- updates.creditBundles || creditBundles
19293
+ updates.creditBundles || creditBundles,
19294
+ plan?.id ?? data?.company?.plan?.id
19299
19295
  );
19300
19296
  const isCreditOnly = !data?.company?.billingSubscription && !planPriceId && resolvedCreditBundles.some((bundle) => bundle.count > 0) && !(updates.addOns || addOns).some(
19301
19297
  (addOn) => addOn.isSelected && !!getAddOnPrice(addOn, period, resolvedCurrency)?.id
@@ -19437,6 +19433,7 @@ var CheckoutDialog = ({ top }) => {
19437
19433
  [
19438
19434
  t3,
19439
19435
  addOnCompatibilityLookup,
19436
+ data?.company?.plan?.id,
19440
19437
  data?.company?.plan?.includedCreditGrants,
19441
19438
  data?.company?.billingSubscription,
19442
19439
  previewCheckout,
@@ -19720,13 +19717,13 @@ var CheckoutDialog = ({ top }) => {
19720
19717
  setBundleCounts(nextCounts);
19721
19718
  debouncedPreviewCheckout({
19722
19719
  creditBundles: deriveCreditBundles(
19723
- bundleGatingGrants,
19724
19720
  data?.creditBundles,
19721
+ bundleGatingPlanId,
19725
19722
  nextCounts
19726
19723
  )
19727
19724
  });
19728
19725
  },
19729
- [bundleGatingGrants, data?.creditBundles, debouncedPreviewCheckout]
19726
+ [bundleGatingPlanId, data?.creditBundles, debouncedPreviewCheckout]
19730
19727
  );
19731
19728
  const toggleCreditBundle = useCallback8(
19732
19729
  (id) => {
@@ -19740,13 +19737,13 @@ var CheckoutDialog = ({ top }) => {
19740
19737
  setBundleCounts(nextCounts);
19741
19738
  handlePreviewCheckout({
19742
19739
  creditBundles: deriveCreditBundles(
19743
- bundleGatingGrants,
19744
19740
  data?.creditBundles,
19741
+ bundleGatingPlanId,
19745
19742
  nextCounts
19746
19743
  )
19747
19744
  });
19748
19745
  },
19749
- [bundleGatingGrants, data?.creditBundles, handlePreviewCheckout]
19746
+ [bundleGatingPlanId, data?.creditBundles, handlePreviewCheckout]
19750
19747
  );
19751
19748
  const updateAddOnEntitlementQuantity = useCallback8(
19752
19749
  (id, updatedQuantity) => {
@@ -24286,9 +24283,9 @@ var MeteredFeatures = forwardRef12(({ className, ...rest }, ref) => {
24286
24283
  },
24287
24284
  [data?.featureUsage?.features]
24288
24285
  );
24289
- const bundleOffCreditIds = useMemo27(
24290
- () => getBundleOffCreditIds(data?.company?.plan?.includedCreditGrants),
24291
- [data?.company?.plan?.includedCreditGrants]
24286
+ const purchasableCreditIds = useMemo27(
24287
+ () => getPurchasableCreditIds(data?.creditBundles, data?.company?.plan?.id),
24288
+ [data?.creditBundles, data?.company?.plan?.id]
24292
24289
  );
24293
24290
  const [expandedCreditIds, setExpandedCreditIds] = useState18(
24294
24291
  () => /* @__PURE__ */ new Set()
@@ -24466,7 +24463,7 @@ var MeteredFeatures = forwardRef12(({ className, ...rest }, ref) => {
24466
24463
  )]
24467
24464
  }
24468
24465
  ),
24469
- canCheckout && !bundleOffCreditIds.has(credit.id) && /* @__PURE__ */ jsx55(
24466
+ canCheckout && purchasableCreditIds.has(credit.id) && /* @__PURE__ */ jsx55(
24470
24467
  Button,
24471
24468
  {
24472
24469
  type: "button",
@@ -25032,7 +25029,7 @@ var registerWrapper = function registerWrapper2(stripe, startTime) {
25032
25029
  }
25033
25030
  stripe._registerWrapper({
25034
25031
  name: "stripe-js",
25035
- version: "9.12.1",
25032
+ version: "9.13.0",
25036
25033
  startTime
25037
25034
  });
25038
25035
  };
@@ -25110,7 +25107,7 @@ var initStripe = function initStripe2(maybeStripe, args, startTime) {
25110
25107
  var version = runtimeVersionToUrlVersion(maybeStripe.version);
25111
25108
  var expectedVersion = RELEASE_TRAIN;
25112
25109
  if (isTestKey && version !== expectedVersion) {
25113
- console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("9.12.1", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
25110
+ console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("9.13.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
25114
25111
  }
25115
25112
  var stripe = maybeStripe.apply(void 0, args);
25116
25113
  registerWrapper(stripe, startTime);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@schematichq/schematic-components",
3
- "version": "2.23.0",
3
+ "version": "2.24.0",
4
4
  "main": "dist/schematic-components.cjs.js",
5
5
  "module": "dist/schematic-components.esm.js",
6
6
  "types": "dist/schematic-components.d.ts",
@@ -55,12 +55,12 @@
55
55
  },
56
56
  "dependencies": {
57
57
  "@schematichq/schematic-icons": "^0.8.0",
58
- "@stripe/stripe-js": "^9.12.1",
58
+ "@stripe/stripe-js": "^9.13.0",
59
59
  "i18next": "^26.3.6",
60
60
  "lodash": "^4.18.1",
61
61
  "pako": "^3.0.1",
62
62
  "react-i18next": "16.1.6",
63
- "styled-components": "^6.5.0",
63
+ "styled-components": "^6.5.3",
64
64
  "uuid": "^14.0.1"
65
65
  },
66
66
  "devDependencies": {
@@ -72,7 +72,7 @@
72
72
  "@stripe/react-stripe-js": "^6.8.1",
73
73
  "@swc/core": "^1.15.47",
74
74
  "@testing-library/dom": "^10.4.1",
75
- "@testing-library/jest-dom": "^7.0.0",
75
+ "@testing-library/jest-dom": "^7.0.1",
76
76
  "@testing-library/react": "^16.3.2",
77
77
  "@types/lodash": "^4.17.25",
78
78
  "@types/pako": "^3.0.0",
@@ -85,8 +85,8 @@
85
85
  "eslint-plugin-import-x": "^4.17.1",
86
86
  "eslint-plugin-react": "^7.37.5",
87
87
  "eslint-plugin-react-hooks": "^7.1.1",
88
- "globals": "^17.9.0",
89
- "happy-dom": "^20.11.1",
88
+ "globals": "^17.11.0",
89
+ "happy-dom": "^20.11.2",
90
90
  "jsdom": "^30.0.1",
91
91
  "msw": "^2.15.0",
92
92
  "prettier": "^3.9.6",