@motor-hero/ui-kit 0.37.4 → 0.39.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.js CHANGED
@@ -903,7 +903,7 @@ function ConfirmDialog({
903
903
  {
904
904
  onClick: onConfirm,
905
905
  disabled: loading,
906
- className: `inline-flex h-9 items-center justify-center rounded-md px-4 text-sm font-medium shadow transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 cursor-pointer ${variant === "destructive" ? "bg-destructive text-destructive-foreground hover:bg-destructive/90" : "bg-primary text-primary-foreground hover:bg-primary/90"}`,
906
+ className: `inline-flex h-9 items-center justify-center rounded-md px-4 text-sm font-medium shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 cursor-pointer ${variant === "destructive" ? "bg-destructive text-destructive-foreground hover:bg-destructive/90" : "bg-primary text-primary-foreground hover:bg-primary/90"}`,
907
907
  children: loading ? "Aguarde..." : confirmLabel
908
908
  }
909
909
  )
@@ -1456,7 +1456,7 @@ function FormDialogLayout({
1456
1456
  {
1457
1457
  type: "submit",
1458
1458
  disabled: isSubmitting || isDisabled,
1459
- className: "inline-flex h-9 items-center justify-center rounded-md bg-primary px-4 text-sm font-medium text-primary-foreground shadow transition-colors hover:bg-primary/90 cursor-pointer disabled:pointer-events-none disabled:opacity-50",
1459
+ className: "inline-flex h-9 items-center justify-center rounded-md bg-primary px-4 text-sm font-medium text-primary-foreground shadow-sm transition-colors hover:bg-primary/90 cursor-pointer disabled:pointer-events-none disabled:opacity-50",
1460
1460
  children: isSubmitting ? "Salvando..." : submitLabel
1461
1461
  }
1462
1462
  )
@@ -2052,19 +2052,38 @@ function ResponsiveDataView({
2052
2052
  cards,
2053
2053
  isEmpty,
2054
2054
  isLoading,
2055
+ isBusy = false,
2055
2056
  emptyIcon,
2056
2057
  emptyTitle = "Nenhum registro encontrado",
2057
2058
  emptyDescription,
2059
+ emptyAction,
2058
2060
  pagination
2059
2061
  }) {
2062
+ if (!isLoading && !isBusy && isEmpty) {
2063
+ return /* @__PURE__ */ jsx25("div", { className: "rounded-md border", children: /* @__PURE__ */ jsx25(
2064
+ EmptyState,
2065
+ {
2066
+ icon: emptyIcon,
2067
+ title: emptyTitle,
2068
+ description: emptyDescription,
2069
+ action: emptyAction
2070
+ }
2071
+ ) });
2072
+ }
2073
+ const busyClass = isBusy && "pointer-events-none opacity-50";
2060
2074
  return /* @__PURE__ */ jsxs22("div", { className: "space-y-4", children: [
2061
- /* @__PURE__ */ jsx25("div", { className: "hidden overflow-x-auto rounded-md border md:block", children: table }),
2062
- /* @__PURE__ */ jsx25("div", { className: "md:hidden", children: cards }),
2063
- !isLoading && isEmpty && /* @__PURE__ */ jsxs22("div", { className: "flex flex-col items-center justify-center py-16 text-center", children: [
2064
- emptyIcon && /* @__PURE__ */ jsx25("div", { className: "mb-4 text-muted-foreground", children: emptyIcon }),
2065
- /* @__PURE__ */ jsx25("h3", { className: "text-lg font-semibold tracking-tight", children: emptyTitle }),
2066
- emptyDescription && /* @__PURE__ */ jsx25("p", { className: "mt-1 max-w-sm text-sm text-muted-foreground", children: emptyDescription })
2067
- ] }),
2075
+ /* @__PURE__ */ jsx25(
2076
+ "div",
2077
+ {
2078
+ "aria-busy": isBusy,
2079
+ className: cn(
2080
+ "hidden overflow-x-auto rounded-md border transition-opacity md:block",
2081
+ busyClass
2082
+ ),
2083
+ children: table
2084
+ }
2085
+ ),
2086
+ /* @__PURE__ */ jsx25("div", { "aria-busy": isBusy, className: cn("transition-opacity md:hidden", busyClass), children: cards }),
2068
2087
  pagination
2069
2088
  ] });
2070
2089
  }
@@ -2263,24 +2282,24 @@ function StatCard({ label, value, detail, icon, isLoading }) {
2263
2282
  import { jsx as jsx29, jsxs as jsxs26 } from "react/jsx-runtime";
2264
2283
  var variantClasses = {
2265
2284
  neutral: {
2266
- badge: "bg-gray-100 text-gray-700 dark:bg-gray-800 dark:text-gray-300",
2267
- dot: "bg-gray-400"
2285
+ badge: "bg-[var(--status-neutral-surface,#f3f4f6)] text-[var(--status-neutral-text,#374151)]",
2286
+ dot: "bg-[var(--status-neutral,#9ca3af)]"
2268
2287
  },
2269
2288
  info: {
2270
- badge: "bg-blue-100 text-blue-700 dark:bg-blue-950 dark:text-blue-400",
2271
- dot: "bg-blue-500"
2289
+ badge: "bg-[var(--status-info-surface,#dbeafe)] text-[var(--status-info-text,#1d4ed8)]",
2290
+ dot: "bg-[var(--status-info,#3b82f6)]"
2272
2291
  },
2273
2292
  success: {
2274
- badge: "bg-green-100 text-green-700 dark:bg-green-950 dark:text-green-400",
2275
- dot: "bg-green-500"
2293
+ badge: "bg-[var(--status-success-surface,#dcfce7)] text-[var(--status-success-text,#15803d)]",
2294
+ dot: "bg-[var(--status-success,#22c55e)]"
2276
2295
  },
2277
2296
  danger: {
2278
- badge: "bg-red-100 text-red-700 dark:bg-red-950 dark:text-red-400",
2279
- dot: "bg-red-500"
2297
+ badge: "bg-[var(--status-danger-surface,#fee2e2)] text-[var(--status-danger-text,#b91c1c)]",
2298
+ dot: "bg-[var(--status-danger,#ef4444)]"
2280
2299
  },
2281
2300
  warning: {
2282
- badge: "bg-amber-100 text-amber-700 dark:bg-amber-950 dark:text-amber-400",
2283
- dot: "bg-amber-500"
2301
+ badge: "bg-[var(--status-warning-surface,#fef3c7)] text-[var(--status-warning-text,#b45309)]",
2302
+ dot: "bg-[var(--status-warning,#f59e0b)]"
2284
2303
  }
2285
2304
  };
2286
2305
  function StatusBadge({
@@ -2324,7 +2343,12 @@ function StatusDot({ active, label, className }) {
2324
2343
  // src/components/table-skeleton.tsx
2325
2344
  import { Fragment as Fragment7, jsx as jsx31 } from "react/jsx-runtime";
2326
2345
  function TableSkeleton({ rows = 5, columns = 4 }) {
2327
- return /* @__PURE__ */ jsx31(Fragment7, { children: Array.from({ length: rows }).map((_, i) => /* @__PURE__ */ jsx31("tr", { className: "border-b transition-colors", children: Array.from({ length: columns }).map((_2, j) => /* @__PURE__ */ jsx31("td", { className: "p-4 align-middle", children: /* @__PURE__ */ jsx31("div", { className: "h-5 w-full animate-pulse rounded bg-muted" }) }, j)) }, i)) });
2346
+ return /* @__PURE__ */ jsx31(Fragment7, { children: Array.from({ length: rows }).map((_, i) => (
2347
+ // p-2/h-4 espelha o TableCell real. Com p-4/h-5 a linha do skeleton
2348
+ // ficava ~16px mais alta que a linha de dados, e a tabela encolhia
2349
+ // visivelmente quando a resposta chegava.
2350
+ /* @__PURE__ */ jsx31("tr", { className: "border-b transition-colors", children: Array.from({ length: columns }).map((_2, j) => /* @__PURE__ */ jsx31("td", { className: "p-2 align-middle first:pl-4 last:pr-4", children: /* @__PURE__ */ jsx31("div", { className: "h-4 w-full animate-pulse rounded bg-muted" }) }, j)) }, i)
2351
+ )) });
2328
2352
  }
2329
2353
 
2330
2354
  // src/components/toaster.tsx