-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(select): Initial commit of Select
Refactor FormField to be generic enough for both Textarea and Select
- Loading branch information
1 parent
2a5c533
commit eeb5e69
Showing
13 changed files
with
332 additions
and
185 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import React from 'react' | ||
import PropTypes from 'prop-types' | ||
|
||
import Fade from '../Animation/Fade' | ||
import StandaloneIcon from '../Icons/StandaloneIcon/StandaloneIcon' | ||
|
||
import iconWrapperStyles from '../Icons/IconWrapper.modules.scss' | ||
|
||
const FeedbackIcon = ({ showIcon, feedback }) => ( | ||
<Fade timeout={100} in={showIcon} mountOnEnter={true} unmountOnExit={true}> | ||
{() => ( | ||
<div className={iconWrapperStyles.fixLineHeight}> | ||
{feedback === 'success' ? ( | ||
<StandaloneIcon | ||
symbol="checkmark" | ||
variant="primary" | ||
size={16} | ||
a11yText="The value of this input field is valid." | ||
/> | ||
) : ( | ||
<StandaloneIcon | ||
symbol="exclamationPointCircle" | ||
variant="error" | ||
size={16} | ||
a11yText="The value of this input field is invalid." | ||
/> | ||
)} | ||
</div> | ||
)} | ||
</Fade> | ||
) | ||
FeedbackIcon.propTypes = { | ||
showIcon: PropTypes.bool.isRequired, | ||
feedback: PropTypes.oneOf(['success', 'error']), | ||
} | ||
FeedbackIcon.defaultProps = { | ||
feedback: undefined | ||
} | ||
|
||
export default FeedbackIcon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,8 @@ | |
.absolute { | ||
position: absolute; | ||
} | ||
|
||
.centerVertically { | ||
top: 50%; | ||
transform: translateY(-50%); | ||
} |
Oops, something went wrong.