Skip to content

Commit ac32f9e

Browse files
authored
Make FocusManager unstable (#177)
1 parent a79b058 commit ac32f9e

File tree

5 files changed

+16
-21
lines changed

5 files changed

+16
-21
lines changed

.size-snapshot.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
{
22
"dist/react-powerplug.umd.js": {
3-
"bundled": 21934,
4-
"minified": 8685,
5-
"gzipped": 2348
3+
"bundled": 21943,
4+
"minified": 8694,
5+
"gzipped": 2355
66
},
77
"dist/react-powerplug.cjs.js": {
8-
"bundled": 19793,
9-
"minified": 9876,
10-
"gzipped": 2373
8+
"bundled": 19802,
9+
"minified": 9885,
10+
"gzipped": 2380
1111
},
1212
"dist/react-powerplug.esm.js": {
13-
"bundled": 19172,
14-
"minified": 9347,
15-
"gzipped": 2235,
13+
"bundled": 19197,
14+
"minified": 9372,
15+
"gzipped": 2246,
1616
"treeshaked": {
1717
"rollup": {
1818
"code": 197,

README.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ import { Pagination, Tabs, Checkbox } from './MyDumbComponents'
8383
| **\<Active>** | `{ onChange }` | `{ active, bind }` | [:point_down:](#active) [:books:](docs/components/Active.md) |
8484
| **\<Focus>** | `{ onChange }` | `{ focused, bind }` | [:point_down:](#focus) [:books:](docs/components/Focus.md) |
8585
| **\<Touch>** | `{ onChange }` | `{ touched, bind }` | [:point_down:](#touch) [:books:](docs/components/Touch.md) |
86-
| **\<FocusManager>** | `{ onChange }` | `{ focused, blur, bind }` | [:point_down:](#focusmanager) [:books:](docs/components/FocusManager.md) |
8786
| <h6>FORM CONTAINERS</h6> |
8887
| **\<Input>** | `{ initial, onChange }` | `{ set, value, bind }` | [:point_down:](#input) [:books:](docs/components/Input.md) |
8988
| **\<Form>** | `{ initial, onChange }` | `{ input, values }` | [:point_down:](#form) [:books:](docs/components/Form.md) |
@@ -180,9 +179,7 @@ import { Pagination, Tabs, Checkbox } from './MyDumbComponents'
180179
{({ values, remove, add }) => (
181180
<TagManager>
182181
<FormInput onSubmit={add} />
183-
{values.map(tag => (
184-
<Tag onRemove={() => remove(tag)}>{tag}</Tag>
185-
))}
182+
{values.map(tag => <Tag onRemove={() => remove(tag)}>{tag}</Tag>)}
186183
</TagManager>
187184
)}
188185
</Set>
@@ -196,9 +193,7 @@ import { Pagination, Tabs, Checkbox } from './MyDumbComponents'
196193
<Todo>
197194
<TodoFormInput onSubmit={push} />
198195
{list.map(todo => (
199-
<TodoItem onDelete={() => pull(i => i === todo)}>
200-
{todo}
201-
</TodoItem>
196+
<TodoItem onDelete={() => pull(i => i === todo)}>{todo}</TodoItem>
202197
))}
203198
</Todo>
204199
)}

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ export { default as Compose } from './components/Compose'
33
export { default as Counter } from './components/Counter'
44
export { default as Field } from './components/Field'
55
export { default as Focus } from './components/Focus'
6-
export { default as FocusManager } from './components/FocusManager'
6+
export { default as unstable_FocusManager } from './components/FocusManager'
77
export { default as Form } from './components/Form'
88
export { default as Hover } from './components/Hover'
99
export { default as Interval } from './components/Interval'

src/index.js.flow

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ type FocusManagerRender = ({|
7474
|},
7575
|}) => React.Node
7676

77-
declare export var FocusManager: React.ComponentType<
77+
declare export var unstable_FocusManager: React.ComponentType<
7878
| {| onChange?: FocusManagerChange, render: FocusManagerRender |}
7979
| {| onChange?: FocusManagerChange, children: FocusManagerRender |}
8080
>
@@ -131,7 +131,7 @@ type FieldRender<T> = ({|
131131
value: T,
132132
set: Updater<T>,
133133
reset: Reset,
134-
bind: {| value: T, onChange: (SyntheticFieldEvent<*>) => void |},
134+
bind: {| value: T, onChange: (SyntheticInputEvent<*>) => void |},
135135
|}) => React.Node
136136

137137
type FieldProps<T> =

tests/components/FocusManager.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ test('keep focus when click on menu', async () => {
4343

4444
await page.evaluate(() => {
4545
const React = window.React
46-
const FocusManager = window.ReactPowerPlug.FocusManager
46+
const FocusManager = window.ReactPowerPlug.unstable_FocusManager
4747

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

8282
await page.evaluate(() => {
8383
const React = window.React
84-
const { FocusManager } = window.ReactPowerPlug
84+
const FocusManager = window.ReactPowerPlug.unstable_FocusManager
8585

8686
const App = () => (
8787
<FocusManager>

0 commit comments

Comments
 (0)