refactor: enhance UI components and navigation structure, implement export functionality for wizard steps, and update routing for improved user experience

This commit is contained in:
Jennie Robinson Faber 2025-08-16 13:17:36 +01:00
parent 37ab8d7bab
commit d7e52293e4
18 changed files with 3802 additions and 3318 deletions

View file

@ -1,9 +1,21 @@
<template>
<div class="space-y-6">
<div>
<h3 class="text-2xl font-black text-black mb-4">
Where does your money go?
</h3>
<div class="max-w-4xl mx-auto space-y-6">
<!-- Section Header with Export Controls -->
<div class="flex items-center justify-between mb-8">
<div>
<h3 class="text-2xl font-black text-black mb-2">
Where does your money go?
</h3>
<p class="text-neutral-600">
Add costs like rent, tools, insurance, or other recurring expenses.
</p>
</div>
<div class="flex items-center gap-3">
<UButton variant="outline" color="gray" size="sm" @click="exportCosts">
<UIcon name="i-heroicons-arrow-down-tray" class="mr-1" />
Export
</UButton>
</div>
</div>
<!-- Overhead Costs -->
@ -31,7 +43,7 @@
class="text-center py-12 border-4 border-dashed border-black rounded-xl bg-white shadow-lg">
<h4 class="font-medium text-neutral-900 mb-2">No overhead costs yet</h4>
<p class="text-sm text-neutral-500 mb-4">
Add costs like rent, tools, insurance, or other recurring expenses.
Get started by adding your first overhead cost.
</p>
<UButton
@click="addOverheadCost"
@ -202,4 +214,24 @@ function addOverheadCost() {
function removeCost(id: string) {
budgetStore.removeOverheadLine(id);
}
function exportCosts() {
const exportData = {
overheadCosts: overheadCosts.value,
exportedAt: new Date().toISOString(),
section: "costs",
};
const blob = new Blob([JSON.stringify(exportData, null, 2)], {
type: "application/json",
});
const url = URL.createObjectURL(blob);
const a = document.createElement("a");
a.href = url;
a.download = `coop-costs-${new Date().toISOString().split("T")[0]}.json`;
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
URL.revokeObjectURL(url);
}
</script>

View file

@ -1,8 +1,23 @@
<template>
<div class="space-y-4">
<div>
<div class="flex items-center justify-between mb-6">
<h3 class="text-2xl font-black text-black">Who's on your team?</h3>
<div class="max-w-4xl mx-auto space-y-6">
<!-- Section Header with Export Controls -->
<div class="flex items-center justify-between mb-8">
<div>
<h3 class="text-2xl font-black text-black mb-2">Who's on your team?</h3>
<p class="text-neutral-600">
Add everyone who'll be working in the co-op, even if they're not ready
to be paid yet.
</p>
</div>
<div class="flex items-center gap-3">
<UButton
variant="outline"
color="gray"
size="sm"
@click="exportMembers">
<UIcon name="i-heroicons-arrow-down-tray" class="mr-1" />
Export
</UButton>
<UButton
v-if="members.length > 0"
@click="addMember"
@ -26,8 +41,7 @@
class="text-center py-12 border-4 border-dashed border-black rounded-xl bg-white shadow-lg">
<h4 class="font-medium text-neutral-900 mb-2">No team members yet</h4>
<p class="text-sm text-neutral-500 mb-4">
Add everyone who'll be working in the co-op, even if they're not ready
to be paid yet.
Get started by adding your first team member.
</p>
<UButton @click="addMember" size="lg" variant="solid" color="primary">
<UIcon name="i-heroicons-plus" class="mr-2" />
@ -218,4 +232,24 @@ function addMember() {
function removeMember(id: string) {
membersStore.removeMember(id);
}
function exportMembers() {
const exportData = {
members: members.value,
exportedAt: new Date().toISOString(),
section: "members",
};
const blob = new Blob([JSON.stringify(exportData, null, 2)], {
type: "application/json",
});
const url = URL.createObjectURL(blob);
const a = document.createElement("a");
a.href = url;
a.download = `coop-members-${new Date().toISOString().split("T")[0]}.json`;
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
URL.revokeObjectURL(url);
}
</script>

View file

@ -1,9 +1,25 @@
<template>
<div class="space-y-4">
<div>
<h3 class="text-2xl font-black text-black mb-6">
What's your equal hourly wage?
</h3>
<div class="max-w-4xl mx-auto space-y-6">
<!-- Section Header with Export Controls -->
<div class="flex items-center justify-between mb-8">
<div>
<h3 class="text-2xl font-black text-black mb-2">
What's your equal hourly wage?
</h3>
<p class="text-neutral-600">
Set the hourly rate that all co-op members will earn for their work.
</p>
</div>
<div class="flex items-center gap-3">
<UButton
variant="outline"
color="gray"
size="sm"
@click="exportPolicies">
<UIcon name="i-heroicons-arrow-down-tray" class="mr-1" />
Export
</UButton>
</div>
</div>
<div class="max-w-md">
@ -101,4 +117,32 @@ onMounted(() => {
setDefaults();
}
});
function exportPolicies() {
const exportData = {
policies: {
equalHourlyWage: policiesStore.equalHourlyWage,
payrollOncostPct: policiesStore.payrollOncostPct,
savingsTargetMonths: policiesStore.savingsTargetMonths,
minCashCushionAmount: policiesStore.minCashCushionAmount,
deferredCapHoursPerQtr: policiesStore.deferredCapHoursPerQtr,
deferredSunsetMonths: policiesStore.deferredSunsetMonths,
volunteerScope: policiesStore.volunteerScope,
},
exportedAt: new Date().toISOString(),
section: "policies",
};
const blob = new Blob([JSON.stringify(exportData, null, 2)], {
type: "application/json",
});
const url = URL.createObjectURL(blob);
const a = document.createElement("a");
a.href = url;
a.download = `coop-policies-${new Date().toISOString().split("T")[0]}.json`;
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
URL.revokeObjectURL(url);
}
</script>

View file

@ -1,10 +1,24 @@
<template>
<div class="space-y-4">
<div>
<div class="flex items-center justify-between mb-6">
<h3 class="text-2xl font-black text-black">
<div class="max-w-4xl mx-auto space-y-6">
<!-- Section Header with Export Controls -->
<div class="flex items-center justify-between mb-8">
<div>
<h3 class="text-2xl font-black text-black mb-2">
Where will your money come from?
</h3>
<p class="text-neutral-600">
Add sources like client work, grants, product sales, or donations.
</p>
</div>
<div class="flex items-center gap-3">
<UButton
variant="outline"
color="gray"
size="sm"
@click="exportStreams">
<UIcon name="i-heroicons-arrow-down-tray" class="mr-1" />
Export
</UButton>
<UButton
v-if="streams.length > 0"
@click="addRevenueStream"
@ -29,7 +43,7 @@
No revenue streams yet
</h4>
<p class="text-sm text-neutral-500 mb-4">
Add sources like client work, grants, product sales, or donations.
Get started by adding your first revenue source.
</p>
<UButton
@click="addRevenueStream"
@ -247,4 +261,24 @@ function addRevenueStream() {
function removeStream(id: string) {
streamsStore.removeStream(id);
}
function exportStreams() {
const exportData = {
streams: streams.value,
exportedAt: new Date().toISOString(),
section: "revenue",
};
const blob = new Blob([JSON.stringify(exportData, null, 2)], {
type: "application/json",
});
const url = URL.createObjectURL(blob);
const a = document.createElement("a");
a.href = url;
a.download = `coop-revenue-${new Date().toISOString().split("T")[0]}.json`;
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
URL.revokeObjectURL(url);
}
</script>

View file

@ -1,11 +1,20 @@
<template>
<div class="space-y-6">
<div>
<h3 class="text-lg font-medium mb-4">Review & Complete</h3>
<p class="text-neutral-600 mb-6">
Review your setup and complete the wizard to start using your co-op
tool.
</p>
<div class="max-w-4xl mx-auto space-y-6">
<!-- Section Header with Export Controls -->
<div class="flex items-center justify-between mb-8">
<div>
<h3 class="text-2xl font-black text-black mb-2">Review & Complete</h3>
<p class="text-neutral-600">
Review your setup and complete the wizard to start using your co-op
tool.
</p>
</div>
<div class="flex items-center gap-3">
<UButton variant="outline" color="gray" size="sm" @click="exportSetup">
<UIcon name="i-heroicons-arrow-down-tray" class="mr-1" />
Export All
</UButton>
</div>
</div>
<div class="grid grid-cols-1 lg:grid-cols-2 gap-6">
@ -284,9 +293,6 @@
</UButton>
<div class="flex gap-3">
<UButton variant="outline" color="gray" @click="exportSetup">
Export Setup
</UButton>
<UButton
@click="completeSetup"
:disabled="!canComplete"

101
components/WizardSubnav.vue Normal file
View file

@ -0,0 +1,101 @@
<template>
<div
class="border-b border-neutral-200 dark:border-neutral-700 bg-neutral-50 dark:bg-neutral-900">
<div class="max-w-4xl mx-auto px-4 py-3">
<nav class="flex items-center space-x-1 overflow-x-auto">
<!-- Main Setup Wizard -->
<NuxtLink
to="/wizard"
class="inline-flex items-center px-3 py-2 rounded-md text-sm font-medium transition-colors whitespace-nowrap"
:class="
isActive('/wizard')
? 'bg-black text-white dark:bg-white dark:text-black'
: 'text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-100 hover:bg-neutral-100 dark:hover:bg-neutral-800'
">
<UIcon name="i-heroicons-cog-6-tooth" class="w-4 h-4 mr-2" />
Setup Wizard
</NuxtLink>
<!-- Divider -->
<div class="h-6 w-px bg-neutral-300 dark:bg-neutral-600 mx-2"></div>
<!-- Template Wizards -->
<NuxtLink
v-for="wizard in templateWizards"
:key="wizard.id"
:to="wizard.path"
class="inline-flex items-center px-3 py-2 rounded-md text-sm font-medium transition-colors whitespace-nowrap"
:class="
isActive(wizard.path)
? 'bg-black text-white dark:bg-white dark:text-black'
: 'text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-100 hover:bg-neutral-100 dark:hover:bg-neutral-800'
">
<UIcon :name="wizard.icon" class="w-4 h-4 mr-2" />
{{ wizard.name }}
</NuxtLink>
<!-- All Wizards Link -->
<div class="h-6 w-px bg-neutral-300 dark:bg-neutral-600 mx-2"></div>
<NuxtLink
to="/wizards"
class="inline-flex items-center px-3 py-2 rounded-md text-sm font-medium transition-colors whitespace-nowrap"
:class="
isActive('/wizards')
? 'bg-black text-white dark:bg-white dark:text-black'
: 'text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-100 hover:bg-neutral-100 dark:hover:bg-neutral-800'
">
<UIcon name="i-heroicons-squares-plus" class="w-4 h-4 mr-2" />
All Wizards
</NuxtLink>
</nav>
</div>
</div>
</template>
<script setup lang="ts">
const route = useRoute();
// Template wizards data - matches the wizards.vue page
const templateWizards = [
{
id: "membership-agreement",
name: "Membership Agreement",
icon: "i-heroicons-user-group",
path: "/templates/membership-agreement",
},
{
id: "conflict-resolution-framework",
name: "Conflict Resolution",
icon: "i-heroicons-scale",
path: "/templates/conflict-resolution-framework",
},
{
id: "tech-charter",
name: "Tech Charter",
icon: "i-heroicons-cog-6-tooth",
path: "/templates/tech-charter",
},
{
id: "decision-framework",
name: "Decision Helper",
icon: "i-heroicons-light-bulb",
path: "/templates/decision-framework",
},
];
function isActive(path: string): boolean {
return route.path === path;
}
</script>
<style scoped>
/* Ensure horizontal scroll on mobile */
nav {
scrollbar-width: none; /* Firefox */
-ms-overflow-style: none; /* Internet Explorer 10+ */
}
nav::-webkit-scrollbar {
display: none; /* WebKit */
}
</style>