diff --git a/packages/components/src/tip/index.js b/packages/components/src/tip/index.js index fac7d9f286ad50..1845d095035807 100644 --- a/packages/components/src/tip/index.js +++ b/packages/components/src/tip/index.js @@ -1,14 +1,23 @@ +/** @jsx jsx */ +/** + * External dependencies + */ +import { jsx } from '@emotion/core'; +import classnames from 'classnames'; + /** * WordPress dependencies */ import { SVG, Path } from '@wordpress/primitives'; + /** * Internal dependencies */ -import { StyledTip } from './styles/tip-styles'; +import { tipStyles, iconStyles, contentStyles } from './styles/tip-styles'; /** * @typedef Props + * @property {string} [className] Optional classname to add to the tip. * @property {import('react').ReactNode} children Children to render in the tip. */ @@ -16,14 +25,17 @@ import { StyledTip } from './styles/tip-styles'; * @param {Props} props * @return {JSX.Element} Element */ -function Tip( props ) { +function Tip( { children, className } ) { return ( - - +
+ -

{ props.children }

- +

{ children }

+
); } diff --git a/packages/components/src/tip/styles/tip-styles.js b/packages/components/src/tip/styles/tip-styles.js index 9b615241d126ff..de59a5e70f7da4 100644 --- a/packages/components/src/tip/styles/tip-styles.js +++ b/packages/components/src/tip/styles/tip-styles.js @@ -1,25 +1,25 @@ /** * External dependencies */ -import styled from '@emotion/styled'; +import { css } from '@emotion/core'; /** * Internal dependencies */ import { color, space, rtl } from '../../utils'; -export const StyledTip = styled.div` +export const tipStyles = css` display: flex; color: ${ color( 'mediumGray.text' ) }; +`; - svg { - align-self: center; - fill: ${ color( 'alert.yellow' ) }; - flex-shrink: 0; - ${ rtl( { marginRight: space( 2 ) } ) } - } +export const iconStyles = css` + align-self: center; + fill: ${ color( 'alert.yellow' ) }; + flex-shrink: 0; + ${ rtl( { marginRight: space( 2 ) } )() } +`; - p { - margin: 0; - } +export const contentStyles = css` + margin: 0; `;