import { ReactNode } from 'react';
import classnames from 'classnames';
import { Box, Flex, IconCompact, Text } from 'morphe';
import styles from './HelperText.css';
type SizeType = 'sm' | 'md' | 'lg';
type Props = {
id: string;
text?: ReactNode;
size?: SizeType;
noPadding?: boolean;
};
const icon = 'compact-workflow-status-problem';
const color = 'error';
export default function FormErrorMessage({
id,
size,
text = '',
noPadding: noStartPadding,
}: Props) {
return (
{/* Class used to ensure all children are font size "sm" */}
{/* This error message is accessible by screenreaders. It alerts the user right when the error message is presented to the user. While error messages are visually apparent to users who can see the page, they may not be obvious to users of assistive technologies. This role="alert" provides a way to programmatically expose dynamic content changes in a way that can be announced by assistive technologies.
*/}
{text}
);
}