@arolariu/components 0.2.0 → 0.3.1
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/changelog.md +15 -0
- package/dist/components/ui/accordion.d.ts +4 -4
- package/dist/components/ui/accordion.d.ts.map +1 -1
- package/dist/components/ui/accordion.js +19 -27
- package/dist/components/ui/accordion.js.map +1 -1
- package/dist/components/ui/alert-dialog.d.ts +17 -11
- package/dist/components/ui/alert-dialog.d.ts.map +1 -1
- package/dist/components/ui/alert-dialog.js +38 -61
- package/dist/components/ui/alert-dialog.js.map +1 -1
- package/dist/components/ui/alert.d.ts +4 -5
- package/dist/components/ui/alert.d.ts.map +1 -1
- package/dist/components/ui/alert.js +17 -20
- package/dist/components/ui/alert.js.map +1 -1
- package/dist/components/ui/aspect-ratio.d.ts +1 -2
- package/dist/components/ui/aspect-ratio.d.ts.map +1 -1
- package/dist/components/ui/aspect-ratio.js +1 -8
- package/dist/components/ui/aspect-ratio.js.map +1 -1
- package/dist/components/ui/avatar.d.ts +3 -3
- package/dist/components/ui/avatar.d.ts.map +1 -1
- package/dist/components/ui/avatar.js +16 -19
- package/dist/components/ui/avatar.js.map +1 -1
- package/dist/components/ui/badge.d.ts +3 -3
- package/dist/components/ui/badge.d.ts.map +1 -1
- package/dist/components/ui/badge.js +7 -10
- package/dist/components/ui/badge.js.map +1 -1
- package/dist/components/ui/breadcrumb.d.ts +16 -8
- package/dist/components/ui/breadcrumb.d.ts.map +1 -1
- package/dist/components/ui/breadcrumb.js +28 -35
- package/dist/components/ui/breadcrumb.js.map +1 -1
- package/dist/components/ui/button-group.d.ts +13 -0
- package/dist/components/ui/button-group.d.ts.map +1 -0
- package/dist/components/ui/button-group.js +47 -0
- package/dist/components/ui/button-group.js.map +1 -0
- package/dist/components/ui/button.d.ts +3 -2
- package/dist/components/ui/button.d.ts.map +1 -1
- package/dist/components/ui/button.js +15 -14
- package/dist/components/ui/button.js.map +1 -1
- package/dist/components/ui/calendar.js +20 -20
- package/dist/components/ui/calendar.js.map +1 -1
- package/dist/components/ui/card.d.ts +7 -8
- package/dist/components/ui/card.d.ts.map +1 -1
- package/dist/components/ui/card.js +31 -44
- package/dist/components/ui/card.js.map +1 -1
- package/dist/components/ui/carousel.d.ts +5 -6
- package/dist/components/ui/carousel.d.ts.map +1 -1
- package/dist/components/ui/carousel.js +29 -20
- package/dist/components/ui/carousel.js.map +1 -1
- package/dist/components/ui/chart.d.ts +35 -27
- package/dist/components/ui/chart.d.ts.map +1 -1
- package/dist/components/ui/chart.js +28 -26
- package/dist/components/ui/chart.js.map +1 -1
- package/dist/components/ui/checkbox.d.ts +1 -1
- package/dist/components/ui/checkbox.d.ts.map +1 -1
- package/dist/components/ui/checkbox.js +10 -12
- package/dist/components/ui/checkbox.js.map +1 -1
- package/dist/components/ui/collapsible.d.ts +2 -4
- package/dist/components/ui/collapsible.d.ts.map +1 -1
- package/dist/components/ui/collapsible.js +31 -20
- package/dist/components/ui/collapsible.js.map +1 -1
- package/dist/components/ui/command.d.ts +78 -16
- package/dist/components/ui/command.d.ts.map +1 -1
- package/dist/components/ui/command.js +47 -72
- package/dist/components/ui/command.js.map +1 -1
- package/dist/components/ui/context-menu.d.ts +21 -19
- package/dist/components/ui/context-menu.d.ts.map +1 -1
- package/dist/components/ui/context-menu.js +57 -101
- package/dist/components/ui/context-menu.js.map +1 -1
- package/dist/components/ui/dialog.d.ts +16 -12
- package/dist/components/ui/dialog.d.ts.map +1 -1
- package/dist/components/ui/dialog.js +36 -64
- package/dist/components/ui/dialog.js.map +1 -1
- package/dist/components/ui/drawer.d.ts +19 -10
- package/dist/components/ui/drawer.d.ts.map +1 -1
- package/dist/components/ui/drawer.js +32 -57
- package/dist/components/ui/drawer.js.map +1 -1
- package/dist/components/ui/dropdown-menu.d.ts +21 -19
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -1
- package/dist/components/ui/dropdown-menu.js +64 -108
- package/dist/components/ui/dropdown-menu.js.map +1 -1
- package/dist/components/ui/dropdrawer.d.ts +1 -1
- package/dist/components/ui/dropdrawer.d.ts.map +1 -1
- package/dist/components/ui/dropdrawer.js +2 -5
- package/dist/components/ui/dropdrawer.js.map +1 -1
- package/dist/components/ui/empty.d.ts +13 -0
- package/dist/components/ui/empty.d.ts.map +1 -0
- package/dist/components/ui/empty.js +65 -0
- package/dist/components/ui/empty.js.map +1 -0
- package/dist/components/ui/field.d.ts +26 -0
- package/dist/components/ui/field.d.ts.map +1 -0
- package/dist/components/ui/field.js +135 -0
- package/dist/components/ui/field.js.map +1 -0
- package/dist/components/ui/form.d.ts +5 -6
- package/dist/components/ui/form.d.ts.map +1 -1
- package/dist/components/ui/form.js +29 -28
- package/dist/components/ui/form.js.map +1 -1
- package/dist/components/ui/hover-card.d.ts +3 -3
- package/dist/components/ui/hover-card.d.ts.map +1 -1
- package/dist/components/ui/hover-card.js +11 -25
- package/dist/components/ui/hover-card.js.map +1 -1
- package/dist/components/ui/input-group.d.ts +17 -0
- package/dist/components/ui/input-group.d.ts.map +1 -0
- package/dist/components/ui/input-group.js +91 -0
- package/dist/components/ui/input-group.js.map +1 -0
- package/dist/components/ui/input-otp.d.ts +30 -7
- package/dist/components/ui/input-otp.d.ts.map +1 -1
- package/dist/components/ui/input-otp.js +22 -25
- package/dist/components/ui/input-otp.js.map +1 -1
- package/dist/components/ui/input.d.ts +1 -1
- package/dist/components/ui/input.d.ts.map +1 -1
- package/dist/components/ui/input.js +6 -7
- package/dist/components/ui/input.js.map +1 -1
- package/dist/components/ui/item.d.ts +24 -0
- package/dist/components/ui/item.d.ts.map +1 -0
- package/dist/components/ui/item.js +122 -0
- package/dist/components/ui/item.js.map +1 -0
- package/dist/components/ui/kbd.d.ts +5 -0
- package/dist/components/ui/kbd.d.ts.map +1 -0
- package/dist/components/ui/kbd.js +21 -0
- package/dist/components/ui/kbd.js.map +1 -0
- package/dist/components/ui/label.d.ts +2 -1
- package/dist/components/ui/label.d.ts.map +1 -1
- package/dist/components/ui/label.js +8 -7
- package/dist/components/ui/label.js.map +1 -1
- package/dist/components/ui/menubar.d.ts +18 -16
- package/dist/components/ui/menubar.d.ts.map +1 -1
- package/dist/components/ui/menubar.js +73 -93
- package/dist/components/ui/menubar.js.map +1 -1
- package/dist/components/ui/navigation-menu.d.ts +8 -10
- package/dist/components/ui/navigation-menu.d.ts.map +1 -1
- package/dist/components/ui/navigation-menu.js +36 -55
- package/dist/components/ui/navigation-menu.js.map +1 -1
- package/dist/components/ui/pagination.d.ts +24 -9
- package/dist/components/ui/pagination.d.ts.map +1 -1
- package/dist/components/ui/pagination.js +33 -45
- package/dist/components/ui/pagination.js.map +1 -1
- package/dist/components/ui/popover.d.ts +4 -4
- package/dist/components/ui/popover.d.ts.map +1 -1
- package/dist/components/ui/popover.js +9 -25
- package/dist/components/ui/popover.js.map +1 -1
- package/dist/components/ui/progress.d.ts +1 -1
- package/dist/components/ui/progress.d.ts.map +1 -1
- package/dist/components/ui/progress.js +5 -7
- package/dist/components/ui/progress.js.map +1 -1
- package/dist/components/ui/radio-group.d.ts +2 -2
- package/dist/components/ui/radio-group.d.ts.map +1 -1
- package/dist/components/ui/radio-group.js +16 -19
- package/dist/components/ui/radio-group.js.map +1 -1
- package/dist/components/ui/resizable.d.ts +20 -4
- package/dist/components/ui/resizable.d.ts.map +1 -1
- package/dist/components/ui/resizable.js +8 -19
- package/dist/components/ui/resizable.js.map +1 -1
- package/dist/components/ui/scroll-area.d.ts +2 -2
- package/dist/components/ui/scroll-area.d.ts.map +1 -1
- package/dist/components/ui/scroll-area.js +12 -16
- package/dist/components/ui/scroll-area.js.map +1 -1
- package/dist/components/ui/select.d.ts +10 -12
- package/dist/components/ui/select.d.ts.map +1 -1
- package/dist/components/ui/select.js +54 -77
- package/dist/components/ui/select.js.map +1 -1
- package/dist/components/ui/separator.d.ts +1 -1
- package/dist/components/ui/separator.d.ts.map +1 -1
- package/dist/components/ui/separator.js +6 -7
- package/dist/components/ui/separator.js.map +1 -1
- package/dist/components/ui/sheet.d.ts +23 -11
- package/dist/components/ui/sheet.d.ts.map +1 -1
- package/dist/components/ui/sheet.js +54 -66
- package/dist/components/ui/sheet.js.map +1 -1
- package/dist/components/ui/sidebar.d.ts +34 -38
- package/dist/components/ui/sidebar.d.ts.map +1 -1
- package/dist/components/ui/sidebar.js +116 -124
- package/dist/components/ui/sidebar.js.map +1 -1
- package/dist/components/ui/skeleton.d.ts +1 -1
- package/dist/components/ui/skeleton.d.ts.map +1 -1
- package/dist/components/ui/skeleton.js +1 -2
- package/dist/components/ui/skeleton.js.map +1 -1
- package/dist/components/ui/slider.d.ts +1 -1
- package/dist/components/ui/slider.d.ts.map +1 -1
- package/dist/components/ui/slider.js +11 -30
- package/dist/components/ui/slider.js.map +1 -1
- package/dist/components/ui/sonner.d.ts +4 -2
- package/dist/components/ui/sonner.d.ts.map +1 -1
- package/dist/components/ui/sonner.js +7 -4
- package/dist/components/ui/sonner.js.map +1 -1
- package/dist/components/ui/spinner.d.ts +4 -0
- package/dist/components/ui/spinner.d.ts.map +1 -0
- package/dist/components/ui/spinner.js +16 -0
- package/dist/components/ui/spinner.js.map +1 -0
- package/dist/components/ui/switch.d.ts +2 -2
- package/dist/components/ui/switch.d.ts.map +1 -1
- package/dist/components/ui/switch.js +7 -9
- package/dist/components/ui/switch.js.map +1 -1
- package/dist/components/ui/table.d.ts +8 -8
- package/dist/components/ui/table.d.ts.map +1 -1
- package/dist/components/ui/table.js +36 -45
- package/dist/components/ui/table.js.map +1 -1
- package/dist/components/ui/tabs.d.ts +4 -4
- package/dist/components/ui/tabs.d.ts.map +1 -1
- package/dist/components/ui/tabs.js +17 -26
- package/dist/components/ui/tabs.js.map +1 -1
- package/dist/components/ui/textarea.d.ts +1 -1
- package/dist/components/ui/textarea.d.ts.map +1 -1
- package/dist/components/ui/textarea.js +6 -7
- package/dist/components/ui/textarea.js.map +1 -1
- package/dist/components/ui/toggle-group.d.ts +8 -3
- package/dist/components/ui/toggle-group.d.ts.map +1 -1
- package/dist/components/ui/toggle-group.js +11 -15
- package/dist/components/ui/toggle-group.js.map +1 -1
- package/dist/components/ui/toggle.d.ts +4 -1
- package/dist/components/ui/toggle.d.ts.map +1 -1
- package/dist/components/ui/toggle.js +7 -8
- package/dist/components/ui/toggle.js.map +1 -1
- package/dist/components/ui/tooltip.d.ts +4 -4
- package/dist/components/ui/tooltip.d.ts.map +1 -1
- package/dist/components/ui/tooltip.js +13 -38
- package/dist/components/ui/tooltip.js.map +1 -1
- package/dist/components/ui/typewriter.d.ts.map +1 -1
- package/dist/components/ui/typewriter.js +2 -6
- package/dist/components/ui/typewriter.js.map +1 -1
- package/dist/index.css +839 -1126
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +9 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -3
- package/package.json +37 -2
- package/src/components/ui/accordion.tsx +43 -44
- package/src/components/ui/alert-dialog.tsx +88 -99
- package/src/components/ui/alert.tsx +24 -25
- package/src/components/ui/aspect-ratio.tsx +1 -9
- package/src/components/ui/avatar.tsx +33 -27
- package/src/components/ui/badge.tsx +8 -16
- package/src/components/ui/breadcrumb.tsx +70 -73
- package/src/components/ui/button-group.tsx +69 -0
- package/src/components/ui/button.tsx +18 -24
- package/src/components/ui/calendar.tsx +20 -20
- package/src/components/ui/card.tsx +52 -71
- package/src/components/ui/carousel.tsx +145 -133
- package/src/components/ui/chart.tsx +174 -182
- package/src/components/ui/checkbox.tsx +18 -18
- package/src/components/ui/collapsible.tsx +2 -26
- package/src/components/ui/command.tsx +101 -99
- package/src/components/ui/context-menu.tsx +150 -193
- package/src/components/ui/dialog.tsx +75 -110
- package/src/components/ui/drawer.tsx +74 -102
- package/src/components/ui/dropdown-menu.tsx +153 -200
- package/src/components/ui/dropdrawer.tsx +0 -5
- package/src/components/ui/empty.tsx +86 -0
- package/src/components/ui/field.tsx +199 -0
- package/src/components/ui/form.tsx +49 -50
- package/src/components/ui/hover-card.tsx +18 -37
- package/src/components/ui/input-group.tsx +145 -0
- package/src/components/ui/input-otp.tsx +49 -59
- package/src/components/ui/input.tsx +5 -6
- package/src/components/ui/item.tsx +163 -0
- package/src/components/ui/kbd.tsx +31 -0
- package/src/components/ui/label.tsx +14 -12
- package/src/components/ui/menubar.tsx +178 -201
- package/src/components/ui/navigation-menu.tsx +84 -100
- package/src/components/ui/pagination.tsx +75 -85
- package/src/components/ui/popover.tsx +19 -38
- package/src/components/ui/progress.tsx +15 -14
- package/src/components/ui/radio-group.tsx +19 -13
- package/src/components/ui/resizable.tsx +23 -36
- package/src/components/ui/scroll-area.tsx +32 -35
- package/src/components/ui/select.tsx +112 -127
- package/src/components/ui/separator.tsx +17 -19
- package/src/components/ui/sheet.tsx +87 -108
- package/src/components/ui/sidebar.tsx +276 -279
- package/src/components/ui/skeleton.tsx +2 -3
- package/src/components/ui/slider.tsx +15 -40
- package/src/components/ui/sonner.tsx +15 -9
- package/src/components/ui/spinner.tsx +18 -0
- package/src/components/ui/switch.tsx +18 -17
- package/src/components/ui/table.tsx +66 -71
- package/src/components/ui/tabs.tsx +36 -36
- package/src/components/ui/textarea.tsx +5 -4
- package/src/components/ui/toggle-group.tsx +21 -34
- package/src/components/ui/toggle.tsx +14 -16
- package/src/components/ui/tooltip.tsx +19 -43
- package/src/components/ui/typewriter.tsx +3 -4
- package/src/index.css +6 -6
- package/src/index.ts +43 -4
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "../../lib/utilities.js";
|
|
4
|
+
import { cva } from "class-variance-authority";
|
|
5
|
+
import "react";
|
|
6
|
+
function Empty({ className, ...props }) {
|
|
7
|
+
return /*#__PURE__*/ jsx("div", {
|
|
8
|
+
"data-slot": "empty",
|
|
9
|
+
className: cn("flex min-w-0 flex-1 flex-col items-center justify-center gap-6 rounded-lg border-dashed p-6 text-center text-balance md:p-12", className),
|
|
10
|
+
...props
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
function EmptyHeader({ className, ...props }) {
|
|
14
|
+
return /*#__PURE__*/ jsx("div", {
|
|
15
|
+
"data-slot": "empty-header",
|
|
16
|
+
className: cn("flex max-w-sm flex-col items-center gap-2 text-center", className),
|
|
17
|
+
...props
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
const emptyMediaVariants = cva("mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0", {
|
|
21
|
+
variants: {
|
|
22
|
+
variant: {
|
|
23
|
+
default: "bg-transparent",
|
|
24
|
+
icon: "bg-neutral-100 text-neutral-950 flex size-10 shrink-0 items-center justify-center rounded-lg [&_svg:not([class*='size-'])]:size-6 dark:bg-neutral-800 dark:text-neutral-50"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
defaultVariants: {
|
|
28
|
+
variant: "default"
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
function EmptyMedia({ className, variant = "default", ...props }) {
|
|
32
|
+
return /*#__PURE__*/ jsx("div", {
|
|
33
|
+
"data-slot": "empty-icon",
|
|
34
|
+
"data-variant": variant,
|
|
35
|
+
className: cn(emptyMediaVariants({
|
|
36
|
+
variant,
|
|
37
|
+
className
|
|
38
|
+
})),
|
|
39
|
+
...props
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
function EmptyTitle({ className, ...props }) {
|
|
43
|
+
return /*#__PURE__*/ jsx("div", {
|
|
44
|
+
"data-slot": "empty-title",
|
|
45
|
+
className: cn("text-lg font-medium tracking-tight", className),
|
|
46
|
+
...props
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
function EmptyDescription({ className, ...props }) {
|
|
50
|
+
return /*#__PURE__*/ jsx("div", {
|
|
51
|
+
"data-slot": "empty-description",
|
|
52
|
+
className: cn("text-sm/relaxed text-neutral-500 dark:text-neutral-400 [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-neutral-900 dark:[&>a:hover]:text-neutral-50", className),
|
|
53
|
+
...props
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
function EmptyContent({ className, ...props }) {
|
|
57
|
+
return /*#__PURE__*/ jsx("div", {
|
|
58
|
+
"data-slot": "empty-content",
|
|
59
|
+
className: cn("flex w-full max-w-sm min-w-0 flex-col items-center gap-4 text-sm text-balance", className),
|
|
60
|
+
...props
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
export { Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle };
|
|
64
|
+
|
|
65
|
+
//# sourceMappingURL=empty.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components\\ui\\empty.js","sources":["webpack://@arolariu/components/./src/components/ui/empty.tsx"],"sourcesContent":["\r\n\r\nimport {cn} from \"@/lib/utilities\";\r\nimport {cva, type VariantProps} from \"class-variance-authority\";\r\nimport * as React from \"react\";\r\n\r\nfunction Empty({className, ...props}: React.ComponentProps<\"div\">) {\r\n return (\r\n <div\r\n data-slot='empty'\r\n className={cn(\r\n \"flex min-w-0 flex-1 flex-col items-center justify-center gap-6 rounded-lg border-dashed p-6 text-center text-balance md:p-12\",\r\n className,\r\n )}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\nfunction EmptyHeader({className, ...props}: React.ComponentProps<\"div\">) {\r\n return (\r\n <div\r\n data-slot='empty-header'\r\n className={cn(\"flex max-w-sm flex-col items-center gap-2 text-center\", className)}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\nconst emptyMediaVariants = cva(\"mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0\", {\r\n variants: {\r\n variant: {\r\n default: \"bg-transparent\",\r\n icon: \"bg-neutral-100 text-neutral-950 flex size-10 shrink-0 items-center justify-center rounded-lg [&_svg:not([class*='size-'])]:size-6 dark:bg-neutral-800 dark:text-neutral-50\",\r\n },\r\n },\r\n defaultVariants: {\r\n variant: \"default\",\r\n },\r\n});\r\n\r\nfunction EmptyMedia({className, variant = \"default\", ...props}: React.ComponentProps<\"div\"> & VariantProps<typeof emptyMediaVariants>) {\r\n return (\r\n <div\r\n data-slot='empty-icon'\r\n data-variant={variant}\r\n className={cn(emptyMediaVariants({variant, className}))}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\nfunction EmptyTitle({className, ...props}: React.ComponentProps<\"div\">) {\r\n return (\r\n <div\r\n data-slot='empty-title'\r\n className={cn(\"text-lg font-medium tracking-tight\", className)}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\nfunction EmptyDescription({className, ...props}: React.ComponentProps<\"p\">) {\r\n return (\r\n <div\r\n data-slot='empty-description'\r\n className={cn(\r\n \"text-sm/relaxed text-neutral-500 dark:text-neutral-400 [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-neutral-900 dark:[&>a:hover]:text-neutral-50\",\r\n className,\r\n )}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\nfunction EmptyContent({className, ...props}: React.ComponentProps<\"div\">) {\r\n return (\r\n <div\r\n data-slot='empty-content'\r\n className={cn(\"flex w-full max-w-sm min-w-0 flex-col items-center gap-4 text-sm text-balance\", className)}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\nexport {Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle};\r\n"],"names":["Empty","className","props","cn","EmptyHeader","emptyMediaVariants","cva","EmptyMedia","variant","EmptyTitle","EmptyDescription","EmptyContent"],"mappings":";;;;;AAMA,SAASA,MAAM,EAACC,SAAS,EAAE,GAAGC,OAAmC;IAC/D,OAAO,WAAP,GACE,IAAC;QACC,aAAU;QACV,WAAWC,GACT,gIACAF;QAED,GAAGC,KAAK;;AAGf;AAEA,SAASE,YAAY,EAACH,SAAS,EAAE,GAAGC,OAAmC;IACrE,OAAO,WAAP,GACE,IAAC;QACC,aAAU;QACV,WAAWC,GAAG,yDAAyDF;QACtE,GAAGC,KAAK;;AAGf;AAEA,MAAMG,qBAAqBC,IAAI,+FAA+F;IAC5H,UAAU;QACR,SAAS;YACP,SAAS;YACT,MAAM;QACR;IACF;IACA,iBAAiB;QACf,SAAS;IACX;AACF;AAEA,SAASC,WAAW,EAACN,SAAS,EAAEO,UAAU,SAAS,EAAE,GAAGN,OAA6E;IACnI,OAAO,WAAP,GACE,IAAC;QACC,aAAU;QACV,gBAAcM;QACd,WAAWL,GAAGE,mBAAmB;YAACG;YAASP;QAAS;QACnD,GAAGC,KAAK;;AAGf;AAEA,SAASO,WAAW,EAACR,SAAS,EAAE,GAAGC,OAAmC;IACpE,OAAO,WAAP,GACE,IAAC;QACC,aAAU;QACV,WAAWC,GAAG,sCAAsCF;QACnD,GAAGC,KAAK;;AAGf;AAEA,SAASQ,iBAAiB,EAACT,SAAS,EAAE,GAAGC,OAAiC;IACxE,OAAO,WAAP,GACE,IAAC;QACC,aAAU;QACV,WAAWC,GACT,iKACAF;QAED,GAAGC,KAAK;;AAGf;AAEA,SAASS,aAAa,EAACV,SAAS,EAAE,GAAGC,OAAmC;IACtE,OAAO,WAAP,GACE,IAAC;QACC,aAAU;QACV,WAAWC,GAAG,iFAAiFF;QAC9F,GAAGC,KAAK;;AAGf"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type VariantProps } from "class-variance-authority";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { Label } from "./label";
|
|
4
|
+
declare function FieldSet({ className, ...props }: React.ComponentProps<"fieldset">): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function FieldLegend({ className, variant, ...props }: React.ComponentProps<"legend"> & {
|
|
6
|
+
variant?: "legend" | "label";
|
|
7
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare function FieldGroup({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare const fieldVariants: (props?: {
|
|
10
|
+
orientation?: "horizontal" | "vertical" | "responsive";
|
|
11
|
+
} & import("class-variance-authority/types").ClassProp) => string;
|
|
12
|
+
declare function Field({ className, orientation, ...props }: React.ComponentProps<"div"> & VariantProps<typeof fieldVariants>): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
declare function FieldContent({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
declare function FieldLabel({ className, ...props }: React.ComponentProps<typeof Label>): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
declare function FieldTitle({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
declare function FieldDescription({ className, ...props }: React.ComponentProps<"p">): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
declare function FieldSeparator({ children, className, ...props }: React.ComponentProps<"div"> & {
|
|
18
|
+
children?: React.ReactNode;
|
|
19
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
declare function FieldError({ className, children, errors, ...props }: React.ComponentProps<"div"> & {
|
|
21
|
+
errors?: Array<{
|
|
22
|
+
message?: string;
|
|
23
|
+
} | undefined>;
|
|
24
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export { Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle };
|
|
26
|
+
//# sourceMappingURL=field.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field.d.ts","sourceRoot":"","sources":["../../../src/components/ui/field.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAM,KAAK,YAAY,EAAC,MAAM,0BAA0B,CAAC;AAChE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAC,KAAK,EAAC,MAAM,uBAAuB,CAAC;AAI5C,iBAAS,QAAQ,CAAC,EAAC,SAAS,EAAE,GAAG,KAAK,EAAC,EAAE,KAAK,CAAC,cAAc,CAAC,UAAU,CAAC,2CAQxE;AAED,iBAAS,WAAW,CAAC,EAAC,SAAS,EAAE,OAAkB,EAAE,GAAG,KAAK,EAAC,EAAE,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,GAAG;IAAC,OAAO,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAA;CAAC,2CAS9H;AAED,iBAAS,UAAU,CAAC,EAAC,SAAS,EAAE,GAAG,KAAK,EAAC,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAWrE;AAED,QAAA,MAAM,aAAa;;iEAmBjB,CAAC;AAEH,iBAAS,KAAK,CAAC,EAAC,SAAS,EAAE,WAAwB,EAAE,GAAG,KAAK,EAAC,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG,YAAY,CAAC,OAAO,aAAa,CAAC,2CAU/H;AAED,iBAAS,YAAY,CAAC,EAAC,SAAS,EAAE,GAAG,KAAK,EAAC,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAQvE;AAED,iBAAS,UAAU,CAAC,EAAC,SAAS,EAAE,GAAG,KAAK,EAAC,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,KAAK,CAAC,2CAa5E;AAED,iBAAS,UAAU,CAAC,EAAC,SAAS,EAAE,GAAG,KAAK,EAAC,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAWrE;AAED,iBAAS,gBAAgB,CAAC,EAAC,SAAS,EAAE,GAAG,KAAK,EAAC,EAAE,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,2CAazE;AAED,iBAAS,cAAc,CAAC,EACtB,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG;IAC/B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,2CAiBA;AAED,iBAAS,UAAU,CAAC,EAClB,SAAS,EACT,QAAQ,EACR,MAAM,EACN,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG;IAC/B,MAAM,CAAC,EAAE,KAAK,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAC,GAAG,SAAS,CAAC,CAAC;CAChD,2CAmCA;AAED,OAAO,EAAC,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,cAAc,EAAE,QAAQ,EAAE,UAAU,EAAC,CAAC"}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { cva } from "class-variance-authority";
|
|
4
|
+
import { useMemo } from "react";
|
|
5
|
+
import { Label } from "./label.js";
|
|
6
|
+
import { Separator } from "./separator.js";
|
|
7
|
+
import { cn } from "../../lib/utilities.js";
|
|
8
|
+
function FieldSet({ className, ...props }) {
|
|
9
|
+
return /*#__PURE__*/ jsx("fieldset", {
|
|
10
|
+
"data-slot": "field-set",
|
|
11
|
+
className: cn("flex flex-col gap-6", "has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3", className),
|
|
12
|
+
...props
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
function FieldLegend({ className, variant = "legend", ...props }) {
|
|
16
|
+
return /*#__PURE__*/ jsx("legend", {
|
|
17
|
+
"data-slot": "field-legend",
|
|
18
|
+
"data-variant": variant,
|
|
19
|
+
className: cn("mb-3 font-medium", "data-[variant=legend]:text-base", "data-[variant=label]:text-sm", className),
|
|
20
|
+
...props
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
function FieldGroup({ className, ...props }) {
|
|
24
|
+
return /*#__PURE__*/ jsx("div", {
|
|
25
|
+
"data-slot": "field-group",
|
|
26
|
+
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),
|
|
27
|
+
...props
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
const fieldVariants = cva("group/field data-[invalid=true]:text-red-500 flex w-full gap-3 dark:data-[invalid=true]:text-red-900", {
|
|
31
|
+
variants: {
|
|
32
|
+
orientation: {
|
|
33
|
+
vertical: [
|
|
34
|
+
"flex-col [&>*]:w-full [&>.sr-only]:w-auto"
|
|
35
|
+
],
|
|
36
|
+
horizontal: [
|
|
37
|
+
"flex-row items-center",
|
|
38
|
+
"[&>[data-slot=field-label]]:flex-auto",
|
|
39
|
+
"has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px has-[>[data-slot=field-content]]:items-start"
|
|
40
|
+
],
|
|
41
|
+
responsive: [
|
|
42
|
+
"@md/field-group:flex-row @md/field-group:items-center @md/field-group:[&>*]:w-auto flex-col [&>*]:w-full [&>.sr-only]:w-auto",
|
|
43
|
+
"@md/field-group:[&>[data-slot=field-label]]:flex-auto",
|
|
44
|
+
"@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
defaultVariants: {
|
|
49
|
+
orientation: "vertical"
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
function Field({ className, orientation = "vertical", ...props }) {
|
|
53
|
+
return /*#__PURE__*/ jsx("div", {
|
|
54
|
+
role: "group",
|
|
55
|
+
"data-slot": "field",
|
|
56
|
+
"data-orientation": orientation,
|
|
57
|
+
className: cn(fieldVariants({
|
|
58
|
+
orientation
|
|
59
|
+
}), className),
|
|
60
|
+
...props
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
function FieldContent({ className, ...props }) {
|
|
64
|
+
return /*#__PURE__*/ jsx("div", {
|
|
65
|
+
"data-slot": "field-content",
|
|
66
|
+
className: cn("group/field-content flex flex-1 flex-col gap-1.5 leading-snug", className),
|
|
67
|
+
...props
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
function FieldLabel({ className, ...props }) {
|
|
71
|
+
return /*#__PURE__*/ jsx(Label, {
|
|
72
|
+
"data-slot": "field-label",
|
|
73
|
+
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]:border-neutral-900 has-data-[state=checked]:bg-neutral-900/5 dark:has-data-[state=checked]:border-neutral-50 dark:dark:has-data-[state=checked]:bg-neutral-50/10 dark:has-data-[state=checked]:bg-neutral-50/5 dark:has-data-[state=checked]:bg-neutral-900/10", className),
|
|
74
|
+
...props
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
function FieldTitle({ className, ...props }) {
|
|
78
|
+
return /*#__PURE__*/ jsx("div", {
|
|
79
|
+
"data-slot": "field-label",
|
|
80
|
+
className: cn("flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50", className),
|
|
81
|
+
...props
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
function FieldDescription({ className, ...props }) {
|
|
85
|
+
return /*#__PURE__*/ jsx("p", {
|
|
86
|
+
"data-slot": "field-description",
|
|
87
|
+
className: cn("text-sm leading-normal font-normal text-neutral-500 group-has-[[data-orientation=horizontal]]/field:text-balance dark:text-neutral-400", "last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5", "[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-neutral-900 dark:[&>a:hover]:text-neutral-50", className),
|
|
88
|
+
...props
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
function FieldSeparator({ children, className, ...props }) {
|
|
92
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
93
|
+
"data-slot": "field-separator",
|
|
94
|
+
"data-content": Boolean(children) || void 0,
|
|
95
|
+
className: cn("relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2", className),
|
|
96
|
+
...props,
|
|
97
|
+
children: [
|
|
98
|
+
/*#__PURE__*/ jsx(Separator, {
|
|
99
|
+
className: "absolute inset-0 top-1/2"
|
|
100
|
+
}),
|
|
101
|
+
children && /*#__PURE__*/ jsx("span", {
|
|
102
|
+
className: "relative mx-auto block w-fit bg-white px-2 text-neutral-500 dark:bg-neutral-950 dark:text-neutral-400",
|
|
103
|
+
"data-slot": "field-separator-content",
|
|
104
|
+
children: children
|
|
105
|
+
})
|
|
106
|
+
]
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
function FieldError({ className, children, errors, ...props }) {
|
|
110
|
+
const content = useMemo(()=>{
|
|
111
|
+
if (children) return children;
|
|
112
|
+
if (!errors) return null;
|
|
113
|
+
if (errors?.length === 1 && errors[0]?.message) return errors[0].message;
|
|
114
|
+
return /*#__PURE__*/ jsx("ul", {
|
|
115
|
+
className: "ml-4 flex list-disc flex-col gap-1",
|
|
116
|
+
children: errors.map((error, index)=>error?.message && /*#__PURE__*/ jsx("li", {
|
|
117
|
+
children: error.message
|
|
118
|
+
}, index))
|
|
119
|
+
});
|
|
120
|
+
}, [
|
|
121
|
+
children,
|
|
122
|
+
errors
|
|
123
|
+
]);
|
|
124
|
+
if (!content) return null;
|
|
125
|
+
return /*#__PURE__*/ jsx("div", {
|
|
126
|
+
role: "alert",
|
|
127
|
+
"data-slot": "field-error",
|
|
128
|
+
className: cn("text-sm font-normal text-red-500 dark:text-red-900", className),
|
|
129
|
+
...props,
|
|
130
|
+
children: content
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
export { Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle };
|
|
134
|
+
|
|
135
|
+
//# sourceMappingURL=field.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components\\ui\\field.js","sources":["webpack://@arolariu/components/./src/components/ui/field.tsx"],"sourcesContent":["\r\n\r\nimport {cva, type VariantProps} from \"class-variance-authority\";\r\nimport * as React from \"react\";\r\n\r\nimport {Label} from \"@/components/ui/label\";\r\nimport {Separator} from \"@/components/ui/separator\";\r\nimport {cn} from \"@/lib/utilities\";\r\n\r\nfunction FieldSet({className, ...props}: React.ComponentProps<\"fieldset\">) {\r\n return (\r\n <fieldset\r\n data-slot='field-set'\r\n className={cn(\"flex flex-col gap-6\", \"has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3\", className)}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\nfunction FieldLegend({className, variant = \"legend\", ...props}: React.ComponentProps<\"legend\"> & {variant?: \"legend\" | \"label\"}) {\r\n return (\r\n <legend\r\n data-slot='field-legend'\r\n data-variant={variant}\r\n className={cn(\"mb-3 font-medium\", \"data-[variant=legend]:text-base\", \"data-[variant=label]:text-sm\", className)}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\nfunction FieldGroup({className, ...props}: React.ComponentProps<\"div\">) {\r\n return (\r\n <div\r\n data-slot='field-group'\r\n className={cn(\r\n \"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\",\r\n className,\r\n )}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\nconst fieldVariants = cva(\"group/field data-[invalid=true]:text-red-500 flex w-full gap-3 dark:data-[invalid=true]:text-red-900\", {\r\n variants: {\r\n orientation: {\r\n vertical: [\"flex-col [&>*]:w-full [&>.sr-only]:w-auto\"],\r\n horizontal: [\r\n \"flex-row items-center\",\r\n \"[&>[data-slot=field-label]]:flex-auto\",\r\n \"has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px has-[>[data-slot=field-content]]:items-start\",\r\n ],\r\n responsive: [\r\n \"@md/field-group:flex-row @md/field-group:items-center @md/field-group:[&>*]:w-auto flex-col [&>*]:w-full [&>.sr-only]:w-auto\",\r\n \"@md/field-group:[&>[data-slot=field-label]]:flex-auto\",\r\n \"@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px\",\r\n ],\r\n },\r\n },\r\n defaultVariants: {\r\n orientation: \"vertical\",\r\n },\r\n});\r\n\r\nfunction Field({className, orientation = \"vertical\", ...props}: React.ComponentProps<\"div\"> & VariantProps<typeof fieldVariants>) {\r\n return (\r\n <div\r\n role='group'\r\n data-slot='field'\r\n data-orientation={orientation}\r\n className={cn(fieldVariants({orientation}), className)}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\nfunction FieldContent({className, ...props}: React.ComponentProps<\"div\">) {\r\n return (\r\n <div\r\n data-slot='field-content'\r\n className={cn(\"group/field-content flex flex-1 flex-col gap-1.5 leading-snug\", className)}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\nfunction FieldLabel({className, ...props}: React.ComponentProps<typeof Label>) {\r\n return (\r\n <Label\r\n data-slot='field-label'\r\n className={cn(\r\n \"group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50\",\r\n \"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\",\r\n \"has-data-[state=checked]:border-neutral-900 has-data-[state=checked]:bg-neutral-900/5 dark:has-data-[state=checked]:border-neutral-50 dark:dark:has-data-[state=checked]:bg-neutral-50/10 dark:has-data-[state=checked]:bg-neutral-50/5 dark:has-data-[state=checked]:bg-neutral-900/10\",\r\n className,\r\n )}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\nfunction FieldTitle({className, ...props}: React.ComponentProps<\"div\">) {\r\n return (\r\n <div\r\n data-slot='field-label'\r\n className={cn(\r\n \"flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50\",\r\n className,\r\n )}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\nfunction FieldDescription({className, ...props}: React.ComponentProps<\"p\">) {\r\n return (\r\n <p\r\n data-slot='field-description'\r\n className={cn(\r\n \"text-sm leading-normal font-normal text-neutral-500 group-has-[[data-orientation=horizontal]]/field:text-balance dark:text-neutral-400\",\r\n \"last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5\",\r\n \"[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-neutral-900 dark:[&>a:hover]:text-neutral-50\",\r\n className,\r\n )}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\nfunction FieldSeparator({\r\n children,\r\n className,\r\n ...props\r\n}: React.ComponentProps<\"div\"> & {\r\n children?: React.ReactNode;\r\n}) {\r\n return (\r\n <div\r\n data-slot='field-separator'\r\n data-content={Boolean(children) || undefined}\r\n className={cn(\"relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2\", className)}\r\n {...props}>\r\n <Separator className='absolute inset-0 top-1/2' />\r\n {children && (\r\n <span\r\n className='relative mx-auto block w-fit bg-white px-2 text-neutral-500 dark:bg-neutral-950 dark:text-neutral-400'\r\n data-slot='field-separator-content'>\r\n {children}\r\n </span>\r\n )}\r\n </div>\r\n );\r\n}\r\n\r\nfunction FieldError({\r\n className,\r\n children,\r\n errors,\r\n ...props\r\n}: React.ComponentProps<\"div\"> & {\r\n errors?: Array<{message?: string} | undefined>;\r\n}) {\r\n // eslint-disable-next-line sonarjs/function-return-type -- expected different return type.\r\n const content = React.useMemo(() => {\r\n if (children) {\r\n return children;\r\n }\r\n\r\n if (!errors) {\r\n return null;\r\n }\r\n\r\n if (errors?.length === 1 && errors[0]?.message) {\r\n return errors[0].message;\r\n }\r\n\r\n return (\r\n <ul className='ml-4 flex list-disc flex-col gap-1'>\r\n {errors.map((error, index) => error?.message && <li key={index}>{error.message}</li>)}\r\n </ul>\r\n );\r\n }, [children, errors]);\r\n\r\n if (!content) {\r\n return null;\r\n }\r\n\r\n return (\r\n <div\r\n role='alert'\r\n data-slot='field-error'\r\n className={cn(\"text-sm font-normal text-red-500 dark:text-red-900\", className)}\r\n {...props}>\r\n {content}\r\n </div>\r\n );\r\n}\r\n\r\nexport {Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle};\r\n"],"names":["FieldSet","className","props","cn","FieldLegend","variant","FieldGroup","fieldVariants","cva","Field","orientation","FieldContent","FieldLabel","Label","FieldTitle","FieldDescription","FieldSeparator","children","Boolean","undefined","Separator","FieldError","errors","content","React","error","index"],"mappings":"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"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
2
|
-
import { Slot } from "@radix-ui/react-slot";
|
|
3
2
|
import * as React from "react";
|
|
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;
|
|
@@ -16,10 +15,10 @@ 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 { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, useFormField };
|
|
25
24
|
//# sourceMappingURL=form.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../../src/components/ui/form.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../../src/components/ui/form.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,cAAc,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAA2C,KAAK,eAAe,EAAE,KAAK,SAAS,EAAE,KAAK,WAAW,EAAC,MAAM,iBAAiB,CAAC;AAKjI,QAAA,MAAM,IAAI,4MAAe,CAAC;AAW1B,QAAA,MAAM,SAAS,GAAI,YAAY,SAAS,WAAW,GAAG,WAAW,EAAE,KAAK,SAAS,SAAS,CAAC,YAAY,CAAC,GAAG,SAAS,CAAC,YAAY,CAAC,EAAE,cAEjI,eAAe,CAAC,YAAY,EAAE,KAAK,CAAC,4CAMtC,CAAC;AAEF,QAAA,MAAM,YAAY;;;;;;;;;;;CAqBjB,CAAC;AAQF,QAAA,MAAM,QAAQ,6GAYZ,CAAC;AAGH,QAAA,MAAM,SAAS,yJAcb,CAAC;AAGH,QAAA,MAAM,WAAW,8JAYf,CAAC;AAGH,QAAA,MAAM,eAAe,yHAWnB,CAAC;AAGH,QAAA,MAAM,WAAW,yHAmBhB,CAAC;AAGF,OAAO,EAAC,IAAI,EAAE,WAAW,EAAE,eAAe,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAC,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { Slot } from "@radix-ui/react-slot";
|
|
4
|
-
import { createContext, useContext, useId } from "react";
|
|
5
|
-
import { Controller, FormProvider, useFormContext
|
|
4
|
+
import { createContext, forwardRef, useContext, useId } from "react";
|
|
5
|
+
import { Controller, FormProvider, useFormContext } from "react-hook-form";
|
|
6
6
|
import { Label } from "./label.js";
|
|
7
7
|
import { cn } from "../../lib/utilities.js";
|
|
8
8
|
const Form = FormProvider;
|
|
@@ -18,10 +18,7 @@ const FormField = ({ ...props })=>/*#__PURE__*/ jsx(FormFieldContext.Provider, {
|
|
|
18
18
|
const useFormField = ()=>{
|
|
19
19
|
const fieldContext = useContext(FormFieldContext);
|
|
20
20
|
const itemContext = useContext(FormItemContext);
|
|
21
|
-
const { getFieldState } = useFormContext();
|
|
22
|
-
const formState = useFormState({
|
|
23
|
-
name: fieldContext.name
|
|
24
|
-
});
|
|
21
|
+
const { getFieldState, formState } = useFormContext();
|
|
25
22
|
const fieldState = getFieldState(fieldContext.name, formState);
|
|
26
23
|
if (!fieldContext) throw new Error("useFormField should be used within <FormField>");
|
|
27
24
|
const { id } = itemContext;
|
|
@@ -35,60 +32,64 @@ const useFormField = ()=>{
|
|
|
35
32
|
};
|
|
36
33
|
};
|
|
37
34
|
const FormItemContext = /*#__PURE__*/ createContext({});
|
|
38
|
-
|
|
35
|
+
const FormItem = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>{
|
|
39
36
|
const id = useId();
|
|
40
37
|
return /*#__PURE__*/ jsx(FormItemContext.Provider, {
|
|
41
38
|
value: {
|
|
42
39
|
id
|
|
43
40
|
},
|
|
44
41
|
children: /*#__PURE__*/ jsx("div", {
|
|
45
|
-
|
|
46
|
-
className: cn("
|
|
42
|
+
ref: ref,
|
|
43
|
+
className: cn("space-y-2", className),
|
|
47
44
|
...props
|
|
48
45
|
})
|
|
49
46
|
});
|
|
50
|
-
}
|
|
51
|
-
|
|
47
|
+
});
|
|
48
|
+
FormItem.displayName = "FormItem";
|
|
49
|
+
const FormLabel = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>{
|
|
52
50
|
const { error, formItemId } = useFormField();
|
|
53
51
|
return /*#__PURE__*/ jsx(Label, {
|
|
54
|
-
|
|
55
|
-
"
|
|
56
|
-
className: cn("data-[error=true]:text-red-500 dark:data-[error=true]:text-red-900", className),
|
|
52
|
+
ref: ref,
|
|
53
|
+
className: cn(error && "text-red-500 dark:text-red-900", className),
|
|
57
54
|
htmlFor: formItemId,
|
|
58
55
|
...props
|
|
59
56
|
});
|
|
60
|
-
}
|
|
61
|
-
|
|
57
|
+
});
|
|
58
|
+
FormLabel.displayName = "FormLabel";
|
|
59
|
+
const FormControl = /*#__PURE__*/ forwardRef(({ ...props }, ref)=>{
|
|
62
60
|
const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
|
|
63
61
|
return /*#__PURE__*/ jsx(Slot, {
|
|
64
|
-
|
|
62
|
+
ref: ref,
|
|
65
63
|
id: formItemId,
|
|
66
64
|
"aria-describedby": error ? `${formDescriptionId} ${formMessageId}` : `${formDescriptionId}`,
|
|
67
|
-
"aria-invalid":
|
|
65
|
+
"aria-invalid": Boolean(error),
|
|
68
66
|
...props
|
|
69
67
|
});
|
|
70
|
-
}
|
|
71
|
-
|
|
68
|
+
});
|
|
69
|
+
FormControl.displayName = "FormControl";
|
|
70
|
+
const FormDescription = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>{
|
|
72
71
|
const { formDescriptionId } = useFormField();
|
|
73
72
|
return /*#__PURE__*/ jsx("p", {
|
|
74
|
-
|
|
73
|
+
ref: ref,
|
|
75
74
|
id: formDescriptionId,
|
|
76
|
-
className: cn("text-
|
|
75
|
+
className: cn("text-[0.8rem] text-neutral-500 dark:text-neutral-400", className),
|
|
77
76
|
...props
|
|
78
77
|
});
|
|
79
|
-
}
|
|
80
|
-
|
|
78
|
+
});
|
|
79
|
+
FormDescription.displayName = "FormDescription";
|
|
80
|
+
const FormMessage = /*#__PURE__*/ forwardRef(({ className, children, ...props }, ref)=>{
|
|
81
81
|
const { error, formMessageId } = useFormField();
|
|
82
|
-
const body = error ? String(error?.message ?? "") :
|
|
82
|
+
const body = error ? String(error?.message ?? "") : children;
|
|
83
83
|
if (!body) return null;
|
|
84
84
|
return /*#__PURE__*/ jsx("p", {
|
|
85
|
-
|
|
85
|
+
ref: ref,
|
|
86
86
|
id: formMessageId,
|
|
87
|
-
className: cn("text-
|
|
87
|
+
className: cn("text-[0.8rem] font-medium text-red-500 dark:text-red-900", className),
|
|
88
88
|
...props,
|
|
89
89
|
children: body
|
|
90
90
|
});
|
|
91
|
-
}
|
|
91
|
+
});
|
|
92
|
+
FormMessage.displayName = "FormMessage";
|
|
92
93
|
export { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, useFormField };
|
|
93
94
|
|
|
94
95
|
//# sourceMappingURL=form.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components\\ui\\form.js","sources":["webpack://@arolariu/components/./src/components/ui/form.tsx"],"sourcesContent":["\r\n\r\
|
|
1
|
+
{"version":3,"file":"components\\ui\\form.js","sources":["webpack://@arolariu/components/./src/components/ui/form.tsx"],"sourcesContent":["\r\n\r\nimport * as LabelPrimitive from \"@radix-ui/react-label\";\r\nimport {Slot} from \"@radix-ui/react-slot\";\r\nimport * as React from \"react\";\r\nimport {Controller, FormProvider, useFormContext, type ControllerProps, type FieldPath, type FieldValues} from \"react-hook-form\";\r\n\r\nimport {Label} from \"@/components/ui/label\";\r\nimport {cn} from \"@/lib/utilities\";\r\n\r\nconst Form = FormProvider;\r\n\r\ntype FormFieldContextValue<\r\n TFieldValues extends FieldValues = FieldValues,\r\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\r\n> = {\r\n name: TName;\r\n};\r\n\r\nconst FormFieldContext = React.createContext<FormFieldContextValue>({} as FormFieldContextValue);\r\n\r\nconst FormField = <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({\r\n ...props\r\n}: ControllerProps<TFieldValues, TName>) => {\r\n return (\r\n <FormFieldContext.Provider value={{name: props.name}}>\r\n <Controller {...props} />\r\n </FormFieldContext.Provider>\r\n );\r\n};\r\n\r\nconst useFormField = () => {\r\n const fieldContext = React.useContext(FormFieldContext);\r\n const itemContext = React.useContext(FormItemContext);\r\n const {getFieldState, formState} = useFormContext();\r\n\r\n const fieldState = getFieldState(fieldContext.name, formState);\r\n\r\n if (!fieldContext) {\r\n throw new Error(\"useFormField should be used within <FormField>\");\r\n }\r\n\r\n const {id} = itemContext;\r\n\r\n return {\r\n id,\r\n name: fieldContext.name,\r\n formItemId: `${id}-form-item`,\r\n formDescriptionId: `${id}-form-item-description`,\r\n formMessageId: `${id}-form-item-message`,\r\n ...fieldState,\r\n };\r\n};\r\n\r\ntype FormItemContextValue = {\r\n id: string;\r\n};\r\n\r\nconst FormItemContext = React.createContext<FormItemContextValue>({} as FormItemContextValue);\r\n\r\nconst FormItem = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(({className, ...props}, ref) => {\r\n const id = React.useId();\r\n\r\n return (\r\n <FormItemContext.Provider value={{id}}>\r\n <div\r\n ref={ref}\r\n className={cn(\"space-y-2\", className)}\r\n {...props}\r\n />\r\n </FormItemContext.Provider>\r\n );\r\n});\r\nFormItem.displayName = \"FormItem\";\r\n\r\nconst FormLabel = React.forwardRef<\r\n React.ComponentRef<typeof LabelPrimitive.Root>,\r\n React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>\r\n>(({className, ...props}, ref) => {\r\n const {error, formItemId} = useFormField();\r\n\r\n return (\r\n <Label\r\n ref={ref}\r\n className={cn(error && \"text-red-500 dark:text-red-900\", className)}\r\n htmlFor={formItemId}\r\n {...props}\r\n />\r\n );\r\n});\r\nFormLabel.displayName = \"FormLabel\";\r\n\r\nconst FormControl = React.forwardRef<React.ComponentRef<typeof Slot>, React.ComponentPropsWithoutRef<typeof Slot>>(({...props}, ref) => {\r\n const {error, formItemId, formDescriptionId, formMessageId} = useFormField();\r\n\r\n return (\r\n <Slot\r\n ref={ref}\r\n id={formItemId}\r\n aria-describedby={error ? `${formDescriptionId} ${formMessageId}` : `${formDescriptionId}`}\r\n aria-invalid={Boolean(error)}\r\n {...props}\r\n />\r\n );\r\n});\r\nFormControl.displayName = \"FormControl\";\r\n\r\nconst FormDescription = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLParagraphElement>>(({className, ...props}, ref) => {\r\n const {formDescriptionId} = useFormField();\r\n\r\n return (\r\n <p\r\n ref={ref}\r\n id={formDescriptionId}\r\n className={cn(\"text-[0.8rem] text-neutral-500 dark:text-neutral-400\", className)}\r\n {...props}\r\n />\r\n );\r\n});\r\nFormDescription.displayName = \"FormDescription\";\r\n\r\nconst FormMessage = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLParagraphElement>>(\r\n ({className, children, ...props}, ref) => {\r\n const {error, formMessageId} = useFormField();\r\n const body = error ? String(error?.message ?? \"\") : children;\r\n\r\n if (!body) {\r\n return null;\r\n }\r\n\r\n return (\r\n <p\r\n ref={ref}\r\n id={formMessageId}\r\n className={cn(\"text-[0.8rem] font-medium text-red-500 dark:text-red-900\", className)}\r\n {...props}>\r\n {body}\r\n </p>\r\n );\r\n },\r\n);\r\nFormMessage.displayName = \"FormMessage\";\r\n\r\nexport {Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, useFormField};\r\n"],"names":["Form","FormProvider","FormFieldContext","React","FormField","props","Controller","useFormField","fieldContext","itemContext","FormItemContext","getFieldState","formState","useFormContext","fieldState","Error","id","FormItem","className","ref","cn","FormLabel","error","formItemId","Label","FormControl","formDescriptionId","formMessageId","Slot","Boolean","FormDescription","FormMessage","children","body","String"],"mappings":"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"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as HoverCardPrimitive from "@radix-ui/react-hover-card";
|
|
2
2
|
import * as React from "react";
|
|
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, HoverCardContent, HoverCardTrigger };
|
|
7
7
|
//# sourceMappingURL=hover-card.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hover-card.d.ts","sourceRoot":"","sources":["../../../src/components/ui/hover-card.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,kBAAkB,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,
|
|
1
|
+
{"version":3,"file":"hover-card.d.ts","sourceRoot":"","sources":["../../../src/components/ui/hover-card.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,kBAAkB,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,QAAA,MAAM,SAAS,6CAA0B,CAAC;AAE1C,QAAA,MAAM,gBAAgB,oHAA6B,CAAC;AAEpD,QAAA,MAAM,gBAAgB,oKAcpB,CAAC;AAGH,OAAO,EAAC,SAAS,EAAE,gBAAgB,EAAE,gBAAgB,EAAC,CAAC"}
|
|
@@ -1,32 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import { Content,
|
|
4
|
-
import "react";
|
|
3
|
+
import { Content, Root, Trigger } from "@radix-ui/react-hover-card";
|
|
4
|
+
import { forwardRef } from "react";
|
|
5
5
|
import { cn } from "../../lib/utilities.js";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
const HoverCard = Root;
|
|
7
|
+
const HoverCardTrigger = Trigger;
|
|
8
|
+
const HoverCardContent = /*#__PURE__*/ forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref)=>/*#__PURE__*/ jsx(Content, {
|
|
9
|
+
ref: ref,
|
|
10
|
+
align: align,
|
|
11
|
+
sideOffset: sideOffset,
|
|
12
|
+
className: cn("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 border-neutral-200 bg-white p-4 text-neutral-950 shadow-md outline-none dark:border-neutral-800 dark:bg-neutral-950 dark:text-neutral-50", className),
|
|
9
13
|
...props
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
function HoverCardTrigger({ ...props }) {
|
|
13
|
-
return /*#__PURE__*/ jsx(Trigger, {
|
|
14
|
-
"data-slot": "hover-card-trigger",
|
|
15
|
-
...props
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
function HoverCardContent({ className, align = "center", sideOffset = 4, ...props }) {
|
|
19
|
-
return /*#__PURE__*/ jsx(Portal, {
|
|
20
|
-
"data-slot": "hover-card-portal",
|
|
21
|
-
children: /*#__PURE__*/ jsx(Content, {
|
|
22
|
-
"data-slot": "hover-card-content",
|
|
23
|
-
align: align,
|
|
24
|
-
sideOffset: sideOffset,
|
|
25
|
-
className: cn("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 border-neutral-200 bg-white p-4 text-neutral-950 shadow-md outline-hidden dark:border-neutral-800 dark:bg-neutral-950 dark:text-neutral-50", className),
|
|
26
|
-
...props
|
|
27
|
-
})
|
|
28
|
-
});
|
|
29
|
-
}
|
|
14
|
+
}));
|
|
15
|
+
HoverCardContent.displayName = Content.displayName;
|
|
30
16
|
export { HoverCard, HoverCardContent, HoverCardTrigger };
|
|
31
17
|
|
|
32
18
|
//# sourceMappingURL=hover-card.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components\\ui\\hover-card.js","sources":["webpack://@arolariu/components/./src/components/ui/hover-card.tsx"],"sourcesContent":["\r\n\r\nimport * as HoverCardPrimitive from \"@radix-ui/react-hover-card\";\r\nimport * as React from \"react\";\r\n\r\nimport {cn} from \"@/lib/utilities\";\r\n\r\
|
|
1
|
+
{"version":3,"file":"components\\ui\\hover-card.js","sources":["webpack://@arolariu/components/./src/components/ui/hover-card.tsx"],"sourcesContent":["\r\n\r\nimport * as HoverCardPrimitive from \"@radix-ui/react-hover-card\";\r\nimport * as React from \"react\";\r\n\r\nimport {cn} from \"@/lib/utilities\";\r\n\r\nconst HoverCard = HoverCardPrimitive.Root;\r\n\r\nconst HoverCardTrigger = HoverCardPrimitive.Trigger;\r\n\r\nconst HoverCardContent = React.forwardRef<\r\n React.ComponentRef<typeof HoverCardPrimitive.Content>,\r\n React.ComponentPropsWithoutRef<typeof HoverCardPrimitive.Content>\r\n>(({className, align = \"center\", sideOffset = 4, ...props}, ref) => (\r\n <HoverCardPrimitive.Content\r\n ref={ref}\r\n align={align}\r\n sideOffset={sideOffset}\r\n className={cn(\r\n \"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 border-neutral-200 bg-white p-4 text-neutral-950 shadow-md outline-none dark:border-neutral-800 dark:bg-neutral-950 dark:text-neutral-50\",\r\n className,\r\n )}\r\n {...props}\r\n />\r\n));\r\nHoverCardContent.displayName = HoverCardPrimitive.Content.displayName;\r\n\r\nexport {HoverCard, HoverCardContent, HoverCardTrigger};\r\n"],"names":["HoverCard","HoverCardPrimitive","HoverCardTrigger","HoverCardContent","React","className","align","sideOffset","props","ref","cn"],"mappings":";;;;;AAOA,MAAMA,YAAYC;AAElB,MAAMC,mBAAmBD;AAEzB,MAAME,mBAAmB,WAAnBA,GAAmBC,WAGvB,CAAC,EAACC,SAAS,EAAEC,QAAQ,QAAQ,EAAEC,aAAa,CAAC,EAAE,GAAGC,OAAM,EAAEC,MAAAA,WAAAA,GAC1D,IAACR,SAA0B;QACzB,KAAKQ;QACL,OAAOH;QACP,YAAYC;QACZ,WAAWG,GACT,8iBACAL;QAED,GAAGG,KAAK;;AAGbL,iBAAiB,WAAW,GAAGF,QAAAA,WAAsC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type VariantProps } from "class-variance-authority";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { Button } from "./button";
|
|
4
|
+
declare function InputGroup({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare const inputGroupAddonVariants: (props?: {
|
|
6
|
+
align?: "inline-start" | "inline-end" | "block-start" | "block-end";
|
|
7
|
+
} & import("class-variance-authority/types").ClassProp) => string;
|
|
8
|
+
declare function InputGroupAddon({ className, align, ...props }: React.ComponentProps<"div"> & VariantProps<typeof inputGroupAddonVariants>): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare const inputGroupButtonVariants: (props?: {
|
|
10
|
+
size?: "sm" | "xs" | "icon-xs" | "icon-sm";
|
|
11
|
+
} & import("class-variance-authority/types").ClassProp) => string;
|
|
12
|
+
declare function InputGroupButton({ className, type, variant, size, ...props }: Omit<React.ComponentProps<typeof Button>, "size"> & VariantProps<typeof inputGroupButtonVariants>): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
declare function InputGroupText({ className, ...props }: React.ComponentProps<"span">): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
declare function InputGroupInput({ className, ...props }: React.ComponentProps<"input">): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
declare function InputGroupTextarea({ className, ...props }: React.ComponentProps<"textarea">): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea };
|
|
17
|
+
//# sourceMappingURL=input-group.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input-group.d.ts","sourceRoot":"","sources":["../../../src/components/ui/input-group.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAM,KAAK,YAAY,EAAC,MAAM,0BAA0B,CAAC;AAChE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAC,MAAM,EAAC,MAAM,wBAAwB,CAAC;AAK9C,iBAAS,UAAU,CAAC,EAAC,SAAS,EAAE,GAAG,KAAK,EAAC,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CA0BrE;AAED,QAAA,MAAM,uBAAuB;;iEAe5B,CAAC;AAEF,iBAAS,eAAe,CAAC,EACvB,SAAS,EACT,KAAsB,EACtB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG,YAAY,CAAC,OAAO,uBAAuB,CAAC,2CAgB5E;AAED,QAAA,MAAM,wBAAwB;;iEAY5B,CAAC;AAEH,iBAAS,gBAAgB,CAAC,EACxB,SAAS,EACT,IAAe,EACf,OAAiB,EACjB,IAAW,EACX,GAAG,KAAK,EACT,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,EAAE,MAAM,CAAC,GAAG,YAAY,CAAC,OAAO,wBAAwB,CAAC,2CAUnG;AAED,iBAAS,cAAc,CAAC,EAAC,SAAS,EAAE,GAAG,KAAK,EAAC,EAAE,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,2CAU1E;AAED,iBAAS,eAAe,CAAC,EAAC,SAAS,EAAE,GAAG,KAAK,EAAC,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,2CAQ5E;AAED,iBAAS,kBAAkB,CAAC,EAAC,SAAS,EAAE,GAAG,KAAK,EAAC,EAAE,KAAK,CAAC,cAAc,CAAC,UAAU,CAAC,2CAWlF;AAED,OAAO,EAAC,UAAU,EAAE,eAAe,EAAE,gBAAgB,EAAE,eAAe,EAAE,cAAc,EAAE,kBAAkB,EAAC,CAAC"}
|