@hilum/ui 3.2.4 → 3.2.6
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.ts
CHANGED
|
@@ -1288,18 +1288,24 @@ declare namespace StatCardGrid {
|
|
|
1288
1288
|
}
|
|
1289
1289
|
|
|
1290
1290
|
type StatusBadgeVariant = NonNullable<React.ComponentProps<typeof Badge>["variant"]>;
|
|
1291
|
+
type StatusBadgeIcon = React.ComponentType<{
|
|
1292
|
+
className?: string;
|
|
1293
|
+
}>;
|
|
1291
1294
|
interface StatusBadgeProps extends Omit<React.ComponentProps<typeof Badge>, "children" | "variant"> {
|
|
1292
1295
|
status?: string | null;
|
|
1293
1296
|
label?: React.ReactNode;
|
|
1294
1297
|
variant?: StatusBadgeVariant;
|
|
1295
1298
|
variantMap?: Record<string, StatusBadgeVariant>;
|
|
1296
1299
|
labelMap?: Record<string, React.ReactNode>;
|
|
1300
|
+
icon?: StatusBadgeIcon;
|
|
1301
|
+
iconMap?: Record<string, StatusBadgeIcon>;
|
|
1302
|
+
iconClassName?: string;
|
|
1297
1303
|
showDot?: boolean;
|
|
1298
1304
|
dotClassName?: string;
|
|
1299
1305
|
}
|
|
1300
1306
|
declare function statusLabel(status?: string | null): string;
|
|
1301
1307
|
declare function statusBadgeVariantFor(status?: string | null, variantMap?: Record<string, StatusBadgeVariant>): StatusBadgeVariant;
|
|
1302
|
-
declare function StatusBadge({ status, label, variant, variantMap, labelMap, showDot, dotClassName, className, ...props }: StatusBadgeProps): react_jsx_runtime.JSX.Element;
|
|
1308
|
+
declare function StatusBadge({ status, label, variant, variantMap, labelMap, icon, iconMap, iconClassName, showDot, dotClassName, className, ...props }: StatusBadgeProps): react_jsx_runtime.JSX.Element;
|
|
1303
1309
|
declare namespace StatusBadge {
|
|
1304
1310
|
var displayName: string;
|
|
1305
1311
|
}
|
package/dist/index.js
CHANGED
|
@@ -2846,7 +2846,7 @@ function DataTransferControls({
|
|
|
2846
2846
|
type: "button",
|
|
2847
2847
|
variant: "outline",
|
|
2848
2848
|
size: "icon",
|
|
2849
|
-
className: "size-
|
|
2849
|
+
className: "size-9",
|
|
2850
2850
|
"aria-label": compactLabel,
|
|
2851
2851
|
children: /* @__PURE__ */ jsx(MoreHorizontal, { className: "size-4", "aria-hidden": "true" })
|
|
2852
2852
|
}
|
|
@@ -6045,6 +6045,9 @@ function StatusBadge({
|
|
|
6045
6045
|
variant,
|
|
6046
6046
|
variantMap,
|
|
6047
6047
|
labelMap,
|
|
6048
|
+
icon,
|
|
6049
|
+
iconMap,
|
|
6050
|
+
iconClassName,
|
|
6048
6051
|
showDot = false,
|
|
6049
6052
|
dotClassName,
|
|
6050
6053
|
className,
|
|
@@ -6053,11 +6056,12 @@ function StatusBadge({
|
|
|
6053
6056
|
const normalized = normalizeStatus(status);
|
|
6054
6057
|
const resolvedVariant = variant ?? statusBadgeVariantFor(normalized, variantMap);
|
|
6055
6058
|
const resolvedLabel = label ?? labelMap?.[normalized] ?? statusLabel(normalized);
|
|
6059
|
+
const Icon = icon ?? iconMap?.[normalized];
|
|
6056
6060
|
return /* @__PURE__ */ jsxs(
|
|
6057
6061
|
Badge,
|
|
6058
6062
|
{
|
|
6059
6063
|
variant: resolvedVariant,
|
|
6060
|
-
className: cn("max-w-full whitespace-nowrap", showDot && "pl-2", className),
|
|
6064
|
+
className: cn("max-w-full whitespace-nowrap", (showDot || Icon) && "pl-2", className),
|
|
6061
6065
|
...props,
|
|
6062
6066
|
children: [
|
|
6063
6067
|
showDot && /* @__PURE__ */ jsx(
|
|
@@ -6071,6 +6075,7 @@ function StatusBadge({
|
|
|
6071
6075
|
"aria-hidden": "true"
|
|
6072
6076
|
}
|
|
6073
6077
|
),
|
|
6078
|
+
Icon && /* @__PURE__ */ jsx(Icon, { className: cn("size-3 shrink-0", iconClassName), "aria-hidden": "true" }),
|
|
6074
6079
|
/* @__PURE__ */ jsx("span", { className: "min-w-0 truncate", children: resolvedLabel })
|
|
6075
6080
|
]
|
|
6076
6081
|
}
|