UNPKG

@kadconsulting/dry

Version:
12 lines 847 B
import { jsx as _jsx } from "react/jsx-runtime"; import './ErrorText.scss'; import classnames from 'classnames'; import { forwardRef, useMemo } from 'react'; const ErrorText = forwardRef(({ id, className, children, ...props }, ref) => { const ErrorTextChildren = useMemo(() => /** Use the default text element if the user has passed a simple string */ typeof children === 'string' ? (_jsx("span", { className: 'dry-textInput__errorText__default-text dry-typography dry-typography--weight-regular dry-typography--font-style-normal dry-typography--no-vertical-rhythm', children: children })) : (children), [children]); return (_jsx("div", { id: id, ref: ref, className: classnames(className, 'dry-textInput__errorText'), ...props, children: ErrorTextChildren })); }); export default ErrorText; //# sourceMappingURL=ErrorText.js.map