Open source personal finance application
feat(ui): enhance button components with tooltips and adjust layout spacing
Ilya Komichev2b0ac46f0267
diff --git a/app/components/filter/Selector.vue b/app/components/filter/Selector.vueindex c941e62c..9d2877f3 100644--- a/app/components/filter/Selector.vue+++ b/app/components/filter/Selector.vue@@ -16,7 +16,7 @@ const modals = ref({</script><template>- <div class="flex">+ <div class="flex gap-1"><BottomSheetOrDropdownv-if="props.isShowCategories":title="t('categories.filter')"@@ -26,9 +26,17 @@ const modals = ref({@onCloseModal="modals.categories = false"><template #trigger>- <UiItem1>- <Icon name="hugeicons:folder-library" size="20" />- </UiItem1>+ <UTooltip :text="t('categories.filter')">+ <UButton+ :aria-label="t('categories.filter')"+ class="text-muted"+ color="neutral"+ icon="hugeicons:folder-library"+ size="lg"+ square+ variant="ghost"+ />+ </UTooltip></template><template #custom="{ close }">@@ -61,9 +69,17 @@ const modals = ref({@onCloseModal="modals.wallets = false"><template #trigger>- <UiItem1>- <Icon name="hugeicons:wallet-01" size="20" />- </UiItem1>+ <UTooltip :text="t('wallets.filter')">+ <UButton+ :aria-label="t('wallets.filter')"+ class="text-muted"+ color="neutral"+ icon="hugeicons:wallet-01"+ size="lg"+ square+ variant="ghost"+ />+ </UTooltip></template><template #custom="{ close }">diff --git a/app/components/locale/Switcher.vue b/app/components/locale/Switcher.vueindex 70d5787a..5ecaa260 100644--- a/app/components/locale/Switcher.vue+++ b/app/components/locale/Switcher.vue@@ -46,28 +46,19 @@ function changeLocale(locale: LocaleSlug) {/></template>- <UButton- v-else- icon="lucide:languages"- color="neutral"- variant="ghost"- square- aria-label="Locale switcher"- size="lg"- @click="changeLocale(locale === 'ru' ? 'en' : 'ru')"- />+ <template v-else>+ <UTooltip :text="t('locale.title')">+ <UButton+ :aria-label="t('locale.title')"+ class="text-muted"+ color="neutral"+ icon="lucide:languages"+ size="lg"+ square+ variant="ghost"+ @click="changeLocale(locale === 'ru' ? 'en' : 'ru')"+ />+ </UTooltip>+ </template></div></template>--<i18n lang="yaml">-en:- locale:- en: 'English'- ru: 'Русский'- title: 'Language'-ru:- locale:- en: 'English'- ru: 'Русский'- title: 'Язык'-</i18n>diff --git a/app/components/stat/ConfigModal.vue b/app/components/stat/ConfigModal.vueindex ecb6bc1d..0235ae3a 100644--- a/app/components/stat/ConfigModal.vue+++ b/app/components/stat/ConfigModal.vue@@ -38,9 +38,17 @@ function updateStatAverage(value: number) {@onCloseModal="props.statConfigModal.close"><template #trigger>- <UiItem1>- <Icon name="lucide:settings-2" size="20" />- </UiItem1>+ <UTooltip :text="t('stat.config.menu.label')">+ <UButton+ :aria-label="t('stat.config.menu.label')"+ class="text-muted"+ color="neutral"+ icon="lucide:settings-2"+ size="lg"+ square+ variant="ghost"+ />+ </UTooltip></template><template #content="{ close }">diff --git a/app/components/stat/Header.vue b/app/components/stat/Header.vueindex bd91daf6..a6c6a595 100644--- a/app/components/stat/Header.vue+++ b/app/components/stat/Header.vue@@ -56,7 +56,7 @@ const statConfigModal: Ref<StatConfigModal> = ref({<template #actions><divv-if="props.filter || props.config"- class="ml-auto flex items-center"+ class="ml-auto flex items-center gap-1"><FilterSelectorv-if="props.filter"diff --git a/app/components/stat/Item.vue b/app/components/stat/Item.vueindex 727de560..654ff557 100644--- a/app/components/stat/Item.vue+++ b/app/components/stat/Item.vue@@ -296,7 +296,7 @@ function getIntervalsData(trnsIds: TrnId[], intervalsInRange: Range[]) {<div:class="{- 'grid @3xl/page:grid-cols-2 @3xl/page:gap-6 gap-3': props.statTab !== 'split' && statConfig.config.value.catsList.isShow,+ 'grid @3xl/page:grid-cols-2 @3xl/page:gap-6 gap-5': props.statTab !== 'split' && statConfig.config.value.catsList.isShow,}"><StatCategoriesSection2@@ -311,11 +311,11 @@ function getIntervalsData(trnsIds: TrnId[], intervalsInRange: Range[]) {/><StatTrns- class="@3xl/page:order-1"+ :isPeriodOneDay="isPeriodOneDay":selectedTrnsIds="selectedAndFilteredTrnsIds":storageKey="newBaseStorageKey":type="props.type ?? 'netIncome'"- :isPeriodOneDay="isPeriodOneDay"+ class="@3xl/page:order-1"/></div></div>diff --git a/app/components/stat/Trns.vue b/app/components/stat/Trns.vueindex a08291e6..32eec80d 100644--- a/app/components/stat/Trns.vue+++ b/app/components/stat/Trns.vue@@ -20,6 +20,7 @@ defineProps<{isShowExpenseisShowFilterByDescisShowIncome+ isShowHeaderisShowTransfers/>diff --git a/app/components/theme/Picker.vue b/app/components/theme/Picker.vueindex 2050780d..deb11956 100644--- a/app/components/theme/Picker.vue+++ b/app/components/theme/Picker.vue@@ -65,14 +65,17 @@ function setBlackAsPrimary(value: boolean) {:ui="{ content: 'w-72 px-6 py-4 flex flex-col gap-4' }"><template #default="{ open }">- <UButton- icon="i-lucide-swatch-book"- color="neutral"- :variant="open ? 'soft' : 'ghost'"- square- aria-label="Theme picker"- size="lg"- />+ <UTooltip :text="t('theme.color')">+ <UButton+ :aria-label="t('theme.color')"+ :variant="open ? 'soft' : 'ghost'"+ color="neutral"+ class="text-muted"+ icon="i-lucide-swatch-book"+ size="lg"+ square+ />+ </UTooltip></template><template #content>@@ -157,22 +160,24 @@ function setBlackAsPrimary(value: boolean) {</UPopover></template>-<i18n yaml>+<i18n lang="yaml">en:- light: Lightdark: Dark- system: System- primary: Primary color+ light: Lightneutral: Neutral color+ picker: Theme picker+ primary: Primary colorradius: Radius+ system: Systemtheme: Themeru:- light: Светлаяdark: Темная- system: Системная- primary: Основной цвет+ light: Светлаяneutral: Нейтральный цвет+ picker: Выбор темы+ primary: Основной цветradius: Радиус+ system: Системнаяtheme: Тема</i18n>diff --git a/app/components/theme/Switcher.vue b/app/components/theme/Switcher.vueindex 91b6dd4d..21c6b7ec 100644--- a/app/components/theme/Switcher.vue+++ b/app/components/theme/Switcher.vue@@ -28,17 +28,19 @@ const { options, preference, setTheme } = useTheme()/></template>- <UButton- v-else- :icon="colorMode.value === 'light' ? 'lucide:sun' : 'lucide:moon'"- color="neutral"- variant="ghost"- square- aria-label="Theme switcher"- size="lg"- @click="setTheme(colorMode.value === 'light' ? 'dark' : 'light')"- />+ <template v-else>+ <UTooltip :text="t('theme.title')">+ <UButton+ :aria-label="t('theme.title')"+ :icon="colorMode.value === 'light' ? 'lucide:sun' : 'lucide:moon'"+ class="text-muted"+ color="neutral"+ size="lg"+ square+ variant="ghost"+ @click="setTheme(colorMode.value === 'light' ? 'dark' : 'light')"+ />+ </UTooltip>+ </template></div></template>--<i18n lang="yaml" src="./locale.yaml" />diff --git a/app/components/theme/locale.yaml b/app/components/theme/locale.yamldeleted file mode 100644index b567cdd4..00000000--- a/app/components/theme/locale.yaml+++ /dev/null@@ -1,15 +0,0 @@-en:- theme:- change: Change theme- dark: Dark- light: Light- select: Select theme- system: System--ru:- theme:- change: Сменить тему- dark: Темная- light: Светлая- select: Выберите тему- system: Автоdiff --git a/app/components/trns/List.vue b/app/components/trns/List.vueindex 2908a25d..2afd1be8 100644--- a/app/components/trns/List.vue+++ b/app/components/trns/List.vue@@ -172,9 +172,9 @@ function onOpenTrnForm(date: number) {:paginatedTrnsIds:selectedIds>- <UiTitle3 class="pb-2 pl-1">+ <UiTitle8 isHideArrow>{{ t('trns.title') }} {{ selectedIds.length > 0 ? selectedIds.length : '' }}- </UiTitle3>+ </UiTitle8></slot><slot name="contentBefore" />diff --git a/app/components/trns/pages/History.vue b/app/components/trns/pages/History.vueindex a7cf9abc..ee6c2585 100644--- a/app/components/trns/pages/History.vue+++ b/app/components/trns/pages/History.vue@@ -65,7 +65,7 @@ watch([filter.categoriesIds, filter.walletsIds], () => {</template></UiHeader>- <div class="pageWrapper mb-4 rounded-xl bg-default pb-4 pt-3">+ <div class="pageWrapper mb-4 rounded-xl bg-default pb-4 pt-1"><div class="grid gap-3 @3xl/main:max-w-md"><TrnsList:trnsIds@@ -74,7 +74,6 @@ watch([filter.categoriesIds, filter.walletsIds], () => {isShowFilterByDescisShowFilterByTypeisShowGroupSum- isShowHeaderisShowIncomeisShowTransfers/>diff --git a/app/components/ui/Tabs1.global.vue b/app/components/ui/Tabs1.global.vueindex 5780cdd2..4f896ea1 100644--- a/app/components/ui/Tabs1.global.vue+++ b/app/components/ui/Tabs1.global.vue@@ -1,5 +1,5 @@<template>- <div class="flex grow items-center overflow-hidden overflow-x-auto rounded-md bg-[var(--item-3)]">+ <div class="flex grow items-center overflow-hidden overflow-x-auto rounded bg-[var(--item-3)]"><slot /></div></template>diff --git a/app/components/ui/TabsItem1.vue b/app/components/ui/TabsItem1.vueindex f04fc9e6..e895eb82 100644--- a/app/components/ui/TabsItem1.vue+++ b/app/components/ui/TabsItem1.vue@@ -1,7 +1,9 @@<script setup lang="ts">-import { getStyles } from '~/components/ui/getStyles'+import { cn } from '~~/lib/cn'-defineProps<{+import { classes } from '~/components/ui/getStyles'++const props = defineProps<{isActive?: boolean}>()@@ -10,10 +12,11 @@ const emit = defineEmits(['click'])<template><div- :class="[getStyles('item', ['minh3']), {- '!bg-item-4': isActive,- }]"- class="flex flex-1 grow select-none items-center justify-center gap-1 text-nowrap rounded-lg px-2 text-sm text-3 hover:bg-[var(--item-5)]"+ :class="cn(+ 'flex flex-1 grow select-none items-center justify-center gap-1 text-nowrap rounded px-2 text-sm text-3 hover:bg-[var(--item-5)]',+ [classes.item.minh3],+ props.isActive && 'bg-item-4',+ )"@click="emit('click')"><slot />diff --git a/app/components/ui/Title8.vue b/app/components/ui/Title8.vueindex 14bf4c2e..96ab6ede 100644--- a/app/components/ui/Title8.vue+++ b/app/components/ui/Title8.vue@@ -1,7 +1,10 @@<script setup lang="ts">-import { getStyles } from '~/components/ui/getStyles'+import { cn } from '~~/lib/cn'++import { classes } from '~/components/ui/getStyles'const props = defineProps<{+ isHideArrow?: booleanisOpen?: booleanisShown?: boolean}>()@@ -12,13 +15,16 @@ const emit = defineEmits<{<template><div- :class="getStyles('item', ['link', 'center', 'padding3', 'minh2', 'minw1', 'rounded'])"- class="flex grow items-center gap-2 pb-0 !font-tertiary !text-base font-semibold leading-none tracking-wide"+ :class="cn(+ [classes.item.center, classes.item.padding3, classes.item.minh2, classes.item.minw1, classes.item.rounded],+ 'flex grow items-center gap-2 pb-0 !font-tertiary !text-base font-semibold leading-none tracking-wide',+ !props.isHideArrow && [classes.item.link],+ )"@click="emit('click')"><div><slot /></div><Icon- v-if="!props.isShown"+ v-if="!props.isHideArrow && !props.isShown"name="lucide:chevron-left"size="22"class="-ml-1"diff --git a/app/layouts/default.vue b/app/layouts/default.vueindex 08902650..48b804c4 100644--- a/app/layouts/default.vue+++ b/app/layouts/default.vue@@ -89,7 +89,7 @@ usePageScroll()'sm:pl-74 md:pl-74': isShowSidebar && width >= 767,}">- <div class="relative h-full overflow-hidden sm:rounded-2xl bg-default sm:border sm:border-item-4 max-w-5xl">+ <div class="relative h-full overflow-hidden sm:rounded-md lg:rounded-2xl bg-default sm:border sm:border-item-4 max-w-5xl"><mainid="pageScroll"style="padding-bottom: calc(50px + env(safe-area-inset-bottom))"diff --git a/app/pages/login.vue b/app/pages/login.vueindex 04140431..4453d328 100644--- a/app/pages/login.vue+++ b/app/pages/login.vue@@ -69,16 +69,19 @@ async function openDemo() {<LocaleSwitcher /><ThemeSwitcher /><ThemePicker />- <UButton- icon="mdi:github"- color="neutral"- variant="ghost"- square- aria-label="GitHub"- to="https://github.com/ilkome/finapp"- target="_blank"- size="lg"- />+ <UTooltip text="GitHub">+ <UButton+ aria-label="GitHub"+ class="text-muted"+ color="neutral"+ icon="mdi:github"+ size="lg"+ square+ target="_blank"+ to="https://github.com/ilkome/finapp"+ variant="ghost"+ />+ </UTooltip></div><divdiff --git a/app/pages/settings.vue b/app/pages/settings.vueindex a3a627ce..ab8fcb0c 100644--- a/app/pages/settings.vue+++ b/app/pages/settings.vue@@ -38,14 +38,14 @@ function onGenerateDemoData() {<UiHeader><UiHeaderTitle>{{ t('settings.title') }}</UiHeaderTitle>- <div class="flex items-center gap-3">+ <div class="flex items-center gap-1"><ThemeSwitcher /><ThemePicker /></div></UiHeader><div class="pageWrapper">- <div class="grid gap-8 @3xl/main:max-w-md">+ <div class="grid gap-8 @3xl/main:max-w-md pt-2"><!-- User --><div class="pb-6"><UserViewLogout isShowSignOut />diff --git a/i18n/locales/en-US.js b/i18n/locales/en-US.jsindex ac0d6a6d..c45f2c72 100644--- a/i18n/locales/en-US.js+++ b/i18n/locales/en-US.js@@ -183,7 +183,9 @@ export default {},locale: {- toggle: 'Toggle locale',+ en: 'English',+ ru: 'Russian',+ title: 'Language',},loginWithGithub: 'Login with Github',@@ -324,7 +326,11 @@ export default {},theme: {- change: 'Change theme',+ color: 'Change theme color',+ dark: 'Dark',+ light: 'Light',+ select: 'Select theme',+ system: 'System',title: 'Theme',},diff --git a/i18n/locales/ru-RU.js b/i18n/locales/ru-RU.jsindex 13fbc6f4..c26cc025 100644--- a/i18n/locales/ru-RU.js+++ b/i18n/locales/ru-RU.js@@ -181,7 +181,9 @@ export default {},locale: {- toggle: 'Сменить язык',+ en: 'Английский',+ ru: 'Русский',+ title: 'Язык',},loginWithGithub: 'Войти через Github',@@ -326,7 +328,11 @@ export default {},theme: {- change: 'Сменить цвет оформления',+ color: 'Сменить цвет оформления',+ dark: 'Темная',+ light: 'Светлая',+ select: 'Выберите тему',+ system: 'Авто',title: 'Тема',},