@me1a/ui 2.1.8 → 2.2.0
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-J5A6PILI.cjs.js +2 -0
- package/dist/chunk-J5A6PILI.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-Q76IMLQ3.esm.js +2 -0
- package/dist/chunk-Q76IMLQ3.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-YEZB7AOJ.esm.js +2 -0
- package/dist/chunk-YEZB7AOJ.esm.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/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export { B as Button, a as ButtonProps, T as Tooltip, d as TooltipContent, e as TooltipProvider, c as TooltipTrigger, b as buttonVariants } from './tooltip-B4jzaurK.js';
|
|
2
|
-
export { Avatar, AvatarFallback, AvatarFallbackProps, AvatarImage, AvatarImageProps, AvatarProps, Badge, BadgeProps, Box, BoxProps, Container, ContainerProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger,
|
|
3
|
-
export { I as Input } from './
|
|
2
|
+
export { Accordion, AccordionContent, AccordionContentProps, AccordionItem, AccordionItemProps, AccordionProps, AccordionTrigger, AccordionTriggerProps, Avatar, AvatarFallback, AvatarFallbackProps, AvatarImage, AvatarImageProps, AvatarProps, Badge, BadgeProps, Box, BoxProps, Breadcrumb, BreadcrumbEllipsis, BreadcrumbEllipsisProps, BreadcrumbItem, BreadcrumbItemProps, BreadcrumbLink, BreadcrumbLinkProps, BreadcrumbList, BreadcrumbListProps, BreadcrumbPage, BreadcrumbPageProps, BreadcrumbProps, BreadcrumbSeparator, BreadcrumbSeparatorProps, CheckboxProps, Collapsible, CollapsibleContent, CollapsibleContentProps, CollapsibleProps, CollapsibleTrigger, CollapsibleTriggerProps, Command, CommandDialog, CommandDialogProps, CommandEmpty, CommandEmptyProps, CommandEmptyRef, CommandGroup, CommandGroupProps, CommandGroupRef, CommandInput, CommandInputProps, CommandInputRef, CommandItem, CommandItemProps, CommandItemRef, CommandList, CommandListProps, CommandListRef, CommandProps, CommandRef, CommandSeparator, CommandSeparatorProps, CommandSeparatorRef, CommandShortcut, CommandShortcutProps, Container, ContainerProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, MultiSelect, MultiSelectOption, MultiSelectProps, PageLoader, PageLoaderProps, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationLinkProps, PaginationNext, PaginationPrevious, RadioGroupItemProps, RadioGroupProps, ResizableHandle, ResizableHandleProps, ResizablePanel, ResizablePanelGroup, ResizablePanelGroupProps, ResizablePanelProps, Select, SelectOption, SelectProps, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Skeleton, Stack, StackProps, SwitchProps, Table, TableBody, TableBodyProps, TableCaption, TableCaptionProps, TableCell, TableCellProps, TableFooter, TableFooterProps, TableHead, TableHeadProps, TableHeader, TableHeaderProps, TableProps, TableRow, TableRowProps, TextField, TextFieldProps, Toaster, Typography, TypographyAlign, TypographyProps, TypographyVariant, badgeVariants, typographyVariants } from './atoms.js';
|
|
3
|
+
export { C as Checkbox, I as Input, L as Label, a as LabelProps, R as RadioGroup, b as RadioGroupItem, d as RadioItemContainer, c as RadioItemLabel, S as Switch } from './checkbox-DxgDKaHx.js';
|
|
4
4
|
export { d as Toast, h as ToastAction, a as ToastActionElement, g as ToastClose, f as ToastDescription, T as ToastProps, b as ToastProvider, e as ToastTitle, c as ToastViewport } from './toast-2xT7L1tJ.js';
|
|
5
|
-
export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, NavigationMenu, NavigationMenuContent, NavigationMenuContentProps, NavigationMenuIndicator, NavigationMenuIndicatorProps, NavigationMenuItem, NavigationMenuItemProps, NavigationMenuLink, NavigationMenuLinkProps, NavigationMenuList, NavigationMenuListProps, NavigationMenuProps, NavigationMenuTrigger, NavigationMenuTriggerProps, NavigationMenuViewport, NavigationMenuViewportProps } from './molecules.js';
|
|
5
|
+
export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, NavigationMenu, NavigationMenuContent, NavigationMenuContentProps, NavigationMenuIndicator, NavigationMenuIndicatorProps, NavigationMenuItem, NavigationMenuItemProps, NavigationMenuLink, NavigationMenuLinkProps, NavigationMenuList, NavigationMenuListProps, NavigationMenuProps, NavigationMenuTrigger, NavigationMenuTriggerProps, NavigationMenuViewport, NavigationMenuViewportProps, Tabs, TabsContent, TabsList, TabsTrigger } from './molecules.js';
|
|
6
6
|
export { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuCheckboxItemProps, DropdownMenuContent, DropdownMenuContentProps, DropdownMenuGroup, DropdownMenuGroupProps, DropdownMenuItem, DropdownMenuItemProps, DropdownMenuLabel, DropdownMenuLabelProps, DropdownMenuPortal, DropdownMenuPortalProps, DropdownMenuProps, DropdownMenuRadioGroup, DropdownMenuRadioGroupProps, DropdownMenuRadioItem, DropdownMenuRadioItemProps, DropdownMenuSeparator, DropdownMenuSeparatorProps, DropdownMenuShortcut, DropdownMenuShortcutProps, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubContentProps, DropdownMenuSubProps, DropdownMenuSubTrigger, DropdownMenuSubTriggerProps, DropdownMenuTrigger, DropdownMenuTriggerProps, Sidebar, SidebarContent, SidebarContextProps, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupActionProps, SidebarGroupContent, SidebarGroupLabel, SidebarGroupLabelProps, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuActionProps, SidebarMenuBadge, SidebarMenuButton, SidebarMenuButtonProps, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSkeletonProps, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubButtonProps, SidebarMenuSubItem, SidebarProps, SidebarProvider, SidebarProviderProps, SidebarRail, SidebarSeparator, SidebarTrigger, sidebarMenuButtonVariants, useSidebar } from './organisms.js';
|
|
7
7
|
export { reducer, toast, useIsMobile, useToast } from './hooks.js';
|
|
8
8
|
export { cn } from './utils.js';
|
|
@@ -14,9 +14,17 @@ import 'react/jsx-runtime';
|
|
|
14
14
|
import '@radix-ui/react-dialog';
|
|
15
15
|
import '@radix-ui/react-separator';
|
|
16
16
|
import '@radix-ui/react-avatar';
|
|
17
|
+
import 'react-resizable-panels';
|
|
18
|
+
import '@radix-ui/react-switch';
|
|
19
|
+
import '@radix-ui/react-collapsible';
|
|
20
|
+
import 'cmdk';
|
|
21
|
+
import '@radix-ui/react-radio-group';
|
|
22
|
+
import '@radix-ui/react-accordion';
|
|
23
|
+
import '@radix-ui/react-checkbox';
|
|
17
24
|
import '@radix-ui/react-label';
|
|
18
25
|
import '@radix-ui/react-toast';
|
|
19
26
|
import '@radix-ui/react-navigation-menu';
|
|
27
|
+
import '@radix-ui/react-tabs';
|
|
20
28
|
import 'vaul';
|
|
21
29
|
import '@radix-ui/react-dropdown-menu';
|
|
22
30
|
import 'clsx';
|
package/dist/index.esm.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import'./chunk-U4NMIMU7.esm.js';export{o as Avatar,q as AvatarFallback,p as AvatarImage,s as Badge,c as Box,b as Container,e as Dialog,h as DialogClose,j as DialogContent,n as DialogDescription,l as DialogFooter,k as DialogHeader,i as DialogOverlay,g as DialogPortal,m as DialogTitle,f as DialogTrigger,v as PageLoader,d as Stack,a as TextField,y as Toast,z as ToastAction,A as ToastClose,C as ToastDescription,w as ToastProvider,B as ToastTitle,x as ToastViewport,D as Toaster,u as Typography,r as badgeVariants,t as typographyVariants}from'./chunk-
|
|
1
|
+
import'./chunk-U4NMIMU7.esm.js';export{ia as Accordion,la as AccordionContent,ja as AccordionItem,ka as AccordionTrigger,o as Avatar,q as AvatarFallback,p as AvatarImage,s as Badge,c as Box,ma as Breadcrumb,sa as BreadcrumbEllipsis,oa as BreadcrumbItem,pa as BreadcrumbLink,na as BreadcrumbList,qa as BreadcrumbPage,ra as BreadcrumbSeparator,_ as Collapsible,aa as CollapsibleContent,$ as CollapsibleTrigger,P as Command,Q as CommandDialog,T as CommandEmpty,U as CommandGroup,R as CommandInput,W as CommandItem,S as CommandList,V as CommandSeparator,X as CommandShortcut,b as Container,e as Dialog,h as DialogClose,j as DialogContent,n as DialogDescription,l as DialogFooter,k as DialogHeader,i as DialogOverlay,g as DialogPortal,m as DialogTitle,f as DialogTrigger,Z as MultiSelect,v as PageLoader,ba as Pagination,ca as PaginationContent,ha as PaginationEllipsis,da as PaginationItem,ea as PaginationLink,ga as PaginationNext,fa as PaginationPrevious,O as ResizableHandle,N as ResizablePanel,M as ResizablePanelGroup,Y as Select,d as Stack,E as Table,G as TableBody,L as TableCaption,K as TableCell,H as TableFooter,J as TableHead,F as TableHeader,I as TableRow,a as TextField,y as Toast,z as ToastAction,A as ToastClose,C as ToastDescription,w as ToastProvider,B as ToastTitle,x as ToastViewport,D as Toaster,u as Typography,r as badgeVariants,t as typographyVariants}from'./chunk-Q76IMLQ3.esm.js';export{a as reducer,b as toast,c as useToast}from'./chunk-JKTYFZ5M.esm.js';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';export{g as Checkbox,a as Label,c as RadioGroup,d as RadioGroupItem,e as RadioItemContainer,f as RadioItemLabel,b as Switch}from'./chunk-MOYOCJW6.esm.js';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';export{a as useIsMobile}from'./chunk-M4S5YZ56.esm.js';export{a as Separator,b as Sheet,d as SheetClose,g as SheetContent,k as SheetDescription,i as SheetFooter,h as SheetHeader,f as SheetOverlay,e as SheetPortal,j as SheetTitle,c as SheetTrigger,l as Skeleton,n as Tooltip,p as TooltipContent,m as TooltipProvider,o as TooltipTrigger}from'./chunk-YEZB7AOJ.esm.js';export{b as Button,c as Input,a as buttonVariants}from'./chunk-JUZG25DH.esm.js';export{a as cn}from'./chunk-C26U3FL4.esm.js';//# sourceMappingURL=index.esm.js.map
|
|
2
2
|
//# sourceMappingURL=index.esm.js.map
|
package/dist/molecules.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkDTM5LZHM_cjs_js=require('./chunk-DTM5LZHM.cjs.js');require('./chunk-SL2ZUI4G.cjs.js');Object.defineProperty(exports,"Card",{enumerable:true,get:function(){return chunkDTM5LZHM_cjs_js.a}});Object.defineProperty(exports,"CardContent",{enumerable:true,get:function(){return chunkDTM5LZHM_cjs_js.e}});Object.defineProperty(exports,"CardDescription",{enumerable:true,get:function(){return chunkDTM5LZHM_cjs_js.d}});Object.defineProperty(exports,"CardFooter",{enumerable:true,get:function(){return chunkDTM5LZHM_cjs_js.f}});Object.defineProperty(exports,"CardHeader",{enumerable:true,get:function(){return chunkDTM5LZHM_cjs_js.b}});Object.defineProperty(exports,"CardTitle",{enumerable:true,get:function(){return chunkDTM5LZHM_cjs_js.c}});Object.defineProperty(exports,"NavigationMenu",{enumerable:true,get:function(){return chunkDTM5LZHM_cjs_js.g}});Object.defineProperty(exports,"NavigationMenuContent",{enumerable:true,get:function(){return chunkDTM5LZHM_cjs_js.k}});Object.defineProperty(exports,"NavigationMenuIndicator",{enumerable:true,get:function(){return chunkDTM5LZHM_cjs_js.n}});Object.defineProperty(exports,"NavigationMenuItem",{enumerable:true,get:function(){return chunkDTM5LZHM_cjs_js.i}});Object.defineProperty(exports,"NavigationMenuLink",{enumerable:true,get:function(){return chunkDTM5LZHM_cjs_js.l}});Object.defineProperty(exports,"NavigationMenuList",{enumerable:true,get:function(){return chunkDTM5LZHM_cjs_js.h}});Object.defineProperty(exports,"NavigationMenuTrigger",{enumerable:true,get:function(){return chunkDTM5LZHM_cjs_js.j}});Object.defineProperty(exports,"NavigationMenuViewport",{enumerable:true,get:function(){return chunkDTM5LZHM_cjs_js.m}});Object.defineProperty(exports,"Tabs",{enumerable:true,get:function(){return chunkDTM5LZHM_cjs_js.o}});Object.defineProperty(exports,"TabsContent",{enumerable:true,get:function(){return chunkDTM5LZHM_cjs_js.r}});Object.defineProperty(exports,"TabsList",{enumerable:true,get:function(){return chunkDTM5LZHM_cjs_js.p}});Object.defineProperty(exports,"TabsTrigger",{enumerable:true,get:function(){return chunkDTM5LZHM_cjs_js.q}});//# sourceMappingURL=molecules.cjs.js.map
|
|
2
2
|
//# sourceMappingURL=molecules.cjs.js.map
|
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,GAEIC,cAACJ,CAAAA,CAAAA,CAAiB,SAAjB,CAA0B,KAAA,CAAO,CAAE,IAAMG,CAAAA,CAAAA,CAAM,IAAK,CACnD,CAAA,QAAA,CAAAC,cAACC,CAAAA,wBAAAA,CAAA,CAAY,GAAGF,EAAO,CACzB,CAAA,CAAA,CAIEG,EAAe,IAAM,CACzB,IAAMC,CAAqB,CAAAN,YAAA,CAAA,UAAA,CAAWD,CAAgB,CAAA,CAChDQ,CAAoB,CA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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,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CAAAA,CAAAA,CACV,aAAYG,CACZ,CAAA,kBAAA,CAAkBC,EAClB,cAAc,CAAA,CAAC,CAACtB,CAChB,CAAA,eAAA,CAAeiB,EACf,SAAU,CAAA,wDAAA,CACT,GAAGO,CAEH,CAAA,QAAA,CAAAyB,EAAQ,GAAKL,CAAAA,CAAAA,EACZ5D,eAACkE,sBAAA,CAAA,CAEC,KAAMN,CAAO,CAAA,IAAA,EAAQ,KACrB,OAASlB,CAAAA,CAAAA,CAAM,QAAUkB,CAAO,CAAA,EAAA,CAAK,UAAY,WACjD,CAAA,OAAA,CAAS,IAAMlB,CAAM,CAAA,QAAA,CAASkB,EAAO,EAAE,CAAA,CACvC,KAAK,OACL,CAAA,cAAA,CAAclB,EAAM,KAAUkB,GAAAA,CAAAA,CAAO,GACrC,QAAU1B,CAAAA,CAAAA,CAET,SAAA0B,CAAO,CAAA,KAAA,CAAA,CARHA,EAAO,EASd,CACD,EACH,CACF,CAAA,CAAA,CACC9B,GAAe9B,cAACuB,CAAAA,CAAAA,CAAA,CAAiB,QAAAO,CAAAA,CAAAA,CAAY,EAC7CE,CAAehC,EAAAA,cAAAA,CAACuB,EAAA,CAAgB,SAAA,CAAU,eAAgB,QAAAS,CAAAA,CAAAA,CAAY,EACtEhB,CAAShB,EAAAA,cAAAA,CAACwB,EAAA,CAAa,QAAA,CAAAR,EAAM,OAAQ,CAAA,CAAA,CAAA,CACxC,EAEJ,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","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"]}
|