more updates

This commit is contained in:
dharini committed 2022-01-16 16:37:55 -08:00
1 parent c807af02f4
commit bf09c9b0b8
6 files changed
+194 -22

No files matched your search

@@ -4,4 +4,4 @@ export default class RoseFormRadioRadioCardComponent extends RoseFormRadioRadioC
// =attributes
className = 'rose-form-radio-card';
}
}
@@ -0,0 +1,120 @@
import { Meta, Story, Preview } from '@storybook/addon-docs/blocks';
import { hbs } from 'ember-cli-htmlbars';
import { text, boolean, select } from '@storybook/addon-knobs';
<Meta title="Rose|Form/Radio/Radio/RadioCard" component="Form/Radio/Radio/RadioCard" />
# Form Radiofield
Renders a form radiofield.
```htmlbars
<Rose::Form::Radio::RadioCard
@label="Yes"
@error={{false}}
@value="yes-agree"
@selectedValue="yes-agree"
@disabled={{false}}
@changed={{fn}}
/>
```
<Preview>
<Story name="Basic" height="10rem">{{
template: hbs`
<Rose::Form::Radio::RadioCard
@label={{label}}
@error={{error}}
@value={{value}}
@selectedValue={{selectedValue}}
@disabled={{disabled}}
@icon={{icon}}
/>
`,
context: {
label: text('text', 'Radiofield'),
error: boolean('error', false),
value: text('value', 'value and selectedValue must match to select radiofield'),
selectedValue: text(
'selectedValue',
'value and selectedValue must match to select radiofield'
),
disabled: boolean('disabled', false),
icon: select(
'icon',
{
'none': null,
'flight-icons/svg/org-16': 'flight-icons/svg/org-16',
'flight-icons/svg/clipboard-copy-16': 'flight-icons/svg/clipboard-copy-16',
},
null
),
}
}}</Story>
</Preview>
```htmlbars
<Rose::Form::Radio::RadioCard
@label="Yes"
@error={{false}}
@value="yes-agree"
@selectedValue="yes-agree"
@disabled={{false}}
@changed={{fn}}
@inline={{true}}
/>
```
<Preview>
<Story name="Radio with inline style" height="10rem">{{
template: hbs`
<Rose::Form::Radio::RadioCard
@label='Radiofield1'
@error={{error}}
@value={{value}}
@selectedValue={{selectedValue}}
@disabled={{disabled}}
@icon={{icon}}
@inline={{inline}}
/>
<Rose::Form::Radio::RadioCard
@label='Radiofield2'
@error={{error}}
@value={{value}}
@selectedValue={{selectedValue}}
@disabled={{disabled}}
@icon={{icon}}
@inline={{inline}}
/>
<Rose::Form::Radio::RadioCard
@label='Radiofield3'
@error={{error}}
@value={{value}}
@selectedValue={{selectedValue}}
@disabled={{disabled}}
@icon={{icon}}
@inline={{inline}}
/>
`,
context: {
error: boolean('error', false),
value: text('value', 'value and selectedValue must match to select radiofield'),
selectedValue: text(
'selectedValue',
'value and selectedValue must match to select radiofield'
),
disabled: boolean('disabled', false),
icon: select(
'icon',
{
'none': null,
'flight-icons/svg/org-16': 'flight-icons/svg/org-16',
'flight-icons/svg/clipboard-copy-16': 'flight-icons/svg/clipboard-copy-16',
},
null
),
inline: boolean('inline', false)
}
}}</Story>
</Preview>
@@ -1,5 +1,5 @@
<div class="{{this.className}} {{if @error " error"}} {{if @inline "inline"}}">
<span class='radio-wrapper'>
<RadioButton
...attributes
@radioClass="rose-form-radio-field"
@@ -11,7 +11,7 @@
@groupValue={{@selectedValue}}
@disabled={{@disabled}}
@changed={{@changed}} />
</span>
<label class="rose-form-radio-label" for={{this.id}}>
{{#if @icon}}