@hilum/ui 3.6.2 → 3.6.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hilum/ui",
3
- "version": "3.6.2",
3
+ "version": "3.6.4",
4
4
  "private": false,
5
5
  "description": "Hilum UI — design system primitives (Button, Input, Dialog, Combobox, …) + tokens + fonts + icons",
6
6
  "license": "MIT",
@@ -181,21 +181,21 @@ function Combobox({
181
181
  <button
182
182
  type="button"
183
183
  aria-label="Close options"
184
- className="fixed inset-0 z-40 hidden bg-black/30 backdrop-blur-sm max-sm:block"
184
+ className="fixed inset-0 z-40 hidden bg-black/30 backdrop-blur-sm max-md:block"
185
185
  onClick={closeDropdown}
186
186
  />
187
187
  <div
188
188
  className={cn(
189
189
  "absolute z-50 mt-1 w-full overflow-hidden rounded-lg border border-border bg-card shadow-elevated",
190
- "max-sm:fixed max-sm:inset-x-3 max-sm:bottom-3 max-sm:[bottom:max(0.75rem,env(safe-area-inset-bottom))] max-sm:top-auto max-sm:mt-0 max-sm:w-auto",
191
- "max-sm:max-h-[min(70dvh,28rem)] max-sm:rounded-2xl max-sm:p-2 max-sm:pt-5",
192
- "max-sm:before:absolute max-sm:before:left-1/2 max-sm:before:top-2 max-sm:before:h-1 max-sm:before:w-9 max-sm:before:-translate-x-1/2 max-sm:before:rounded-full max-sm:before:bg-muted-foreground/35",
190
+ "max-md:fixed max-md:inset-x-3 max-md:bottom-3 max-md:[bottom:max(0.75rem,env(safe-area-inset-bottom))] max-md:top-auto max-md:mt-0 max-md:w-auto",
191
+ "max-md:max-h-[min(70dvh,28rem)] max-md:rounded-2xl max-md:p-2 max-md:pt-5",
192
+ "max-md:before:absolute max-md:before:left-1/2 max-md:before:top-2 max-md:before:h-1 max-md:before:w-9 max-md:before:-translate-x-1/2 max-md:before:rounded-full max-md:before:bg-muted-foreground/35",
193
193
  )}
194
194
  >
195
195
  <ul
196
196
  id={listboxId}
197
197
  role="listbox"
198
- className="max-h-60 overflow-auto py-1 max-sm:max-h-[calc(min(70dvh,28rem)-3rem)]"
198
+ className="max-h-60 overflow-auto py-1 max-md:max-h-[calc(min(70dvh,28rem)-3rem)]"
199
199
  >
200
200
  {filtered.length === 0 ? (
201
201
  <li className="px-3 py-2 body text-muted-foreground">{emptyText}</li>
@@ -32,7 +32,7 @@ const ContextMenuContent = React.forwardRef<
32
32
  "z-50 min-w-[8rem] overflow-hidden rounded-xl border border-border bg-card p-1 text-card-foreground shadow-elevated outline-none",
33
33
  mobilePopperSheetPositionClassName,
34
34
  mobilePopperSheetSurfaceClassName,
35
- "max-sm:overflow-y-auto max-sm:px-2 max-sm:pb-2 max-sm:pt-5",
35
+ "max-md:overflow-y-auto max-md:px-2 max-md:pb-2 max-md:pt-5",
36
36
  "data-[state=open]:animate-in data-[state=closed]:animate-out",
37
37
  "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
38
38
  "data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
@@ -184,7 +184,7 @@ const ContextMenuSubContent = React.forwardRef<
184
184
  "z-50 min-w-[8rem] overflow-hidden rounded-xl border border-border bg-card p-1 text-card-foreground shadow-elevated outline-none",
185
185
  mobilePopperSheetPositionClassName,
186
186
  mobilePopperSheetSurfaceClassName,
187
- "max-sm:overflow-y-auto max-sm:px-2 max-sm:pb-2 max-sm:pt-5",
187
+ "max-md:overflow-y-auto max-md:px-2 max-md:pb-2 max-md:pt-5",
188
188
  "data-[state=open]:animate-in data-[state=closed]:animate-out",
189
189
  "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
190
190
  "data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
@@ -39,7 +39,7 @@ const DropdownMenuContent = React.forwardRef<
39
39
  "z-50 min-w-[8rem] rounded-xl border border-border bg-card p-1 shadow-elevated",
40
40
  mobilePopperSheetPositionClassName,
41
41
  mobilePopperSheetSurfaceClassName,
42
- "max-sm:overflow-y-auto max-sm:px-2 max-sm:pb-2 max-sm:pt-5",
42
+ "max-md:overflow-y-auto max-md:px-2 max-md:pb-2 max-md:pt-5",
43
43
  "data-[state=open]:animate-in data-[state=closed]:animate-out",
44
44
  "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
45
45
  "data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
@@ -193,7 +193,7 @@ const DropdownMenuSubContent = React.forwardRef<
193
193
  "z-50 min-w-[8rem] rounded-xl border border-border bg-card p-1 shadow-elevated",
194
194
  mobilePopperSheetPositionClassName,
195
195
  mobilePopperSheetSurfaceClassName,
196
- "max-sm:overflow-y-auto max-sm:px-2 max-sm:pb-2 max-sm:pt-5",
196
+ "max-md:overflow-y-auto max-md:px-2 max-md:pb-2 max-md:pt-5",
197
197
  "data-[state=open]:animate-in data-[state=closed]:animate-out",
198
198
  "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
199
199
  "data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
@@ -69,7 +69,7 @@ const MenubarContent = React.forwardRef<
69
69
  "z-50 min-w-[12rem] bg-card rounded-xl shadow-natural p-1",
70
70
  mobilePopperSheetPositionClassName,
71
71
  mobilePopperSheetSurfaceClassName,
72
- "max-sm:overflow-y-auto max-sm:px-2 max-sm:pb-2 max-sm:pt-5",
72
+ "max-md:overflow-y-auto max-md:px-2 max-md:pb-2 max-md:pt-5",
73
73
  "data-[state=open]:animate-in data-[state=closed]:animate-out",
74
74
  "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
75
75
  "data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
@@ -214,7 +214,7 @@ const MenubarSubContent = React.forwardRef<
214
214
  "z-50 min-w-[8rem] bg-card rounded-xl border border-border shadow-natural p-1",
215
215
  mobilePopperSheetPositionClassName,
216
216
  mobilePopperSheetSurfaceClassName,
217
- "max-sm:overflow-y-auto max-sm:px-2 max-sm:pb-2 max-sm:pt-5",
217
+ "max-md:overflow-y-auto max-md:px-2 max-md:pb-2 max-md:pt-5",
218
218
  "data-[state=open]:animate-in data-[state=closed]:animate-out",
219
219
  "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
220
220
  "data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
@@ -32,7 +32,7 @@ const PopoverContent = React.forwardRef<
32
32
  motionClasses,
33
33
  mobilePopperSheetPositionClassName,
34
34
  mobilePopperSheetSurfaceClassName,
35
- "max-sm:overflow-y-auto max-sm:px-4 max-sm:pb-4 max-sm:pt-6",
35
+ "max-md:overflow-y-auto max-md:px-4 max-md:pb-4 max-md:pt-6",
36
36
  "data-[state=open]:animate-in data-[state=closed]:animate-out",
37
37
  "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
38
38
  "data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
@@ -448,7 +448,7 @@ const SelectContent = forwardRef<HTMLDivElement, SelectContentProps>(
448
448
  }}
449
449
  onKeyDown={handleKeyDown}
450
450
  className={cn(
451
- `relative flex flex-col gap-0.5 max-h-[300px] overflow-y-auto ${shape.container} p-1 select-none outline-none max-sm:!fixed max-sm:rounded-2xl max-sm:data-[state=open]:slide-in-from-bottom`,
451
+ `relative flex flex-col gap-0.5 max-h-[300px] overflow-y-auto ${shape.container} p-1 select-none outline-none max-md:!fixed max-md:rounded-2xl max-md:data-[state=open]:slide-in-from-bottom`,
452
452
  className,
453
453
  )}
454
454
  >
@@ -0,0 +1,85 @@
1
+ import * as React from "react";
2
+ import { cn } from "../lib/utils";
3
+ import { StatusBadge, type StatusBadgeVariant } from "./status-badge";
4
+
5
+ interface StatusTileGridProps extends React.HTMLAttributes<HTMLDivElement> {
6
+ columns?: 2 | 3 | 4;
7
+ }
8
+
9
+ interface StatusTileProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "title"> {
10
+ title: React.ReactNode;
11
+ status: string;
12
+ description?: React.ReactNode;
13
+ meta?: React.ReactNode;
14
+ icon?: React.ComponentType<{ className?: string }>;
15
+ labelMap?: Record<string, React.ReactNode>;
16
+ variantMap?: Record<string, StatusBadgeVariant>;
17
+ iconMap?: Record<string, React.ComponentType<{ className?: string }>>;
18
+ }
19
+
20
+ const columnClassName: Record<NonNullable<StatusTileGridProps["columns"]>, string> = {
21
+ 2: "md:grid-cols-2",
22
+ 3: "md:grid-cols-2 xl:grid-cols-3",
23
+ 4: "md:grid-cols-2 xl:grid-cols-4",
24
+ };
25
+
26
+ function StatusTileGrid({ columns = 3, className, ...props }: StatusTileGridProps) {
27
+ return (
28
+ <div
29
+ data-slot="status-tile-grid"
30
+ className={cn(
31
+ "divide-y divide-border md:grid md:gap-4 md:divide-y-0",
32
+ columnClassName[columns],
33
+ className,
34
+ )}
35
+ {...props}
36
+ />
37
+ );
38
+ }
39
+
40
+ function StatusTile({
41
+ title,
42
+ status,
43
+ description,
44
+ meta,
45
+ icon: Icon,
46
+ labelMap,
47
+ variantMap,
48
+ iconMap,
49
+ className,
50
+ ...props
51
+ }: StatusTileProps) {
52
+ return (
53
+ <div
54
+ data-slot="status-tile"
55
+ className={cn(
56
+ "min-w-0 py-4 md:rounded-lg md:border md:border-border md:bg-background md:p-4 md:shadow-natural",
57
+ className,
58
+ )}
59
+ {...props}
60
+ >
61
+ <div className="flex min-w-0 items-start justify-between gap-3">
62
+ <div className="flex min-w-0 items-center gap-2">
63
+ {Icon ? <Icon className="size-4 shrink-0 text-muted-foreground" /> : null}
64
+ <h3 className="body min-w-0 truncate font-medium text-foreground">{title}</h3>
65
+ </div>
66
+ <StatusBadge
67
+ status={status}
68
+ {...(labelMap ? { labelMap } : {})}
69
+ {...(variantMap ? { variantMap } : {})}
70
+ {...(iconMap ? { iconMap } : {})}
71
+ className="shrink-0"
72
+ />
73
+ </div>
74
+ {description ? (
75
+ <p className="body-sm mt-3 text-muted-foreground">{description}</p>
76
+ ) : null}
77
+ {meta ? <div className="mt-3 min-w-0 text-muted-foreground">{meta}</div> : null}
78
+ </div>
79
+ );
80
+ }
81
+
82
+ StatusTileGrid.displayName = "StatusTileGrid";
83
+ StatusTile.displayName = "StatusTile";
84
+
85
+ export { StatusTile, StatusTileGrid, type StatusTileProps, type StatusTileGridProps };
package/src/index.ts CHANGED
@@ -98,6 +98,7 @@ export * from "./components/spinner";
98
98
  export * from "./components/stacked-list";
99
99
  export * from "./components/stat-card";
100
100
  export * from "./components/status-badge";
101
+ export * from "./components/status-tile";
101
102
  export * from "./components/steps";
102
103
  export * from "./components/summary-tile";
103
104
  export * from "./components/switch";
@@ -1,35 +1,35 @@
1
1
  export const mobileDialogSheetContentClassName = [
2
2
  "fixed inset-x-0 bottom-0 z-50 max-h-[calc(100dvh-1rem)] w-full overflow-y-auto",
3
3
  "rounded-t-2xl border border-border bg-card p-6 shadow-elevated",
4
- "max-sm:pb-[calc(1.5rem+env(safe-area-inset-bottom))] max-sm:pt-8",
5
- "max-sm:before:absolute max-sm:before:left-1/2 max-sm:before:top-3 max-sm:before:h-1 max-sm:before:w-9",
6
- "max-sm:before:-translate-x-1/2 max-sm:before:rounded-full max-sm:before:bg-muted-foreground/35",
4
+ "max-md:pb-[calc(1.5rem+env(safe-area-inset-bottom))] max-md:pt-8",
5
+ "max-md:before:absolute max-md:before:left-1/2 max-md:before:top-3 max-md:before:h-1 max-md:before:w-9",
6
+ "max-md:before:-translate-x-1/2 max-md:before:rounded-full max-md:before:bg-muted-foreground/35",
7
7
  ].join(" ");
8
8
 
9
9
  export const desktopDialogContentClassName =
10
- "sm:bottom-auto sm:left-1/2 sm:top-1/2 sm:max-h-[calc(100dvh-2rem)] sm:-translate-x-1/2 sm:-translate-y-1/2 sm:rounded-2xl";
10
+ "md:bottom-auto md:left-1/2 md:top-1/2 md:max-h-[calc(100dvh-2rem)] md:-translate-x-1/2 md:-translate-y-1/2 md:rounded-2xl";
11
11
 
12
12
  export const dialogSheetMotionClassName = [
13
13
  "data-[state=open]:animate-in data-[state=closed]:animate-out",
14
14
  "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
15
15
  "data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
16
- "sm:data-[state=closed]:zoom-out-95 sm:data-[state=open]:zoom-in-95",
16
+ "md:data-[state=closed]:zoom-out-95 md:data-[state=open]:zoom-in-95",
17
17
  ].join(" ");
18
18
 
19
19
  export const mobilePopperSheetPositionClassName = [
20
- "max-sm:!fixed max-sm:!inset-x-3 max-sm:!bottom-3 max-sm:!top-auto max-sm:!left-3 max-sm:!right-3",
21
- "max-sm:!w-auto max-sm:!min-w-0 max-sm:!max-w-none max-sm:!transform-none",
20
+ "max-md:!fixed max-md:!inset-x-3 max-md:!bottom-3 max-md:!top-auto max-md:!left-3 max-md:!right-3",
21
+ "max-md:!w-auto max-md:!min-w-0 max-md:!max-w-none max-md:!transform-none",
22
22
  ].join(" ");
23
23
 
24
24
  export const mobilePopperSheetSurfaceClassName =
25
- "max-sm:max-h-[min(70dvh,28rem)] max-sm:rounded-2xl max-sm:border max-sm:border-border max-sm:shadow-elevated";
25
+ "max-md:max-h-[min(70dvh,28rem)] max-md:rounded-2xl max-md:border max-md:border-border max-md:shadow-elevated";
26
26
 
27
27
  export const mobilePopperSheetMotionClassName = [
28
- "max-sm:data-[state=closed]:slide-out-to-bottom max-sm:data-[state=open]:slide-in-from-bottom",
28
+ "max-md:data-[state=closed]:slide-out-to-bottom max-md:data-[state=open]:slide-in-from-bottom",
29
29
  ].join(" ");
30
30
 
31
31
  export const mobilePopperSheetStyle = `
32
- @media (max-width: 639px) {
32
+ @media (max-width: 767px) {
33
33
  [data-radix-popper-content-wrapper]:has([data-hilum-mobile-sheet="true"]) {
34
34
  position: fixed !important;
35
35
  inset: 0 !important;