eai-frontend-components 2.0.76 → 2.0.78

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.ts CHANGED
@@ -80,7 +80,7 @@ declare const AvatarImage: React$1.ForwardRefExoticComponent<Omit<AvatarPrimitiv
80
80
  declare const AvatarFallback: React$1.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarFallbackProps & React$1.RefAttributes<HTMLSpanElement>, "ref"> & React$1.RefAttributes<HTMLSpanElement>>;
81
81
 
82
82
  declare const badgeVariants: (props?: ({
83
- variant?: "default" | "secondary" | "surface" | "destructive" | "outline" | "green" | "red" | "gray" | "blue" | "orange" | "yellow" | null | undefined;
83
+ variant?: "default" | "secondary" | "destructive" | "outline" | "surface" | "green" | "red" | "gray" | "blue" | "orange" | "yellow" | null | undefined;
84
84
  } & class_variance_authority_dist_types.ClassProp) | undefined) => string;
85
85
  interface BadgeProps extends React$1.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
86
86
  }
@@ -105,7 +105,7 @@ declare const BreadcrumbEllipsis: {
105
105
  };
106
106
 
107
107
  declare const buttonVariants: (props?: ({
108
- variant?: "default" | "secondary" | "destructive" | "outline" | "link" | "primary" | "ghost" | null | undefined;
108
+ variant?: "link" | "default" | "primary" | "secondary" | "destructive" | "outline" | "ghost" | null | undefined;
109
109
  size?: "default" | "sm" | "lg" | "icon" | null | undefined;
110
110
  } & class_variance_authority_dist_types.ClassProp) | undefined) => string;
111
111
  interface ButtonProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
@@ -208,7 +208,7 @@ declare const Command: React$1.ForwardRefExoticComponent<Omit<{
208
208
  ref?: React$1.Ref<HTMLDivElement>;
209
209
  } & {
210
210
  asChild?: boolean;
211
- }, "key" | keyof React$1.HTMLAttributes<HTMLDivElement> | "asChild"> & {
211
+ }, "key" | "asChild" | keyof React$1.HTMLAttributes<HTMLDivElement>> & {
212
212
  label?: string;
213
213
  shouldFilter?: boolean;
214
214
  filter?: (value: string, search: string, keywords?: string[]) => number;
@@ -224,7 +224,7 @@ declare const CommandInput: React$1.ForwardRefExoticComponent<Omit<Omit<Pick<Pic
224
224
  ref?: React$1.Ref<HTMLInputElement>;
225
225
  } & {
226
226
  asChild?: boolean;
227
- }, "key" | "asChild" | keyof React$1.InputHTMLAttributes<HTMLInputElement>>, "onChange" | "value" | "type"> & {
227
+ }, "key" | "asChild" | keyof React$1.InputHTMLAttributes<HTMLInputElement>>, "onChange" | "type" | "value"> & {
228
228
  value?: string;
229
229
  onValueChange?: (search: string) => void;
230
230
  } & React$1.RefAttributes<HTMLInputElement>, "ref"> & React$1.RefAttributes<HTMLInputElement>>;
@@ -234,7 +234,7 @@ declare const CommandList: React$1.ForwardRefExoticComponent<Omit<{
234
234
  ref?: React$1.Ref<HTMLDivElement>;
235
235
  } & {
236
236
  asChild?: boolean;
237
- }, "key" | keyof React$1.HTMLAttributes<HTMLDivElement> | "asChild"> & {
237
+ }, "key" | "asChild" | keyof React$1.HTMLAttributes<HTMLDivElement>> & {
238
238
  label?: string;
239
239
  } & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
