@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,331 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defProps = Object.defineProperties;
|
|
4
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
5
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
8
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9
|
+
var __spreadValues = (a, b) => {
|
|
10
|
+
for (var prop in b || (b = {}))
|
|
11
|
+
if (__hasOwnProp.call(b, prop))
|
|
12
|
+
__defNormalProp(a, prop, b[prop]);
|
|
13
|
+
if (__getOwnPropSymbols)
|
|
14
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
15
|
+
if (__propIsEnum.call(b, prop))
|
|
16
|
+
__defNormalProp(a, prop, b[prop]);
|
|
17
|
+
}
|
|
18
|
+
return a;
|
|
19
|
+
};
|
|
20
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
21
|
+
var __objRest = (source, exclude) => {
|
|
22
|
+
var target = {};
|
|
23
|
+
for (var prop in source)
|
|
24
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
25
|
+
target[prop] = source[prop];
|
|
26
|
+
if (source != null && __getOwnPropSymbols)
|
|
27
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
28
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
29
|
+
target[prop] = source[prop];
|
|
30
|
+
}
|
|
31
|
+
return target;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
// lib/components/field.tsx
|
|
35
|
+
import { useMemo } from "react";
|
|
36
|
+
import { cva } from "class-variance-authority";
|
|
37
|
+
|
|
38
|
+
// lib/utils/utils.ts
|
|
39
|
+
import { clsx } from "clsx";
|
|
40
|
+
import { twMerge } from "tailwind-merge";
|
|
41
|
+
function cn(...inputs) {
|
|
42
|
+
return twMerge(clsx(inputs));
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// lib/components/label.tsx
|
|
46
|
+
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
47
|
+
import { jsx } from "react/jsx-runtime";
|
|
48
|
+
function Label(_a) {
|
|
49
|
+
var _b = _a, {
|
|
50
|
+
className
|
|
51
|
+
} = _b, props = __objRest(_b, [
|
|
52
|
+
"className"
|
|
53
|
+
]);
|
|
54
|
+
return /* @__PURE__ */ jsx(
|
|
55
|
+
LabelPrimitive.Root,
|
|
56
|
+
__spreadValues({
|
|
57
|
+
"data-slot": "label",
|
|
58
|
+
className: cn(
|
|
59
|
+
"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",
|
|
60
|
+
className
|
|
61
|
+
)
|
|
62
|
+
}, props)
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// lib/components/separator.tsx
|
|
67
|
+
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
68
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
69
|
+
function Separator(_a) {
|
|
70
|
+
var _b = _a, {
|
|
71
|
+
className,
|
|
72
|
+
orientation = "horizontal",
|
|
73
|
+
decorative = true
|
|
74
|
+
} = _b, props = __objRest(_b, [
|
|
75
|
+
"className",
|
|
76
|
+
"orientation",
|
|
77
|
+
"decorative"
|
|
78
|
+
]);
|
|
79
|
+
return /* @__PURE__ */ jsx2(
|
|
80
|
+
SeparatorPrimitive.Root,
|
|
81
|
+
__spreadValues({
|
|
82
|
+
"data-slot": "separator",
|
|
83
|
+
decorative,
|
|
84
|
+
orientation,
|
|
85
|
+
className: cn(
|
|
86
|
+
"bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
|
|
87
|
+
className
|
|
88
|
+
)
|
|
89
|
+
}, props)
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// lib/components/field.tsx
|
|
94
|
+
import { jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
95
|
+
function FieldSet(_a) {
|
|
96
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
97
|
+
return /* @__PURE__ */ jsx3(
|
|
98
|
+
"fieldset",
|
|
99
|
+
__spreadValues({
|
|
100
|
+
"data-slot": "field-set",
|
|
101
|
+
className: cn(
|
|
102
|
+
"flex flex-col gap-6",
|
|
103
|
+
"has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3",
|
|
104
|
+
className
|
|
105
|
+
)
|
|
106
|
+
}, props)
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
function FieldLegend(_a) {
|
|
110
|
+
var _b = _a, {
|
|
111
|
+
className,
|
|
112
|
+
variant = "legend"
|
|
113
|
+
} = _b, props = __objRest(_b, [
|
|
114
|
+
"className",
|
|
115
|
+
"variant"
|
|
116
|
+
]);
|
|
117
|
+
return /* @__PURE__ */ jsx3(
|
|
118
|
+
"legend",
|
|
119
|
+
__spreadValues({
|
|
120
|
+
"data-slot": "field-legend",
|
|
121
|
+
"data-variant": variant,
|
|
122
|
+
className: cn(
|
|
123
|
+
"mb-3 font-medium",
|
|
124
|
+
"data-[variant=legend]:text-base",
|
|
125
|
+
"data-[variant=label]:text-sm",
|
|
126
|
+
className
|
|
127
|
+
)
|
|
128
|
+
}, props)
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
function FieldGroup(_a) {
|
|
132
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
133
|
+
return /* @__PURE__ */ jsx3(
|
|
134
|
+
"div",
|
|
135
|
+
__spreadValues({
|
|
136
|
+
"data-slot": "field-group",
|
|
137
|
+
className: cn(
|
|
138
|
+
"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",
|
|
139
|
+
className
|
|
140
|
+
)
|
|
141
|
+
}, props)
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
var fieldVariants = cva(
|
|
145
|
+
"group/field flex w-full gap-3 data-[invalid=true]:text-destructive",
|
|
146
|
+
{
|
|
147
|
+
variants: {
|
|
148
|
+
orientation: {
|
|
149
|
+
vertical: ["flex-col [&>*]:w-full [&>.sr-only]:w-auto"],
|
|
150
|
+
horizontal: [
|
|
151
|
+
"flex-row items-center",
|
|
152
|
+
"[&>[data-slot=field-label]]:flex-auto",
|
|
153
|
+
"has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"
|
|
154
|
+
],
|
|
155
|
+
responsive: [
|
|
156
|
+
"flex-col [&>*]:w-full [&>.sr-only]:w-auto @md/field-group:flex-row @md/field-group:items-center @md/field-group:[&>*]:w-auto",
|
|
157
|
+
"@md/field-group:[&>[data-slot=field-label]]:flex-auto",
|
|
158
|
+
"@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"
|
|
159
|
+
]
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
defaultVariants: {
|
|
163
|
+
orientation: "vertical"
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
);
|
|
167
|
+
function Field(_a) {
|
|
168
|
+
var _b = _a, {
|
|
169
|
+
className,
|
|
170
|
+
orientation = "vertical"
|
|
171
|
+
} = _b, props = __objRest(_b, [
|
|
172
|
+
"className",
|
|
173
|
+
"orientation"
|
|
174
|
+
]);
|
|
175
|
+
return /* @__PURE__ */ jsx3(
|
|
176
|
+
"div",
|
|
177
|
+
__spreadValues({
|
|
178
|
+
role: "group",
|
|
179
|
+
"data-slot": "field",
|
|
180
|
+
"data-orientation": orientation,
|
|
181
|
+
className: cn(fieldVariants({ orientation }), className)
|
|
182
|
+
}, props)
|
|
183
|
+
);
|
|
184
|
+
}
|
|
185
|
+
function FieldContent(_a) {
|
|
186
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
187
|
+
return /* @__PURE__ */ jsx3(
|
|
188
|
+
"div",
|
|
189
|
+
__spreadValues({
|
|
190
|
+
"data-slot": "field-content",
|
|
191
|
+
className: cn(
|
|
192
|
+
"group/field-content flex flex-1 flex-col gap-1.5 leading-snug",
|
|
193
|
+
className
|
|
194
|
+
)
|
|
195
|
+
}, props)
|
|
196
|
+
);
|
|
197
|
+
}
|
|
198
|
+
function FieldLabel(_a) {
|
|
199
|
+
var _b = _a, {
|
|
200
|
+
className
|
|
201
|
+
} = _b, props = __objRest(_b, [
|
|
202
|
+
"className"
|
|
203
|
+
]);
|
|
204
|
+
return /* @__PURE__ */ jsx3(
|
|
205
|
+
Label,
|
|
206
|
+
__spreadValues({
|
|
207
|
+
"data-slot": "field-label",
|
|
208
|
+
className: cn(
|
|
209
|
+
"group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50",
|
|
210
|
+
"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",
|
|
211
|
+
"has-data-[state=checked]:bg-primary/5 has-data-[state=checked]:border-primary dark:has-data-[state=checked]:bg-primary/10",
|
|
212
|
+
className
|
|
213
|
+
)
|
|
214
|
+
}, props)
|
|
215
|
+
);
|
|
216
|
+
}
|
|
217
|
+
function FieldTitle(_a) {
|
|
218
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
219
|
+
return /* @__PURE__ */ jsx3(
|
|
220
|
+
"div",
|
|
221
|
+
__spreadValues({
|
|
222
|
+
"data-slot": "field-label",
|
|
223
|
+
className: cn(
|
|
224
|
+
"flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50",
|
|
225
|
+
className
|
|
226
|
+
)
|
|
227
|
+
}, props)
|
|
228
|
+
);
|
|
229
|
+
}
|
|
230
|
+
function FieldDescription(_a) {
|
|
231
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
232
|
+
return /* @__PURE__ */ jsx3(
|
|
233
|
+
"p",
|
|
234
|
+
__spreadValues({
|
|
235
|
+
"data-slot": "field-description",
|
|
236
|
+
className: cn(
|
|
237
|
+
"text-muted-foreground text-sm leading-normal font-normal group-has-[[data-orientation=horizontal]]/field:text-balance",
|
|
238
|
+
"last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5",
|
|
239
|
+
"[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4",
|
|
240
|
+
className
|
|
241
|
+
)
|
|
242
|
+
}, props)
|
|
243
|
+
);
|
|
244
|
+
}
|
|
245
|
+
function FieldSeparator(_a) {
|
|
246
|
+
var _b = _a, {
|
|
247
|
+
children,
|
|
248
|
+
className
|
|
249
|
+
} = _b, props = __objRest(_b, [
|
|
250
|
+
"children",
|
|
251
|
+
"className"
|
|
252
|
+
]);
|
|
253
|
+
return /* @__PURE__ */ jsxs(
|
|
254
|
+
"div",
|
|
255
|
+
__spreadProps(__spreadValues({
|
|
256
|
+
"data-slot": "field-separator",
|
|
257
|
+
"data-content": !!children,
|
|
258
|
+
className: cn(
|
|
259
|
+
"relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2",
|
|
260
|
+
className
|
|
261
|
+
)
|
|
262
|
+
}, props), {
|
|
263
|
+
children: [
|
|
264
|
+
/* @__PURE__ */ jsx3(Separator, { className: "absolute inset-0 top-1/2" }),
|
|
265
|
+
children && /* @__PURE__ */ jsx3(
|
|
266
|
+
"span",
|
|
267
|
+
{
|
|
268
|
+
className: "bg-background text-muted-foreground relative mx-auto block w-fit px-2",
|
|
269
|
+
"data-slot": "field-separator-content",
|
|
270
|
+
children
|
|
271
|
+
}
|
|
272
|
+
)
|
|
273
|
+
]
|
|
274
|
+
})
|
|
275
|
+
);
|
|
276
|
+
}
|
|
277
|
+
function FieldError(_a) {
|
|
278
|
+
var _b = _a, {
|
|
279
|
+
className,
|
|
280
|
+
children,
|
|
281
|
+
errors
|
|
282
|
+
} = _b, props = __objRest(_b, [
|
|
283
|
+
"className",
|
|
284
|
+
"children",
|
|
285
|
+
"errors"
|
|
286
|
+
]);
|
|
287
|
+
const content = useMemo(() => {
|
|
288
|
+
var _a2;
|
|
289
|
+
if (children) {
|
|
290
|
+
return children;
|
|
291
|
+
}
|
|
292
|
+
if (!(errors == null ? void 0 : errors.length)) {
|
|
293
|
+
return null;
|
|
294
|
+
}
|
|
295
|
+
const uniqueErrors = [
|
|
296
|
+
...new Map(errors.map((error) => [error == null ? void 0 : error.message, error])).values()
|
|
297
|
+
];
|
|
298
|
+
if ((uniqueErrors == null ? void 0 : uniqueErrors.length) == 1) {
|
|
299
|
+
return (_a2 = uniqueErrors[0]) == null ? void 0 : _a2.message;
|
|
300
|
+
}
|
|
301
|
+
return /* @__PURE__ */ jsx3("ul", { className: "ml-4 flex list-disc flex-col gap-1", children: uniqueErrors.map(
|
|
302
|
+
(error, index) => (error == null ? void 0 : error.message) && /* @__PURE__ */ jsx3("li", { children: error.message }, index)
|
|
303
|
+
) });
|
|
304
|
+
}, [children, errors]);
|
|
305
|
+
if (!content) {
|
|
306
|
+
return null;
|
|
307
|
+
}
|
|
308
|
+
return /* @__PURE__ */ jsx3(
|
|
309
|
+
"div",
|
|
310
|
+
__spreadProps(__spreadValues({
|
|
311
|
+
role: "alert",
|
|
312
|
+
"data-slot": "field-error",
|
|
313
|
+
className: cn("text-destructive text-sm font-normal", className)
|
|
314
|
+
}, props), {
|
|
315
|
+
children: content
|
|
316
|
+
})
|
|
317
|
+
);
|
|
318
|
+
}
|
|
319
|
+
export {
|
|
320
|
+
Field,
|
|
321
|
+
FieldContent,
|
|
322
|
+
FieldDescription,
|
|
323
|
+
FieldError,
|
|
324
|
+
FieldGroup,
|
|
325
|
+
FieldLabel,
|
|
326
|
+
FieldLegend,
|
|
327
|
+
FieldSeparator,
|
|
328
|
+
FieldSet,
|
|
329
|
+
FieldTitle
|
|
330
|
+
};
|
|
331
|
+
//# sourceMappingURL=field.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../lib/components/field.tsx","../../lib/utils/utils.ts","../../lib/components/label.tsx","../../lib/components/separator.tsx"],"sourcesContent":["import { useMemo } from \"react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"../utils/utils\"\nimport { Label } from \"./label\"\nimport { Separator } from \"./separator\"\n\nfunction FieldSet({ className, ...props }: React.ComponentProps<\"fieldset\">) {\n return (\n <fieldset\n data-slot=\"field-set\"\n className={cn(\n \"flex flex-col gap-6\",\n \"has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction FieldLegend({\n className,\n variant = \"legend\",\n ...props\n}: React.ComponentProps<\"legend\"> & { variant?: \"legend\" | \"label\" }) {\n return (\n <legend\n data-slot=\"field-legend\"\n data-variant={variant}\n className={cn(\n \"mb-3 font-medium\",\n \"data-[variant=legend]:text-base\",\n \"data-[variant=label]:text-sm\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction FieldGroup({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"field-group\"\n className={cn(\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\",\n className\n )}\n {...props}\n />\n )\n}\n\nconst fieldVariants = cva(\n \"group/field flex w-full gap-3 data-[invalid=true]:text-destructive\",\n {\n variants: {\n orientation: {\n vertical: [\"flex-col [&>*]:w-full [&>.sr-only]:w-auto\"],\n horizontal: [\n \"flex-row items-center\",\n \"[&>[data-slot=field-label]]:flex-auto\",\n \"has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px\",\n ],\n responsive: [\n \"flex-col [&>*]:w-full [&>.sr-only]:w-auto @md/field-group:flex-row @md/field-group:items-center @md/field-group:[&>*]:w-auto\",\n \"@md/field-group:[&>[data-slot=field-label]]:flex-auto\",\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\",\n ],\n },\n },\n defaultVariants: {\n orientation: \"vertical\",\n },\n }\n)\n\nfunction Field({\n className,\n orientation = \"vertical\",\n ...props\n}: React.ComponentProps<\"div\"> & VariantProps<typeof fieldVariants>) {\n return (\n <div\n role=\"group\"\n data-slot=\"field\"\n data-orientation={orientation}\n className={cn(fieldVariants({ orientation }), className)}\n {...props}\n />\n )\n}\n\nfunction FieldContent({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"field-content\"\n className={cn(\n \"group/field-content flex flex-1 flex-col gap-1.5 leading-snug\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction FieldLabel({\n className,\n ...props\n}: React.ComponentProps<typeof Label>) {\n return (\n <Label\n data-slot=\"field-label\"\n className={cn(\n \"group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50\",\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\",\n \"has-data-[state=checked]:bg-primary/5 has-data-[state=checked]:border-primary dark:has-data-[state=checked]:bg-primary/10\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction FieldTitle({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"field-label\"\n className={cn(\n \"flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction FieldDescription({ className, ...props }: React.ComponentProps<\"p\">) {\n return (\n <p\n data-slot=\"field-description\"\n className={cn(\n \"text-muted-foreground text-sm leading-normal font-normal group-has-[[data-orientation=horizontal]]/field:text-balance\",\n \"last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5\",\n \"[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction FieldSeparator({\n children,\n className,\n ...props\n}: React.ComponentProps<\"div\"> & {\n children?: React.ReactNode\n}) {\n return (\n <div\n data-slot=\"field-separator\"\n data-content={!!children}\n className={cn(\n \"relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2\",\n className\n )}\n {...props}\n >\n <Separator className=\"absolute inset-0 top-1/2\" />\n {children && (\n <span\n className=\"bg-background text-muted-foreground relative mx-auto block w-fit px-2\"\n data-slot=\"field-separator-content\"\n >\n {children}\n </span>\n )}\n </div>\n )\n}\n\nfunction FieldError({\n className,\n children,\n errors,\n ...props\n}: React.ComponentProps<\"div\"> & {\n errors?: Array<{ message?: string } | undefined>\n}) {\n const content = useMemo(() => {\n if (children) {\n return children\n }\n\n if (!errors?.length) {\n return null\n }\n\n const uniqueErrors = [\n ...new Map(errors.map((error) => [error?.message, error])).values(),\n ]\n\n if (uniqueErrors?.length == 1) {\n return uniqueErrors[0]?.message\n }\n\n return (\n <ul className=\"ml-4 flex list-disc flex-col gap-1\">\n {uniqueErrors.map(\n (error, index) =>\n error?.message && <li key={index}>{error.message}</li>\n )}\n </ul>\n )\n }, [children, errors])\n\n if (!content) {\n return null\n }\n\n return (\n <div\n role=\"alert\"\n data-slot=\"field-error\"\n className={cn(\"text-destructive text-sm font-normal\", className)}\n {...props}\n >\n {content}\n </div>\n )\n}\n\nexport {\n Field,\n FieldLabel,\n FieldDescription,\n FieldError,\n FieldGroup,\n FieldLegend,\n FieldSeparator,\n FieldSet,\n FieldContent,\n FieldTitle,\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","\"use client\"\n\nimport * as React from \"react\"\nimport * as SeparatorPrimitive from \"@radix-ui/react-separator\"\n\nimport { cn } from \"../utils/utils\"\n\nfunction Separator({\n className,\n orientation = \"horizontal\",\n decorative = true,\n ...props\n}: React.ComponentProps<typeof SeparatorPrimitive.Root>) {\n return (\n <SeparatorPrimitive.Root\n data-slot=\"separator\"\n decorative={decorative}\n orientation={orientation}\n className={cn(\n \"bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Separator }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,eAAe;AACxB,SAAS,WAA8B;;;ACDvC,SAAS,YAA6B;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ACFA,YAAY,oBAAoB;AAS5B;AALJ,SAAS,MAAM,IAGsC;AAHtC,eACb;AAAA;AAAA,EARF,IAOe,IAEV,kBAFU,I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,KAAK,CAAC,CAAC,EAAE,OAAO;AAAA,IACpE;AAEA,SAAI,6CAAc,WAAU,GAAG;AAC7B,cAAOA,MAAA,aAAa,CAAC,MAAd,gBAAAA,IAAiB;AAAA,IAC1B;AAEA,WACE,gBAAAD,KAAC,QAAG,WAAU,sCACX,uBAAa;AAAA,MACZ,CAAC,OAAO,WACN,+BAAO,YAAW,gBAAAA,KAAC,QAAgB,gBAAM,WAAd,KAAsB;AAAA,IACrD,GACF;AAAA,EAEJ,GAAG,CAAC,UAAU,MAAM,CAAC;AAErB,MAAI,CAAC,SAAS;AACZ,WAAO;AAAA,EACT;AAEA,SACE,gBAAAA;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,aAAU;AAAA,MACV,WAAW,GAAG,wCAAwC,SAAS;AAAA,OAC3D,QAJL;AAAA,MAME;AAAA;AAAA,EACH;AAEJ;","names":["jsx","jsx","_a"]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as react_hook_form from 'react-hook-form';
|
|
3
|
+
import { FieldValues, FieldPath, ControllerProps } from 'react-hook-form';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
6
|
+
import { Slot } from '@radix-ui/react-slot';
|
|
7
|
+
|
|
8
|
+
declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>(props: react_hook_form.FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
|
|
9
|
+
declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: ControllerProps<TFieldValues, TName>) => react_jsx_runtime.JSX.Element;
|
|
10
|
+
declare const useFormField: () => {
|
|
11
|
+
invalid: boolean;
|
|
12
|
+
isDirty: boolean;
|
|
13
|
+
isTouched: boolean;
|
|
14
|
+
isValidating: boolean;
|
|
15
|
+
error?: react_hook_form.FieldError;
|
|
16
|
+
id: string;
|
|
17
|
+
name: string;
|
|
18
|
+
formItemId: string;
|
|
19
|
+
formDescriptionId: string;
|
|
20
|
+
formMessageId: string;
|
|
21
|
+
};
|
|
22
|
+
declare function FormItem({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
23
|
+
declare function FormLabel({ className, ...props }: React.ComponentProps<typeof LabelPrimitive.Root>): react_jsx_runtime.JSX.Element;
|
|
24
|
+
declare function FormControl({ ...props }: React.ComponentProps<typeof Slot>): react_jsx_runtime.JSX.Element;
|
|
25
|
+
declare function FormDescription({ className, ...props }: React.ComponentProps<"p">): react_jsx_runtime.JSX.Element;
|
|
26
|
+
declare function FormMessage({ className, ...props }: React.ComponentProps<"p">): react_jsx_runtime.JSX.Element | null;
|
|
27
|
+
|
|
28
|
+
export { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, useFormField };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as react_hook_form from 'react-hook-form';
|
|
3
|
+
import { FieldValues, FieldPath, ControllerProps } from 'react-hook-form';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
6
|
+
import { Slot } from '@radix-ui/react-slot';
|
|
7
|
+
|
|
8
|
+
declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>(props: react_hook_form.FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
|
|
9
|
+
declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: ControllerProps<TFieldValues, TName>) => react_jsx_runtime.JSX.Element;
|
|
10
|
+
declare const useFormField: () => {
|
|
11
|
+
invalid: boolean;
|
|
12
|
+
isDirty: boolean;
|
|
13
|
+
isTouched: boolean;
|
|
14
|
+
isValidating: boolean;
|
|
15
|
+
error?: react_hook_form.FieldError;
|
|
16
|
+
id: string;
|
|
17
|
+
name: string;
|
|
18
|
+
formItemId: string;
|
|
19
|
+
formDescriptionId: string;
|
|
20
|
+
formMessageId: string;
|
|
21
|
+
};
|
|
22
|
+
declare function FormItem({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
23
|
+
declare function FormLabel({ className, ...props }: React.ComponentProps<typeof LabelPrimitive.Root>): react_jsx_runtime.JSX.Element;
|
|
24
|
+
declare function FormControl({ ...props }: React.ComponentProps<typeof Slot>): react_jsx_runtime.JSX.Element;
|
|
25
|
+
declare function FormDescription({ className, ...props }: React.ComponentProps<"p">): react_jsx_runtime.JSX.Element;
|
|
26
|
+
declare function FormMessage({ className, ...props }: React.ComponentProps<"p">): react_jsx_runtime.JSX.Element | null;
|
|
27
|
+
|
|
28
|
+
export { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, useFormField };
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
"use client";
|
|
4
|
+
var __create = Object.create;
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __defProps = Object.defineProperties;
|
|
7
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
8
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
9
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
10
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
11
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
12
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
13
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
14
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
15
|
+
var __spreadValues = (a, b) => {
|
|
16
|
+
for (var prop in b || (b = {}))
|
|
17
|
+
if (__hasOwnProp.call(b, prop))
|
|
18
|
+
__defNormalProp(a, prop, b[prop]);
|
|
19
|
+
if (__getOwnPropSymbols)
|
|
20
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
21
|
+
if (__propIsEnum.call(b, prop))
|
|
22
|
+
__defNormalProp(a, prop, b[prop]);
|
|
23
|
+
}
|
|
24
|
+
return a;
|
|
25
|
+
};
|
|
26
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
27
|
+
var __objRest = (source, exclude) => {
|
|
28
|
+
var target = {};
|
|
29
|
+
for (var prop in source)
|
|
30
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
31
|
+
target[prop] = source[prop];
|
|
32
|
+
if (source != null && __getOwnPropSymbols)
|
|
33
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
34
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
35
|
+
target[prop] = source[prop];
|
|
36
|
+
}
|
|
37
|
+
return target;
|
|
38
|
+
};
|
|
39
|
+
var __export = (target, all) => {
|
|
40
|
+
for (var name in all)
|
|
41
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
42
|
+
};
|
|
43
|
+
var __copyProps = (to, from, except, desc) => {
|
|
44
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
45
|
+
for (let key of __getOwnPropNames(from))
|
|
46
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
47
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
48
|
+
}
|
|
49
|
+
return to;
|
|
50
|
+
};
|
|
51
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
52
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
53
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
54
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
55
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
56
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
57
|
+
mod
|
|
58
|
+
));
|
|
59
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
60
|
+
|
|
61
|
+
// lib/components/form.tsx
|
|
62
|
+
var form_exports = {};
|
|
63
|
+
__export(form_exports, {
|
|
64
|
+
Form: () => Form,
|
|
65
|
+
FormControl: () => FormControl,
|
|
66
|
+
FormDescription: () => FormDescription,
|
|
67
|
+
FormField: () => FormField,
|
|
68
|
+
FormItem: () => FormItem,
|
|
69
|
+
FormLabel: () => FormLabel,
|
|
70
|
+
FormMessage: () => FormMessage,
|
|
71
|
+
useFormField: () => useFormField
|
|
72
|
+
});
|
|
73
|
+
module.exports = __toCommonJS(form_exports);
|
|
74
|
+
var React = __toESM(require("react"));
|
|
75
|
+
var import_react_slot = require("@radix-ui/react-slot");
|
|
76
|
+
var import_react_hook_form = require("react-hook-form");
|
|
77
|
+
|
|
78
|
+
// lib/utils/utils.ts
|
|
79
|
+
var import_clsx = require("clsx");
|
|
80
|
+
var import_tailwind_merge = require("tailwind-merge");
|
|
81
|
+
function cn(...inputs) {
|
|
82
|
+
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// lib/components/label.tsx
|
|
86
|
+
var LabelPrimitive = __toESM(require("@radix-ui/react-label"));
|
|
87
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
88
|
+
function Label(_a) {
|
|
89
|
+
var _b = _a, {
|
|
90
|
+
className
|
|
91
|
+
} = _b, props = __objRest(_b, [
|
|
92
|
+
"className"
|
|
93
|
+
]);
|
|
94
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
95
|
+
LabelPrimitive.Root,
|
|
96
|
+
__spreadValues({
|
|
97
|
+
"data-slot": "label",
|
|
98
|
+
className: cn(
|
|
99
|
+
"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",
|
|
100
|
+
className
|
|
101
|
+
)
|
|
102
|
+
}, props)
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// lib/components/form.tsx
|
|
107
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
108
|
+
var Form = import_react_hook_form.FormProvider;
|
|
109
|
+
var FormFieldContext = React.createContext(
|
|
110
|
+
{}
|
|
111
|
+
);
|
|
112
|
+
var FormField = (_a) => {
|
|
113
|
+
var props = __objRest(_a, []);
|
|
114
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(FormFieldContext.Provider, { value: { name: props.name }, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_hook_form.Controller, __spreadValues({}, props)) });
|
|
115
|
+
};
|
|
116
|
+
var useFormField = () => {
|
|
117
|
+
const fieldContext = React.useContext(FormFieldContext);
|
|
118
|
+
const itemContext = React.useContext(FormItemContext);
|
|
119
|
+
const { getFieldState } = (0, import_react_hook_form.useFormContext)();
|
|
120
|
+
const formState = (0, import_react_hook_form.useFormState)({ name: fieldContext.name });
|
|
121
|
+
const fieldState = getFieldState(fieldContext.name, formState);
|
|
122
|
+
if (!fieldContext) {
|
|
123
|
+
throw new Error("useFormField should be used within <FormField>");
|
|
124
|
+
}
|
|
125
|
+
const { id } = itemContext;
|
|
126
|
+
return __spreadValues({
|
|
127
|
+
id,
|
|
128
|
+
name: fieldContext.name,
|
|
129
|
+
formItemId: `${id}-form-item`,
|
|
130
|
+
formDescriptionId: `${id}-form-item-description`,
|
|
131
|
+
formMessageId: `${id}-form-item-message`
|
|
132
|
+
}, fieldState);
|
|
133
|
+
};
|
|
134
|
+
var FormItemContext = React.createContext(
|
|
135
|
+
{}
|
|
136
|
+
);
|
|
137
|
+
function FormItem(_a) {
|
|
138
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
139
|
+
const id = React.useId();
|
|
140
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(FormItemContext.Provider, { value: { id }, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
141
|
+
"div",
|
|
142
|
+
__spreadValues({
|
|
143
|
+
"data-slot": "form-item",
|
|
144
|
+
className: cn("grid gap-2", className)
|
|
145
|
+
}, props)
|
|
146
|
+
) });
|
|
147
|
+
}
|
|
148
|
+
function FormLabel(_a) {
|
|
149
|
+
var _b = _a, {
|
|
150
|
+
className
|
|
151
|
+
} = _b, props = __objRest(_b, [
|
|
152
|
+
"className"
|
|
153
|
+
]);
|
|
154
|
+
const { error, formItemId } = useFormField();
|
|
155
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
156
|
+
Label,
|
|
157
|
+
__spreadValues({
|
|
158
|
+
"data-slot": "form-label",
|
|
159
|
+
"data-error": !!error,
|
|
160
|
+
className: cn("data-[error=true]:text-destructive", className),
|
|
161
|
+
htmlFor: formItemId
|
|
162
|
+
}, props)
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
function FormControl(_a) {
|
|
166
|
+
var props = __objRest(_a, []);
|
|
167
|
+
const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
|
|
168
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
169
|
+
import_react_slot.Slot,
|
|
170
|
+
__spreadValues({
|
|
171
|
+
"data-slot": "form-control",
|
|
172
|
+
id: formItemId,
|
|
173
|
+
"aria-describedby": !error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`,
|
|
174
|
+
"aria-invalid": !!error
|
|
175
|
+
}, props)
|
|
176
|
+
);
|
|
177
|
+
}
|
|
178
|
+
function FormDescription(_a) {
|
|
179
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
180
|
+
const { formDescriptionId } = useFormField();
|
|
181
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
182
|
+
"p",
|
|
183
|
+
__spreadValues({
|
|
184
|
+
"data-slot": "form-description",
|
|
185
|
+
id: formDescriptionId,
|
|
186
|
+
className: cn("text-muted-foreground text-sm", className)
|
|
187
|
+
}, props)
|
|
188
|
+
);
|
|
189
|
+
}
|
|
190
|
+
function FormMessage(_a) {
|
|
191
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
192
|
+
var _a2;
|
|
193
|
+
const { error, formMessageId } = useFormField();
|
|
194
|
+
const body = error ? String((_a2 = error == null ? void 0 : error.message) != null ? _a2 : "") : props.children;
|
|
195
|
+
if (!body) {
|
|
196
|
+
return null;
|
|
197
|
+
}
|
|
198
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
199
|
+
"p",
|
|
200
|
+
__spreadProps(__spreadValues({
|
|
201
|
+
"data-slot": "form-message",
|
|
202
|
+
id: formMessageId,
|
|
203
|
+
className: cn("text-destructive text-sm", className)
|
|
204
|
+
}, props), {
|
|
205
|
+
children: body
|
|
206
|
+
})
|
|
207
|
+
);
|
|
208
|
+
}
|
|
209
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
210
|
+
0 && (module.exports = {
|
|
211
|
+
Form,
|
|
212
|
+
FormControl,
|
|
213
|
+
FormDescription,
|
|
214
|
+
FormField,
|
|
215
|
+
FormItem,
|
|
216
|
+
FormLabel,
|
|
217
|
+
FormMessage,
|
|
218
|
+
useFormField
|
|
219
|
+
});
|
|
220
|
+
//# sourceMappingURL=form.js.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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