@motor-hero/ui-kit 0.32.0 → 0.32.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/dist/components/base-dialog.d.ts +8 -1
- package/dist/components/base-dialog.d.ts.map +1 -1
- package/dist/components/confirm-dialog.d.ts +12 -1
- package/dist/components/confirm-dialog.d.ts.map +1 -1
- package/dist/index.cjs +32 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +32 -13
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/base-dialog.tsx +16 -3
- package/src/components/confirm-dialog.tsx +22 -1
|
@@ -34,6 +34,13 @@ export interface BaseDialogProps {
|
|
|
34
34
|
* Defaults to true; pass false to keep the plain scrim.
|
|
35
35
|
*/
|
|
36
36
|
blurBackdrop?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Extra classes appended to the backdrop/overlay. Use it to tune the scrim
|
|
39
|
+
* per dialog, e.g. `bg-black/40` for a lighter tint or `bg-transparent` to
|
|
40
|
+
* drop the darkening and keep only the blur. Wins over the default via
|
|
41
|
+
* tailwind-merge.
|
|
42
|
+
*/
|
|
43
|
+
backdropClassName?: string;
|
|
37
44
|
/**
|
|
38
45
|
* Advanced: wraps the dialog's inner content (header + body + footer) inside
|
|
39
46
|
* Content. Used by FormDialog to inject a <form>. Defaults to identity.
|
|
@@ -50,6 +57,6 @@ export interface BaseDialogProps {
|
|
|
50
57
|
* can persist after closing a dialog that contained a Select/Popover,
|
|
51
58
|
* which would otherwise make the rest of the page unclickable.
|
|
52
59
|
*/
|
|
53
|
-
export declare function BaseDialog({ open, onOpenChange, title, description, children, footer, size, className, modal, blurBackdrop, contentWrapper, }: BaseDialogProps): React.JSX.Element;
|
|
60
|
+
export declare function BaseDialog({ open, onOpenChange, title, description, children, footer, size, className, modal, blurBackdrop, backdropClassName, contentWrapper, }: BaseDialogProps): React.JSX.Element;
|
|
54
61
|
export {};
|
|
55
62
|
//# sourceMappingURL=base-dialog.d.ts.map
|
|
@@ -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;;;OAGG;IACH,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,SAAS,KAAK,SAAS,CAAA;CACnD;AAED;;;;;;;;;GASG;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,cAAqC,GACtC,EAAE,eAAe,
|
|
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;;;;;;;;;GASG;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,qBAuFjB"}
|
|
@@ -9,7 +9,18 @@ interface ConfirmDialogProps {
|
|
|
9
9
|
cancelLabel?: string;
|
|
10
10
|
loading?: boolean;
|
|
11
11
|
variant?: "default" | "destructive";
|
|
12
|
+
/**
|
|
13
|
+
* Applies backdrop-blur to the overlay behind the dialog.
|
|
14
|
+
* Defaults to true; pass false to keep the plain scrim.
|
|
15
|
+
*/
|
|
16
|
+
blurBackdrop?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Extra classes appended to the backdrop/overlay. Use it to tune the scrim
|
|
19
|
+
* per dialog, e.g. `bg-black/40` for a lighter tint. Wins over the default
|
|
20
|
+
* via tailwind-merge.
|
|
21
|
+
*/
|
|
22
|
+
backdropClassName?: string;
|
|
12
23
|
}
|
|
13
|
-
export declare function ConfirmDialog({ open, onOpenChange, onConfirm, title, description, confirmLabel, cancelLabel, loading, variant, }: ConfirmDialogProps): import("react").JSX.Element;
|
|
24
|
+
export declare function ConfirmDialog({ open, onOpenChange, onConfirm, title, description, confirmLabel, cancelLabel, loading, variant, blurBackdrop, backdropClassName, }: ConfirmDialogProps): import("react").JSX.Element;
|
|
14
25
|
export {};
|
|
15
26
|
//# sourceMappingURL=confirm-dialog.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"confirm-dialog.d.ts","sourceRoot":"","sources":["../../src/components/confirm-dialog.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"confirm-dialog.d.ts","sourceRoot":"","sources":["../../src/components/confirm-dialog.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAItC,UAAU,kBAAkB;IAC1B,IAAI,EAAE,OAAO,CAAA;IACb,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IACrC,SAAS,EAAE,MAAM,IAAI,CAAA;IACrB,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,SAAS,CAAA;IACtB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,OAAO,CAAC,EAAE,SAAS,GAAG,aAAa,CAAA;IACnC;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC3B;AAED,wBAAgB,aAAa,CAAC,EAC5B,IAAI,EACJ,YAAY,EACZ,SAAS,EACT,KAAK,EACL,WAAW,EACX,YAA0B,EAC1B,WAAwB,EACxB,OAAe,EACf,OAAmB,EACnB,YAAmB,EACnB,iBAAiB,GAClB,EAAE,kBAAkB,+BAsCpB"}
|
package/dist/index.cjs
CHANGED
|
@@ -264,6 +264,15 @@ function EmptyState({ icon, title, description, action, className }) {
|
|
|
264
264
|
|
|
265
265
|
// src/components/confirm-dialog.tsx
|
|
266
266
|
var AlertDialog = __toESM(require("@radix-ui/react-alert-dialog"), 1);
|
|
267
|
+
|
|
268
|
+
// src/lib/utils.ts
|
|
269
|
+
var import_clsx = require("clsx");
|
|
270
|
+
var import_tailwind_merge = require("tailwind-merge");
|
|
271
|
+
function cn(...inputs) {
|
|
272
|
+
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
// src/components/confirm-dialog.tsx
|
|
267
276
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
268
277
|
function ConfirmDialog({
|
|
269
278
|
open,
|
|
@@ -274,10 +283,21 @@ function ConfirmDialog({
|
|
|
274
283
|
confirmLabel = "Confirmar",
|
|
275
284
|
cancelLabel = "Cancelar",
|
|
276
285
|
loading = false,
|
|
277
|
-
variant = "default"
|
|
286
|
+
variant = "default",
|
|
287
|
+
blurBackdrop = true,
|
|
288
|
+
backdropClassName
|
|
278
289
|
}) {
|
|
279
290
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(AlertDialog.Root, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(AlertDialog.Portal, { children: [
|
|
280
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
291
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
292
|
+
AlertDialog.Overlay,
|
|
293
|
+
{
|
|
294
|
+
className: cn(
|
|
295
|
+
"fixed inset-0 z-50 bg-black/50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
296
|
+
blurBackdrop && "backdrop-blur-sm",
|
|
297
|
+
backdropClassName
|
|
298
|
+
)
|
|
299
|
+
}
|
|
300
|
+
),
|
|
281
301
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(AlertDialog.Content, { className: "fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg", children: [
|
|
282
302
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex flex-col space-y-2 text-center sm:text-left", children: [
|
|
283
303
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(AlertDialog.Title, { className: "text-lg font-semibold", children: title }),
|
|
@@ -466,13 +486,6 @@ function useIsDesktop() {
|
|
|
466
486
|
return isDesktop;
|
|
467
487
|
}
|
|
468
488
|
|
|
469
|
-
// src/lib/utils.ts
|
|
470
|
-
var import_clsx = require("clsx");
|
|
471
|
-
var import_tailwind_merge = require("tailwind-merge");
|
|
472
|
-
function cn(...inputs) {
|
|
473
|
-
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
|
474
|
-
}
|
|
475
|
-
|
|
476
489
|
// src/components/base-dialog.tsx
|
|
477
490
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
478
491
|
var sizeClasses2 = {
|
|
@@ -498,6 +511,7 @@ function BaseDialog({
|
|
|
498
511
|
className,
|
|
499
512
|
modal,
|
|
500
513
|
blurBackdrop = true,
|
|
514
|
+
backdropClassName,
|
|
501
515
|
contentWrapper = (content) => content
|
|
502
516
|
}) {
|
|
503
517
|
const isDesktop = useIsDesktop();
|
|
@@ -534,19 +548,24 @@ function BaseDialog({
|
|
|
534
548
|
Dialog.Overlay,
|
|
535
549
|
{
|
|
536
550
|
className: cn(
|
|
537
|
-
"fixed inset-0 z-50 bg-black/
|
|
538
|
-
blurBackdrop && "backdrop-blur-sm"
|
|
551
|
+
"fixed inset-0 z-50 bg-black/50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
552
|
+
blurBackdrop && "backdrop-blur-sm",
|
|
553
|
+
backdropClassName
|
|
539
554
|
)
|
|
540
555
|
}
|
|
541
556
|
) : (
|
|
542
557
|
// Radix skips Dialog.Overlay when non-modal, so the backdrop is
|
|
543
558
|
// rendered by hand; pointer-events-none keeps outside interactions
|
|
544
559
|
// working (the reason the dialog is non-modal on desktop).
|
|
545
|
-
blurBackdrop && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
560
|
+
(blurBackdrop || backdropClassName) && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
546
561
|
"div",
|
|
547
562
|
{
|
|
548
563
|
"aria-hidden": true,
|
|
549
|
-
className:
|
|
564
|
+
className: cn(
|
|
565
|
+
"pointer-events-none fixed inset-0 z-50 bg-black/50 animate-in fade-in-0",
|
|
566
|
+
blurBackdrop && "backdrop-blur-sm",
|
|
567
|
+
backdropClassName
|
|
568
|
+
)
|
|
550
569
|
}
|
|
551
570
|
)
|
|
552
571
|
),
|