import { __ } from '@wordpress/i18n'; import Checkbox from './Checkbox'; import FourDirectionInputGroup from './FourDirectionInputGroup'; import Input from './Input'; import Select from './Select'; import TransparentColorPicker from './TransparentColorPicker'; type DirectionValues = { top: number; right: number; bottom: number; left: number; }; type HeaderContainerValues = { borderWidths: DirectionValues; borderRadius: number; borderStyle: 'solid' | 'dashed' | 'dotted'; borderColor: string; paddings: DirectionValues; bgColor: string; margins: DirectionValues; }; type HeaderTitleValues = { fontStyle: { bold: boolean; italic: boolean; underline: boolean; }; color: string; fontSize: number; }; type SectionHeaderStyleCardsProps = { container: HeaderContainerValues; title: HeaderTitleValues; onContainerChange: ( patch: Partial ) => void; onTitleChange: ( patch: Partial ) => void; idPrefix: string; containerMaxBorderWidth?: number; containerMaxSpacing?: number; containerMaxRadius?: number; titleMinFontSize?: number; titleMaxFontSize?: number; }; const SectionHeaderStyleCards = ( { container, title, onContainerChange, onTitleChange, idPrefix, containerMaxBorderWidth = 20, containerMaxSpacing = 50, containerMaxRadius = 50, titleMinFontSize = 10, titleMaxFontSize = 40, }: SectionHeaderStyleCardsProps ) => ( <>

{ __( 'Section header container', 'airygen-seo' ) }

onContainerChange( { bgColor: value } ) } />
onContainerChange( { borderColor: value } ) } />
onContainerChange( { borderRadius: Math.max( 0, Math.min( containerMaxRadius, Number( value ) || 0 ) ), } ) } />

{ __( 'Padding', 'airygen-seo' ) + ' (px)' }

onContainerChange( { paddings: values } ) } />

{ __( 'Margin', 'airygen-seo' ) + ' (px)' }

onContainerChange( { margins: values } ) } />

{ __( 'Border width', 'airygen-seo' ) + ' (px)' }

onContainerChange( { borderWidths: values } ) } />

{ __( 'Section title', 'airygen-seo' ) }

{ __( 'Font style', 'airygen-seo' ) }

onTitleChange( { fontStyle: { ...title.fontStyle, bold: value } } ) } /> onTitleChange( { fontStyle: { ...title.fontStyle, italic: value } } ) } /> onTitleChange( { fontStyle: { ...title.fontStyle, underline: value } } ) } />
onTitleChange( { color: value } ) } />
onTitleChange( { fontSize: Math.max( titleMinFontSize, Math.min( titleMaxFontSize, Number( value ) || 0 ) ), } ) } />
); export type { HeaderContainerValues, HeaderTitleValues }; export default SectionHeaderStyleCards;