Update fieldset (#1334)
* chore: 🤖 add helpertext to fieldset and update text
This commit is contained in:
1 parent
d2b67fa76c
commit
e17db2e0d6
2 files changed
+26
-11
No files matched your search
@@ -19,6 +19,16 @@
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
{{#if @helperText}}
|
||||
<Rose::Form::HelperText
|
||||
@id='helper-text-{{this.id}}'
|
||||
@error={{@error}}
|
||||
@link={{@link}}
|
||||
@linkText={{@linkText}}
|
||||
>
|
||||
{{@helperText}}
|
||||
</Rose::Form::HelperText>
|
||||
{{/if}}
|
||||
<div class='rose-form-fieldset-body'>
|
||||
{{yield to='body'}}
|
||||
</div>
|
||||
|
||||
@@ -7,10 +7,10 @@ import { text, boolean, select } from '@storybook/addon-knobs';
|
||||
|
||||
# Form Fieldset
|
||||
|
||||
Renders a simple fieldset with title, description and body.
|
||||
Renders a simple fieldset with title, description and body and an optional helperText
|
||||
|
||||
```html
|
||||
<Rose::Form::Fieldset>
|
||||
<Rose::Form::Fieldset @helperText={{helperText}}>
|
||||
<:title>Title</:title>
|
||||
<:description>Description</:description>
|
||||
<:body>Rest of the form</:body>
|
||||
@@ -18,12 +18,17 @@ Renders a simple fieldset with title, description and body.
|
||||
```
|
||||
|
||||
<Preview>
|
||||
<Story name="Basic Fieldset">{{
|
||||
template: hbs`
|
||||
<Rose::Form::Fieldset>
|
||||
<:title>Title</:title>
|
||||
<:description>Description</:description>
|
||||
<:body>Rest of the form</:body>
|
||||
</Rose::Form::Fieldset>`
|
||||
}}</Story>
|
||||
</Preview>
|
||||
<Story name="Basic Fieldset">
|
||||
{{
|
||||
template: hbs`
|
||||
<Rose::Form::Fieldset @helperText={{helperText}}>
|
||||
<:title>Title</:title>
|
||||
<:description>Description</:description>
|
||||
<:body>Rest of the form</:body>
|
||||
</Rose::Form::Fieldset>`,
|
||||
context: {
|
||||
helperText: text('helperText', 'This is an optional help text.'),
|
||||
},
|
||||
}}
|
||||
</Story>
|
||||
</Preview>
|
||||
Reference in new issue
Block a user