@purpurds/promotion-card 7.3.1 → 7.5.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 CHANGED
@@ -1,26 +1,26 @@
1
1
  Name: @purpurds/badge
2
- Version: 7.3.0
2
+ Version: 7.4.0
3
3
  License: AGPL-3.0-only
4
4
  Private: false
5
5
 
6
6
  ---
7
7
 
8
8
  Name: @purpurds/card
9
- Version: 7.3.0
9
+ Version: 7.4.0
10
10
  License: AGPL-3.0-only
11
11
  Private: false
12
12
 
13
13
  ---
14
14
 
15
15
  Name: @purpurds/heading
16
- Version: 7.3.0
16
+ Version: 7.4.0
17
17
  License: AGPL-3.0-only
18
18
  Private: false
19
19
 
20
20
  ---
21
21
 
22
22
  Name: @purpurds/paragraph
23
- Version: 7.3.0
23
+ Version: 7.4.0
24
24
  License: AGPL-3.0-only
25
25
  Private: false
26
26
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpurds/promotion-card",
3
- "version": "7.3.1",
3
+ "version": "7.5.0",
4
4
  "license": "AGPL-3.0-only",
5
5
  "main": "./dist/promotion-card.cjs.js",
6
6
  "types": "./dist/promotion-card.d.ts",
@@ -17,14 +17,14 @@
17
17
  "source": "src/promotion-card.tsx",
18
18
  "dependencies": {
19
19
  "classnames": "~2.5.0",
20
- "@purpurds/badge": "7.3.1",
21
- "@purpurds/button": "7.3.1",
22
- "@purpurds/cta-link": "7.3.1",
23
- "@purpurds/heading": "7.3.1",
24
- "@purpurds/paragraph": "7.3.1",
25
- "@purpurds/icon": "7.3.1",
26
- "@purpurds/card": "7.3.1",
27
- "@purpurds/tokens": "7.3.1"
20
+ "@purpurds/badge": "7.5.0",
21
+ "@purpurds/cta-link": "7.5.0",
22
+ "@purpurds/button": "7.5.0",
23
+ "@purpurds/heading": "7.5.0",
24
+ "@purpurds/card": "7.5.0",
25
+ "@purpurds/paragraph": "7.5.0",
26
+ "@purpurds/tokens": "7.5.0",
27
+ "@purpurds/icon": "7.5.0"
28
28
  },
29
29
  "devDependencies": {
30
30
  "eslint": "9.24.0",
@@ -45,8 +45,8 @@
45
45
  "vite": "^6.2.1",
46
46
  "vitest": "^3.1.2",
47
47
  "@purpurds/component-rig": "1.0.0",
48
- "@purpurds/text-spacing": "7.3.1",
49
- "@purpurds/grid": "7.3.1"
48
+ "@purpurds/text-spacing": "7.5.0",
49
+ "@purpurds/grid": "7.5.0"
50
50
  },
51
51
  "peerDependencies": {
52
52
  "@types/react": "^18 || ^19",
@@ -17,7 +17,7 @@ import "@purpurds/heading/styles";
17
17
  import "@purpurds/paragraph/styles";
18
18
  import "@purpurds/icon/styles";
19
19
  import "@purpurds/paragraph/styles";
20
- import { PromotionCard, promotionCardVariants } from "./promotion-card";
20
+ import { PromotionCard, type PromotionCardVariant, promotionCardVariants } from "./promotion-card";
21
21
 
22
22
  const meta = {
23
23
  title: "Components/PromotionCard",
@@ -36,16 +36,6 @@ const meta = {
36
36
  badgeText: "Badge title",
37
37
  badgeIcon: <IconOffering size="xs" />,
38
38
  title: "Title goes here lorem ipsum",
39
- actions: (
40
- <>
41
- <CtaLink variant="primary" href="#" negative>
42
- Primary link
43
- </CtaLink>
44
- <CtaLink variant="secondary" href="#" negative>
45
- Secondary link
46
- </CtaLink>
47
- </>
48
- ),
49
39
  additionalText: "Additional texts such as legal ones",
50
40
  enableTitleHyphenation: false,
51
41
  },
@@ -89,6 +79,17 @@ const meta = {
89
79
  },
90
80
  } satisfies Meta<typeof PromotionCard>;
91
81
 
82
+ const getActions = (variant?: PromotionCardVariant) => (
83
+ <>
84
+ <CtaLink variant="primary" href="#" negative={variant === "primary"}>
85
+ Primary link
86
+ </CtaLink>
87
+ <CtaLink variant="secondary" href="#" negative={variant === "primary"}>
88
+ Secondary link
89
+ </CtaLink>
90
+ </>
91
+ );
92
+
92
93
  export default meta;
93
94
  type Story = StoryObj<typeof PromotionCard>;
94
95
 
@@ -131,7 +132,7 @@ export const WithDecorativeImage: Story = {
131
132
  },
132
133
  render: (args) => {
133
134
  return (
134
- <PromotionCard {...args}>
135
+ <PromotionCard actions={getActions(args.variant)} {...args}>
135
136
  <Children />
136
137
  </PromotionCard>
137
138
  );
@@ -160,7 +161,7 @@ export const WithProductImage: Story = {
160
161
  },
161
162
  render: (args) => {
162
163
  return (
163
- <PromotionCard {...args}>
164
+ <PromotionCard actions={getActions(args.variant)} {...args}>
164
165
  <Children />
165
166
  </PromotionCard>
166
167
  );
@@ -182,13 +183,13 @@ export const CardGroup: Story = {
182
183
  render: (args) => {
183
184
  return (
184
185
  <Grid colsMd={3}>
185
- <PromotionCard {...args} title="Lorem">
186
+ <PromotionCard {...args} actions={getActions(args.variant)} title="Lorem">
186
187
  <Paragraph>Buy mobile telephony!</Paragraph>
187
188
  </PromotionCard>
188
189
  <PromotionCard
189
190
  {...args}
190
191
  actions={
191
- <CtaLink variant="primary" href="#" negative>
192
+ <CtaLink variant="primary" href="#" negative={args.variant === "primary"}>
192
193
  Primary link
193
194
  </CtaLink>
194
195
  }
@@ -210,7 +211,13 @@ export const CardGroup: Story = {
210
211
  };
211
212
 
212
213
  export const Showcase: Story = {
213
- args: { children: <Children /> },
214
+ render: (args) => {
215
+ return (
216
+ <PromotionCard actions={getActions(args.variant)} {...args}>
217
+ <Children />
218
+ </PromotionCard>
219
+ );
220
+ },
214
221
  tags: ["visual:check"],
215
222
  };
216
223