@purpurds/card 7.6.1 → 7.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 +5 -5
- package/dist/card-content-container.d.ts +4 -7
- package/dist/card-content-container.d.ts.map +1 -1
- package/dist/card-content.d.ts +2 -5
- package/dist/card-content.d.ts.map +1 -1
- package/dist/card-cta.d.ts +3 -4
- package/dist/card-cta.d.ts.map +1 -1
- package/dist/card-heading.d.ts +4 -3
- package/dist/card-heading.d.ts.map +1 -1
- package/dist/card-media-layout.d.ts +3 -4
- package/dist/card-media-layout.d.ts.map +1 -1
- package/dist/card-media.d.ts +3 -5
- package/dist/card-media.d.ts.map +1 -1
- package/dist/card-root.d.ts +3 -6
- package/dist/card-root.d.ts.map +1 -1
- package/dist/card.cjs.js +8 -8
- package/dist/card.cjs.js.map +1 -1
- package/dist/card.es.js +214 -259
- package/dist/card.es.js.map +1 -1
- package/package.json +12 -11
- package/src/card-badge.test.tsx +1 -1
- package/src/card-content-container.test.tsx +1 -1
- package/src/card-content-container.tsx +4 -7
- package/src/card-content.tsx +2 -5
- package/src/card-cta.tsx +3 -4
- package/src/card-feature-list.test.tsx +1 -1
- package/src/card-heading.test.tsx +1 -1
- package/src/card-heading.tsx +5 -4
- package/src/card-media-layout.tsx +3 -4
- package/src/card-media.tsx +3 -5
- package/src/card-overline.test.tsx +1 -1
- package/src/card-root.test.tsx +1 -1
- package/src/card-root.tsx +6 -15
- package/src/card.stories.tsx +3 -3
package/src/card-root.tsx
CHANGED
|
@@ -1,21 +1,12 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
|
|
3
|
-
type ForwardedRef,
|
|
4
|
-
forwardRef,
|
|
5
|
-
type HTMLAttributes,
|
|
6
|
-
type ReactNode,
|
|
7
|
-
} from "react";
|
|
1
|
+
import React, { forwardRef, type ReactNode } from "react";
|
|
2
|
+
import type { BaseProps } from "@purpurds/common-types";
|
|
8
3
|
import c from "classnames/bind";
|
|
9
4
|
|
|
10
5
|
import styles from "./card-root.module.scss";
|
|
11
6
|
|
|
12
7
|
const cx = c.bind(styles);
|
|
13
8
|
|
|
14
|
-
export type CardRootProps =
|
|
15
|
-
/**
|
|
16
|
-
* Use this to set a testid on the card
|
|
17
|
-
*/
|
|
18
|
-
["data-testid"]?: string;
|
|
9
|
+
export type CardRootProps = Omit<BaseProps, "children"> & {
|
|
19
10
|
children: ReactNode;
|
|
20
11
|
fullHeight?: boolean;
|
|
21
12
|
variant?: "primary" | "secondary";
|
|
@@ -23,7 +14,7 @@ export type CardRootProps = DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HT
|
|
|
23
14
|
|
|
24
15
|
const rootClassName = "purpur-card-root";
|
|
25
16
|
|
|
26
|
-
export const CardRoot = forwardRef(
|
|
17
|
+
export const CardRoot = forwardRef<HTMLDivElement, CardRootProps>(
|
|
27
18
|
(
|
|
28
19
|
{
|
|
29
20
|
["data-testid"]: dataTestId = "purpur-card-root",
|
|
@@ -32,8 +23,8 @@ export const CardRoot = forwardRef(
|
|
|
32
23
|
fullHeight = true,
|
|
33
24
|
variant,
|
|
34
25
|
...props
|
|
35
|
-
}
|
|
36
|
-
ref
|
|
26
|
+
},
|
|
27
|
+
ref
|
|
37
28
|
) => {
|
|
38
29
|
const classes = cx([
|
|
39
30
|
rootClassName,
|
package/src/card.stories.tsx
CHANGED
|
@@ -86,7 +86,7 @@ export const CardWithHeading: Story = {
|
|
|
86
86
|
<Card.Heading
|
|
87
87
|
title="Tips and tricks"
|
|
88
88
|
icon={<IconSimcard size="sm" />}
|
|
89
|
-
href="/?path=/docs/
|
|
89
|
+
href="/?path=/docs/layout-and-structure-card--docs"
|
|
90
90
|
>
|
|
91
91
|
<Card.Cta linkStyling>
|
|
92
92
|
<IconArrowRight size="sm" />
|
|
@@ -221,7 +221,7 @@ export const CardHeadingWithCustomLinkElement: Story = {
|
|
|
221
221
|
<Card>
|
|
222
222
|
<Card.Heading
|
|
223
223
|
title="Tips and tricks"
|
|
224
|
-
href="/?path=/docs/
|
|
224
|
+
href="/?path=/docs/layout-and-structure-card--docs"
|
|
225
225
|
linkElement={React.forwardRef(
|
|
226
226
|
(
|
|
227
227
|
{ href, children }: { href?: string; children?: React.ReactNode },
|
|
@@ -253,7 +253,7 @@ export const CardHeadingWithCustomLinkElement: Story = {
|
|
|
253
253
|
<Card {...args}>
|
|
254
254
|
<Card.Heading
|
|
255
255
|
title="Tips and tricks"
|
|
256
|
-
href="/?path=/docs/
|
|
256
|
+
href="/?path=/docs/layout-and-structure-card--docs"
|
|
257
257
|
linkElement={LinkElement}
|
|
258
258
|
></Card.Heading>
|
|
259
259
|
</Card>
|