@umituz/web-dashboard 6.11.0 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -3
- package/src/domains/analytics/components/AnalyticsCard.tsx +11 -0
- package/src/domains/analytics/components/AnalyticsChart.tsx +24 -5
- package/src/domains/analytics/components/AnalyticsLayout.tsx +26 -26
- package/src/domains/analytics/components/MetricCard.tsx +2 -5
- package/src/domains/analytics/hooks/useAnalytics.ts +1 -7
- package/src/domains/analytics/index.ts +0 -1
- package/src/domains/analytics/types/analytics.ts +11 -0
- package/src/domains/analytics/utils/analytics.ts +2 -115
- package/src/domains/analytics/utils/index.ts +0 -1
- package/src/domains/calendar/services/CalendarService.ts +2 -25
- package/src/domains/charts/components.test.tsx +1 -0
- package/src/domains/charts/components.tsx +65 -0
- package/src/domains/layouts/components/BrandLogo.tsx +1 -0
- package/src/domains/layouts/components/DashboardHeader.tsx +56 -20
- package/src/domains/layouts/components/DashboardLayout.test.tsx +39 -21
- package/src/domains/layouts/components/DashboardLayout.tsx +21 -25
- package/src/domains/layouts/components/DashboardSidebar.tsx +33 -32
- package/src/domains/layouts/components/FilterBar.test.tsx +3 -0
- package/src/domains/layouts/components/FilterBar.tsx +5 -9
- package/src/domains/layouts/components/FilterSelect.test.tsx +28 -0
- package/src/domains/layouts/components/FilterSelect.tsx +47 -0
- package/src/domains/layouts/components/PageHeader.test.tsx +3 -0
- package/src/domains/layouts/components/PageHeader.tsx +11 -2
- package/src/domains/layouts/components/SectionHeader.tsx +7 -4
- package/src/domains/layouts/components/index.ts +2 -0
- package/src/domains/layouts/hooks/dashboard.ts +4 -7
- package/src/domains/layouts/types/index.ts +12 -1
- package/src/domains/layouts/types/layout.ts +72 -63
- package/src/domains/layouts/types/sidebar.ts +0 -8
- package/src/domains/layouts/utils/dashboard.test.ts +2 -2
- package/src/domains/layouts/utils/dashboard.ts +15 -11
- package/src/domains/layouts/utils/index.ts +2 -1
- package/src/domains/modules/build.test.tsx +4 -0
- package/src/domains/modules/build.tsx +1 -0
- package/src/domains/onboarding/calc/slider-value-bounds.ts +1 -1
- package/src/domains/onboarding/components/AnimationWrapper.tsx +3 -0
- package/src/domains/onboarding/components/OnboardingErrorBoundary.tsx +6 -0
- package/src/domains/onboarding/components/OnboardingFlow.test.tsx +48 -27
- package/src/domains/onboarding/components/OnboardingFlow.tsx +10 -2
- package/src/domains/onboarding/components/OnboardingIntl.tsx +7 -65
- package/src/domains/onboarding/components/PrimaryButton.tsx +3 -0
- package/src/domains/onboarding/components/ProgressBar.tsx +5 -1
- package/src/domains/onboarding/components/QuestionWrapper.tsx +5 -0
- package/src/domains/onboarding/components/ScreenContainer.tsx +4 -0
- package/src/domains/onboarding/components/SwipeCard.test.tsx +43 -1
- package/src/domains/onboarding/components/SwipeCard.tsx +7 -0
- package/src/domains/onboarding/components/screens/AccountGateScreen.tsx +7 -0
- package/src/domains/onboarding/components/screens/AppDemoScreen.tsx +4 -0
- package/src/domains/onboarding/components/screens/ComparisonScreen.tsx +9 -0
- package/src/domains/onboarding/components/screens/GoalQuestionScreen.tsx +3 -0
- package/src/domains/onboarding/components/screens/PainPointsScreen.tsx +3 -0
- package/src/domains/onboarding/components/screens/PaywallScreen.tsx +17 -0
- package/src/domains/onboarding/components/screens/PermissionPrimingScreen.tsx +10 -0
- package/src/domains/onboarding/components/screens/PersonalizedSolutionScreen.tsx +9 -0
- package/src/domains/onboarding/components/screens/PreferencesScreen.tsx +15 -0
- package/src/domains/onboarding/components/screens/ProcessingScreen.tsx +8 -0
- package/src/domains/onboarding/components/screens/SocialProofScreen.tsx +17 -0
- package/src/domains/onboarding/components/screens/TinderCardsScreen.tsx +12 -0
- package/src/domains/onboarding/components/screens/ValueDeliveryScreen.tsx +9 -0
- package/src/domains/onboarding/components/screens/WelcomeScreen.tsx +7 -0
- package/src/domains/onboarding/hooks/useOnboardingProgress.test.tsx +4 -5
- package/src/domains/onboarding/index.ts +0 -12
- package/src/domains/onboarding/predicates/predicates.test.ts +1 -1
- package/src/domains/onboarding/types/config.ts +1 -1
- package/src/domains/onboarding/types/labels.ts +1 -0
- package/src/domains/onboarding/utils/analytics-dispatch.ts +2 -2
- package/src/domains/onboarding/utils/local-storage-bridge.ts +1 -1
- package/src/domains/onboarding/validation/validation.test.ts +2 -2
- package/src/domains/permissions/PermissionsContext.tsx +6 -18
- package/src/domains/permissions/index.ts +0 -1
- package/src/domains/search/searchItems.test.ts +1 -1
- package/src/domains/search/searchItems.ts +0 -3
- package/src/domains/settings/components/AuditLogList.tsx +14 -7
- package/src/domains/settings/components/PermissionMatrixScreen.tsx +10 -0
- package/src/domains/settings/components/SettingsLayout.tsx +20 -3
- package/src/domains/settings/components/SettingsSection.tsx +12 -6
- package/src/domains/settings/components/UserManagementTable.tsx +16 -9
- package/src/domains/settings/types/settings.ts +7 -1
- package/src/domains/settings/utils/index.ts +0 -1
- package/src/domains/timing/hooks/useCountdown.test.ts +1 -2
- package/src/domains/timing/hooks/useCountdown.ts +0 -4
- package/src/internal/formatPattern.ts +8 -0
- package/src/domains/analytics/utils/i18nKeys.ts +0 -31
- package/src/domains/onboarding/templates/TemplateDemoFallback.tsx +0 -92
- package/src/domains/onboarding/templates/art-onboarding.ts +0 -71
- package/src/domains/onboarding/templates/health-onboarding.ts +0 -92
- package/src/domains/onboarding/templates/index.ts +0 -6
- package/src/domains/onboarding/templates/platform-onboarding.ts +0 -201
- package/src/domains/onboarding/templates/video-onboarding.ts +0 -95
- package/src/domains/permissions/utils/i18nKeys.ts +0 -6
- package/src/domains/settings/utils/i18nKeys.ts +0 -12
|
@@ -55,8 +55,7 @@ describe('useCountdown', () => {
|
|
|
55
55
|
|
|
56
56
|
it('pause halts the tick and start resumes it', () => {
|
|
57
57
|
const { result } = renderHook(() => useCountdown(5));
|
|
58
|
-
|
|
59
|
-
// effect only re-registers after the pause() commit
|
|
58
|
+
|
|
60
59
|
act(() => {
|
|
61
60
|
result.current.pause();
|
|
62
61
|
});
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { useEffect, useRef, useState } from 'react';
|
|
2
2
|
|
|
3
|
-
/** Ticking countdown in seconds; fires onFinish once at zero. */
|
|
4
3
|
export function useCountdown(seconds: number | null, onFinish?: () => void) {
|
|
5
4
|
const [remaining, setRemaining] = useState(seconds ?? 0);
|
|
6
5
|
const [running, setRunning] = useState(seconds != null);
|
|
@@ -28,8 +27,6 @@ export function useCountdown(seconds: number | null, onFinish?: () => void) {
|
|
|
28
27
|
return () => window.clearInterval(id);
|
|
29
28
|
}, [running]);
|
|
30
29
|
|
|
31
|
-
// Completion fires in an effect, not inside the setRemaining updater —
|
|
32
|
-
// updaters must stay pure (StrictMode double-invokes them).
|
|
33
30
|
useEffect(() => {
|
|
34
31
|
if (running && remaining === 0 && !finishedRef.current) {
|
|
35
32
|
finishedRef.current = true;
|
|
@@ -51,7 +48,6 @@ export function useCountdown(seconds: number | null, onFinish?: () => void) {
|
|
|
51
48
|
};
|
|
52
49
|
}
|
|
53
50
|
|
|
54
|
-
/** Stopwatch for open practice (writing time, speaking response windows). */
|
|
55
51
|
export function useStopwatch() {
|
|
56
52
|
const [elapsed, setElapsed] = useState(0);
|
|
57
53
|
const [running, setRunning] = useState(false);
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
export const ANALYTICS_KEYS = {
|
|
2
|
-
common: {
|
|
3
|
-
export: 'analytics.common.export',
|
|
4
|
-
refresh: 'analytics.common.refresh',
|
|
5
|
-
periodSelector: 'analytics.common.periodSelector',
|
|
6
|
-
lastPeriod: 'analytics.common.lastPeriod',
|
|
7
|
-
last7Days: 'analytics.common.last7Days',
|
|
8
|
-
last30Days: 'analytics.common.last30Days',
|
|
9
|
-
last90Days: 'analytics.common.last90Days',
|
|
10
|
-
lastYear: 'analytics.common.lastYear',
|
|
11
|
-
loading: 'analytics.common.loading',
|
|
12
|
-
},
|
|
13
|
-
|
|
14
|
-
metric: {
|
|
15
|
-
noData: 'analytics.metric.noData',
|
|
16
|
-
change: 'analytics.metric.change',
|
|
17
|
-
},
|
|
18
|
-
|
|
19
|
-
card: {
|
|
20
|
-
title: 'analytics.card.title',
|
|
21
|
-
},
|
|
22
|
-
|
|
23
|
-
chart: {
|
|
24
|
-
noData: 'analytics.chart.noData',
|
|
25
|
-
},
|
|
26
|
-
|
|
27
|
-
layout: {
|
|
28
|
-
title: 'analytics.layout.title',
|
|
29
|
-
export: 'analytics.layout.export',
|
|
30
|
-
},
|
|
31
|
-
} as const;
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { useState } from 'react';
|
|
2
|
-
import { Button } from '@umituz/web-design-system/atoms';
|
|
3
|
-
import { Sparkles } from 'lucide-react';
|
|
4
|
-
import { cn } from '@umituz/web-design-system/utils/cn';
|
|
5
|
-
import type { DemoConfig, OnboardingScreen } from '../types/screens';
|
|
6
|
-
|
|
7
|
-
export interface TemplateDemoResult {
|
|
8
|
-
variant: string;
|
|
9
|
-
palette: string[];
|
|
10
|
-
generatedAt: number;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
function TemplateDemoFallback({ onSave }: { onSave: (result: TemplateDemoResult) => void }) {
|
|
14
|
-
const palettes: ReadonlyArray<{ variant: string; palette: string[] }> = [
|
|
15
|
-
{ variant: 'Minimal', palette: ['#0F172A', '#475569', '#94A3B8', '#F1F5F9', '#FFFFFF'] },
|
|
16
|
-
{ variant: 'Bold', palette: ['#7C3AED', '#EC4899', '#F59E0B', '#10B981', '#0EA5E9'] },
|
|
17
|
-
{ variant: 'Retro', palette: ['#92400E', '#B45309', '#D97706', '#FCD34D', '#FEF3C7'] },
|
|
18
|
-
{ variant: 'Playful', palette: ['#F472B6', '#A78BFA', '#60A9FA', '#34D399', '#FBBF24'] },
|
|
19
|
-
];
|
|
20
|
-
|
|
21
|
-
const [activeIdx, setActiveIdx] = useState(0);
|
|
22
|
-
const active = palettes[activeIdx];
|
|
23
|
-
|
|
24
|
-
return (
|
|
25
|
-
<div className="udb-onb-question__body">
|
|
26
|
-
<div className="udb-onb-palettes">
|
|
27
|
-
{palettes.map((p, i) => (
|
|
28
|
-
<button
|
|
29
|
-
key={p.variant}
|
|
30
|
-
type="button"
|
|
31
|
-
onClick={() => setActiveIdx(i)}
|
|
32
|
-
className={cn('udb-onb-palette', i === activeIdx && 'udb-onb-palette--active')}
|
|
33
|
-
>
|
|
34
|
-
<div className="udb-onb-palette__strip">
|
|
35
|
-
{p.palette.map((c) => (
|
|
36
|
-
<span key={c} className="udb-onb-palette__chip" style={{ background: c }} />
|
|
37
|
-
))}
|
|
38
|
-
</div>
|
|
39
|
-
<span className="udb-onb-palette__name">{p.variant}</span>
|
|
40
|
-
</button>
|
|
41
|
-
))}
|
|
42
|
-
</div>
|
|
43
|
-
<div className="udb-onb-palette-preview">
|
|
44
|
-
<div className="udb-onb-palette__strip udb-onb-palette__strip--lg">
|
|
45
|
-
{active.palette.map((c) => (
|
|
46
|
-
<span key={c} className="udb-onb-palette__chip" style={{ background: c }} />
|
|
47
|
-
))}
|
|
48
|
-
</div>
|
|
49
|
-
<p className="udb-onb-lead">
|
|
50
|
-
Preview: <strong>{active.variant}</strong> palette
|
|
51
|
-
</p>
|
|
52
|
-
</div>
|
|
53
|
-
<Button
|
|
54
|
-
variant="primary"
|
|
55
|
-
size="sm"
|
|
56
|
-
icon={<Sparkles className="udb-onb-icon--sm" />}
|
|
57
|
-
onClick={() =>
|
|
58
|
-
onSave({
|
|
59
|
-
variant: active.variant,
|
|
60
|
-
palette: [...active.palette],
|
|
61
|
-
generatedAt: Date.now(),
|
|
62
|
-
})
|
|
63
|
-
}
|
|
64
|
-
>
|
|
65
|
-
Save this style
|
|
66
|
-
</Button>
|
|
67
|
-
</div>
|
|
68
|
-
);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
const fallbackDemo: DemoConfig = {
|
|
72
|
-
component: TemplateDemoFallback as React.ComponentType<Record<string, unknown>>,
|
|
73
|
-
onSave: () => undefined,
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
const fallbackResult: TemplateDemoResult = {
|
|
77
|
-
variant: 'Minimal',
|
|
78
|
-
palette: ['#0F172A', '#475569', '#94A3B8', '#F1F5F9', '#FFFFFF'],
|
|
79
|
-
generatedAt: 0,
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
export function withDefaultDemo(screen: OnboardingScreen, fallback: DemoConfig = fallbackDemo): OnboardingScreen {
|
|
83
|
-
if (screen.type !== 'app-demo') return screen;
|
|
84
|
-
return { ...screen, demo: { ...fallback, ...screen.demo } };
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
export function defaultDemoResult(): TemplateDemoResult {
|
|
88
|
-
return { ...fallbackResult };
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
export { TemplateDemoFallback };
|
|
92
|
-
export type { DemoConfig };
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import type { OnboardingConfig } from '../types/config';
|
|
2
|
-
import type { OnboardingScreen } from '../types/screens';
|
|
3
|
-
import { withDefaultDemo, defaultDemoResult } from './TemplateDemoFallback';
|
|
4
|
-
|
|
5
|
-
const baseScreens: OnboardingScreen[] = [
|
|
6
|
-
{
|
|
7
|
-
id: 'welcome',
|
|
8
|
-
type: 'welcome',
|
|
9
|
-
title: 'Make something beautiful in 60 seconds',
|
|
10
|
-
subtitle: 'No design skills. No learning curve. Just create.',
|
|
11
|
-
cta: 'Try the demo',
|
|
12
|
-
heroIconName: 'Sparkles',
|
|
13
|
-
highlight: 'Live demo',
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
id: 'style',
|
|
17
|
-
type: 'goal-question',
|
|
18
|
-
question: 'Pick a style that feels like you',
|
|
19
|
-
multiSelect: true,
|
|
20
|
-
options: [
|
|
21
|
-
{ id: 'minimal', label: 'Minimal', iconName: 'Square' },
|
|
22
|
-
{ id: 'bold', label: 'Bold colors', iconName: 'Zap' },
|
|
23
|
-
{ id: 'retro', label: 'Retro', iconName: 'Rewind' },
|
|
24
|
-
{ id: 'playful', label: 'Playful', iconName: 'Smile' },
|
|
25
|
-
],
|
|
26
|
-
onChange: () => undefined,
|
|
27
|
-
cta: 'Continue',
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
id: 'demo',
|
|
31
|
-
type: 'app-demo',
|
|
32
|
-
title: 'Your turn — pick a palette',
|
|
33
|
-
demo: {
|
|
34
|
-
component: () => null,
|
|
35
|
-
onSave: () => undefined,
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
id: 'value',
|
|
40
|
-
type: 'value-delivery',
|
|
41
|
-
title: 'You made this!',
|
|
42
|
-
result: defaultDemoResult(),
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
id: 'paywall',
|
|
46
|
-
type: 'paywall',
|
|
47
|
-
title: 'Keep creating',
|
|
48
|
-
subtitle: 'Unlimited generations, all styles, no watermarks.',
|
|
49
|
-
price: '$4.99 / week',
|
|
50
|
-
trialDays: 3,
|
|
51
|
-
cta: 'Start free trial',
|
|
52
|
-
secondaryCta: 'Not now',
|
|
53
|
-
features: [
|
|
54
|
-
{ iconName: 'Infinity', text: 'Unlimited creations', highlighted: true },
|
|
55
|
-
{ iconName: 'Palette', text: 'All styles unlocked' },
|
|
56
|
-
{ iconName: 'Download', text: 'High-res export' },
|
|
57
|
-
{ iconName: 'Share2', text: 'Share anywhere' },
|
|
58
|
-
],
|
|
59
|
-
onSecondaryCta: () => undefined,
|
|
60
|
-
onAccept: async () => ({ accepted: true, trialStarted: true }),
|
|
61
|
-
},
|
|
62
|
-
];
|
|
63
|
-
|
|
64
|
-
const screens = baseScreens.map((s) => withDefaultDemo(s));
|
|
65
|
-
|
|
66
|
-
export const artOnboardingTemplate: OnboardingConfig = {
|
|
67
|
-
category: 'art',
|
|
68
|
-
screens,
|
|
69
|
-
onSkip: () => undefined,
|
|
70
|
-
onComplete: () => undefined,
|
|
71
|
-
};
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import type { OnboardingConfig } from '../types/config';
|
|
2
|
-
import type { OnboardingScreen } from '../types/screens';
|
|
3
|
-
|
|
4
|
-
const screens: OnboardingScreen[] = [
|
|
5
|
-
{
|
|
6
|
-
id: 'welcome',
|
|
7
|
-
type: 'welcome',
|
|
8
|
-
title: 'Your health, your data, your call',
|
|
9
|
-
subtitle: 'Private by design. Always encrypted on-device.',
|
|
10
|
-
cta: 'Get started',
|
|
11
|
-
heroIconName: 'ShieldCheck',
|
|
12
|
-
highlight: 'HIPAA-ready',
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
id: 'goal',
|
|
16
|
-
type: 'goal-question',
|
|
17
|
-
question: 'What brings you here today?',
|
|
18
|
-
multiSelect: false,
|
|
19
|
-
options: [
|
|
20
|
-
{ id: 'sleep', label: 'Better sleep', iconName: 'Moon' },
|
|
21
|
-
{ id: 'fitness', label: 'Get fitter', iconName: 'Dumbbell' },
|
|
22
|
-
{ id: 'nutrition', label: 'Eat healthier', iconName: 'Apple' },
|
|
23
|
-
{ id: 'stress', label: 'Manage stress', iconName: 'HeartPulse' },
|
|
24
|
-
],
|
|
25
|
-
onChange: () => undefined,
|
|
26
|
-
cta: 'Continue',
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
id: 'privacy',
|
|
30
|
-
type: 'pain-points',
|
|
31
|
-
title: 'What worries you most about health apps?',
|
|
32
|
-
painPoints: [
|
|
33
|
-
{ id: 'data-shared', label: 'Data shared with insurers' },
|
|
34
|
-
{ id: 'tracking', label: 'Being tracked across apps' },
|
|
35
|
-
{ id: 'ads', label: 'Seeing health ads' },
|
|
36
|
-
{ id: 'leaks', label: 'Data breaches' },
|
|
37
|
-
],
|
|
38
|
-
multiSelect: true,
|
|
39
|
-
onChange: () => undefined,
|
|
40
|
-
cta: 'Continue',
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
id: 'permission-priming-notifications',
|
|
44
|
-
type: 'permission-priming',
|
|
45
|
-
permission: 'notifications',
|
|
46
|
-
title: 'Gentle daily reminders',
|
|
47
|
-
description: 'We only ping you when it matters — never spammy.',
|
|
48
|
-
benefits: [
|
|
49
|
-
'Reminders you can mute any time',
|
|
50
|
-
'On-device scheduling — nothing leaves your phone',
|
|
51
|
-
'One-tap unsubscribe from any category',
|
|
52
|
-
],
|
|
53
|
-
iconName: 'Bell',
|
|
54
|
-
onRequest: async () => 'prompt',
|
|
55
|
-
cta: 'Allow reminders',
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
id: 'processing',
|
|
59
|
-
type: 'processing',
|
|
60
|
-
title: 'Building your wellness plan…',
|
|
61
|
-
steps: ['Reading your goals', 'Filtering privacy settings', 'Personalizing the plan'],
|
|
62
|
-
durationMs: 3000,
|
|
63
|
-
onComplete: () => undefined,
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
id: 'paywall',
|
|
67
|
-
type: 'paywall',
|
|
68
|
-
title: 'Unlock your full plan',
|
|
69
|
-
subtitle: 'Most users see results in their first week.',
|
|
70
|
-
price: '$6.99 / month',
|
|
71
|
-
trialDays: 7,
|
|
72
|
-
trialPrice: 'Free',
|
|
73
|
-
cta: 'Start 7-day trial',
|
|
74
|
-
secondaryCta: 'Maybe later',
|
|
75
|
-
features: [
|
|
76
|
-
{ iconName: 'Lock', text: 'End-to-end encrypted data' },
|
|
77
|
-
{ iconName: 'Activity', text: 'Personalized daily plan' },
|
|
78
|
-
{ iconName: 'MessageCircle', text: '24/7 human coaching' },
|
|
79
|
-
{ iconName: 'Award', text: 'Progress you can share (or not)' },
|
|
80
|
-
],
|
|
81
|
-
socialProof: { text: 'Trusted by', count: 250000 },
|
|
82
|
-
onSecondaryCta: () => undefined,
|
|
83
|
-
onAccept: async () => ({ accepted: true, trialStarted: true }),
|
|
84
|
-
},
|
|
85
|
-
];
|
|
86
|
-
|
|
87
|
-
export const healthOnboardingTemplate: OnboardingConfig = {
|
|
88
|
-
category: 'health',
|
|
89
|
-
screens,
|
|
90
|
-
onSkip: () => undefined,
|
|
91
|
-
onComplete: () => undefined,
|
|
92
|
-
};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { healthOnboardingTemplate } from './health-onboarding';
|
|
2
|
-
export { artOnboardingTemplate } from './art-onboarding';
|
|
3
|
-
export { videoOnboardingTemplate } from './video-onboarding';
|
|
4
|
-
export { platformOnboardingTemplate } from './platform-onboarding';
|
|
5
|
-
export { withDefaultDemo, defaultDemoResult, TemplateDemoFallback } from './TemplateDemoFallback';
|
|
6
|
-
export type { TemplateDemoResult } from './TemplateDemoFallback';
|
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
import type { OnboardingConfig } from '../types/config';
|
|
2
|
-
import type { OnboardingScreen } from '../types/screens';
|
|
3
|
-
import { withDefaultDemo, defaultDemoResult } from './TemplateDemoFallback';
|
|
4
|
-
|
|
5
|
-
const screens: OnboardingScreen[] = [
|
|
6
|
-
{
|
|
7
|
-
id: 'welcome',
|
|
8
|
-
type: 'welcome',
|
|
9
|
-
title: 'Welcome aboard',
|
|
10
|
-
subtitle: 'A few questions and we’ll tailor the entire experience.',
|
|
11
|
-
cta: 'Start',
|
|
12
|
-
heroIconName: 'Rocket',
|
|
13
|
-
highlight: '~2 minutes',
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
id: 'goals',
|
|
17
|
-
type: 'goal-question',
|
|
18
|
-
question: 'What do you want to get out of this?',
|
|
19
|
-
multiSelect: true,
|
|
20
|
-
options: [
|
|
21
|
-
{ id: 'productivity', label: 'Be more productive', iconName: 'Zap' },
|
|
22
|
-
{ id: 'learn', label: 'Learn new skills', iconName: 'GraduationCap' },
|
|
23
|
-
{ id: 'connect', label: 'Connect with people', iconName: 'Users' },
|
|
24
|
-
{ id: 'create', label: 'Create content', iconName: 'PenTool' },
|
|
25
|
-
],
|
|
26
|
-
onChange: () => undefined,
|
|
27
|
-
cta: 'Continue',
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
id: 'pains',
|
|
31
|
-
type: 'pain-points',
|
|
32
|
-
title: 'What frustrates you about tools like this?',
|
|
33
|
-
painPoints: [
|
|
34
|
-
{ id: 'complex', label: 'Too complex' },
|
|
35
|
-
{ id: 'slow', label: 'Too slow' },
|
|
36
|
-
{ id: 'pricey', label: 'Too expensive' },
|
|
37
|
-
{ id: 'privacy', label: 'Privacy concerns' },
|
|
38
|
-
],
|
|
39
|
-
multiSelect: true,
|
|
40
|
-
maxSelect: 3,
|
|
41
|
-
onChange: () => undefined,
|
|
42
|
-
cta: 'Continue',
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
id: 'proof',
|
|
46
|
-
type: 'social-proof',
|
|
47
|
-
title: 'Why people stay',
|
|
48
|
-
testimonials: [
|
|
49
|
-
{
|
|
50
|
-
name: 'Maya K.',
|
|
51
|
-
role: 'Designer',
|
|
52
|
-
content: 'The best $10/mo I spend. Period.',
|
|
53
|
-
rating: 5,
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
name: 'Andre P.',
|
|
57
|
-
role: 'PM',
|
|
58
|
-
content: 'I onboarded my whole team in a day.',
|
|
59
|
-
rating: 5,
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
name: 'Sara L.',
|
|
63
|
-
role: 'Founder',
|
|
64
|
-
content: 'Replaced three other tools for me.',
|
|
65
|
-
rating: 4,
|
|
66
|
-
},
|
|
67
|
-
],
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
id: 'tinder',
|
|
71
|
-
type: 'tinder-cards',
|
|
72
|
-
title: 'A bit about you',
|
|
73
|
-
statements: [
|
|
74
|
-
{ id: 'a', text: 'I prefer learning by doing.', category: 'Style' },
|
|
75
|
-
{ id: 'b', text: 'I read every doc end-to-end.', category: 'Style' },
|
|
76
|
-
{ id: 'c', text: 'I collaborate with others daily.', category: 'Style' },
|
|
77
|
-
{ id: 'd', text: 'I work alone most of the time.', category: 'Style' },
|
|
78
|
-
],
|
|
79
|
-
onChange: () => undefined,
|
|
80
|
-
cta: 'Continue',
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
id: 'personalized',
|
|
84
|
-
type: 'personalized-solution',
|
|
85
|
-
title: 'Built for the way you work',
|
|
86
|
-
subtitle: 'Here is what we’ll set up for you.',
|
|
87
|
-
solutions: [
|
|
88
|
-
{ painPointId: 'complex', solution: 'A guided first-run experience with smart defaults.' },
|
|
89
|
-
{ painPointId: 'slow', solution: 'Sub-200ms interactions, no spinner purgatory.' },
|
|
90
|
-
{ painPointId: 'pricey', solution: 'A free tier that actually does the job.' },
|
|
91
|
-
{ painPointId: 'privacy', solution: 'You own your data — export and delete anytime.' },
|
|
92
|
-
],
|
|
93
|
-
selectedPainPointIds: [],
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
id: 'comparison',
|
|
97
|
-
type: 'comparison',
|
|
98
|
-
title: 'Before vs. after',
|
|
99
|
-
before: ['Tool overload', 'Generic templates', 'Steep learning curve'],
|
|
100
|
-
after: ['One workspace', 'Personalized setup', '2-minute onboarding'],
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
id: 'prefs',
|
|
104
|
-
type: 'preferences',
|
|
105
|
-
title: 'A few preferences',
|
|
106
|
-
preferences: [
|
|
107
|
-
{
|
|
108
|
-
id: 'theme',
|
|
109
|
-
label: 'Theme',
|
|
110
|
-
type: 'select',
|
|
111
|
-
defaultValue: 'system',
|
|
112
|
-
options: [
|
|
113
|
-
{ id: 'system', label: 'Match system' },
|
|
114
|
-
{ id: 'light', label: 'Light' },
|
|
115
|
-
{ id: 'dark', label: 'Dark' },
|
|
116
|
-
],
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
id: 'density',
|
|
120
|
-
label: 'Density',
|
|
121
|
-
type: 'select',
|
|
122
|
-
defaultValue: 'comfortable',
|
|
123
|
-
options: [
|
|
124
|
-
{ id: 'compact', label: 'Compact' },
|
|
125
|
-
{ id: 'comfortable', label: 'Comfortable' },
|
|
126
|
-
],
|
|
127
|
-
},
|
|
128
|
-
],
|
|
129
|
-
onChange: () => undefined,
|
|
130
|
-
cta: 'Continue',
|
|
131
|
-
},
|
|
132
|
-
{
|
|
133
|
-
id: 'permission-notifications',
|
|
134
|
-
type: 'permission-priming',
|
|
135
|
-
permission: 'notifications',
|
|
136
|
-
title: 'Stay in the loop',
|
|
137
|
-
description: 'Only the alerts you actually want.',
|
|
138
|
-
benefits: ['Mentions & replies', 'Weekly summary', 'Customizable quiet hours'],
|
|
139
|
-
iconName: 'Bell',
|
|
140
|
-
onRequest: async () => 'prompt',
|
|
141
|
-
cta: 'Enable notifications',
|
|
142
|
-
},
|
|
143
|
-
{
|
|
144
|
-
id: 'processing',
|
|
145
|
-
type: 'processing',
|
|
146
|
-
title: 'Setting up your workspace…',
|
|
147
|
-
steps: ['Tuning recommendations', 'Importing defaults', 'Warming caches'],
|
|
148
|
-
durationMs: 3500,
|
|
149
|
-
onComplete: () => undefined,
|
|
150
|
-
},
|
|
151
|
-
{
|
|
152
|
-
id: 'demo',
|
|
153
|
-
type: 'app-demo',
|
|
154
|
-
title: 'Quick tour — try a quick action',
|
|
155
|
-
demo: { component: () => null, onSave: () => undefined },
|
|
156
|
-
},
|
|
157
|
-
{
|
|
158
|
-
id: 'value',
|
|
159
|
-
type: 'value-delivery',
|
|
160
|
-
title: 'You’re all set',
|
|
161
|
-
result: defaultDemoResult(),
|
|
162
|
-
},
|
|
163
|
-
{
|
|
164
|
-
id: 'account',
|
|
165
|
-
type: 'account-gate',
|
|
166
|
-
title: 'Save your progress',
|
|
167
|
-
subtitle: 'Sign in to sync across devices.',
|
|
168
|
-
optional: true,
|
|
169
|
-
signInMethod: 'email',
|
|
170
|
-
skipText: 'Continue without account',
|
|
171
|
-
onSignIn: async () => ({ signedIn: true, method: 'email' }),
|
|
172
|
-
},
|
|
173
|
-
{
|
|
174
|
-
id: 'paywall',
|
|
175
|
-
type: 'paywall',
|
|
176
|
-
title: 'Unlock the full platform',
|
|
177
|
-
subtitle: 'Pricing that scales with you.',
|
|
178
|
-
price: '$14.99 / month',
|
|
179
|
-
trialDays: 14,
|
|
180
|
-
cta: 'Start 14-day trial',
|
|
181
|
-
secondaryCta: 'Stay on free',
|
|
182
|
-
features: [
|
|
183
|
-
{ iconName: 'Infinity', text: 'Unlimited projects' },
|
|
184
|
-
{ iconName: 'Users', text: 'Team workspaces' },
|
|
185
|
-
{ iconName: 'Shield', text: 'Enterprise SSO' },
|
|
186
|
-
{ iconName: 'Headphones', text: 'Priority support' },
|
|
187
|
-
],
|
|
188
|
-
socialProof: { text: 'Joined by', count: 850000 },
|
|
189
|
-
onSecondaryCta: () => undefined,
|
|
190
|
-
onAccept: async () => ({ accepted: true, trialStarted: true }),
|
|
191
|
-
},
|
|
192
|
-
];
|
|
193
|
-
|
|
194
|
-
const resolvedScreens = screens.map((s) => withDefaultDemo(s));
|
|
195
|
-
|
|
196
|
-
export const platformOnboardingTemplate: OnboardingConfig = {
|
|
197
|
-
category: 'platform',
|
|
198
|
-
screens: resolvedScreens,
|
|
199
|
-
onSkip: () => undefined,
|
|
200
|
-
onComplete: () => undefined,
|
|
201
|
-
};
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import type { OnboardingConfig } from '../types/config';
|
|
2
|
-
import type { OnboardingScreen } from '../types/screens';
|
|
3
|
-
|
|
4
|
-
const screens: OnboardingScreen[] = [
|
|
5
|
-
{
|
|
6
|
-
id: 'welcome',
|
|
7
|
-
type: 'welcome',
|
|
8
|
-
title: 'Watch what you actually love',
|
|
9
|
-
subtitle: 'A few quick questions and we’ll never recommend junk again.',
|
|
10
|
-
cta: 'Let’s go',
|
|
11
|
-
heroIconName: 'Play',
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
id: 'genres',
|
|
15
|
-
type: 'goal-question',
|
|
16
|
-
question: 'Which genres do you enjoy?',
|
|
17
|
-
multiSelect: true,
|
|
18
|
-
options: [
|
|
19
|
-
{ id: 'comedy', label: 'Comedy', iconName: 'Smile' },
|
|
20
|
-
{ id: 'drama', label: 'Drama', iconName: 'Theater' },
|
|
21
|
-
{ id: 'documentary', label: 'Documentary', iconName: 'BookOpen' },
|
|
22
|
-
{ id: 'thriller', label: 'Thriller', iconName: 'AlertTriangle' },
|
|
23
|
-
{ id: 'sci-fi', label: 'Sci-fi', iconName: 'Rocket' },
|
|
24
|
-
],
|
|
25
|
-
onChange: () => undefined,
|
|
26
|
-
cta: 'Continue',
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
id: 'mood',
|
|
30
|
-
type: 'tinder-cards',
|
|
31
|
-
title: 'Swipe on what feels right',
|
|
32
|
-
statements: [
|
|
33
|
-
{ id: 's1', text: 'I want to learn something new today.', category: 'Curious' },
|
|
34
|
-
{ id: 's2', text: 'I want pure entertainment.', category: 'Fun' },
|
|
35
|
-
{ id: 's3', text: 'I want something to cry to.', category: 'Emotional' },
|
|
36
|
-
{ id: 's4', text: 'I want background noise while I work.', category: 'Casual' },
|
|
37
|
-
],
|
|
38
|
-
onChange: () => undefined,
|
|
39
|
-
cta: 'Continue',
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
id: 'length',
|
|
43
|
-
type: 'preferences',
|
|
44
|
-
title: 'How long should a video be?',
|
|
45
|
-
preferences: [
|
|
46
|
-
{
|
|
47
|
-
id: 'length',
|
|
48
|
-
label: 'Preferred length',
|
|
49
|
-
type: 'slider',
|
|
50
|
-
min: 1,
|
|
51
|
-
max: 120,
|
|
52
|
-
defaultValue: 20,
|
|
53
|
-
},
|
|
54
|
-
],
|
|
55
|
-
onChange: () => undefined,
|
|
56
|
-
cta: 'Continue',
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
id: 'permission-priming-notifications',
|
|
60
|
-
type: 'permission-priming',
|
|
61
|
-
permission: 'notifications',
|
|
62
|
-
title: 'Never miss a live premiere',
|
|
63
|
-
description: 'Get a heads-up when channels you love go live.',
|
|
64
|
-
benefits: ['Only from channels you follow', 'Snooze any time', 'Silent by default'],
|
|
65
|
-
iconName: 'Bell',
|
|
66
|
-
onRequest: async () => 'prompt',
|
|
67
|
-
cta: 'Turn on alerts',
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
id: 'paywall',
|
|
71
|
-
type: 'paywall',
|
|
72
|
-
title: 'Watch without limits',
|
|
73
|
-
subtitle: 'Ad-free, offline downloads, 4K.',
|
|
74
|
-
price: '$11.99 / month',
|
|
75
|
-
trialDays: 14,
|
|
76
|
-
cta: 'Start 14-day trial',
|
|
77
|
-
secondaryCta: 'Continue with ads',
|
|
78
|
-
features: [
|
|
79
|
-
{ iconName: 'Tv', text: '4K Ultra HD' },
|
|
80
|
-
{ iconName: 'Download', text: 'Offline downloads' },
|
|
81
|
-
{ iconName: 'Users', text: '4 screens at once' },
|
|
82
|
-
{ iconName: 'Ban', text: 'Zero ads' },
|
|
83
|
-
],
|
|
84
|
-
socialProof: { text: 'Loved by', count: 1200000 },
|
|
85
|
-
onSecondaryCta: () => undefined,
|
|
86
|
-
onAccept: async () => ({ accepted: true, trialStarted: true }),
|
|
87
|
-
},
|
|
88
|
-
];
|
|
89
|
-
|
|
90
|
-
export const videoOnboardingTemplate: OnboardingConfig = {
|
|
91
|
-
category: 'video',
|
|
92
|
-
screens,
|
|
93
|
-
onSkip: () => undefined,
|
|
94
|
-
onComplete: () => undefined,
|
|
95
|
-
};
|