From a4b16bdddbb314132033836925e9fff5e0c7d699 Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Thu, 7 May 2020 12:49:40 -0400 Subject: [PATCH] =?UTF-8?q?chore:=20=F0=9F=A4=96=20add=20contextual=20radi?= =?UTF-8?q?o/radio=20group=20components?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../addon/components/rose/form/radio/group.js | 8 ++++ .../addon/components/rose/form/radio/radio.js | 20 ++++++++++ .../components/rose/form/radio/group.hbs | 3 ++ .../components/rose/form/radio/radio.hbs | 18 +++++++++ .../app/components/rose/form/radio/group.js | 1 + .../app/components/rose/form/radio/radio.js | 1 + addons/rose/app/templates/index.hbs | 19 +++++++++ addons/rose/package.json | 1 + .../components/rose/form/radio/group-test.js | 26 +++++++++++++ .../components/rose/form/radio/radio-test.js | 26 +++++++++++++ yarn.lock | 39 +++++++++++++++++-- 11 files changed, 159 insertions(+), 3 deletions(-) create mode 100644 addons/rose/addon/components/rose/form/radio/group.js create mode 100644 addons/rose/addon/components/rose/form/radio/radio.js create mode 100644 addons/rose/addon/templates/components/rose/form/radio/group.hbs create mode 100644 addons/rose/addon/templates/components/rose/form/radio/radio.hbs create mode 100644 addons/rose/app/components/rose/form/radio/group.js create mode 100644 addons/rose/app/components/rose/form/radio/radio.js create mode 100644 addons/rose/tests/integration/components/rose/form/radio/group-test.js create mode 100644 addons/rose/tests/integration/components/rose/form/radio/radio-test.js diff --git a/addons/rose/addon/components/rose/form/radio/group.js b/addons/rose/addon/components/rose/form/radio/group.js new file mode 100644 index 000000000..5375e3cbf --- /dev/null +++ b/addons/rose/addon/components/rose/form/radio/group.js @@ -0,0 +1,8 @@ +import Component from '@ember/component'; +import layout from '../../../../templates/components/rose/form/radio/group'; + +export default Component.extend({ + layout, + + tagName: '' +}); diff --git a/addons/rose/addon/components/rose/form/radio/radio.js b/addons/rose/addon/components/rose/form/radio/radio.js new file mode 100644 index 000000000..853f3a58b --- /dev/null +++ b/addons/rose/addon/components/rose/form/radio/radio.js @@ -0,0 +1,20 @@ +import Component from '@ember/component'; +import layout from '../../../../templates/components/rose/form/radio/radio'; + +/** + * A HTML `` element. + * + * @example + * + */ +export default Component.extend({ + layout, + tagName: '', +}); diff --git a/addons/rose/addon/templates/components/rose/form/radio/group.hbs b/addons/rose/addon/templates/components/rose/form/radio/group.hbs new file mode 100644 index 000000000..4fa7ab5fa --- /dev/null +++ b/addons/rose/addon/templates/components/rose/form/radio/group.hbs @@ -0,0 +1,3 @@ +{{yield (hash + radio=(component 'rose/form/radio/radio' name=@name variable=@variable) +)}} diff --git a/addons/rose/addon/templates/components/rose/form/radio/radio.hbs b/addons/rose/addon/templates/components/rose/form/radio/radio.hbs new file mode 100644 index 000000000..84b155d26 --- /dev/null +++ b/addons/rose/addon/templates/components/rose/form/radio/radio.hbs @@ -0,0 +1,18 @@ +
+ + + + + + {{yield}} + +
diff --git a/addons/rose/app/components/rose/form/radio/group.js b/addons/rose/app/components/rose/form/radio/group.js new file mode 100644 index 000000000..0a106a8ce --- /dev/null +++ b/addons/rose/app/components/rose/form/radio/group.js @@ -0,0 +1 @@ +export { default } from 'rose/components/rose/form/radio/group'; \ No newline at end of file diff --git a/addons/rose/app/components/rose/form/radio/radio.js b/addons/rose/app/components/rose/form/radio/radio.js new file mode 100644 index 000000000..e2662158e --- /dev/null +++ b/addons/rose/app/components/rose/form/radio/radio.js @@ -0,0 +1 @@ +export { default } from 'rose/components/rose/form/radio/radio'; \ No newline at end of file diff --git a/addons/rose/app/templates/index.hbs b/addons/rose/app/templates/index.hbs index 47336ad5e..d4440212c 100644 --- a/addons/rose/app/templates/index.hbs +++ b/addons/rose/app/templates/index.hbs @@ -120,6 +120,25 @@ Dummy app index template />

Radio

+ + + + + + +