File tree Expand file tree Collapse file tree 5 files changed +49
-107
lines changed Expand file tree Collapse file tree 5 files changed +49
-107
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,9 @@ yarn add @sandstreamdev/react-swipeable-list
32
32
## Usage
33
33
34
34
``` jsx
35
+ import { SwipeableList } from ' @sandstreamdev/react-swipeable-list' ;
36
+ import ' @sandstreamdev/react-swipeable-list/dist/react-swipeable-list.cjs.css' ;
37
+
35
38
< SwipeableList>
36
39
< SwipeableListItem
37
40
swipeLeft= {{
@@ -45,7 +48,7 @@ yarn add @sandstreamdev/react-swipeable-list
45
48
>
46
49
< div> Item name< / div>
47
50
< / SwipeableListItem>
48
- < / SwipeableList>
51
+ < / SwipeableList> ;
49
52
```
50
53
51
54
NOTE: ` SwipeableListItem ` can be used without ` SwipeableList ` but swipe blocking on scroll needs to be handled.
Original file line number Diff line number Diff line change 20
20
],
21
21
"main" : " dist/react-swipeable-list.cjs.js" ,
22
22
"module" : " dist/react-swipeable-list.esm.js" ,
23
- "browser" : " dist/react-swipeable-list.umd.js" ,
24
23
"peerDependencies" : {
25
24
"prop-types" : " ^15.7.2" ,
26
25
"react" : " ^16.8.0" ,
50
49
"react-dom" : " ^16.8.0" ,
51
50
"rollup" : " ^1.20.3" ,
52
51
"rollup-plugin-babel" : " ^4.3.3" ,
53
- "rollup-plugin-commonjs" : " ^9.3.4" ,
54
- "rollup-plugin-node-resolve" : " ^4.2.4" ,
55
52
"rollup-plugin-postcss" : " ^2.0.3" ,
56
53
"stylelint" : " ^11.0.0" ,
57
54
"stylelint-config-standard" : " ^19.0.0"
Original file line number Diff line number Diff line change 1
- import resolve from 'rollup-plugin-node-resolve' ;
2
- import commonjs from 'rollup-plugin-commonjs' ;
3
1
import babel from 'rollup-plugin-babel' ;
4
2
import postcss from 'rollup-plugin-postcss' ;
5
3
6
4
import pkg from './package.json' ;
7
5
8
6
export default [
9
- {
10
- input : 'src/index.js' ,
11
- output : {
12
- name : pkg . name ,
13
- file : pkg . browser ,
14
- format : 'umd'
15
- } ,
16
- plugins : [
17
- resolve ( ) ,
18
- babel ( {
19
- exclude : [ 'node_modules/**' ]
20
- } ) ,
21
- commonjs ( {
22
- namedExports : {
23
- 'node_modules/react/index.js' : [
24
- 'PureComponent' ,
25
- 'Children' ,
26
- 'createElement' ,
27
- 'useEffect' ,
28
- 'useState'
29
- ]
30
- }
31
- } ) ,
32
- postcss ( {
33
- extract : true ,
34
- modules : true
35
- } )
36
- ]
37
- } ,
38
7
{
39
8
input : 'src/index.js' ,
40
9
external : [ 'react' , 'prop-types' ] ,
Original file line number Diff line number Diff line change 21
21
}
22
22
23
23
.contentRight {
24
- composes : contentLeft;
24
+ position : absolute;
25
+ width : 100% ;
26
+ height : 100% ;
27
+ z-index : -1 ;
28
+ display : flex;
29
+ flex-direction : row;
30
+ align-items : center;
31
+ box-sizing : border-box;
32
+ opacity : 0 ;
25
33
justify-content : flex-end;
26
34
}
27
35
28
- .return {
29
- transition : opacity 0.5s ease-out;
30
- }
31
-
32
36
.contentLeftReturn {
33
- composes : contentLeft return;
37
+ position : absolute;
38
+ width : 100% ;
39
+ height : 100% ;
40
+ z-index : -1 ;
41
+ display : flex;
42
+ flex-direction : row;
43
+ align-items : center;
44
+ box-sizing : border-box;
45
+ opacity : 0 ;
46
+ transition : opacity 0.5s ease-out;
34
47
}
35
48
36
49
.contentRightReturn {
37
- composes : contentRight return;
50
+ position : absolute;
51
+ width : 100% ;
52
+ height : 100% ;
53
+ z-index : -1 ;
54
+ display : flex;
55
+ flex-direction : row;
56
+ align-items : center;
57
+ box-sizing : border-box;
58
+ opacity : 0 ;
59
+ justify-content : flex-end;
60
+ transition : opacity 0.5s ease-out;
38
61
}
39
62
40
63
.content {
47
70
}
48
71
49
72
.contentReturn {
50
- composes : content;
73
+ width : 100% ;
74
+ align-items : center;
75
+ box-sizing : border-box;
76
+ background-color : # fff ;
77
+ height : 100% ;
78
+ display : flex;
51
79
transition : transform 0.5s ease-out;
52
80
}
You can’t perform that action at this time.
0 commit comments