eai-frontend-components 2.0.44 → 2.0.46
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 -13
- package/dist/index.esm.js +2 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -105,7 +105,7 @@ declare const BreadcrumbEllipsis: {
|
|
|
105
105
|
};
|
|
106
106
|
|
|
107
107
|
declare const buttonVariants: (props?: ({
|
|
108
|
-
variant?: "
|
|
108
|
+
variant?: "default" | "destructive" | "link" | "outline" | "secondary" | "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> {
|
|
@@ -204,11 +204,11 @@ declare const CollapsibleContent: React$1.ForwardRefExoticComponent<CollapsibleP
|
|
|
204
204
|
|
|
205
205
|
declare const Command: React$1.ForwardRefExoticComponent<Omit<{
|
|
206
206
|
children?: React$1.ReactNode;
|
|
207
|
-
} & Pick<Pick<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>,
|
|
207
|
+
} & Pick<Pick<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React$1.HTMLAttributes<HTMLDivElement> | "key"> & {
|
|
208
208
|
ref?: React$1.Ref<HTMLDivElement>;
|
|
209
209
|
} & {
|
|
210
210
|
asChild?: boolean;
|
|
211
|
-
},
|
|
211
|
+
}, keyof React$1.HTMLAttributes<HTMLDivElement> | "key" | "asChild"> & {
|
|
212
212
|
label?: string;
|
|
213
213
|
shouldFilter?: boolean;
|
|
214
214
|
filter?: (value: string, search: string, keywords?: string[]) => number;
|
|
@@ -230,45 +230,45 @@ declare const CommandInput: React$1.ForwardRefExoticComponent<Omit<Omit<Pick<Pic
|
|
|
230
230
|
} & React$1.RefAttributes<HTMLInputElement>, "ref"> & React$1.RefAttributes<HTMLInputElement>>;
|
|
231
231
|
declare const CommandList: React$1.ForwardRefExoticComponent<Omit<{
|
|
232
232
|
children?: React$1.ReactNode;
|
|
233
|
-
} & Pick<Pick<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>,
|
|
233
|
+
} & Pick<Pick<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React$1.HTMLAttributes<HTMLDivElement> | "key"> & {
|
|
234
234
|
ref?: React$1.Ref<HTMLDivElement>;
|
|
235
235
|
} & {
|
|
236
236
|
asChild?: boolean;
|
|
237
|
-
},
|
|
237
|
+
}, keyof React$1.HTMLAttributes<HTMLDivElement> | "key" | "asChild"> & {
|
|
238
238
|
label?: string;
|
|
239
239
|
} & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
240
240
|
declare const CommandEmpty: React$1.ForwardRefExoticComponent<Omit<{
|
|
241
241
|
children?: React$1.ReactNode;
|
|
242
|
-
} & Pick<Pick<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>,
|
|
242
|
+
} & Pick<Pick<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React$1.HTMLAttributes<HTMLDivElement> | "key"> & {
|
|
243
243
|
ref?: React$1.Ref<HTMLDivElement>;
|
|
244
244
|
} & {
|
|
245
245
|
asChild?: boolean;
|
|
246
|
-
},
|
|
246
|
+
}, keyof React$1.HTMLAttributes<HTMLDivElement> | "key" | "asChild"> & 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
|
-
} & Omit<Pick<Pick<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>,
|
|
249
|
+
} & Omit<Pick<Pick<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React$1.HTMLAttributes<HTMLDivElement> | "key"> & {
|
|
250
250
|
ref?: React$1.Ref<HTMLDivElement>;
|
|
251
251
|
} & {
|
|
252
252
|
asChild?: boolean;
|
|
253
|
-
},
|
|
253
|
+
}, keyof React$1.HTMLAttributes<HTMLDivElement> | "key" | "asChild">, "value" | "heading"> & {
|
|
254
254
|
heading?: React$1.ReactNode;
|
|
255
255
|
value?: string;
|
|
256
256
|
forceMount?: boolean;
|
|
257
257
|
} & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
258
|
-
declare const CommandSeparator: React$1.ForwardRefExoticComponent<Omit<Pick<Pick<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>,
|
|
258
|
+
declare const CommandSeparator: React$1.ForwardRefExoticComponent<Omit<Pick<Pick<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React$1.HTMLAttributes<HTMLDivElement> | "key"> & {
|
|
259
259
|
ref?: React$1.Ref<HTMLDivElement>;
|
|
260
260
|
} & {
|
|
261
261
|
asChild?: boolean;
|
|
262
|
-
},
|
|
262
|
+
}, keyof React$1.HTMLAttributes<HTMLDivElement> | "key" | "asChild"> & {
|
|
263
263
|
alwaysRender?: boolean;
|
|
264
264
|
} & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
265
265
|
declare const CommandItem: React$1.ForwardRefExoticComponent<Omit<{
|
|
266
266
|
children?: React$1.ReactNode;
|
|
267
|
-
} & Omit<Pick<Pick<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>,
|
|
267
|
+
} & Omit<Pick<Pick<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React$1.HTMLAttributes<HTMLDivElement> | "key"> & {
|
|
268
268
|
ref?: React$1.Ref<HTMLDivElement>;
|
|
269
269
|
} & {
|
|
270
270
|
asChild?: boolean;
|
|
271
|
-
},
|
|
271
|
+
}, keyof React$1.HTMLAttributes<HTMLDivElement> | "key" | "asChild">, "onSelect" | "disabled" | "value"> & {
|
|
272
272
|
disabled?: boolean;
|
|
273
273
|
onSelect?: (value: string) => void;
|
|
274
274
|
value?: string;
|
|
@@ -722,6 +722,7 @@ interface Props$h {
|
|
|
722
722
|
subLabel?: string;
|
|
723
723
|
helpText?: JSX.Element;
|
|
724
724
|
placeholder?: string;
|
|
725
|
+
placeholderSearch?: string;
|
|
725
726
|
className?: string;
|
|
726
727
|
disabled?: boolean;
|
|
727
728
|
required?: boolean;
|
package/dist/index.esm.js
CHANGED
|
@@ -9199,7 +9199,7 @@ const FormInputColor = ({ control, name, label, subLabel, helpText, placeholder,
|
|
|
9199
9199
|
return (jsx(FormField, { control: control, name: name, render: ({ field, formState }) => (jsxs(FormItem, { className: className, children: [jsxs("div", { className: 'flex items-center space-x-1.5', children: [label && formLabelAndSubLabel(FormLabel, label, subLabel, required), helpText && formHelpText(helpText)] }), jsxs(Popover, { children: [jsx(PopoverTrigger, { asChild: true, children: jsx(FormControl, { children: jsx(Button, { type: 'button', variant: 'outline', className: cn('w-[240px] justify-start text-left font-normal', !field.value && 'text-zinc-500', className), disabled: disabled || formState.isSubmitting, children: jsxs("div", { className: 'w-full flex items-center gap-2', children: [field.value ? (jsx("div", { className: 'h-4 w-4 rounded !bg-center !bg-cover transition-all border', style: { backgroundColor: field.value } })) : (jsx(Paintbrush, { className: 'h-4 w-4' })), jsx("div", { className: 'truncate flex-1 text-sm', children: field.value ? field.value : placeholder || 'Selecione uma cor' })] }) }) }) }), jsx(PopoverContent, { className: cn('w-80', className), children: jsxs("div", { className: 'flex flex-col gap-4', children: [jsx("section", { className: '[&_.react-colorful]:w-auto', children: jsx(HexColorPicker, { color: field.value ?? DEFAULT_COLOR, onChange: (newColor) => handleColorChange(newColor, field.onChange) }) }), jsxs("div", { className: 'flex gap-2', children: [jsxs("div", { className: 'flex flex-col gap-1', children: [jsx(Label, { children: "Hex" }), jsx(Input, { value: currentColor, onChange: (e) => handleHexChange(e.target.value, field.onChange), maxLength: 7 })] }), jsxs("div", { className: 'flex gap-2', children: [jsxs("div", { className: 'flex flex-col gap-1', children: [jsx(Label, { children: "R" }), jsx(Input, { value: rgb.r, onChange: (e) => handleRgbChange('r', e.target.value, field.onChange), className: 'w-14' })] }), jsxs("div", { className: 'flex flex-col gap-1', children: [jsx(Label, { children: "G" }), jsx(Input, { value: rgb.g, onChange: (e) => handleRgbChange('g', e.target.value, field.onChange), className: 'w-14' })] }), jsxs("div", { className: 'flex flex-col gap-1', children: [jsx(Label, { children: "B" }), jsx(Input, { value: rgb.b, onChange: (e) => handleRgbChange('b', e.target.value, field.onChange), className: 'w-14' })] })] })] })] }) })] }), formMessage(FormMessage)] })) }));
|
|
9200
9200
|
};
|
|
9201
9201
|
|
|
9202
|
-
const FormCombobox = ({ control, variant = 'outline', name, label, subLabel, helpText, placeholder, className, disabled, required, options, selectedOption, iconLeft, iconRight, addEmptyOption, canUnselect = false, closePopUpOnChange = true, runInternalSearch = true, disabledSearch = false, onChange, onSearch, footerAction, }) => {
|
|
9202
|
+
const FormCombobox = ({ control, variant = 'outline', name, label, subLabel, helpText, placeholder, placeholderSearch, className, disabled, required, options, selectedOption, iconLeft, iconRight, addEmptyOption, canUnselect = false, closePopUpOnChange = true, runInternalSearch = true, disabledSearch = false, onChange, onSearch, footerAction, }) => {
|
|
9203
9203
|
const { FormField, FormItem, FormLabel, FormControl, FormMessage } = FormComponents;
|
|
9204
9204
|
const [open, setOpen] = useState(false);
|
|
9205
9205
|
const [loading, setLoading] = useState(false);
|
|
@@ -9273,7 +9273,7 @@ const FormCombobox = ({ control, variant = 'outline', name, label, subLabel, hel
|
|
|
9273
9273
|
return (jsx(FormField, { control: control, name: name, render: ({ field, formState }) => (jsxs(FormItem, { className: className, children: [jsxs("div", { className: 'flex items-center space-x-1.5', children: [label && formLabelAndSubLabel(FormLabel, label, subLabel, required), helpText && formHelpText(helpText)] }), jsxs(Popover, { open: open, onOpenChange: (open) => {
|
|
9274
9274
|
if (!disabled)
|
|
9275
9275
|
setOpen(open);
|
|
9276
|
-
}, children: [jsx(PopoverTrigger, { asChild: true, children: jsx(FormControl, { children: jsx("div", { className: cn(`rounded-sm outline-none ${open ? 'ring-2 ring-ring ring-offset-2' : 'ring-0'}`, className), children: jsxs(Button, { type: 'button', variant: variant, role: 'combobox', "aria-expanded": open, className: cn('justify-between disabled:border-disabled disabled:cursor-not-allowed disabled:opacity-50', formState.errors[name] ? 'border-red-600' : '', className), disabled: disabled || formState.isSubmitting, children: [iconLeft, jsx("div", { className: 'grid flex-1 text-left text-sm leading-tight', children: jsx("span", { className: 'truncate font-normal', children: getSelectedOption(field.value) ? (jsxs("div", { className: 'flex gap-2', children: [getSelectedOption(field.value)?.icon, getSelectedOption(field.value)?.title] })) : (jsx("span", { className: 'text-zinc-500', children: placeholder ?? DEFAULT_PLACEHOLDER })) }) }), iconRight ?? jsx(ChevronsUpDown, { size: 20, className: 'stroke-zinc-500' })] }) }) }) }), jsxs(PopoverContent, { className: cn('p-0', className, 'w-[--radix-popover-trigger-width]'), children: [jsxs(Command, { shouldFilter: false, children: [!disabledSearch && jsx(CommandInput, { placeholder:
|
|
9276
|
+
}, children: [jsx(PopoverTrigger, { asChild: true, children: jsx(FormControl, { children: jsx("div", { className: cn(`rounded-sm outline-none ${open ? 'ring-2 ring-ring ring-offset-2' : 'ring-0'}`, className), children: jsxs(Button, { type: 'button', variant: variant, role: 'combobox', "aria-expanded": open, className: cn('justify-between disabled:border-disabled disabled:cursor-not-allowed disabled:opacity-50', formState.errors[name] ? 'border-red-600' : '', className), disabled: disabled || formState.isSubmitting, children: [iconLeft, jsx("div", { className: 'grid flex-1 text-left text-sm leading-tight', children: jsx("span", { className: 'truncate font-normal', children: getSelectedOption(field.value) ? (jsxs("div", { className: 'flex gap-2', children: [getSelectedOption(field.value)?.icon, getSelectedOption(field.value)?.title] })) : (jsx("span", { className: 'text-zinc-500', children: placeholder ?? (disabledSearch ? 'Selecione' : DEFAULT_PLACEHOLDER) })) }) }), iconRight ?? jsx(ChevronsUpDown, { size: 20, className: 'stroke-zinc-500' })] }) }) }) }), jsxs(PopoverContent, { className: cn('p-0', className, 'w-[--radix-popover-trigger-width]'), children: [jsxs(Command, { shouldFilter: false, children: [!disabledSearch && jsx(CommandInput, { placeholder: placeholderSearch ?? DEFAULT_PLACEHOLDER, onKeyUp: handleKeyUp }), jsxs(CommandList, { children: [jsx(CommandEmpty, { className: 'flex flex-col justify-between items-center p-3 font-normal text-sm', children: loading ? (jsx(LoaderCircle, { size: 16, className: 'text-muted-foreground animate-spin mr-2' })) : getOptions()?.length === 0 && (searchString !== '' || disabledSearch) ? ('Nenhum resultado encontrado') : ('...') }), options.length > 0 && (jsx(CommandGroup, { children: getOptions().map((option) => (jsxs(CommandItem, { value: option.value, className: 'group', onSelect: () => handleSelect(option.value, field), children: [jsxs("div", { className: cn('grid flex-1 text-left text-sm leading-tight', option.className), children: [jsxs("div", { className: 'flex gap-2', children: [option.icon, jsx("span", { className: 'truncate font-normal', children: option.title })] }), jsx("span", { className: 'truncate text-xs text-zinc-500', children: option.subTitle })] }), jsxs("div", { className: `ml-auto text-zinc-500 ${field.value === option.value ? 'opacity-100' : 'opacity-0'}`, children: [jsx(Check, { className: cn('flex', canUnselect && 'group-hover:hidden hover:hidden'), size: 16 }), jsx(X, { className: cn('hidden', canUnselect && 'group-hover:flex hover:flex'), size: 16 })] })] }, `key-opt-${option.value}`))) }))] })] }), footerAction && (jsx("div", { className: 'grid w-full p-1 border-t', children: jsxs(Button, { type: 'button', variant: 'ghost', className: 'h-8', onClick: () => footerAction.onClick(), children: [footerAction.icon, footerAction.label] }) }))] })] }), formMessage(FormMessage)] })) }));
|
|
9277
9277
|
};
|
|
9278
9278
|
|
|
9279
9279
|
const masks$1 = ['999.999.999-999', '99.999.999/9999-99'];
|