@motor-hero/ui-kit 0.46.0 → 0.47.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.
@@ -49,10 +49,27 @@ export interface BaseDialogProps {
49
49
  }
50
50
  /**
51
51
  * Standardized, responsive dialog shell:
52
- * - mobile: bottom sheet (full width, up to 92vh tall)
53
- * - desktop: centered dialog (up to 90vh tall)
52
+ * - mobile: bottom sheet that can grow to nearly the whole screen
53
+ * - desktop: centered dialog (up to 92dvh tall)
54
54
  * Header and footer stay fixed; only the body scrolls.
55
55
  *
56
+ * The mobile ceiling is the screen minus a slim top gap (safe area or
57
+ * 0.75rem, whichever is larger): a long form gets virtually the whole
58
+ * screen — the old 92dvh cap wasted ~70px on the one device where height is
59
+ * scarce — while the rounded top and the sliver of scrim above it keep the
60
+ * sheet language every other mobile surface in this kit speaks (combobox,
61
+ * pickers, menus are all `rounded-t-2xl` bottom sheets). An edge-to-edge
62
+ * square dialog here read as a foreign screen, not a layer of this app.
63
+ * Short dialogs still hug their content instead of stretching.
64
+ *
65
+ * Heights use `dvh`, not `vh`: on iOS `vh` is locked to the large viewport
66
+ * (toolbars collapsed), so a `vh` cap can exceed the visible area by
67
+ * 10-15%. With the sheet anchored to `bottom-0` the overflow leaves
68
+ * through the top, and since the body is the only scrollable child, what
69
+ * goes off-screen is the header - title and close button. Does not
70
+ * reproduce outside real iOS. The footer pads for the home indicator
71
+ * (`env(safe-area-inset-bottom)`); the top gap already clears the notch.
72
+ *
56
73
  * Also fixes the known Radix bug where `body { pointer-events: none }`
57
74
  * can persist after closing a dialog that contained a Select/Popover,
58
75
  * which would otherwise make the rest of the page unclickable.
@@ -1 +1 @@
1
- {"version":3,"file":"base-dialog.d.ts","sourceRoot":"","sources":["../../src/components/base-dialog.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;A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AE,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,+BAgDjB"}
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"}
package/dist/index.cjs CHANGED
@@ -506,7 +506,7 @@ function BaseDialog({
506
506
  )
507
507
  ] }),
508
508
  /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "min-h-0 flex-1 overflow-y-auto px-6 py-4", children }),
509
- footer && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "flex shrink-0 flex-col-reverse gap-2 border-t px-6 py-3 sm:flex-row sm:justify-end", children: footer })
509
+ footer && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "flex shrink-0 flex-col-reverse gap-2 border-t px-6 py-3 pb-[max(0.75rem,env(safe-area-inset-bottom))] sm:flex-row sm:justify-end", children: footer })
510
510
  ] });
511
511
  const isModal = modal ?? !isDesktop;
512
512
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Dialog.Root, { open, onOpenChange, modal: isModal, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Dialog.Portal, { children: [
@@ -542,9 +542,13 @@ function BaseDialog({
542
542
  document.body.style.pointerEvents = "";
543
543
  },
544
544
  className: cn(
545
- "fixed z-50 flex max-h-[92vh] flex-col bg-background shadow-lg outline-none",
546
- "inset-x-0 bottom-0 rounded-t-2xl",
547
- "sm:inset-x-auto sm:bottom-auto sm:left-1/2 sm:top-1/2 sm:max-h-[92vh] sm:w-full sm:-translate-x-1/2 sm:-translate-y-1/2 sm:rounded-lg",
545
+ "fixed z-50 flex w-full flex-col bg-background shadow-lg outline-none",
546
+ "inset-x-0 bottom-0 rounded-t-2xl max-h-[calc(100dvh_-_max(0.75rem,env(safe-area-inset-top)))]",
547
+ // Entra deslizando de baixo, como os drawers (vaul) do restante do
548
+ // kit; no desktop os slides sairiam brigando com o translate de
549
+ // centralização, então ficam restritos ao mobile.
550
+ "max-sm:slide-in-from-bottom-8 max-sm:slide-out-to-bottom-8",
551
+ "sm:inset-x-auto sm:bottom-auto sm:left-1/2 sm:top-1/2 sm:max-h-[92dvh] sm:-translate-x-1/2 sm:-translate-y-1/2 sm:rounded-lg",
548
552
  "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
549
553
  sizeClasses[size],
550
554
  className
@@ -884,7 +888,7 @@ function Combobox({
884
888
  import_cmdk.Command.List,
885
889
  {
886
890
  ref: listRef,
887
- className: "max-h-[50vh] overflow-y-auto overflow-x-hidden p-1 sm:max-h-60",
891
+ className: "max-h-[50dvh] overflow-y-auto overflow-x-hidden p-1 sm:max-h-60",
888
892
  children: [
889
893
  !isServer && !showCreate && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_cmdk.Command.Empty, { className: "py-6 text-center text-sm text-muted-foreground", children: emptyMessage }),
890
894
  showCreate && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
@@ -952,7 +956,7 @@ function Combobox({
952
956
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_vaul2.Drawer.Trigger, { asChild: true, children: trigger }),
953
957
  /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_vaul2.Drawer.Portal, { children: [
954
958
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_vaul2.Drawer.Overlay, { className: "fixed inset-0 z-50 bg-black/80" }),
955
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_vaul2.Drawer.Content, { className: "fixed inset-x-0 bottom-0 z-50 mt-24 flex max-h-[85vh] flex-col rounded-t-2xl border bg-popover text-popover-foreground outline-none", children: [
959
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_vaul2.Drawer.Content, { className: "fixed inset-x-0 bottom-0 z-50 mt-24 flex max-h-[85dvh] flex-col rounded-t-2xl border bg-popover text-popover-foreground outline-none", children: [
956
960
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_vaul2.Drawer.Title, { className: "sr-only", children: placeholder }),
957
961
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "mx-auto my-3 h-1.5 w-12 shrink-0 rounded-full bg-muted" }),
958
962
  command
@@ -1334,7 +1338,7 @@ function DatePickerImpl({
1334
1338
  onInteractOutside: (event) => {
1335
1339
  if (triggerRef.current?.contains(event.target)) event.preventDefault();
1336
1340
  },
1337
- className: "fixed inset-x-0 bottom-0 z-50 mt-24 flex max-h-[85vh] flex-col rounded-t-2xl border bg-popover text-popover-foreground outline-none",
1341
+ className: "fixed inset-x-0 bottom-0 z-50 mt-24 flex max-h-[85dvh] flex-col rounded-t-2xl border bg-popover text-popover-foreground outline-none",
1338
1342
  children: [
1339
1343
  /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_vaul3.Drawer.Title, { className: "sr-only", children: withTime ? "Selecione a data e o hor\xE1rio" : "Selecione a data" }),
1340
1344
  /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "mx-auto my-3 h-1.5 w-12 shrink-0 rounded-full bg-muted" }),
@@ -1459,7 +1463,7 @@ function FilterPopover({
1459
1463
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_vaul4.Drawer.Trigger, { asChild: true, children: trigger }),
1460
1464
  /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_vaul4.Drawer.Portal, { children: [
1461
1465
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_vaul4.Drawer.Overlay, { className: "fixed inset-0 z-50 bg-black/80" }),
1462
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_vaul4.Drawer.Content, { className: "fixed inset-x-0 bottom-0 z-50 mt-24 flex max-h-[85vh] flex-col rounded-t-2xl border bg-popover text-popover-foreground outline-none", children: [
1466
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_vaul4.Drawer.Content, { className: "fixed inset-x-0 bottom-0 z-50 mt-24 flex max-h-[85dvh] flex-col rounded-t-2xl border bg-popover text-popover-foreground outline-none", children: [
1463
1467
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_vaul4.Drawer.Title, { className: "sr-only", children: title ?? label }),
1464
1468
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "mx-auto my-3 h-1.5 w-12 shrink-0 rounded-full bg-muted" }),
1465
1469
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "overflow-y-auto p-2", children: content })
@@ -1958,7 +1962,7 @@ function MultiCombobox({
1958
1962
  import_cmdk2.Command.List,
1959
1963
  {
1960
1964
  ref: listRef,
1961
- className: "max-h-[50vh] overflow-y-auto overflow-x-hidden p-1 sm:max-h-60",
1965
+ className: "max-h-[50dvh] overflow-y-auto overflow-x-hidden p-1 sm:max-h-60",
1962
1966
  children: [
1963
1967
  !isServer && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_cmdk2.Command.Empty, { className: "py-6 text-center text-sm text-muted-foreground", children: emptyMessage }),
1964
1968
  options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
@@ -2011,7 +2015,7 @@ function MultiCombobox({
2011
2015
  /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_vaul5.Drawer.Trigger, { asChild: true, disabled, children: trigger }),
2012
2016
  /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_vaul5.Drawer.Portal, { children: [
2013
2017
  /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_vaul5.Drawer.Overlay, { className: "fixed inset-0 z-50 bg-black/80" }),
2014
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_vaul5.Drawer.Content, { className: "fixed inset-x-0 bottom-0 z-50 mt-24 flex max-h-[85vh] flex-col rounded-t-2xl border bg-popover text-popover-foreground outline-none", children: [
2018
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_vaul5.Drawer.Content, { className: "fixed inset-x-0 bottom-0 z-50 mt-24 flex max-h-[85dvh] flex-col rounded-t-2xl border bg-popover text-popover-foreground outline-none", children: [
2015
2019
  /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_vaul5.Drawer.Title, { className: "sr-only", children: placeholder }),
2016
2020
  /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "mx-auto my-3 h-1.5 w-12 shrink-0 rounded-full bg-muted" }),
2017
2021
  command
@@ -2056,7 +2060,7 @@ function Pagination({
2056
2060
  return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
2057
2061
  "div",
2058
2062
  {
2059
- className: `flex items-center ${showPageSizeSelector ? "justify-between" : "justify-end"} gap-4 ${className ?? ""}`,
2063
+ className: `flex flex-wrap items-center ${showPageSizeSelector ? "justify-between" : "justify-end"} gap-x-4 gap-y-2 ${className ?? ""}`,
2060
2064
  children: [
2061
2065
  showPageSizeSelector && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex items-center gap-2", children: [
2062
2066
  /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("label", { htmlFor: "pagination-page-size", className: "text-sm text-muted-foreground", children: "Itens por p\xE1gina" }),