/** * Spacing section — spacing scale overrides. * * Renders scale fields from the server-provided schema and writes changes into * the working settings tree via setPath. These map to the --aureon-space-* * custom properties emitted by the dynamic CSS pipeline. * * Two tabs (Scale / Layout) behind one segmented toggle — the Layout tab holds * both Section Spacing and Container Padding, each only a single field, so * neither earns a `WP_Customize_Section` of its own. Both hosts therefore * render exactly the same thing here, like Cart's and Checkout's own tabs. */ import { useState } from '@wordpress/element'; import { __ } from '@wordpress/i18n'; import { Ruler, Columns3 } from 'lucide-react'; import Tabs, { TabPanel } from '../../controls/tabs'; import CssVariablesCallout from '../../controls/css-variables-callout'; import { getSpacingData, ScaleFields, SectionSpacingFields, ContainerPaddingFields, type SpacingSchema, type LayoutSchemaSlice, } from './fields'; import type { WorkingSettings, SetPath } from '../../types'; import SectionIntro from '../../controls/section-intro'; const ID_PREFIX = 'aureon-spacing'; interface SpacingSectionProps { schema?: SpacingSchema; layoutSchema?: LayoutSchemaSlice; defaults: Partial< WorkingSettings >; working: WorkingSettings; setPath: SetPath; } export default function SpacingSection( { schema, layoutSchema, defaults, working, setPath, }: SpacingSectionProps ) { const [ activeTab, setActiveTab ] = useState( 'scale' ); if ( ! schema ) { return null; } const { spacing, spacingDefaults, layout, sectionSpacingOptions, containerPaddingPath, containerPadding, cssVariables, } = getSpacingData( schema, layoutSchema, defaults, working ); const tabs = [ { key: 'scale', label: __( 'Scale', 'aureon' ), icon: Ruler }, { key: 'layout', label: __( 'Layout', 'aureon' ), icon: Columns3 }, ]; return (

{ schema.label }

{ __( 'Spacing scale used for gaps and padding across the theme and Aureon Blocks.', 'aureon' ) }

{ sectionSpacingOptions.length > 0 && ( ) }
); }