UNPKG

fui-fancyui

Version:
57 lines (56 loc) 1.74 kB
"use client"; import { jsxs as C, jsx as e } from "react/jsx-runtime"; import z from "../../atoms/Typography/Typography.js"; import { calcPostionToFlex as T } from "./utils/calcPostionToFlex.js"; import A from "../../templates/FancyFlexBox/FancyFlexBox.js"; import { ButtonStyle as k } from "./ActionItem.style.js"; import { sizeSettings as r } from "./sizeSettings.js"; import B from "../../atoms/DisableBox/DisabledBox.js"; import F from "../../atoms/FancySVGAtom/FancySVGAtom.js"; function q(m) { const { label: t, icon: s, layer: d = 0, size: o = "md", isActive: i = !1, isClickable: p = !0, labelAlign: u = "left", themeType: l = "primary", themeTypeActiveHover: n = "accent", backgroundState: h, outlinedBackgroundStrength: v, hoverColor: f, outlined: x, disabled: a, textColor: g, textHover: y, useSimpleTextColor: S, hideLabel: c, ...$ } = m, b = i ? "active" : "hover"; return /* @__PURE__ */ C(A, { direction: T(u ?? "left"), align: "center", gap: "8px", ...$, children: [ t && !c && /* @__PURE__ */ e(B, { disabled: a, children: /* @__PURE__ */ e(z, { variant: r[o].fontSize, children: t }) }), /* @__PURE__ */ e( k, { "aria-label": c ? t : void 0, $disabled: a, $size: r[o].size, $layer: d, $outlined: x, $textColor: g, $textHover: y, $useSimpleTextColor: S, $outlinedBackgroundStrength: v, $themeType: i ? n : l, $hoverColor: f || i ? n : l, $backgroundState: h || (p ? b : "active"), children: /* @__PURE__ */ e(F, { isPassive: !0, sizeC: r[o].iconSize, children: s }) } ) ] }); } export { q as default };