@motor-hero/ui-kit 0.30.0 → 0.32.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/index.js CHANGED
@@ -422,6 +422,7 @@ function BaseDialog({
422
422
  size = "lg",
423
423
  className,
424
424
  modal,
425
+ blurBackdrop = true,
425
426
  contentWrapper = (content) => content
426
427
  }) {
427
428
  const isDesktop = useIsDesktop();
@@ -452,8 +453,28 @@ function BaseDialog({
452
453
  /* @__PURE__ */ jsx10("div", { className: "min-h-0 flex-1 overflow-y-auto px-6 py-4", children }),
453
454
  footer && /* @__PURE__ */ jsx10("div", { className: "flex shrink-0 flex-col-reverse gap-2 border-t px-6 py-3 sm:flex-row sm:justify-end", children: footer })
454
455
  ] });
455
- return /* @__PURE__ */ jsx10(Dialog.Root, { open, onOpenChange, modal: modal ?? !isDesktop, children: /* @__PURE__ */ jsxs9(Dialog.Portal, { children: [
456
- /* @__PURE__ */ jsx10(Dialog.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" }),
456
+ const isModal = modal ?? !isDesktop;
457
+ return /* @__PURE__ */ jsx10(Dialog.Root, { open, onOpenChange, modal: isModal, children: /* @__PURE__ */ jsxs9(Dialog.Portal, { children: [
458
+ isModal ? /* @__PURE__ */ jsx10(
459
+ Dialog.Overlay,
460
+ {
461
+ 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"
464
+ )
465
+ }
466
+ ) : (
467
+ // Radix skips Dialog.Overlay when non-modal, so the backdrop is
468
+ // rendered by hand; pointer-events-none keeps outside interactions
469
+ // working (the reason the dialog is non-modal on desktop).
470
+ blurBackdrop && /* @__PURE__ */ jsx10(
471
+ "div",
472
+ {
473
+ "aria-hidden": true,
474
+ className: "pointer-events-none fixed inset-0 z-50 bg-black/80 backdrop-blur-sm animate-in fade-in-0"
475
+ }
476
+ )
477
+ ),
457
478
  /* @__PURE__ */ jsx10(
458
479
  Dialog.Content,
459
480
  {
@@ -1032,13 +1053,18 @@ function MultiCombobox({
1032
1053
  import * as PopoverPrimitive3 from "@radix-ui/react-popover";
1033
1054
  import { ChevronsUpDown as ChevronsUpDown3, X as X3 } from "lucide-react";
1034
1055
  import * as React8 from "react";
1035
- import { HexColorInput, HexColorPicker } from "react-colorful";
1056
+ import {
1057
+ HexAlphaColorPicker,
1058
+ HexColorInput,
1059
+ HexColorPicker
1060
+ } from "react-colorful";
1036
1061
  import { jsx as jsx19, jsxs as jsxs17 } from "react/jsx-runtime";
1037
1062
  function ColorPicker({
1038
1063
  value,
1039
1064
  onChange,
1040
1065
  placeholder = "Selecionar cor",
1041
1066
  clearable = true,
1067
+ alpha = false,
1042
1068
  disabled,
1043
1069
  id,
1044
1070
  className,
@@ -1072,12 +1098,11 @@ function ColorPicker({
1072
1098
  "span",
1073
1099
  {
1074
1100
  "aria-hidden": true,
1075
- className: cn(
1076
- "h-5 w-5 shrink-0 rounded border border-border",
1077
- !color && "bg-[length:8px_8px] bg-[position:0_0,4px_4px]"
1078
- ),
1079
- style: color ? { backgroundColor: color } : {
1080
- backgroundImage: "linear-gradient(45deg,var(--color-muted) 25%,transparent 25%,transparent 75%,var(--color-muted) 75%),linear-gradient(45deg,var(--color-muted) 25%,transparent 25%,transparent 75%,var(--color-muted) 75%)"
1101
+ className: "h-5 w-5 shrink-0 rounded border border-border bg-[length:8px_8px] bg-[position:0_0,4px_4px]",
1102
+ style: {
1103
+ // The checkerboard stays under the color layer so a
1104
+ // translucent value reads as translucent in the swatch.
1105
+ backgroundImage: `${color ? `linear-gradient(${color},${color}),` : ""}linear-gradient(45deg,var(--color-muted) 25%,transparent 25%,transparent 75%,var(--color-muted) 75%),linear-gradient(45deg,var(--color-muted) 25%,transparent 25%,transparent 75%,var(--color-muted) 75%)`
1081
1106
  }
1082
1107
  }
1083
1108
  ),
@@ -1112,7 +1137,7 @@ function ColorPicker({
1112
1137
  sideOffset: 4,
1113
1138
  className: "z-50 w-56 rounded-md border bg-popover p-3 text-popover-foreground shadow-md",
1114
1139
  children: /* @__PURE__ */ jsxs17("div", { className: "mh-color-picker flex flex-col gap-3", children: [
1115
- /* @__PURE__ */ jsx19(HexColorPicker, { color, onChange }),
1140
+ alpha ? /* @__PURE__ */ jsx19(HexAlphaColorPicker, { color, onChange }) : /* @__PURE__ */ jsx19(HexColorPicker, { color, onChange }),
1116
1141
  /* @__PURE__ */ jsxs17("div", { className: "flex items-center gap-2", children: [
1117
1142
  /* @__PURE__ */ jsx19("span", { className: "text-sm text-muted-foreground", children: "#" }),
1118
1143
  /* @__PURE__ */ jsx19(
@@ -1121,6 +1146,7 @@ function ColorPicker({
1121
1146
  color,
1122
1147
  onChange,
1123
1148
  prefixed: false,
1149
+ alpha,
1124
1150
  className: "flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm uppercase shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
1125
1151
  }
1126
1152
  )