@zendeskgarden/react-tabs
Version:
Components and render prop containers relating to the Garden Design System.
43 lines (40 loc) • 1.74 kB
JavaScript
/**
* Copyright Zendesk, Inc.
*
* Use of this source code is governed under the Apache License, Version 2.0
* found at http://www.apache.org/licenses/LICENSE-2.0.
*/
import styled, { css } from 'styled-components';
import { componentStyles, getLineHeight, getColor } from '@zendeskgarden/react-theming';
const COMPONENT_ID$2 = 'tabs.tablist';
const colorStyles = ({
theme
}) => {
const borderColor = getColor({
theme,
variable: 'border.default'
});
const foregroundColor = getColor({
theme,
variable: 'foreground.default'
});
return css(["transition:border-color 0.25s ease-in-out;color-scheme:only ", ";border-bottom-color:", ";color:", ";"], p => p.theme.colors.base, borderColor, foregroundColor);
};
const sizeStyles$1 = ({
theme,
$isVertical
}) => {
const marginBottom = $isVertical ? 0 : `${theme.space.base * 5}px`;
const borderBottom = $isVertical ? undefined : theme.borderWidths.sm;
const fontSize = theme.fontSizes.md;
const lineHeight = getLineHeight(theme.space.base * 5, fontSize);
return css(["margin-top:0;margin-bottom:", ";border-bottom-width:", ";padding:0;line-height:", ";font-size:", ";"], marginBottom, borderBottom, lineHeight, fontSize);
};
const StyledTabList = styled.div.attrs({
'data-garden-id': COMPONENT_ID$2,
'data-garden-version': '9.15.7'
}).withConfig({
displayName: "StyledTabList",
componentId: "sc-wa5aaj-0"
})(["display:", ";border-bottom:", ";vertical-align:", ";white-space:nowrap;", ";", ";", ";"], props => props.$isVertical ? 'table-cell' : 'block', props => props.$isVertical ? 'none' : props.theme.borderStyles.solid, props => props.$isVertical ? 'top' : undefined, sizeStyles$1, colorStyles, componentStyles);
export { StyledTabList };