import React, { CSSProperties } from 'react'; import { BG_COLORS, SPACING_PRESETS, RADIUS_PRESETS, } from '../../../constants/presets'; import { StylePanelProps, SectionLabel, ColorSwatchGrid, GradientSwatchGrid, PresetButtonGrid, labelStyle, inputStyle, sectionGap, useNodeProp, } from './shared'; /* ---------- CONTAINER / SECTION ---------- */ export const ContainerStylePanel: React.FC = ({ selectedId, nodeProps }) => { const style: CSSProperties = nodeProps.style || {}; const { setProp, setPropStyle } = useNodeProp(selectedId); return ( <> {nodeProps.cssId !== undefined && (
setProp('cssId', e.target.value)} placeholder="my-element-id" style={inputStyle} />
)} {nodeProps.cssClass !== undefined && (
setProp('cssClass', e.target.value)} placeholder="my-custom-class" style={inputStyle} />
)}
Background Color setPropStyle('backgroundColor', v)} />
Background Gradient setPropStyle('background', v)} />
Padding setPropStyle('padding', v)} />
Border Radius setPropStyle('borderRadius', v)} />
Alignment
{(['left', 'center', 'right', 'justify'] as const).map((a) => ( ))}
); };