export function onboardingWeek1Survey(form: FormTs) {
// Week 1 Onboarding Feedback - Comprehensive first week check-in
// Demonstrates: MatrixQuestion, StarRating, Slider, EmojiRating, RatingScale (Likert), SuggestionChips
// ============================================
// HEADER
// ============================================
form.addRow(row => {
row.addTextPanel('header', {
label: 'Week 1 Check-in',
computedValue: () => 'Your first week matters. Share your experience to help us improve.',
customStyles: {
background: 'linear-gradient(135deg, #059669 0%, #10b981 100%)',
color: 'white',
padding: '24px',
borderRadius: '12px',
textAlign: 'center'
}
});
});
// ============================================
// SECTION 1: Overall Experience
// ============================================
const overallSection = form.addSubform('overallSection', {
title: 'Overall First Week Experience',
customStyles: () => {
const mood = overallSection.emojiRating('weekMood')?.value();
if (mood === 'excellent' || mood === 'good') return { backgroundColor: '#d1fae5', padding: '16px', borderRadius: '8px' };
if (mood === 'very-bad' || mood === 'bad') return { backgroundColor: '#fee2e2', padding: '16px', borderRadius: '8px' };
return { padding: '16px', borderRadius: '8px', border: '1px solid #e2e8f0' };
}
});
overallSection.addRow(row => {
row.addEmojiRating('weekMood', {
label: 'How was your first week overall?',
preset: 'satisfaction',
size: 'lg',
showLabels: true,
alignment: 'center'
});
});
overallSection.addRow(row => {
row.addTextarea('weekHighlight', {
label: () => {
const mood = overallSection.emojiRating('weekMood')?.value();
if (mood === 'excellent' || mood === 'good') return 'What made your first week great?';
if (mood === 'very-bad' || mood === 'bad') return 'What challenges did you face this week?';
return 'What stood out about your first week?';
},
placeholder: 'Share a moment or experience that defined your week...',
rows: 2,
autoExpand: true,
isVisible: () => overallSection.emojiRating('weekMood')?.value() !== null
});
});
// ============================================
// SECTION 2: Manager & Team Support
// ============================================
const supportSection = form.addSubform('supportSection', {
title: 'Manager & Team Support'
});
supportSection.addRow(row => {
row.addStarRating('managerAvailability', {
label: 'How available was your manager when you needed help?',
maxStars: 5,
size: 'lg',
alignment: 'center'
});
});
supportSection.addRow(row => {
row.addStarRating('managerClarity', {
label: 'How clearly did your manager explain expectations?',
maxStars: 5,
size: 'lg',
alignment: 'center'
});
});
supportSection.addRow(row => {
row.addStarRating('teamWelcome', {
label: 'How welcomed did you feel by your team?',
maxStars: 5,
size: 'lg',
alignment: 'center'
});
});
// Manager follow-up for low scores
supportSection.addSpacer();
supportSection.addRow(row => {
row.addTextarea('managerFeedback', {
label: 'How could your manager better support you?',
placeholder: 'Your feedback helps us coach managers on supporting new hires...',
rows: 2,
isVisible: () => {
const availability = supportSection.starRating('managerAvailability')?.value() ?? 0;
const clarity = supportSection.starRating('managerClarity')?.value() ?? 0;
return availability > 0 && availability <= 3 || clarity > 0 && clarity <= 3;
}
});
});
// ============================================
// SECTION 3: Training Experience (Matrix Question)
// ============================================
const trainingSection = form.addSubform('trainingSection', {
title: 'Training & Learning'
});
trainingSection.addRow(row => {
row.addMatrixQuestion('trainingRating', {
label: 'Rate your training experience in each area:',
rows: [
{ id: 'company', label: 'Company overview & culture', isRequired: true },
{ id: 'role', label: 'Role-specific training', isRequired: true },
{ id: 'tools', label: 'Tools & systems training', isRequired: true },
{ id: 'processes', label: 'Processes & workflows', isRequired: false },
{ id: 'compliance', label: 'Compliance & policies', isRequired: false }
],
columns: [
{ id: 'poor', label: 'Poor' },
{ id: 'fair', label: 'Fair' },
{ id: 'good', label: 'Good' },
{ id: 'excellent', label: 'Excellent' },
{ id: 'na', label: 'N/A' }
],
striped: true,
fullWidth: true
});
});
trainingSection.addSpacer();
trainingSection.addRow(row => {
row.addCheckboxList('trainingGaps', {
label: 'What training topics need more coverage?',
options: [
{ id: 'none', name: 'No gaps - training was comprehensive' },
{ id: 'tools', name: 'Tools and software' },
{ id: 'processes', name: 'Day-to-day processes' },
{ id: 'team', name: 'Team structure and roles' },
{ id: 'culture', name: 'Company culture and values' },
{ id: 'technical', name: 'Technical skills' },
{ id: 'customers', name: 'Customer/client understanding' }
],
orientation: 'vertical'
});
});
// ============================================
// SECTION 4: Role Clarity & Workload
// ============================================
const roleSection = form.addSubform('roleSection', {
title: 'Role Clarity & Workload'
});
roleSection.addRow(row => {
row.addRatingScale('roleClarity', {
label: 'How clear are you about your role and responsibilities?',
preset: 'likert-5',
lowLabel: 'Very unclear',
highLabel: 'Very clear',
size: 'md',
alignment: 'center'
});
});
roleSection.addSpacer();
roleSection.addRow(row => {
row.addSlider('workloadLevel', {
label: 'How would you describe your workload this week?',
min: 1,
max: 5,
step: 1,
defaultValue: 3,
showValue: false,
unit: ''
});
});
roleSection.addRow(row => {
row.addTextPanel('workloadLabel', {
computedValue: () => {
const level = roleSection.slider('workloadLevel')?.value() ?? 3;
const labels = [
'',
'Too light - I need more to do',
'Slightly light - could handle more',
'Just right - good balance',
'Slightly heavy - manageable but busy',
'Overwhelming - too much too soon'
];
return labels[level] || '';
},
customStyles: () => {
const level = roleSection.slider('workloadLevel')?.value() ?? 3;
const defaultStyle = { bg: '#d1fae5', text: '#065f46', border: '#10b981' };
const colors: Record<number, { bg: string; text: string; border: string }> = {
1: { bg: '#dbeafe', text: '#1e40af', border: '#3b82f6' },
2: { bg: '#e0f2fe', text: '#0369a1', border: '#0ea5e9' },
3: defaultStyle,
4: { bg: '#fef3c7', text: '#92400e', border: '#f59e0b' },
5: { bg: '#fee2e2', text: '#991b1b', border: '#ef4444' }
};
const style = colors[level] ?? defaultStyle;
return {
backgroundColor: style.bg,
color: style.text,
padding: '8px 16px',
borderRadius: '6px',
textAlign: 'center',
borderLeft: `4px solid ${style.border}`
};
}
});
});
// Workload concerns follow-up
roleSection.addSpacer();
roleSection.addRow(row => {
row.addTextarea('workloadConcerns', {
label: () => {
const level = roleSection.slider('workloadLevel')?.value() ?? 3;
if (level <= 2) return 'What additional work or projects would you like to take on?';
return 'What would help manage the workload better?';
},
placeholder: 'Your feedback helps us calibrate onboarding pace...',
rows: 2,
isVisible: () => {
const level = roleSection.slider('workloadLevel')?.value() ?? 3;
return level <= 2 || level >= 4;
}
});
});
// ============================================
// SECTION 5: Resources & Tools
// ============================================
const resourcesSection = form.addSubform('resourcesSection', {
title: 'Resources & Tools'
});
resourcesSection.addRow(row => {
row.addSuggestionChips('missingResources', {
label: 'Select any resources you still need:',
suggestions: [
{ id: 'none', name: 'I have everything I need' },
{ id: 'access', name: 'System access' },
{ id: 'docs', name: 'Documentation' },
{ id: 'contacts', name: 'Key contacts list' },
{ id: 'tools', name: 'Tools/software' },
{ id: 'space', name: 'Workspace setup' },
{ id: 'training', name: 'Training materials' }
],
alignment: 'left'
});
});
// ============================================
// SECTION 6: Looking Forward
// ============================================
const forwardSection = form.addSubform('forwardSection', {
title: 'Looking Forward'
});
forwardSection.addRow(row => {
row.addRatingScale('successConfidence', {
label: 'How confident are you in succeeding in this role?',
preset: 'likert-5',
lowLabel: 'Not confident',
highLabel: 'Very confident',
size: 'md',
alignment: 'center'
});
});
forwardSection.addSpacer();
forwardSection.addRow(row => {
row.addTextarea('questionsForManager', {
label: 'What questions do you want to discuss with your manager?',
placeholder: 'List topics for your next 1-on-1...',
rows: 2,
autoExpand: true
});
});
forwardSection.addRow(row => {
row.addTextarea('additionalComments', {
label: 'Any other feedback about your first week?',
placeholder: 'Share anything else on your mind...',
rows: 2,
autoExpand: true
});
});
// ============================================
// SECTION 7: Summary
// ============================================
const summarySection = form.addSubform('summarySection', {
title: 'Week 1 Summary',
isVisible: () => {
const mood = overallSection.emojiRating('weekMood')?.value();
const managerAvail = supportSection.starRating('managerAvailability')?.value();
return mood !== null || (managerAvail !== null && managerAvail !== undefined && managerAvail > 0);
}
});
summarySection.addRow(row => {
row.addTextPanel('summary', {
computedValue: () => {
const mood = overallSection.emojiRating('weekMood')?.value();
const managerAvail = supportSection.starRating('managerAvailability')?.value() ?? 0;
const managerClarity = supportSection.starRating('managerClarity')?.value() ?? 0;
const teamWelcome = supportSection.starRating('teamWelcome')?.value() ?? 0;
const roleClarity = roleSection.ratingScale('roleClarity')?.value() ?? 0;
const workload = roleSection.slider('workloadLevel')?.value() ?? 3;
const confidence = forwardSection.ratingScale('successConfidence')?.value() ?? 0;
const moodLabels: Record<string, string> = {
'very-bad': 'Challenging', 'bad': 'Difficult', 'neutral': 'Okay',
'good': 'Good', 'excellent': 'Excellent'
};
const workloadLabels: Record<number, string> = {
1: 'Too light', 2: 'Light', 3: 'Balanced', 4: 'Heavy', 5: 'Overwhelming'
};
let summary = 'Week 1 Feedback Summary\n';
summary += '═'.repeat(25) + '\n\n';
summary += `Overall Experience: ${moodLabels[mood || ''] || 'Not rated'}\n\n`;
summary += 'Manager & Team Support:\n';
summary += ` Manager Availability: ${managerAvail > 0 ? '★'.repeat(managerAvail) + '☆'.repeat(5 - managerAvail) : 'Not rated'}\n`;
summary += ` Expectations Clarity: ${managerClarity > 0 ? '★'.repeat(managerClarity) + '☆'.repeat(5 - managerClarity) : 'Not rated'}\n`;
summary += ` Team Welcome: ${teamWelcome > 0 ? '★'.repeat(teamWelcome) + '☆'.repeat(5 - teamWelcome) : 'Not rated'}\n\n`;
summary += 'Role & Workload:\n';
summary += ` Role Clarity: ${roleClarity}/5\n`;
summary += ` Workload: ${workloadLabels[workload] || 'Balanced'}\n\n`;
summary += `Success Confidence: ${confidence}/5\n`;
// Alerts
const avgSupport = (managerAvail + managerClarity + teamWelcome) / 3;
if (avgSupport < 3 && avgSupport > 0) {
summary += '\n⚠️ Support scores below target - manager follow-up needed';
}
if (roleClarity < 3 && roleClarity > 0) {
summary += '\n⚠️ Role clarity needs attention - schedule alignment meeting';
}
if (workload >= 4) {
summary += '\n⚠️ Workload concerns - review onboarding pace';
}
return summary;
},
customStyles: () => {
const mood = overallSection.emojiRating('weekMood')?.value();
const baseStyles = {
padding: '16px',
borderRadius: '8px',
whiteSpace: 'pre-wrap',
fontFamily: 'monospace',
fontSize: '13px'
};
if (mood === 'excellent' || mood === 'good') {
return { ...baseStyles, backgroundColor: '#d1fae5', borderLeft: '4px solid #10b981' };
} else if (mood === 'very-bad' || mood === 'bad') {
return { ...baseStyles, backgroundColor: '#fee2e2', borderLeft: '4px solid #ef4444' };
}
return { ...baseStyles, backgroundColor: '#f8fafc', borderLeft: '4px solid #059669' };
}
});
});
// ============================================
// FORM CONFIGURATION
// ============================================
form.configureSubmitButton({
label: 'Submit Week 1 Feedback'
});
form.configureCompletionScreen({
type: 'text',
title: 'Thank you for your feedback!',
message: 'Your Week 1 insights help us improve the onboarding experience for everyone. Your manager will receive a summary to discuss in your next 1-on-1. Keep up the great work!'
});
}