Skip to content

Commit

Permalink
chore: test playground2
Browse files Browse the repository at this point in the history
  • Loading branch information
2nikhiltom committed Sep 10, 2024
1 parent 3da60eb commit 81f530e
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions packages/react/src/components/NumberInput/NumberInput.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,3 +175,51 @@ Playground.argTypes = {
action: 'onKeyUp',
},
};

export const Playground2 = ({ ...args }) => {
const [value, setValue] = React.useState(50);

const handleChange = (event, { value }) => {
setValue(value);
};

return (
<NumberInput
id="playground-number-input"
min={-100}
max={100}
value={value}
label="NumberInput label"
helperText="Optional helper text."
onChange={handleChange}
{...args}
/>
);
};

Playground2.args = {
step: 1,
disabled: false,
invalid: false,
invalidText: 'Error message goes here',
warn: false,
warnText: 'Warning message goes here',
size: 'md',
};

Playground2.argTypes = {
min: { control: { type: 'number' } },
max: { control: { type: 'number' } },
step: { control: { type: 'number' } },
disabled: { control: { type: 'boolean' } },
invalid: { control: { type: 'boolean' } },
invalidText: { control: { type: 'text' } },
warn: { control: { type: 'boolean' } },
warnText: { control: { type: 'text' } },
size: {
options: ['sm', 'md', 'lg'],
control: { type: 'select' },
},
label: { control: { type: 'text' } },
helperText: { control: { type: 'text' } },
};

0 comments on commit 81f530e

Please sign in to comment.