@me1a/ui 2.1.8 → 2.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/dist/atoms.cjs.js +1 -1
  2. package/dist/atoms.d.mts +546 -16
  3. package/dist/atoms.d.ts +546 -16
  4. package/dist/atoms.esm.js +1 -1
  5. package/dist/checkbox-DxgDKaHx.d.mts +108 -0
  6. package/dist/checkbox-DxgDKaHx.d.ts +108 -0
  7. package/dist/chunk-23T2PH5G.esm.js +2 -0
  8. package/dist/{chunk-5ZMFQLBF.esm.js.map → chunk-23T2PH5G.esm.js.map} +1 -1
  9. package/dist/chunk-2QG3QTSW.cjs.js +2 -0
  10. package/dist/chunk-2QG3QTSW.cjs.js.map +1 -0
  11. package/dist/chunk-DTM5LZHM.cjs.js +2 -0
  12. package/dist/chunk-DTM5LZHM.cjs.js.map +1 -0
  13. package/dist/chunk-HW32JE75.cjs.js +2 -0
  14. package/dist/chunk-HW32JE75.cjs.js.map +1 -0
  15. package/dist/{chunk-IXYLGKQT.cjs.js → chunk-JIRS6MWF.cjs.js} +2 -2
  16. package/dist/{chunk-IXYLGKQT.cjs.js.map → chunk-JIRS6MWF.cjs.js.map} +1 -1
  17. package/dist/chunk-JUZG25DH.esm.js +2 -0
  18. package/dist/chunk-JUZG25DH.esm.js.map +1 -0
  19. package/dist/chunk-MOYOCJW6.esm.js +2 -0
  20. package/dist/chunk-MOYOCJW6.esm.js.map +1 -0
  21. package/dist/chunk-STRDPP3B.esm.js +2 -0
  22. package/dist/chunk-STRDPP3B.esm.js.map +1 -0
  23. package/dist/chunk-UK47BFA3.cjs.js +2 -0
  24. package/dist/chunk-UK47BFA3.cjs.js.map +1 -0
  25. package/dist/chunk-UTVXFZLD.esm.js +2 -0
  26. package/dist/chunk-UTVXFZLD.esm.js.map +1 -0
  27. package/dist/chunk-YEZB7AOJ.esm.js +2 -0
  28. package/dist/chunk-YEZB7AOJ.esm.js.map +1 -0
  29. package/dist/chunk-YGLYFSF6.cjs.js +2 -0
  30. package/dist/chunk-YGLYFSF6.cjs.js.map +1 -0
  31. package/dist/index.cjs.js +1 -1
  32. package/dist/index.d.mts +11 -3
  33. package/dist/index.d.ts +11 -3
  34. package/dist/index.esm.js +1 -1
  35. package/dist/molecules.cjs.js +1 -1
  36. package/dist/molecules.d.mts +30 -1
  37. package/dist/molecules.d.ts +30 -1
  38. package/dist/molecules.esm.js +1 -1
  39. package/dist/organisms.cjs.js +1 -1
  40. package/dist/organisms.esm.js +1 -1
  41. package/dist/rhf.cjs.js +1 -1
  42. package/dist/rhf.cjs.js.map +1 -1
  43. package/dist/rhf.d.mts +211 -2
  44. package/dist/rhf.d.ts +211 -2
  45. package/dist/rhf.esm.js +1 -1
  46. package/dist/rhf.esm.js.map +1 -1
  47. package/package.json +24 -12
  48. package/dist/chunk-3HTFCAYW.esm.js +0 -2
  49. package/dist/chunk-3HTFCAYW.esm.js.map +0 -1
  50. package/dist/chunk-5ZMFQLBF.esm.js +0 -2
  51. package/dist/chunk-7NN2L46N.esm.js +0 -2
  52. package/dist/chunk-7NN2L46N.esm.js.map +0 -1
  53. package/dist/chunk-BR7Z6MCL.cjs.js +0 -2
  54. package/dist/chunk-BR7Z6MCL.cjs.js.map +0 -1
  55. package/dist/chunk-C4ZAMI2P.cjs.js +0 -2
  56. package/dist/chunk-C4ZAMI2P.cjs.js.map +0 -1
  57. package/dist/chunk-EBPUGBUT.esm.js +0 -2
  58. package/dist/chunk-EBPUGBUT.esm.js.map +0 -1
  59. package/dist/chunk-ELZV2CGE.cjs.js +0 -2
  60. package/dist/chunk-ELZV2CGE.cjs.js.map +0 -1
  61. package/dist/chunk-LCAU4YZI.esm.js +0 -2
  62. package/dist/chunk-LCAU4YZI.esm.js.map +0 -1
  63. package/dist/chunk-OZY26HWB.cjs.js +0 -2
  64. package/dist/chunk-OZY26HWB.cjs.js.map +0 -1
  65. package/dist/chunk-PEQ3VT44.esm.js +0 -2
  66. package/dist/chunk-PEQ3VT44.esm.js.map +0 -1
  67. package/dist/chunk-UAZIJGWR.cjs.js +0 -2
  68. package/dist/chunk-UAZIJGWR.cjs.js.map +0 -1
  69. package/dist/input-Ruz0ZoY6.d.mts +0 -12
  70. package/dist/input-Ruz0ZoY6.d.ts +0 -12
package/dist/rhf.d.ts CHANGED
@@ -3,10 +3,15 @@ import * as react_hook_form from 'react-hook-form';
3
3
  import { FieldValues, FieldPath, ControllerProps } from 'react-hook-form';
4
4
  import * as React from 'react';
5
5
  import { TextareaHTMLAttributes } from 'react';
6
- import { I as Input } from './input-Ruz0ZoY6.js';
6
+ import { I as Input, C as Checkbox, S as Switch, R as RadioGroup } from './checkbox-DxgDKaHx.js';
7
7
  import * as _radix_ui_react_slot from '@radix-ui/react-slot';
8
8
  import { Slot } from '@radix-ui/react-slot';
9
9
  import * as LabelPrimitive from '@radix-ui/react-label';
10
+ import '@radix-ui/react-switch';
11
+ import 'class-variance-authority/types';
12
+ import 'class-variance-authority';
13
+ import '@radix-ui/react-radio-group';
14
+ import '@radix-ui/react-checkbox';
10
15
 
