@motor-hero/ui-kit 0.47.0 → 0.48.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.
@@ -1 +1 @@
1
- {"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../src/components/pagination.tsx"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAA;IACZ,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IACpC,WAAW,EAAE,OAAO,CAAA;IACpB,eAAe,EAAE,OAAO,CAAA;IACxB,yFAAyF;IACzF,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,uGAAuG;IACvG,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,gBAAgB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IACzC,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAKD,wBAAgB,UAAU,CAAC,EACzB,IAAI,EACJ,YAAY,EACZ,WAAW,EACX,eAAe,EACf,UAAU,EACV,oBAA4B,EAC5B,QAAQ,EACR,gBAAgB,EAChB,eAAe,EACf,SAAS,GACV,EAAE,eAAe,+BAmDjB"}
1
+ {"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../src/components/pagination.tsx"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAA;IACZ,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IACpC,WAAW,EAAE,OAAO,CAAA;IACpB,eAAe,EAAE,OAAO,CAAA;IACxB,yFAAyF;IACzF,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,uGAAuG;IACvG,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,gBAAgB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IACzC,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAMD,wBAAgB,UAAU,CAAC,EACzB,IAAI,EACJ,YAAY,EACZ,WAAW,EACX,eAAe,EACf,UAAU,EACV,oBAA4B,EAC5B,QAAQ,EACR,gBAAgB,EAChB,eAAe,EACf,SAAS,GACV,EAAE,eAAe,+BAmDjB"}
@@ -16,7 +16,14 @@ interface ResponsiveDataViewProps {
16
16
  /** CTA do estado vazio — normalmente o mesmo botão "Adicionar X" da página. */
17
17
  emptyAction?: ReactNode;
18
18
  pagination?: ReactNode;
19
+ /**
20
+ * A partir de qual largura a tabela substitui os cards. Padrão `md`. Use
21
+ * `lg`/`xl` quando a tabela tem colunas demais para caber ao lado da barra
22
+ * lateral num tablet — os cards leem melhor do que uma tabela rolando de lado.
23
+ */
24
+ breakpoint?: ResponsiveDataViewBreakpoint;
19
25
  }
20
- export declare function ResponsiveDataView({ table, cards, isEmpty, isLoading, isBusy, emptyIcon, emptyTitle, emptyDescription, emptyAction, pagination, }: ResponsiveDataViewProps): import("react").JSX.Element;
26
+ export type ResponsiveDataViewBreakpoint = "md" | "lg" | "xl";
27
+ export declare function ResponsiveDataView({ table, cards, isEmpty, isLoading, isBusy, emptyIcon, emptyTitle, emptyDescription, emptyAction, pagination, breakpoint, }: ResponsiveDataViewProps): import("react").JSX.Element;
21
28
  export {};
22
29
  //# 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;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"}
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;IACtB;;;;OAIG;IACH,UAAU,CAAC,EAAE,4BAA4B,CAAA;CAC1C;AAED,MAAM,MAAM,4BAA4B,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;AAY7D,wBAAgB,kBAAkB,CAAC,EACjC,KAAK,EACL,KAAK,EACL,OAAO,EACP,SAAS,EACT,MAAc,EACd,SAAS,EACT,UAAyC,EACzC,gBAAgB,EAChB,WAAW,EACX,UAAU,EACV,UAAiB,GAClB,EAAE,uBAAuB,+BAqCzB"}
@@ -1 +1 @@
1
- {"version":3,"file":"row-actions-menu.d.ts","sourceRoot":"","sources":["../../src/components/row-actions-menu.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAY,MAAM,OAAO,CAAA;AAIhD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAGzC,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAGlB,QAAQ,CAAC,EAAE,SAAS,EAAE,CAAA;CACvB;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,SAAS,EAAE,CAAA;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,KAAK,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAA;IAClC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,UAAU,CAAC,EAAE,UAAU,CAAA;CACxB;AAWD,wBAAgB,cAAc,CAAC,EAC7B,OAAO,EACP,QAAgB,EAChB,KAAa,EACb,KAAe,EACf,UAA8B,GAC/B,EAAE,mBAAmB,sCA2LrB"}
1
+ {"version":3,"file":"row-actions-menu.d.ts","sourceRoot":"","sources":["../../src/components/row-actions-menu.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAY,MAAM,OAAO,CAAA;AAIhD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAGzC,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAGlB,QAAQ,CAAC,EAAE,SAAS,EAAE,CAAA;CACvB;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,SAAS,EAAE,CAAA;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,KAAK,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAA;IAClC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,UAAU,CAAC,EAAE,UAAU,CAAA;CACxB;AAYD,wBAAgB,cAAc,CAAC,EAC7B,OAAO,EACP,QAAgB,EAChB,KAAa,EACb,KAAe,EACf,UAA8B,GAC/B,EAAE,mBAAmB,sCA2LrB"}
package/dist/index.cjs CHANGED
@@ -186,7 +186,7 @@ function UserMenu({
186
186
  "button",
187
187
  {
188
188
  type: "button",
189
- className: "inline-flex h-9 w-9 items-center justify-center overflow-hidden rounded-full border border-input bg-background text-xs font-semibold shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
189
+ className: "inline-flex h-9 w-9 max-sm:h-10 max-sm:w-10 items-center justify-center overflow-hidden rounded-full border border-input bg-background text-xs font-semibold shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
190
190
  "aria-label": "Menu do usu\xE1rio",
191
191
  "data-testid": "user-menu",
192
192
  children: user?.avatarUrl ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
@@ -421,7 +421,7 @@ function AppShell({
421
421
  {
422
422
  type: "button",
423
423
  onClick: () => setMobileOpen(true),
424
- className: "inline-flex h-9 w-9 items-center justify-center rounded-md border border-input bg-background shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground md:hidden",
424
+ className: "inline-flex h-9 w-9 max-sm:h-10 max-sm:w-10 items-center justify-center rounded-md border border-input bg-background shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground md:hidden",
425
425
  "aria-label": "Abrir menu",
426
426
  children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react2.Menu, { className: "h-4 w-4" })
427
427
  }
@@ -1257,7 +1257,7 @@ function DatePickerImpl({
1257
1257
  "aria-haspopup": "dialog",
1258
1258
  "aria-expanded": open,
1259
1259
  onClick: () => setOpen(!open),
1260
- className: "absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground transition-colors hover:text-foreground disabled:pointer-events-none disabled:opacity-50",
1260
+ className: "absolute right-1 top-1/2 inline-flex size-8 -translate-y-1/2 items-center justify-center rounded-md text-muted-foreground transition-colors hover:text-foreground disabled:pointer-events-none disabled:opacity-50",
1261
1261
  children: withTime ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react7.Clock, { className: "h-4 w-4" }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react7.CalendarIcon, { className: "h-4 w-4" })
1262
1262
  }
1263
1263
  )
@@ -1788,7 +1788,7 @@ function ModeToggle() {
1788
1788
  "button",
1789
1789
  {
1790
1790
  type: "button",
1791
- className: "relative inline-flex h-9 w-9 items-center justify-center rounded-md border border-input bg-background text-sm font-medium shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
1791
+ className: "relative inline-flex h-9 w-9 max-sm:h-10 max-sm:w-10 items-center justify-center rounded-md border border-input bg-background text-sm font-medium shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
1792
1792
  "aria-label": "Alternar tema",
1793
1793
  children: [
1794
1794
  /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react9.Sun, { className: "h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0" }),
@@ -2044,7 +2044,7 @@ function PageHeader({ title, description, action, className }) {
2044
2044
 
2045
2045
  // src/components/pagination.tsx
2046
2046
  var import_jsx_runtime23 = require("react/jsx-runtime");
2047
- var navButtonClass2 = "inline-flex h-8 items-center justify-center rounded-md border border-input bg-background px-3 text-xs font-medium shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground cursor-pointer disabled:pointer-events-none disabled:opacity-50";
2047
+ var navButtonClass2 = "inline-flex h-8 max-sm:h-10 items-center justify-center rounded-md border border-input bg-background px-3 text-xs font-medium shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground cursor-pointer disabled:pointer-events-none disabled:opacity-50";
2048
2048
  function Pagination({
2049
2049
  page,
2050
2050
  onPageChange,
@@ -2070,7 +2070,7 @@ function Pagination({
2070
2070
  id: "pagination-page-size",
2071
2071
  value: pageSize,
2072
2072
  onChange: (e) => onPageSizeChange?.(Number(e.target.value)),
2073
- className: "h-8 rounded-md border border-input bg-background px-2 text-xs font-medium shadow-sm transition-colors hover:bg-accent focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring cursor-pointer",
2073
+ className: "h-8 max-sm:h-10 rounded-md border border-input bg-background px-2 text-xs font-medium shadow-sm transition-colors hover:bg-accent focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring cursor-pointer",
2074
2074
  children: (pageSizeOptions ?? []).map((size) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("option", { value: size, children: size }, size))
2075
2075
  }
2076
2076
  )
@@ -2130,7 +2130,7 @@ var PasswordInput = React9.forwardRef(({ containerClassName, className, ...props
2130
2130
  onClick: () => setVisible((prev) => !prev),
2131
2131
  "aria-label": visible ? "Ocultar senha" : "Mostrar senha",
2132
2132
  tabIndex: -1,
2133
- className: "absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground transition-colors hover:text-foreground",
2133
+ className: "absolute right-1 top-1/2 inline-flex size-8 -translate-y-1/2 items-center justify-center rounded-md text-muted-foreground transition-colors hover:text-foreground",
2134
2134
  children: visible ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react11.EyeOff, { className: "h-4 w-4" }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react11.Eye, { className: "h-4 w-4" })
2135
2135
  }
2136
2136
  )
@@ -2176,6 +2176,11 @@ function ProgressBar({
2176
2176
 
2177
2177
  // src/components/responsive-data-view.tsx
2178
2178
  var import_jsx_runtime26 = require("react/jsx-runtime");
2179
+ var BREAKPOINT_CLASSES = {
2180
+ md: { table: "md:block", cards: "md:hidden" },
2181
+ lg: { table: "lg:block", cards: "lg:hidden" },
2182
+ xl: { table: "xl:block", cards: "xl:hidden" }
2183
+ };
2179
2184
  function ResponsiveDataView({
2180
2185
  table,
2181
2186
  cards,
@@ -2186,7 +2191,8 @@ function ResponsiveDataView({
2186
2191
  emptyTitle = "Nenhum registro encontrado",
2187
2192
  emptyDescription,
2188
2193
  emptyAction,
2189
- pagination
2194
+ pagination,
2195
+ breakpoint = "md"
2190
2196
  }) {
2191
2197
  if (!isLoading && !isBusy && isEmpty) {
2192
2198
  return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "rounded-md border", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
@@ -2200,19 +2206,21 @@ function ResponsiveDataView({
2200
2206
  ) });
2201
2207
  }
2202
2208
  const busyClass = isBusy && "pointer-events-none opacity-50";
2209
+ const visibility = BREAKPOINT_CLASSES[breakpoint];
2203
2210
  return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "space-y-4", children: [
2204
2211
  /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
2205
2212
  "div",
2206
2213
  {
2207
2214
  "aria-busy": isBusy,
2208
2215
  className: cn(
2209
- "hidden overflow-x-auto rounded-md border transition-opacity md:block",
2216
+ "hidden overflow-x-auto rounded-md border transition-opacity",
2217
+ visibility.table,
2210
2218
  busyClass
2211
2219
  ),
2212
2220
  children: table
2213
2221
  }
2214
2222
  ),
2215
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { "aria-busy": isBusy, className: cn("transition-opacity md:hidden", busyClass), children: cards }),
2223
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { "aria-busy": isBusy, className: cn("transition-opacity", visibility.cards, busyClass), children: cards }),
2216
2224
  pagination
2217
2225
  ] });
2218
2226
  }
@@ -2223,7 +2231,7 @@ var import_lucide_react12 = require("lucide-react");
2223
2231
  var import_react7 = require("react");
2224
2232
  var import_vaul6 = require("vaul");
2225
2233
  var import_jsx_runtime27 = require("react/jsx-runtime");
2226
- var triggerClass = "inline-flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50";
2234
+ var triggerClass = "inline-flex h-8 w-8 max-sm:h-10 max-sm:w-10 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50";
2227
2235
  var itemClass2 = "flex w-full cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors hover:bg-accent focus:bg-accent data-[disabled]:pointer-events-none data-[disabled]:opacity-50";
2228
2236
  var sheetItemClass2 = "flex w-full cursor-pointer select-none items-center gap-3 rounded-md px-3 py-3 text-base outline-none transition-colors hover:bg-accent active:bg-accent disabled:pointer-events-none disabled:opacity-50";
2229
2237
  function RowActionsMenu({