UNPKG

jobiqo-cl

Version:

[![CircleCI](https://circleci.com/gh/jobiqo/jobiqo-cl.svg?style=svg&circle-token=5a24efa5b8bbc4879276123e77d0d3f35ca7144c)](https://circleci.com/gh/jobiqo/jobiqo-cl)

27 lines (24 loc) 1.02 kB
import React__default from 'react'; import styled from 'styled-components'; import Alert from '../../../../../node_modules/@reach/alert/es/index.js'; /** * @file index.tsx * * @fileoverview InlineError component. */ // This looks weird but necessary until a solution is found on https://github.com/styled-components/styled-components/pull/2093 // @ts-ignore: This is an anti patttern. remove when fixed in styled components. const StyledMessage = styled(props => React__default.createElement(Alert, Object.assign({}, props))) ` &[data-reach-alert] { color: ${props => props.theme.colors.danger}; } `; /** * A message that is shown bellow a input when the input has an error. This message is a way for the user to get immediate feedback on form items * that error for example on blur. */ const InlineError = (props) => { const { message } = props; return (React__default.createElement(StyledMessage, { "data-testid": "alert", type: "polite" }, message)); }; export { InlineError };