Skip to content

Commit

Permalink
fix: props are passed via args
Browse files Browse the repository at this point in the history
  • Loading branch information
2nikhiltom committed Sep 9, 2024
1 parent b72d0e7 commit cfc3e81
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions packages/react/src/components/NumberInput/NumberInput.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import Button from '../Button';
import { AILabel, AILabelContent, AILabelActions } from '../AILabel';
import { IconButton } from '../IconButton';
import { View, FolderOpen, Folders } from '@carbon/icons-react';
import { number } from 'prop-types';

export default {
title: 'Components/NumberInput',
Expand Down Expand Up @@ -83,23 +84,19 @@ export const withAILabel = () => (
);

export const Playground = (args) => {
return (
<NumberInput
id="carbon-number"
min={-100}
max={100}
value={50}
label="NumberInput label"
helperText="Optional helper text."
invalidText="Number is not valid"
// {...args}
/>
);
// const { numberInputArrowTranslationIds, ...rest } = props();
return <NumberInput id="carbon-number" {...args} />;
};

Playground.args = {
warnText:
'Warning message that is really long can wrap to more lines but should not be excessively long.',
value: 50,
min: -100,
max: 100,
label: 'NumberInput label',
helperText: 'Optional helper text.',
invalidText: 'Number is not valid',
};

Playground.argTypes = {
Expand Down Expand Up @@ -147,7 +144,13 @@ Playground.argTypes = {
},
},
value: {
control: { type: 'text' },
control: { type: `number` },
},
min: {
control: { type: 'number' },
},
max: {
control: { type: 'number' },
},
warnText: {
control: {
Expand Down

0 comments on commit cfc3e81

Please sign in to comment.