@motor-hero/ui-kit 0.46.0 → 0.46.1

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.0",
3
+ "version": "0.46.1",
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,10 +58,16 @@ export interface BaseDialogProps {
58
58
 
59
59
  /**
60
60
  * Standardized, responsive dialog shell:
61
- * - mobile: bottom sheet (full width, up to 92vh tall)
62
- * - desktop: centered dialog (up to 90vh tall)
61
+ * - mobile: bottom sheet (full width, up to 92dvh tall)
62
+ * - desktop: centered dialog (up to 92dvh tall)
63
63
  * Header and footer stay fixed; only the body scrolls.
64
64
  *
65
+ * 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.
70
+ *
65
71
  * Also fixes the known Radix bug where `body { pointer-events: none }`
66
72
  * can persist after closing a dialog that contained a Select/Popover,
67
73
  * which would otherwise make the rest of the page unclickable.
@@ -153,9 +159,9 @@ export function BaseDialog({
153
159
  document.body.style.pointerEvents = ""
154
160
  }}
155
161
  className={cn(
156
- "fixed z-50 flex max-h-[92vh] flex-col bg-background shadow-lg outline-none",
162
+ "fixed z-50 flex max-h-[92dvh] flex-col bg-background shadow-lg outline-none",
157
163
  "inset-x-0 bottom-0 rounded-t-2xl",
158
- "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",
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",
159
165
  "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
160
166
  sizeClasses[size],
161
167
  className,
@@ -178,7 +178,7 @@ export function Combobox({
178
178
  </div>
179
179
  <CommandPrimitive.List
180
180
  ref={listRef}
181
- className="max-h-[50vh] overflow-y-auto overflow-x-hidden p-1 sm:max-h-60"
181
+ className="max-h-[50dvh] overflow-y-auto overflow-x-hidden p-1 sm:max-h-60"
182
182
  >
183
183
  {!isServer && !showCreate && (
184
184
  <CommandPrimitive.Empty className="py-6 text-center text-sm text-muted-foreground">
@@ -260,7 +260,7 @@ export function Combobox({
260
260
  <DrawerPrimitive.Trigger asChild>{trigger}</DrawerPrimitive.Trigger>
261
261
  <DrawerPrimitive.Portal>
262
262
  <DrawerPrimitive.Overlay className="fixed inset-0 z-50 bg-black/80" />
263
- <DrawerPrimitive.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">
263
+ <DrawerPrimitive.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">
264
264
  <DrawerPrimitive.Title className="sr-only">
265
265
  {placeholder}
266
266
  </DrawerPrimitive.Title>
@@ -351,7 +351,7 @@ function DatePickerImpl({
351
351
  onInteractOutside={(event) => {
352
352
  if (triggerRef.current?.contains(event.target as Node)) event.preventDefault()
353
353
  }}
354
- 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"
354
+ 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"
355
355
  >
356
356
  <DrawerPrimitive.Title className="sr-only">
357
357
  {withTime ? "Selecione a data e o horário" : "Selecione a data"}
@@ -147,7 +147,7 @@ export function FilterPopover({
147
147
  <DrawerPrimitive.Trigger asChild>{trigger}</DrawerPrimitive.Trigger>
148
148
  <DrawerPrimitive.Portal>
149
149
  <DrawerPrimitive.Overlay className="fixed inset-0 z-50 bg-black/80" />
150
- <DrawerPrimitive.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">
150
+ <DrawerPrimitive.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">
151
151
  <DrawerPrimitive.Title className="sr-only">
152
152
  {title ?? label}
153
153
  </DrawerPrimitive.Title>
@@ -180,7 +180,7 @@ export function MultiCombobox({
180
180
  </div>
181
181
  <CommandPrimitive.List
182
182
  ref={listRef}
183
- className="max-h-[50vh] overflow-y-auto overflow-x-hidden p-1 sm:max-h-60"
183
+ className="max-h-[50dvh] overflow-y-auto overflow-x-hidden p-1 sm:max-h-60"
184
184
  >
185
185
  {!isServer && (
186
186
  <CommandPrimitive.Empty className="py-6 text-center text-sm text-muted-foreground">
@@ -248,7 +248,7 @@ export function MultiCombobox({
248
248
  </DrawerPrimitive.Trigger>
249
249
  <DrawerPrimitive.Portal>
250
250
  <DrawerPrimitive.Overlay className="fixed inset-0 z-50 bg-black/80" />
251
- <DrawerPrimitive.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">
251
+ <DrawerPrimitive.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">
252
252
  <DrawerPrimitive.Title className="sr-only">
253
253
  {placeholder}
254
254
  </DrawerPrimitive.Title>