export function partnerFeedbackForm(form: FormTs) {
// Partner Satisfaction Survey (B2B)
// Demonstrates: RatingScale (NPS), MatrixQuestion, StarRating, Slider, SuggestionChips, conditional sections
// ============================================
// HEADER
// ============================================
form.addRow(row => {
row.addTextPanel('header', {
label: 'Partner Satisfaction Survey',
computedValue: () => 'Your feedback helps us build stronger partnerships. This survey takes about 5 minutes.',
customStyles: {
backgroundColor: '#059669',
color: 'white',
padding: '24px',
borderRadius: '12px',
textAlign: 'center'
}
});
});
// ============================================
// SECTION 1: Partner Information
// ============================================
const infoSection = form.addSubform('infoSection', {
title: 'Partnership Details'
});
infoSection.addRow(row => {
row.addDropdown('partnerType', {
label: 'What type of partner are you?',
options: [
{ id: 'reseller', name: 'Reseller / Channel Partner' },
{ id: 'technology', name: 'Technology Partner / Integration' },
{ id: 'referral', name: 'Referral Partner' },
{ id: 'strategic', name: 'Strategic Alliance' },
{ id: 'implementation', name: 'Implementation / Services Partner' },
{ id: 'other', name: 'Other' }
],
placeholder: 'Select partner type',
isRequired: true
}, '1fr');
row.addDropdown('partnershipLength', {
label: 'How long have we been partners?',
options: [
{ id: 'less-1', name: 'Less than 1 year' },
{ id: '1-2', name: '1-2 years' },
{ id: '3-5', name: '3-5 years' },
{ id: 'more-5', name: 'More than 5 years' }
],
placeholder: 'Select duration',
isRequired: true
}, '1fr');
});
// ============================================
// SECTION 2: Partner NPS
// ============================================
const npsSection = form.addSubform('npsSection', {
title: 'Partnership Recommendation',
customStyles: () => {
const category = npsSection.ratingScale('partnerNps')?.npsCategory();
if (category === 'promoter') return { backgroundColor: '#d1fae5', padding: '16px', borderRadius: '8px' };
if (category === 'passive') return { backgroundColor: '#fef3c7', padding: '16px', borderRadius: '8px' };
if (category === 'detractor') return { backgroundColor: '#fee2e2', padding: '16px', borderRadius: '8px' };
return { padding: '16px' };
}
});
npsSection.addRow(row => {
row.addRatingScale('partnerNps', {
preset: 'nps',
label: 'How likely are you to recommend partnering with us to other companies?',
showCategoryLabel: true,
showSegmentColors: true,
showConfettiOnPromoter: true,
isRequired: true
});
});
npsSection.addRow(row => {
row.addTextarea('npsReason', {
label: () => {
const category = npsSection.ratingScale('partnerNps')?.npsCategory();
switch (category) {
case 'promoter': return "That's great! What makes this partnership stand out?";
case 'passive': return 'Thanks! What would make you rate us higher?';
case 'detractor': return 'We appreciate your honesty. What needs to improve?';
default: return 'Please share your thoughts on our partnership';
}
},
placeholder: 'Your feedback...',
rows: 3,
autoExpand: true,
isVisible: () => npsSection.ratingScale('partnerNps')?.value() !== null
});
});
// ============================================
// SECTION 3: Partnership Value Matrix
// ============================================
const valueSection = form.addSubform('valueSection', {
title: 'Partnership Value Assessment',
isVisible: () => npsSection.ratingScale('partnerNps')?.value() !== null
});
valueSection.addRow(row => {
row.addMatrixQuestion('partnershipMatrix', {
label: 'Please rate the following aspects of our partnership:',
rows: [
{ id: 'communication', label: 'Communication Quality', description: 'Regular, clear, timely updates' },
{ id: 'support', label: 'Partner Support', description: 'Responsiveness and helpfulness' },
{ id: 'training', label: 'Training & Enablement', description: 'Resources and knowledge sharing' },
{ id: 'marketing', label: 'Joint Marketing', description: 'Co-marketing opportunities' },
{ id: 'technical', label: 'Technical Collaboration', description: 'Integration and product support' },
{ id: 'commercial', label: 'Commercial Terms', description: 'Fair pricing and incentives' }
],
columns: [
{ id: '1', label: 'Very Poor' },
{ id: '2', label: 'Poor' },
{ id: '3', label: 'Neutral' },
{ id: '4', label: 'Good' },
{ id: '5', label: 'Excellent' }
],
striped: true,
fullWidth: true
});
});
// ============================================
// SECTION 4: Business Impact
// ============================================
const impactSection = form.addSubform('impactSection', {
title: 'Business Impact',
isVisible: () => npsSection.ratingScale('partnerNps')?.value() !== null
});
impactSection.addRow(row => {
row.addSlider('revenueImpact', {
label: 'Estimated revenue growth from this partnership (%)',
min: 0,
max: 100,
step: 5,
showValue: true,
unit: '%',
defaultValue: 20
}, '1fr');
row.addSlider('roiSatisfaction', {
label: 'How satisfied are you with the ROI of this partnership?',
min: 1,
max: 10,
step: 1,
showValue: true,
defaultValue: 5
}, '1fr');
});
impactSection.addRow(row => {
row.addStarRating('overallValue', {
label: 'Overall value this partnership brings to your business',
maxStars: 5,
size: 'lg',
alignment: 'center',
showConfettiOnMax: true
});
});
// ============================================
// SECTION 5: Strengths & Improvements
// ============================================
const strengthsSection = form.addSubform('strengthsSection', {
title: 'Partnership Strengths',
isVisible: () => {
const nps = npsSection.ratingScale('partnerNps')?.value();
return nps !== null && nps !== undefined && nps >= 7;
},
customStyles: {
backgroundColor: '#ecfdf5',
padding: '16px',
borderRadius: '8px'
}
});
strengthsSection.addRow(row => {
row.addSuggestionChips('keyStrengths', {
label: 'What are the key strengths of this partnership? (Select up to 4)',
suggestions: [
{ id: 'trust', name: 'Mutual trust' },
{ id: 'responsive', name: 'Responsive team' },
{ id: 'innovative', name: 'Innovation focus' },
{ id: 'market', name: 'Market presence' },
{ id: 'technical', name: 'Technical excellence' },
{ id: 'revenue', name: 'Revenue growth' },
{ id: 'aligned', name: 'Aligned vision' },
{ id: 'flexible', name: 'Flexibility' }
],
max: 4,
alignment: 'left'
});
});
const improvementSection = form.addSubform('improvementSection', {
title: 'Areas for Improvement',
isVisible: () => {
const nps = npsSection.ratingScale('partnerNps')?.value();
return nps !== null && nps !== undefined && nps <= 6;
},
customStyles: {
backgroundColor: '#fef3c7',
padding: '16px',
borderRadius: '8px'
}
});
improvementSection.addRow(row => {
row.addCheckboxList('improvementAreas', {
label: 'Which areas need the most improvement?',
options: [
{ id: 'communication', name: 'Communication frequency and quality' },
{ id: 'support', name: 'Partner support responsiveness' },
{ id: 'training', name: 'Training and enablement resources' },
{ id: 'marketing', name: 'Co-marketing investment' },
{ id: 'commercial', name: 'Commercial terms and incentives' },
{ id: 'technical', name: 'Technical integration support' },
{ id: 'strategy', name: 'Strategic alignment and planning' },
{ id: 'leadership', name: 'Executive engagement' }
],
orientation: 'vertical'
});
});
improvementSection.addSpacer();
improvementSection.addRow(row => {
row.addTextarea('improvementDetails', {
label: 'Please provide specific examples or suggestions:',
placeholder: 'Share specific areas where we can improve...',
rows: 4,
autoExpand: true
});
});
// ============================================
// SECTION 6: Future Outlook
// ============================================
const futureSection = form.addSubform('futureSection', {
title: 'Future Collaboration',
isVisible: () => npsSection.ratingScale('partnerNps')?.value() !== null
});
futureSection.addRow(row => {
row.addRadioButton('futureIntention', {
label: 'What are your intentions for this partnership in the next 12 months?',
options: [
{ id: 'expand', name: 'Significantly expand the partnership' },
{ id: 'grow', name: 'Grow moderately' },
{ id: 'maintain', name: 'Maintain current level' },
{ id: 'reduce', name: 'Reduce scope' },
{ id: 'unsure', name: 'Unsure at this time' }
],
orientation: 'vertical'
});
});
futureSection.addSpacer();
futureSection.addRow(row => {
row.addCheckboxList('collaborationAreas', {
label: 'Which areas would you like to explore together? (Select all that apply)',
options: [
{ id: 'new-markets', name: 'Entering new markets together' },
{ id: 'co-selling', name: 'Joint sales initiatives' },
{ id: 'integration', name: 'Deeper product integration' },
{ id: 'co-marketing', name: 'Joint marketing campaigns' },
{ id: 'innovation', name: 'Co-innovation projects' },
{ id: 'events', name: 'Joint events or webinars' },
{ id: 'case-studies', name: 'Customer case studies' }
],
orientation: 'vertical'
});
});
futureSection.addSpacer();
futureSection.addRow(row => {
row.addTextarea('additionalFeedback', {
label: 'Any other feedback or suggestions for strengthening our partnership?',
placeholder: 'Share your thoughts...',
rows: 3,
autoExpand: true
});
});
// ============================================
// SECTION 7: Summary
// ============================================
const summarySection = form.addSubform('summarySection', {
title: 'Partnership Summary',
isVisible: () => {
const nps = npsSection.ratingScale('partnerNps')?.value();
return nps !== null && nps !== undefined;
}
});
summarySection.addRow(row => {
row.addTextPanel('summaryContent', {
computedValue: () => {
const partnerType = infoSection.dropdown('partnerType')?.value();
const nps = npsSection.ratingScale('partnerNps')?.value();
const category = npsSection.ratingScale('partnerNps')?.npsCategory();
const overallValue = impactSection.starRating('overallValue')?.value();
const roiSatisfaction = impactSection.slider('roiSatisfaction')?.value();
const revenueImpact = impactSection.slider('revenueImpact')?.value();
const future = futureSection.radioButton('futureIntention')?.value();
const partnerTypeLabels: Record<string, string> = {
'reseller': 'Reseller/Channel',
'technology': 'Technology',
'referral': 'Referral',
'strategic': 'Strategic Alliance',
'implementation': 'Implementation',
'other': 'Other'
};
const futureLabels: Record<string, string> = {
'expand': 'Significant Expansion',
'grow': 'Moderate Growth',
'maintain': 'Maintain',
'reduce': 'Reduce',
'unsure': 'Unsure'
};
let emoji = category === 'promoter' ? '🤝' : category === 'passive' ? '📊' : '⚠️';
let summary = `${emoji} Partnership Health Report\n`;
summary += `${'═'.repeat(30)}\n\n`;
if (partnerType) summary += `🏢 Partner Type: ${partnerTypeLabels[partnerType] || partnerType}\n`;
if (nps !== null && nps !== undefined) {
summary += `📊 Partner NPS: ${nps}/10 (${category?.charAt(0).toUpperCase()}${category?.slice(1)})\n`;
}
if (overallValue) summary += `⭐ Overall Value: ${overallValue}/5 stars\n`;
if (roiSatisfaction) summary += `💰 ROI Satisfaction: ${roiSatisfaction}/10\n`;
if (revenueImpact) summary += `📈 Revenue Impact: +${revenueImpact}%\n`;
if (future) summary += `\n🔮 Future Plans: ${futureLabels[future] || future}`;
return summary;
},
customStyles: () => {
const category = npsSection.ratingScale('partnerNps')?.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' };
} else if (category === 'passive') {
return { ...baseStyles, backgroundColor: '#fef3c7', borderLeft: '4px solid #f59e0b' };
} else {
return { ...baseStyles, backgroundColor: '#fee2e2', borderLeft: '4px solid #ef4444' };
}
}
});
});
// ============================================
// FORM CONFIGURATION
// ============================================
form.configureSubmitButton({
label: 'Submit Partnership Feedback',
isVisible: () => npsSection.ratingScale('partnerNps')?.value() !== null
});
form.configureCompletionScreen({
type: 'text',
title: 'Thank You for Your Feedback!',
message: 'Your input is invaluable in helping us build a stronger partnership. We review all feedback and will follow up on key areas for improvement.'
});
}