@hilum/ui 3.6.9 → 3.6.11
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 +10 -1
- package/dist/index.js +252 -206
- package/dist/index.js.map +1 -1
- package/llms.txt +4 -3
- package/package.json +1 -1
- package/src/components/checkbox-card.tsx +52 -0
- package/src/components/dialog.tsx +10 -1
- package/src/index.ts +1 -0
- package/src/lib/mobile-popper-sheet.ts +4 -2
package/llms.txt
CHANGED
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
## Key Facts
|
|
6
6
|
|
|
7
7
|
- Package name: `@hilum/ui`
|
|
8
|
-
- Package version: 3.6.
|
|
9
|
-
- Component modules:
|
|
10
|
-
- Atom components:
|
|
8
|
+
- Package version: 3.6.11
|
|
9
|
+
- Component modules: 104
|
|
10
|
+
- Atom components: 73
|
|
11
11
|
- Molecule components: 31
|
|
12
12
|
- Docs site: https://ui.hilum.dev
|
|
13
13
|
- GitHub repository: https://github.com/hilum-labs/hilum-ui
|
|
@@ -90,6 +90,7 @@ Primary exports:
|
|
|
90
90
|
- Chart (/atoms/chart/) — Recharts-based data visualization with design-system styling.
|
|
91
91
|
- Chat Message (/molecules/chat-message/) — Chat transcript row with avatar, author metadata, alignment, and message bubble tone. Composes: Avatar.
|
|
92
92
|
- Checkbox (/atoms/checkbox/) — Binary selection control with checked, unchecked, and indeterminate states.
|
|
93
|
+
- Checkbox Card (/atoms/checkbox-card/) — Clickable card-style checkbox option for settings, filters, and compact binary choices. Composes: Checkbox.
|
|
93
94
|
- Checkbox Group (/atoms/checkbox-group/) — Grouped multi-select options with contiguous product-style row highlighting.
|
|
94
95
|
- Collapsible (/atoms/collapsible/) — Toggleable content region, often used for navigation groups.
|
|
95
96
|
- Color Input (/atoms/color-input/) — Compact color input combining swatch, hex field, and optional opacity control.
|
package/package.json
CHANGED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { cn } from "../lib/utils";
|
|
5
|
+
import { Checkbox } from "./checkbox";
|
|
6
|
+
|
|
7
|
+
interface CheckboxCardProps extends Omit<React.LabelHTMLAttributes<HTMLLabelElement>, "onChange"> {
|
|
8
|
+
checked?: boolean | "indeterminate";
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
label: React.ReactNode;
|
|
11
|
+
description?: React.ReactNode;
|
|
12
|
+
onCheckedChange?: (checked: boolean | "indeterminate") => void;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const CheckboxCard = React.forwardRef<HTMLLabelElement, CheckboxCardProps>(
|
|
16
|
+
({ checked, disabled, label, description, onCheckedChange, className, children, ...props }, ref) => {
|
|
17
|
+
const checkboxProps = {
|
|
18
|
+
...(checked !== undefined ? { checked } : {}),
|
|
19
|
+
...(disabled !== undefined ? { disabled } : {}),
|
|
20
|
+
...(onCheckedChange ? { onCheckedChange } : {}),
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<label
|
|
25
|
+
ref={ref}
|
|
26
|
+
aria-disabled={disabled || undefined}
|
|
27
|
+
className={cn(
|
|
28
|
+
"group flex min-w-0 items-start gap-3 rounded-lg border border-border bg-card p-3",
|
|
29
|
+
"text-sm text-foreground shadow-natural transition-[background-color,border-color,box-shadow,opacity,scale]",
|
|
30
|
+
"hover:bg-muted/40 active:scale-[0.98]",
|
|
31
|
+
"has-[:focus-visible]:ring-1 has-[:focus-visible]:ring-[#6B97FF]",
|
|
32
|
+
"has-[:disabled]:cursor-not-allowed has-[:disabled]:opacity-50",
|
|
33
|
+
className,
|
|
34
|
+
)}
|
|
35
|
+
{...props}
|
|
36
|
+
>
|
|
37
|
+
<Checkbox {...checkboxProps} className="mt-0.5" />
|
|
38
|
+
<span className="flex min-w-0 flex-1 flex-col gap-0.5">
|
|
39
|
+
<span className="font-medium leading-5 text-foreground">{label}</span>
|
|
40
|
+
{description ? (
|
|
41
|
+
<span className="text-[12px] leading-4 text-muted-foreground">{description}</span>
|
|
42
|
+
) : null}
|
|
43
|
+
{children}
|
|
44
|
+
</span>
|
|
45
|
+
</label>
|
|
46
|
+
);
|
|
47
|
+
},
|
|
48
|
+
);
|
|
49
|
+
CheckboxCard.displayName = "CheckboxCard";
|
|
50
|
+
|
|
51
|
+
export { CheckboxCard };
|
|
52
|
+
export type { CheckboxCardProps };
|
|
@@ -159,7 +159,16 @@ function DialogHeader({ className, ...props }: HTMLAttributes<HTMLDivElement>) {
|
|
|
159
159
|
}
|
|
160
160
|
|
|
161
161
|
function DialogFooter({ className, ...props }: HTMLAttributes<HTMLDivElement>) {
|
|
162
|
-
return
|
|
162
|
+
return (
|
|
163
|
+
<div
|
|
164
|
+
className={cn(
|
|
165
|
+
"mt-6 flex justify-end gap-2",
|
|
166
|
+
"max-sm:flex-col-reverse max-sm:[&>*]:w-full",
|
|
167
|
+
className,
|
|
168
|
+
)}
|
|
169
|
+
{...props}
|
|
170
|
+
/>
|
|
171
|
+
);
|
|
163
172
|
}
|
|
164
173
|
|
|
165
174
|
const DialogTitle = forwardRef<
|
package/src/index.ts
CHANGED
|
@@ -34,6 +34,7 @@ export * from "./components/carousel";
|
|
|
34
34
|
export * from "./components/chart";
|
|
35
35
|
export * from "./components/chat-message";
|
|
36
36
|
export * from "./components/checkbox";
|
|
37
|
+
export * from "./components/checkbox-card";
|
|
37
38
|
export * from "./components/checkbox-group";
|
|
38
39
|
export * from "./components/collapsible";
|
|
39
40
|
export * from "./components/color-input";
|
|
@@ -1,8 +1,10 @@
|
|
|
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
|
-
"max-lg:!
|
|
3
|
+
"max-lg:!fixed max-lg:!inset-x-0 max-lg:!bottom-0 max-lg:!top-auto",
|
|
4
|
+
"max-lg:!w-full max-lg:!max-w-none max-lg:!max-h-[calc(100dvh-1rem)]",
|
|
5
|
+
"max-lg:!rounded-b-none max-lg:overscroll-contain",
|
|
4
6
|
"rounded-t-2xl border border-border bg-card p-6 shadow-elevated",
|
|
5
|
-
"max-lg
|
|
7
|
+
"max-lg:!px-5 max-lg:!pb-[calc(1.25rem+env(safe-area-inset-bottom))] max-lg:!pt-8",
|
|
6
8
|
"max-lg:before:absolute max-lg:before:left-1/2 max-lg:before:top-3 max-lg:before:h-1 max-lg:before:w-9",
|
|
7
9
|
"max-lg:before:-translate-x-1/2 max-lg:before:rounded-full max-lg:before:bg-muted-foreground/35",
|
|
8
10
|
].join(" ");
|