1
1
import type { ReactNode } from 'react' ;
2
2
import React from 'react' ;
3
3
4
+ import classNames from 'classnames' ;
5
+
4
6
import { Box } from '../box' ;
5
7
import { Flex } from '../flex' ;
6
8
import { Text } from '../text' ;
9
+ import { FontWeights } from '../text/create-text.util' ;
7
10
8
11
import * as cx from './action-card.css' ;
9
12
10
13
import type { OmitClassName } from '../../types' ;
11
14
12
15
type Props = Omit < OmitClassName < 'div' > , 'title' > & {
13
- title : { text : string ; highlight : boolean } [ ] ;
16
+ title : { text : string ; highlight ? : boolean ; weight ?: FontWeights } [ ] ;
14
17
description ?: string ;
15
18
icon : ReactNode ;
19
+ rootClassName ?: string ;
20
+ iconClassName ?: string ;
16
21
} ;
17
22
18
23
export const ActionCard = ( {
@@ -21,9 +26,9 @@ export const ActionCard = ({
21
26
icon,
22
27
...props
23
28
} : Readonly < Props > ) : JSX . Element => (
24
- < Box { ...props } className = { cx . root } >
29
+ < Box { ...props } className = { classNames ( [ cx . root , props . rootClassName ] ) } >
25
30
< Flex
26
- className = { cx . iconBox }
31
+ className = { classNames ( [ cx . iconBox , props . iconClassName ] ) }
27
32
mr = "$24"
28
33
alignItems = "center"
29
34
justifyContent = "center"
@@ -33,9 +38,9 @@ export const ActionCard = ({
33
38
< Box w = "$fill" >
34
39
< Flex justifyContent = "center" h = "$fill" flexDirection = "column" >
35
40
< Box >
36
- { title . map ( ( { text, highlight } ) => (
41
+ { title . map ( ( { text, highlight, weight } ) => (
37
42
< Text . Body . Normal
38
- weight = " $medium"
43
+ weight = { weight || ' $medium' }
39
44
color = { highlight ? 'highlight' : 'primary' }
40
45
key = { text }
41
46
>
0 commit comments