Merge branch 'chore-scope-service' of https://github.com/hashicorp/watchtower-ui into chore-scope-service
This commit is contained in:
5 files changed
+109
-72
No files matched your search
@@ -5,7 +5,7 @@ import { text, boolean, select } from '@storybook/addon-knobs';
|
||||
|
||||
<Meta title="Rose|Form/Checkbox" component="Form/Checkbox" />
|
||||
|
||||
# Form Checkobx
|
||||
# Form Checkbox
|
||||
|
||||
Renders a form input checkbox.
|
||||
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
import { Meta, Story, Preview } from '@storybook/addon-docs/blocks';
|
||||
import { hbs } from 'ember-cli-htmlbars';
|
||||
import { text } from '@storybook/addon-knobs';
|
||||
|
||||
<Meta title="Rose|Form/Radio/Group" component="Form/Radio/Group" />
|
||||
|
||||
# Form radiofield group
|
||||
|
||||
Renders a form radiofield group.
|
||||
|
||||
```htmlbars
|
||||
<Rose::Form::Radio::Group @name={{name}} @selectedValue="disagree" as |radioGroup|>
|
||||
<radioGroup.radio
|
||||
@id="agree-radiofield"
|
||||
@label="Agree"
|
||||
@value="agree"
|
||||
/>
|
||||
<radioGroup.radio
|
||||
@id="disagree-radiofield"
|
||||
@label="disagree"
|
||||
@value="disagree"
|
||||
/>
|
||||
<radioGroup.radio
|
||||
@id="maybe-radiofield"
|
||||
@label="maybe"
|
||||
@value="maybe"
|
||||
/>
|
||||
</Rose::Form::Radio::Group>
|
||||
```
|
||||
<Preview>
|
||||
<Story name="Basic" height="10rem">{{
|
||||
template: hbs`
|
||||
<Rose::Form::Radio::Group @name={{name}} @selectedValue={{selectedValue}} as |radioGroup|>
|
||||
<radioGroup.radio
|
||||
@id="firstField"
|
||||
@label={{firstFieldLabel}}
|
||||
@value={{firstFieldValue}}
|
||||
/>
|
||||
<radioGroup.radio
|
||||
@id="secondField"
|
||||
@label={{secondFieldLabel}}
|
||||
@value={{secondFieldValue}}
|
||||
/>
|
||||
<radioGroup.radio
|
||||
@id="thirdField"
|
||||
@label={{thirdFieldLabel}}
|
||||
@value={{thirdFieldValue}}
|
||||
/>
|
||||
</Rose::Form::Radio::Group>
|
||||
`,
|
||||
context: {
|
||||
name: text('name', 'mustagree'),
|
||||
selectedValue: text('selectedValue', 'disagree'),
|
||||
firstFieldLabel: text('first label', 'Agree'),
|
||||
firstFieldValue: text('first value', 'agree'),
|
||||
secondFieldLabel: text('second label', 'Maybe'),
|
||||
secondFieldValue: text('second value', 'maybe'),
|
||||
thirdFieldLabel: text('third label', 'Disagree'),
|
||||
thirdFieldValue: text('third value', 'disagree'),
|
||||
}
|
||||
}}</Story>
|
||||
</Preview>
|
||||
@@ -0,0 +1,46 @@
|
||||
import { Meta, Story, Preview } from '@storybook/addon-docs/blocks';
|
||||
import { hbs } from 'ember-cli-htmlbars';
|
||||
import { text, boolean } from '@storybook/addon-knobs';
|
||||
|
||||
<Meta title="Rose|Form/Radio/Radio" component="Form/Radio/Radio" />
|
||||
|
||||
# Form Radiofield
|
||||
|
||||
Renders a form radiofield.
|
||||
|
||||
```htmlbars
|
||||
<Rose::Form::Radio::Radio
|
||||
@id="yes-radiofield"
|
||||
@label="Yes"
|
||||
@error={{false}}
|
||||
@value="yes-agree"
|
||||
@selectedValue="yes-agree"
|
||||
@disabled={{false}}
|
||||
/>
|
||||
```
|
||||
|
||||
<Preview>
|
||||
<Story name="Basic" height="10rem">{{
|
||||
template: hbs`
|
||||
<Rose::Form::Radio::Radio
|
||||
@id={{id}}
|
||||
@label={{label}}
|
||||
@error={{error}}
|
||||
@value={{value}}
|
||||
@selectedValue={{selectedValue}}
|
||||
@disabled={{disabled}}
|
||||
/>
|
||||
`,
|
||||
context: {
|
||||
id: text('id', 'radio-1'),
|
||||
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),
|
||||
}
|
||||
}}</Story>
|
||||
</Preview>
|
||||
@@ -1,41 +0,0 @@
|
||||
import { hbs } from 'ember-cli-htmlbars';
|
||||
import { text } from '@storybook/addon-knobs';
|
||||
|
||||
export default {
|
||||
title: 'Rose::Form::Radio::Group',
|
||||
};
|
||||
|
||||
export const Normal = () => ({
|
||||
template: hbs`
|
||||
<Rose::Form::Radio::Group @name={{name}} @selectedValue={{selectedValue}} as |radioGroup|>
|
||||
<radioGroup.radio
|
||||
@id="firstField"
|
||||
@label={{firstFieldLabel}}
|
||||
@value={{firstFieldValue}}
|
||||
/>
|
||||
<radioGroup.radio
|
||||
@id="secondField"
|
||||
@label={{secondFieldLabel}}
|
||||
@value={{secondFieldValue}}
|
||||
/>
|
||||
<radioGroup.radio
|
||||
@id="thirdField"
|
||||
@label={{thirdFieldLabel}}
|
||||
@value={{thirdFieldValue}}
|
||||
/>
|
||||
</Rose::Form::Radio::Group>
|
||||
`,
|
||||
context: {
|
||||
name: text('name', 'Groupname'),
|
||||
selectedValue: text('selectedValue', 'disagree'),
|
||||
|
||||
firstFieldLabel: text('first radiofield label', 'Agree'),
|
||||
firstFieldValue: text('first radiofield value', 'agree'),
|
||||
|
||||
secondFieldLabel: text('second radiofield label', 'Maybe'),
|
||||
secondFieldValue: text('second radiofield value', 'maybe'),
|
||||
|
||||
thirdFieldLabel: text('third radiofield label', 'Disagree'),
|
||||
thirdFieldValue: text('third radiofield value', 'disagree'),
|
||||
},
|
||||
});
|
||||
@@ -1,30 +0,0 @@
|
||||
import { hbs } from 'ember-cli-htmlbars';
|
||||
import { text, boolean } from '@storybook/addon-knobs';
|
||||
|
||||
export default {
|
||||
title: 'Rose::Form::Radio::Radio',
|
||||
};
|
||||
|
||||
export const Normal = () => ({
|
||||
template: hbs`
|
||||
<Rose::Form::Radio::Radio
|
||||
@id={{id}}
|
||||
@label={{label}}
|
||||
@error={{error}}
|
||||
@value={{value}}
|
||||
@selectedValue={{selectedValue}}
|
||||
@disabled={{disabled}}
|
||||
/>
|
||||
`,
|
||||
context: {
|
||||
id: text('id', 'radio-1'),
|
||||
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),
|
||||
},
|
||||
});
|
||||
Reference in new issue
Block a user