Skip to content

Commit

Permalink
Merge pull request #1320 from Kajabi/SAGE-425_mw-react-input-placehol…
Browse files Browse the repository at this point in the history
…der-disabled

SAGE-425: fix(input): add hasPlaceholder prop to react input
  • Loading branch information
Monica Wheeler authored Apr 12, 2022
2 parents 4a9ff61 + 2036350 commit 29a737a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/sage-react/lib/Input/Input.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { SageTokens } from '../configs';
export const Input = ({
className,
hasError,
hasPlaceholder,
icon,
id,
label,
Expand All @@ -28,6 +29,7 @@ export const Input = ({
className,
{
'sage-form-field--error': hasError,
'sage-form-field--showplaceholder': hasPlaceholder,
'sage-input--prefixed': prefix,
'sage-input--suffixed': suffix,
'sage-input--standalone': standalone,
Expand Down Expand Up @@ -121,6 +123,7 @@ export const Input = ({
Input.defaultProps = {
className: null,
hasError: false,
hasPlaceholder: false,
icon: null,
label: null,
message: null,
Expand All @@ -137,6 +140,7 @@ Input.propTypes = {
icon: PropTypes.oneOf(Object.values(SageTokens.ICONS)),
id: PropTypes.string.isRequired,
hasError: PropTypes.bool,
hasPlaceholder: PropTypes.bool,
label: PropTypes.string,
message: PropTypes.string,
onChange: PropTypes.func,
Expand Down
3 changes: 3 additions & 0 deletions packages/sage-react/lib/Input/Input.story.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export const Default = (args) => {
className={args.className}
disabled={args.disabled}
hasError={args.hasError}
hasPlaceholder={args.hasPlaceholder}
icon={args.icon}
id={args.id}
label={args.label}
Expand All @@ -53,6 +54,7 @@ export const InputWithStaticIcon = (args) => {
className={args.className}
disabled={args.disabled}
hasError={args.hasError}
hasPlaceholder={args.hasPlaceholder}
icon={args.icon}
id={args.id}
label={args.label}
Expand All @@ -78,6 +80,7 @@ export const InputWithPopover = (args) => {
className={args.className}
disabled={args.disabled}
hasError={args.hasError}
hasPlaceholder={args.hasPlaceholder}
icon={args.icon}
id={args.id}
label={args.label}
Expand Down

0 comments on commit 29a737a

Please sign in to comment.