@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.
- package/dist/atoms.cjs.js +1 -1
- package/dist/atoms.d.mts +546 -16
- package/dist/atoms.d.ts +546 -16
- package/dist/atoms.esm.js +1 -1
- package/dist/checkbox-DxgDKaHx.d.mts +108 -0
- package/dist/checkbox-DxgDKaHx.d.ts +108 -0
- package/dist/chunk-23T2PH5G.esm.js +2 -0
- package/dist/{chunk-5ZMFQLBF.esm.js.map → chunk-23T2PH5G.esm.js.map} +1 -1
- package/dist/chunk-2QG3QTSW.cjs.js +2 -0
- package/dist/chunk-2QG3QTSW.cjs.js.map +1 -0
- package/dist/chunk-DTM5LZHM.cjs.js +2 -0
- package/dist/chunk-DTM5LZHM.cjs.js.map +1 -0
- package/dist/chunk-HW32JE75.cjs.js +2 -0
- package/dist/chunk-HW32JE75.cjs.js.map +1 -0
- package/dist/{chunk-IXYLGKQT.cjs.js → chunk-JIRS6MWF.cjs.js} +2 -2
- package/dist/{chunk-IXYLGKQT.cjs.js.map → chunk-JIRS6MWF.cjs.js.map} +1 -1
- package/dist/chunk-JUZG25DH.esm.js +2 -0
- package/dist/chunk-JUZG25DH.esm.js.map +1 -0
- package/dist/chunk-MOYOCJW6.esm.js +2 -0
- package/dist/chunk-MOYOCJW6.esm.js.map +1 -0
- package/dist/chunk-STRDPP3B.esm.js +2 -0
- package/dist/chunk-STRDPP3B.esm.js.map +1 -0
- package/dist/chunk-UK47BFA3.cjs.js +2 -0
- package/dist/chunk-UK47BFA3.cjs.js.map +1 -0
- package/dist/chunk-UTVXFZLD.esm.js +2 -0
- package/dist/chunk-UTVXFZLD.esm.js.map +1 -0
- package/dist/chunk-YEZB7AOJ.esm.js +2 -0
- package/dist/chunk-YEZB7AOJ.esm.js.map +1 -0
- package/dist/chunk-YGLYFSF6.cjs.js +2 -0
- package/dist/chunk-YGLYFSF6.cjs.js.map +1 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.mts +11 -3
- package/dist/index.d.ts +11 -3
- package/dist/index.esm.js +1 -1
- package/dist/molecules.cjs.js +1 -1
- package/dist/molecules.d.mts +30 -1
- package/dist/molecules.d.ts +30 -1
- package/dist/molecules.esm.js +1 -1
- package/dist/organisms.cjs.js +1 -1
- package/dist/organisms.esm.js +1 -1
- package/dist/rhf.cjs.js +1 -1
- package/dist/rhf.cjs.js.map +1 -1
- package/dist/rhf.d.mts +211 -2
- package/dist/rhf.d.ts +211 -2
- package/dist/rhf.esm.js +1 -1
- package/dist/rhf.esm.js.map +1 -1
- package/package.json +24 -12
- package/dist/chunk-3HTFCAYW.esm.js +0 -2
- package/dist/chunk-3HTFCAYW.esm.js.map +0 -1
- package/dist/chunk-5ZMFQLBF.esm.js +0 -2
- package/dist/chunk-7NN2L46N.esm.js +0 -2
- package/dist/chunk-7NN2L46N.esm.js.map +0 -1
- package/dist/chunk-BR7Z6MCL.cjs.js +0 -2
- package/dist/chunk-BR7Z6MCL.cjs.js.map +0 -1
- package/dist/chunk-C4ZAMI2P.cjs.js +0 -2
- package/dist/chunk-C4ZAMI2P.cjs.js.map +0 -1
- package/dist/chunk-EBPUGBUT.esm.js +0 -2
- package/dist/chunk-EBPUGBUT.esm.js.map +0 -1
- package/dist/chunk-ELZV2CGE.cjs.js +0 -2
- package/dist/chunk-ELZV2CGE.cjs.js.map +0 -1
- package/dist/chunk-LCAU4YZI.esm.js +0 -2
- package/dist/chunk-LCAU4YZI.esm.js.map +0 -1
- package/dist/chunk-OZY26HWB.cjs.js +0 -2
- package/dist/chunk-OZY26HWB.cjs.js.map +0 -1
- package/dist/chunk-PEQ3VT44.esm.js +0 -2
- package/dist/chunk-PEQ3VT44.esm.js.map +0 -1
- package/dist/chunk-UAZIJGWR.cjs.js +0 -2
- package/dist/chunk-UAZIJGWR.cjs.js.map +0 -1
- package/dist/input-Ruz0ZoY6.d.mts +0 -12
- package/dist/input-Ruz0ZoY6.d.ts +0 -12
package/dist/molecules.d.mts
CHANGED
|
@@ -2,6 +2,7 @@ import * as React$1 from 'react';
|
|
|
2
2
|
import * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu';
|
|
3
3
|
import { VariantProps } from 'class-variance-authority';
|
|
4
4
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
5
|
+
import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Card is a flexible container component that can be used to group related content and actions.
|
|
@@ -169,4 +170,32 @@ declare const NavigationMenuLink: React$1.ForwardRefExoticComponent<NavigationMe
|
|
|
169
170
|
declare const NavigationMenuViewport: React$1.ForwardRefExoticComponent<NavigationMenuViewportProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
170
171
|
declare const NavigationMenuIndicator: React$1.ForwardRefExoticComponent<NavigationMenuIndicatorProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
171
172
|
|
|
172
|
-
|
|
173
|
+
/**
|
|
174
|
+
* Tabs component provides a way to organize content into separate views where only one view is visible at a time.
|
|
175
|
+
* It follows the WAI-ARIA Tabs Pattern for accessibility.
|
|
176
|
+
*
|
|
177
|
+
* @url https://sergii-melnykov.github.io/ui/?path=/docs/molecules-tabs--docs
|
|
178
|
+
*
|
|
179
|
+
* @example
|
|
180
|
+
* ```tsx
|
|
181
|
+
* <Tabs defaultValue="account">
|
|
182
|
+
* <TabsList>
|
|
183
|
+
* <TabsTrigger value="account">Account</TabsTrigger>
|
|
184
|
+
* <TabsTrigger value="password">Password</TabsTrigger>
|
|
185
|
+
* </TabsList>
|
|
186
|
+
* <TabsContent value="account">
|
|
187
|
+
* <p>Account settings content</p>
|
|
188
|
+
* </TabsContent>
|
|
189
|
+
* <TabsContent value="password">
|
|
190
|
+
* <p>Password settings content</p>
|
|
191
|
+
* </TabsContent>
|
|
192
|
+
* </Tabs>
|
|
193
|
+
* ```
|
|
194
|
+
*/
|
|
195
|
+
|
|
196
|
+
declare const Tabs: React$1.ForwardRefExoticComponent<TabsPrimitive.TabsProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
197
|
+
declare const TabsList: React$1.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsListProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
198
|
+
declare const TabsTrigger: React$1.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsTriggerProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
|
|
199
|
+
declare const TabsContent: React$1.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
200
|
+
|
|
201
|
+
export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, NavigationMenu, NavigationMenuContent, type NavigationMenuContentProps, NavigationMenuIndicator, type NavigationMenuIndicatorProps, NavigationMenuItem, type NavigationMenuItemProps, NavigationMenuLink, type NavigationMenuLinkProps, NavigationMenuList, type NavigationMenuListProps, type NavigationMenuProps, NavigationMenuTrigger, type NavigationMenuTriggerProps, NavigationMenuViewport, type NavigationMenuViewportProps, Tabs, TabsContent, TabsList, TabsTrigger };
|
package/dist/molecules.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import * as React$1 from 'react';
|
|
|
2
2
|
import * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu';
|
|
3
3
|
import { VariantProps } from 'class-variance-authority';
|
|
4
4
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
5
|
+
import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Card is a flexible container component that can be used to group related content and actions.
|
|
@@ -169,4 +170,32 @@ declare const NavigationMenuLink: React$1.ForwardRefExoticComponent<NavigationMe
|
|
|
169
170
|
declare const NavigationMenuViewport: React$1.ForwardRefExoticComponent<NavigationMenuViewportProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
170
171
|
declare const NavigationMenuIndicator: React$1.ForwardRefExoticComponent<NavigationMenuIndicatorProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
171
172
|
|
|
172
|
-
|
|
173
|
+
/**
|
|
174
|
+
* Tabs component provides a way to organize content into separate views where only one view is visible at a time.
|
|
175
|
+
* It follows the WAI-ARIA Tabs Pattern for accessibility.
|
|
176
|
+
*
|
|
177
|
+
* @url https://sergii-melnykov.github.io/ui/?path=/docs/molecules-tabs--docs
|
|
178
|
+
*
|
|
179
|
+
* @example
|
|
180
|
+
* ```tsx
|
|
181
|
+
* <Tabs defaultValue="account">
|
|
182
|
+
* <TabsList>
|
|
183
|
+
* <TabsTrigger value="account">Account</TabsTrigger>
|
|
184
|
+
* <TabsTrigger value="password">Password</TabsTrigger>
|
|
185
|
+
* </TabsList>
|
|
186
|
+
* <TabsContent value="account">
|
|
187
|
+
* <p>Account settings content</p>
|
|
188
|
+
* </TabsContent>
|
|
189
|
+
* <TabsContent value="password">
|
|
190
|
+
* <p>Password settings content</p>
|
|
191
|
+
* </TabsContent>
|
|
192
|
+
* </Tabs>
|
|
193
|
+
* ```
|
|
194
|
+
*/
|
|
195
|
+
|
|
196
|
+
declare const Tabs: React$1.ForwardRefExoticComponent<TabsPrimitive.TabsProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
197
|
+
declare const TabsList: React$1.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsListProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
198
|
+
declare const TabsTrigger: React$1.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsTriggerProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
|
|
199
|
+
declare const TabsContent: React$1.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
200
|
+
|
|
201
|
+
export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, NavigationMenu, NavigationMenuContent, type NavigationMenuContentProps, NavigationMenuIndicator, type NavigationMenuIndicatorProps, NavigationMenuItem, type NavigationMenuItemProps, NavigationMenuLink, type NavigationMenuLinkProps, NavigationMenuList, type NavigationMenuListProps, type NavigationMenuProps, NavigationMenuTrigger, type NavigationMenuTriggerProps, NavigationMenuViewport, type NavigationMenuViewportProps, Tabs, TabsContent, TabsList, TabsTrigger };
|
package/dist/molecules.esm.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{a as Card,e as CardContent,d as CardDescription,f as CardFooter,b as CardHeader,c as CardTitle,g as NavigationMenu,k as NavigationMenuContent,n as NavigationMenuIndicator,i as NavigationMenuItem,l as NavigationMenuLink,h as NavigationMenuList,j as NavigationMenuTrigger,m as NavigationMenuViewport}from'./chunk-
|
|
1
|
+
export{a as Card,e as CardContent,d as CardDescription,f as CardFooter,b as CardHeader,c as CardTitle,g as NavigationMenu,k as NavigationMenuContent,n as NavigationMenuIndicator,i as NavigationMenuItem,l as NavigationMenuLink,h as NavigationMenuList,j as NavigationMenuTrigger,m as NavigationMenuViewport,o as Tabs,r as TabsContent,p as TabsList,q as TabsTrigger}from'./chunk-STRDPP3B.esm.js';import'./chunk-C26U3FL4.esm.js';//# sourceMappingURL=molecules.esm.js.map
|
|
2
2
|
//# sourceMappingURL=molecules.esm.js.map
|
package/dist/organisms.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkJIRS6MWF_cjs_js=require('./chunk-JIRS6MWF.cjs.js');require('./chunk-KOYJODOP.cjs.js'),require('./chunk-HW32JE75.cjs.js'),require('./chunk-UK47BFA3.cjs.js'),require('./chunk-SL2ZUI4G.cjs.js');Object.defineProperty(exports,"Drawer",{enumerable:true,get:function(){return chunkJIRS6MWF_cjs_js.a}});Object.defineProperty(exports,"DrawerClose",{enumerable:true,get:function(){return chunkJIRS6MWF_cjs_js.d}});Object.defineProperty(exports,"DrawerContent",{enumerable:true,get:function(){return chunkJIRS6MWF_cjs_js.f}});Object.defineProperty(exports,"DrawerDescription",{enumerable:true,get:function(){return chunkJIRS6MWF_cjs_js.j}});Object.defineProperty(exports,"DrawerFooter",{enumerable:true,get:function(){return chunkJIRS6MWF_cjs_js.h}});Object.defineProperty(exports,"DrawerHeader",{enumerable:true,get:function(){return chunkJIRS6MWF_cjs_js.g}});Object.defineProperty(exports,"DrawerOverlay",{enumerable:true,get:function(){return chunkJIRS6MWF_cjs_js.e}});Object.defineProperty(exports,"DrawerPortal",{enumerable:true,get:function(){return chunkJIRS6MWF_cjs_js.c}});Object.defineProperty(exports,"DrawerTitle",{enumerable:true,get:function(){return chunkJIRS6MWF_cjs_js.i}});Object.defineProperty(exports,"DrawerTrigger",{enumerable:true,get:function(){return chunkJIRS6MWF_cjs_js.b}});Object.defineProperty(exports,"DropdownMenu",{enumerable:true,get:function(){return chunkJIRS6MWF_cjs_js.J}});Object.defineProperty(exports,"DropdownMenuCheckboxItem",{enumerable:true,get:function(){return chunkJIRS6MWF_cjs_js.T}});Object.defineProperty(exports,"DropdownMenuContent",{enumerable:true,get:function(){return chunkJIRS6MWF_cjs_js.R}});Object.defineProperty(exports,"DropdownMenuGroup",{enumerable:true,get:function(){return chunkJIRS6MWF_cjs_js.L}});Object.defineProperty(exports,"DropdownMenuItem",{enumerable:true,get:function(){return chunkJIRS6MWF_cjs_js.S}});Object.defineProperty(exports,"DropdownMenuLabel",{enumerable:true,get:function(){return chunkJIRS6MWF_cjs_js.V}});Object.defineProperty(exports,"DropdownMenuPortal",{enumerable:true,get:function(){return chunkJIRS6MWF_cjs_js.M}});Object.defineProperty(exports,"DropdownMenuRadioGroup",{enumerable:true,get:function(){return chunkJIRS6MWF_cjs_js.O}});Object.defineProperty(exports,"DropdownMenuRadioItem",{enumerable:true,get:function(){return chunkJIRS6MWF_cjs_js.U}});Object.defineProperty(exports,"DropdownMenuSeparator",{enumerable:true,get:function(){return chunkJIRS6MWF_cjs_js.W}});Object.defineProperty(exports,"DropdownMenuShortcut",{enumerable:true,get:function(){return chunkJIRS6MWF_cjs_js.X}});Object.defineProperty(exports,"DropdownMenuSub",{enumerable:true,get:function(){return chunkJIRS6MWF_cjs_js.N}});Object.defineProperty(exports,"DropdownMenuSubContent",{enumerable:true,get:function(){return chunkJIRS6MWF_cjs_js.Q}});Object.defineProperty(exports,"DropdownMenuSubTrigger",{enumerable:true,get:function(){return chunkJIRS6MWF_cjs_js.P}});Object.defineProperty(exports,"DropdownMenuTrigger",{enumerable:true,get:function(){return chunkJIRS6MWF_cjs_js.K}});Object.defineProperty(exports,"Sidebar",{enumerable:true,get:function(){return chunkJIRS6MWF_cjs_js.m}});Object.defineProperty(exports,"SidebarContent",{enumerable:true,get:function(){return chunkJIRS6MWF_cjs_js.u}});Object.defineProperty(exports,"SidebarFooter",{enumerable:true,get:function(){return chunkJIRS6MWF_cjs_js.s}});Object.defineProperty(exports,"SidebarGroup",{enumerable:true,get:function(){return chunkJIRS6MWF_cjs_js.v}});Object.defineProperty(exports,"SidebarGroupAction",{enumerable:true,get:function(){return chunkJIRS6MWF_cjs_js.x}});Object.defineProperty(exports,"SidebarGroupContent",{enumerable:true,get:function(){return chunkJIRS6MWF_cjs_js.y}});Object.defineProperty(exports,"SidebarGroupLabel",{enumerable:true,get:function(){return chunkJIRS6MWF_cjs_js.w}});Object.defineProperty(exports,"SidebarHeader",{enumerable:true,get:function(){return chunkJIRS6MWF_cjs_js.r}});Object.defineProperty(exports,"SidebarInput",{enumerable:true,get:function(){return chunkJIRS6MWF_cjs_js.q}});Object.defineProperty(exports,"SidebarInset",{enumerable:true,get:function(){return chunkJIRS6MWF_cjs_js.p}});Object.defineProperty(exports,"SidebarMenu",{enumerable:true,get:function(){return chunkJIRS6MWF_cjs_js.z}});Object.defineProperty(exports,"SidebarMenuAction",{enumerable:true,get:function(){return chunkJIRS6MWF_cjs_js.D}});Object.defineProperty(exports,"SidebarMenuBadge",{enumerable:true,get:function(){return chunkJIRS6MWF_cjs_js.E}});Object.defineProperty(exports,"SidebarMenuButton",{enumerable:true,get:function(){return chunkJIRS6MWF_cjs_js.C}});Object.defineProperty(exports,"SidebarMenuItem",{enumerable:true,get:function(){return chunkJIRS6MWF_cjs_js.A}});Object.defineProperty(exports,"SidebarMenuSkeleton",{enumerable:true,get:function(){return chunkJIRS6MWF_cjs_js.F}});Object.defineProperty(exports,"SidebarMenuSub",{enumerable:true,get:function(){return chunkJIRS6MWF_cjs_js.G}});Object.defineProperty(exports,"SidebarMenuSubButton",{enumerable:true,get:function(){return chunkJIRS6MWF_cjs_js.I}});Object.defineProperty(exports,"SidebarMenuSubItem",{enumerable:true,get:function(){return chunkJIRS6MWF_cjs_js.H}});Object.defineProperty(exports,"SidebarProvider",{enumerable:true,get:function(){return chunkJIRS6MWF_cjs_js.l}});Object.defineProperty(exports,"SidebarRail",{enumerable:true,get:function(){return chunkJIRS6MWF_cjs_js.o}});Object.defineProperty(exports,"SidebarSeparator",{enumerable:true,get:function(){return chunkJIRS6MWF_cjs_js.t}});Object.defineProperty(exports,"SidebarTrigger",{enumerable:true,get:function(){return chunkJIRS6MWF_cjs_js.n}});Object.defineProperty(exports,"sidebarMenuButtonVariants",{enumerable:true,get:function(){return chunkJIRS6MWF_cjs_js.B}});Object.defineProperty(exports,"useSidebar",{enumerable:true,get:function(){return chunkJIRS6MWF_cjs_js.k}});//# sourceMappingURL=organisms.cjs.js.map
|
|
2
2
|
//# sourceMappingURL=organisms.cjs.js.map
|
package/dist/organisms.esm.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{a as Drawer,d as DrawerClose,f as DrawerContent,j as DrawerDescription,h as DrawerFooter,g as DrawerHeader,e as DrawerOverlay,c as DrawerPortal,i as DrawerTitle,b as DrawerTrigger,J as DropdownMenu,T as DropdownMenuCheckboxItem,R as DropdownMenuContent,L as DropdownMenuGroup,S as DropdownMenuItem,V as DropdownMenuLabel,M as DropdownMenuPortal,O as DropdownMenuRadioGroup,U as DropdownMenuRadioItem,W as DropdownMenuSeparator,X as DropdownMenuShortcut,N as DropdownMenuSub,Q as DropdownMenuSubContent,P as DropdownMenuSubTrigger,K as DropdownMenuTrigger,m as Sidebar,u as SidebarContent,s as SidebarFooter,v as SidebarGroup,x as SidebarGroupAction,y as SidebarGroupContent,w as SidebarGroupLabel,r as SidebarHeader,q as SidebarInput,p as SidebarInset,z as SidebarMenu,D as SidebarMenuAction,E as SidebarMenuBadge,C as SidebarMenuButton,A as SidebarMenuItem,F as SidebarMenuSkeleton,G as SidebarMenuSub,I as SidebarMenuSubButton,H as SidebarMenuSubItem,l as SidebarProvider,o as SidebarRail,t as SidebarSeparator,n as SidebarTrigger,B as sidebarMenuButtonVariants,k as useSidebar}from'./chunk-
|
|
1
|
+
export{a as Drawer,d as DrawerClose,f as DrawerContent,j as DrawerDescription,h as DrawerFooter,g as DrawerHeader,e as DrawerOverlay,c as DrawerPortal,i as DrawerTitle,b as DrawerTrigger,J as DropdownMenu,T as DropdownMenuCheckboxItem,R as DropdownMenuContent,L as DropdownMenuGroup,S as DropdownMenuItem,V as DropdownMenuLabel,M as DropdownMenuPortal,O as DropdownMenuRadioGroup,U as DropdownMenuRadioItem,W as DropdownMenuSeparator,X as DropdownMenuShortcut,N as DropdownMenuSub,Q as DropdownMenuSubContent,P as DropdownMenuSubTrigger,K as DropdownMenuTrigger,m as Sidebar,u as SidebarContent,s as SidebarFooter,v as SidebarGroup,x as SidebarGroupAction,y as SidebarGroupContent,w as SidebarGroupLabel,r as SidebarHeader,q as SidebarInput,p as SidebarInset,z as SidebarMenu,D as SidebarMenuAction,E as SidebarMenuBadge,C as SidebarMenuButton,A as SidebarMenuItem,F as SidebarMenuSkeleton,G as SidebarMenuSub,I as SidebarMenuSubButton,H as SidebarMenuSubItem,l as SidebarProvider,o as SidebarRail,t as SidebarSeparator,n as SidebarTrigger,B as sidebarMenuButtonVariants,k as useSidebar}from'./chunk-23T2PH5G.esm.js';import'./chunk-M4S5YZ56.esm.js';import'./chunk-YEZB7AOJ.esm.js';import'./chunk-JUZG25DH.esm.js';import'./chunk-C26U3FL4.esm.js';//# sourceMappingURL=organisms.esm.js.map
|
|
2
2
|
//# sourceMappingURL=organisms.esm.js.map
|
package/dist/rhf.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunk2QG3QTSW_cjs_js=require('./chunk-2QG3QTSW.cjs.js'),chunkUK47BFA3_cjs_js=require('./chunk-UK47BFA3.cjs.js'),chunkSL2ZUI4G_cjs_js=require('./chunk-SL2ZUI4G.cjs.js'),reactHookForm=require('react-hook-form'),F=require('react'),reactSlot=require('@radix-ui/react-slot'),jsxRuntime=require('react/jsx-runtime');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 F__namespace=/*#__PURE__*/_interopNamespace(F);var oe=reactHookForm.FormProvider,U=F__namespace.createContext({}),R=({...r})=>jsxRuntime.jsx(U.Provider,{value:{name:r.name},children:jsxRuntime.jsx(reactHookForm.Controller,{...r})}),k=()=>{let r=F__namespace.useContext(U),a=F__namespace.useContext(X),{getFieldState:t,formState:i}=reactHookForm.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__namespace.createContext({}),p=F__namespace.forwardRef(({className:r,...a},t)=>{let i=F__namespace.useId();return jsxRuntime.jsx(X.Provider,{value:{id:i},children:jsxRuntime.jsx("div",{ref:t,className:chunkSL2ZUI4G_cjs_js.a("space-y-2",r),...a})})});p.displayName="FormItem";var u=F__namespace.forwardRef(({className:r,...a},t)=>{let{error:i,formItemId:o}=k();return jsxRuntime.jsx(chunk2QG3QTSW_cjs_js.a,{ref:t,className:chunkSL2ZUI4G_cjs_js.a(i&&"text-destructive",r),htmlFor:o,...a})});u.displayName="FormLabel";var c=F__namespace.forwardRef(({...r},a)=>{let{error:t,formItemId:i,formDescriptionId:o,formMessageId:e}=k();return jsxRuntime.jsx(reactSlot.Slot,{ref:a,id:i,"aria-describedby":t?`${o} ${e}`:`${o}`,"aria-invalid":!!t,...r})});c.displayName="FormControl";var n=F__namespace.forwardRef(({className:r,...a},t)=>{let{formDescriptionId:i}=k();return jsxRuntime.jsx("p",{ref:t,id:i,className:chunkSL2ZUI4G_cjs_js.a("text-sm text-muted-foreground",r),...a})});n.displayName="FormDescription";var f=F__namespace.forwardRef(({className:r,children:a,...t},i)=>{let{error:o,formMessageId:e}=k(),m=o?String(o?.message??""):a;return m?jsxRuntime.jsx("p",{ref:i,id:e,className:chunkSL2ZUI4G_cjs_js.a("text-sm font-medium text-destructive",r),...t,children:m}):null});f.displayName="FormMessage";function Ce({name:r,label:a,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}=reactHookForm.useFormContext();return jsxRuntime.jsx(R,{name:r,control:C,render:({field:l,fieldState:{error:d}})=>jsxRuntime.jsxs(p,{children:[a&&jsxRuntime.jsxs(u,{children:[a,m&&jsxRuntime.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),jsxRuntime.jsx(c,{children:jsxRuntime.jsx(chunkUK47BFA3_cjs_js.c,{...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:chunkSL2ZUI4G_cjs_js.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&&jsxRuntime.jsx(n,{children:t}),d&&jsxRuntime.jsx(f,{children:d.message}),!d&&e&&jsxRuntime.jsx("p",{className:"text-sm text-yellow-600 dark:text-yellow-500",role:"alert",children:e})]})})}var E=F__namespace.forwardRef(({className:r,autoResize:a=false,...t},i)=>{let o=F__namespace.useRef(null);return F__namespace.useEffect(()=>{if(!a||!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]),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",r),ref:i,...t})});E.displayName="Textarea";function De({name:r,label:a,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}=reactHookForm.useFormContext();return jsxRuntime.jsx(R,{name:r,control:C,render:({field:l,fieldState:{error:d}})=>jsxRuntime.jsxs(p,{children:[a&&jsxRuntime.jsxs(u,{children:[a,e&&jsxRuntime.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),jsxRuntime.jsx(c,{children:jsxRuntime.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:chunkSL2ZUI4G_cjs_js.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&&jsxRuntime.jsx(n,{children:t}),d&&jsxRuntime.jsx(f,{children:d.message}),!d&&o&&jsxRuntime.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}=reactHookForm.useFormContext();return jsxRuntime.jsx(R,{name:r,control:x,render:({field:b,fieldState:{error:s}})=>jsxRuntime.jsxs(p,{className:"flex flex-row items-start space-x-3 space-y-0",children:[jsxRuntime.jsx(c,{children:jsxRuntime.jsx(chunk2QG3QTSW_cjs_js.g,{checked:b.value,onCheckedChange:b.onChange,disabled:m,"aria-label":y,"aria-describedby":h,"aria-invalid":!!s,"aria-required":e,...T})}),jsxRuntime.jsxs("div",{className:"space-y-1 leading-none",children:[a&&jsxRuntime.jsxs(u,{children:[a,e&&jsxRuntime.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),t&&jsxRuntime.jsx(n,{children:t}),s&&jsxRuntime.jsx(f,{children:s.message}),!s&&o&&jsxRuntime.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}=reactHookForm.useFormContext();return jsxRuntime.jsx(R,{name:r,control:x,render:({field:b,fieldState:{error:s}})=>jsxRuntime.jsxs(p,{className:"flex flex-row items-start space-x-3 space-y-0",children:[jsxRuntime.jsx(c,{children:jsxRuntime.jsx(chunk2QG3QTSW_cjs_js.b,{checked:b.value,onCheckedChange:b.onChange,disabled:m,"aria-label":y,"aria-describedby":h,"aria-invalid":!!s,"aria-required":e,...T})}),jsxRuntime.jsxs("div",{className:"space-y-1 leading-none",children:[a&&jsxRuntime.jsxs(u,{children:[a,e&&jsxRuntime.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),t&&jsxRuntime.jsx(n,{children:t}),s&&jsxRuntime.jsx(f,{children:s.message}),!s&&o&&jsxRuntime.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,disabled:m,readOnly:I,"aria-label":y,"aria-describedby":h,children:T,...x}){let{control:b}=reactHookForm.useFormContext(),s="options"in x;return jsxRuntime.jsx(R,{name:r,control:b,render:({field:C,fieldState:{error:l}})=>jsxRuntime.jsxs(p,{className:"space-y-3",children:[a&&jsxRuntime.jsxs(u,{children:[a,e&&jsxRuntime.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),jsxRuntime.jsx(c,{children:jsxRuntime.jsxs(chunk2QG3QTSW_cjs_js.c,{onValueChange:C.onChange,defaultValue:C.value,disabled:m,"aria-label":y,"aria-describedby":h,"aria-invalid":!!l,"aria-required":e,...x,children:[s&&x.options.map(d=>jsxRuntime.jsxs(chunk2QG3QTSW_cjs_js.e,{children:[jsxRuntime.jsx(chunk2QG3QTSW_cjs_js.d,{value:d.id,id:d.id}),jsxRuntime.jsx(chunk2QG3QTSW_cjs_js.f,{htmlFor:d.id,children:d.label})]},d.id)),!s&&T]})}),t&&jsxRuntime.jsx(n,{children:t}),l&&jsxRuntime.jsx(f,{children:l.message}),!l&&o&&jsxRuntime.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}=reactHookForm.useFormContext();return jsxRuntime.jsx(R,{name:r,control:b,render:({field:s,fieldState:{error:C}})=>jsxRuntime.jsxs(p,{className:"space-y-3",children:[a&&jsxRuntime.jsxs(u,{children:[a,e&&jsxRuntime.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),jsxRuntime.jsx(c,{children:jsxRuntime.jsx(chunk2QG3QTSW_cjs_js.c,{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=>jsxRuntime.jsx(chunkUK47BFA3_cjs_js.b,{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&&jsxRuntime.jsx(n,{children:t}),o&&jsxRuntime.jsx(n,{className:"text-warning",children:o}),C&&jsxRuntime.jsx(f,{children:C.message})]})})}exports.Form=oe;exports.FormControl=c;exports.FormDescription=n;exports.FormField=R;exports.FormItem=p;exports.FormLabel=u;exports.FormMessage=f;exports.RHFCheckbox=Be;exports.RHFRadioButtonGroup=ra;exports.RHFRadioGroup=Ze;exports.RHFSwitch=Je;exports.RHFTextField=Ce;exports.RHFTextarea=De;exports.useFormField=k;//# sourceMappingURL=rhf.cjs.js.map
|
|
2
2
|
//# sourceMappingURL=rhf.cjs.js.map
|
package/dist/rhf.cjs.js.map
CHANGED
|
@@ -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","l","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":"6qBAiBA,IAAMA,CAAOC,CAAAA,0BAAAA,CASPC,EAAyBC,YAAqC,CAAA,aAAA,CAAA,EAA2B,CAEzFC,CAAAA,CAAAA,CAAY,CAGhB,CACA,GAAGC,CACL,CAAA,GAE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AA,CAAAA,CAAM,KAAM,CAAA,IAAA,EAAM,CAAA,CAEnCA,EAAM,MAAO,EAAA,CACbH,CAASM,GAAAA,CAAC,EACZ,CAAA,CACA,UAAW/B,sBACTE,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,cAACuB,CAAAA,CAAAA,CAAA,CAAiB,QAAAO,CAAAA,CAAAA,CAAY,EAC7Cd,CAAShB,EAAAA,cAAAA,CAACwB,EAAA,CAAa,QAAA,CAAAR,CAAM,CAAA,OAAA,CAAQ,CACrC,CAAA,CAACA,GAASgB,CACThC,EAAAA,cAAAA,CAAC,GAAE,CAAA,CAAA,SAAA,CAAU,8CAA+C,CAAA,IAAA,CAAK,QAC9D,QAAAgC,CAAAA,CAAAA,CACH,CAEJ,CAAA,CAAA,CAAA,CAEJ,CAEJ","file":"rhf.cjs.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","F","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":"irBAiBMA,EAAOC,CAAAA,0BAAAA,CASPC,EAAyBC,YAAqC,CAAA,aAAA,CAAA,EAA2B,CAEzFC,CAAAA,CAAAA,CAAY,CAGhB,CACA,GAAGC,CACL,CAEIC,GAAAA,cAAAA,CAACJ,EAAiB,QAAjB,CAAA,CAA0B,MAAO,CAAE,IAAA,CAAMG,EAAM,IAAK,CAAA,CACnD,QAAAC,CAAAA,cAAAA,CAACC,yBAAA,CAAY,GAAGF,EAAO,CACzB,CAAA,CAAA,CAIEG,EAAe,IAAM,CACzB,IAAMC,CAAqB,CAAAN,YAAA,CAAA,UAAA,CAAWD,CAAgB,CAChDQ,CAAAA,CAAAA,CAAoBP,wBAAWQ,CAAe,CAAA,CAC9C,CAAE,aAAAC,CAAAA,CAAAA,CAAe,UAAAC,CAAU,CAAA,CAAIC,8BAE/BC,CAAAA,CAAAA,CAAaH,EAAcH,CAAa,CAAA,IAAA,CAAMI,CAAS,CAE7D,CAAA,GAAI,CAACJ,CACH,CAAA,MAAM,IAAI,KAAM,CAAA,gDAAgD,EAGlE,GAAM,CAAE,GAAAO,CAAG,CAAA,CAAIN,CAEf,CAAA,OAAO,CACL,EAAAM,CAAAA,CAAAA,CACA,KAAMP,CAAa,CAAA,IAAA,CACnB,WAAY,CAAGO,EAAAA,CAAE,aACjB,iBAAmB,CAAA,CAAA,EAAGA,CAAE,CACxB,sBAAA,CAAA,CAAA,aAAA,CAAe,GAAGA,CAAE,CAAA,kBAAA,CAAA,CACpB,GAAGD,CACL,CACF,EAMMJ,CAAwB,CAAAR,YAAA,CAAA,aAAA,CAAoC,EAA0B,CAAA,CAEtFc,EAAiBd,YACrB,CAAA,UAAA,CAAA,CAAC,CAAE,SAAAe,CAAAA,CAA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\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/dist/rhf.d.mts
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 './
|
|
6
|
+
import { I as Input, C as Checkbox, S as Switch, R as RadioGroup } from './checkbox-DxgDKaHx.mjs';
|
|
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 };
|