@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/dist/components/base-dialog.d.ts +16 -5
- package/dist/components/base-dialog.d.ts.map +1 -1
- package/dist/components/pagination.d.ts.map +1 -1
- package/dist/index.cjs +9 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +9 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/base-dialog.tsx +24 -9
- package/src/components/pagination.tsx +4 -1
|
@@ -49,15 +49,26 @@ export interface BaseDialogProps {
|
|
|
49
49
|
}
|
|
50
50
|
/**
|
|
51
51
|
* Standardized, responsive dialog shell:
|
|
52
|
-
* - mobile: bottom sheet
|
|
52
|
+
* - mobile: bottom sheet that can grow to nearly the whole screen
|
|
53
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
|
+
*
|
|
56
65
|
* Heights use `dvh`, not `vh`: on iOS `vh` is locked to the large viewport
|
|
57
|
-
* (toolbars collapsed), so `
|
|
58
|
-
* the sheet anchored to `bottom-0` the overflow leaves
|
|
59
|
-
* since the body is the only scrollable child, what
|
|
60
|
-
* header - title and close button. Does not
|
|
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.
|
|
61
72
|
*
|
|
62
73
|
* Also fixes the known Radix bug where `body { pointer-events: none }`
|
|
63
74
|
* can persist after closing a dialog that contained a Select/Popover,
|
|
@@ -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;AAKtC,QAAA,MAAM,WAAW;;;;;;;;;;;CAWP,CAAA;AAEV,MAAM,MAAM,cAAc,GAAG,MAAM,OAAO,WAAW,CAAA;AAErD,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,OAAO,CAAA;IACb,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IACrC,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,SAAS,CAAA;IACvB,QAAQ,EAAE,SAAS,CAAA;IACnB,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,IAAI,CAAC,EAAE,cAAc,CAAA;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;;;OAKG;IACH,KAAK,CAAC,EAAE,OAAO,CAAA;IACf;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B;;;OAGG;IACH,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,SAAS,KAAK,SAAS,CAAA;CACnD;AAED
|
|
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;AAKtC,QAAA,MAAM,WAAW;;;;;;;;;;;CAWP,CAAA;AAEV,MAAM,MAAM,cAAc,GAAG,MAAM,OAAO,WAAW,CAAA;AAErD,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,OAAO,CAAA;IACb,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IACrC,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,SAAS,CAAA;IACvB,QAAQ,EAAE,SAAS,CAAA;IACnB,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,IAAI,CAAC,EAAE,cAAc,CAAA;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;;;OAKG;IACH,KAAK,CAAC,EAAE,OAAO,CAAA;IACf;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B;;;OAGG;IACH,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,SAAS,KAAK,SAAS,CAAA;CACnD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,UAAU,CAAC,EACzB,IAAI,EACJ,YAAY,EACZ,KAAK,EACL,WAAW,EACX,QAAQ,EACR,MAAM,EACN,IAAW,EACX,SAAS,EACT,KAAK,EACL,YAAmB,EACnB,iBAAiB,EACjB,cAAqC,GACtC,EAAE,eAAe,qBA2FjB"}
|
|
@@ -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,CAA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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
|
|
546
|
-
"inset-x-0 bottom-0 rounded-t-2xl",
|
|
547
|
-
|
|
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
|
|
@@ -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" }),
|