@flowtomic/ui 0.1.2 → 0.1.4

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.
Files changed (75) hide show
  1. package/dist/blocks/developer-panel/page.d.ts.map +1 -1
  2. package/dist/blocks/developer-panel/page.js +2 -2
  3. package/dist/components/atoms/actions/badge/badge.d.ts +2 -2
  4. package/dist/components/atoms/actions/button/button.d.ts +2 -2
  5. package/dist/components/atoms/animation/encrypted-text/encrypted-text.d.ts +57 -0
  6. package/dist/components/atoms/animation/encrypted-text/encrypted-text.d.ts.map +1 -0
  7. package/dist/components/atoms/animation/encrypted-text/encrypted-text.js +104 -0
  8. package/dist/components/atoms/animation/encrypted-text/index.d.ts +3 -0
  9. package/dist/components/atoms/animation/encrypted-text/index.d.ts.map +1 -0
  10. package/dist/components/atoms/animation/encrypted-text/index.js +1 -0
  11. package/dist/components/atoms/animation/index.d.ts +2 -0
  12. package/dist/components/atoms/animation/index.d.ts.map +1 -1
  13. package/dist/components/atoms/animation/index.js +1 -0
  14. package/dist/components/atoms/feedback/alert/alert.d.ts +1 -1
  15. package/dist/components/atoms/feedback/alert-dialog/alert-dialog.d.ts +2 -2
  16. package/dist/components/atoms/feedback/tooltip/index.d.ts +1 -1
  17. package/dist/components/atoms/feedback/tooltip/index.d.ts.map +1 -1
  18. package/dist/components/atoms/feedback/tooltip/index.js +1 -1
  19. package/dist/components/atoms/feedback/tooltip/tooltip.d.ts +42 -5
  20. package/dist/components/atoms/feedback/tooltip/tooltip.d.ts.map +1 -1
  21. package/dist/components/atoms/feedback/tooltip/tooltip.js +188 -5
  22. package/dist/components/atoms/forms/autocomplete/autocomplete-context.d.ts +29 -0
  23. package/dist/components/atoms/forms/autocomplete/autocomplete-context.d.ts.map +1 -0
  24. package/dist/components/atoms/forms/autocomplete/autocomplete-context.js +10 -0
  25. package/dist/components/atoms/forms/autocomplete/autocomplete-item.d.ts +16 -0
  26. package/dist/components/atoms/forms/autocomplete/autocomplete-item.d.ts.map +1 -0
  27. package/dist/components/atoms/forms/autocomplete/autocomplete-item.js +48 -0
  28. package/dist/components/atoms/forms/autocomplete/autocomplete-section.d.ts +14 -0
  29. package/dist/components/atoms/forms/autocomplete/autocomplete-section.d.ts.map +1 -0
  30. package/dist/components/atoms/forms/autocomplete/autocomplete-section.js +13 -0
  31. package/dist/components/atoms/forms/autocomplete/autocomplete.d.ts +13 -9
  32. package/dist/components/atoms/forms/autocomplete/autocomplete.d.ts.map +1 -1
  33. package/dist/components/atoms/forms/autocomplete/autocomplete.js +295 -87
  34. package/dist/components/atoms/forms/autocomplete/index.d.ts +6 -0
  35. package/dist/components/atoms/forms/autocomplete/index.d.ts.map +1 -1
  36. package/dist/components/atoms/forms/autocomplete/index.js +3 -0
  37. package/dist/components/atoms/forms/index.d.ts +0 -2
  38. package/dist/components/atoms/forms/index.d.ts.map +1 -1
  39. package/dist/components/atoms/forms/index.js +0 -1
  40. package/dist/components/atoms/forms/input/input.d.ts +2 -2
  41. package/dist/components/atoms/forms/toggle/toggle.d.ts +2 -2
  42. package/dist/components/atoms/layout/sidebar/sidebar.d.ts +2 -2
  43. package/dist/components/atoms/navigation/command/command.d.ts +7 -7
  44. package/dist/components/atoms/navigation/tabs/tabs.js +2 -2
  45. package/dist/components/molecules/auth/auth-navigation-link/auth-navigation-link.d.ts +1 -11
  46. package/dist/components/molecules/auth/auth-navigation-link/auth-navigation-link.d.ts.map +1 -1
  47. package/dist/components/molecules/auth/auth-navigation-link/auth-navigation-link.js +2 -3
  48. package/dist/components/molecules/forms/autocomplete/autocomplete-context.d.ts +16 -0
  49. package/dist/components/molecules/forms/autocomplete/autocomplete-context.d.ts.map +1 -0
  50. package/dist/components/molecules/forms/autocomplete/autocomplete-context.js +14 -0
  51. package/dist/components/molecules/forms/autocomplete/autocomplete-item.d.ts +23 -0
  52. package/dist/components/molecules/forms/autocomplete/autocomplete-item.d.ts.map +1 -0
  53. package/dist/components/molecules/forms/autocomplete/autocomplete-item.js +29 -0
  54. package/dist/components/molecules/forms/autocomplete/autocomplete-section.d.ts +19 -0
  55. package/dist/components/molecules/forms/autocomplete/autocomplete-section.d.ts.map +1 -0
  56. package/dist/components/molecules/forms/autocomplete/autocomplete-section.js +13 -0
  57. package/dist/components/molecules/forms/autocomplete/autocomplete.d.ts +33 -0
  58. package/dist/components/molecules/forms/autocomplete/autocomplete.d.ts.map +1 -0
  59. package/dist/components/molecules/forms/autocomplete/autocomplete.js +101 -0
  60. package/dist/components/molecules/forms/autocomplete/index.d.ts +9 -0
  61. package/dist/components/molecules/forms/autocomplete/index.d.ts.map +1 -0
  62. package/dist/components/molecules/forms/autocomplete/index.js +4 -0
  63. package/dist/components/molecules/forms/item/item.d.ts +3 -3
  64. package/dist/components/molecules/index.d.ts +2 -2
  65. package/dist/components/molecules/index.d.ts.map +1 -1
  66. package/dist/components/molecules/index.js +1 -1
  67. package/dist/components/molecules/navigation/menu-dock/menu-dock.d.ts +5 -0
  68. package/dist/components/molecules/navigation/menu-dock/menu-dock.d.ts.map +1 -1
  69. package/dist/components/molecules/navigation/menu-dock/menu-dock.js +103 -10
  70. package/dist/components/molecules/typography/index.d.ts +0 -2
  71. package/dist/components/molecules/typography/index.d.ts.map +1 -1
  72. package/dist/components/molecules/typography/index.js +1 -1
  73. package/dist/components/organisms/model-selector/model-selector.d.ts +1 -1
  74. package/dist/index.js +460 -498
  75. package/package.json +28 -17
