/** * Sidebar section — the global default sidebar position (shared with the * Layout container settings via `layout.sidebar`), and every bit of the * sidebar column's own styling: width/sticky/responsive on the Layout tab, * appearance/spacing/widget styling/hover effect on the Style tab. * Per-content-type position overrides live in the Layout section, alongside * every other per-context layout override. */ import { useState } from '@wordpress/element'; import { __ } from '@wordpress/i18n'; import { PanelsTopLeft, Paintbrush, MoveHorizontal, ArrowUpDown, Smartphone, Tablet, Info, Square, PanelRight, Ban, CircleDashed, Layers, ArrowUp, SquareDashed, Underline, } from 'lucide-react'; import type { LucideIcon } from 'lucide-react'; import Tabs, { TabPanel } from '../controls/tabs'; import OptionCards from '../controls/option-cards'; import SelectField from '../controls/select-field'; import ColorField from '../controls/color-field'; import ToggleRow from '../controls/toggle-row'; import SidebarLayoutCards from '../controls/sidebar-layout-cards'; import RangeField from '../controls/range-field'; import type { WorkingSettings, SetPath } from '../types'; import SectionIntro from '../controls/section-intro'; const ID_PREFIX = 'aureon-sidebar'; const TABS = [ { key: 'layout', label: __( 'Layout', 'aureon' ), icon: PanelsTopLeft }, { key: 'style', label: __( 'Style', 'aureon' ), icon: Paintbrush }, ]; interface Option { value: string; label: string; description?: string; } interface SidebarSchema { label: string; styles?: Option[]; positions?: Option[]; width?: { min: number; max: number }; border_styles?: Option[]; shadows?: Option[]; widget_title_styles?: Option[]; divider_styles?: Option[]; hover_effects?: Option[]; border_width_max?: number; radius_max?: number; spacing_max?: number; } interface SidebarSectionProps { schema?: SidebarSchema; working: WorkingSettings; setPath: SetPath; } const APPEARANCE_ICONS: Record< string, LucideIcon > = { unboxed: Square, boxed: PanelRight, }; const SHADOW_ICONS: Record< string, LucideIcon > = { none: Ban, subtle: CircleDashed, medium: Layers, }; const HOVER_ICONS: Record< string, LucideIcon > = { none: Ban, background: SquareDashed, lift: ArrowUp, underline: Underline, }; /** Static-site-wide footer note repeated at the bottom of each tab. */ function ScopeNotice() { return (
{ __( 'These settings apply across your entire site.', 'aureon' ) }
{ __( 'Set the site-wide sidebar and fine-tune its look. Individual pages can override this from the block editor.', 'aureon' ) }
{ 'both' === position ? __( 'The columns show default widgets until you add your own to the Sidebar and Sidebar 2 widget areas (Appearance → Widgets).', 'aureon' ) : __( 'The column shows default widgets until you add your own to the Sidebar widget area (Appearance → Widgets).', 'aureon' ) }
{ __( 'Set the width of the sidebar column, as a percentage of the content row.', 'aureon' ) }
{ __( 'Adjust the spacing inside the sidebar.', 'aureon' ) }
{ __( 'Customize the appearance of widgets in the sidebar.', 'aureon' ) }
{ __( 'Control sidebar visibility on different devices.', 'aureon' ) }