@motor-hero/ui-kit 0.38.0 → 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.
@@ -4,6 +4,12 @@ interface ResponsiveDataViewProps {
4
4
  cards: ReactNode;
5
5
  isEmpty: boolean;
6
6
  isLoading: boolean;
7
+ /**
8
+ * Dados desatualizados na tela enquanto um refetch está em voo (ex.:
9
+ * `isPlaceholderData` do TanStack Query). Esmaece e bloqueia a interação
10
+ * com table/cards; a paginação continua clicável.
11
+ */
12
+ isBusy?: boolean;
7
13
  emptyIcon?: ReactNode;
8
14
  emptyTitle?: string;
9
15
  emptyDescription?: string;
@@ -11,6 +17,6 @@ interface ResponsiveDataViewProps {
11
17
  emptyAction?: ReactNode;
12
18
  pagination?: ReactNode;
13
19
  }
14
- export declare function ResponsiveDataView({ table, cards, isEmpty, isLoading, emptyIcon, emptyTitle, emptyDescription, emptyAction, pagination, }: ResponsiveDataViewProps): import("react").JSX.Element;
20
+ export declare function ResponsiveDataView({ table, cards, isEmpty, isLoading, isBusy, emptyIcon, emptyTitle, emptyDescription, emptyAction, pagination, }: ResponsiveDataViewProps): import("react").JSX.Element;
15
21
  export {};
16
22
  //# 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;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
+ {"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;AAKtC,UAAU,uBAAuB;IAC/B,KAAK,EAAE,SAAS,CAAA;IAChB,KAAK,EAAE,SAAS,CAAA;IAChB,OAAO,EAAE,OAAO,CAAA;IAChB,SAAS,EAAE,OAAO,CAAA;IAClB;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,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,MAAc,EACd,SAAS,EACT,UAAyC,EACzC,gBAAgB,EAChB,WAAW,EACX,UAAU,GACX,EAAE,uBAAuB,+BAmCzB"}
package/dist/index.cjs CHANGED
@@ -2129,13 +2129,14 @@ function ResponsiveDataView({
2129
2129
  cards,
2130
2130
  isEmpty,
2131
2131
  isLoading,
2132
+ isBusy = false,
2132
2133
  emptyIcon,
2133
2134
  emptyTitle = "Nenhum registro encontrado",
2134
2135
  emptyDescription,
2135
2136
  emptyAction,
2136
2137
  pagination
2137
2138
  }) {
2138
- if (!isLoading && isEmpty) {
2139
+ if (!isLoading && !isBusy && isEmpty) {
2139
2140
  return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "rounded-md border", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
2140
2141
  EmptyState,
2141
2142
  {
@@ -2146,9 +2147,20 @@ function ResponsiveDataView({
2146
2147
  }
2147
2148
  ) });
2148
2149
  }
2150
+ const busyClass = isBusy && "pointer-events-none opacity-50";
2149
2151
  return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "space-y-4", children: [
2150
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "hidden overflow-x-auto rounded-md border md:block", children: table }),
2151
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "md:hidden", children: cards }),
2152
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
2153
+ "div",
2154
+ {
2155
+ "aria-busy": isBusy,
2156
+ className: cn(
2157
+ "hidden overflow-x-auto rounded-md border transition-opacity md:block",
2158
+ busyClass
2159
+ ),
2160
+ children: table
2161
+ }
2162
+ ),
2163
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { "aria-busy": isBusy, className: cn("transition-opacity md:hidden", busyClass), children: cards }),
2152
2164
  pagination
2153
2165
  ] });
2154
2166
  }