@me1a/ui 2.1.4 → 2.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/rhf.d.mts ADDED
@@ -0,0 +1,199 @@
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 { TextareaHTMLAttributes } from 'react';
6
+ import { I as Input } from './input-Ruz0ZoY6.mjs';
7
+ import * as _radix_ui_react_slot from '@radix-ui/react-slot';
8
+ import { Slot } from '@radix-ui/react-slot';
9
+ import * as LabelPrimitive from '@radix-ui/react-label';
10
+
11
+ interface RHFTextFieldProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> extends Omit<React.ComponentProps<typeof Input>, "name"> {
12
+ /** The name of the field in the form */
13
+ name: TName;
14
+ /** Optional label for the field */
15
+ label?: string;
16
+ /** Optional description text below the field */
17
+ description?: string;
18
+ /** Optional warning text to display */
19
+ warningText?: string;
20
+ /** Whether the field is required */
21
+ required?: boolean;
22
+ /** Whether the field is disabled */
23
+ disabled?: boolean;
24
+ /** Whether the field is read-only */
25
+ readOnly?: boolean;
26
+ /** The type of input (text, number, email, etc.) */
27
+ type?: React.HTMLInputTypeAttribute;
28
+ /** Optional placeholder text */
29
+ placeholder?: string;
30
+ /** Optional aria-label for accessibility */
31
+ "aria-label"?: string;
32
+ /** Optional aria-describedby for accessibility */
33
+ "aria-describedby"?: string;
34
+ }
35
+
36
+ /**
37
+ * A text field component that integrates with React Hook Form.
38
+ * Provides form validation, error handling, and accessibility features.
39
+ *
40
+ * @url https://sergii-melnykov.github.io/ui/?path=/docs/molecules-rhf-rhftextfield--docs
41
+ *
42
+ * * @example
43
+ * ```tsx
44
+ * <Form>
45
+ * <RHFTextField name="name" label="Name" />
46
+ * <RHFTextField name="email" label="Email" />
47
+ * </Form>
48
+ * ```
49
+ */
50
+ declare function RHFTextField<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ name, label, description, className, type, warningText, required, disabled, readOnly, placeholder, "aria-label": ariaLabel, "aria-describedby": ariaDescribedby, onBlur, ...other }: RHFTextFieldProps<TFieldValues, TName>): react_jsx_runtime.JSX.Element;
51
+
52
+ interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
53
+ /**
54
+ * Whether the textarea should automatically resize
55
+ */
56
+ autoResize?: boolean;
57
+ }
58
+
59
+ /**
60
+ * Textarea component for creating accessible text areas.
61
+ * Built on top of shadcn/ui's Textarea component.
62
+ *
63
+ * @url https://sergii-melnykov.github.io/ui/?path=/docs/atoms-textarea--docs
64
+ *
65
+ * @example
66
+ * ```tsx
67
+ * <Textarea placeholder="Enter text" />
68
+ * ```
69
+ */
70
+ declare const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
71
+
72
+ interface RHFTextareaProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> extends Omit<React.ComponentProps<typeof Textarea>, "name"> {
73
+ /** The name of the field in the form */
74
+ name: TName;
75
+ /** Optional label for the field */
76
+ label?: string;
77
+ /** Optional description text below the field */
78
+ description?: string;
79
+ /** Optional warning text to display */
80
+ warningText?: string;
81
+ /** Whether the field is required */
82
+ required?: boolean;
83
+ /** Whether the field is disabled */
84
+ disabled?: boolean;
85
+ /** Whether the field is read-only */
86
+ readOnly?: boolean;
87
+ /** Optional placeholder text */
88
+ placeholder?: string;
89
+ /** Optional aria-label for accessibility */
90
+ "aria-label"?: string;
91
+ /** Optional aria-describedby for accessibility */
92
+ "aria-describedby"?: string;
93
+ /** Whether the textarea should automatically resize */
94
+ autoResize?: boolean;
95
+ }
96
+
97
+ /**
98
+ * A textarea component that integrates with React Hook Form.
99
+ * Provides form validation, error handling, and accessibility features.
100
+ *
101
+ * @url https://sergii-melnykov.github.io/ui/?path=/docs/molecules-rhf-rhftextarea--docs
102
+ *
103
+ * @example
104
+ * ```tsx
105
+ * <Form>
106
+ * <RHFTextarea name="description" label="Description" />
107
+ * </Form>
108
+ * ```
109
+ */
110
+ declare function RHFTextarea<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ name, label, description, className, warningText, required, disabled, readOnly, placeholder, autoResize, "aria-label": ariaLabel, "aria-describedby": ariaDescribedby, onBlur, ...other }: RHFTextareaProps<TFieldValues, TName>): react_jsx_runtime.JSX.Element;
111
+
112
+ declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>(props: react_hook_form.FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
113
+ declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: ControllerProps<TFieldValues, TName>) => react_jsx_runtime.JSX.Element;
114
+ declare const useFormField: () => {
115
+ invalid: boolean;
116
+ isDirty: boolean;
117
+ isTouched: boolean;
118
+ isValidating: boolean;
119
+ error?: react_hook_form.FieldError;
120
+ id: string;
121
+ name: string;
122
+ formItemId: string;
123
+ formDescriptionId: string;
124
+ formMessageId: string;
125
+ };
126
+ declare const FormItem: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
127
+ declare const FormLabel: React.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & React.RefAttributes<HTMLLabelElement>>;
128
+ declare const FormControl: React.ForwardRefExoticComponent<Omit<_radix_ui_react_slot.SlotProps & React.RefAttributes<HTMLElement>, "ref"> & React.RefAttributes<HTMLElement>>;
129
+ declare const FormDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
130
+ declare const FormMessage: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
131
+
132
+ /**
133
+ * Props interface for the Form component.
134
+ * Extends react-hook-form's FormProvider props.
135
+ */
136
+ interface FormProps<TFieldValues extends FieldValues = FieldValues> {
137
+ /**
138
+ * The form context value
139
+ */
140
+ context: React.Context<TFieldValues>;
141
+ /**
142
+ * The form children
143
+ */
144
+ children: React.ReactNode;
145
+ }
146
+ /**
147
+ * Props interface for the FormField component.
148
+ * Extends react-hook-form's Controller props.
149
+ */
150
+ interface FormFieldProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> extends ControllerProps<TFieldValues, TName> {
151
+ }
152
+ /**
153
+ * Props interface for the FormItem component.
154
+ * Extends HTML div attributes.
155
+ */
156
+ interface FormItemProps extends React.HTMLAttributes<HTMLDivElement> {
157
+ }
158
+ /**
159
+ * Props interface for the FormLabel component.
160
+ * Extends Radix UI Label props.
161
+ */
162
+ interface FormLabelProps extends React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> {
163
+ }
164
+ /**
165
+ * Props interface for the FormControl component.
166
+ * Extends Radix UI Slot props.
167
+ */
168
+ interface FormControlProps extends React.ComponentPropsWithoutRef<typeof Slot> {
169
+ }
170
+ /**
171
+ * Props interface for the FormDescription component.
172
+ * Extends HTML paragraph attributes.
173
+ */
174
+ interface FormDescriptionProps extends React.HTMLAttributes<HTMLParagraphElement> {
175
+ }
176
+ /**
177
+ * Props interface for the FormMessage component.
178
+ * Extends HTML paragraph attributes.
179
+ */
180
+ interface FormMessageProps extends React.HTMLAttributes<HTMLParagraphElement> {
181
+ /**
182
+ * The message content
183
+ */
184
+ children?: React.ReactNode;
185
+ }
186
+ /**
187
+ * Context value type for form field context
188
+ */
189
+ type FormFieldContextValue<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = {
190
+ name: TName;
191
+ };
192
+ /**
193
+ * Context value type for form item context
194
+ */
195
+ type FormItemContextValue = {
196
+ id: string;
197
+ };
198
+
199
+ export { Form, FormControl, type FormControlProps, FormDescription, type FormDescriptionProps, FormField, type FormFieldContextValue, type FormFieldProps, FormItem, type FormItemContextValue, type FormItemProps, FormLabel, type FormLabelProps, FormMessage, type FormMessageProps, type FormProps, RHFTextField, RHFTextarea, useFormField };
package/dist/rhf.d.ts ADDED
@@ -0,0 +1,199 @@
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 { TextareaHTMLAttributes } from 'react';
6
+ import { I as Input } from './input-Ruz0ZoY6.js';
7
+ import * as _radix_ui_react_slot from '@radix-ui/react-slot';
8
+ import { Slot } from '@radix-ui/react-slot';
9
+ import * as LabelPrimitive from '@radix-ui/react-label';
10
+
11
+ interface RHFTextFieldProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> extends Omit<React.ComponentProps<typeof Input>, "name"> {
12
+ /** The name of the field in the form */
13
+ name: TName;
14
+ /** Optional label for the field */
15
+ label?: string;
16
+ /** Optional description text below the field */
17
+ description?: string;
18
+ /** Optional warning text to display */
19
+ warningText?: string;
20
+ /** Whether the field is required */
21
+ required?: boolean;
22
+ /** Whether the field is disabled */
23
+ disabled?: boolean;
24
+ /** Whether the field is read-only */
25
+ readOnly?: boolean;
26
+ /** The type of input (text, number, email, etc.) */
27
+ type?: React.HTMLInputTypeAttribute;
28
+ /** Optional placeholder text */
29
+ placeholder?: string;
30
+ /** Optional aria-label for accessibility */
31
+ "aria-label"?: string;
32
+ /** Optional aria-describedby for accessibility */
33
+ "aria-describedby"?: string;
34
+ }
35
+
36
+ /**
37
+ * A text field component that integrates with React Hook Form.
38
+ * Provides form validation, error handling, and accessibility features.
39
+ *
40
+ * @url https://sergii-melnykov.github.io/ui/?path=/docs/molecules-rhf-rhftextfield--docs
41
+ *
42
+ * * @example
43
+ * ```tsx
44
+ * <Form>
45
+ * <RHFTextField name="name" label="Name" />
46
+ * <RHFTextField name="email" label="Email" />
47
+ * </Form>
48
+ * ```
49
+ */
50
+ declare function RHFTextField<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ name, label, description, className, type, warningText, required, disabled, readOnly, placeholder, "aria-label": ariaLabel, "aria-describedby": ariaDescribedby, onBlur, ...other }: RHFTextFieldProps<TFieldValues, TName>): react_jsx_runtime.JSX.Element;
51
+
52
+ interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
53
+ /**
54
+ * Whether the textarea should automatically resize
55
+ */
56
+ autoResize?: boolean;
57
+ }
58
+
59
+ /**
60
+ * Textarea component for creating accessible text areas.
61
+ * Built on top of shadcn/ui's Textarea component.
62
+ *
63
+ * @url https://sergii-melnykov.github.io/ui/?path=/docs/atoms-textarea--docs
64
+ *
65
+ * @example
66
+ * ```tsx
67
+ * <Textarea placeholder="Enter text" />
68
+ * ```
69
+ */
70
+ declare const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
71
+
72
+ interface RHFTextareaProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> extends Omit<React.ComponentProps<typeof Textarea>, "name"> {
73
+ /** The name of the field in the form */
74
+ name: TName;
75
+ /** Optional label for the field */
76
+ label?: string;
77
+ /** Optional description text below the field */
78
+ description?: string;
79
+ /** Optional warning text to display */
80
+ warningText?: string;
81
+ /** Whether the field is required */
82
+ required?: boolean;
83
+ /** Whether the field is disabled */
84
+ disabled?: boolean;
85
+ /** Whether the field is read-only */
86
+ readOnly?: boolean;
87
+ /** Optional placeholder text */
88
+ placeholder?: string;
89
+ /** Optional aria-label for accessibility */
90
+ "aria-label"?: string;
91
+ /** Optional aria-describedby for accessibility */
92
+ "aria-describedby"?: string;
93
+ /** Whether the textarea should automatically resize */
94
+ autoResize?: boolean;
95
+ }
96
+
97
+ /**
98
+ * A textarea component that integrates with React Hook Form.
99
+ * Provides form validation, error handling, and accessibility features.
100
+ *
101
+ * @url https://sergii-melnykov.github.io/ui/?path=/docs/molecules-rhf-rhftextarea--docs
102
+ *
103
+ * @example
104
+ * ```tsx
105
+ * <Form>
106
+ * <RHFTextarea name="description" label="Description" />
107
+ * </Form>
108
+ * ```
109
+ */
110
+ declare function RHFTextarea<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ name, label, description, className, warningText, required, disabled, readOnly, placeholder, autoResize, "aria-label": ariaLabel, "aria-describedby": ariaDescribedby, onBlur, ...other }: RHFTextareaProps<TFieldValues, TName>): react_jsx_runtime.JSX.Element;
111
+
112
+ declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>(props: react_hook_form.FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
113
+ declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: ControllerProps<TFieldValues, TName>) => react_jsx_runtime.JSX.Element;
114
+ declare const useFormField: () => {
115
+ invalid: boolean;
116
+ isDirty: boolean;
117
+ isTouched: boolean;
118
+ isValidating: boolean;
119
+ error?: react_hook_form.FieldError;
120
+ id: string;
121
+ name: string;
122
+ formItemId: string;
123
+ formDescriptionId: string;
124
+ formMessageId: string;
125
+ };
126
+ declare const FormItem: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
127
+ declare const FormLabel: React.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & React.RefAttributes<HTMLLabelElement>>;
128
+ declare const FormControl: React.ForwardRefExoticComponent<Omit<_radix_ui_react_slot.SlotProps & React.RefAttributes<HTMLElement>, "ref"> & React.RefAttributes<HTMLElement>>;
129
+ declare const FormDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
130
+ declare const FormMessage: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
131
+
132
+ /**
133
+ * Props interface for the Form component.
134
+ * Extends react-hook-form's FormProvider props.
135
+ */
136
+ interface FormProps<TFieldValues extends FieldValues = FieldValues> {
137
+ /**
138
+ * The form context value
139
+ */
140
+ context: React.Context<TFieldValues>;
141
+ /**
142
+ * The form children
143
+ */
144
+ children: React.ReactNode;
145
+ }
146
+ /**
147
+ * Props interface for the FormField component.
148
+ * Extends react-hook-form's Controller props.
149
+ */
150
+ interface FormFieldProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> extends ControllerProps<TFieldValues, TName> {
151
+ }
152
+ /**
153
+ * Props interface for the FormItem component.
154
+ * Extends HTML div attributes.
155
+ */
156
+ interface FormItemProps extends React.HTMLAttributes<HTMLDivElement> {
157
+ }
158
+ /**
159
+ * Props interface for the FormLabel component.
160
+ * Extends Radix UI Label props.
161
+ */
162
+ interface FormLabelProps extends React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> {
163
+ }
164
+ /**
165
+ * Props interface for the FormControl component.
166
+ * Extends Radix UI Slot props.
167
+ */
168
+ interface FormControlProps extends React.ComponentPropsWithoutRef<typeof Slot> {
169
+ }
170
+ /**
171
+ * Props interface for the FormDescription component.
172
+ * Extends HTML paragraph attributes.
173
+ */
174
+ interface FormDescriptionProps extends React.HTMLAttributes<HTMLParagraphElement> {
175
+ }
176
+ /**
177
+ * Props interface for the FormMessage component.
178
+ * Extends HTML paragraph attributes.
179
+ */
180
+ interface FormMessageProps extends React.HTMLAttributes<HTMLParagraphElement> {
181
+ /**
182
+ * The message content
183
+ */
184
+ children?: React.ReactNode;
185
+ }
186
+ /**
187
+ * Context value type for form field context
188
+ */
189
+ type FormFieldContextValue<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = {
190
+ name: TName;
191
+ };
192
+ /**
193
+ * Context value type for form item context
194
+ */
195
+ type FormItemContextValue = {
196
+ id: string;
197
+ };
198
+
199
+ export { Form, FormControl, type FormControlProps, FormDescription, type FormDescriptionProps, FormField, type FormFieldContextValue, type FormFieldProps, FormItem, type FormItemContextValue, type FormItemProps, FormLabel, type FormLabelProps, FormMessage, type FormMessageProps, type FormProps, RHFTextField, RHFTextarea, useFormField };
@@ -0,0 +1,2 @@
1
+ import {a as a$1}from'./chunk-7NN2L46N.esm.js';import {a as a$2}from'./chunk-EBPUGBUT.esm.js';import {a}from'./chunk-C26U3FL4.esm.js';import {useFormContext,FormProvider,Controller}from'react-hook-form';import*as l from'react';import {Slot}from'@radix-ui/react-slot';import {jsx,jsxs}from'react/jsx-runtime';var z=FormProvider,D=l.createContext({}),g=({...e})=>jsx(D.Provider,{value:{name:e.name},children:jsx(Controller,{...e})}),C=()=>{let e=l.useContext(D),r=l.useContext(S),{getFieldState:o,formState:m}=useFormContext(),a=o(e.name,m);if(!e)throw new Error("useFormField should be used within <FormField>");let{id:t}=r;return {id:t,name:e.name,formItemId:`${t}-form-item`,formDescriptionId:`${t}-form-item-description`,formMessageId:`${t}-form-item-message`,...a}},S=l.createContext({}),f=l.forwardRef(({className:e,...r},o)=>{let m=l.useId();return jsx(S.Provider,{value:{id:m},children:jsx("div",{ref:o,className:a("space-y-2",e),...r})})});f.displayName="FormItem";var x=l.forwardRef(({className:e,...r},o)=>{let{error:m,formItemId:a$2}=C();return jsx(a$1,{ref:o,className:a(m&&"text-destructive",e),htmlFor:a$2,...r})});x.displayName="FormLabel";var b=l.forwardRef(({...e},r)=>{let{error:o,formItemId:m,formDescriptionId:a,formMessageId:t}=C();return jsx(Slot,{ref:r,id:m,"aria-describedby":o?`${a} ${t}`:`${a}`,"aria-invalid":!!o,...e})});b.displayName="FormControl";var T=l.forwardRef(({className:e,...r},o)=>{let{formDescriptionId:m}=C();return jsx("p",{ref:o,id:m,className:a("text-sm text-muted-foreground",e),...r})});T.displayName="FormDescription";var v=l.forwardRef(({className:e,children:r,...o},m)=>{let{error:a$1,formMessageId:t}=C(),i=a$1?String(a$1?.message??""):r;return i?jsx("p",{ref:m,id:t,className:a("text-sm font-medium text-destructive",e),...o,children:i}):null});v.displayName="FormMessage";function ae({name:e,label:r,description:o,className:m,type:a$1="text",warningText:t,required:i,disabled:y,readOnly:P,placeholder:h,"aria-label":V,"aria-describedby":I,onBlur:N,...L}){let{control:M}=useFormContext();return jsx(g,{name:e,control:M,render:({field:s,fieldState:{error:n}})=>jsxs(f,{children:[r&&jsxs(x,{children:[r,i&&jsx("span",{className:"text-destructive ml-1",children:"*"})]}),jsx(b,{children:jsx(a$2,{...s,type:a$1,value:a$1==="number"&&s.value===0?"":s.value,onChange:F=>{a$1==="number"?s.onChange(Number(F.target.value)):s.onChange(F.target.value);},onBlur:F=>{a$1!=="number"&&typeof s.value=="string"&&s.onChange(s.value.trim()),s.onBlur(),N?.(F);},className:a(n&&"border-destructive focus-visible:ring-destructive",m),disabled:y,readOnly:P,required:i,placeholder:h,"aria-label":V,"aria-describedby":I,"aria-invalid":!!n,"aria-required":i,...L})}),o&&jsx(T,{children:o}),n&&jsx(v,{children:n.message}),!n&&t&&jsx("p",{className:"text-sm text-yellow-600 dark:text-yellow-500",role:"alert",children:t})]})})}var H=l.forwardRef(({className:e,autoResize:r=false,...o},m)=>{let a$1=l.useRef(null);return l.useEffect(()=>{if(!r||!a$1.current)return;let t=a$1.current,i=()=>{t.style.height="auto",t.style.height=`${t.scrollHeight}px`;};return t.addEventListener("input",i),i(),()=>t.removeEventListener("input",i)},[r]),jsx("textarea",{className:a("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:m,...o})});H.displayName="Textarea";function pe({name:e,label:r,description:o,className:m,warningText:a$1,required:t,disabled:i,readOnly:y,placeholder:P,autoResize:h,"aria-label":V,"aria-describedby":I,onBlur:N,...L}){let{control:M}=useFormContext();return jsx(g,{name:e,control:M,render:({field:s,fieldState:{error:n}})=>jsxs(f,{children:[r&&jsxs(x,{children:[r,t&&jsx("span",{className:"text-destructive ml-1",children:"*"})]}),jsx(b,{children:jsx(H,{...s,value:s.value,onChange:F=>{s.onChange(F.target.value);},onBlur:F=>{typeof s.value=="string"&&s.onChange(s.value.trim()),s.onBlur(),N?.(F);},className:a(n&&"border-destructive focus-visible:ring-destructive",m),disabled:i,readOnly:y,required:t,placeholder:P,"aria-label":V,"aria-describedby":I,"aria-invalid":!!n,"aria-required":t,autoResize:h,...L})}),o&&jsx(T,{children:o}),n&&jsx(v,{children:n.message}),!n&&a$1&&jsx("p",{className:"text-sm text-yellow-600 dark:text-yellow-500",role:"alert",children:a$1})]})})}export{z as Form,b as FormControl,T as FormDescription,g as FormField,f as FormItem,x as FormLabel,v as FormMessage,ae as RHFTextField,pe as RHFTextarea,C as useFormField};//# sourceMappingURL=rhf.esm.js.map
2
+ //# sourceMappingURL=rhf.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/rhf/form/form.tsx","../src/components/rhf/rhf-text-field/rhf-text-field.tsx","../src/components/atoms/textarea/textarea.tsx","../src/components/rhf/rhf-textarea/rhf-textarea.tsx"],"names":["Form","FormProvider","FormFieldContext","FormField","props","jsx","Controller","useFormField","fieldContext","itemContext","FormItemContext","getFieldState","formState","useFormContext","fieldState","id","FormItem","className","ref","cn","FormLabel","error","formItemId","Label","FormControl","formDescriptionId","formMessageId","Slot","FormDescription","FormMessage","children","body","RHFTextField","name","label","description","type","warningText","required","disabled","readOnly","placeholder","ariaLabel","ariaDescribedby","onBlur","other","control","field","jsxs","Input","e","Textarea","R","autoResize","internalRef","textarea","resizeTextarea","RHF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AAE,CAAA,MAAA,CAAO,KAAK,EAC/B,CACA,CAAA,MAAA,CAASA,GAAM,CAET,OAAOH,EAAM,KAAU,EAAA,QAAA,EACzBA,EAAM,QAASA,CAAAA,CAAAA,CAAM,KAAM,CAAA,IAAA,EAAM,CAAA,CAEnCA,EAAM,MAAO,EAAA,CACbH,CAASM,GAAAA,CAAC,EACZ,CAAA,CACA,UAAW/B,CACTE,CAAAA,CAAAA,EAAS,mDACTJ,CAAAA,CACF,CACA,CAAA,QAAA,CAAUsB,EACV,QAAUC,CAAAA,CAAAA,CACV,SAAUF,CACV,CAAA,WAAA,CAAaG,EACb,YAAYC,CAAAA,CAAAA,CACZ,kBAAkBC,CAAAA,CAAAA,CAClB,cAAc,CAAA,CAAC,CAACtB,CAChB,CAAA,eAAA,CAAeiB,EACf,UAAYe,CAAAA,CAAAA,CACX,GAAGR,CACN,CAAA,CAAA,CACF,CACCV,CAAAA,CAAAA,EAAe9B,GAACuB,CAAAA,CAAAA,CAAA,CAAiB,QAAAO,CAAAA,CAAAA,CAAY,EAC7Cd,CAAShB,EAAAA,GAAAA,CAACwB,EAAA,CAAa,QAAA,CAAAR,CAAM,CAAA,OAAA,CAAQ,CACrC,CAAA,CAACA,GAASgB,GACThC,EAAAA,GAAAA,CAAC,GAAE,CAAA,CAAA,SAAA,CAAU,8CAA+C,CAAA,IAAA,CAAK,QAC9D,QAAAgC,CAAAA,GAAAA,CACH,CAEJ,CAAA,CAAA,CAAA,CAEJ,CAEJ","file":"rhf.esm.js","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 type ControllerProps,\n type FieldPath,\n type FieldValues\n} from \"react-hook-form\"\n\nimport { cn } from \"@/utils/cn\"\nimport { Label } from \"@/components/atoms/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>({} as FormFieldContextValue)\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, formState } = useFormContext()\n\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>({} as FormItemContextValue)\n\nconst FormItem = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => {\n const id = React.useId()\n\n return (\n <FormItemContext.Provider value={{ id }}>\n <div ref={ref} className={cn(\"space-y-2\", className)} {...props} />\n </FormItemContext.Provider>\n )\n }\n)\nFormItem.displayName = \"FormItem\"\n\nconst FormLabel = React.forwardRef<\n React.ElementRef<typeof LabelPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>\n>(({ className, ...props }, ref) => {\n const { error, formItemId } = useFormField()\n\n return (\n <Label\n ref={ref}\n className={cn(error && \"text-destructive\", className)}\n htmlFor={formItemId}\n {...props}\n />\n )\n})\nFormLabel.displayName = \"FormLabel\"\n\nconst FormControl = React.forwardRef<\n React.ElementRef<typeof Slot>,\n React.ComponentPropsWithoutRef<typeof Slot>\n>(({ ...props }, ref) => {\n const { error, formItemId, formDescriptionId, formMessageId } = useFormField()\n\n return (\n <Slot\n ref={ref}\n id={formItemId}\n aria-describedby={!error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`}\n aria-invalid={!!error}\n {...props}\n />\n )\n})\nFormControl.displayName = \"FormControl\"\n\nconst FormDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => {\n const { formDescriptionId } = useFormField()\n\n return (\n <p\n ref={ref}\n id={formDescriptionId}\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n )\n})\nFormDescription.displayName = \"FormDescription\"\n\nconst FormMessage = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, children, ...props }, ref) => {\n const { error, formMessageId } = useFormField()\n const body = error ? String(error?.message ?? \"\") : children\n\n if (!body) {\n return null\n }\n\n return (\n <p\n ref={ref}\n id={formMessageId}\n className={cn(\"text-sm font-medium text-destructive\", className)}\n {...props}\n >\n {body}\n </p>\n )\n})\nFormMessage.displayName = \"FormMessage\"\n\nexport {\n useFormField,\n Form,\n FormItem,\n FormLabel,\n FormControl,\n FormDescription,\n FormMessage,\n FormField\n}\n","import * as React from \"react\"\nimport { useFormContext, type FieldValues, type FieldPath } from \"react-hook-form\"\nimport { Input } from \"@/components/atoms/input\"\nimport { cn } from \"@/utils/cn\"\nimport {\n FormControl,\n FormItem,\n FormMessage,\n FormLabel,\n FormDescription,\n FormField\n} from \"@/components/rhf/form\"\nimport { type RHFTextFieldProps } from \"./rhf-text-field.types\"\n\n// ----------------------------------------------------------------------\n\n/**\n * A text field component that integrates with React Hook Form.\n * Provides form validation, error handling, and accessibility features.\n *\n * @url https://sergii-melnykov.github.io/ui/?path=/docs/molecules-rhf-rhftextfield--docs\n *\n * * @example\n * ```tsx\n * <Form>\n * <RHFTextField name=\"name\" label=\"Name\" />\n * <RHFTextField name=\"email\" label=\"Email\" />\n * </Form>\n * ```\n */\nexport function RHFTextField<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n>({\n name,\n label,\n description,\n className,\n type = \"text\",\n warningText,\n required,\n disabled,\n readOnly,\n placeholder,\n \"aria-label\": ariaLabel,\n \"aria-describedby\": ariaDescribedby,\n onBlur,\n ...other\n}: RHFTextFieldProps<TFieldValues, TName>) {\n const { control } = useFormContext<TFieldValues>()\n\n return (\n <FormField\n name={name}\n control={control}\n render={({ field, fieldState: { error } }) => (\n <FormItem>\n {label && (\n <FormLabel>\n {label}\n {required && <span className=\"text-destructive ml-1\">*</span>}\n </FormLabel>\n )}\n <FormControl>\n <Input\n {...field}\n type={type}\n value={type === \"number\" && field.value === 0 ? \"\" : field.value}\n onChange={(e) => {\n if (type === \"number\") {\n field.onChange(Number(e.target.value))\n } else {\n field.onChange(e.target.value)\n }\n }}\n onBlur={(e) => {\n // trim if a string\n if (type !== \"number\" && typeof field.value === \"string\") {\n field.onChange(field.value.trim())\n }\n field.onBlur() // pass to react-hook-form\n onBlur?.(e) // pass to wrapper\n }}\n className={cn(\n error && \"border-destructive focus-visible:ring-destructive\",\n className\n )}\n disabled={disabled}\n readOnly={readOnly}\n required={required}\n placeholder={placeholder}\n aria-label={ariaLabel}\n aria-describedby={ariaDescribedby}\n aria-invalid={!!error}\n aria-required={required}\n {...other}\n />\n </FormControl>\n {description && <FormDescription>{description}</FormDescription>}\n {error && <FormMessage>{error.message}</FormMessage>}\n {!error && warningText && (\n <p className=\"text-sm text-yellow-600 dark:text-yellow-500\" role=\"alert\">\n {warningText}\n </p>\n )}\n </FormItem>\n )}\n />\n )\n}\n","import * as React from \"react\"\nimport { cn } from \"@/utils/index\"\nimport { TextareaProps } from \"./textarea.types\"\n\n/**\n * Textarea component for creating accessible text areas.\n * Built on top of shadcn/ui's Textarea component.\n *\n * @url https://sergii-melnykov.github.io/ui/?path=/docs/atoms-textarea--docs\n *\n * @example\n * ```tsx\n * <Textarea placeholder=\"Enter text\" />\n * ```\n */\nconst Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(\n ({ className, autoResize = false, ...props }, ref) => {\n const internalRef = React.useRef<HTMLTextAreaElement>(null)\n\n React.useEffect(() => {\n if (!autoResize || !internalRef.current) return\n\n const textarea = internalRef.current\n const resizeTextarea = () => {\n textarea.style.height = \"auto\"\n textarea.style.height = `${textarea.scrollHeight}px`\n }\n\n textarea.addEventListener(\"input\", resizeTextarea)\n resizeTextarea() // Initial resize\n\n return () => textarea.removeEventListener(\"input\", resizeTextarea)\n }, [autoResize])\n\n return (\n <textarea\n className={cn(\n \"flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\",\n className\n )}\n ref={ref}\n {...props}\n />\n )\n }\n)\n\nTextarea.displayName = \"Textarea\"\n\nexport { Textarea }\n","import * as React from \"react\"\nimport { useFormContext, type FieldValues, type FieldPath } from \"react-hook-form\"\nimport { Textarea } from \"@/components/atoms/textarea\"\nimport { cn } from \"@/utils/cn\"\nimport {\n FormControl,\n FormItem,\n FormMessage,\n FormLabel,\n FormDescription,\n FormField\n} from \"@/components/rhf/form\"\nimport { type RHFTextareaProps } from \"./rhf-textarea.types\"\n\n// ----------------------------------------------------------------------\n\n/**\n * A textarea component that integrates with React Hook Form.\n * Provides form validation, error handling, and accessibility features.\n *\n * @url https://sergii-melnykov.github.io/ui/?path=/docs/molecules-rhf-rhftextarea--docs\n *\n * @example\n * ```tsx\n * <Form>\n * <RHFTextarea name=\"description\" label=\"Description\" />\n * </Form>\n * ```\n */\nexport function RHFTextarea<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n>({\n name,\n label,\n description,\n className,\n warningText,\n required,\n disabled,\n readOnly,\n placeholder,\n autoResize,\n \"aria-label\": ariaLabel,\n \"aria-describedby\": ariaDescribedby,\n onBlur,\n ...other\n}: RHFTextareaProps<TFieldValues, TName>) {\n const { control } = useFormContext<TFieldValues>()\n\n return (\n <FormField\n name={name}\n control={control}\n render={({ field, fieldState: { error } }) => (\n <FormItem>\n {label && (\n <FormLabel>\n {label}\n {required && <span className=\"text-destructive ml-1\">*</span>}\n </FormLabel>\n )}\n <FormControl>\n <Textarea\n {...field}\n value={field.value}\n onChange={(e) => {\n field.onChange(e.target.value)\n }}\n onBlur={(e) => {\n // trim if a string\n if (typeof field.value === \"string\") {\n field.onChange(field.value.trim())\n }\n field.onBlur() // pass to react-hook-form\n onBlur?.(e) // pass to wrapper\n }}\n className={cn(\n error && \"border-destructive focus-visible:ring-destructive\",\n className\n )}\n disabled={disabled}\n readOnly={readOnly}\n required={required}\n placeholder={placeholder}\n aria-label={ariaLabel}\n aria-describedby={ariaDescribedby}\n aria-invalid={!!error}\n aria-required={required}\n autoResize={autoResize}\n {...other}\n />\n </FormControl>\n {description && <FormDescription>{description}</FormDescription>}\n {error && <FormMessage>{error.message}</FormMessage>}\n {!error && warningText && (\n <p className=\"text-sm text-yellow-600 dark:text-yellow-500\" role=\"alert\">\n {warningText}\n </p>\n )}\n </FormItem>\n )}\n />\n )\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@me1a/ui",
3
- "version": "2.1.4",
3
+ "version": "2.1.6",
4
4
  "private": false,
5
5
  "main": "./dist/index.cjs.js",
6
6
  "module": "./dist/index.esm.js",
@@ -21,6 +21,11 @@
21
21
  "import": "./dist/molecules.esm.js",
22
22
  "require": "./dist/molecules.cjs.js"
23
23
  },
24
+ "./rhf": {
25
+ "types": "./dist/rhf.d.ts",
26
+ "import": "./dist/rhf.esm.js",
27
+ "require": "./dist/rhf.cjs.js"
28
+ },
24
29
  "./organisms": {
25
30
  "types": "./dist/organisms.d.ts",
26
31
  "import": "./dist/organisms.esm.js",
@@ -1,2 +0,0 @@
1
- import {a as a$1}from'./chunk-7NN2L46N.esm.js';import {a as a$2}from'./chunk-EBPUGBUT.esm.js';import {a}from'./chunk-C26U3FL4.esm.js';import*as l from'react';import {jsx,jsxs}from'react/jsx-runtime';import*as i from'@radix-ui/react-navigation-menu';import {ChevronDown}from'lucide-react';import {cva}from'class-variance-authority';import {useFormContext,FormProvider,Controller}from'react-hook-form';import {Slot}from'@radix-ui/react-slot';var Y=l.forwardRef(({className:e,...t},a$1)=>jsx("div",{ref:a$1,className:a("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));Y.displayName="Card";var Z=l.forwardRef(({className:e,...t},a$1)=>jsx("div",{ref:a$1,className:a("flex flex-col space-y-1.5 p-6",e),...t}));Z.displayName="CardHeader";var _=l.forwardRef(({className:e,...t},a$1)=>jsx("h3",{ref:a$1,className:a("text-2xl font-semibold leading-none tracking-tight",e),...t}));_.displayName="CardTitle";var ee=l.forwardRef(({className:e,...t},a$1)=>jsx("p",{ref:a$1,className:a("text-sm text-muted-foreground",e),...t}));ee.displayName="CardDescription";var te=l.forwardRef(({className:e,...t},a$1)=>jsx("div",{ref:a$1,className:a("p-6 pt-0",e),...t}));te.displayName="CardContent";var ae=l.forwardRef(({className:e,...t},a$1)=>jsx("div",{ref:a$1,className:a("flex items-center p-6 pt-0",e),...t}));ae.displayName="CardFooter";var B=cva("group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[state=open]:bg-accent/50",{variants:{variant:{default:"text-foreground",ghost:"hover:bg-transparent hover:underline",link:"text-primary underline-offset-4 hover:underline",mobile:"w-full justify-between border-b border-border py-4 text-base font-medium"}},defaultVariants:{variant:"default"}});var O=l.forwardRef(({className:e,children:t,...a$1},n)=>jsxs(i.Root,{ref:n,className:a("relative z-10 flex max-w-max flex-1 items-center justify-center",e),...a$1,children:[t,jsx(S,{})]}));O.displayName=i.Root.displayName;var W=l.forwardRef(({className:e,...t},a$1)=>jsx(i.List,{ref:a$1,className:a("group flex flex-1 list-none items-center justify-center space-x-1",e),...t}));W.displayName=i.List.displayName;var ie=i.Item,j=l.forwardRef(({className:e,children:t,variant:a$1,...n},r)=>jsxs(i.Trigger,{ref:r,className:a(B({variant:a$1}),e),...n,children:[t," ",jsx(ChevronDown,{className:"relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180","aria-hidden":"true"})]}));j.displayName=i.Trigger.displayName;var q=l.forwardRef(({className:e,...t},a$1)=>jsx(i.Content,{ref:a$1,className:a("left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto",e),...t}));q.displayName=i.Content.displayName;var ne=i.Link,S=l.forwardRef(({className:e,...t},a$1)=>jsx("div",{className:a("absolute left-0 top-full flex justify-center"),children:jsx(i.Viewport,{className:a("origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]",e),ref:a$1,...t})}));S.displayName=i.Viewport.displayName;var G=l.forwardRef(({className:e,...t},a$1)=>jsx(i.Indicator,{ref:a$1,className:a("top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in",e),...t,children:jsx("div",{className:"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md"})}));G.displayName=i.Indicator.displayName;var ue=FormProvider,K=l.createContext({}),h=({...e})=>jsx(K.Provider,{value:{name:e.name},children:jsx(Controller,{...e})}),C=()=>{let e=l.useContext(K),t=l.useContext(Q),{getFieldState:a,formState:n}=useFormContext(),r=a(e.name,n);if(!e)throw new Error("useFormField should be used within <FormField>");let{id:s}=t;return {id:s,name:e.name,formItemId:`${s}-form-item`,formDescriptionId:`${s}-form-item-description`,formMessageId:`${s}-form-item-message`,...r}},Q=l.createContext({}),x=l.forwardRef(({className:e,...t},a$1)=>{let n=l.useId();return jsx(Q.Provider,{value:{id:n},children:jsx("div",{ref:a$1,className:a("space-y-2",e),...t})})});x.displayName="FormItem";var R=l.forwardRef(({className:e,...t},a$2)=>{let{error:n,formItemId:r}=C();return jsx(a$1,{ref:a$2,className:a(n&&"text-destructive",e),htmlFor:r,...t})});R.displayName="FormLabel";var P=l.forwardRef(({...e},t)=>{let{error:a,formItemId:n,formDescriptionId:r,formMessageId:s}=C();return jsx(Slot,{ref:t,id:n,"aria-describedby":a?`${r} ${s}`:`${r}`,"aria-invalid":!!a,...e})});P.displayName="FormControl";var b=l.forwardRef(({className:e,...t},a$1)=>{let{formDescriptionId:n}=C();return jsx("p",{ref:a$1,id:n,className:a("text-sm text-muted-foreground",e),...t})});b.displayName="FormDescription";var y=l.forwardRef(({className:e,children:t,...a$1},n)=>{let{error:r,formMessageId:s}=C(),d=r?String(r?.message??""):t;return d?jsx("p",{ref:n,id:s,className:a("text-sm font-medium text-destructive",e),...a$1,children:d}):null});y.displayName="FormMessage";function ze({name:e,label:t,description:a$1,className:n,type:r="text",warningText:s,required:d,disabled:L,readOnly:w,placeholder:V,"aria-label":I,"aria-describedby":H,onBlur:E,...D}){let{control:A}=useFormContext();return jsx(h,{name:e,control:A,render:({field:m,fieldState:{error:u}})=>jsxs(x,{children:[t&&jsxs(R,{children:[t,d&&jsx("span",{className:"text-destructive ml-1",children:"*"})]}),jsx(P,{children:jsx(a$2,{...m,type:r,value:r==="number"&&m.value===0?"":m.value,onChange:p=>{r==="number"?m.onChange(Number(p.target.value)):m.onChange(p.target.value);},onBlur:p=>{r!=="number"&&typeof m.value=="string"&&m.onChange(m.value.trim()),m.onBlur(),E?.(p);},className:a(u&&"border-destructive focus-visible:ring-destructive",n),disabled:L,readOnly:w,required:d,placeholder:V,"aria-label":I,"aria-describedby":H,"aria-invalid":!!u,"aria-required":d,...D})}),a$1&&jsx(b,{children:a$1}),u&&jsx(y,{children:u.message}),!u&&s&&jsx("p",{className:"text-sm text-yellow-600 dark:text-yellow-500",role:"alert",children:s})]})})}var k=l.forwardRef(({className:e,autoResize:t=false,...a$1},n)=>{let r=l.useRef(null);return l.useEffect(()=>{if(!t||!r.current)return;let s=r.current,d=()=>{s.style.height="auto",s.style.height=`${s.scrollHeight}px`;};return s.addEventListener("input",d),d(),()=>s.removeEventListener("input",d)},[t]),jsx("textarea",{className:a("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...a$1})});k.displayName="Textarea";function Ue({name:e,label:t,description:a$1,className:n,warningText:r,required:s,disabled:d,readOnly:L,placeholder:w,autoResize:V,"aria-label":I,"aria-describedby":H,onBlur:E,...D}){let{control:A}=useFormContext();return jsx(h,{name:e,control:A,render:({field:m,fieldState:{error:u}})=>jsxs(x,{children:[t&&jsxs(R,{children:[t,s&&jsx("span",{className:"text-destructive ml-1",children:"*"})]}),jsx(P,{children:jsx(k,{...m,value:m.value,onChange:p=>{m.onChange(p.target.value);},onBlur:p=>{typeof m.value=="string"&&m.onChange(m.value.trim()),m.onBlur(),E?.(p);},className:a(u&&"border-destructive focus-visible:ring-destructive",n),disabled:d,readOnly:L,required:s,placeholder:w,"aria-label":I,"aria-describedby":H,"aria-invalid":!!u,"aria-required":s,autoResize:V,...D})}),a$1&&jsx(b,{children:a$1}),u&&jsx(y,{children:u.message}),!u&&r&&jsx("p",{className:"text-sm text-yellow-600 dark:text-yellow-500",role:"alert",children:r})]})})}export{Y as a,Z as b,_ as c,ee as d,te as e,ae as f,O as g,W as h,ie as i,j,q as k,ne as l,S as m,G as n,ue as o,h as p,C as q,x as r,R as s,P as t,b as u,y as v,ze as w,Ue as x};//# sourceMappingURL=chunk-JQGLWFDR.esm.js.map
2
- //# sourceMappingURL=chunk-JQGLWFDR.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/molecules/card/card.tsx","../src/components/molecules/navigation-menu/navigation-menu.variants.ts","../src/components/molecules/navigation-menu/navigation-menu.tsx","../src/components/molecules/rhf/rhf-text-field/rhf-text-field.tsx","../src/components/molecules/rhf/form/form.tsx","../src/components/atoms/textarea/textarea.tsx","../src/components/molecules/rhf/rhf-textarea/rhf-textarea.tsx"],"names":["Card","v","className","props","ref","jsx","cn","CardHeader","CardTitle","CardDescription","CardContent","CardFooter","navigationMenuTriggerStyle","cva","NavigationMenu","g","children","jsxs","NavigationMenuViewport","NavigationMenuList","NavigationMenuItem","NavigationMenuTrigger","variant","ChevronDown","NavigationMenuContent","NavigationMenuLink","NavigationMenuIndicator","Form","FormProvider","FormFieldContext","FormField","Controller","useFormField","fieldContext","itemContext","FormItemContext","getFieldState","formState","useFormContext","fieldState","id","FormItem","FormLabel","error","formItemId","Label","FormControl","formDescriptionId","formMessageId","Slot","FormDescription","FormMessage","body","RHFTextField","name","label","description","type","warningText","required","disabled","readOnly","placeholder","ariaLabel","ariaDescribedby","onBlur","other","control","field","Input","e","Textarea","T","autoResize","internalRef","textarea","resizeTextarea","RHFTextarea"],"mappings":"wbAwCMA,IAAAA,CAAAA,CAAaC,CACjB,CAAA,UAAA,CAAA,CAAC,CAAE,SAAAC,CAAAA,CAAAA,CAAW,GAAGC,CAAM,EAAGC,GACxBC,GAAAA,GAAAA,CAAC,KACC,CAAA,CAAA,GAAA,CAAKD,IACL,SAAWE,CAAAA,CAAAA,CAAG,0DAA4DJ,CAAAA,CAAS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B,gBAAegB,CACf,CAAA,UAAA,CAAYc,CACX,CAAA,GAAGP,EACN,CACF,CAAA,CAAA,CACCV,GAAenD,EAAAA,GAAAA,CAAC6C,EAAA,CAAiB,QAAA,CAAAM,GAAY,CAAA,CAAA,CAC7Cb,GAAStC,GAAC8C,CAAAA,CAAAA,CAAA,CAAa,QAAA,CAAAR,EAAM,OAAQ,CAAA,CAAA,CACrC,CAACA,CAAAA,EAASe,GACTrD,GAAC,CAAA,GAAA,CAAA,CAAE,SAAU,CAAA,8CAAA,CAA+C,KAAK,OAC9D,CAAA,QAAA,CAAAqD,CACH,CAAA,CAAA,CAAA,CAEJ,EAEJ,CAEJ","file":"chunk-JQGLWFDR.esm.js","sourcesContent":["/**\n * Card is a flexible container component that can be used to group related content and actions.\n * It provides a consistent visual style with a subtle border, shadow, and rounded corners.\n *\n */\nimport * as React from \"react\"\nimport { cn } from \"@/utils\"\n\n/**\n * The main card container component.\n * Provides the base styling for the card including border, shadow, and rounded corners.\n * * @url https://sergii-melnykov.github.io/ui/?path=/docs/molecules-card--docs\n *\n * @example\n * ```tsx\n * // Basic card\n * <Card>\n * <CardHeader>\n * <CardTitle>Card Title</CardTitle>\n * <CardDescription>Card Description</CardDescription>\n * </CardHeader>\n * <CardContent>\n * <p>Card content goes here.</p>\n * </CardContent>\n * <CardFooter>\n * <Button>Action</Button>\n * </CardFooter>\n * </Card>\n *\n * // Card with custom styling\n * <Card className=\"bg-primary text-primary-foreground\">\n * <CardHeader>\n * <CardTitle>Custom Styled Card</CardTitle>\n * </CardHeader>\n * <CardContent>\n * <p>This card has custom background and text colors.</p>\n * </CardContent>\n * </Card>\n * ```\n */\nconst Card = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"rounded-lg border bg-card text-card-foreground shadow-sm\", className)}\n {...props}\n />\n )\n)\nCard.displayName = \"Card\"\n\n/**\n * Header section of the card.\n * Typically contains the card title and description.\n * Includes padding and spacing for consistent layout.\n */\nconst CardHeader = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div ref={ref} className={cn(\"flex flex-col space-y-1.5 p-6\", className)} {...props} />\n )\n)\nCardHeader.displayName = \"CardHeader\"\n\n/**\n * Title component for the card.\n * Should be used within CardHeader.\n * Provides consistent typography styling for card titles.\n */\nconst CardTitle = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLHeadingElement>>(\n ({ className, ...props }, ref) => (\n <h3\n ref={ref}\n className={cn(\"text-2xl font-semibold leading-none tracking-tight\", className)}\n {...props}\n />\n )\n)\nCardTitle.displayName = \"CardTitle\"\n\n/**\n * Description component for the card.\n * Should be used within CardHeader.\n * Provides consistent typography styling for card descriptions.\n */\nconst CardDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => (\n <p ref={ref} className={cn(\"text-sm text-muted-foreground\", className)} {...props} />\n))\nCardDescription.displayName = \"CardDescription\"\n\n/**\n * Main content section of the card.\n * Includes padding and removes top padding to maintain consistent spacing with the header.\n */\nconst CardContent = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div ref={ref} className={cn(\"p-6 pt-0\", className)} {...props} />\n )\n)\nCardContent.displayName = \"CardContent\"\n\n/**\n * Footer section of the card.\n * Typically contains action buttons or additional information.\n * Includes padding and removes top padding to maintain consistent spacing with the content.\n */\nconst CardFooter = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div ref={ref} className={cn(\"flex items-center p-6 pt-0\", className)} {...props} />\n )\n)\nCardFooter.displayName = \"CardFooter\"\n\nexport { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent }\n","import { cva } from \"class-variance-authority\"\n\nexport const navigationMenuTriggerStyle = cva(\n \"group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[state=open]:bg-accent/50\",\n {\n variants: {\n variant: {\n default: \"text-foreground\",\n ghost: \"hover:bg-transparent hover:underline\",\n link: \"text-primary underline-offset-4 hover:underline\",\n mobile: \"w-full justify-between border-b border-border py-4 text-base font-medium\"\n }\n },\n defaultVariants: {\n variant: \"default\"\n }\n }\n)\n","import * as React from \"react\"\nimport * as NavigationMenuPrimitive from \"@radix-ui/react-navigation-menu\"\nimport { ChevronDown } from \"lucide-react\"\nimport { cn } from \"@/utils/index\"\nimport { navigationMenuTriggerStyle } from \"./navigation-menu.variants\"\nimport type {\n NavigationMenuProps,\n NavigationMenuListProps,\n NavigationMenuItemProps,\n NavigationMenuTriggerProps,\n NavigationMenuContentProps,\n NavigationMenuLinkProps,\n NavigationMenuViewportProps,\n NavigationMenuIndicatorProps\n} from \"./navigation-menu.types\"\n\n/**\n * NavigationMenu component for creating accessible navigation menus with dropdowns.\n * Built on top of Radix UI's NavigationMenu primitive.\n *\n * @url https://sergii-melnykov.github.io/ui/?path=/docs/molecules-navigation-menu--docs\n *\n * @example\n * ```tsx\n * <NavigationMenu>\n * <NavigationMenuList>\n * <NavigationMenuItem>\n * <NavigationMenuTrigger>Getting Started</NavigationMenuTrigger>\n * <NavigationMenuContent>\n * <ul className=\"grid gap-3 p-4 md:w-[400px] lg:w-[500px]\">\n * <li className=\"row-span-3\">\n * <NavigationMenuLink asChild>\n * <a className=\"flex h-full w-full select-none flex-col justify-end rounded-md bg-gradient-to-b from-muted/50 to-muted p-6 no-underline outline-none focus:shadow-md\">\n * <div className=\"mb-2 mt-4 text-lg font-medium\">shadcn/ui</div>\n * <p className=\"text-sm leading-tight text-muted-foreground\">\n * Beautifully designed components built with Radix UI and Tailwind CSS.\n * </p>\n * </a>\n * </NavigationMenuLink>\n * </li>\n * </ul>\n * </NavigationMenuContent>\n * </NavigationMenuItem>\n * </NavigationMenuList>\n * </NavigationMenu>\n * ```\n */\nconst NavigationMenu = React.forwardRef<\n React.ElementRef<typeof NavigationMenuPrimitive.Root>,\n NavigationMenuProps\n>(({ className, children, ...props }, ref) => (\n <NavigationMenuPrimitive.Root\n ref={ref}\n className={cn(\"relative z-10 flex max-w-max flex-1 items-center justify-center\", className)}\n {...props}\n >\n {children}\n <NavigationMenuViewport />\n </NavigationMenuPrimitive.Root>\n))\nNavigationMenu.displayName = NavigationMenuPrimitive.Root.displayName\n\nconst NavigationMenuList = React.forwardRef<\n React.ElementRef<typeof NavigationMenuPrimitive.List>,\n NavigationMenuListProps\n>(({ className, ...props }, ref) => (\n <NavigationMenuPrimitive.List\n ref={ref}\n className={cn(\"group flex flex-1 list-none items-center justify-center space-x-1\", className)}\n {...props}\n />\n))\nNavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName\n\nconst NavigationMenuItem = NavigationMenuPrimitive.Item\n\nconst NavigationMenuTrigger = React.forwardRef<\n React.ElementRef<typeof NavigationMenuPrimitive.Trigger>,\n NavigationMenuTriggerProps\n>(({ className, children, variant, ...props }, ref) => (\n <NavigationMenuPrimitive.Trigger\n ref={ref}\n className={cn(navigationMenuTriggerStyle({ variant }), className)}\n {...props}\n >\n {children}{\" \"}\n <ChevronDown\n className=\"relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180\"\n aria-hidden=\"true\"\n />\n </NavigationMenuPrimitive.Trigger>\n))\nNavigationMenuTrigger.displayName = NavigationMenuPrimitive.Trigger.displayName\n\nconst NavigationMenuContent = React.forwardRef<\n React.ElementRef<typeof NavigationMenuPrimitive.Content>,\n NavigationMenuContentProps\n>(({ className, ...props }, ref) => (\n <NavigationMenuPrimitive.Content\n ref={ref}\n className={cn(\n \"left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto\",\n className\n )}\n {...props}\n />\n))\nNavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName\n\nconst NavigationMenuLink = NavigationMenuPrimitive.Link\n\nconst NavigationMenuViewport = React.forwardRef<\n React.ElementRef<typeof NavigationMenuPrimitive.Viewport>,\n NavigationMenuViewportProps\n>(({ className, ...props }, ref) => (\n <div className={cn(\"absolute left-0 top-full flex justify-center\")}>\n <NavigationMenuPrimitive.Viewport\n className={cn(\n \"origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]\",\n className\n )}\n ref={ref}\n {...props}\n />\n </div>\n))\nNavigationMenuViewport.displayName = NavigationMenuPrimitive.Viewport.displayName\n\nconst NavigationMenuIndicator = React.forwardRef<\n React.ElementRef<typeof NavigationMenuPrimitive.Indicator>,\n NavigationMenuIndicatorProps\n>(({ className, ...props }, ref) => (\n <NavigationMenuPrimitive.Indicator\n ref={ref}\n className={cn(\n \"top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in\",\n className\n )}\n {...props}\n >\n <div className=\"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md\" />\n </NavigationMenuPrimitive.Indicator>\n))\nNavigationMenuIndicator.displayName = NavigationMenuPrimitive.Indicator.displayName\n\nexport {\n NavigationMenu,\n NavigationMenuList,\n NavigationMenuItem,\n NavigationMenuContent,\n NavigationMenuTrigger,\n NavigationMenuLink,\n NavigationMenuIndicator,\n NavigationMenuViewport\n}\n","import * as React from \"react\"\nimport { useFormContext, type FieldValues, type FieldPath } from \"react-hook-form\"\nimport { Input } from \"@/components/atoms/input\"\nimport {\n FormControl,\n FormItem,\n FormMessage,\n FormLabel,\n FormDescription,\n FormField\n} from \"@/components/molecules/rhf/form\"\nimport { cn } from \"@/utils/cn\"\nimport { type RHFTextFieldProps } from \"./rhf-text-field.types\"\n\n// ----------------------------------------------------------------------\n\n/**\n * A text field component that integrates with React Hook Form.\n * Provides form validation, error handling, and accessibility features.\n *\n * @url https://sergii-melnykov.github.io/ui/?path=/docs/molecules-rhf-rhftextfield--docs\n *\n * * @example\n * ```tsx\n * <Form>\n * <RHFTextField name=\"name\" label=\"Name\" />\n * <RHFTextField name=\"email\" label=\"Email\" />\n * </Form>\n * ```\n */\nexport function RHFTextField<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n>({\n name,\n label,\n description,\n className,\n type = \"text\",\n warningText,\n required,\n disabled,\n readOnly,\n placeholder,\n \"aria-label\": ariaLabel,\n \"aria-describedby\": ariaDescribedby,\n onBlur,\n ...other\n}: RHFTextFieldProps<TFieldValues, TName>) {\n const { control } = useFormContext<TFieldValues>()\n\n return (\n <FormField\n name={name}\n control={control}\n render={({ field, fieldState: { error } }) => (\n <FormItem>\n {label && (\n <FormLabel>\n {label}\n {required && <span className=\"text-destructive ml-1\">*</span>}\n </FormLabel>\n )}\n <FormControl>\n <Input\n {...field}\n type={type}\n value={type === \"number\" && field.value === 0 ? \"\" : field.value}\n onChange={(e) => {\n if (type === \"number\") {\n field.onChange(Number(e.target.value))\n } else {\n field.onChange(e.target.value)\n }\n }}\n onBlur={(e) => {\n // trim if a string\n if (type !== \"number\" && typeof field.value === \"string\") {\n field.onChange(field.value.trim())\n }\n field.onBlur() // pass to react-hook-form\n onBlur?.(e) // pass to wrapper\n }}\n className={cn(\n error && \"border-destructive focus-visible:ring-destructive\",\n className\n )}\n disabled={disabled}\n readOnly={readOnly}\n required={required}\n placeholder={placeholder}\n aria-label={ariaLabel}\n aria-describedby={ariaDescribedby}\n aria-invalid={!!error}\n aria-required={required}\n {...other}\n />\n </FormControl>\n {description && <FormDescription>{description}</FormDescription>}\n {error && <FormMessage>{error.message}</FormMessage>}\n {!error && warningText && (\n <p className=\"text-sm text-yellow-600 dark:text-yellow-500\" role=\"alert\">\n {warningText}\n </p>\n )}\n </FormItem>\n )}\n />\n )\n}\n","\"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 type ControllerProps,\n type FieldPath,\n type FieldValues\n} from \"react-hook-form\"\n\nimport { cn } from \"@/utils/cn\"\nimport { Label } from \"@/components/atoms/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>({} as FormFieldContextValue)\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, formState } = useFormContext()\n\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>({} as FormItemContextValue)\n\nconst FormItem = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => {\n const id = React.useId()\n\n return (\n <FormItemContext.Provider value={{ id }}>\n <div ref={ref} className={cn(\"space-y-2\", className)} {...props} />\n </FormItemContext.Provider>\n )\n }\n)\nFormItem.displayName = \"FormItem\"\n\nconst FormLabel = React.forwardRef<\n React.ElementRef<typeof LabelPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>\n>(({ className, ...props }, ref) => {\n const { error, formItemId } = useFormField()\n\n return (\n <Label\n ref={ref}\n className={cn(error && \"text-destructive\", className)}\n htmlFor={formItemId}\n {...props}\n />\n )\n})\nFormLabel.displayName = \"FormLabel\"\n\nconst FormControl = React.forwardRef<\n React.ElementRef<typeof Slot>,\n React.ComponentPropsWithoutRef<typeof Slot>\n>(({ ...props }, ref) => {\n const { error, formItemId, formDescriptionId, formMessageId } = useFormField()\n\n return (\n <Slot\n ref={ref}\n id={formItemId}\n aria-describedby={!error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`}\n aria-invalid={!!error}\n {...props}\n />\n )\n})\nFormControl.displayName = \"FormControl\"\n\nconst FormDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => {\n const { formDescriptionId } = useFormField()\n\n return (\n <p\n ref={ref}\n id={formDescriptionId}\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n )\n})\nFormDescription.displayName = \"FormDescription\"\n\nconst FormMessage = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, children, ...props }, ref) => {\n const { error, formMessageId } = useFormField()\n const body = error ? String(error?.message ?? \"\") : children\n\n if (!body) {\n return null\n }\n\n return (\n <p\n ref={ref}\n id={formMessageId}\n className={cn(\"text-sm font-medium text-destructive\", className)}\n {...props}\n >\n {body}\n </p>\n )\n})\nFormMessage.displayName = \"FormMessage\"\n\nexport {\n useFormField,\n Form,\n FormItem,\n FormLabel,\n FormControl,\n FormDescription,\n FormMessage,\n FormField\n}\n","import * as React from \"react\"\nimport { cn } from \"@/utils/index\"\nimport { TextareaProps } from \"./textarea.types\"\n\n/**\n * Textarea component for creating accessible text areas.\n * Built on top of shadcn/ui's Textarea component.\n *\n * @url https://sergii-melnykov.github.io/ui/?path=/docs/atoms-textarea--docs\n *\n * @example\n * ```tsx\n * <Textarea placeholder=\"Enter text\" />\n * ```\n */\nconst Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(\n ({ className, autoResize = false, ...props }, ref) => {\n const internalRef = React.useRef<HTMLTextAreaElement>(null)\n\n React.useEffect(() => {\n if (!autoResize || !internalRef.current) return\n\n const textarea = internalRef.current\n const resizeTextarea = () => {\n textarea.style.height = \"auto\"\n textarea.style.height = `${textarea.scrollHeight}px`\n }\n\n textarea.addEventListener(\"input\", resizeTextarea)\n resizeTextarea() // Initial resize\n\n return () => textarea.removeEventListener(\"input\", resizeTextarea)\n }, [autoResize])\n\n return (\n <textarea\n className={cn(\n \"flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\",\n className\n )}\n ref={ref}\n {...props}\n />\n )\n }\n)\n\nTextarea.displayName = \"Textarea\"\n\nexport { Textarea }\n","import * as React from \"react\"\nimport { useFormContext, type FieldValues, type FieldPath } from \"react-hook-form\"\nimport { Textarea } from \"@/components/atoms/textarea\"\nimport {\n FormControl,\n FormItem,\n FormMessage,\n FormLabel,\n FormDescription,\n FormField\n} from \"@/components/molecules/rhf/form\"\nimport { cn } from \"@/utils/cn\"\nimport { type RHFTextareaProps } from \"./rhf-textarea.types\"\n\n// ----------------------------------------------------------------------\n\n/**\n * A textarea component that integrates with React Hook Form.\n * Provides form validation, error handling, and accessibility features.\n *\n * @url https://sergii-melnykov.github.io/ui/?path=/docs/molecules-rhf-rhftextarea--docs\n *\n * @example\n * ```tsx\n * <Form>\n * <RHFTextarea name=\"description\" label=\"Description\" />\n * </Form>\n * ```\n */\nexport function RHFTextarea<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n>({\n name,\n label,\n description,\n className,\n warningText,\n required,\n disabled,\n readOnly,\n placeholder,\n autoResize,\n \"aria-label\": ariaLabel,\n \"aria-describedby\": ariaDescribedby,\n onBlur,\n ...other\n}: RHFTextareaProps<TFieldValues, TName>) {\n const { control } = useFormContext<TFieldValues>()\n\n return (\n <FormField\n name={name}\n control={control}\n render={({ field, fieldState: { error } }) => (\n <FormItem>\n {label && (\n <FormLabel>\n {label}\n {required && <span className=\"text-destructive ml-1\">*</span>}\n </FormLabel>\n )}\n <FormControl>\n <Textarea\n {...field}\n value={field.value}\n onChange={(e) => {\n field.onChange(e.target.value)\n }}\n onBlur={(e) => {\n // trim if a string\n if (typeof field.value === \"string\") {\n field.onChange(field.value.trim())\n }\n field.onBlur() // pass to react-hook-form\n onBlur?.(e) // pass to wrapper\n }}\n className={cn(\n error && \"border-destructive focus-visible:ring-destructive\",\n className\n )}\n disabled={disabled}\n readOnly={readOnly}\n required={required}\n placeholder={placeholder}\n aria-label={ariaLabel}\n aria-describedby={ariaDescribedby}\n aria-invalid={!!error}\n aria-required={required}\n autoResize={autoResize}\n {...other}\n />\n </FormControl>\n {description && <FormDescription>{description}</FormDescription>}\n {error && <FormMessage>{error.message}</FormMessage>}\n {!error && warningText && (\n <p className=\"text-sm text-yellow-600 dark:text-yellow-500\" role=\"alert\">\n {warningText}\n </p>\n )}\n </FormItem>\n )}\n />\n )\n}\n"]}
@@ -1,2 +0,0 @@
1
- 'use strict';var chunkUAZIJGWR_cjs_js=require('./chunk-UAZIJGWR.cjs.js'),chunkBR7Z6MCL_cjs_js=require('./chunk-BR7Z6MCL.cjs.js'),chunkSL2ZUI4G_cjs_js=require('./chunk-SL2ZUI4G.cjs.js'),l=require('react'),jsxRuntime=require('react/jsx-runtime'),i=require('@radix-ui/react-navigation-menu'),lucideReact=require('lucide-react'),classVarianceAuthority=require('class-variance-authority'),reactHookForm=require('react-hook-form'),reactSlot=require('@radix-ui/react-slot');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var l__namespace=/*#__PURE__*/_interopNamespace(l);var i__namespace=/*#__PURE__*/_interopNamespace(i);var Y=l__namespace.forwardRef(({className:e,...t},a)=>jsxRuntime.jsx("div",{ref:a,className:chunkSL2ZUI4G_cjs_js.a("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));Y.displayName="Card";var Z=l__namespace.forwardRef(({className:e,...t},a)=>jsxRuntime.jsx("div",{ref:a,className:chunkSL2ZUI4G_cjs_js.a("flex flex-col space-y-1.5 p-6",e),...t}));Z.displayName="CardHeader";var _=l__namespace.forwardRef(({className:e,...t},a)=>jsxRuntime.jsx("h3",{ref:a,className:chunkSL2ZUI4G_cjs_js.a("text-2xl font-semibold leading-none tracking-tight",e),...t}));_.displayName="CardTitle";var ee=l__namespace.forwardRef(({className:e,...t},a)=>jsxRuntime.jsx("p",{ref:a,className:chunkSL2ZUI4G_cjs_js.a("text-sm text-muted-foreground",e),...t}));ee.displayName="CardDescription";var te=l__namespace.forwardRef(({className:e,...t},a)=>jsxRuntime.jsx("div",{ref:a,className:chunkSL2ZUI4G_cjs_js.a("p-6 pt-0",e),...t}));te.displayName="CardContent";var ae=l__namespace.forwardRef(({className:e,...t},a)=>jsxRuntime.jsx("div",{ref:a,className:chunkSL2ZUI4G_cjs_js.a("flex items-center p-6 pt-0",e),...t}));ae.displayName="CardFooter";var B=classVarianceAuthority.cva("group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[state=open]:bg-accent/50",{variants:{variant:{default:"text-foreground",ghost:"hover:bg-transparent hover:underline",link:"text-primary underline-offset-4 hover:underline",mobile:"w-full justify-between border-b border-border py-4 text-base font-medium"}},defaultVariants:{variant:"default"}});var O=l__namespace.forwardRef(({className:e,children:t,...a},n)=>jsxRuntime.jsxs(i__namespace.Root,{ref:n,className:chunkSL2ZUI4G_cjs_js.a("relative z-10 flex max-w-max flex-1 items-center justify-center",e),...a,children:[t,jsxRuntime.jsx(S,{})]}));O.displayName=i__namespace.Root.displayName;var W=l__namespace.forwardRef(({className:e,...t},a)=>jsxRuntime.jsx(i__namespace.List,{ref:a,className:chunkSL2ZUI4G_cjs_js.a("group flex flex-1 list-none items-center justify-center space-x-1",e),...t}));W.displayName=i__namespace.List.displayName;var ie=i__namespace.Item,j=l__namespace.forwardRef(({className:e,children:t,variant:a,...n},r)=>jsxRuntime.jsxs(i__namespace.Trigger,{ref:r,className:chunkSL2ZUI4G_cjs_js.a(B({variant:a}),e),...n,children:[t," ",jsxRuntime.jsx(lucideReact.ChevronDown,{className:"relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180","aria-hidden":"true"})]}));j.displayName=i__namespace.Trigger.displayName;var q=l__namespace.forwardRef(({className:e,...t},a)=>jsxRuntime.jsx(i__namespace.Content,{ref:a,className:chunkSL2ZUI4G_cjs_js.a("left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto",e),...t}));q.displayName=i__namespace.Content.displayName;var ne=i__namespace.Link,S=l__namespace.forwardRef(({className:e,...t},a)=>jsxRuntime.jsx("div",{className:chunkSL2ZUI4G_cjs_js.a("absolute left-0 top-full flex justify-center"),children:jsxRuntime.jsx(i__namespace.Viewport,{className:chunkSL2ZUI4G_cjs_js.a("origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]",e),ref:a,...t})}));S.displayName=i__namespace.Viewport.displayName;var G=l__namespace.forwardRef(({className:e,...t},a)=>jsxRuntime.jsx(i__namespace.Indicator,{ref:a,className:chunkSL2ZUI4G_cjs_js.a("top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in",e),...t,children:jsxRuntime.jsx("div",{className:"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md"})}));G.displayName=i__namespace.Indicator.displayName;var ue=reactHookForm.FormProvider,K=l__namespace.createContext({}),h=({...e})=>jsxRuntime.jsx(K.Provider,{value:{name:e.name},children:jsxRuntime.jsx(reactHookForm.Controller,{...e})}),C=()=>{let e=l__namespace.useContext(K),t=l__namespace.useContext(Q),{getFieldState:a,formState:n}=reactHookForm.useFormContext(),r=a(e.name,n);if(!e)throw new Error("useFormField should be used within <FormField>");let{id:s}=t;return {id:s,name:e.name,formItemId:`${s}-form-item`,formDescriptionId:`${s}-form-item-description`,formMessageId:`${s}-form-item-message`,...r}},Q=l__namespace.createContext({}),x=l__namespace.forwardRef(({className:e,...t},a)=>{let n=l__namespace.useId();return jsxRuntime.jsx(Q.Provider,{value:{id:n},children:jsxRuntime.jsx("div",{ref:a,className:chunkSL2ZUI4G_cjs_js.a("space-y-2",e),...t})})});x.displayName="FormItem";var R=l__namespace.forwardRef(({className:e,...t},a)=>{let{error:n,formItemId:r}=C();return jsxRuntime.jsx(chunkUAZIJGWR_cjs_js.a,{ref:a,className:chunkSL2ZUI4G_cjs_js.a(n&&"text-destructive",e),htmlFor:r,...t})});R.displayName="FormLabel";var P=l__namespace.forwardRef(({...e},t)=>{let{error:a,formItemId:n,formDescriptionId:r,formMessageId:s}=C();return jsxRuntime.jsx(reactSlot.Slot,{ref:t,id:n,"aria-describedby":a?`${r} ${s}`:`${r}`,"aria-invalid":!!a,...e})});P.displayName="FormControl";var b=l__namespace.forwardRef(({className:e,...t},a)=>{let{formDescriptionId:n}=C();return jsxRuntime.jsx("p",{ref:a,id:n,className:chunkSL2ZUI4G_cjs_js.a("text-sm text-muted-foreground",e),...t})});b.displayName="FormDescription";var y=l__namespace.forwardRef(({className:e,children:t,...a},n)=>{let{error:r,formMessageId:s}=C(),d=r?String(r?.message??""):t;return d?jsxRuntime.jsx("p",{ref:n,id:s,className:chunkSL2ZUI4G_cjs_js.a("text-sm font-medium text-destructive",e),...a,children:d}):null});y.displayName="FormMessage";function ze({name:e,label:t,description:a,className:n,type:r="text",warningText:s,required:d,disabled:L,readOnly:w,placeholder:V,"aria-label":I,"aria-describedby":H,onBlur:E,...D}){let{control:A}=reactHookForm.useFormContext();return jsxRuntime.jsx(h,{name:e,control:A,render:({field:m,fieldState:{error:u}})=>jsxRuntime.jsxs(x,{children:[t&&jsxRuntime.jsxs(R,{children:[t,d&&jsxRuntime.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),jsxRuntime.jsx(P,{children:jsxRuntime.jsx(chunkBR7Z6MCL_cjs_js.a,{...m,type:r,value:r==="number"&&m.value===0?"":m.value,onChange:p=>{r==="number"?m.onChange(Number(p.target.value)):m.onChange(p.target.value);},onBlur:p=>{r!=="number"&&typeof m.value=="string"&&m.onChange(m.value.trim()),m.onBlur(),E?.(p);},className:chunkSL2ZUI4G_cjs_js.a(u&&"border-destructive focus-visible:ring-destructive",n),disabled:L,readOnly:w,required:d,placeholder:V,"aria-label":I,"aria-describedby":H,"aria-invalid":!!u,"aria-required":d,...D})}),a&&jsxRuntime.jsx(b,{children:a}),u&&jsxRuntime.jsx(y,{children:u.message}),!u&&s&&jsxRuntime.jsx("p",{className:"text-sm text-yellow-600 dark:text-yellow-500",role:"alert",children:s})]})})}var k=l__namespace.forwardRef(({className:e,autoResize:t=false,...a},n)=>{let r=l__namespace.useRef(null);return l__namespace.useEffect(()=>{if(!t||!r.current)return;let s=r.current,d=()=>{s.style.height="auto",s.style.height=`${s.scrollHeight}px`;};return s.addEventListener("input",d),d(),()=>s.removeEventListener("input",d)},[t]),jsxRuntime.jsx("textarea",{className:chunkSL2ZUI4G_cjs_js.a("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...a})});k.displayName="Textarea";function Ue({name:e,label:t,description:a,className:n,warningText:r,required:s,disabled:d,readOnly:L,placeholder:w,autoResize:V,"aria-label":I,"aria-describedby":H,onBlur:E,...D}){let{control:A}=reactHookForm.useFormContext();return jsxRuntime.jsx(h,{name:e,control:A,render:({field:m,fieldState:{error:u}})=>jsxRuntime.jsxs(x,{children:[t&&jsxRuntime.jsxs(R,{children:[t,s&&jsxRuntime.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),jsxRuntime.jsx(P,{children:jsxRuntime.jsx(k,{...m,value:m.value,onChange:p=>{m.onChange(p.target.value);},onBlur:p=>{typeof m.value=="string"&&m.onChange(m.value.trim()),m.onBlur(),E?.(p);},className:chunkSL2ZUI4G_cjs_js.a(u&&"border-destructive focus-visible:ring-destructive",n),disabled:d,readOnly:L,required:s,placeholder:w,"aria-label":I,"aria-describedby":H,"aria-invalid":!!u,"aria-required":s,autoResize:V,...D})}),a&&jsxRuntime.jsx(b,{children:a}),u&&jsxRuntime.jsx(y,{children:u.message}),!u&&r&&jsxRuntime.jsx("p",{className:"text-sm text-yellow-600 dark:text-yellow-500",role:"alert",children:r})]})})}exports.a=Y;exports.b=Z;exports.c=_;exports.d=ee;exports.e=te;exports.f=ae;exports.g=O;exports.h=W;exports.i=ie;exports.j=j;exports.k=q;exports.l=ne;exports.m=S;exports.n=G;exports.o=ue;exports.p=h;exports.q=C;exports.r=x;exports.s=R;exports.t=P;exports.u=b;exports.v=y;exports.w=ze;exports.x=Ue;//# sourceMappingURL=chunk-YVYCVGPC.cjs.js.map
2
- //# sourceMappingURL=chunk-YVYCVGPC.cjs.js.map