UNPKG

@zendeskgarden/react-chrome

Version:

Components relating to Chrome within the Garden Design System.

54 lines (51 loc) 1.94 kB
/** * 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, getColor } from '@zendeskgarden/react-theming'; import { StyledLogoHeaderItem } from './StyledLogoHeaderItem.js'; import { getHeaderHeight } from '../utils.js'; const COMPONENT_ID$k = 'chrome.header'; const colorStyles$7 = ({ theme, $isStandalone }) => { const backgroundColor = getColor({ theme, variable: 'background.default' }); const borderColor = getColor({ theme, variable: 'border.default' }); const boxShadowColor = getColor({ variable: 'shadow.small', theme }); const boxShadow = $isStandalone ? theme.shadows.lg('0', `${theme.space.base * 2}px`, boxShadowColor) : undefined; const foregroundColor = getColor({ theme, variable: 'foreground.subtle' }); return css(["border-bottom-color:", ";box-shadow:", ";background-color:", ";color:", ";"], borderColor, boxShadow, backgroundColor, foregroundColor); }; const sizeStyles$9 = ({ theme }) => { const border = theme.borders.sm; const padding = `0 ${theme.space.base}px`; const fontSize = theme.fontSizes.md; const height = getHeaderHeight(theme); return css(["box-sizing:border-box;border-bottom:", ";padding:", ";height:", ";font-size:", ";"], border, padding, height, fontSize); }; const StyledHeader = styled.header.attrs({ 'data-garden-id': COMPONENT_ID$k, 'data-garden-version': '9.15.5' }).withConfig({ displayName: "StyledHeader", componentId: "sc-1cexpz-0" })(["display:flex;position:", ";align-items:center;justify-content:flex-end;", ";", ";", "{display:", ";}", ";"], props => props.$isStandalone && 'relative', sizeStyles$9, colorStyles$7, StyledLogoHeaderItem, props => props.$isStandalone && 'inline-flex', componentStyles); export { StyledHeader };