@purpurds/promotion-card 6.10.0 → 6.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import * as
|
|
1
|
+
import { jsxs as c, jsx as u, Fragment as ur } from "react/jsx-runtime";
|
|
2
|
+
import * as d from "react";
|
|
3
3
|
import { forwardRef as J } from "react";
|
|
4
4
|
import "react-dom";
|
|
5
5
|
function _e(e) {
|
|
@@ -223,7 +223,7 @@ const gr = /* @__PURE__ */ Be(Me), X = {
|
|
|
223
223
|
...t
|
|
224
224
|
}) => {
|
|
225
225
|
const n = Ge(a), l = gr([r, X[Q], X[`${Q}--${a}`]]);
|
|
226
|
-
return /* @__PURE__ */
|
|
226
|
+
return /* @__PURE__ */ c("span", { "aria-label": p, className: l, "data-testid": o, ...t, children: [
|
|
227
227
|
i && n && /* @__PURE__ */ u(
|
|
228
228
|
re,
|
|
229
229
|
{
|
|
@@ -397,7 +397,7 @@ const Ve = /* @__PURE__ */ De(Te), We = {
|
|
|
397
397
|
loading: t = !1,
|
|
398
398
|
negative: n = !1,
|
|
399
399
|
onClick: l,
|
|
400
|
-
size:
|
|
400
|
+
size: _ = "md",
|
|
401
401
|
variant: m,
|
|
402
402
|
type: C = "button",
|
|
403
403
|
...j
|
|
@@ -408,7 +408,7 @@ const Ve = /* @__PURE__ */ De(Te), We = {
|
|
|
408
408
|
[
|
|
409
409
|
O,
|
|
410
410
|
`${O}--${n ? `${m}-negative` : m}`,
|
|
411
|
-
`${O}--${
|
|
411
|
+
`${O}--${_}`
|
|
412
412
|
],
|
|
413
413
|
{
|
|
414
414
|
[`${O}--icon-only`]: r,
|
|
@@ -420,7 +420,7 @@ const Ve = /* @__PURE__ */ De(Te), We = {
|
|
|
420
420
|
), B = (v) => {
|
|
421
421
|
o || t ? v.preventDefault() : l && l(v);
|
|
422
422
|
}, k = !!j["aria-disabled"] || o || t;
|
|
423
|
-
return /* @__PURE__ */
|
|
423
|
+
return /* @__PURE__ */ c(
|
|
424
424
|
"button",
|
|
425
425
|
{
|
|
426
426
|
className: f,
|
|
@@ -431,7 +431,7 @@ const Ve = /* @__PURE__ */ De(Te), We = {
|
|
|
431
431
|
onClick: B,
|
|
432
432
|
...j,
|
|
433
433
|
children: [
|
|
434
|
-
t && /* @__PURE__ */ u(Le, { size:
|
|
434
|
+
t && /* @__PURE__ */ u(Le, { size: _ === Ee.LG ? "xs" : "xxs", negative: n, disabled: k }),
|
|
435
435
|
" ",
|
|
436
436
|
e
|
|
437
437
|
]
|
|
@@ -708,7 +708,7 @@ const Or = /* @__PURE__ */ yt(xt), rr = {
|
|
|
708
708
|
...t
|
|
709
709
|
}) => {
|
|
710
710
|
const n = bt(a), l = Or([r, rr[er], rr[`${er}--${a}`]]);
|
|
711
|
-
return /* @__PURE__ */
|
|
711
|
+
return /* @__PURE__ */ c("span", { "aria-label": p, className: l, "data-testid": o, ...t, children: [
|
|
712
712
|
i && n && /* @__PURE__ */ u(
|
|
713
713
|
te,
|
|
714
714
|
{
|
|
@@ -895,7 +895,7 @@ const Br = /* @__PURE__ */ Zt(qt), zt = "_rotate_1xozj_1", Ut = "_dash_1xozj_1",
|
|
|
895
895
|
])} ${$}`,
|
|
896
896
|
"data-testid": e,
|
|
897
897
|
...l,
|
|
898
|
-
children: r ? /* @__PURE__ */ u(Rt, { "data-testid": `${e}-spinner`, size: "xs", disabled: o }) : /* @__PURE__ */
|
|
898
|
+
children: r ? /* @__PURE__ */ u(Rt, { "data-testid": `${e}-spinner`, size: "xs", disabled: o }) : /* @__PURE__ */ c(ur, { children: [
|
|
899
899
|
p === "left" && a,
|
|
900
900
|
t,
|
|
901
901
|
p === "right" && a
|
|
@@ -1081,7 +1081,7 @@ const pa = {
|
|
|
1081
1081
|
}, qr = h.bind(pa), zr = "purpur-card-feature-list", ua = ({
|
|
1082
1082
|
["data-testid"]: e = "purpur-card-feature-list",
|
|
1083
1083
|
listItems: i
|
|
1084
|
-
}) => i && i.length > 0 ? /* @__PURE__ */ u("ul", { className: qr(zr), "data-testid": e, children: i.map((a) => /* @__PURE__ */
|
|
1084
|
+
}) => i && i.length > 0 ? /* @__PURE__ */ u("ul", { className: qr(zr), "data-testid": e, children: i.map((a) => /* @__PURE__ */ c(
|
|
1085
1085
|
"li",
|
|
1086
1086
|
{
|
|
1087
1087
|
className: qr(`${zr}__list-item`),
|
|
@@ -1155,25 +1155,24 @@ const ca = /* @__PURE__ */ la(da), H = {
|
|
|
1155
1155
|
}, _a = {
|
|
1156
1156
|
TITLE100: "title-100"
|
|
1157
1157
|
}, T = "purpur-heading", ie = ({
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
...n
|
|
1158
|
+
children: e,
|
|
1159
|
+
className: i = "",
|
|
1160
|
+
enableHyphenation: a = !1,
|
|
1161
|
+
negative: o = !1,
|
|
1162
|
+
tag: p,
|
|
1163
|
+
variant: r = _a.TITLE100,
|
|
1164
|
+
...t
|
|
1166
1165
|
}) => {
|
|
1167
|
-
const
|
|
1168
|
-
|
|
1166
|
+
const n = p, l = ca([
|
|
1167
|
+
i,
|
|
1169
1168
|
H[T],
|
|
1170
|
-
H[`${T}--${
|
|
1169
|
+
H[`${T}--${r}`],
|
|
1171
1170
|
{
|
|
1172
|
-
[H[`${T}--hyphens`]]:
|
|
1173
|
-
[H[`${T}--negative`]]:
|
|
1171
|
+
[H[`${T}--hyphens`]]: a,
|
|
1172
|
+
[H[`${T}--negative`]]: o
|
|
1174
1173
|
}
|
|
1175
1174
|
]);
|
|
1176
|
-
return /* @__PURE__ */ u(
|
|
1175
|
+
return /* @__PURE__ */ u(n, { className: l, ...t, children: e });
|
|
1177
1176
|
};
|
|
1178
1177
|
ie.displayName = "Heading";
|
|
1179
1178
|
const fa = {
|
|
@@ -1188,8 +1187,8 @@ const fa = {
|
|
|
1188
1187
|
children: o,
|
|
1189
1188
|
titleTag: p = "h2",
|
|
1190
1189
|
enableHyphenation: r
|
|
1191
|
-
}) => /* @__PURE__ */
|
|
1192
|
-
/* @__PURE__ */
|
|
1190
|
+
}) => /* @__PURE__ */ c("div", { className: V(W), "data-testid": e, children: [
|
|
1191
|
+
/* @__PURE__ */ c("div", { className: V(`${W}__header`), children: [
|
|
1193
1192
|
a && /* @__PURE__ */ u("div", { className: V(`${W}__icon`), children: a }),
|
|
1194
1193
|
/* @__PURE__ */ u(
|
|
1195
1194
|
ie,
|
|
@@ -1251,27 +1250,27 @@ function ja(...e) {
|
|
|
1251
1250
|
};
|
|
1252
1251
|
};
|
|
1253
1252
|
}
|
|
1254
|
-
var oe =
|
|
1255
|
-
const { children: a, ...o } = e, p =
|
|
1253
|
+
var oe = d.forwardRef((e, i) => {
|
|
1254
|
+
const { children: a, ...o } = e, p = d.Children.toArray(a), r = p.find(Fa);
|
|
1256
1255
|
if (r) {
|
|
1257
|
-
const t = r.props.children, n = p.map((l) => l === r ?
|
|
1258
|
-
return /* @__PURE__ */ u(or, { ...o, ref: i, children:
|
|
1256
|
+
const t = r.props.children, n = p.map((l) => l === r ? d.Children.count(t) > 1 ? d.Children.only(null) : d.isValidElement(t) ? t.props.children : null : l);
|
|
1257
|
+
return /* @__PURE__ */ u(or, { ...o, ref: i, children: d.isValidElement(t) ? d.cloneElement(t, void 0, n) : null });
|
|
1259
1258
|
}
|
|
1260
1259
|
return /* @__PURE__ */ u(or, { ...o, ref: i, children: a });
|
|
1261
1260
|
});
|
|
1262
1261
|
oe.displayName = "Slot";
|
|
1263
|
-
var or =
|
|
1262
|
+
var or = d.forwardRef((e, i) => {
|
|
1264
1263
|
const { children: a, ...o } = e;
|
|
1265
|
-
if (
|
|
1264
|
+
if (d.isValidElement(a)) {
|
|
1266
1265
|
const p = Ga(a), r = Ma(o, a.props);
|
|
1267
|
-
return a.type !==
|
|
1266
|
+
return a.type !== d.Fragment && (r.ref = i ? ja(i, p) : p), d.cloneElement(a, r);
|
|
1268
1267
|
}
|
|
1269
|
-
return
|
|
1268
|
+
return d.Children.count(a) > 1 ? d.Children.only(null) : null;
|
|
1270
1269
|
});
|
|
1271
1270
|
or.displayName = "SlotClone";
|
|
1272
1271
|
var Ba = ({ children: e }) => /* @__PURE__ */ u(ur, { children: e });
|
|
1273
1272
|
function Fa(e) {
|
|
1274
|
-
return
|
|
1273
|
+
return d.isValidElement(e) && e.type === Ba;
|
|
1275
1274
|
}
|
|
1276
1275
|
function Ma(e, i) {
|
|
1277
1276
|
const a = { ...i };
|
|
@@ -1306,12 +1305,12 @@ var Za = [
|
|
|
1306
1305
|
"svg",
|
|
1307
1306
|
"ul"
|
|
1308
1307
|
], Ea = Za.reduce((e, i) => {
|
|
1309
|
-
const a =
|
|
1308
|
+
const a = d.forwardRef((o, p) => {
|
|
1310
1309
|
const { asChild: r, ...t } = o, n = r ? oe : i;
|
|
1311
1310
|
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ u(n, { ...t, ref: p });
|
|
1312
1311
|
});
|
|
1313
1312
|
return a.displayName = `Primitive.${i}`, { ...e, [i]: a };
|
|
1314
|
-
}, {}), qa = "VisuallyHidden", pe =
|
|
1313
|
+
}, {}), qa = "VisuallyHidden", pe = d.forwardRef(
|
|
1315
1314
|
(e, i) => /* @__PURE__ */ u(
|
|
1316
1315
|
Ea.span,
|
|
1317
1316
|
{
|
|
@@ -1398,7 +1397,7 @@ const Pr = ({
|
|
|
1398
1397
|
onClick: t,
|
|
1399
1398
|
screenReaderText: n,
|
|
1400
1399
|
variant: l,
|
|
1401
|
-
...
|
|
1400
|
+
..._
|
|
1402
1401
|
}, m) => {
|
|
1403
1402
|
const C = Ia([
|
|
1404
1403
|
ar,
|
|
@@ -1408,7 +1407,7 @@ const Pr = ({
|
|
|
1408
1407
|
[`${ar}--full-height`]: p
|
|
1409
1408
|
}
|
|
1410
1409
|
]);
|
|
1411
|
-
return /* @__PURE__ */
|
|
1410
|
+
return /* @__PURE__ */ c("div", { className: C, "data-testid": e, ref: m, ..._, children: [
|
|
1412
1411
|
i,
|
|
1413
1412
|
(t || r) && n && /* @__PURE__ */ u(
|
|
1414
1413
|
Ua,
|
|
@@ -1630,7 +1629,7 @@ const n0 = /* @__PURE__ */ e0(a0), i0 = {
|
|
|
1630
1629
|
negative: t = !1,
|
|
1631
1630
|
size: n = "md",
|
|
1632
1631
|
variant: l,
|
|
1633
|
-
icon:
|
|
1632
|
+
icon: _ = "forward",
|
|
1634
1633
|
...m
|
|
1635
1634
|
}, C) => {
|
|
1636
1635
|
const j = o0(
|
|
@@ -1645,10 +1644,10 @@ const n0 = /* @__PURE__ */ e0(a0), i0 = {
|
|
|
1645
1644
|
[`${F}--negative`]: t,
|
|
1646
1645
|
[`${F}--full-width`]: o
|
|
1647
1646
|
}
|
|
1648
|
-
), S = p0[
|
|
1649
|
-
r && (
|
|
1647
|
+
), S = p0[_], f = /* @__PURE__ */ c(ur, { children: [
|
|
1648
|
+
r && (_ === "back" || _ === "phone") && /* @__PURE__ */ u(pr, { svg: S, size: n === "lg" ? "sm" : "xs" }),
|
|
1650
1649
|
(!p || p && !r) && e,
|
|
1651
|
-
r && (
|
|
1650
|
+
r && (_ === "forward" || _ === "external") && /* @__PURE__ */ u(pr, { svg: S, size: n === "lg" ? "sm" : "xs" })
|
|
1652
1651
|
] }), B = {
|
|
1653
1652
|
...m,
|
|
1654
1653
|
className: j,
|
|
@@ -1720,25 +1719,24 @@ const d0 = /* @__PURE__ */ u0(s0), Y = {
|
|
|
1720
1719
|
}, c0 = {
|
|
1721
1720
|
TITLE100: "title-100"
|
|
1722
1721
|
}, K = "purpur-heading", se = ({
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
...n
|
|
1722
|
+
children: e,
|
|
1723
|
+
className: i = "",
|
|
1724
|
+
enableHyphenation: a = !1,
|
|
1725
|
+
negative: o = !1,
|
|
1726
|
+
tag: p,
|
|
1727
|
+
variant: r = c0.TITLE100,
|
|
1728
|
+
...t
|
|
1731
1729
|
}) => {
|
|
1732
|
-
const
|
|
1733
|
-
|
|
1730
|
+
const n = p, l = d0([
|
|
1731
|
+
i,
|
|
1734
1732
|
Y[K],
|
|
1735
|
-
Y[`${K}--${
|
|
1733
|
+
Y[`${K}--${r}`],
|
|
1736
1734
|
{
|
|
1737
|
-
[Y[`${K}--hyphens`]]:
|
|
1738
|
-
[Y[`${K}--negative`]]:
|
|
1735
|
+
[Y[`${K}--hyphens`]]: a,
|
|
1736
|
+
[Y[`${K}--negative`]]: o
|
|
1739
1737
|
}
|
|
1740
1738
|
]);
|
|
1741
|
-
return /* @__PURE__ */ u(
|
|
1739
|
+
return /* @__PURE__ */ u(n, { className: l, ...t, children: e });
|
|
1742
1740
|
};
|
|
1743
1741
|
se.displayName = "Heading";
|
|
1744
1742
|
function _0(e) {
|
|
@@ -1910,7 +1908,7 @@ const x0 = /* @__PURE__ */ v0(w0), b0 = {
|
|
|
1910
1908
|
titleVariant: t = "title-300",
|
|
1911
1909
|
enableTitleHyphenation: n = !1,
|
|
1912
1910
|
className: l,
|
|
1913
|
-
actions:
|
|
1911
|
+
actions: _,
|
|
1914
1912
|
children: m,
|
|
1915
1913
|
style: C,
|
|
1916
1914
|
alignment: j = "space-between",
|
|
@@ -1933,7 +1931,7 @@ const x0 = /* @__PURE__ */ v0(w0), b0 = {
|
|
|
1933
1931
|
"--promotion-card-color": S0[i],
|
|
1934
1932
|
"--promotion-card-background-image": C0[i]
|
|
1935
1933
|
};
|
|
1936
|
-
return /* @__PURE__ */ u(y, { ref: B, className: g(`${s}__card`), fullHeight: !0, children: /* @__PURE__ */
|
|
1934
|
+
return /* @__PURE__ */ u(y, { ref: B, className: g(`${s}__card`), fullHeight: !0, children: /* @__PURE__ */ c(
|
|
1937
1935
|
"div",
|
|
1938
1936
|
{
|
|
1939
1937
|
"data-testid": e,
|
|
@@ -1952,7 +1950,7 @@ const x0 = /* @__PURE__ */ v0(w0), b0 = {
|
|
|
1952
1950
|
]),
|
|
1953
1951
|
...k,
|
|
1954
1952
|
children: [
|
|
1955
|
-
/* @__PURE__ */
|
|
1953
|
+
/* @__PURE__ */ c(
|
|
1956
1954
|
"div",
|
|
1957
1955
|
{
|
|
1958
1956
|
className: g([
|
|
@@ -1963,11 +1961,11 @@ const x0 = /* @__PURE__ */ v0(w0), b0 = {
|
|
|
1963
1961
|
}
|
|
1964
1962
|
]),
|
|
1965
1963
|
children: [
|
|
1966
|
-
a && /* @__PURE__ */ u("div", { "data-testid": "badgeWrapper", className: g(`${s}__badge-wrapper`), children: /* @__PURE__ */
|
|
1964
|
+
a && /* @__PURE__ */ u("div", { "data-testid": "badgeWrapper", className: g(`${s}__badge-wrapper`), children: /* @__PURE__ */ c(Ze, { variant: i === "primary" ? "special" : "attention", showIcon: !1, children: [
|
|
1967
1965
|
o && o,
|
|
1968
1966
|
a
|
|
1969
1967
|
] }) }),
|
|
1970
|
-
/* @__PURE__ */
|
|
1968
|
+
/* @__PURE__ */ c(
|
|
1971
1969
|
"div",
|
|
1972
1970
|
{
|
|
1973
1971
|
className: g(
|
|
@@ -1985,9 +1983,9 @@ const x0 = /* @__PURE__ */ v0(w0), b0 = {
|
|
|
1985
1983
|
children: p
|
|
1986
1984
|
}
|
|
1987
1985
|
),
|
|
1988
|
-
/* @__PURE__ */
|
|
1986
|
+
/* @__PURE__ */ c("div", { className: g(`${s}__body`), children: [
|
|
1989
1987
|
/* @__PURE__ */ u("div", { className: g(`${s}__child-content`), children: m }),
|
|
1990
|
-
|
|
1988
|
+
_ && _.length > 0 && /* @__PURE__ */ u("div", { className: g(`${s}__actions`), children: _.map(({ label: w, ...A }, M) => {
|
|
1991
1989
|
const G = {
|
|
1992
1990
|
variant: M === 0 ? "primary" : "secondary",
|
|
1993
1991
|
negative: i === "primary",
|
|
@@ -2012,7 +2010,7 @@ const x0 = /* @__PURE__ */ v0(w0), b0 = {
|
|
|
2012
2010
|
]
|
|
2013
2011
|
}
|
|
2014
2012
|
),
|
|
2015
|
-
v && /* @__PURE__ */
|
|
2013
|
+
v && /* @__PURE__ */ c(
|
|
2016
2014
|
"div",
|
|
2017
2015
|
{
|
|
2018
2016
|
className: g([
|