{"version":3,"file":"error-text.cjs","sources":["../../../src/components/error-text.tsx"],"sourcesContent":["import React, { type ReactElement, type ReactNode } from \"react\";\nimport { mergedCva } from \"../utils/components\";\nimport DangerIcon from \"../icons/danger\";\nimport { Typography, type TypographyProps } from \"./typography\";\n\nconst errorTextWrapperStyles = mergedCva([\n    \"cui-flex\",\n    \"cui-items-center\",\n    \"cui-gap-2\",\n    \"cui-mt-2\",\n]);\n\nconst errorTextIconStyles = mergedCva([\"cui-w-6\"], {\n    variants: {\n        variant: {\n            danger: [\"cui-stroke-red\"],\n            info: [\"cui-stroke-black\", \"dark:cui-stroke-white\"],\n        },\n    },\n});\n\nconst errorTextStyles = mergedCva([\"cui-text-red\", \"dark:cui-text-red\"]);\n\nexport interface ErrorTextProps {\n    className?: {\n        root?: string;\n        icon?: string;\n        text?: TypographyProps[\"className\"];\n    };\n    children: ReactNode;\n}\n\nexport const ErrorText = ({\n    children,\n    className,\n}: ErrorTextProps): ReactElement => {\n    return (\n        <div\n            className={errorTextWrapperStyles({\n                className: className?.root,\n            })}\n        >\n            <div>\n                {typeof children === \"string\" && !!children && (\n                    <DangerIcon\n                        className={errorTextIconStyles({\n                            variant: \"danger\",\n                            className: className?.icon,\n                        })}\n                    />\n                )}\n            </div>\n            <Typography\n                variant=\"xs\"\n                className={{\n                    ...className?.text,\n                    root: errorTextStyles({\n                        className: className?.text?.root,\n                    }),\n                }}\n            >\n                {children}\n            </Typography>\n        </div>\n    );\n};\n"],"names":["mergedCva","DangerIcon","Typography"],"mappings":";;;;;;;AAKA,MAAM,yBAAyBA,oBAAU,CAAA;AAAA,EACrC,UAAA;AAAA,EACA,kBAAA;AAAA,EACA,WAAA;AAAA,EACA,UAAA;AACJ,CAAC,CAAA,CAAA;AAED,MAAM,mBAAsB,GAAAA,oBAAA,CAAU,CAAC,SAAS,CAAG,EAAA;AAAA,EAC/C,QAAU,EAAA;AAAA,IACN,OAAS,EAAA;AAAA,MACL,MAAA,EAAQ,CAAC,gBAAgB,CA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