@purpurds/promotion-card 5.21.1 → 5.22.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpurds/promotion-card",
3
- "version": "5.21.1",
3
+ "version": "5.22.0",
4
4
  "license": "AGPL-3.0-only",
5
5
  "main": "./dist/promotion-card.cjs.js",
6
6
  "types": "./dist/promotion-card.d.ts",
@@ -16,13 +16,13 @@
16
16
  "source": "src/promotion-card.tsx",
17
17
  "dependencies": {
18
18
  "classnames": "~2.5.0",
19
- "@purpurds/badge": "5.21.1",
20
- "@purpurds/card": "5.21.1",
21
- "@purpurds/cta-link": "5.21.1",
22
- "@purpurds/heading": "5.21.1",
23
- "@purpurds/button": "5.21.1",
24
- "@purpurds/icon": "5.21.1",
25
- "@purpurds/tokens": "5.21.1"
19
+ "@purpurds/badge": "5.22.0",
20
+ "@purpurds/card": "5.22.0",
21
+ "@purpurds/heading": "5.22.0",
22
+ "@purpurds/cta-link": "5.22.0",
23
+ "@purpurds/icon": "5.22.0",
24
+ "@purpurds/tokens": "5.22.0",
25
+ "@purpurds/button": "5.22.0"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@rushstack/eslint-patch": "~1.10.0",
@@ -47,9 +47,9 @@
47
47
  "vite": "5.4.8",
48
48
  "vitest": "^2.1.2",
49
49
  "@purpurds/component-rig": "1.0.0",
50
- "@purpurds/text-spacing": "5.21.1",
51
- "@purpurds/grid": "5.21.1",
52
- "@purpurds/paragraph": "5.21.1"
50
+ "@purpurds/paragraph": "5.22.0",
51
+ "@purpurds/text-spacing": "5.22.0",
52
+ "@purpurds/grid": "5.22.0"
53
53
  },
54
54
  "scripts": {
55
55
  "build:dev": "vite",
@@ -1,4 +1,10 @@
1
- import React, { DetailedHTMLProps, HTMLAttributes, ReactNode } from "react";
1
+ import React, {
2
+ DetailedHTMLProps,
3
+ ForwardedRef,
4
+ forwardRef,
5
+ HTMLAttributes,
6
+ ReactNode,
7
+ } from "react";
2
8
  import { Badge } from "@purpurds/badge";
3
9
  import { Button } from "@purpurds/button";
4
10
  import { Card } from "@purpurds/card";
@@ -55,21 +61,24 @@ export type PromotionCardProps = {
55
61
  const cx = c.bind(styles);
56
62
  const rootClassName = "purpur-promotion-card";
57
63
 
58
- export const PromotionCard = ({
59
- ["data-testid"]: dataTestid,
60
- variant = "primary",
61
- badgeText,
62
- badgeIcon,
63
- title,
64
- titleTag = "h2",
65
- titleVariant = "title-300",
66
- enableTitleHyphenation = true,
67
- className,
68
- actions,
69
- children,
70
- style,
71
- ...props
72
- }: PromotionCardProps & DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>) => {
64
+ const PromotionCardComponent = (
65
+ {
66
+ ["data-testid"]: dataTestid,
67
+ variant = "primary",
68
+ badgeText,
69
+ badgeIcon,
70
+ title,
71
+ titleTag = "h2",
72
+ titleVariant = "title-300",
73
+ enableTitleHyphenation = true,
74
+ className,
75
+ actions,
76
+ children,
77
+ style,
78
+ ...props
79
+ }: PromotionCardProps & DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>,
80
+ ref: ForwardedRef<HTMLDivElement>
81
+ ) => {
73
82
  let rest = props;
74
83
  let image;
75
84
  let showGradient;
@@ -97,7 +106,7 @@ export const PromotionCard = ({
97
106
  } as React.CSSProperties;
98
107
 
99
108
  return (
100
- <Card className={cx(`${rootClassName}__card`)}>
109
+ <Card ref={ref} className={cx(`${rootClassName}__card`)}>
101
110
  <div
102
111
  data-testid={dataTestid}
103
112
  style={{
@@ -197,4 +206,5 @@ export const PromotionCard = ({
197
206
  );
198
207
  };
199
208
 
209
+ export const PromotionCard = forwardRef(PromotionCardComponent);
200
210
  PromotionCard.displayName = "PromotionCard";