@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/index.js CHANGED
@@ -189,6 +189,15 @@ function EmptyState({ icon, title, description, action, className }) {
189
189
 
190
190
  // src/components/confirm-dialog.tsx
191
191
  import * as AlertDialog from "@radix-ui/react-alert-dialog";
192
+
193
+ // src/lib/utils.ts
194
+ import { clsx } from "clsx";
195
+ import { twMerge } from "tailwind-merge";
196
+ function cn(...inputs) {
197
+ return twMerge(clsx(inputs));
198
+ }
199
+
200
+ // src/components/confirm-dialog.tsx
192
201
  import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
193
202
  function ConfirmDialog({
194
203
  open,
@@ -199,10 +208,21 @@ function ConfirmDialog({
199
208
  confirmLabel = "Confirmar",
200
209
  cancelLabel = "Cancelar",
201
210
  loading = false,
202
- variant = "default"
211
+ variant = "default",
212
+ blurBackdrop = true,
213
+ backdropClassName
203
214
  }) {
204
215
  return /* @__PURE__ */ jsx4(AlertDialog.Root, { open, onOpenChange, children: /* @__PURE__ */ jsxs3(AlertDialog.Portal, { children: [
205
- /* @__PURE__ */ jsx4(AlertDialog.Overlay, { className: "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0" }),
216
+ /* @__PURE__ */ jsx4(
217
+ AlertDialog.Overlay,
218
+ {
219
+ className: cn(
220
+ "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",
221
+ blurBackdrop && "backdrop-blur-sm",
222
+ backdropClassName
223
+ )
224
+ }
225
+ ),
206
226
  /* @__PURE__ */ jsxs3(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: [
207
227
  /* @__PURE__ */ jsxs3("div", { className: "flex flex-col space-y-2 text-center sm:text-left", children: [
208
228
  /* @__PURE__ */ jsx4(AlertDialog.Title, { className: "text-lg font-semibold", children: title }),
@@ -391,13 +411,6 @@ function useIsDesktop() {
391
411
  return isDesktop;
392
412
  }
393
413
 
394
- // src/lib/utils.ts
395
- import { clsx } from "clsx";
396
- import { twMerge } from "tailwind-merge";
397
- function cn(...inputs) {
398
- return twMerge(clsx(inputs));
399
- }
400
-
401
414
  // src/components/base-dialog.tsx
402
415
  import { Fragment, jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
403
416
  var sizeClasses2 = {
@@ -423,6 +436,7 @@ function BaseDialog({
423
436
  className,
424
437
  modal,
425
438
  blurBackdrop = true,
439
+ backdropClassName,
426
440
  contentWrapper = (content) => content
427
441
  }) {
428
442
  const isDesktop = useIsDesktop();
@@ -459,19 +473,24 @@ function BaseDialog({
459
473
  Dialog.Overlay,
460
474
  {
461
475
  className: cn(
462
- "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
463
- blurBackdrop && "backdrop-blur-sm"
476
+ "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",
477
+ blurBackdrop && "backdrop-blur-sm",
478
+ backdropClassName
464
479
  )
465
480
  }
466
481
  ) : (
467
482
  // Radix skips Dialog.Overlay when non-modal, so the backdrop is
468
483
  // rendered by hand; pointer-events-none keeps outside interactions
469
484
  // working (the reason the dialog is non-modal on desktop).
470
- blurBackdrop && /* @__PURE__ */ jsx10(
485
+ (blurBackdrop || backdropClassName) && /* @__PURE__ */ jsx10(
471
486
  "div",
472
487
  {
473
488
  "aria-hidden": true,
474
- className: "pointer-events-none fixed inset-0 z-50 bg-black/80 backdrop-blur-sm animate-in fade-in-0"
489
+ className: cn(
490
+ "pointer-events-none fixed inset-0 z-50 bg-black/50 animate-in fade-in-0",
491
+ blurBackdrop && "backdrop-blur-sm",
492
+ backdropClassName
493
+ )
475
494
  }
476
495
  )
477
496
  ),