@hashicorp/react-components 0.0.0-nightly.f20702c → 0.0.0-nightly.f535c63
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": "@hashicorp/react-components",
|
|
3
|
-
"version": "0.0.0-nightly.
|
|
3
|
+
"version": "0.0.0-nightly.f535c63",
|
|
4
4
|
"main": "src/index.ts",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"lint": "next-hashicorp lint",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"test:watch": "vitest watch"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@hashicorp/flight-icons": "^3.
|
|
11
|
+
"@hashicorp/flight-icons": "^3.7.0",
|
|
12
12
|
"@hashicorp/platform-product-meta": "^0.1.1",
|
|
13
13
|
"@hashicorp/platform-util": "^0.2.0",
|
|
14
14
|
"@hashicorp/react-design-system-components": "*",
|
|
@@ -33,6 +33,7 @@ const Card = React.forwardRef<HTMLAnchorElement, CardPrimitiveProps>(
|
|
|
33
33
|
hasBorder = true,
|
|
34
34
|
children,
|
|
35
35
|
className,
|
|
36
|
+
'aria-label': ariaLabel,
|
|
36
37
|
} = props
|
|
37
38
|
|
|
38
39
|
const linkProps = isExternal
|
|
@@ -58,7 +59,7 @@ const Card = React.forwardRef<HTMLAnchorElement, CardPrimitiveProps>(
|
|
|
58
59
|
href={link}
|
|
59
60
|
ref={ref}
|
|
60
61
|
className={s.link}
|
|
61
|
-
aria-label={heading}
|
|
62
|
+
aria-label={ariaLabel ?? heading}
|
|
62
63
|
onClickCapture={clickHandler}
|
|
63
64
|
{...linkProps}
|
|
64
65
|
/>
|
|
@@ -10,14 +10,14 @@ import type { PersonCardProps } from './person-card'
|
|
|
10
10
|
import type { ResourceCardProps } from './resource-card'
|
|
11
11
|
import type { UnifiedCardProps } from './unified-card'
|
|
12
12
|
|
|
13
|
-
export interface BaseCardProps
|
|
13
|
+
export interface BaseCardProps
|
|
14
|
+
extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
14
15
|
withArrow?: boolean
|
|
15
16
|
heading: string
|
|
16
17
|
link: string
|
|
17
18
|
clickHandler?: () => void
|
|
18
19
|
isExternal?: boolean
|
|
19
20
|
hasBorder?: boolean
|
|
20
|
-
className?: string
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
export interface CardPrimitiveProps extends BaseCardProps {
|
|
@@ -6,18 +6,10 @@
|
|
|
6
6
|
import type { ReactNode } from 'react'
|
|
7
7
|
import Badge from '@hashicorp/react-design-system-components/src/components/badge'
|
|
8
8
|
import * as CardPrimitives from '../primitives'
|
|
9
|
-
import type { CardProps
|
|
9
|
+
import type { CardProps } from '../types'
|
|
10
10
|
|
|
11
|
-
export interface UnifiedCardProps {
|
|
12
|
-
heading: string
|
|
13
|
-
meta?: string[]
|
|
14
|
-
link: string
|
|
15
|
-
productBadges?: CardProps['productBadges']
|
|
11
|
+
export interface UnifiedCardProps extends CardProps {
|
|
16
12
|
badges?: (string | [ReactNode, string])[]
|
|
17
|
-
thumbnail?: ThumbnailProps
|
|
18
|
-
withArrow?: boolean
|
|
19
|
-
isExternal?: boolean
|
|
20
|
-
className?: string
|
|
21
13
|
}
|
|
22
14
|
|
|
23
15
|
export function UnifiedCard({
|
|
@@ -30,6 +22,7 @@ export function UnifiedCard({
|
|
|
30
22
|
withArrow = false,
|
|
31
23
|
isExternal = false,
|
|
32
24
|
className,
|
|
25
|
+
'aria-label': ariaLabel,
|
|
33
26
|
}: UnifiedCardProps) {
|
|
34
27
|
return (
|
|
35
28
|
<CardPrimitives.Card
|
|
@@ -38,6 +31,7 @@ export function UnifiedCard({
|
|
|
38
31
|
withArrow={withArrow}
|
|
39
32
|
isExternal={isExternal}
|
|
40
33
|
className={className}
|
|
34
|
+
aria-label={ariaLabel ?? heading}
|
|
41
35
|
>
|
|
42
36
|
{thumbnail ? <CardPrimitives.Thumbnail {...thumbnail} /> : null}
|
|
43
37
|
<CardPrimitives.Content>
|