@eqtylab/equality 2.2.1 → 2.2.2

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.cjs CHANGED
@@ -550,6 +550,7 @@ function Badge({
550
550
  size,
551
551
  closeable,
552
552
  handleClosable,
553
+ closeLabel = "Remove",
553
554
  truncate = false,
554
555
  truncateLength = 50,
555
556
  icon,
@@ -560,18 +561,19 @@ function Badge({
560
561
  }) {
561
562
  const effectiveIcon = icon ?? (variant ? defaultVariantIcons2[variant] : void 0);
562
563
  const renderClosable = () => {
563
- if (closeable && handleClosable)
564
- return /* @__PURE__ */ jsxRuntime.jsx(
565
- Button,
566
- {
567
- variant: "tertiary",
568
- size: "sm",
569
- onClick: handleClosable,
570
- className: styles7__default.default["closable-btn"],
571
- children: /* @__PURE__ */ jsxRuntime.jsx(XIcon, {})
572
- }
573
- );
574
- return null;
564
+ if (!closeable) return null;
565
+ return /* @__PURE__ */ jsxRuntime.jsx(
566
+ Button,
567
+ {
568
+ type: "button",
569
+ variant: "tertiary",
570
+ size: "sm",
571
+ onClick: handleClosable,
572
+ "aria-label": closeLabel,
573
+ className: styles7__default.default["closable-btn"],
574
+ children: /* @__PURE__ */ jsxRuntime.jsx(XIcon, {})
575
+ }
576
+ );
575
577
  };
576
578
  const renderChildren = () => {
577
579
  const children = props.children;
@@ -849,6 +851,7 @@ var ResourceBadge = ({
849
851
  display = "both",
850
852
  closeable,
851
853
  handleClosable,
854
+ closeLabel,
852
855
  children
853
856
  }) => {
854
857
  const config = getTypeConfig(type);
@@ -861,6 +864,7 @@ var ResourceBadge = ({
861
864
  variant: null,
862
865
  closeable,
863
866
  handleClosable,
867
+ closeLabel,
864
868
  children: children ?? config.label
865
869
  }
866
870
  );