@@ -4,11 +4,10 @@ import React, {
4
4
type ReactNode ,
5
5
type CSSProperties ,
6
6
DetailedHTMLProps ,
7
- ImgHTMLAttributes
7
+ ImgHTMLAttributes ,
8
+ ReactHTMLElement
8
9
} from "react" ;
9
10
import { symToStr } from "tsafe/symToStr" ;
10
- import { assert } from "tsafe/assert" ;
11
- import type { Equals } from "tsafe" ;
12
11
13
12
import type { FrIconClassName , RiIconClassName } from "./fr/generatedFromCss/classNames" ;
14
13
import { fr } from "./fr" ;
@@ -62,9 +61,11 @@ export type CardProps = {
62
61
>
63
62
> ;
64
63
style ?: CSSProperties ;
64
+ nativeDivElement ?: React . HTMLAttributes < HTMLDivElement > ;
65
65
} & ( CardProps . EnlargedLink | CardProps . NotEnlargedLink ) &
66
66
( CardProps . Horizontal | CardProps . Vertical ) &
67
- ( CardProps . WithImageLink | CardProps . WithImageComponent | CardProps . WithoutImage ) ;
67
+ ( CardProps . WithImageLink | CardProps . WithImageComponent | CardProps . WithoutImage ) &
68
+ React . HTMLAttributes < HTMLDivElement > ;
68
69
69
70
export namespace CardProps {
70
71
export type EnlargedLink = {
@@ -146,11 +147,10 @@ export const Card = memo(
146
147
grey = false ,
147
148
iconId,
148
149
style,
150
+ nativeDivElement = { } ,
149
151
...rest
150
152
} = props ;
151
153
152
- assert < Equals < keyof typeof rest , never > > ( ) ;
153
-
154
154
const id = useAnalyticsId ( {
155
155
"defaultIdPrefix" : "fr-card" ,
156
156
"explicitlyProvidedId" : props_id
@@ -161,6 +161,7 @@ export const Card = memo(
161
161
return (
162
162
< div
163
163
id = { id }
164
+ { ...nativeDivElement }
164
165
className = { cx (
165
166
fr . cx (
166
167
"fr-card" ,
0 commit comments