UNPKG

grommet

Version:

focus on the essential experience

29 lines 1.2 kB
var _FLEX_MAP; import styled, { css } from 'styled-components'; import { Box } from '../Box'; import { genericStyles, styledComponentsConfig } from '../../utils'; var StyledTabsHeader = styled(Box).withConfig({ displayName: "StyledTabs__StyledTabsHeader", componentId: "sc-a4fwxl-0" })(["", ";"], function (props) { return props.theme.tabs.header.extend; }); var FLEX_MAP = (_FLEX_MAP = {}, _FLEX_MAP[true] = '1 1', _FLEX_MAP[false] = '0 0', _FLEX_MAP.grow = '1 0', _FLEX_MAP.shrink = '0 1', _FLEX_MAP); var flexStyle = css(["flex:", ";"], function (props) { return "" + FLEX_MAP[props.flex] + (props.flex !== true ? ' auto' : ''); }); var StyledTabPanel = styled.div.withConfig(styledComponentsConfig).withConfig({ displayName: "StyledTabs__StyledTabPanel", componentId: "sc-a4fwxl-1" })(["min-height:0;", " ", ";"], function (props) { return props.flex && flexStyle; }, function (props) { return props.theme.tabs.panel.extend; }); var StyledTabs = styled(Box).withConfig({ displayName: "StyledTabs", componentId: "sc-a4fwxl-2" })(["", " ", ";"], genericStyles, function (props) { return props.theme.tabs.extend; }); export { StyledTabsHeader, StyledTabPanel, StyledTabs };