This repository has been archived by the owner on Mar 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 54
feat(Input): adding variation for clearable input #37
Merged
alinais
merged 12 commits into
master
from
feature/input-component-clearable-icon-variation
Aug 21, 2018
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
463a11c
adding variation for clearable input
alinais 554e7a9
adding clearable property to Input component
alinais 36ce1d5
fixing merge issues; fixing the inputs without clearable prop
alinais 60ef99b
making the Input component a normal UIComponent
alinais 8e7a736
making the value prop working
alinais 440ecbc
cleaning the Input code; cleaning the example
alinais 9c0b991
fixing failing tests
alinais 653e3c2
updating changelog
alinais 739d804
updating the input variations with a simple example of clearable prop…
alinais 97e22b1
use trySet State instead of setState
alinais bcbef98
Merge branch 'master' into feature/input-component-clearable-icon-var…
levithomason 45fc37f
Merge branch 'master' into feature/input-component-clearable-icon-var…
alinais File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
2 changes: 1 addition & 1 deletion
2
docs/src/examples/components/Input/Types/InputExample.shorthand.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
6 changes: 6 additions & 0 deletions
6
docs/src/examples/components/Input/Variations/InputExampleClearable.shorthand.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,6 @@ | ||
import * as React from 'react' | ||
import { Input } from '@stardust-ui/react' | ||
|
||
const InputExampleClearableShorthand = () => <Input clearable placeholder="Search..." /> | ||
|
||
export default InputExampleClearableShorthand |
2 changes: 1 addition & 1 deletion
2
docs/src/examples/components/Input/Variations/InputExampleFluid.shorthand.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
2 changes: 1 addition & 1 deletion
2
docs/src/examples/components/Input/Variations/InputExampleIcon.shorthand.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
8 changes: 8 additions & 0 deletions
8
docs/src/examples/components/Input/Variations/InputExampleIconClearable.shorthand.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,8 @@ | ||
import * as React from 'react' | ||
import { Input } from '@stardust-ui/react' | ||
|
||
const InputExampleIconClearableShorthand = () => ( | ||
<Input icon="search" clearable placeholder="Search..." /> | ||
) | ||
|
||
export default InputExampleIconClearableShorthand |
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 was deleted.
Oops, something went wrong.
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 * as React from 'react' | ||
|
||
import { isConformant } from 'test/specs/commonTests' | ||
|
||
import Input from 'src/components/Input/Input' | ||
import { mountWithProvider } from 'test/utils' | ||
|
||
describe('Input', () => { | ||
isConformant(Input) | ||
|
||
describe('input', () => { | ||
it('renders a text <input> by default', () => { | ||
const input = mountWithProvider(<Input placeholder="Search ..." />).find('input[type="text"]') | ||
expect(input).not.toBe(undefined) | ||
}) | ||
}) | ||
|
||
describe('icon', () => { | ||
it('creates the Icon component when the icon shorthand is provided', () => { | ||
const input = mountWithProvider(<Input icon={{ name: 'close' }} />).find('Icon[name="close"]') | ||
expect(input).not.toBe(undefined) | ||
}) | ||
}) | ||
}) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No TS in examples please.