Skip to content

Open source personal finance application

refactor: enhance component styles and layout consistency

Ilya Komicheve2b1673d0b29
diff --git a/app/app.config.ts b/app/app.config.ts
index 9a195eda..5c053ab5 100644
--- a/app/app.config.ts
+++ b/app/app.config.ts
@@ -12,7 +12,7 @@ export default defineAppConfig({
placement: 'bottom-start',
},
ring: '!ring-2 !ring-item-3',
- trigger: 'w-full',
+ trigger: 'w-full cursor-default',
},
strategy: 'override',
},
diff --git a/app/components/filter/FilterSelector.vue b/app/components/filter/FilterSelector.vue
index f22dbff3..04473483 100644
--- a/app/components/filter/FilterSelector.vue
+++ b/app/components/filter/FilterSelector.vue
@@ -21,10 +21,12 @@ const modals = ref({
</script>
<template>
- <div class="_bg-item-4 flex gap-2 rounded-md p-px">
+ <div class="flex">
<template v-if="props.isShowCategories">
<!-- Categories -->
- <UPopover v-if="isLaptop">
+ <UPopover
+ v-if="isLaptop"
+ >
<UiItem3>
<Icon name="hugeicons:folder-library" size="20" />
</UiItem3>
diff --git a/app/components/stat/Header.vue b/app/components/stat/Header.vue
index 6721211d..004a1afb 100644
--- a/app/components/stat/Header.vue
+++ b/app/components/stat/Header.vue
@@ -52,7 +52,7 @@ function onClickWallet(walletId: WalletId) {
<template #actions>
<div
v-if="props.filter || props.config"
- class="ml-auto flex items-center gap-1"
+ class="ml-auto flex items-center"
>
<FilterSelector
v-if="props.filter"
@@ -75,7 +75,7 @@ function onClickWallet(walletId: WalletId) {
<template #after>
<div
v-if="props.menu"
- class="px-2 pt-1 sm:pb-4 md:pt-2 lg:px-4 2xl:px-8"
+ class="px-2 sm:pb-4 md:pt-2 lg:px-4 2xl:px-8"
>
<StatMenu
:active="props.menu.active"
diff --git a/app/components/ui/Element.vue b/app/components/ui/Element.vue
index c1f84fa6..0ef74899 100644
--- a/app/components/ui/Element.vue
+++ b/app/components/ui/Element.vue
@@ -24,7 +24,10 @@ const classes = computed(() => cn(
</script>
<template>
- <div @click="(e: Event) => emit('click', e)">
+ <div
+ class="@container/element"
+ @click="(e: Event) => emit('click', e)"
+ >
<div :class="classes">
<div
v-if="slots.leftIcon"
@@ -46,7 +49,7 @@ const classes = computed(() => cn(
'ml-[48px] group-last/item:hidden': lineWidth === 4,
'group-last:hidden': lineWidth !== 3 && lineWidth !== 4,
}"
- class="mx-2 h-px bg-item-5"
+ class="bg-item-5 mx-2 h-px"
/>
</div>
</template>
diff --git a/app/components/ui/Header.vue b/app/components/ui/Header.vue
index 9ed3c8f3..ef96a5af 100644
--- a/app/components/ui/Header.vue
+++ b/app/components/ui/Header.vue
@@ -1,9 +1,9 @@
<template>
- <div class="@lg:pt-3 max-w-7xl px-2 pb-2 pt-1 lg:px-4 2xl:px-8">
- <div class="flex items-center gap-2">
+ <div class="border-item-3 mb-2 flex min-h-12 max-w-7xl items-center border-b px-2 py-1 sm:min-h-14 lg:px-4 2xl:px-8">
+ <div class="flex grow items-center gap-2">
<slot />
- <div v-if="$slots.actions" class="ml-auto flex items-center gap-1">
+ <div v-if="$slots.actions" class="ml-auto flex items-center">
<slot name="actions" />
</div>
</div>
diff --git a/app/components/ui/Item2.vue b/app/components/ui/Item2.vue
index cffefedd..d8f9bf03 100644
--- a/app/components/ui/Item2.vue
+++ b/app/components/ui/Item2.vue
@@ -7,20 +7,20 @@ const emit = defineEmits<{
</script>
<template>
- <div
- :class="getStyles('item', ['link', 'center', 'minh2', 'minw1', 'rounded'])"
- class="flex items-center justify-between border border-item-5 bg-item-4 px-4 py-2.5"
+ <UiElement
+ insideClasses="w-full !min-h-[44px] bg-item-4 px-2 @xl/page:px-4 block @xl/page:flex @xl/page:flex-wrap gap-0 gap-x-2"
@click="(e: Event) => emit('click', e)"
>
- <div class="text-sm">
+ <div class="text-2 text-sm">
<slot name="label" />
</div>
- <div class="flex items-center gap-1 text-base">
+
+ <div class="@xl/page:ml-auto flex items-center gap-1 text-base">
<slot name="value" />
<Icon
name="lucide:chevron-down"
class="text-item-2"
/>
</div>
- </div>
+ </UiElement>
</template>
diff --git a/app/components/wallets/page/List.vue b/app/components/wallets/page/List.vue
index 877ceab5..77e7ec00 100644
--- a/app/components/wallets/page/List.vue
+++ b/app/components/wallets/page/List.vue
@@ -298,7 +298,7 @@ const counts = computed(() => ({
</script>
<template>
- <UiPage class="@container/page">
+ <UiPage>
<UiHeader>
<UiHeaderTitle>{{ t('wallets.name') }}</UiHeaderTitle>
<template #actions>
@@ -334,22 +334,30 @@ const counts = computed(() => ({
class="max-w-4xl grow px-2 lg:px-4 2xl:px-8"
>
<div class="@xl/page:grid-cols-2 @xl/page:gap-12 grid max-w-3xl">
- <div class="@xl/page:order-1 @xl/page:gap-4 @xl/page:pt-1 grid content-start pt-2">
+ <div class="@xl/page:order-1 @xl/page:gap-4 @xl/page:pt-1 @md/page:pb-2 grid content-start pb-1">
<div
v-if="walletsStore.currenciesUsed.length > 1"
class="@xl/page:hidden grid grid-cols-2 gap-2 pb-2"
>
<!-- Currencies -->
- <UiBox3 @click="isShowCurrencyFilter = true">
- <UiTitle6>{{ t('filterByCurrency') }}</UiTitle6>
- {{ currencyFiltered === 'all' ? t('all') : currencyFiltered }}
- </UiBox3>
+ <UiItem2 @click="isShowCurrencyFilter = true">
+ <template #label>
+ {{ t('filterByCurrency') }}
+ </template>
+ <template #value>
+ {{ currencyFiltered === 'all' ? t('all') : currencyFiltered }}
+ </template>
+ </UiItem2>
<!-- Base -->
- <UiBox3 @click="isShowBaseCurrencyModal = true">
- <UiTitle6>{{ t('currencies.base') }}</UiTitle6>
- {{ currenciesStore.base }}
- </UiBox3>
+ <UiItem2 @click="isShowBaseCurrencyModal = true">
+ <template #label>
+ {{ t('currencies.base') }}
+ </template>
+ <template #value>
+ {{ currenciesStore.base }}
+ </template>
+ </UiItem2>
</div>
<!-- Wallets Currencies -->
@@ -416,49 +424,53 @@ const counts = computed(() => ({
/>
</UiToggle2>
- <UiBox3
- class="@xl/page:grid hidden"
+ <UiItem2
+ class="@xl/page:grid hidden grow"
@click="isShowBaseCurrencyModal = true"
>
- <UiTitle6>{{ t('currencies.base') }}</UiTitle6>
- {{ currenciesStore.base }}
- </UiBox3>
+ <template #label>
+ {{ t('currencies.base') }}
+ </template>
+ <template #value>
+ {{ currenciesStore.base }}
+ </template>
+ </UiItem2>
</div>
<div>
- <div class="@xl/page:pt-2 mb-2 flex items-center gap-2">
- <UiTabs1>
- <UiTabsItem1
+ <div class="mb-2 flex items-center gap-2">
+ <UiTabs2>
+ <UiTabsItem4
:isActive="groupedBy === 'list'"
@click="groupedBy = 'list'"
>
{{ t('list') }}
- </UiTabsItem1>
- <UiTabsItem1
+ </UiTabsItem4>
+ <UiTabsItem4
:isActive="groupedBy === 'type'"
@click="groupedBy = 'type'"
>
{{ t('type') }}
- </UiTabsItem1>
+ </UiTabsItem4>
- <UiTabsItem1
+ <UiTabsItem4
v-if="walletsStore.currenciesUsed.length > 1"
:isActive="groupedBy === 'currencies'"
@click="groupedBy = 'currencies'"
>
{{ t('currencies') }}
- </UiTabsItem1>
- </UiTabs1>
- <UiItem1
- v-if="groupedBy !== 'list'"
- class="grow-0 px-5"
- @click="groupedOptions[groupedBy] = groupedOptions[groupedBy] === 0 ? 1 : 0"
- >
- <Icon
- :name="groupedOptions[groupedBy] === 0 ? 'lucide:folder-tree' : 'lucide:network'"
- size="18"
- />
- </UiItem1>
+ </UiTabsItem4>
+ <UiTabsItem4
+ v-if="groupedBy !== 'list'"
+ class="ml-auto grow-0 px-5"
+ @click="groupedOptions[groupedBy] = groupedOptions[groupedBy] === 0 ? 1 : 0"
+ >
+ <Icon
+ :name="groupedOptions[groupedBy] === 0 ? 'lucide:folder-tree' : 'lucide:network'"
+ size="18"
+ />
+ </UiTabsItem4>
+ </UiTabs2>
</div>
<!-- Statistics -->
@@ -532,7 +544,7 @@ const counts = computed(() => ({
</div>
</template>
- <div class="ml-5 -translate-x-px border-l border-item-5 pl-3">
+ <div class="border-item-5 ml-5 -translate-x-px border-l pl-3">
<template v-if="groupedOptions.currencies === 0">
<WalletsItem
v-for="walletId in walletsIds"
@@ -574,7 +586,7 @@ const counts = computed(() => ({
</div>
</template>
- <div class="ml-5 -translate-x-px border-l border-item-5 pl-3">
+ <div class="border-item-5 ml-5 -translate-x-px border-l pl-3">
<WalletsItem
v-for="walletId in groupedWalletsIds"
:key="walletId"
@@ -622,7 +634,7 @@ const counts = computed(() => ({
</div>
</template>
- <div class="ml-5 -translate-x-px border-l border-item-5 pl-3">
+ <div class="border-item-5 ml-5 -translate-x-px border-l pl-3">
<template v-if="groupedOptions.type === 0">
<WalletsItem
v-for="walletId in walletsIds"
@@ -673,7 +685,7 @@ const counts = computed(() => ({
</div>
</template>
- <div class="ml-5 -translate-x-px border-l border-item-5 pl-3">
+ <div class="border-item-5 ml-5 -translate-x-px border-l pl-3">
<WalletsItem
v-for="walletId in groupedWalletsIds"
:key="walletId"
diff --git a/app/pages/settings.vue b/app/pages/settings.vue
index f4faa43c..4874181b 100644
--- a/app/pages/settings.vue
+++ b/app/pages/settings.vue
@@ -36,7 +36,7 @@ function onGenerateDemoData() {
<template>
<UiPage>
<UiHeader>
- <UiHeaderTitle>{{ t("settings.title") }}</UiHeaderTitle>
+ <UiHeaderTitle>{{ t('settings.title') }}</UiHeaderTitle>
</UiHeader>
<div class="pageWrapper bg-foreground-1 rounded-xl pt-4">
@@ -45,7 +45,7 @@ function onGenerateDemoData() {
<div class="pb-12">
<div class="grid gap-3">
<UiTitle3 class="pb-2">
- {{ t("settings.lang") }}
+ {{ t('settings.lang') }}
</UiTitle3>
<AppLocaleSwitcher />
</div>
@@ -54,7 +54,7 @@ function onGenerateDemoData() {
<!-- Theme -->
<div class="pb-12">
<UiTitle3 class="pb-2">
- {{ t("theme.title") }}
+ {{ t('theme.title') }}
</UiTitle3>
<AppThemeSwitcher
isShowSystem
@@ -78,7 +78,7 @@ function onGenerateDemoData() {
<!-- User -->
<div class="pb-12">
<UiTitle3 class="pb-2">
- {{ t("user") }}
+ {{ t('user') }}
</UiTitle3>
<div
v-if="userStore.user"
@@ -87,7 +87,7 @@ function onGenerateDemoData() {
{{ userStore.user?.email }}
</div>
<UiElement
- insideClasses="bg-item-3 min-h-[44px]"
+ insideClasses="bg-item-4 min-h-[44px]"
@click="userStore.signOut"
>
<template #leftIcon>
@@ -100,10 +100,10 @@ function onGenerateDemoData() {
<!-- Delete -->
<div class="pb-12">
<UiTitle3 class="pb-2">
- {{ t("settings.caution") }}
+ {{ t('settings.caution') }}
</UiTitle3>
<div class="text-item-2 pb-4 text-xs leading-none">
- {{ t("alerts.willDeleteEverything") }}
+ {{ t('alerts.willDeleteEverything') }}
</div>
<div class="grid gap-2 pb-4">
@@ -111,7 +111,7 @@ function onGenerateDemoData() {
v-if="isDemo"
:lineWidth="1"
class="group"
- insideClasses="min-h-[44px] bg-item-3"
+ insideClasses="min-h-[44px] bg-item-4"
@click="onGenerateDemoData"
>
<template #leftIcon>
@@ -123,7 +123,7 @@ function onGenerateDemoData() {
<UiElement
:lineWidth="1"
class="group"
- insideClasses="min-h-[44px] bg-item-3"
+ insideClasses="min-h-[44px] bg-item-4"
@click="confirmRemoveUserData = true"
>
<template #leftIcon>
@@ -137,9 +137,9 @@ function onGenerateDemoData() {
<!-- About -->
<div class="pb-12">
- {{ t("app.about") }}
+ {{ t('app.about') }}
<div class="text-item-2 pt-4 text-xs">
- {{ t("app.version") }} {{ version }}
+ {{ t('app.version') }} {{ version }}
</div>
</div>
</div>