@motor-hero/ui-kit 0.37.4 → 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
|
@@ -7,8 +7,10 @@ interface ResponsiveDataViewProps {
|
|
|
7
7
|
emptyIcon?: ReactNode;
|
|
8
8
|
emptyTitle?: string;
|
|
9
9
|
emptyDescription?: string;
|
|
10
|
+
/** CTA do estado vazio — normalmente o mesmo botão "Adicionar X" da página. */
|
|
11
|
+
emptyAction?: ReactNode;
|
|
10
12
|
pagination?: ReactNode;
|
|
11
13
|
}
|
|
12
|
-
export declare function ResponsiveDataView({ table, cards, isEmpty, isLoading, emptyIcon, emptyTitle, emptyDescription, pagination, }: ResponsiveDataViewProps): import("react").JSX.Element;
|
|
14
|
+
export declare function ResponsiveDataView({ table, cards, isEmpty, isLoading, emptyIcon, emptyTitle, emptyDescription, emptyAction, pagination, }: ResponsiveDataViewProps): import("react").JSX.Element;
|
|
13
15
|
export {};
|
|
14
16
|
//# sourceMappingURL=responsive-data-view.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"responsive-data-view.d.ts","sourceRoot":"","sources":["../../src/components/responsive-data-view.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"responsive-data-view.d.ts","sourceRoot":"","sources":["../../src/components/responsive-data-view.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGtC,UAAU,uBAAuB;IAC/B,KAAK,EAAE,SAAS,CAAA;IAChB,KAAK,EAAE,SAAS,CAAA;IAChB,OAAO,EAAE,OAAO,CAAA;IAChB,SAAS,EAAE,OAAO,CAAA;IAClB,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,+EAA+E;IAC/E,WAAW,CAAC,EAAE,SAAS,CAAA;IACvB,UAAU,CAAC,EAAE,SAAS,CAAA;CACvB;AAED,wBAAgB,kBAAkB,CAAC,EACjC,KAAK,EACL,KAAK,EACL,OAAO,EACP,SAAS,EACT,SAAS,EACT,UAAyC,EACzC,gBAAgB,EAChB,WAAW,EACX,UAAU,GACX,EAAE,uBAAuB,+BA0BzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status-badge.d.ts","sourceRoot":"","sources":["../../src/components/status-badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,MAAM,MAAM,kBAAkB,GAC1B,SAAS,GACT,MAAM,GACN,SAAS,GACT,QAAQ,GACR,SAAS,CAAA;AAEb,UAAU,gBAAgB;IACxB,OAAO,CAAC,EAAE,kBAAkB,CAAA;IAC5B,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,SAAS,CAAA;CACpB;
|
|
1
|
+
{"version":3,"file":"status-badge.d.ts","sourceRoot":"","sources":["../../src/components/status-badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,MAAM,MAAM,kBAAkB,GAC1B,SAAS,GACT,MAAM,GACN,SAAS,GACT,QAAQ,GACR,SAAS,CAAA;AAEb,UAAU,gBAAgB;IACxB,OAAO,CAAC,EAAE,kBAAkB,CAAA;IAC5B,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,SAAS,CAAA;CACpB;AAyCD,wBAAgB,WAAW,CAAC,EAC1B,OAAmB,EACnB,GAAU,EACV,SAAS,EACT,QAAQ,GACT,EAAE,gBAAgB,+BAelB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-skeleton.d.ts","sourceRoot":"","sources":["../../src/components/table-skeleton.tsx"],"names":[],"mappings":"AAAA,UAAU,kBAAkB;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,wBAAgB,aAAa,CAAC,EAAE,IAAQ,EAAE,OAAW,EAAE,EAAE,kBAAkB,+
|
|
1
|
+
{"version":3,"file":"table-skeleton.d.ts","sourceRoot":"","sources":["../../src/components/table-skeleton.tsx"],"names":[],"mappings":"AAAA,UAAU,kBAAkB;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,wBAAgB,aAAa,CAAC,EAAE,IAAQ,EAAE,OAAW,EAAE,EAAE,kBAAkB,+BAiB1E"}
|
package/dist/index.cjs
CHANGED
|
@@ -980,7 +980,7 @@ function ConfirmDialog({
|
|
|
980
980
|
{
|
|
981
981
|
onClick: onConfirm,
|
|
982
982
|
disabled: loading,
|
|
983
|
-
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"}`,
|
|
983
|
+
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"}`,
|
|
984
984
|
children: loading ? "Aguarde..." : confirmLabel
|
|
985
985
|
}
|
|
986
986
|
)
|
|
@@ -1533,7 +1533,7 @@ function FormDialogLayout({
|
|
|
1533
1533
|
{
|
|
1534
1534
|
type: "submit",
|
|
1535
1535
|
disabled: isSubmitting || isDisabled,
|
|
1536
|
-
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",
|
|
1536
|
+
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",
|
|
1537
1537
|
children: isSubmitting ? "Salvando..." : submitLabel
|
|
1538
1538
|
}
|
|
1539
1539
|
)
|
|
@@ -2132,16 +2132,23 @@ function ResponsiveDataView({
|
|
|
2132
2132
|
emptyIcon,
|
|
2133
2133
|
emptyTitle = "Nenhum registro encontrado",
|
|
2134
2134
|
emptyDescription,
|
|
2135
|
+
emptyAction,
|
|
2135
2136
|
pagination
|
|
2136
2137
|
}) {
|
|
2138
|
+
if (!isLoading && isEmpty) {
|
|
2139
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "rounded-md border", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2140
|
+
EmptyState,
|
|
2141
|
+
{
|
|
2142
|
+
icon: emptyIcon,
|
|
2143
|
+
title: emptyTitle,
|
|
2144
|
+
description: emptyDescription,
|
|
2145
|
+
action: emptyAction
|
|
2146
|
+
}
|
|
2147
|
+
) });
|
|
2148
|
+
}
|
|
2137
2149
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "space-y-4", children: [
|
|
2138
2150
|
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "hidden overflow-x-auto rounded-md border md:block", children: table }),
|
|
2139
2151
|
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "md:hidden", children: cards }),
|
|
2140
|
-
!isLoading && isEmpty && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex flex-col items-center justify-center py-16 text-center", children: [
|
|
2141
|
-
emptyIcon && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "mb-4 text-muted-foreground", children: emptyIcon }),
|
|
2142
|
-
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("h3", { className: "text-lg font-semibold tracking-tight", children: emptyTitle }),
|
|
2143
|
-
emptyDescription && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "mt-1 max-w-sm text-sm text-muted-foreground", children: emptyDescription })
|
|
2144
|
-
] }),
|
|
2145
2152
|
pagination
|
|
2146
2153
|
] });
|
|
2147
2154
|
}
|
|
@@ -2340,24 +2347,24 @@ function StatCard({ label, value, detail, icon, isLoading }) {
|
|
|
2340
2347
|
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
2341
2348
|
var variantClasses = {
|
|
2342
2349
|
neutral: {
|
|
2343
|
-
badge: "bg-
|
|
2344
|
-
dot: "bg-
|
|
2350
|
+
badge: "bg-[var(--status-neutral-surface,#f3f4f6)] text-[var(--status-neutral-text,#374151)]",
|
|
2351
|
+
dot: "bg-[var(--status-neutral,#9ca3af)]"
|
|
2345
2352
|
},
|
|
2346
2353
|
info: {
|
|
2347
|
-
badge: "bg-
|
|
2348
|
-
dot: "bg-
|
|
2354
|
+
badge: "bg-[var(--status-info-surface,#dbeafe)] text-[var(--status-info-text,#1d4ed8)]",
|
|
2355
|
+
dot: "bg-[var(--status-info,#3b82f6)]"
|
|
2349
2356
|
},
|
|
2350
2357
|
success: {
|
|
2351
|
-
badge: "bg-
|
|
2352
|
-
dot: "bg-
|
|
2358
|
+
badge: "bg-[var(--status-success-surface,#dcfce7)] text-[var(--status-success-text,#15803d)]",
|
|
2359
|
+
dot: "bg-[var(--status-success,#22c55e)]"
|
|
2353
2360
|
},
|
|
2354
2361
|
danger: {
|
|
2355
|
-
badge: "bg-
|
|
2356
|
-
dot: "bg-
|
|
2362
|
+
badge: "bg-[var(--status-danger-surface,#fee2e2)] text-[var(--status-danger-text,#b91c1c)]",
|
|
2363
|
+
dot: "bg-[var(--status-danger,#ef4444)]"
|
|
2357
2364
|
},
|
|
2358
2365
|
warning: {
|
|
2359
|
-
badge: "bg-
|
|
2360
|
-
dot: "bg-
|
|
2366
|
+
badge: "bg-[var(--status-warning-surface,#fef3c7)] text-[var(--status-warning-text,#b45309)]",
|
|
2367
|
+
dot: "bg-[var(--status-warning,#f59e0b)]"
|
|
2361
2368
|
}
|
|
2362
2369
|
};
|
|
2363
2370
|
function StatusBadge({
|
|
@@ -2401,7 +2408,12 @@ function StatusDot({ active, label, className }) {
|
|
|
2401
2408
|
// src/components/table-skeleton.tsx
|
|
2402
2409
|
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
2403
2410
|
function TableSkeleton({ rows = 5, columns = 4 }) {
|
|
2404
|
-
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_jsx_runtime31.Fragment, { children: Array.from({ length: rows }).map((_, i) =>
|
|
2411
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_jsx_runtime31.Fragment, { children: Array.from({ length: rows }).map((_, i) => (
|
|
2412
|
+
// p-2/h-4 espelha o TableCell real. Com p-4/h-5 a linha do skeleton
|
|
2413
|
+
// ficava ~16px mais alta que a linha de dados, e a tabela encolhia
|
|
2414
|
+
// visivelmente quando a resposta chegava.
|
|
2415
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("tr", { className: "border-b transition-colors", children: Array.from({ length: columns }).map((_2, j) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("td", { className: "p-2 align-middle first:pl-4 last:pr-4", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "h-4 w-full animate-pulse rounded bg-muted" }) }, j)) }, i)
|
|
2416
|
+
)) });
|
|
2405
2417
|
}
|
|
2406
2418
|
|
|
2407
2419
|
// src/components/toaster.tsx
|