@appcorp/shadcn 1.1.99 → 2.0.0
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/components/app-sidebar.js +16 -23
- package/components/audio.js +11 -19
- package/components/dashboard.js +27 -65
- package/components/drawer-generic.js +20 -28
- package/components/enhanced-checkbox.js +10 -57
- package/components/enhanced-combobox.js +99 -143
- package/components/enhanced-drawer-footer.js +22 -31
- package/components/enhanced-drawer-header.js +6 -14
- package/components/enhanced-dropzone-impl.d.ts +32 -0
- package/components/enhanced-dropzone-impl.js +218 -0
- package/components/enhanced-dropzone.d.ts +2 -63
- package/components/enhanced-dropzone.js +6 -294
- package/components/enhanced-input.js +10 -57
- package/components/enhanced-label.js +6 -52
- package/components/enhanced-radio.js +12 -20
- package/components/enhanced-select.js +13 -61
- package/components/enhanced-slider.js +11 -58
- package/components/enhanced-switch.js +11 -58
- package/components/enhanced-table-footer-action.js +11 -19
- package/components/enhanced-table-footer-page.js +16 -24
- package/components/enhanced-table-footer-pagination.js +11 -21
- package/components/enhanced-table-header-action.js +22 -30
- package/components/enhanced-table-header-search.js +9 -17
- package/components/enhanced-table.js +125 -153
- package/components/enhanced-textarea.js +10 -57
- package/components/field.d.ts +1 -1
- package/components/field.js +31 -88
- package/components/image-resize-dialog.js +61 -159
- package/components/nav-main.js +32 -78
- package/components/nav-projects.js +37 -48
- package/components/nav-user.js +41 -51
- package/components/show-toast.d.ts +2 -0
- package/components/show-toast.js +7 -0
- package/components/sidebar.d.ts +1 -1
- package/components/sidebar.js +115 -184
- package/components/team-switcher.js +36 -47
- package/components/theme-provider.js +36 -84
- package/components/timeline.d.ts +12 -0
- package/components/timeline.js +13 -0
- package/components/tooltip.js +10 -59
- package/components/ui/accordion.js +17 -67
- package/components/ui/alert-dialog.js +32 -89
- package/components/ui/alert.d.ts +1 -1
- package/components/ui/alert.js +14 -63
- package/components/ui/area-chart-v1-impl.d.ts +19 -0
- package/components/ui/area-chart-v1-impl.js +75 -0
- package/components/ui/area-chart-v1.d.ts +2 -19
- package/components/ui/area-chart-v1.js +4 -113
- package/components/ui/aspect-ratio.js +3 -39
- package/components/ui/avatar.js +13 -62
- package/components/ui/badge.d.ts +2 -2
- package/components/ui/badge.js +7 -55
- package/components/ui/breadcrumb.js +27 -80
- package/components/ui/button.d.ts +2 -2
- package/components/ui/button.js +10 -58
- package/components/ui/calendar-impl.d.ts +8 -0
- package/components/ui/calendar-impl.js +55 -0
- package/components/ui/calendar.d.ts +2 -8
- package/components/ui/calendar.js +5 -108
- package/components/ui/card.js +21 -73
- package/components/ui/carousel-impl.d.ts +18 -0
- package/components/ui/carousel-impl.js +117 -0
- package/components/ui/carousel.d.ts +6 -18
- package/components/ui/carousel.js +8 -170
- package/components/ui/chart-impl.d.ts +62 -0
- package/components/ui/chart-impl.js +162 -0
- package/components/ui/chart.d.ts +7 -62
- package/components/ui/chart.js +9 -219
- package/components/ui/checkbox.js +10 -57
- package/components/ui/collapsible.js +5 -43
- package/components/ui/combobox.js +22 -58
- package/components/ui/command-impl.d.ts +80 -0
- package/components/ui/command-impl.js +63 -0
- package/components/ui/command.d.ts +9 -80
- package/components/ui/command.js +12 -117
- package/components/ui/context-menu.js +41 -102
- package/components/ui/dialog.js +28 -84
- package/components/ui/drawer-impl.d.ts +22 -0
- package/components/ui/drawer-impl.js +56 -0
- package/components/ui/drawer.d.ts +10 -22
- package/components/ui/drawer.js +13 -111
- package/components/ui/dropdown-menu.js +41 -102
- package/components/ui/form.d.ts +4 -2
- package/components/ui/form.js +41 -95
- package/components/ui/hover-card.js +9 -58
- package/components/ui/input-otp-impl.d.ts +34 -0
- package/components/ui/input-otp-impl.js +43 -0
- package/components/ui/input-otp.d.ts +4 -34
- package/components/ui/input-otp.js +7 -92
- package/components/ui/input.js +6 -53
- package/components/ui/label.d.ts +1 -1
- package/components/ui/label.js +9 -56
- package/components/ui/language-selector.js +17 -55
- package/components/ui/menubar.js +46 -108
- package/components/ui/navigation-menu.d.ts +1 -1
- package/components/ui/navigation-menu.js +29 -84
- package/components/ui/pagination.js +30 -83
- package/components/ui/popover.js +10 -60
- package/components/ui/progress.js +8 -55
- package/components/ui/radio-group.js +12 -60
- package/components/ui/resizable-impl.d.ts +24 -0
- package/components/ui/resizable-impl.js +27 -0
- package/components/ui/resizable.d.ts +3 -24
- package/components/ui/resizable.js +6 -78
- package/components/ui/scroll-area.js +10 -58
- package/components/ui/select.js +34 -90
- package/components/ui/separator.js +7 -54
- package/components/ui/sheet.d.ts +1 -1
- package/components/ui/sheet.js +30 -86
- package/components/ui/skeleton.js +5 -21
- package/components/ui/slider.js +10 -57
- package/components/ui/sonner.js +7 -24
- package/components/ui/switch.js +8 -55
- package/components/ui/table.js +27 -81
- package/components/ui/tabs.js +14 -64
- package/components/ui/textarea.js +6 -53
- package/components/ui/theme-switcher.js +41 -91
- package/components/ui/toggle.d.ts +2 -2
- package/components/ui/toggle.js +9 -57
- package/data/admin-dashboard.js +16 -19
- package/hooks/use-enhanced-combobox.js +47 -124
- package/hooks/use-mobile.js +8 -44
- package/hooks/use-outside-click.js +6 -10
- package/lib/themes.js +1 -4
- package/lib/toast-utils.js +78 -120
- package/lib/utils.js +4 -11
- package/package.json +9 -90
- package/utils/transform-breadcrumbs.js +4 -8
- package/utils/transform-navitems.js +7 -22
- package/components/aceternity-ui/apple-cards-carousel.d.ts +0 -35
- package/components/aceternity-ui/apple-cards-carousel.js +0 -263
- package/components/shadcn-example/ai-chat/chat-interface.d.ts +0 -11
- package/components/shadcn-example/ai-chat/chat-interface.js +0 -70
- package/components/shadcn-example/ai-chat/index.d.ts +0 -38
- package/components/shadcn-example/ai-chat/index.js +0 -66
- package/components/shadcn-example/ai-chat/sidebar.d.ts +0 -15
- package/components/shadcn-example/ai-chat/sidebar.js +0 -68
- package/components/shadcn-example/ai-chat/welcome-section.d.ts +0 -12
- package/components/shadcn-example/ai-chat/welcome-section.js +0 -26
- package/components/shadcn-example/authentication/index.d.ts +0 -24
- package/components/shadcn-example/authentication/index.js +0 -59
- package/components/shadcn-example/authentication/user-auth-form.d.ts +0 -11
- package/components/shadcn-example/authentication/user-auth-form.js +0 -54
- package/components/shadcn-example/blog-detail-page/comment-section.d.ts +0 -15
- package/components/shadcn-example/blog-detail-page/comment-section.js +0 -83
- package/components/shadcn-example/blog-detail-page/content.d.ts +0 -7
- package/components/shadcn-example/blog-detail-page/content.js +0 -15
- package/components/shadcn-example/blog-detail-page/header.d.ts +0 -11
- package/components/shadcn-example/blog-detail-page/header.js +0 -36
- package/components/shadcn-example/blog-detail-page/index.d.ts +0 -25
- package/components/shadcn-example/blog-detail-page/index.js +0 -74
- package/components/shadcn-example/blog-page/blog-post-card.d.ts +0 -13
- package/components/shadcn-example/blog-page/blog-post-card.js +0 -30
- package/components/shadcn-example/blog-page/featured-post-sidebar-item.d.ts +0 -10
- package/components/shadcn-example/blog-page/featured-post-sidebar-item.js +0 -19
- package/components/shadcn-example/blog-page/index.d.ts +0 -20
- package/components/shadcn-example/blog-page/index.js +0 -36
- package/components/shadcn-example/coming-soon/countdown.d.ts +0 -2
- package/components/shadcn-example/coming-soon/countdown.js +0 -82
- package/components/shadcn-example/coming-soon/index.d.ts +0 -10
- package/components/shadcn-example/coming-soon/index.js +0 -41
- package/components/shadcn-io/color-picker/index.d.ts +0 -43
- package/components/shadcn-io/color-picker/index.js +0 -304
- package/components/shadcn-io/copy-button/index.d.ts +0 -16
- package/components/shadcn-io/copy-button/index.js +0 -121
- package/components/shadcn-io/dropzone/index.d.ts +0 -19
- package/components/shadcn-io/dropzone/index.js +0 -131
- package/components/shadcn-io/gantt/index.d.ts +0 -145
- package/components/shadcn-io/gantt/index.js +0 -766
- package/components/shadcn-io/table/index.d.ts +0 -60
- package/components/shadcn-io/table/index.js +0 -138
- package/templates/appcorp-v1/footer/bottom-bar.d.ts +0 -6
- package/templates/appcorp-v1/footer/bottom-bar.js +0 -25
- package/templates/appcorp-v1/footer/cta.d.ts +0 -6
- package/templates/appcorp-v1/footer/cta.js +0 -21
- package/templates/appcorp-v1/footer/footer-grid.d.ts +0 -14
- package/templates/appcorp-v1/footer/footer-grid.js +0 -52
- package/templates/appcorp-v1/footer/index.d.ts +0 -3
- package/templates/appcorp-v1/footer/index.js +0 -28
- package/templates/appcorp-v1/footer/newsletter.d.ts +0 -11
- package/templates/appcorp-v1/footer/newsletter.js +0 -28
- package/templates/appcorp-v1/footer/stats.d.ts +0 -6
- package/templates/appcorp-v1/footer/stats.js +0 -15
- package/templates/appcorp-v1/header/announcement-bar.d.ts +0 -3
- package/templates/appcorp-v1/header/announcement-bar.js +0 -15
- package/templates/appcorp-v1/header/dropdown-panel.d.ts +0 -8
- package/templates/appcorp-v1/header/dropdown-panel.js +0 -72
- package/templates/appcorp-v1/header/index.d.ts +0 -12
- package/templates/appcorp-v1/header/index.js +0 -16
- package/templates/appcorp-v1/header/mobile-menu.d.ts +0 -14
- package/templates/appcorp-v1/header/mobile-menu.js +0 -101
- package/templates/appcorp-v1/header/navigation-bar.d.ts +0 -3
- package/templates/appcorp-v1/header/navigation-bar.js +0 -117
- package/templates/appcorp-v1/header/social-button.d.ts +0 -7
- package/templates/appcorp-v1/header/social-button.js +0 -48
- package/templates/appcorp-v1/home.d.ts +0 -3
- package/templates/appcorp-v1/home.js +0 -27
- package/templates/data/appcorp-v1.d.ts +0 -93
- package/templates/data/appcorp-v1.js +0 -348
- package/templates/data/edupilotpro-v1.d.ts +0 -33
- package/templates/data/edupilotpro-v1.js +0 -116
- package/templates/data/school-v1.d.ts +0 -328
- package/templates/data/school-v1.js +0 -1563
- package/templates/edupilotpro-v1/feature-card.d.ts +0 -13
- package/templates/edupilotpro-v1/feature-card.js +0 -28
- package/templates/edupilotpro-v1/mockups/dashboard-mockup.d.ts +0 -3
- package/templates/edupilotpro-v1/mockups/dashboard-mockup.js +0 -55
- package/templates/school-v1/footer.d.ts +0 -3
- package/templates/school-v1/footer.js +0 -75
- package/templates/school-v1/index.d.ts +0 -18
- package/templates/school-v1/index.js +0 -60
- package/templates/school-v1/navigation.d.ts +0 -3
- package/templates/school-v1/navigation.js +0 -123
- package/templates/school-v1/sections/about.d.ts +0 -3
- package/templates/school-v1/sections/about.js +0 -49
- package/templates/school-v1/sections/admissions.d.ts +0 -3
- package/templates/school-v1/sections/admissions.js +0 -77
- package/templates/school-v1/sections/contact.d.ts +0 -3
- package/templates/school-v1/sections/contact.js +0 -67
- package/templates/school-v1/sections/faqs.d.ts +0 -3
- package/templates/school-v1/sections/faqs.js +0 -50
- package/templates/school-v1/sections/hero.d.ts +0 -3
- package/templates/school-v1/sections/hero.js +0 -132
- package/templates/school-v1/sections/management.d.ts +0 -3
- package/templates/school-v1/sections/management.js +0 -34
- package/templates/school-v1/sections/policies.d.ts +0 -3
- package/templates/school-v1/sections/policies.js +0 -127
- package/templates/school-v1/sections/programs.d.ts +0 -3
- package/templates/school-v1/sections/programs.js +0 -107
- package/templates/school-v1/sections/testimonials.d.ts +0 -3
- package/templates/school-v1/sections/testimonials.js +0 -46
- package/templates/school-v1/sections/why-choose-us.d.ts +0 -3
- package/templates/school-v1/sections/why-choose-us.js +0 -57
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
import * as React from "react";
|
|
14
|
+
import { Drawer as DrawerPrimitive } from "vaul";
|
|
15
|
+
import { cn } from "../../lib/utils";
|
|
16
|
+
const Drawer = (_a) => {
|
|
17
|
+
var { shouldScaleBackground = true } = _a, props = __rest(_a, ["shouldScaleBackground"]);
|
|
18
|
+
return (React.createElement(DrawerPrimitive.Root, Object.assign({ shouldScaleBackground: shouldScaleBackground }, props)));
|
|
19
|
+
};
|
|
20
|
+
Drawer.displayName = "Drawer";
|
|
21
|
+
const DrawerTrigger = DrawerPrimitive.Trigger;
|
|
22
|
+
const DrawerPortal = DrawerPrimitive.Portal;
|
|
23
|
+
const DrawerClose = DrawerPrimitive.Close;
|
|
24
|
+
const DrawerOverlay = React.forwardRef((_a, ref) => {
|
|
25
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
26
|
+
return (React.createElement(DrawerPrimitive.Overlay, Object.assign({ ref: ref, className: cn("fixed inset-0 z-50 bg-black/80", className) }, props)));
|
|
27
|
+
});
|
|
28
|
+
DrawerOverlay.displayName = DrawerPrimitive.Overlay.displayName;
|
|
29
|
+
const DrawerContent = React.forwardRef((_a, ref) => {
|
|
30
|
+
var { className, children } = _a, props = __rest(_a, ["className", "children"]);
|
|
31
|
+
return (React.createElement(DrawerPortal, null,
|
|
32
|
+
React.createElement(DrawerOverlay, null),
|
|
33
|
+
React.createElement(DrawerPrimitive.Content, Object.assign({ ref: ref, className: cn("fixed z-50 flex flex-col border bg-background", "data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:rounded-t-[10px]", "data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:rounded-b-[10px]", "data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:h-full data-[vaul-drawer-direction=left]:rounded-r-[10px]", "data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:h-full data-[vaul-drawer-direction=right]:rounded-l-[10px]", className) }, props), children)));
|
|
34
|
+
});
|
|
35
|
+
DrawerContent.displayName = "DrawerContent";
|
|
36
|
+
const DrawerHeader = (_a) => {
|
|
37
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
38
|
+
return (React.createElement("div", Object.assign({ className: cn("grid gap-1.5 p-4 text-center sm:text-left", className) }, props)));
|
|
39
|
+
};
|
|
40
|
+
DrawerHeader.displayName = "DrawerHeader";
|
|
41
|
+
const DrawerFooter = (_a) => {
|
|
42
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
43
|
+
return (React.createElement("div", Object.assign({ className: cn("mt-auto flex flex-col gap-2 p-4", className) }, props)));
|
|
44
|
+
};
|
|
45
|
+
DrawerFooter.displayName = "DrawerFooter";
|
|
46
|
+
const DrawerTitle = React.forwardRef((_a, ref) => {
|
|
47
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
48
|
+
return (React.createElement(DrawerPrimitive.Title, Object.assign({ ref: ref, className: cn("text-lg font-semibold leading-none tracking-tight", className) }, props)));
|
|
49
|
+
});
|
|
50
|
+
DrawerTitle.displayName = DrawerPrimitive.Title.displayName;
|
|
51
|
+
const DrawerDescription = React.forwardRef((_a, ref) => {
|
|
52
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
53
|
+
return (React.createElement(DrawerPrimitive.Description, Object.assign({ ref: ref, className: cn("text-sm text-muted-foreground", className) }, props)));
|
|
54
|
+
});
|
|
55
|
+
DrawerDescription.displayName = DrawerPrimitive.Description.displayName;
|
|
56
|
+
export { Drawer, DrawerPortal, DrawerOverlay, DrawerTrigger, DrawerClose, DrawerContent, DrawerHeader, DrawerFooter, DrawerTitle, DrawerDescription, };
|
|
@@ -1,22 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
declare const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
declare const
|
|
8
|
-
declare const
|
|
9
|
-
declare const
|
|
10
|
-
declare const
|
|
11
|
-
declare const DrawerContent: React.ForwardRefExoticComponent<Omit<Omit<import("@radix-ui/react-dialog").DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
-
declare const DrawerHeader: {
|
|
13
|
-
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
|
|
14
|
-
displayName: string;
|
|
15
|
-
};
|
|
16
|
-
declare const DrawerFooter: {
|
|
17
|
-
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
|
|
18
|
-
displayName: string;
|
|
19
|
-
};
|
|
20
|
-
declare const DrawerTitle: React.ForwardRefExoticComponent<Omit<import("@radix-ui/react-dialog").DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
21
|
-
declare const DrawerDescription: React.ForwardRefExoticComponent<Omit<import("@radix-ui/react-dialog").DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
22
|
-
export { Drawer, DrawerPortal, DrawerOverlay, DrawerTrigger, DrawerClose, DrawerContent, DrawerHeader, DrawerFooter, DrawerTitle, DrawerDescription, };
|
|
1
|
+
export declare const Drawer: typeof import("./drawer-impl")["Drawer"];
|
|
2
|
+
export declare const DrawerPortal: typeof import("./drawer-impl")["DrawerPortal"];
|
|
3
|
+
export declare const DrawerOverlay: typeof import("./drawer-impl")["DrawerOverlay"];
|
|
4
|
+
export declare const DrawerTrigger: typeof import("./drawer-impl")["DrawerTrigger"];
|
|
5
|
+
export declare const DrawerClose: typeof import("./drawer-impl")["DrawerClose"];
|
|
6
|
+
export declare const DrawerContent: typeof import("./drawer-impl")["DrawerContent"];
|
|
7
|
+
export declare const DrawerHeader: typeof import("./drawer-impl")["DrawerHeader"];
|
|
8
|
+
export declare const DrawerFooter: typeof import("./drawer-impl")["DrawerFooter"];
|
|
9
|
+
export declare const DrawerTitle: typeof import("./drawer-impl")["DrawerTitle"];
|
|
10
|
+
export declare const DrawerDescription: typeof import("./drawer-impl")["DrawerDescription"];
|
package/components/ui/drawer.js
CHANGED
|
@@ -1,112 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
if (k2 === undefined) k2 = k;
|
|
16
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
17
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
18
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
19
|
-
}
|
|
20
|
-
Object.defineProperty(o, k2, desc);
|
|
21
|
-
}) : (function(o, m, k, k2) {
|
|
22
|
-
if (k2 === undefined) k2 = k;
|
|
23
|
-
o[k2] = m[k];
|
|
24
|
-
}));
|
|
25
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
26
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
27
|
-
}) : function(o, v) {
|
|
28
|
-
o["default"] = v;
|
|
29
|
-
});
|
|
30
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
31
|
-
var ownKeys = function(o) {
|
|
32
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
33
|
-
var ar = [];
|
|
34
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
35
|
-
return ar;
|
|
36
|
-
};
|
|
37
|
-
return ownKeys(o);
|
|
38
|
-
};
|
|
39
|
-
return function (mod) {
|
|
40
|
-
if (mod && mod.__esModule) return mod;
|
|
41
|
-
var result = {};
|
|
42
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
43
|
-
__setModuleDefault(result, mod);
|
|
44
|
-
return result;
|
|
45
|
-
};
|
|
46
|
-
})();
|
|
47
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
48
|
-
var t = {};
|
|
49
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
50
|
-
t[p] = s[p];
|
|
51
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
52
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
53
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
54
|
-
t[p[i]] = s[p[i]];
|
|
55
|
-
}
|
|
56
|
-
return t;
|
|
57
|
-
};
|
|
58
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
59
|
-
exports.DrawerDescription = exports.DrawerTitle = exports.DrawerFooter = exports.DrawerHeader = exports.DrawerContent = exports.DrawerClose = exports.DrawerTrigger = exports.DrawerOverlay = exports.DrawerPortal = exports.Drawer = void 0;
|
|
60
|
-
var React = __importStar(require("react"));
|
|
61
|
-
var vaul_1 = require("vaul");
|
|
62
|
-
var utils_1 = require("../../lib/utils");
|
|
63
|
-
var Drawer = function (_a) {
|
|
64
|
-
var _b = _a.shouldScaleBackground, shouldScaleBackground = _b === void 0 ? true : _b, props = __rest(_a, ["shouldScaleBackground"]);
|
|
65
|
-
return (React.createElement(vaul_1.Drawer.Root, __assign({ shouldScaleBackground: shouldScaleBackground }, props)));
|
|
66
|
-
};
|
|
67
|
-
exports.Drawer = Drawer;
|
|
68
|
-
Drawer.displayName = "Drawer";
|
|
69
|
-
var DrawerTrigger = vaul_1.Drawer.Trigger;
|
|
70
|
-
exports.DrawerTrigger = DrawerTrigger;
|
|
71
|
-
var DrawerPortal = vaul_1.Drawer.Portal;
|
|
72
|
-
exports.DrawerPortal = DrawerPortal;
|
|
73
|
-
var DrawerClose = vaul_1.Drawer.Close;
|
|
74
|
-
exports.DrawerClose = DrawerClose;
|
|
75
|
-
var DrawerOverlay = React.forwardRef(function (_a, ref) {
|
|
76
|
-
var className = _a.className, props = __rest(_a, ["className"]);
|
|
77
|
-
return (React.createElement(vaul_1.Drawer.Overlay, __assign({ ref: ref, className: (0, utils_1.cn)("fixed inset-0 z-50 bg-black/80", className) }, props)));
|
|
78
|
-
});
|
|
79
|
-
exports.DrawerOverlay = DrawerOverlay;
|
|
80
|
-
DrawerOverlay.displayName = vaul_1.Drawer.Overlay.displayName;
|
|
81
|
-
var DrawerContent = React.forwardRef(function (_a, ref) {
|
|
82
|
-
var className = _a.className, children = _a.children, props = __rest(_a, ["className", "children"]);
|
|
83
|
-
return (React.createElement(DrawerPortal, null,
|
|
84
|
-
React.createElement(DrawerOverlay, null),
|
|
85
|
-
React.createElement(vaul_1.Drawer.Content, __assign({ ref: ref, className: (0, utils_1.cn)("fixed z-50 flex flex-col border bg-background", "data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:rounded-t-[10px]", "data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:rounded-b-[10px]", "data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:h-full data-[vaul-drawer-direction=left]:rounded-r-[10px]", "data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:h-full data-[vaul-drawer-direction=right]:rounded-l-[10px]", className) }, props), children)));
|
|
86
|
-
});
|
|
87
|
-
exports.DrawerContent = DrawerContent;
|
|
88
|
-
DrawerContent.displayName = "DrawerContent";
|
|
89
|
-
var DrawerHeader = function (_a) {
|
|
90
|
-
var className = _a.className, props = __rest(_a, ["className"]);
|
|
91
|
-
return (React.createElement("div", __assign({ className: (0, utils_1.cn)("grid gap-1.5 p-4 text-center sm:text-left", className) }, props)));
|
|
92
|
-
};
|
|
93
|
-
exports.DrawerHeader = DrawerHeader;
|
|
94
|
-
DrawerHeader.displayName = "DrawerHeader";
|
|
95
|
-
var DrawerFooter = function (_a) {
|
|
96
|
-
var className = _a.className, props = __rest(_a, ["className"]);
|
|
97
|
-
return (React.createElement("div", __assign({ className: (0, utils_1.cn)("mt-auto flex flex-col gap-2 p-4", className) }, props)));
|
|
98
|
-
};
|
|
99
|
-
exports.DrawerFooter = DrawerFooter;
|
|
100
|
-
DrawerFooter.displayName = "DrawerFooter";
|
|
101
|
-
var DrawerTitle = React.forwardRef(function (_a, ref) {
|
|
102
|
-
var className = _a.className, props = __rest(_a, ["className"]);
|
|
103
|
-
return (React.createElement(vaul_1.Drawer.Title, __assign({ ref: ref, className: (0, utils_1.cn)("text-lg font-semibold leading-none tracking-tight", className) }, props)));
|
|
104
|
-
});
|
|
105
|
-
exports.DrawerTitle = DrawerTitle;
|
|
106
|
-
DrawerTitle.displayName = vaul_1.Drawer.Title.displayName;
|
|
107
|
-
var DrawerDescription = React.forwardRef(function (_a, ref) {
|
|
108
|
-
var className = _a.className, props = __rest(_a, ["className"]);
|
|
109
|
-
return (React.createElement(vaul_1.Drawer.Description, __assign({ ref: ref, className: (0, utils_1.cn)("text-sm text-muted-foreground", className) }, props)));
|
|
110
|
-
});
|
|
111
|
-
exports.DrawerDescription = DrawerDescription;
|
|
112
|
-
DrawerDescription.displayName = vaul_1.Drawer.Description.displayName;
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
const module = import("./drawer-impl");
|
|
4
|
+
const lazy = (name) => React.lazy(() => module.then((m) => ({ default: m[name] })));
|
|
5
|
+
export const Drawer = lazy("Drawer");
|
|
6
|
+
export const DrawerPortal = lazy("DrawerPortal");
|
|
7
|
+
export const DrawerOverlay = lazy("DrawerOverlay");
|
|
8
|
+
export const DrawerTrigger = lazy("DrawerTrigger");
|
|
9
|
+
export const DrawerClose = lazy("DrawerClose");
|
|
10
|
+
export const DrawerContent = lazy("DrawerContent");
|
|
11
|
+
export const DrawerHeader = lazy("DrawerHeader");
|
|
12
|
+
export const DrawerFooter = lazy("DrawerFooter");
|
|
13
|
+
export const DrawerTitle = lazy("DrawerTitle");
|
|
14
|
+
export const DrawerDescription = lazy("DrawerDescription");
|
|
@@ -1,49 +1,4 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";
|
|
3
|
-
var __assign = (this && this.__assign) || function () {
|
|
4
|
-
__assign = Object.assign || function(t) {
|
|
5
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
6
|
-
s = arguments[i];
|
|
7
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
8
|
-
t[p] = s[p];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
return __assign.apply(this, arguments);
|
|
13
|
-
};
|
|
14
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
15
|
-
if (k2 === undefined) k2 = k;
|
|
16
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
17
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
18
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
19
|
-
}
|
|
20
|
-
Object.defineProperty(o, k2, desc);
|
|
21
|
-
}) : (function(o, m, k, k2) {
|
|
22
|
-
if (k2 === undefined) k2 = k;
|
|
23
|
-
o[k2] = m[k];
|
|
24
|
-
}));
|
|
25
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
26
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
27
|
-
}) : function(o, v) {
|
|
28
|
-
o["default"] = v;
|
|
29
|
-
});
|
|
30
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
31
|
-
var ownKeys = function(o) {
|
|
32
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
33
|
-
var ar = [];
|
|
34
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
35
|
-
return ar;
|
|
36
|
-
};
|
|
37
|
-
return ownKeys(o);
|
|
38
|
-
};
|
|
39
|
-
return function (mod) {
|
|
40
|
-
if (mod && mod.__esModule) return mod;
|
|
41
|
-
var result = {};
|
|
42
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
43
|
-
__setModuleDefault(result, mod);
|
|
44
|
-
return result;
|
|
45
|
-
};
|
|
46
|
-
})();
|
|
47
2
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
48
3
|
var t = {};
|
|
49
4
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -55,89 +10,73 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
55
10
|
}
|
|
56
11
|
return t;
|
|
57
12
|
};
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
exports.DropdownMenuPortal = DropdownMenuPortal;
|
|
72
|
-
var DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
73
|
-
exports.DropdownMenuSub = DropdownMenuSub;
|
|
74
|
-
var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
75
|
-
exports.DropdownMenuRadioGroup = DropdownMenuRadioGroup;
|
|
76
|
-
var DropdownMenuSubTrigger = React.forwardRef(function (_a, ref) {
|
|
77
|
-
var className = _a.className, inset = _a.inset, children = _a.children, props = __rest(_a, ["className", "inset", "children"]);
|
|
78
|
-
return (React.createElement(DropdownMenuPrimitive.SubTrigger, __assign({ ref: ref, className: (0, utils_1.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
|
+
import * as React from "react";
|
|
14
|
+
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
15
|
+
import { cn } from "../../lib/utils";
|
|
16
|
+
import { CheckIcon, ChevronRightIcon, DotFilledIcon, } from "@radix-ui/react-icons";
|
|
17
|
+
const DropdownMenu = DropdownMenuPrimitive.Root;
|
|
18
|
+
const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
|
19
|
+
const DropdownMenuGroup = DropdownMenuPrimitive.Group;
|
|
20
|
+
const DropdownMenuPortal = DropdownMenuPrimitive.Portal;
|
|
21
|
+
const DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
22
|
+
const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
23
|
+
const DropdownMenuSubTrigger = React.forwardRef((_a, ref) => {
|
|
24
|
+
var { className, inset, children } = _a, props = __rest(_a, ["className", "inset", "children"]);
|
|
25
|
+
return (React.createElement(DropdownMenuPrimitive.SubTrigger, Object.assign({ 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),
|
|
79
26
|
children,
|
|
80
|
-
React.createElement(
|
|
27
|
+
React.createElement(ChevronRightIcon, { className: "ml-auto" })));
|
|
81
28
|
});
|
|
82
|
-
exports.DropdownMenuSubTrigger = DropdownMenuSubTrigger;
|
|
83
29
|
DropdownMenuSubTrigger.displayName =
|
|
84
30
|
DropdownMenuPrimitive.SubTrigger.displayName;
|
|
85
|
-
|
|
86
|
-
var className = _a
|
|
87
|
-
return (React.createElement(DropdownMenuPrimitive.SubContent,
|
|
31
|
+
const DropdownMenuSubContent = React.forwardRef((_a, ref) => {
|
|
32
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
33
|
+
return (React.createElement(DropdownMenuPrimitive.SubContent, Object.assign({ 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)));
|
|
88
34
|
});
|
|
89
|
-
exports.DropdownMenuSubContent = DropdownMenuSubContent;
|
|
90
35
|
DropdownMenuSubContent.displayName =
|
|
91
36
|
DropdownMenuPrimitive.SubContent.displayName;
|
|
92
|
-
|
|
93
|
-
var
|
|
37
|
+
const DropdownMenuContent = React.forwardRef((_a, ref) => {
|
|
38
|
+
var { className, sideOffset = 4 } = _a, props = __rest(_a, ["className", "sideOffset"]);
|
|
94
39
|
return (React.createElement(DropdownMenuPrimitive.Portal, null,
|
|
95
|
-
React.createElement(DropdownMenuPrimitive.Content,
|
|
40
|
+
React.createElement(DropdownMenuPrimitive.Content, Object.assign({ 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))));
|
|
96
41
|
});
|
|
97
|
-
exports.DropdownMenuContent = DropdownMenuContent;
|
|
98
42
|
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
99
|
-
|
|
100
|
-
var
|
|
101
|
-
return (React.createElement(DropdownMenuPrimitive.Item,
|
|
43
|
+
const DropdownMenuItem = React.forwardRef((_a, ref) => {
|
|
44
|
+
var { className, inset } = _a, props = __rest(_a, ["className", "inset"]);
|
|
45
|
+
return (React.createElement(DropdownMenuPrimitive.Item, Object.assign({ 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]:size-4 [&>svg]:shrink-0", inset && "pl-8", className) }, props)));
|
|
102
46
|
});
|
|
103
|
-
exports.DropdownMenuItem = DropdownMenuItem;
|
|
104
47
|
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
105
|
-
|
|
106
|
-
var
|
|
107
|
-
return (React.createElement(DropdownMenuPrimitive.CheckboxItem,
|
|
48
|
+
const DropdownMenuCheckboxItem = React.forwardRef((_a, ref) => {
|
|
49
|
+
var { className, children, checked } = _a, props = __rest(_a, ["className", "children", "checked"]);
|
|
50
|
+
return (React.createElement(DropdownMenuPrimitive.CheckboxItem, Object.assign({ 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),
|
|
108
51
|
React.createElement("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center" },
|
|
109
52
|
React.createElement(DropdownMenuPrimitive.ItemIndicator, null,
|
|
110
|
-
React.createElement(
|
|
53
|
+
React.createElement(CheckIcon, { className: "h-4 w-4" }))),
|
|
111
54
|
children));
|
|
112
55
|
});
|
|
113
|
-
exports.DropdownMenuCheckboxItem = DropdownMenuCheckboxItem;
|
|
114
56
|
DropdownMenuCheckboxItem.displayName =
|
|
115
57
|
DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
116
|
-
|
|
117
|
-
var
|
|
118
|
-
return (React.createElement(DropdownMenuPrimitive.RadioItem,
|
|
58
|
+
const DropdownMenuRadioItem = React.forwardRef((_a, ref) => {
|
|
59
|
+
var { className, children } = _a, props = __rest(_a, ["className", "children"]);
|
|
60
|
+
return (React.createElement(DropdownMenuPrimitive.RadioItem, Object.assign({ 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),
|
|
119
61
|
React.createElement("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center" },
|
|
120
62
|
React.createElement(DropdownMenuPrimitive.ItemIndicator, null,
|
|
121
|
-
React.createElement(
|
|
63
|
+
React.createElement(DotFilledIcon, { className: "h-2 w-2 fill-current" }))),
|
|
122
64
|
children));
|
|
123
65
|
});
|
|
124
|
-
exports.DropdownMenuRadioItem = DropdownMenuRadioItem;
|
|
125
66
|
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
126
|
-
|
|
127
|
-
var
|
|
128
|
-
return (React.createElement(DropdownMenuPrimitive.Label,
|
|
67
|
+
const DropdownMenuLabel = React.forwardRef((_a, ref) => {
|
|
68
|
+
var { className, inset } = _a, props = __rest(_a, ["className", "inset"]);
|
|
69
|
+
return (React.createElement(DropdownMenuPrimitive.Label, Object.assign({ ref: ref, className: cn("px-2 py-1.5 text-sm font-semibold", inset && "pl-8", className) }, props)));
|
|
129
70
|
});
|
|
130
|
-
exports.DropdownMenuLabel = DropdownMenuLabel;
|
|
131
71
|
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
132
|
-
|
|
133
|
-
var className = _a
|
|
134
|
-
return (React.createElement(DropdownMenuPrimitive.Separator,
|
|
72
|
+
const DropdownMenuSeparator = React.forwardRef((_a, ref) => {
|
|
73
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
74
|
+
return (React.createElement(DropdownMenuPrimitive.Separator, Object.assign({ ref: ref, className: cn("-mx-1 my-1 h-px bg-muted", className) }, props)));
|
|
135
75
|
});
|
|
136
|
-
exports.DropdownMenuSeparator = DropdownMenuSeparator;
|
|
137
76
|
DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
|
|
138
|
-
|
|
139
|
-
var className = _a
|
|
140
|
-
return (React.createElement("span",
|
|
77
|
+
const DropdownMenuShortcut = (_a) => {
|
|
78
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
79
|
+
return (React.createElement("span", Object.assign({ className: cn("ml-auto text-xs tracking-widest opacity-60", className) }, props)));
|
|
141
80
|
};
|
|
142
|
-
exports.DropdownMenuShortcut = DropdownMenuShortcut;
|
|
143
81
|
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
82
|
+
export { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuGroup, DropdownMenuPortal, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuRadioGroup, };
|
package/components/ui/form.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
3
3
|
import { type ControllerProps, type FieldPath, type FieldValues } from "react-hook-form";
|
|
4
|
-
declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>(
|
|
4
|
+
declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>({ children, watch, getValues, getFieldState, setError, clearErrors, setValue, setValues, trigger, formState, resetField, reset, handleSubmit, unregister, control, register, setFocus, subscribe, }: import("react-hook-form").FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
|
|
5
5
|
declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: ControllerProps<TFieldValues, TName>) => React.JSX.Element;
|
|
6
6
|
declare const useFormField: () => {
|
|
7
7
|
invalid: boolean;
|
|
@@ -17,7 +17,9 @@ declare const useFormField: () => {
|
|
|
17
17
|
};
|
|
18
18
|
declare const FormItem: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
19
19
|
declare const FormLabel: React.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & React.RefAttributes<HTMLLabelElement>>;
|
|
20
|
-
declare const FormControl: React.ForwardRefExoticComponent<Omit<
|
|
20
|
+
declare const FormControl: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLElement> & {
|
|
21
|
+
children?: React.ReactNode;
|
|
22
|
+
} & React.RefAttributes<HTMLElement>, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
21
23
|
declare const FormDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
22
24
|
declare const FormMessage: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
23
25
|
export { useFormField, Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField, };
|
package/components/ui/form.js
CHANGED
|
@@ -1,49 +1,4 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";
|
|
3
|
-
var __assign = (this && this.__assign) || function () {
|
|
4
|
-
__assign = Object.assign || function(t) {
|
|
5
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
6
|
-
s = arguments[i];
|
|
7
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
8
|
-
t[p] = s[p];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
return __assign.apply(this, arguments);
|
|
13
|
-
};
|
|
14
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
15
|
-
if (k2 === undefined) k2 = k;
|
|
16
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
17
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
18
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
19
|
-
}
|
|
20
|
-
Object.defineProperty(o, k2, desc);
|
|
21
|
-
}) : (function(o, m, k, k2) {
|
|
22
|
-
if (k2 === undefined) k2 = k;
|
|
23
|
-
o[k2] = m[k];
|
|
24
|
-
}));
|
|
25
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
26
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
27
|
-
}) : function(o, v) {
|
|
28
|
-
o["default"] = v;
|
|
29
|
-
});
|
|
30
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
31
|
-
var ownKeys = function(o) {
|
|
32
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
33
|
-
var ar = [];
|
|
34
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
35
|
-
return ar;
|
|
36
|
-
};
|
|
37
|
-
return ownKeys(o);
|
|
38
|
-
};
|
|
39
|
-
return function (mod) {
|
|
40
|
-
if (mod && mod.__esModule) return mod;
|
|
41
|
-
var result = {};
|
|
42
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
43
|
-
__setModuleDefault(result, mod);
|
|
44
|
-
return result;
|
|
45
|
-
};
|
|
46
|
-
})();
|
|
47
2
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
48
3
|
var t = {};
|
|
49
4
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -55,78 +10,69 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
55
10
|
}
|
|
56
11
|
return t;
|
|
57
12
|
};
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
exports.Form = Form;
|
|
67
|
-
var FormFieldContext = React.createContext(null);
|
|
68
|
-
var FormField = function (_a) {
|
|
13
|
+
import * as React from "react";
|
|
14
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
15
|
+
import { Controller, FormProvider, useFormContext, } from "react-hook-form";
|
|
16
|
+
import { cn } from "../../lib/utils";
|
|
17
|
+
import { Label } from "../ui/label";
|
|
18
|
+
const Form = FormProvider;
|
|
19
|
+
const FormFieldContext = React.createContext(null);
|
|
20
|
+
const FormField = (_a) => {
|
|
69
21
|
var props = __rest(_a, []);
|
|
70
22
|
return (React.createElement(FormFieldContext.Provider, { value: { name: props.name } },
|
|
71
|
-
React.createElement(
|
|
23
|
+
React.createElement(Controller, Object.assign({}, props))));
|
|
72
24
|
};
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
var _a = (0, react_hook_form_1.useFormContext)(), getFieldState = _a.getFieldState, formState = _a.formState;
|
|
25
|
+
const useFormField = () => {
|
|
26
|
+
const fieldContext = React.useContext(FormFieldContext);
|
|
27
|
+
const itemContext = React.useContext(FormItemContext);
|
|
28
|
+
const { getFieldState, formState } = useFormContext();
|
|
78
29
|
if (!fieldContext) {
|
|
79
30
|
throw new Error("useFormField should be used within <FormField>");
|
|
80
31
|
}
|
|
81
32
|
if (!itemContext) {
|
|
82
33
|
throw new Error("useFormField should be used within <FormItem>");
|
|
83
34
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
return
|
|
35
|
+
const fieldState = getFieldState(fieldContext.name, formState);
|
|
36
|
+
const { id } = itemContext;
|
|
37
|
+
return Object.assign({ id, name: fieldContext.name, formItemId: `${id}-form-item`, formDescriptionId: `${id}-form-item-description`, formMessageId: `${id}-form-item-message` }, fieldState);
|
|
87
38
|
};
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
var
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
React.createElement("div", __assign({ ref: ref, className: (0, utils_1.cn)("space-y-2", className) }, props))));
|
|
39
|
+
const FormItemContext = React.createContext(null);
|
|
40
|
+
const FormItem = React.forwardRef((_a, ref) => {
|
|
41
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
42
|
+
const id = React.useId();
|
|
43
|
+
return (React.createElement(FormItemContext.Provider, { value: { id } },
|
|
44
|
+
React.createElement("div", Object.assign({ ref: ref, className: cn("space-y-2", className) }, props))));
|
|
95
45
|
});
|
|
96
|
-
exports.FormItem = FormItem;
|
|
97
46
|
FormItem.displayName = "FormItem";
|
|
98
|
-
|
|
99
|
-
var className = _a
|
|
100
|
-
|
|
101
|
-
return (React.createElement(
|
|
47
|
+
const FormLabel = React.forwardRef((_a, ref) => {
|
|
48
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
49
|
+
const { error, formItemId } = useFormField();
|
|
50
|
+
return (React.createElement(Label, Object.assign({ ref: ref, className: cn(error && "text-destructive", className), htmlFor: formItemId }, props)));
|
|
102
51
|
});
|
|
103
|
-
exports.FormLabel = FormLabel;
|
|
104
52
|
FormLabel.displayName = "FormLabel";
|
|
105
|
-
|
|
53
|
+
const FormControl = React.forwardRef((_a, ref) => {
|
|
106
54
|
var props = __rest(_a, []);
|
|
107
|
-
|
|
108
|
-
return (React.createElement(
|
|
109
|
-
?
|
|
110
|
-
:
|
|
55
|
+
const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
|
|
56
|
+
return (React.createElement(Slot, Object.assign({ ref: ref, id: formItemId, "aria-describedby": !error
|
|
57
|
+
? `${formDescriptionId}`
|
|
58
|
+
: `${formDescriptionId} ${formMessageId}`, "aria-invalid": !!error }, props)));
|
|
111
59
|
});
|
|
112
|
-
exports.FormControl = FormControl;
|
|
113
60
|
FormControl.displayName = "FormControl";
|
|
114
|
-
|
|
115
|
-
var className = _a
|
|
116
|
-
|
|
117
|
-
return (React.createElement("p",
|
|
61
|
+
const FormDescription = React.forwardRef((_a, ref) => {
|
|
62
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
63
|
+
const { formDescriptionId } = useFormField();
|
|
64
|
+
return (React.createElement("p", Object.assign({ ref: ref, id: formDescriptionId, className: cn("text-[0.8rem] text-muted-foreground", className) }, props)));
|
|
118
65
|
});
|
|
119
|
-
exports.FormDescription = FormDescription;
|
|
120
66
|
FormDescription.displayName = "FormDescription";
|
|
121
|
-
|
|
67
|
+
const FormMessage = React.forwardRef((_a, ref) => {
|
|
122
68
|
var _b;
|
|
123
|
-
var
|
|
124
|
-
|
|
125
|
-
|
|
69
|
+
var { className, children } = _a, props = __rest(_a, ["className", "children"]);
|
|
70
|
+
const { error, formMessageId } = useFormField();
|
|
71
|
+
const body = error ? String((_b = error === null || error === void 0 ? void 0 : error.message) !== null && _b !== void 0 ? _b : "") : children;
|
|
126
72
|
if (!body) {
|
|
127
73
|
return null;
|
|
128
74
|
}
|
|
129
|
-
return (React.createElement("p",
|
|
75
|
+
return (React.createElement("p", Object.assign({ ref: ref, id: formMessageId, className: cn("text-[0.8rem] font-medium text-destructive", className) }, props), body));
|
|
130
76
|
});
|
|
131
|
-
exports.FormMessage = FormMessage;
|
|
132
77
|
FormMessage.displayName = "FormMessage";
|
|
78
|
+
export { useFormField, Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField, };
|