Files
portal/app/resources/js/components/projects/ProjectCard.vue
T
Дмитрий 3fc90f12df feat(projects-ui): Quiet Luxury redesign for card-check + 5 dialog v-text-fields
ProjectCard.vue: replace 2px noir solid border on .card-check__box with
1px var(--liderra-line) idle / var(--liderra-line-strong) hover / var(--liderra-teal)
checked. Checked state uses tonal 10% teal bg instead of full fill. Size 20→16px.
Added :focus-visible outline for keyboard nav.

NewProjectDialog.vue: add a local .ld-input-quiet class to all 5 v-text-field
in the dialog (domain / phone / sms keyword / name / daily limit). The class
overrides v-field outline border-color through :deep() to use the tokens.css
1px line / line-strong / teal palette, and sets border-radius to var(--radius-8).
All variant/density/color values come from Vuetify global defaults in
plugins/vuetify.ts:50-54. Includes opacity:1 on every override to neutralize
Vuetify's --v-field-border-opacity 0.38 cascade, plus an explicit error-state
rule with border-color:currentColor to preserve Vuetify's red error border.

Twin elements left out of scope: .toolbar-check__box in ProjectsView.vue,
v-combobox/v-autocomplete/v-btn-toggle inside the same dialog, and the
filter-bar v-select inputs.

Spec: docs/superpowers/specs/2026-05-12-quiet-luxury-elements-1440-896-design.md
Plan: docs/superpowers/plans/2026-05-12-quiet-luxury-elements-1440-896.md

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 18:07:20 +03:00

182 lines
6.5 KiB
Vue

<template>
<v-card class="project-card ld-hover-lift" :class="{ paused: !project.is_active }" elevation="1">
<v-card-item>
<template #prepend>
<label class="card-check" data-testid="card-select">
<input
type="checkbox"
:checked="selected"
@change="$emit('toggle-select', project.id)"
/>
<span class="card-check__box" />
</label>
</template>
<v-card-title>
{{ project.name }}
<v-chip size="x-small" :color="typeColor" class="ml-2">{{ typeLabel }}</v-chip>
</v-card-title>
<v-card-subtitle>{{ identifierDisplay }}</v-card-subtitle>
<template #append>
<v-menu>
<template #activator="{ props: menuProps }">
<v-btn icon="mdi-dots-vertical" variant="text" size="small" v-bind="menuProps" />
</template>
<v-list density="compact">
<v-list-item @click="$emit('edit', project)">
<template #prepend><v-icon>mdi-pencil</v-icon></template>
<v-list-item-title>Редактировать</v-list-item-title>
</v-list-item>
<v-list-item @click="$emit('toggle-active', project)">
<template #prepend><v-icon>{{ project.is_active ? 'mdi-pause' : 'mdi-play' }}</v-icon></template>
<v-list-item-title>{{ project.is_active ? 'Приостановить' : 'Возобновить' }}</v-list-item-title>
</v-list-item>
<v-list-item @click="$emit('sync-now', project)">
<template #prepend><v-icon>mdi-refresh</v-icon></template>
<v-list-item-title>Синхронизировать</v-list-item-title>
</v-list-item>
<v-list-item @click="$emit('archive', project)">
<template #prepend><v-icon>mdi-archive</v-icon></template>
<v-list-item-title>Архивировать</v-list-item-title>
</v-list-item>
</v-list>
</v-menu>
</template>
</v-card-item>
<v-card-text>
<div v-if="project.is_active" class="mb-2">
<div class="d-flex justify-space-between">
<span class="text-caption"><span class="ld-mono">{{ project.delivered_today }}</span> / <span class="ld-mono">{{ project.daily_limit_target }}</span> лидов</span>
<span class="text-caption text-medium-emphasis"><span class="ld-mono">{{ progressPercent }}</span>%</span>
</div>
<v-progress-linear :model-value="progressPercent" :color="progressColor" height="6" rounded />
</div>
<div v-else class="text-caption text-medium-emphasis mb-2">На паузе</div>
<v-chip :color="syncStatusColor" size="x-small" variant="tonal">
<v-icon start size="x-small">{{ syncStatusIcon }}</v-icon>
{{ syncStatusLabel }}
</v-chip>
</v-card-text>
</v-card>
</template>
<script setup lang="ts">
import { computed } from 'vue';
interface Project {
id: number;
name: string;
signal_type: 'site' | 'call' | 'sms';
signal_identifier?: string | null;
sms_senders?: string[] | null;
sms_keyword?: string | null;
daily_limit_target: number;
delivered_today: number;
is_active: boolean;
archived_at: string | null;
sync_status: 'ok' | 'pending' | 'failed';
}
const props = defineProps<{ project: Project; selected: boolean }>();
defineEmits<{
'toggle-select': [id: number];
edit: [project: Project];
'toggle-active': [project: Project];
'sync-now': [project: Project];
archive: [project: Project];
}>();
const typeLabel = computed(
() => ({ site: 'Сайт', call: 'Звонок', sms: 'СМС' })[props.project.signal_type],
);
const typeColor = computed(
() =>
({ site: 'blue-lighten-4', call: 'orange-lighten-4', sms: 'purple-lighten-4' })[
props.project.signal_type
],
);
const identifierDisplay = computed(() => {
if (props.project.signal_type === 'sms') {
return [(props.project.sms_senders ?? []).join(', '), props.project.sms_keyword]
.filter(Boolean)
.join(' · ');
}
return props.project.signal_identifier ?? '';
});
const progressPercent = computed(() =>
Math.min(
100,
Math.round((props.project.delivered_today / props.project.daily_limit_target) * 100),
),
);
const progressColor = computed(() => (progressPercent.value >= 90 ? 'success' : 'primary'));
const syncStatusLabel = computed(
() => ({ ok: 'Sync OK', pending: 'Sync pending', failed: 'Sync failed' })[
props.project.sync_status
],
);
const syncStatusIcon = computed(
() => ({ ok: 'mdi-check-circle', pending: 'mdi-clock-outline', failed: 'mdi-alert-circle' })[
props.project.sync_status
],
);
const syncStatusColor = computed(
() => ({ ok: 'success', pending: 'warning', failed: 'error' })[props.project.sync_status],
);
</script>
<style scoped>
.project-card.paused {
opacity: 0.75;
}
.card-check {
display: inline-flex;
align-items: center;
cursor: pointer;
padding: 4px;
}
.card-check input {
position: absolute;
opacity: 0;
pointer-events: none;
}
.card-check__box {
width: 16px;
height: 16px;
border: 1px solid var(--liderra-line);
border-radius: var(--radius-6);
background: var(--liderra-surface);
display: inline-block;
position: relative;
transition:
border-color 200ms cubic-bezier(0.16, 1, 0.3, 1),
background-color 200ms cubic-bezier(0.16, 1, 0.3, 1);
}
.card-check:hover .card-check__box {
border-color: var(--liderra-line-strong);
}
.card-check input:focus-visible + .card-check__box {
outline: 2px solid var(--liderra-teal);
outline-offset: 2px;
}
.card-check input:checked + .card-check__box {
background: rgba(15, 110, 86, 0.10);
border-color: var(--liderra-teal);
}
.card-check input:checked + .card-check__box::after {
content: '';
position: absolute;
left: 4px;
top: 0;
width: 5px;
height: 9px;
border: solid var(--liderra-teal);
border-width: 0 1.5px 1.5px 0;
transform: rotate(45deg);
}
</style>