@financinha/ui 0.10.1 → 0.12.0
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.
- package/dist/index.cjs +75 -23
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +20 -7
- package/dist/index.d.ts +20 -7
- package/dist/index.js +75 -23
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -349,7 +349,7 @@ type BankAvatarProps = Omit<React$1.ComponentProps<"span">, "children"> & {
|
|
|
349
349
|
*/
|
|
350
350
|
declare function BankAvatar({ name, src, initials, color, textColor, size, status, statusLabel, owner, ownerLabel, className, ...props }: BankAvatarProps): React$1.JSX.Element;
|
|
351
351
|
|
|
352
|
-
type AmountTone = "neutral" | "income" | "expense" | "auto";
|
|
352
|
+
type AmountTone = "neutral" | "income" | "expense" | "auto" | "balance";
|
|
353
353
|
type AmountProps = Omit<React$1.ComponentProps<"span">, "children"> & {
|
|
354
354
|
/** O valor, na moeda de `currency`. Pode ser negativo. */
|
|
355
355
|
value: number;
|
|
@@ -361,6 +361,8 @@ type AmountProps = Omit<React$1.ComponentProps<"span">, "children"> & {
|
|
|
361
361
|
* - `income`: ganho. Verde, com "+".
|
|
362
362
|
* - `expense`: despesa. Vermelho, com "−".
|
|
363
363
|
* - `auto`: pelo sinal do valor. Positivo é ganho, negativo é despesa, zero é neutro.
|
|
364
|
+
* - `balance`: um saldo que pode ficar positivo ou negativo, como o saldo livre. Positivo com "+" na cor
|
|
365
|
+
* do texto (é um total, não um ganho); negativo vermelho, com "−"; zero sem sinal.
|
|
364
366
|
*/
|
|
365
367
|
tone?: AmountTone;
|
|
366
368
|
/** Mostra "+" ou "−" no ganho e na despesa. Padrão: sim. */
|
|
@@ -369,7 +371,7 @@ type AmountProps = Omit<React$1.ComponentProps<"span">, "children"> & {
|
|
|
369
371
|
hidden?: boolean;
|
|
370
372
|
};
|
|
371
373
|
/**
|
|
372
|
-
* financinha: valor em dinheiro, sempre no mesmo formato ("R$ 1.234,56", "
|
|
374
|
+
* financinha: valor em dinheiro, sempre no mesmo formato ("R$ 1.234,56", "$ 1.234,56"), com
|
|
373
375
|
* algarismos de largura igual para alinhar em colunas. O tamanho e o peso vêm do texto em volta
|
|
374
376
|
* (use `className`).
|
|
375
377
|
*/
|
|
@@ -527,9 +529,10 @@ declare function CardContent({ className, flush, ...props }: React$1.ComponentPr
|
|
|
527
529
|
declare function CardFooter({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
528
530
|
|
|
529
531
|
declare const itemVariants: (props?: ({
|
|
530
|
-
variant?: "default" | "subtle" | null | undefined;
|
|
532
|
+
variant?: "default" | "outline" | "subtle" | null | undefined;
|
|
533
|
+
size?: "default" | "sm" | null | undefined;
|
|
531
534
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
532
|
-
declare function Item({ className, variant, asChild, ...props }: React$1.ComponentProps<"div"> & VariantProps<typeof itemVariants> & {
|
|
535
|
+
declare function Item({ className, variant, size, asChild, ...props }: React$1.ComponentProps<"div"> & VariantProps<typeof itemVariants> & {
|
|
533
536
|
asChild?: boolean;
|
|
534
537
|
}): React$1.JSX.Element;
|
|
535
538
|
/** Uma lista de `Item`. Com `divided`, uma linha entre eles (como Fixo e Variável). */
|
|
@@ -537,7 +540,7 @@ declare function ItemGroup({ className, divided, ...props }: React$1.ComponentPr
|
|
|
537
540
|
divided?: boolean;
|
|
538
541
|
}): React$1.JSX.Element;
|
|
539
542
|
declare const MEDIA_TONE: {
|
|
540
|
-
readonly neutral: "bg-
|
|
543
|
+
readonly neutral: "bg-support-50 text-support-500 dark:bg-support-800/40 dark:text-support-300";
|
|
541
544
|
readonly success: "bg-success-50 text-success-500 dark:bg-success-800/40 dark:text-success-300";
|
|
542
545
|
readonly danger: "bg-danger-50 text-danger-500 dark:bg-danger-800/40 dark:text-danger-300";
|
|
543
546
|
};
|
|
@@ -580,6 +583,7 @@ type MetricCardProps = Omit<React$1.ComponentProps<"div">, "children"> & {
|
|
|
580
583
|
declare function MetricCard({ label, value, icon, tone, trend, comparison, className, ...props }: MetricCardProps): React$1.JSX.Element;
|
|
581
584
|
|
|
582
585
|
type InsightTone = "success" | "warning" | "tip";
|
|
586
|
+
type InsightSize = "default" | "sm";
|
|
583
587
|
type InsightCardProps = Omit<React$1.ComponentProps<"div">, "title"> & {
|
|
584
588
|
/** O título do card, como "Principais insights da semana". Vem sempre com o brilho da IA antes. */
|
|
585
589
|
title: React$1.ReactNode;
|
|
@@ -589,12 +593,21 @@ type InsightCardProps = Omit<React$1.ComponentProps<"div">, "title"> & {
|
|
|
589
593
|
action?: React$1.ReactNode;
|
|
590
594
|
/** Linha embaixo do cabeçalho. Use quando o conteúdo é uma lista de `InsightItem`. */
|
|
591
595
|
divider?: boolean;
|
|
596
|
+
/** Linha entre os `InsightItem`. Padrão: sim. */
|
|
597
|
+
divided?: boolean;
|
|
598
|
+
/**
|
|
599
|
+
* `default`: título de 16 px e ícone do insight de 40 px.
|
|
600
|
+
* `sm`: denso, como os outros cards da Home (Card compacto). Títulos de 14 px, cabeçalho de 24 px alinhado ao topo,
|
|
601
|
+
* 16 px até o conteúdo, ícone do insight de 32 px e 8 px entre o ícone e o texto. A ação do cabeçalho usa
|
|
602
|
+
* `size="icon-xs"` (24 px), para não mudar a altura.
|
|
603
|
+
*/
|
|
604
|
+
size?: InsightSize;
|
|
592
605
|
};
|
|
593
606
|
/**
|
|
594
607
|
* Card da IA: superfície lilás (o único card roxo do DS; o Card comum não tem essa cor), com o brilho (Sparkles) e o título no topo.
|
|
595
608
|
* O conteúdo é livre: um texto curto, seções com listas ou uma lista de `InsightItem`.
|
|
596
609
|
*/
|
|
597
|
-
declare function InsightCard({ title, meta, action, divider, className, children, ...props }: InsightCardProps): React$1.JSX.Element;
|
|
610
|
+
declare function InsightCard({ title, meta, action, divider, divided, size, className, children, ...props }: InsightCardProps): React$1.JSX.Element;
|
|
598
611
|
type InsightItemProps = Omit<React$1.ComponentProps<"div">, "title"> & {
|
|
599
612
|
/** O assunto: verde (o que foi bom), amarelo (atenção) ou lilás (dica da Financinha). */
|
|
600
613
|
tone?: InsightTone;
|
|
@@ -884,4 +897,4 @@ declare function SidebarMenuSubButton({ asChild, size, isActive, className, ...p
|
|
|
884
897
|
isActive?: boolean;
|
|
885
898
|
}): React$1.JSX.Element;
|
|
886
899
|
|
|
887
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertAction, AlertDescription, AlertModal, AlertModalAction, AlertModalCancel, AlertModalContent, AlertModalDescription, AlertModalFooter, AlertModalHeader, AlertModalOverlay, AlertModalPanel, AlertModalPortal, AlertModalTitle, AlertModalTrigger, AlertTitle, Amount, type AmountProps, type AmountTone, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, type BadgeProps, type BadgeVariant, BankAvatar, type BankAvatarOwner, type BankAvatarProps, type BankAvatarStatus, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Calendar, CalendarDayButton, Card, CardAction, CardBrand, type CardBrandProps, CardContent, CardDescription, CardFooter, CardHeader, CardIcon, CardTitle, Checkbox, CheckboxCard, type CheckboxCardProps, Collapsible, CollapsibleContent, CollapsibleTrigger, type ColorScheme, DangerZoneCard, type DangerZoneCardProps, DangerZoneItem, type DangerZoneItemProps, DatePicker, type DatePickerProps, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, FileUpload, type FileUploadProps, type FileUploadRejection, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, InsightCard, type InsightCardProps, InsightItem, type InsightItemProps, type InsightTone, Item, ItemActions, ItemContent, ItemDescription, ItemGroup, ItemMedia, ItemTitle, Label, Link, type LinkProps, MetricCard, type MetricCardProps, type MetricCardTone, Modal, ModalBody, ModalClose, ModalContent, ModalDescription, ModalFooter, ModalHeader, ModalOverlay, ModalPortal, ModalTitle, ModalTrigger, Multiselect, type MultiselectOption, type MultiselectProps, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, PageHeader, type PageHeaderProps, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Popover, PopoverAnchor, PopoverConfirm, type PopoverConfirmProps, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, Progress, RadioCard, type RadioCardProps, RadioGroup, RadioGroupCard, RadioGroupItem, ScrollArea, ScrollBar, SegmentedControl, type SegmentedControlProps, type SegmentedOption, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Spinner, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Tag, Textarea, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, buttonVariants, cardVariants, headingStyle, itemVariants, modalContentVariants, navigationMenuTriggerStyle, tagVariants, textStyle, toggleVariants, useColorScheme, useIsMobile, useSidebar };
|
|
900
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertAction, AlertDescription, AlertModal, AlertModalAction, AlertModalCancel, AlertModalContent, AlertModalDescription, AlertModalFooter, AlertModalHeader, AlertModalOverlay, AlertModalPanel, AlertModalPortal, AlertModalTitle, AlertModalTrigger, AlertTitle, Amount, type AmountProps, type AmountTone, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, type BadgeProps, type BadgeVariant, BankAvatar, type BankAvatarOwner, type BankAvatarProps, type BankAvatarStatus, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Calendar, CalendarDayButton, Card, CardAction, CardBrand, type CardBrandProps, CardContent, CardDescription, CardFooter, CardHeader, CardIcon, CardTitle, Checkbox, CheckboxCard, type CheckboxCardProps, Collapsible, CollapsibleContent, CollapsibleTrigger, type ColorScheme, DangerZoneCard, type DangerZoneCardProps, DangerZoneItem, type DangerZoneItemProps, DatePicker, type DatePickerProps, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, FileUpload, type FileUploadProps, type FileUploadRejection, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, InsightCard, type InsightCardProps, InsightItem, type InsightItemProps, type InsightSize, type InsightTone, Item, ItemActions, ItemContent, ItemDescription, ItemGroup, ItemMedia, ItemTitle, Label, Link, type LinkProps, MetricCard, type MetricCardProps, type MetricCardTone, Modal, ModalBody, ModalClose, ModalContent, ModalDescription, ModalFooter, ModalHeader, ModalOverlay, ModalPortal, ModalTitle, ModalTrigger, Multiselect, type MultiselectOption, type MultiselectProps, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, PageHeader, type PageHeaderProps, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Popover, PopoverAnchor, PopoverConfirm, type PopoverConfirmProps, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, Progress, RadioCard, type RadioCardProps, RadioGroup, RadioGroupCard, RadioGroupItem, ScrollArea, ScrollBar, SegmentedControl, type SegmentedControlProps, type SegmentedOption, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Spinner, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Tag, Textarea, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, buttonVariants, cardVariants, headingStyle, itemVariants, modalContentVariants, navigationMenuTriggerStyle, tagVariants, textStyle, toggleVariants, useColorScheme, useIsMobile, useSidebar };
|
package/dist/index.d.ts
CHANGED
|
@@ -349,7 +349,7 @@ type BankAvatarProps = Omit<React$1.ComponentProps<"span">, "children"> & {
|
|
|
349
349
|
*/
|
|
350
350
|
declare function BankAvatar({ name, src, initials, color, textColor, size, status, statusLabel, owner, ownerLabel, className, ...props }: BankAvatarProps): React$1.JSX.Element;
|
|
351
351
|
|
|
352
|
-
type AmountTone = "neutral" | "income" | "expense" | "auto";
|
|
352
|
+
type AmountTone = "neutral" | "income" | "expense" | "auto" | "balance";
|
|
353
353
|
type AmountProps = Omit<React$1.ComponentProps<"span">, "children"> & {
|
|
354
354
|
/** O valor, na moeda de `currency`. Pode ser negativo. */
|
|
355
355
|
value: number;
|
|
@@ -361,6 +361,8 @@ type AmountProps = Omit<React$1.ComponentProps<"span">, "children"> & {
|
|
|
361
361
|
* - `income`: ganho. Verde, com "+".
|
|
362
362
|
* - `expense`: despesa. Vermelho, com "−".
|
|
363
363
|
* - `auto`: pelo sinal do valor. Positivo é ganho, negativo é despesa, zero é neutro.
|
|
364
|
+
* - `balance`: um saldo que pode ficar positivo ou negativo, como o saldo livre. Positivo com "+" na cor
|
|
365
|
+
* do texto (é um total, não um ganho); negativo vermelho, com "−"; zero sem sinal.
|
|
364
366
|
*/
|
|
365
367
|
tone?: AmountTone;
|
|
366
368
|
/** Mostra "+" ou "−" no ganho e na despesa. Padrão: sim. */
|
|
@@ -369,7 +371,7 @@ type AmountProps = Omit<React$1.ComponentProps<"span">, "children"> & {
|
|
|
369
371
|
hidden?: boolean;
|
|
370
372
|
};
|
|
371
373
|
/**
|
|
372
|
-
* financinha: valor em dinheiro, sempre no mesmo formato ("R$ 1.234,56", "
|
|
374
|
+
* financinha: valor em dinheiro, sempre no mesmo formato ("R$ 1.234,56", "$ 1.234,56"), com
|
|
373
375
|
* algarismos de largura igual para alinhar em colunas. O tamanho e o peso vêm do texto em volta
|
|
374
376
|
* (use `className`).
|
|
375
377
|
*/
|
|
@@ -527,9 +529,10 @@ declare function CardContent({ className, flush, ...props }: React$1.ComponentPr
|
|
|
527
529
|
declare function CardFooter({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
528
530
|
|
|
529
531
|
declare const itemVariants: (props?: ({
|
|
530
|
-
variant?: "default" | "subtle" | null | undefined;
|
|
532
|
+
variant?: "default" | "outline" | "subtle" | null | undefined;
|
|
533
|
+
size?: "default" | "sm" | null | undefined;
|
|
531
534
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
532
|
-
declare function Item({ className, variant, asChild, ...props }: React$1.ComponentProps<"div"> & VariantProps<typeof itemVariants> & {
|
|
535
|
+
declare function Item({ className, variant, size, asChild, ...props }: React$1.ComponentProps<"div"> & VariantProps<typeof itemVariants> & {
|
|
533
536
|
asChild?: boolean;
|
|
534
537
|
}): React$1.JSX.Element;
|
|
535
538
|
/** Uma lista de `Item`. Com `divided`, uma linha entre eles (como Fixo e Variável). */
|
|
@@ -537,7 +540,7 @@ declare function ItemGroup({ className, divided, ...props }: React$1.ComponentPr
|
|
|
537
540
|
divided?: boolean;
|
|
538
541
|
}): React$1.JSX.Element;
|
|
539
542
|
declare const MEDIA_TONE: {
|
|
540
|
-
readonly neutral: "bg-
|
|
543
|
+
readonly neutral: "bg-support-50 text-support-500 dark:bg-support-800/40 dark:text-support-300";
|
|
541
544
|
readonly success: "bg-success-50 text-success-500 dark:bg-success-800/40 dark:text-success-300";
|
|
542
545
|
readonly danger: "bg-danger-50 text-danger-500 dark:bg-danger-800/40 dark:text-danger-300";
|
|
543
546
|
};
|
|
@@ -580,6 +583,7 @@ type MetricCardProps = Omit<React$1.ComponentProps<"div">, "children"> & {
|
|
|
580
583
|
declare function MetricCard({ label, value, icon, tone, trend, comparison, className, ...props }: MetricCardProps): React$1.JSX.Element;
|
|
581
584
|
|
|
582
585
|
type InsightTone = "success" | "warning" | "tip";
|
|
586
|
+
type InsightSize = "default" | "sm";
|
|
583
587
|
type InsightCardProps = Omit<React$1.ComponentProps<"div">, "title"> & {
|
|
584
588
|
/** O título do card, como "Principais insights da semana". Vem sempre com o brilho da IA antes. */
|
|
585
589
|
title: React$1.ReactNode;
|
|
@@ -589,12 +593,21 @@ type InsightCardProps = Omit<React$1.ComponentProps<"div">, "title"> & {
|
|
|
589
593
|
action?: React$1.ReactNode;
|
|
590
594
|
/** Linha embaixo do cabeçalho. Use quando o conteúdo é uma lista de `InsightItem`. */
|
|
591
595
|
divider?: boolean;
|
|
596
|
+
/** Linha entre os `InsightItem`. Padrão: sim. */
|
|
597
|
+
divided?: boolean;
|
|
598
|
+
/**
|
|
599
|
+
* `default`: título de 16 px e ícone do insight de 40 px.
|
|
600
|
+
* `sm`: denso, como os outros cards da Home (Card compacto). Títulos de 14 px, cabeçalho de 24 px alinhado ao topo,
|
|
601
|
+
* 16 px até o conteúdo, ícone do insight de 32 px e 8 px entre o ícone e o texto. A ação do cabeçalho usa
|
|
602
|
+
* `size="icon-xs"` (24 px), para não mudar a altura.
|
|
603
|
+
*/
|
|
604
|
+
size?: InsightSize;
|
|
592
605
|
};
|
|
593
606
|
/**
|
|
594
607
|
* Card da IA: superfície lilás (o único card roxo do DS; o Card comum não tem essa cor), com o brilho (Sparkles) e o título no topo.
|
|
595
608
|
* O conteúdo é livre: um texto curto, seções com listas ou uma lista de `InsightItem`.
|
|
596
609
|
*/
|
|
597
|
-
declare function InsightCard({ title, meta, action, divider, className, children, ...props }: InsightCardProps): React$1.JSX.Element;
|
|
610
|
+
declare function InsightCard({ title, meta, action, divider, divided, size, className, children, ...props }: InsightCardProps): React$1.JSX.Element;
|
|
598
611
|
type InsightItemProps = Omit<React$1.ComponentProps<"div">, "title"> & {
|
|
599
612
|
/** O assunto: verde (o que foi bom), amarelo (atenção) ou lilás (dica da Financinha). */
|
|
600
613
|
tone?: InsightTone;
|
|
@@ -884,4 +897,4 @@ declare function SidebarMenuSubButton({ asChild, size, isActive, className, ...p
|
|
|
884
897
|
isActive?: boolean;
|
|
885
898
|
}): React$1.JSX.Element;
|
|
886
899
|
|
|
887
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertAction, AlertDescription, AlertModal, AlertModalAction, AlertModalCancel, AlertModalContent, AlertModalDescription, AlertModalFooter, AlertModalHeader, AlertModalOverlay, AlertModalPanel, AlertModalPortal, AlertModalTitle, AlertModalTrigger, AlertTitle, Amount, type AmountProps, type AmountTone, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, type BadgeProps, type BadgeVariant, BankAvatar, type BankAvatarOwner, type BankAvatarProps, type BankAvatarStatus, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Calendar, CalendarDayButton, Card, CardAction, CardBrand, type CardBrandProps, CardContent, CardDescription, CardFooter, CardHeader, CardIcon, CardTitle, Checkbox, CheckboxCard, type CheckboxCardProps, Collapsible, CollapsibleContent, CollapsibleTrigger, type ColorScheme, DangerZoneCard, type DangerZoneCardProps, DangerZoneItem, type DangerZoneItemProps, DatePicker, type DatePickerProps, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, FileUpload, type FileUploadProps, type FileUploadRejection, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, InsightCard, type InsightCardProps, InsightItem, type InsightItemProps, type InsightTone, Item, ItemActions, ItemContent, ItemDescription, ItemGroup, ItemMedia, ItemTitle, Label, Link, type LinkProps, MetricCard, type MetricCardProps, type MetricCardTone, Modal, ModalBody, ModalClose, ModalContent, ModalDescription, ModalFooter, ModalHeader, ModalOverlay, ModalPortal, ModalTitle, ModalTrigger, Multiselect, type MultiselectOption, type MultiselectProps, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, PageHeader, type PageHeaderProps, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Popover, PopoverAnchor, PopoverConfirm, type PopoverConfirmProps, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, Progress, RadioCard, type RadioCardProps, RadioGroup, RadioGroupCard, RadioGroupItem, ScrollArea, ScrollBar, SegmentedControl, type SegmentedControlProps, type SegmentedOption, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Spinner, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Tag, Textarea, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, buttonVariants, cardVariants, headingStyle, itemVariants, modalContentVariants, navigationMenuTriggerStyle, tagVariants, textStyle, toggleVariants, useColorScheme, useIsMobile, useSidebar };
|
|
900
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertAction, AlertDescription, AlertModal, AlertModalAction, AlertModalCancel, AlertModalContent, AlertModalDescription, AlertModalFooter, AlertModalHeader, AlertModalOverlay, AlertModalPanel, AlertModalPortal, AlertModalTitle, AlertModalTrigger, AlertTitle, Amount, type AmountProps, type AmountTone, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, type BadgeProps, type BadgeVariant, BankAvatar, type BankAvatarOwner, type BankAvatarProps, type BankAvatarStatus, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Calendar, CalendarDayButton, Card, CardAction, CardBrand, type CardBrandProps, CardContent, CardDescription, CardFooter, CardHeader, CardIcon, CardTitle, Checkbox, CheckboxCard, type CheckboxCardProps, Collapsible, CollapsibleContent, CollapsibleTrigger, type ColorScheme, DangerZoneCard, type DangerZoneCardProps, DangerZoneItem, type DangerZoneItemProps, DatePicker, type DatePickerProps, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, FileUpload, type FileUploadProps, type FileUploadRejection, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, InsightCard, type InsightCardProps, InsightItem, type InsightItemProps, type InsightSize, type InsightTone, Item, ItemActions, ItemContent, ItemDescription, ItemGroup, ItemMedia, ItemTitle, Label, Link, type LinkProps, MetricCard, type MetricCardProps, type MetricCardTone, Modal, ModalBody, ModalClose, ModalContent, ModalDescription, ModalFooter, ModalHeader, ModalOverlay, ModalPortal, ModalTitle, ModalTrigger, Multiselect, type MultiselectOption, type MultiselectProps, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, PageHeader, type PageHeaderProps, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Popover, PopoverAnchor, PopoverConfirm, type PopoverConfirmProps, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, Progress, RadioCard, type RadioCardProps, RadioGroup, RadioGroupCard, RadioGroupItem, ScrollArea, ScrollBar, SegmentedControl, type SegmentedControlProps, type SegmentedOption, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Spinner, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Tag, Textarea, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, buttonVariants, cardVariants, headingStyle, itemVariants, modalContentVariants, navigationMenuTriggerStyle, tagVariants, textStyle, toggleVariants, useColorScheme, useIsMobile, useSidebar };
|
package/dist/index.js
CHANGED
|
@@ -2217,20 +2217,39 @@ import { cva as cva6 } from "class-variance-authority";
|
|
|
2217
2217
|
import { Slot as Slot3 } from "radix-ui";
|
|
2218
2218
|
import { cn as cn25 } from "cn";
|
|
2219
2219
|
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
2220
|
-
var
|
|
2220
|
+
var OUTLINE_DETAILS = [
|
|
2221
|
+
// O título do resumo em destaque: semibold, na cor do texto.
|
|
2222
|
+
"[&>[data-slot=item-content]>[data-slot=item-title]]:font-semibold [&>[data-slot=item-content]>[data-slot=item-title]]:text-foreground",
|
|
2223
|
+
// As linhas de detalhe (um ItemGroup dentro da caixa) ocupam a linha toda, abaixo de uma divisória de ponta a ponta,
|
|
2224
|
+
// com 8 px entre a divisória e o texto e entre o texto e a borda de baixo.
|
|
2225
|
+
"[&>[data-slot=item-group]]:-mx-2 [&>[data-slot=item-group]]:mt-1 [&>[data-slot=item-group]]:-mb-1 [&>[data-slot=item-group]]:basis-[calc(100%+1rem)] [&>[data-slot=item-group]]:border-t [&>[data-slot=item-group]]:border-border [&>[data-slot=item-group]]:px-2 [&>[data-slot=item-group]]:pt-1",
|
|
2226
|
+
// Cada linha de detalhe: 4 px em cima e embaixo, nome e valor em cinza, valor sem negrito.
|
|
2227
|
+
"[&>[data-slot=item-group]>[data-slot=item]]:py-1 [&>[data-slot=item-group]_[data-slot=item-title]]:text-muted-foreground [&>[data-slot=item-group]_[data-slot=item-actions]]:font-normal [&>[data-slot=item-group]_[data-slot=item-actions]]:text-muted-foreground"
|
|
2228
|
+
].join(" ");
|
|
2229
|
+
var itemVariants = cva6("group/item flex flex-wrap items-center gap-y-1 text-sm", {
|
|
2221
2230
|
variants: {
|
|
2222
2231
|
variant: {
|
|
2223
2232
|
// Solta, sem fundo: as linhas de uma lista.
|
|
2224
2233
|
default: "py-2",
|
|
2225
2234
|
// Bloco cinza com borda: o resumo dentro de um card ("Saldo total", "Ganho total").
|
|
2226
|
-
subtle: "rounded-lg border border-border bg-muted px-4 py-3"
|
|
2235
|
+
subtle: "rounded-lg border border-border bg-muted px-4 py-3",
|
|
2236
|
+
// Caixa branca com borda e 8 px de espaço: o resumo dentro de um card, com o título em destaque e, se quiser,
|
|
2237
|
+
// as linhas de detalhe dentro dela (um ItemGroup). Não é um Card: card dentro de card continua proibido.
|
|
2238
|
+
outline: cn25("rounded-lg border border-border bg-card p-2", OUTLINE_DETAILS)
|
|
2239
|
+
},
|
|
2240
|
+
size: {
|
|
2241
|
+
// 16 px no título e no valor.
|
|
2242
|
+
default: "gap-x-3",
|
|
2243
|
+
// 14 px no título e no valor (ItemTitle e ItemActions leem o data-size), e 8 px entre as partes: resumos densos.
|
|
2244
|
+
sm: "gap-x-2"
|
|
2227
2245
|
}
|
|
2228
2246
|
},
|
|
2229
|
-
defaultVariants: { variant: "default" }
|
|
2247
|
+
defaultVariants: { variant: "default", size: "default" }
|
|
2230
2248
|
});
|
|
2231
2249
|
function Item({
|
|
2232
2250
|
className,
|
|
2233
2251
|
variant,
|
|
2252
|
+
size,
|
|
2234
2253
|
asChild = false,
|
|
2235
2254
|
...props
|
|
2236
2255
|
}) {
|
|
@@ -2240,7 +2259,8 @@ function Item({
|
|
|
2240
2259
|
{
|
|
2241
2260
|
"data-slot": "item",
|
|
2242
2261
|
"data-variant": variant ?? "default",
|
|
2243
|
-
|
|
2262
|
+
"data-size": size ?? "default",
|
|
2263
|
+
className: cn25(itemVariants({ variant, size }), className),
|
|
2244
2264
|
...props
|
|
2245
2265
|
}
|
|
2246
2266
|
);
|
|
@@ -2261,7 +2281,8 @@ function ItemGroup({
|
|
|
2261
2281
|
);
|
|
2262
2282
|
}
|
|
2263
2283
|
var MEDIA_TONE = {
|
|
2264
|
-
|
|
2284
|
+
// Azul (apoio), como no MetricCard: o cinza fazia o ícone parecer desabilitado.
|
|
2285
|
+
neutral: "bg-support-50 text-support-500 dark:bg-support-800/40 dark:text-support-300",
|
|
2265
2286
|
success: "bg-success-50 text-success-500 dark:bg-success-800/40 dark:text-success-300",
|
|
2266
2287
|
danger: "bg-danger-50 text-danger-500 dark:bg-danger-800/40 dark:text-danger-300"
|
|
2267
2288
|
};
|
|
@@ -2286,14 +2307,14 @@ function ItemMedia({
|
|
|
2286
2307
|
);
|
|
2287
2308
|
}
|
|
2288
2309
|
function ItemContent({ className, ...props }) {
|
|
2289
|
-
return /* @__PURE__ */ jsx24("div", { "data-slot": "item-content", className: cn25("flex min-w-
|
|
2310
|
+
return /* @__PURE__ */ jsx24("div", { "data-slot": "item-content", className: cn25("flex min-w-16 flex-1 flex-col gap-1", className), ...props });
|
|
2290
2311
|
}
|
|
2291
2312
|
function ItemTitle({ className, ...props }) {
|
|
2292
2313
|
return /* @__PURE__ */ jsx24(
|
|
2293
2314
|
"div",
|
|
2294
2315
|
{
|
|
2295
2316
|
"data-slot": "item-title",
|
|
2296
|
-
className: cn25(textStyle("text1"), "flex items-center gap-2 leading-tight text-foreground group-data-[variant=subtle]/item:text-neutral-600", className),
|
|
2317
|
+
className: cn25(textStyle("text1"), "flex items-center gap-2 leading-tight text-foreground group-data-[variant=subtle]/item:text-neutral-600 group-data-[size=sm]/item:text-sm group-data-[size=sm]/item:leading-5", className),
|
|
2297
2318
|
...props
|
|
2298
2319
|
}
|
|
2299
2320
|
);
|
|
@@ -2306,7 +2327,7 @@ function ItemActions({ className, ...props }) {
|
|
|
2306
2327
|
"div",
|
|
2307
2328
|
{
|
|
2308
2329
|
"data-slot": "item-actions",
|
|
2309
|
-
className: cn25("ml-auto flex shrink-0 items-center gap-2 text-base font-semibold text-foreground tabular-nums", className),
|
|
2330
|
+
className: cn25("ml-auto flex shrink-0 items-center gap-2 text-base font-semibold text-foreground tabular-nums group-data-[size=sm]/item:text-sm", className),
|
|
2310
2331
|
...props
|
|
2311
2332
|
}
|
|
2312
2333
|
);
|
|
@@ -2729,7 +2750,7 @@ var formatadores = /* @__PURE__ */ new Map();
|
|
|
2729
2750
|
function formatador(moeda) {
|
|
2730
2751
|
let f = formatadores.get(moeda);
|
|
2731
2752
|
if (!f) {
|
|
2732
|
-
f = new Intl.NumberFormat("pt-BR", { style: "currency", currency: moeda });
|
|
2753
|
+
f = new Intl.NumberFormat("pt-BR", { style: "currency", currency: moeda, currencyDisplay: "narrowSymbol" });
|
|
2733
2754
|
formatadores.set(moeda, f);
|
|
2734
2755
|
}
|
|
2735
2756
|
return f;
|
|
@@ -2740,14 +2761,17 @@ var COR = {
|
|
|
2740
2761
|
expense: "text-danger-500"
|
|
2741
2762
|
};
|
|
2742
2763
|
function Amount({ value, currency = "BRL", tone = "neutral", showSign = true, hidden = false, className, ...props }) {
|
|
2743
|
-
const
|
|
2764
|
+
const porSinal = value > 0 ? "income" : value < 0 ? "expense" : "neutral";
|
|
2765
|
+
const saldoPositivo = tone === "balance" && value > 0;
|
|
2766
|
+
const tipo = tone === "auto" ? porSinal : tone === "balance" ? saldoPositivo ? "neutral" : porSinal : tone;
|
|
2744
2767
|
const negativo = tipo === "expense" || tipo === "neutral" && value < 0;
|
|
2745
|
-
const
|
|
2746
|
-
const
|
|
2768
|
+
const positivo = tipo === "income" || saldoPositivo;
|
|
2769
|
+
const sinal = positivo ? "+" : negativo ? "\u2212" : "";
|
|
2770
|
+
const mostraSinal = sinal !== "" && (tipo === "neutral" && !saldoPositivo || showSign);
|
|
2747
2771
|
const f = formatador(currency);
|
|
2748
2772
|
const texto = f.format(Math.abs(value));
|
|
2749
2773
|
const simbolo = f.formatToParts(0).find((p) => p.type === "currency")?.value ?? currency;
|
|
2750
|
-
const falado = hidden ? "Valor oculto" : `${negativo ? "menos " :
|
|
2774
|
+
const falado = hidden ? "Valor oculto" : `${negativo ? "menos " : positivo && mostraSinal ? "mais " : ""}${texto}`;
|
|
2751
2775
|
return /* @__PURE__ */ jsxs13(
|
|
2752
2776
|
"span",
|
|
2753
2777
|
{
|
|
@@ -3208,7 +3232,7 @@ function MetricCard({
|
|
|
3208
3232
|
}
|
|
3209
3233
|
|
|
3210
3234
|
// src/components/patterns/insight-card.tsx
|
|
3211
|
-
import "react";
|
|
3235
|
+
import * as React37 from "react";
|
|
3212
3236
|
import { cn as cn37 } from "cn";
|
|
3213
3237
|
import { SparklesIcon } from "lucide-react";
|
|
3214
3238
|
import { jsx as jsx36, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
@@ -3222,13 +3246,31 @@ var TITLE_TONE = {
|
|
|
3222
3246
|
warning: "text-warning-500 dark:text-warning-300",
|
|
3223
3247
|
tip: "text-primary-500 dark:text-primary-300"
|
|
3224
3248
|
};
|
|
3225
|
-
|
|
3249
|
+
var InsightCardContext = React37.createContext({ size: "default", divided: true });
|
|
3250
|
+
function InsightCard({
|
|
3251
|
+
title,
|
|
3252
|
+
meta,
|
|
3253
|
+
action,
|
|
3254
|
+
divider = false,
|
|
3255
|
+
divided = true,
|
|
3256
|
+
size = "default",
|
|
3257
|
+
className,
|
|
3258
|
+
children,
|
|
3259
|
+
...props
|
|
3260
|
+
}) {
|
|
3261
|
+
const sm = size === "sm";
|
|
3262
|
+
const contexto = React37.useMemo(() => ({ size, divided }), [size, divided]);
|
|
3226
3263
|
return /* @__PURE__ */ jsxs20(
|
|
3227
3264
|
Card,
|
|
3228
3265
|
{
|
|
3229
3266
|
"data-slot": "insight-card",
|
|
3267
|
+
"data-size": size,
|
|
3230
3268
|
padding: "compact",
|
|
3231
|
-
className: cn37(
|
|
3269
|
+
className: cn37(
|
|
3270
|
+
"border-primary-200 bg-primary-50 dark:border-primary-700 dark:bg-primary-800/40",
|
|
3271
|
+
sm ? "gap-4" : "gap-3",
|
|
3272
|
+
className
|
|
3273
|
+
),
|
|
3232
3274
|
...props,
|
|
3233
3275
|
children: [
|
|
3234
3276
|
/* @__PURE__ */ jsxs20(
|
|
@@ -3236,12 +3278,14 @@ function InsightCard({ title, meta, action, divider = false, className, children
|
|
|
3236
3278
|
{
|
|
3237
3279
|
"data-slot": "insight-card-header",
|
|
3238
3280
|
className: cn37(
|
|
3239
|
-
"flex
|
|
3281
|
+
"flex gap-2 px-(--card-spacing)",
|
|
3282
|
+
// sm: 24 px de altura (a do botão icon-xs), alinhado ao topo, como o cabeçalho do Card compacto.
|
|
3283
|
+
sm ? "min-h-6 items-start" : "items-center",
|
|
3240
3284
|
divider && "border-b border-inherit pb-(--card-spacing)"
|
|
3241
3285
|
),
|
|
3242
3286
|
children: [
|
|
3243
|
-
/* @__PURE__ */ jsx36(
|
|
3244
|
-
/* @__PURE__ */ jsxs20("p", { className: "
|
|
3287
|
+
/* @__PURE__ */ jsx36("span", { "aria-hidden": true, className: cn37("flex shrink-0 items-center", sm && "h-6"), children: /* @__PURE__ */ jsx36(SparklesIcon, { className: "size-5 text-primary-500 dark:text-primary-300" }) }),
|
|
3288
|
+
/* @__PURE__ */ jsxs20("p", { className: cn37("font-semibold text-foreground", sm ? "text-sm leading-6" : "text-base"), children: [
|
|
3245
3289
|
title,
|
|
3246
3290
|
meta ? /* @__PURE__ */ jsxs20("span", { className: "font-normal text-muted-foreground", children: [
|
|
3247
3291
|
" \xB7 ",
|
|
@@ -3257,7 +3301,7 @@ function InsightCard({ title, meta, action, divider = false, className, children
|
|
|
3257
3301
|
{
|
|
3258
3302
|
"data-slot": "insight-card-content",
|
|
3259
3303
|
className: "flex flex-col gap-3 px-(--card-spacing) text-sm leading-relaxed text-neutral-600 dark:text-neutral-300",
|
|
3260
|
-
children
|
|
3304
|
+
children: /* @__PURE__ */ jsx36(InsightCardContext.Provider, { value: contexto, children })
|
|
3261
3305
|
}
|
|
3262
3306
|
)
|
|
3263
3307
|
]
|
|
@@ -3265,12 +3309,16 @@ function InsightCard({ title, meta, action, divider = false, className, children
|
|
|
3265
3309
|
);
|
|
3266
3310
|
}
|
|
3267
3311
|
function InsightItem({ tone = "tip", icon, title, className, children, ...props }) {
|
|
3312
|
+
const { size, divided } = React37.useContext(InsightCardContext);
|
|
3313
|
+
const sm = size === "sm";
|
|
3268
3314
|
return /* @__PURE__ */ jsxs20(
|
|
3269
3315
|
"div",
|
|
3270
3316
|
{
|
|
3271
3317
|
"data-slot": "insight-item",
|
|
3272
3318
|
className: cn37(
|
|
3273
|
-
"flex
|
|
3319
|
+
"flex",
|
|
3320
|
+
sm ? "gap-2" : "gap-3",
|
|
3321
|
+
divided && "border-b border-primary-200 pb-3 last:border-0 last:pb-0 dark:border-primary-700",
|
|
3274
3322
|
className
|
|
3275
3323
|
),
|
|
3276
3324
|
...props,
|
|
@@ -3279,12 +3327,16 @@ function InsightItem({ tone = "tip", icon, title, className, children, ...props
|
|
|
3279
3327
|
"span",
|
|
3280
3328
|
{
|
|
3281
3329
|
"aria-hidden": true,
|
|
3282
|
-
className: cn37(
|
|
3330
|
+
className: cn37(
|
|
3331
|
+
"flex shrink-0 items-center justify-center",
|
|
3332
|
+
sm ? "size-8 rounded-md [&>svg]:size-4" : "size-10 rounded-lg [&>svg]:size-5",
|
|
3333
|
+
ICON_TONE2[tone]
|
|
3334
|
+
),
|
|
3283
3335
|
children: icon
|
|
3284
3336
|
}
|
|
3285
3337
|
) : null,
|
|
3286
3338
|
/* @__PURE__ */ jsxs20("div", { className: "flex flex-col gap-1", children: [
|
|
3287
|
-
/* @__PURE__ */ jsx36("p", { className: cn37("text-
|
|
3339
|
+
/* @__PURE__ */ jsx36("p", { className: cn37("font-semibold", sm ? "text-sm" : "text-base", TITLE_TONE[tone]), children: title }),
|
|
3288
3340
|
/* @__PURE__ */ jsx36("div", { children })
|
|
3289
3341
|
] })
|
|
3290
3342
|
]
|