@eqtylab/equality 2.2.2 → 2.2.4

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.d.cts CHANGED
@@ -396,7 +396,7 @@ declare const DropdownMenuSubContent: React$1.ForwardRefExoticComponent<Omit<Dro
396
396
  declare const DropdownMenuContent: React$1.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
397
397
  declare const DropdownMenuItem: React$1.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuItemProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & {
398
398
  inset?: boolean;
399
- danger?: boolean;
399
+ variant?: "neutral" | "danger";
400
400
  } & React$1.RefAttributes<HTMLDivElement>>;
401
401
  declare const DropdownMenuCheckboxItem: React$1.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuCheckboxItemProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
402
402
  declare const DropdownMenuRadioItem: React$1.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuRadioItemProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
@@ -645,7 +645,7 @@ declare const SearchBar: ({ searchQuery, setSearchQuery, placeholder, className,
645
645
 
646
646
  interface SectionHeadingProps {
647
647
  className?: string;
648
- heading: string;
648
+ heading: React.ReactNode;
649
649
  description?: string;
650
650
  renderRightContent?: () => React.ReactNode;
651
651
  }
@@ -878,7 +878,7 @@ declare const TruncatedDescription: ({ className, description, maxLength, }: Tru
878
878
 
879
879
  declare const iconVariants: (props?: ({
880
880
  size?: "xs" | "sm" | "md" | "lg" | null | undefined;
881
- background?: "circle" | "square" | "transparent" | null | undefined;
881
+ background?: "square" | "circle" | "transparent" | null | undefined;
882
882
  } & class_variance_authority_types.ClassProp) | undefined) => string;
883
883
  declare const iconElevationVariants: (props?: ({
884
884
  elevation?: string | number | null | undefined;
package/dist/index.d.ts CHANGED
@@ -396,7 +396,7 @@ declare const DropdownMenuSubContent: React$1.ForwardRefExoticComponent<Omit<Dro
396
396
  declare const DropdownMenuContent: React$1.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
397
397
  declare const DropdownMenuItem: React$1.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuItemProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & {
398
398
  inset?: boolean;
399
- danger?: boolean;
399
+ variant?: "neutral" | "danger";
400
400
  } & React$1.RefAttributes<HTMLDivElement>>;
401
401
  declare const DropdownMenuCheckboxItem: React$1.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuCheckboxItemProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
402
402
  declare const DropdownMenuRadioItem: React$1.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuRadioItemProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
@@ -645,7 +645,7 @@ declare const SearchBar: ({ searchQuery, setSearchQuery, placeholder, className,
645
645
 
646
646
  interface SectionHeadingProps {
647
647
  className?: string;
648
- heading: string;
648
+ heading: React.ReactNode;
649
649
  description?: string;
650
650
  renderRightContent?: () => React.ReactNode;
651
651
  }
@@ -878,7 +878,7 @@ declare const TruncatedDescription: ({ className, description, maxLength, }: Tru
878
878
 
879
879
  declare const iconVariants: (props?: ({
880
880
  size?: "xs" | "sm" | "md" | "lg" | null | undefined;
881
- background?: "circle" | "square" | "transparent" | null | undefined;
881
+ background?: "square" | "circle" | "transparent" | null | undefined;
882
882
  } & class_variance_authority_types.ClassProp) | undefined) => string;
883
883
  declare const iconElevationVariants: (props?: ({
884
884
  elevation?: string | number | null | undefined;
package/dist/index.js CHANGED
@@ -457,19 +457,25 @@ function Badge({
457
457
  }) {
458
458
  const effectiveIcon = icon ?? (variant ? defaultVariantIcons2[variant] : void 0);
459
459
  const renderClosable = () => {
460
- if (!closeable) return null;
461
- return /* @__PURE__ */ jsx(
462
- Button,
463
- {
464
- type: "button",
465
- variant: "tertiary",
466
- size: "sm",
467
- onClick: handleClosable,
468
- "aria-label": closeLabel,
469
- className: styles7["closable-btn"],
470
- children: /* @__PURE__ */ jsx(XIcon, {})
471
- }
472
- );
460
+ if (closeable && handleClosable) {
461
+ return /* @__PURE__ */ jsx(
462
+ Button,
463
+ {
464
+ type: "button",
465
+ variant: "tertiary",
466
+ size: "sm",
467
+ onPointerDown: (e) => e.stopPropagation(),
468
+ onClick: (e) => {
469
+ e.stopPropagation();
470
+ handleClosable();
471
+ },
472
+ "aria-label": closeLabel,
473
+ className: styles7["closable-btn"],
474
+ children: /* @__PURE__ */ jsx(XIcon, {})
475
+ }
476
+ );
477
+ }
478
+ return null;
473
479
  };
474
480
  const renderChildren = () => {
475
481
  const children = props.children;
@@ -1829,14 +1835,14 @@ var DropdownMenuContent = React16.forwardRef(({ className, sideOffset = 4, ...pr
1829
1835
  }
1830
1836
  ) }));
1831
1837
  DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
1832
- var DropdownMenuItem = React16.forwardRef(({ className, inset, danger, ...props }, ref) => /* @__PURE__ */ jsx(
1838
+ var DropdownMenuItem = React16.forwardRef(({ className, inset, variant = "neutral", ...props }, ref) => /* @__PURE__ */ jsx(
1833
1839
  DropdownMenuPrimitive.Item,
1834
1840
  {
1835
1841
  ref,
1836
1842
  className: cn(
1837
1843
  styles22["dropdown-menu-item"],
1838
1844
  inset && styles22["dropdown-menu-inset"],
1839
- danger && styles22["dropdown-menu-item-danger"],
1845
+ variant === "danger" && styles22["dropdown-menu-item-danger"],
1840
1846
  className
1841
1847
  ),
1842
1848
  ...props
@@ -1927,7 +1933,7 @@ var FilterDropdown = ({
1927
1933
  (option) => option.value && option.value.trim() !== "" && option.label && option.label.trim() !== ""
1928
1934
  );
1929
1935
  return /* @__PURE__ */ jsxs(DropdownMenu, { children: [
1930
- /* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
1936
+ /* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, disabled, children: /* @__PURE__ */ jsxs(
1931
1937
  Button,
1932
1938
  {
1933
1939
  variant: "tertiary",
@@ -2971,19 +2977,15 @@ function SortSelector({
2971
2977
  !isDefaultSort && /* @__PURE__ */ jsx(Button, { variant: "link", size: "sm", onClick: handleReset, children: "Reset" })
2972
2978
  ] }),
2973
2979
  /* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
2974
- filteredOptions.map((option) => {
2975
- const isSelected = currentValue === option.value;
2976
- return /* @__PURE__ */ jsx(
2977
- DropdownMenuCheckboxItem,
2978
- {
2979
- checked: isSelected,
2980
- onCheckedChange: () => handleChange(option.value),
2981
- onSelect: (e) => e.preventDefault(),
2982
- children: option.label
2983
- },
2984
- option.value
2985
- );
2986
- })
2980
+ /* @__PURE__ */ jsx(DropdownMenuRadioGroup, { value: currentValue, onValueChange: handleChange, children: filteredOptions.map((option) => /* @__PURE__ */ jsx(
2981
+ DropdownMenuRadioItem,
2982
+ {
2983
+ value: option.value,
2984
+ onSelect: (e) => e.preventDefault(),
2985
+ children: option.label
2986
+ },
2987
+ option.value
2988
+ )) })
2987
2989
  ]
2988
2990
  }
2989
2991
  )