@websolutespa/ask-ui 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/accordion.d.mts +25 -0
- package/dist/components/accordion.mjs +55 -0
- package/dist/components/ai-elements/attachments.d.mts +94 -0
- package/dist/components/ai-elements/attachments.mjs +174 -0
- package/dist/components/ai-elements/conversation.d.mts +51 -0
- package/dist/components/ai-elements/conversation.mjs +85 -0
- package/dist/components/ai-elements/message.d.mts +89 -0
- package/dist/components/ai-elements/message.mjs +175 -0
- package/dist/components/ai-elements/prompt-input.d.mts +277 -0
- package/dist/components/ai-elements/prompt-input.mjs +703 -0
- package/dist/components/ai-elements/speech-input.d.mts +64 -0
- package/dist/components/ai-elements/speech-input.mjs +153 -0
- package/dist/components/alert-dialog.d.mts +60 -0
- package/dist/components/alert-dialog.mjs +101 -0
- package/dist/components/alert.d.mts +28 -0
- package/dist/components/alert.mjs +43 -0
- package/dist/components/aspect-ratio.d.mts +9 -0
- package/dist/components/aspect-ratio.mjs +12 -0
- package/dist/components/avatar.d.mts +34 -0
- package/dist/components/avatar.mjs +51 -0
- package/dist/components/badge.d.mts +19 -0
- package/dist/components/badge.mjs +27 -0
- package/dist/components/breadcrumb.d.mts +38 -0
- package/dist/components/breadcrumb.mjs +70 -0
- package/dist/components/button-group.d.mts +28 -0
- package/dist/components/button-group.mjs +38 -0
- package/dist/components/button.d.mts +21 -0
- package/dist/components/button.mjs +47 -0
- package/dist/components/calendar.d.mts +30 -0
- package/dist/components/calendar.mjs +109 -0
- package/dist/components/card.d.mts +37 -0
- package/dist/components/card.mjs +56 -0
- package/dist/components/carousel.d.mts +56 -0
- package/dist/components/carousel.mjs +132 -0
- package/dist/components/chart.d.mts +78 -0
- package/dist/components/chart.mjs +146 -0
- package/dist/components/checkbox.d.mts +11 -0
- package/dist/components/checkbox.mjs +21 -0
- package/dist/components/collapsible.d.mts +15 -0
- package/dist/components/collapsible.mjs +24 -0
- package/dist/components/combobox.d.mts +81 -0
- package/dist/components/combobox.mjs +163 -0
- package/dist/components/command.d.mts +54 -0
- package/dist/components/command.mjs +88 -0
- package/dist/components/context-menu.d.mts +85 -0
- package/dist/components/context-menu.mjs +125 -0
- package/dist/components/dialog.d.mts +51 -0
- package/dist/components/dialog.mjs +96 -0
- package/dist/components/direction.d.mts +15 -0
- package/dist/components/direction.mjs +14 -0
- package/dist/components/drawer.d.mts +47 -0
- package/dist/components/drawer.mjs +79 -0
- package/dist/components/dropdown-menu.d.mts +87 -0
- package/dist/components/dropdown-menu.mjs +131 -0
- package/dist/components/empty.d.mts +35 -0
- package/dist/components/empty.mjs +59 -0
- package/dist/components/field.d.mts +64 -0
- package/dist/components/field.mjs +110 -0
- package/dist/components/hover-card.d.mts +22 -0
- package/dist/components/hover-card.mjs +33 -0
- package/dist/components/input-group.d.mts +43 -0
- package/dist/components/input-group.mjs +79 -0
- package/dist/components/input-otp.d.mts +28 -0
- package/dist/components/input-otp.mjs +47 -0
- package/dist/components/input.d.mts +11 -0
- package/dist/components/input.mjs +14 -0
- package/dist/components/item.d.mts +62 -0
- package/dist/components/item.mjs +117 -0
- package/dist/components/kbd.d.mts +13 -0
- package/dist/components/kbd.mjs +19 -0
- package/dist/components/label.d.mts +11 -0
- package/dist/components/label.mjs +15 -0
- package/dist/components/menubar.d.mts +90 -0
- package/dist/components/menubar.mjs +135 -0
- package/dist/components/native-select.d.mts +21 -0
- package/dist/components/native-select.mjs +37 -0
- package/dist/components/navigation-menu.d.mts +46 -0
- package/dist/components/navigation-menu.mjs +80 -0
- package/dist/components/pagination.d.mts +45 -0
- package/dist/components/pagination.mjs +80 -0
- package/dist/components/popover.d.mts +34 -0
- package/dist/components/popover.mjs +56 -0
- package/dist/components/progress.d.mts +12 -0
- package/dist/components/progress.mjs +20 -0
- package/dist/components/radio-group.d.mts +15 -0
- package/dist/components/radio-group.mjs +27 -0
- package/dist/components/resizable.d.mts +20 -0
- package/dist/components/resizable.mjs +28 -0
- package/dist/components/scroll-area.d.mts +17 -0
- package/dist/components/scroll-area.mjs +37 -0
- package/dist/components/select.d.mts +53 -0
- package/dist/components/select.mjs +100 -0
- package/dist/components/separator.d.mts +13 -0
- package/dist/components/separator.mjs +17 -0
- package/dist/components/sheet.d.mts +42 -0
- package/dist/components/sheet.mjs +90 -0
- package/dist/components/sidebar.d.mts +167 -0
- package/dist/components/sidebar.mjs +374 -0
- package/dist/components/skeleton.d.mts +9 -0
- package/dist/components/skeleton.mjs +12 -0
- package/dist/components/slider.d.mts +15 -0
- package/dist/components/slider.mjs +36 -0
- package/dist/components/sonner.d.mts +9 -0
- package/dist/components/sonner.mjs +30 -0
- package/dist/components/spinner.d.mts +9 -0
- package/dist/components/spinner.mjs +14 -0
- package/dist/components/switch.d.mts +14 -0
- package/dist/components/switch.mjs +20 -0
- package/dist/components/table.d.mts +38 -0
- package/dist/components/table.mjs +67 -0
- package/dist/components/tabs.d.mts +30 -0
- package/dist/components/tabs.mjs +46 -0
- package/dist/components/textarea.d.mts +10 -0
- package/dist/components/textarea.mjs +13 -0
- package/dist/components/toggle-group.d.mts +28 -0
- package/dist/components/toggle-group.mjs +51 -0
- package/dist/components/toggle.d.mts +19 -0
- package/dist/components/toggle.mjs +37 -0
- package/dist/components/tooltip.d.mts +23 -0
- package/dist/components/tooltip.mjs +36 -0
- package/dist/exports/components.d.mts +61 -2248
- package/dist/exports/components.mjs +60 -4481
- package/dist/exports/hooks.d.mts +1 -3
- package/dist/exports/hooks.mjs +1 -1
- package/dist/exports/lib.d.mts +1 -1
- package/dist/exports/lib.mjs +1 -1
- package/dist/hooks/use-mobile.d.mts +4 -0
- package/dist/{use-mobile-SSHtEcOs.mjs → hooks/use-mobile.mjs} +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{utils-CCM7KiiI.d.mts → lib/utils.d.mts} +1 -1
- package/dist/{utils-XdqGR1qq.mjs → lib/utils.mjs} +1 -1
- package/package.json +7 -7
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { DropdownMenu } from "radix-ui";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region src/components/dropdown-menu.d.ts
|
|
6
|
+
declare function DropdownMenu$1({
|
|
7
|
+
...props
|
|
8
|
+
}: React.ComponentProps<typeof DropdownMenu.Root>): _$react_jsx_runtime0.JSX.Element;
|
|
9
|
+
declare function DropdownMenuPortal({
|
|
10
|
+
...props
|
|
11
|
+
}: React.ComponentProps<typeof DropdownMenu.Portal>): _$react_jsx_runtime0.JSX.Element;
|
|
12
|
+
declare function DropdownMenuTrigger({
|
|
13
|
+
...props
|
|
14
|
+
}: React.ComponentProps<typeof DropdownMenu.Trigger>): _$react_jsx_runtime0.JSX.Element;
|
|
15
|
+
declare function DropdownMenuContent({
|
|
16
|
+
className,
|
|
17
|
+
align,
|
|
18
|
+
sideOffset,
|
|
19
|
+
container,
|
|
20
|
+
...props
|
|
21
|
+
}: React.ComponentProps<typeof DropdownMenu.Content> & {
|
|
22
|
+
container?: HTMLDivElement | null;
|
|
23
|
+
}): _$react_jsx_runtime0.JSX.Element;
|
|
24
|
+
declare function DropdownMenuGroup({
|
|
25
|
+
...props
|
|
26
|
+
}: React.ComponentProps<typeof DropdownMenu.Group>): _$react_jsx_runtime0.JSX.Element;
|
|
27
|
+
declare function DropdownMenuItem({
|
|
28
|
+
className,
|
|
29
|
+
inset,
|
|
30
|
+
variant,
|
|
31
|
+
...props
|
|
32
|
+
}: React.ComponentProps<typeof DropdownMenu.Item> & {
|
|
33
|
+
inset?: boolean;
|
|
34
|
+
variant?: 'default' | 'destructive';
|
|
35
|
+
}): _$react_jsx_runtime0.JSX.Element;
|
|
36
|
+
declare function DropdownMenuCheckboxItem({
|
|
37
|
+
className,
|
|
38
|
+
children,
|
|
39
|
+
checked,
|
|
40
|
+
inset,
|
|
41
|
+
...props
|
|
42
|
+
}: React.ComponentProps<typeof DropdownMenu.CheckboxItem> & {
|
|
43
|
+
inset?: boolean;
|
|
44
|
+
}): _$react_jsx_runtime0.JSX.Element;
|
|
45
|
+
declare function DropdownMenuRadioGroup({
|
|
46
|
+
...props
|
|
47
|
+
}: React.ComponentProps<typeof DropdownMenu.RadioGroup>): _$react_jsx_runtime0.JSX.Element;
|
|
48
|
+
declare function DropdownMenuRadioItem({
|
|
49
|
+
className,
|
|
50
|
+
children,
|
|
51
|
+
inset,
|
|
52
|
+
...props
|
|
53
|
+
}: React.ComponentProps<typeof DropdownMenu.RadioItem> & {
|
|
54
|
+
inset?: boolean;
|
|
55
|
+
}): _$react_jsx_runtime0.JSX.Element;
|
|
56
|
+
declare function DropdownMenuLabel({
|
|
57
|
+
className,
|
|
58
|
+
inset,
|
|
59
|
+
...props
|
|
60
|
+
}: React.ComponentProps<typeof DropdownMenu.Label> & {
|
|
61
|
+
inset?: boolean;
|
|
62
|
+
}): _$react_jsx_runtime0.JSX.Element;
|
|
63
|
+
declare function DropdownMenuSeparator({
|
|
64
|
+
className,
|
|
65
|
+
...props
|
|
66
|
+
}: React.ComponentProps<typeof DropdownMenu.Separator>): _$react_jsx_runtime0.JSX.Element;
|
|
67
|
+
declare function DropdownMenuShortcut({
|
|
68
|
+
className,
|
|
69
|
+
...props
|
|
70
|
+
}: React.ComponentProps<'span'>): _$react_jsx_runtime0.JSX.Element;
|
|
71
|
+
declare function DropdownMenuSub({
|
|
72
|
+
...props
|
|
73
|
+
}: React.ComponentProps<typeof DropdownMenu.Sub>): _$react_jsx_runtime0.JSX.Element;
|
|
74
|
+
declare function DropdownMenuSubTrigger({
|
|
75
|
+
className,
|
|
76
|
+
inset,
|
|
77
|
+
children,
|
|
78
|
+
...props
|
|
79
|
+
}: React.ComponentProps<typeof DropdownMenu.SubTrigger> & {
|
|
80
|
+
inset?: boolean;
|
|
81
|
+
}): _$react_jsx_runtime0.JSX.Element;
|
|
82
|
+
declare function DropdownMenuSubContent({
|
|
83
|
+
className,
|
|
84
|
+
...props
|
|
85
|
+
}: React.ComponentProps<typeof DropdownMenu.SubContent>): _$react_jsx_runtime0.JSX.Element;
|
|
86
|
+
//#endregion
|
|
87
|
+
export { DropdownMenu$1 as DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger };
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/utils.mjs";
|
|
3
|
+
import { CheckIcon, ChevronRightIcon } from "lucide-react";
|
|
4
|
+
import { DropdownMenu } from "radix-ui";
|
|
5
|
+
import "react";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
//#region src/components/dropdown-menu.tsx
|
|
8
|
+
function DropdownMenu$1({ ...props }) {
|
|
9
|
+
return /* @__PURE__ */ jsx(DropdownMenu.Root, {
|
|
10
|
+
"data-slot": "dropdown-menu",
|
|
11
|
+
...props
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
function DropdownMenuPortal({ ...props }) {
|
|
15
|
+
return /* @__PURE__ */ jsx(DropdownMenu.Portal, {
|
|
16
|
+
"data-slot": "dropdown-menu-portal",
|
|
17
|
+
...props
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
function DropdownMenuTrigger({ ...props }) {
|
|
21
|
+
return /* @__PURE__ */ jsx(DropdownMenu.Trigger, {
|
|
22
|
+
"data-slot": "dropdown-menu-trigger",
|
|
23
|
+
...props
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
function DropdownMenuContent({ className, align = "start", sideOffset = 4, container, ...props }) {
|
|
27
|
+
return /* @__PURE__ */ jsx(DropdownMenu.Portal, {
|
|
28
|
+
container,
|
|
29
|
+
children: /* @__PURE__ */ jsx(DropdownMenu.Content, {
|
|
30
|
+
"data-slot": "dropdown-menu-content",
|
|
31
|
+
sideOffset,
|
|
32
|
+
align,
|
|
33
|
+
className: cn("z-50 max-h-(--radix-dropdown-menu-content-available-height) w-(--radix-dropdown-menu-trigger-width) min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 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 data-[state=closed]:overflow-hidden data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className),
|
|
34
|
+
...props
|
|
35
|
+
})
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
function DropdownMenuGroup({ ...props }) {
|
|
39
|
+
return /* @__PURE__ */ jsx(DropdownMenu.Group, {
|
|
40
|
+
"data-slot": "dropdown-menu-group",
|
|
41
|
+
...props
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
function DropdownMenuItem({ className, inset, variant = "default", ...props }) {
|
|
45
|
+
return /* @__PURE__ */ jsx(DropdownMenu.Item, {
|
|
46
|
+
"data-slot": "dropdown-menu-item",
|
|
47
|
+
"data-inset": inset,
|
|
48
|
+
"data-variant": variant,
|
|
49
|
+
className: cn("group/dropdown-menu-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive", className),
|
|
50
|
+
...props
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
function DropdownMenuCheckboxItem({ className, children, checked, inset, ...props }) {
|
|
54
|
+
return /* @__PURE__ */ jsxs(DropdownMenu.CheckboxItem, {
|
|
55
|
+
"data-slot": "dropdown-menu-checkbox-item",
|
|
56
|
+
"data-inset": inset,
|
|
57
|
+
className: cn("relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-8 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
58
|
+
checked,
|
|
59
|
+
...props,
|
|
60
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
61
|
+
className: "pointer-events-none absolute right-2 flex items-center justify-center",
|
|
62
|
+
"data-slot": "dropdown-menu-checkbox-item-indicator",
|
|
63
|
+
children: /* @__PURE__ */ jsx(DropdownMenu.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, {}) })
|
|
64
|
+
}), children]
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
function DropdownMenuRadioGroup({ ...props }) {
|
|
68
|
+
return /* @__PURE__ */ jsx(DropdownMenu.RadioGroup, {
|
|
69
|
+
"data-slot": "dropdown-menu-radio-group",
|
|
70
|
+
...props
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
function DropdownMenuRadioItem({ className, children, inset, ...props }) {
|
|
74
|
+
return /* @__PURE__ */ jsxs(DropdownMenu.RadioItem, {
|
|
75
|
+
"data-slot": "dropdown-menu-radio-item",
|
|
76
|
+
"data-inset": inset,
|
|
77
|
+
className: cn("relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-8 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
78
|
+
...props,
|
|
79
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
80
|
+
className: "pointer-events-none absolute right-2 flex items-center justify-center",
|
|
81
|
+
"data-slot": "dropdown-menu-radio-item-indicator",
|
|
82
|
+
children: /* @__PURE__ */ jsx(DropdownMenu.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, {}) })
|
|
83
|
+
}), children]
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
function DropdownMenuLabel({ className, inset, ...props }) {
|
|
87
|
+
return /* @__PURE__ */ jsx(DropdownMenu.Label, {
|
|
88
|
+
"data-slot": "dropdown-menu-label",
|
|
89
|
+
"data-inset": inset,
|
|
90
|
+
className: cn("px-2 py-1.5 text-xs font-medium text-muted-foreground data-inset:pl-8", className),
|
|
91
|
+
...props
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
function DropdownMenuSeparator({ className, ...props }) {
|
|
95
|
+
return /* @__PURE__ */ jsx(DropdownMenu.Separator, {
|
|
96
|
+
"data-slot": "dropdown-menu-separator",
|
|
97
|
+
className: cn("-mx-1 my-1 h-px bg-border", className),
|
|
98
|
+
...props
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
function DropdownMenuShortcut({ className, ...props }) {
|
|
102
|
+
return /* @__PURE__ */ jsx("span", {
|
|
103
|
+
"data-slot": "dropdown-menu-shortcut",
|
|
104
|
+
className: cn("ml-auto text-xs tracking-widest text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground", className),
|
|
105
|
+
...props
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
function DropdownMenuSub({ ...props }) {
|
|
109
|
+
return /* @__PURE__ */ jsx(DropdownMenu.Sub, {
|
|
110
|
+
"data-slot": "dropdown-menu-sub",
|
|
111
|
+
...props
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
function DropdownMenuSubTrigger({ className, inset, children, ...props }) {
|
|
115
|
+
return /* @__PURE__ */ jsxs(DropdownMenu.SubTrigger, {
|
|
116
|
+
"data-slot": "dropdown-menu-sub-trigger",
|
|
117
|
+
"data-inset": inset,
|
|
118
|
+
className: cn("flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-8 data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
119
|
+
...props,
|
|
120
|
+
children: [children, /* @__PURE__ */ jsx(ChevronRightIcon, { className: "ml-auto" })]
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
function DropdownMenuSubContent({ className, ...props }) {
|
|
124
|
+
return /* @__PURE__ */ jsx(DropdownMenu.SubContent, {
|
|
125
|
+
"data-slot": "dropdown-menu-sub-content",
|
|
126
|
+
className: cn("z-50 min-w-[96px] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100 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 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className),
|
|
127
|
+
...props
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
//#endregion
|
|
131
|
+
export { DropdownMenu$1 as DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
|
+
import { VariantProps } from "class-variance-authority";
|
|
3
|
+
import * as _$class_variance_authority_types0 from "class-variance-authority/types";
|
|
4
|
+
|
|
5
|
+
//#region src/components/empty.d.ts
|
|
6
|
+
declare function Empty({
|
|
7
|
+
className,
|
|
8
|
+
...props
|
|
9
|
+
}: React.ComponentProps<'div'>): _$react_jsx_runtime0.JSX.Element;
|
|
10
|
+
declare function EmptyHeader({
|
|
11
|
+
className,
|
|
12
|
+
...props
|
|
13
|
+
}: React.ComponentProps<'div'>): _$react_jsx_runtime0.JSX.Element;
|
|
14
|
+
declare const emptyMediaVariants: (props?: ({
|
|
15
|
+
variant?: "default" | "icon" | null | undefined;
|
|
16
|
+
} & _$class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
17
|
+
declare function EmptyMedia({
|
|
18
|
+
className,
|
|
19
|
+
variant,
|
|
20
|
+
...props
|
|
21
|
+
}: React.ComponentProps<'div'> & VariantProps<typeof emptyMediaVariants>): _$react_jsx_runtime0.JSX.Element;
|
|
22
|
+
declare function EmptyTitle({
|
|
23
|
+
className,
|
|
24
|
+
...props
|
|
25
|
+
}: React.ComponentProps<'div'>): _$react_jsx_runtime0.JSX.Element;
|
|
26
|
+
declare function EmptyDescription({
|
|
27
|
+
className,
|
|
28
|
+
...props
|
|
29
|
+
}: React.ComponentProps<'p'>): _$react_jsx_runtime0.JSX.Element;
|
|
30
|
+
declare function EmptyContent({
|
|
31
|
+
className,
|
|
32
|
+
...props
|
|
33
|
+
}: React.ComponentProps<'div'>): _$react_jsx_runtime0.JSX.Element;
|
|
34
|
+
//#endregion
|
|
35
|
+
export { Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { cn } from "../lib/utils.mjs";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { cva } from "class-variance-authority";
|
|
4
|
+
//#region src/components/empty.tsx
|
|
5
|
+
function Empty({ className, ...props }) {
|
|
6
|
+
return /* @__PURE__ */ jsx("div", {
|
|
7
|
+
"data-slot": "empty",
|
|
8
|
+
className: cn("flex w-full min-w-0 flex-1 flex-col items-center justify-center gap-4 rounded-lg border-dashed p-12 text-center text-balance", className),
|
|
9
|
+
...props
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
function EmptyHeader({ className, ...props }) {
|
|
13
|
+
return /* @__PURE__ */ jsx("div", {
|
|
14
|
+
"data-slot": "empty-header",
|
|
15
|
+
className: cn("flex max-w-sm flex-col items-center gap-2", className),
|
|
16
|
+
...props
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
const emptyMediaVariants = cva("mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0", {
|
|
20
|
+
variants: { variant: {
|
|
21
|
+
default: "bg-transparent",
|
|
22
|
+
icon: "flex size-10 shrink-0 items-center justify-center rounded-lg bg-muted text-foreground [&_svg:not([class*='size-'])]:size-6"
|
|
23
|
+
} },
|
|
24
|
+
defaultVariants: { variant: "default" }
|
|
25
|
+
});
|
|
26
|
+
function EmptyMedia({ className, variant = "default", ...props }) {
|
|
27
|
+
return /* @__PURE__ */ jsx("div", {
|
|
28
|
+
"data-slot": "empty-icon",
|
|
29
|
+
"data-variant": variant,
|
|
30
|
+
className: cn(emptyMediaVariants({
|
|
31
|
+
variant,
|
|
32
|
+
className
|
|
33
|
+
})),
|
|
34
|
+
...props
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
function EmptyTitle({ className, ...props }) {
|
|
38
|
+
return /* @__PURE__ */ jsx("div", {
|
|
39
|
+
"data-slot": "empty-title",
|
|
40
|
+
className: cn("text-lg font-medium tracking-tight", className),
|
|
41
|
+
...props
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
function EmptyDescription({ className, ...props }) {
|
|
45
|
+
return /* @__PURE__ */ jsx("div", {
|
|
46
|
+
"data-slot": "empty-description",
|
|
47
|
+
className: cn("text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary", className),
|
|
48
|
+
...props
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
function EmptyContent({ className, ...props }) {
|
|
52
|
+
return /* @__PURE__ */ jsx("div", {
|
|
53
|
+
"data-slot": "empty-content",
|
|
54
|
+
className: cn("flex w-full max-w-sm min-w-0 flex-col items-center gap-4 text-sm text-balance", className),
|
|
55
|
+
...props
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
//#endregion
|
|
59
|
+
export { Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Label } from "./label.mjs";
|
|
2
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
import { VariantProps } from "class-variance-authority";
|
|
4
|
+
import * as _$class_variance_authority_types0 from "class-variance-authority/types";
|
|
5
|
+
|
|
6
|
+
//#region src/components/field.d.ts
|
|
7
|
+
declare function FieldSet({
|
|
8
|
+
className,
|
|
9
|
+
...props
|
|
10
|
+
}: React.ComponentProps<'fieldset'>): _$react_jsx_runtime0.JSX.Element;
|
|
11
|
+
declare function FieldLegend({
|
|
12
|
+
className,
|
|
13
|
+
variant,
|
|
14
|
+
...props
|
|
15
|
+
}: React.ComponentProps<'legend'> & {
|
|
16
|
+
variant?: 'legend' | 'label';
|
|
17
|
+
}): _$react_jsx_runtime0.JSX.Element;
|
|
18
|
+
declare function FieldGroup({
|
|
19
|
+
className,
|
|
20
|
+
...props
|
|
21
|
+
}: React.ComponentProps<'div'>): _$react_jsx_runtime0.JSX.Element;
|
|
22
|
+
declare const fieldVariants: (props?: ({
|
|
23
|
+
orientation?: "horizontal" | "vertical" | "responsive" | null | undefined;
|
|
24
|
+
} & _$class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
25
|
+
declare function Field({
|
|
26
|
+
className,
|
|
27
|
+
orientation,
|
|
28
|
+
...props
|
|
29
|
+
}: React.ComponentProps<'div'> & VariantProps<typeof fieldVariants>): _$react_jsx_runtime0.JSX.Element;
|
|
30
|
+
declare function FieldContent({
|
|
31
|
+
className,
|
|
32
|
+
...props
|
|
33
|
+
}: React.ComponentProps<'div'>): _$react_jsx_runtime0.JSX.Element;
|
|
34
|
+
declare function FieldLabel({
|
|
35
|
+
className,
|
|
36
|
+
...props
|
|
37
|
+
}: React.ComponentProps<typeof Label>): _$react_jsx_runtime0.JSX.Element;
|
|
38
|
+
declare function FieldTitle({
|
|
39
|
+
className,
|
|
40
|
+
...props
|
|
41
|
+
}: React.ComponentProps<'div'>): _$react_jsx_runtime0.JSX.Element;
|
|
42
|
+
declare function FieldDescription({
|
|
43
|
+
className,
|
|
44
|
+
...props
|
|
45
|
+
}: React.ComponentProps<'p'>): _$react_jsx_runtime0.JSX.Element;
|
|
46
|
+
declare function FieldSeparator({
|
|
47
|
+
children,
|
|
48
|
+
className,
|
|
49
|
+
...props
|
|
50
|
+
}: React.ComponentProps<'div'> & {
|
|
51
|
+
children?: React.ReactNode;
|
|
52
|
+
}): _$react_jsx_runtime0.JSX.Element;
|
|
53
|
+
declare function FieldError({
|
|
54
|
+
className,
|
|
55
|
+
children,
|
|
56
|
+
errors,
|
|
57
|
+
...props
|
|
58
|
+
}: React.ComponentProps<'div'> & {
|
|
59
|
+
errors?: ({
|
|
60
|
+
message?: string;
|
|
61
|
+
} | undefined)[];
|
|
62
|
+
}): _$react_jsx_runtime0.JSX.Element | null;
|
|
63
|
+
//#endregion
|
|
64
|
+
export { Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle };
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/utils.mjs";
|
|
3
|
+
import { Separator } from "./separator.mjs";
|
|
4
|
+
import { Label } from "./label.mjs";
|
|
5
|
+
import { useMemo } from "react";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { cva } from "class-variance-authority";
|
|
8
|
+
//#region src/components/field.tsx
|
|
9
|
+
function FieldSet({ className, ...props }) {
|
|
10
|
+
return /* @__PURE__ */ jsx("fieldset", {
|
|
11
|
+
"data-slot": "field-set",
|
|
12
|
+
className: cn("flex flex-col gap-6 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3", className),
|
|
13
|
+
...props
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
function FieldLegend({ className, variant = "legend", ...props }) {
|
|
17
|
+
return /* @__PURE__ */ jsx("legend", {
|
|
18
|
+
"data-slot": "field-legend",
|
|
19
|
+
"data-variant": variant,
|
|
20
|
+
className: cn("mb-3 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base", className),
|
|
21
|
+
...props
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
function FieldGroup({ className, ...props }) {
|
|
25
|
+
return /* @__PURE__ */ jsx("div", {
|
|
26
|
+
"data-slot": "field-group",
|
|
27
|
+
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),
|
|
28
|
+
...props
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
const fieldVariants = cva("group/field flex w-full gap-3 data-[invalid=true]:text-destructive", {
|
|
32
|
+
variants: { orientation: {
|
|
33
|
+
vertical: "flex-col *:w-full [&>.sr-only]:w-auto",
|
|
34
|
+
horizontal: "flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
|
|
35
|
+
responsive: "flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"
|
|
36
|
+
} },
|
|
37
|
+
defaultVariants: { orientation: "vertical" }
|
|
38
|
+
});
|
|
39
|
+
function Field({ className, orientation = "vertical", ...props }) {
|
|
40
|
+
return /* @__PURE__ */ jsx("div", {
|
|
41
|
+
role: "group",
|
|
42
|
+
"data-slot": "field",
|
|
43
|
+
"data-orientation": orientation,
|
|
44
|
+
className: cn(fieldVariants({ orientation }), className),
|
|
45
|
+
...props
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
function FieldContent({ className, ...props }) {
|
|
49
|
+
return /* @__PURE__ */ jsx("div", {
|
|
50
|
+
"data-slot": "field-content",
|
|
51
|
+
className: cn("group/field-content flex flex-1 flex-col gap-1 leading-snug", className),
|
|
52
|
+
...props
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
function FieldLabel({ className, ...props }) {
|
|
56
|
+
return /* @__PURE__ */ jsx(Label, {
|
|
57
|
+
"data-slot": "field-label",
|
|
58
|
+
className: cn("group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border *:data-[slot=field]:p-3 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10", "has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col", className),
|
|
59
|
+
...props
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
function FieldTitle({ className, ...props }) {
|
|
63
|
+
return /* @__PURE__ */ jsx("div", {
|
|
64
|
+
"data-slot": "field-label",
|
|
65
|
+
className: cn("flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50", className),
|
|
66
|
+
...props
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
function FieldDescription({ className, ...props }) {
|
|
70
|
+
return /* @__PURE__ */ jsx("p", {
|
|
71
|
+
"data-slot": "field-description",
|
|
72
|
+
className: cn("text-left text-sm leading-normal font-normal text-muted-foreground group-has-data-horizontal/field:text-balance [[data-variant=legend]+&]:-mt-1.5", "last:mt-0 nth-last-2:-mt-1", "[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary", className),
|
|
73
|
+
...props
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
function FieldSeparator({ children, className, ...props }) {
|
|
77
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
78
|
+
"data-slot": "field-separator",
|
|
79
|
+
"data-content": !!children,
|
|
80
|
+
className: cn("relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2", className),
|
|
81
|
+
...props,
|
|
82
|
+
children: [/* @__PURE__ */ jsx(Separator, { className: "absolute inset-0 top-1/2" }), children && /* @__PURE__ */ jsx("span", {
|
|
83
|
+
className: "relative mx-auto block w-fit bg-background px-2 text-muted-foreground",
|
|
84
|
+
"data-slot": "field-separator-content",
|
|
85
|
+
children
|
|
86
|
+
})]
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
function FieldError({ className, children, errors, ...props }) {
|
|
90
|
+
const content = useMemo(() => {
|
|
91
|
+
if (children) return children;
|
|
92
|
+
if (!errors?.length) return null;
|
|
93
|
+
const uniqueErrors = [...new Map(errors.map((error) => [error?.message, error])).values()];
|
|
94
|
+
if (uniqueErrors?.length == 1) return uniqueErrors[0]?.message;
|
|
95
|
+
return /* @__PURE__ */ jsx("ul", {
|
|
96
|
+
className: "ml-4 flex list-disc flex-col gap-1",
|
|
97
|
+
children: uniqueErrors.map((error, index) => error?.message && /* @__PURE__ */ jsx("li", { children: error.message }, index))
|
|
98
|
+
});
|
|
99
|
+
}, [children, errors]);
|
|
100
|
+
if (!content) return null;
|
|
101
|
+
return /* @__PURE__ */ jsx("div", {
|
|
102
|
+
role: "alert",
|
|
103
|
+
"data-slot": "field-error",
|
|
104
|
+
className: cn("text-sm font-normal text-destructive", className),
|
|
105
|
+
...props,
|
|
106
|
+
children: content
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
//#endregion
|
|
110
|
+
export { Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { HoverCard } from "radix-ui";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region src/components/hover-card.d.ts
|
|
6
|
+
declare function HoverCard$1({
|
|
7
|
+
...props
|
|
8
|
+
}: React.ComponentProps<typeof HoverCard.Root>): _$react_jsx_runtime0.JSX.Element;
|
|
9
|
+
declare function HoverCardTrigger({
|
|
10
|
+
...props
|
|
11
|
+
}: React.ComponentProps<typeof HoverCard.Trigger>): _$react_jsx_runtime0.JSX.Element;
|
|
12
|
+
declare function HoverCardContent({
|
|
13
|
+
className,
|
|
14
|
+
align,
|
|
15
|
+
sideOffset,
|
|
16
|
+
container,
|
|
17
|
+
...props
|
|
18
|
+
}: React.ComponentProps<typeof HoverCard.Content> & {
|
|
19
|
+
container?: Element | DocumentFragment | null;
|
|
20
|
+
}): _$react_jsx_runtime0.JSX.Element;
|
|
21
|
+
//#endregion
|
|
22
|
+
export { HoverCard$1 as HoverCard, HoverCardContent, HoverCardTrigger };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/utils.mjs";
|
|
3
|
+
import { HoverCard } from "radix-ui";
|
|
4
|
+
import "react";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/hover-card.tsx
|
|
7
|
+
function HoverCard$1({ ...props }) {
|
|
8
|
+
return /* @__PURE__ */ jsx(HoverCard.Root, {
|
|
9
|
+
"data-slot": "hover-card",
|
|
10
|
+
...props
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
function HoverCardTrigger({ ...props }) {
|
|
14
|
+
return /* @__PURE__ */ jsx(HoverCard.Trigger, {
|
|
15
|
+
"data-slot": "hover-card-trigger",
|
|
16
|
+
...props
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
function HoverCardContent({ className, align = "center", sideOffset = 4, container, ...props }) {
|
|
20
|
+
return /* @__PURE__ */ jsx(HoverCard.Portal, {
|
|
21
|
+
"data-slot": "hover-card-portal",
|
|
22
|
+
container,
|
|
23
|
+
children: /* @__PURE__ */ jsx(HoverCard.Content, {
|
|
24
|
+
"data-slot": "hover-card-content",
|
|
25
|
+
align,
|
|
26
|
+
sideOffset,
|
|
27
|
+
className: cn("z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-lg bg-popover p-4 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 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 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className),
|
|
28
|
+
...props
|
|
29
|
+
})
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
33
|
+
export { HoverCard$1 as HoverCard, HoverCardContent, HoverCardTrigger };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Button } from "./button.mjs";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
|
+
import { VariantProps } from "class-variance-authority";
|
|
5
|
+
import * as _$class_variance_authority_types0 from "class-variance-authority/types";
|
|
6
|
+
|
|
7
|
+
//#region src/components/input-group.d.ts
|
|
8
|
+
declare function InputGroup({
|
|
9
|
+
className,
|
|
10
|
+
...props
|
|
11
|
+
}: React.ComponentProps<'div'>): _$react_jsx_runtime0.JSX.Element;
|
|
12
|
+
declare const inputGroupAddonVariants: (props?: ({
|
|
13
|
+
align?: "inline-start" | "inline-end" | "block-start" | "block-end" | null | undefined;
|
|
14
|
+
} & _$class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
15
|
+
declare function InputGroupAddon({
|
|
16
|
+
className,
|
|
17
|
+
align,
|
|
18
|
+
...props
|
|
19
|
+
}: React.ComponentProps<'div'> & VariantProps<typeof inputGroupAddonVariants>): _$react_jsx_runtime0.JSX.Element;
|
|
20
|
+
declare const inputGroupButtonVariants: (props?: ({
|
|
21
|
+
size?: "xs" | "sm" | "icon-xs" | "icon-sm" | null | undefined;
|
|
22
|
+
} & _$class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
23
|
+
declare function InputGroupButton({
|
|
24
|
+
className,
|
|
25
|
+
type,
|
|
26
|
+
variant,
|
|
27
|
+
size,
|
|
28
|
+
...props
|
|
29
|
+
}: Omit<React.ComponentProps<typeof Button>, 'size'> & VariantProps<typeof inputGroupButtonVariants>): _$react_jsx_runtime0.JSX.Element;
|
|
30
|
+
declare function InputGroupText({
|
|
31
|
+
className,
|
|
32
|
+
...props
|
|
33
|
+
}: React.ComponentProps<'span'>): _$react_jsx_runtime0.JSX.Element;
|
|
34
|
+
declare function InputGroupInput({
|
|
35
|
+
className,
|
|
36
|
+
...props
|
|
37
|
+
}: React.ComponentProps<'input'>): _$react_jsx_runtime0.JSX.Element;
|
|
38
|
+
declare function InputGroupTextarea({
|
|
39
|
+
className,
|
|
40
|
+
...props
|
|
41
|
+
}: React.ComponentProps<'textarea'>): _$react_jsx_runtime0.JSX.Element;
|
|
42
|
+
//#endregion
|
|
43
|
+
export { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea };
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/utils.mjs";
|
|
3
|
+
import { Button } from "./button.mjs";
|
|
4
|
+
import { Input } from "./input.mjs";
|
|
5
|
+
import { Textarea } from "./textarea.mjs";
|
|
6
|
+
import "react";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
import { cva } from "class-variance-authority";
|
|
9
|
+
//#region src/components/input-group.tsx
|
|
10
|
+
function InputGroup({ className, ...props }) {
|
|
11
|
+
return /* @__PURE__ */ jsx("div", {
|
|
12
|
+
"data-slot": "input-group",
|
|
13
|
+
role: "group",
|
|
14
|
+
className: cn("group/input-group relative flex h-9 w-full min-w-0 items-center rounded-md border border-input shadow-xs transition-[color,box-shadow] outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5", className),
|
|
15
|
+
...props
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
const inputGroupAddonVariants = cva("flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4", {
|
|
19
|
+
variants: { align: {
|
|
20
|
+
"inline-start": "order-first pl-2 has-[>button]:-ml-1 has-[>kbd]:ml-[-0.15rem]",
|
|
21
|
+
"inline-end": "order-last pr-2 has-[>button]:-mr-1 has-[>kbd]:mr-[-0.15rem]",
|
|
22
|
+
"block-start": "order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2",
|
|
23
|
+
"block-end": "order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2"
|
|
24
|
+
} },
|
|
25
|
+
defaultVariants: { align: "inline-start" }
|
|
26
|
+
});
|
|
27
|
+
function InputGroupAddon({ className, align = "inline-start", ...props }) {
|
|
28
|
+
return /* @__PURE__ */ jsx("div", {
|
|
29
|
+
role: "group",
|
|
30
|
+
"data-slot": "input-group-addon",
|
|
31
|
+
"data-align": align,
|
|
32
|
+
className: cn(inputGroupAddonVariants({ align }), className),
|
|
33
|
+
onClick: (e) => {
|
|
34
|
+
if (e.target.closest("button")) return;
|
|
35
|
+
e.currentTarget.parentElement?.querySelector("input")?.focus();
|
|
36
|
+
},
|
|
37
|
+
...props
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
const inputGroupButtonVariants = cva("flex items-center gap-2 text-sm shadow-none", {
|
|
41
|
+
variants: { size: {
|
|
42
|
+
xs: "h-6 gap-1 rounded-[calc(var(--radius)-5px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5",
|
|
43
|
+
sm: "",
|
|
44
|
+
"icon-xs": "size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0",
|
|
45
|
+
"icon-sm": "size-8 p-0 has-[>svg]:p-0"
|
|
46
|
+
} },
|
|
47
|
+
defaultVariants: { size: "xs" }
|
|
48
|
+
});
|
|
49
|
+
function InputGroupButton({ className, type = "button", variant = "ghost", size = "xs", ...props }) {
|
|
50
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
51
|
+
type,
|
|
52
|
+
"data-size": size,
|
|
53
|
+
variant,
|
|
54
|
+
className: cn(inputGroupButtonVariants({ size }), className),
|
|
55
|
+
...props
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
function InputGroupText({ className, ...props }) {
|
|
59
|
+
return /* @__PURE__ */ jsx("span", {
|
|
60
|
+
className: cn("flex items-center gap-2 text-sm text-muted-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4", className),
|
|
61
|
+
...props
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
function InputGroupInput({ className, ...props }) {
|
|
65
|
+
return /* @__PURE__ */ jsx(Input, {
|
|
66
|
+
"data-slot": "input-group-control",
|
|
67
|
+
className: cn("flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 aria-invalid:ring-0 dark:bg-transparent", className),
|
|
68
|
+
...props
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
function InputGroupTextarea({ className, ...props }) {
|
|
72
|
+
return /* @__PURE__ */ jsx(Textarea, {
|
|
73
|
+
"data-slot": "input-group-control",
|
|
74
|
+
className: cn("flex-1 resize-none rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:ring-0 aria-invalid:ring-0 dark:bg-transparent", className),
|
|
75
|
+
...props
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
//#endregion
|
|
79
|
+
export { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea };
|