From a4dca84e62ddc04710d0f18ccbec08d80e62590b Mon Sep 17 00:00:00 2001 From: dharini Date: Wed, 10 Nov 2021 21:36:42 -0800 Subject: [PATCH] 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,