@hilum/ui 3.6.6 → 3.6.8
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 +14 -1
- package/dist/index.js +51 -3
- package/dist/index.js.map +1 -1
- package/llms.txt +7 -4
- package/package.json +1 -1
- package/src/components/alert-dialog.tsx +3 -0
- package/src/components/dialog.tsx +5 -1
- package/src/components/media-asset-grid.tsx +43 -0
- package/src/index.ts +1 -0
- package/src/lib/mobile-popper-sheet.ts +18 -0
package/llms.txt
CHANGED
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
## Key Facts
|
|
6
6
|
|
|
7
7
|
- Package name: `@hilum/ui`
|
|
8
|
-
- Package version: 3.
|
|
9
|
-
- Component modules:
|
|
10
|
-
- Atom components:
|
|
11
|
-
- Molecule components:
|
|
8
|
+
- Package version: 3.6.8
|
|
9
|
+
- Component modules: 103
|
|
10
|
+
- Atom components: 72
|
|
11
|
+
- Molecule components: 31
|
|
12
12
|
- Docs site: https://ui.hilum.dev
|
|
13
13
|
- GitHub repository: https://github.com/hilum-labs/hilum-ui
|
|
14
14
|
- Machine-readable docs index: https://ui.hilum.dev/catalog.json
|
|
@@ -122,6 +122,7 @@ Primary exports:
|
|
|
122
122
|
- Kbd (/atoms/kbd/) — Keyboard shortcut display using compact monospaced styling.
|
|
123
123
|
- Label (/atoms/label/) — Accessible form label that associates text with its control.
|
|
124
124
|
- Media Asset Card (/molecules/media-asset-card/) — Selectable media or file card with grid, list, and responsive orientations. Composes: Card · Icon · Image.
|
|
125
|
+
- Media Asset Grid (/molecules/media-asset-grid/) — Responsive media asset container that keeps compact divided rows on mobile and switches to a grid on larger screens. Composes: MediaAssetCard · List.
|
|
125
126
|
- Media Object (/molecules/media-object/) — Layout primitive pairing fixed media with flexible text content. Composes: Avatar · Icon.
|
|
126
127
|
- Menu Item (/atoms/menu-item/) — Reusable command row for menus, lists, and product navigation surfaces.
|
|
127
128
|
- Menubar (/atoms/menubar/) — Horizontal application menu bar with nested dropdown panels.
|
|
@@ -155,6 +156,8 @@ Primary exports:
|
|
|
155
156
|
- Stat Card (/molecules/stat-card/) — Metric display card with label, value, optional trend, and optional icon. Composes: Card · Badge · Icon.
|
|
156
157
|
- Usage Bar (/molecules/usage-bar/) — Compact quota, readiness, and capacity meter with inline and stacked layouts. Composes: Progress.
|
|
157
158
|
- Status Badge (/atoms/status-badge/) — Semantic badge that maps status values to labels, variants, icons, and dots.
|
|
159
|
+
- Status Tile (/atoms/status-tile/) — Compact status tiles for service health, operational states, and responsive mobile panels.
|
|
160
|
+
- Summary Tile (/atoms/summary-tile/) — Compact metric tiles for dense dashboard summaries and responsive mobile panels.
|
|
158
161
|
- Steps (/atoms/steps/) — Multi-step progress indicator with circles, bullets, and progress variants.
|
|
159
162
|
- Switch (/atoms/switch/) — Toggle between two states, on and off.
|
|
160
163
|
- Table (/atoms/table/) — Structured data display with rows and columns.
|
package/package.json
CHANGED
|
@@ -7,6 +7,7 @@ import { focusRingClasses, motionClasses, pressClasses } from "../lib/interactio
|
|
|
7
7
|
import {
|
|
8
8
|
desktopDialogContentClassName,
|
|
9
9
|
dialogSheetMotionClassName,
|
|
10
|
+
mobileDialogSheetStyle,
|
|
10
11
|
mobileDialogSheetContentClassName,
|
|
11
12
|
} from "../lib/mobile-popper-sheet";
|
|
12
13
|
|
|
@@ -37,9 +38,11 @@ const AlertDialogContent = React.forwardRef<
|
|
|
37
38
|
React.ComponentPropsWithoutRef<typeof AlertDialog.Content>
|
|
38
39
|
>(({ className, children, ...props }, ref) => (
|
|
39
40
|
<AlertDialog.Portal>
|
|
41
|
+
<style>{mobileDialogSheetStyle}</style>
|
|
40
42
|
<AlertDialogOverlay />
|
|
41
43
|
<AlertDialog.Content
|
|
42
44
|
ref={ref}
|
|
45
|
+
data-hilum-dialog-sheet="true"
|
|
43
46
|
className={cn(
|
|
44
47
|
mobileDialogSheetContentClassName,
|
|
45
48
|
desktopDialogContentClassName,
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
createContext,
|
|
5
|
+
createElement,
|
|
5
6
|
forwardRef,
|
|
6
7
|
useContext,
|
|
7
8
|
useEffect,
|
|
@@ -20,6 +21,7 @@ import { surfaceClasses } from "../lib/surface-classes";
|
|
|
20
21
|
import {
|
|
21
22
|
desktopDialogContentClassName,
|
|
22
23
|
dialogSheetMotionClassName,
|
|
24
|
+
mobileDialogSheetStyle,
|
|
23
25
|
mobileDialogSheetContentClassName,
|
|
24
26
|
} from "../lib/mobile-popper-sheet";
|
|
25
27
|
import { Button } from "./button";
|
|
@@ -91,6 +93,7 @@ const DialogContent = forwardRef<HTMLDivElement, DialogContentProps>(
|
|
|
91
93
|
|
|
92
94
|
return (
|
|
93
95
|
<DialogPrimitive.Portal forceMount container={container ?? undefined}>
|
|
96
|
+
{!container && <style>{mobileDialogSheetStyle}</style>}
|
|
94
97
|
<DialogPrimitive.Overlay asChild forceMount>
|
|
95
98
|
<motion.div
|
|
96
99
|
className={cn(
|
|
@@ -104,6 +107,7 @@ const DialogContent = forwardRef<HTMLDivElement, DialogContentProps>(
|
|
|
104
107
|
</DialogPrimitive.Overlay>
|
|
105
108
|
<DialogPrimitive.Content ref={ref} asChild forceMount {...props}>
|
|
106
109
|
<motion.div
|
|
110
|
+
data-hilum-dialog-sheet={container ? undefined : "true"}
|
|
107
111
|
className={cn(
|
|
108
112
|
container
|
|
109
113
|
? "absolute left-1/2 top-1/2 z-50 w-[calc(100%-2rem)]"
|
|
@@ -137,7 +141,7 @@ const DialogContent = forwardRef<HTMLDivElement, DialogContentProps>(
|
|
|
137
141
|
{children}
|
|
138
142
|
<DialogPrimitive.Close asChild>
|
|
139
143
|
<Button variant="ghost" size="icon-sm" className="absolute right-3 top-3">
|
|
140
|
-
|
|
144
|
+
{createElement(XIcon)}
|
|
141
145
|
<span className="sr-only">Close</span>
|
|
142
146
|
</Button>
|
|
143
147
|
</DialogPrimitive.Close>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { cn } from "../lib/utils";
|
|
5
|
+
|
|
6
|
+
interface MediaAssetGridProps extends React.HTMLAttributes<HTMLUListElement> {
|
|
7
|
+
columns?: 2 | 3 | 4 | 5;
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const columnClasses: Record<NonNullable<MediaAssetGridProps["columns"]>, string> = {
|
|
12
|
+
2: "sm:grid-cols-2",
|
|
13
|
+
3: "sm:grid-cols-2 md:grid-cols-3",
|
|
14
|
+
4: "sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4",
|
|
15
|
+
5: "sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5",
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
function MediaAssetGrid({ children, columns = 5, className, ...props }: MediaAssetGridProps) {
|
|
19
|
+
return (
|
|
20
|
+
<ul
|
|
21
|
+
role="list"
|
|
22
|
+
className={cn(
|
|
23
|
+
"divide-y divide-border border-y border-border",
|
|
24
|
+
"sm:grid sm:gap-4 sm:divide-y-0 sm:border-y-0",
|
|
25
|
+
columnClasses[columns],
|
|
26
|
+
className,
|
|
27
|
+
)}
|
|
28
|
+
{...props}
|
|
29
|
+
>
|
|
30
|
+
{children}
|
|
31
|
+
</ul>
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function MediaAssetGridItem({ className, ...props }: React.HTMLAttributes<HTMLLIElement>) {
|
|
36
|
+
return <li className={cn("min-w-0", className)} {...props} />;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
MediaAssetGrid.displayName = "MediaAssetGrid";
|
|
40
|
+
MediaAssetGridItem.displayName = "MediaAssetGridItem";
|
|
41
|
+
|
|
42
|
+
export { MediaAssetGrid, MediaAssetGridItem };
|
|
43
|
+
export type { MediaAssetGridProps };
|
package/src/index.ts
CHANGED
|
@@ -65,6 +65,7 @@ export * from "./components/input-otp";
|
|
|
65
65
|
export * from "./components/input";
|
|
66
66
|
export * from "./components/kbd";
|
|
67
67
|
export * from "./components/label";
|
|
68
|
+
export * from "./components/media-asset-grid";
|
|
68
69
|
export * from "./components/media-asset-card";
|
|
69
70
|
export * from "./components/media-object";
|
|
70
71
|
export * from "./components/menu-item";
|
|
@@ -17,6 +17,24 @@ export const dialogSheetMotionClassName = [
|
|
|
17
17
|
"lg:data-[state=closed]:zoom-out-95 lg:data-[state=open]:zoom-in-95",
|
|
18
18
|
].join(" ");
|
|
19
19
|
|
|
20
|
+
export const mobileDialogSheetStyle = `
|
|
21
|
+
@media (max-width: 1023px) {
|
|
22
|
+
[data-hilum-dialog-sheet="true"] {
|
|
23
|
+
position: fixed !important;
|
|
24
|
+
left: 0 !important;
|
|
25
|
+
right: 0 !important;
|
|
26
|
+
bottom: 0 !important;
|
|
27
|
+
top: auto !important;
|
|
28
|
+
width: 100% !important;
|
|
29
|
+
max-width: none !important;
|
|
30
|
+
max-height: calc(100dvh - 1rem) !important;
|
|
31
|
+
border-bottom-left-radius: 0 !important;
|
|
32
|
+
border-bottom-right-radius: 0 !important;
|
|
33
|
+
transform-origin: bottom center !important;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
`;
|
|
37
|
+
|
|
20
38
|
export const mobilePopperSheetPositionClassName = [
|
|
21
39
|
"max-md:!fixed max-md:!inset-x-3 max-md:!bottom-3 max-md:!top-auto max-md:!left-3 max-md:!right-3",
|
|
22
40
|
"max-md:!w-auto max-md:!min-w-0 max-md:!max-w-none max-md:!transform-none",
|