@thalamiq/ui 0.1.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/README.md +29 -0
- package/dist/components/accordion.d.mts +10 -0
- package/dist/components/accordion.d.ts +10 -0
- package/dist/components/accordion.js +148 -0
- package/dist/components/accordion.js.map +1 -0
- package/dist/components/accordion.mjs +113 -0
- package/dist/components/accordion.mjs.map +1 -0
- package/dist/components/alert-dialog.d.mts +17 -0
- package/dist/components/alert-dialog.d.ts +17 -0
- package/dist/components/alert-dialog.js +264 -0
- package/dist/components/alert-dialog.js.map +1 -0
- package/dist/components/alert-dialog.mjs +222 -0
- package/dist/components/alert-dialog.mjs.map +1 -0
- package/dist/components/alert.d.mts +13 -0
- package/dist/components/alert.d.ts +13 -0
- package/dist/components/alert.js +133 -0
- package/dist/components/alert.js.map +1 -0
- package/dist/components/alert.mjs +109 -0
- package/dist/components/alert.mjs.map +1 -0
- package/dist/components/aspect-ratio.d.mts +6 -0
- package/dist/components/aspect-ratio.d.ts +6 -0
- package/dist/components/aspect-ratio.js +74 -0
- package/dist/components/aspect-ratio.js.map +1 -0
- package/dist/components/aspect-ratio.mjs +42 -0
- package/dist/components/aspect-ratio.mjs.map +1 -0
- package/dist/components/avatar.d.mts +9 -0
- package/dist/components/avatar.d.ts +9 -0
- package/dist/components/avatar.js +130 -0
- package/dist/components/avatar.js.map +1 -0
- package/dist/components/avatar.mjs +96 -0
- package/dist/components/avatar.mjs.map +1 -0
- package/dist/components/badge.d.mts +13 -0
- package/dist/components/badge.d.ts +13 -0
- package/dist/components/badge.js +106 -0
- package/dist/components/badge.js.map +1 -0
- package/dist/components/badge.mjs +83 -0
- package/dist/components/badge.mjs.map +1 -0
- package/dist/components/breadcrumb.d.mts +14 -0
- package/dist/components/breadcrumb.d.ts +14 -0
- package/dist/components/breadcrumb.js +182 -0
- package/dist/components/breadcrumb.js.map +1 -0
- package/dist/components/breadcrumb.mjs +154 -0
- package/dist/components/breadcrumb.mjs.map +1 -0
- package/dist/components/button-group.d.mts +17 -0
- package/dist/components/button-group.d.ts +17 -0
- package/dist/components/button-group.js +183 -0
- package/dist/components/button-group.js.map +1 -0
- package/dist/components/button-group.mjs +148 -0
- package/dist/components/button-group.mjs.map +1 -0
- package/dist/components/button.d.mts +14 -0
- package/dist/components/button.d.ts +14 -0
- package/dist/components/button.js +119 -0
- package/dist/components/button.js.map +1 -0
- package/dist/components/button.mjs +96 -0
- package/dist/components/button.mjs.map +1 -0
- package/dist/components/calendar.d.mts +13 -0
- package/dist/components/calendar.d.ts +13 -0
- package/dist/components/calendar.js +324 -0
- package/dist/components/calendar.js.map +1 -0
- package/dist/components/calendar.mjs +295 -0
- package/dist/components/calendar.mjs.map +1 -0
- package/dist/components/card.d.mts +12 -0
- package/dist/components/card.d.ts +12 -0
- package/dist/components/card.js +158 -0
- package/dist/components/card.js.map +1 -0
- package/dist/components/card.mjs +128 -0
- package/dist/components/card.mjs.map +1 -0
- package/dist/components/carousel.d.mts +24 -0
- package/dist/components/carousel.d.ts +24 -0
- package/dist/components/carousel.js +343 -0
- package/dist/components/carousel.js.map +1 -0
- package/dist/components/carousel.mjs +307 -0
- package/dist/components/carousel.mjs.map +1 -0
- package/dist/components/chart.d.mts +43 -0
- package/dist/components/chart.d.ts +43 -0
- package/dist/components/chart.js +330 -0
- package/dist/components/chart.js.map +1 -0
- package/dist/components/chart.mjs +293 -0
- package/dist/components/chart.mjs.map +1 -0
- package/dist/components/checkbox.d.mts +7 -0
- package/dist/components/checkbox.d.ts +7 -0
- package/dist/components/checkbox.js +109 -0
- package/dist/components/checkbox.js.map +1 -0
- package/dist/components/checkbox.mjs +77 -0
- package/dist/components/checkbox.mjs.map +1 -0
- package/dist/components/collapsible.d.mts +8 -0
- package/dist/components/collapsible.d.ts +8 -0
- package/dist/components/collapsible.js +95 -0
- package/dist/components/collapsible.js.map +1 -0
- package/dist/components/collapsible.mjs +61 -0
- package/dist/components/collapsible.mjs.map +1 -0
- package/dist/components/command.d.mts +22 -0
- package/dist/components/command.d.ts +22 -0
- package/dist/components/command.js +370 -0
- package/dist/components/command.js.map +1 -0
- package/dist/components/command.mjs +330 -0
- package/dist/components/command.mjs.map +1 -0
- package/dist/components/context-menu.d.mts +28 -0
- package/dist/components/context-menu.d.ts +28 -0
- package/dist/components/context-menu.js +326 -0
- package/dist/components/context-menu.js.map +1 -0
- package/dist/components/context-menu.mjs +280 -0
- package/dist/components/context-menu.mjs.map +1 -0
- package/dist/components/dialog.d.mts +18 -0
- package/dist/components/dialog.d.ts +18 -0
- package/dist/components/dialog.js +223 -0
- package/dist/components/dialog.js.map +1 -0
- package/dist/components/dialog.mjs +182 -0
- package/dist/components/dialog.mjs.map +1 -0
- package/dist/components/drawer.d.mts +16 -0
- package/dist/components/drawer.d.ts +16 -0
- package/dist/components/drawer.js +205 -0
- package/dist/components/drawer.js.map +1 -0
- package/dist/components/drawer.mjs +174 -0
- package/dist/components/drawer.mjs.map +1 -0
- package/dist/components/dropdown-menu.d.mts +28 -0
- package/dist/components/dropdown-menu.d.ts +28 -0
- package/dist/components/dropdown-menu.js +333 -0
- package/dist/components/dropdown-menu.js.map +1 -0
- package/dist/components/dropdown-menu.mjs +287 -0
- package/dist/components/dropdown-menu.mjs.map +1 -0
- package/dist/components/empty.d.mts +15 -0
- package/dist/components/empty.d.ts +15 -0
- package/dist/components/empty.js +171 -0
- package/dist/components/empty.js.map +1 -0
- package/dist/components/empty.mjs +144 -0
- package/dist/components/empty.mjs.map +1 -0
- package/dist/components/field.d.mts +30 -0
- package/dist/components/field.d.ts +30 -0
- package/dist/components/field.js +372 -0
- package/dist/components/field.js.map +1 -0
- package/dist/components/field.mjs +331 -0
- package/dist/components/field.mjs.map +1 -0
- package/dist/components/form.d.mts +28 -0
- package/dist/components/form.d.ts +28 -0
- package/dist/components/form.js +220 -0
- package/dist/components/form.js.map +1 -0
- package/dist/components/form.mjs +186 -0
- package/dist/components/form.mjs.map +1 -0
- package/dist/components/hover-card.d.mts +9 -0
- package/dist/components/hover-card.d.ts +9 -0
- package/dist/components/hover-card.js +114 -0
- package/dist/components/hover-card.js.map +1 -0
- package/dist/components/hover-card.mjs +80 -0
- package/dist/components/hover-card.mjs.map +1 -0
- package/dist/components/input-group.d.mts +20 -0
- package/dist/components/input-group.d.ts +20 -0
- package/dist/components/input-group.js +316 -0
- package/dist/components/input-group.js.map +1 -0
- package/dist/components/input-group.mjs +289 -0
- package/dist/components/input-group.mjs.map +1 -0
- package/dist/components/input-otp.d.mts +14 -0
- package/dist/components/input-otp.d.ts +14 -0
- package/dist/components/input-otp.js +151 -0
- package/dist/components/input-otp.js.map +1 -0
- package/dist/components/input-otp.mjs +116 -0
- package/dist/components/input-otp.mjs.map +1 -0
- package/dist/components/input.d.mts +6 -0
- package/dist/components/input.d.ts +6 -0
- package/dist/components/input.js +83 -0
- package/dist/components/input.js.map +1 -0
- package/dist/components/input.mjs +59 -0
- package/dist/components/input.mjs.map +1 -0
- package/dist/components/item.d.mts +28 -0
- package/dist/components/item.d.ts +28 -0
- package/dist/components/item.js +301 -0
- package/dist/components/item.js.map +1 -0
- package/dist/components/item.mjs +260 -0
- package/dist/components/item.mjs.map +1 -0
- package/dist/components/kbd.d.mts +6 -0
- package/dist/components/kbd.d.ts +6 -0
- package/dist/components/kbd.js +94 -0
- package/dist/components/kbd.js.map +1 -0
- package/dist/components/kbd.mjs +69 -0
- package/dist/components/kbd.mjs.map +1 -0
- package/dist/components/label.d.mts +7 -0
- package/dist/components/label.d.ts +7 -0
- package/dist/components/label.js +96 -0
- package/dist/components/label.js.map +1 -0
- package/dist/components/label.mjs +64 -0
- package/dist/components/label.mjs.map +1 -0
- package/dist/components/menubar.d.mts +29 -0
- package/dist/components/menubar.d.ts +29 -0
- package/dist/components/menubar.js +361 -0
- package/dist/components/menubar.js.map +1 -0
- package/dist/components/menubar.mjs +314 -0
- package/dist/components/menubar.mjs.map +1 -0
- package/dist/components/navigation-menu.d.mts +18 -0
- package/dist/components/navigation-menu.d.ts +18 -0
- package/dist/components/navigation-menu.js +267 -0
- package/dist/components/navigation-menu.js.map +1 -0
- package/dist/components/navigation-menu.mjs +227 -0
- package/dist/components/navigation-menu.mjs.map +1 -0
- package/dist/components/pagination.d.mts +18 -0
- package/dist/components/pagination.d.ts +18 -0
- package/dist/components/pagination.js +231 -0
- package/dist/components/pagination.js.map +1 -0
- package/dist/components/pagination.mjs +207 -0
- package/dist/components/pagination.mjs.map +1 -0
- package/dist/components/popover.d.mts +10 -0
- package/dist/components/popover.d.ts +10 -0
- package/dist/components/popover.js +120 -0
- package/dist/components/popover.js.map +1 -0
- package/dist/components/popover.mjs +85 -0
- package/dist/components/popover.mjs.map +1 -0
- package/dist/components/progress.d.mts +7 -0
- package/dist/components/progress.d.ts +7 -0
- package/dist/components/progress.js +109 -0
- package/dist/components/progress.js.map +1 -0
- package/dist/components/progress.mjs +77 -0
- package/dist/components/progress.mjs.map +1 -0
- package/dist/components/radio-group.d.mts +8 -0
- package/dist/components/radio-group.d.ts +8 -0
- package/dist/components/radio-group.js +125 -0
- package/dist/components/radio-group.js.map +1 -0
- package/dist/components/radio-group.mjs +92 -0
- package/dist/components/radio-group.mjs.map +1 -0
- package/dist/components/resizable.d.mts +11 -0
- package/dist/components/resizable.d.ts +11 -0
- package/dist/components/resizable.js +128 -0
- package/dist/components/resizable.js.map +1 -0
- package/dist/components/resizable.mjs +94 -0
- package/dist/components/resizable.mjs.map +1 -0
- package/dist/components/scroll-area.d.mts +8 -0
- package/dist/components/scroll-area.d.ts +8 -0
- package/dist/components/scroll-area.js +143 -0
- package/dist/components/scroll-area.js.map +1 -0
- package/dist/components/scroll-area.mjs +110 -0
- package/dist/components/scroll-area.mjs.map +1 -0
- package/dist/components/select.d.mts +18 -0
- package/dist/components/select.d.ts +18 -0
- package/dist/components/select.js +270 -0
- package/dist/components/select.js.map +1 -0
- package/dist/components/select.mjs +229 -0
- package/dist/components/select.mjs.map +1 -0
- package/dist/components/separator.d.mts +7 -0
- package/dist/components/separator.d.ts +7 -0
- package/dist/components/separator.js +102 -0
- package/dist/components/separator.js.map +1 -0
- package/dist/components/separator.mjs +70 -0
- package/dist/components/separator.mjs.map +1 -0
- package/dist/components/sheet.d.mts +16 -0
- package/dist/components/sheet.d.ts +16 -0
- package/dist/components/sheet.js +213 -0
- package/dist/components/sheet.js.map +1 -0
- package/dist/components/sheet.mjs +174 -0
- package/dist/components/sheet.mjs.map +1 -0
- package/dist/components/sidebar.d.mts +75 -0
- package/dist/components/sidebar.d.ts +75 -0
- package/dist/components/sidebar.js +1055 -0
- package/dist/components/sidebar.js.map +1 -0
- package/dist/components/sidebar.mjs +1000 -0
- package/dist/components/sidebar.mjs.map +1 -0
- package/dist/components/skeleton.d.mts +5 -0
- package/dist/components/skeleton.d.ts +5 -0
- package/dist/components/skeleton.js +77 -0
- package/dist/components/skeleton.js.map +1 -0
- package/dist/components/skeleton.mjs +53 -0
- package/dist/components/skeleton.mjs.map +1 -0
- package/dist/components/slider.d.mts +7 -0
- package/dist/components/slider.d.ts +7 -0
- package/dist/components/slider.js +145 -0
- package/dist/components/slider.js.map +1 -0
- package/dist/components/slider.mjs +113 -0
- package/dist/components/slider.mjs.map +1 -0
- package/dist/components/sonner.d.mts +6 -0
- package/dist/components/sonner.d.ts +6 -0
- package/dist/components/sonner.js +85 -0
- package/dist/components/sonner.js.map +1 -0
- package/dist/components/sonner.mjs +69 -0
- package/dist/components/sonner.mjs.map +1 -0
- package/dist/components/spinner.d.mts +5 -0
- package/dist/components/spinner.d.ts +5 -0
- package/dist/components/spinner.js +79 -0
- package/dist/components/spinner.js.map +1 -0
- package/dist/components/spinner.mjs +57 -0
- package/dist/components/spinner.mjs.map +1 -0
- package/dist/components/switch.d.mts +7 -0
- package/dist/components/switch.d.ts +7 -0
- package/dist/components/switch.js +109 -0
- package/dist/components/switch.js.map +1 -0
- package/dist/components/switch.mjs +77 -0
- package/dist/components/switch.mjs.map +1 -0
- package/dist/components/table.d.mts +13 -0
- package/dist/components/table.d.ts +13 -0
- package/dist/components/table.js +184 -0
- package/dist/components/table.js.map +1 -0
- package/dist/components/table.mjs +153 -0
- package/dist/components/table.mjs.map +1 -0
- package/dist/components/tabs.d.mts +10 -0
- package/dist/components/tabs.d.ts +10 -0
- package/dist/components/tabs.js +147 -0
- package/dist/components/tabs.js.map +1 -0
- package/dist/components/tabs.mjs +112 -0
- package/dist/components/tabs.mjs.map +1 -0
- package/dist/components/textarea.d.mts +6 -0
- package/dist/components/textarea.d.ts +6 -0
- package/dist/components/textarea.js +80 -0
- package/dist/components/textarea.js.map +1 -0
- package/dist/components/textarea.mjs +56 -0
- package/dist/components/textarea.mjs.map +1 -0
- package/dist/components/toggle-group.d.mts +14 -0
- package/dist/components/toggle-group.d.ts +14 -0
- package/dist/components/toggle-group.js +179 -0
- package/dist/components/toggle-group.js.map +1 -0
- package/dist/components/toggle-group.mjs +146 -0
- package/dist/components/toggle-group.mjs.map +1 -0
- package/dist/components/toggle.d.mts +13 -0
- package/dist/components/toggle.d.ts +13 -0
- package/dist/components/toggle.js +119 -0
- package/dist/components/toggle.js.map +1 -0
- package/dist/components/toggle.mjs +86 -0
- package/dist/components/toggle.mjs.map +1 -0
- package/dist/components/tooltip.d.mts +10 -0
- package/dist/components/tooltip.d.ts +10 -0
- package/dist/components/tooltip.js +137 -0
- package/dist/components/tooltip.js.map +1 -0
- package/dist/components/tooltip.mjs +102 -0
- package/dist/components/tooltip.mjs.map +1 -0
- package/dist/hooks/use-mobile.d.mts +3 -0
- package/dist/hooks/use-mobile.d.ts +3 -0
- package/dist/hooks/use-mobile.js +56 -0
- package/dist/hooks/use-mobile.js.map +1 -0
- package/dist/hooks/use-mobile.mjs +22 -0
- package/dist/hooks/use-mobile.mjs.map +1 -0
- package/dist/styles/globals.css +230 -0
- package/dist/utils/utils.d.mts +5 -0
- package/dist/utils/utils.d.ts +5 -0
- package/dist/utils/utils.js +36 -0
- package/dist/utils/utils.js.map +1 -0
- package/dist/utils/utils.mjs +12 -0
- package/dist/utils/utils.mjs.map +1 -0
- package/package.json +393 -0
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __defProps = Object.defineProperties;
|
|
5
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
9
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
10
|
+
var __spreadValues = (a, b) => {
|
|
11
|
+
for (var prop in b || (b = {}))
|
|
12
|
+
if (__hasOwnProp.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
if (__getOwnPropSymbols)
|
|
15
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
16
|
+
if (__propIsEnum.call(b, prop))
|
|
17
|
+
__defNormalProp(a, prop, b[prop]);
|
|
18
|
+
}
|
|
19
|
+
return a;
|
|
20
|
+
};
|
|
21
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
22
|
+
var __objRest = (source, exclude) => {
|
|
23
|
+
var target = {};
|
|
24
|
+
for (var prop in source)
|
|
25
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
26
|
+
target[prop] = source[prop];
|
|
27
|
+
if (source != null && __getOwnPropSymbols)
|
|
28
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
29
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
30
|
+
target[prop] = source[prop];
|
|
31
|
+
}
|
|
32
|
+
return target;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
// lib/components/form.tsx
|
|
36
|
+
import * as React from "react";
|
|
37
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
38
|
+
import {
|
|
39
|
+
Controller,
|
|
40
|
+
FormProvider,
|
|
41
|
+
useFormContext,
|
|
42
|
+
useFormState
|
|
43
|
+
} from "react-hook-form";
|
|
44
|
+
|
|
45
|
+
// lib/utils/utils.ts
|
|
46
|
+
import { clsx } from "clsx";
|
|
47
|
+
import { twMerge } from "tailwind-merge";
|
|
48
|
+
function cn(...inputs) {
|
|
49
|
+
return twMerge(clsx(inputs));
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// lib/components/label.tsx
|
|
53
|
+
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
54
|
+
import { jsx } from "react/jsx-runtime";
|
|
55
|
+
function Label(_a) {
|
|
56
|
+
var _b = _a, {
|
|
57
|
+
className
|
|
58
|
+
} = _b, props = __objRest(_b, [
|
|
59
|
+
"className"
|
|
60
|
+
]);
|
|
61
|
+
return /* @__PURE__ */ jsx(
|
|
62
|
+
LabelPrimitive.Root,
|
|
63
|
+
__spreadValues({
|
|
64
|
+
"data-slot": "label",
|
|
65
|
+
className: cn(
|
|
66
|
+
"flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
|
|
67
|
+
className
|
|
68
|
+
)
|
|
69
|
+
}, props)
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// lib/components/form.tsx
|
|
74
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
75
|
+
var Form = FormProvider;
|
|
76
|
+
var FormFieldContext = React.createContext(
|
|
77
|
+
{}
|
|
78
|
+
);
|
|
79
|
+
var FormField = (_a) => {
|
|
80
|
+
var props = __objRest(_a, []);
|
|
81
|
+
return /* @__PURE__ */ jsx2(FormFieldContext.Provider, { value: { name: props.name }, children: /* @__PURE__ */ jsx2(Controller, __spreadValues({}, props)) });
|
|
82
|
+
};
|
|
83
|
+
var useFormField = () => {
|
|
84
|
+
const fieldContext = React.useContext(FormFieldContext);
|
|
85
|
+
const itemContext = React.useContext(FormItemContext);
|
|
86
|
+
const { getFieldState } = useFormContext();
|
|
87
|
+
const formState = useFormState({ name: fieldContext.name });
|
|
88
|
+
const fieldState = getFieldState(fieldContext.name, formState);
|
|
89
|
+
if (!fieldContext) {
|
|
90
|
+
throw new Error("useFormField should be used within <FormField>");
|
|
91
|
+
}
|
|
92
|
+
const { id } = itemContext;
|
|
93
|
+
return __spreadValues({
|
|
94
|
+
id,
|
|
95
|
+
name: fieldContext.name,
|
|
96
|
+
formItemId: `${id}-form-item`,
|
|
97
|
+
formDescriptionId: `${id}-form-item-description`,
|
|
98
|
+
formMessageId: `${id}-form-item-message`
|
|
99
|
+
}, fieldState);
|
|
100
|
+
};
|
|
101
|
+
var FormItemContext = React.createContext(
|
|
102
|
+
{}
|
|
103
|
+
);
|
|
104
|
+
function FormItem(_a) {
|
|
105
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
106
|
+
const id = React.useId();
|
|
107
|
+
return /* @__PURE__ */ jsx2(FormItemContext.Provider, { value: { id }, children: /* @__PURE__ */ jsx2(
|
|
108
|
+
"div",
|
|
109
|
+
__spreadValues({
|
|
110
|
+
"data-slot": "form-item",
|
|
111
|
+
className: cn("grid gap-2", className)
|
|
112
|
+
}, props)
|
|
113
|
+
) });
|
|
114
|
+
}
|
|
115
|
+
function FormLabel(_a) {
|
|
116
|
+
var _b = _a, {
|
|
117
|
+
className
|
|
118
|
+
} = _b, props = __objRest(_b, [
|
|
119
|
+
"className"
|
|
120
|
+
]);
|
|
121
|
+
const { error, formItemId } = useFormField();
|
|
122
|
+
return /* @__PURE__ */ jsx2(
|
|
123
|
+
Label,
|
|
124
|
+
__spreadValues({
|
|
125
|
+
"data-slot": "form-label",
|
|
126
|
+
"data-error": !!error,
|
|
127
|
+
className: cn("data-[error=true]:text-destructive", className),
|
|
128
|
+
htmlFor: formItemId
|
|
129
|
+
}, props)
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
function FormControl(_a) {
|
|
133
|
+
var props = __objRest(_a, []);
|
|
134
|
+
const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
|
|
135
|
+
return /* @__PURE__ */ jsx2(
|
|
136
|
+
Slot,
|
|
137
|
+
__spreadValues({
|
|
138
|
+
"data-slot": "form-control",
|
|
139
|
+
id: formItemId,
|
|
140
|
+
"aria-describedby": !error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`,
|
|
141
|
+
"aria-invalid": !!error
|
|
142
|
+
}, props)
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
function FormDescription(_a) {
|
|
146
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
147
|
+
const { formDescriptionId } = useFormField();
|
|
148
|
+
return /* @__PURE__ */ jsx2(
|
|
149
|
+
"p",
|
|
150
|
+
__spreadValues({
|
|
151
|
+
"data-slot": "form-description",
|
|
152
|
+
id: formDescriptionId,
|
|
153
|
+
className: cn("text-muted-foreground text-sm", className)
|
|
154
|
+
}, props)
|
|
155
|
+
);
|
|
156
|
+
}
|
|
157
|
+
function FormMessage(_a) {
|
|
158
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
159
|
+
var _a2;
|
|
160
|
+
const { error, formMessageId } = useFormField();
|
|
161
|
+
const body = error ? String((_a2 = error == null ? void 0 : error.message) != null ? _a2 : "") : props.children;
|
|
162
|
+
if (!body) {
|
|
163
|
+
return null;
|
|
164
|
+
}
|
|
165
|
+
return /* @__PURE__ */ jsx2(
|
|
166
|
+
"p",
|
|
167
|
+
__spreadProps(__spreadValues({
|
|
168
|
+
"data-slot": "form-message",
|
|
169
|
+
id: formMessageId,
|
|
170
|
+
className: cn("text-destructive text-sm", className)
|
|
171
|
+
}, props), {
|
|
172
|
+
children: body
|
|
173
|
+
})
|
|
174
|
+
);
|
|
175
|
+
}
|
|
176
|
+
export {
|
|
177
|
+
Form,
|
|
178
|
+
FormControl,
|
|
179
|
+
FormDescription,
|
|
180
|
+
FormField,
|
|
181
|
+
FormItem,
|
|
182
|
+
FormLabel,
|
|
183
|
+
FormMessage,
|
|
184
|
+
useFormField
|
|
185
|
+
};
|
|
186
|
+
//# sourceMappingURL=form.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../lib/components/form.tsx","../../lib/utils/utils.ts","../../lib/components/label.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport * as LabelPrimitive from \"@radix-ui/react-label\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport {\n Controller,\n FormProvider,\n useFormContext,\n useFormState,\n type ControllerProps,\n type FieldPath,\n type FieldValues,\n} from \"react-hook-form\"\n\nimport { cn } from \"../utils/utils\"\nimport { Label } from \"./label\"\n\nconst Form = FormProvider\n\ntype FormFieldContextValue<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n> = {\n name: TName\n}\n\nconst FormFieldContext = React.createContext<FormFieldContextValue>(\n {} as FormFieldContextValue\n)\n\nconst FormField = <\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n>({\n ...props\n}: ControllerProps<TFieldValues, TName>) => {\n return (\n <FormFieldContext.Provider value={{ name: props.name }}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n )\n}\n\nconst useFormField = () => {\n const fieldContext = React.useContext(FormFieldContext)\n const itemContext = React.useContext(FormItemContext)\n const { getFieldState } = useFormContext()\n const formState = useFormState({ name: fieldContext.name })\n const fieldState = getFieldState(fieldContext.name, formState)\n\n if (!fieldContext) {\n throw new Error(\"useFormField should be used within <FormField>\")\n }\n\n const { id } = itemContext\n\n return {\n id,\n name: fieldContext.name,\n formItemId: `${id}-form-item`,\n formDescriptionId: `${id}-form-item-description`,\n formMessageId: `${id}-form-item-message`,\n ...fieldState,\n }\n}\n\ntype FormItemContextValue = {\n id: string\n}\n\nconst FormItemContext = React.createContext<FormItemContextValue>(\n {} as FormItemContextValue\n)\n\nfunction FormItem({ className, ...props }: React.ComponentProps<\"div\">) {\n const id = React.useId()\n\n return (\n <FormItemContext.Provider value={{ id }}>\n <div\n data-slot=\"form-item\"\n className={cn(\"grid gap-2\", className)}\n {...props}\n />\n </FormItemContext.Provider>\n )\n}\n\nfunction FormLabel({\n className,\n ...props\n}: React.ComponentProps<typeof LabelPrimitive.Root>) {\n const { error, formItemId } = useFormField()\n\n return (\n <Label\n data-slot=\"form-label\"\n data-error={!!error}\n className={cn(\"data-[error=true]:text-destructive\", className)}\n htmlFor={formItemId}\n {...props}\n />\n )\n}\n\nfunction FormControl({ ...props }: React.ComponentProps<typeof Slot>) {\n const { error, formItemId, formDescriptionId, formMessageId } = useFormField()\n\n return (\n <Slot\n data-slot=\"form-control\"\n id={formItemId}\n aria-describedby={\n !error\n ? `${formDescriptionId}`\n : `${formDescriptionId} ${formMessageId}`\n }\n aria-invalid={!!error}\n {...props}\n />\n )\n}\n\nfunction FormDescription({ className, ...props }: React.ComponentProps<\"p\">) {\n const { formDescriptionId } = useFormField()\n\n return (\n <p\n data-slot=\"form-description\"\n id={formDescriptionId}\n className={cn(\"text-muted-foreground text-sm\", className)}\n {...props}\n />\n )\n}\n\nfunction FormMessage({ className, ...props }: React.ComponentProps<\"p\">) {\n const { error, formMessageId } = useFormField()\n const body = error ? String(error?.message ?? \"\") : props.children\n\n if (!body) {\n return null\n }\n\n return (\n <p\n data-slot=\"form-message\"\n id={formMessageId}\n className={cn(\"text-destructive text-sm\", className)}\n {...props}\n >\n {body}\n </p>\n )\n}\n\nexport {\n useFormField,\n Form,\n FormItem,\n FormLabel,\n FormControl,\n FormDescription,\n FormMessage,\n FormField,\n}\n","import { clsx, type ClassValue } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}","\"use client\"\n\nimport * as React from \"react\"\nimport * as LabelPrimitive from \"@radix-ui/react-label\"\n\nimport { cn } from \"../utils/utils\"\n\nfunction Label({\n className,\n ...props\n}: React.ComponentProps<typeof LabelPrimitive.Root>) {\n return (\n <LabelPrimitive.Root\n data-slot=\"label\"\n className={cn(\n \"flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Label }\n"],"mappings":"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","names":["jsx","_a"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import * as HoverCardPrimitive from '@radix-ui/react-hover-card';
|
|
4
|
+
|
|
5
|
+
declare function HoverCard({ ...props }: React.ComponentProps<typeof HoverCardPrimitive.Root>): react_jsx_runtime.JSX.Element;
|
|
6
|
+
declare function HoverCardTrigger({ ...props }: React.ComponentProps<typeof HoverCardPrimitive.Trigger>): react_jsx_runtime.JSX.Element;
|
|
7
|
+
declare function HoverCardContent({ className, align, sideOffset, ...props }: React.ComponentProps<typeof HoverCardPrimitive.Content>): react_jsx_runtime.JSX.Element;
|
|
8
|
+
|
|
9
|
+
export { HoverCard, HoverCardContent, HoverCardTrigger };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import * as HoverCardPrimitive from '@radix-ui/react-hover-card';
|
|
4
|
+
|
|
5
|
+
declare function HoverCard({ ...props }: React.ComponentProps<typeof HoverCardPrimitive.Root>): react_jsx_runtime.JSX.Element;
|
|
6
|
+
declare function HoverCardTrigger({ ...props }: React.ComponentProps<typeof HoverCardPrimitive.Trigger>): react_jsx_runtime.JSX.Element;
|
|
7
|
+
declare function HoverCardContent({ className, align, sideOffset, ...props }: React.ComponentProps<typeof HoverCardPrimitive.Content>): react_jsx_runtime.JSX.Element;
|
|
8
|
+
|
|
9
|
+
export { HoverCard, HoverCardContent, HoverCardTrigger };
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
"use client";
|
|
4
|
+
var __create = Object.create;
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
9
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
10
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
11
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
12
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
13
|
+
var __spreadValues = (a, b) => {
|
|
14
|
+
for (var prop in b || (b = {}))
|
|
15
|
+
if (__hasOwnProp.call(b, prop))
|
|
16
|
+
__defNormalProp(a, prop, b[prop]);
|
|
17
|
+
if (__getOwnPropSymbols)
|
|
18
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
19
|
+
if (__propIsEnum.call(b, prop))
|
|
20
|
+
__defNormalProp(a, prop, b[prop]);
|
|
21
|
+
}
|
|
22
|
+
return a;
|
|
23
|
+
};
|
|
24
|
+
var __objRest = (source, exclude) => {
|
|
25
|
+
var target = {};
|
|
26
|
+
for (var prop in source)
|
|
27
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
28
|
+
target[prop] = source[prop];
|
|
29
|
+
if (source != null && __getOwnPropSymbols)
|
|
30
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
31
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
32
|
+
target[prop] = source[prop];
|
|
33
|
+
}
|
|
34
|
+
return target;
|
|
35
|
+
};
|
|
36
|
+
var __export = (target, all) => {
|
|
37
|
+
for (var name in all)
|
|
38
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
39
|
+
};
|
|
40
|
+
var __copyProps = (to, from, except, desc) => {
|
|
41
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
42
|
+
for (let key of __getOwnPropNames(from))
|
|
43
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
44
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
45
|
+
}
|
|
46
|
+
return to;
|
|
47
|
+
};
|
|
48
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
49
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
50
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
51
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
52
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
53
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
54
|
+
mod
|
|
55
|
+
));
|
|
56
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
57
|
+
|
|
58
|
+
// lib/components/hover-card.tsx
|
|
59
|
+
var hover_card_exports = {};
|
|
60
|
+
__export(hover_card_exports, {
|
|
61
|
+
HoverCard: () => HoverCard,
|
|
62
|
+
HoverCardContent: () => HoverCardContent,
|
|
63
|
+
HoverCardTrigger: () => HoverCardTrigger
|
|
64
|
+
});
|
|
65
|
+
module.exports = __toCommonJS(hover_card_exports);
|
|
66
|
+
var HoverCardPrimitive = __toESM(require("@radix-ui/react-hover-card"));
|
|
67
|
+
|
|
68
|
+
// lib/utils/utils.ts
|
|
69
|
+
var import_clsx = require("clsx");
|
|
70
|
+
var import_tailwind_merge = require("tailwind-merge");
|
|
71
|
+
function cn(...inputs) {
|
|
72
|
+
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// lib/components/hover-card.tsx
|
|
76
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
77
|
+
function HoverCard(_a) {
|
|
78
|
+
var props = __objRest(_a, []);
|
|
79
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(HoverCardPrimitive.Root, __spreadValues({ "data-slot": "hover-card" }, props));
|
|
80
|
+
}
|
|
81
|
+
function HoverCardTrigger(_a) {
|
|
82
|
+
var props = __objRest(_a, []);
|
|
83
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(HoverCardPrimitive.Trigger, __spreadValues({ "data-slot": "hover-card-trigger" }, props));
|
|
84
|
+
}
|
|
85
|
+
function HoverCardContent(_a) {
|
|
86
|
+
var _b = _a, {
|
|
87
|
+
className,
|
|
88
|
+
align = "center",
|
|
89
|
+
sideOffset = 4
|
|
90
|
+
} = _b, props = __objRest(_b, [
|
|
91
|
+
"className",
|
|
92
|
+
"align",
|
|
93
|
+
"sideOffset"
|
|
94
|
+
]);
|
|
95
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(HoverCardPrimitive.Portal, { "data-slot": "hover-card-portal", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
96
|
+
HoverCardPrimitive.Content,
|
|
97
|
+
__spreadValues({
|
|
98
|
+
"data-slot": "hover-card-content",
|
|
99
|
+
align,
|
|
100
|
+
sideOffset,
|
|
101
|
+
className: cn(
|
|
102
|
+
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",
|
|
103
|
+
className
|
|
104
|
+
)
|
|
105
|
+
}, props)
|
|
106
|
+
) });
|
|
107
|
+
}
|
|
108
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
109
|
+
0 && (module.exports = {
|
|
110
|
+
HoverCard,
|
|
111
|
+
HoverCardContent,
|
|
112
|
+
HoverCardTrigger
|
|
113
|
+
});
|
|
114
|
+
//# sourceMappingURL=hover-card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../lib/components/hover-card.tsx","../../lib/utils/utils.ts"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport * as HoverCardPrimitive from \"@radix-ui/react-hover-card\"\n\nimport { cn } from \"../utils/utils\"\n\nfunction HoverCard({\n ...props\n}: React.ComponentProps<typeof HoverCardPrimitive.Root>) {\n return <HoverCardPrimitive.Root data-slot=\"hover-card\" {...props} />\n}\n\nfunction HoverCardTrigger({\n ...props\n}: React.ComponentProps<typeof HoverCardPrimitive.Trigger>) {\n return (\n <HoverCardPrimitive.Trigger data-slot=\"hover-card-trigger\" {...props} />\n )\n}\n\nfunction HoverCardContent({\n className,\n align = \"center\",\n sideOffset = 4,\n ...props\n}: React.ComponentProps<typeof HoverCardPrimitive.Content>) {\n return (\n <HoverCardPrimitive.Portal data-slot=\"hover-card-portal\">\n <HoverCardPrimitive.Content\n data-slot=\"hover-card-content\"\n align={align}\n sideOffset={sideOffset}\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden\",\n className\n )}\n {...props}\n />\n </HoverCardPrimitive.Portal>\n )\n}\n\nexport { HoverCard, HoverCardTrigger, HoverCardContent }\n","import { clsx, type ClassValue } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,yBAAoC;;;ACHpC,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ADKS;AAHT,SAAS,UAAU,IAEsC;AAFtC,MACd,kBADc,IACd;AAEH,SAAO,4CAAoB,yBAAnB,iBAAwB,aAAU,gBAAiB,MAAO;AACpE;AAEA,SAAS,iBAAiB,IAEkC;AAFlC,MACrB,kBADqB,IACrB;AAEH,SACE,4CAAoB,4BAAnB,iBAA2B,aAAU,wBAAyB,MAAO;AAE1E;AAEA,SAAS,iBAAiB,IAKkC;AALlC,eACxB;AAAA;AAAA,IACA,QAAQ;AAAA,IACR,aAAa;AAAA,EAxBf,IAqB0B,IAIrB,kBAJqB,IAIrB;AAAA,IAHH;AAAA,IACA;AAAA,IACA;AAAA;AAGA,SACE,4CAAoB,2BAAnB,EAA0B,aAAU,qBACnC;AAAA,IAAoB;AAAA,IAAnB;AAAA,MACC,aAAU;AAAA,MACV;AAAA,MACA;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,OACI;AAAA,EACN,GACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __objRest = (source, exclude) => {
|
|
20
|
+
var target = {};
|
|
21
|
+
for (var prop in source)
|
|
22
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
23
|
+
target[prop] = source[prop];
|
|
24
|
+
if (source != null && __getOwnPropSymbols)
|
|
25
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
26
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
27
|
+
target[prop] = source[prop];
|
|
28
|
+
}
|
|
29
|
+
return target;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
// lib/components/hover-card.tsx
|
|
33
|
+
import * as HoverCardPrimitive from "@radix-ui/react-hover-card";
|
|
34
|
+
|
|
35
|
+
// lib/utils/utils.ts
|
|
36
|
+
import { clsx } from "clsx";
|
|
37
|
+
import { twMerge } from "tailwind-merge";
|
|
38
|
+
function cn(...inputs) {
|
|
39
|
+
return twMerge(clsx(inputs));
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// lib/components/hover-card.tsx
|
|
43
|
+
import { jsx } from "react/jsx-runtime";
|
|
44
|
+
function HoverCard(_a) {
|
|
45
|
+
var props = __objRest(_a, []);
|
|
46
|
+
return /* @__PURE__ */ jsx(HoverCardPrimitive.Root, __spreadValues({ "data-slot": "hover-card" }, props));
|
|
47
|
+
}
|
|
48
|
+
function HoverCardTrigger(_a) {
|
|
49
|
+
var props = __objRest(_a, []);
|
|
50
|
+
return /* @__PURE__ */ jsx(HoverCardPrimitive.Trigger, __spreadValues({ "data-slot": "hover-card-trigger" }, props));
|
|
51
|
+
}
|
|
52
|
+
function HoverCardContent(_a) {
|
|
53
|
+
var _b = _a, {
|
|
54
|
+
className,
|
|
55
|
+
align = "center",
|
|
56
|
+
sideOffset = 4
|
|
57
|
+
} = _b, props = __objRest(_b, [
|
|
58
|
+
"className",
|
|
59
|
+
"align",
|
|
60
|
+
"sideOffset"
|
|
61
|
+
]);
|
|
62
|
+
return /* @__PURE__ */ jsx(HoverCardPrimitive.Portal, { "data-slot": "hover-card-portal", children: /* @__PURE__ */ jsx(
|
|
63
|
+
HoverCardPrimitive.Content,
|
|
64
|
+
__spreadValues({
|
|
65
|
+
"data-slot": "hover-card-content",
|
|
66
|
+
align,
|
|
67
|
+
sideOffset,
|
|
68
|
+
className: cn(
|
|
69
|
+
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",
|
|
70
|
+
className
|
|
71
|
+
)
|
|
72
|
+
}, props)
|
|
73
|
+
) });
|
|
74
|
+
}
|
|
75
|
+
export {
|
|
76
|
+
HoverCard,
|
|
77
|
+
HoverCardContent,
|
|
78
|
+
HoverCardTrigger
|
|
79
|
+
};
|
|
80
|
+
//# sourceMappingURL=hover-card.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../lib/components/hover-card.tsx","../../lib/utils/utils.ts"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport * as HoverCardPrimitive from \"@radix-ui/react-hover-card\"\n\nimport { cn } from \"../utils/utils\"\n\nfunction HoverCard({\n ...props\n}: React.ComponentProps<typeof HoverCardPrimitive.Root>) {\n return <HoverCardPrimitive.Root data-slot=\"hover-card\" {...props} />\n}\n\nfunction HoverCardTrigger({\n ...props\n}: React.ComponentProps<typeof HoverCardPrimitive.Trigger>) {\n return (\n <HoverCardPrimitive.Trigger data-slot=\"hover-card-trigger\" {...props} />\n )\n}\n\nfunction HoverCardContent({\n className,\n align = \"center\",\n sideOffset = 4,\n ...props\n}: React.ComponentProps<typeof HoverCardPrimitive.Content>) {\n return (\n <HoverCardPrimitive.Portal data-slot=\"hover-card-portal\">\n <HoverCardPrimitive.Content\n data-slot=\"hover-card-content\"\n align={align}\n sideOffset={sideOffset}\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden\",\n className\n )}\n {...props}\n />\n </HoverCardPrimitive.Portal>\n )\n}\n\nexport { HoverCard, HoverCardTrigger, HoverCardContent }\n","import { clsx, type ClassValue } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,YAAY,wBAAwB;;;ACHpC,SAAS,YAA6B;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ADKS;AAHT,SAAS,UAAU,IAEsC;AAFtC,MACd,kBADc,IACd;AAEH,SAAO,oBAAoB,yBAAnB,iBAAwB,aAAU,gBAAiB,MAAO;AACpE;AAEA,SAAS,iBAAiB,IAEkC;AAFlC,MACrB,kBADqB,IACrB;AAEH,SACE,oBAAoB,4BAAnB,iBAA2B,aAAU,wBAAyB,MAAO;AAE1E;AAEA,SAAS,iBAAiB,IAKkC;AALlC,eACxB;AAAA;AAAA,IACA,QAAQ;AAAA,IACR,aAAa;AAAA,EAxBf,IAqB0B,IAIrB,kBAJqB,IAIrB;AAAA,IAHH;AAAA,IACA;AAAA,IACA;AAAA;AAGA,SACE,oBAAoB,2BAAnB,EAA0B,aAAU,qBACnC;AAAA,IAAoB;AAAA,IAAnB;AAAA,MACC,aAAU;AAAA,MACV;AAAA,MACA;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,OACI;AAAA,EACN,GACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
2
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { VariantProps } from 'class-variance-authority';
|
|
5
|
+
import { Button } from './button.mjs';
|
|
6
|
+
|
|
7
|
+
declare function InputGroup({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
8
|
+
declare const inputGroupAddonVariants: (props?: ({
|
|
9
|
+
align?: "inline-start" | "inline-end" | "block-start" | "block-end" | null | undefined;
|
|
10
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
11
|
+
declare function InputGroupAddon({ className, align, ...props }: React.ComponentProps<"div"> & VariantProps<typeof inputGroupAddonVariants>): react_jsx_runtime.JSX.Element;
|
|
12
|
+
declare const inputGroupButtonVariants: (props?: ({
|
|
13
|
+
size?: "sm" | "icon-sm" | "xs" | "icon-xs" | null | undefined;
|
|
14
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
15
|
+
declare function InputGroupButton({ className, type, variant, size, ...props }: Omit<React.ComponentProps<typeof Button>, "size"> & VariantProps<typeof inputGroupButtonVariants>): react_jsx_runtime.JSX.Element;
|
|
16
|
+
declare function InputGroupText({ className, ...props }: React.ComponentProps<"span">): react_jsx_runtime.JSX.Element;
|
|
17
|
+
declare function InputGroupInput({ className, ...props }: React.ComponentProps<"input">): react_jsx_runtime.JSX.Element;
|
|
18
|
+
declare function InputGroupTextarea({ className, ...props }: React.ComponentProps<"textarea">): react_jsx_runtime.JSX.Element;
|
|
19
|
+
|
|
20
|
+
export { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
2
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { VariantProps } from 'class-variance-authority';
|
|
5
|
+
import { Button } from './button.js';
|
|
6
|
+
|
|
7
|
+
declare function InputGroup({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
8
|
+
declare const inputGroupAddonVariants: (props?: ({
|
|
9
|
+
align?: "inline-start" | "inline-end" | "block-start" | "block-end" | null | undefined;
|
|
10
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
11
|
+
declare function InputGroupAddon({ className, align, ...props }: React.ComponentProps<"div"> & VariantProps<typeof inputGroupAddonVariants>): react_jsx_runtime.JSX.Element;
|
|
12
|
+
declare const inputGroupButtonVariants: (props?: ({
|
|
13
|
+
size?: "sm" | "icon-sm" | "xs" | "icon-xs" | null | undefined;
|
|
14
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
15
|
+
declare function InputGroupButton({ className, type, variant, size, ...props }: Omit<React.ComponentProps<typeof Button>, "size"> & VariantProps<typeof inputGroupButtonVariants>): react_jsx_runtime.JSX.Element;
|
|
16
|
+
declare function InputGroupText({ className, ...props }: React.ComponentProps<"span">): react_jsx_runtime.JSX.Element;
|
|
17
|
+
declare function InputGroupInput({ className, ...props }: React.ComponentProps<"input">): react_jsx_runtime.JSX.Element;
|
|
18
|
+
declare function InputGroupTextarea({ className, ...props }: React.ComponentProps<"textarea">): react_jsx_runtime.JSX.Element;
|
|
19
|
+
|
|
20
|
+
export { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea };
|