import React from 'react'; import { BG_COLORS, SPACING_PRESETS, RADIUS_PRESETS, } from '../../../constants/presets'; import { StylePanelProps, SectionLabel, ColorSwatchGrid, PresetButtonGrid, CollapsibleSection, labelStyle, inputStyle, btnActiveStyle, sectionGap, useNodeProp, } from './shared'; /* ---------- FORM ---------- */ export const FormStylePanel: React.FC = ({ selectedId, nodeProps }) => { const { setProp, setPropStyle } = useNodeProp(selectedId); const style = nodeProps.style || {}; return ( <> {/* Contact-form relay: where submissions are emailed. Present on ContactForm and FormContainer (both have recipientEmail/thankYouUrl props). */} {nodeProps.recipientEmail !== undefined && (
setProp('recipientEmail', e.target.value)} placeholder="you@example.com" style={inputStyle} />

Emailed via the site's contact-form relay (an admin must enable it in Server Settings). Leave blank to use the Form Action URL instead.

)} {nodeProps.thankYouUrl !== undefined && (
setProp('thankYouUrl', e.target.value)} placeholder="/thank-you (blank = hosted page)" style={inputStyle} />
)} {/* Form action/method */} {nodeProps.action !== undefined && (
setProp('action', e.target.value)} placeholder="https://..." style={inputStyle} />
)} {nodeProps.method !== undefined && (
{['GET', 'POST'].map((m) => ( ))}
)} {/* Input field props */} {nodeProps.label !== undefined && (
setProp('label', e.target.value)} style={inputStyle} />
)} {nodeProps.placeholder !== undefined && (
setProp('placeholder', e.target.value)} style={inputStyle} />
)} {nodeProps.name !== undefined && (
setProp('name', e.target.value)} style={inputStyle} />
)} {nodeProps.type !== undefined && typeof nodeProps.type === 'string' && (
)} {nodeProps.required !== undefined && (
)} {/* Button text */} {nodeProps.text !== undefined && nodeProps.label === undefined && (
setProp('text', e.target.value)} style={inputStyle} />
)} {/* Subscribe form props */} {nodeProps.buttonText !== undefined && (
setProp('buttonText', e.target.value)} style={inputStyle} />
)} {nodeProps.placeholderText !== undefined && (
setProp('placeholderText', e.target.value)} style={inputStyle} />
)} {nodeProps.successMessage !== undefined && (
setProp('successMessage', e.target.value)} style={inputStyle} />
)} {/* Style */}
Background setPropStyle('backgroundColor', v)} />
Padding setPropStyle('padding', v)} />
Border Radius setPropStyle('borderRadius', v)} />
); };