export function boardFeedbackForm(form: FormTs) {
// Board Member Feedback Form - Nonprofit Governance Survey
// Demonstrates: MatrixQuestion, StarRating, EmojiRating, RatingScale, Slider, dynamic styling
// ============================================
// HEADER
// ============================================
form.addRow(row => {
row.addTextPanel('header', {
label: 'Board Member Feedback',
computedValue: () => 'Your input helps strengthen our governance and organizational effectiveness.',
customStyles: {
backgroundColor: '#1e40af',
color: 'white',
padding: '24px',
borderRadius: '12px',
textAlign: 'center'
}
});
});
// ============================================
// SECTION 1: Governance Effectiveness Matrix
// ============================================
const governanceSection = form.addSubform('governance', {
title: 'Governance Effectiveness'
});
governanceSection.addRow(row => {
row.addMatrixQuestion('governanceMatrix', {
label: 'Please rate the following governance areas:',
rows: [
{ id: 'strategic', label: 'Strategic Direction', description: 'Setting and reviewing organizational strategy', isRequired: true },
{ id: 'fiduciary', label: 'Fiduciary Oversight', description: 'Financial monitoring and accountability', isRequired: true },
{ id: 'policy', label: 'Policy Development', description: 'Creating and updating organizational policies', isRequired: true },
{ id: 'leadership', label: 'Executive Oversight', description: 'Supporting and evaluating leadership', isRequired: true },
{ id: 'mission', label: 'Mission Alignment', description: 'Ensuring activities align with mission', isRequired: true }
],
columns: [
{ id: 'poor', label: 'Poor' },
{ id: 'fair', label: 'Fair' },
{ id: 'good', label: 'Good' },
{ id: 'excellent', label: 'Excellent' }
],
fullWidth: true,
striped: true
});
});
// Conditional follow-up for low governance ratings
governanceSection.addSpacer({ height: '16px' });
governanceSection.addRow(row => {
row.addTextarea('governanceConcerns', {
label: 'Please elaborate on governance areas that need improvement:',
placeholder: 'Share specific concerns or suggestions for strengthening these areas...',
rows: 3,
isVisible: () => {
const matrix = governanceSection.matrixQuestion('governanceMatrix');
if (!matrix) return false;
const values = matrix.value();
if (!values) return false;
return Object.values(values).some(v => v === 'poor' || v === 'fair');
}
});
});
// ============================================
// SECTION 2: Meeting Effectiveness
// ============================================
const meetingSection = form.addSubform('meetings', {
title: 'Meeting Effectiveness'
});
meetingSection.addRow(row => {
row.addStarRating('meetingQuality', {
label: 'Overall quality of board meetings',
maxStars: 5,
size: 'lg',
showCounter: true,
alignment: 'center'
});
row.addStarRating('preparationMaterials', {
label: 'Quality of pre-meeting materials',
maxStars: 5,
size: 'lg',
showCounter: true,
alignment: 'center'
});
});
meetingSection.addRow(row => {
row.addEmojiRating('boardClimate', {
label: 'How would you describe the board meeting atmosphere?',
preset: 'mood',
size: 'lg',
showLabels: true,
alignment: 'center'
});
});
meetingSection.addRow(row => {
row.addRadioButton('meetingFrequency', {
label: 'How do you feel about the current meeting frequency?',
options: [
{ id: 'too-few', name: 'Too few meetings' },
{ id: 'just-right', name: 'Just right' },
{ id: 'too-many', name: 'Too many meetings' }
],
orientation: 'horizontal'
});
});
// Dynamic feedback based on meeting quality
meetingSection.addSpacer({ height: '16px' });
meetingSection.addRow(row => {
row.addTextarea('meetingImprovements', {
label: () => {
const quality = meetingSection.starRating('meetingQuality')?.value();
if (quality && quality >= 4) return 'What makes our meetings effective?';
if (quality && quality <= 2) return 'What specific changes would improve our meetings?';
return 'How can we improve our meeting effectiveness?';
},
placeholder: 'Your suggestions for better board meetings...',
rows: 2,
isVisible: () => meetingSection.starRating('meetingQuality')?.value() !== null
});
});
// ============================================
// SECTION 3: Board Member Engagement
// ============================================
const engagementSection = form.addSubform('engagement', {
title: 'Your Engagement'
});
engagementSection.addRow(row => {
row.addSlider('timeCommitment', {
label: 'Average hours per month you dedicate to board duties',
min: 0,
max: 40,
step: 1,
unit: 'hours',
showValue: true,
defaultValue: 10
});
});
engagementSection.addRow(row => {
row.addRatingScale('contributionSatisfaction', {
label: 'How satisfied are you with your ability to contribute meaningfully?',
preset: 'satisfaction',
size: 'md',
alignment: 'center'
});
});
engagementSection.addRow(row => {
row.addCheckboxList('engagementBarriers', {
label: 'What barriers limit your engagement? (select all that apply)',
options: [
{ id: 'time', name: 'Time constraints' },
{ id: 'info', name: 'Insufficient information' },
{ id: 'unclear', name: 'Unclear expectations' },
{ id: 'expertise', name: 'Skills not utilized' },
{ id: 'remote', name: 'Meeting logistics' },
{ id: 'none', name: 'No significant barriers' }
],
orientation: 'vertical'
});
});
// ============================================
// SECTION 4: Overall Assessment & NPS
// ============================================
const overallSection = form.addSubform('overall', {
title: 'Overall Assessment',
customStyles: () => {
const nps = overallSection.ratingScale('boardNPS')?.npsCategory();
if (nps === 'promoter') return { backgroundColor: '#d1fae5', padding: '16px', borderRadius: '8px' };
if (nps === 'detractor') return { backgroundColor: '#fee2e2', padding: '16px', borderRadius: '8px' };
return { padding: '16px', borderRadius: '8px', border: '1px solid #e5e7eb' };
}
});
overallSection.addRow(row => {
row.addRatingScale('boardNPS', {
label: 'How likely are you to recommend serving on this board to a colleague?',
preset: 'nps',
showCategoryLabel: true,
showSegmentColors: true,
isRequired: true
});
});
// Conditional follow-up based on NPS
overallSection.addSpacer({ height: '16px' });
overallSection.addRow(row => {
row.addTextarea('npsReason', {
label: () => {
const category = overallSection.ratingScale('boardNPS')?.npsCategory();
if (category === 'promoter') return 'What makes this board experience exceptional?';
if (category === 'detractor') return 'What would need to change for you to recommend this experience?';
return 'What would make this board experience better?';
},
placeholder: 'Share your thoughts...',
rows: 3,
isVisible: () => overallSection.ratingScale('boardNPS')?.value() !== null
});
});
// ============================================
// SECTION 5: Improvement Priorities
// ============================================
const prioritiesSection = form.addSubform('priorities', {
title: 'Improvement Priorities',
isVisible: () => overallSection.ratingScale('boardNPS')?.value() !== null
});
prioritiesSection.addRow(row => {
row.addCheckboxList('topPriorities', {
label: 'Select your top 3 priorities for board improvement:',
options: [
{ id: 'strategy', name: 'Strategic planning process' },
{ id: 'diversity', name: 'Board diversity and inclusion' },
{ id: 'skills', name: 'Skills development and training' },
{ id: 'communication', name: 'Communication between meetings' },
{ id: 'committees', name: 'Committee effectiveness' },
{ id: 'succession', name: 'Leadership succession planning' },
{ id: 'evaluation', name: 'Performance evaluation processes' },
{ id: 'community', name: 'Community engagement' }
],
orientation: 'vertical',
max: 3
});
});
prioritiesSection.addSpacer({ height: '16px' });
prioritiesSection.addRow(row => {
row.addTextarea('additionalSuggestions', {
label: 'Any additional suggestions for improving board effectiveness?',
placeholder: 'Share any other ideas or recommendations...',
rows: 3
});
});
// ============================================
// SECTION 6: Feedback Summary
// ============================================
const summarySection = form.addSubform('summary', {
title: 'Your Feedback Summary',
isVisible: () => overallSection.ratingScale('boardNPS')?.value() !== null
});
summarySection.addRow(row => {
row.addTextPanel('summaryContent', {
computedValue: () => {
const nps = overallSection.ratingScale('boardNPS')?.value();
const npsCategory = overallSection.ratingScale('boardNPS')?.npsCategory();
const meetingQuality = meetingSection.starRating('meetingQuality')?.value();
const timeCommitment = engagementSection.slider('timeCommitment')?.value();
const priorities = prioritiesSection.checkboxList('topPriorities')?.value() || [];
if (!nps) return '';
let summary = '📋 Board Feedback Summary\n';
summary += '═'.repeat(30) + '\n\n';
summary += `📊 Board NPS: ${nps}/10 (${npsCategory?.charAt(0).toUpperCase()}${npsCategory?.slice(1)})\n`;
if (meetingQuality) {
const stars = '★'.repeat(meetingQuality) + '☆'.repeat(5 - meetingQuality);
summary += `📅 Meeting Quality: ${stars}\n`;
}
if (timeCommitment !== null && timeCommitment !== undefined) {
summary += `⏱️ Monthly Time: ${timeCommitment} hours\n`;
}
if (priorities.length > 0) {
summary += `\n🎯 Top ${priorities.length} Priority Areas Selected`;
}
return summary;
},
customStyles: () => {
const category = overallSection.ratingScale('boardNPS')?.npsCategory();
const baseStyles = {
padding: '16px',
borderRadius: '8px',
whiteSpace: 'pre-wrap',
fontFamily: 'monospace',
fontSize: '14px'
};
if (category === 'promoter') return { ...baseStyles, backgroundColor: '#d1fae5', borderLeft: '4px solid #10b981' };
if (category === 'detractor') return { ...baseStyles, backgroundColor: '#fee2e2', borderLeft: '4px solid #ef4444' };
return { ...baseStyles, backgroundColor: '#fef3c7', borderLeft: '4px solid #f59e0b' };
}
});
});
// ============================================
// FORM CONFIGURATION
// ============================================
form.configureSubmitButton({
label: 'Submit Feedback',
isVisible: () => overallSection.ratingScale('boardNPS')?.value() !== null
});
form.configureCompletionScreen({
type: 'text',
title: 'Thank you for your feedback!',
message: 'Your insights are invaluable for strengthening our governance and board effectiveness. We will review all responses and share aggregate findings at our next board meeting.'
});
}