@financinha/ui 0.12.0 → 0.13.1
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 +16 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -2
- package/dist/index.d.ts +7 -2
- package/dist/index.js +16 -7
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -587,8 +587,13 @@ type InsightSize = "default" | "sm";
|
|
|
587
587
|
type InsightCardProps = Omit<React$1.ComponentProps<"div">, "title"> & {
|
|
588
588
|
/** O título do card, como "Principais insights da semana". Vem sempre com o brilho da IA antes. */
|
|
589
589
|
title: React$1.ReactNode;
|
|
590
|
-
/** Texto de apoio
|
|
590
|
+
/** Texto de apoio do título, como o período ("23 de out. – 29 de out."). */
|
|
591
591
|
meta?: React$1.ReactNode;
|
|
592
|
+
/**
|
|
593
|
+
* Onde fica o `meta`. `inline` (padrão): colado ao título, depois de " · ".
|
|
594
|
+
* `end`: na borda direita do cabeçalho, em 14 px cinza, antes da ação, como o período de um card comum no `CardAction`.
|
|
595
|
+
*/
|
|
596
|
+
metaPosition?: "inline" | "end";
|
|
592
597
|
/** Ação à direita do título, como o botão de atualizar. */
|
|
593
598
|
action?: React$1.ReactNode;
|
|
594
599
|
/** Linha embaixo do cabeçalho. Use quando o conteúdo é uma lista de `InsightItem`. */
|
|
@@ -607,7 +612,7 @@ type InsightCardProps = Omit<React$1.ComponentProps<"div">, "title"> & {
|
|
|
607
612
|
* 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.
|
|
608
613
|
* O conteúdo é livre: um texto curto, seções com listas ou uma lista de `InsightItem`.
|
|
609
614
|
*/
|
|
610
|
-
declare function InsightCard({ title, meta, action, divider, divided, size, className, children, ...props }: InsightCardProps): React$1.JSX.Element;
|
|
615
|
+
declare function InsightCard({ title, meta, metaPosition, action, divider, divided, size, className, children, ...props }: InsightCardProps): React$1.JSX.Element;
|
|
611
616
|
type InsightItemProps = Omit<React$1.ComponentProps<"div">, "title"> & {
|
|
612
617
|
/** O assunto: verde (o que foi bom), amarelo (atenção) ou lilás (dica da Financinha). */
|
|
613
618
|
tone?: InsightTone;
|
package/dist/index.d.ts
CHANGED
|
@@ -587,8 +587,13 @@ type InsightSize = "default" | "sm";
|
|
|
587
587
|
type InsightCardProps = Omit<React$1.ComponentProps<"div">, "title"> & {
|
|
588
588
|
/** O título do card, como "Principais insights da semana". Vem sempre com o brilho da IA antes. */
|
|
589
589
|
title: React$1.ReactNode;
|
|
590
|
-
/** Texto de apoio
|
|
590
|
+
/** Texto de apoio do título, como o período ("23 de out. – 29 de out."). */
|
|
591
591
|
meta?: React$1.ReactNode;
|
|
592
|
+
/**
|
|
593
|
+
* Onde fica o `meta`. `inline` (padrão): colado ao título, depois de " · ".
|
|
594
|
+
* `end`: na borda direita do cabeçalho, em 14 px cinza, antes da ação, como o período de um card comum no `CardAction`.
|
|
595
|
+
*/
|
|
596
|
+
metaPosition?: "inline" | "end";
|
|
592
597
|
/** Ação à direita do título, como o botão de atualizar. */
|
|
593
598
|
action?: React$1.ReactNode;
|
|
594
599
|
/** Linha embaixo do cabeçalho. Use quando o conteúdo é uma lista de `InsightItem`. */
|
|
@@ -607,7 +612,7 @@ type InsightCardProps = Omit<React$1.ComponentProps<"div">, "title"> & {
|
|
|
607
612
|
* 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.
|
|
608
613
|
* O conteúdo é livre: um texto curto, seções com listas ou uma lista de `InsightItem`.
|
|
609
614
|
*/
|
|
610
|
-
declare function InsightCard({ title, meta, action, divider, divided, size, className, children, ...props }: InsightCardProps): React$1.JSX.Element;
|
|
615
|
+
declare function InsightCard({ title, meta, metaPosition, action, divider, divided, size, className, children, ...props }: InsightCardProps): React$1.JSX.Element;
|
|
611
616
|
type InsightItemProps = Omit<React$1.ComponentProps<"div">, "title"> & {
|
|
612
617
|
/** O assunto: verde (o que foi bom), amarelo (atenção) ou lilás (dica da Financinha). */
|
|
613
618
|
tone?: InsightTone;
|
package/dist/index.js
CHANGED
|
@@ -3237,9 +3237,9 @@ import { cn as cn37 } from "cn";
|
|
|
3237
3237
|
import { SparklesIcon } from "lucide-react";
|
|
3238
3238
|
import { jsx as jsx36, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
3239
3239
|
var ICON_TONE2 = {
|
|
3240
|
-
success: "bg-success-
|
|
3241
|
-
warning: "bg-warning-
|
|
3242
|
-
tip: "bg-primary-
|
|
3240
|
+
success: "bg-success-100 text-success-500 dark:bg-success-800/60 dark:text-success-300",
|
|
3241
|
+
warning: "bg-warning-200 text-warning-500 dark:bg-warning-800/60 dark:text-warning-300",
|
|
3242
|
+
tip: "bg-primary-200 text-primary-500 dark:bg-primary-800/60 dark:text-primary-300"
|
|
3243
3243
|
};
|
|
3244
3244
|
var TITLE_TONE = {
|
|
3245
3245
|
success: "text-success-500 dark:text-success-300",
|
|
@@ -3250,6 +3250,7 @@ var InsightCardContext = React37.createContext({ size: "default", divided: true
|
|
|
3250
3250
|
function InsightCard({
|
|
3251
3251
|
title,
|
|
3252
3252
|
meta,
|
|
3253
|
+
metaPosition = "inline",
|
|
3253
3254
|
action,
|
|
3254
3255
|
divider = false,
|
|
3255
3256
|
divided = true,
|
|
@@ -3259,6 +3260,7 @@ function InsightCard({
|
|
|
3259
3260
|
...props
|
|
3260
3261
|
}) {
|
|
3261
3262
|
const sm = size === "sm";
|
|
3263
|
+
const metaNoFim = meta != null && metaPosition === "end";
|
|
3262
3264
|
const contexto = React37.useMemo(() => ({ size, divided }), [size, divided]);
|
|
3263
3265
|
return /* @__PURE__ */ jsxs20(
|
|
3264
3266
|
Card,
|
|
@@ -3285,14 +3287,17 @@ function InsightCard({
|
|
|
3285
3287
|
),
|
|
3286
3288
|
children: [
|
|
3287
3289
|
/* @__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: [
|
|
3290
|
+
/* @__PURE__ */ jsxs20("p", { className: cn37("min-w-0 font-semibold text-foreground", sm ? "text-sm leading-6" : "text-base"), children: [
|
|
3289
3291
|
title,
|
|
3290
|
-
meta ? /* @__PURE__ */ jsxs20("span", { className: "font-normal text-muted-foreground", children: [
|
|
3292
|
+
meta != null && !metaNoFim ? /* @__PURE__ */ jsxs20("span", { className: "font-normal text-muted-foreground", children: [
|
|
3291
3293
|
" \xB7 ",
|
|
3292
3294
|
meta
|
|
3293
3295
|
] }) : null
|
|
3294
3296
|
] }),
|
|
3295
|
-
action ? /* @__PURE__ */
|
|
3297
|
+
metaNoFim || action ? /* @__PURE__ */ jsxs20("div", { className: "ml-auto flex shrink-0 items-center gap-2", children: [
|
|
3298
|
+
metaNoFim ? /* @__PURE__ */ jsx36("p", { "data-slot": "insight-card-meta", className: "text-sm leading-6 text-muted-foreground", children: meta }) : null,
|
|
3299
|
+
action
|
|
3300
|
+
] }) : null
|
|
3296
3301
|
]
|
|
3297
3302
|
}
|
|
3298
3303
|
),
|
|
@@ -3300,7 +3305,11 @@ function InsightCard({
|
|
|
3300
3305
|
"div",
|
|
3301
3306
|
{
|
|
3302
3307
|
"data-slot": "insight-card-content",
|
|
3303
|
-
className:
|
|
3308
|
+
className: cn37(
|
|
3309
|
+
"flex flex-col px-(--card-spacing) text-sm leading-relaxed text-neutral-600 dark:text-neutral-300",
|
|
3310
|
+
// sm sem linhas: 20 px entre os insights, porque só o espaço os separa. Com linhas, 12 px de cada lado da linha.
|
|
3311
|
+
sm && !divided ? "gap-5" : "gap-3"
|
|
3312
|
+
),
|
|
3304
3313
|
children: /* @__PURE__ */ jsx36(InsightCardContext.Provider, { value: contexto, children })
|
|
3305
3314
|
}
|
|
3306
3315
|
)
|