Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: playGround story issue in NumberInput #17389

Merged
merged 13 commits into from
Sep 12, 2024
Prev Previous commit
Next Next commit
fix: passed props dunamically via args
  • Loading branch information
2nikhiltom committed Sep 9, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit e4ffc9f448ddbfea618f03a1c1792229fc692c89
25 changes: 13 additions & 12 deletions packages/react/src/components/NumberInput/NumberInput.stories.js
Original file line number Diff line number Diff line change
@@ -85,23 +85,18 @@ export const withAILabel = () => (

export const Playground = (args) => {
// const { numberInputArrowTranslationIds, ...rest } = props();
return (
<NumberInput
id="carbon-number"
min={-100}
max={100}
value={50}
label="NumberInput label"
helperText="Optional helper text."
invalidText="Number is not valid"
{...args}
/>
);
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 = {
@@ -151,6 +146,12 @@ Playground.argTypes = {
value: {
control: { type: `number` },
},
min: {
control: { type: 'number' },
},
max: {
control: { type: 'number' },
},
warnText: {
control: {
type: 'text',