-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathindex.tsx
67 lines (64 loc) · 1.45 KB
/
index.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import { Box, type BoxProps } from '@/components/Box'
function CheckIcon() {
return (
<Box
as="svg"
color="primary.foreground"
fill="none"
height="8px"
part="check-icon"
viewBox="0 0 10 8"
width="10px"
>
<path
d="M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1"
stroke="currentColor"
strokeWidth="1.5"
strokeLinecap="round"
strokeLinejoin="round"
/>
</Box>
)
}
interface CheckIndicatorProps extends BoxProps {
checked?: boolean
size?: string
}
export function CheckIndicator({ checked = false, size = '22px', ...props }: CheckIndicatorProps) {
return (
<Box
backgroundColor="inherit"
borderWidth="md"
borderStyle="solid"
borderColor="neutral.border"
borderRadius="100%"
padding="0"
part="check-indicator"
position="relative"
height={size}
width={size}
{...props}
>
{checked && (
<Box
alignItems="center"
bg="green500"
borderWidth="md"
borderStyle="solid"
borderColor="green500"
borderRadius="100%"
display="flex"
height="calc(100% + 2px)"
justifyContent="center"
left="-1px"
part="check-indicator-checked"
position="absolute"
top="-1px"
width="calc(100% + 2px)"
>
<CheckIcon />
</Box>
)}
</Box>
)
}