Move tabs and TabBar into UI package

This commit is contained in:
Gregor Vostrak
2026-03-23 17:25:26 +01:00
parent 5c6d84dc38
commit c19a0f9acc
35 changed files with 103 additions and 25 deletions

View File

@@ -20,7 +20,10 @@ import { useClientsQuery } from '@/utils/useClientsQuery';
import { getOrganizationCurrencyString } from '@/utils/money';
import { isAllowedToPerformPremiumAction } from '@/utils/billing';
import { canCreateProjects } from '@/utils/permissions';
import { useOrganizationQuery } from '@/utils/useOrganizationQuery';
import { getCurrentOrganizationId } from '@/utils/useUser';
const { organization } = useOrganizationQuery(getCurrentOrganizationId()!);
const searchValue = ref('');
const searchInput = ref<HTMLElement | null>(null);
const model = defineModel<string | null>({
@@ -156,6 +159,7 @@ function updateValue(project: Project) {
:create-client="handleCreateClient"
:clients="activeClients"
:currency="getOrganizationCurrencyString()"
:organization-billable-rate="organization?.billable_rate ?? null"
:enable-estimated-time="isAllowedToPerformPremiumAction()" />
</template>

View File

@@ -20,9 +20,12 @@ import ProjectBillableRateModal from '@/packages/ui/src/Project/ProjectBillableR
import { getOrganizationCurrencyString } from '@/utils/money';
import ProjectEditBillableSection from '@/packages/ui/src/Project/ProjectEditBillableSection.vue';
import { isAllowedToPerformPremiumAction } from '@/utils/billing';
import { useOrganizationQuery } from '@/utils/useOrganizationQuery';
import { getCurrentOrganizationId } from '@/utils/useUser';
const { updateProject } = useProjectsStore();
const { clients } = useClientsQuery();
const { organization } = useOrganizationQuery(getCurrentOrganizationId()!);
const show = defineModel('show', { default: false });
const saving = ref(false);
const showBillableRateModal = ref(false);
@@ -117,6 +120,7 @@ async function submitBillableRate() {
v-model:is-billable="project.is_billable"
v-model:billable-rate="project.billable_rate"
:currency="getOrganizationCurrencyString()"
:organization-billable-rate="organization?.billable_rate ?? null"
@submit="submit"></ProjectEditBillableSection>
<EstimatedTimeSection
v-if="isAllowedToPerformPremiumAction()"

View File

@@ -22,6 +22,8 @@ import { useClientsStore } from '@/utils/useClients';
import { useClientsQuery } from '@/utils/useClientsQuery';
import { getOrganizationCurrencyString } from '@/utils/money';
import { isAllowedToPerformPremiumAction } from '@/utils/billing';
import { useOrganizationQuery } from '@/utils/useOrganizationQuery';
import { getCurrentOrganizationId } from '@/utils/useUser';
import {
useVueTable,
getCoreRowModel,
@@ -29,6 +31,8 @@ import {
type SortingState,
} from '@tanstack/vue-table';
const { organization } = useOrganizationQuery(getCurrentOrganizationId()!);
const props = defineProps<{
projects: Project[];
showBillableRate: boolean;
@@ -155,6 +159,7 @@ const gridTemplate = computed(() => {
:create-project
:create-client
:currency="getOrganizationCurrencyString()"
:organization-billable-rate="organization?.billable_rate ?? null"
:clients="clients"
:enable-estimated-time="isAllowedToPerformPremiumAction()"></ProjectCreateModal>
<div class="flow-root max-w-[100vw] overflow-x-auto">

View File

@@ -2,8 +2,7 @@
import { router } from '@inertiajs/vue3';
import { canViewReport } from '@/utils/permissions';
import { computed } from 'vue';
import TabBar from '@/Components/Common/TabBar/TabBar.vue';
import TabBarItem from '@/Components/Common/TabBar/TabBarItem.vue';
import { TabBar, TabBarItem } from '@/packages/ui/src';
const props = defineProps<{
active: 'reporting' | 'detailed' | 'shared';

View File

@@ -1,17 +0,0 @@
<script setup lang="ts">
import { Tabs, TabsList } from '@/Components/ui/tabs';
defineProps<{
defaultValue?: string;
}>();
</script>
<template>
<Tabs :default-value="defaultValue" class="w-full">
<TabsList class="flex items-center space-x-0.5 sm:space-x-1">
<slot></slot>
</TabsList>
</Tabs>
</template>
<style scoped></style>

View File

@@ -1,27 +0,0 @@
<script setup lang="ts">
import { TabsTrigger } from '@/Components/ui/tabs';
import { twMerge } from 'tailwind-merge';
import type { Component } from 'vue';
const props = defineProps<{
value: string;
class?: string;
icon?: Component;
}>();
</script>
<template>
<TabsTrigger
:value="value"
:icon="icon"
:class="
twMerge(
'rounded-md px-2 sm:px-3 border py-1.5 text-xs sm:text-sm font-medium text-text-tertiary hover:text-text-primary focus-visible:outline-none data-[state=active]:bg-tab-background data-[state=active]:border-input-border data-[state=active]:text-text-primary border-tab-border',
props.class
)
">
<slot></slot>
</TabsTrigger>
</template>
<style scoped></style>