@hilum/ui 3.2.5 → 3.2.7
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 +7 -1
- package/dist/index.js +17 -12
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/button.tsx +1 -1
- package/src/components/dialog.tsx +1 -1
- package/src/components/notification.tsx +1 -1
- package/src/components/pagination.tsx +2 -2
- package/src/components/rich-text-editor.tsx +3 -3
- package/src/components/sheet.tsx +1 -1
- package/src/components/sidebar.tsx +1 -1
- package/src/components/status-badge.tsx +10 -1
- package/src/components/toggle.tsx +1 -1
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
|
@@ -446,7 +446,7 @@ var buttonVariants = cva(
|
|
|
446
446
|
xs: "h-6 gap-1 px-2 caption rounded-md",
|
|
447
447
|
sm: "h-8 gap-1.5 px-3 rounded-md",
|
|
448
448
|
lg: "h-11 px-6 rounded-md",
|
|
449
|
-
icon: "size-
|
|
449
|
+
icon: "size-9 rounded-md",
|
|
450
450
|
"icon-xs": "size-6 rounded-md [&_svg:not([class*='size-'])]:size-3",
|
|
451
451
|
"icon-sm": "size-8 rounded-md",
|
|
452
452
|
"icon-lg": "size-11 rounded-md"
|
|
@@ -2042,7 +2042,7 @@ var DialogContent = React19.forwardRef(({ className, children, ...props }, ref)
|
|
|
2042
2042
|
...props,
|
|
2043
2043
|
children: [
|
|
2044
2044
|
children,
|
|
2045
|
-
/* @__PURE__ */ jsxs(Dialog.Close, { className: "absolute right-3 top-3 flex size-
|
|
2045
|
+
/* @__PURE__ */ jsxs(Dialog.Close, { className: "absolute right-3 top-3 flex size-9 items-center justify-center rounded-md text-muted-foreground opacity-70 transition-[opacity,scale] hover:opacity-100 active:scale-[0.96] focus:outline-none focus:ring-2 focus:ring-ground-900/20", children: [
|
|
2046
2046
|
/* @__PURE__ */ jsx(X, { size: 16 }),
|
|
2047
2047
|
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
|
|
2048
2048
|
] })
|
|
@@ -4182,7 +4182,7 @@ function Notification({
|
|
|
4182
4182
|
{
|
|
4183
4183
|
type: "button",
|
|
4184
4184
|
onClick: onClose,
|
|
4185
|
-
className: "flex size-
|
|
4185
|
+
className: "flex size-9 items-center justify-center rounded-md text-muted-foreground transition-[color,scale] hover:text-muted-foreground active:scale-[0.96] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/30",
|
|
4186
4186
|
children: [
|
|
4187
4187
|
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" }),
|
|
4188
4188
|
/* @__PURE__ */ jsx(X, { size: 16 })
|
|
@@ -4275,7 +4275,7 @@ var PaginationLink = ({ className, isActive, ...props }) => /* @__PURE__ */ jsx(
|
|
|
4275
4275
|
"aria-current": isActive ? "page" : void 0,
|
|
4276
4276
|
className: cn(
|
|
4277
4277
|
buttonVariants({ variant: isActive ? "default" : "ghost", size: "icon" }),
|
|
4278
|
-
"size-
|
|
4278
|
+
"size-9 rounded-md body",
|
|
4279
4279
|
className
|
|
4280
4280
|
),
|
|
4281
4281
|
...props
|
|
@@ -4315,7 +4315,7 @@ var PaginationEllipsis = ({ className, ...props }) => /* @__PURE__ */ jsx(
|
|
|
4315
4315
|
"span",
|
|
4316
4316
|
{
|
|
4317
4317
|
"aria-hidden": true,
|
|
4318
|
-
className: cn("flex size-
|
|
4318
|
+
className: cn("flex size-9 items-center justify-center text-muted-foreground", className),
|
|
4319
4319
|
...props,
|
|
4320
4320
|
children: /* @__PURE__ */ jsx(MoreHorizontal, { size: 14 })
|
|
4321
4321
|
}
|
|
@@ -4741,7 +4741,7 @@ function RichTextEditor({
|
|
|
4741
4741
|
type: "button",
|
|
4742
4742
|
variant: "ghost",
|
|
4743
4743
|
size: "icon",
|
|
4744
|
-
className: "size-
|
|
4744
|
+
className: "size-9 text-muted-foreground hover:text-foreground",
|
|
4745
4745
|
title,
|
|
4746
4746
|
"aria-label": title,
|
|
4747
4747
|
onMouseDown: (event) => {
|
|
@@ -4783,7 +4783,7 @@ function RichTextEditor({
|
|
|
4783
4783
|
type: "button",
|
|
4784
4784
|
variant: "ghost",
|
|
4785
4785
|
size: "icon",
|
|
4786
|
-
className: "size-
|
|
4786
|
+
className: "size-9 text-muted-foreground hover:text-foreground",
|
|
4787
4787
|
title: "Insert link",
|
|
4788
4788
|
"aria-label": "Insert link",
|
|
4789
4789
|
onMouseDown: (event) => {
|
|
@@ -4800,7 +4800,7 @@ function RichTextEditor({
|
|
|
4800
4800
|
type: "button",
|
|
4801
4801
|
variant: "ghost",
|
|
4802
4802
|
size: "icon",
|
|
4803
|
-
className: "size-
|
|
4803
|
+
className: "size-9 text-muted-foreground hover:text-foreground",
|
|
4804
4804
|
title: "Insert image",
|
|
4805
4805
|
"aria-label": "Insert image",
|
|
4806
4806
|
onMouseDown: (event) => {
|
|
@@ -5258,7 +5258,7 @@ var SheetContent = React19.forwardRef(
|
|
|
5258
5258
|
...props,
|
|
5259
5259
|
children: [
|
|
5260
5260
|
children,
|
|
5261
|
-
/* @__PURE__ */ jsxs(Dialog.Close, { className: "absolute right-3 top-3 flex size-
|
|
5261
|
+
/* @__PURE__ */ jsxs(Dialog.Close, { className: "absolute right-3 top-3 flex size-9 items-center justify-center rounded-md text-muted-foreground opacity-70 transition-[opacity,scale] hover:opacity-100 active:scale-[0.96] focus:outline-none focus:ring-2 focus:ring-ground-900/20", children: [
|
|
5262
5262
|
/* @__PURE__ */ jsx(X, { size: 16 }),
|
|
5263
5263
|
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
|
|
5264
5264
|
] })
|
|
@@ -5687,7 +5687,7 @@ function SidebarMenuButton({
|
|
|
5687
5687
|
],
|
|
5688
5688
|
// Collapsed state
|
|
5689
5689
|
"group-data-[state=collapsed]/sidebar-wrapper:justify-center",
|
|
5690
|
-
"group-data-[state=collapsed]/sidebar-wrapper:size-
|
|
5690
|
+
"group-data-[state=collapsed]/sidebar-wrapper:size-9",
|
|
5691
5691
|
"group-data-[state=collapsed]/sidebar-wrapper:p-0",
|
|
5692
5692
|
className
|
|
5693
5693
|
),
|
|
@@ -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
|
}
|
|
@@ -6378,7 +6383,7 @@ var toggleVariants = cva(
|
|
|
6378
6383
|
sm: "h-8 gap-1.5 px-3",
|
|
6379
6384
|
default: "h-10 px-3",
|
|
6380
6385
|
lg: "h-11 px-4",
|
|
6381
|
-
icon: "size-
|
|
6386
|
+
icon: "size-9",
|
|
6382
6387
|
"icon-sm": "size-8",
|
|
6383
6388
|
"icon-lg": "size-11"
|
|
6384
6389
|
}
|