import React, { ReactNode } from 'react'; const styles = { container: { borderRadius: '.25rem', overflow: 'hidden', }, componentContainer: { backgroundColor: '#00000010', width: '100%', padding: '3rem 0', display: 'flex', justifyContent: 'center', alignIntems: 'center', }, instructionsContainer: { borderTopWidth: '.2rem', borderTopStyle: 'solid', padding: '1.5rem', }, titleContainer: { display: 'flex', flexDirection: 'row', }, title: { marginLeft: '.5rem', }, instructionsWrapper: { marginTop: '1rem', }, button: { backgroundColor: '#00000030', padding: '.5rem', fontWeight: 600, borderRadius: '.25rem', }, }; type IconProps = { width?: string; height?: string; color?: string; }; const CheckCircle = ({ width = '24px', height = '24px', color = '#36B37E', }: IconProps) => ( ); const CloseOctagon = ({ width = '24px', height = '24px', color = '#FF6347', }: IconProps) => ( ); type CardProps = { /** * Icon to be shown as indicator */ Icon?: ReactNode; /** * Color to be used as theme from the card. A transparency will be added to use as background color as well. */ color: string; /** * The label, e.g. "DO", "DON'T" */ label: string; /** * The instructions to show: use array for bullet list or string for paragraph. */ instructions?: string[] | string; /** * The sample component to display. */ Component?: ReactNode; }; export const InstructionsCard = ({ Icon, color, Component, label, instructions, }: CardProps) => (
{!!Component && (
)}
{!!Icon && } {label}
{!!instructions && (
{Array.isArray(instructions) ? (
    {instructions.map((instruction) => (
  • {instruction}
  • ))}
) : (

{instructions}

)}
)}
); /** * Component to render general instructions or for a specific component. */ export const Dos = ({ Icon, color = '#36B37E', label = 'DO', Component, instructions, }: CardProps) => ( (!!Icon ? : )} color={color} label={label} instructions={instructions} /> ); /** * Component to render general restrictions or for a specific component. */ export const Donts = ({ Icon, color = '#DE350B', label = "DON'T", Component, instructions, }: CardProps) => ( (!!Icon ? : )} color={color} label={label} instructions={instructions} /> ); export const SampleButton = () => (
SAMPLE BUTTON
);