@luscii-healthtech/web-ui 28.6.1 → 28.7.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.
@@ -1,7 +1,11 @@
1
1
  import React from "react";
2
2
  interface BadgeProps {
3
- badgeCount: number;
3
+ /**
4
+ * @deprecated, use children instead
5
+ */
6
+ badgeCount?: number;
4
7
  className?: string;
8
+ children: string | number;
5
9
  }
6
10
  declare const Badge: (props: BadgeProps) => React.JSX.Element;
7
11
  export default Badge;
@@ -2375,6 +2375,7 @@ const Avatar = ({ size = "medium", src, alt, defaultImage, initials, className }
2375
2375
  };
2376
2376
 
2377
2377
  const Badge = (props) => {
2378
+ var _a;
2378
2379
  const containerClasses = classNames__default.default([
2379
2380
  "ui-inline-flex",
2380
2381
  "ui-items-center",
@@ -2390,10 +2391,11 @@ const Badge = (props) => {
2390
2391
  "ui-text-primary",
2391
2392
  "ui-leading-none"
2392
2393
  ]);
2394
+ const badgeContent = (_a = props.children) !== null && _a !== void 0 ? _a : props.badgeCount;
2393
2395
  return React__namespace.default.createElement(
2394
2396
  "div",
2395
2397
  { className: containerClasses },
2396
- React__namespace.default.createElement("span", { className: textClasses }, props.badgeCount)
2398
+ React__namespace.default.createElement("span", { className: textClasses }, badgeContent)
2397
2399
  );
2398
2400
  };
2399
2401
 
@@ -4425,7 +4427,7 @@ const TabbarItem = ({ title, index, isSelected, onSelect, className, badgeCount
4425
4427
  "button",
4426
4428
  { className: itemClassName, onClick: handleTabClick, "data-test-id": dataTestId, role: "tab", "aria-selected": isSelected },
4427
4429
  typeof title === "string" ? React__namespace.default.createElement(Text, { variant: "strong", color: "current", inline: true, className: "ui-leading-inherit" }, title) : title,
4428
- badgeCount > 0 && React__namespace.default.createElement(Badge, { className: "ui-ml-1", badgeCount }),
4430
+ badgeCount > 0 && React__namespace.default.createElement(Badge, { className: "ui-ml-1" }, badgeCount),
4429
4431
  isLoading && React__namespace.default.createElement(LoadingIndicator, { asSpinner: true, spinnerColor: "gray", className: "ui-w-6" })
4430
4432
  );
4431
4433
  };