From a4dca84e62ddc04710d0f18ccbec08d80e62590b Mon Sep 17 00:00:00 2001 From: dharini Date: Wed, 10 Nov 2021 21:36:42 -0800 Subject: [PATCH 01/11] dropdown- checkbox styles --- .../rose/dropdown/index.stories.mdx | 71 ++++++++++++++++++- .../components/rose/form/checkbox/index.hbs | 2 +- .../rose/form/checkbox/index.stories.mdx | 4 ++ .../rose/addon/components/rose/form/index.hbs | 1 + .../rose/components/dropdown/_item.scss | 66 ++++++++++++++++- .../rose/components/form/_checkbox.scss | 2 - 6 files changed, 139 insertions(+), 7 deletions(-) diff --git a/addons/rose/addon/components/rose/dropdown/index.stories.mdx b/addons/rose/addon/components/rose/dropdown/index.stories.mdx index 1f3545707..87d7059cc 100644 --- a/addons/rose/addon/components/rose/dropdown/index.stories.mdx +++ b/addons/rose/addon/components/rose/dropdown/index.stories.mdx @@ -1,6 +1,7 @@ import { Meta, Story, Preview } from '@storybook/addon-docs/blocks'; import { hbs } from 'ember-cli-htmlbars'; -import { boolean } from '@storybook/addon-knobs'; +import { boolean, object } from '@storybook/addon-knobs'; +import { action } from '@storybook/addon-actions'; @@ -123,8 +124,8 @@ Dropdown indicator can be hidden using `showCaret` attribute. ``` -Dropdowns also support radio buttons. Currently, this is the only supported -form field. +Dropdowns also support radio buttons. Currently, radio buttons and checkboxes are the supported +form fields. ```html @@ -144,6 +145,70 @@ form field. ``` +```html + + + + + + + + + + +``` + + + + {{ + template: hbs` + + + + + + + + + + `, + context: { + inline: boolean('inline', false), + disabled: boolean('disabled', false), + outline: boolean('outline', true), + items: object('items', [ + { id: 1, name: 'Foo' }, + { id: 2, name: 'Bar' }, + { id: 3, name: 'Baz' }, + ]), + selectedItems: object('selectedItems', []), + onChange: action('changed'), + } + }} + + + + 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 diff --git a/addons/rose/addon/components/rose/form/checkbox/index.hbs b/addons/rose/addon/components/rose/form/checkbox/index.hbs index c8f759924..02b7987d7 100644 --- a/addons/rose/addon/components/rose/form/checkbox/index.hbs +++ b/addons/rose/addon/components/rose/form/checkbox/index.hbs @@ -1,4 +1,4 @@ -
+
``` @@ -93,6 +94,7 @@ Renders a form input checkbox. @error={{error}} @disabled={{disabled}} @inline={{inline}} + @outline={{outline}} /> `, context: { diff --git a/addons/rose/addon/components/rose/form/index.hbs b/addons/rose/addon/components/rose/form/index.hbs index e23e52c0b..18f637ea3 100644 --- a/addons/rose/addon/components/rose/form/index.hbs +++ b/addons/rose/addon/components/rose/form/index.hbs @@ -17,6 +17,7 @@ {{yield (hash radioGroup=(component 'rose/form/radio/group' disabled=this.disabled) checkbox=(component 'rose/form/checkbox' disabled=this.disabled) + checkboxGroup=(component 'rose/form/checkbox/group' disabled=this.disabled) input=(component 'rose/form/input' disabled=this.disabled) select=(component 'rose/form/select' disabled=this.disabled) textarea=(component 'rose/form/textarea' disabled=this.disabled) diff --git a/addons/rose/addon/styles/rose/components/dropdown/_item.scss b/addons/rose/addon/styles/rose/components/dropdown/_item.scss index 2d9634e42..78c963c1f 100644 --- a/addons/rose/addon/styles/rose/components/dropdown/_item.scss +++ b/addons/rose/addon/styles/rose/components/dropdown/_item.scss @@ -69,4 +69,68 @@ $checkmark: url("data:image/svg+xml;utf-8, Date: Thu, 11 Nov 2021 09:51:41 -0800 Subject: [PATCH 02/11] =?UTF-8?q?style:=20=F0=9F=92=84=20right=20align=20c?= =?UTF-8?q?heckbox=20and=20toggle=20outline?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rose/addon/components/rose/dropdown/index.stories.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/rose/addon/components/rose/dropdown/index.stories.mdx b/addons/rose/addon/components/rose/dropdown/index.stories.mdx index 87d7059cc..2076d8160 100644 --- a/addons/rose/addon/components/rose/dropdown/index.stories.mdx +++ b/addons/rose/addon/components/rose/dropdown/index.stories.mdx @@ -147,7 +147,7 @@ form fields. ```html - + - {{ + {{ template: hbs` - + Date: Thu, 11 Nov 2021 10:32:46 -0800 Subject: [PATCH 03/11] Update index.stories.mdx --- addons/rose/addon/components/rose/dropdown/index.stories.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/rose/addon/components/rose/dropdown/index.stories.mdx b/addons/rose/addon/components/rose/dropdown/index.stories.mdx index 2076d8160..7c36fd265 100644 --- a/addons/rose/addon/components/rose/dropdown/index.stories.mdx +++ b/addons/rose/addon/components/rose/dropdown/index.stories.mdx @@ -124,7 +124,7 @@ Dropdown indicator can be hidden using `showCaret` attribute. ``` -Dropdowns also support radio buttons. Currently, radio buttons and checkboxes are the supported +Dropdowns also support radio buttons and checkboxes. Currently, radio buttons and checkboxes are the only supported form fields. ```html From 8714627d6f760dceba74570fdc29ced602332c28 Mon Sep 17 00:00:00 2001 From: Dharini Jeeva Date: Thu, 11 Nov 2021 10:47:37 -0800 Subject: [PATCH 04/11] Update _item.scss --- addons/rose/addon/styles/rose/components/dropdown/_item.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/rose/addon/styles/rose/components/dropdown/_item.scss b/addons/rose/addon/styles/rose/components/dropdown/_item.scss index 78c963c1f..461ec0882 100644 --- a/addons/rose/addon/styles/rose/components/dropdown/_item.scss +++ b/addons/rose/addon/styles/rose/components/dropdown/_item.scss @@ -133,4 +133,4 @@ $checkmark: url("data:image/svg+xml;utf-8, ``` @@ -94,7 +93,6 @@ Renders a form input checkbox. @error={{error}} @disabled={{disabled}} @inline={{inline}} - @outline={{outline}} /> `, context: { diff --git a/addons/rose/addon/styles/rose/components/dropdown/_item.scss b/addons/rose/addon/styles/rose/components/dropdown/_item.scss index a3dbf7b9a..6ecf6ff4e 100644 --- a/addons/rose/addon/styles/rose/components/dropdown/_item.scss +++ b/addons/rose/addon/styles/rose/components/dropdown/_item.scss @@ -71,35 +71,29 @@ $checkmark: url("data:image/svg+xml;utf-8,"); + } + } + } + } + &:not(:checked) { + ~ .rose-form-radio-label { &::after { opacity: 0.25; } } } &:checked { - ~ .rose-form-checkbox-label { + ~ .rose-form-radio-label { color: var(--action); + background-color: var(--action-subtler-1h); } } &:disabled { - ~ .rose-form-checkbox-label { + ~ .rose-form-radio-label { opacity: 0.5; } } From a71c31b685c9db63dac1550107011658562874c1 Mon Sep 17 00:00:00 2001 From: dharini Date: Fri, 12 Nov 2021 11:32:50 -0800 Subject: [PATCH 07/11] =?UTF-8?q?style:=20=F0=9F=92=84=20make=20style=20co?= =?UTF-8?q?nsistent?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rose/components/dropdown/_item.scss | 46 ++++++------------- .../rose/components/form/_checkbox.scss | 2 + 2 files changed, 17 insertions(+), 31 deletions(-) diff --git a/addons/rose/addon/styles/rose/components/dropdown/_item.scss b/addons/rose/addon/styles/rose/components/dropdown/_item.scss index 6ecf6ff4e..022c3b683 100644 --- a/addons/rose/addon/styles/rose/components/dropdown/_item.scss +++ b/addons/rose/addon/styles/rose/components/dropdown/_item.scss @@ -73,7 +73,7 @@ $checkmark: url("data:image/svg+xml;utf-8,"); - } - } - } - } - &:not(:checked) { - ~ .rose-form-radio-label { - &::after { - opacity: 0.25; + border-color: var(--ui-gray); } } } + &:checked { - ~ .rose-form-radio-label { + ~ .rose-form-checkbox-label { color: var(--action); background-color: var(--action-subtler-1h); } } &:disabled { - ~ .rose-form-radio-label { + ~ .rose-form-checkbox-label { opacity: 0.5; + &::after { + border-color: var(--ui-gray-subtler-2); + background-color: var(--ui-gray-subtler-4); + } + &::before { + background: none; + } } } } diff --git a/addons/rose/addon/styles/rose/components/form/_checkbox.scss b/addons/rose/addon/styles/rose/components/form/_checkbox.scss index b173d3131..6dd2c6802 100644 --- a/addons/rose/addon/styles/rose/components/form/_checkbox.scss +++ b/addons/rose/addon/styles/rose/components/form/_checkbox.scss @@ -44,6 +44,8 @@ height: sizing.rems(m); pointer-events: none; content: ' '; + border: sizing.rems(xxxxs) solid var(--ui-gray-subtler-2); + border-radius: sizing.rems(xxxs); } &::after { From 79d193675505238c641e8232753f9d9b07624b79 Mon Sep 17 00:00:00 2001 From: dharini Date: Fri, 12 Nov 2021 11:37:08 -0800 Subject: [PATCH 08/11] undo outline changes --- addons/rose/addon/components/rose/form/checkbox/index.hbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/rose/addon/components/rose/form/checkbox/index.hbs b/addons/rose/addon/components/rose/form/checkbox/index.hbs index 02b7987d7..c8f759924 100644 --- a/addons/rose/addon/components/rose/form/checkbox/index.hbs +++ b/addons/rose/addon/components/rose/form/checkbox/index.hbs @@ -1,4 +1,4 @@ -
+
Date: Fri, 12 Nov 2021 13:43:44 -0800 Subject: [PATCH 09/11] =?UTF-8?q?fix:=20=F0=9F=90=9B=20updates=20to=20chec?= =?UTF-8?q?kbox-=20border=20color,=20size?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rose/addon/components/rose/dropdown/index.stories.mdx | 2 -- .../rose/addon/styles/rose/components/dropdown/_item.scss | 7 ++++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/addons/rose/addon/components/rose/dropdown/index.stories.mdx b/addons/rose/addon/components/rose/dropdown/index.stories.mdx index f500a672e..1ee5d754a 100644 --- a/addons/rose/addon/components/rose/dropdown/index.stories.mdx +++ b/addons/rose/addon/components/rose/dropdown/index.stories.mdx @@ -175,7 +175,6 @@ form fields. `, context: { - inline: boolean('inline', false), disabled: boolean('disabled', false), items: object('items', [ { id: 1, name: 'Foo' }, diff --git a/addons/rose/addon/styles/rose/components/dropdown/_item.scss b/addons/rose/addon/styles/rose/components/dropdown/_item.scss index 022c3b683..162350165 100644 --- a/addons/rose/addon/styles/rose/components/dropdown/_item.scss +++ b/addons/rose/addon/styles/rose/components/dropdown/_item.scss @@ -90,8 +90,9 @@ $checkmark: url("data:image/svg+xml;utf-8,