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
3232## Usage
3333
3434``` jsx
35+ import { SwipeableList } from ' @sandstreamdev/react-swipeable-list' ;
36+ import ' @sandstreamdev/react-swipeable-list/dist/react-swipeable-list.cjs.css' ;
37+
3538< SwipeableList>
3639 < SwipeableListItem
3740 swipeLeft= {{
@@ -45,7 +48,7 @@ yarn add @sandstreamdev/react-swipeable-list
4548 >
4649 < div> Item name< / div>
4750 < / SwipeableListItem>
48- < / SwipeableList>
51+ < / SwipeableList> ;
4952```
5053
5154NOTE: ` 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 2020 ],
2121 "main" : " dist/react-swipeable-list.cjs.js" ,
2222 "module" : " dist/react-swipeable-list.esm.js" ,
23- "browser" : " dist/react-swipeable-list.umd.js" ,
2423 "peerDependencies" : {
2524 "prop-types" : " ^15.7.2" ,
2625 "react" : " ^16.8.0" ,
5049 "react-dom" : " ^16.8.0" ,
5150 "rollup" : " ^1.20.3" ,
5251 "rollup-plugin-babel" : " ^4.3.3" ,
53- "rollup-plugin-commonjs" : " ^9.3.4" ,
54- "rollup-plugin-node-resolve" : " ^4.2.4" ,
5552 "rollup-plugin-postcss" : " ^2.0.3" ,
5653 "stylelint" : " ^11.0.0" ,
5754 "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' ;
31import babel from 'rollup-plugin-babel' ;
42import postcss from 'rollup-plugin-postcss' ;
53
64import pkg from './package.json' ;
75
86export 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- } ,
387 {
398 input : 'src/index.js' ,
409 external : [ 'react' , 'prop-types' ] ,
Original file line number Diff line number Diff line change 2121}
2222
2323.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 ;
2533 justify-content : flex-end;
2634}
2735
28- .return {
29- transition : opacity 0.5s ease-out;
30- }
31-
3236.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;
3447}
3548
3649.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;
3861}
3962
4063.content {
4770}
4871
4972.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;
5179 transition : transform 0.5s ease-out;
5280}
You can’t perform that action at this time.
0 commit comments