240
240
  declare const CommandEmpty: React$1.ForwardRefExoticComponent<Omit<{
@@ -243,14 +243,14 @@ declare const CommandEmpty: React$1.ForwardRefExoticComponent<Omit<{
243
243
  ref?: React$1.Ref<HTMLDivElement>;
244
244
  } & {
245
245
  asChild?: boolean;
246
- }, "key" | keyof React$1.HTMLAttributes<HTMLDivElement> | "asChild"> & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
246
+ }, "key" | "asChild" | keyof React$1.HTMLAttributes<HTMLDivElement>> & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
247
247
  declare const CommandGroup: React$1.ForwardRefExoticComponent<Omit<{
248
248
  children?: React$1.ReactNode;
249
249
  } & Omit<Pick<Pick<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React$1.HTMLAttributes<HTMLDivElement>> & {
250
250
  ref?: React$1.Ref<HTMLDivElement>;
251
251
  } & {
252
252
  asChild?: boolean;
253
- }, "key" | keyof React$1.HTMLAttributes<HTMLDivElement> | "asChild">, "value" | "heading"> & {
253
+ }, "key" | "asChild" | keyof React$1.HTMLAttributes<HTMLDivElement>>, "value" | "heading"> & {
254
254
  heading?: React$1.ReactNode;
255
255
  value?: string;
256
256
  forceMount?: boolean;
@@ -259,7 +259,7 @@ declare const CommandSeparator: React$1.ForwardRefExoticComponent<Omit<Pick<Pick
259
259
  ref?: React$1.Ref<HTMLDivElement>;
260
260
  } & {
261
261
  asChild?: boolean;
262
- }, "key" | keyof React$1.HTMLAttributes<HTMLDivElement> | "asChild"> & {
262
+ }, "key" | "asChild" | keyof React$1.HTMLAttributes<HTMLDivElement>> & {
263
263
  alwaysRender?: boolean;
264
264
  } & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
265
265
  declare const CommandItem: React$1.ForwardRefExoticComponent<Omit<{
@@ -268,7 +268,7 @@ declare const CommandItem: React$1.ForwardRefExoticComponent<Omit<{
268
268
  ref?: React$1.Ref<HTMLDivElement>;
269
269
  } & {
270
270
  asChild?: boolean;
271
- }, "key" | keyof React$1.HTMLAttributes<HTMLDivElement> | "asChild">, "onSelect" | "disabled" | "value"> & {
271
+ }, "key" | "asChild" | keyof React$1.HTMLAttributes<HTMLDivElement>>, "onSelect" | "value" | "disabled"> & {
272
272
  disabled?: boolean;
273
273
  onSelect?: (value: string) => void;
274
274
  value?: string;
@@ -530,7 +530,9 @@ declare const PopoverContent: React$1.ForwardRefExoticComponent<Omit<PopoverPrim
530
530
  declare const Progress: React$1.ForwardRefExoticComponent<Omit<ProgressPrimitive.ProgressProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
531
531
 
532
532
  declare const RadioGroup: React$1.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
533
- declare const RadioGroupItem: React$1.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupItemProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
533
+ declare const RadioGroupItem: React$1.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupItemProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & {
534
+ size?: "sm" | "md" | "lg";
535
+ } & React$1.RefAttributes<HTMLButtonElement>>;
534
536
 
535
537
  declare const ScrollArea: React$1.ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
536
538
  declare const ScrollBar: React$1.ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaScrollbarProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
@@ -963,6 +965,7 @@ interface Props$4 {
963
965
  classNameOptions?: string;
964
966
  disabled?: boolean;
965
967
  required?: boolean;
968
+ size?: 'sm' | 'md' | 'lg';
966
969
  options?: RadioOption[];
967
970
  onChange?: (value: string) => void;
968
971
  }
package/dist/index.esm.js CHANGED
@@ -1085,8 +1085,13 @@ const RadioGroup = React$1.forwardRef(({ className, ...props }, ref) => {
1085
1085
  return jsx(RadioGroupPrimitive.Root, { className: cn('', className), ...props, ref: ref });
1086
1086
  });
1087
1087
  RadioGroup.displayName = RadioGroupPrimitive.Root.displayName;
1088
- const RadioGroupItem = React$1.forwardRef(({ className, ...props }, ref) => {
1089
- return (jsx(RadioGroupPrimitive.Item, { ref: ref, className: cn('aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50', className), ...props, children: jsx(RadioGroupPrimitive.Indicator, { className: 'flex items-center justify-center', children: jsx(Circle, { className: 'h-2.5 w-2.5 fill-current text-current' }) }) }));
1088
+ const RadioGroupItem = React$1.forwardRef(({ className, size = 'md', ...props }, ref) => {
1089
+ const sizeClasses = {
1090
+ sm: 'h-3.5 w-3.5',
1091
+ md: 'h-4 w-4',
1092
+ lg: 'h-5 w-5',
1093
+ };
1094
+ return (jsx(RadioGroupPrimitive.Item, { ref: ref, className: cn(`aspect-square ${sizeClasses[size]} rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50`, className), ...props, children: jsx(RadioGroupPrimitive.Indicator, { className: 'flex items-center justify-center', children: jsx(Circle, { className: 'h-2.5 w-2.5 fill-current text-current' }) }) }));
1090
1095
  });
1091
1096
  RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;
1092
1097
 
@@ -9559,12 +9564,12 @@ const FormInputPhone = ({ control, name, label, subLabel, helpText, placeholder,
9559
9564
  }, onKeyUp: (e) => onKeyUp?.(e) }) }), formMessage(FormMessage)] })) }));
