UNPKG

@zendeskgarden/react-accordions

Version:

Components related to accordions in the Garden Design System

31 lines (28 loc) 1.56 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 { getLineHeight, getColor, componentStyles } from '@zendeskgarden/react-theming'; import { StyledSeparator } from './StyledSeparator.js'; import { StyledTimelineContent } from './StyledContent.js'; import { StyledOppositeContent } from './StyledOppositeContent.js'; const COMPONENT_ID = 'timeline.item'; const StyledTimelineItem = styled.li.attrs({ 'data-garden-id': COMPONENT_ID, 'data-garden-version': '9.5.3' }).withConfig({ displayName: "StyledItem__StyledTimelineItem", componentId: "sc-5mcnzm-0" })(["display:flex;position:relative;line-height:", ";color:", ";font-size:", ";&:last-of-type ", "::after{display:none;}", " ", " ", ";"], props => getLineHeight(props.theme.space.base * 5, props.theme.fontSizes.md), _ref => { let { theme } = _ref; return getColor({ theme, variable: 'foreground.default' }); }, props => props.theme.fontSizes.md, StyledSeparator, props => !props.$hasOppositeContent && props.$isAlternate && css(["&::before{flex:1;padding:", "px;content:'';}"], props.theme.space.base * 4), props => props.$isAlternate && css(["&:nth-child(even){flex-direction:row-reverse;", "{text-align:", ";}", "{text-align:", ";}}"], StyledOppositeContent, props.theme.rtl ? 'right' : 'left', StyledTimelineContent, props.theme.rtl ? 'left' : 'right'), componentStyles); export { StyledTimelineItem };