11
16
  interface RHFTextFieldProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> extends Omit<React.ComponentProps<typeof Input>, "name"> {
12
17
  /** The name of the field in the form */
@@ -109,6 +114,210 @@ interface RHFTextareaProps<TFieldValues extends FieldValues = FieldValues, TName
109
114
  */
110
115
  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
116
 
117
+ interface RHFCheckboxProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> extends Omit<React.ComponentProps<typeof Checkbox>, "name"> {
118
+ /** The name of the field in the form */
119
+ name: TName;
120
+ /** Optional label for the field */
121
+ label?: string;
122
+ /** Optional description text below the field */
123
+ description?: string;
124
+ /** Optional warning text to display */
125
+ warningText?: string;
126
+ /** Whether the field is required */
127
+ required?: boolean;
128
+ /** Whether the field is disabled */
129
+ disabled?: boolean;
130
+ /** Whether the field is read-only */
131
+ readOnly?: boolean;
132
+ /** Optional aria-label for accessibility */
133
+ "aria-label"?: string;
134
+ /** Optional aria-describedby for accessibility */
135
+ "aria-describedby"?: string;
136
+ }
137
+
138
+ /**
139
+ * A checkbox component that integrates with React Hook Form.
140
+ * Provides form validation, error handling, and accessibility features.
141
+ *
142
+ * @url https://sergii-melnykov.github.io/ui/?path=/docs/molecules-rhf-rhfcheckbox--docs
143
+ *
144
+ * @example
145
+ * ```tsx
146
+ * <Form>
147
+ * <RHFCheckbox name="terms" label="Accept terms and conditions" />
148
+ * </Form>
149
+ * ```
150
+ */
151
+ declare function RHFCheckbox<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ name, label, description, className, warningText, required, disabled, readOnly, "aria-label": ariaLabel, "aria-describedby": ariaDescribedby, ...other }: RHFCheckboxProps<TFieldValues, TName>): react_jsx_runtime.JSX.Element;
152
+
153
+ interface RHFSwitchProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> extends Omit<React.ComponentProps<typeof Switch>, "name"> {
154
+ /** The name of the field in the form */
155
+ name: TName;
156
+ /** Optional label for the field */
157
+ label?: string;
158
+ /** Optional description text below the field */
159
+ description?: string;
160
+ /** Optional warning text to display */
161
+ warningText?: string;
162
+ /** Whether the field is required */
163
+ required?: boolean;
164
+ /** Whether the field is disabled */
165
+ disabled?: boolean;
166
+ /** Whether the field is read-only */
167
+ readOnly?: boolean;
168
+ /** Optional aria-label for accessibility */
169
+ "aria-label"?: string;
170
+ /** Optional aria-describedby for accessibility */
171
+ "aria-describedby"?: string;
172
+ }
173
+
174
+ /**
175
+ * A switch component that integrates with React Hook Form.
176
+ * Provides form validation, error handling, and accessibility features.
177
+ *
178
+ * @url https://sergii-melnykov.github.io/ui/?path=/docs/molecules-rhf-rhfswitch--docs
179
+ *
180
+ * @example
181
+ * ```tsx
182
+ * <Form>
183
+ * <RHFSwitch name="notifications" label="Enable notifications" />
184
+ * </Form>
185
+ * ```
186
+ */
187
+ declare function RHFSwitch<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ name, label, description, className, warningText, required, disabled, readOnly, "aria-label": ariaLabel, "aria-describedby": ariaDescribedby, ...other }: RHFSwitchProps<TFieldValues, TName>): react_jsx_runtime.JSX.Element;
188
+
189
+ interface RHFRadioGroupOption {
190
+ label: string;
191
+ id: string;
192
+ }
193
+ interface RHFRadioGroupWithChildrenProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> extends Omit<React.ComponentProps<typeof RadioGroup>, "name"> {
194
+ /** The name of the field in the form */
195
+ name: TName;
196
+ /** Optional label for the field */
197
+ label?: string;
198
+ /** Optional description text below the field */
199
+ description?: string;
200
+ /** Optional warning text to display */
201
+ warningText?: string;
202
+ /** Whether the field is required */
203
+ required?: boolean;
204
+ /** Whether the field is disabled */
205
+ disabled?: boolean;
206
+ /** Whether the field is read-only */
207
+ readOnly?: boolean;
208
+ /** Optional aria-label for accessibility */
209
+ "aria-label"?: string;
210
+ /** Optional aria-describedby for accessibility */
211
+ "aria-describedby"?: string;
212
+ /** Children must be RadioGroupItem components */
213
+ children: React.ReactNode;
214
+ }
215
+ interface RHFRadioGroupWithOptionsProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> extends Omit<React.ComponentProps<typeof RadioGroup>, "name"> {
216
+ /** The name of the field in the form */
217
+ name: TName;
218
+ /** Optional label for the field */
219
+ label?: string;
220
+ /** radio group options */
221
+ options: RHFRadioGroupOption[];
222
+ /** Optional description text below the field */
223
+ description?: string;
224
+ /** Optional warning text to display */
225
+ warningText?: string;
226
+ /** Whether the field is required */
227
+ required?: boolean;
228
+ /** Whether the field is disabled */
229
+ disabled?: boolean;
230
+ /** Whether the field is read-only */
231
+ readOnly?: boolean;
232
+ /** Optional aria-label for accessibility */
233
+ "aria-label"?: string;
234
+ /** Optional aria-describedby for accessibility */
235
+ "aria-describedby"?: string;
236
+ }
237
+ type RHFRadioGroupProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = RHFRadioGroupWithChildrenProps<TFieldValues, TName> | RHFRadioGroupWithOptionsProps<TFieldValues, TName>;
238
+
239
+ /**
240
+ * A radio group component that integrates with React Hook Form.
241
+ * Provides form validation, error handling, and accessibility features.
242
+ *
243
+ * @url https://sergii-melnykov.github.io/ui/?path=/docs/molecules-rhf-rhfradiogroup--docs
244
+ *
245
+ * @example
246
+ * ```tsx
247
+ * // Using children
248
+ * <Form>
249
+ * <RHFRadioGroup name="preference" label="Select your preference">
250
+ * <RadioGroupItem value="option1" label="Option 1" />
251
+ * <RadioGroupItem value="option2" label="Option 2" />
252
+ * </RHFRadioGroup>
253
+ * </Form>
254
+ *
255
+ * // Using options prop
256
+ * <Form>
257
+ * <RHFRadioGroup
258
+ * name="preference"
259
+ * label="Select your preference"
260
+ * options={[
261
+ * { id: "option1", label: "Option 1" },
262
+ * { id: "option2", label: "Option 2" }
263
+ * ]}
264
+ * />
265
+ * </Form>
266
+ * ```
267
+ */
268
+ declare function RHFRadioGroup<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ name, label, description, className, warningText, required, disabled, readOnly, "aria-label": ariaLabel, "aria-describedby": ariaDescribedby, children, ...other }: RHFRadioGroupProps<TFieldValues, TName>): react_jsx_runtime.JSX.Element;
269
+
270
+ interface RHFRadioButtonGroupOption {
271
+ label: string;
272
+ id: string;
273
+ size?: "default" | "sm" | "lg";
274
+ }
275
+ interface RHFRadioButtonGroupProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> extends Omit<React.ComponentProps<typeof RadioGroup>, "name"> {
276
+ /** The name of the field in the form */
277
+ name: TName;
278
+ /** Optional label for the field */
279
+ label?: string;
280
+ /** Optional description text below the field */
281
+ description?: string;
282
+ /** Optional warning text to display */
283
+ warningText?: string;
284
+ /** Whether the field is required */
285
+ required?: boolean;
286
+ /** Whether the field is disabled */
287
+ disabled?: boolean;
288
+ /** Whether the field is read-only */
289
+ readOnly?: boolean;
290
+ /** Optional aria-label for accessibility */
291
+ "aria-label"?: string;
292
+ /** Optional aria-describedby for accessibility */
293
+ "aria-describedby"?: string;
294
+ /** Radio button group options */
295
+ options: RHFRadioButtonGroupOption[];
296
+ }
297
+
298
+ /**
299
+ * A radio button group component that integrates with React Hook Form.
300
+ * Uses buttons instead of traditional radio inputs for a more modern look.
301
+ *
302
+ * @url https://sergii-melnykov.github.io/ui/?path=/docs/molecules-rhf-rhfradiobuttongroup--docs
303
+ *
304
+ * @example
305
+ * ```tsx
306
+ * <Form>
307
+ * <RHFRadioButtonGroup
308
+ * name="preference"
309
+ * label="Select your preference"
310
+ * options={[
311
+ * { value: "option1", label: "Option 1" },
312
+ * { value: "option2", label: "Option 2" },
313
+ * { value: "option3", label: "Option 3" }
314
+ * ]}
315
+ * />
316
+ * </Form>
317
+ * ```
318
+ */
319
+ declare function RHFRadioButtonGroup<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ name, label, description, className, warningText, required, disabled, readOnly, "aria-label": ariaLabel, "aria-describedby": ariaDescribedby, options, ...other }: RHFRadioButtonGroupProps<TFieldValues, TName>): react_jsx_runtime.JSX.Element;
320
+
112
321
  declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>(props: react_hook_form.FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
113
322
  declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: ControllerProps<TFieldValues, TName>) => react_jsx_runtime.JSX.Element;
