@arch-cadre/ui 0.0.61 → 0.0.63

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 (186) hide show
  1. package/dist/components/.gitkeep +0 -0
  2. package/dist/components/accordion.d.ts +4 -4
  3. package/dist/components/accordion.mjs +58 -0
  4. package/dist/components/alert-dialog.d.ts +11 -11
  5. package/dist/components/alert-dialog.mjs +144 -0
  6. package/dist/components/alert.d.ts +4 -4
  7. package/dist/components/alert.mjs +62 -0
  8. package/dist/components/aspect-ratio.d.ts +1 -1
  9. package/dist/components/aspect-ratio.mjs +9 -0
  10. package/dist/components/avatar.d.ts +3 -3
  11. package/dist/components/avatar.mjs +50 -0
  12. package/dist/components/badge.d.ts +3 -3
  13. package/dist/components/badge.mjs +37 -0
  14. package/dist/components/breadcrumb.d.ts +7 -7
  15. package/dist/components/breadcrumb.mjs +105 -0
  16. package/dist/components/button-group.d.ts +4 -4
  17. package/dist/components/button-group.mjs +76 -0
  18. package/dist/components/button.d.ts +3 -3
  19. package/dist/components/button.mjs +51 -0
  20. package/dist/components/calendar.d.ts +2 -2
  21. package/dist/components/calendar.mjs +191 -0
  22. package/dist/components/card.d.ts +7 -7
  23. package/dist/components/card.mjs +90 -0
  24. package/dist/components/checkbox.d.ts +1 -1
  25. package/dist/components/checkbox.mjs +30 -0
  26. package/dist/components/collapsible.d.ts +3 -3
  27. package/dist/components/collapsible.mjs +31 -0
  28. package/dist/components/command.d.ts +9 -9
  29. package/dist/components/command.mjs +169 -0
  30. package/dist/components/context-menu.d.ts +15 -15
  31. package/dist/components/context-menu.mjs +218 -0
  32. package/dist/components/dialog.d.ts +10 -10
  33. package/dist/components/dialog.mjs +130 -0
  34. package/dist/components/drawer.d.ts +10 -10
  35. package/dist/components/drawer.mjs +124 -0
  36. package/dist/components/dropdown-menu.d.ts +15 -15
  37. package/dist/components/dropdown-menu.mjs +226 -0
  38. package/dist/components/empty.d.ts +7 -7
  39. package/dist/components/empty.mjs +102 -0
  40. package/dist/components/field.d.ts +11 -11
  41. package/dist/components/field.mjs +228 -0
  42. package/dist/components/form.d.ts +6 -6
  43. package/dist/components/form.mjs +123 -0
  44. package/dist/components/hover-card.d.ts +3 -3
  45. package/dist/components/hover-card.mjs +35 -0
  46. package/dist/components/input-group.d.ts +8 -8
  47. package/dist/components/input-group.mjs +155 -0
  48. package/dist/components/input-otp.d.ts +4 -4
  49. package/dist/components/input-otp.mjs +59 -0
  50. package/dist/components/input.d.ts +1 -1
  51. package/dist/components/input.mjs +19 -0
  52. package/dist/components/item.d.ts +13 -13
  53. package/dist/components/item.mjs +187 -0
  54. package/dist/components/kbd.d.ts +2 -2
  55. package/dist/components/kbd.mjs +28 -0
  56. package/dist/components/label.d.ts +1 -1
  57. package/dist/components/label.mjs +21 -0
  58. package/dist/components/language-switcher.d.ts +2 -1
  59. package/dist/components/language-switcher.mjs +30 -0
  60. package/dist/components/menubar.d.ts +16 -16
  61. package/dist/components/menubar.mjs +246 -0
  62. package/dist/components/navigation-menu.d.ts +9 -9
  63. package/dist/components/navigation-menu.mjs +166 -0
  64. package/dist/components/pagination.d.ts +7 -7
  65. package/dist/components/pagination.mjs +116 -0
  66. package/dist/components/popover.d.ts +4 -4
  67. package/dist/components/popover.mjs +40 -0
  68. package/dist/components/progress.d.ts +1 -1
  69. package/dist/components/progress.mjs +30 -0
  70. package/dist/components/radio-group.d.ts +2 -2
  71. package/dist/components/radio-group.mjs +43 -0
  72. package/dist/components/scroll-area.d.ts +2 -2
  73. package/dist/components/scroll-area.mjs +59 -0
  74. package/dist/components/select.d.ts +10 -10
  75. package/dist/components/select.mjs +173 -0
  76. package/dist/components/separator.d.ts +1 -1
  77. package/dist/components/separator.mjs +25 -0
  78. package/dist/components/sheet.d.ts +8 -8
  79. package/dist/components/sheet.mjs +119 -0
  80. package/dist/components/sidebar.d.ts +24 -24
  81. package/dist/components/sidebar.mjs +635 -0
  82. package/dist/components/skeleton.d.ts +1 -1
  83. package/dist/components/skeleton.mjs +13 -0
  84. package/dist/components/slider.d.ts +1 -1
  85. package/dist/components/slider.mjs +59 -0
  86. package/dist/components/sonner.d.ts +2 -1
  87. package/dist/components/sonner.mjs +36 -0
  88. package/dist/components/spinner.d.ts +1 -1
  89. package/dist/components/spinner.mjs +15 -0
  90. package/dist/components/switch.d.ts +1 -1
  91. package/dist/components/switch.mjs +30 -0
  92. package/dist/components/table.d.ts +8 -8
  93. package/dist/components/table.mjs +115 -0
  94. package/dist/components/tabs.d.ts +4 -4
  95. package/dist/components/tabs.mjs +63 -0
  96. package/dist/components/textarea.d.ts +1 -1
  97. package/dist/components/textarea.mjs +16 -0
  98. package/dist/components/toggle-group.d.ts +2 -2
  99. package/dist/components/toggle-group.mjs +65 -0
  100. package/dist/components/toggle.d.ts +2 -2
  101. package/dist/components/toggle.mjs +41 -0
  102. package/dist/components/tooltip.d.ts +4 -4
  103. package/dist/components/tooltip.mjs +49 -0
  104. package/dist/hooks/.gitkeep +0 -0
  105. package/dist/hooks/use-mobile.mjs +17 -0
  106. package/dist/hooks/use-user.mjs +12 -0
  107. package/dist/index.mjs +15 -0
  108. package/dist/lib/{utils.js → utils.mjs} +1 -1
  109. package/dist/logo.d.ts +2 -2
  110. package/dist/logo.mjs +32 -0
  111. package/dist/postcss.config.mjs +2 -1
  112. package/dist/providers/auth-provider.d.ts +1 -1
  113. package/dist/providers/auth-provider.mjs +37 -0
  114. package/dist/providers/index.d.ts +1 -1
  115. package/dist/providers/index.mjs +33 -0
  116. package/dist/shared/access-denied.d.ts +2 -1
  117. package/dist/shared/access-denied.mjs +12 -0
  118. package/dist/shared/loader.d.ts +4 -4
  119. package/dist/shared/loader.mjs +98 -0
  120. package/dist/shared/page-loader.d.ts +2 -1
  121. package/dist/shared/page-loader.mjs +6 -0
  122. package/dist/shared/scroll-fade-effect.d.ts +1 -1
  123. package/dist/shared/scroll-fade-effect.mjs +20 -0
  124. package/dist/styles/globals.css +1 -0
  125. package/package.json +13 -13
  126. package/dist/components/accordion.js +0 -18
  127. package/dist/components/alert-dialog.js +0 -39
  128. package/dist/components/alert.js +0 -24
  129. package/dist/components/aspect-ratio.js +0 -7
  130. package/dist/components/avatar.js +0 -14
  131. package/dist/components/badge.js +0 -22
  132. package/dist/components/breadcrumb.js +0 -30
  133. package/dist/components/button-group.js +0 -28
  134. package/dist/components/button.js +0 -33
  135. package/dist/components/calendar.js +0 -76
  136. package/dist/components/card.js +0 -24
  137. package/dist/components/checkbox.js +0 -9
  138. package/dist/components/collapsible.js +0 -13
  139. package/dist/components/command.js +0 -34
  140. package/dist/components/context-menu.js +0 -51
  141. package/dist/components/dialog.js +0 -36
  142. package/dist/components/drawer.js +0 -35
  143. package/dist/components/dropdown-menu.js +0 -51
  144. package/dist/components/empty.js +0 -33
  145. package/dist/components/field.js +0 -78
  146. package/dist/components/form.js +0 -59
  147. package/dist/components/hover-card.js +0 -14
  148. package/dist/components/input-group.js +0 -63
  149. package/dist/components/input-otp.js +0 -21
  150. package/dist/components/input.js +0 -6
  151. package/dist/components/item.js +0 -66
  152. package/dist/components/kbd.js +0 -9
  153. package/dist/components/label.js +0 -8
  154. package/dist/components/language-switcher.js +0 -20
  155. package/dist/components/menubar.js +0 -54
  156. package/dist/components/navigation-menu.js +0 -31
  157. package/dist/components/pagination.js +0 -31
  158. package/dist/components/popover.js +0 -17
  159. package/dist/components/progress.js +0 -8
  160. package/dist/components/radio-group.js +0 -12
  161. package/dist/components/scroll-area.js +0 -13
  162. package/dist/components/select.js +0 -38
  163. package/dist/components/separator.js +0 -8
  164. package/dist/components/sheet.js +0 -40
  165. package/dist/components/sidebar.js +0 -213
  166. package/dist/components/skeleton.js +0 -6
  167. package/dist/components/slider.js +0 -14
  168. package/dist/components/sonner.js +0 -21
  169. package/dist/components/spinner.js +0 -7
  170. package/dist/components/switch.js +0 -8
  171. package/dist/components/table.js +0 -28
  172. package/dist/components/tabs.js +0 -17
  173. package/dist/components/textarea.js +0 -6
  174. package/dist/components/toggle-group.js +0 -22
  175. package/dist/components/toggle.js +0 -26
  176. package/dist/components/tooltip.js +0 -17
  177. package/dist/hooks/use-mobile.js +0 -15
  178. package/dist/hooks/use-user.js +0 -25
  179. package/dist/index.js +0 -15
  180. package/dist/logo.js +0 -28
  181. package/dist/providers/auth-provider.js +0 -27
  182. package/dist/providers/index.js +0 -23
  183. package/dist/shared/access-denied.js +0 -6
  184. package/dist/shared/loader.js +0 -41
  185. package/dist/shared/page-loader.js +0 -6
  186. package/dist/shared/scroll-fade-effect.js +0 -5
