import * as React from 'react'; import { css } from '@emotion/core'; import styled from '@emotion/styled'; import { IconSmallChevronDown } from '@lightspeed/flame/Icon/SmallChevronDown'; import { Flex } from '@lightspeed/flame/Core'; import { themeGet } from '@styled-system/theme-get'; import { COLOR_SIDEBAR_SECONDARY_BUTTON_BG, COLOR_SIDEBAR_SECONDARY_BUTTON_BG_HOVER, } from '../../styles/constants'; import { secondaryButtonDefault, ellipsis } from '../../shared/styles'; const activeStyle = css` background-color: ${COLOR_SIDEBAR_SECONDARY_BUTTON_BG_HOVER}; `; interface DropdownButtonProps { active?: boolean; } const DropdownButton = styled('button')` ${secondaryButtonDefault} background-color: transparent; padding: ${themeGet('space.2')} 0; margin-bottom: ${themeGet('space.1')}; &:hover, &:focus { background-color: ${COLOR_SIDEBAR_SECONDARY_BUTTON_BG}; } ${props => props.active && activeStyle} &:active { ${activeStyle} } `; const Title = styled('div')` padding-left: ${themeGet('space.2')}; padding-right: ${themeGet('space.1')}; ${ellipsis} `; const SidebarDropdownButton = React.forwardRef< HTMLButtonElement, DropdownButtonProps & { children: React.ReactNode } >(({ children, ...props }, ref) => ( {children} )); export default SidebarDropdownButton;