Skip to content

Commit

Permalink
Make FocusManager unstable (#177)
Browse files Browse the repository at this point in the history
  • Loading branch information
TrySound authored Oct 1, 2018
1 parent a79b058 commit ac32f9e
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 21 deletions.
18 changes: 9 additions & 9 deletions .size-snapshot.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"dist/react-powerplug.umd.js": {
"bundled": 21934,
"minified": 8685,
"gzipped": 2348
"bundled": 21943,
"minified": 8694,
"gzipped": 2355
},
"dist/react-powerplug.cjs.js": {
"bundled": 19793,
"minified": 9876,
"gzipped": 2373
"bundled": 19802,
"minified": 9885,
"gzipped": 2380
},
"dist/react-powerplug.esm.js": {
"bundled": 19172,
"minified": 9347,
"gzipped": 2235,
"bundled": 19197,
"minified": 9372,
"gzipped": 2246,
"treeshaked": {
"rollup": {
"code": 197,
Expand Down
9 changes: 2 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ import { Pagination, Tabs, Checkbox } from './MyDumbComponents'
| **\<Active>** | `{ onChange }` | `{ active, bind }` | [:point_down:](#active) [:books:](docs/components/Active.md) |
| **\<Focus>** | `{ onChange }` | `{ focused, bind }` | [:point_down:](#focus) [:books:](docs/components/Focus.md) |
| **\<Touch>** | `{ onChange }` | `{ touched, bind }` | [:point_down:](#touch) [:books:](docs/components/Touch.md) |
| **\<FocusManager>** | `{ onChange }` | `{ focused, blur, bind }` | [:point_down:](#focusmanager) [:books:](docs/components/FocusManager.md) |
| <h6>FORM CONTAINERS</h6> |
| **\<Input>** | `{ initial, onChange }` | `{ set, value, bind }` | [:point_down:](#input) [:books:](docs/components/Input.md) |
| **\<Form>** | `{ initial, onChange }` | `{ input, values }` | [:point_down:](#form) [:books:](docs/components/Form.md) |
Expand Down Expand Up @@ -180,9 +179,7 @@ import { Pagination, Tabs, Checkbox } from './MyDumbComponents'
{({ values, remove, add }) => (
<TagManager>
<FormInput onSubmit={add} />
{values.map(tag => (
<Tag onRemove={() => remove(tag)}>{tag}</Tag>
))}
{values.map(tag => <Tag onRemove={() => remove(tag)}>{tag}</Tag>)}
</TagManager>
)}
</Set>
Expand All @@ -196,9 +193,7 @@ import { Pagination, Tabs, Checkbox } from './MyDumbComponents'
<Todo>
<TodoFormInput onSubmit={push} />
{list.map(todo => (
<TodoItem onDelete={() => pull(i => i === todo)}>
{todo}
</TodoItem>
<TodoItem onDelete={() => pull(i => i === todo)}>{todo}</TodoItem>
))}
</Todo>
)}
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export { default as Compose } from './components/Compose'
export { default as Counter } from './components/Counter'
export { default as Field } from './components/Field'
export { default as Focus } from './components/Focus'
export { default as FocusManager } from './components/FocusManager'
export { default as unstable_FocusManager } from './components/FocusManager'
export { default as Form } from './components/Form'
export { default as Hover } from './components/Hover'
export { default as Interval } from './components/Interval'
Expand Down
4 changes: 2 additions & 2 deletions src/index.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ type FocusManagerRender = ({|
|},
|}) => React.Node

declare export var FocusManager: React.ComponentType<
declare export var unstable_FocusManager: React.ComponentType<
| {| onChange?: FocusManagerChange, render: FocusManagerRender |}
| {| onChange?: FocusManagerChange, children: FocusManagerRender |}
>
Expand Down Expand Up @@ -131,7 +131,7 @@ type FieldRender<T> = ({|
value: T,
set: Updater<T>,
reset: Reset,
bind: {| value: T, onChange: (SyntheticFieldEvent<*>) => void |},
bind: {| value: T, onChange: (SyntheticInputEvent<*>) => void |},
|}) => React.Node

type FieldProps<T> =
Expand Down
4 changes: 2 additions & 2 deletions tests/components/FocusManager.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ test('keep focus when click on menu', async () => {

await page.evaluate(() => {
const React = window.React
const FocusManager = window.ReactPowerPlug.FocusManager
const FocusManager = window.ReactPowerPlug.unstable_FocusManager

const style = { width: 100, height: 100 }
const App = () => (
Expand Down Expand Up @@ -81,7 +81,7 @@ test('remove focus and state after calling blur', async () => {

await page.evaluate(() => {
const React = window.React
const { FocusManager } = window.ReactPowerPlug
const FocusManager = window.ReactPowerPlug.unstable_FocusManager

const App = () => (
<FocusManager>
Expand Down

0 comments on commit ac32f9e

Please sign in to comment.