@hed-hog/finance 0.0.302 → 0.0.303

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -17,6 +17,7 @@ type FinancePageSectionProps = {
17
17
  children: ReactNode;
18
18
  className?: string;
19
19
  contentClassName?: string;
20
+ variant?: 'card' | 'flat';
20
21
  };
21
22
 
22
23
  export function FinancePageSection({
@@ -26,9 +27,31 @@ export function FinancePageSection({
26
27
  children,
27
28
  className,
28
29
  contentClassName,
30
+ variant = 'card',
29
31
  }: FinancePageSectionProps) {
30
32
  const hasHeader = title || description || actions;
31
33
 
34
+ if (variant === 'flat') {
35
+ return (
36
+ <section className={cn('space-y-4', className)}>
37
+ {hasHeader ? (
38
+ <div className="flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between">
39
+ <div className="space-y-1">
40
+ {title ? (
41
+ <h2 className="text-base font-semibold">{title}</h2>
42
+ ) : null}
43
+ {description ? (
44
+ <p className="text-sm text-muted-foreground">{description}</p>
45
+ ) : null}
46
+ </div>
47
+ {actions ? <div className="shrink-0">{actions}</div> : null}
48
+ </div>
49
+ ) : null}
50
+ <div className={cn(contentClassName)}>{children}</div>
51
+ </section>
52
+ );
53
+ }
54
+
32
55
  return (
33
56
  <Card
34
57
  className={cn(
@@ -3,9 +3,9 @@
3
3
  'use client';
4
4
 
5
5
  import { FinancePageSection } from '@/app/(app)/(libraries)/finance/_components/finance-layout';
6
+ import { EmptyState, Page, PageHeader } from '@/components/entity-list';
6
7
  import { Badge } from '@/components/ui/badge';
7
8
  import { Button } from '@/components/ui/button';
8
- import { EmptyState, Page, PageHeader } from '@/components/entity-list';
9
9
  import {
10
10
  Dialog,
11
11
  DialogContent,
@@ -251,7 +251,7 @@ export default function AprovacoesPage() {
251
251
 
252
252
  <KpiCardsGrid items={summaryCards} columns={3} />
253
253
 
254
- <FinancePageSection className="border-none shadow-none p-0">
254
+ <FinancePageSection variant="flat">
255
255
  {aprovacoes.length > 0 ? (
256
256
  <div className="overflow-x-auto">
257
257
  <Table>
@@ -339,15 +339,13 @@ export default function AprovacoesPage() {
339
339
  </Table>
340
340
  </div>
341
341
  ) : (
342
- <div className="px-4 py-8 sm:px-6">
343
- <EmptyState
344
- icon={<CheckCircle className="h-12 w-12" />}
345
- title={t('empty.title')}
346
- description={t('empty.description')}
347
- actionLabel={t('empty.refresh')}
348
- onAction={() => void refetch()}
349
- />
350
- </div>
342
+ <EmptyState
343
+ icon={<CheckCircle className="h-12 w-12" />}
344
+ title={t('empty.title')}
345
+ description={t('empty.description')}
346
+ actionLabel={t('empty.refresh')}
347
+ onAction={() => void refetch()}
348
+ />
351
349
  )}
352
350
  </FinancePageSection>
353
351
  </Page>
@@ -1,5 +1,6 @@
1
1
  'use client';
2
2
 
3
+ import { PersonFieldWithCreate } from '@/app/(app)/(libraries)/contact/person/_components/person-field-with-create';
3
4
  import {
4
5
  CategoryFieldWithCreate,
5
6
  CostCenterFieldWithCreate,
@@ -10,7 +11,6 @@ import {
10
11
  FinanceSheetSection,
11
12
  } from '@/app/(app)/(libraries)/finance/_components/finance-layout';
12
13
  import { FinanceTitleActionsMenu } from '@/app/(app)/(libraries)/finance/_components/finance-title-actions-menu';
13
- import { PersonFieldWithCreate } from '@/app/(app)/(libraries)/contact/person/_components/person-field-with-create';
14
14
  import {
15
15
  EmptyState,
16
16
  Page,
@@ -2840,10 +2840,10 @@ export default function TitulosPagarPage() {
2840
2840
  </SheetContent>
2841
2841
  </Sheet>
2842
2842
 
2843
- <FinancePageSection className="border-none shadow-none p-0">
2843
+ <FinancePageSection variant="flat">
2844
2844
  {titulosPagar.length > 0 ? (
2845
2845
  <div className="overflow-x-auto">
2846
- <Table className="min-w-[760px]">
2846
+ <Table className="min-w-190">
2847
2847
  <TableHeader>
2848
2848
  <TableRow>
2849
2849
  <TableHead>{t('table.headers.document')}</TableHead>
@@ -2855,7 +2855,7 @@ export default function TitulosPagarPage() {
2855
2855
  </TableHead>
2856
2856
  <TableHead>{t('table.headers.category')}</TableHead>
2857
2857
  <TableHead>{t('table.headers.status')}</TableHead>
2858
- <TableHead className="w-[50px]" />
2858
+ <TableHead className="w-12.5" />
2859
2859
  </TableRow>
2860
2860
  </TableHeader>
2861
2861
  <TableBody>
@@ -2969,15 +2969,13 @@ export default function TitulosPagarPage() {
2969
2969
  </Table>
2970
2970
  </div>
2971
2971
  ) : (
2972
- <div className="px-4 py-8 sm:px-6">
2973
- <EmptyState
2974
- icon={<FileText className="h-12 w-12" />}
2975
- title={t('empty.title')}
2976
- description={t('empty.description')}
2977
- actionLabel={t('newTitle.action')}
2978
- onAction={() => setIsNewTitleSheetOpen(true)}
2979
- />
2980
- </div>
2972
+ <EmptyState
2973
+ icon={<FileText className="h-12 w-12" />}
2974
+ title={t('empty.title')}
2975
+ description={t('empty.description')}
2976
+ actionLabel={t('newTitle.action')}
2977
+ onAction={() => setIsNewTitleSheetOpen(true)}
2978
+ />
2981
2979
  )}
2982
2980
 
2983
2981
  <div className="border-t border-border/50 px-4 py-4 sm:px-6">