shadcn-packaged 2025.8.25 → 2025.9.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/index.css +20 -0
- package/package.json +4 -4
- package/ui/accordion.d.ts +4 -4
- package/ui/accordion.jsx +15 -20
- package/ui/alert-dialog.d.ts +17 -11
- package/ui/alert-dialog.jsx +23 -36
- package/ui/alert.d.ts +4 -5
- package/ui/alert.jsx +9 -12
- package/ui/aspect-ratio.d.ts +1 -1
- package/ui/aspect-ratio.jsx +1 -3
- package/ui/avatar.d.ts +3 -3
- package/ui/avatar.jsx +6 -9
- package/ui/badge.d.ts +3 -3
- package/ui/badge.jsx +7 -9
- package/ui/breadcrumb.d.ts +16 -8
- package/ui/breadcrumb.jsx +21 -26
- package/ui/button.d.ts +3 -2
- package/ui/button.jsx +14 -13
- package/ui/calendar.jsx +20 -20
- package/ui/card.d.ts +7 -8
- package/ui/card.jsx +13 -22
- package/ui/carousel.d.ts +5 -6
- package/ui/carousel.jsx +34 -26
- package/ui/chart.d.ts +28 -6
- package/ui/chart.jsx +40 -37
- package/ui/checkbox.d.ts +1 -1
- package/ui/checkbox.jsx +7 -8
- package/ui/collapsible.d.ts +3 -3
- package/ui/collapsible.jsx +3 -9
- package/ui/command.d.ts +78 -16
- package/ui/command.jsx +27 -37
- package/ui/context-menu.d.ts +21 -19
- package/ui/context-menu.jsx +47 -65
- package/ui/dialog.d.ts +17 -13
- package/ui/dialog.jsx +27 -41
- package/ui/drawer.d.ts +19 -10
- package/ui/drawer.jsx +23 -36
- package/ui/dropdown-menu.d.ts +22 -20
- package/ui/dropdown-menu.jsx +50 -66
- package/ui/form.d.ts +5 -6
- package/ui/form.jsx +23 -19
- package/ui/hover-card.d.ts +3 -3
- package/ui/hover-card.jsx +4 -11
- package/ui/input-otp.d.ts +30 -7
- package/ui/input-otp.jsx +15 -17
- package/ui/input.d.ts +1 -1
- package/ui/input.jsx +4 -3
- package/ui/label.d.ts +2 -1
- package/ui/label.jsx +4 -3
- package/ui/menubar.d.ts +19 -17
- package/ui/menubar.jsx +49 -58
- package/ui/navigation-menu.d.ts +9 -11
- package/ui/navigation-menu.jsx +29 -37
- package/ui/pagination.d.ts +25 -10
- package/ui/pagination.jsx +28 -35
- package/ui/popover.d.ts +4 -5
- package/ui/popover.jsx +7 -15
- package/ui/progress.d.ts +1 -1
- package/ui/progress.jsx +4 -5
- package/ui/radio-group.d.ts +2 -2
- package/ui/radio-group.jsx +11 -9
- package/ui/resizable.d.ts +20 -5
- package/ui/resizable.jsx +8 -15
- package/ui/scroll-area.d.ts +2 -2
- package/ui/scroll-area.jsx +14 -16
- package/ui/select.d.ts +11 -13
- package/ui/select.jsx +47 -58
- package/ui/separator.d.ts +1 -1
- package/ui/separator.jsx +2 -3
- package/ui/sheet.d.ts +23 -11
- package/ui/sheet.jsx +41 -45
- package/ui/sidebar.d.ts +34 -38
- package/ui/sidebar.jsx +122 -109
- package/ui/skeleton.d.ts +1 -1
- package/ui/skeleton.jsx +1 -1
- package/ui/slider.d.ts +1 -1
- package/ui/slider.jsx +7 -13
- package/ui/sonner.d.ts +2 -1
- package/ui/sonner.jsx +7 -4
- package/ui/switch.d.ts +2 -2
- package/ui/switch.jsx +5 -6
- package/ui/table.d.ts +8 -8
- package/ui/table.jsx +18 -27
- package/ui/tabs.d.ts +4 -4
- package/ui/tabs.jsx +7 -12
- package/ui/textarea.d.ts +1 -1
- package/ui/textarea.jsx +4 -3
- package/ui/toggle-group.d.ts +8 -3
- package/ui/toggle-group.jsx +11 -11
- package/ui/toggle.d.ts +4 -1
- package/ui/toggle.jsx +7 -8
- package/ui/tooltip.d.ts +4 -4
- package/ui/tooltip.jsx +5 -19
package/ui/dropdown-menu.d.ts
CHANGED
@@ -1,25 +1,27 @@
|
|
1
1
|
import * as React from "react";
|
2
2
|
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
3
|
-
declare
|
4
|
-
declare
|
5
|
-
declare
|
6
|
-
declare
|
7
|
-
declare
|
8
|
-
declare
|
3
|
+
declare const DropdownMenu: React.FC<DropdownMenuPrimitive.DropdownMenuProps>;
|
4
|
+
declare const DropdownMenuTrigger: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
5
|
+
declare const DropdownMenuGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuGroupProps & React.RefAttributes<HTMLDivElement>>;
|
6
|
+
declare const DropdownMenuPortal: React.FC<DropdownMenuPrimitive.DropdownMenuPortalProps>;
|
7
|
+
declare const DropdownMenuSub: React.FC<DropdownMenuPrimitive.DropdownMenuSubProps>;
|
8
|
+
declare const DropdownMenuRadioGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuRadioGroupProps & React.RefAttributes<HTMLDivElement>>;
|
9
|
+
declare const DropdownMenuSubTrigger: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubTriggerProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
9
10
|
inset?: boolean;
|
10
|
-
|
11
|
-
|
12
|
-
declare
|
13
|
-
declare
|
14
|
-
declare function DropdownMenuRadioItem({ className, children, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>): React.JSX.Element;
|
15
|
-
declare function DropdownMenuLabel({ className, inset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
|
11
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
12
|
+
declare const DropdownMenuSubContent: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
13
|
+
declare const DropdownMenuContent: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
14
|
+
declare const DropdownMenuItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
16
15
|
inset?: boolean;
|
17
|
-
}
|
18
|
-
declare
|
19
|
-
declare
|
20
|
-
declare
|
21
|
-
declare function DropdownMenuSubTrigger({ className, inset, children, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
|
16
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
17
|
+
declare const DropdownMenuCheckboxItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuCheckboxItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
18
|
+
declare const DropdownMenuRadioItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuRadioItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
19
|
+
declare const DropdownMenuLabel: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
22
20
|
inset?: boolean;
|
23
|
-
}
|
24
|
-
declare
|
25
|
-
|
21
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
22
|
+
declare const DropdownMenuSeparator: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
23
|
+
declare const DropdownMenuShortcut: {
|
24
|
+
({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): React.JSX.Element;
|
25
|
+
displayName: string;
|
26
|
+
};
|
27
|
+
export { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuGroup, DropdownMenuPortal, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuRadioGroup, };
|
package/ui/dropdown-menu.jsx
CHANGED
@@ -1,70 +1,54 @@
|
|
1
1
|
"use client";
|
2
2
|
import * as React from "react";
|
3
3
|
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
4
|
-
import {
|
4
|
+
import { Check, ChevronRight, Circle } from "lucide-react";
|
5
5
|
import { cn } from "../lib/utils";
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
}
|
23
|
-
|
24
|
-
|
25
|
-
}
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
}
|
49
|
-
|
50
|
-
|
51
|
-
}
|
52
|
-
|
53
|
-
|
54
|
-
}
|
55
|
-
function DropdownMenuShortcut({ className, ...props }) {
|
56
|
-
return (<span data-slot="dropdown-menu-shortcut" className={cn("text-muted-foreground ml-auto text-xs tracking-widest", className)} {...props}/>);
|
57
|
-
}
|
58
|
-
function DropdownMenuSub({ ...props }) {
|
59
|
-
return <DropdownMenuPrimitive.Sub data-slot="dropdown-menu-sub" {...props}/>;
|
60
|
-
}
|
61
|
-
function DropdownMenuSubTrigger({ className, inset, children, ...props }) {
|
62
|
-
return (<DropdownMenuPrimitive.SubTrigger data-slot="dropdown-menu-sub-trigger" data-inset={inset} className={cn("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8", className)} {...props}>
|
63
|
-
{children}
|
64
|
-
<ChevronRightIcon className="ml-auto size-4"/>
|
65
|
-
</DropdownMenuPrimitive.SubTrigger>);
|
66
|
-
}
|
67
|
-
function DropdownMenuSubContent({ className, ...props }) {
|
68
|
-
return (<DropdownMenuPrimitive.SubContent data-slot="dropdown-menu-sub-content" className={cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg", className)} {...props}/>);
|
69
|
-
}
|
70
|
-
export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, };
|
6
|
+
const DropdownMenu = DropdownMenuPrimitive.Root;
|
7
|
+
const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
8
|
+
const DropdownMenuGroup = DropdownMenuPrimitive.Group;
|
9
|
+
const DropdownMenuPortal = DropdownMenuPrimitive.Portal;
|
10
|
+
const DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
11
|
+
const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
12
|
+
const DropdownMenuSubTrigger = React.forwardRef(({ className, inset, children, ...props }, ref) => (<DropdownMenuPrimitive.SubTrigger ref={ref} className={cn("flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", inset && "pl-8", className)} {...props}>
|
13
|
+
{children}
|
14
|
+
<ChevronRight className="ml-auto"/>
|
15
|
+
</DropdownMenuPrimitive.SubTrigger>));
|
16
|
+
DropdownMenuSubTrigger.displayName =
|
17
|
+
DropdownMenuPrimitive.SubTrigger.displayName;
|
18
|
+
const DropdownMenuSubContent = React.forwardRef(({ className, ...props }, ref) => (<DropdownMenuPrimitive.SubContent ref={ref} className={cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]", className)} {...props}/>));
|
19
|
+
DropdownMenuSubContent.displayName =
|
20
|
+
DropdownMenuPrimitive.SubContent.displayName;
|
21
|
+
const DropdownMenuContent = React.forwardRef(({ className, sideOffset = 4, ...props }, ref) => (<DropdownMenuPrimitive.Portal>
|
22
|
+
<DropdownMenuPrimitive.Content ref={ref} sideOffset={sideOffset} className={cn("z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]", className)} {...props}/>
|
23
|
+
</DropdownMenuPrimitive.Portal>));
|
24
|
+
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
25
|
+
const DropdownMenuItem = React.forwardRef(({ className, inset, ...props }, ref) => (<DropdownMenuPrimitive.Item ref={ref} className={cn("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", inset && "pl-8", className)} {...props}/>));
|
26
|
+
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
27
|
+
const DropdownMenuCheckboxItem = React.forwardRef(({ className, children, checked, ...props }, ref) => (<DropdownMenuPrimitive.CheckboxItem ref={ref} className={cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className)} checked={checked} {...props}>
|
28
|
+
<span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
|
29
|
+
<DropdownMenuPrimitive.ItemIndicator>
|
30
|
+
<Check className="h-4 w-4"/>
|
31
|
+
</DropdownMenuPrimitive.ItemIndicator>
|
32
|
+
</span>
|
33
|
+
{children}
|
34
|
+
</DropdownMenuPrimitive.CheckboxItem>));
|
35
|
+
DropdownMenuCheckboxItem.displayName =
|
36
|
+
DropdownMenuPrimitive.CheckboxItem.displayName;
|
37
|
+
const DropdownMenuRadioItem = React.forwardRef(({ className, children, ...props }, ref) => (<DropdownMenuPrimitive.RadioItem ref={ref} className={cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className)} {...props}>
|
38
|
+
<span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
|
39
|
+
<DropdownMenuPrimitive.ItemIndicator>
|
40
|
+
<Circle className="h-2 w-2 fill-current"/>
|
41
|
+
</DropdownMenuPrimitive.ItemIndicator>
|
42
|
+
</span>
|
43
|
+
{children}
|
44
|
+
</DropdownMenuPrimitive.RadioItem>));
|
45
|
+
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
46
|
+
const DropdownMenuLabel = React.forwardRef(({ className, inset, ...props }, ref) => (<DropdownMenuPrimitive.Label ref={ref} className={cn("px-2 py-1.5 text-sm font-semibold", inset && "pl-8", className)} {...props}/>));
|
47
|
+
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
48
|
+
const DropdownMenuSeparator = React.forwardRef(({ className, ...props }, ref) => (<DropdownMenuPrimitive.Separator ref={ref} className={cn("-mx-1 my-1 h-px bg-muted", className)} {...props}/>));
|
49
|
+
DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
|
50
|
+
const DropdownMenuShortcut = ({ className, ...props }) => {
|
51
|
+
return (<span className={cn("ml-auto text-xs tracking-widest opacity-60", className)} {...props}/>);
|
52
|
+
};
|
53
|
+
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
54
|
+
export { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuGroup, DropdownMenuPortal, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuRadioGroup, };
|
package/ui/form.d.ts
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
import * as React from "react";
|
2
2
|
import * as LabelPrimitive from "@radix-ui/react-label";
|
3
|
-
import { Slot } from "@radix-ui/react-slot";
|
4
3
|
import { type ControllerProps, type FieldPath, type FieldValues } from "react-hook-form";
|
5
4
|
declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>(props: import("react-hook-form").FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
|
6
5
|
declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: ControllerProps<TFieldValues, TName>) => React.JSX.Element;
|
@@ -16,9 +15,9 @@ declare const useFormField: () => {
|
|
16
15
|
formDescriptionId: string;
|
17
16
|
formMessageId: string;
|
18
17
|
};
|
19
|
-
declare
|
20
|
-
declare
|
21
|
-
declare
|
22
|
-
declare
|
23
|
-
declare
|
18
|
+
declare const FormItem: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
19
|
+
declare const FormLabel: React.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & React.RefAttributes<HTMLLabelElement>>;
|
20
|
+
declare const FormControl: React.ForwardRefExoticComponent<Omit<import("@radix-ui/react-slot").SlotProps & React.RefAttributes<HTMLElement>, "ref"> & React.RefAttributes<HTMLElement>>;
|
21
|
+
declare const FormDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
22
|
+
declare const FormMessage: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
24
23
|
export { useFormField, Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField, };
|
package/ui/form.jsx
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
"use client";
|
2
2
|
import * as React from "react";
|
3
3
|
import { Slot } from "@radix-ui/react-slot";
|
4
|
-
import { Controller, FormProvider, useFormContext,
|
4
|
+
import { Controller, FormProvider, useFormContext, } from "react-hook-form";
|
5
5
|
import { cn } from "../lib/utils";
|
6
6
|
import { Label } from "../ui/label";
|
7
7
|
const Form = FormProvider;
|
@@ -14,8 +14,7 @@ const FormField = ({ ...props }) => {
|
|
14
14
|
const useFormField = () => {
|
15
15
|
const fieldContext = React.useContext(FormFieldContext);
|
16
16
|
const itemContext = React.useContext(FormItemContext);
|
17
|
-
const { getFieldState } = useFormContext();
|
18
|
-
const formState = useFormState({ name: fieldContext.name });
|
17
|
+
const { getFieldState, formState } = useFormContext();
|
19
18
|
const fieldState = getFieldState(fieldContext.name, formState);
|
20
19
|
if (!fieldContext) {
|
21
20
|
throw new Error("useFormField should be used within <FormField>");
|
@@ -31,34 +30,39 @@ const useFormField = () => {
|
|
31
30
|
};
|
32
31
|
};
|
33
32
|
const FormItemContext = React.createContext({});
|
34
|
-
|
33
|
+
const FormItem = React.forwardRef(({ className, ...props }, ref) => {
|
35
34
|
const id = React.useId();
|
36
35
|
return (<FormItemContext.Provider value={{ id }}>
|
37
|
-
<div
|
36
|
+
<div ref={ref} className={cn("space-y-2", className)} {...props}/>
|
38
37
|
</FormItemContext.Provider>);
|
39
|
-
}
|
40
|
-
|
38
|
+
});
|
39
|
+
FormItem.displayName = "FormItem";
|
40
|
+
const FormLabel = React.forwardRef(({ className, ...props }, ref) => {
|
41
41
|
const { error, formItemId } = useFormField();
|
42
|
-
return (<Label
|
43
|
-
}
|
44
|
-
|
42
|
+
return (<Label ref={ref} className={cn(error && "text-destructive", className)} htmlFor={formItemId} {...props}/>);
|
43
|
+
});
|
44
|
+
FormLabel.displayName = "FormLabel";
|
45
|
+
const FormControl = React.forwardRef(({ ...props }, ref) => {
|
45
46
|
const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
|
46
|
-
return (<Slot
|
47
|
+
return (<Slot ref={ref} id={formItemId} aria-describedby={!error
|
47
48
|
? `${formDescriptionId}`
|
48
49
|
: `${formDescriptionId} ${formMessageId}`} aria-invalid={!!error} {...props}/>);
|
49
|
-
}
|
50
|
-
|
50
|
+
});
|
51
|
+
FormControl.displayName = "FormControl";
|
52
|
+
const FormDescription = React.forwardRef(({ className, ...props }, ref) => {
|
51
53
|
const { formDescriptionId } = useFormField();
|
52
|
-
return (<p
|
53
|
-
}
|
54
|
-
|
54
|
+
return (<p ref={ref} id={formDescriptionId} className={cn("text-sm text-muted-foreground", className)} {...props}/>);
|
55
|
+
});
|
56
|
+
FormDescription.displayName = "FormDescription";
|
57
|
+
const FormMessage = React.forwardRef(({ className, children, ...props }, ref) => {
|
55
58
|
const { error, formMessageId } = useFormField();
|
56
|
-
const body = error ? String(error?.message ?? "") :
|
59
|
+
const body = error ? String(error?.message ?? "") : children;
|
57
60
|
if (!body) {
|
58
61
|
return null;
|
59
62
|
}
|
60
|
-
return (<p
|
63
|
+
return (<p ref={ref} id={formMessageId} className={cn("text-sm font-medium text-destructive", className)} {...props}>
|
61
64
|
{body}
|
62
65
|
</p>);
|
63
|
-
}
|
66
|
+
});
|
67
|
+
FormMessage.displayName = "FormMessage";
|
64
68
|
export { useFormField, Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField, };
|
package/ui/hover-card.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as React from "react";
|
2
2
|
import * as HoverCardPrimitive from "@radix-ui/react-hover-card";
|
3
|
-
declare
|
4
|
-
declare
|
5
|
-
declare
|
3
|
+
declare const HoverCard: React.FC<HoverCardPrimitive.HoverCardProps>;
|
4
|
+
declare const HoverCardTrigger: React.ForwardRefExoticComponent<HoverCardPrimitive.HoverCardTriggerProps & React.RefAttributes<HTMLAnchorElement>>;
|
5
|
+
declare const HoverCardContent: React.ForwardRefExoticComponent<Omit<HoverCardPrimitive.HoverCardContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
6
6
|
export { HoverCard, HoverCardTrigger, HoverCardContent };
|
package/ui/hover-card.jsx
CHANGED
@@ -2,15 +2,8 @@
|
|
2
2
|
import * as React from "react";
|
3
3
|
import * as HoverCardPrimitive from "@radix-ui/react-hover-card";
|
4
4
|
import { cn } from "../lib/utils";
|
5
|
-
|
6
|
-
|
7
|
-
}
|
8
|
-
|
9
|
-
return (<HoverCardPrimitive.Trigger data-slot="hover-card-trigger" {...props}/>);
|
10
|
-
}
|
11
|
-
function HoverCardContent({ className, align = "center", sideOffset = 4, ...props }) {
|
12
|
-
return (<HoverCardPrimitive.Portal data-slot="hover-card-portal">
|
13
|
-
<HoverCardPrimitive.Content data-slot="hover-card-content" align={align} sideOffset={sideOffset} className={cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden", className)} {...props}/>
|
14
|
-
</HoverCardPrimitive.Portal>);
|
15
|
-
}
|
5
|
+
const HoverCard = HoverCardPrimitive.Root;
|
6
|
+
const HoverCardTrigger = HoverCardPrimitive.Trigger;
|
7
|
+
const HoverCardContent = React.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => (<HoverCardPrimitive.Content ref={ref} align={align} sideOffset={sideOffset} className={cn("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-hover-card-content-transform-origin]", className)} {...props}/>));
|
8
|
+
HoverCardContent.displayName = HoverCardPrimitive.Content.displayName;
|
16
9
|
export { HoverCard, HoverCardTrigger, HoverCardContent };
|
package/ui/input-otp.d.ts
CHANGED
@@ -1,11 +1,34 @@
|
|
1
1
|
import * as React from "react";
|
2
|
-
|
3
|
-
|
2
|
+
declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "textAlign" | "value" | "onChange" | "maxLength" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
|
3
|
+
value?: string;
|
4
|
+
onChange?: (newValue: string) => unknown;
|
5
|
+
maxLength: number;
|
6
|
+
textAlign?: "left" | "center" | "right";
|
7
|
+
onComplete?: (...args: any[]) => unknown;
|
8
|
+
pushPasswordManagerStrategy?: "increase-width" | "none";
|
9
|
+
pasteTransformer?: (pasted: string) => string;
|
4
10
|
containerClassName?: string;
|
5
|
-
|
6
|
-
|
7
|
-
|
11
|
+
noScriptCSSFallback?: string | null;
|
12
|
+
} & {
|
13
|
+
render: (props: import("input-otp").RenderProps) => React.ReactNode;
|
14
|
+
children?: never;
|
15
|
+
} & React.RefAttributes<HTMLInputElement>, "ref"> | Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "textAlign" | "value" | "onChange" | "maxLength" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
|
16
|
+
value?: string;
|
17
|
+
onChange?: (newValue: string) => unknown;
|
18
|
+
maxLength: number;
|
19
|
+
textAlign?: "left" | "center" | "right";
|
20
|
+
onComplete?: (...args: any[]) => unknown;
|
21
|
+
pushPasswordManagerStrategy?: "increase-width" | "none";
|
22
|
+
pasteTransformer?: (pasted: string) => string;
|
23
|
+
containerClassName?: string;
|
24
|
+
noScriptCSSFallback?: string | null;
|
25
|
+
} & {
|
26
|
+
render?: never;
|
27
|
+
children: React.ReactNode;
|
28
|
+
} & React.RefAttributes<HTMLInputElement>, "ref">) & React.RefAttributes<HTMLInputElement>>;
|
29
|
+
declare const InputOTPGroup: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
30
|
+
declare const InputOTPSlot: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
8
31
|
index: number;
|
9
|
-
}
|
10
|
-
declare
|
32
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
33
|
+
declare const InputOTPSeparator: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
11
34
|
export { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator };
|
package/ui/input-otp.jsx
CHANGED
@@ -1,27 +1,25 @@
|
|
1
1
|
"use client";
|
2
2
|
import * as React from "react";
|
3
3
|
import { OTPInput, OTPInputContext } from "input-otp";
|
4
|
-
import {
|
4
|
+
import { Dot } from "lucide-react";
|
5
5
|
import { cn } from "../lib/utils";
|
6
|
-
|
7
|
-
|
8
|
-
}
|
9
|
-
|
10
|
-
|
11
|
-
}
|
12
|
-
function InputOTPSlot({ index, className, ...props }) {
|
6
|
+
const InputOTP = React.forwardRef(({ className, containerClassName, ...props }, ref) => (<OTPInput ref={ref} containerClassName={cn("flex items-center gap-2 has-[:disabled]:opacity-50", containerClassName)} className={cn("disabled:cursor-not-allowed", className)} {...props}/>));
|
7
|
+
InputOTP.displayName = "InputOTP";
|
8
|
+
const InputOTPGroup = React.forwardRef(({ className, ...props }, ref) => (<div ref={ref} className={cn("flex items-center", className)} {...props}/>));
|
9
|
+
InputOTPGroup.displayName = "InputOTPGroup";
|
10
|
+
const InputOTPSlot = React.forwardRef(({ index, className, ...props }, ref) => {
|
13
11
|
const inputOTPContext = React.useContext(OTPInputContext);
|
14
|
-
const { char, hasFakeCaret, isActive } = inputOTPContext
|
15
|
-
return (<div
|
12
|
+
const { char, hasFakeCaret, isActive } = inputOTPContext.slots[index];
|
13
|
+
return (<div ref={ref} className={cn("relative flex h-10 w-10 items-center justify-center border-y border-r border-input text-sm transition-all first:rounded-l-md first:border-l last:rounded-r-md", isActive && "z-10 ring-2 ring-ring ring-offset-background", className)} {...props}>
|
16
14
|
{char}
|
17
15
|
{hasFakeCaret && (<div className="pointer-events-none absolute inset-0 flex items-center justify-center">
|
18
|
-
<div className="animate-caret-blink bg-foreground
|
16
|
+
<div className="h-4 w-px animate-caret-blink bg-foreground duration-1000"/>
|
19
17
|
</div>)}
|
20
18
|
</div>);
|
21
|
-
}
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
19
|
+
});
|
20
|
+
InputOTPSlot.displayName = "InputOTPSlot";
|
21
|
+
const InputOTPSeparator = React.forwardRef(({ ...props }, ref) => (<div ref={ref} role="separator" {...props}>
|
22
|
+
<Dot />
|
23
|
+
</div>));
|
24
|
+
InputOTPSeparator.displayName = "InputOTPSeparator";
|
27
25
|
export { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator };
|
package/ui/input.d.ts
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
import * as React from "react";
|
2
|
-
declare
|
2
|
+
declare const Input: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
3
3
|
export { Input };
|
package/ui/input.jsx
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
import * as React from "react";
|
2
2
|
import { cn } from "../lib/utils";
|
3
|
-
|
4
|
-
return (<input type={type}
|
5
|
-
}
|
3
|
+
const Input = React.forwardRef(({ className, type, ...props }, ref) => {
|
4
|
+
return (<input type={type} className={cn("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", className)} ref={ref} {...props}/>);
|
5
|
+
});
|
6
|
+
Input.displayName = "Input";
|
6
7
|
export { Input };
|
package/ui/label.d.ts
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
import * as React from "react";
|
2
2
|
import * as LabelPrimitive from "@radix-ui/react-label";
|
3
|
-
|
3
|
+
import { type VariantProps } from "class-variance-authority";
|
4
|
+
declare const Label: React.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & VariantProps<(props?: import("class-variance-authority/dist/types").ClassProp) => string> & React.RefAttributes<HTMLLabelElement>>;
|
4
5
|
export { Label };
|
package/ui/label.jsx
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
"use client";
|
2
2
|
import * as React from "react";
|
3
3
|
import * as LabelPrimitive from "@radix-ui/react-label";
|
4
|
+
import { cva } from "class-variance-authority";
|
4
5
|
import { cn } from "../lib/utils";
|
5
|
-
|
6
|
-
|
7
|
-
|
6
|
+
const labelVariants = cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70");
|
7
|
+
const Label = React.forwardRef(({ className, ...props }, ref) => (<LabelPrimitive.Root ref={ref} className={cn(labelVariants(), className)} {...props}/>));
|
8
|
+
Label.displayName = LabelPrimitive.Root.displayName;
|
8
9
|
export { Label };
|
package/ui/menubar.d.ts
CHANGED
@@ -1,26 +1,28 @@
|
|
1
1
|
import * as React from "react";
|
2
2
|
import * as MenubarPrimitive from "@radix-ui/react-menubar";
|
3
|
-
declare function Menubar({ className, ...props }: React.ComponentProps<typeof MenubarPrimitive.Root>): React.JSX.Element;
|
4
3
|
declare function MenubarMenu({ ...props }: React.ComponentProps<typeof MenubarPrimitive.Menu>): React.JSX.Element;
|
5
4
|
declare function MenubarGroup({ ...props }: React.ComponentProps<typeof MenubarPrimitive.Group>): React.JSX.Element;
|
6
5
|
declare function MenubarPortal({ ...props }: React.ComponentProps<typeof MenubarPrimitive.Portal>): React.JSX.Element;
|
7
6
|
declare function MenubarRadioGroup({ ...props }: React.ComponentProps<typeof MenubarPrimitive.RadioGroup>): React.JSX.Element;
|
8
|
-
declare function
|
9
|
-
declare
|
10
|
-
declare
|
7
|
+
declare function MenubarSub({ ...props }: React.ComponentProps<typeof MenubarPrimitive.Sub>): React.JSX.Element;
|
8
|
+
declare const Menubar: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
9
|
+
declare const MenubarTrigger: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
10
|
+
declare const MenubarSubTrigger: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarSubTriggerProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
11
11
|
inset?: boolean;
|
12
|
-
|
13
|
-
|
14
|
-
declare
|
15
|
-
declare
|
16
|
-
declare function MenubarLabel({ className, inset, ...props }: React.ComponentProps<typeof MenubarPrimitive.Label> & {
|
12
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
13
|
+
declare const MenubarSubContent: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarSubContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
14
|
+
declare const MenubarContent: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
15
|
+
declare const MenubarItem: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
17
16
|
inset?: boolean;
|
18
|
-
}
|
19
|
-
declare
|
20
|
-
declare
|
21
|
-
declare
|
22
|
-
declare function MenubarSubTrigger({ className, inset, children, ...props }: React.ComponentProps<typeof MenubarPrimitive.SubTrigger> & {
|
17
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
18
|
+
declare const MenubarCheckboxItem: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarCheckboxItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
19
|
+
declare const MenubarRadioItem: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarRadioItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
20
|
+
declare const MenubarLabel: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
23
21
|
inset?: boolean;
|
24
|
-
}
|
25
|
-
declare
|
26
|
-
|
22
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
23
|
+
declare const MenubarSeparator: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
24
|
+
declare const MenubarShortcut: {
|
25
|
+
({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): React.JSX.Element;
|
26
|
+
displayname: string;
|
27
|
+
};
|
28
|
+
export { Menubar, MenubarMenu, MenubarTrigger, MenubarContent, MenubarItem, MenubarSeparator, MenubarLabel, MenubarCheckboxItem, MenubarRadioGroup, MenubarRadioItem, MenubarPortal, MenubarSubContent, MenubarSubTrigger, MenubarGroup, MenubarSub, MenubarShortcut, };
|