File tree Expand file tree Collapse file tree 6 files changed +30
-30
lines changed
Expand file tree Collapse file tree 6 files changed +30
-30
lines changed Original file line number Diff line number Diff line change @@ -9,8 +9,8 @@ import { Active } from 'react-powerplug'
99
1010``` jsx
1111< Active>
12- {({ isActive, bindActive }) => (
13- < div {... bindActive }>
12+ {({ isActive, bind }) => (
13+ < div {... bind }>
1414 You are {isActive ? ' clicking' : ' not clicking' } this div.
1515 < / div>
1616 )}
@@ -23,18 +23,18 @@ _Don't have props_
2323
2424## Active Children Props
2525
26- TL;DR: ` { isActive, bindActive } `
26+ TL;DR: ` { isActive, bind } `
2727
2828** isActive**
2929` boolean `
3030True if is activated (being clicked) the binded element
3131
32- ** bindActive **
32+ ** bind **
3333` { onMouseUp: () => void, onMouseDown: () => void } `
3434There are the bind event functions that make ` Active ` works.
3535You ** must** bind some element to track their events.
3636You can use spread operator to bind effectively an element.
3737
3838``` jsx
39- < span {... bindActive }> Binded! < / span>
39+ < span {... bind }> Binded! < / span>
4040```
Original file line number Diff line number Diff line change @@ -9,10 +9,10 @@ import { Focus } from 'react-powerplug'
99
1010``` jsx
1111< Focus>
12- {({ isFocus, bindFocus }) => (
12+ {({ isFocused, bind }) => (
1313 < div>
14- < input {... bindFocus } placeholder= " Focus me" / >
15- < div> You are {isFocus ? ' focusing' : ' not focusing' } the input.< / div>
14+ < input {... bind } placeholder= " Focus me" / >
15+ < div> You are {isFocused ? ' focusing' : ' not focusing' } the input.< / div>
1616 < / div>
1717 )}
1818< / Focus>
@@ -24,18 +24,18 @@ _Don't have props_
2424
2525## Focus Children Props
2626
27- TL;DR: ` { isFocus, bindFocus } `
27+ TL;DR: ` { isFocused, bind } `
2828
29- ** isFocus **
29+ ** isFocused **
3030` boolean `
3131True if is focusing the binded element
3232
33- ** bindFocus **
33+ ** bind **
3434` { onFocusIn: () => void, onFocusOut: () => void } `
3535There are the bind event functions that make ` Focus ` works.
3636You ** must** bind some element to track their events.
3737You can use spread operator to bind effectively an element.
3838
3939``` jsx
40- < button {... bindFocus }> Binded! < / button>
40+ < button {... bind }> Binded! < / button>
4141```
Original file line number Diff line number Diff line change @@ -9,9 +9,9 @@ import { Hover } from 'react-powerplug'
99
1010``` jsx
1111< Hover>
12- {({ isHover, bindHover }) => (
13- < div {... bindHover }>
14- You are {isHover ? ' hovering' : ' not hovering' } this div.
12+ {({ isHovered, bind }) => (
13+ < div {... bind }>
14+ You are {isHovered ? ' hovering' : ' not hovering' } this div.
1515 < / div>
1616 )}
1717< / Hover>
@@ -23,18 +23,18 @@ _Don't have props_
2323
2424## Hover Children Props
2525
26- TL;DR: ` { isHover, bindHover } `
26+ TL;DR: ` { isHovered, bind } `
2727
28- ** isHover **
28+ ** isHovered **
2929` boolean `
3030True if is hovering the binded element
3131
32- ** bindHover **
32+ ** bind **
3333` { onMouseEnter: () => void, onMouseLeave: () => void } `
3434There are the bind event functions that make ` Hover ` works.
3535You ** must** bind some element to track their events.
3636You can use spread operator to bind effectively an element.
3737
3838``` jsx
39- < span {... bindHover }> Binded! < / span>
39+ < span {... bind }> Binded! < / span>
4040```
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ const Active = ({ onChange, ...props }) => (
77 { ( { state, setState } ) =>
88 renderProps ( props , {
99 isActive : state . isActive ,
10- bindActive : {
10+ bind : {
1111 onMouseDown : ( ) => setState ( { isActive : true } ) ,
1212 onMouseUp : ( ) => setState ( { isActive : false } ) ,
1313 } ,
Original file line number Diff line number Diff line change @@ -3,13 +3,13 @@ import State from './State'
33import renderProps from '../utils/renderProps'
44
55const Focus = ( { onChange, ...props } ) => (
6- < State initial = { { isFocus : false } } onChange = { onChange } >
6+ < State initial = { { isFocused : false } } onChange = { onChange } >
77 { ( { state, setState } ) =>
88 renderProps ( props , {
9- isFocus : state . isFocus ,
10- bindFocus : {
11- onFocusIn : ( ) => setState ( { isFocus : true } ) ,
12- onFocusOut : ( ) => setState ( { isFocus : false } ) ,
9+ isFocused : state . isFocused ,
10+ bind : {
11+ onFocus : ( ) => setState ( { isFocused : true } ) ,
12+ onBlur : ( ) => setState ( { isFocused : false } ) ,
1313 } ,
1414 } )
1515 }
Original file line number Diff line number Diff line change @@ -3,13 +3,13 @@ import State from './State'
33import renderProps from '../utils/renderProps'
44
55const Hover = ( { onChange, ...props } ) => (
6- < State initial = { { isHover : false } } onChange = { onChange } >
6+ < State initial = { { isHovered : false } } onChange = { onChange } >
77 { ( { state, setState } ) =>
88 renderProps ( props , {
9- isHover : state . isHover ,
10- bindHover : {
11- onMouseEnter : ( ) => setState ( { isHover : true } ) ,
12- onMouseLeave : ( ) => setState ( { isHover : false } ) ,
9+ isHovered : state . isHovered ,
10+ bind : {
11+ onMouseEnter : ( ) => setState ( { isHovered : true } ) ,
12+ onMouseLeave : ( ) => setState ( { isHovered : false } ) ,
1313 } ,
1414 } )
1515 }
You can’t perform that action at this time.
0 commit comments