eai-frontend-components 2.0.77 → 2.0.79
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 +14 -11
- package/dist/index.esm.js +10 -5
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +10 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1125,8 +1125,13 @@ const RadioGroup = React__namespace.forwardRef(({ className, ...props }, ref) =>
|
|
|
1125
1125
|
return jsxRuntime.jsx(RadioGroupPrimitive__namespace.Root, { className: cn('', className), ...props, ref: ref });
|
|
1126
1126
|
});
|
|
1127
1127
|
RadioGroup.displayName = RadioGroupPrimitive__namespace.Root.displayName;
|
|
1128
|
-
const RadioGroupItem = React__namespace.forwardRef(({ className, ...props }, ref) => {
|
|
1129
|
-
|
|
1128
|
+
const RadioGroupItem = React__namespace.forwardRef(({ className, size = 'md', ...props }, ref) => {
|
|
1129
|
+
const sizeClasses = {
|
|
1130
|
+
sm: 'h-3.5 w-3.5',
|
|
1131
|
+
md: 'h-4 w-4',
|
|
1132
|
+
lg: 'h-5 w-5',
|
|
1133
|
+
};
|
|
1134
|
+
return (jsxRuntime.jsx(RadioGroupPrimitive__namespace.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: jsxRuntime.jsx(RadioGroupPrimitive__namespace.Indicator, { className: 'flex items-center justify-center', children: jsxRuntime.jsx(lucideReact.Circle, { className: 'h-2.5 w-2.5 fill-current text-current' }) }) }));
|
|
1130
1135
|
});
|
|
1131
1136
|
RadioGroupItem.displayName = RadioGroupPrimitive__namespace.Item.displayName;
|
|
1132
1137
|
|
|
@@ -9599,12 +9604,12 @@ const FormInputPhone = ({ control, name, label, subLabel, helpText, placeholder,
|
|
|
9599
9604
|
}, onKeyUp: (e) => onKeyUp?.(e) }) }), formMessage(FormMessage)] })) }));
|
|
9600
9605
|
};
|
|
9601
9606
|
|
|
9602
|
-
const FormRadioGroup = ({ control, name, value, label, subLabel, helpText, className, classNameOptions, disabled, required, options, onChange, }) => {
|
|
9607
|
+
const FormRadioGroup = ({ control, name, value, label, subLabel, helpText, className, classNameOptions, disabled, required, size = 'md', options, onChange, }) => {
|
|
9603
9608
|
const { FormField, FormItem, FormLabel, FormControl, FormMessage } = FormComponents;
|
|
9604
|
-
return (jsxRuntime.jsx(FormField, { control: control, name: name, render: ({ field, formState }) => (jsxRuntime.jsxs(FormItem, { children: [jsxRuntime.jsxs("div", { className: cn('flex items-center space-x-1.5 mb-2', className), children: [
|
|
9609
|
+
return (jsxRuntime.jsx(FormField, { control: control, name: name, render: ({ field, formState }) => (jsxRuntime.jsxs(FormItem, { children: [label && (jsxRuntime.jsxs("div", { className: cn('flex items-center space-x-1.5 mb-2', className), children: [formLabelAndSubLabel(FormLabel, label, subLabel, required), helpText && formHelpText(helpText)] })), jsxRuntime.jsx(FormControl, { children: jsxRuntime.jsx(RadioGroup, { onValueChange: (value) => {
|
|
9605
9610
|
field?.onChange?.(value);
|
|
9606
9611
|
onChange?.(value);
|
|
9607
|
-
}, defaultValue: field.value, disabled: disabled || formState.isSubmitting, className: `${className}`, children: jsxRuntime.jsx("div", { className: cn('flex flex-grow gap-6 font-medium text-sm', classNameOptions), children: options?.map((option) => (jsxRuntime.jsx("label", { htmlFor: `r${option.value}`, className: cn(option.disabled ? 'cursor-not-allowed' : 'cursor-pointer', 'block'), children: jsxRuntime.jsxs("div", { className: 'flex flex-col', children: [jsxRuntime.jsxs("div", { className: 'flex items-center space-x-2', children: [jsxRuntime.jsx(RadioGroupItem, { value: option.value, id: `r${option.value}`, checked: field.value === option.value, disabled: option.disabled }), jsxRuntime.jsx("div", { className: option.disabled ? 'opacity-50' : '', children: option.label })] }), option.description && (jsxRuntime.jsx("div", { className: cn('pl-6 text-zinc-500', { 'opacity-50': option.disabled }), children: option.description }))] }) }, `radio-${name}-${option.value}`))) }) }) }), formMessage(FormMessage)] })) }, value));
|
|
9612
|
+
}, defaultValue: field.value, disabled: disabled || formState.isSubmitting, className: `${className}`, children: jsxRuntime.jsx("div", { className: cn('flex flex-grow gap-6 font-medium text-sm', classNameOptions), children: options?.map((option) => (jsxRuntime.jsx("label", { htmlFor: `r${option.value}`, className: cn(option.disabled ? 'cursor-not-allowed' : 'cursor-pointer', 'block'), children: jsxRuntime.jsxs("div", { className: 'flex flex-col', children: [jsxRuntime.jsxs("div", { className: 'flex items-center space-x-2', children: [jsxRuntime.jsx(RadioGroupItem, { value: option.value, id: `r${option.value}`, checked: field.value === option.value, disabled: option.disabled, size: size }), jsxRuntime.jsx("div", { className: option.disabled ? 'opacity-50' : '', children: option.label })] }), option.description && (jsxRuntime.jsx("div", { className: cn('pl-6 text-zinc-500', { 'opacity-50': option.disabled }), children: option.description }))] }) }, `radio-${name}-${option.value}`))) }) }) }), formMessage(FormMessage)] })) }, value));
|
|
9608
9613
|
};
|
|
9609
9614
|
|
|
9610
9615
|
const FormSelect = ({ control, name, label, subLabel, helpText, placeholder, className, disabled, required, options }) => {
|