fui-fancyui
Version:
FancyUI Libary
65 lines (64 loc) • 1.78 kB
JavaScript
"use client";
import { jsx as n, jsxs as x } from "react/jsx-runtime";
import { css as B } from "styled-components";
import S from "../../atoms/LoadingSVGArrows/LoadingSVGArrows.js";
import h from "../../molecules/Button/Button.js";
import r from "../../molecules/FancyContent/FancyContent.js";
import { generateFancyButton as z } from "./FancyButton.style.js";
import C from "../../../design/designFunctions/leftRightCenterToFlexJustify/leftRightCenterToFlexJustify.js";
import { sizeSettings as f } from "./sizeSettings.js";
function w(d) {
const {
icon: o,
label: t,
isLoading: i,
iconAlign: l = "right",
sizeC: e = "md",
align: a = "center",
externalStyle: u,
oneToOne: g,
outlined: c,
noSize: p,
outlinedRemoveBorder: s,
...m
} = d, y = l === "left" ? "left" : "right", $ = z({
$iconAlign: l,
$icon: !!o,
$sizeC: e,
$oneToOne: g ?? (!t && !!o),
$justifyContent: C[a ?? "center"],
$outlined: c,
$noSize: p,
$removeBorder: s
});
return /* @__PURE__ */ n(
h,
{
sizeC: e,
noSize: !0,
outlined: c,
outlinedRemoveBorder: s,
externalStyle: B`
${$};
${u};
`,
...m,
children: /* @__PURE__ */ x(
r,
{
justify: a,
layoutMode: "normal",
alignIcon: y,
gapBetweenIcon: f[e].gap,
children: [
t && /* @__PURE__ */ n(r.Title, { fontVariant: f[e ?? "md"].fontSize, themeType: m.textColor, children: t }),
(i || o) && /* @__PURE__ */ n(r.Icon, { sizeC: e === "xs" ? "sm" : e === "xl" ? "lg" : e, noPadding: !0, children: i ? /* @__PURE__ */ n(S, { isLoading: i }) : o })
]
}
)
}
);
}
export {
w as default
};