diff --git a/addons/rose/addon/components/rose/dropdown/index.hbs b/addons/rose/addon/components/rose/dropdown/index.hbs index 90f899281..31497ea27 100644 --- a/addons/rose/addon/components/rose/dropdown/index.hbs +++ b/addons/rose/addon/components/rose/dropdown/index.hbs @@ -29,6 +29,7 @@ item=(component "rose/anonymous" class="rose-dropdown-item") separator=(component "rose/anonymous" tagName="hr" class="rose-dropdown-separator") section=(component "rose/dropdown/section" style=this.style) + key-value=(component "rose/dropdown/key-value" style=this.style) )}} diff --git a/addons/rose/addon/components/rose/dropdown/key-value/index.hbs b/addons/rose/addon/components/rose/dropdown/key-value/index.hbs new file mode 100644 index 000000000..a160906c5 --- /dev/null +++ b/addons/rose/addon/components/rose/dropdown/key-value/index.hbs @@ -0,0 +1,9 @@ +
+
+ {{yield to='key'}} +
+ +
+ {{yield to='value'}} +
+
diff --git a/addons/rose/addon/styles/rose/components/dropdown/_index.scss b/addons/rose/addon/styles/rose/components/dropdown/_index.scss index ad9bba47a..4f44734f8 100644 --- a/addons/rose/addon/styles/rose/components/dropdown/_index.scss +++ b/addons/rose/addon/styles/rose/components/dropdown/_index.scss @@ -3,3 +3,4 @@ @import 'link'; @import 'item'; @import 'section'; +@import 'key-value'; diff --git a/addons/rose/addon/styles/rose/components/dropdown/_key-value.scss b/addons/rose/addon/styles/rose/components/dropdown/_key-value.scss new file mode 100644 index 000000000..70b9b6510 --- /dev/null +++ b/addons/rose/addon/styles/rose/components/dropdown/_key-value.scss @@ -0,0 +1,11 @@ +@use '../../variables/sizing'; + +.rose-dropdown-key-value { + .rose-dropdown-key { + text-transform: capitalize; + } + .rose-dropdown-value { + color: var(--ui-gray); + padding: sizing.rems(xxs) sizing.rems(s) 0 0; + } +} diff --git a/addons/rose/app/components/rose/dropdown/key-value.js b/addons/rose/app/components/rose/dropdown/key-value.js new file mode 100644 index 000000000..51e6ae804 --- /dev/null +++ b/addons/rose/app/components/rose/dropdown/key-value.js @@ -0,0 +1 @@ +export { default } from 'rose/components/rose/dropdown/key-value'; diff --git a/addons/rose/tests/dummy/app/templates/index.hbs b/addons/rose/tests/dummy/app/templates/index.hbs index e3cd92620..e831f2e6a 100644 --- a/addons/rose/tests/dummy/app/templates/index.hbs +++ b/addons/rose/tests/dummy/app/templates/index.hbs @@ -1,3 +1,30 @@ +

KeyValue Dropdown

+ + + <:key>ID + <:value>cl_nbv9375hLHs + + + + + + <:key>Name + <:value>Key/Value + + + + + + <:key>Description + <:value>Lorem ipsum dolor sit amet consectetur adipisicing elit. Assumenda illo ratione libero ducimus magnam, porro sed provident repellat mollitia a, repellendus placeat. Magni consequuntur cumque, debitis obcaecati dolores quasi natus? + + + +

Condensed dropdown

+ <:key>key + <:value>value + + `); + + assert.equal(find('.rose-dropdown-key').textContent.trim(), 'key'); + assert.equal(find('.rose-dropdown-value').textContent.trim(), 'value'); + }); +});