114
323
  declare const useFormField: () => {
@@ -196,4 +405,4 @@ type FormItemContextValue = {
196
405
  id: string;
197
406
  };
198
407
 
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 };
408
+ 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, RHFCheckbox, RHFRadioButtonGroup, type RHFRadioButtonGroupOption, type RHFRadioButtonGroupProps, RHFRadioGroup, RHFSwitch, RHFTextField, RHFTextarea, useFormField };
package/dist/rhf.esm.js CHANGED
@@ -1,2 +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
1
+ import {a as a$1,g,b,c as c$2,e,d,f as f$1}from'./chunk-MOYOCJW6.esm.js';import {c as c$1,b as b$1}from'./chunk-JUZG25DH.esm.js';import {a}from'./chunk-C26U3FL4.esm.js';import {useFormContext,FormProvider,Controller}from'react-hook-form';import*as F from'react';import {Slot}from'@radix-ui/react-slot';import {jsx,jsxs}from'react/jsx-runtime';var oe=FormProvider,U=F.createContext({}),R=({...r})=>jsx(U.Provider,{value:{name:r.name},children:jsx(Controller,{...r})}),k=()=>{let r=F.useContext(U),a=F.useContext(X),{getFieldState:t,formState:i}=useFormContext(),o=t(r.name,i);if(!r)throw new Error("useFormField should be used within <FormField>");let{id:e}=a;return {id:e,name:r.name,formItemId:`${e}-form-item`,formDescriptionId:`${e}-form-item-description`,formMessageId:`${e}-form-item-message`,...o}},X=F.createContext({}),p=F.forwardRef(({className:r,...a$1},t)=>{let i=F.useId();return jsx(X.Provider,{value:{id:i},children:jsx("div",{ref:t,className:a("space-y-2",r),...a$1})})});p.displayName="FormItem";var u=F.forwardRef(({className:r,...a$2},t)=>{let{error:i,formItemId:o}=k();return jsx(a$1,{ref:t,className:a(i&&"text-destructive",r),htmlFor:o,...a$2})});u.displayName="FormLabel";var c=F.forwardRef(({...r},a)=>{let{error:t,formItemId:i,formDescriptionId:o,formMessageId:e}=k();return jsx(Slot,{ref:a,id:i,"aria-describedby":t?`${o} ${e}`:`${o}`,"aria-invalid":!!t,...r})});c.displayName="FormControl";var n=F.forwardRef(({className:r,...a$1},t)=>{let{formDescriptionId:i}=k();return jsx("p",{ref:t,id:i,className:a("text-sm text-muted-foreground",r),...a$1})});n.displayName="FormDescription";var f=F.forwardRef(({className:r,children:a$1,...t},i)=>{let{error:o,formMessageId:e}=k(),m=o?String(o?.message??""):a$1;return m?jsx("p",{ref:i,id:e,className:a("text-sm font-medium text-destructive",r),...t,children:m}):null});f.displayName="FormMessage";function Ce({name:r,label:a$1,description:t,className:i,type:o="text",warningText:e,required:m,disabled:I,readOnly:y,placeholder:h,"aria-label":T,"aria-describedby":x,onBlur:b,...s}){let{control:C}=useFormContext();return jsx(R,{name:r,control:C,render:({field:l,fieldState:{error:d}})=>jsxs(p,{children:[a$1&&jsxs(u,{children:[a$1,m&&jsx("span",{className:"text-destructive ml-1",children:"*"})]}),jsx(c,{children:jsx(c$1,{...l,type:o,value:o==="number"&&l.value===0?"":l.value,onChange:g=>{o==="number"?l.onChange(Number(g.target.value)):l.onChange(g.target.value);},onBlur:g=>{o!=="number"&&typeof l.value=="string"&&l.onChange(l.value.trim()),l.onBlur(),b?.(g);},className:a(d&&"border-destructive focus-visible:ring-destructive",i),disabled:I,readOnly:y,required:m,placeholder:h,"aria-label":T,"aria-describedby":x,"aria-invalid":!!d,"aria-required":m,...s})}),t&&jsx(n,{children:t}),d&&jsx(f,{children:d.message}),!d&&e&&jsx("p",{className:"text-sm text-yellow-600 dark:text-yellow-500",role:"alert",children:e})]})})}var E=F.forwardRef(({className:r,autoResize:a$1=false,...t},i)=>{let o=F.useRef(null);return F.useEffect(()=>{if(!a$1||!o.current)return;let e=o.current,m=()=>{e.style.height="auto",e.style.height=`${e.scrollHeight}px`;};return e.addEventListener("input",m),m(),()=>e.removeEventListener("input",m)},[a$1]),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",r),ref:i,...t})});E.displayName="Textarea";function De({name:r,label:a$1,description:t,className:i,warningText:o,required:e,disabled:m,readOnly:I,placeholder:y,autoResize:h,"aria-label":T,"aria-describedby":x,onBlur:b,...s}){let{control:C}=useFormContext();return jsx(R,{name:r,control:C,render:({field:l,fieldState:{error:d}})=>jsxs(p,{children:[a$1&&jsxs(u,{children:[a$1,e&&jsx("span",{className:"text-destructive ml-1",children:"*"})]}),jsx(c,{children:jsx(E,{...l,value:l.value,onChange:g=>{l.onChange(g.target.value);},onBlur:g=>{typeof l.value=="string"&&l.onChange(l.value.trim()),l.onBlur(),b?.(g);},className:a(d&&"border-destructive focus-visible:ring-destructive",i),disabled:m,readOnly:I,required:e,placeholder:y,"aria-label":T,"aria-describedby":x,"aria-invalid":!!d,"aria-required":e,autoResize:h,...s})}),t&&jsx(n,{children:t}),d&&jsx(f,{children:d.message}),!d&&o&&jsx("p",{className:"text-sm text-yellow-600 dark:text-yellow-500",role:"alert",children:o})]})})}function Be({name:r,label:a,description:t,className:i,warningText:o,required:e,disabled:m,readOnly:I,"aria-label":y,"aria-describedby":h,...T}){let{control:x}=useFormContext();return jsx(R,{name:r,control:x,render:({field:b,fieldState:{error:s}})=>jsxs(p,{className:"flex flex-row items-start space-x-3 space-y-0",children:[jsx(c,{children:jsx(g,{checked:b.value,onCheckedChange:b.onChange,disabled:m,"aria-label":y,"aria-describedby":h,"aria-invalid":!!s,"aria-required":e,...T})}),jsxs("div",{className:"space-y-1 leading-none",children:[a&&jsxs(u,{children:[a,e&&jsx("span",{className:"text-destructive ml-1",children:"*"})]}),t&&jsx(n,{children:t}),s&&jsx(f,{children:s.message}),!s&&o&&jsx("p",{className:"text-sm text-yellow-600 dark:text-yellow-500",role:"alert",children:o})]})]})})}function Je({name:r,label:a,description:t,className:i,warningText:o,required:e,disabled:m,readOnly:I,"aria-label":y,"aria-describedby":h,...T}){let{control:x}=useFormContext();return jsx(R,{name:r,control:x,render:({field:b$1,fieldState:{error:s}})=>jsxs(p,{className:"flex flex-row items-start space-x-3 space-y-0",children:[jsx(c,{children:jsx(b,{checked:b$1.value,onCheckedChange:b$1.onChange,disabled:m,"aria-label":y,"aria-describedby":h,"aria-invalid":!!s,"aria-required":e,...T})}),jsxs("div",{className:"space-y-1 leading-none",children:[a&&jsxs(u,{children:[a,e&&jsx("span",{className:"text-destructive ml-1",children:"*"})]}),t&&jsx(n,{children:t}),s&&jsx(f,{children:s.message}),!s&&o&&jsx("p",{className:"text-sm text-yellow-600 dark:text-yellow-500",role:"alert",children:o})]})]})})}function Ze({name:r,label:a,description:t,className:i,warningText:o,required:e$1,disabled:m,readOnly:I,"aria-label":y,"aria-describedby":h,children:T,...x}){let{control:b}=useFormContext(),s="options"in x;return jsx(R,{name:r,control:b,render:({field:C,fieldState:{error:l}})=>jsxs(p,{className:"space-y-3",children:[a&&jsxs(u,{children:[a,e$1&&jsx("span",{className:"text-destructive ml-1",children:"*"})]}),jsx(c,{children:jsxs(c$2,{onValueChange:C.onChange,defaultValue:C.value,disabled:m,"aria-label":y,"aria-describedby":h,"aria-invalid":!!l,"aria-required":e$1,...x,children:[s&&x.options.map(d$1=>jsxs(e,{children:[jsx(d,{value:d$1.id,id:d$1.id}),jsx(f$1,{htmlFor:d$1.id,children:d$1.label})]},d$1.id)),!s&&T]})}),t&&jsx(n,{children:t}),l&&jsx(f,{children:l.message}),!l&&o&&jsx("p",{className:"text-sm text-yellow-600 dark:text-yellow-500",role:"alert",children:o})]})})}function ra({name:r,label:a,description:t,className:i,warningText:o,required:e,disabled:m,readOnly:I,"aria-label":y,"aria-describedby":h,options:T,...x}){let{control:b}=useFormContext();return jsx(R,{name:r,control:b,render:({field:s,fieldState:{error:C}})=>jsxs(p,{className:"space-y-3",children:[a&&jsxs(u,{children:[a,e&&jsx("span",{className:"text-destructive ml-1",children:"*"})]}),jsx(c,{children:jsx(c$2,{onValueChange:s.onChange,defaultValue:s.value,disabled:m,"aria-label":y,"aria-describedby":h,"aria-invalid":!!C,"aria-required":e,className:"flex gap-2 p-2 border border-gray-200 rounded-md w-fit",...x,children:T.map(l=>jsx(b$1,{size:l.size??"sm",variant:s.value===l.id?"default":"secondary",onClick:()=>s.onChange(l.id),role:"radio","aria-checked":s.value===l.id,disabled:m,children:l.label},l.id))})}),t&&jsx(n,{children:t}),o&&jsx(n,{className:"text-warning",children:o}),C&&jsx(f,{children:C.message})]})})}export{oe as Form,c as FormControl,n as FormDescription,R as FormField,p as FormItem,u as FormLabel,f as FormMessage,Be as RHFCheckbox,ra as RHFRadioButtonGroup,Ze as RHFRadioGroup,Je as RHFSwitch,Ce as RHFTextField,De as RHFTextarea,k as useFormField};//# sourceMappingURL=rhf.esm.js.map
2
2
  //# sourceMappingURL=rhf.esm.js.map
@@ -1 +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","RHFTextarea"],"mappings":"oTAiBA,IAAMA,CAAOC,CAAAA,YAAAA,CASPC,EAAyB,CAAqC,CAAA,aAAA,CAAA,EAA2B,CAEzFC,CAAAA,CAAAA,CAAY,CAGhB,CACA,GAAGC,CACL,CAAA,GAEIC,GAACH,CAAAA,CAAAA,CAAiB,SAAjB,CAA0B,KAAA,CAAO,CAAE,IAAME,CAAAA,CAAAA,CAAM,IAAK,CACnD,CAAA,QAAA,CAAAC,GAACC,CAAAA,UAAAA,CAAA,CAAY,GAAGF,EAAO,CACzB,CAAA,CAAA,CAIEG,EAAe,IAAM,CACzB,IAAMC,CAAqB,CAAA,CAAA,CAAA,UAAA,CAAWN,CAAgB,CAAA,CAChDO,CAAoB,CAAA,CAAA,CAAA,UAAA,CAAWC,CAAe,CAC9C,CAAA,CAAE,cAAAC,CAAe,CAAA,SAAA,CAAAC,CAAU,CAAIC,CAAAA,cAAAA,EAE/BC,CAAAA,CAAAA,CAAaH,CAAcH,CAAAA,CAAAA,CAAa,KAAMI,CAAS,CAAA,CAE7D,GAAI,CAACJ,CAAAA,CACH,MAAM,IAAI,KAAA,CAAM,gDAAgD,CAAA,CAGlE,GAAM,CAAE,GAAAO,CAAG,CAAA,CAAIN,CAEf,CAAA,OAAO,CACL,EAAA,CAAAM,EACA,IAAMP,CAAAA,CAAAA,CAAa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AA+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"]}
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","../src/components/rhf/rhf-checkbox/rhf-checkbox.tsx","../src/components/rhf/rhf-switch/rhf-switch.tsx","../src/components/rhf/rhf-radio-group/rhf-radio-group.tsx","../src/components/rhf/rhf-radio-button-group/rhf-radio-button-group.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","D","autoResize","internalRef","textarea","resizeTextarea","RHFTextarea","RHFCheckbox","Checkbox","RHFSwitch","Switch","RHFRadioGroup","hasOptions","RadioGroup","option","RadioItemContainer","RadioGroupItem","RadioItemLabel","RHFRadioButtonGroup","options","Button"],"mappings":"2VAiBMA,EAAOC,CAAAA,YAAAA,CASPC,EAAyB,CAAqC,CAAA,aAAA,CAAA,EAA2B,CAEzFC,CAAAA,CAAAA,CAAY,CAGhB,CACA,GAAGC,CACL,CAEIC,GAAAA,GAAAA,CAACH,EAAiB,QAAjB,CAAA,CAA0B,MAAO,CAAE,IAAA,CAAME,EAAM,IAAK,CAAA,CACnD,QAAAC,CAAAA,GAAAA,CAACC,WAAA,CAAY,GAAGF,EAAO,CACzB,CAAA,CAAA,CAIEG,EAAe,IAAM,CACzB,IAAMC,CAAqB,CAAA,CAAA,CAAA,UAAA,CAAWN,CAAgB,CAChDO,CAAAA,CAAAA,CAAoB,aAAWC,CAAe,CAAA,CAC9C,CAAE,aAAAC,CAAAA,CAAAA,CAAe,UAAAC,CAAU,CAAA,CAAIC,gBAE/BC,CAAAA,CAAAA,CAAaH,EAAcH,CAAa,CA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B,GAAAA,CAAAA,CAAO,GACrC,QAAU1B,CAAAA,CAAAA,CAET,SAAA0B,CAAO,CAAA,KAAA,CAAA,CARHA,EAAO,EASd,CACD,EACH,CACF,CAAA,CAAA,CACC9B,GAAe9B,GAACuB,CAAAA,CAAAA,CAAA,CAAiB,QAAAO,CAAAA,CAAAA,CAAY,EAC7CE,CAAehC,EAAAA,GAAAA,CAACuB,EAAA,CAAgB,SAAA,CAAU,eAAgB,QAAAS,CAAAA,CAAAA,CAAY,EACtEhB,CAAShB,EAAAA,GAAAA,CAACwB,EAAA,CAAa,QAAA,CAAAR,EAAM,OAAQ,CAAA,CAAA,CAAA,CACxC,EAEJ,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","import * as React from \"react\"\nimport { useFormContext, type FieldValues, type FieldPath } from \"react-hook-form\"\nimport { Checkbox } from \"@/components/atoms/checkbox\"\nimport {\n FormControl,\n FormItem,\n FormMessage,\n FormLabel,\n FormDescription,\n FormField\n} from \"@/components/rhf/form\"\nimport { type RHFCheckboxProps } from \"./rhf-checkbox.types\"\n\n// ----------------------------------------------------------------------\n\n/**\n * A checkbox 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-rhfcheckbox--docs\n *\n * @example\n * ```tsx\n * <Form>\n * <RHFCheckbox name=\"terms\" label=\"Accept terms and conditions\" />\n * </Form>\n * ```\n */\nexport function RHFCheckbox<\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 \"aria-label\": ariaLabel,\n \"aria-describedby\": ariaDescribedby,\n ...other\n}: RHFCheckboxProps<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 className=\"flex flex-row items-start space-x-3 space-y-0\">\n <FormControl>\n <Checkbox\n checked={field.value}\n onCheckedChange={field.onChange}\n disabled={disabled}\n aria-label={ariaLabel}\n aria-describedby={ariaDescribedby}\n aria-invalid={!!error}\n aria-required={required}\n {...other}\n />\n </FormControl>\n <div className=\"space-y-1 leading-none\">\n {label && (\n <FormLabel>\n {label}\n {required && <span className=\"text-destructive ml-1\">*</span>}\n </FormLabel>\n )}\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 </div>\n </FormItem>\n )}\n />\n )\n}\n","import * as React from \"react\"\nimport { useFormContext, type FieldValues, type FieldPath } from \"react-hook-form\"\nimport { Switch } from \"@/components/atoms/switch\"\nimport {\n FormControl,\n FormItem,\n FormMessage,\n FormLabel,\n FormDescription,\n FormField\n} from \"@/components/rhf/form\"\nimport { type RHFSwitchProps } from \"./rhf-switch.types\"\n\n// ----------------------------------------------------------------------\n\n/**\n * A switch 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-rhfswitch--docs\n *\n * @example\n * ```tsx\n * <Form>\n * <RHFSwitch name=\"notifications\" label=\"Enable notifications\" />\n * </Form>\n * ```\n */\nexport function RHFSwitch<\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 \"aria-label\": ariaLabel,\n \"aria-describedby\": ariaDescribedby,\n ...other\n}: RHFSwitchProps<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 className=\"flex flex-row items-start space-x-3 space-y-0\">\n <FormControl>\n <Switch\n checked={field.value}\n onCheckedChange={field.onChange}\n disabled={disabled}\n aria-label={ariaLabel}\n aria-describedby={ariaDescribedby}\n aria-invalid={!!error}\n aria-required={required}\n {...other}\n />\n </FormControl>\n <div className=\"space-y-1 leading-none\">\n {label && (\n <FormLabel>\n {label}\n {required && <span className=\"text-destructive ml-1\">*</span>}\n </FormLabel>\n )}\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 </div>\n </FormItem>\n )}\n />\n )\n}\n","import * as React from \"react\"\nimport { useFormContext, type FieldValues, type FieldPath } from \"react-hook-form\"\nimport {\n RadioGroup,\n RadioGroupItem,\n RadioItemLabel,\n RadioItemContainer\n} from \"@/components/atoms/radio-group\"\nimport {\n FormControl,\n FormItem,\n FormMessage,\n FormLabel,\n FormDescription,\n FormField\n} from \"@/components/rhf/form\"\nimport {\n RHFRadioGroupOption,\n type RHFRadioGroupProps,\n type RHFRadioGroupWithOptionsProps\n} from \"./rhf-radio-group.types\"\n\n// ----------------------------------------------------------------------\n\n/**\n * A radio group 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-rhfradiogroup--docs\n *\n * @example\n * ```tsx\n * // Using children\n * <Form>\n * <RHFRadioGroup name=\"preference\" label=\"Select your preference\">\n * <RadioGroupItem value=\"option1\" label=\"Option 1\" />\n * <RadioGroupItem value=\"option2\" label=\"Option 2\" />\n * </RHFRadioGroup>\n * </Form>\n *\n * // Using options prop\n * <Form>\n * <RHFRadioGroup\n * name=\"preference\"\n * label=\"Select your preference\"\n * options={[\n * { id: \"option1\", label: \"Option 1\" },\n * { id: \"option2\", label: \"Option 2\" }\n * ]}\n * />\n * </Form>\n * ```\n */\nexport function RHFRadioGroup<\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 \"aria-label\": ariaLabel,\n \"aria-describedby\": ariaDescribedby,\n children,\n ...other\n}: RHFRadioGroupProps<TFieldValues, TName>) {\n const { control } = useFormContext<TFieldValues>()\n const hasOptions = \"options\" in other\n\n return (\n <FormField\n name={name}\n control={control}\n render={({ field, fieldState: { error } }) => (\n <FormItem className=\"space-y-3\">\n {label && (\n <FormLabel>\n {label}\n {required && <span className=\"text-destructive ml-1\">*</span>}\n </FormLabel>\n )}\n <FormControl>\n <RadioGroup\n onValueChange={field.onChange}\n defaultValue={field.value}\n disabled={disabled}\n aria-label={ariaLabel}\n aria-describedby={ariaDescribedby}\n aria-invalid={!!error}\n aria-required={required}\n {...other}\n >\n {hasOptions &&\n (other as RHFRadioGroupWithOptionsProps<TFieldValues, TName>).options.map(\n (option: RHFRadioGroupOption) => (\n <RadioItemContainer key={option.id}>\n <RadioGroupItem value={option.id} id={option.id} />\n <RadioItemLabel htmlFor={option.id}>{option.label}</RadioItemLabel>\n </RadioItemContainer>\n )\n )}\n {!hasOptions && children}\n </RadioGroup>\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 { useFormContext, type FieldValues, type FieldPath } from \"react-hook-form\"\nimport { RadioGroup } from \"@/components/atoms/radio-group\"\nimport { Button } from \"@/components/atoms/button\"\nimport {\n FormControl,\n FormItem,\n FormMessage,\n FormLabel,\n FormDescription,\n FormField\n} from \"@/components/rhf/form\"\nimport { type RHFRadioButtonGroupProps } from \"./rhf-radio-button-group.types\"\n\n// ----------------------------------------------------------------------\n\n/**\n * A radio button group component that integrates with React Hook Form.\n * Uses buttons instead of traditional radio inputs for a more modern look.\n *\n * @url https://sergii-melnykov.github.io/ui/?path=/docs/molecules-rhf-rhfradiobuttongroup--docs\n *\n * @example\n * ```tsx\n * <Form>\n * <RHFRadioButtonGroup\n * name=\"preference\"\n * label=\"Select your preference\"\n * options={[\n * { value: \"option1\", label: \"Option 1\" },\n * { value: \"option2\", label: \"Option 2\" },\n * { value: \"option3\", label: \"Option 3\" }\n * ]}\n * />\n * </Form>\n * ```\n */\nexport function RHFRadioButtonGroup<\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 \"aria-label\": ariaLabel,\n \"aria-describedby\": ariaDescribedby,\n options,\n ...other\n}: RHFRadioButtonGroupProps<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 className=\"space-y-3\">\n {label && (\n <FormLabel>\n {label}\n {required && <span className=\"text-destructive ml-1\">*</span>}\n </FormLabel>\n )}\n <FormControl>\n <RadioGroup\n onValueChange={field.onChange}\n defaultValue={field.value}\n disabled={disabled}\n aria-label={ariaLabel}\n aria-describedby={ariaDescribedby}\n aria-invalid={!!error}\n aria-required={required}\n className=\"flex gap-2 p-2 border border-gray-200 rounded-md w-fit\"\n {...other}\n >\n {options.map((option) => (\n <Button\n key={option.id}\n size={option.size ?? \"sm\"}\n variant={field.value === option.id ? \"default\" : \"secondary\"}\n onClick={() => field.onChange(option.id)}\n role=\"radio\"\n aria-checked={field.value === option.id}\n disabled={disabled}\n >\n {option.label}\n </Button>\n ))}\n </RadioGroup>\n </FormControl>\n {description && <FormDescription>{description}</FormDescription>}\n {warningText && <FormDescription className=\"text-warning\">{warningText}</FormDescription>}\n {error && <FormMessage>{error.message}</FormMessage>}\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.8",
3
+ "version": "2.2.1",
4
4
  "private": false,
5
5
  "main": "./dist/index.cjs.js",
6
6
  "module": "./dist/index.esm.js",
@@ -73,13 +73,11 @@
73
73
  "@babel/preset-env": "^7.27.2",
74
74
  "@babel/preset-react": "^7.27.1",
75
75
  "@babel/preset-typescript": "^7.27.1",
76
- "@storybook/addon-a11y": "^8.6.14",
77
- "@storybook/addon-essentials": "^8.6.14",
78
- "@storybook/addon-interactions": "^8.6.14",
79
- "@storybook/addon-onboarding": "^8.6.14",
76
+ "@storybook/addon-a11y": "^9.1.0-alpha.1",
77
+ "@storybook/addon-docs": "^9.1.0-alpha.1",
78
+ "@storybook/addon-onboarding": "^9.1.0-alpha.1",
80
79
  "@storybook/blocks": "^8.6.14",
81
- "@storybook/react": "^8.6.14",
82
- "@storybook/react-vite": "^8.6.14",
80
+ "@storybook/react-vite": "^9.1.0-alpha.1",
83
81
  "@storybook/test": "^8.6.14",
84
82
  "@testing-library/jest-dom": "^6.6.3",
85
83
  "@testing-library/react": "^16.3.0",
@@ -100,13 +98,13 @@
100
98
  "eslint-plugin-prettier": "^5.4.0",
101
99
  "eslint-plugin-react": "^7.33.2",
102
100
  "eslint-plugin-react-hooks": "^4.6.0",
103
- "eslint-plugin-storybook": "^0.12.0",
101
+ "eslint-plugin-storybook": "^9.1.0-alpha.1",
104
102
  "jest": "^29.7.0",
105
103
  "jest-environment-jsdom": "^29.7.0",
106
104
  "postcss": "^8.5.3",
107
105
  "prettier": "^3.2.5",
108
106
  "prettier-plugin-tailwindcss": "^0.5.11",
109
- "storybook": "^8.6.14",
107
+ "storybook": "^9.1.0-alpha.1",
110
108
  "tailwindcss": "^3.4.17",
111
109
  "tailwindcss-animate": "^1.0.7",
112
110
  "ts-node": "^10.9.2",
@@ -115,19 +113,30 @@
115
113
  },
116
114
  "dependencies": {
117
115
  "@hookform/resolvers": "^5.0.1",
116
+ "@radix-ui/react-accordion": "^1.2.11",
118
117
  "@radix-ui/react-avatar": "^1.1.9",
119
- "@radix-ui/react-dialog": "^1.1.13",
118
+ "@radix-ui/react-checkbox": "^1.3.2",
119
+ "@radix-ui/react-collapsible": "^1.1.11",
120
+ "@radix-ui/react-dialog": "^1.1.14",
120
121
  "@radix-ui/react-dropdown-menu": "^2.1.14",
121
122
  "@radix-ui/react-icons": "^1.3.0",
122
123
  "@radix-ui/react-label": "^2.1.6",
123
124
  "@radix-ui/react-navigation-menu": "^1.2.12",
125
+ "@radix-ui/react-popover": "^1.1.14",
126
+ "@radix-ui/react-radio-group": "^1.3.7",
127
+ "@radix-ui/react-select": "^2.2.5",
124
128
  "@radix-ui/react-separator": "^1.1.6",
125
- "@radix-ui/react-slot": "^1.2.2",
129
+ "@radix-ui/react-slot": "^1.2.3",
130
+ "@radix-ui/react-switch": "^1.2.5",
131
+ "@radix-ui/react-tabs": "^1.1.12",
126
132
  "@radix-ui/react-toast": "^1.2.13",
127
133
  "@radix-ui/react-tooltip": "^1.2.6",
134
+ "@tanstack/react-table": "^8.21.3",
128
135
  "class-variance-authority": "^0.7.1",
129
136
  "clsx": "^2.1.1",
137
+ "cmdk": "^1.1.1",
130
138
  "lucide-react": "^0.511.0",
139
+ "react-resizable-panels": "^3.0.2",
131
140
  "vaul": "^1.1.2",
132
141
  "vite": "^6.3.5"
133
142
  },
@@ -145,5 +154,8 @@
145
154
  },