@@ -0,0 +1,16 @@
1
+ import type { ListState } from "@react-stately/list";
2
+ import * as React from "react";
3
+ type CollectionItem = ReturnType<ListState<unknown>["collection"]["getItem"]>;
4
+ export interface AutocompleteItemProps {
5
+ value?: string;
6
+ disabled?: boolean;
7
+ startContent?: React.ReactNode;
8
+ endContent?: React.ReactNode;
9
+ children?: React.ReactNode;
10
+ className?: string;
11
+ item?: NonNullable<CollectionItem>;
12
+ state?: ListState<unknown>;
13
+ }
14
+ declare const AutocompleteItemComponent: React.ForwardRefExoticComponent<AutocompleteItemProps & React.RefAttributes<HTMLLIElement>>;
15
+ export { AutocompleteItemComponent as AutocompleteItem };
16
+ //# sourceMappingURL=autocomplete-item.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"autocomplete-item.d.ts","sourceRoot":"","sources":["../../../../../src/components/atoms/forms/autocomplete/autocomplete-item.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,KAAK,cAAc,GAAG,UAAU,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,YAAY,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;AAE9E,MAAM,WAAW,qBAAqB;IAEpC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC/B,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,IAAI,CAAC,EAAE,WAAW,CAAC,cAAc,CAAC,CAAC;IACnC,KAAK,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;CAC5B;AAED,QAAA,MAAM,yBAAyB,6FAiF9B,CAAC;AAIF,OAAO,EAAE,yBAAyB,IAAI,gBAAgB,EAAE,CAAC"}
@@ -0,0 +1,48 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useOption } from "@react-aria/listbox";
3
+ import { mergeProps } from "@react-aria/utils";
4
+ import { CheckIcon } from "lucide-react";
5
+ import * as React from "react";
6
+ import { cn } from "@/lib/utils";
7
+ import { useAutocompleteContext } from "./autocomplete-context";
8
+ const AutocompleteItemComponent = React.forwardRef(({ className, startContent, endContent, value, disabled, children, item, state, ...props }, ref) => {
9
+ const context = useAutocompleteContext();
10
+ const optionRef = React.useRef(null);
11
+ // Determinar se está usando composição ou API antiga
12
+ const useComposition = value !== undefined || children !== undefined;
13
+ // Sempre usar o contexto para composição, ou state/item para API antiga
14
+ const listStateToUse = useComposition ? context.listState : state;
15
+ const itemKey = useComposition ? value || String(children) : item?.key;
16
+ const isDisabledProp = useComposition ? disabled : item?.props?.isDisabled;
17
+ // Sempre chamar useOption no topo (regra dos hooks)
18
+ // Se não tiver key válido, usar um fallback
19
+ const validKey = itemKey || String(children || value || "");
20
+ const { optionProps: propsFromHook, isSelected: selected, isFocused: focused, isDisabled: disabledState, } = useOption({
21
+ key: validKey,
22
+ isDisabled: isDisabledProp,
23
+ }, listStateToUse, optionRef);
24
+ // Validar se tem os dados necessários
25
+ if (!useComposition && (!item || !state)) {
26
+ throw new Error("AutocompleteItem requires either (value/children) or (item/state)");
27
+ }
28
+ const optionProps = propsFromHook;
29
+ const isSelected = selected;
30
+ const isFocused = focused;
31
+ const isDisabled = disabledState || false;
32
+ const itemChildren = useComposition ? children : item?.props?.children || item?.rendered;
33
+ const mergedRef = React.useMemo(() => {
34
+ if (ref) {
35
+ if (typeof ref === "function") {
36
+ return (node) => {
37
+ ref(node);
38
+ optionRef.current = node;
39
+ };
40
+ }
41
+ return Object.assign(ref, optionRef);
42
+ }
43
+ return optionRef;
44
+ }, [ref]);
45
+ return (_jsxs("li", { ...mergeProps(optionProps, props), ref: mergedRef, className: cn("relative flex w-full cursor-default select-none items-center gap-2 rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none transition-colors", "focus:bg-accent focus:text-accent-foreground", isSelected && "bg-accent text-accent-foreground", isFocused && !isSelected && "bg-accent/50", isDisabled && "pointer-events-none opacity-50", className), children: [startContent && _jsx("span", { className: "shrink-0", children: startContent }), _jsx("span", { className: "flex-1 truncate", children: itemChildren }), endContent && _jsx("span", { className: "shrink-0", children: endContent }), isSelected && (_jsx("span", { className: "absolute right-2 flex size-3.5 items-center justify-center", children: _jsx(CheckIcon, { className: "size-4" }) }))] }));
46
+ });
47
+ AutocompleteItemComponent.displayName = "AutocompleteItem";
48
+ export { AutocompleteItemComponent as AutocompleteItem };
@@ -0,0 +1,14 @@
1
+ import type { ListState } from "@react-stately/list";
2
+ import * as React from "react";
3
+ export interface AutocompleteSectionProps {
4
+ state: ListState<unknown>;
5
+ title?: string;
6
+ "aria-label"?: string;
7
+ children?: React.ReactNode;
8
+ className?: string;
9
+ titleClassName?: string;
10
+ separatorClassName?: string;
11
+ }
12
+ declare const AutocompleteSection: React.ForwardRefExoticComponent<AutocompleteSectionProps & React.RefAttributes<HTMLLIElement>>;
13
+ export { AutocompleteSection };
14
+ //# sourceMappingURL=autocomplete-section.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"autocomplete-section.d.ts","sourceRoot":"","sources":["../../../../../src/components/atoms/forms/autocomplete/autocomplete-section.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,MAAM,WAAW,wBAAwB;IACvC,KAAK,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,QAAA,MAAM,mBAAmB,gGAyCxB,CAAC;AAIF,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useListBoxSection } from "@react-aria/listbox";
3
+ import * as React from "react";
4
+ import { cn } from "@/lib/utils";
5
+ const AutocompleteSection = React.forwardRef(({ state: _state, className, titleClassName, separatorClassName, title, "aria-label": ariaLabel, children, ..._props }, ref) => {
6
+ const { itemProps, headingProps, groupProps } = useListBoxSection({
7
+ heading: title,
8
+ "aria-label": ariaLabel,
9
+ });
10
+ return (_jsxs(_Fragment, { children: [title && (_jsx("li", { className: cn("sticky top-0 z-10 bg-popover px-2 py-1.5 text-xs font-semibold text-muted-foreground", separatorClassName), children: _jsx("div", { ...headingProps, className: cn("truncate", titleClassName), children: title }) })), _jsx("li", { ...itemProps, ref: ref, className: cn("list-none", className), children: _jsx("ul", { ...groupProps, className: "list-none p-0", children: children }) })] }));
11
+ });
12
+ AutocompleteSection.displayName = "AutocompleteSection";
13
+ export { AutocompleteSection };
@@ -1,11 +1,7 @@
1
1
  import * as React from "react";
