@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 CHANGED
@@ -3500,9 +3500,9 @@ var import_cn37 = require("cn");
3500
3500
  var import_lucide_react13 = require("lucide-react");
3501
3501
  var import_jsx_runtime36 = require("react/jsx-runtime");
3502
3502
  var ICON_TONE2 = {
3503
- success: "bg-success-50 text-success-500 dark:bg-success-800/40 dark:text-success-300",
3504
- warning: "bg-warning-100 text-warning-500 dark:bg-warning-800/40 dark:text-warning-300",
3505
- tip: "bg-primary-100 text-primary-500 dark:bg-primary-800/40 dark:text-primary-300"
3503
+ success: "bg-success-100 text-success-500 dark:bg-success-800/60 dark:text-success-300",
3504
+ warning: "bg-warning-200 text-warning-500 dark:bg-warning-800/60 dark:text-warning-300",
3505
+ tip: "bg-primary-200 text-primary-500 dark:bg-primary-800/60 dark:text-primary-300"
3506
3506
  };
3507
3507
  var TITLE_TONE = {
3508
3508
  success: "text-success-500 dark:text-success-300",
@@ -3513,6 +3513,7 @@ var InsightCardContext = React37.createContext({ size: "default", divided: true
3513
3513
  function InsightCard({
3514
3514
  title,
3515
3515
  meta,
3516
+ metaPosition = "inline",
3516
3517
  action,
3517
3518
  divider = false,
3518
3519
  divided = true,
@@ -3522,6 +3523,7 @@ function InsightCard({
3522
3523
  ...props
3523
3524
  }) {
3524
3525
  const sm = size === "sm";
3526
+ const metaNoFim = meta != null && metaPosition === "end";
3525
3527
  const contexto = React37.useMemo(() => ({ size, divided }), [size, divided]);
3526
3528
  return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
3527
3529
  Card,
@@ -3548,14 +3550,17 @@ function InsightCard({
3548
3550
  ),
3549
3551
  children: [
3550
3552
  /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { "aria-hidden": true, className: (0, import_cn37.cn)("flex shrink-0 items-center", sm && "h-6"), children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_lucide_react13.SparklesIcon, { className: "size-5 text-primary-500 dark:text-primary-300" }) }),
3551
- /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("p", { className: (0, import_cn37.cn)("font-semibold text-foreground", sm ? "text-sm leading-6" : "text-base"), children: [
3553
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("p", { className: (0, import_cn37.cn)("min-w-0 font-semibold text-foreground", sm ? "text-sm leading-6" : "text-base"), children: [
3552
3554
  title,
3553
- meta ? /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("span", { className: "font-normal text-muted-foreground", children: [
3555
+ meta != null && !metaNoFim ? /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("span", { className: "font-normal text-muted-foreground", children: [
3554
3556
  " \xB7 ",
3555
3557
  meta
3556
3558
  ] }) : null
3557
3559
  ] }),
3558
- action ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "ml-auto", children: action }) : null
3560
+ metaNoFim || action ? /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "ml-auto flex shrink-0 items-center gap-2", children: [
3561
+ metaNoFim ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { "data-slot": "insight-card-meta", className: "text-sm leading-6 text-muted-foreground", children: meta }) : null,
3562
+ action
3563
+ ] }) : null
3559
3564
  ]
3560
3565
  }
3561
3566
  ),
@@ -3563,7 +3568,11 @@ function InsightCard({
3563
3568
  "div",
3564
3569
  {
3565
3570
  "data-slot": "insight-card-content",
3566
- className: "flex flex-col gap-3 px-(--card-spacing) text-sm leading-relaxed text-neutral-600 dark:text-neutral-300",
3571
+ className: (0, import_cn37.cn)(
3572
+ "flex flex-col px-(--card-spacing) text-sm leading-relaxed text-neutral-600 dark:text-neutral-300",
3573
+ // sm sem linhas: 20 px entre os insights, porque só o espaço os separa. Com linhas, 12 px de cada lado da linha.
3574
+ sm && !divided ? "gap-5" : "gap-3"
3575
+ ),
3567
3576
  children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(InsightCardContext.Provider, { value: contexto, children })
3568
3577
  }
3569
3578
  )