@purpurds/promotion-card 8.5.2 → 8.7.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.
- package/dist/LICENSE.txt +4 -4
- package/dist/metadata.js +2 -0
- package/dist/promotion-card.cjs.js +7 -7
- package/dist/promotion-card.cjs.js.map +1 -1
- package/dist/promotion-card.d.ts +9 -11
- package/dist/promotion-card.d.ts.map +1 -1
- package/dist/promotion-card.es.js +41 -41
- package/dist/promotion-card.es.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +13 -13
- package/src/promotion-card.module.scss +6 -0
- package/src/promotion-card.tsx +4 -1
package/dist/promotion-card.d.ts
CHANGED
|
@@ -5,6 +5,12 @@ import { ColorScheme } from '@purpurds/theme';
|
|
|
5
5
|
|
|
6
6
|
export declare const promotionCardVariants: readonly ["primary", "secondary", "quaternary"];
|
|
7
7
|
export type PromotionCardVariant = (typeof promotionCardVariants)[number];
|
|
8
|
+
export type PromotionCardDecorativeImage = {
|
|
9
|
+
decorativeImage?: ReactNode;
|
|
10
|
+
};
|
|
11
|
+
export type PromotionCardProductImage = {
|
|
12
|
+
productImage?: ReactNode;
|
|
13
|
+
};
|
|
8
14
|
export type PromotionCardProps = Omit<BaseProps, "children"> & {
|
|
9
15
|
variant?: PromotionCardVariant;
|
|
10
16
|
title: string;
|
|
@@ -22,11 +28,7 @@ export type PromotionCardProps = Omit<BaseProps, "children"> & {
|
|
|
22
28
|
* @deprecated Gradient has been removed from both design and implementation. This prop will be removed in the next major release.
|
|
23
29
|
*/
|
|
24
30
|
hasGradient?: boolean;
|
|
25
|
-
} & (
|
|
26
|
-
decorativeImage?: ReactNode;
|
|
27
|
-
} | {
|
|
28
|
-
productImage?: ReactNode;
|
|
29
|
-
});
|
|
31
|
+
} & (PromotionCardDecorativeImage | PromotionCardProductImage);
|
|
30
32
|
export declare const PromotionCard: React.ForwardRefExoticComponent<(Omit<Omit<React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement> & {
|
|
31
33
|
[key: `data-${string}`]: string | undefined;
|
|
32
34
|
}, "children"> & {
|
|
@@ -46,9 +48,7 @@ export declare const PromotionCard: React.ForwardRefExoticComponent<(Omit<Omit<R
|
|
|
46
48
|
* @deprecated Gradient has been removed from both design and implementation. This prop will be removed in the next major release.
|
|
47
49
|
*/
|
|
48
50
|
hasGradient?: boolean;
|
|
49
|
-
} & {
|
|
50
|
-
decorativeImage?: ReactNode;
|
|
51
|
-
}, "ref"> | Omit<Omit<React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement> & {
|
|
51
|
+
} & PromotionCardDecorativeImage, "ref"> | Omit<Omit<React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement> & {
|
|
52
52
|
[key: `data-${string}`]: string | undefined;
|
|
53
53
|
}, "children"> & {
|
|
54
54
|
variant?: PromotionCardVariant;
|
|
@@ -67,7 +67,5 @@ export declare const PromotionCard: React.ForwardRefExoticComponent<(Omit<Omit<R
|
|
|
67
67
|
* @deprecated Gradient has been removed from both design and implementation. This prop will be removed in the next major release.
|
|
68
68
|
*/
|
|
69
69
|
hasGradient?: boolean;
|
|
70
|
-
} &
|
|
71
|
-
productImage?: ReactNode;
|
|
72
|
-
}, "ref">) & React.RefAttributes<HTMLDivElement>>;
|
|
70
|
+
} & PromotionCardProductImage, "ref">) & React.RefAttributes<HTMLDivElement>>;
|
|
73
71
|
//# sourceMappingURL=promotion-card.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"promotion-card.d.ts","sourceRoot":"","sources":["../src/promotion-card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAc,KAAK,SAAS,EAAS,MAAM,OAAO,CAAC;AAGjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAW,KAAK,cAAc,EAAE,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEt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16 @@ const $e = /* @__PURE__ */ be(Se), Fe = {
|
|
|
320
320
|
"purpur-icon--md": "_purpur-icon--md_8u1lq_16",
|
|
321
321
|
"purpur-icon--lg": "_purpur-icon--lg_8u1lq_20",
|
|
322
322
|
"purpur-icon--xl": "_purpur-icon--xl_8u1lq_24"
|
|
323
|
-
}, Be = $e.bind(Fe), sr = "purpur-icon", Ae = "md",
|
|
323
|
+
}, Be = $e.bind(Fe), sr = "purpur-icon", Ae = "md", ke = (e) => e.filter((o) => Object.keys(o).length >= 1).map((o) => `${o.name}="${o.value}"`).join(" "), Oe = ({ content: e = "", title: o } = {}) => {
|
|
324
324
|
const a = [
|
|
325
325
|
{ name: "xmlns", value: "http://www.w3.org/2000/svg" },
|
|
326
326
|
{ name: "fill", value: "currentColor" },
|
|
327
327
|
{ name: "viewBox", value: "0 0 24 24" },
|
|
328
328
|
o ? { name: "role", value: "img" } : { name: "aria-hidden", value: "true" }
|
|
329
329
|
], n = o ? `<title>${o}</title>` : "";
|
|
330
|
-
return `<svg ${
|
|
330
|
+
return `<svg ${ke(a)}>${n}${e}</svg>`;
|
|
331
331
|
}, Me = (e) => e.replace(/<(\/?)svg([^>]*)>/g, "").trim(), Nr = ({ svg: e, allyTitle: o, className: a, size: n = Ae, ...p }) => {
|
|
332
|
-
const r =
|
|
332
|
+
const r = Oe({
|
|
333
333
|
content: Me(e.svg),
|
|
334
334
|
title: o
|
|
335
335
|
}), t = Be(sr, `${sr}--${n}`, a);
|
|
@@ -517,7 +517,7 @@ const _r = /* @__PURE__ */ Le(Pe), H = {
|
|
|
517
517
|
"purpur-card-content-container--gap-size--md": "_purpur-card-content-container--gap-size--md_2oha5_39",
|
|
518
518
|
"purpur-card-content-container--gap-size--lg": "_purpur-card-content-container--gap-size--lg_2oha5_42",
|
|
519
519
|
"purpur-card-content-container--gap-size--xl": "_purpur-card-content-container--gap-size--xl_2oha5_45"
|
|
520
|
-
}, rt = d.bind(Xe),
|
|
520
|
+
}, rt = d.bind(Xe), k = "purpur-card-content-container", et = ({
|
|
521
521
|
["data-testid"]: e = "purpur-card-content-container",
|
|
522
522
|
children: o,
|
|
523
523
|
className: a,
|
|
@@ -529,12 +529,12 @@ const _r = /* @__PURE__ */ Le(Pe), H = {
|
|
|
529
529
|
"div",
|
|
530
530
|
{
|
|
531
531
|
className: rt([
|
|
532
|
-
|
|
532
|
+
k,
|
|
533
533
|
a,
|
|
534
|
-
`${
|
|
534
|
+
`${k}--gap-size--${r}`,
|
|
535
535
|
{
|
|
536
|
-
[`${
|
|
537
|
-
[`${
|
|
536
|
+
[`${k}--full-height`]: p,
|
|
537
|
+
[`${k}--footer`]: n
|
|
538
538
|
}
|
|
539
539
|
]),
|
|
540
540
|
"data-testid": e,
|
|
@@ -804,7 +804,7 @@ const Bt = /* @__PURE__ */ St(Ft), At = {
|
|
|
804
804
|
"purpur-paragraph--additional-100-medium": "_purpur-paragraph--additional-100-medium_1rh57_60",
|
|
805
805
|
"purpur-paragraph--overline-100": "_purpur-paragraph--overline-100_1rh57_67",
|
|
806
806
|
"purpur-paragraph--overline-200": "_purpur-paragraph--overline-200_1rh57_75"
|
|
807
|
-
},
|
|
807
|
+
}, kt = Bt.bind(At), Ot = {
|
|
808
808
|
PARAGRAPH100: "paragraph-100"
|
|
809
809
|
}, $ = "purpur-paragraph", Q = ({
|
|
810
810
|
children: e,
|
|
@@ -812,10 +812,10 @@ const Bt = /* @__PURE__ */ St(Ft), At = {
|
|
|
812
812
|
disabled: a,
|
|
813
813
|
enableHyphenation: n = !1,
|
|
814
814
|
negative: p = !1,
|
|
815
|
-
variant: r =
|
|
815
|
+
variant: r = Ot.PARAGRAPH100,
|
|
816
816
|
...t
|
|
817
817
|
}) => {
|
|
818
|
-
const i =
|
|
818
|
+
const i = kt(o, $, `${$}--${r}`, {
|
|
819
819
|
[`${$}--hyphens`]: n,
|
|
820
820
|
[`${$}--disabled`]: a,
|
|
821
821
|
[`${$}--negative`]: p
|
|
@@ -885,7 +885,7 @@ function Zt() {
|
|
|
885
885
|
})(br)), br.exports;
|
|
886
886
|
}
|
|
887
887
|
var Et = Zt();
|
|
888
|
-
const Ut = /* @__PURE__ */ Nt(Et),
|
|
888
|
+
const Ut = /* @__PURE__ */ Nt(Et), O = {
|
|
889
889
|
"purpur-heading": "_purpur-heading_vo751_1",
|
|
890
890
|
"purpur-heading--hyphens": "_purpur-heading--hyphens_vo751_8",
|
|
891
891
|
"purpur-heading--negative": "_purpur-heading--negative_vo751_11",
|
|
@@ -918,11 +918,11 @@ const Ut = /* @__PURE__ */ Nt(Et), k = {
|
|
|
918
918
|
}) => {
|
|
919
919
|
const i = p, s = Ut([
|
|
920
920
|
o,
|
|
921
|
-
|
|
922
|
-
|
|
921
|
+
O[M],
|
|
922
|
+
O[`${M}--${r}`],
|
|
923
923
|
{
|
|
924
|
-
[
|
|
925
|
-
[
|
|
924
|
+
[O[`${M}--hyphens`]]: a,
|
|
925
|
+
[O[`${M}--negative`]]: n
|
|
926
926
|
}
|
|
927
927
|
]);
|
|
928
928
|
return /* @__PURE__ */ l(i, { className: s, ...t, children: e });
|
|
@@ -1077,11 +1077,11 @@ const Dt = {
|
|
|
1077
1077
|
}, t) => {
|
|
1078
1078
|
const i = ra([
|
|
1079
1079
|
z,
|
|
1080
|
-
a,
|
|
1081
1080
|
{
|
|
1082
1081
|
[`${z}--${p}`]: p,
|
|
1083
1082
|
[`${z}--full-height`]: n
|
|
1084
|
-
}
|
|
1083
|
+
},
|
|
1084
|
+
a
|
|
1085
1085
|
]);
|
|
1086
1086
|
return /* @__PURE__ */ l("div", { className: i, "data-testid": e, ref: t, ...r, children: o });
|
|
1087
1087
|
}
|
|
@@ -1206,9 +1206,9 @@ var Ar = { exports: {} };
|
|
|
1206
1206
|
Licensed under the MIT License (MIT), see
|
|
1207
1207
|
http://jedwatson.github.io/classnames
|
|
1208
1208
|
*/
|
|
1209
|
-
var
|
|
1209
|
+
var kr;
|
|
1210
1210
|
function pa() {
|
|
1211
|
-
return
|
|
1211
|
+
return kr || (kr = 1, (function(e) {
|
|
1212
1212
|
(function() {
|
|
1213
1213
|
var o = {}.hasOwnProperty;
|
|
1214
1214
|
function a() {
|
|
@@ -1283,9 +1283,9 @@ var K = { exports: {} };
|
|
|
1283
1283
|
Licensed under the MIT License (MIT), see
|
|
1284
1284
|
http://jedwatson.github.io/classnames
|
|
1285
1285
|
*/
|
|
1286
|
-
var
|
|
1286
|
+
var Or;
|
|
1287
1287
|
function fa() {
|
|
1288
|
-
return
|
|
1288
|
+
return Or || (Or = 1, (function(e) {
|
|
1289
1289
|
(function() {
|
|
1290
1290
|
var o = {}.hasOwnProperty;
|
|
1291
1291
|
function a() {
|
|
@@ -1318,25 +1318,25 @@ function fa() {
|
|
|
1318
1318
|
}
|
|
1319
1319
|
var ha = fa();
|
|
1320
1320
|
const ga = /* @__PURE__ */ _a(ha), ma = {
|
|
1321
|
-
"purpur-promotion-card": "_purpur-promotion-
|
|
1322
|
-
"purpur-promotion-card__inner": "_purpur-promotion-
|
|
1323
|
-
"purpur-promotion-card__inner--without-image": "_purpur-promotion-card__inner--without-
|
|
1324
|
-
"purpur-promotion-card__content": "_purpur-promotion-
|
|
1325
|
-
"purpur-promotion-card__inner--with-image": "_purpur-promotion-card__inner--with-
|
|
1326
|
-
"purpur-promotion-card__actions": "_purpur-promotion-
|
|
1327
|
-
"purpur-promotion-card__content--without-image": "_purpur-promotion-card__content--without-
|
|
1328
|
-
"purpur-promotion-card__main-content": "_purpur-promotion-card__main-
|
|
1329
|
-
"purpur-promotion-card__heading": "_purpur-promotion-
|
|
1330
|
-
"purpur-promotion-card__content--with-image": "_purpur-promotion-card__content--with-
|
|
1331
|
-
"purpur-promotion-card__badge-wrapper": "_purpur-promotion-card__badge-
|
|
1332
|
-
"purpur-promotion-card__body": "_purpur-promotion-
|
|
1333
|
-
"purpur-promotion-card__main-content--space-between": "_purpur-promotion-card__main-content--space-
|
|
1334
|
-
"purpur-promotion-card__main-content--flex-end": "_purpur-promotion-card__main-content--flex-
|
|
1335
|
-
"purpur-promotion-card__child-content": "_purpur-promotion-card__child-
|
|
1336
|
-
"purpur-promotion-card__additional-text": "_purpur-promotion-card__additional-
|
|
1337
|
-
"purpur-promotion-card__image-wrapper": "_purpur-promotion-card__image-
|
|
1338
|
-
"purpur-promotion-card__image-wrapper--decorative": "_purpur-promotion-card__image-wrapper--
|
|
1339
|
-
"purpur-promotion-card__image-wrapper--product": "_purpur-promotion-card__image-wrapper--
|
|
1321
|
+
"purpur-promotion-card": "_purpur-promotion-card_1kw9a_1",
|
|
1322
|
+
"purpur-promotion-card__inner": "_purpur-promotion-card__inner_1kw9a_9",
|
|
1323
|
+
"purpur-promotion-card__inner--without-image": "_purpur-promotion-card__inner--without-image_1kw9a_12",
|
|
1324
|
+
"purpur-promotion-card__content": "_purpur-promotion-card__content_1kw9a_12",
|
|
1325
|
+
"purpur-promotion-card__inner--with-image": "_purpur-promotion-card__inner--with-image_1kw9a_37",
|
|
1326
|
+
"purpur-promotion-card__actions": "_purpur-promotion-card__actions_1kw9a_49",
|
|
1327
|
+
"purpur-promotion-card__content--without-image": "_purpur-promotion-card__content--without-image_1kw9a_71",
|
|
1328
|
+
"purpur-promotion-card__main-content": "_purpur-promotion-card__main-content_1kw9a_74",
|
|
1329
|
+
"purpur-promotion-card__heading": "_purpur-promotion-card__heading_1kw9a_79",
|
|
1330
|
+
"purpur-promotion-card__content--with-image": "_purpur-promotion-card__content--with-image_1kw9a_84",
|
|
1331
|
+
"purpur-promotion-card__badge-wrapper": "_purpur-promotion-card__badge-wrapper_1kw9a_95",
|
|
1332
|
+
"purpur-promotion-card__body": "_purpur-promotion-card__body_1kw9a_99",
|
|
1333
|
+
"purpur-promotion-card__main-content--space-between": "_purpur-promotion-card__main-content--space-between_1kw9a_110",
|
|
1334
|
+
"purpur-promotion-card__main-content--flex-end": "_purpur-promotion-card__main-content--flex-end_1kw9a_113",
|
|
1335
|
+
"purpur-promotion-card__child-content": "_purpur-promotion-card__child-content_1kw9a_133",
|
|
1336
|
+
"purpur-promotion-card__additional-text": "_purpur-promotion-card__additional-text_1kw9a_136",
|
|
1337
|
+
"purpur-promotion-card__image-wrapper": "_purpur-promotion-card__image-wrapper_1kw9a_139",
|
|
1338
|
+
"purpur-promotion-card__image-wrapper--decorative": "_purpur-promotion-card__image-wrapper--decorative_1kw9a_142",
|
|
1339
|
+
"purpur-promotion-card__image-wrapper--product": "_purpur-promotion-card__image-wrapper--product_1kw9a_143"
|
|
1340
1340
|
}, $a = ["primary", "secondary", "quaternary"], va = {
|
|
1341
1341
|
primary: "var(--purpur-color-background-tone-on-tone-primary)",
|
|
1342
1342
|
secondary: "var(--purpur-color-background-tone-on-tone-secondary)",
|