2
- export interface AutocompleteOption {
3
- value: string;
4
- label: string;
5
- disabled?: boolean;
6
- }
7
- export interface AutocompleteProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "value" | "onChange"> {
8
- options: AutocompleteOption[];
2
+ import { type AutocompleteOption } from "./autocomplete-context";
3
+ export interface AutocompleteProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "value" | "onChange" | "defaultValue"> {
4
+ options?: AutocompleteOption[];
9
5
  value?: string;
10
6
  defaultValue?: string;
11
7
  onValueChange?: (value: string | undefined) => void;
@@ -17,7 +13,15 @@ export interface AutocompleteProps extends Omit<React.InputHTMLAttributes<HTMLIn
17
13
  emptyMessage?: string;
18
14
  filterFunction?: (option: AutocompleteOption, searchTerm: string) => boolean;
19
15
  allowCustomValue?: boolean;
16
+ isLoading?: boolean;
17
+ maxListboxHeight?: string;
18
+ children?: React.ReactNode;
20
19
  }
21
- declare const Autocomplete: React.ForwardRefExoticComponent<AutocompleteProps & React.RefAttributes<HTMLInputElement>>;
22
- export { Autocomplete };
20
+ export declare const Autocomplete: React.ForwardRefExoticComponent<AutocompleteProps & React.RefAttributes<HTMLInputElement>> & {
21
+ List: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLUListElement> & React.RefAttributes<HTMLUListElement>>;
22
+ Empty: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
23
+ Loading: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
24
+ Item: React.ForwardRefExoticComponent<import("./autocomplete-item").AutocompleteItemProps & React.RefAttributes<HTMLLIElement>>;
25
+ };
26
+ export type { AutocompleteOption } from "./autocomplete-context";
23
27
  //# sourceMappingURL=autocomplete.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"autocomplete.d.ts","sourceRoot":"","sources":["../../../../../src/components/atoms/forms/autocomplete/autocomplete.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,iBACf,SAAQ,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,UAAU,CAAC;IACxF,OAAO,EAAE,kBAAkB,EAAE,CAAC;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;IACpD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,IAAI,GAAG,SAAS,GAAG,IAAI,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC;IAC7E,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAMD,QAAA,MAAM,YAAY,4FAiNjB,CAAC;AAIF,OAAO,EAAE,YAAY,EAAE,CAAC"}
1
+ {"version":3,"file":"autocomplete.d.ts","sourceRoot":"","sources":["../../../../../src/components/atoms/forms/autocomplete/autocomplete.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAEL,KAAK,kBAAkB,EAExB,MAAM,wBAAwB,CAAC;AAIhC,MAAM,WAAW,iBACf,SAAQ,IAAI,CACV,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAC3C,MAAM,GAAG,OAAO,GAAG,UAAU,GAAG,cAAc,CAC/C;IAED,OAAO,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;IAEpD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,IAAI,GAAG,SAAS,GAAG,IAAI,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC;IAC7E,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AA0eD,eAAO,MAAM,YAAY;;;;;CAKvB,CAAC;AAEH,YAAY,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC"}
@@ -1,119 +1,327 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import * as PopoverPrimitive from "@radix-ui/react-popover";
3
- import { CheckIcon, ChevronDownIcon, XIcon } from "lucide-react";
3
+ import { useComboBox } from "@react-aria/combobox";
4
+ import { useListBox } from "@react-aria/listbox";
5
+ import { usePopover } from "@react-aria/overlays";
6
+ import { useComboBoxState } from "@react-stately/combobox";
7
+ import { useListState } from "@react-stately/list";
8
+ import { ChevronDownIcon, XIcon } from "lucide-react";
4
9
  import * as React from "react";
5
10
  import { cn } from "@/lib/utils";
6
11
  import { inputVariants } from "../input/input";
12
+ import { AutocompleteContext, useAutocompleteContext, } from "./autocomplete-context";
13
+ import { AutocompleteItem } from "./autocomplete-item";
7
14
  function defaultFilter(option, searchTerm) {
8
15
  return option.label.toLowerCase().includes(searchTerm.toLowerCase());
9
16
  }
10
- const Autocomplete = React.forwardRef(({ options, value: controlledValue, defaultValue, onValueChange, placeholder = "Selecione uma opção...", disabled = false, size = "default", className, inputClassName, emptyMessage = "Nenhum resultado encontrado.", filterFunction = defaultFilter, allowCustomValue = false, id, ...props }, ref) => {
11
- const [open, setOpen] = React.useState(false);
12
- const [inputValue, setInputValue] = React.useState(controlledValue || defaultValue || "");
13
- const [selectedValue, setSelectedValue] = React.useState(controlledValue || defaultValue);
17
+ const AutocompleteRoot = React.forwardRef(({ options = [], value: controlledValue, defaultValue, onValueChange, placeholder = "Selecione uma opção...", disabled = false, size = "default", className, inputClassName, emptyMessage = "Nenhum resultado encontrado.", filterFunction = defaultFilter, allowCustomValue = false, isLoading = false, maxListboxHeight = "300px", children, id, ...props }, ref) => {
14
18
  const isControlled = controlledValue !== undefined;
15
- const currentValue = isControlled ? controlledValue : selectedValue;
16
- const currentInputValue = isControlled ? controlledValue || "" : inputValue;
17
- // Sincroniza o estado interno quando o valor controlado muda
18
- React.useEffect(() => {
19
- if (isControlled) {
20
- setInputValue(controlledValue || "");
21
- }
22
- }, [controlledValue, isControlled]);
19
+ const [selectedKey, setSelectedKey] = React.useState(controlledValue || defaultValue || null);
20
+ const [inputValue, setInputValue] = React.useState("");
21
+ // Filtrar opções baseado no inputValue
23
22
  const filteredOptions = React.useMemo(() => {
24
- if (!currentInputValue.trim()) {
23
+ if (!inputValue.trim()) {
25
24
  return options;
26
25
  }
27
- return options.filter((option) => filterFunction(option, currentInputValue));
28
- }, [options, currentInputValue, filterFunction]);
29
- const selectedOption = React.useMemo(() => {
30
- return options.find((option) => option.value === currentValue);
31
- }, [options, currentValue]);
32
- const handleInputChange = (e) => {
33
- const newValue = e.target.value;
34
- setInputValue(newValue);
35
- setOpen(true);
36
- if (!isControlled) {
37
- // Se não está controlado, atualiza o valor local
38
- if (allowCustomValue) {
39
- setSelectedValue(newValue);
40
- onValueChange?.(newValue);
41
- }
42
- else {
43
- // Se não permite valor customizado, limpa a seleção se não encontrar match exato
44
- const matchingOption = options.find((opt) => opt.label === newValue);
45
- if (matchingOption) {
46
- setSelectedValue(matchingOption.value);
47
- onValueChange?.(matchingOption.value);
26
+ return options.filter((option) => filterFunction(option, inputValue));
27
+ }, [options, inputValue, filterFunction]);
28
+ // Determinar se deve usar composição ou API antiga
29
+ const useComposition = React.useMemo(() => {
30
+ return children !== undefined;
31
+ }, [children]);
32
+ // Função helper para extrair items dos children em modo composição
33
+ const extractItemsFromChildren = React.useCallback((childrenNodes) => {
34
+ const items = [];
35
+ const processChild = (child) => {
36
+ // Ignorar valores primitivos (null, undefined, strings, números, booleanos)
37
+ if (!React.isValidElement(child)) {
38
+ // Se for um Fragment, processar seus children
39
+ if (child === null || child === undefined) {
40
+ return;
48
41
  }
49
- else {
50
- setSelectedValue(undefined);
51
- onValueChange?.(undefined);
42
+ return;
43
+ }
44
+ const props = child.props;
45
+ const componentType = child.type;
46
+ const displayName = componentType?.displayName;
47
+ // Debug: verificar tipo do componente
48
+ if (process.env.NODE_ENV === "development") {
49
+ // biome-ignore lint/suspicious/noConsoleLog: Debug temporário
50
+ console.log("[extractItemsFromChildren] Processing child:", {
51
+ type: typeof componentType,
52
+ displayName,
53
+ hasValue: props.value !== undefined,
54
+ hasTitle: props.title !== undefined,
55
+ hasChildren: props.children !== undefined,
56
+ });
57
+ }
58
+ // Se tiver prop 'value', é um Autocomplete.Item
59
+ if (props.value !== undefined) {
60
+ const value = String(props.value);
61
+ // Extrair o texto dos children (pode ser string, ReactNode, etc)
62
+ let name = value;
63
+ if (props.children !== undefined && props.children !== null) {
64
+ if (typeof props.children === "string") {
65
+ name = props.children;
66
+ }
67
+ else if (typeof props.children === "number") {
68
+ name = String(props.children);
69
+ }
70
+ else if (typeof props.children === "boolean") {
71
+ name = String(props.children);
72
+ }
73
+ else if (React.isValidElement(props.children)) {
74
+ // Se children é um elemento React, tentar extrair texto recursivamente
75
+ const childProps = props.children.props;
76
+ if (typeof childProps?.children === "string") {
77
+ name = childProps.children;
78
+ }
79
+ else {
80
+ name = String(props.children);
81
+ }
82
+ }
83
+ else if (Array.isArray(props.children)) {
84
+ // Se children é um array, processar recursivamente e pegar o primeiro texto encontrado
85
+ React.Children.forEach(props.children, (c) => {
86
+ if (typeof c === "string" && name === value) {
87
+ name = c;
88
+ }
89
+ });
90
+ }
91
+ else {
92
+ name = String(props.children);
93
+ }
52
94
  }
95
+ items.push({
96
+ id: value,
97
+ name,
98
+ disabled: props.disabled,
99
+ });
100
+ return;
53
101
  }
54
- }
55
- else {
56
- // Se está controlado, apenas notifica a mudança
57
- if (allowCustomValue) {
58
- onValueChange?.(newValue);
102
+ // Se tiver prop 'title', é um AutocompleteSection - processar seus children
103
+ if (props.title !== undefined) {
104
+ if (props.children) {
105
+ React.Children.forEach(props.children, processChild);
106
+ }
107
+ return;
59
108
  }
60
- else {
61
- const matchingOption = options.find((opt) => opt.label === newValue);
62
- if (matchingOption) {
63
- onValueChange?.(matchingOption.value);
109
+ // Se tiver children mas não é Item nem Section, pode ser um wrapper (como Autocomplete.List, Fragment, etc)
110
+ // Processar seus children recursivamente
111
+ if (props.children !== undefined && props.children !== null) {
112
+ // Se children é uma string, número ou booleano, não processar (é conteúdo de texto, não componentes)
113
+ if (typeof props.children === "string" || typeof props.children === "number" || typeof props.children === "boolean") {
114
+ // É um componente com conteúdo de texto (como Autocomplete.Loading ou Autocomplete.Empty)
115
+ // Ignorar - não contém items
116
+ return;
117
+ }
118
+ // Se children é um array ou ReactNode, processar recursivamente
119
+ if (Array.isArray(props.children) || React.isValidElement(props.children)) {
120
+ React.Children.forEach(props.children, processChild);
64
121
  }
65
- else {
66
- onValueChange?.(undefined);
122
+ else if (typeof props.children === "object") {
123
+ // Pode ser um Fragment ou outro wrapper
124
+ React.Children.forEach(props.children, processChild);
67
125
  }
126
+ return;
68
127
  }
128
+ // Se chegou aqui, é um componente sem children e sem value (como Autocomplete.Empty ou Autocomplete.Loading vazio)
129
+ // Ignorar esses componentes
130
+ };
131
+ // Processar todos os children, incluindo arrays e Fragments
132
+ React.Children.forEach(childrenNodes, processChild);
133
+ return items;
134
+ }, []);
135
+ // Criar items para o React Aria
136
+ const items = React.useMemo(() => {
137
+ if (useComposition) {
138
+ // Em modo composição, extrair items dos children
139
+ const extractedItems = extractItemsFromChildren(children);
140
+ // Debug temporário: verificar se items foram extraídos
141
+ if (process.env.NODE_ENV === "development") {
142
+ // biome-ignore lint/suspicious/noConsoleLog: Debug temporário
143
+ console.log("[Autocomplete] Children:", children);
144
+ // biome-ignore lint/suspicious/noConsoleLog: Debug temporário
145
+ console.log("[Autocomplete] Extracted items:", extractedItems);
146
+ // biome-ignore lint/suspicious/noConsoleLog: Debug temporário
147
+ console.log("[Autocomplete] Items count:", extractedItems.length);
148
+ }
149
+ return extractedItems;
69
150
  }
70
- };
71
- const handleSelectOption = (optionValue) => {
72
- const option = options.find((opt) => opt.value === optionValue);
73
- if (option && !option.disabled) {
74
- if (!isControlled) {
75
- setSelectedValue(option.value);
151
+ return filteredOptions.map((option) => ({
152
+ id: option.value,
153
+ name: option.label,
154
+ disabled: option.disabled,
155
+ }));
156
+ }, [filteredOptions, useComposition, children, extractItemsFromChildren]);
157
+ // Estado do combobox
158
+ const state = useComboBoxState({
159
+ items,
160
+ selectedKey: selectedKey ?? undefined,
161
+ onSelectionChange: (key) => {
162
+ setSelectedKey(key ? String(key) : null);
163
+ onValueChange?.(key ? String(key) : undefined);
164
+ },
165
+ inputValue,
166
+ onInputChange: setInputValue,
167
+ allowsCustomValue: allowCustomValue,
168
+ isDisabled: disabled,
169
+ defaultSelectedKey: defaultValue ? defaultValue : undefined,
170
+ });
171
+ // Sincronizar com valor controlado
172
+ React.useEffect(() => {
173
+ if (isControlled && controlledValue !== undefined) {
174
+ const option = options.find((opt) => opt.value === controlledValue);
175
+ if (option) {
176
+ setSelectedKey(controlledValue);
76
177
  setInputValue(option.label);
77
178
  }
78
- onValueChange?.(option.value);
79
- setOpen(false);
179
+ else {
180
+ setSelectedKey(null);
181
+ setInputValue(controlledValue);
182
+ }
80
183
  }
81
- };
184
+ }, [isControlled, controlledValue, options]);
185
+ // Sincronizar inputValue quando seleção muda (apenas para API antiga)
186
+ React.useEffect(() => {
187
+ if (!useComposition && state.selectedKey) {
188
+ const option = options.find((opt) => opt.value === state.selectedKey);
189
+ if (option && state.inputValue !== option.label) {
190
+ state.setInputValue(option.label);
191
+ }
192
+ }
193
+ }, [state.selectedKey, options, state, useComposition]);
194
+ // Refs
195
+ const inputRef = React.useRef(null);
196
+ const listBoxRef = React.useRef(null);
197
+ const popoverRef = React.useRef(null);
198
+ const mergedInputRef = React.useMemo(() => {
199
+ if (ref) {
200
+ if (typeof ref === "function") {
201
+ return (node) => {
202
+ ref(node);
203
+ inputRef.current = node;
204
+ };
205
+ }
206
+ return Object.assign(ref, inputRef);
207
+ }
208
+ return inputRef;
209
+ }, [ref]);
210
+ // Hooks do React Aria
211
+ const { inputProps, listBoxProps } = useComboBox({
212
+ ...props,
213
+ inputRef: mergedInputRef,
214
+ listBoxRef,
215
+ popoverRef,
216
+ isDisabled: disabled,
217
+ placeholder,
218
+ }, state);
219
+ const listState = useListState({
220
+ items,
221
+ selectedKeys: state.selectedKey ? [state.selectedKey] : [],
222
+ });
223
+ const { listBoxProps: listBoxPropsMerged } = useListBox({
224
+ ...listBoxProps,
225
+ autoFocus: state.focusStrategy ?? undefined,
226
+ shouldSelectOnPressUp: true,
227
+ }, listState, listBoxRef);
228
+ const { popoverProps } = usePopover({
229
+ popoverRef,
230
+ triggerRef: mergedInputRef,
231
+ placement: "bottom start",
232
+ offset: 4,
233
+ }, state);
234
+ // Handler para limpar
82
235
  const handleClear = (e) => {
83
236
  e.stopPropagation();
84
237
  e.preventDefault();
85
- if (!isControlled) {
86
- setSelectedValue(undefined);
87
- setInputValue("");
88
- }
238
+ state.setSelectedKey(null);
239
+ state.setInputValue("");
89
240
  onValueChange?.(undefined);
90
- setOpen(false);
91
241
  };
92
- const handleInputFocus = () => {
93
- if (!disabled) {
94
- setOpen(true);
242
+ // Valor de exibição
243
+ const displayValue = React.useMemo(() => {
244
+ if (useComposition) {
245
+ // Em modo composição, usar inputValue diretamente
246
+ return state.inputValue;
95
247
  }
248
+ // Em modo API antiga, buscar label da opção
249
+ if (state.selectedKey) {
250
+ const option = options.find((opt) => opt.value === state.selectedKey);
251
+ return option?.label || state.inputValue;
252
+ }
253
+ return state.inputValue;
254
+ }, [state.selectedKey, state.inputValue, options, useComposition]);
255
+ const contextValue = {
256
+ state,
257
+ listState,
258
+ inputRef: mergedInputRef,
259
+ listBoxRef: listBoxRef,
260
+ popoverRef: popoverRef,
261
+ inputProps,
262
+ listBoxProps: listBoxPropsMerged,
263
+ popoverProps,
264
+ handleClear,
265
+ size,
266
+ disabled,
267
+ maxListboxHeight,
268
+ isLoading,
269
+ emptyMessage,
270
+ options: useComposition ? undefined : filteredOptions,
96
271
  };
97
- const handleInputBlur = () => {
98
- // Delay para permitir clique no item
99
- setTimeout(() => {
100
- if (!allowCustomValue && selectedOption) {
101
- // Restaura o label do item selecionado se não permite valor customizado
102
- if (!isControlled) {
103
- setInputValue(selectedOption.label);
104
- }
105
- }
106
- setOpen(false);
107
- }, 200);
108
- };
109
- const displayValue = selectedOption?.label || currentInputValue;
110
- return (_jsx(PopoverPrimitive.Root, { open: open, onOpenChange: setOpen, children: _jsxs("div", { className: cn("relative w-full", className), children: [_jsx(PopoverPrimitive.Trigger, { asChild: true, children: _jsx("input", { ref: ref, id: id, value: displayValue, onChange: handleInputChange, onFocus: handleInputFocus, onBlur: handleInputBlur, placeholder: placeholder, disabled: disabled, className: cn(inputVariants({ size }), "pr-8", inputClassName), ...props }) }), _jsxs("div", { className: "absolute right-2 top-1/2 -translate-y-1/2 flex items-center gap-1 pointer-events-none", children: [currentValue && !disabled && (_jsxs("button", { type: "button", onClick: handleClear, onMouseDown: (e) => {
272
+ return (_jsx(AutocompleteContext.Provider, { value: contextValue, children: _jsx("div", { className: cn("relative w-full", className), children: _jsxs(PopoverPrimitive.Root, { open: state.isOpen, onOpenChange: state.setOpen, children: [_jsx(PopoverPrimitive.Trigger, { asChild: true, children: _jsxs("div", { className: "relative", children: [_jsx("input", { ...inputProps, ...props, ref: mergedInputRef, id: id, value: displayValue, onChange: (e) => {
273
+ setInputValue(e.target.value);
274
+ state.setInputValue(e.target.value);
275
+ state.open();
276
+ }, className: cn(inputVariants({ size }), "pr-8", inputClassName), disabled: disabled }), _jsxs("div", { className: "absolute right-2 top-1/2 -translate-y-1/2 flex items-center gap-1 pointer-events-none", children: [state.selectedKey && !disabled && (_jsxs("button", { type: "button", onClick: handleClear, onMouseDown: (e) => {
277
+ e.preventDefault();
278
+ e.stopPropagation();
279
+ }, className: "text-muted-foreground hover:text-foreground rounded-sm p-1 opacity-70 hover:opacity-100 transition-opacity focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring pointer-events-auto", children: [_jsx(XIcon, { className: "size-4" }), _jsx("span", { className: "sr-only", children: "Limpar" })] })), _jsx(ChevronDownIcon, { className: cn("size-4 text-muted-foreground transition-transform", state.isOpen && "rotate-180") })] })] }) }), _jsx(PopoverPrimitive.Portal, { children: _jsx(PopoverPrimitive.Content, { ...popoverProps, ref: popoverRef, className: cn("bg-popover text-popover-foreground", "data-[state=open]:animate-in data-[state=closed]:animate-out", "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", "data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95", "data-[side=bottom]:slide-in-from-top-2", "data-[side=left]:slide-in-from-right-2", "data-[side=right]:slide-in-from-left-2", "data-[side=top]:slide-in-from-bottom-2", "relative z-50", "min-w-(--radix-popover-trigger-width) w-full", "overflow-hidden rounded-md border shadow-md"), style: {
280
+ maxHeight: maxListboxHeight,
281
+ ...popoverProps.style,
282
+ }, align: "start", sideOffset: 4, onOpenAutoFocus: (e) => {
111
283
  e.preventDefault();
112
- e.stopPropagation();
113
- }, className: "text-muted-foreground hover:text-foreground rounded-sm p-1 opacity-70 hover:opacity-100 transition-opacity focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring pointer-events-auto", children: [_jsx(XIcon, { className: "size-4" }), _jsx("span", { className: "sr-only", children: "Limpar" })] })), _jsx(ChevronDownIcon, { className: cn("size-4 text-muted-foreground transition-transform", open && "rotate-180") })] }), _jsx(PopoverPrimitive.Portal, { children: _jsx(PopoverPrimitive.Content, { className: cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-[300px] min-w-(--radix-popover-trigger-width) w-full overflow-x-hidden overflow-y-auto rounded-md border shadow-md"), align: "start", sideOffset: 4, onOpenAutoFocus: (e) => {
114
- // Previne o foco automático no popover, mantendo o foco no input
115
- e.preventDefault();
116
- }, children: filteredOptions.length > 0 ? (_jsx("div", { className: "p-1", children: filteredOptions.map((option) => (_jsxs("button", { type: "button", onClick: () => handleSelectOption(option.value), disabled: option.disabled, className: cn("focus:bg-accent focus:text-accent-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none transition-colors", currentValue === option.value && "bg-accent text-accent-foreground", option.disabled && "pointer-events-none opacity-50"), children: [_jsx("span", { className: "absolute right-2 flex size-3.5 items-center justify-center", children: currentValue === option.value && _jsx(CheckIcon, { className: "size-4" }) }), option.label] }, option.value))) })) : (_jsx("div", { className: "py-6 text-center text-sm text-muted-foreground", children: emptyMessage })) }) })] }) }));
284
+ }, children: _jsx("div", { className: "overflow-y-auto overflow-x-hidden", style: { maxHeight: maxListboxHeight }, children: useComposition ? (children) : isLoading ? (_jsx("div", { className: "py-6 text-center text-sm text-muted-foreground", children: "Carregando..." })) : filteredOptions.length > 0 ? (_jsx("ul", { ...listBoxPropsMerged, ref: listBoxRef, className: "p-1 outline-none", children: Array.from(listState.collection).map((item) => {
285
+ return _jsx(AutocompleteItem, { item: item, state: listState }, item.key);
286
+ }) })) : (_jsx("div", { className: "py-6 text-center text-sm text-muted-foreground", children: emptyMessage })) }) }) })] }) }) }));
287
+ });
288
+ AutocompleteRoot.displayName = "Autocomplete";
289
+ // Subcomponentes para composição
290
+ const AutocompleteList = React.forwardRef(({ className, children, ...props }, ref) => {
291
+ const { listBoxProps, listBoxRef } = useAutocompleteContext();
292
+ const mergedRef = React.useMemo(() => {
293
+ if (ref) {
294
+ if (typeof ref === "function") {
295
+ return (node) => {
296
+ ref(node);
297
+ if (listBoxRef.current !== node) {
298
+ listBoxRef.current = node;
299
+ }
300
+ };
301
+ }
302
+ return Object.assign(ref, listBoxRef);
303
+ }
304
+ return listBoxRef;
305
+ }, [ref, listBoxRef]);
306
+ return (_jsx("ul", { ...listBoxProps, ...props, ref: mergedRef, className: cn("p-1 outline-none", className), children: children }));
307
+ });
308
+ AutocompleteList.displayName = "AutocompleteList";
309
+ const AutocompleteEmpty = React.forwardRef(({ className, children, ...props }, ref) => {
310
+ const { emptyMessage } = useAutocompleteContext();
311
+ return (_jsx("div", { ref: ref, ...props, className: cn("py-6 text-center text-sm text-muted-foreground", className), children: children || emptyMessage }));
312
+ });
313
+ AutocompleteEmpty.displayName = "AutocompleteEmpty";
314
+ const AutocompleteLoading = React.forwardRef(({ className, children, ...props }, ref) => {
315
+ const { isLoading } = useAutocompleteContext();
316
+ if (!isLoading)
317
+ return null;
318
+ return (_jsx("div", { ref: ref, ...props, className: cn("py-6 text-center text-sm text-muted-foreground", className), children: children || "Carregando..." }));
319
+ });
320
+ AutocompleteLoading.displayName = "AutocompleteLoading";
321
+ // Exportar componente composto
322
+ export const Autocomplete = Object.assign(AutocompleteRoot, {
323
+ List: AutocompleteList,
324
+ Empty: AutocompleteEmpty,
325
+ Loading: AutocompleteLoading,
326
+ Item: AutocompleteItem,
117
327
  });
118
- Autocomplete.displayName = "Autocomplete";
119
- export { Autocomplete };
@@ -1,3 +1,9 @@
1
1
  export type { AutocompleteOption, AutocompleteProps } from "./autocomplete";
2
2
  export { Autocomplete } from "./autocomplete";
3
+ export type { AutocompleteContextValue } from "./autocomplete-context";
4
+ export { useAutocompleteContext } from "./autocomplete-context";
5
+ export type { AutocompleteItemProps } from "./autocomplete-item";
6
+ export { AutocompleteItem } from "./autocomplete-item";
7
+ export type { AutocompleteSectionProps } from "./autocomplete-section";
8
+ export { AutocompleteSection } from "./autocomplete-section";
3
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/atoms/forms/autocomplete/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/atoms/forms/autocomplete/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AACvE,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,YAAY,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,YAAY,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC"}
@@ -1 +1,4 @@
1
1
  export { Autocomplete } from "./autocomplete";
2
+ export { useAutocompleteContext } from "./autocomplete-context";
3
+ export { AutocompleteItem } from "./autocomplete-item";
4
+ export { AutocompleteSection } from "./autocomplete-section";
@@ -1,5 +1,3 @@
1
- export type { AutocompleteOption, AutocompleteProps } from "./autocomplete";
2
- export { Autocomplete } from "./autocomplete";
3
1
  export type { CheckboxProps } from "./checkbox";
4
2
  export { Checkbox } from "./checkbox";
5
3
  export type { FieldContentProps, FieldDescriptionProps, FieldErrorProps, FieldGroupProps, FieldLabelProps, FieldLegendProps, FieldProps, FieldSeparatorProps, FieldSetProps, FieldTitleProps, } from "./field";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/forms/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,YAAY,EACV,iBAAiB,EACjB,qBAAqB,EACrB,eAAe,EACf,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,UAAU,EACV,mBAAmB,EACnB,aAAa,EACb,eAAe,GAChB,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,KAAK,EACL,YAAY,EACZ,gBAAgB,EAChB,UAAU,EACV,UAAU,EACV,UAAU,EACV,WAAW,EACX,cAAc,EACd,QAAQ,EACR,UAAU,GACX,MAAM,SAAS,CAAC;AACjB,YAAY,EACV,gBAAgB,EAChB,oBAAoB,EACpB,cAAc,EACd,aAAa,EACb,cAAc,EACd,gBAAgB,GACjB,MAAM,QAAQ,CAAC;AAChB,OAAO,EACL,IAAI,EACJ,WAAW,EACX,eAAe,EACf,SAAS,EACT,QAAQ,EACR,SAAS,EACT,WAAW,EACX,YAAY,GACb,MAAM,QAAQ,CAAC;AAChB,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC/C,YAAY,EACV,kBAAkB,EAClB,aAAa,EACb,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACvF,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,YAAY,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,EACL,MAAM,EACN,aAAa,EACb,WAAW,EACX,UAAU,EACV,WAAW,EACX,sBAAsB,EACtB,oBAAoB,EACpB,eAAe,EACf,aAAa,EACb,WAAW,GACZ,MAAM,UAAU,CAAC;AAClB,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/forms/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,YAAY,EACV,iBAAiB,EACjB,qBAAqB,EACrB,eAAe,EACf,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,UAAU,EACV,mBAAmB,EACnB,aAAa,EACb,eAAe,GAChB,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,KAAK,EACL,YAAY,EACZ,gBAAgB,EAChB,UAAU,EACV,UAAU,EACV,UAAU,EACV,WAAW,EACX,cAAc,EACd,QAAQ,EACR,UAAU,GACX,MAAM,SAAS,CAAC;AACjB,YAAY,EACV,gBAAgB,EAChB,oBAAoB,EACpB,cAAc,EACd,aAAa,EACb,cAAc,EACd,gBAAgB,GACjB,MAAM,QAAQ,CAAC;AAChB,OAAO,EACL,IAAI,EACJ,WAAW,EACX,eAAe,EACf,SAAS,EACT,QAAQ,EACR,SAAS,EACT,WAAW,EACX,YAAY,GACb,MAAM,QAAQ,CAAC;AAChB,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC/C,YAAY,EACV,kBAAkB,EAClB,aAAa,EACb,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACvF,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,YAAY,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,EACL,MAAM,EACN,aAAa,EACb,WAAW,EACX,UAAU,EACV,WAAW,EACX,sBAAsB,EACtB,oBAAoB,EACpB,eAAe,EACf,aAAa,EACb,WAAW,GACZ,MAAM,UAAU,CAAC;AAClB,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC"}
@@ -1,4 +1,3 @@
1
- export { Autocomplete } from "./autocomplete";
2
1
  export { Checkbox } from "./checkbox";
3
2
  export { Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, } from "./field";
4
3
  export { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, useFormField, } from "./form";
@@ -1,8 +1,8 @@
1
1
  import { type VariantProps } from "class-variance-authority";
2
2
  import React from "react";
3
3
  declare const inputVariants: (props?: ({
4
- size?: "default" | "sm" | "lg" | null | undefined;
5
- variant?: "default" | "success" | "error" | null | undefined;
4
+ size?: "sm" | "default" | "lg" | null | undefined;
5
+ variant?: "default" | "error" | "success" | null | undefined;
6
6
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
7
  export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "size">, VariantProps<typeof inputVariants> {
8
8
  label?: string;