shadcn-packaged 2025.9.22 → 2025.10.6
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/index.d.ts +7 -0
- package/package.json +3 -3
- package/ui/button-group.d.ts +11 -0
- package/ui/button-group.jsx +26 -0
- package/ui/empty.d.ts +11 -0
- package/ui/empty.jsx +32 -0
- package/ui/field.d.ts +24 -0
- package/ui/field.jsx +81 -0
- package/ui/input-group.d.ts +16 -0
- package/ui/input-group.jsx +63 -0
- package/ui/item.d.ts +23 -0
- package/ui/item.jsx +66 -0
- package/ui/kbd.d.ts +3 -0
- package/ui/kbd.jsx +8 -0
- package/ui/spinner.d.ts +2 -0
- package/ui/spinner.jsx +6 -0
package/index.d.ts
CHANGED
@@ -7,6 +7,7 @@
|
|
7
7
|
/// <reference path="./ui/avatar.d.ts" />;
|
8
8
|
/// <reference path="./ui/badge.d.ts" />;
|
9
9
|
/// <reference path="./ui/breadcrumb.d.ts" />;
|
10
|
+
/// <reference path="./ui/button-group.d.ts" />;
|
10
11
|
/// <reference path="./ui/button.d.ts" />;
|
11
12
|
/// <reference path="./ui/calendar.d.ts" />;
|
12
13
|
/// <reference path="./ui/card.d.ts" />;
|
@@ -19,10 +20,15 @@
|
|
19
20
|
/// <reference path="./ui/dialog.d.ts" />;
|
20
21
|
/// <reference path="./ui/drawer.d.ts" />;
|
21
22
|
/// <reference path="./ui/dropdown-menu.d.ts" />;
|
23
|
+
/// <reference path="./ui/empty.d.ts" />;
|
24
|
+
/// <reference path="./ui/field.d.ts" />;
|
22
25
|
/// <reference path="./ui/form.d.ts" />;
|
23
26
|
/// <reference path="./ui/hover-card.d.ts" />;
|
27
|
+
/// <reference path="./ui/input-group.d.ts" />;
|
24
28
|
/// <reference path="./ui/input-otp.d.ts" />;
|
25
29
|
/// <reference path="./ui/input.d.ts" />;
|
30
|
+
/// <reference path="./ui/item.d.ts" />;
|
31
|
+
/// <reference path="./ui/kbd.d.ts" />;
|
26
32
|
/// <reference path="./ui/label.d.ts" />;
|
27
33
|
/// <reference path="./ui/menubar.d.ts" />;
|
28
34
|
/// <reference path="./ui/navigation-menu.d.ts" />;
|
@@ -39,6 +45,7 @@
|
|
39
45
|
/// <reference path="./ui/skeleton.d.ts" />;
|
40
46
|
/// <reference path="./ui/slider.d.ts" />;
|
41
47
|
/// <reference path="./ui/sonner.d.ts" />;
|
48
|
+
/// <reference path="./ui/spinner.d.ts" />;
|
42
49
|
/// <reference path="./ui/switch.d.ts" />;
|
43
50
|
/// <reference path="./ui/table.d.ts" />;
|
44
51
|
/// <reference path="./ui/tabs.d.ts" />;
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "shadcn-packaged",
|
3
3
|
"private": false,
|
4
|
-
"version": "2025.
|
4
|
+
"version": "2025.10.6",
|
5
5
|
"type": "module",
|
6
6
|
"module": "index.mjs",
|
7
7
|
"scripts": {
|
@@ -57,7 +57,7 @@
|
|
57
57
|
"input-otp": "^1.4.2",
|
58
58
|
"next-themes": "^0.4.6",
|
59
59
|
"react-day-picker": "^9.11.0",
|
60
|
-
"react-hook-form": "^7.
|
60
|
+
"react-hook-form": "^7.64.0",
|
61
61
|
"react-resizable-panels": "^3.0.6",
|
62
62
|
"recharts": "^2.15.4",
|
63
63
|
"sonner": "^2.0.7",
|
@@ -74,7 +74,7 @@
|
|
74
74
|
"lucide-react": "^0.544.0",
|
75
75
|
"tailwind-merge": "^3.3.1",
|
76
76
|
"tailwindcss": "^3.4.17",
|
77
|
-
"tw-animate-css": "^1.
|
77
|
+
"tw-animate-css": "^1.4.0",
|
78
78
|
"typescript": "~5.6.2"
|
79
79
|
}
|
80
80
|
}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { type VariantProps } from "class-variance-authority";
|
2
|
+
import { Separator } from "../ui/separator";
|
3
|
+
declare const buttonGroupVariants: (props?: {
|
4
|
+
orientation?: "horizontal" | "vertical";
|
5
|
+
} & import("class-variance-authority/dist/types").ClassProp) => string;
|
6
|
+
declare function ButtonGroup({ className, orientation, ...props }: React.ComponentProps<"div"> & VariantProps<typeof buttonGroupVariants>): import("react").JSX.Element;
|
7
|
+
declare function ButtonGroupText({ className, asChild, ...props }: React.ComponentProps<"div"> & {
|
8
|
+
asChild?: boolean;
|
9
|
+
}): import("react").JSX.Element;
|
10
|
+
declare function ButtonGroupSeparator({ className, orientation, ...props }: React.ComponentProps<typeof Separator>): import("react").JSX.Element;
|
11
|
+
export { ButtonGroup, ButtonGroupSeparator, ButtonGroupText, buttonGroupVariants, };
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import { Slot } from "@radix-ui/react-slot";
|
2
|
+
import { cva } from "class-variance-authority";
|
3
|
+
import { cn } from "../lib/utils";
|
4
|
+
import { Separator } from "../ui/separator";
|
5
|
+
const buttonGroupVariants = cva("flex w-fit items-stretch has-[>[data-slot=button-group]]:gap-2 [&>*]:focus-visible:relative [&>*]:focus-visible:z-10 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1", {
|
6
|
+
variants: {
|
7
|
+
orientation: {
|
8
|
+
horizontal: "[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none",
|
9
|
+
vertical: "flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none",
|
10
|
+
},
|
11
|
+
},
|
12
|
+
defaultVariants: {
|
13
|
+
orientation: "horizontal",
|
14
|
+
},
|
15
|
+
});
|
16
|
+
function ButtonGroup({ className, orientation, ...props }) {
|
17
|
+
return (<div role="group" data-slot="button-group" data-orientation={orientation} className={cn(buttonGroupVariants({ orientation }), className)} {...props}/>);
|
18
|
+
}
|
19
|
+
function ButtonGroupText({ className, asChild = false, ...props }) {
|
20
|
+
const Comp = asChild ? Slot : "div";
|
21
|
+
return (<Comp className={cn("bg-muted shadow-xs flex items-center gap-2 rounded-md border px-4 text-sm font-medium [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none", className)} {...props}/>);
|
22
|
+
}
|
23
|
+
function ButtonGroupSeparator({ className, orientation = "vertical", ...props }) {
|
24
|
+
return (<Separator data-slot="button-group-separator" orientation={orientation} className={cn("bg-input relative !m-0 self-stretch data-[orientation=vertical]:h-auto", className)} {...props}/>);
|
25
|
+
}
|
26
|
+
export { ButtonGroup, ButtonGroupSeparator, ButtonGroupText, buttonGroupVariants, };
|
package/ui/empty.d.ts
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
import { type VariantProps } from "class-variance-authority";
|
2
|
+
declare function Empty({ className, ...props }: React.ComponentProps<"div">): import("react").JSX.Element;
|
3
|
+
declare function EmptyHeader({ className, ...props }: React.ComponentProps<"div">): import("react").JSX.Element;
|
4
|
+
declare const emptyMediaVariants: (props?: {
|
5
|
+
variant?: "default" | "icon";
|
6
|
+
} & import("class-variance-authority/dist/types").ClassProp) => string;
|
7
|
+
declare function EmptyMedia({ className, variant, ...props }: React.ComponentProps<"div"> & VariantProps<typeof emptyMediaVariants>): import("react").JSX.Element;
|
8
|
+
declare function EmptyTitle({ className, ...props }: React.ComponentProps<"div">): import("react").JSX.Element;
|
9
|
+
declare function EmptyDescription({ className, ...props }: React.ComponentProps<"p">): import("react").JSX.Element;
|
10
|
+
declare function EmptyContent({ className, ...props }: React.ComponentProps<"div">): import("react").JSX.Element;
|
11
|
+
export { Empty, EmptyHeader, EmptyTitle, EmptyDescription, EmptyContent, EmptyMedia, };
|
package/ui/empty.jsx
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
import { cva } from "class-variance-authority";
|
2
|
+
import { cn } from "../lib/utils";
|
3
|
+
function Empty({ className, ...props }) {
|
4
|
+
return (<div data-slot="empty" className={cn("flex min-w-0 flex-1 flex-col items-center justify-center gap-6 text-balance rounded-lg border-dashed p-6 text-center md:p-12", className)} {...props}/>);
|
5
|
+
}
|
6
|
+
function EmptyHeader({ className, ...props }) {
|
7
|
+
return (<div data-slot="empty-header" className={cn("flex max-w-sm flex-col items-center gap-2 text-center", className)} {...props}/>);
|
8
|
+
}
|
9
|
+
const emptyMediaVariants = cva("mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0", {
|
10
|
+
variants: {
|
11
|
+
variant: {
|
12
|
+
default: "bg-transparent",
|
13
|
+
icon: "bg-muted text-foreground flex size-10 shrink-0 items-center justify-center rounded-lg [&_svg:not([class*='size-'])]:size-6",
|
14
|
+
},
|
15
|
+
},
|
16
|
+
defaultVariants: {
|
17
|
+
variant: "default",
|
18
|
+
},
|
19
|
+
});
|
20
|
+
function EmptyMedia({ className, variant = "default", ...props }) {
|
21
|
+
return (<div data-slot="empty-icon" data-variant={variant} className={cn(emptyMediaVariants({ variant, className }))} {...props}/>);
|
22
|
+
}
|
23
|
+
function EmptyTitle({ className, ...props }) {
|
24
|
+
return (<div data-slot="empty-title" className={cn("text-lg font-medium tracking-tight", className)} {...props}/>);
|
25
|
+
}
|
26
|
+
function EmptyDescription({ className, ...props }) {
|
27
|
+
return (<div data-slot="empty-description" className={cn("text-muted-foreground [&>a:hover]:text-primary text-sm/relaxed [&>a]:underline [&>a]:underline-offset-4", className)} {...props}/>);
|
28
|
+
}
|
29
|
+
function EmptyContent({ className, ...props }) {
|
30
|
+
return (<div data-slot="empty-content" className={cn("flex w-full min-w-0 max-w-sm flex-col items-center gap-4 text-balance text-sm", className)} {...props}/>);
|
31
|
+
}
|
32
|
+
export { Empty, EmptyHeader, EmptyTitle, EmptyDescription, EmptyContent, EmptyMedia, };
|
package/ui/field.d.ts
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
import { type VariantProps } from "class-variance-authority";
|
2
|
+
import { Label } from "../ui/label";
|
3
|
+
declare function FieldSet({ className, ...props }: React.ComponentProps<"fieldset">): import("react").JSX.Element;
|
4
|
+
declare function FieldLegend({ className, variant, ...props }: React.ComponentProps<"legend"> & {
|
5
|
+
variant?: "legend" | "label";
|
6
|
+
}): import("react").JSX.Element;
|
7
|
+
declare function FieldGroup({ className, ...props }: React.ComponentProps<"div">): import("react").JSX.Element;
|
8
|
+
declare const fieldVariants: (props?: {
|
9
|
+
orientation?: "horizontal" | "vertical" | "responsive";
|
10
|
+
} & import("class-variance-authority/dist/types").ClassProp) => string;
|
11
|
+
declare function Field({ className, orientation, ...props }: React.ComponentProps<"div"> & VariantProps<typeof fieldVariants>): import("react").JSX.Element;
|
12
|
+
declare function FieldContent({ className, ...props }: React.ComponentProps<"div">): import("react").JSX.Element;
|
13
|
+
declare function FieldLabel({ className, ...props }: React.ComponentProps<typeof Label>): import("react").JSX.Element;
|
14
|
+
declare function FieldTitle({ className, ...props }: React.ComponentProps<"div">): import("react").JSX.Element;
|
15
|
+
declare function FieldDescription({ className, ...props }: React.ComponentProps<"p">): import("react").JSX.Element;
|
16
|
+
declare function FieldSeparator({ children, className, ...props }: React.ComponentProps<"div"> & {
|
17
|
+
children?: React.ReactNode;
|
18
|
+
}): import("react").JSX.Element;
|
19
|
+
declare function FieldError({ className, children, errors, ...props }: React.ComponentProps<"div"> & {
|
20
|
+
errors?: Array<{
|
21
|
+
message?: string;
|
22
|
+
} | undefined>;
|
23
|
+
}): import("react").JSX.Element;
|
24
|
+
export { Field, FieldLabel, FieldDescription, FieldError, FieldGroup, FieldLegend, FieldSeparator, FieldSet, FieldContent, FieldTitle, };
|
package/ui/field.jsx
ADDED
@@ -0,0 +1,81 @@
|
|
1
|
+
"use client";
|
2
|
+
import { useMemo } from "react";
|
3
|
+
import { cva } from "class-variance-authority";
|
4
|
+
import { cn } from "../lib/utils";
|
5
|
+
import { Label } from "../ui/label";
|
6
|
+
import { Separator } from "../ui/separator";
|
7
|
+
function FieldSet({ className, ...props }) {
|
8
|
+
return (<fieldset data-slot="field-set" className={cn("flex flex-col gap-6", "has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3", className)} {...props}/>);
|
9
|
+
}
|
10
|
+
function FieldLegend({ className, variant = "legend", ...props }) {
|
11
|
+
return (<legend data-slot="field-legend" data-variant={variant} className={cn("mb-3 font-medium", "data-[variant=legend]:text-base", "data-[variant=label]:text-sm", className)} {...props}/>);
|
12
|
+
}
|
13
|
+
function FieldGroup({ className, ...props }) {
|
14
|
+
return (<div data-slot="field-group" className={cn("group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4", className)} {...props}/>);
|
15
|
+
}
|
16
|
+
const fieldVariants = cva("group/field data-[invalid=true]:text-destructive flex w-full gap-3", {
|
17
|
+
variants: {
|
18
|
+
orientation: {
|
19
|
+
vertical: ["flex-col [&>*]:w-full [&>.sr-only]:w-auto"],
|
20
|
+
horizontal: [
|
21
|
+
"flex-row items-center",
|
22
|
+
"[&>[data-slot=field-label]]:flex-auto",
|
23
|
+
"has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px has-[>[data-slot=field-content]]:items-start",
|
24
|
+
],
|
25
|
+
responsive: [
|
26
|
+
"@md/field-group:flex-row @md/field-group:items-center @md/field-group:[&>*]:w-auto flex-col [&>*]:w-full [&>.sr-only]:w-auto",
|
27
|
+
"@md/field-group:[&>[data-slot=field-label]]:flex-auto",
|
28
|
+
"@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
|
29
|
+
],
|
30
|
+
},
|
31
|
+
},
|
32
|
+
defaultVariants: {
|
33
|
+
orientation: "vertical",
|
34
|
+
},
|
35
|
+
});
|
36
|
+
function Field({ className, orientation = "vertical", ...props }) {
|
37
|
+
return (<div role="group" data-slot="field" data-orientation={orientation} className={cn(fieldVariants({ orientation }), className)} {...props}/>);
|
38
|
+
}
|
39
|
+
function FieldContent({ className, ...props }) {
|
40
|
+
return (<div data-slot="field-content" className={cn("group/field-content flex flex-1 flex-col gap-1.5 leading-snug", className)} {...props}/>);
|
41
|
+
}
|
42
|
+
function FieldLabel({ className, ...props }) {
|
43
|
+
return (<Label data-slot="field-label" className={cn("group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50", "has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>[data-slot=field]]:p-4", "has-data-[state=checked]:bg-primary/5 has-data-[state=checked]:border-primary dark:has-data-[state=checked]:bg-primary/10", className)} {...props}/>);
|
44
|
+
}
|
45
|
+
function FieldTitle({ className, ...props }) {
|
46
|
+
return (<div data-slot="field-label" className={cn("flex w-fit items-center gap-2 text-sm font-medium leading-snug group-data-[disabled=true]/field:opacity-50", className)} {...props}/>);
|
47
|
+
}
|
48
|
+
function FieldDescription({ className, ...props }) {
|
49
|
+
return (<p data-slot="field-description" className={cn("text-muted-foreground text-sm font-normal leading-normal group-has-[[data-orientation=horizontal]]/field:text-balance", "nth-last-2:-mt-1 last:mt-0 [[data-variant=legend]+&]:-mt-1.5", "[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4", className)} {...props}/>);
|
50
|
+
}
|
51
|
+
function FieldSeparator({ children, className, ...props }) {
|
52
|
+
return (<div data-slot="field-separator" data-content={!!children} className={cn("relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2", className)} {...props}>
|
53
|
+
<Separator className="absolute inset-0 top-1/2"/>
|
54
|
+
{children && (<span className="bg-background text-muted-foreground relative mx-auto block w-fit px-2" data-slot="field-separator-content">
|
55
|
+
{children}
|
56
|
+
</span>)}
|
57
|
+
</div>);
|
58
|
+
}
|
59
|
+
function FieldError({ className, children, errors, ...props }) {
|
60
|
+
const content = useMemo(() => {
|
61
|
+
if (children) {
|
62
|
+
return children;
|
63
|
+
}
|
64
|
+
if (!errors) {
|
65
|
+
return null;
|
66
|
+
}
|
67
|
+
if (errors?.length === 1 && errors[0]?.message) {
|
68
|
+
return errors[0].message;
|
69
|
+
}
|
70
|
+
return (<ul className="ml-4 flex list-disc flex-col gap-1">
|
71
|
+
{errors.map((error, index) => error?.message && <li key={index}>{error.message}</li>)}
|
72
|
+
</ul>);
|
73
|
+
}, [children, errors]);
|
74
|
+
if (!content) {
|
75
|
+
return null;
|
76
|
+
}
|
77
|
+
return (<div role="alert" data-slot="field-error" className={cn("text-destructive text-sm font-normal", className)} {...props}>
|
78
|
+
{content}
|
79
|
+
</div>);
|
80
|
+
}
|
81
|
+
export { Field, FieldLabel, FieldDescription, FieldError, FieldGroup, FieldLegend, FieldSeparator, FieldSet, FieldContent, FieldTitle, };
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import * as React from "react";
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
3
|
+
import { Button } from "../ui/button";
|
4
|
+
declare function InputGroup({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
5
|
+
declare const inputGroupAddonVariants: (props?: {
|
6
|
+
align?: "block-end" | "block-start" | "inline-end" | "inline-start";
|
7
|
+
} & import("class-variance-authority/dist/types").ClassProp) => string;
|
8
|
+
declare function InputGroupAddon({ className, align, ...props }: React.ComponentProps<"div"> & VariantProps<typeof inputGroupAddonVariants>): React.JSX.Element;
|
9
|
+
declare const inputGroupButtonVariants: (props?: {
|
10
|
+
size?: "sm" | "xs" | "icon-xs" | "icon-sm";
|
11
|
+
} & import("class-variance-authority/dist/types").ClassProp) => string;
|
12
|
+
declare function InputGroupButton({ className, type, variant, size, ...props }: Omit<React.ComponentProps<typeof Button>, "size"> & VariantProps<typeof inputGroupButtonVariants>): React.JSX.Element;
|
13
|
+
declare function InputGroupText({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
14
|
+
declare function InputGroupInput({ className, ...props }: React.ComponentProps<"input">): React.JSX.Element;
|
15
|
+
declare function InputGroupTextarea({ className, ...props }: React.ComponentProps<"textarea">): React.JSX.Element;
|
16
|
+
export { InputGroup, InputGroupAddon, InputGroupButton, InputGroupText, InputGroupInput, InputGroupTextarea, };
|
@@ -0,0 +1,63 @@
|
|
1
|
+
"use client";
|
2
|
+
import * as React from "react";
|
3
|
+
import { cva } from "class-variance-authority";
|
4
|
+
import { cn } from "../lib/utils";
|
5
|
+
import { Button } from "../ui/button";
|
6
|
+
import { Input } from "../ui/input";
|
7
|
+
import { Textarea } from "../ui/textarea";
|
8
|
+
function InputGroup({ className, ...props }) {
|
9
|
+
return (<div data-slot="input-group" role="group" className={cn("group/input-group border-input dark:bg-input/30 shadow-xs relative flex w-full items-center rounded-md border outline-none transition-[color,box-shadow]", "h-9 has-[>textarea]:h-auto",
|
10
|
+
// Variants based on alignment.
|
11
|
+
"has-[>[data-align=inline-start]]:[&>input]:pl-2", "has-[>[data-align=inline-end]]:[&>input]:pr-2", "has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3", "has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3",
|
12
|
+
// Focus state.
|
13
|
+
"has-[[data-slot=input-group-control]:focus-visible]:ring-ring has-[[data-slot=input-group-control]:focus-visible]:ring-1",
|
14
|
+
// Error state.
|
15
|
+
"has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40", className)} {...props}/>);
|
16
|
+
}
|
17
|
+
const inputGroupAddonVariants = cva("text-muted-foreground flex h-auto cursor-text select-none items-center justify-center gap-2 py-1.5 text-sm font-medium group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4", {
|
18
|
+
variants: {
|
19
|
+
align: {
|
20
|
+
"inline-start": "order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]",
|
21
|
+
"inline-end": "order-last pr-3 has-[>button]:mr-[-0.4rem] has-[>kbd]:mr-[-0.35rem]",
|
22
|
+
"block-start": "[.border-b]:pb-3 order-first w-full justify-start px-3 pt-3 group-has-[>input]/input-group:pt-2.5",
|
23
|
+
"block-end": "[.border-t]:pt-3 order-last w-full justify-start px-3 pb-3 group-has-[>input]/input-group:pb-2.5",
|
24
|
+
},
|
25
|
+
},
|
26
|
+
defaultVariants: {
|
27
|
+
align: "inline-start",
|
28
|
+
},
|
29
|
+
});
|
30
|
+
function InputGroupAddon({ className, align = "inline-start", ...props }) {
|
31
|
+
return (<div role="group" data-slot="input-group-addon" data-align={align} className={cn(inputGroupAddonVariants({ align }), className)} onClick={(e) => {
|
32
|
+
if (e.target.closest("button")) {
|
33
|
+
return;
|
34
|
+
}
|
35
|
+
e.currentTarget.parentElement?.querySelector("input")?.focus();
|
36
|
+
}} {...props}/>);
|
37
|
+
}
|
38
|
+
const inputGroupButtonVariants = cva("flex items-center gap-2 text-sm shadow-none", {
|
39
|
+
variants: {
|
40
|
+
size: {
|
41
|
+
xs: "h-6 gap-1 rounded-[calc(var(--radius)-5px)] px-2 has-[>svg]:px-2 [&>svg:not([class*='size-'])]:size-3.5",
|
42
|
+
sm: "h-8 gap-1.5 rounded-md px-2.5 has-[>svg]:px-2.5",
|
43
|
+
"icon-xs": "size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0",
|
44
|
+
"icon-sm": "size-8 p-0 has-[>svg]:p-0",
|
45
|
+
},
|
46
|
+
},
|
47
|
+
defaultVariants: {
|
48
|
+
size: "xs",
|
49
|
+
},
|
50
|
+
});
|
51
|
+
function InputGroupButton({ className, type = "button", variant = "ghost", size = "xs", ...props }) {
|
52
|
+
return (<Button type={type} data-size={size} variant={variant} className={cn(inputGroupButtonVariants({ size }), className)} {...props}/>);
|
53
|
+
}
|
54
|
+
function InputGroupText({ className, ...props }) {
|
55
|
+
return (<span className={cn("text-muted-foreground flex items-center gap-2 text-sm [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none", className)} {...props}/>);
|
56
|
+
}
|
57
|
+
function InputGroupInput({ className, ...props }) {
|
58
|
+
return (<Input data-slot="input-group-control" className={cn("flex-1 rounded-none border-0 bg-transparent shadow-none focus-visible:ring-0 dark:bg-transparent", className)} {...props}/>);
|
59
|
+
}
|
60
|
+
function InputGroupTextarea({ className, ...props }) {
|
61
|
+
return (<Textarea data-slot="input-group-control" className={cn("flex-1 resize-none rounded-none border-0 bg-transparent py-3 shadow-none focus-visible:ring-0 dark:bg-transparent", className)} {...props}/>);
|
62
|
+
}
|
63
|
+
export { InputGroup, InputGroupAddon, InputGroupButton, InputGroupText, InputGroupInput, InputGroupTextarea, };
|
package/ui/item.d.ts
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
import * as React from "react";
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
3
|
+
import { Separator } from "../ui/separator";
|
4
|
+
declare function ItemGroup({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
5
|
+
declare function ItemSeparator({ className, ...props }: React.ComponentProps<typeof Separator>): React.JSX.Element;
|
6
|
+
declare const itemVariants: (props?: {
|
7
|
+
variant?: "default" | "outline" | "muted";
|
8
|
+
size?: "default" | "sm";
|
9
|
+
} & import("class-variance-authority/dist/types").ClassProp) => string;
|
10
|
+
declare function Item({ className, variant, size, asChild, ...props }: React.ComponentProps<"div"> & VariantProps<typeof itemVariants> & {
|
11
|
+
asChild?: boolean;
|
12
|
+
}): React.JSX.Element;
|
13
|
+
declare const itemMediaVariants: (props?: {
|
14
|
+
variant?: "default" | "image" | "icon";
|
15
|
+
} & import("class-variance-authority/dist/types").ClassProp) => string;
|
16
|
+
declare function ItemMedia({ className, variant, ...props }: React.ComponentProps<"div"> & VariantProps<typeof itemMediaVariants>): React.JSX.Element;
|
17
|
+
declare function ItemContent({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
18
|
+
declare function ItemTitle({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
19
|
+
declare function ItemDescription({ className, ...props }: React.ComponentProps<"p">): React.JSX.Element;
|
20
|
+
declare function ItemActions({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
21
|
+
declare function ItemHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
22
|
+
declare function ItemFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
23
|
+
export { Item, ItemMedia, ItemContent, ItemActions, ItemGroup, ItemSeparator, ItemTitle, ItemDescription, ItemHeader, ItemFooter, };
|
package/ui/item.jsx
ADDED
@@ -0,0 +1,66 @@
|
|
1
|
+
import * as React from "react";
|
2
|
+
import { Slot } from "@radix-ui/react-slot";
|
3
|
+
import { cva } from "class-variance-authority";
|
4
|
+
import { cn } from "../lib/utils";
|
5
|
+
import { Separator } from "../ui/separator";
|
6
|
+
function ItemGroup({ className, ...props }) {
|
7
|
+
return (<div role="list" data-slot="item-group" className={cn("group/item-group flex flex-col", className)} {...props}/>);
|
8
|
+
}
|
9
|
+
function ItemSeparator({ className, ...props }) {
|
10
|
+
return (<Separator data-slot="item-separator" orientation="horizontal" className={cn("my-0", className)} {...props}/>);
|
11
|
+
}
|
12
|
+
const itemVariants = cva("group/item [a]:hover:bg-accent/50 focus-visible:border-ring focus-visible:ring-ring/50 [a]:transition-colors flex flex-wrap items-center rounded-md border border-transparent text-sm outline-none transition-colors duration-100 focus-visible:ring-[3px]", {
|
13
|
+
variants: {
|
14
|
+
variant: {
|
15
|
+
default: "bg-transparent",
|
16
|
+
outline: "border-border",
|
17
|
+
muted: "bg-muted/50",
|
18
|
+
},
|
19
|
+
size: {
|
20
|
+
default: "gap-4 p-4 ",
|
21
|
+
sm: "gap-2.5 px-4 py-3",
|
22
|
+
},
|
23
|
+
},
|
24
|
+
defaultVariants: {
|
25
|
+
variant: "default",
|
26
|
+
size: "default",
|
27
|
+
},
|
28
|
+
});
|
29
|
+
function Item({ className, variant = "default", size = "default", asChild = false, ...props }) {
|
30
|
+
const Comp = asChild ? Slot : "div";
|
31
|
+
return (<Comp data-slot="item" data-variant={variant} data-size={size} className={cn(itemVariants({ variant, size, className }))} {...props}/>);
|
32
|
+
}
|
33
|
+
const itemMediaVariants = cva("flex shrink-0 items-center justify-center gap-2 group-has-[[data-slot=item-description]]/item:translate-y-0.5 group-has-[[data-slot=item-description]]/item:self-start [&_svg]:pointer-events-none", {
|
34
|
+
variants: {
|
35
|
+
variant: {
|
36
|
+
default: "bg-transparent",
|
37
|
+
icon: "bg-muted size-8 rounded-sm border [&_svg:not([class*='size-'])]:size-4",
|
38
|
+
image: "size-10 overflow-hidden rounded-sm [&_img]:size-full [&_img]:object-cover",
|
39
|
+
},
|
40
|
+
},
|
41
|
+
defaultVariants: {
|
42
|
+
variant: "default",
|
43
|
+
},
|
44
|
+
});
|
45
|
+
function ItemMedia({ className, variant = "default", ...props }) {
|
46
|
+
return (<div data-slot="item-media" data-variant={variant} className={cn(itemMediaVariants({ variant, className }))} {...props}/>);
|
47
|
+
}
|
48
|
+
function ItemContent({ className, ...props }) {
|
49
|
+
return (<div data-slot="item-content" className={cn("flex flex-1 flex-col gap-1 [&+[data-slot=item-content]]:flex-none", className)} {...props}/>);
|
50
|
+
}
|
51
|
+
function ItemTitle({ className, ...props }) {
|
52
|
+
return (<div data-slot="item-title" className={cn("flex w-fit items-center gap-2 text-sm font-medium leading-snug", className)} {...props}/>);
|
53
|
+
}
|
54
|
+
function ItemDescription({ className, ...props }) {
|
55
|
+
return (<p data-slot="item-description" className={cn("text-muted-foreground line-clamp-2 text-balance text-sm font-normal leading-normal", "[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4", className)} {...props}/>);
|
56
|
+
}
|
57
|
+
function ItemActions({ className, ...props }) {
|
58
|
+
return (<div data-slot="item-actions" className={cn("flex items-center gap-2", className)} {...props}/>);
|
59
|
+
}
|
60
|
+
function ItemHeader({ className, ...props }) {
|
61
|
+
return (<div data-slot="item-header" className={cn("flex basis-full items-center justify-between gap-2", className)} {...props}/>);
|
62
|
+
}
|
63
|
+
function ItemFooter({ className, ...props }) {
|
64
|
+
return (<div data-slot="item-footer" className={cn("flex basis-full items-center justify-between gap-2", className)} {...props}/>);
|
65
|
+
}
|
66
|
+
export { Item, ItemMedia, ItemContent, ItemActions, ItemGroup, ItemSeparator, ItemTitle, ItemDescription, ItemHeader, ItemFooter, };
|
package/ui/kbd.d.ts
ADDED
package/ui/kbd.jsx
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
import { cn } from "../lib/utils";
|
2
|
+
function Kbd({ className, ...props }) {
|
3
|
+
return (<kbd data-slot="kbd" className={cn("bg-muted text-muted-foreground pointer-events-none inline-flex h-5 w-fit min-w-5 select-none items-center justify-center gap-1 rounded-sm px-1 font-sans text-xs font-medium", "[&_svg:not([class*='size-'])]:size-3", "[[data-slot=tooltip-content]_&]:bg-background/20 [[data-slot=tooltip-content]_&]:text-background dark:[[data-slot=tooltip-content]_&]:bg-background/10", className)} {...props}/>);
|
4
|
+
}
|
5
|
+
function KbdGroup({ className, ...props }) {
|
6
|
+
return (<kbd data-slot="kbd-group" className={cn("inline-flex items-center gap-1", className)} {...props}/>);
|
7
|
+
}
|
8
|
+
export { Kbd, KbdGroup };
|
package/ui/spinner.d.ts
ADDED
package/ui/spinner.jsx
ADDED
@@ -0,0 +1,6 @@
|
|
1
|
+
import { Loader2Icon } from "lucide-react";
|
2
|
+
import { cn } from "../lib/utils";
|
3
|
+
function Spinner({ className, ...props }) {
|
4
|
+
return (<Loader2Icon role="status" aria-label="Loading" className={cn("size-4 animate-spin", className)} {...props}/>);
|
5
|
+
}
|
6
|
+
export { Spinner };
|