-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add input field to design system
- Loading branch information
1 parent
e878dfc
commit b0313f9
Showing
6 changed files
with
45 additions
and
0 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,8 @@ | ||
.input-field { | ||
display: block; | ||
width: 100%; | ||
margin-top: var(--space-3xs); | ||
padding: var(--space-2xs); | ||
color: var(--color-blue); | ||
border: 1px solid var(--color-blue); | ||
} |
24 changes: 24 additions & 0 deletions
24
src/design-system/components/InputField/InputField.stories.tsx
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,24 @@ | ||
import { Meta } from '@storybook/react'; | ||
|
||
import InputField from './InputField'; | ||
import React from 'react'; | ||
|
||
export default { | ||
title: 'Design-System/Form Elements/Input Field', | ||
component: InputField, | ||
args: { | ||
placeholder: 'Enter a location e.g. London', | ||
}, | ||
parameters: { | ||
iframeHeight: 200, | ||
docs: { | ||
description: { | ||
component: | ||
'This component accepts data from the user and has the props associated with an input field', | ||
}, | ||
iframeHeight: 200, | ||
}, | ||
}, | ||
} as Meta; | ||
|
||
export const Default = (args) => <InputField {...args} />; |
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,8 @@ | ||
import { forwardRef } from 'react'; | ||
|
||
const InputField = forwardRef<HTMLInputElement>((props, ref) => { | ||
return <input ref={ref} className="input" {...props} />; | ||
}); | ||
|
||
InputField.displayName = 'InputField'; | ||
export default InputField; |
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,3 @@ | ||
import InputField from './InputField'; | ||
|
||
export default InputField; |
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
@import 'src/design-system/components/Badge/Badge.css'; | ||
@import 'src/design-system/components/Button/Button.css'; | ||
@import 'src/design-system/components/InputField/InputField.css'; |