import styled from 'styled-components'; import { smPaddingX, smPaddingY, mdPaddingY, mdPaddingX, } from '/imports/ui/stylesheets/styled-components/general'; import { smallOnly } from '/imports/ui/stylesheets/styled-components/breakpoints'; import { colorGrayDark, colorPrimary, colorWhite, } from '/imports/ui/stylesheets/styled-components/palette'; import { fontSizeLarge } from '/imports/ui/stylesheets/styled-components/typography'; import { Tab, Tabs, TabList, TabPanel, } from 'react-tabs'; import Icon from '../icon/component'; const ToggleLabel = styled.span` margin-right: ${smPaddingX}; [dir="rtl"] & { margin: 0 0 0 ${smPaddingX}; } `; const SettingsTabs = styled(Tabs)` display: flex; flex-flow: row; justify-content: flex-start; @media ${smallOnly} { width: 100%; flex-flow: column; } `; const SettingsTabList = styled(TabList)` display: flex; flex-flow: column; margin: 0; border: none; padding: 0; width: calc(100% / 3); @media ${smallOnly} { width: 100%; flex-flow: row; flex-wrap: wrap; justify-content: center; } `; const SettingsTabSelector = styled(Tab)` display: flex; flex-flow: row; font-size: 0.9rem; flex: 0 0 auto; justify-content: flex-start; border: none !important; padding: ${mdPaddingY} ${mdPaddingX}; color: ${colorGrayDark}; border-radius: .2rem; cursor: pointer; margin-bottom: ${smPaddingY}; align-items: center; flex-grow: 0; min-width: 0; & > span { min-width: 0; display: inline-block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } @media ${smallOnly} { max-width: 100%; margin: 0 ${smPaddingX} 0 0; & > i { display: none; } [dir="rtl"] & { margin: 0 0 0 ${smPaddingX}; } } &.is-selected { color: ${colorWhite}; background-color: ${colorPrimary}; font-weight: bold; & > i { color: ${colorWhite}; } } `; const SettingsIcon = styled(Icon)` margin: 0 .5rem 0 0; font-size: ${fontSizeLarge}; [dir="rtl"] & { margin: 0 0 0 .5rem; } `; const SettingsTabPanel = styled(TabPanel)` display: none; margin: 0 0 0 1rem; width: calc(100% / 3 * 2); [dir="rtl"] & { margin: 0 1rem 0 0; } &.is-selected { display: block; } @media ${smallOnly} { width: 100%; margin: 0; padding-left: 1rem; padding-right: 1rem; } `; export default { ToggleLabel, SettingsTabs, SettingsTabList, SettingsTabSelector, SettingsIcon, SettingsTabPanel, };