From 2fd646c2c9f2bdee26ff75f63219d5886987f187 Mon Sep 17 00:00:00 2001 From: Carlos Alcaide Date: Wed, 16 Jun 2021 11:03:59 -0700 Subject: [PATCH 01/21] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20Add=20condensed=20?= =?UTF-8?q?style=20for=20dropdown?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit First iteration to add a condensed style for dropdown. โœ… Closes: ICU-1431 --- .../addon/components/rose/dropdown/index.hbs | 2 +- .../rose/components/dropdown/_dropdown.scss | 23 ++ .../rose/components/dropdown/_item.scss | 20 +- .../rose/components/dropdown/_section.scss | 24 ++ .../rose/components/form/_fieldset.scss | 2 +- .../rose/tests/dummy/app/templates/index.hbs | 236 ++++-------------- 6 files changed, 104 insertions(+), 203 deletions(-) diff --git a/addons/rose/addon/components/rose/dropdown/index.hbs b/addons/rose/addon/components/rose/dropdown/index.hbs index 587b8c369..90f899281 100644 --- a/addons/rose/addon/components/rose/dropdown/index.hbs +++ b/addons/rose/addon/components/rose/dropdown/index.hbs @@ -1,6 +1,6 @@
diff --git a/addons/rose/addon/styles/rose/components/dropdown/_dropdown.scss b/addons/rose/addon/styles/rose/components/dropdown/_dropdown.scss index 4b75b3ad5..96717ebc1 100644 --- a/addons/rose/addon/styles/rose/components/dropdown/_dropdown.scss +++ b/addons/rose/addon/styles/rose/components/dropdown/_dropdown.scss @@ -5,6 +5,7 @@ $xs: sizing.rems(xs); // 8 $xxs: sizing.rems(xxs); // 4 $chevron: url("data:image/svg+xml;utf-8,"); $chevronWhite: url("data:image/svg+xml;utf-8,"); +$chevronGrey: url("data:image/svg+xml;utf-8,"); .rose-dropdown { --background-image-light: #{$chevron}; @@ -121,4 +122,26 @@ $chevronWhite: url("data:image/svg+xml;utf-8, + {{yield + (hash + header=(component + 'rose/anonymous' tagName='header' class='credentials-card-header' + ) + body=(component + 'rose/anonymous' tagName='div' class='credentials-card-body' + ) + footer=(component + 'rose/anonymous' tagName='footer' class='credentials-card-footer' + ) + ) + }} + \ No newline at end of file diff --git a/ui/desktop/tests/integration/components/card-test.js b/ui/desktop/tests/integration/components/card-test.js new file mode 100644 index 000000000..a48efd669 --- /dev/null +++ b/ui/desktop/tests/integration/components/card-test.js @@ -0,0 +1,28 @@ +import { module, test } from 'qunit'; +import { setupRenderingTest } from 'ember-qunit'; +import { render, find } from '@ember/test-helpers'; +import { hbs } from 'ember-cli-htmlbars'; + +module('Integration | Component | card', function (hooks) { + setupRenderingTest(hooks); + + test('it renders', async function (assert) { + await render(hbs``); + assert.ok(find('.credentials-card')); + }); + + test('it renders with content', async function (assert) { + await render(hbs` + + + + + + `); + + assert.ok(find('.credentials-card')); + assert.ok(find('.credentials-card-header')); + assert.ok(find('.credentials-card-body')); + assert.ok(find('.credentials-card-footer')); + }); +}); From b0a23487765018b0d2b36808e2c5be8fc70bf99c Mon Sep 17 00:00:00 2001 From: Carlos Alcaide Date: Tue, 8 Jun 2021 11:07:50 -0700 Subject: [PATCH 03/21] Refactor component name to just card and change tests to accommodate the changes --- ui/desktop/app/components/card/index.hbs | 10 ++-- ui/desktop/app/styles/app.scss | 57 ++++++++----------- .../tests/integration/components/card-test.js | 10 ++-- 3 files changed, 35 insertions(+), 42 deletions(-) diff --git a/ui/desktop/app/components/card/index.hbs b/ui/desktop/app/components/card/index.hbs index 1000ab795..1b571a872 100644 --- a/ui/desktop/app/components/card/index.hbs +++ b/ui/desktop/app/components/card/index.hbs @@ -1,15 +1,15 @@ -
+
{{yield (hash header=(component - 'rose/anonymous' tagName='header' class='credentials-card-header' + 'rose/anonymous' tagName='header' class='card-header' ) body=(component - 'rose/anonymous' tagName='div' class='credentials-card-body' + 'rose/anonymous' tagName='div' class='card-body' ) footer=(component - 'rose/anonymous' tagName='footer' class='credentials-card-footer' + 'rose/anonymous' tagName='footer' class='card-footer' ) ) }} -
\ No newline at end of file +
diff --git a/ui/desktop/app/styles/app.scss b/ui/desktop/app/styles/app.scss index cc21ec36f..de383ddd5 100644 --- a/ui/desktop/app/styles/app.scss +++ b/ui/desktop/app/styles/app.scss @@ -346,7 +346,6 @@ .rose-dialog-footer { align-items: center; - display: flex; div:nth-child(1) { display: flex; @@ -360,35 +359,29 @@ width: 50%; } } - - // .credentials-card { - // display: flex; - // flex-direction: column; - // margin-bottom: 12px; - - // &:last-child { margin-bottom: 0; } - - // .credentials-card-header { - // display: flex; - // flex-direction: row; - - // div { - // display: flex; - // width: 50%; - - // &:last-child { - // justify-content: flex-end; - // } - // } - // // border-bottom: 1px solid grey; - // } - - // .credentials-card-body { - // // background: yellow; - // } - - // .credentials-card-footer { - // // background: pink; - // } - // } +} + +// Card component (app/componetns/card) +.card { + border: sizing.rems(xxxxs) solid var(--ui-gray-subtler-3); + display: flex; + flex-direction: column; + margin-bottom: sizing.rems(m); + + .card-header { + border-bottom: sizing.rems(xxxxs) solid var(--ui-gray-subtler-3); + display: flex; + } + + .card-body { + display: flex; + flex-direction: column; + padding: sizing.rems(s); + } + + .card-footer { + border-top: sizing.rems(xxxxs) solid var(--ui-gray-subtler-3); + display: flex; + padding: sizing.rems(s); + } } diff --git a/ui/desktop/tests/integration/components/card-test.js b/ui/desktop/tests/integration/components/card-test.js index a48efd669..03c63ab96 100644 --- a/ui/desktop/tests/integration/components/card-test.js +++ b/ui/desktop/tests/integration/components/card-test.js @@ -8,7 +8,7 @@ module('Integration | Component | card', function (hooks) { test('it renders', async function (assert) { await render(hbs``); - assert.ok(find('.credentials-card')); + assert.ok(find('.card')); }); test('it renders with content', async function (assert) { @@ -20,9 +20,9 @@ module('Integration | Component | card', function (hooks) { `); - assert.ok(find('.credentials-card')); - assert.ok(find('.credentials-card-header')); - assert.ok(find('.credentials-card-body')); - assert.ok(find('.credentials-card-footer')); + assert.ok(find('.card')); + assert.ok(find('.card-header')); + assert.ok(find('.card-body')); + assert.ok(find('.card-footer')); }); }); From 939dd1640912ca0e3be4fcf8247aff19cb7d0445 Mon Sep 17 00:00:00 2001 From: Carlos Alcaide Date: Tue, 8 Jun 2021 12:02:29 -0700 Subject: [PATCH 04/21] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20Change=20component?= =?UTF-8?q?=20name=20and=20add=20attributes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change the component name to a more generic name (card). Add heading attributes. โœ… Closes: ICU-1432 --- ui/desktop/app/components/card/index.hbs | 22 ++++++++++--------- .../tests/integration/components/card-test.js | 18 +++++++++++++++ 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/ui/desktop/app/components/card/index.hbs b/ui/desktop/app/components/card/index.hbs index 1b571a872..d0d766aeb 100644 --- a/ui/desktop/app/components/card/index.hbs +++ b/ui/desktop/app/components/card/index.hbs @@ -1,15 +1,17 @@
+
+
+ {{#if @icon}} + + {{/if}} + {{@heading}} +
+ {{yield (hash header=(component 'rose/anonymous'))}} + {{yield (hash - header=(component - 'rose/anonymous' tagName='header' class='card-header' - ) - body=(component - 'rose/anonymous' tagName='div' class='card-body' - ) - footer=(component - 'rose/anonymous' tagName='footer' class='card-footer' - ) + body=(component 'rose/anonymous' tagName='div' class='card-body') + footer=(component 'rose/anonymous' tagName='footer' class='card-footer') ) }} - + \ No newline at end of file diff --git a/ui/desktop/tests/integration/components/card-test.js b/ui/desktop/tests/integration/components/card-test.js index 03c63ab96..8df798416 100644 --- a/ui/desktop/tests/integration/components/card-test.js +++ b/ui/desktop/tests/integration/components/card-test.js @@ -25,4 +25,22 @@ module('Integration | Component | card', function (hooks) { assert.ok(find('.card-body')); assert.ok(find('.card-footer')); }); + + test('header renders an icon when defined', async function (assert) { + await render(hbs` + + + + + + `); + + assert.ok(find('.card')); + assert.ok(find('.card-header')); + assert.ok(find('.card-header .rose-icon')); + assert.equal(this.element.textContent.trim(), 'This is a heading test'); + }); }); From 445d789344e14c3a327548fc0b68adb431c86cf2 Mon Sep 17 00:00:00 2001 From: Carlos Alcaide Date: Wed, 16 Jun 2021 13:42:57 -0700 Subject: [PATCH 05/21] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20Update=20PR=20with?= =?UTF-8?q?=20suggestions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Apply forgoten padding and alignment styles for header. BREAKING CHANGE: ๐Ÿงจ - Refactor to use named block withint the card component. --- ui/desktop/app/components/card/index.hbs | 24 +++++++++++------------- ui/desktop/app/styles/app.scss | 8 ++++++++ 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/ui/desktop/app/components/card/index.hbs b/ui/desktop/app/components/card/index.hbs index d0d766aeb..07debfc77 100644 --- a/ui/desktop/app/components/card/index.hbs +++ b/ui/desktop/app/components/card/index.hbs @@ -1,17 +1,15 @@
-
- {{#if @icon}} - - {{/if}} - {{@heading}} -
- {{yield (hash header=(component 'rose/anonymous'))}} + {{#if @heading}} +
+ {{#if @icon}} + + {{/if}} + {{@heading}} +
+ {{/if}} + {{yield to='header'}}
- {{yield - (hash - body=(component 'rose/anonymous' tagName='div' class='card-body') - footer=(component 'rose/anonymous' tagName='footer' class='card-footer') - ) - }} +
{{yield to='body'}}
+
{{yield to='footer'}}
\ No newline at end of file diff --git a/ui/desktop/app/styles/app.scss b/ui/desktop/app/styles/app.scss index de383ddd5..b829c2938 100644 --- a/ui/desktop/app/styles/app.scss +++ b/ui/desktop/app/styles/app.scss @@ -371,6 +371,14 @@ .card-header { border-bottom: sizing.rems(xxxxs) solid var(--ui-gray-subtler-3); display: flex; + justify-content: flex-start; + padding: sizing.rems(s); + + div { + display: flex; + flex-shrink: 1; + width: 100%; + } } .card-body { From a6a33f6b56c0eac0a9d40fe4e78cce3026e58091 Mon Sep 17 00:00:00 2001 From: Carlos Alcaide Date: Fri, 11 Jun 2021 14:48:41 -0700 Subject: [PATCH 06/21] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20Create=20reveal=20?= =?UTF-8?q?component=20for=20desktop=20client?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Create reveal component for desktop client. โœ… Closes: ICU-1432 --- ui/desktop/app/components/reveal/index.hbs | 17 ++++++ ui/desktop/app/components/reveal/index.js | 14 +++++ ui/desktop/app/styles/app.scss | 52 ++++++++----------- .../integration/components/reveal-test.js | 47 +++++++++++++++++ 4 files changed, 101 insertions(+), 29 deletions(-) create mode 100644 ui/desktop/app/components/reveal/index.hbs create mode 100644 ui/desktop/app/components/reveal/index.js create mode 100644 ui/desktop/tests/integration/components/reveal-test.js diff --git a/ui/desktop/app/components/reveal/index.hbs b/ui/desktop/app/components/reveal/index.hbs new file mode 100644 index 000000000..3f8a551eb --- /dev/null +++ b/ui/desktop/app/components/reveal/index.hbs @@ -0,0 +1,17 @@ +
+ + + {{if this.isOpen @textWhenOpen @textWhenClose}} + + + +
+ +{{#if this.isOpen}} + + {{yield}} + +{{/if}} \ No newline at end of file diff --git a/ui/desktop/app/components/reveal/index.js b/ui/desktop/app/components/reveal/index.js new file mode 100644 index 000000000..f2833ba37 --- /dev/null +++ b/ui/desktop/app/components/reveal/index.js @@ -0,0 +1,14 @@ +import Component from '@glimmer/component'; +import { tracked } from '@glimmer/tracking'; +import { action } from '@ember/object'; + +export default class RevealComponent extends Component { + // =attributes + @tracked isOpen = false; + + // =actions + @action + toggle() { + this.isOpen = !this.isOpen; + } +} diff --git a/ui/desktop/app/styles/app.scss b/ui/desktop/app/styles/app.scss index cc21ec36f..64acd993f 100644 --- a/ui/desktop/app/styles/app.scss +++ b/ui/desktop/app/styles/app.scss @@ -319,7 +319,6 @@ } .change-origin { - @include type.type(s); color: var(--ui-border-starker-1); margin: sizing.rems(l) 0 0 0; text-align: center; @@ -361,34 +360,29 @@ } } - // .credentials-card { - // display: flex; - // flex-direction: column; - // margin-bottom: 12px; +.reveal { + display: flex; + margin-bottom: sizing.rems(m); - // &:last-child { margin-bottom: 0; } + .reveal-summary { + align-items: center; + color: var(--info); + display: flex; + flex-direction: row; + // Hide default twistie triangle + // Firefox + list-style-type: none; + // Webkit / Chromium + &::-webkit-details-marker { + display: none; + } - // .credentials-card-header { - // display: flex; - // flex-direction: row; - - // div { - // display: flex; - // width: 50%; - - // &:last-child { - // justify-content: flex-end; - // } - // } - // // border-bottom: 1px solid grey; - // } - - // .credentials-card-body { - // // background: yellow; - // } - - // .credentials-card-footer { - // // background: pink; - // } - // } + &::marker { + display: none; + } + } +} + +.reveal-content { + display: flex; } diff --git a/ui/desktop/tests/integration/components/reveal-test.js b/ui/desktop/tests/integration/components/reveal-test.js new file mode 100644 index 000000000..4c8f5497d --- /dev/null +++ b/ui/desktop/tests/integration/components/reveal-test.js @@ -0,0 +1,47 @@ +import { module, test } from 'qunit'; +import { setupRenderingTest } from 'ember-qunit'; +import { render, find, click } from '@ember/test-helpers'; +import { hbs } from 'ember-cli-htmlbars'; + +module('Integration | Component | reveal', function (hooks) { + setupRenderingTest(hooks); + + test('it renders', async function (assert) { + assert.expect(3); + await render(hbs` + + `); + assert.ok(find('.reveal')); + assert.ok(find('.reveal-summary')); + assert.ok(find('.reveal-summary').textContent.trim(), 'View content'); + }); + + test('it renders with content, opens, show the content, close and hide the content', async function (assert) { + await render(hbs` + +
+          
+            {
+              "auth": null,
+              "lease_duration": 3600,
+              "lease_id": "",
+              "renewable": false
+            }
+          
+        
+
+ `); + assert.notOk(find('.reveal-content')); + await click('details'); + assert.ok(find('.reveal-content')); + assert.ok(find('.reveal-content pre code')); + await click('details'); + assert.notOk(find('.reveal-content')); + }); +}); From b209ff7b2afd406783bfcc0d1499e52af5edf656 Mon Sep 17 00:00:00 2001 From: Carlos Alcaide Date: Fri, 11 Jun 2021 15:00:31 -0700 Subject: [PATCH 07/21] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20Fix=20commited=20m?= =?UTF-8?q?istake?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix a line of code I delete by accident on my previous commit --- ui/desktop/app/styles/app.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/ui/desktop/app/styles/app.scss b/ui/desktop/app/styles/app.scss index 64acd993f..821c274d8 100644 --- a/ui/desktop/app/styles/app.scss +++ b/ui/desktop/app/styles/app.scss @@ -319,6 +319,7 @@ } .change-origin { + @include type.type(s); color: var(--ui-border-starker-1); margin: sizing.rems(l) 0 0 0; text-align: center; From 62b097170c203692e575d99778ef08001ba29063 Mon Sep 17 00:00:00 2001 From: Carlos Alcaide Date: Fri, 18 Jun 2021 12:29:39 -0700 Subject: [PATCH 08/21] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20Changes=20from=20p?= =?UTF-8?q?revious=20PR=20suggestions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Refactor RevealComponent class to inherit from RoseDropdown, no logic need it. Now there is no need to keep any logic or state. - Refactor component, to toggle Summary text and set chevron icon with CSS. - Removed old commented code. Please feel free to suggest a change to bring it back if can be useful. --- .../rose/components/dropdown/_item.scss | 5 ---- ui/desktop/app/components/reveal/index.hbs | 21 +++++++-------- ui/desktop/app/components/reveal/index.js | 15 +++-------- ui/desktop/app/styles/app.scss | 27 +++++++++++++++++++ .../integration/components/reveal-test.js | 13 ++++----- 5 files changed, 47 insertions(+), 34 deletions(-) diff --git a/addons/rose/addon/styles/rose/components/dropdown/_item.scss b/addons/rose/addon/styles/rose/components/dropdown/_item.scss index a0f4b0a67..b38dd5903 100644 --- a/addons/rose/addon/styles/rose/components/dropdown/_item.scss +++ b/addons/rose/addon/styles/rose/components/dropdown/_item.scss @@ -57,11 +57,6 @@ $checkmark: url("data:image/svg+xml;utf-8, +
-
- {{if this.isOpen @textWhenOpen @textWhenClose}} + + {{@textWhenClose}} + + + {{@textWhenOpen}} - - -
-{{#if this.isOpen}} - + + {{yield}} -{{/if}} \ No newline at end of file + \ No newline at end of file diff --git a/ui/desktop/app/components/reveal/index.js b/ui/desktop/app/components/reveal/index.js index f2833ba37..339596663 100644 --- a/ui/desktop/app/components/reveal/index.js +++ b/ui/desktop/app/components/reveal/index.js @@ -1,14 +1,7 @@ -import Component from '@glimmer/component'; -import { tracked } from '@glimmer/tracking'; -import { action } from '@ember/object'; +import RoseDropdownComponent from 'rose/components/rose/dropdown'; -export default class RevealComponent extends Component { - // =attributes - @tracked isOpen = false; - - // =actions - @action - toggle() { - this.isOpen = !this.isOpen; +export default class RevealComponent extends RoseDropdownComponent { + constructor() { + super(...arguments); } } diff --git a/ui/desktop/app/styles/app.scss b/ui/desktop/app/styles/app.scss index 821c274d8..fc806580d 100644 --- a/ui/desktop/app/styles/app.scss +++ b/ui/desktop/app/styles/app.scss @@ -360,11 +360,38 @@ width: 50%; } } +} + + +$chevron-up: "data:image/svg+xml;utf-8,"; +$chevron-down: "data:image/svg+xml;utf-8,"; .reveal { display: flex; margin-bottom: sizing.rems(m); + &:not([open]) .reveal-summary { + .reveal-summary-text-close { + background: url($chevron-down) no-repeat right center; + padding-right: sizing.rems(l); + } + + .reveal-summary-text-open { + display: none; + } + } + + &[open] .reveal-summary { + .reveal-summary-text-open { + background: url($chevron-up) no-repeat right center; + padding-right: sizing.rems(l); + } + + .reveal-summary-text-close { + display: none; + } + } + .reveal-summary { align-items: center; color: var(--info); diff --git a/ui/desktop/tests/integration/components/reveal-test.js b/ui/desktop/tests/integration/components/reveal-test.js index 4c8f5497d..4acf7b69e 100644 --- a/ui/desktop/tests/integration/components/reveal-test.js +++ b/ui/desktop/tests/integration/components/reveal-test.js @@ -20,6 +20,7 @@ module('Integration | Component | reveal', function (hooks) { }); test('it renders with content, opens, show the content, close and hide the content', async function (assert) { + assert.expect(3); await render(hbs` `); - assert.notOk(find('.reveal-content')); - await click('details'); - assert.ok(find('.reveal-content')); - assert.ok(find('.reveal-content pre code')); - await click('details'); - assert.notOk(find('.reveal-content')); + + assert.notOk(find('details').open); + await click('summary'); + assert.ok(find('details').open); + await click('summary'); + assert.notOk(find('details').open); }); }); From 88d47688facb28047dae922ed1e8a7f9d33be241 Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Fri, 18 Jun 2021 16:54:16 -0400 Subject: [PATCH 09/21] =?UTF-8?q?chore:=20=F0=9F=A4=96=20simplify=20dropdo?= =?UTF-8?q?wn=20styles=20for=20consistency=20with=20Structur?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addons/api/mirage/config.js | 2 +- .../rose/components/dropdown/_item.scss | 29 +++++++++---------- .../rose/components/dropdown/_section.scss | 24 --------------- .../rose/tests/dummy/app/templates/index.hbs | 6 +++- 4 files changed, 19 insertions(+), 42 deletions(-) diff --git a/addons/api/mirage/config.js b/addons/api/mirage/config.js index 007950f69..008ed2743 100644 --- a/addons/api/mirage/config.js +++ b/addons/api/mirage/config.js @@ -13,7 +13,7 @@ export default function () { // make this `/api`, for example, if your API is namespaced this.namespace = config.api.namespace; // delay for each request, automatically set to 0 during testing - this.timing = 350; + this.timing = 1; // Allow any configured API host to passthrough, which is useful in // development for testing against a locally running backend. diff --git a/addons/rose/addon/styles/rose/components/dropdown/_item.scss b/addons/rose/addon/styles/rose/components/dropdown/_item.scss index ad01cdb70..2d9634e42 100644 --- a/addons/rose/addon/styles/rose/components/dropdown/_item.scss +++ b/addons/rose/addon/styles/rose/components/dropdown/_item.scss @@ -7,8 +7,14 @@ $checkmark: url("data:image/svg+xml;utf-8, + {{yield}} \ No newline at end of file diff --git a/ui/desktop/app/components/reveal/index.js b/ui/desktop/app/components/reveal/index.js index 339596663..a4db866c4 100644 --- a/ui/desktop/app/components/reveal/index.js +++ b/ui/desktop/app/components/reveal/index.js @@ -1,7 +1,3 @@ import RoseDropdownComponent from 'rose/components/rose/dropdown'; -export default class RevealComponent extends RoseDropdownComponent { - constructor() { - super(...arguments); - } -} +export default class RevealComponent extends RoseDropdownComponent {} From bfdaacc2cdc4c7294f8751e46fcdfd814321f4e5 Mon Sep 17 00:00:00 2001 From: Carlos Alcaide Date: Fri, 18 Jun 2021 16:23:07 -0700 Subject: [PATCH 11/21] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20Changing=20div=20f?= =?UTF-8?q?or=20h2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changing the heading text container from a div to an h2 --- ui/desktop/app/components/card/index.hbs | 4 ++-- ui/desktop/app/styles/app.scss | 9 ++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ui/desktop/app/components/card/index.hbs b/ui/desktop/app/components/card/index.hbs index 07debfc77..28e1f869f 100644 --- a/ui/desktop/app/components/card/index.hbs +++ b/ui/desktop/app/components/card/index.hbs @@ -1,12 +1,12 @@
{{#if @heading}} -
+

{{#if @icon}} {{/if}} {{@heading}} -

+ {{/if}} {{yield to='header'}} diff --git a/ui/desktop/app/styles/app.scss b/ui/desktop/app/styles/app.scss index b829c2938..e314e01ce 100644 --- a/ui/desktop/app/styles/app.scss +++ b/ui/desktop/app/styles/app.scss @@ -369,12 +369,19 @@ margin-bottom: sizing.rems(m); .card-header { + align-items: center; border-bottom: sizing.rems(xxxxs) solid var(--ui-gray-subtler-3); display: flex; justify-content: flex-start; padding: sizing.rems(s); - div { + h2 { + @include type.type(s, normal); + color: var(--ui-gray-starker-1); + } + + div, + h2 { display: flex; flex-shrink: 1; width: 100%; From c3561a106366fc399c0a13beb4c14ba048effceb Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Tue, 22 Jun 2021 12:08:31 -0400 Subject: [PATCH 12/21] chore: tweak card styles --- ui/desktop/app/styles/app.scss | 14 +++--- .../scopes/scope/projects/targets.hbs | 45 ++++++++++++++----- 2 files changed, 40 insertions(+), 19 deletions(-) diff --git a/ui/desktop/app/styles/app.scss b/ui/desktop/app/styles/app.scss index e314e01ce..537e540ed 100644 --- a/ui/desktop/app/styles/app.scss +++ b/ui/desktop/app/styles/app.scss @@ -373,30 +373,26 @@ border-bottom: sizing.rems(xxxxs) solid var(--ui-gray-subtler-3); display: flex; justify-content: flex-start; - padding: sizing.rems(s); + padding: sizing.rems(s) sizing.rems(m); h2 { @include type.type(s, normal); color: var(--ui-gray-starker-1); + margin: 0; + padding: sizing.rems(xxs) + sizing.rems(xxxs) 0; } - div, - h2 { - display: flex; - flex-shrink: 1; - width: 100%; + .rose-icon { + margin-right: sizing.rems(xxxs); } } .card-body { - display: flex; - flex-direction: column; padding: sizing.rems(s); } .card-footer { border-top: sizing.rems(xxxxs) solid var(--ui-gray-subtler-3); - display: flex; padding: sizing.rems(s); } } diff --git a/ui/desktop/app/templates/scopes/scope/projects/targets.hbs b/ui/desktop/app/templates/scopes/scope/projects/targets.hbs index 3fee051d6..5e6f624f4 100644 --- a/ui/desktop/app/templates/scopes/scope/projects/targets.hbs +++ b/ui/desktop/app/templates/scopes/scope/projects/targets.hbs @@ -20,18 +20,43 @@ <:body>

{{t 'resources.target.messages.proxy_url.title'}} ({{t 'resources.target.types.tcp'}})

- - {{session.proxy_address}}:{{session.proxy_port}} - +

+ + {{session.proxy_address}}:{{session.proxy_port}} + +

- {{! + {{!-- -

Credentials

}} +

Credentials

+ + <:body> + + + + Key + Value + + + + + Foo + Value + + + ttl + Test + + + + + +--}} <:footer>
@@ -58,4 +83,4 @@ {{/each}} {{/each}} -{{outlet}} \ No newline at end of file +{{outlet}} From 8934e4455878300b7c88b329fe71965968341752 Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Tue, 22 Jun 2021 12:26:20 -0400 Subject: [PATCH 13/21] tweak styles --- addons/core/public/app-icons/credential.svg | 4 ++ addons/core/public/app-icons/credentials.svg | 9 +++++ .../styles/rose/components/table/_table.scss | 27 ++++++++++++- ui/desktop/app/components/card/index.hbs | 40 ++++++++++++------- .../scopes/scope/projects/targets.hbs | 10 ++--- 5 files changed, 69 insertions(+), 21 deletions(-) create mode 100644 addons/core/public/app-icons/credential.svg create mode 100644 addons/core/public/app-icons/credentials.svg diff --git a/addons/core/public/app-icons/credential.svg b/addons/core/public/app-icons/credential.svg new file mode 100644 index 000000000..fb9bc8a1d --- /dev/null +++ b/addons/core/public/app-icons/credential.svg @@ -0,0 +1,4 @@ + + + + diff --git a/addons/core/public/app-icons/credentials.svg b/addons/core/public/app-icons/credentials.svg new file mode 100644 index 000000000..72c15d48a --- /dev/null +++ b/addons/core/public/app-icons/credentials.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/addons/rose/addon/styles/rose/components/table/_table.scss b/addons/rose/addon/styles/rose/components/table/_table.scss index 40520adee..279deda1a 100644 --- a/addons/rose/addon/styles/rose/components/table/_table.scss +++ b/addons/rose/addon/styles/rose/components/table/_table.scss @@ -9,6 +9,10 @@ .rose-table-row { border-bottom: sizing.rems(xxxxs) solid var(--ui-gray-subtler-3); text-align: left; + + &:last-child { + border-bottom: 0; + } } // This styles are add to stop the input to apply extra margin (default on forms) @@ -39,6 +43,9 @@ .rose-table-header-cell { @include type.type(s, semibold); + } + + .rose-table-header .rose-table-header-cell { color: var(--ui-gray); } @@ -67,11 +74,27 @@ } &.rose-table-condensed { - .rose-table-cell { + .rose-table-cell, + .rose-table-header-cell { @include type.type(s); $lineHeight: math.div(36, 14); line-height: $lineHeight; - padding: math.div(sizing.rems(s), 2) sizing.rems(s); + padding: sizing.rems(xxs) + sizing.rems(xxxxs) sizing.rems(s); + + &:first-child { + padding-left: 0; + } + } + .rose-table-header { + .rose-table-header-cell { + $lineHeight: math.div(16, 14); + line-height: $lineHeight; + padding: sizing.rems(xs) sizing.rems(s); + + &:first-child { + padding-left: 0; + } + } } } diff --git a/ui/desktop/app/components/card/index.hbs b/ui/desktop/app/components/card/index.hbs index 28e1f869f..e7525224f 100644 --- a/ui/desktop/app/components/card/index.hbs +++ b/ui/desktop/app/components/card/index.hbs @@ -1,15 +1,27 @@
-
- {{#if @heading}} -

- {{#if @icon}} - - {{/if}} - {{@heading}} -

- {{/if}} - {{yield to='header'}} -
-
{{yield to='body'}}
-
{{yield to='footer'}}
-
\ No newline at end of file + {{#if (if (has-block 'header') true @heading)}} +
+ {{#if @heading}} +

+ {{#if @icon}} + + {{/if}} + {{@heading}} +

+ {{/if}} + + {{yield to='header'}} + +
+ {{/if}} + +
+ {{yield to='body'}} +
+ + {{#if (has-block 'footer')}} +
+ {{yield to='footer'}} +
+ {{/if}} + diff --git a/ui/desktop/app/templates/scopes/scope/projects/targets.hbs b/ui/desktop/app/templates/scopes/scope/projects/targets.hbs index 5e6f624f4..09eae199b 100644 --- a/ui/desktop/app/templates/scopes/scope/projects/targets.hbs +++ b/ui/desktop/app/templates/scopes/scope/projects/targets.hbs @@ -32,20 +32,20 @@ {{!-- -

Credentials

+

Credentials

--}} - + <:body> - Key + Key Value - Foo + foo Value @@ -56,7 +56,7 @@ ---}} + <:footer>
From 4abf4e5550f3756bd1067b1c299d2ceab0f7fb14 Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Tue, 22 Jun 2021 12:58:34 -0400 Subject: [PATCH 14/21] =?UTF-8?q?chore:=20=F0=9F=A4=96=20polish=20card=20a?= =?UTF-8?q?nd=20example=20card=20usage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/desktop/app/components/card/index.hbs | 2 +- .../templates/scopes/scope/projects/targets.hbs | 8 ++++---- .../tests/integration/components/card-test.js | 17 ++++++++--------- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/ui/desktop/app/components/card/index.hbs b/ui/desktop/app/components/card/index.hbs index e7525224f..1516a7bcf 100644 --- a/ui/desktop/app/components/card/index.hbs +++ b/ui/desktop/app/components/card/index.hbs @@ -24,4 +24,4 @@ {{yield to='footer'}} {{/if}} - + \ No newline at end of file diff --git a/ui/desktop/app/templates/scopes/scope/projects/targets.hbs b/ui/desktop/app/templates/scopes/scope/projects/targets.hbs index 09eae199b..1fa2603c6 100644 --- a/ui/desktop/app/templates/scopes/scope/projects/targets.hbs +++ b/ui/desktop/app/templates/scopes/scope/projects/targets.hbs @@ -30,9 +30,9 @@

- {{!-- + {{! -

Credentials

--}} +

Credentials

<:body> @@ -56,7 +56,7 @@ - + }} <:footer>
@@ -83,4 +83,4 @@ {{/each}} {{/each}} -{{outlet}} +{{outlet}} \ No newline at end of file diff --git a/ui/desktop/tests/integration/components/card-test.js b/ui/desktop/tests/integration/components/card-test.js index 8df798416..fdb37919b 100644 --- a/ui/desktop/tests/integration/components/card-test.js +++ b/ui/desktop/tests/integration/components/card-test.js @@ -13,10 +13,10 @@ module('Integration | Component | card', function (hooks) { test('it renders with content', async function (assert) { await render(hbs` - - - - + + <:header> + <:body> + <:footer> `); @@ -30,11 +30,10 @@ module('Integration | Component | card', function (hooks) { await render(hbs` - - - + @icon='key'> + <:header> + <:body> + <:footer> `); From 73fef6b907ec0603427701368f819fc291d542b7 Mon Sep 17 00:00:00 2001 From: Susmitha Girumala Date: Tue, 22 Jun 2021 13:30:08 -0400 Subject: [PATCH 15/21] feat: Add key-value item to dropdown in rose addon --- .../addon/components/rose/dropdown/index.hbs | 1 + .../rose/dropdown/key-value/index.hbs | 9 +++++++ .../rose/components/dropdown/_index.scss | 1 + .../rose/components/dropdown/_key-value.scss | 11 ++++++++ .../app/components/rose/dropdown/key-value.js | 1 + .../rose/tests/dummy/app/templates/index.hbs | 27 +++++++++++++++++++ .../rose/dropdown/key-value-test.js | 20 ++++++++++++++ 7 files changed, 70 insertions(+) create mode 100644 addons/rose/addon/components/rose/dropdown/key-value/index.hbs create mode 100644 addons/rose/addon/styles/rose/components/dropdown/_key-value.scss create mode 100644 addons/rose/app/components/rose/dropdown/key-value.js create mode 100644 addons/rose/tests/integration/components/rose/dropdown/key-value-test.js 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'); + }); +}); From 27afafa077547ff01a00e57b18eac283622bf357 Mon Sep 17 00:00:00 2001 From: Susmitha Girumala Date: Tue, 22 Jun 2021 13:45:46 -0400 Subject: [PATCH 16/21] docs: Update dropdown storybook with key-value item --- .../components/rose/dropdown/index.stories.mdx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/addons/rose/addon/components/rose/dropdown/index.stories.mdx b/addons/rose/addon/components/rose/dropdown/index.stories.mdx index a6b7a1b52..77cd40c4c 100644 --- a/addons/rose/addon/components/rose/dropdown/index.stories.mdx +++ b/addons/rose/addon/components/rose/dropdown/index.stories.mdx @@ -63,6 +63,24 @@ A simple dropdown component with support for links and buttons. }} + + {{ + template: hbs` + + + <: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? + + + `, + }} + + ```html From 1b5e1a7736312fc592ca7c277eb843b35cda228f Mon Sep 17 00:00:00 2001 From: Susmitha Girumala Date: Tue, 22 Jun 2021 13:53:34 -0400 Subject: [PATCH 17/21] style: Remove unused style param --- addons/rose/addon/components/rose/dropdown/index.hbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/rose/addon/components/rose/dropdown/index.hbs b/addons/rose/addon/components/rose/dropdown/index.hbs index 31497ea27..c4f8dec52 100644 --- a/addons/rose/addon/components/rose/dropdown/index.hbs +++ b/addons/rose/addon/components/rose/dropdown/index.hbs @@ -29,7 +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) + key-value=(component "rose/dropdown/key-value") )}}
From 2b5afa0e2c361a6550a580321e632745798114cb Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Tue, 22 Jun 2021 15:35:19 -0400 Subject: [PATCH 18/21] chore: add more example content to credentials card --- .../scopes/scope/projects/targets.hbs | 32 +++++++++++++++++-- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/ui/desktop/app/templates/scopes/scope/projects/targets.hbs b/ui/desktop/app/templates/scopes/scope/projects/targets.hbs index 1fa2603c6..fb8f3789e 100644 --- a/ui/desktop/app/templates/scopes/scope/projects/targets.hbs +++ b/ui/desktop/app/templates/scopes/scope/projects/targets.hbs @@ -35,6 +35,15 @@

Credentials

+ <:header> + + + <:body> @@ -55,8 +64,25 @@ - - }} + <:footer> + +
+                    
+  {
+    "auth": null,
+    "lease_duration": 3600,
+    "lease_id": "",
+    "renewable": false
+  }
+                    
+                  
+
+ +
--}} + <:footer>
@@ -83,4 +109,4 @@ {{/each}} {{/each}} -{{outlet}} \ No newline at end of file +{{outlet}} From 3fcff99024e15c9a00dead2ef35fb21c0987ac9f Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Tue, 22 Jun 2021 15:35:47 -0400 Subject: [PATCH 19/21] fix: template syntax error --- ui/desktop/app/templates/scopes/scope/projects/targets.hbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/desktop/app/templates/scopes/scope/projects/targets.hbs b/ui/desktop/app/templates/scopes/scope/projects/targets.hbs index fb8f3789e..d9066001a 100644 --- a/ui/desktop/app/templates/scopes/scope/projects/targets.hbs +++ b/ui/desktop/app/templates/scopes/scope/projects/targets.hbs @@ -30,7 +30,7 @@

- {{! + {{!--

Credentials

From 1143fb02cc1e1460688522a750d152056f8ce3e1 Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Tue, 22 Jun 2021 16:43:02 -0400 Subject: [PATCH 20/21] =?UTF-8?q?chore:=20=F0=9F=A4=96=20polish=20up=20rev?= =?UTF-8?q?eal=20component?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/desktop/.stylelintrc.json | 3 +- ui/desktop/app/components/reveal/index.hbs | 8 +-- ui/desktop/app/styles/app.scss | 68 +++++++++---------- .../scopes/scope/projects/targets.hbs | 2 +- .../integration/components/reveal-test.js | 4 +- 5 files changed, 42 insertions(+), 43 deletions(-) diff --git a/ui/desktop/.stylelintrc.json b/ui/desktop/.stylelintrc.json index b20f46ce4..d28c485da 100644 --- a/ui/desktop/.stylelintrc.json +++ b/ui/desktop/.stylelintrc.json @@ -6,6 +6,7 @@ "scss/at-extend-no-missing-placeholder": null, "function-parentheses-space-inside": null, "property-no-vendor-prefix": null, - "at-rule-no-vendor-prefix": null + "at-rule-no-vendor-prefix": null, + "order/properties-alphabetical-order": null } } diff --git a/ui/desktop/app/components/reveal/index.hbs b/ui/desktop/app/components/reveal/index.hbs index 5674a8036..8e15785dd 100644 --- a/ui/desktop/app/components/reveal/index.hbs +++ b/ui/desktop/app/components/reveal/index.hbs @@ -1,9 +1,9 @@ -
- - +
+ + {{@textWhenClose}} - + {{@textWhenOpen}} diff --git a/ui/desktop/app/styles/app.scss b/ui/desktop/app/styles/app.scss index 09e6ce142..00313f9ea 100644 --- a/ui/desktop/app/styles/app.scss +++ b/ui/desktop/app/styles/app.scss @@ -361,40 +361,22 @@ } } -$chevron-up: "data:image/svg+xml;utf-8,"; -$chevron-down: "data:image/svg+xml;utf-8,"; +// Reveal component (app/components/reveal) +$chevron-up: url("data:image/svg+xml;utf-8,"); +$chevron-down: url("data:image/svg+xml;utf-8,"); .reveal { - display: flex; - margin-bottom: sizing.rems(m); + --trigger-color: var(--action); - &:not([open]) .reveal-summary { - .reveal-summary-text-close { - background: url($chevron-down) no-repeat right center; - padding-right: sizing.rems(l); - } + .reveal-trigger { + background: url($chevron-down) no-repeat right center; + color: var(--trigger-color); + cursor: default; + display: inline-block; + overflow: hidden; + padding-right: sizing.rems(l); + white-space: nowrap; - .reveal-summary-text-open { - display: none; - } - } - - &[open] .reveal-summary { - .reveal-summary-text-open { - background: url($chevron-up) no-repeat right center; - padding-right: sizing.rems(l); - } - - .reveal-summary-text-close { - display: none; - } - } - - .reveal-summary { - align-items: center; - color: var(--info); - display: flex; - flex-direction: row; // Hide default twistie triangle // Firefox list-style-type: none; @@ -406,14 +388,30 @@ $chevron-down: "data:image/svg+xml;utf-8, `); assert.ok(find('.reveal')); - assert.ok(find('.reveal-summary')); - assert.ok(find('.reveal-summary').textContent.trim(), 'View content'); + assert.ok(find('.reveal-trigger')); + assert.ok(find('.reveal-trigger').textContent.trim(), 'View content'); }); test('it renders with content, opens, show the content, close and hide the content', async function (assert) { From c7ee9cde175e1ea517d9fe1f82fa966866199711 Mon Sep 17 00:00:00 2001 From: Susmitha Girumala Date: Wed, 23 Jun 2021 09:04:08 -0400 Subject: [PATCH 21/21] feat: Allow dropdown items to be selectable without closing --- .../addon/components/rose/dropdown/index.hbs | 33 +++++++++++++------ .../rose/dropdown/index.stories.mdx | 13 +++++++- .../rose/tests/dummy/app/templates/index.hbs | 1 + 3 files changed, 36 insertions(+), 11 deletions(-) diff --git a/addons/rose/addon/components/rose/dropdown/index.hbs b/addons/rose/addon/components/rose/dropdown/index.hbs index c4f8dec52..5d02e87e8 100644 --- a/addons/rose/addon/components/rose/dropdown/index.hbs +++ b/addons/rose/addon/components/rose/dropdown/index.hbs @@ -22,15 +22,28 @@ -
- {{yield (hash - link=(component "rose/dropdown/link" style=this.style) - button=(component "rose/dropdown/button" style=this.style) - 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") - )}} -
+ {{#if @ignoreClickInside}} +
+ {{yield (hash + link=(component "rose/dropdown/link" style=this.style) + button=(component "rose/dropdown/button" style=this.style) + 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") + )}} +
+ {{else}} +
+ {{yield (hash + link=(component "rose/dropdown/link" style=this.style) + button=(component "rose/dropdown/button" style=this.style) + 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") + )}} +
+ {{/if}}
diff --git a/addons/rose/addon/components/rose/dropdown/index.stories.mdx b/addons/rose/addon/components/rose/dropdown/index.stories.mdx index 77cd40c4c..58a0575bf 100644 --- a/addons/rose/addon/components/rose/dropdown/index.stories.mdx +++ b/addons/rose/addon/components/rose/dropdown/index.stories.mdx @@ -66,7 +66,7 @@ A simple dropdown component with support for links and buttons. {{ template: hbs` - + <:key>Name <:value>Key/Value @@ -143,3 +143,14 @@ form field. ``` + +Closing dropdown after clicking inside it's content can be ignored using `ignoreClickInside`. This is useful when dropdown contains keyvalue items that users need to select/copy/interact with. + +```html + + + <:key>ID + <:value>cl_nbv9375hLHs + + +``` diff --git a/addons/rose/tests/dummy/app/templates/index.hbs b/addons/rose/tests/dummy/app/templates/index.hbs index e831f2e6a..ed8345c31 100644 --- a/addons/rose/tests/dummy/app/templates/index.hbs +++ b/addons/rose/tests/dummy/app/templates/index.hbs @@ -2,6 +2,7 @@