Skip to content

Commit 5aaf0aa

Browse files
committed
Add jsdocs
1 parent b5b12ab commit 5aaf0aa

File tree

1 file changed

+68
-0
lines changed

1 file changed

+68
-0
lines changed

src/components/card2/CardRadio.tsx

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,88 @@ import generateRandomString from '../../js/generateRandomString';
55
import {useCardRadioGroupContext} from './CardRadioGroupContext';
66

77
export interface CardRadioPropsType {
8+
/**
9+
* Required string. Value of the CardRadio input.
10+
*/
811
value: string;
12+
13+
/**
14+
* Optional boolean. Whether the Radio is required.
15+
* @default false
16+
*/
917
required?: boolean;
18+
19+
/**
20+
* Optional boolean. Whether the Radio is disabled.
21+
* @default false
22+
*/
1023
disabled?: boolean;
24+
25+
/**
26+
* Optional boolean. Whether the Radio is invalid.
27+
* @default false
28+
*/
1129
invalid?: boolean;
30+
31+
/**
32+
* Optional string. ID of the Radio.
33+
*/
1234
id?: string;
35+
36+
/**
37+
* Optional string. Variant of the card. Default is 'outline'.
38+
*/
1339
variant?: 'solid' | 'outline';
40+
41+
/**
42+
* Optional string. Color of the card. Default is 'dark'.
43+
*/
1444
color?: 'light' | 'dark';
45+
46+
/**
47+
* Optional string. Additional class names.
48+
*/
1549
className?: string;
50+
51+
/**
52+
* Optional React.ReactNode. Children of the card. This is the place where label should be used and connected to the card.
53+
* @example <CardRadio>Card content</CardRadio>
54+
*/
1655
children?: React.ReactNode;
56+
57+
/**
58+
* Optional string. Width of the card.
59+
* @default auto
60+
* @example <CardRadio width="100px" />
61+
*/
1762
width?: React.CSSProperties['width'];
63+
64+
/**
65+
* Optional string. Height of the card.
66+
* @default auto
67+
* @example <CardRadio height="100px" />
68+
*/
1869
height?: React.CSSProperties['height'];
70+
71+
/**
72+
* Optional object. Inline styles.
73+
* @example <CardRadio style={--card-background-color: var(--green-20)} />
74+
*/
1975
style?: React.CSSProperties;
76+
77+
/**
78+
* Function called whenever the state of the Radio changes.
79+
*/
2080
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
81+
82+
/**
83+
* Function called whenever the mouse enters the Radio.
84+
*/
2185
onMouseEnter?: (e: React.MouseEvent<HTMLDivElement>) => void;
86+
87+
/**
88+
* Function called whenever the mouse leaves the Radio.
89+
*/
2290
onMouseLeave?: (e: React.MouseEvent<HTMLDivElement>) => void;
2391
}
2492

0 commit comments

Comments
 (0)