[feat] negodata/front: 디자인 리뉴얼 1차 — 인디고 콘솔 토큰·⌘K 크롬·대시보드/로그인/알림함 개편, 툴바 통일, 시트 스크롤 수정

This commit is contained in:
minaChoi committed 2026-07-16 16:24:40 +09:00
1 parent 3d515055fb
commit 25e13d7b01
20 files changed
+805 -580

No files matched your search

@@ -1,72 +0,0 @@
import type { ElementType, ReactNode } from 'react';
import { Card, CardContent } from '@/components/ui/card';
import { Badge } from '@/components/ui/badge';
import { Typography } from '@/components/ui/typography';
import { cn } from '@/lib/utils';
import { TONE_CHIP, type Tone } from '../tones';
// 대시보드 액션 위젯 공용 셸: 컬러 아이콘칩·제목·total 배지·빈상태. 본문(행 목록)은 children 으로 받는다.
export function ActionWidget({
title,
icon: Icon,
tone,
total,
empty,
emptyText = '처리할 항목 없음',
children,
}: {
title: string;
icon: ElementType;
tone: Tone;
total: number;
empty: boolean;
emptyText?: string;
children: ReactNode;
}) {
return (
<Card className="gap-3 py-4">
<CardContent className="space-y-2.5 px-4">
<div className="flex items-center justify-between">
<div className="flex items-center gap-2">
<span className={cn('flex size-7 items-center justify-center rounded-lg', TONE_CHIP[tone])}>
<Icon size={15} />
</span>
<Typography variant="h4" className="text-base">
{title}
</Typography>
</div>
<Badge variant="secondary">{total}</Badge>
</div>
{empty ? (
<Typography variant="muted">{emptyText}</Typography>
) : (
<div className="-mx-1.5 space-y-0.5">{children}</div>
)}
</CardContent>
</Card>
);
}
// 위젯 안의 클릭 가능한 행(견적 1건 → 상세 딥링크). 우측 슬롯에 D-n·미발송 배지 등을 건다.
export function ActionRow({
name,
right,
onClick,
}: {
name?: string;
right?: ReactNode;
onClick: () => void;
}) {
return (
<button
type="button"
onClick={onClick}
className="flex w-full cursor-pointer items-center justify-between gap-2 rounded-md px-1.5 py-1.5 text-left transition-colors hover:bg-muted/60"
>
<Typography variant="small" className="truncate">
{name || '(이름 없음)'}
</Typography>
{right}
</button>
);
}
@@ -1,26 +1,23 @@
import { HelpCircle } from 'lucide-react';
import { Button } from '@/components/ui/button';
import { Badge } from '@/components/ui/badge';
import { Typography } from '@/components/ui/typography';
import { useAuth } from '@/features/auth/useAuth';
// 대시보드 상단 환영 배너. 제품 소개는 온보딩(이용안내 모달)이 맡고, 여기선 누구의/어느 회사 대시보드인지만 보여준다.
// 배지=현재 로그인 회사, 제목=사용자 이름 인사. 목업의 그라데이션 대신 primary 틴트 패널로 절제.
// 대시보드 상단 인사 행. 제품 소개는 온보딩(이용안내 모달)이 맡고, 여기선 인사+안내 진입점만 —
// 배너/그라데이션 없이 텍스트가 위계를 만든다(시안 1 "인디고 콘솔" 문법). 회사명은 헤더가 이미 보여줘 생략.
export function DashboardHero({ onOpenGuide }: { onOpenGuide: () => void }) {
const { user } = useAuth();
const name = user?.name?.trim();
const company = user?.company?.trim();
return (
<div className="flex flex-col gap-4 rounded-xl border border-primary/20 bg-primary/5 p-6 md:flex-row md:items-center md:justify-between">
<div className="space-y-2">
{company && <Badge>{company}</Badge>}
<Typography variant="h2">{name ? `${name}님, 환영합니다` : '환영합니다'}</Typography>
<Typography variant="muted" className="max-w-2xl">
견적 생성부터 초청메일·협상·마감·낙찰까지, 지금 처리할 일을 아래에서 한눈에 봅니다.
<div className="flex items-center justify-between gap-4">
<div className="min-w-0">
<Typography variant="h3" as="h1">{name ? `${name}님, 환영합니다` : '환영합니다'}</Typography>
<Typography variant="muted" className="mt-0.5 text-[13px]">
견적 생성부터 초청메일·협상·마감·낙찰까지, 지금 처리할 일을 한눈에 봅니다.
</Typography>
</div>
<Button variant="outline" onClick={onOpenGuide} className="shrink-0">
<Button variant="outline" size="sm" onClick={onOpenGuide} className="shrink-0">
<HelpCircle />
이용안내
</Button>
@@ -1,28 +0,0 @@
import { Clock } from 'lucide-react';
import { Badge } from '@/components/ui/badge';
import type { DashboardActionList } from '@/api/generated/model/dashboardActionList';
import { ActionWidget, ActionRow } from './ActionWidget';
import { fmtDeadline } from '../fmt';
// 마감 임박: 견적명 + 우측에 마감 D-n.
export function DeadlineWidget({
data,
onOpen,
}: {
data?: DashboardActionList;
onOpen: (qtId: string) => void;
}) {
const items = data?.items ?? [];
return (
<ActionWidget title="마감 임박" icon={Clock} tone="amber" total={data?.total ?? 0} empty={items.length === 0}>
{items.map((it) => (
<ActionRow
key={it.qt_id}
name={it.name}
onClick={() => onOpen(it.qt_id)}
right={<Badge variant="outline">{fmtDeadline(it.end_time)}</Badge>}
/>
))}
</ActionWidget>
);
}
@@ -1,27 +0,0 @@
import { Mail } from 'lucide-react';
import { Badge } from '@/components/ui/badge';
import type { DashboardEmailUnsent } from '@/api/generated/model/dashboardEmailUnsent';
import { ActionWidget, ActionRow } from './ActionWidget';
// 메일 미발송: 견적 단위로 묶고 우측에 미발송 협력사 수. 발송 전엔 협상이 시작 안 되므로 미발송 수는 destructive 배지.
export function EmailUnsentWidget({
data,
onOpen,
}: {
data?: DashboardEmailUnsent;
onOpen: (qtId: string) => void;
}) {
const items = data?.quotations ?? [];
return (
<ActionWidget title="메일 미발송" icon={Mail} tone="rose" total={data?.total ?? 0} empty={items.length === 0}>
{items.map((it) => (
<ActionRow
key={it.qt_id}
name={it.name}
onClick={() => onOpen(it.qt_id)}
right={<Badge variant="destructive">미발송 {it.unsent_count ?? 0}곳</Badge>}
/>
))}
</ActionWidget>
);
}
@@ -0,0 +1,25 @@
import { Card } from '@/components/ui/card';
import { Typography } from '@/components/ui/typography';
import { cn } from '@/lib/utils';
// KPI 숫자 스트립(시안 1 "인디고 콘솔" 문법) — 카드 하나에 칸을 보더로 나눠 숫자만 크게.
// alert 지표는 값이 0보다 클 때만 destructive 로 강조한다.
export function KpiStrip({ items }: { items: { label: string; value: number; alert?: boolean }[] }) {
return (
<Card className="grid grid-cols-2 gap-0 overflow-hidden py-0 sm:grid-cols-4 sm:divide-x sm:divide-border/70">
{items.map((it) => (
<div key={it.label} className="px-4 py-3">
<Typography variant="caption" className="block">
{it.label}
</Typography>
<Typography
variant="h3"
className={cn('mt-0.5 leading-none tabular-nums', it.alert && it.value > 0 && 'text-destructive')}
>
{it.value}
</Typography>
</div>
))}
</Card>
);
}
@@ -1,39 +0,0 @@
import type { ElementType } from 'react';
import { Card, CardContent } from '@/components/ui/card';
import { Typography } from '@/components/ui/typography';
import { cn } from '@/lib/utils';
import { TONE_CHIP, type Tone } from '../tones';
// 대시보드 KPI 숫자 타일. 컬러 아이콘칩 + 값 + 라벨. warn 지표는 값이 0보다 클 때만 숫자를 destructive 로 강조한다.
export function KpiTile({
label,
value,
icon: Icon,
tone,
alertWhenPositive,
}: {
label: string;
value: number;
icon: ElementType;
tone: Tone;
alertWhenPositive?: boolean;
}) {
const alert = !!alertWhenPositive && value > 0;
return (
<Card className="gap-0 py-0">
<CardContent className="flex items-center gap-3 px-4 py-3.5">
<div className={cn('flex size-9 shrink-0 items-center justify-center rounded-lg', TONE_CHIP[tone])}>
<Icon size={18} />
</div>
<div className="min-w-0 space-y-0.5">
<Typography variant="h3" className={cn('leading-none', alert && 'text-destructive')}>
{value}
</Typography>
<Typography variant="caption" className="block truncate">
{label}
</Typography>
</div>
</CardContent>
</Card>
);
}
@@ -1,37 +0,0 @@
import type { ElementType } from 'react';
import type { DashboardActionList } from '@/api/generated/model/dashboardActionList';
import { ActionWidget, ActionRow } from './ActionWidget';
import type { Tone } from '../tones';
// 동가 / 결렬: 견적명만 나열(수동 확인 대상). 제목·아이콘·톤은 호출부에서 지정.
export function RefWidget({
title,
icon,
tone,
data,
onOpen,
emptyText,
}: {
title: string;
icon: ElementType;
tone: Tone;
data?: DashboardActionList;
onOpen: (qtId: string) => void;
emptyText?: string;
}) {
const items = data?.items ?? [];
return (
<ActionWidget
title={title}
icon={icon}
tone={tone}
total={data?.total ?? 0}
empty={items.length === 0}
emptyText={emptyText}
>
{items.map((it) => (
<ActionRow key={it.qt_id} name={it.name} onClick={() => onOpen(it.qt_id)} />
))}
</ActionWidget>
);
}
@@ -1,14 +1,9 @@
import { Activity, CalendarPlus, Award, Ban } from 'lucide-react';
import { Typography } from '@/components/ui/typography';
import type { DashboardScope } from '@/api/generated/model/dashboardScope';
import { KpiTile } from './KpiTile';
import { DeadlineWidget } from './DeadlineWidget';
import { EmailUnsentWidget } from './EmailUnsentWidget';
import { RefWidget } from './RefWidget';
import { KpiStrip } from './KpiStrip';
import { WorkTable } from './WorkTable';
// 스코프 1개(회사 전체 / 내 견적) 블록: 라벨 + 요약 KPI + 액션 위젯.
// KPI = 리스트 없는 순수 지표만.
// 위젯 = 관리자가 직접 처리해야 하는 것만.
// 스코프 1개(회사 전체 / 내 견적) 블록: 섹션 라벨 + KPI 스트립 + 처리 필요 테이블(시안 1 문법).
export function ScopeSection({
label,
scope,
@@ -19,24 +14,22 @@ export function ScopeSection({
onOpen: (qtId: string) => void;
}) {
const s = scope ?? {};
const pending =
(s.deadline_soon?.total ?? 0) + (s.email_unsent?.total ?? 0) + (s.ruptured?.total ?? 0);
return (
<div className="space-y-3">
<div className="flex items-center gap-2">
<span className="h-4 w-1 rounded bg-primary" />
<Typography variant="h3">{label}</Typography>
</div>
<div className="grid grid-cols-1 gap-3 sm:grid-cols-3">
<KpiTile label="진행중" value={s.in_progress ?? 0} icon={Activity} tone="blue" />
<KpiTile label="이번 달 생성" value={s.this_month ?? 0} icon={CalendarPlus} tone="purple" />
<KpiTile label="누적 낙찰" value={s.awarded?.total ?? 0} icon={Award} tone="emerald" />
</div>
<div className="grid gap-3 sm:grid-cols-2 lg:grid-cols-3">
<DeadlineWidget data={s.deadline_soon} onOpen={onOpen} />
<EmailUnsentWidget data={s.email_unsent} onOpen={onOpen} />
<RefWidget title="개찰 (낙찰자 미정 마감)" icon={Ban} tone="amber" data={s.ruptured} onOpen={onOpen} />
</div>
</div>
<section className="space-y-3">
<Typography variant="label" className="block text-muted-foreground">
{label}
</Typography>
<KpiStrip
items={[
{ label: '진행중', value: s.in_progress ?? 0 },
{ label: '이번 달 생성', value: s.this_month ?? 0 },
{ label: '누적 낙찰', value: s.awarded?.total ?? 0 },
{ label: '처리 필요', value: pending, alert: true },
]}
/>
<WorkTable scope={s} onOpen={onOpen} />
</section>
);
}
@@ -0,0 +1,82 @@
import { CheckCircle2 } from 'lucide-react';
import { Card } from '@/components/ui/card';
import { Badge } from '@/components/ui/badge';
import { Typography } from '@/components/ui/typography';
import { cn } from '@/lib/utils';
import type { DashboardScope } from '@/api/generated/model/dashboardScope';
import { fmtDeadline } from '../fmt';
type WorkRow = { qtId: string; name?: string; dot: string; kind: string; meta: string };
// "처리 필요 견적" 단일 테이블(시안 1 문법) — 마감 임박·메일 미발송·개찰을 한 목록으로 합치고
// 유형은 컬러 도트+라벨로 구분한다. 행 클릭 = 견적 상세 딥링크.
export function WorkTable({ scope, onOpen }: { scope: DashboardScope; onOpen: (qtId: string) => void }) {
const rows: WorkRow[] = [
...(scope.deadline_soon?.items ?? []).map((it) => ({
qtId: it.qt_id,
name: it.name,
dot: 'bg-warning',
kind: '마감 임박',
meta: fmtDeadline(it.end_time),
})),
...(scope.email_unsent?.quotations ?? []).map((it) => ({
qtId: it.qt_id,
name: it.name,
dot: 'bg-destructive',
kind: '메일 발송 필요',
meta: `미발송 ${it.unsent_count ?? 0}곳`,
})),
...(scope.ruptured?.items ?? []).map((it) => ({
qtId: it.qt_id,
name: it.name,
dot: 'bg-muted-foreground/50',
kind: '개찰',
meta: '낙찰자 미정',
})),
];
const total =
(scope.deadline_soon?.total ?? 0) + (scope.email_unsent?.total ?? 0) + (scope.ruptured?.total ?? 0);
return (
<Card className="gap-0 overflow-hidden py-0">
<div className="flex items-center justify-between gap-2 border-b border-border/70 px-4 py-3">
<Typography variant="h4" className="text-sm">
처리 필요 견적
</Typography>
<Badge variant="secondary" className="tabular-nums">
{total}
</Badge>
</div>
{rows.length === 0 ? (
<div className="flex flex-col items-center justify-center gap-1.5 px-4 py-8">
<CheckCircle2 size={18} className="text-muted-foreground/50" />
<Typography variant="muted" className="text-xs">
처리할 항목 없음
</Typography>
</div>
) : (
<div className="divide-y divide-border/60">
{rows.map((row) => (
<button
key={`${row.kind}-${row.qtId}`}
type="button"
onClick={() => onOpen(row.qtId)}
className="grid w-full cursor-pointer grid-cols-[8px_1fr_auto] items-center gap-3 px-4 py-2.5 text-left transition-colors hover:bg-muted/50 sm:grid-cols-[8px_1fr_9rem_auto]"
>
<span aria-hidden className={cn('size-2 rounded-full', row.dot)} />
<Typography variant="small" className="truncate">
{row.name || '(이름 없음)'}
</Typography>
<Typography variant="caption" className="hidden truncate sm:block">
{row.kind}
</Typography>
<Typography variant="caption" className="font-semibold tabular-nums text-foreground/80">
{row.meta}
</Typography>
</button>
))}
</div>
)}
</Card>
);
}
@@ -1,4 +1,5 @@
import { useState } from 'react';
import { createPortal } from 'react-dom';
import { CheckCircle2, X, UserCheck, MessageSquare, Layers, RefreshCw } from 'lucide-react';
import { Typography } from '@/components/ui/typography';
import {
@@ -141,7 +142,9 @@ export function QuotationDetailSheet({
{ id: 'cards', label: `협상 카드 (${serverCards.length})`, icon: Layers },
];
return (
// body 로 포털 — main(페이지 스크롤 컨테이너) 안에 렌더되면 시트 내부 스크롤이 끝에서
// 부모로 체이닝돼 모바일에서 뒤 화면이 스크롤된다.
return createPortal(
<div className="fixed inset-0 z-40 bg-black/40 backdrop-blur-xs flex justify-end animate-fade-in">
<div className="flex-1 cursor-pointer" onClick={onClose} />
@@ -213,7 +216,7 @@ export function QuotationDetailSheet({
{showHeaderCards ? (
<div
style={{ flex: '2 1 0%' }}
className="min-h-0 overflow-y-auto px-6 pb-6 bg-muted/30 border-b border-border"
className="min-h-0 overflow-y-auto overscroll-contain px-6 pb-6 bg-muted/30 border-b border-border"
>
<DrawerHeaderCards
quotation={quotation}
@@ -270,7 +273,7 @@ export function QuotationDetailSheet({
</div>
{/* Tab content */}
<div style={{ flex: '1 1 0%' }} className="min-h-0 p-6 overflow-y-auto bg-background/50">
<div style={{ flex: '1 1 0%' }} className="min-h-0 p-6 pb-[calc(1.5rem+env(safe-area-inset-bottom))] overflow-y-auto overscroll-contain bg-background/50">
{activeTab === 'status' && (
<SessionsStatusTab
sessionViews={sessionViews}
@@ -334,6 +337,7 @@ export function QuotationDetailSheet({
onClose={() => setRegenOpen(false)}
/>
)}
</div>
</div>,
document.body,
);
}