@motor-hero/ui-kit 0.28.0 → 0.30.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
@@ -405,7 +405,12 @@ var sizeClasses2 = {
405
405
  md: "sm:max-w-md",
406
406
  lg: "sm:max-w-lg",
407
407
  xl: "sm:max-w-xl",
408
- "2xl": "sm:max-w-2xl"
408
+ "2xl": "sm:max-w-2xl",
409
+ "3xl": "sm:max-w-3xl",
410
+ "4xl": "sm:max-w-4xl",
411
+ "5xl": "sm:max-w-5xl",
412
+ "6xl": "sm:max-w-6xl",
413
+ "7xl": "sm:max-w-7xl"
409
414
  };
410
415
  function BaseDialog({
411
416
  open,
@@ -736,7 +741,7 @@ function Combobox({
736
741
  "aria-describedby": ariaDescribedby,
737
742
  disabled,
738
743
  className: cn(
739
- "flex h-9 w-full cursor-pointer items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:focus-visible:ring-destructive",
744
+ "flex h-9 w-full cursor-pointer items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm transition-colors hover:border-ring/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:focus-visible:ring-destructive",
740
745
  className
741
746
  ),
742
747
  children: [
@@ -907,7 +912,7 @@ function MultiCombobox({
907
912
  }
908
913
  },
909
914
  className: cn(
910
- "flex min-h-9 w-full cursor-pointer flex-wrap items-center gap-1 rounded-md border border-input bg-transparent px-3 py-1.5 text-sm shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring aria-disabled:pointer-events-none aria-disabled:opacity-50 aria-invalid:border-destructive aria-invalid:focus-visible:ring-destructive",
915
+ "flex min-h-9 w-full cursor-pointer flex-wrap items-center gap-1 rounded-md border border-input bg-transparent px-3 py-1.5 text-sm shadow-sm transition-colors hover:border-ring/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring aria-disabled:pointer-events-none aria-disabled:opacity-50 aria-invalid:border-destructive aria-invalid:focus-visible:ring-destructive",
911
916
  className
912
917
  ),
913
918
  children: [
@@ -1025,7 +1030,7 @@ function MultiCombobox({
1025
1030
 
1026
1031
  // src/components/color-picker.tsx
1027
1032
  import * as PopoverPrimitive3 from "@radix-ui/react-popover";
1028
- import { ChevronsUpDown as ChevronsUpDown3 } from "lucide-react";
1033
+ import { ChevronsUpDown as ChevronsUpDown3, X as X3 } from "lucide-react";
1029
1034
  import * as React8 from "react";
1030
1035
  import { HexColorInput, HexColorPicker } from "react-colorful";
1031
1036
  import { jsx as jsx19, jsxs as jsxs17 } from "react/jsx-runtime";
@@ -1033,6 +1038,7 @@ function ColorPicker({
1033
1038
  value,
1034
1039
  onChange,
1035
1040
  placeholder = "Selecionar cor",
1041
+ clearable = true,
1036
1042
  disabled,
1037
1043
  id,
1038
1044
  className,
@@ -1041,6 +1047,12 @@ function ColorPicker({
1041
1047
  }) {
1042
1048
  const [open, setOpen] = React8.useState(false);
1043
1049
  const color = value || "";
1050
+ const showClear = clearable && !!color && !disabled;
1051
+ const clear = (event) => {
1052
+ event.stopPropagation();
1053
+ event.preventDefault();
1054
+ onChange("");
1055
+ };
1044
1056
  return /* @__PURE__ */ jsxs17(PopoverPrimitive3.Root, { open, onOpenChange: setOpen, children: [
1045
1057
  /* @__PURE__ */ jsx19(PopoverPrimitive3.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs17(
1046
1058
  "button",
@@ -1051,7 +1063,7 @@ function ColorPicker({
1051
1063
  "aria-describedby": ariaDescribedby,
1052
1064
  disabled,
1053
1065
  className: cn(
1054
- "flex h-9 w-full cursor-pointer items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:focus-visible:ring-destructive",
1066
+ "flex h-9 w-full cursor-pointer items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm transition-colors hover:border-ring/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:focus-visible:ring-destructive",
1055
1067
  className
1056
1068
  ),
1057
1069
  children: [
@@ -1071,7 +1083,25 @@ function ColorPicker({
1071
1083
  ),
1072
1084
  /* @__PURE__ */ jsx19("span", { className: cn("truncate", !color && "text-muted-foreground"), children: color || placeholder })
1073
1085
  ] }),
1074
- /* @__PURE__ */ jsx19(ChevronsUpDown3, { className: "h-4 w-4 shrink-0 opacity-50" })
1086
+ /* @__PURE__ */ jsxs17("span", { className: "flex shrink-0 items-center gap-1", children: [
1087
+ showClear && // Not a <button> — nesting one inside the trigger button is
1088
+ // invalid HTML.
1089
+ /* @__PURE__ */ jsx19(
1090
+ "span",
1091
+ {
1092
+ role: "button",
1093
+ tabIndex: 0,
1094
+ "aria-label": "Limpar cor",
1095
+ onClick: clear,
1096
+ onKeyDown: (event) => {
1097
+ if (event.key === "Enter" || event.key === " ") clear(event);
1098
+ },
1099
+ className: "rounded p-0.5 text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
1100
+ children: /* @__PURE__ */ jsx19(X3, { className: "h-3.5 w-3.5" })
1101
+ }
1102
+ ),
1103
+ /* @__PURE__ */ jsx19(ChevronsUpDown3, { className: "h-4 w-4 shrink-0 opacity-50" })
1104
+ ] })
1075
1105
  ]
1076
1106
  }
1077
1107
  ) }),