@motor-hero/ui-kit 0.46.1 → 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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@motor-hero/ui-kit",
3
- "version": "0.46.1",
3
+ "version": "0.47.0",
4
4
  "description": "Componentes React reutilizáveis para o ecossistema MotorHero — shadcn/ui + Tailwind CSS v4",
5
5
  "author": "MotorHero",
6
6
  "license": "UNLICENSED",
@@ -58,15 +58,26 @@ export interface BaseDialogProps {
58
58
 
59
59
  /**
60
60
  * Standardized, responsive dialog shell:
61
- * - mobile: bottom sheet (full width, up to 92dvh tall)
61
+ * - mobile: bottom sheet that can grow to nearly the whole screen
62
62
  * - desktop: centered dialog (up to 92dvh tall)
63
63
  * Header and footer stay fixed; only the body scrolls.
64
64
  *
65
+ * The mobile ceiling is the screen minus a slim top gap (safe area or
66
+ * 0.75rem, whichever is larger): a long form gets virtually the whole
67
+ * screen — the old 92dvh cap wasted ~70px on the one device where height is
68
+ * scarce — while the rounded top and the sliver of scrim above it keep the
69
+ * sheet language every other mobile surface in this kit speaks (combobox,
70
+ * pickers, menus are all `rounded-t-2xl` bottom sheets). An edge-to-edge
71
+ * square dialog here read as a foreign screen, not a layer of this app.
72
+ * Short dialogs still hug their content instead of stretching.
73
+ *
65
74
  * Heights use `dvh`, not `vh`: on iOS `vh` is locked to the large viewport
66
- * (toolbars collapsed), so `92vh` can exceed the visible area by 10-15%. With
67
- * the sheet anchored to `bottom-0` the overflow leaves through the top, and
68
- * since the body is the only scrollable child, what goes off-screen is the
69
- * header - title and close button. Does not reproduce outside real iOS.
75
+ * (toolbars collapsed), so a `vh` cap can exceed the visible area by
76
+ * 10-15%. With the sheet anchored to `bottom-0` the overflow leaves
77
+ * through the top, and since the body is the only scrollable child, what
78
+ * goes off-screen is the header - title and close button. Does not
79
+ * reproduce outside real iOS. The footer pads for the home indicator
80
+ * (`env(safe-area-inset-bottom)`); the top gap already clears the notch.
70
81
  *
71
82
  * Also fixes the known Radix bug where `body { pointer-events: none }`
72
83
  * can persist after closing a dialog that contained a Select/Popover,
@@ -119,7 +130,7 @@ export function BaseDialog({
119
130
  </div>
120
131
  <div className="min-h-0 flex-1 overflow-y-auto px-6 py-4">{children}</div>
121
132
  {footer && (
122
- <div className="flex shrink-0 flex-col-reverse gap-2 border-t px-6 py-3 sm:flex-row sm:justify-end">
133
+ <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">
123
134
  {footer}
124
135
  </div>
125
136
  )}
@@ -159,9 +170,13 @@ export function BaseDialog({
159
170
  document.body.style.pointerEvents = ""
160
171
  }}
161
172
  className={cn(
162
- "fixed z-50 flex max-h-[92dvh] flex-col bg-background shadow-lg outline-none",
163
- "inset-x-0 bottom-0 rounded-t-2xl",
164
- "sm:inset-x-auto sm:bottom-auto sm:left-1/2 sm:top-1/2 sm:max-h-[92dvh] sm:w-full sm:-translate-x-1/2 sm:-translate-y-1/2 sm:rounded-lg",
173
+ "fixed z-50 flex w-full flex-col bg-background shadow-lg outline-none",
174
+ "inset-x-0 bottom-0 rounded-t-2xl max-h-[calc(100dvh_-_max(0.75rem,env(safe-area-inset-top)))]",
175
+ // Entra deslizando de baixo, como os drawers (vaul) do restante do
176
+ // kit; no desktop os slides sairiam brigando com o translate de
177
+ // centralização, então ficam restritos ao mobile.
178
+ "max-sm:slide-in-from-bottom-8 max-sm:slide-out-to-bottom-8",
179
+ "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",
165
180
  "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
166
181
  sizeClasses[size],
167
182
  className,
@@ -30,7 +30,10 @@ export function Pagination({
30
30
  }: PaginationProps) {
31
31
  return (
32
32
  <div
33
- className={`flex items-center ${showPageSizeSelector ? "justify-between" : "justify-end"} gap-4 ${className ?? ""}`}
33
+ // Quebra em vez de empurrar: num celular de 360px os dois grupos não
34
+ // cabem na mesma linha e o "Próximo" saía da área visível, com a lista
35
+ // inteira rolando de lado atrás dele.
36
+ className={`flex flex-wrap items-center ${showPageSizeSelector ? "justify-between" : "justify-end"} gap-x-4 gap-y-2 ${className ?? ""}`}
34
37
  >
35
38
  {showPageSizeSelector && (
36
39
  <div className="flex items-center gap-2">