react-shadcn-kit 0.0.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.
Files changed (123) hide show
  1. package/LICENSE +7 -0
  2. package/README.md +113 -0
  3. package/dist/assets/global.css +1 -0
  4. package/dist/atoms/accordion.d.ts +7 -0
  5. package/dist/atoms/accordion.js +62 -0
  6. package/dist/atoms/alert-dialog.d.ts +14 -0
  7. package/dist/atoms/alert-dialog.js +127 -0
  8. package/dist/atoms/alert.d.ts +9 -0
  9. package/dist/atoms/alert.js +60 -0
  10. package/dist/atoms/aspect-ratio.d.ts +3 -0
  11. package/dist/atoms/aspect-ratio.js +8 -0
  12. package/dist/atoms/avatar.d.ts +6 -0
  13. package/dist/atoms/avatar.js +41 -0
  14. package/dist/atoms/badge.d.ts +9 -0
  15. package/dist/atoms/badge.js +32 -0
  16. package/dist/atoms/breadcrumb.d.ts +11 -0
  17. package/dist/atoms/breadcrumb.js +95 -0
  18. package/dist/atoms/button-group.d.ts +11 -0
  19. package/dist/atoms/button-group.js +75 -0
  20. package/dist/atoms/button.d.ts +10 -0
  21. package/dist/atoms/button.js +51 -0
  22. package/dist/atoms/calendar.d.ts +8 -0
  23. package/dist/atoms/calendar.js +144 -0
  24. package/dist/atoms/card.d.ts +9 -0
  25. package/dist/atoms/card.js +80 -0
  26. package/dist/atoms/carousel.d.ts +19 -0
  27. package/dist/atoms/carousel.js +165 -0
  28. package/dist/atoms/chart.d.ts +43 -0
  29. package/dist/atoms/chart.js +203 -0
  30. package/dist/atoms/checkbox.d.ts +4 -0
  31. package/dist/atoms/checkbox.js +28 -0
  32. package/dist/atoms/collapsible.d.ts +5 -0
  33. package/dist/atoms/collapsible.js +20 -0
  34. package/dist/atoms/command.d.ts +18 -0
  35. package/dist/atoms/command.js +143 -0
  36. package/dist/atoms/context-menu.d.ts +25 -0
  37. package/dist/atoms/context-menu.js +200 -0
  38. package/dist/atoms/dialog.d.ts +15 -0
  39. package/dist/atoms/dialog.js +122 -0
  40. package/dist/atoms/drawer.d.ts +13 -0
  41. package/dist/atoms/drawer.js +117 -0
  42. package/dist/atoms/dropdown-menu.d.ts +25 -0
  43. package/dist/atoms/dropdown-menu.js +204 -0
  44. package/dist/atoms/empty.d.ts +11 -0
  45. package/dist/atoms/empty.js +99 -0
  46. package/dist/atoms/field.d.ts +24 -0
  47. package/dist/atoms/field.js +208 -0
  48. package/dist/atoms/form.d.ts +24 -0
  49. package/dist/atoms/form.js +87 -0
  50. package/dist/atoms/hover-card.d.ts +6 -0
  51. package/dist/atoms/hover-card.js +34 -0
  52. package/dist/atoms/input-group.d.ts +16 -0
  53. package/dist/atoms/input-group.js +142 -0
  54. package/dist/atoms/input-otp.d.ts +11 -0
  55. package/dist/atoms/input-otp.js +55 -0
  56. package/dist/atoms/input.d.ts +3 -0
  57. package/dist/atoms/input.js +21 -0
  58. package/dist/atoms/item.d.ts +23 -0
  59. package/dist/atoms/item.js +164 -0
  60. package/dist/atoms/kbd.d.ts +3 -0
  61. package/dist/atoms/kbd.js +31 -0
  62. package/dist/atoms/label.d.ts +4 -0
  63. package/dist/atoms/label.js +19 -0
  64. package/dist/atoms/menubar.d.ts +26 -0
  65. package/dist/atoms/menubar.js +229 -0
  66. package/dist/atoms/navigation-menu.d.ts +14 -0
  67. package/dist/atoms/navigation-menu.js +159 -0
  68. package/dist/atoms/pagination.d.ts +13 -0
  69. package/dist/atoms/pagination.js +100 -0
  70. package/dist/atoms/popover.d.ts +7 -0
  71. package/dist/atoms/popover.js +38 -0
  72. package/dist/atoms/progress.d.ts +4 -0
  73. package/dist/atoms/progress.js +28 -0
  74. package/dist/atoms/radio-group.d.ts +5 -0
  75. package/dist/atoms/radio-group.js +45 -0
  76. package/dist/atoms/resizable.d.ts +8 -0
  77. package/dist/atoms/resizable.js +43 -0
  78. package/dist/atoms/scroll-area.d.ts +5 -0
  79. package/dist/atoms/scroll-area.js +60 -0
  80. package/dist/atoms/select.d.ts +15 -0
  81. package/dist/atoms/select.js +156 -0
  82. package/dist/atoms/separator.d.ts +4 -0
  83. package/dist/atoms/separator.js +26 -0
  84. package/dist/atoms/sheet.d.ts +13 -0
  85. package/dist/atoms/sheet.js +117 -0
  86. package/dist/atoms/sidebar.d.ts +69 -0
  87. package/dist/atoms/sidebar.js +570 -0
  88. package/dist/atoms/skeleton.d.ts +2 -0
  89. package/dist/atoms/skeleton.js +15 -0
  90. package/dist/atoms/slider.d.ts +4 -0
  91. package/dist/atoms/slider.js +63 -0
  92. package/dist/atoms/sonner.d.ts +3 -0
  93. package/dist/atoms/sonner.js +31 -0
  94. package/dist/atoms/spinner.d.ts +2 -0
  95. package/dist/atoms/spinner.js +17 -0
  96. package/dist/atoms/switch.d.ts +4 -0
  97. package/dist/atoms/switch.js +28 -0
  98. package/dist/atoms/table.d.ts +10 -0
  99. package/dist/atoms/table.js +94 -0
  100. package/dist/atoms/tabs.d.ts +7 -0
  101. package/dist/atoms/tabs.js +55 -0
  102. package/dist/atoms/textarea.d.ts +3 -0
  103. package/dist/atoms/textarea.js +18 -0
  104. package/dist/atoms/toggle-group.d.ts +9 -0
  105. package/dist/atoms/toggle-group.js +68 -0
  106. package/dist/atoms/toggle.d.ts +9 -0
  107. package/dist/atoms/toggle.js +43 -0
  108. package/dist/atoms/tooltip.d.ts +7 -0
  109. package/dist/atoms/tooltip.js +51 -0
  110. package/dist/config/default-navigation.js +136 -0
  111. package/dist/hooks/use-mobile.d.ts +1 -0
  112. package/dist/hooks/use-mobile.js +14 -0
  113. package/dist/index.d.ts +57 -0
  114. package/dist/index.js +347 -0
  115. package/dist/lib/utils.d.ts +2 -0
  116. package/dist/lib/utils.js +8 -0
  117. package/dist/molecules/app-navbar.d.ts +11 -0
  118. package/dist/molecules/app-navbar.js +117 -0
  119. package/dist/molecules/app-sidebar.d.ts +9 -0
  120. package/dist/molecules/app-sidebar.js +121 -0
  121. package/dist/organisms/layout.d.ts +3 -0
  122. package/dist/organisms/layout.js +16 -0
  123. package/package.json +120 -0
