@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/package.json
CHANGED
|
@@ -31,7 +31,7 @@ const buttonVariants = cva(
|
|
|
31
31
|
xs: "h-6 gap-1 px-2 caption rounded-md",
|
|
32
32
|
sm: "h-8 gap-1.5 px-3 rounded-md",
|
|
33
33
|
lg: "h-11 px-6 rounded-md",
|
|
34
|
-
icon: "size-
|
|
34
|
+
icon: "size-9 rounded-md",
|
|
35
35
|
"icon-xs": "size-6 rounded-md [&_svg:not([class*='size-'])]:size-3",
|
|
36
36
|
"icon-sm": "size-8 rounded-md",
|
|
37
37
|
"icon-lg": "size-11 rounded-md",
|
|
@@ -49,7 +49,7 @@ const DialogContent = React.forwardRef<
|
|
|
49
49
|
{...props}
|
|
50
50
|
>
|
|
51
51
|
{children}
|
|
52
|
-
<Dialog.Close className="absolute right-3 top-3 flex size-
|
|
52
|
+
<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">
|
|
53
53
|
<X size={16} />
|
|
54
54
|
<span className="sr-only">Close</span>
|
|
55
55
|
</Dialog.Close>
|
|
@@ -95,7 +95,7 @@ function Notification({
|
|
|
95
95
|
<button
|
|
96
96
|
type="button"
|
|
97
97
|
onClick={onClose}
|
|
98
|
-
className="flex size-
|
|
98
|
+
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"
|
|
99
99
|
>
|
|
100
100
|
<span className="sr-only">Close</span>
|
|
101
101
|
<X size={16} />
|
|
@@ -32,7 +32,7 @@ const PaginationLink = ({ className, isActive, ...props }: PaginationLinkProps)
|
|
|
32
32
|
aria-current={isActive ? "page" : undefined}
|
|
33
33
|
className={cn(
|
|
34
34
|
buttonVariants({ variant: isActive ? "default" : "ghost", size: "icon" }),
|
|
35
|
-
"size-
|
|
35
|
+
"size-9 rounded-md body",
|
|
36
36
|
className,
|
|
37
37
|
)}
|
|
38
38
|
{...props}
|
|
@@ -70,7 +70,7 @@ PaginationNext.displayName = "PaginationNext";
|
|
|
70
70
|
const PaginationEllipsis = ({ className, ...props }: React.ComponentProps<"span">) => (
|
|
71
71
|
<span
|
|
72
72
|
aria-hidden
|
|
73
|
-
className={cn("flex size-
|
|
73
|
+
className={cn("flex size-9 items-center justify-center text-muted-foreground", className)}
|
|
74
74
|
{...props}
|
|
75
75
|
>
|
|
76
76
|
<MoreHorizontal size={14} />
|
|
@@ -294,7 +294,7 @@ function RichTextEditor({
|
|
|
294
294
|
type="button"
|
|
295
295
|
variant="ghost"
|
|
296
296
|
size="icon"
|
|
297
|
-
className="size-
|
|
297
|
+
className="size-9 text-muted-foreground hover:text-foreground"
|
|
298
298
|
title={title}
|
|
299
299
|
aria-label={title}
|
|
300
300
|
onMouseDown={(event) => {
|
|
@@ -334,7 +334,7 @@ function RichTextEditor({
|
|
|
334
334
|
type="button"
|
|
335
335
|
variant="ghost"
|
|
336
336
|
size="icon"
|
|
337
|
-
className="size-
|
|
337
|
+
className="size-9 text-muted-foreground hover:text-foreground"
|
|
338
338
|
title="Insert link"
|
|
339
339
|
aria-label="Insert link"
|
|
340
340
|
onMouseDown={(event) => {
|
|
@@ -349,7 +349,7 @@ function RichTextEditor({
|
|
|
349
349
|
type="button"
|
|
350
350
|
variant="ghost"
|
|
351
351
|
size="icon"
|
|
352
|
-
className="size-
|
|
352
|
+
className="size-9 text-muted-foreground hover:text-foreground"
|
|
353
353
|
title="Insert image"
|
|
354
354
|
aria-label="Insert image"
|
|
355
355
|
onMouseDown={(event) => {
|
package/src/components/sheet.tsx
CHANGED
|
@@ -65,7 +65,7 @@ const SheetContent = React.forwardRef<React.ComponentRef<typeof Dialog.Content>,
|
|
|
65
65
|
{...props}
|
|
66
66
|
>
|
|
67
67
|
{children}
|
|
68
|
-
<Dialog.Close className="absolute right-3 top-3 flex size-
|
|
68
|
+
<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">
|
|
69
69
|
<X size={16} />
|
|
70
70
|
<span className="sr-only">Close</span>
|
|
71
71
|
</Dialog.Close>
|
|
@@ -514,7 +514,7 @@ function SidebarMenuButton({
|
|
|
514
514
|
],
|
|
515
515
|
// Collapsed state
|
|
516
516
|
"group-data-[state=collapsed]/sidebar-wrapper:justify-center",
|
|
517
|
-
"group-data-[state=collapsed]/sidebar-wrapper:size-
|
|
517
|
+
"group-data-[state=collapsed]/sidebar-wrapper:size-9",
|
|
518
518
|
"group-data-[state=collapsed]/sidebar-wrapper:p-0",
|
|
519
519
|
className,
|
|
520
520
|
)}
|
|
@@ -5,6 +5,7 @@ import { Badge } from "./badge";
|
|
|
5
5
|
import { cn } from "../lib/utils";
|
|
6
6
|
|
|
7
7
|
type StatusBadgeVariant = NonNullable<React.ComponentProps<typeof Badge>["variant"]>;
|
|
8
|
+
type StatusBadgeIcon = React.ComponentType<{ className?: string }>;
|
|
8
9
|
|
|
9
10
|
interface StatusBadgeProps extends Omit<
|
|
10
11
|
React.ComponentProps<typeof Badge>,
|
|
@@ -15,6 +16,9 @@ interface StatusBadgeProps extends Omit<
|
|
|
15
16
|
variant?: StatusBadgeVariant;
|
|
16
17
|
variantMap?: Record<string, StatusBadgeVariant>;
|
|
17
18
|
labelMap?: Record<string, React.ReactNode>;
|
|
19
|
+
icon?: StatusBadgeIcon;
|
|
20
|
+
iconMap?: Record<string, StatusBadgeIcon>;
|
|
21
|
+
iconClassName?: string;
|
|
18
22
|
showDot?: boolean;
|
|
19
23
|
dotClassName?: string;
|
|
20
24
|
}
|
|
@@ -108,6 +112,9 @@ function StatusBadge({
|
|
|
108
112
|
variant,
|
|
109
113
|
variantMap,
|
|
110
114
|
labelMap,
|
|
115
|
+
icon,
|
|
116
|
+
iconMap,
|
|
117
|
+
iconClassName,
|
|
111
118
|
showDot = false,
|
|
112
119
|
dotClassName,
|
|
113
120
|
className,
|
|
@@ -116,11 +123,12 @@ function StatusBadge({
|
|
|
116
123
|
const normalized = normalizeStatus(status);
|
|
117
124
|
const resolvedVariant = variant ?? statusBadgeVariantFor(normalized, variantMap);
|
|
118
125
|
const resolvedLabel = label ?? labelMap?.[normalized] ?? statusLabel(normalized);
|
|
126
|
+
const Icon = icon ?? iconMap?.[normalized];
|
|
119
127
|
|
|
120
128
|
return (
|
|
121
129
|
<Badge
|
|
122
130
|
variant={resolvedVariant}
|
|
123
|
-
className={cn("max-w-full whitespace-nowrap", showDot && "pl-2", className)}
|
|
131
|
+
className={cn("max-w-full whitespace-nowrap", (showDot || Icon) && "pl-2", className)}
|
|
124
132
|
{...props}
|
|
125
133
|
>
|
|
126
134
|
{showDot && (
|
|
@@ -133,6 +141,7 @@ function StatusBadge({
|
|
|
133
141
|
aria-hidden="true"
|
|
134
142
|
/>
|
|
135
143
|
)}
|
|
144
|
+
{Icon && <Icon className={cn("size-3 shrink-0", iconClassName)} aria-hidden="true" />}
|
|
136
145
|
<span className="min-w-0 truncate">{resolvedLabel}</span>
|
|
137
146
|
</Badge>
|
|
138
147
|
);
|