11/* eslint no-console: 0 */
22import React from 'react' ;
3+ import { Story } from '@storybook/react' ;
34
45import { ReactCompareSlider , ReactCompareSliderImage } from 'react-compare-slider' ;
56
@@ -11,7 +12,7 @@ export default {
1112 argTypes : config . argTypes ,
1213} ;
1314
14- export const Images = ( props ) => (
15+ export const Images : Story = ( props ) => (
1516 < ReactCompareSlider
1617 { ...props }
1718 itemOne = {
@@ -33,7 +34,7 @@ export const Images = (props) => (
3334
3435Images . args = { boundsPadding : 0 } ;
3536
36- export const BoundsPadding = ( { boundsPadding = 80 , ...props } ) => {
37+ export const BoundsPadding : Story = ( { boundsPadding = 80 , ...props } ) => {
3738 return (
3839 < div style = { { display : 'flex' , flexDirection : 'column' , flexGrow : 1 } } >
3940 < ReactCompareSlider
@@ -59,7 +60,7 @@ export const BoundsPadding = ({ boundsPadding = 80, ...props }) => {
5960
6061BoundsPadding . args = { boundsPadding : 80 } ;
6162
62- export const OnPositionChange = ( props ) => {
63+ export const OnPositionChange : Story = ( props ) => {
6364 const onPositionChange = React . useCallback ( ( position ) => {
6465 console . log ( '[OnPositionChange.onPositionChange]' , position ) ;
6566 } , [ ] ) ;
@@ -95,7 +96,7 @@ export const OnPositionChange = (props) => {
9596
9697OnPositionChange . args = { boundsPadding : 0 } ;
9798
98- export const OnlyHandleDraggable = ( { onlyHandleDraggable = true , ...props } ) => {
99+ export const OnlyHandleDraggable : Story = ( { onlyHandleDraggable = true , ...props } ) => {
99100 return (
100101 < div style = { { display : 'flex' , flexDirection : 'column' , flexGrow : 1 } } >
101102 < ReactCompareSlider
@@ -122,7 +123,7 @@ export const OnlyHandleDraggable = ({ onlyHandleDraggable = true, ...props }) =>
122123
123124OnlyHandleDraggable . args = { boundsPadding : 0 , onlyHandleDraggable : true } ;
124125
125- export const Portrait = ( { portrait = true , ...props } ) => (
126+ export const Portrait : Story = ( { portrait = true , ...props } ) => (
126127 < ReactCompareSlider
127128 portrait = { portrait }
128129 itemOne = {
@@ -145,7 +146,7 @@ export const Portrait = ({ portrait = true, ...props }) => (
145146
146147Portrait . args = { boundsPadding : 0 , portrait : true } ;
147148
148- export const Position = ( { position = 75 , ...props } ) => (
149+ export const Position : Story = ( { position = 75 , ...props } ) => (
149150 < ReactCompareSlider
150151 position = { position }
151152 itemOne = {
@@ -169,7 +170,10 @@ export const Position = ({ position = 75, ...props }) => (
169170
170171Position . args = { boundsPadding : 0 , position : 25 } ;
171172
172- export const ChangePositionOnHover = ( { changePositionOnHover = true , ...props } ) => {
173+ export const ChangePositionOnHover : Story = ( {
174+ changePositionOnHover = true ,
175+ ...props
176+ } ) => {
173177 return (
174178 < div style = { { display : 'flex' , flexDirection : 'column' , flexGrow : 1 } } >
175179 < ReactCompareSlider
@@ -195,3 +199,29 @@ export const ChangePositionOnHover = ({ changePositionOnHover = true, ...props }
195199} ;
196200
197201ChangePositionOnHover . args = { boundsPadding : 0 , changePositionOnHover : true } ;
202+
203+ export const Scaled : Story = ( { style, ...props } ) => (
204+ < ReactCompareSlider
205+ { ...props }
206+ itemOne = {
207+ < ReactCompareSliderImage
208+ src = "https://images.unsplash.com/photo-1580458148391-8c4951dc1465?auto=format& fit = crop & w = 1280 & q = 80 "
209+ style = { { filter : 'grayscale(1)' } }
210+ alt = "one"
211+ />
212+ }
213+ itemTwo = {
214+ < ReactCompareSliderImage
215+ src = "https://images.unsplash.com/photo-1580458148391-8c4951dc1465?auto=format& fit = crop & w = 1280 & q = 80 "
216+ alt = "two"
217+ />
218+ }
219+ style = { { width : '100%' , height : '100vh' , ...style } }
220+ />
221+ ) ;
222+
223+ Scaled . args = {
224+ style : {
225+ transform : 'scale(0.75)' ,
226+ } ,
227+ } ;
0 commit comments