| 1 |
import { arrowRight, Icon } from '@wordpress/icons'; |
| 2 |
import classNames from 'classnames'; |
| 3 |
|
| 4 |
export const ChoiceBox = ({ |
| 5 |
icon, |
| 6 |
badgeLabel, |
| 7 |
heading, |
| 8 |
description, |
| 9 |
buttonLabel, |
| 10 |
buttonIcon = arrowRight, |
| 11 |
highlight, |
| 12 |
onClick, |
| 13 |
}) => ( |
| 14 |
<div |
| 15 |
className={classNames( |
| 16 |
'flex flex-col overflow-hidden text-left text-gray-900 backdrop-blur-2xl', |
| 17 |
highlight |
| 18 |
? 'rounded-lg border-[3px] border-design-main sm:-mt-7' |
| 19 |
: 'rounded-sm border border-gray-300', |
| 20 |
)} |
| 21 |
> |
| 22 |
{highlight && badgeLabel && ( |
| 23 |
<span className="flex h-7 items-center justify-center bg-design-main text-sm font-medium text-design-text"> |
| 24 |
{badgeLabel} |
| 25 |
</span> |
| 26 |
)} |
| 27 |
<span className="flex items-center justify-center bg-gray-100/80 py-10 text-gray-900"> |
| 28 |
<Icon fill="currentColor" icon={icon} size={40} /> |
| 29 |
</span> |
| 30 |
<span className="flex flex-1 flex-col justify-between gap-6 border-t border-gray-300 bg-white/60 p-6"> |
| 31 |
<span className="flex flex-col gap-2"> |
| 32 |
{heading && ( |
| 33 |
<span className="text-base font-semibold leading-6">{heading}</span> |
| 34 |
)} |
| 35 |
<span className="text-sm leading-5 opacity-70">{description}</span> |
| 36 |
</span> |
| 37 |
<button |
| 38 |
type="button" |
| 39 |
onClick={onClick} |
| 40 |
className={classNames( |
| 41 |
'inline-flex w-full items-center justify-between gap-2 rounded-full px-5 py-2.5 text-sm font-medium transition focus:outline-none focus-visible:ring-1 focus-visible:ring-gray-500', |
| 42 |
highlight |
| 43 |
? 'border border-design-main bg-design-main text-white hover:opacity-90' |
| 44 |
: 'border border-gray-300 bg-transparent hover:border-gray-500', |
| 45 |
)} |
| 46 |
> |
| 47 |
{buttonLabel} |
| 48 |
<Icon fill="currentColor" icon={buttonIcon} size={20} /> |
| 49 |
</button> |
| 50 |
</span> |
| 51 |
</div> |
| 52 |
); |
| 53 |
|