'use client'; import * as React from 'react'; import type { DateRange } from 'react-day-picker'; import { Button } from '@/components/ui/button'; import { Input } from '@/components/ui/input'; import { Textarea } from '@/components/ui/textarea'; import { FormField } from '@/components/ui/form-field'; import { InputGroup, InputGroupAddon, InputGroupInput, InputGroupText, } from '@/components/ui/input-group'; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from '@/components/ui/select'; import { Combobox } from '@/components/ui/combobox'; import { DatePicker, DateRangePicker } from '@/components/ui/date-picker'; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'; import { Badge } from '@/components/ui/badge'; import { STATUS_PILL_MAP, StatusPill, type BusinessStatus } from '@/components/ui/status-pill'; import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs'; import { Skeleton, SkeletonCard, SkeletonText } from '@/components/ui/skeleton'; import { EmptyState } from '@/components/ui/empty-state'; import { DataPagination } from '@/components/ui/data-pagination'; import { ResponsiveDialog } from '@/components/ui/responsive-dialog'; import { DataTable, type DataTableColumn, type DataTableSort } from '@/components/ui/data-table'; import { toast } from '@/lib/toast'; interface DemoCliente { id: string; nome: string; documento: string; telefone: string; cidade: string; status: BusinessStatus; valor: number; } const DEMO_CLIENTES: DemoCliente[] = [ { id: '1', nome: 'Ateliê Boa Vista Ltda', documento: '12.345.678/0001-90', telefone: '(11) 98765-4321', cidade: 'São Paulo/SP', status: 'ativo', valor: 4230.5, }, { id: '2', nome: 'Comércio Silva & Filhos', documento: '98.765.432/0001-10', telefone: '(21) 91234-5678', cidade: 'Rio de Janeiro/RJ', status: 'inadimplente', valor: 1890, }, { id: '3', nome: 'Padaria Pão Dourado', documento: '11.222.333/0001-44', telefone: '(31) 99887-6655', cidade: 'Belo Horizonte/MG', status: 'ativo', valor: 750.9, }, { id: '4', nome: 'Distribuidora Nordeste', documento: '55.666.777/0001-88', telefone: '(85) 98111-2233', cidade: 'Fortaleza/CE', status: 'trial', valor: 0, }, { id: '5', nome: 'Oficina Central Auto Peças', documento: '22.333.444/0001-55', telefone: '(41) 97654-3210', cidade: 'Curitiba/PR', status: 'suspenso', valor: 320, }, ]; const CLIENTE_COLUMNS: DataTableColumn[] = [ { id: 'nome', header: 'Cliente', primary: true, sortable: true, cell: (row) => row.nome }, { id: 'documento', header: 'Documento', cell: (row) => row.documento }, { id: 'telefone', header: 'Telefone', cell: (row) => row.telefone }, { id: 'cidade', header: 'Cidade', cell: (row) => row.cidade }, { id: 'valor', header: 'Valor em aberto', sortable: true, className: 'text-right', cell: (row) => row.valor.toLocaleString('pt-BR', { style: 'currency', currency: 'BRL' }), }, { id: 'status', header: 'Status', primary: true, cell: (row) => , }, ]; const PRODUTO_OPTIONS = [ { value: 'p1', label: 'Consultoria mensal' }, { value: 'p2', label: 'Licença de software' }, { value: 'p3', label: 'Suporte técnico avançado' }, { value: 'p4', label: 'Treinamento presencial' }, ]; function Section({ title, children }: { title: string; children: React.ReactNode }) { return (

{title}

{children}
); } export function ComponentesShowcase() { const [tableLoading, setTableLoading] = React.useState(false); const [tableEmpty, setTableEmpty] = React.useState(false); const [sort, setSort] = React.useState(); const [page, setPage] = React.useState(1); const [dialogOpen, setDialogOpen] = React.useState(false); const [comboboxValue, setComboboxValue] = React.useState(); const [date, setDate] = React.useState(); const [range, setRange] = React.useState(); const [paginationDemoPage, setPaginationDemoPage] = React.useState(1); const sortedData = React.useMemo(() => { if (!sort) return DEMO_CLIENTES; const factor = sort.direction === 'asc' ? 1 : -1; return [...DEMO_CLIENTES].sort((a, b) => { const av = a[sort.columnId as keyof DemoCliente]; const bv = b[sort.columnId as keyof DemoCliente]; if (typeof av === 'number' && typeof bv === 'number') return (av - bv) * factor; return String(av).localeCompare(String(bv)) * factor; }); }, [sort]); return (

/dev/componentes — Etapa 12

Design system — SeConectai Vendas

Rota só de desenvolvimento (404 em produção). Redimensione a janela para ver o comportamento responsivo.

R$