@me1a/ui 2.2.11 → 2.5.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.
|
@@ -2,27 +2,27 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
2
2
|
import { FieldValues, FieldPath } from 'react-hook-form';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
|
|
5
|
-
type SelectOption = {
|
|
6
|
-
id:
|
|
5
|
+
type SelectOption<T extends string | number = string | number> = {
|
|
6
|
+
id: T;
|
|
7
7
|
label: string;
|
|
8
8
|
startIcon?: React.ReactNode;
|
|
9
9
|
endIcon?: React.ReactNode;
|
|
10
10
|
className?: string;
|
|
11
11
|
disabled?: boolean;
|
|
12
12
|
};
|
|
13
|
-
type SelectProps = {
|
|
13
|
+
type SelectProps<T extends string | number = string | number> = {
|
|
14
14
|
/** Whether the select is searchable */
|
|
15
15
|
searchable?: boolean;
|
|
16
16
|
/** Whether the select should take up the full width of its container */
|
|
17
17
|
fullWidth?: boolean;
|
|
18
18
|
/** Currently selected value */
|
|
19
|
-
value:
|
|
19
|
+
value: T;
|
|
20
20
|
/** Array of options to display in the select */
|
|
21
|
-
options: SelectOption[];
|
|
21
|
+
options: SelectOption<T>[];
|
|
22
22
|
/** Callback fired when the value changes */
|
|
23
|
-
onChange: (value:
|
|
23
|
+
onChange: (value: T) => void;
|
|
24
24
|
/** Render a custom CommandList for the select, if not provided, the select will render a default CommandList with the options */
|
|
25
|
-
renderCommandList?: (options: SelectOption[]) => React.ReactNode;
|
|
25
|
+
renderCommandList?: (options: SelectOption<T>[]) => React.ReactNode;
|
|
26
26
|
/** Placeholder text to show when no value is selected */
|
|
27
27
|
placeholder?: string;
|
|
28
28
|
/** Whether the select is disabled */
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";import{useFormContext as
|
|
1
|
+
"use client";import{useFormContext as Pe}from"react-hook-form";import*as v from"react";import{ChevronDown as fe}from"lucide-react";import{clsx as re}from"clsx";import{twMerge as ae}from"tailwind-merge";function r(...e){return ae(re(e))}import{Popover as ge,PopoverContent as ye,PopoverTrigger as xe}from"@radix-ui/react-popover";import*as Q from"react";import{Slot as me}from"@radix-ui/react-slot";import{cva as ne}from"class-variance-authority";import{Loader2 as se}from"lucide-react";import{jsx as V,jsxs as ie}from"react/jsx-runtime";var J=ne("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),W=Q.forwardRef(({className:e,variant:t,size:o,asChild:a=!1,startIcon:m,endIcon:n,loading:l=!1,disabled:T,children:c,type:P="button","aria-label":N,...f},x)=>{let h=a?me:"button",p=T||l,u=N||(typeof c=="string"?c:void 0),I=F=>{(F.key==="Enter"||F.key===" ")&&(F.preventDefault(),!p&&f.onClick&&f.onClick(F))};return a?V(h,{className:r(J({variant:t,size:o,className:e})),ref:x,disabled:p,type:P,"aria-label":u,"aria-disabled":p,...f,children:c}):ie(h,{className:r(J({variant:t,size:o,className:e})),ref:x,disabled:p,type:P,"aria-label":u,"aria-disabled":p,onKeyDown:I,...f,children:[l&&V(se,{className:"mr-2 h-4 w-4 animate-spin",role:"status","aria-label":"Loading","aria-hidden":"true"}),!l&&m&&V("span",{className:"mr-2","aria-hidden":"true",children:m}),c,!l&&n&&V("span",{className:"ml-2","aria-hidden":"true",children:n})]})});W.displayName="Button";import*as b from"react";import{Command as i}from"cmdk";import{Search as de}from"lucide-react";import{jsx as g,jsxs as le}from"react/jsx-runtime";var k=b.forwardRef(({className:e,...t},o)=>g(i,{ref:o,className:r("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));k.displayName=i.displayName;var S=b.forwardRef(({className:e,...t},o)=>le("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[g(de,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),g(i.Input,{ref:o,className:r("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));S.displayName=i.Input.displayName;var E=b.forwardRef(({className:e,...t},o)=>g(i.List,{ref:o,className:r("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));E.displayName=i.List.displayName;var M=b.forwardRef((e,t)=>g(i.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));M.displayName=i.Empty.displayName;var _=b.forwardRef(({className:e,...t},o)=>g(i.Group,{ref:o,className:r("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));_.displayName=i.Group.displayName;var U=b.forwardRef(({className:e,...t},o)=>g(i.Separator,{ref:o,className:r("-mx-1 h-px bg-border",e),...t}));U.displayName=i.Separator.displayName;var D=b.forwardRef(({className:e,...t},o)=>g(i.Item,{ref:o,className:r("relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",e),...t}));D.displayName=i.Item.displayName;var X=({className:e,...t})=>g("span",{className:r("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});X.displayName="CommandShortcut";import*as Y from"react";import{cva as pe}from"class-variance-authority";import{jsx as ue}from"react/jsx-runtime";var ce=pe("",{variants:{variant:{h1:"scroll-m-5 text-4xl font-extrabold tracking-tight lg:text-5xl",h2:"scroll-m-5 text-3xl font-semibold tracking-tight",h3:"scroll-m-5 text-2xl font-semibold tracking-tight",h4:"scroll-m-5 text-xl font-semibold tracking-tight",h5:"scroll-m-5 text-lg font-semibold tracking-tight",h6:"scroll-m-5 text-base font-semibold tracking-tight",p:"leading-7 [&:not(:first-child)]:mt-6",blockquote:"mt-6 border-l-2 border-slate-300 pl-6 italic",list:"my-6 ml-6 list-disc [&>li]:mt-2",lead:"text-xl text-muted-foreground",large:"text-lg font-semibold",small:"text-sm font-medium leading-none",muted:"text-sm text-muted-foreground"},align:{left:"text-left",center:"text-center",right:"text-right",justify:"text-justify"}},defaultVariants:{variant:"p",align:"left"}}),q=Y.forwardRef(({className:e,variant:t,align:o,as:a="p",...m},n)=>ue(a,{className:r(ce({variant:t,align:o,className:e})),ref:n,...m}));q.displayName="Typography";import{jsx as y,jsxs as w}from"react/jsx-runtime";function Z({options:e,value:t,onChange:o,placeholder:a="Select an option",disabled:m,required:n,error:l,className:T,fullWidth:c,searchable:P,id:N,renderCommandList:f}){let[x,h]=v.useState(!1),[p,u]=v.useState(void 0),I=v.useRef(null),F=e?.find(s=>s.id===t);return v.useEffect(()=>{I.current&&u(I.current.offsetWidth)},[]),y("div",{className:r(c&&"w-full"),children:w(ge,{open:x,onOpenChange:h,children:[y(xe,{asChild:!0,children:w(W,{ref:I,variant:"outline",role:"combobox","aria-expanded":x,"aria-controls":N?`${N}-content`:void 0,"aria-required":n,"aria-invalid":!!l,disabled:m,className:r("w-[13rem] justify-between",!t&&"text-muted-foreground",c&&"w-full",l&&"border-destructive focus-visible:ring-destructive",T),children:[F?F.label:a,y(fe,{className:r("opacity-50",x&&"rotate-180")})]})}),y(ye,{className:r("p-0 rounded-md border bg-popover text-popover-foreground shadow-md",c&&"w-full"),style:{width:p},align:"start",children:w(k,{children:[P&&y(S,{placeholder:"Search...",className:"h-9",disabled:m}),w(E,{className:"max-h-[12rem] overflow-y-auto",children:[y(M,{children:"No items found."}),f?f(e):y(_,{children:e?.map(s=>w(D,{value:s.label,onSelect:()=>{o(s.id),h(!1)},disabled:s.disabled,className:r("flex items-center justify-between cursor-pointer my-1",t===s.id&&"bg-accent text-accent-foreground",s.disabled&&"opacity-50 cursor-not-allowed",s.className),children:[w("div",{className:"flex items-center gap-1",children:[s.startIcon&&s.startIcon,y(q,{variant:"small",children:s.label})]}),s.endIcon&&y("div",{className:"ml-2",children:s.endIcon})]},s.id))})]})]})})]})})}import*as d from"react";import{Slot as Fe}from"@radix-ui/react-slot";import{Controller as ve,FormProvider as pt,useFormContext as Re}from"react-hook-form";import*as j from"react";import*as K from"@radix-ui/react-label";import{cva as be}from"class-variance-authority";import{jsx as he}from"react/jsx-runtime";var Ce=be("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),H=j.forwardRef(({className:e,...t},o)=>he(K.Root,{ref:o,className:r(Ce(),e),...t}));H.displayName=K.Root.displayName;import{jsx as C}from"react/jsx-runtime";var ee=d.createContext({}),z=({...e})=>C(ee.Provider,{value:{name:e.name},children:C(ve,{...e})}),L=()=>{let e=d.useContext(ee),t=d.useContext(te),{getFieldState:o,formState:a}=Re(),m=o(e.name,a);if(!e)throw new Error("useFormField should be used within <FormField>");let{id:n}=t;return{id:n,name:e.name,formItemId:`${n}-form-item`,formDescriptionId:`${n}-form-item-description`,formMessageId:`${n}-form-item-message`,...m}},te=d.createContext({}),G=d.forwardRef(({className:e,...t},o)=>{let a=d.useId();return C(te.Provider,{value:{id:a},children:C("div",{ref:o,className:r("space-y-2",e),...t})})});G.displayName="FormItem";var B=d.forwardRef(({className:e,...t},o)=>{let{error:a,formItemId:m}=L();return C(H,{ref:o,className:r(a&&"text-destructive",e),htmlFor:m,...t})});B.displayName="FormLabel";var $=d.forwardRef(({...e},t)=>{let{error:o,formItemId:a,formDescriptionId:m,formMessageId:n}=L();return C(Fe,{ref:t,id:a,"aria-describedby":o?`${m} ${n}`:`${m}`,"aria-invalid":!!o,...e})});$.displayName="FormControl";var O=d.forwardRef(({className:e,...t},o)=>{let{formDescriptionId:a}=L();return C("p",{ref:o,id:a,className:r("text-sm text-muted-foreground",e),...t})});O.displayName="FormDescription";var A=d.forwardRef(({className:e,children:t,...o},a)=>{let{error:m,formMessageId:n}=L(),l=m?String(m?.message??""):t;return l?C("p",{ref:a,id:n,className:r("text-sm font-medium text-destructive",e),...o,children:l}):null});A.displayName="FormMessage";import{jsx as R,jsxs as oe}from"react/jsx-runtime";function Rt({name:e,label:t,description:o,className:a,warningText:m,required:n,disabled:l,readOnly:T,placeholder:c,"aria-label":P,"aria-describedby":N,options:f,...x}){let{control:h}=Pe();return R(z,{name:e,control:h,render:({field:p,fieldState:{error:u}})=>oe(G,{children:[t&&oe(B,{children:[t,n&&R("span",{className:"text-destructive ml-1",children:"*"})]}),R($,{children:R(Z,{...p,options:f,value:p.value||"",onChange:p.onChange,className:r(u&&"border-destructive focus-visible:ring-destructive",a),disabled:l||T,required:n,placeholder:c,"aria-label":P,"aria-describedby":N,"aria-invalid":!!u,"aria-required":n,...x})}),o&&R(O,{children:o}),u&&R(A,{children:u.message}),!u&&m&&R("p",{className:"text-sm text-yellow-600 dark:text-yellow-500",role:"alert",children:m})]})})}export{Rt as RHFSelect};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/rhf/rhf-select/rhf-select.tsx","../../src/components/atoms/select/select.tsx","../../src/utils/cn.ts","../../src/components/atoms/button/button.tsx","../../src/components/atoms/command/command.tsx","../../src/components/atoms/typography/typography.tsx","../../src/components/rhf/form/form.tsx","../../src/components/atoms/label/label.tsx"],"sourcesContent":["\"use client\";\n\"use client\"\n\nimport * as React from \"react\"\nimport { useFormContext, type FieldValues, type FieldPath } from \"react-hook-form\"\nimport { Select } from \"@/components/atoms/select\"\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 RHFSelectProps } from \"./rhf-select.types\"\n\n// ----------------------------------------------------------------------\n\n/**\n * A select 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-rhfselect--docs\n *\n * @example\n * ```tsx\n * <Form>\n * <RHFSelect\n * name=\"country\"\n * label=\"Country\"\n * options={[\n * { id: \"us\", label: \"United States\" },\n * { id: \"ca\", label: \"Canada\" }\n * ]}\n * />\n * </Form>\n * ```\n */\nexport function RHFSelect<\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 \"aria-label\": ariaLabel,\n \"aria-describedby\": ariaDescribedby,\n options,\n ...other\n}: RHFSelectProps<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 <Select\n {...field}\n options={options}\n value={field.value || \"\"}\n onChange={field.onChange}\n className={cn(\n error && \"border-destructive focus-visible:ring-destructive\",\n className\n )}\n disabled={disabled || readOnly}\n required={required}\n placeholder={placeholder}\n aria-label={ariaLabel}\n aria-describedby={ariaDescribedby}\n aria-invalid={!!error}\n aria-required={required}\n {...other}\n />\n </FormControl>\n {description && <FormDescription>{description}</FormDescription>}\n {error && <FormMessage>{error.message}</FormMessage>}\n {!error && warningText && (\n <p className=\"text-sm text-yellow-600 dark:text-yellow-500\" role=\"alert\">\n {warningText}\n </p>\n )}\n </FormItem>\n )}\n />\n )\n}\n","\"use client\";\n\"use client\"\n\nimport * as React from \"react\"\nimport { ChevronDown } from \"lucide-react\"\n\nimport { cn } from \"@/utils\"\n\nimport { Popover, PopoverContent, PopoverTrigger } from \"@radix-ui/react-popover\"\nimport { Button } from \"../button\"\nimport {\n Command,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList\n} from \"../command\"\nimport { Typography } from \"../typography\"\n\nexport type SelectOption = {\n id: string\n label: string\n startIcon?: React.ReactNode\n endIcon?: React.ReactNode\n className?: string\n disabled?: boolean\n}\n\nexport type SelectProps = {\n /** Whether the select is searchable */\n searchable?: boolean\n /** Whether the select should take up the full width of its container */\n fullWidth?: boolean\n /** Currently selected value */\n value: string\n /** Array of options to display in the select */\n options: SelectOption[]\n /** Callback fired when the value changes */\n // eslint-disable-next-line no-unused-vars\n onChange: (value: string) => void\n /** Render a custom CommandList for the select, if not provided, the select will render a default CommandList with the options */\n // eslint-disable-next-line no-unused-vars\n renderCommandList?: (options: SelectOption[]) => React.ReactNode\n /** Placeholder text to show when no value is selected */\n placeholder?: string\n /** Whether the select is disabled */\n disabled?: boolean\n /** Whether the select is required */\n required?: boolean\n /** Error message to display */\n error?: string\n /** Additional class name for the select */\n className?: string\n /** ID for the select element */\n id?: string\n}\n\n/**\n * SearchableSelect component that provides a searchable dropdown select input.\n * Built on top of Radix UI's Select primitive.\n *\n * @url https://sergii-melnykov.github.io/ui/?path=/docs-atoms-select--docs\n *\n * @example\n * ```tsx\n * <Select\n * options={[\n * { id: \"1\", label: \"Option 1\" },\n * { id: \"2\", label: \"Option 2\" }\n * ]}\n * value=\"1\"\n * onChange={setValue}\n * required\n * />\n * ```\n */\nexport function Select({\n options,\n value,\n onChange,\n placeholder = \"Select an option\",\n disabled,\n required,\n error,\n className,\n fullWidth,\n searchable,\n id,\n renderCommandList\n}: SelectProps) {\n const [open, setOpen] = React.useState(false)\n const selectedOption = options?.find((option) => option.id === value)\n\n return (\n <div className={cn(fullWidth && \"w-full\")}>\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n <Button\n variant=\"outline\"\n role=\"combobox\"\n aria-expanded={open}\n aria-controls={id ? `${id}-content` : undefined}\n aria-required={required}\n aria-invalid={!!error}\n disabled={disabled}\n className={cn(\n \"w-[13rem] justify-between\",\n !value && \"text-muted-foreground\",\n fullWidth && \"w-full\",\n error && \"border-destructive focus-visible:ring-destructive\",\n className\n )}\n >\n {selectedOption ? selectedOption.label : placeholder}\n <ChevronDown className={cn(\"opacity-50\", open && \"rotate-180\")} />\n </Button>\n </PopoverTrigger>\n <PopoverContent\n className={cn(\n \"w-[13rem] p-0 rounded-md border bg-popover text-popover-foreground shadow-md\",\n fullWidth && \"w-full\"\n )}\n align=\"start\"\n >\n <Command>\n {searchable && (\n <CommandInput placeholder=\"Search...\" className=\"h-9\" disabled={disabled} />\n )}\n <CommandList className=\"max-h-[12rem] overflow-y-auto\">\n <CommandEmpty>No items found.</CommandEmpty>\n {renderCommandList ? (\n renderCommandList(options)\n ) : (\n <CommandGroup>\n {options?.map((option) => (\n <CommandItem\n value={option.label}\n key={option.id}\n onSelect={() => {\n onChange(option.id)\n setOpen(false)\n }}\n disabled={option.disabled}\n className={cn(\n \"flex items-center justify-between cursor-pointer my-1\",\n value === option.id && \"bg-accent text-accent-foreground\",\n option.disabled && \"opacity-50 cursor-not-allowed\",\n option.className\n )}\n >\n <div className=\"flex items-center gap-1\">\n {option.startIcon && option.startIcon}\n <Typography variant=\"small\">{option.label}</Typography>\n </div>\n {option.endIcon && <div className=\"ml-2\">{option.endIcon}</div>}\n </CommandItem>\n ))}\n </CommandGroup>\n )}\n </CommandList>\n </Command>\n </PopoverContent>\n </Popover>\n </div>\n )\n}\n","import { type ClassValue, clsx } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n","import * as React from \"react\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport { cva } from \"class-variance-authority\"\nimport { cn } from \"@/utils/cn\"\nimport { Loader2 } from \"lucide-react\"\nimport { ButtonProps } from \"./button.types\"\n\n/**\n * Button variant styles using class-variance-authority.\n * Defines the visual styles for different button variants and sizes.\n * Follows WCAG 2.1 Level AA guidelines for accessibility.\n *\n * @example\n * ```tsx\n * <Button variant=\"primary\" size=\"lg\">Click me</Button>\n * ```\n */\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground shadow hover:bg-primary/90\",\n destructive: \"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90\",\n outline:\n \"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground\",\n secondary: \"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80\",\n ghost: \"hover:bg-accent hover:text-accent-foreground\",\n link: \"text-primary underline-offset-4 hover:underline\"\n } as const,\n size: {\n default: \"h-9 px-4 py-2\",\n sm: \"h-8 rounded-md px-3 text-xs\",\n lg: \"h-10 rounded-md px-8\",\n icon: \"h-9 w-9\"\n } as const\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\"\n }\n }\n)\n\n/**\n * A versatile button component that supports multiple variants, sizes, and can be rendered as a child component.\n * Built on top of Radix UI's Slot primitive for maximum flexibility.\n * Implements proper accessibility features and follows WCAG 2.1 Level AA guidelines.\n *\n * @url https://sergii-melnykov.github.io/ui/?path=/docs/atoms-button--docs\n *\n * @component\n * @example\n * ```tsx\n * // Default button\n * <Button>Click me</Button>\n *\n * // Destructive button with small size\n * <Button variant=\"destructive\" size=\"sm\">Delete</Button>\n *\n * // As a link\n * <Button variant=\"link\" asChild>\n * <a href=\"/about\">About</a>\n * </Button>\n *\n * // With icons\n * <Button startIcon={<Icon />}>With Start Icon</Button>\n * <Button endIcon={<Icon />}>With End Icon</Button>\n *\n * // Loading state\n * <Button loading>Loading</Button>\n * ```\n *\n * @param {ButtonProps} props - The component props\n * @param {React.Ref<HTMLButtonElement>} ref - Forwarded ref\n * @returns {JSX.Element} A button element\n */\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n className,\n variant,\n size,\n asChild = false,\n startIcon,\n endIcon,\n loading = false,\n disabled,\n children,\n type = \"button\",\n \"aria-label\": ariaLabel,\n ...props\n },\n ref\n ) => {\n const Comp = asChild ? Slot : \"button\"\n const isDisabled = disabled || loading\n const buttonAriaLabel = ariaLabel || (typeof children === \"string\" ? children : undefined)\n\n // Handle keyboard interaction\n const handleKeyDown = (event: React.KeyboardEvent) => {\n if (event.key === \"Enter\" || event.key === \" \") {\n event.preventDefault()\n if (!isDisabled && props.onClick) {\n props.onClick(event as unknown as React.MouseEvent<HTMLButtonElement>)\n }\n }\n }\n\n if (asChild) {\n return (\n <Comp\n className={cn(buttonVariants({ variant, size, className }))}\n ref={ref}\n disabled={isDisabled}\n type={type}\n aria-label={buttonAriaLabel}\n aria-disabled={isDisabled}\n {...props}\n >\n {children}\n </Comp>\n )\n }\n\n return (\n <Comp\n className={cn(buttonVariants({ variant, size, className }))}\n ref={ref}\n disabled={isDisabled}\n type={type}\n aria-label={buttonAriaLabel}\n aria-disabled={isDisabled}\n onKeyDown={handleKeyDown}\n {...props}\n >\n {loading && (\n <Loader2\n className=\"mr-2 h-4 w-4 animate-spin\"\n role=\"status\"\n aria-label=\"Loading\"\n aria-hidden=\"true\"\n />\n )}\n {!loading && startIcon && (\n <span className=\"mr-2\" aria-hidden=\"true\">\n {startIcon}\n </span>\n )}\n {children}\n {!loading && endIcon && (\n <span className=\"ml-2\" aria-hidden=\"true\">\n {endIcon}\n </span>\n )}\n </Comp>\n )\n }\n)\nButton.displayName = \"Button\"\n\nexport { Button, buttonVariants }\n","import * as React from \"react\"\nimport { Command as CommandPrimitive } from \"cmdk\"\nimport { Search } from \"lucide-react\"\n\nimport { cn } from \"@/utils/index\"\nimport { Dialog, DialogContent } from \"@/components/atoms/dialog\"\nimport {\n type CommandProps,\n type CommandRef,\n type CommandDialogProps,\n type CommandInputProps,\n type CommandInputRef,\n type CommandListProps,\n type CommandListRef,\n type CommandEmptyProps,\n type CommandEmptyRef,\n type CommandGroupProps,\n type CommandGroupRef,\n type CommandSeparatorProps,\n type CommandSeparatorRef,\n type CommandItemProps,\n type CommandItemRef,\n type CommandShortcutProps\n} from \"./command.types\"\n\n/**\n * Command component that provides a command palette interface.\n * Built on top of cmdk and Radix UI's Dialog primitive.\n *\n * @url https://sergii-melnykov.github.io/ui/?path=/docs/atoms-command--docs\n *\n * @example\n * ```tsx\n * <Command>\n * <CommandInput placeholder=\"Search...\" />\n * <CommandList>\n * <CommandEmpty>No results found.</CommandEmpty>\n * <CommandGroup heading=\"Suggestions\">\n * <CommandItem>Calendar</CommandItem>\n * <CommandItem>Search</CommandItem>\n * </CommandGroup>\n * </CommandList>\n * </Command>\n * ```\n */\nconst Command = React.forwardRef<CommandRef, CommandProps>(({ className, ...props }, ref) => (\n <CommandPrimitive\n ref={ref}\n className={cn(\n \"flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground\",\n className\n )}\n {...props}\n />\n))\nCommand.displayName = CommandPrimitive.displayName\n\nconst CommandDialog = ({ children, ...props }: CommandDialogProps) => {\n return (\n <Dialog {...props}>\n <DialogContent className=\"overflow-hidden p-0\">\n <Command className=\"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5\">\n {children}\n </Command>\n </DialogContent>\n </Dialog>\n )\n}\n\nconst CommandInput = React.forwardRef<CommandInputRef, CommandInputProps>(\n ({ className, ...props }, ref) => (\n <div className=\"flex items-center border-b px-3\" cmdk-input-wrapper=\"\">\n <Search className=\"mr-2 h-4 w-4 shrink-0 opacity-50\" />\n <CommandPrimitive.Input\n ref={ref}\n className={cn(\n \"flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50\",\n className\n )}\n {...props}\n />\n </div>\n )\n)\nCommandInput.displayName = CommandPrimitive.Input.displayName\n\nconst CommandList = React.forwardRef<CommandListRef, CommandListProps>(\n ({ className, ...props }, ref) => (\n <CommandPrimitive.List\n ref={ref}\n className={cn(\"max-h-[300px] overflow-y-auto overflow-x-hidden\", className)}\n {...props}\n />\n )\n)\nCommandList.displayName = CommandPrimitive.List.displayName\n\nconst CommandEmpty = React.forwardRef<CommandEmptyRef, CommandEmptyProps>((props, ref) => (\n <CommandPrimitive.Empty ref={ref} className=\"py-6 text-center text-sm\" {...props} />\n))\nCommandEmpty.displayName = CommandPrimitive.Empty.displayName\n\nconst CommandGroup = React.forwardRef<CommandGroupRef, CommandGroupProps>(\n ({ className, ...props }, ref) => (\n <CommandPrimitive.Group\n ref={ref}\n className={cn(\n \"overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground\",\n className\n )}\n {...props}\n />\n )\n)\nCommandGroup.displayName = CommandPrimitive.Group.displayName\n\nconst CommandSeparator = React.forwardRef<CommandSeparatorRef, CommandSeparatorProps>(\n ({ className, ...props }, ref) => (\n <CommandPrimitive.Separator\n ref={ref}\n className={cn(\"-mx-1 h-px bg-border\", className)}\n {...props}\n />\n )\n)\nCommandSeparator.displayName = CommandPrimitive.Separator.displayName\n\nconst CommandItem = React.forwardRef<CommandItemRef, CommandItemProps>(\n ({ className, ...props }, ref) => (\n <CommandPrimitive.Item\n ref={ref}\n className={cn(\n \"relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0\",\n className\n )}\n {...props}\n />\n )\n)\nCommandItem.displayName = CommandPrimitive.Item.displayName\n\nconst CommandShortcut = ({ className, ...props }: CommandShortcutProps) => {\n return (\n <span\n className={cn(\"ml-auto text-xs tracking-widest text-muted-foreground\", className)}\n {...props}\n />\n )\n}\nCommandShortcut.displayName = \"CommandShortcut\"\n\nexport {\n Command,\n CommandDialog,\n CommandInput,\n CommandList,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandShortcut,\n CommandSeparator\n}\n","import * as React from \"react\"\nimport { cn } from \"@/utils\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nconst typographyVariants = cva(\"\", {\n variants: {\n variant: {\n h1: \"scroll-m-5 text-4xl font-extrabold tracking-tight lg:text-5xl\",\n h2: \"scroll-m-5 text-3xl font-semibold tracking-tight\",\n h3: \"scroll-m-5 text-2xl font-semibold tracking-tight\",\n h4: \"scroll-m-5 text-xl font-semibold tracking-tight\",\n h5: \"scroll-m-5 text-lg font-semibold tracking-tight\",\n h6: \"scroll-m-5 text-base font-semibold tracking-tight\",\n p: \"leading-7 [&:not(:first-child)]:mt-6\",\n blockquote: \"mt-6 border-l-2 border-slate-300 pl-6 italic\",\n list: \"my-6 ml-6 list-disc [&>li]:mt-2\",\n lead: \"text-xl text-muted-foreground\",\n large: \"text-lg font-semibold\",\n small: \"text-sm font-medium leading-none\",\n muted: \"text-sm text-muted-foreground\"\n },\n align: {\n left: \"text-left\",\n center: \"text-center\",\n right: \"text-right\",\n justify: \"text-justify\"\n }\n },\n defaultVariants: {\n variant: \"p\",\n align: \"left\"\n }\n})\n\nexport interface TypographyProps\n extends React.HTMLAttributes<HTMLElement>,\n VariantProps<typeof typographyVariants> {\n as?: React.ElementType\n}\n\n/**\n * Typography component for creating accessible text elements.\n * Built on top of shadcn/ui's Typography component.\n *\n * @url https://sergii-melnykov.github.io/ui/?path=/docs/atoms-typography--docs\n *\n */\nconst Typography = React.forwardRef<HTMLElement, TypographyProps>(\n ({ className, variant, align, as: Component = \"p\", ...props }, ref) => {\n return (\n <Component\n className={cn(typographyVariants({ variant, align, className }))}\n ref={ref}\n {...props}\n />\n )\n }\n)\n\nTypography.displayName = \"Typography\"\n\nexport { Typography, typographyVariants }\n","\"use client\";\n\"use client\"\n\nimport * as React from \"react\"\nimport * as LabelPrimitive from \"@radix-ui/react-label\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport {\n Controller,\n FormProvider,\n useFormContext,\n type ControllerProps,\n type FieldPath,\n type FieldValues\n} from \"react-hook-form\"\n\nimport { cn } from \"@/utils/cn\"\nimport { Label } from \"@/components/atoms/label\"\n\nconst Form = FormProvider\n\ntype FormFieldContextValue<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n> = {\n name: TName\n}\n\nconst FormFieldContext = React.createContext<FormFieldContextValue>({} as FormFieldContextValue)\n\nconst FormField = <\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n>({\n ...props\n}: ControllerProps<TFieldValues, TName>) => {\n return (\n <FormFieldContext.Provider value={{ name: props.name }}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n )\n}\n\nconst useFormField = () => {\n const fieldContext = React.useContext(FormFieldContext)\n const itemContext = React.useContext(FormItemContext)\n const { getFieldState, formState } = useFormContext()\n\n const fieldState = getFieldState(fieldContext.name, formState)\n\n if (!fieldContext) {\n throw new Error(\"useFormField should be used within <FormField>\")\n }\n\n const { id } = itemContext\n\n return {\n id,\n name: fieldContext.name,\n formItemId: `${id}-form-item`,\n formDescriptionId: `${id}-form-item-description`,\n formMessageId: `${id}-form-item-message`,\n ...fieldState\n }\n}\n\ntype FormItemContextValue = {\n id: string\n}\n\nconst FormItemContext = React.createContext<FormItemContextValue>({} as FormItemContextValue)\n\nconst FormItem = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => {\n const id = React.useId()\n\n return (\n <FormItemContext.Provider value={{ id }}>\n <div ref={ref} className={cn(\"space-y-2\", className)} {...props} />\n </FormItemContext.Provider>\n )\n }\n)\nFormItem.displayName = \"FormItem\"\n\nconst FormLabel = React.forwardRef<\n React.ElementRef<typeof LabelPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>\n>(({ className, ...props }, ref) => {\n const { error, formItemId } = useFormField()\n\n return (\n <Label\n ref={ref}\n className={cn(error && \"text-destructive\", className)}\n htmlFor={formItemId}\n {...props}\n />\n )\n})\nFormLabel.displayName = \"FormLabel\"\n\nconst FormControl = React.forwardRef<\n React.ElementRef<typeof Slot>,\n React.ComponentPropsWithoutRef<typeof Slot>\n>(({ ...props }, ref) => {\n const { error, formItemId, formDescriptionId, formMessageId } = useFormField()\n\n return (\n <Slot\n ref={ref}\n id={formItemId}\n aria-describedby={!error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`}\n aria-invalid={!!error}\n {...props}\n />\n )\n})\nFormControl.displayName = \"FormControl\"\n\nconst FormDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => {\n const { formDescriptionId } = useFormField()\n\n return (\n <p\n ref={ref}\n id={formDescriptionId}\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n )\n})\nFormDescription.displayName = \"FormDescription\"\n\nconst FormMessage = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, children, ...props }, ref) => {\n const { error, formMessageId } = useFormField()\n const body = error ? String(error?.message ?? \"\") : children\n\n if (!body) {\n return null\n }\n\n return (\n <p\n ref={ref}\n id={formMessageId}\n className={cn(\"text-sm font-medium text-destructive\", className)}\n {...props}\n >\n {body}\n </p>\n )\n})\nFormMessage.displayName = \"FormMessage\"\n\nexport {\n useFormField,\n Form,\n FormItem,\n FormLabel,\n FormControl,\n FormDescription,\n FormMessage,\n FormField\n}\n","import * as React from \"react\"\nimport * as LabelPrimitive from \"@radix-ui/react-label\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/utils/index\"\n\nconst labelVariants = cva(\n \"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70\"\n)\n\nexport interface LabelProps\n extends React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>,\n VariantProps<typeof labelVariants> {}\n\n/**\n * Label component for creating accessible labels.\n * Built on top of Radix UI's Label primitive.\n *\n * @url https://sergii-melnykov.github.io/ui/?path=/docs/atoms-label--docs\n *\n */\nconst Label = React.forwardRef<React.ElementRef<typeof LabelPrimitive.Root>, LabelProps>(\n ({ className, ...props }, ref) => (\n <LabelPrimitive.Root ref={ref} className={cn(labelVariants(), className)} {...props} />\n )\n)\nLabel.displayName = LabelPrimitive.Root.displayName\n\nexport { Label }\n"],"mappings":"aAIA,OAAS,kBAAAA,OAAwD,kBCDjE,UAAYC,MAAW,QACvB,OAAS,eAAAC,OAAmB,eCJ5B,OAA0B,QAAAC,OAAY,OACtC,OAAS,WAAAC,OAAe,iBAEjB,SAASC,KAAMC,EAAsB,CAC1C,OAAOF,GAAQD,GAAKG,CAAM,CAAC,CAC7B,CDGA,OAAS,WAAAC,GAAS,kBAAAC,GAAgB,kBAAAC,OAAsB,0BERxD,UAAYC,MAAW,QACvB,OAAS,QAAAC,OAAY,uBACrB,OAAS,OAAAC,OAAW,2BAEpB,OAAS,WAAAC,OAAe,eA2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ACC,SAAAvB,EAACwB,EAAA,CACE,GAAGL,EACJ,QAASL,EACT,MAAOK,EAAM,OAAS,GACtB,SAAUA,EAAM,SAChB,UAAWM,EACTL,GAAS,oDACTd,CACF,EACA,SAAUG,GAAYC,EACtB,SAAUF,EACV,YAAaG,EACb,aAAYC,EACZ,mBAAkBC,EAClB,eAAc,CAAC,CAACO,EAChB,gBAAeZ,EACd,GAAGO,EACN,EACF,EACCV,GAAeL,EAAC0B,EAAA,CAAiB,SAAArB,EAAY,EAC7Ce,GAASpB,EAAC2B,EAAA,CAAa,SAAAP,EAAM,QAAQ,EACrC,CAACA,GAASb,GACTP,EAAC,KAAE,UAAU,+CAA+C,KAAK,QAC9D,SAAAO,EACH,GAEJ,EAEJ,CAEJ","names":["useFormContext","React","ChevronDown","clsx","twMerge","cn","inputs","Popover","PopoverContent","PopoverTrigger","React","Slot","cva","Loader2","jsx","jsxs","buttonVariants","cva","Button","className","variant","size","asChild","startIcon","endIcon","loading","disabled","children","type","ariaLabel","props","ref","Comp","Slot","isDisabled","buttonAriaLabel","handleKeyDown","event","cn","React","CommandPrimitive","Search","jsx","jsxs","Command","className","props","ref","CommandPrimitive","cn","CommandInput","className","props","ref","jsxs","jsx","Search","CommandPrimitive","cn","CommandList","CommandEmpty","CommandGroup","CommandSeparator","CommandItem","CommandShortcut","React","cva","jsx","typographyVariants","Typography","className","variant","align","Component","props","ref","cn","jsx","jsxs","Select","options","value","onChange","placeholder","disabled","required","error","className","fullWidth","searchable","id","renderCommandList","open","setOpen","selectedOption","option","cn","Popover","PopoverTrigger","Button","ChevronDown","PopoverContent","Command","CommandInput","CommandList","CommandEmpty","CommandGroup","CommandItem","Typography","React","Slot","Controller","FormProvider","useFormContext","React","LabelPrimitive","cva","jsx","labelVariants","cva","Label","className","props","ref","cn","jsx","FormFieldContext","FormField","props","jsx","Controller","useFormField","fieldContext","itemContext","FormItemContext","getFieldState","formState","useFormContext","fieldState","id","FormItem","className","ref","cn","FormLabel","error","formItemId","Label","FormControl","formDescriptionId","formMessageId","Slot","FormDescription","FormMessage","children","body","jsx","jsxs","RHFSelect","name","label","description","className","warningText","required","disabled","readOnly","placeholder","ariaLabel","ariaDescribedby","options","other","control","useFormContext","FormField","field","error","FormItem","FormLabel","FormControl","Select","cn","FormDescription","FormMessage"]}
|
|
1
|
+
{"version":3,"sources":["../../src/components/rhf/rhf-select/rhf-select.tsx","../../src/components/atoms/select/select.tsx","../../src/utils/cn.ts","../../src/components/atoms/button/button.tsx","../../src/components/atoms/command/command.tsx","../../src/components/atoms/typography/typography.tsx","../../src/components/rhf/form/form.tsx","../../src/components/atoms/label/label.tsx"],"sourcesContent":["\"use client\";\n\"use client\"\n\nimport * as React from \"react\"\nimport { useFormContext, type FieldValues, type FieldPath } from \"react-hook-form\"\nimport { Select } from \"@/components/atoms/select\"\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 RHFSelectProps } from \"./rhf-select.types\"\n\n// ----------------------------------------------------------------------\n\n/**\n * A select 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-rhfselect--docs\n *\n * @example\n * ```tsx\n * <Form>\n * <RHFSelect\n * name=\"country\"\n * label=\"Country\"\n * options={[\n * { id: \"us\", label: \"United States\" },\n * { id: \"ca\", label: \"Canada\" }\n * ]}\n * />\n * </Form>\n * ```\n */\nexport function RHFSelect<\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 \"aria-label\": ariaLabel,\n \"aria-describedby\": ariaDescribedby,\n options,\n ...other\n}: RHFSelectProps<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 <Select\n {...field}\n options={options}\n value={field.value || \"\"}\n onChange={field.onChange}\n className={cn(\n error && \"border-destructive focus-visible:ring-destructive\",\n className\n )}\n disabled={disabled || readOnly}\n required={required}\n placeholder={placeholder}\n aria-label={ariaLabel}\n aria-describedby={ariaDescribedby}\n aria-invalid={!!error}\n aria-required={required}\n {...other}\n />\n </FormControl>\n {description && <FormDescription>{description}</FormDescription>}\n {error && <FormMessage>{error.message}</FormMessage>}\n {!error && warningText && (\n <p className=\"text-sm text-yellow-600 dark:text-yellow-500\" role=\"alert\">\n {warningText}\n </p>\n )}\n </FormItem>\n )}\n />\n )\n}\n","\"use client\";\n\"use client\"\n\nimport * as React from \"react\"\nimport { ChevronDown } from \"lucide-react\"\n\nimport { cn } from \"@/utils\"\n\nimport { Popover, PopoverContent, PopoverTrigger } from \"@radix-ui/react-popover\"\nimport { Button } from \"../button\"\nimport {\n Command,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList\n} from \"../command\"\nimport { Typography } from \"../typography\"\n\nexport type SelectOption<T extends string | number = string | number> = {\n id: T\n label: string\n startIcon?: React.ReactNode\n endIcon?: React.ReactNode\n className?: string\n disabled?: boolean\n}\n\nexport type SelectProps<T extends string | number = string | number> = {\n /** Whether the select is searchable */\n searchable?: boolean\n /** Whether the select should take up the full width of its container */\n fullWidth?: boolean\n /** Currently selected value */\n value: T\n /** Array of options to display in the select */\n options: SelectOption<T>[]\n /** Callback fired when the value changes */\n // eslint-disable-next-line no-unused-vars\n onChange: (value: T) => void\n /** Render a custom CommandList for the select, if not provided, the select will render a default CommandList with the options */\n // eslint-disable-next-line no-unused-vars\n renderCommandList?: (options: SelectOption<T>[]) => React.ReactNode\n /** Placeholder text to show when no value is selected */\n placeholder?: string\n /** Whether the select is disabled */\n disabled?: boolean\n /** Whether the select is required */\n required?: boolean\n /** Error message to display */\n error?: string\n /** Additional class name for the select */\n className?: string\n /** ID for the select element */\n id?: string\n}\n\n/**\n * SearchableSelect component that provides a searchable dropdown select input.\n * Built on top of Radix UI's Select primitive.\n *\n * @url https://sergii-melnykov.github.io/ui/?path=/docs-atoms-select--docs\n *\n * @example\n * ```tsx\n * <Select\n * options={[\n * { id: \"1\", label: \"Option 1\" },\n * { id: \"2\", label: \"Option 2\" }\n * ]}\n * value=\"1\"\n * onChange={setValue}\n * required\n * />\n * ```\n */\nexport function Select<T extends string | number = string | number>({\n options,\n value,\n onChange,\n placeholder = \"Select an option\",\n disabled,\n required,\n error,\n className,\n fullWidth,\n searchable,\n id,\n renderCommandList\n}: SelectProps<T>) {\n const [open, setOpen] = React.useState(false)\n const [triggerWidth, setTriggerWidth] = React.useState<number | undefined>(undefined)\n const triggerRef = React.useRef<HTMLButtonElement>(null)\n const selectedOption = options?.find((option) => option.id === value)\n\n React.useEffect(() => {\n if (triggerRef.current) {\n setTriggerWidth(triggerRef.current.offsetWidth)\n }\n }, [])\n\n return (\n <div className={cn(fullWidth && \"w-full\")}>\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n <Button\n ref={triggerRef}\n variant=\"outline\"\n role=\"combobox\"\n aria-expanded={open}\n aria-controls={id ? `${id}-content` : undefined}\n aria-required={required}\n aria-invalid={!!error}\n disabled={disabled}\n className={cn(\n \"w-[13rem] justify-between\",\n !value && \"text-muted-foreground\",\n fullWidth && \"w-full\",\n error && \"border-destructive focus-visible:ring-destructive\",\n className\n )}\n >\n {selectedOption ? selectedOption.label : placeholder}\n <ChevronDown className={cn(\"opacity-50\", open && \"rotate-180\")} />\n </Button>\n </PopoverTrigger>\n <PopoverContent\n className={cn(\n \"p-0 rounded-md border bg-popover text-popover-foreground shadow-md\",\n fullWidth && \"w-full\"\n )}\n style={{ width: triggerWidth }}\n align=\"start\"\n >\n <Command>\n {searchable && (\n <CommandInput placeholder=\"Search...\" className=\"h-9\" disabled={disabled} />\n )}\n <CommandList className=\"max-h-[12rem] overflow-y-auto\">\n <CommandEmpty>No items found.</CommandEmpty>\n {renderCommandList ? (\n renderCommandList(options)\n ) : (\n <CommandGroup>\n {options?.map((option) => (\n <CommandItem\n value={option.label}\n key={option.id}\n onSelect={() => {\n onChange(option.id)\n setOpen(false)\n }}\n disabled={option.disabled}\n className={cn(\n \"flex items-center justify-between cursor-pointer my-1\",\n value === option.id && \"bg-accent text-accent-foreground\",\n option.disabled && \"opacity-50 cursor-not-allowed\",\n option.className\n )}\n >\n <div className=\"flex items-center gap-1\">\n {option.startIcon && option.startIcon}\n <Typography variant=\"small\">{option.label}</Typography>\n </div>\n {option.endIcon && <div className=\"ml-2\">{option.endIcon}</div>}\n </CommandItem>\n ))}\n </CommandGroup>\n )}\n </CommandList>\n </Command>\n </PopoverContent>\n </Popover>\n </div>\n )\n}\n","import { type ClassValue, clsx } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n","import * as React from \"react\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport { cva } from \"class-variance-authority\"\nimport { cn } from \"@/utils/cn\"\nimport { Loader2 } from \"lucide-react\"\nimport { ButtonProps } from \"./button.types\"\n\n/**\n * Button variant styles using class-variance-authority.\n * Defines the visual styles for different button variants and sizes.\n * Follows WCAG 2.1 Level AA guidelines for accessibility.\n *\n * @example\n * ```tsx\n * <Button variant=\"primary\" size=\"lg\">Click me</Button>\n * ```\n */\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground shadow hover:bg-primary/90\",\n destructive: \"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90\",\n outline:\n \"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground\",\n secondary: \"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80\",\n ghost: \"hover:bg-accent hover:text-accent-foreground\",\n link: \"text-primary underline-offset-4 hover:underline\"\n } as const,\n size: {\n default: \"h-9 px-4 py-2\",\n sm: \"h-8 rounded-md px-3 text-xs\",\n lg: \"h-10 rounded-md px-8\",\n icon: \"h-9 w-9\"\n } as const\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\"\n }\n }\n)\n\n/**\n * A versatile button component that supports multiple variants, sizes, and can be rendered as a child component.\n * Built on top of Radix UI's Slot primitive for maximum flexibility.\n * Implements proper accessibility features and follows WCAG 2.1 Level AA guidelines.\n *\n * @url https://sergii-melnykov.github.io/ui/?path=/docs/atoms-button--docs\n *\n * @component\n * @example\n * ```tsx\n * // Default button\n * <Button>Click me</Button>\n *\n * // Destructive button with small size\n * <Button variant=\"destructive\" size=\"sm\">Delete</Button>\n *\n * // As a link\n * <Button variant=\"link\" asChild>\n * <a href=\"/about\">About</a>\n * </Button>\n *\n * // With icons\n * <Button startIcon={<Icon />}>With Start Icon</Button>\n * <Button endIcon={<Icon />}>With End Icon</Button>\n *\n * // Loading state\n * <Button loading>Loading</Button>\n * ```\n *\n * @param {ButtonProps} props - The component props\n * @param {React.Ref<HTMLButtonElement>} ref - Forwarded ref\n * @returns {JSX.Element} A button element\n */\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n className,\n variant,\n size,\n asChild = false,\n startIcon,\n endIcon,\n loading = false,\n disabled,\n children,\n type = \"button\",\n \"aria-label\": ariaLabel,\n ...props\n },\n ref\n ) => {\n const Comp = asChild ? Slot : \"button\"\n const isDisabled = disabled || loading\n const buttonAriaLabel = ariaLabel || (typeof children === \"string\" ? children : undefined)\n\n // Handle keyboard interaction\n const handleKeyDown = (event: React.KeyboardEvent) => {\n if (event.key === \"Enter\" || event.key === \" \") {\n event.preventDefault()\n if (!isDisabled && props.onClick) {\n props.onClick(event as unknown as React.MouseEvent<HTMLButtonElement>)\n }\n }\n }\n\n if (asChild) {\n return (\n <Comp\n className={cn(buttonVariants({ variant, size, className }))}\n ref={ref}\n disabled={isDisabled}\n type={type}\n aria-label={buttonAriaLabel}\n aria-disabled={isDisabled}\n {...props}\n >\n {children}\n </Comp>\n )\n }\n\n return (\n <Comp\n className={cn(buttonVariants({ variant, size, className }))}\n ref={ref}\n disabled={isDisabled}\n type={type}\n aria-label={buttonAriaLabel}\n aria-disabled={isDisabled}\n onKeyDown={handleKeyDown}\n {...props}\n >\n {loading && (\n <Loader2\n className=\"mr-2 h-4 w-4 animate-spin\"\n role=\"status\"\n aria-label=\"Loading\"\n aria-hidden=\"true\"\n />\n )}\n {!loading && startIcon && (\n <span className=\"mr-2\" aria-hidden=\"true\">\n {startIcon}\n </span>\n )}\n {children}\n {!loading && endIcon && (\n <span className=\"ml-2\" aria-hidden=\"true\">\n {endIcon}\n </span>\n )}\n </Comp>\n )\n }\n)\nButton.displayName = \"Button\"\n\nexport { Button, buttonVariants }\n","import * as React from \"react\"\nimport { Command as CommandPrimitive } from \"cmdk\"\nimport { Search } from \"lucide-react\"\n\nimport { cn } from \"@/utils/index\"\nimport { Dialog, DialogContent } from \"@/components/atoms/dialog\"\nimport {\n type CommandProps,\n type CommandRef,\n type CommandDialogProps,\n type CommandInputProps,\n type CommandInputRef,\n type CommandListProps,\n type CommandListRef,\n type CommandEmptyProps,\n type CommandEmptyRef,\n type CommandGroupProps,\n type CommandGroupRef,\n type CommandSeparatorProps,\n type CommandSeparatorRef,\n type CommandItemProps,\n type CommandItemRef,\n type CommandShortcutProps\n} from \"./command.types\"\n\n/**\n * Command component that provides a command palette interface.\n * Built on top of cmdk and Radix UI's Dialog primitive.\n *\n * @url https://sergii-melnykov.github.io/ui/?path=/docs/atoms-command--docs\n *\n * @example\n * ```tsx\n * <Command>\n * <CommandInput placeholder=\"Search...\" />\n * <CommandList>\n * <CommandEmpty>No results found.</CommandEmpty>\n * <CommandGroup heading=\"Suggestions\">\n * <CommandItem>Calendar</CommandItem>\n * <CommandItem>Search</CommandItem>\n * </CommandGroup>\n * </CommandList>\n * </Command>\n * ```\n */\nconst Command = React.forwardRef<CommandRef, CommandProps>(({ className, ...props }, ref) => (\n <CommandPrimitive\n ref={ref}\n className={cn(\n \"flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground\",\n className\n )}\n {...props}\n />\n))\nCommand.displayName = CommandPrimitive.displayName\n\nconst CommandDialog = ({ children, ...props }: CommandDialogProps) => {\n return (\n <Dialog {...props}>\n <DialogContent className=\"overflow-hidden p-0\">\n <Command className=\"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5\">\n {children}\n </Command>\n </DialogContent>\n </Dialog>\n )\n}\n\nconst CommandInput = React.forwardRef<CommandInputRef, CommandInputProps>(\n ({ className, ...props }, ref) => (\n <div className=\"flex items-center border-b px-3\" cmdk-input-wrapper=\"\">\n <Search className=\"mr-2 h-4 w-4 shrink-0 opacity-50\" />\n <CommandPrimitive.Input\n ref={ref}\n className={cn(\n \"flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50\",\n className\n )}\n {...props}\n />\n </div>\n )\n)\nCommandInput.displayName = CommandPrimitive.Input.displayName\n\nconst CommandList = React.forwardRef<CommandListRef, CommandListProps>(\n ({ className, ...props }, ref) => (\n <CommandPrimitive.List\n ref={ref}\n className={cn(\"max-h-[300px] overflow-y-auto overflow-x-hidden\", className)}\n {...props}\n />\n )\n)\nCommandList.displayName = CommandPrimitive.List.displayName\n\nconst CommandEmpty = React.forwardRef<CommandEmptyRef, CommandEmptyProps>((props, ref) => (\n <CommandPrimitive.Empty ref={ref} className=\"py-6 text-center text-sm\" {...props} />\n))\nCommandEmpty.displayName = CommandPrimitive.Empty.displayName\n\nconst CommandGroup = React.forwardRef<CommandGroupRef, CommandGroupProps>(\n ({ className, ...props }, ref) => (\n <CommandPrimitive.Group\n ref={ref}\n className={cn(\n \"overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground\",\n className\n )}\n {...props}\n />\n )\n)\nCommandGroup.displayName = CommandPrimitive.Group.displayName\n\nconst CommandSeparator = React.forwardRef<CommandSeparatorRef, CommandSeparatorProps>(\n ({ className, ...props }, ref) => (\n <CommandPrimitive.Separator\n ref={ref}\n className={cn(\"-mx-1 h-px bg-border\", className)}\n {...props}\n />\n )\n)\nCommandSeparator.displayName = CommandPrimitive.Separator.displayName\n\nconst CommandItem = React.forwardRef<CommandItemRef, CommandItemProps>(\n ({ className, ...props }, ref) => (\n <CommandPrimitive.Item\n ref={ref}\n className={cn(\n \"relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0\",\n className\n )}\n {...props}\n />\n )\n)\nCommandItem.displayName = CommandPrimitive.Item.displayName\n\nconst CommandShortcut = ({ className, ...props }: CommandShortcutProps) => {\n return (\n <span\n className={cn(\"ml-auto text-xs tracking-widest text-muted-foreground\", className)}\n {...props}\n />\n )\n}\nCommandShortcut.displayName = \"CommandShortcut\"\n\nexport {\n Command,\n CommandDialog,\n CommandInput,\n CommandList,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandShortcut,\n CommandSeparator\n}\n","import * as React from \"react\"\nimport { cn } from \"@/utils\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nconst typographyVariants = cva(\"\", {\n variants: {\n variant: {\n h1: \"scroll-m-5 text-4xl font-extrabold tracking-tight lg:text-5xl\",\n h2: \"scroll-m-5 text-3xl font-semibold tracking-tight\",\n h3: \"scroll-m-5 text-2xl font-semibold tracking-tight\",\n h4: \"scroll-m-5 text-xl font-semibold tracking-tight\",\n h5: \"scroll-m-5 text-lg font-semibold tracking-tight\",\n h6: \"scroll-m-5 text-base font-semibold tracking-tight\",\n p: \"leading-7 [&:not(:first-child)]:mt-6\",\n blockquote: \"mt-6 border-l-2 border-slate-300 pl-6 italic\",\n list: \"my-6 ml-6 list-disc [&>li]:mt-2\",\n lead: \"text-xl text-muted-foreground\",\n large: \"text-lg font-semibold\",\n small: \"text-sm font-medium leading-none\",\n muted: \"text-sm text-muted-foreground\"\n },\n align: {\n left: \"text-left\",\n center: \"text-center\",\n right: \"text-right\",\n justify: \"text-justify\"\n }\n },\n defaultVariants: {\n variant: \"p\",\n align: \"left\"\n }\n})\n\nexport interface TypographyProps\n extends React.HTMLAttributes<HTMLElement>,\n VariantProps<typeof typographyVariants> {\n as?: React.ElementType\n}\n\n/**\n * Typography component for creating accessible text elements.\n * Built on top of shadcn/ui's Typography component.\n *\n * @url https://sergii-melnykov.github.io/ui/?path=/docs/atoms-typography--docs\n *\n */\nconst Typography = React.forwardRef<HTMLElement, TypographyProps>(\n ({ className, variant, align, as: Component = \"p\", ...props }, ref) => {\n return (\n <Component\n className={cn(typographyVariants({ variant, align, className }))}\n ref={ref}\n {...props}\n />\n )\n }\n)\n\nTypography.displayName = \"Typography\"\n\nexport { Typography, typographyVariants }\n","\"use client\";\n\"use client\"\n\nimport * as React from \"react\"\nimport * as LabelPrimitive from \"@radix-ui/react-label\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport {\n Controller,\n FormProvider,\n useFormContext,\n type ControllerProps,\n type FieldPath,\n type FieldValues\n} from \"react-hook-form\"\n\nimport { cn } from \"@/utils/cn\"\nimport { Label } from \"@/components/atoms/label\"\n\nconst Form = FormProvider\n\ntype FormFieldContextValue<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n> = {\n name: TName\n}\n\nconst FormFieldContext = React.createContext<FormFieldContextValue>({} as FormFieldContextValue)\n\nconst FormField = <\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n>({\n ...props\n}: ControllerProps<TFieldValues, TName>) => {\n return (\n <FormFieldContext.Provider value={{ name: props.name }}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n )\n}\n\nconst useFormField = () => {\n const fieldContext = React.useContext(FormFieldContext)\n const itemContext = React.useContext(FormItemContext)\n const { getFieldState, formState } = useFormContext()\n\n const fieldState = getFieldState(fieldContext.name, formState)\n\n if (!fieldContext) {\n throw new Error(\"useFormField should be used within <FormField>\")\n }\n\n const { id } = itemContext\n\n return {\n id,\n name: fieldContext.name,\n formItemId: `${id}-form-item`,\n formDescriptionId: `${id}-form-item-description`,\n formMessageId: `${id}-form-item-message`,\n ...fieldState\n }\n}\n\ntype FormItemContextValue = {\n id: string\n}\n\nconst FormItemContext = React.createContext<FormItemContextValue>({} as FormItemContextValue)\n\nconst FormItem = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => {\n const id = React.useId()\n\n return (\n <FormItemContext.Provider value={{ id }}>\n <div ref={ref} className={cn(\"space-y-2\", className)} {...props} />\n </FormItemContext.Provider>\n )\n }\n)\nFormItem.displayName = \"FormItem\"\n\nconst FormLabel = React.forwardRef<\n React.ElementRef<typeof LabelPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>\n>(({ className, ...props }, ref) => {\n const { error, formItemId } = useFormField()\n\n return (\n <Label\n ref={ref}\n className={cn(error && \"text-destructive\", className)}\n htmlFor={formItemId}\n {...props}\n />\n )\n})\nFormLabel.displayName = \"FormLabel\"\n\nconst FormControl = React.forwardRef<\n React.ElementRef<typeof Slot>,\n React.ComponentPropsWithoutRef<typeof Slot>\n>(({ ...props }, ref) => {\n const { error, formItemId, formDescriptionId, formMessageId } = useFormField()\n\n return (\n <Slot\n ref={ref}\n id={formItemId}\n aria-describedby={!error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`}\n aria-invalid={!!error}\n {...props}\n />\n )\n})\nFormControl.displayName = \"FormControl\"\n\nconst FormDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => {\n const { formDescriptionId } = useFormField()\n\n return (\n <p\n ref={ref}\n id={formDescriptionId}\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n )\n})\nFormDescription.displayName = \"FormDescription\"\n\nconst FormMessage = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, children, ...props }, ref) => {\n const { error, formMessageId } = useFormField()\n const body = error ? String(error?.message ?? \"\") : children\n\n if (!body) {\n return null\n }\n\n return (\n <p\n ref={ref}\n id={formMessageId}\n className={cn(\"text-sm font-medium text-destructive\", className)}\n {...props}\n >\n {body}\n </p>\n )\n})\nFormMessage.displayName = \"FormMessage\"\n\nexport {\n useFormField,\n Form,\n FormItem,\n FormLabel,\n FormControl,\n FormDescription,\n FormMessage,\n FormField\n}\n","import * as React from \"react\"\nimport * as LabelPrimitive from \"@radix-ui/react-label\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/utils/index\"\n\nconst labelVariants = cva(\n \"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70\"\n)\n\nexport interface LabelProps\n extends React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>,\n VariantProps<typeof labelVariants> {}\n\n/**\n * Label component for creating accessible labels.\n * Built on top of Radix UI's Label primitive.\n *\n * @url https://sergii-melnykov.github.io/ui/?path=/docs/atoms-label--docs\n *\n */\nconst Label = React.forwardRef<React.ElementRef<typeof LabelPrimitive.Root>, LabelProps>(\n ({ className, ...props }, ref) => (\n <LabelPrimitive.Root ref={ref} className={cn(labelVariants(), className)} {...props} />\n )\n)\nLabel.displayName = LabelPrimitive.Root.displayName\n\nexport { Label }\n"],"mappings":"aAIA,OAAS,kBAAAA,OAAwD,kBCDjE,UAAYC,MAAW,QACvB,OAAS,eAAAC,OAAmB,eCJ5B,OAA0B,QAAAC,OAAY,OACtC,OAAS,WAAAC,OAAe,iBAEjB,SAASC,KAAMC,EAAsB,CAC1C,OAAOF,GAAQD,GAAKG,CAAM,CAAC,CAC7B,CDGA,OAAS,WAAAC,GAAS,kBAAAC,GAAgB,kBAAAC,OAAsB,0BERxD,UAAYC,MAAW,QACvB,OAAS,QAAAC,OAAY,uBACrB,OAAS,OAAAC,OAAW,2BAEpB,OAAS,WAAAC,OAAe,eA2GhB,cAAAC,EAeF,QAAAC,OAfE,oBA9FR,IAAMC,EAAiBC,GACrB,yRACA,CACE,SAAU,CACR,QAAS,CACP,QAAS,gEACT,YAAa,+EACb,QACE,2FACF,UAAW,yEACX,MAAO,+CACP,KAAM,iDACR,EACA,KAAM,CACJ,QAAS,gBACT,GAAI,8BACJ,GAAI,uBACJ,KAAM,SACR,CACF,EACA,gBAAiB,CACf,QAAS,UACT,KAAM,SACR,CACF,CACF,EAmCMC,EAAe,aACnB,CACE,CACE,UAAAC,EACA,QAAAC,EACA,KAAAC,EACA,QAAAC,EAAU,GACV,UAAAC,EACA,QAAAC,EACA,QAAAC,EAAU,GACV,SAAAC,EACA,SAAAC,EACA,KAAAC,EAAO,SACP,aAAcC,EACd,GAAGC,CACL,EACAC,IACG,CACH,IAAMC,EAAOV,EAAUW,GAAO,SACxBC,EAAaR,GAAYD,EACzBU,EAAkBN,IAAc,OAAOF,GAAa,S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AAAP,EAAM,QAAQ,EACrC,CAACA,GAASb,GACTP,EAAC,KAAE,UAAU,+CAA+C,KAAK,QAC9D,SAAAO,EACH,GAEJ,EAEJ,CAEJ","names":["useFormContext","React","ChevronDown","clsx","twMerge","cn","inputs","Popover","PopoverContent","PopoverTrigger","React","Slot","cva","Loader2","jsx","jsxs","buttonVariants","cva","Button","className","variant","size","asChild","startIcon","endIcon","loading","disabled","children","type","ariaLabel","props","ref","Comp","Slot","isDisabled","buttonAriaLabel","handleKeyDown","event","cn","React","CommandPrimitive","Search","jsx","jsxs","Command","className","props","ref","CommandPrimitive","cn","CommandInput","className","props","ref","jsxs","jsx","Search","CommandPrimitive","cn","CommandList","CommandEmpty","CommandGroup","CommandSeparator","CommandItem","CommandShortcut","React","cva","jsx","typographyVariants","Typography","className","variant","align","Component","props","ref","cn","jsx","jsxs","Select","options","value","onChange","placeholder","disabled","required","error","className","fullWidth","searchable","id","renderCommandList","open","setOpen","triggerWidth","setTriggerWidth","triggerRef","selectedOption","option","cn","Popover","PopoverTrigger","Button","ChevronDown","PopoverContent","Command","CommandInput","CommandList","CommandEmpty","CommandGroup","CommandItem","Typography","React","Slot","Controller","FormProvider","useFormContext","React","LabelPrimitive","cva","jsx","labelVariants","cva","Label","className","props","ref","cn","jsx","FormFieldContext","FormField","props","jsx","Controller","useFormField","fieldContext","itemContext","FormItemContext","getFieldState","formState","useFormContext","fieldState","id","FormItem","className","ref","cn","FormLabel","error","formItemId","Label","FormControl","formDescriptionId","formMessageId","Slot","FormDescription","FormMessage","children","body","jsx","jsxs","RHFSelect","name","label","description","className","warningText","required","disabled","readOnly","placeholder","ariaLabel","ariaDescribedby","options","other","control","useFormContext","FormField","field","error","FormItem","FormLabel","FormControl","Select","cn","FormDescription","FormMessage"]}
|