-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(form): update gap to use correct spacing 07, add v11 story (#10645)
* fix(button): use intrinsic width by default, closes #10644 * fix(form): update gap to use correct spacing 07, add v11 story Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
- Loading branch information
1 parent
ffa2dfe
commit addd1a7
Showing
3 changed files
with
64 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
packages/react/src/components/FormGroup/next/FormGroup.stories.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/** | ||
* Copyright IBM Corp. 2016, 2018 | ||
* | ||
* This source code is licensed under the Apache-2.0 license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
import React from 'react'; | ||
import FormGroup from '../FormGroup'; | ||
import TextInput from '../../TextInput'; | ||
import RadioButtonGroup from '../../RadioButtonGroup'; | ||
import RadioButton from '../../RadioButton'; | ||
import Button from '../../Button'; | ||
import { Stack } from '../../Stack'; | ||
|
||
export default { | ||
title: 'Components/FormGroup', | ||
component: FormGroup, | ||
argTypes: { | ||
disabled: { | ||
control: { | ||
type: 'boolean', | ||
}, | ||
defaultValue: false, | ||
}, | ||
// TODO remove hasMargin in v11 | ||
hasMargin: { | ||
table: { | ||
disable: true, | ||
}, | ||
}, | ||
legendText: { | ||
control: { type: 'text' }, | ||
defaultValue: 'FormGroup Legend', | ||
}, | ||
legendId: { | ||
control: { type: 'text' }, | ||
defaultValue: 'formgroup-legend-id', | ||
}, | ||
children: { | ||
control: false, | ||
}, | ||
}, | ||
}; | ||
|
||
export const Default = (args) => ( | ||
<FormGroup style={{ maxWidth: '400px' }} {...args}> | ||
<Stack gap={7}> | ||
<TextInput id="one" labelText="First Name" /> | ||
<TextInput id="two" labelText="Last Name" /> | ||
<RadioButtonGroup | ||
legendText="Radio button heading" | ||
name="radio-button-group" | ||
defaultSelected="radio-1"> | ||
<RadioButton labelText="Option 1" value="radio-1" id="radio-1" /> | ||
<RadioButton labelText="Option 2" value="radio-2" id="radio-2" /> | ||
<RadioButton labelText="Option 3" value="radio-3" id="radio-3" /> | ||
</RadioButtonGroup> | ||
<Button>Submit</Button> | ||
</Stack> | ||
</FormGroup> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters