@purpurds/content-block 5.24.2 → 5.25.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.
@@ -1,4 +1,4 @@
1
- import { jsxs as y, jsx as l, Fragment as K } from "react/jsx-runtime";
1
+ import { jsxs as w, jsx as l, Fragment as K } from "react/jsx-runtime";
2
2
  import S, { forwardRef as X, Children as Q } from "react";
3
3
  function rr(t) {
4
4
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
@@ -165,7 +165,7 @@ const fr = /* @__PURE__ */ vr(mr), M = {
165
165
  "purpur-badge--warning": "_purpur-badge--warning_1r1mu_33",
166
166
  "purpur-badge--error": "_purpur-badge--error_1r1mu_37",
167
167
  "purpur-badge--black-friday": "_purpur-badge--black-friday_1r1mu_41"
168
- }, Z = "purpur-badge", _ = {
168
+ }, Z = "purpur-badge", g = {
169
169
  ATTENTION: "attention",
170
170
  SPECIAL: "special",
171
171
  NEUTRAL: "neutral",
@@ -176,20 +176,20 @@ const fr = /* @__PURE__ */ vr(mr), M = {
176
176
  BLACK_FRIDAY: "black-friday"
177
177
  }, yr = (t) => {
178
178
  switch (t) {
179
- case _.ATTENTION:
180
- case _.SPECIAL:
179
+ case g.ATTENTION:
180
+ case g.SPECIAL:
181
181
  return lr;
182
- case _.INFORMATION:
182
+ case g.INFORMATION:
183
183
  return ir;
184
- case _.SUCCESS:
184
+ case g.SUCCESS:
185
185
  return ur;
186
- case _.WARNING:
186
+ case g.WARNING:
187
187
  return nr;
188
- case _.ERROR:
188
+ case g.ERROR:
189
189
  return pr;
190
- case _.NEUTRAL:
190
+ case g.NEUTRAL:
191
191
  return or;
192
- case _.BLACK_FRIDAY:
192
+ case g.BLACK_FRIDAY:
193
193
  return sr;
194
194
  default:
195
195
  return;
@@ -204,7 +204,7 @@ const fr = /* @__PURE__ */ vr(mr), M = {
204
204
  ...e
205
205
  }) => {
206
206
  const a = yr(n), o = fr([r, M[Z], M[`${Z}--${n}`]]);
207
- return /* @__PURE__ */ y("span", { "aria-label": p, className: o, "data-testid": i, ...e, children: [
207
+ return /* @__PURE__ */ w("span", { "aria-label": p, className: o, "data-testid": i, ...e, children: [
208
208
  u && a && /* @__PURE__ */ l(E, { "data-testid": `${i}-icon`, allyTitle: p, size: "xs", svg: a }),
209
209
  t
210
210
  ] });
@@ -363,7 +363,7 @@ const Lr = /* @__PURE__ */ jr(Er), Pr = {
363
363
  "purpur-cta-link--secondary-negative": "_purpur-cta-link--secondary-negative_1mhg7_87",
364
364
  "purpur-cta-link--expressive": "_purpur-cta-link--expressive_1mhg7_98",
365
365
  "purpur-cta-link--expressive-negative": "_purpur-cta-link--expressive-negative_1mhg7_108"
366
- }, Rr = Lr.bind(Pr), h = "purpur-cta-link", Cr = {
366
+ }, Rr = Lr.bind(Pr), v = "purpur-cta-link", Cr = {
367
367
  forward: Ar,
368
368
  external: Sr,
369
369
  back: Nr,
@@ -375,34 +375,35 @@ const Lr = /* @__PURE__ */ jr(Er), Pr = {
375
375
  ["data-testid"]: n,
376
376
  fullWidth: i = !1,
377
377
  iconOnly: p = !1,
378
- negative: r = !1,
379
- size: e = "md",
380
- variant: a,
381
- icon: o = "forward",
382
- ...g
383
- }, w) => {
384
- const v = Rr(
378
+ showIcon: r = !0,
379
+ negative: e = !1,
380
+ size: a = "md",
381
+ variant: o,
382
+ icon: _ = "forward",
383
+ ...m
384
+ }, h) => {
385
+ const N = Rr(
385
386
  [
386
387
  u,
387
- h,
388
- `${h}--${r ? `${a}-negative` : a}`,
389
- `${h}--${e}`
388
+ v,
389
+ `${v}--${e ? `${o}-negative` : o}`,
390
+ `${v}--${a}`
390
391
  ],
391
392
  {
392
- [`${h}--icon-only`]: p,
393
- [`${h}--negative`]: r,
394
- [`${h}--full-width`]: i
393
+ [`${v}--icon-only`]: p,
394
+ [`${v}--negative`]: e,
395
+ [`${v}--full-width`]: i
395
396
  }
396
- ), b = Cr[o], x = /* @__PURE__ */ y(K, { children: [
397
- (o === "back" || o === "phone") && /* @__PURE__ */ l(A, { svg: b, size: e === "lg" ? "sm" : "xs" }),
398
- !p && t,
399
- (o === "forward" || o === "external") && /* @__PURE__ */ l(A, { svg: b, size: e === "lg" ? "sm" : "xs" })
400
- ] }), k = {
401
- ...g,
402
- className: v,
397
+ ), b = Cr[_], x = /* @__PURE__ */ w(K, { children: [
398
+ r && (_ === "back" || _ === "phone") && /* @__PURE__ */ l(A, { svg: b, size: a === "lg" ? "sm" : "xs" }),
399
+ (!p || p && !r) && t,
400
+ r && (_ === "forward" || _ === "external") && /* @__PURE__ */ l(A, { svg: b, size: a === "lg" ? "sm" : "xs" })
401
+ ] }), s = {
402
+ ...m,
403
+ className: N,
403
404
  "data-testid": n
404
405
  };
405
- return "href" in g && g.href ? /* @__PURE__ */ l("a", { ...k, ref: w, children: x }) : /* @__PURE__ */ l("span", { ...k, ref: w, children: x });
406
+ return "href" in m && m.href ? /* @__PURE__ */ l("a", { ...s, ref: h, children: x }) : /* @__PURE__ */ l("span", { ...s, ref: h, children: x });
406
407
  }
407
408
  );
408
409
  function Hr(t) {
@@ -445,7 +446,7 @@ var C = { exports: {} };
445
446
  })();
446
447
  })(C);
447
448
  var Vr = C.exports;
448
- const Dr = /* @__PURE__ */ Hr(Vr), $ = {
449
+ const Dr = /* @__PURE__ */ Hr(Vr), k = {
449
450
  "purpur-heading": "_purpur-heading_k9fhq_1",
450
451
  "purpur-heading--hyphens": "_purpur-heading--hyphens_k9fhq_8",
451
452
  "purpur-heading--negative": "_purpur-heading--negative_k9fhq_11",
@@ -470,7 +471,7 @@ const Dr = /* @__PURE__ */ Hr(Vr), $ = {
470
471
  TITLE600: "title-600",
471
472
  TITLE700: "title-700",
472
473
  SUBSECTION100: "subsection-100"
473
- }, N = "purpur-heading", B = ({
474
+ }, $ = "purpur-heading", B = ({
474
475
  ["data-testid"]: t,
475
476
  children: u,
476
477
  className: n = "",
@@ -480,16 +481,16 @@ const Dr = /* @__PURE__ */ Hr(Vr), $ = {
480
481
  variant: e = Gr.TITLE100,
481
482
  ...a
482
483
  }) => {
483
- const o = r, g = Dr([
484
+ const o = r, _ = Dr([
484
485
  n,
485
- $[N],
486
- $[`${N}--${e}`],
486
+ k[$],
487
+ k[`${$}--${e}`],
487
488
  {
488
- [$[`${N}--hyphens`]]: i,
489
- [$[`${N}--negative`]]: p
489
+ [k[`${$}--hyphens`]]: i,
490
+ [k[`${$}--negative`]]: p
490
491
  }
491
492
  ]);
492
- return /* @__PURE__ */ l(o, { ...a, className: g, "data-testid": t, children: u });
493
+ return /* @__PURE__ */ l(o, { ...a, className: _, "data-testid": t, children: u });
493
494
  };
494
495
  B.displayName = "Heading";
495
496
  function zr(t) {
@@ -625,7 +626,7 @@ var G = { exports: {} };
625
626
  })();
626
627
  })(G);
627
628
  var te = G.exports;
628
- const ae = /* @__PURE__ */ ee(te), m = {
629
+ const ae = /* @__PURE__ */ ee(te), f = {
629
630
  "purpur-paragraph": "_purpur-paragraph_1rh57_1",
630
631
  "purpur-paragraph--disabled": "_purpur-paragraph--disabled_1rh57_7",
631
632
  "purpur-paragraph--hyphens": "_purpur-paragraph--hyphens_1rh57_10",
@@ -651,7 +652,7 @@ const ae = /* @__PURE__ */ ee(te), m = {
651
652
  ADDITIONAL100MEDIUM: "additional-100-medium",
652
653
  OVERLINE100: "overline-100",
653
654
  OVERLINE200: "overline-200"
654
- }, f = "purpur-paragraph", z = ({
655
+ }, y = "purpur-paragraph", z = ({
655
656
  ["data-testid"]: t,
656
657
  children: u,
657
658
  className: n,
@@ -663,12 +664,12 @@ const ae = /* @__PURE__ */ ee(te), m = {
663
664
  }) => {
664
665
  const o = ae([
665
666
  n,
666
- m[f],
667
- m[`${f}--${e}`],
667
+ f[y],
668
+ f[`${y}--${e}`],
668
669
  {
669
- [m[`${f}--hyphens`]]: p,
670
- [m[`${f}--disabled`]]: i,
671
- [m[`${f}--negative`]]: r
670
+ [f[`${y}--hyphens`]]: p,
671
+ [f[`${y}--disabled`]]: i,
672
+ [f[`${y}--negative`]]: r
672
673
  }
673
674
  ]);
674
675
  return /* @__PURE__ */ l("p", { ...a, className: o, "data-testid": t, children: u });
@@ -747,7 +748,7 @@ const U = /* @__PURE__ */ ue(pe), ie = {
747
748
  return /* @__PURE__ */ l("div", { className: r, "data-testid": i, ...p, children: Q.map(t, (a) => S.isValidElement(a) ? S.cloneElement(a, { negative: n }) : a) });
748
749
  };
749
750
  W.displayName = "ContentBlockGroup";
750
- const c = U.bind(ie), s = "purpur-content-block", Y = ({
751
+ const d = U.bind(ie), c = "purpur-content-block", Y = ({
751
752
  ["data-testid"]: t,
752
753
  className: u,
753
754
  negative: n,
@@ -757,48 +758,48 @@ const c = U.bind(ie), s = "purpur-content-block", Y = ({
757
758
  title: e,
758
759
  ctas: a,
759
760
  usp: o,
760
- headingTag: g = "h2",
761
- headingVariant: w = "title-300",
762
- onCtaClick: v,
763
- children: b,
764
- ...x
761
+ headingTag: _ = "h2",
762
+ headingVariant: m = "title-300",
763
+ onCtaClick: h,
764
+ children: N,
765
+ ...b
765
766
  }) => {
766
- const k = c([
767
+ const x = d([
767
768
  u,
768
- s,
769
+ c,
769
770
  {
770
- [`${s}--negative`]: n
771
+ [`${c}--negative`]: n
771
772
  }
772
773
  ]);
773
- return /* @__PURE__ */ y("div", { "data-testid": t, className: k, ...x, children: [
774
- /* @__PURE__ */ l("div", { className: c(`${s}__section`), children: p ? /* @__PURE__ */ l("div", { className: c(`${s}__video-wrapper`), children: p }) : /* @__PURE__ */ l("div", { className: c(`${s}__image-wrapper`), children: i }) }),
775
- /* @__PURE__ */ l("div", { className: c(`${s}__section`), children: /* @__PURE__ */ y("div", { className: c(`${s}__content-wrapper`), children: [
776
- r ? /* @__PURE__ */ l(wr, { variant: "special", className: c(`${s}__badge`), children: r }) : null,
777
- e && e.trim() && /* @__PURE__ */ l(B, { variant: w, tag: g, negative: n, children: e }),
778
- /* @__PURE__ */ l("div", { className: c(`${s}__content`), children: b }),
779
- o != null && o.length ? /* @__PURE__ */ l("ul", { className: c(`${s}__usp-list`), children: o.map(
780
- (d) => d && /* @__PURE__ */ y("li", { className: c(`${s}__usp-list-item`), children: [
774
+ return /* @__PURE__ */ w("div", { "data-testid": t, className: x, ...b, children: [
775
+ /* @__PURE__ */ l("div", { className: d(`${c}__section`), children: p ? /* @__PURE__ */ l("div", { className: d(`${c}__video-wrapper`), children: p }) : /* @__PURE__ */ l("div", { className: d(`${c}__image-wrapper`), children: i }) }),
776
+ /* @__PURE__ */ l("div", { className: d(`${c}__section`), children: /* @__PURE__ */ w("div", { className: d(`${c}__content-wrapper`), children: [
777
+ r ? /* @__PURE__ */ l(wr, { variant: "special", className: d(`${c}__badge`), children: r }) : null,
778
+ e && e.trim() && /* @__PURE__ */ l(B, { variant: m, tag: _, negative: n, children: e }),
779
+ /* @__PURE__ */ l("div", { className: d(`${c}__content`), children: N }),
780
+ o != null && o.length ? /* @__PURE__ */ l("ul", { className: d(`${c}__usp-list`), children: o.map(
781
+ (s) => s && /* @__PURE__ */ w("li", { className: d(`${c}__usp-list-item`), children: [
781
782
  /* @__PURE__ */ l(
782
783
  V,
783
784
  {
784
785
  size: "xs",
785
- className: c(`${s}__usp-list-item-icon`)
786
+ className: d(`${c}__usp-list-item-icon`)
786
787
  }
787
788
  ),
788
- /* @__PURE__ */ l(z, { negative: n, children: d })
789
- ] }, d)
789
+ /* @__PURE__ */ l(z, { negative: n, children: s })
790
+ ] }, s)
790
791
  ) }) : null,
791
- a && a.length > 0 && /* @__PURE__ */ l("div", { className: c(`${s}__links`), children: a.map(
792
- (d, J) => d.href && /* @__PURE__ */ l(
792
+ a && a.length > 0 && /* @__PURE__ */ l("div", { className: d(`${c}__links`), children: a.map(
793
+ (s, J) => s.href && /* @__PURE__ */ l(
793
794
  Br,
794
795
  {
795
- href: d.href,
796
+ href: s.href,
796
797
  variant: J === 0 ? "primary" : "secondary",
797
798
  negative: n,
798
- onClick: () => v == null ? void 0 : v(d),
799
- children: d.text
799
+ onClick: () => h == null ? void 0 : h(s),
800
+ children: s.text
800
801
  },
801
- d.text + d.href
802
+ s.text + s.href
802
803
  )
803
804
  ) })
804
805
  ] }) })