@@ -0,0 +1,228 @@
1
+ "use client";
2
+ import { cva } from "class-variance-authority";
3
+ import * as React from "react";
4
+ import { useMemo } from "react";
5
+ import { cn } from "../lib/utils.mjs";
6
+ import { Label } from "./label.mjs";
7
+ import { Separator } from "./separator.mjs";
8
+ function FieldSet({ className, ...props }) {
9
+ return /* @__PURE__ */ React.createElement(
10
+ "fieldset",
11
+ {
12
+ "data-slot": "field-set",
13
+ className: cn(
14
+ "flex flex-col gap-6",
15
+ "has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3",
16
+ className
17
+ ),
18
+ ...props
19
+ }
20
+ );
21
+ }
22
+ function FieldLegend({
23
+ className,
24
+ variant = "legend",
25
+ ...props
26
+ }) {
27
+ return /* @__PURE__ */ React.createElement(
28
+ "legend",
29
+ {
30
+ "data-slot": "field-legend",
31
+ "data-variant": variant,
32
+ className: cn(
33
+ "mb-3 font-medium",
34
+ "data-[variant=legend]:text-base",
35
+ "data-[variant=label]:text-sm",
36
+ className
37
+ ),
38
+ ...props
39
+ }
40
+ );
41
+ }
42
+ function FieldGroup({ className, ...props }) {
43
+ return /* @__PURE__ */ React.createElement(
44
+ "div",
45
+ {
46
+ "data-slot": "field-group",
47
+ className: cn(
48
+ "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",
49
+ className
50
+ ),
51
+ ...props
52
+ }
53
+ );
54
+ }
55
+ const fieldVariants = cva(
56
+ "group/field flex w-full gap-3 data-[invalid=true]:text-destructive",
57
+ {
58
+ variants: {
59
+ orientation: {
60
+ vertical: ["flex-col [&>*]:w-full [&>.sr-only]:w-auto"],
61
+ horizontal: [
62
+ "flex-row items-center",
63
+ "[&>[data-slot=field-label]]:flex-auto",
64
+ "has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"
65
+ ],
66
+ responsive: [
67
+ "flex-col [&>*]:w-full [&>.sr-only]:w-auto @md/field-group:flex-row @md/field-group:items-center @md/field-group:[&>*]:w-auto",
68
+ "@md/field-group:[&>[data-slot=field-label]]:flex-auto",
69
+ "@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"
70
+ ]
71
+ }
72
+ },
73
+ defaultVariants: {
74
+ orientation: "vertical"
75
+ }
76
+ }
77
+ );
78
+ function Field({
79
+ className,
80
+ orientation = "vertical",
81
+ ...props
82
+ }) {
83
+ return /* @__PURE__ */ React.createElement(
84
+ "div",
85
+ {
86
+ role: "group",
87
+ "data-slot": "field",
88
+ "data-orientation": orientation,
89
+ className: cn(fieldVariants({ orientation }), className),
90
+ ...props
91
+ }
92
+ );
93
+ }
94
+ function FieldContent({ className, ...props }) {
95
+ return /* @__PURE__ */ React.createElement(
96
+ "div",
97
+ {
98
+ "data-slot": "field-content",
99
+ className: cn(
100
+ "group/field-content flex flex-1 flex-col gap-1.5 leading-snug",
101
+ className
102
+ ),
103
+ ...props
104
+ }
105
+ );
106
+ }
107
+ function FieldLabel({
108
+ className,
109
+ ...props
110
+ }) {
111
+ return /* @__PURE__ */ React.createElement(
112
+ Label,
113
+ {
114
+ "data-slot": "field-label",
115
+ className: cn(
116
+ "group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50",
117
+ "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",
118
+ "has-data-[state=checked]:bg-primary/5 has-data-[state=checked]:border-primary dark:has-data-[state=checked]:bg-primary/10",
119
+ className
120
+ ),
121
+ ...props
122
+ }
123
+ );
124
+ }
125
+ function FieldTitle({ className, ...props }) {
126
+ return /* @__PURE__ */ React.createElement(
127
+ "div",
128
+ {
129
+ "data-slot": "field-label",
130
+ className: cn(
131
+ "flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50",
132
+ className
133
+ ),
134
+ ...props
135
+ }
136
+ );
137
+ }
138
+ function FieldDescription({ className, ...props }) {
139
+ return /* @__PURE__ */ React.createElement(
140
+ "p",
141
+ {
142
+ "data-slot": "field-description",
143
+ className: cn(
144
+ "text-muted-foreground text-sm leading-normal font-normal group-has-[[data-orientation=horizontal]]/field:text-balance",
145
+ "last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5",
146
+ "[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4",
147
+ className
148
+ ),
149
+ ...props
150
+ }
151
+ );
152
+ }
153
+ function FieldSeparator({
154
+ children,
155
+ className,
156
+ ...props
157
+ }) {
158
+ return /* @__PURE__ */ React.createElement(
159
+ "div",
160
+ {
161
+ "data-slot": "field-separator",
162
+ "data-content": !!children,
163
+ className: cn(
164
+ "relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2",
165
+ className
166
+ ),
167
+ ...props
168
+ },
169
+ /* @__PURE__ */ React.createElement(Separator, { className: "absolute inset-0 top-1/2" }),
170
+ children && /* @__PURE__ */ React.createElement(
171
+ "span",
172
+ {
173
+ className: "bg-background text-muted-foreground relative mx-auto block w-fit px-2",
174
+ "data-slot": "field-separator-content"
175
+ },
176
+ children
177
+ )
178
+ );
179
+ }
180
+ function FieldError({
181
+ className,
182
+ children,
183
+ errors,
184
+ ...props
185
+ }) {
186
+ const content = useMemo(() => {
187
+ if (children) {
188
+ return children;
189
+ }
190
+ if (!errors?.length) {
191
+ return null;
192
+ }
193
+ const uniqueErrors = [
194
+ ...new Map(errors.map((error) => [error?.message, error])).values()
195
+ ];
196
+ if (uniqueErrors?.length === 1) {
197
+ return uniqueErrors[0]?.message;
198
+ }
199
+ return /* @__PURE__ */ React.createElement("ul", { className: "ml-4 flex list-disc flex-col gap-1" }, uniqueErrors.map(
200
+ (error, index) => error?.message && /* @__PURE__ */ React.createElement("li", { key: index }, error.message)
201
+ ));
202
+ }, [children, errors]);
203
+ if (!content) {
204
+ return null;
205
+ }
206
+ return /* @__PURE__ */ React.createElement(
207
+ "div",
208
+ {
209
+ role: "alert",
210
+ "data-slot": "field-error",
211
+ className: cn("text-destructive text-sm font-normal", className),
212
+ ...props
213
+ },
214
+ content
215
+ );
216
+ }
217
+ export {
218
+ Field,
219
+ FieldLabel,
220
+ FieldDescription,
221
+ FieldError,
222
+ FieldGroup,
223
+ FieldLegend,
224
+ FieldSeparator,
225
+ FieldSet,
226
+ FieldContent,
227
+ FieldTitle
228
+ };
@@ -2,7 +2,7 @@ import { type Label as LabelPrimitive, Slot as SlotPrimitive } from "radix-ui";
2
2
  import * as React from "react";
