diff --git a/services/web/frontend/stories/dropdown.stories.js b/services/web/frontend/stories/dropdown.stories.js new file mode 100644 index 0000000000..3ecd884d9b --- /dev/null +++ b/services/web/frontend/stories/dropdown.stories.js @@ -0,0 +1,97 @@ +import React from 'react' +import { Dropdown, DropdownButton, MenuItem } from 'react-bootstrap' +import Icon from '../js/shared/components/icon' + +const MenuItems = () => ( + <> + Action + Another action + + Active Item + + + Separated link + +) + +const defaultArgs = { + bsStyle: 'default', + title: 'Dropdown', + pullRight: false, + noCaret: false, + className: '', + defaultOpen: true +} + +export const Default = args => { + return ( + + + + ) +} +Default.args = { ...defaultArgs } + +export const Primary = args => { + return ( + + + + ) +} +Primary.args = { ...defaultArgs, bsStyle: 'primary' } + +export const RightAligned = args => { + return ( +
+ + + +
+ ) +} +RightAligned.args = { ...defaultArgs, pullRight: true } + +export const SingleIconTransparent = args => { + return ( +
+ + + +
+ ) +} +SingleIconTransparent.args = { + ...defaultArgs, + pullRight: true, + title: , + noCaret: true, + className: 'dropdown-toggle-no-background' +} + +export const Customized = args => { + return ( + + + {args.title} + + + + + + ) +} +Customized.args = { + ...defaultArgs, + component: Dropdown, + title: 'Toggle & Menu used separately' +} + +export default { + title: 'Dropdown', + component: DropdownButton +} diff --git a/services/web/frontend/stylesheets/components/dropdowns.less b/services/web/frontend/stylesheets/components/dropdowns.less index 5f0ef899af..2e8082cb37 100755 --- a/services/web/frontend/stylesheets/components/dropdowns.less +++ b/services/web/frontend/stylesheets/components/dropdowns.less @@ -20,6 +20,19 @@ position: relative; } +.open button.dropdown-toggle.dropdown-toggle-no-background, +button.dropdown-toggle.dropdown-toggle-no-background { + background-color: transparent; + box-shadow: none; + border: 0; + &:hover, + &:active, + &:focus { + background-color: transparent; + box-shadow: none; + } +} + // Prevent the focus on the dropdown toggle when closing dropdowns .dropdown-toggle:focus { outline: 0;