@purpurds/promotion-card 5.14.0 → 5.15.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.
- package/dist/LICENSE.txt +3 -3
- package/dist/promotion-card.cjs.js +6 -6
- package/dist/promotion-card.cjs.js.map +1 -1
- package/dist/promotion-card.d.ts +1 -1
- package/dist/promotion-card.es.js +53 -54
- package/dist/promotion-card.es.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +10 -10
- package/src/promotion-card.module.scss +3 -1
package/dist/promotion-card.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { HeadingTagType, TitleVariantType } from '@purpurds/heading';
|
|
2
1
|
import { default as React, DetailedHTMLProps, HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { HeadingTagType, TitleVariantType } from '@purpurds/heading';
|
|
3
3
|
|
|
4
4
|
export declare const promotionCardVariants: readonly ["primary", "secondary", "quaternary"];
|
|
5
5
|
export type PromotionCardVariant = (typeof promotionCardVariants)[number];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as _, jsx as l } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as M, Children as O, isValidElement as I, createElement as $, cloneElement as ar, useEffect as xr, Fragment as
|
|
2
|
+
import { forwardRef as M, Children as O, isValidElement as I, createElement as $, cloneElement as ar, useEffect as xr, Fragment as Cr } from "react";
|
|
3
3
|
import "react-dom";
|
|
4
|
-
function
|
|
4
|
+
function br(e) {
|
|
5
5
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
6
6
|
}
|
|
7
7
|
var or = { exports: {} };
|
|
@@ -41,7 +41,7 @@ var or = { exports: {} };
|
|
|
41
41
|
})();
|
|
42
42
|
})(or);
|
|
43
43
|
var Sr = or.exports;
|
|
44
|
-
const Ar = /* @__PURE__ */
|
|
44
|
+
const Ar = /* @__PURE__ */ br(Sr), Fr = {
|
|
45
45
|
"purpur-icon": "_purpur-icon_8u1lq_1",
|
|
46
46
|
"purpur-icon--xxs": "_purpur-icon--xxs_8u1lq_4",
|
|
47
47
|
"purpur-icon--xs": "_purpur-icon--xs_8u1lq_8",
|
|
@@ -115,7 +115,7 @@ const Ar = /* @__PURE__ */ Cr(Sr), Fr = {
|
|
|
115
115
|
}
|
|
116
116
|
);
|
|
117
117
|
};
|
|
118
|
-
function
|
|
118
|
+
function Dr(e) {
|
|
119
119
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
120
120
|
}
|
|
121
121
|
var ir = { exports: {} };
|
|
@@ -154,8 +154,8 @@ var ir = { exports: {} };
|
|
|
154
154
|
e.exports ? (a.default = a, e.exports = a) : window.classNames = a;
|
|
155
155
|
})();
|
|
156
156
|
})(ir);
|
|
157
|
-
var
|
|
158
|
-
const qr = /* @__PURE__ */ jr
|
|
157
|
+
var jr = ir.exports;
|
|
158
|
+
const qr = /* @__PURE__ */ Dr(jr), P = {
|
|
159
159
|
"purpur-badge": "_purpur-badge_1r1mu_1",
|
|
160
160
|
"purpur-badge--attention": "_purpur-badge--attention_1r1mu_13",
|
|
161
161
|
"purpur-badge--special": "_purpur-badge--special_1r1mu_17",
|
|
@@ -476,10 +476,10 @@ const _e = /* @__PURE__ */ de(ce), V = {
|
|
|
476
476
|
}
|
|
477
477
|
) : null, we = {
|
|
478
478
|
"purpur-card-content": "_purpur-card-content_2uc00_1"
|
|
479
|
-
}, xe = f.bind(we),
|
|
479
|
+
}, xe = f.bind(we), Ce = "purpur-card-content", be = ({
|
|
480
480
|
["data-testid"]: e = "purpur-card-content",
|
|
481
481
|
children: o
|
|
482
|
-
}) => /* @__PURE__ */ l("div", { className: xe(
|
|
482
|
+
}) => /* @__PURE__ */ l("div", { className: xe(Ce), "data-testid": e, children: o }), Se = {
|
|
483
483
|
"purpur-card-content-container": "_purpur-card-content-container_dx1e4_1",
|
|
484
484
|
"purpur-card-content-container--footer": "_purpur-card-content-container--footer_dx1e4_7"
|
|
485
485
|
}, Ae = f.bind(Se), K = "purpur-card-content-container", Fe = ({
|
|
@@ -644,7 +644,7 @@ var _r = { exports: {} };
|
|
|
644
644
|
})();
|
|
645
645
|
})(_r);
|
|
646
646
|
var Le = _r.exports;
|
|
647
|
-
const
|
|
647
|
+
const De = /* @__PURE__ */ Re(Le), A = {
|
|
648
648
|
"purpur-paragraph": "_purpur-paragraph_1rh57_1",
|
|
649
649
|
"purpur-paragraph--disabled": "_purpur-paragraph--disabled_1rh57_7",
|
|
650
650
|
"purpur-paragraph--hyphens": "_purpur-paragraph--hyphens_1rh57_10",
|
|
@@ -659,7 +659,7 @@ const je = /* @__PURE__ */ Re(Le), A = {
|
|
|
659
659
|
"purpur-paragraph--additional-100-medium": "_purpur-paragraph--additional-100-medium_1rh57_60",
|
|
660
660
|
"purpur-paragraph--overline-100": "_purpur-paragraph--overline-100_1rh57_67",
|
|
661
661
|
"purpur-paragraph--overline-200": "_purpur-paragraph--overline-200_1rh57_75"
|
|
662
|
-
},
|
|
662
|
+
}, je = {
|
|
663
663
|
PARAGRAPH100: "paragraph-100",
|
|
664
664
|
PARAGRAPH100MEDIUM: "paragraph-100-medium",
|
|
665
665
|
PARAGRAPH100BOLD: "paragraph-100-bold",
|
|
@@ -677,10 +677,10 @@ const je = /* @__PURE__ */ Re(Le), A = {
|
|
|
677
677
|
disabled: n,
|
|
678
678
|
enableHyphenation: p = !1,
|
|
679
679
|
negative: r = !1,
|
|
680
|
-
variant: t =
|
|
680
|
+
variant: t = je.PARAGRAPH100,
|
|
681
681
|
...i
|
|
682
682
|
}) => {
|
|
683
|
-
const u =
|
|
683
|
+
const u = De([
|
|
684
684
|
a,
|
|
685
685
|
A[F],
|
|
686
686
|
A[`${F}--${t}`],
|
|
@@ -850,11 +850,10 @@ function x() {
|
|
|
850
850
|
return x = Object.assign ? Object.assign.bind() : function(e) {
|
|
851
851
|
for (var o = 1; o < arguments.length; o++) {
|
|
852
852
|
var a = arguments[o];
|
|
853
|
-
for (var n in a)
|
|
854
|
-
Object.prototype.hasOwnProperty.call(a, n) && (e[n] = a[n]);
|
|
853
|
+
for (var n in a) ({}).hasOwnProperty.call(a, n) && (e[n] = a[n]);
|
|
855
854
|
}
|
|
856
855
|
return e;
|
|
857
|
-
}, x.apply(
|
|
856
|
+
}, x.apply(null, arguments);
|
|
858
857
|
}
|
|
859
858
|
function i0(e, o) {
|
|
860
859
|
typeof e == "function" ? e(o) : e != null && (e.current = o);
|
|
@@ -868,24 +867,24 @@ const hr = /* @__PURE__ */ M((e, o) => {
|
|
|
868
867
|
const { children: a, ...n } = e, p = O.toArray(a), r = p.find(l0);
|
|
869
868
|
if (r) {
|
|
870
869
|
const t = r.props.children, i = p.map((u) => u === r ? O.count(t) > 1 ? O.only(null) : /* @__PURE__ */ I(t) ? t.props.children : null : u);
|
|
871
|
-
return /* @__PURE__ */ $(
|
|
870
|
+
return /* @__PURE__ */ $(j, x({}, n, {
|
|
872
871
|
ref: o
|
|
873
872
|
}), /* @__PURE__ */ I(t) ? /* @__PURE__ */ ar(t, void 0, i) : null);
|
|
874
873
|
}
|
|
875
|
-
return /* @__PURE__ */ $(
|
|
874
|
+
return /* @__PURE__ */ $(j, x({}, n, {
|
|
876
875
|
ref: o
|
|
877
876
|
}), a);
|
|
878
877
|
});
|
|
879
878
|
hr.displayName = "Slot";
|
|
880
|
-
const
|
|
879
|
+
const j = /* @__PURE__ */ M((e, o) => {
|
|
881
880
|
const { children: a, ...n } = e;
|
|
882
881
|
return /* @__PURE__ */ I(a) ? /* @__PURE__ */ ar(a, {
|
|
883
882
|
...s0(n, a.props),
|
|
884
883
|
ref: o ? n0(o, a.ref) : a.ref
|
|
885
884
|
}) : O.count(a) > 1 ? O.only(null) : null;
|
|
886
885
|
});
|
|
887
|
-
|
|
888
|
-
const p0 = ({ children: e }) => /* @__PURE__ */ $(
|
|
886
|
+
j.displayName = "SlotClone";
|
|
887
|
+
const p0 = ({ children: e }) => /* @__PURE__ */ $(Cr, null, e);
|
|
889
888
|
function l0(e) {
|
|
890
889
|
return /* @__PURE__ */ I(e) && e.type === p0;
|
|
891
890
|
}
|
|
@@ -1017,7 +1016,7 @@ const u0 = [
|
|
|
1017
1016
|
onClick: t,
|
|
1018
1017
|
screenReaderText: i,
|
|
1019
1018
|
variant: u,
|
|
1020
|
-
...
|
|
1019
|
+
...C
|
|
1021
1020
|
}, U) => {
|
|
1022
1021
|
const d = h0([
|
|
1023
1022
|
L,
|
|
@@ -1027,7 +1026,7 @@ const u0 = [
|
|
|
1027
1026
|
[`${L}--full-height`]: p
|
|
1028
1027
|
}
|
|
1029
1028
|
]);
|
|
1030
|
-
return /* @__PURE__ */ _("div", { className: d, "data-testid": e, ref: U, ...
|
|
1029
|
+
return /* @__PURE__ */ _("div", { className: d, "data-testid": e, ref: U, ...C, children: [
|
|
1031
1030
|
o,
|
|
1032
1031
|
(t || r) && i && /* @__PURE__ */ l(
|
|
1033
1032
|
f0,
|
|
@@ -1042,20 +1041,20 @@ const u0 = [
|
|
|
1042
1041
|
}
|
|
1043
1042
|
);
|
|
1044
1043
|
gr.displayName = "CardRoot";
|
|
1045
|
-
const tr = f.bind(Vr),
|
|
1044
|
+
const tr = f.bind(Vr), D = "purpur-card", v = ({ children: e, className: o, ...a }) => {
|
|
1046
1045
|
const n = tr([
|
|
1047
|
-
|
|
1046
|
+
D,
|
|
1048
1047
|
o,
|
|
1049
1048
|
{
|
|
1050
|
-
[`${
|
|
1051
|
-
[`${
|
|
1049
|
+
[`${D}--is-interactive`]: a.onClick || a.href,
|
|
1050
|
+
[`${D}--disabled`]: a.disabled
|
|
1052
1051
|
}
|
|
1053
1052
|
]);
|
|
1054
1053
|
return /* @__PURE__ */ l(gr, { className: tr(n), ...a, children: e });
|
|
1055
1054
|
};
|
|
1056
1055
|
v.Badge = ye;
|
|
1057
1056
|
v.LinkArrow = Je;
|
|
1058
|
-
v.Content =
|
|
1057
|
+
v.Content = be;
|
|
1059
1058
|
v.ContentContainer = Fe;
|
|
1060
1059
|
v.FeatureList = Te;
|
|
1061
1060
|
v.Overline = t0;
|
|
@@ -1135,7 +1134,7 @@ const v0 = /* @__PURE__ */ g0(m0), G = {
|
|
|
1135
1134
|
variant: t = y0.TITLE100,
|
|
1136
1135
|
...i
|
|
1137
1136
|
}) => {
|
|
1138
|
-
const u = r,
|
|
1137
|
+
const u = r, C = v0([
|
|
1139
1138
|
a,
|
|
1140
1139
|
G[Z],
|
|
1141
1140
|
G[`${Z}--${t}`],
|
|
@@ -1144,7 +1143,7 @@ const v0 = /* @__PURE__ */ g0(m0), G = {
|
|
|
1144
1143
|
[G[`${Z}--negative`]]: p
|
|
1145
1144
|
}
|
|
1146
1145
|
]);
|
|
1147
|
-
return /* @__PURE__ */ l(u, { ...i, className:
|
|
1146
|
+
return /* @__PURE__ */ l(u, { ...i, className: C, "data-testid": e, children: o });
|
|
1148
1147
|
};
|
|
1149
1148
|
vr.displayName = "Heading";
|
|
1150
1149
|
function w0(e) {
|
|
@@ -1187,22 +1186,22 @@ var yr = { exports: {} };
|
|
|
1187
1186
|
})();
|
|
1188
1187
|
})(yr);
|
|
1189
1188
|
var x0 = yr.exports;
|
|
1190
|
-
const
|
|
1191
|
-
"purpur-promotion-card": "_purpur-promotion-
|
|
1192
|
-
"purpur-promotion-card--without-image": "_purpur-promotion-card--without-
|
|
1193
|
-
"purpur-promotion-card--with-image": "_purpur-promotion-card--with-
|
|
1194
|
-
"purpur-promotion-card__card": "_purpur-promotion-
|
|
1195
|
-
"purpur-promotion-card__image-gradient": "_purpur-promotion-card__image-
|
|
1196
|
-
"purpur-promotion-card__content": "_purpur-promotion-
|
|
1197
|
-
"purpur-promotion-card__content--without-image": "_purpur-promotion-card__content--without-
|
|
1198
|
-
"purpur-promotion-card__main-content": "_purpur-promotion-card__main-
|
|
1199
|
-
"purpur-promotion-card__heading": "_purpur-promotion-
|
|
1200
|
-
"purpur-promotion-card__content--with-image": "_purpur-promotion-card__content--with-
|
|
1201
|
-
"purpur-promotion-card__badge-wrapper": "_purpur-promotion-card__badge-
|
|
1202
|
-
"purpur-promotion-card__body": "_purpur-promotion-
|
|
1203
|
-
"purpur-promotion-card__image-wrapper": "_purpur-promotion-card__image-
|
|
1204
|
-
"purpur-promotion-card__image-wrapper--decorative": "_purpur-promotion-card__image-wrapper--
|
|
1205
|
-
"purpur-promotion-card__image-wrapper--product": "_purpur-promotion-card__image-wrapper--
|
|
1189
|
+
const C0 = /* @__PURE__ */ w0(x0), b0 = {
|
|
1190
|
+
"purpur-promotion-card": "_purpur-promotion-card_1u1no_1",
|
|
1191
|
+
"purpur-promotion-card--without-image": "_purpur-promotion-card--without-image_1u1no_8",
|
|
1192
|
+
"purpur-promotion-card--with-image": "_purpur-promotion-card--with-image_1u1no_30",
|
|
1193
|
+
"purpur-promotion-card__card": "_purpur-promotion-card__card_1u1no_42",
|
|
1194
|
+
"purpur-promotion-card__image-gradient": "_purpur-promotion-card__image-gradient_1u1no_46",
|
|
1195
|
+
"purpur-promotion-card__content": "_purpur-promotion-card__content_1u1no_62",
|
|
1196
|
+
"purpur-promotion-card__content--without-image": "_purpur-promotion-card__content--without-image_1u1no_72",
|
|
1197
|
+
"purpur-promotion-card__main-content": "_purpur-promotion-card__main-content_1u1no_75",
|
|
1198
|
+
"purpur-promotion-card__heading": "_purpur-promotion-card__heading_1u1no_79",
|
|
1199
|
+
"purpur-promotion-card__content--with-image": "_purpur-promotion-card__content--with-image_1u1no_84",
|
|
1200
|
+
"purpur-promotion-card__badge-wrapper": "_purpur-promotion-card__badge-wrapper_1u1no_95",
|
|
1201
|
+
"purpur-promotion-card__body": "_purpur-promotion-card__body_1u1no_99",
|
|
1202
|
+
"purpur-promotion-card__image-wrapper": "_purpur-promotion-card__image-wrapper_1u1no_122",
|
|
1203
|
+
"purpur-promotion-card__image-wrapper--decorative": "_purpur-promotion-card__image-wrapper--decorative_1u1no_125",
|
|
1204
|
+
"purpur-promotion-card__image-wrapper--product": "_purpur-promotion-card__image-wrapper--product_1u1no_126"
|
|
1206
1205
|
}, M0 = ["primary", "secondary", "quaternary"], S0 = {
|
|
1207
1206
|
primary: "var(--purpur-color-background-tone-on-tone-primary)",
|
|
1208
1207
|
secondary: "var(--purpur-color-background-tone-on-tone-secondary)",
|
|
@@ -1215,7 +1214,7 @@ const b0 = /* @__PURE__ */ w0(x0), C0 = {
|
|
|
1215
1214
|
primary: "var(--purpur-color-text-tone-on-tone-primary)",
|
|
1216
1215
|
secondary: "var(--purpur-color-text-tone-on-tone-secondary)",
|
|
1217
1216
|
quaternary: "var(--purpur-color-text-tone-on-tone-tertiary)"
|
|
1218
|
-
}, c =
|
|
1217
|
+
}, c = C0.bind(b0), s = "purpur-promotion-card", k0 = ({
|
|
1219
1218
|
["data-testid"]: e,
|
|
1220
1219
|
variant: o = "primary",
|
|
1221
1220
|
badgeText: a,
|
|
@@ -1225,20 +1224,20 @@ const b0 = /* @__PURE__ */ w0(x0), C0 = {
|
|
|
1225
1224
|
titleVariant: t = "title-300",
|
|
1226
1225
|
enableTitleHyphenation: i = !0,
|
|
1227
1226
|
className: u,
|
|
1228
|
-
children:
|
|
1227
|
+
children: C,
|
|
1229
1228
|
style: U,
|
|
1230
1229
|
...d
|
|
1231
1230
|
}) => {
|
|
1232
1231
|
let E = d, h, N;
|
|
1233
1232
|
if ("decorativeImage" in d) {
|
|
1234
|
-
const { hasGradient:
|
|
1235
|
-
h = S, N =
|
|
1233
|
+
const { hasGradient: b, decorativeImage: S, ...R } = d;
|
|
1234
|
+
h = S, N = b, E = R;
|
|
1236
1235
|
} else if ("productImage" in d) {
|
|
1237
|
-
const { hasGradient:
|
|
1238
|
-
h = S, N =
|
|
1236
|
+
const { hasGradient: b, productImage: S, ...R } = d;
|
|
1237
|
+
h = S, N = b, E = R;
|
|
1239
1238
|
} else if ("hasGradient" in d) {
|
|
1240
|
-
const { hasGradient:
|
|
1241
|
-
N =
|
|
1239
|
+
const { hasGradient: b, ...S } = d;
|
|
1240
|
+
N = b, E = S;
|
|
1242
1241
|
}
|
|
1243
1242
|
const wr = {
|
|
1244
1243
|
"--promotion-card-background": S0[o],
|
|
@@ -1290,7 +1289,7 @@ const b0 = /* @__PURE__ */ w0(x0), C0 = {
|
|
|
1290
1289
|
children: p
|
|
1291
1290
|
}
|
|
1292
1291
|
),
|
|
1293
|
-
/* @__PURE__ */ l("div", { className: c(`${s}__body`), children:
|
|
1292
|
+
/* @__PURE__ */ l("div", { className: c(`${s}__body`), children: C })
|
|
1294
1293
|
] })
|
|
1295
1294
|
]
|
|
1296
1295
|
}
|