import React from 'react';
import { Input as InputV2 } from '../src/lib/components/inputv2/inputv2';
import { action } from 'storybook/actions';
import styled from 'styled-components';
import { Wrapper } from './common';
const sizes = ['1/3', '1/2', '2/3', '1'];
const InputWrapper = styled.div`
display: flex;
justify-content: space-around;
`;
export default {
title: 'Components/Inputs/Input',
component: InputV2,
decorators: [
(story) => {story()},
],
args: {
onChange: action('onChange'),
},
argTypes: {
size: {
options: sizes,
},
},
};
export const Playground = {
args: {
placeholder: 'Try me',
},
};
export const WithPlaceholder = {
args: {
placeholder: 'Some text',
},
};
export const SizeScale = {
render: (args) => {
return (
{sizes.map((size) => (
))}
);
},
};
export const WithIcons = {
render: (args) => {
return (
);
},
};
export const WithError = {
args: {
error: 'Something bad',
placeholder: 'Some text',
},
};
export const Disabled = {
args: {
disabled: true,
placeholder: 'Some text',
},
};
/*
const options = Array.from(new Array(1000), (_, index) => ({
label: `Item ${index}`,
value: index,
'data-cy': `Item_${index}`,
}));
const ExampleInput = ({}) => {
const CustomInput = styled.div`
.sc-input-error {
width: 200px;
}
`;
const [numberValue, setNumberValue] = useState(1);
return (
Input without label
Input disabled
Input with label
Input with error
Input with long error
Checkbox Input
Checkbox Input with error
Select Input
'Not found'}
value={options[0]}
/>
Textarea Input
Textarea Input with error
Number Input (Max 100)
{
setNumberValue(e.currentTarget.value);
}}
type="number"
min="0"
max="100"
error={
parseInt(numberValue) > 100
? 'The input number must be less than or equal to 100'
: ''
}
/>
);
};
export default {
title: 'Components/Input/Input',
component: Input,
};
export const Default = {
render: ({}) => {
return ;
},
};
*/