@@ -0,0 +1,204 @@
1
+ import { jsx as t, jsxs as s } from "react/jsx-runtime";
2
+ import * as n from "@radix-ui/react-dropdown-menu";
3
+ import { CheckIcon as i, CircleIcon as u, ChevronRightIcon as c } from "lucide-react";
4
+ import { cn as r } from "../lib/utils.js";
5
+ function f({ ...e }) {
6
+ return /* @__PURE__ */ t(n.Root, { "data-slot": "dropdown-menu", ...e });
7
+ }
8
+ function g({
9
+ ...e
10
+ }) {
11
+ return /* @__PURE__ */ t(n.Portal, { "data-slot": "dropdown-menu-portal", ...e });
12
+ }
13
+ function v({
14
+ ...e
15
+ }) {
16
+ return /* @__PURE__ */ t(n.Trigger, { "data-slot": "dropdown-menu-trigger", ...e });
17
+ }
18
+ function x({
19
+ className: e,
20
+ sideOffset: o = 4,
21
+ ...a
22
+ }) {
23
+ return /* @__PURE__ */ t(n.Portal, { children: /* @__PURE__ */ t(
24
+ n.Content,
25
+ {
26
+ "data-slot": "dropdown-menu-content",
27
+ sideOffset: o,
28
+ className: r(
29
+ "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 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",
30
+ e
31
+ ),
32
+ ...a
33
+ }
34
+ ) });
35
+ }
36
+ function w({ ...e }) {
37
+ return /* @__PURE__ */ t(n.Group, { "data-slot": "dropdown-menu-group", ...e });
38
+ }
39
+ function b({
40
+ className: e,
41
+ inset: o,
42
+ variant: a = "default",
43
+ ...d
44
+ }) {
45
+ return /* @__PURE__ */ t(
46
+ n.Item,
47
+ {
48
+ "data-slot": "dropdown-menu-item",
49
+ "data-inset": o,
50
+ "data-variant": a,
51
+ className: r(
52
+ "focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
53
+ e
54
+ ),
55
+ ...d
56
+ }
57
+ );
58
+ }
59
+ function h({
60
+ className: e,
61
+ children: o,
62
+ checked: a,
63
+ ...d
64
+ }) {
65
+ return /* @__PURE__ */ s(
66
+ n.CheckboxItem,
67
+ {
68
+ "data-slot": "dropdown-menu-checkbox-item",
69
+ className: r(
70
+ "focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
71
+ e
72
+ ),
73
+ checked: a,
74
+ ...d,
75
+ children: [
76
+ /* @__PURE__ */ t("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ t(n.ItemIndicator, { children: /* @__PURE__ */ t(i, { className: "size-4" }) }) }),
77
+ o
78
+ ]
79
+ }
80
+ );
81
+ }
82
+ function z({
83
+ ...e
84
+ }) {
85
+ return /* @__PURE__ */ t(n.RadioGroup, { "data-slot": "dropdown-menu-radio-group", ...e });
86
+ }
87
+ function D({
88
+ className: e,
89
+ children: o,
90
+ ...a
91
+ }) {
92
+ return /* @__PURE__ */ s(
93
+ n.RadioItem,
94
+ {
95
+ "data-slot": "dropdown-menu-radio-item",
96
+ className: r(
97
+ "focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
98
+ e
99
+ ),
100
+ ...a,
101
+ children: [
102
+ /* @__PURE__ */ t("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ t(n.ItemIndicator, { children: /* @__PURE__ */ t(u, { className: "size-2 fill-current" }) }) }),
103
+ o
104
+ ]
105
+ }
106
+ );
107
+ }
108
+ function M({
109
+ className: e,
110
+ inset: o,
111
+ ...a
112
+ }) {
113
+ return /* @__PURE__ */ t(
114
+ n.Label,
115
+ {
116
+ "data-slot": "dropdown-menu-label",
117
+ "data-inset": o,
118
+ className: r("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8", e),
119
+ ...a
120
+ }
121
+ );
122
+ }
123
+ function N({
124
+ className: e,
125
+ ...o
126
+ }) {
127
+ return /* @__PURE__ */ t(
128
+ n.Separator,
129
+ {
130
+ "data-slot": "dropdown-menu-separator",
131
+ className: r("bg-border -mx-1 my-1 h-px", e),
132
+ ...o
133
+ }
134
+ );
135
+ }
136
+ function _({ className: e, ...o }) {
137
+ return /* @__PURE__ */ t(
138
+ "span",
139
+ {
140
+ "data-slot": "dropdown-menu-shortcut",
141
+ className: r("text-muted-foreground ml-auto text-xs tracking-widest", e),
142
+ ...o
143
+ }
144
+ );
145
+ }
146
+ function I({ ...e }) {
147
+ return /* @__PURE__ */ t(n.Sub, { "data-slot": "dropdown-menu-sub", ...e });
148
+ }
149
+ function y({
150
+ className: e,
151
+ inset: o,
152
+ children: a,
153
+ ...d
154
+ }) {
155
+ return /* @__PURE__ */ s(
156
+ n.SubTrigger,
157
+ {
158
+ "data-slot": "dropdown-menu-sub-trigger",
159
+ "data-inset": o,
160
+ className: r(
161
+ "focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
162
+ e
163
+ ),
164
+ ...d,
165
+ children: [
166
+ a,
167
+ /* @__PURE__ */ t(c, { className: "ml-auto size-4" })
168
+ ]
169
+ }
170
+ );
171
+ }
172
+ function k({
173
+ className: e,
174
+ ...o
175
+ }) {
176
+ return /* @__PURE__ */ t(
177
+ n.SubContent,
178
+ {
179
+ "data-slot": "dropdown-menu-sub-content",
180
+ className: r(
181
+ "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 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",
182
+ e
183
+ ),
184
+ ...o
185
+ }
186
+ );
187
+ }
188
+ export {
189
+ f as DropdownMenu,
190
+ h as DropdownMenuCheckboxItem,
191
+ x as DropdownMenuContent,
192
+ w as DropdownMenuGroup,
193
+ b as DropdownMenuItem,
194
+ M as DropdownMenuLabel,
195
+ g as DropdownMenuPortal,
196
+ z as DropdownMenuRadioGroup,
197
+ D as DropdownMenuRadioItem,
198
+ N as DropdownMenuSeparator,
199
+ _ as DropdownMenuShortcut,
200
+ I as DropdownMenuSub,
201
+ k as DropdownMenuSubContent,
202
+ y as DropdownMenuSubTrigger,
203
+ v as DropdownMenuTrigger
204
+ };
@@ -0,0 +1,11 @@
1
+ import { VariantProps } from 'class-variance-authority';
2
+ declare function Empty({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
3
+ declare function EmptyHeader({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
4
+ declare const emptyMediaVariants: (props?: ({
5
+ variant?: "default" | "icon" | null | undefined;
6
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
7
+ declare function EmptyMedia({ className, variant, ...props }: React.ComponentProps<"div"> & VariantProps<typeof emptyMediaVariants>): import("react/jsx-runtime").JSX.Element;
8
+ declare function EmptyTitle({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
9
+ declare function EmptyDescription({ className, ...props }: React.ComponentProps<"p">): import("react/jsx-runtime").JSX.Element;
10
+ declare function EmptyContent({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
11
+ export { Empty, EmptyHeader, EmptyTitle, EmptyDescription, EmptyContent, EmptyMedia };
@@ -0,0 +1,99 @@
1
+ import { jsx as n } from "react/jsx-runtime";
2
+ import { cva as i } from "class-variance-authority";
3
+ import { cn as a } from "../lib/utils.js";
4
+ function d({ className: e, ...t }) {
5
+ return /* @__PURE__ */ n(
6
+ "div",
7
+ {
8
+ "data-slot": "empty",
9
+ className: a(
10
+ "flex min-w-0 flex-1 flex-col items-center justify-center gap-6 rounded-lg border-dashed p-6 text-center text-balance md:p-12",
11
+ e
12
+ ),
13
+ ...t
14
+ }
15
+ );
16
+ }
17
+ function c({ className: e, ...t }) {
18
+ return /* @__PURE__ */ n(
19
+ "div",
20
+ {
21
+ "data-slot": "empty-header",
22
+ className: a("flex max-w-sm flex-col items-center gap-2 text-center", e),
23
+ ...t
24
+ }
25
+ );
26
+ }
27
+ const s = i(
28
+ "flex shrink-0 items-center justify-center mb-2 [&_svg]:pointer-events-none [&_svg]:shrink-0",
29
+ {
30
+ variants: {
31
+ variant: {
32
+ default: "bg-transparent",
33
+ icon: "bg-muted text-foreground flex size-10 shrink-0 items-center justify-center rounded-lg [&_svg:not([class*='size-'])]:size-6"
34
+ }
35
+ },
36
+ defaultVariants: {
37
+ variant: "default"
38
+ }
39
+ }
40
+ );
41
+ function f({
42
+ className: e,
43
+ variant: t = "default",
44
+ ...r
45
+ }) {
46
+ return /* @__PURE__ */ n(
47
+ "div",
48
+ {
49
+ "data-slot": "empty-icon",
50
+ "data-variant": t,
51
+ className: a(s({ variant: t, className: e })),
52
+ ...r
53
+ }
54
+ );
55
+ }
56
+ function u({ className: e, ...t }) {
57
+ return /* @__PURE__ */ n(
58
+ "div",
59
+ {
60
+ "data-slot": "empty-title",
61
+ className: a("text-lg font-medium tracking-tight", e),
62
+ ...t
63
+ }
64
+ );
65
+ }
66
+ function p({ className: e, ...t }) {
67
+ return /* @__PURE__ */ n(
68
+ "div",
69
+ {
70
+ "data-slot": "empty-description",
71
+ className: a(
72
+ "text-muted-foreground [&>a:hover]:text-primary text-sm/relaxed [&>a]:underline [&>a]:underline-offset-4",
73
+ e
74
+ ),
75
+ ...t
76
+ }
77
+ );
78
+ }
79
+ function x({ className: e, ...t }) {
80
+ return /* @__PURE__ */ n(
81
+ "div",
82
+ {
83
+ "data-slot": "empty-content",
84
+ className: a(
85
+ "flex w-full max-w-sm min-w-0 flex-col items-center gap-4 text-sm text-balance",
86
+ e
87
+ ),
88
+ ...t
89
+ }
90
+ );
91
+ }
92
+ export {
93
+ d as Empty,
94
+ x as EmptyContent,
95
+ p as EmptyDescription,
96
+ c as EmptyHeader,
97
+ f as EmptyMedia,
98
+ u as EmptyTitle
99
+ };
@@ -0,0 +1,24 @@
1
+ import { VariantProps } from 'class-variance-authority';
2
+ import { Label } from './label';
3
+ declare function FieldSet({ className, ...props }: React.ComponentProps<"fieldset">): import("react/jsx-runtime").JSX.Element;
4
+ declare function FieldLegend({ className, variant, ...props }: React.ComponentProps<"legend"> & {
5
+ variant?: "legend" | "label";
6
+ }): import("react/jsx-runtime").JSX.Element;
7
+ declare function FieldGroup({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
8
+ declare const fieldVariants: (props?: ({
9
+ orientation?: "horizontal" | "vertical" | "responsive" | null | undefined;
10
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
11
+ declare function Field({ className, orientation, ...props }: React.ComponentProps<"div"> & VariantProps<typeof fieldVariants>): import("react/jsx-runtime").JSX.Element;
12
+ declare function FieldContent({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
13
+ declare function FieldLabel({ className, ...props }: React.ComponentProps<typeof Label>): import("react/jsx-runtime").JSX.Element;
14
+ declare function FieldTitle({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
15
+ declare function FieldDescription({ className, ...props }: React.ComponentProps<"p">): import("react/jsx-runtime").JSX.Element;
16
+ declare function FieldSeparator({ children, className, ...props }: React.ComponentProps<"div"> & {
17
+ children?: React.ReactNode;
18
+ }): import("react/jsx-runtime").JSX.Element;
19
+ declare function FieldError({ className, children, errors, ...props }: React.ComponentProps<"div"> & {
20
+ errors?: Array<{
21
+ message?: string;
22
+ } | undefined>;
23
+ }): import("react/jsx-runtime").JSX.Element | null;
24
+ export { Field, FieldLabel, FieldDescription, FieldError, FieldGroup, FieldLegend, FieldSeparator, FieldSet, FieldContent, FieldTitle, };
@@ -0,0 +1,208 @@
1
+ import { jsx as a, jsxs as f } from "react/jsx-runtime";
2
+ import { useMemo as u } from "react";
3
+ import { cva as c } from "class-variance-authority";
4
+ import { cn as l } from "../lib/utils.js";
5
+ import { Label as m } from "./label.js";
6
+ import { Separator as p } from "./separator.js";
7
+ function k({ className: t, ...e }) {
8
+ return /* @__PURE__ */ a(
9
+ "fieldset",
10
+ {
11
+ "data-slot": "field-set",
12
+ className: l(
13
+ "flex flex-col gap-6",
14
+ "has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3",
15
+ t
16
+ ),
17
+ ...e
18
+ }
19
+ );
20
+ }
21
+ function F({
22
+ className: t,
23
+ variant: e = "legend",
24
+ ...o
25
+ }) {
26
+ return /* @__PURE__ */ a(
27
+ "legend",
28
+ {
29
+ "data-slot": "field-legend",
30
+ "data-variant": e,
31
+ className: l(
32
+ "mb-3 font-medium",
33
+ "data-[variant=legend]:text-base",
34
+ "data-[variant=label]:text-sm",
35
+ t
36
+ ),
37
+ ...o
38
+ }
39
+ );
40
+ }
41
+ function y({ className: t, ...e }) {
42
+ return /* @__PURE__ */ a(
43
+ "div",
44
+ {
45
+ "data-slot": "field-group",
46
+ className: l(
47
+ "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",
48
+ t
49
+ ),
50
+ ...e
51
+ }
52
+ );
53
+ }
54
+ const g = c("group/field flex w-full gap-3 data-[invalid=true]:text-destructive", {
55
+ variants: {
56
+ orientation: {
57
+ vertical: ["flex-col [&>*]:w-full [&>.sr-only]:w-auto"],
58
+ horizontal: [
59
+ "flex-row items-center",
60
+ "[&>[data-slot=field-label]]:flex-auto",
61
+ "has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"
62
+ ],
63
+ responsive: [
64
+ "flex-col [&>*]:w-full [&>.sr-only]:w-auto @md/field-group:flex-row @md/field-group:items-center @md/field-group:[&>*]:w-auto",
65
+ "@md/field-group:[&>[data-slot=field-label]]:flex-auto",
66
+ "@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"
67
+ ]
68
+ }
69
+ },
70
+ defaultVariants: {
71
+ orientation: "vertical"
72
+ }
73
+ });
74
+ function L({
75
+ className: t,
76
+ orientation: e = "vertical",
77
+ ...o
78
+ }) {
79
+ return /* @__PURE__ */ a(
80
+ "div",
81
+ {
82
+ role: "group",
83
+ "data-slot": "field",
84
+ "data-orientation": e,
85
+ className: l(g({ orientation: e }), t),
86
+ ...o
87
+ }
88
+ );
89
+ }
90
+ function S({ className: t, ...e }) {
91
+ return /* @__PURE__ */ a(
92
+ "div",
93
+ {
94
+ "data-slot": "field-content",
95
+ className: l("group/field-content flex flex-1 flex-col gap-1.5 leading-snug", t),
96
+ ...e
97
+ }
98
+ );
99
+ }
100
+ function j({ className: t, ...e }) {
101
+ return /* @__PURE__ */ a(
102
+ m,
103
+ {
104
+ "data-slot": "field-label",
105
+ className: l(
106
+ "group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50",
107
+ "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",
108
+ "has-data-[state=checked]:bg-primary/5 has-data-[state=checked]:border-primary dark:has-data-[state=checked]:bg-primary/10",
109
+ t
110
+ ),
111
+ ...e
112
+ }
113
+ );
114
+ }
115
+ function z({ className: t, ...e }) {
116
+ return /* @__PURE__ */ a(
117
+ "div",
118
+ {
119
+ "data-slot": "field-label",
120
+ className: l(
121
+ "flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50",
122
+ t
123
+ ),
124
+ ...e
125
+ }
126
+ );
127
+ }
128
+ function E({ className: t, ...e }) {
129
+ return /* @__PURE__ */ a(
130
+ "p",
131
+ {
132
+ "data-slot": "field-description",
133
+ className: l(
134
+ "text-muted-foreground text-sm leading-normal font-normal group-has-[[data-orientation=horizontal]]/field:text-balance",
135
+ "last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5",
136
+ "[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4",
137
+ t
138
+ ),
139
+ ...e
140
+ }
141
+ );
142
+ }
143
+ function M({
144
+ children: t,
145
+ className: e,
146
+ ...o
147
+ }) {
148
+ return /* @__PURE__ */ f(
149
+ "div",
150
+ {
151
+ "data-slot": "field-separator",
152
+ "data-content": !!t,
153
+ className: l(
154
+ "relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2",
155
+ e
156
+ ),
157
+ ...o,
158
+ children: [
159
+ /* @__PURE__ */ a(p, { className: "absolute inset-0 top-1/2" }),
160
+ t && /* @__PURE__ */ a(
161
+ "span",
162
+ {
163
+ className: "bg-background text-muted-foreground relative mx-auto block w-fit px-2",
164
+ "data-slot": "field-separator-content",
165
+ children: t
166
+ }
167
+ )
168
+ ]
169
+ }
170
+ );
171
+ }
172
+ function V({
173
+ className: t,
174
+ children: e,
175
+ errors: o,
176
+ ...n
177
+ }) {
178
+ const i = u(() => {
179
+ if (e)
180
+ return e;
181
+ if (!o?.length)
182
+ return null;
183
+ const r = [...new Map(o.map((d) => [d?.message, d])).values()];
184
+ return r?.length == 1 ? r[0]?.message : /* @__PURE__ */ a("ul", { className: "ml-4 flex list-disc flex-col gap-1", children: r.map((d, s) => d?.message && /* @__PURE__ */ a("li", { children: d.message }, s)) });
185
+ }, [e, o]);
186
+ return i ? /* @__PURE__ */ a(
187
+ "div",
188
+ {
189
+ role: "alert",
190
+ "data-slot": "field-error",
191
+ className: l("text-destructive text-sm font-normal", t),
192
+ ...n,
193
+ children: i
194
+ }
195
+ ) : null;
196
+ }
197
+ export {
198
+ L as Field,
199
+ S as FieldContent,
200
+ E as FieldDescription,
201
+ V as FieldError,
202
+ y as FieldGroup,
203
+ j as FieldLabel,
204
+ F as FieldLegend,
205
+ M as FieldSeparator,
206
+ k as FieldSet,
207
+ z as FieldTitle
208
+ };
@@ -0,0 +1,24 @@
1
+ import { Slot } from '@radix-ui/react-slot';
2
+ import { ControllerProps, FieldPath, FieldValues } from 'react-hook-form';
3
+ import * as React from "react";
4
+ import * as LabelPrimitive from "@radix-ui/react-label";
5
+ declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>(props: import('react-hook-form').FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
6
+ declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: ControllerProps<TFieldValues, TName>) => import("react/jsx-runtime").JSX.Element;
7
+ declare const useFormField: () => {
8
+ invalid: boolean;
9
+ isDirty: boolean;
10
+ isTouched: boolean;
11
+ isValidating: boolean;
12
+ error?: import('react-hook-form').FieldError;
13
+ id: string;
14
+ name: string;
15
+ formItemId: string;
16
+ formDescriptionId: string;
17
+ formMessageId: string;
18
+ };
19
+ declare function FormItem({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
20
+ declare function FormLabel({ className, ...props }: React.ComponentProps<typeof LabelPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
21
+ declare function FormControl({ ...props }: React.ComponentProps<typeof Slot>): import("react/jsx-runtime").JSX.Element;
22
+ declare function FormDescription({ className, ...props }: React.ComponentProps<"p">): import("react/jsx-runtime").JSX.Element;
23
+ declare function FormMessage({ className, ...props }: React.ComponentProps<"p">): import("react/jsx-runtime").JSX.Element | null;
24
+ export { useFormField, Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField, };
@@ -0,0 +1,87 @@
1
+ import { jsx as m } from "react/jsx-runtime";
2
+ import * as s from "react";
3
+ import { Slot as f } from "@radix-ui/react-slot";
4
+ import { FormProvider as u, useFormContext as F, useFormState as x, Controller as I } from "react-hook-form";
5
+ import { cn as a } from "../lib/utils.js";
6
+ import { Label as g } from "./label.js";
7
+ const S = u, c = s.createContext({}), $ = ({
8
+ ...e
9
+ }) => /* @__PURE__ */ m(c.Provider, { value: { name: e.name }, children: /* @__PURE__ */ m(I, { ...e }) }), d = () => {
10
+ const e = s.useContext(c), t = s.useContext(l), { getFieldState: r } = F(), o = x({ name: e.name }), n = r(e.name, o);
11
+ if (!e)
12
+ throw new Error("useFormField should be used within <FormField>");
13
+ const { id: i } = t;
14
+ return {
15
+ id: i,
16
+ name: e.name,
17
+ formItemId: `${i}-form-item`,
18
+ formDescriptionId: `${i}-form-item-description`,
19
+ formMessageId: `${i}-form-item-message`,
20
+ ...n
21
+ };
22
+ }, l = s.createContext({});
23
+ function D({ className: e, ...t }) {
24
+ const r = s.useId();
25
+ return /* @__PURE__ */ m(l.Provider, { value: { id: r }, children: /* @__PURE__ */ m("div", { "data-slot": "form-item", className: a("grid gap-2", e), ...t }) });
26
+ }
27
+ function M({ className: e, ...t }) {
28
+ const { error: r, formItemId: o } = d();
29
+ return /* @__PURE__ */ m(
30
+ g,
31
+ {
32
+ "data-slot": "form-label",
33
+ "data-error": !!r,
34
+ className: a("data-[error=true]:text-destructive", e),
35
+ htmlFor: o,
36
+ ...t
37
+ }
38
+ );
39
+ }
40
+ function N({ ...e }) {
41
+ const { error: t, formItemId: r, formDescriptionId: o, formMessageId: n } = d();
42
+ return /* @__PURE__ */ m(
43
+ f,
44
+ {
45
+ "data-slot": "form-control",
46
+ id: r,
47
+ "aria-describedby": t ? `${o} ${n}` : `${o}`,
48
+ "aria-invalid": !!t,
49
+ ...e
50
+ }
51
+ );
52
+ }
53
+ function w({ className: e, ...t }) {
54
+ const { formDescriptionId: r } = d();
55
+ return /* @__PURE__ */ m(
56
+ "p",
57
+ {
58
+ "data-slot": "form-description",
59
+ id: r,
60
+ className: a("text-muted-foreground text-sm", e),
61
+ ...t
62
+ }
63
+ );
64
+ }
65
+ function P({ className: e, ...t }) {
66
+ const { error: r, formMessageId: o } = d(), n = r ? String(r?.message ?? "") : t.children;
67
+ return n ? /* @__PURE__ */ m(
68
+ "p",
69
+ {
70
+ "data-slot": "form-message",
71
+ id: o,
72
+ className: a("text-destructive text-sm", e),
73
+ ...t,
74
+ children: n
75
+ }
76
+ ) : null;
77
+ }
78
+ export {
79
+ S as Form,
80
+ N as FormControl,
81
+ w as FormDescription,
82
+ $ as FormField,
83
+ D as FormItem,
84
+ M as FormLabel,
85
+ P as FormMessage,
86
+ d as useFormField
87
+ };
@@ -0,0 +1,6 @@
1
+ import * as React from "react";
2
+ import * as HoverCardPrimitive from "@radix-ui/react-hover-card";
3
+ declare function HoverCard({ ...props }: React.ComponentProps<typeof HoverCardPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
4
+ declare function HoverCardTrigger({ ...props }: React.ComponentProps<typeof HoverCardPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
5
+ declare function HoverCardContent({ className, align, sideOffset, ...props }: React.ComponentProps<typeof HoverCardPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
6
+ export { HoverCard, HoverCardTrigger, HoverCardContent };