9560
9565
  };
9561
9566
 
9562
- const FormRadioGroup = ({ control, name, value, label, subLabel, helpText, className, classNameOptions, disabled, required, options, onChange, }) => {
9567
+ const FormRadioGroup = ({ control, name, value, label, subLabel, helpText, className, classNameOptions, disabled, required, size = 'md', options, onChange, }) => {
9563
9568
  const { FormField, FormItem, FormLabel, FormControl, FormMessage } = FormComponents;
9564
9569
  return (jsx(FormField, { control: control, name: name, render: ({ field, formState }) => (jsxs(FormItem, { children: [jsxs("div", { className: cn('flex items-center space-x-1.5 mb-2', className), children: [label && formLabelAndSubLabel(FormLabel, label, subLabel, required), helpText && formHelpText(helpText)] }), jsx(FormControl, { children: jsx(RadioGroup, { onValueChange: (value) => {
9565
9570
  field?.onChange?.(value);
9566
9571
  onChange?.(value);
9567
- }, defaultValue: field.value, disabled: disabled || formState.isSubmitting, className: `${className}`, children: jsx("div", { className: cn('flex flex-grow gap-6 font-medium text-sm', classNameOptions), children: options?.map((option) => (jsx("label", { htmlFor: `r${option.value}`, className: cn(option.disabled ? 'cursor-not-allowed' : 'cursor-pointer', 'block'), children: jsxs("div", { className: 'flex flex-col', children: [jsxs("div", { className: 'flex items-center space-x-2', children: [jsx(RadioGroupItem, { value: option.value, id: `r${option.value}`, checked: field.value === option.value, disabled: option.disabled }), jsx("div", { className: option.disabled ? 'opacity-50' : '', children: option.label })] }), option.description && (jsx("div", { className: cn('pl-6 text-zinc-500', { 'opacity-50': option.disabled }), children: option.description }))] }) }, `radio-${name}-${option.value}`))) }) }) }), formMessage(FormMessage)] })) }, value));
9572
+ }, defaultValue: field.value, disabled: disabled || formState.isSubmitting, className: `${className}`, children: jsx("div", { className: cn('flex flex-grow gap-6 font-medium text-sm', classNameOptions), children: options?.map((option) => (jsx("label", { htmlFor: `r${option.value}`, className: cn(option.disabled ? 'cursor-not-allowed' : 'cursor-pointer', 'block'), children: jsxs("div", { className: 'flex flex-col', children: [jsxs("div", { className: 'flex items-center space-x-2', children: [jsx(RadioGroupItem, { value: option.value, id: `r${option.value}`, checked: field.value === option.value, disabled: option.disabled, size: size }), jsx("div", { className: option.disabled ? 'opacity-50' : '', children: option.label })] }), option.description && (jsx("div", { className: cn('pl-6 text-zinc-500', { 'opacity-50': option.disabled }), children: option.description }))] }) }, `radio-${name}-${option.value}`))) }) }) }), formMessage(FormMessage)] })) }, value));
9568
9573
  };
9569
9574
 
9570
9575
  const FormSelect = ({ control, name, label, subLabel, helpText, placeholder, className, disabled, required, options }) => {