/** * CSS variables callout — the "How it works" info box plus a "View CSS * Variables" button that opens a modal listing the CSS custom properties a * settings section emits. Shared by any section (Colors, Typography, …) * that maps its fields onto --aureon-* custom properties. * * Icon and text sit in a row of their own with the button on the line below, * rather than all three across one row: the pane is 320px wide, and a button * holding its own width beside a paragraph squeezed that paragraph to one word * per line. */ import { useState } from '@wordpress/element'; import { __ } from '@wordpress/i18n'; import { Button, Modal } from '@wordpress/components'; import { Lightbulb, Code2 } from '../icons'; export interface CssVariable { name: string; value: string; } interface CssVariablesCalloutProps { description: string; variables: CssVariable[]; } export default function CssVariablesCallout( { description, variables, }: CssVariablesCalloutProps ) { const [ showTokens, setShowTokens ] = useState( false ); return ( <>
{ __( 'How it works', 'aureon' ) }
{ description }
| { __( 'Variable', 'aureon' ) } | { __( 'Value', 'aureon' ) } |
|---|---|
{ variable.name }
|
{ variable.value }
|