3
3
  import { type ControllerProps, type FieldPath, type FieldValues } from "react-hook-form";
4
4
  declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>(props: import("react-hook-form").FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
5
- declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: ControllerProps<TFieldValues, TName>) => import("react/jsx-runtime").JSX.Element;
5
+ declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: ControllerProps<TFieldValues, TName>) => React.JSX.Element;
6
6
  declare const useFormField: () => {
7
7
  invalid: boolean;
8
8
  isDirty: boolean;
@@ -15,9 +15,9 @@ declare const useFormField: () => {
15
15
  formDescriptionId: string;
16
16
  formMessageId: string;
17
17
  };
18
- declare function FormItem({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
19
- declare function FormLabel({ className, ...props }: React.ComponentProps<typeof LabelPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
20
- declare function FormControl({ ...props }: React.ComponentProps<typeof SlotPrimitive.Slot>): import("react/jsx-runtime").JSX.Element;
21
- declare function FormDescription({ className, ...props }: React.ComponentProps<"p">): import("react/jsx-runtime").JSX.Element;
22
- declare function FormMessage({ className, ...props }: React.ComponentProps<"p">): import("react/jsx-runtime").JSX.Element | null;
18
+ declare function FormItem({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
19
+ declare function FormLabel({ className, ...props }: React.ComponentProps<typeof LabelPrimitive.Root>): React.JSX.Element;
20
+ declare function FormControl({ ...props }: React.ComponentProps<typeof SlotPrimitive.Slot>): React.JSX.Element;
21
+ declare function FormDescription({ className, ...props }: React.ComponentProps<"p">): React.JSX.Element;
22
+ declare function FormMessage({ className, ...props }: React.ComponentProps<"p">): React.JSX.Element | null;
23
23
  export { useFormField, Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField, };
@@ -0,0 +1,123 @@
1
+ "use client";
2
+ import { Slot as SlotPrimitive } from "radix-ui";
3
+ import * as React from "react";
4
+ import {
5
+ Controller,
6
+ FormProvider,
7
+ useFormContext,
8
+ useFormState
9
+ } from "react-hook-form";
10
+ import { cn } from "../lib/utils.mjs";
11
+ import { Label } from "./label.mjs";
12
+ const Form = FormProvider;
13
+ const FormFieldContext = React.createContext(
14
+ {}
15
+ );
16
+ const FormField = ({
17
+ ...props
18
+ }) => {
19
+ return /* @__PURE__ */ React.createElement(FormFieldContext.Provider, { value: { name: props.name } }, /* @__PURE__ */ React.createElement(Controller, { ...props }));
20
+ };
21
+ const useFormField = () => {
22
+ const fieldContext = React.useContext(FormFieldContext);
23
+ const itemContext = React.useContext(FormItemContext);
24
+ const { getFieldState } = useFormContext();
25
+ const formState = useFormState({ name: fieldContext.name });
26
+ const fieldState = getFieldState(fieldContext.name, formState);
27
+ if (!fieldContext) {
28
+ throw new Error("useFormField should be used within <FormField>");
29
+ }
30
+ const { id } = itemContext;
31
+ return {
32
+ id,
33
+ name: fieldContext.name,
34
+ formItemId: `${id}-form-item`,
35
+ formDescriptionId: `${id}-form-item-description`,
36
+ formMessageId: `${id}-form-item-message`,
37
+ ...fieldState
38
+ };
39
+ };
40
+ const FormItemContext = React.createContext(
41
+ {}
42
+ );
43
+ function FormItem({ className, ...props }) {
44
+ const id = React.useId();
45
+ return /* @__PURE__ */ React.createElement(FormItemContext.Provider, { value: { id } }, /* @__PURE__ */ React.createElement(
46
+ "div",
47
+ {
48
+ "data-slot": "form-item",
49
+ className: cn("grid gap-2", className),
50
+ ...props
51
+ }
52
+ ));
53
+ }
54
+ function FormLabel({
55
+ className,
56
+ ...props
57
+ }) {
58
+ const { error, formItemId } = useFormField();
59
+ return /* @__PURE__ */ React.createElement(
60
+ Label,
61
+ {
62
+ "data-slot": "form-label",
63
+ "data-error": !!error,
64
+ className: cn("data-[error=true]:text-destructive", className),
65
+ htmlFor: formItemId,
66
+ ...props
67
+ }
68
+ );
69
+ }
70
+ function FormControl({
71
+ ...props
72
+ }) {
73
+ const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
74
+ return /* @__PURE__ */ React.createElement(
75
+ SlotPrimitive.Slot,
76
+ {
77
+ "data-slot": "form-control",
78
+ id: formItemId,
79
+ "aria-describedby": !error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`,
80
+ "aria-invalid": !!error,
81
+ ...props
82
+ }
83
+ );
84
+ }
85
+ function FormDescription({ className, ...props }) {
86
+ const { formDescriptionId } = useFormField();
87
+ return /* @__PURE__ */ React.createElement(
88
+ "p",
89
+ {
90
+ "data-slot": "form-description",
91
+ id: formDescriptionId,
92
+ className: cn("text-muted-foreground text-sm", className),
93
+ ...props
94
+ }
95
+ );
96
+ }
97
+ function FormMessage({ className, ...props }) {
98
+ const { error, formMessageId } = useFormField();
99
+ const body = error ? String(error?.message ?? "") : props.children;
100
+ if (!body) {
101
+ return null;
102
+ }
103
+ return /* @__PURE__ */ React.createElement(
104
+ "p",
105
+ {
106
+ "data-slot": "form-message",
107
+ id: formMessageId,
108
+ className: cn("text-destructive text-sm", className),
109
+ ...props
110
+ },
111
+ body
112
+ );
113
+ }
114
+ export {
115
+ useFormField,
116
+ Form,
117
+ FormItem,
118
+ FormLabel,
119
+ FormControl,
120
+ FormDescription,
121
+ FormMessage,
122
+ FormField
123
+ };
@@ -1,6 +1,6 @@
1
1
  import { HoverCard as HoverCardPrimitive } from "radix-ui";
2
2
  import * as React from "react";
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;
3
+ declare function HoverCard({ ...props }: React.ComponentProps<typeof HoverCardPrimitive.Root>): React.JSX.Element;
4
+ declare function HoverCardTrigger({ ...props }: React.ComponentProps<typeof HoverCardPrimitive.Trigger>): React.JSX.Element;
5
+ declare function HoverCardContent({ className, align, sideOffset, ...props }: React.ComponentProps<typeof HoverCardPrimitive.Content>): React.JSX.Element;
6
6
  export { HoverCard, HoverCardTrigger, HoverCardContent };
@@ -0,0 +1,35 @@
1
+ "use client";
2
+ import { HoverCard as HoverCardPrimitive } from "radix-ui";
3
+ import * as React from "react";
4
+ import { cn } from "../lib/utils.mjs";
5
+ function HoverCard({
6
+ ...props
7
+ }) {
8
+ return /* @__PURE__ */ React.createElement(HoverCardPrimitive.Root, { "data-slot": "hover-card", ...props });
9
+ }
10
+ function HoverCardTrigger({
11
+ ...props
12
+ }) {
13
+ return /* @__PURE__ */ React.createElement(HoverCardPrimitive.Trigger, { "data-slot": "hover-card-trigger", ...props });
14
+ }
15
+ function HoverCardContent({
16
+ className,
17
+ align = "center",
18
+ sideOffset = 4,
19
+ ...props
20
+ }) {
21
+ return /* @__PURE__ */ React.createElement(HoverCardPrimitive.Portal, { "data-slot": "hover-card-portal" }, /* @__PURE__ */ React.createElement(
22
+ HoverCardPrimitive.Content,
23
+ {
24
+ "data-slot": "hover-card-content",
25
+ align,
26
+ sideOffset,
27
+ className: cn(
28
+ "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",
29
+ className
30
+ ),
31
+ ...props
32
+ }
33
+ ));
34
+ }
35
+ export { HoverCard, HoverCardTrigger, HoverCardContent };
@@ -1,16 +1,16 @@
1
1
  import { type VariantProps } from "class-variance-authority";
2
2
  import * as React from "react";
3
3
  import { Button } from "./button";
4
- declare function InputGroup({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
4
+ declare function InputGroup({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
5
5
  declare const inputGroupAddonVariants: (props?: ({
6
6
  align?: "inline-start" | "inline-end" | "block-start" | "block-end" | null | undefined;
7
- } & import("class-variance-authority/types").ClassProp) | undefined) => string;
8
- declare function InputGroupAddon({ className, align, ...props }: React.ComponentProps<"div"> & VariantProps<typeof inputGroupAddonVariants>): import("react/jsx-runtime").JSX.Element;
7
+ } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
8
+ declare function InputGroupAddon({ className, align, ...props }: React.ComponentProps<"div"> & VariantProps<typeof inputGroupAddonVariants>): React.JSX.Element;
9
9
  declare const inputGroupButtonVariants: (props?: ({
10
10
  size?: "sm" | "icon-sm" | "xs" | "icon-xs" | null | undefined;
11
- } & import("class-variance-authority/types").ClassProp) | undefined) => string;
12
- declare function InputGroupButton({ className, type, variant, size, ...props }: Omit<React.ComponentProps<typeof Button>, "size"> & VariantProps<typeof inputGroupButtonVariants>): import("react/jsx-runtime").JSX.Element;
13
- declare function InputGroupText({ className, ...props }: React.ComponentProps<"span">): import("react/jsx-runtime").JSX.Element;
14
- declare function InputGroupInput({ className, ...props }: React.ComponentProps<"input">): import("react/jsx-runtime").JSX.Element;
15
- declare function InputGroupTextarea({ className, ...props }: React.ComponentProps<"textarea">): import("react/jsx-runtime").JSX.Element;
11
+ } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
12
+ declare function InputGroupButton({ className, type, variant, size, ...props }: Omit<React.ComponentProps<typeof Button>, "size"> & VariantProps<typeof inputGroupButtonVariants>): React.JSX.Element;
13
+ declare function InputGroupText({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
14
+ declare function InputGroupInput({ className, ...props }: React.ComponentProps<"input">): React.JSX.Element;
15
+ declare function InputGroupTextarea({ className, ...props }: React.ComponentProps<"textarea">): React.JSX.Element;
16
16
  export { InputGroup, InputGroupAddon, InputGroupButton, InputGroupText, InputGroupInput, InputGroupTextarea, };
@@ -0,0 +1,155 @@
1
+ "use client";
2
+ import { cva } from "class-variance-authority";
3
+ import * as React from "react";
4
+ import { cn } from "../lib/utils.mjs";
5
+ import { Button } from "./button.mjs";
6
+ import { Input } from "./input.mjs";
7
+ import { Textarea } from "./textarea.mjs";
8
+ function InputGroup({ className, ...props }) {
9
+ return /* @__PURE__ */ React.createElement(
10
+ "div",
11
+ {
12
+ "data-slot": "input-group",
13
+ role: "group",
14
+ className: cn(
15
+ "group/input-group border-input dark:bg-input/30 relative flex w-full items-center rounded-md border shadow-xs transition-[color,box-shadow] outline-none",
16
+ "h-9 min-w-0 has-[>textarea]:h-auto",
17
+ // Variants based on alignment.
18
+ "has-[>[data-align=inline-start]]:[&>input]:pl-2",
19
+ "has-[>[data-align=inline-end]]:[&>input]:pr-2",
20
+ "has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3",
21
+ "has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3",
22
+ // Focus state.
23
+ "has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot=input-group-control]:focus-visible]:ring-[3px]",
24
+ // Error state.
25
+ "has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40",
26
+ className
27
+ ),
28
+ ...props
29
+ }
30
+ );
31
+ }
32
+ const inputGroupAddonVariants = cva(
33
+ "text-muted-foreground flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium select-none [&>svg:not([class*='size-'])]:size-4 [&>kbd]:rounded-[calc(var(--radius)-5px)] group-data-[disabled=true]/input-group:opacity-50",
34
+ {
35
+ variants: {
36
+ align: {
37
+ "inline-start": "order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]",
38
+ "inline-end": "order-last pr-3 has-[>button]:mr-[-0.45rem] has-[>kbd]:mr-[-0.35rem]",
39
+ "block-start": "order-first w-full justify-start px-3 pt-3 [.border-b]:pb-3 group-has-[>input]/input-group:pt-2.5",
40
+ "block-end": "order-last w-full justify-start px-3 pb-3 [.border-t]:pt-3 group-has-[>input]/input-group:pb-2.5"
41
+ }
42
+ },
43
+ defaultVariants: {
44
+ align: "inline-start"
45
+ }
46
+ }
47
+ );
48
+ function InputGroupAddon({
49
+ className,
50
+ align = "inline-start",
51
+ ...props
52
+ }) {
53
+ return /* @__PURE__ */ React.createElement(
54
+ "div",
55
+ {
56
+ role: "group",
57
+ "data-slot": "input-group-addon",
58
+ "data-align": align,
59
+ className: cn(inputGroupAddonVariants({ align }), className),
60
+ onClick: (e) => {
61
+ if (e.target.closest("button")) {
62
+ return;
63
+ }
64
+ e.currentTarget.parentElement?.querySelector("input")?.focus();
65
+ },
66
+ ...props
67
+ }
68
+ );
69
+ }
70
+ const inputGroupButtonVariants = cva(
71
+ "text-sm shadow-none flex gap-2 items-center",
72
+ {
73
+ variants: {
74
+ size: {
75
+ xs: "h-6 gap-1 px-2 rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-3.5 has-[>svg]:px-2",
76
+ sm: "h-8 px-2.5 gap-1.5 rounded-md has-[>svg]:px-2.5",
77
+ "icon-xs": "size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0",
78
+ "icon-sm": "size-8 p-0 has-[>svg]:p-0"
79
+ }
80
+ },
81
+ defaultVariants: {
82
+ size: "xs"
83
+ }
84
+ }
85
+ );
86
+ function InputGroupButton({
87
+ className,
88
+ type = "button",
89
+ variant = "ghost",
90
+ size = "xs",
91
+ ...props
92
+ }) {
93
+ return /* @__PURE__ */ React.createElement(
94
+ Button,
95
+ {
96
+ type,
97
+ "data-size": size,
98
+ variant,
99
+ className: cn(inputGroupButtonVariants({ size }), className),
100
+ ...props
101
+ }
102
+ );
103
+ }
104
+ function InputGroupText({ className, ...props }) {
105
+ return /* @__PURE__ */ React.createElement(
106
+ "span",
107
+ {
108
+ className: cn(
109
+ "text-muted-foreground flex items-center gap-2 text-sm [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",
110
+ className
111
+ ),
112
+ ...props
113
+ }
114
+ );
115
+ }
116
+ function InputGroupInput({
117
+ className,
118
+ ...props
119
+ }) {
120
+ return /* @__PURE__ */ React.createElement(
121
+ Input,
122
+ {
123
+ "data-slot": "input-group-control",
124
+ className: cn(
125
+ "flex-1 rounded-none border-0 bg-transparent shadow-none focus-visible:ring-0 dark:bg-transparent",
126
+ className
127
+ ),
128
+ ...props
129
+ }
130
+ );
131
+ }
132
+ function InputGroupTextarea({
133
+ className,
134
+ ...props
135
+ }) {
136
+ return /* @__PURE__ */ React.createElement(
137
+ Textarea,
138
+ {
139
+ "data-slot": "input-group-control",
140
+ className: cn(
141
+ "flex-1 resize-none rounded-none border-0 bg-transparent py-3 shadow-none focus-visible:ring-0 dark:bg-transparent",
142
+ className
143
+ ),
144
+ ...props
145
+ }
146
+ );
147
+ }
148
+ export {
149
+ InputGroup,
150
+ InputGroupAddon,
151
+ InputGroupButton,
152
+ InputGroupText,
153
+ InputGroupInput,
154
+ InputGroupTextarea
155
+ };
@@ -2,10 +2,10 @@ import { OTPInput } from "input-otp";
2
2
  import * as React from "react";
3
3
  declare function InputOTP({ className, containerClassName, ...props }: React.ComponentProps<typeof OTPInput> & {
4
4
  containerClassName?: string;
5
- }): import("react/jsx-runtime").JSX.Element;
6
- declare function InputOTPGroup({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
5
+ }): React.JSX.Element;
6
+ declare function InputOTPGroup({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
7
7
  declare function InputOTPSlot({ index, className, ...props }: React.ComponentProps<"div"> & {
8
8
  index: number;
9
- }): import("react/jsx-runtime").JSX.Element;
10
- declare function InputOTPSeparator({ ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
9
+ }): React.JSX.Element;
10
+ declare function InputOTPSeparator({ ...props }: React.ComponentProps<"div">): React.JSX.Element;
11
11
  export { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator };
@@ -0,0 +1,59 @@
1
+ "use client";
2
+ import { OTPInput, OTPInputContext } from "input-otp";
3
+ import { MinusIcon } from "lucide-react";
4
+ import * as React from "react";
5
+ import { cn } from "../lib/utils.mjs";
6
+ function InputOTP({
7
+ className,
8
+ containerClassName,
9
+ ...props
10
+ }) {
11
+ return /* @__PURE__ */ React.createElement(
12
+ OTPInput,
13
+ {
14
+ "data-slot": "input-otp",
15
+ containerClassName: cn(
16
+ "flex items-center gap-2 has-disabled:opacity-50",
17
+ containerClassName
18
+ ),
19
+ className: cn("disabled:cursor-not-allowed", className),
20
+ ...props
21
+ }
22
+ );
23
+ }
24
+ function InputOTPGroup({ className, ...props }) {
25
+ return /* @__PURE__ */ React.createElement(
26
+ "div",
27
+ {
28
+ "data-slot": "input-otp-group",
29
+ className: cn("flex items-center", className),
30
+ ...props
31
+ }
32
+ );
33
+ }
34
+ function InputOTPSlot({
35
+ index,
36
+ className,
37
+ ...props
38
+ }) {
39
+ const inputOTPContext = React.useContext(OTPInputContext);
40
+ const { char, hasFakeCaret, isActive } = inputOTPContext?.slots[index] ?? {};
41
+ return /* @__PURE__ */ React.createElement(
42
+ "div",
43
+ {
44
+ "data-slot": "input-otp-slot",
45
+ "data-active": isActive,
46
+ className: cn(
47
+ "data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive dark:bg-input/30 border-input relative flex h-9 w-9 items-center justify-center border-y border-r text-sm shadow-xs transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md data-[active=true]:z-10 data-[active=true]:ring-[3px]",
48
+ className
49
+ ),
50
+ ...props
51
+ },
52
+ char,
53
+ hasFakeCaret && /* @__PURE__ */ React.createElement("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center" }, /* @__PURE__ */ React.createElement("div", { className: "animate-caret-blink bg-foreground h-4 w-px duration-1000" }))
54
+ );
55
+ }
56
+ function InputOTPSeparator({ ...props }) {
57
+ return /* @__PURE__ */ React.createElement("div", { "data-slot": "input-otp-separator", role: "separator", ...props }, /* @__PURE__ */ React.createElement(MinusIcon, null));
58
+ }
59
+ export { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator };