{"version":3,"file":"ErrorText.cjs","names":[],"sources":["../../../src/components/ErrorText/ErrorText.tsx"],"sourcesContent":["import type { HTMLAttributes, ReactNode } from \"react\";\nimport { cn } from \"@/utils/cn\";\nimport styles from \"./ErrorText.module.css\";\n\nexport interface ErrorTextProps extends HTMLAttributes<HTMLParagraphElement> {\n    /** The error message. When empty, the component renders nothing. */\n    children?: ReactNode;\n}\n\n/**\n * Renders a form-field error message as a `<p role=\"alert\">`.\n *\n * Renders `null` when there are no children, so it can be placed\n * unconditionally below a field and only appears when an error is present.\n * Styled with the `--tempest-danger` token (falling back to a red default).\n *\n * @param props - The error-text props, plus any `<p>` attributes.\n * @returns The alert paragraph, or `null` when there is no message.\n */\nexport function ErrorText({ children, className, ...props }: ErrorTextProps): ReactNode {\n    if (children === null || children === undefined || children === false || children === \"\") {\n        return null;\n    }\n    return (\n        <p role=\"alert\" className={cn(styles.errorText, className)} {...props}>\n            {children}\n        </p>\n    );\n}\n"],"mappings":"6GAmBA,SAAgB,EAAU,CAAE,WAAU,YAAW,GAAG,GAAoC,CAIpF,OAHI,GAAa,MAAkC,IAAa,IAAS,IAAa,GAC3E,MAGP,EAAA,EAAA,IAAA,CAAC,IAAD,CAAG,KAAK,QAAQ,UAAW,EAAA,GAAG,EAAA,QAAO,UAAW,CAAS,EAAG,GAAI,EAC3D,UACF,CAAA,CAEX"}