Updateing Docs
This commit is contained in:
@@ -1,15 +1,26 @@
|
||||
// components/Fab.js
|
||||
import { $html } from "sigpro";
|
||||
import { val } from "../core/utils.js";
|
||||
import { val, ui, getIcon } from "../core/utils.js";
|
||||
|
||||
/** FAB (Floating Action Button) */
|
||||
/**
|
||||
* Fab (Floating Action Button) component
|
||||
*
|
||||
* daisyUI classes used:
|
||||
* - btn, btn-lg, btn-circle, btn-primary
|
||||
* - shadow-2xl, shadow-lg
|
||||
* - badge, badge-ghost, shadow-sm, whitespace-nowrap
|
||||
* - absolute, flex, flex-col-reverse, items-end, gap-3
|
||||
* - z-100, transition-all, duration-300
|
||||
* - bottom-6, right-6, top-6, left-6
|
||||
*/
|
||||
export const Fab = (props) => {
|
||||
const { icon, label, actions = [], position = "bottom-6 right-6", class: className = "", ...rest } = props;
|
||||
const { class: className, icon, label, actions = [], position = "bottom-6 right-6", ...rest } = props;
|
||||
|
||||
return $html(
|
||||
"div",
|
||||
{
|
||||
...rest,
|
||||
class: `fab absolute ${position} flex flex-col-reverse items-end gap-3 z-[100] ${className}`,
|
||||
class: ui(`fab absolute ${position} flex flex-col-reverse items-end gap-3 z-[100]`, className),
|
||||
},
|
||||
[
|
||||
$html(
|
||||
@@ -20,7 +31,7 @@ export const Fab = (props) => {
|
||||
class: "btn btn-lg btn-circle btn-primary shadow-2xl",
|
||||
},
|
||||
[
|
||||
icon ? (typeof icon === "function" ? icon() : icon) : null,
|
||||
icon ? getIcon(icon) : null,
|
||||
!icon && label ? label : null
|
||||
],
|
||||
),
|
||||
@@ -38,7 +49,7 @@ export const Fab = (props) => {
|
||||
act.onclick?.(e);
|
||||
},
|
||||
},
|
||||
[act.icon ? (typeof act.icon === "function" ? act.icon() : act.icon) : act.text || ""],
|
||||
[act.icon ? getIcon(act.icon) : act.text || ""],
|
||||
),
|
||||
]),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user