@motor-hero/ui-kit 0.37.3 → 0.38.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/components/responsive-data-view.d.ts +3 -1
- package/dist/components/responsive-data-view.d.ts.map +1 -1
- package/dist/components/status-badge.d.ts.map +1 -1
- package/dist/components/table-skeleton.d.ts.map +1 -1
- package/dist/index.cjs +30 -18
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +30 -18
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/confirm-dialog.tsx +1 -1
- package/src/components/form-dialog.tsx +1 -1
- package/src/components/responsive-data-view.tsx +31 -9
- package/src/components/status-badge.tsx +23 -10
- package/src/components/table-skeleton.tsx +5 -2
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
|
)
|
|
@@ -2055,16 +2055,23 @@ function ResponsiveDataView({
|
|
|
2055
2055
|
emptyIcon,
|
|
2056
2056
|
emptyTitle = "Nenhum registro encontrado",
|
|
2057
2057
|
emptyDescription,
|
|
2058
|
+
emptyAction,
|
|
2058
2059
|
pagination
|
|
2059
2060
|
}) {
|
|
2061
|
+
if (!isLoading && isEmpty) {
|
|
2062
|
+
return /* @__PURE__ */ jsx25("div", { className: "rounded-md border", children: /* @__PURE__ */ jsx25(
|
|
2063
|
+
EmptyState,
|
|
2064
|
+
{
|
|
2065
|
+
icon: emptyIcon,
|
|
2066
|
+
title: emptyTitle,
|
|
2067
|
+
description: emptyDescription,
|
|
2068
|
+
action: emptyAction
|
|
2069
|
+
}
|
|
2070
|
+
) });
|
|
2071
|
+
}
|
|
2060
2072
|
return /* @__PURE__ */ jsxs22("div", { className: "space-y-4", children: [
|
|
2061
2073
|
/* @__PURE__ */ jsx25("div", { className: "hidden overflow-x-auto rounded-md border md:block", children: table }),
|
|
2062
2074
|
/* @__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
|
-
] }),
|
|
2068
2075
|
pagination
|
|
2069
2076
|
] });
|
|
2070
2077
|
}
|
|
@@ -2263,24 +2270,24 @@ function StatCard({ label, value, detail, icon, isLoading }) {
|
|
|
2263
2270
|
import { jsx as jsx29, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
2264
2271
|
var variantClasses = {
|
|
2265
2272
|
neutral: {
|
|
2266
|
-
badge: "bg-
|
|
2267
|
-
dot: "bg-
|
|
2273
|
+
badge: "bg-[var(--status-neutral-surface,#f3f4f6)] text-[var(--status-neutral-text,#374151)]",
|
|
2274
|
+
dot: "bg-[var(--status-neutral,#9ca3af)]"
|
|
2268
2275
|
},
|
|
2269
2276
|
info: {
|
|
2270
|
-
badge: "bg-
|
|
2271
|
-
dot: "bg-
|
|
2277
|
+
badge: "bg-[var(--status-info-surface,#dbeafe)] text-[var(--status-info-text,#1d4ed8)]",
|
|
2278
|
+
dot: "bg-[var(--status-info,#3b82f6)]"
|
|
2272
2279
|
},
|
|
2273
2280
|
success: {
|
|
2274
|
-
badge: "bg-
|
|
2275
|
-
dot: "bg-
|
|
2281
|
+
badge: "bg-[var(--status-success-surface,#dcfce7)] text-[var(--status-success-text,#15803d)]",
|
|
2282
|
+
dot: "bg-[var(--status-success,#22c55e)]"
|
|
2276
2283
|
},
|
|
2277
2284
|
danger: {
|
|
2278
|
-
badge: "bg-
|
|
2279
|
-
dot: "bg-
|
|
2285
|
+
badge: "bg-[var(--status-danger-surface,#fee2e2)] text-[var(--status-danger-text,#b91c1c)]",
|
|
2286
|
+
dot: "bg-[var(--status-danger,#ef4444)]"
|
|
2280
2287
|
},
|
|
2281
2288
|
warning: {
|
|
2282
|
-
badge: "bg-
|
|
2283
|
-
dot: "bg-
|
|
2289
|
+
badge: "bg-[var(--status-warning-surface,#fef3c7)] text-[var(--status-warning-text,#b45309)]",
|
|
2290
|
+
dot: "bg-[var(--status-warning,#f59e0b)]"
|
|
2284
2291
|
}
|
|
2285
2292
|
};
|
|
2286
2293
|
function StatusBadge({
|
|
@@ -2324,7 +2331,12 @@ function StatusDot({ active, label, className }) {
|
|
|
2324
2331
|
// src/components/table-skeleton.tsx
|
|
2325
2332
|
import { Fragment as Fragment7, jsx as jsx31 } from "react/jsx-runtime";
|
|
2326
2333
|
function TableSkeleton({ rows = 5, columns = 4 }) {
|
|
2327
|
-
return /* @__PURE__ */ jsx31(Fragment7, { children: Array.from({ length: rows }).map((_, i) =>
|
|
2334
|
+
return /* @__PURE__ */ jsx31(Fragment7, { children: Array.from({ length: rows }).map((_, i) => (
|
|
2335
|
+
// p-2/h-4 espelha o TableCell real. Com p-4/h-5 a linha do skeleton
|
|
2336
|
+
// ficava ~16px mais alta que a linha de dados, e a tabela encolhia
|
|
2337
|
+
// visivelmente quando a resposta chegava.
|
|
2338
|
+
/* @__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)
|
|
2339
|
+
)) });
|
|
2328
2340
|
}
|
|
2329
2341
|
|
|
2330
2342
|
// src/components/toaster.tsx
|