/** * WordPress dependencies */ import { __experimentalHStack as HStack, __experimentalVStack as VStack, __unstableMotion as motion, } from '@wordpress/components'; /** * Internal dependencies */ import { useStyle } from './hooks'; import { useStylesPreviewColors } from './preview-hooks'; import TypographyExample from './typography-example'; import HighlightedColors from './highlighted-colors'; import PreviewWrapper from './preview-wrapper'; const firstFrameVariants = { start: { scale: 1, opacity: 1, }, hover: { scale: 0, opacity: 0, }, }; const midFrameVariants = { hover: { opacity: 1, }, start: { opacity: 0.5, }, }; const secondFrameVariants = { hover: { scale: 1, opacity: 1, }, start: { scale: 0, opacity: 0, }, }; interface PreviewStylesProps { label?: string; isFocused?: boolean; withHoverView?: boolean; variation?: any; } function PreviewStyles( { label, isFocused, withHoverView, variation, }: PreviewStylesProps ) { const [ fontWeight ] = useStyle< string >( 'typography.fontWeight' ); const [ fontFamily = 'serif' ] = useStyle< string >( 'typography.fontFamily' ); const [ headingFontFamily = fontFamily ] = useStyle< string >( 'elements.h1.typography.fontFamily' ); const [ headingFontWeight = fontWeight ] = useStyle< string >( 'elements.h1.typography.fontWeight' ); const [ textColor = 'black' ] = useStyle< string >( 'color.text' ); const [ headingColor = textColor ] = useStyle< string >( 'elements.h1.color.text' ); const { paletteColors } = useStylesPreviewColors(); return ( { ( { ratio, key } ) => ( ) } { ( { key } ) => ( { paletteColors .slice( 0, 4 ) .map( ( { color }, index ) => (
) ) } ) } { ( { ratio, key } ) => ( { label && (
{ label }
) }
) } ); } export default PreviewStyles;