-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(Input): update to v1 API #281
Changes from 19 commits
74a9a24
1bcd072
2813a04
0081a82
a2d4a59
486d669
5e05f31
b011e82
6bf626d
952b52d
b064979
da1c0e1
fe63039
b37952c
5f4c7db
029dab7
1fedf9b
15f89ce
adac980
5478c62
fe327fc
59403ea
72bf71d
af405e9
e27f533
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import React from 'react' | ||
import { Input } from 'stardust' | ||
|
||
const InputDisabled = () => ( | ||
<Input disabled placeholder='Search...' /> | ||
) | ||
|
||
export default InputDisabled |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import React from 'react' | ||
import { Input } from 'stardust' | ||
|
||
const InputError = () => ( | ||
<Input error placeholder='Search...' /> | ||
) | ||
|
||
export default InputError |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import React from 'react' | ||
import { Input } from 'stardust' | ||
|
||
const InputFocus = () => ( | ||
<Input focus placeholder='Search...' /> | ||
) | ||
|
||
export default InputFocus |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import React from 'react' | ||
import { Input } from 'stardust' | ||
|
||
const InputLeftLoading = () => ( | ||
<Input loading icon='user' iconPosition='left' placeholder='Search...' /> | ||
) | ||
|
||
export default InputLeftLoading |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import React from 'react' | ||
import { Input } from 'stardust' | ||
|
||
const InputLoading = () => ( | ||
<Input loading icon='user' placeholder='Search...' /> | ||
) | ||
|
||
export default InputLoading |
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import React from 'react' | ||
import ComponentExample from 'docs/app/Components/ComponentDoc/ComponentExample' | ||
import ExampleSection from 'docs/app/Components/ComponentDoc/ExampleSection' | ||
|
||
import { Message } from 'src' | ||
|
||
const InputStates = () => ( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Var name might be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In order to aide in searching, let's always keep the component name in the default export name. Let's also keep the filename the same as the default export (except for index.js files of course). This way the default export matches the filename and we can easily search for either. This makes automated refactors much easier to work with. Once we're done with the legacy components I plan to update all doc files to be consistent. |
||
<ExampleSection title='States'> | ||
<ComponentExample | ||
title='Focus' | ||
description='An input field can show a user is currently interacting with it' | ||
examplePath='elements/Input/States/InputFocus' | ||
/> | ||
<ComponentExample | ||
title='Loading' | ||
description='An icon input field can show that it is currently loading data' | ||
examplePath='elements/Input/States/InputLoading' | ||
> | ||
<Message> | ||
Loading inputs automatically modify the input's icon on loading state to show loading indication | ||
</Message> | ||
</ComponentExample> | ||
<ComponentExample examplePath='elements/Input/States/InputLeftLoading' /> | ||
<ComponentExample | ||
title='Disabled' | ||
description='An input field can show that it is disabled' | ||
examplePath='elements/Input/States/InputDisabled' | ||
/> | ||
<ComponentExample | ||
title='Error' | ||
description='An input field can show that the data contains errors' | ||
examplePath='elements/Input/States/InputError' | ||
/> | ||
</ExampleSection> | ||
) | ||
|
||
export default InputStates |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import React from 'react' | ||
import { Input } from 'stardust' | ||
|
||
const InputInput = () => ( | ||
<Input placeholder='Search...' /> | ||
) | ||
|
||
export default InputInput |
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import React from 'react' | ||
import ComponentExample from 'docs/app/Components/ComponentDoc/ComponentExample' | ||
import ExampleSection from 'docs/app/Components/ComponentDoc/ExampleSection' | ||
|
||
const InputTypes = () => ( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ^^ |
||
<ExampleSection title='Types'> | ||
<ComponentExample | ||
title='Input' | ||
description='A standard input field' | ||
examplePath='elements/Input/Types/InputInput' | ||
/> | ||
</ExampleSection> | ||
) | ||
|
||
export default InputTypes |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import React from 'react' | ||
import { Input } from 'stardust' | ||
|
||
const InputAction = () => ( | ||
<Input action='Search' placeholder='Search...' /> | ||
) | ||
|
||
export default InputAction |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import React from 'react' | ||
import { Dropdown, Input } from 'stardust' | ||
|
||
const options = [ | ||
{ text: 'This Page', value: 'page' }, | ||
{ text: 'This Organization', value: 'org' }, | ||
{ text: 'Entire Site', value: 'site' }, | ||
] | ||
|
||
const InputActionDropdown = () => ( | ||
<Input | ||
action={<Dropdown basic floating options={options} defaultValue='page' />} | ||
icon='search' | ||
iconPosition='left' | ||
placeholder='Search...' | ||
/> | ||
) | ||
|
||
export default InputActionDropdown |
This file was deleted.
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.
Input is now a stateless component, so no
refs
are available. Updated the doc sidebar to use a regular query selector instead.