@me1a/ui 2.0.10 → 2.0.12
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/index.d.mts +91 -94
- package/dist/index.d.ts +91 -94
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -7
package/dist/index.d.mts
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
2
2
|
import * as React$1 from 'react';
|
|
3
|
+
import { TextareaHTMLAttributes } from 'react';
|
|
3
4
|
import { VariantProps } from 'class-variance-authority';
|
|
4
5
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
6
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
6
7
|
import * as SeparatorPrimitive from '@radix-ui/react-separator';
|
|
7
8
|
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
8
9
|
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
10
|
+
import * as _radix_ui_react_slot from '@radix-ui/react-slot';
|
|
11
|
+
import { Slot } from '@radix-ui/react-slot';
|
|
9
12
|
import * as react_hook_form from 'react-hook-form';
|
|
10
|
-
import {
|
|
13
|
+
import { FieldValues, FieldPath, ControllerProps } from 'react-hook-form';
|
|
11
14
|
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
12
|
-
import { Slot } from '@radix-ui/react-slot';
|
|
13
15
|
import * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu';
|
|
14
16
|
import * as vaul from 'vaul';
|
|
15
17
|
import { Drawer as Drawer$1 } from 'vaul';
|
|
@@ -530,6 +532,26 @@ interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<
|
|
|
530
532
|
*/
|
|
531
533
|
declare const Badge: React$1.ForwardRefExoticComponent<BadgeProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
532
534
|
|
|
535
|
+
declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>(props: react_hook_form.FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React$1.JSX.Element;
|
|
536
|
+
declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: ControllerProps<TFieldValues, TName>) => react_jsx_runtime.JSX.Element;
|
|
537
|
+
declare const useFormField: () => {
|
|
538
|
+
invalid: boolean;
|
|
539
|
+
isDirty: boolean;
|
|
540
|
+
isTouched: boolean;
|
|
541
|
+
isValidating: boolean;
|
|
542
|
+
error?: react_hook_form.FieldError;
|
|
543
|
+
id: string;
|
|
544
|
+
name: string;
|
|
545
|
+
formItemId: string;
|
|
546
|
+
formDescriptionId: string;
|
|
547
|
+
formMessageId: string;
|
|
548
|
+
};
|
|
549
|
+
declare const FormItem: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLDivElement> & React$1.RefAttributes<HTMLDivElement>>;
|
|
550
|
+
declare const FormLabel: React$1.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React$1.RefAttributes<HTMLLabelElement>, "ref"> & React$1.RefAttributes<HTMLLabelElement>>;
|
|
551
|
+
declare const FormControl: React$1.ForwardRefExoticComponent<Omit<_radix_ui_react_slot.SlotProps & React$1.RefAttributes<HTMLElement>, "ref"> & React$1.RefAttributes<HTMLElement>>;
|
|
552
|
+
declare const FormDescription: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLParagraphElement> & React$1.RefAttributes<HTMLParagraphElement>>;
|
|
553
|
+
declare const FormMessage: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLParagraphElement> & React$1.RefAttributes<HTMLParagraphElement>>;
|
|
554
|
+
|
|
533
555
|
/**
|
|
534
556
|
* Props interface for the Form component.
|
|
535
557
|
* Extends react-hook-form's FormProvider props.
|
|
@@ -596,82 +618,6 @@ type FormFieldContextValue<TFieldValues extends FieldValues = FieldValues, TName
|
|
|
596
618
|
type FormItemContextValue = {
|
|
597
619
|
id: string;
|
|
598
620
|
};
|
|
599
|
-
/**
|
|
600
|
-
* Props interface for the FormProvider component.
|
|
601
|
-
*/
|
|
602
|
-
interface FormProviderProps {
|
|
603
|
-
/**
|
|
604
|
-
* The form children
|
|
605
|
-
*/
|
|
606
|
-
children: React$1.ReactNode;
|
|
607
|
-
/**
|
|
608
|
-
* The form methods from react-hook-form
|
|
609
|
-
*/
|
|
610
|
-
methods: UseFormReturn<any>;
|
|
611
|
-
/**
|
|
612
|
-
* Optional form submission handler
|
|
613
|
-
*/
|
|
614
|
-
onSubmit?: VoidFunction;
|
|
615
|
-
}
|
|
616
|
-
|
|
617
|
-
/**
|
|
618
|
-
* Form component that provides form context to all child components.
|
|
619
|
-
* Built on top of react-hook-form's useFormContext.
|
|
620
|
-
*
|
|
621
|
-
* @url https://segiimelnykov.github.io/ui/?path=/docs-atoms-form--docs
|
|
622
|
-
*
|
|
623
|
-
* @example
|
|
624
|
-
* ```tsx
|
|
625
|
-
* <Form>
|
|
626
|
-
* <FormField>
|
|
627
|
-
* <FormItem>
|
|
628
|
-
* <FormLabel>Name</FormLabel>
|
|
629
|
-
* </FormItem>
|
|
630
|
-
* </FormField>
|
|
631
|
-
* </Form>
|
|
632
|
-
*/
|
|
633
|
-
declare const Form: ({ children, methods, onSubmit }: FormProviderProps) => react_jsx_runtime.JSX.Element;
|
|
634
|
-
/**
|
|
635
|
-
* FormField component that wraps react-hook-form's Controller component.
|
|
636
|
-
* Provides form field context to child components.
|
|
637
|
-
*/
|
|
638
|
-
declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: FormFieldProps<TFieldValues, TName>) => react_jsx_runtime.JSX.Element;
|
|
639
|
-
/**
|
|
640
|
-
* Hook to access form field context and state.
|
|
641
|
-
* Must be used within a FormField component.
|
|
642
|
-
*/
|
|
643
|
-
declare const useFormField: () => {
|
|
644
|
-
invalid: boolean;
|
|
645
|
-
isDirty: boolean;
|
|
646
|
-
isTouched: boolean;
|
|
647
|
-
isValidating: boolean;
|
|
648
|
-
error?: react_hook_form.FieldError;
|
|
649
|
-
id: string;
|
|
650
|
-
name: string;
|
|
651
|
-
formItemId: string;
|
|
652
|
-
formDescriptionId: string;
|
|
653
|
-
formMessageId: string;
|
|
654
|
-
};
|
|
655
|
-
/**
|
|
656
|
-
* FormItem component that provides spacing and layout for form fields.
|
|
657
|
-
*/
|
|
658
|
-
declare const FormItem: React$1.ForwardRefExoticComponent<FormItemProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
659
|
-
/**
|
|
660
|
-
* FormLabel component that provides accessible labels for form fields.
|
|
661
|
-
*/
|
|
662
|
-
declare const FormLabel: React$1.ForwardRefExoticComponent<FormLabelProps & React$1.RefAttributes<HTMLLabelElement>>;
|
|
663
|
-
/**
|
|
664
|
-
* FormControl component that provides accessible form controls.
|
|
665
|
-
*/
|
|
666
|
-
declare const FormControl: React$1.ForwardRefExoticComponent<FormControlProps & React$1.RefAttributes<HTMLElement>>;
|
|
667
|
-
/**
|
|
668
|
-
* FormDescription component that provides additional context for form fields.
|
|
669
|
-
*/
|
|
670
|
-
declare const FormDescription: React$1.ForwardRefExoticComponent<FormDescriptionProps & React$1.RefAttributes<HTMLParagraphElement>>;
|
|
671
|
-
/**
|
|
672
|
-
* FormMessage component that displays error messages for form fields.
|
|
673
|
-
*/
|
|
674
|
-
declare const FormMessage: React$1.ForwardRefExoticComponent<FormMessageProps & React$1.RefAttributes<HTMLParagraphElement>>;
|
|
675
621
|
|
|
676
622
|
declare const typographyVariants: (props?: ({
|
|
677
623
|
variant?: "list" | "small" | "blockquote" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "p" | "muted" | "large" | "lead" | null | undefined;
|
|
@@ -932,27 +878,78 @@ interface RHFTextFieldProps<TFieldValues extends FieldValues = FieldValues, TNam
|
|
|
932
878
|
* A text field component that integrates with React Hook Form.
|
|
933
879
|
* Provides form validation, error handling, and accessibility features.
|
|
934
880
|
*
|
|
935
|
-
* @url https://segiimelnykov.github.io/ui/?path=/docs/molecules-rhf-
|
|
881
|
+
* @url https://segiimelnykov.github.io/ui/?path=/docs/molecules-rhf-rhftextfield--docs
|
|
936
882
|
*
|
|
937
|
-
* @example
|
|
883
|
+
* * @example
|
|
938
884
|
* ```tsx
|
|
939
|
-
* <
|
|
940
|
-
* name="
|
|
941
|
-
* label="Email"
|
|
942
|
-
*
|
|
943
|
-
* required
|
|
944
|
-
* rules={{
|
|
945
|
-
* required: "Email is required",
|
|
946
|
-
* pattern: {
|
|
947
|
-
* value: /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i,
|
|
948
|
-
* message: "Invalid email address"
|
|
949
|
-
* }
|
|
950
|
-
* }}
|
|
951
|
-
* />
|
|
885
|
+
* <Form>
|
|
886
|
+
* <RHFTextField name="name" label="Name" />
|
|
887
|
+
* <RHFTextField name="email" label="Email" />
|
|
888
|
+
* </Form>
|
|
952
889
|
* ```
|
|
953
890
|
*/
|
|
954
891
|
declare function RHFTextField<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ name, label, description, className, type, warningText, required, disabled, readOnly, placeholder, "aria-label": ariaLabel, "aria-describedby": ariaDescribedby, onBlur, ...other }: RHFTextFieldProps<TFieldValues, TName>): react_jsx_runtime.JSX.Element;
|
|
955
892
|
|
|
893
|
+
interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
894
|
+
/**
|
|
895
|
+
* Whether the textarea should automatically resize
|
|
896
|
+
*/
|
|
897
|
+
autoResize?: boolean;
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
/**
|
|
901
|
+
* Textarea component for creating accessible text areas.
|
|
902
|
+
* Built on top of shadcn/ui's Textarea component.
|
|
903
|
+
*
|
|
904
|
+
* @url https://segiimelnykov.github.io/ui/?path=/docs/atoms-textarea--docs
|
|
905
|
+
*
|
|
906
|
+
* @example
|
|
907
|
+
* ```tsx
|
|
908
|
+
* <Textarea placeholder="Enter text" />
|
|
909
|
+
* ```
|
|
910
|
+
*/
|
|
911
|
+
declare const Textarea: React$1.ForwardRefExoticComponent<TextareaProps & React$1.RefAttributes<HTMLTextAreaElement>>;
|
|
912
|
+
|
|
913
|
+
interface RHFTextareaProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> extends Omit<React$1.ComponentProps<typeof Textarea>, "name"> {
|
|
914
|
+
/** The name of the field in the form */
|
|
915
|
+
name: TName;
|
|
916
|
+
/** Optional label for the field */
|
|
917
|
+
label?: string;
|
|
918
|
+
/** Optional description text below the field */
|
|
919
|
+
description?: string;
|
|
920
|
+
/** Optional warning text to display */
|
|
921
|
+
warningText?: string;
|
|
922
|
+
/** Whether the field is required */
|
|
923
|
+
required?: boolean;
|
|
924
|
+
/** Whether the field is disabled */
|
|
925
|
+
disabled?: boolean;
|
|
926
|
+
/** Whether the field is read-only */
|
|
927
|
+
readOnly?: boolean;
|
|
928
|
+
/** Optional placeholder text */
|
|
929
|
+
placeholder?: string;
|
|
930
|
+
/** Optional aria-label for accessibility */
|
|
931
|
+
"aria-label"?: string;
|
|
932
|
+
/** Optional aria-describedby for accessibility */
|
|
933
|
+
"aria-describedby"?: string;
|
|
934
|
+
/** Whether the textarea should automatically resize */
|
|
935
|
+
autoResize?: boolean;
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
/**
|
|
939
|
+
* A textarea component that integrates with React Hook Form.
|
|
940
|
+
* Provides form validation, error handling, and accessibility features.
|
|
941
|
+
*
|
|
942
|
+
* @url https://segiimelnykov.github.io/ui/?path=/docs/molecules-rhf-rhftextarea--docs
|
|
943
|
+
*
|
|
944
|
+
* @example
|
|
945
|
+
* ```tsx
|
|
946
|
+
* <Form>
|
|
947
|
+
* <RHFTextarea name="description" label="Description" />
|
|
948
|
+
* </Form>
|
|
949
|
+
* ```
|
|
950
|
+
*/
|
|
951
|
+
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;
|
|
952
|
+
|
|
956
953
|
declare const Drawer: {
|
|
957
954
|
({ shouldScaleBackground, ...props }: React$1.ComponentProps<typeof Drawer$1.Root>): react_jsx_runtime.JSX.Element;
|
|
958
955
|
displayName: string;
|
|
@@ -1475,4 +1472,4 @@ declare function useIsMobile(): boolean;
|
|
|
1475
1472
|
|
|
1476
1473
|
declare function cn(...inputs: ClassValue[]): string;
|
|
1477
1474
|
|
|
1478
|
-
export { Avatar, AvatarFallback, type AvatarFallbackProps, AvatarImage, type AvatarImageProps, type AvatarProps, Badge, type BadgeProps, Box, type BoxProps, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Container, type ContainerProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, type DropdownMenuCheckboxItemProps, DropdownMenuContent, type DropdownMenuContentProps, DropdownMenuGroup, type DropdownMenuGroupProps, DropdownMenuItem, type DropdownMenuItemProps, DropdownMenuLabel, type DropdownMenuLabelProps, DropdownMenuPortal, type DropdownMenuPortalProps, type DropdownMenuProps, DropdownMenuRadioGroup, type DropdownMenuRadioGroupProps, DropdownMenuRadioItem, type DropdownMenuRadioItemProps, DropdownMenuSeparator, type DropdownMenuSeparatorProps, DropdownMenuShortcut, type DropdownMenuShortcutProps, DropdownMenuSub, DropdownMenuSubContent, type DropdownMenuSubContentProps, type DropdownMenuSubProps, DropdownMenuSubTrigger, type DropdownMenuSubTriggerProps, DropdownMenuTrigger, type DropdownMenuTriggerProps, 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, Input, NavigationMenu, NavigationMenuContent, type NavigationMenuContentProps, NavigationMenuIndicator, type NavigationMenuIndicatorProps, NavigationMenuItem, type NavigationMenuItemProps, NavigationMenuLink, type NavigationMenuLinkProps, NavigationMenuList, type NavigationMenuListProps, type NavigationMenuProps, NavigationMenuTrigger, type NavigationMenuTriggerProps, NavigationMenuViewport, type NavigationMenuViewportProps, PageLoader, type PageLoaderProps, RHFTextField, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Sidebar, SidebarContent, type SidebarContextProps, SidebarFooter, SidebarGroup, SidebarGroupAction, type SidebarGroupActionProps, SidebarGroupContent, SidebarGroupLabel, type SidebarGroupLabelProps, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, type SidebarMenuActionProps, SidebarMenuBadge, SidebarMenuButton, type SidebarMenuButtonProps, SidebarMenuItem, SidebarMenuSkeleton, type SidebarMenuSkeletonProps, SidebarMenuSub, SidebarMenuSubButton, type SidebarMenuSubButtonProps, SidebarMenuSubItem, type SidebarProps, SidebarProvider, type SidebarProviderProps, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Stack, type StackProps, TextField, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, Typography, type TypographyAlign, type TypographyProps, type TypographyVariant, badgeVariants, buttonVariants, cn, sidebarMenuButtonVariants, textFieldVariants, typographyVariants, useFormField, useIsMobile, useSidebar };
|
|
1475
|
+
export { Avatar, AvatarFallback, type AvatarFallbackProps, AvatarImage, type AvatarImageProps, type AvatarProps, Badge, type BadgeProps, Box, type BoxProps, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Container, type ContainerProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, type DropdownMenuCheckboxItemProps, DropdownMenuContent, type DropdownMenuContentProps, DropdownMenuGroup, type DropdownMenuGroupProps, DropdownMenuItem, type DropdownMenuItemProps, DropdownMenuLabel, type DropdownMenuLabelProps, DropdownMenuPortal, type DropdownMenuPortalProps, type DropdownMenuProps, DropdownMenuRadioGroup, type DropdownMenuRadioGroupProps, DropdownMenuRadioItem, type DropdownMenuRadioItemProps, DropdownMenuSeparator, type DropdownMenuSeparatorProps, DropdownMenuShortcut, type DropdownMenuShortcutProps, DropdownMenuSub, DropdownMenuSubContent, type DropdownMenuSubContentProps, type DropdownMenuSubProps, DropdownMenuSubTrigger, type DropdownMenuSubTriggerProps, DropdownMenuTrigger, type DropdownMenuTriggerProps, 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, Input, NavigationMenu, NavigationMenuContent, type NavigationMenuContentProps, NavigationMenuIndicator, type NavigationMenuIndicatorProps, NavigationMenuItem, type NavigationMenuItemProps, NavigationMenuLink, type NavigationMenuLinkProps, NavigationMenuList, type NavigationMenuListProps, type NavigationMenuProps, NavigationMenuTrigger, type NavigationMenuTriggerProps, NavigationMenuViewport, type NavigationMenuViewportProps, PageLoader, type PageLoaderProps, RHFTextField, RHFTextarea, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Sidebar, SidebarContent, type SidebarContextProps, SidebarFooter, SidebarGroup, SidebarGroupAction, type SidebarGroupActionProps, SidebarGroupContent, SidebarGroupLabel, type SidebarGroupLabelProps, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, type SidebarMenuActionProps, SidebarMenuBadge, SidebarMenuButton, type SidebarMenuButtonProps, SidebarMenuItem, SidebarMenuSkeleton, type SidebarMenuSkeletonProps, SidebarMenuSub, SidebarMenuSubButton, type SidebarMenuSubButtonProps, SidebarMenuSubItem, type SidebarProps, SidebarProvider, type SidebarProviderProps, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Stack, type StackProps, TextField, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, Typography, type TypographyAlign, type TypographyProps, type TypographyVariant, badgeVariants, buttonVariants, cn, sidebarMenuButtonVariants, textFieldVariants, typographyVariants, useFormField, useIsMobile, useSidebar };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
2
2
|
import * as React$1 from 'react';
|
|
3
|
+
import { TextareaHTMLAttributes } from 'react';
|
|
3
4
|
import { VariantProps } from 'class-variance-authority';
|
|
4
5
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
6
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
6
7
|
import * as SeparatorPrimitive from '@radix-ui/react-separator';
|
|
7
8
|
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
8
9
|
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
10
|
+
import * as _radix_ui_react_slot from '@radix-ui/react-slot';
|
|
11
|
+
import { Slot } from '@radix-ui/react-slot';
|
|
9
12
|
import * as react_hook_form from 'react-hook-form';
|
|
10
|
-
import {
|
|
13
|
+
import { FieldValues, FieldPath, ControllerProps } from 'react-hook-form';
|
|
11
14
|
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
12
|
-
import { Slot } from '@radix-ui/react-slot';
|
|
13
15
|
import * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu';
|
|
14
16
|
import * as vaul from 'vaul';
|
|
15
17
|
import { Drawer as Drawer$1 } from 'vaul';
|
|
@@ -530,6 +532,26 @@ interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<
|
|
|
530
532
|
*/
|
|
531
533
|
declare const Badge: React$1.ForwardRefExoticComponent<BadgeProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
532
534
|
|
|
535
|
+
declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>(props: react_hook_form.FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React$1.JSX.Element;
|
|
536
|
+
declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: ControllerProps<TFieldValues, TName>) => react_jsx_runtime.JSX.Element;
|
|
537
|
+
declare const useFormField: () => {
|
|
538
|
+
invalid: boolean;
|
|
539
|
+
isDirty: boolean;
|
|
540
|
+
isTouched: boolean;
|
|
541
|
+
isValidating: boolean;
|
|
542
|
+
error?: react_hook_form.FieldError;
|
|
543
|
+
id: string;
|
|
544
|
+
name: string;
|
|
545
|
+
formItemId: string;
|
|
546
|
+
formDescriptionId: string;
|
|
547
|
+
formMessageId: string;
|
|
548
|
+
};
|
|
549
|
+
declare const FormItem: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLDivElement> & React$1.RefAttributes<HTMLDivElement>>;
|
|
550
|
+
declare const FormLabel: React$1.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React$1.RefAttributes<HTMLLabelElement>, "ref"> & React$1.RefAttributes<HTMLLabelElement>>;
|
|
551
|
+
declare const FormControl: React$1.ForwardRefExoticComponent<Omit<_radix_ui_react_slot.SlotProps & React$1.RefAttributes<HTMLElement>, "ref"> & React$1.RefAttributes<HTMLElement>>;
|
|
552
|
+
declare const FormDescription: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLParagraphElement> & React$1.RefAttributes<HTMLParagraphElement>>;
|
|
553
|
+
declare const FormMessage: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLParagraphElement> & React$1.RefAttributes<HTMLParagraphElement>>;
|
|
554
|
+
|
|
533
555
|
/**
|
|
534
556
|
* Props interface for the Form component.
|
|
535
557
|
* Extends react-hook-form's FormProvider props.
|
|
@@ -596,82 +618,6 @@ type FormFieldContextValue<TFieldValues extends FieldValues = FieldValues, TName
|
|
|
596
618
|
type FormItemContextValue = {
|
|
597
619
|
id: string;
|
|
598
620
|
};
|
|
599
|
-
/**
|
|
600
|
-
* Props interface for the FormProvider component.
|
|
601
|
-
*/
|
|
602
|
-
interface FormProviderProps {
|
|
603
|
-
/**
|
|
604
|
-
* The form children
|
|
605
|
-
*/
|
|
606
|
-
children: React$1.ReactNode;
|
|
607
|
-
/**
|
|
608
|
-
* The form methods from react-hook-form
|
|
609
|
-
*/
|
|
610
|
-
methods: UseFormReturn<any>;
|
|
611
|
-
/**
|
|
612
|
-
* Optional form submission handler
|
|
613
|
-
*/
|
|
614
|
-
onSubmit?: VoidFunction;
|
|
615
|
-
}
|
|
616
|
-
|
|
617
|
-
/**
|
|
618
|
-
* Form component that provides form context to all child components.
|
|
619
|
-
* Built on top of react-hook-form's useFormContext.
|
|
620
|
-
*
|
|
621
|
-
* @url https://segiimelnykov.github.io/ui/?path=/docs-atoms-form--docs
|
|
622
|
-
*
|
|
623
|
-
* @example
|
|
624
|
-
* ```tsx
|
|
625
|
-
* <Form>
|
|
626
|
-
* <FormField>
|
|
627
|
-
* <FormItem>
|
|
628
|
-
* <FormLabel>Name</FormLabel>
|
|
629
|
-
* </FormItem>
|
|
630
|
-
* </FormField>
|
|
631
|
-
* </Form>
|
|
632
|
-
*/
|
|
633
|
-
declare const Form: ({ children, methods, onSubmit }: FormProviderProps) => react_jsx_runtime.JSX.Element;
|
|
634
|
-
/**
|
|
635
|
-
* FormField component that wraps react-hook-form's Controller component.
|
|
636
|
-
* Provides form field context to child components.
|
|
637
|
-
*/
|
|
638
|
-
declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: FormFieldProps<TFieldValues, TName>) => react_jsx_runtime.JSX.Element;
|
|
639
|
-
/**
|
|
640
|
-
* Hook to access form field context and state.
|
|
641
|
-
* Must be used within a FormField component.
|
|
642
|
-
*/
|
|
643
|
-
declare const useFormField: () => {
|
|
644
|
-
invalid: boolean;
|
|
645
|
-
isDirty: boolean;
|
|
646
|
-
isTouched: boolean;
|
|
647
|
-
isValidating: boolean;
|
|
648
|
-
error?: react_hook_form.FieldError;
|
|
649
|
-
id: string;
|
|
650
|
-
name: string;
|
|
651
|
-
formItemId: string;
|
|
652
|
-
formDescriptionId: string;
|
|
653
|
-
formMessageId: string;
|
|
654
|
-
};
|
|
655
|
-
/**
|
|
656
|
-
* FormItem component that provides spacing and layout for form fields.
|
|
657
|
-
*/
|
|
658
|
-
declare const FormItem: React$1.ForwardRefExoticComponent<FormItemProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
659
|
-
/**
|
|
660
|
-
* FormLabel component that provides accessible labels for form fields.
|
|
661
|
-
*/
|
|
662
|
-
declare const FormLabel: React$1.ForwardRefExoticComponent<FormLabelProps & React$1.RefAttributes<HTMLLabelElement>>;
|
|
663
|
-
/**
|
|
664
|
-
* FormControl component that provides accessible form controls.
|
|
665
|
-
*/
|
|
666
|
-
declare const FormControl: React$1.ForwardRefExoticComponent<FormControlProps & React$1.RefAttributes<HTMLElement>>;
|
|
667
|
-
/**
|
|
668
|
-
* FormDescription component that provides additional context for form fields.
|
|
669
|
-
*/
|
|
670
|
-
declare const FormDescription: React$1.ForwardRefExoticComponent<FormDescriptionProps & React$1.RefAttributes<HTMLParagraphElement>>;
|
|
671
|
-
/**
|
|
672
|
-
* FormMessage component that displays error messages for form fields.
|
|
673
|
-
*/
|
|
674
|
-
declare const FormMessage: React$1.ForwardRefExoticComponent<FormMessageProps & React$1.RefAttributes<HTMLParagraphElement>>;
|
|
675
621
|
|
|
676
622
|
declare const typographyVariants: (props?: ({
|
|
677
623
|
variant?: "list" | "small" | "blockquote" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "p" | "muted" | "large" | "lead" | null | undefined;
|
|
@@ -932,27 +878,78 @@ interface RHFTextFieldProps<TFieldValues extends FieldValues = FieldValues, TNam
|
|
|
932
878
|
* A text field component that integrates with React Hook Form.
|
|
933
879
|
* Provides form validation, error handling, and accessibility features.
|
|
934
880
|
*
|
|
935
|
-
* @url https://segiimelnykov.github.io/ui/?path=/docs/molecules-rhf-
|
|
881
|
+
* @url https://segiimelnykov.github.io/ui/?path=/docs/molecules-rhf-rhftextfield--docs
|
|
936
882
|
*
|
|
937
|
-
* @example
|
|
883
|
+
* * @example
|
|
938
884
|
* ```tsx
|
|
939
|
-
* <
|
|
940
|
-
* name="
|
|
941
|
-
* label="Email"
|
|
942
|
-
*
|
|
943
|
-
* required
|
|
944
|
-
* rules={{
|
|
945
|
-
* required: "Email is required",
|
|
946
|
-
* pattern: {
|
|
947
|
-
* value: /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i,
|
|
948
|
-
* message: "Invalid email address"
|
|
949
|
-
* }
|
|
950
|
-
* }}
|
|
951
|
-
* />
|
|
885
|
+
* <Form>
|
|
886
|
+
* <RHFTextField name="name" label="Name" />
|
|
887
|
+
* <RHFTextField name="email" label="Email" />
|
|
888
|
+
* </Form>
|
|
952
889
|
* ```
|
|
953
890
|
*/
|
|
954
891
|
declare function RHFTextField<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ name, label, description, className, type, warningText, required, disabled, readOnly, placeholder, "aria-label": ariaLabel, "aria-describedby": ariaDescribedby, onBlur, ...other }: RHFTextFieldProps<TFieldValues, TName>): react_jsx_runtime.JSX.Element;
|
|
955
892
|
|
|
893
|
+
interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
894
|
+
/**
|
|
895
|
+
* Whether the textarea should automatically resize
|
|
896
|
+
*/
|
|
897
|
+
autoResize?: boolean;
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
/**
|
|
901
|
+
* Textarea component for creating accessible text areas.
|
|
902
|
+
* Built on top of shadcn/ui's Textarea component.
|
|
903
|
+
*
|
|
904
|
+
* @url https://segiimelnykov.github.io/ui/?path=/docs/atoms-textarea--docs
|
|
905
|
+
*
|
|
906
|
+
* @example
|
|
907
|
+
* ```tsx
|
|
908
|
+
* <Textarea placeholder="Enter text" />
|
|
909
|
+
* ```
|
|
910
|
+
*/
|
|
911
|
+
declare const Textarea: React$1.ForwardRefExoticComponent<TextareaProps & React$1.RefAttributes<HTMLTextAreaElement>>;
|
|
912
|
+
|
|
913
|
+
interface RHFTextareaProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> extends Omit<React$1.ComponentProps<typeof Textarea>, "name"> {
|
|
914
|
+
/** The name of the field in the form */
|
|
915
|
+
name: TName;
|
|
916
|
+
/** Optional label for the field */
|
|
917
|
+
label?: string;
|
|
918
|
+
/** Optional description text below the field */
|
|
919
|
+
description?: string;
|
|
920
|
+
/** Optional warning text to display */
|
|
921
|
+
warningText?: string;
|
|
922
|
+
/** Whether the field is required */
|
|
923
|
+
required?: boolean;
|
|
924
|
+
/** Whether the field is disabled */
|
|
925
|
+
disabled?: boolean;
|
|
926
|
+
/** Whether the field is read-only */
|
|
927
|
+
readOnly?: boolean;
|
|
928
|
+
/** Optional placeholder text */
|
|
929
|
+
placeholder?: string;
|
|
930
|
+
/** Optional aria-label for accessibility */
|
|
931
|
+
"aria-label"?: string;
|
|
932
|
+
/** Optional aria-describedby for accessibility */
|
|
933
|
+
"aria-describedby"?: string;
|
|
934
|
+
/** Whether the textarea should automatically resize */
|
|
935
|
+
autoResize?: boolean;
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
/**
|
|
939
|
+
* A textarea component that integrates with React Hook Form.
|
|
940
|
+
* Provides form validation, error handling, and accessibility features.
|
|
941
|
+
*
|
|
942
|
+
* @url https://segiimelnykov.github.io/ui/?path=/docs/molecules-rhf-rhftextarea--docs
|
|
943
|
+
*
|
|
944
|
+
* @example
|
|
945
|
+
* ```tsx
|
|
946
|
+
* <Form>
|
|
947
|
+
* <RHFTextarea name="description" label="Description" />
|
|
948
|
+
* </Form>
|
|
949
|
+
* ```
|
|
950
|
+
*/
|
|
951
|
+
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;
|
|
952
|
+
|
|
956
953
|
declare const Drawer: {
|
|
957
954
|
({ shouldScaleBackground, ...props }: React$1.ComponentProps<typeof Drawer$1.Root>): react_jsx_runtime.JSX.Element;
|
|
958
955
|
displayName: string;
|
|
@@ -1475,4 +1472,4 @@ declare function useIsMobile(): boolean;
|
|
|
1475
1472
|
|
|
1476
1473
|
declare function cn(...inputs: ClassValue[]): string;
|
|
1477
1474
|
|
|
1478
|
-
export { Avatar, AvatarFallback, type AvatarFallbackProps, AvatarImage, type AvatarImageProps, type AvatarProps, Badge, type BadgeProps, Box, type BoxProps, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Container, type ContainerProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, type DropdownMenuCheckboxItemProps, DropdownMenuContent, type DropdownMenuContentProps, DropdownMenuGroup, type DropdownMenuGroupProps, DropdownMenuItem, type DropdownMenuItemProps, DropdownMenuLabel, type DropdownMenuLabelProps, DropdownMenuPortal, type DropdownMenuPortalProps, type DropdownMenuProps, DropdownMenuRadioGroup, type DropdownMenuRadioGroupProps, DropdownMenuRadioItem, type DropdownMenuRadioItemProps, DropdownMenuSeparator, type DropdownMenuSeparatorProps, DropdownMenuShortcut, type DropdownMenuShortcutProps, DropdownMenuSub, DropdownMenuSubContent, type DropdownMenuSubContentProps, type DropdownMenuSubProps, DropdownMenuSubTrigger, type DropdownMenuSubTriggerProps, DropdownMenuTrigger, type DropdownMenuTriggerProps, 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, Input, NavigationMenu, NavigationMenuContent, type NavigationMenuContentProps, NavigationMenuIndicator, type NavigationMenuIndicatorProps, NavigationMenuItem, type NavigationMenuItemProps, NavigationMenuLink, type NavigationMenuLinkProps, NavigationMenuList, type NavigationMenuListProps, type NavigationMenuProps, NavigationMenuTrigger, type NavigationMenuTriggerProps, NavigationMenuViewport, type NavigationMenuViewportProps, PageLoader, type PageLoaderProps, RHFTextField, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Sidebar, SidebarContent, type SidebarContextProps, SidebarFooter, SidebarGroup, SidebarGroupAction, type SidebarGroupActionProps, SidebarGroupContent, SidebarGroupLabel, type SidebarGroupLabelProps, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, type SidebarMenuActionProps, SidebarMenuBadge, SidebarMenuButton, type SidebarMenuButtonProps, SidebarMenuItem, SidebarMenuSkeleton, type SidebarMenuSkeletonProps, SidebarMenuSub, SidebarMenuSubButton, type SidebarMenuSubButtonProps, SidebarMenuSubItem, type SidebarProps, SidebarProvider, type SidebarProviderProps, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Stack, type StackProps, TextField, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, Typography, type TypographyAlign, type TypographyProps, type TypographyVariant, badgeVariants, buttonVariants, cn, sidebarMenuButtonVariants, textFieldVariants, typographyVariants, useFormField, useIsMobile, useSidebar };
|
|
1475
|
+
export { Avatar, AvatarFallback, type AvatarFallbackProps, AvatarImage, type AvatarImageProps, type AvatarProps, Badge, type BadgeProps, Box, type BoxProps, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Container, type ContainerProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, type DropdownMenuCheckboxItemProps, DropdownMenuContent, type DropdownMenuContentProps, DropdownMenuGroup, type DropdownMenuGroupProps, DropdownMenuItem, type DropdownMenuItemProps, DropdownMenuLabel, type DropdownMenuLabelProps, DropdownMenuPortal, type DropdownMenuPortalProps, type DropdownMenuProps, DropdownMenuRadioGroup, type DropdownMenuRadioGroupProps, DropdownMenuRadioItem, type DropdownMenuRadioItemProps, DropdownMenuSeparator, type DropdownMenuSeparatorProps, DropdownMenuShortcut, type DropdownMenuShortcutProps, DropdownMenuSub, DropdownMenuSubContent, type DropdownMenuSubContentProps, type DropdownMenuSubProps, DropdownMenuSubTrigger, type DropdownMenuSubTriggerProps, DropdownMenuTrigger, type DropdownMenuTriggerProps, 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, Input, NavigationMenu, NavigationMenuContent, type NavigationMenuContentProps, NavigationMenuIndicator, type NavigationMenuIndicatorProps, NavigationMenuItem, type NavigationMenuItemProps, NavigationMenuLink, type NavigationMenuLinkProps, NavigationMenuList, type NavigationMenuListProps, type NavigationMenuProps, NavigationMenuTrigger, type NavigationMenuTriggerProps, NavigationMenuViewport, type NavigationMenuViewportProps, PageLoader, type PageLoaderProps, RHFTextField, RHFTextarea, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Sidebar, SidebarContent, type SidebarContextProps, SidebarFooter, SidebarGroup, SidebarGroupAction, type SidebarGroupActionProps, SidebarGroupContent, SidebarGroupLabel, type SidebarGroupLabelProps, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, type SidebarMenuActionProps, SidebarMenuBadge, SidebarMenuButton, type SidebarMenuButtonProps, SidebarMenuItem, SidebarMenuSkeleton, type SidebarMenuSkeletonProps, SidebarMenuSub, SidebarMenuSubButton, type SidebarMenuSubButtonProps, SidebarMenuSubItem, type SidebarProps, SidebarProvider, type SidebarProviderProps, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Stack, type StackProps, TextField, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, Typography, type TypographyAlign, type TypographyProps, type TypographyVariant, badgeVariants, buttonVariants, cn, sidebarMenuButtonVariants, textFieldVariants, typographyVariants, useFormField, useIsMobile, useSidebar };
|