{"version":3,"file":"FloatingActionButton.cjs","names":[],"sources":["../../../src/components/FloatingActionButton/FloatingActionButton.tsx"],"sourcesContent":["import type { ButtonHTMLAttributes, ReactNode } from \"react\";\nimport { cn } from \"@/utils/cn\";\nimport styles from \"./FloatingActionButton.module.css\";\n\nexport type FloatingActionButtonPosition = \"bottom-right\" | \"bottom-left\" | \"none\";\nexport type FloatingActionButtonSize = \"sm\" | \"md\" | \"lg\";\nexport type FloatingActionButtonVariant = \"primary\" | \"surface\";\n\nexport interface FloatingActionButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n    /** Icon rendered inside the FAB. Required. */\n    icon: ReactNode;\n    /** When present, renders an extended (pill) FAB with icon + label. */\n    label?: ReactNode;\n    /** Corner placement, or `\"none\"` for static/inline. Default `\"bottom-right\"`. */\n    position?: FloatingActionButtonPosition;\n    /** Size token. Default `\"md\"`. */\n    size?: FloatingActionButtonSize;\n    /** Visual style. Default `\"primary\"`. */\n    variant?: FloatingActionButtonVariant;\n    /** Extra class names merged onto the root. */\n    className?: string;\n}\n\n/**\n * Material Floating Action Button. Renders a round FAB when only an `icon` is\n * given, or an extended pill FAB when a `label` is also provided. By default it\n * is fixed to the bottom-right corner; set `position=\"none\"` to place it inline.\n *\n * Spreads all native `<button>` props (`onClick`, `disabled`, etc.).\n *\n * @remarks\n * Always pass an `aria-label` when there is no `label`, since an icon-only FAB\n * has no accessible name otherwise.\n *\n * @example\n * <FloatingActionButton icon={<Plus />} aria-label=\"Adicionar\" onClick={create} />\n *\n * @example\n * <FloatingActionButton icon={<Plus />} label=\"Novo\" onClick={create} />\n */\nexport function FloatingActionButton({\n    icon,\n    label,\n    position = \"bottom-right\",\n    size = \"md\",\n    variant = \"primary\",\n    className,\n    ...props\n}: FloatingActionButtonProps) {\n    const extended = label !== undefined;\n    return (\n        <button\n            type=\"button\"\n            className={cn(\n                styles.fab,\n                styles[size],\n                styles[variant],\n                extended ? styles.extended : styles.round,\n                position !== \"none\" && styles.fixed,\n                position === \"bottom-right\" && styles.bottomRight,\n                position === \"bottom-left\" && styles.bottomLeft,\n                className,\n            )}\n            {...props}\n        >\n            <span className={styles.icon}>{icon}</span>\n            {extended && <span className={styles.label}>{label}</span>}\n        </button>\n    );\n}\n"],"mappings":"wHAwCA,SAAgB,EAAqB,CACjC,OACA,QACA,WAAW,eACX,OAAO,KACP,UAAU,UACV,YACA,GAAG,GACuB,CAC1B,IAAM,EAAW,IAAU,IAAA,GAC3B,OACI,EAAA,EAAA,KAAA,CAAC,SAAD,CACI,KAAK,SACL,UAAW,EAAA,GACP,EAAA,QAAO,IACP,EAAA,QAAO,GACP,EAAA,QAAO,GACP,EAAW,EAAA,QAAO,SAAW,EAAA,QAAO,MACpC,IAAa,QAAU,EAAA,QAAO,MAC9B,IAAa,gBAAkB,EAAA,QAAO,YACtC,IAAa,eAAiB,EAAA,QAAO,WACrC,CACJ,EACA,GAAI,EAZR,SAAA,EAcI,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAW,EAAA,QAAO,KAAO,SAAA,CAAW,CAAA,EACzC,IAAY,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAW,EAAA,QAAO,MAAQ,SAAA,CAAY,CAAA,CACrD,GAEhB"}