146
155
  "homepage": "https://github.com/sergii-melnykov/ui#readme",
147
156
  "description": "A modern UI library for Next.js applications",
148
- "storybook": "https://sergii-melnykov.github.io/ui"
157
+ "storybook": "https://sergii-melnykov.github.io/ui",
158
+ "overrides": {
159
+ "storybook": "$storybook"
160
+ }
149
161
  }
@@ -1,2 +0,0 @@
1
- import {a}from'./chunk-C26U3FL4.esm.js';import*as l from'react';import {Slot}from'@radix-ui/react-slot';import {cva}from'class-variance-authority';import {Loader2,X as X$1}from'lucide-react';import {jsx,jsxs}from'react/jsx-runtime';import*as v from'@radix-ui/react-separator';import*as t from'@radix-ui/react-dialog';import*as r from'@radix-ui/react-tooltip';var x=cva("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),V=l.forwardRef(({className:o,variant:e,size:a$1,asChild:s=false,startIcon:m,endIcon:b,loading:p=false,disabled:k,children:f,type:g="button","aria-label":D,...c},P)=>{let R=s?Slot:"button",d=k||p,S=D||(typeof f=="string"?f:void 0),L=u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),!d&&c.onClick&&c.onClick(u));};return s?jsx(R,{className:a(x({variant:e,size:a$1,className:o})),ref:P,disabled:d,type:g,"aria-label":S,"aria-disabled":d,...c,children:f}):jsxs(R,{className:a(x({variant:e,size:a$1,className:o})),ref:P,disabled:d,type:g,"aria-label":S,"aria-disabled":d,onKeyDown:L,...c,children:[p&&jsx(Loader2,{className:"mr-2 h-4 w-4 animate-spin",role:"status","aria-label":"Loading","aria-hidden":"true"}),!p&&m&&jsx("span",{className:"mr-2","aria-hidden":"true",children:m}),f,!p&&b&&jsx("span",{className:"ml-2","aria-hidden":"true",children:b})]})});V.displayName="Button";var O=l.forwardRef(({className:o,orientation:e="horizontal",decorative:a$1=true,...s},m)=>jsx(v.Root,{ref:m,decorative:a$1,orientation:e,className:a("shrink-0 bg-border",e==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",o),...s}));O.displayName=v.Root.displayName;var me=t.Root,de=t.Trigger,le=t.Close,F=t.Portal,w=l.forwardRef(({className:o,...e},a$1)=>jsx(t.Overlay,{className:a("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",o),...e,ref:a$1}));w.displayName=t.Overlay.displayName;var X=cva("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),q=l.forwardRef(({side:o="right",className:e,children:a$1,...s},m)=>jsxs(F,{children:[jsx(w,{}),jsxs(t.Content,{ref:m,className:a(X({side:o}),e),...s,children:[jsxs(t.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[jsx(X$1,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Close"})]}),a$1]})]}));q.displayName=t.Content.displayName;var G=({className:o,...e})=>jsx("div",{className:a("flex flex-col space-y-2 text-center sm:text-left",o),...e});G.displayName="SheetHeader";var J=({className:o,...e})=>jsx("div",{className:a("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",o),...e});J.displayName="SheetFooter";var Q=l.forwardRef(({className:o,...e},a$1)=>jsx(t.Title,{ref:a$1,className:a("text-lg font-semibold text-foreground",o),...e}));Q.displayName=t.Title.displayName;var U=l.forwardRef(({className:o,...e},a$1)=>jsx(t.Description,{ref:a$1,className:a("text-sm text-muted-foreground",o),...e}));U.displayName=t.Description.displayName;function ue({className:o,...e}){return jsx("div",{className:a("animate-pulse rounded-md bg-primary/10",o),...e})}var be=r.Provider,ge=r.Root,Pe=r.Trigger,Z=l.forwardRef(({className:o,sideOffset:e=4,...a$1},s)=>jsx(r.Portal,{children:jsx(r.Content,{ref:s,sideOffset:e,className:a("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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 origin-[--radix-tooltip-content-transform-origin]",o),...a$1})}));Z.displayName=r.Content.displayName;export{x as a,V as b,O as c,me as d,de as e,le as f,F as g,w as h,q as i,G as j,J as k,Q as l,U as m,ue as n,be as o,ge as p,Pe as q,Z as r};//# sourceMappingURL=chunk-3HTFCAYW.esm.js.map
2
- //# sourceMappingURL=chunk-3HTFCAYW.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/atoms/button/button.tsx","../src/components/atoms/separator/separator.tsx","../src/components/atoms/sheet/sheet.tsx","../src/components/atoms/skeleton/skeleton.tsx","../src/components/atoms/tooltip/tooltip.tsx"],"names":["buttonVariants","cva","Button","N","className","variant","size","asChild","startIcon","endIcon","loading","disabled","children","type","ariaLabel","props","ref","Comp","Slot","isDisabled","buttonAriaLabel","handleKeyDown","event","jsx","cn","jsxs","Loader2","Separator","T","orientation","decorative","Sheet","SheetTrigger","SheetClose","SheetPortal","SheetOverlay","sheetVariants","SheetContent","side","X","SheetHeader","SheetFooter","SheetTitle","SheetDescription","Skeleton","TooltipProvider","Tooltip","TooltipTrigger","TooltipContent","E","sideOffset"],"mappings":"2WAiBMA,CAAiBC,CAAAA,GAAAA,CACrB,wRACA,CAAA,CACE,SAAU,CACR,OAAA,CAAS,CACP,OAAA,CAAS,gEACT,WAAa,CAAA,8EAAA,CACb,OACE,CAAA,0FAAA,CACF,UAAW,wEACX,CAAA,KAAA,CAAO,8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-slot\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { cn } from \"@/utils/cn\"\nimport { ButtonProps } from \"./button.types\"\nimport { Loader2 } from \"lucide-react\"\n\n/**\n * Button variant styles using class-variance-authority.\n * Defines the visual styles for different button variants and sizes.\n * Follows WCAG 2.1 Level AA guidelines for accessibility.\n *\n * @example\n * ```tsx\n * <Button variant=\"primary\" size=\"lg\">Click me</Button>\n * ```\n */\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground shadow hover:bg-primary/90\",\n destructive: \"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90\",\n outline:\n \"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground\",\n secondary: \"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80\",\n ghost: \"hover:bg-accent hover:text-accent-foreground\",\n link: \"text-primary underline-offset-4 hover:underline\"\n } as const,\n size: {\n default: \"h-9 px-4 py-2\",\n sm: \"h-8 rounded-md px-3 text-xs\",\n lg: \"h-10 rounded-md px-8\",\n icon: \"h-9 w-9\"\n } as const\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\"\n }\n }\n)\n\n/**\n * A versatile button component that supports multiple variants, sizes, and can be rendered as a child component.\n * Built on top of Radix UI's Slot primitive for maximum flexibility.\n * Implements proper accessibility features and follows WCAG 2.1 Level AA guidelines.\n *\n * @url https://sergii-melnykov.github.io/ui/?path=/docs/atoms-button--docs\n *\n * @component\n * @example\n * ```tsx\n * // Default button\n * <Button>Click me</Button>\n *\n * // Destructive button with small size\n * <Button variant=\"destructive\" size=\"sm\">Delete</Button>\n *\n * // As a link\n * <Button variant=\"link\" asChild>\n * <a href=\"/about\">About</a>\n * </Button>\n *\n * // With icons\n * <Button startIcon={<Icon />}>With Start Icon</Button>\n * <Button endIcon={<Icon />}>With End Icon</Button>\n *\n * // Loading state\n * <Button loading>Loading</Button>\n * ```\n *\n * @param {ButtonProps} props - The component props\n * @param {React.Ref<HTMLButtonElement>} ref - Forwarded ref\n * @returns {JSX.Element} A button element\n */\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n className,\n variant,\n size,\n asChild = false,\n startIcon,\n endIcon,\n loading = false,\n disabled,\n children,\n type = \"button\",\n \"aria-label\": ariaLabel,\n ...props\n },\n ref\n ) => {\n const Comp = asChild ? Slot : \"button\"\n const isDisabled = disabled || loading\n const buttonAriaLabel = ariaLabel || (typeof children === \"string\" ? children : undefined)\n\n // Handle keyboard interaction\n const handleKeyDown = (event: React.KeyboardEvent) => {\n if (event.key === \"Enter\" || event.key === \" \") {\n event.preventDefault()\n if (!isDisabled && props.onClick) {\n props.onClick(event as unknown as React.MouseEvent<HTMLButtonElement>)\n }\n }\n }\n\n if (asChild) {\n return (\n <Comp\n className={cn(buttonVariants({ variant, size, className }))}\n ref={ref}\n disabled={isDisabled}\n type={type}\n aria-label={buttonAriaLabel}\n aria-disabled={isDisabled}\n {...props}\n >\n {children}\n </Comp>\n )\n }\n\n return (\n <Comp\n className={cn(buttonVariants({ variant, size, className }))}\n ref={ref}\n disabled={isDisabled}\n type={type}\n aria-label={buttonAriaLabel}\n aria-disabled={isDisabled}\n onKeyDown={handleKeyDown}\n {...props}\n >\n {loading && (\n <Loader2\n className=\"mr-2 h-4 w-4 animate-spin\"\n role=\"status\"\n aria-label=\"Loading\"\n aria-hidden=\"true\"\n />\n )}\n {!loading && startIcon && (\n <span className=\"mr-2\" aria-hidden=\"true\">\n {startIcon}\n </span>\n )}\n {children}\n {!loading && endIcon && (\n <span className=\"ml-2\" aria-hidden=\"true\">\n {endIcon}\n </span>\n )}\n </Comp>\n )\n }\n)\nButton.displayName = \"Button\"\n\nexport { Button, buttonVariants }\n","import * as React from \"react\"\nimport * as SeparatorPrimitive from \"@radix-ui/react-separator\"\n\nimport { cn } from \"@/utils/index\"\n\n/**\n * Separator component for creating horizontal or vertical dividers.\n * Built on top of Radix UI's Separator primitive.\n *\n * @url https://sergii-melnykov.github.io/ui/?path=/docs/atoms-separator--docs\n *\n */\nconst Separator = React.forwardRef<\n React.ElementRef<typeof SeparatorPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>\n>(({ className, orientation = \"horizontal\", decorative = true, ...props }, ref) => (\n <SeparatorPrimitive.Root\n ref={ref}\n decorative={decorative}\n orientation={orientation}\n className={cn(\n \"shrink-0 bg-border\",\n orientation === \"horizontal\" ? \"h-[1px] w-full\" : \"h-full w-[1px]\",\n className\n )}\n {...props}\n />\n))\nSeparator.displayName = SeparatorPrimitive.Root.displayName\n\nexport { Separator }\n","\"use client\"\n\nimport * as React from \"react\"\nimport * as SheetPrimitive from \"@radix-ui/react-dialog\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { X } from \"lucide-react\"\n\nimport { cn } from \"@/utils/index\"\n\n/**\n * Sheet component for creating accessible sheets with overlay and content.\n * Built on top of Radix UI's Sheet primitive.\n *\n * @url https://sergii-melnykov.github.io/ui/?path=/docs/atoms-sheet--docs\n *\n * @example\n * ```tsx\n * <Sheet>\n * <SheetTrigger>Open Sheet</SheetTrigger>\n * <SheetContent>Sheet Content</SheetContent>\n * </Sheet>\n */\nconst Sheet = SheetPrimitive.Root\n\nconst SheetTrigger = SheetPrimitive.Trigger\n\nconst SheetClose = SheetPrimitive.Close\n\nconst SheetPortal = SheetPrimitive.Portal\n\nconst SheetOverlay = React.forwardRef<\n React.ElementRef<typeof SheetPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof SheetPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <SheetPrimitive.Overlay\n className={cn(\n \"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n className\n )}\n {...props}\n ref={ref}\n />\n))\nSheetOverlay.displayName = SheetPrimitive.Overlay.displayName\n\nconst sheetVariants = cva(\n \"fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out\",\n {\n variants: {\n side: {\n top: \"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top\",\n bottom:\n \"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom\",\n left: \"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm\",\n right:\n \"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm\"\n }\n },\n defaultVariants: {\n side: \"right\"\n }\n }\n)\n\ninterface SheetContentProps\n extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>,\n VariantProps<typeof sheetVariants> {}\n\nconst SheetContent = React.forwardRef<\n React.ElementRef<typeof SheetPrimitive.Content>,\n SheetContentProps\n>(({ side = \"right\", className, children, ...props }, ref) => (\n <SheetPortal>\n <SheetOverlay />\n <SheetPrimitive.Content ref={ref} className={cn(sheetVariants({ side }), className)} {...props}>\n <SheetPrimitive.Close className=\"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary\">\n <X className=\"h-4 w-4\" />\n <span className=\"sr-only\">Close</span>\n </SheetPrimitive.Close>\n {children}\n </SheetPrimitive.Content>\n </SheetPortal>\n))\nSheetContent.displayName = SheetPrimitive.Content.displayName\n\nconst SheetHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn(\"flex flex-col space-y-2 text-center sm:text-left\", className)} {...props} />\n)\nSheetHeader.displayName = \"SheetHeader\"\n\nconst SheetFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2\", className)}\n {...props}\n />\n)\nSheetFooter.displayName = \"SheetFooter\"\n\nconst SheetTitle = React.forwardRef<\n React.ElementRef<typeof SheetPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof SheetPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <SheetPrimitive.Title\n ref={ref}\n className={cn(\"text-lg font-semibold text-foreground\", className)}\n {...props}\n />\n))\nSheetTitle.displayName = SheetPrimitive.Title.displayName\n\nconst SheetDescription = React.forwardRef<\n React.ElementRef<typeof SheetPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof SheetPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <SheetPrimitive.Description\n ref={ref}\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n))\nSheetDescription.displayName = SheetPrimitive.Description.displayName\n\nexport {\n Sheet,\n SheetPortal,\n SheetOverlay,\n SheetTrigger,\n SheetClose,\n SheetContent,\n SheetHeader,\n SheetFooter,\n SheetTitle,\n SheetDescription\n}\n","import { cn } from \"@/utils/index\"\n\n/**\n * Skeleton component for creating a loading state.\n * Built on top of shadcn/ui's Skeleton component.\n *\n * @url https://sergii-melnykov.github.io/ui/?path=/docs/atoms-skeleton--docs\n *\n * @example\n * ```tsx\n * <Skeleton className=\"w-10 h-10\" />\n * ```\n */\nfunction Skeleton({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) {\n return <div className={cn(\"animate-pulse rounded-md bg-primary/10\", className)} {...props} />\n}\n\nexport { Skeleton }\n","import * as React from \"react\"\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\"\n\nimport { cn } from \"@/utils/index\"\n\n/**\n * TooltipProvider component for creating accessible tooltips.\n * Built on top of Radix UI's Tooltip primitive.\n *\n * @url https://sergii-melnykov.github.io/ui/?path=/docs/atoms-tooltip--docs\n *\n * @example\n * ```tsx\n * <TooltipProvider>\n * <Tooltip>\n * <TooltipTrigger>Hover me</TooltipTrigger>\n * <TooltipContent>Tooltip content</TooltipContent>\n * </Tooltip>\n * </TooltipProvider>\n * ```\n */\nconst TooltipProvider = TooltipPrimitive.Provider\n\nconst Tooltip = TooltipPrimitive.Root\n\nconst TooltipTrigger = TooltipPrimitive.Trigger\n\nconst TooltipContent = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <TooltipPrimitive.Portal>\n <TooltipPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n \"z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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 origin-[--radix-tooltip-content-transform-origin]\",\n className\n )}\n {...props}\n />\n </TooltipPrimitive.Portal>\n))\nTooltipContent.displayName = TooltipPrimitive.Content.displayName\n\nexport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }\n"]}