@stihl-design-system/components
Version:
Welcome to the STIHL Design System react component library.
73 lines (72 loc) • 3.31 kB
JavaScript
"use client";
import { jsxs as L, jsx as I } from "react/jsx-runtime";
import { d as R } from "./chunks/index.CgTHIF3K.js";
import { c as O } from "./chunks/index.CEyLAtio.js";
import { D as $ } from "./chunks/Icon.DGTYCv63.js";
import { DSSpinner as q } from "./spinner.Dht6FspZ.js";
import { forwardRef as G } from "react";
import './assets/floatingactionbutton.l0nvFiJU.css';const J = "ds-floating-action-button_root_1any0_1", K = "ds-floating-action-button_root--dark_1any0_70", M = "ds-floating-action-button_root--small_1any0_108", P = "ds-floating-action-button_loader_1any0_129", Q = "ds-floating-action-button_icon--hidden_1any0_141", T = "ds-floating-action-button_label--hidden_1any0_145", e = {
root: J,
rootDark: K,
rootSmall: M,
loader: P,
iconHidden: Q,
labelHidden: T
}, U = G((v, C) => {
const t = R.c(43);
let n, i, s, l, a, c, f, _, b, u, p;
t[0] !== v ? ({
aria: n,
children: i,
className: s,
disabled: f,
iconName: _,
iconSource: l,
loading: b,
size: u,
theme: p,
onClick: a,
...c
} = v, t[0] = v, t[1] = n, t[2] = i, t[3] = s, t[4] = l, t[5] = a, t[6] = c, t[7] = f, t[8] = _, t[9] = b, t[10] = u, t[11] = p) : (n = t[1], i = t[2], s = t[3], l = t[4], a = t[5], c = t[6], f = t[7], _ = t[8], b = t[9], u = t[10], p = t[11]);
const g = f === void 0 ? !1 : f, y = _ === void 0 ? "placeholder" : _, o = b === void 0 ? !1 : b, E = u === void 0 ? "medium" : u, h = p === void 0 ? "light" : p, x = h === "dark", j = E === "small";
let S;
t[12] !== s || t[13] !== x || t[14] !== j ? (S = O(e.root, e.rootIconOnlySmall, s, {
[e.rootDark]: x,
[e.rootSmall]: j
}), t[12] = s, t[13] = x, t[14] = j, t[15] = S) : S = t[15];
const z = S;
let D;
t[16] !== o ? (D = O(e.icon, {
[e.iconHidden]: o
}), t[16] = o, t[17] = D) : D = t[17];
const A = D;
let N;
t[18] !== g || t[19] !== o || t[20] !== a ? (N = (w) => {
if (g || o) {
w.preventDefault();
return;
}
a && a(w);
}, t[18] = g, t[19] = o, t[20] = a, t[21] = N) : N = t[21];
const B = N, F = g || o;
let r;
t[22] !== o ? (r = o && /* @__PURE__ */ I(q, { className: e.loader, aria: {
"aria-label": "Loading state"
} }), t[22] = o, t[23] = r) : r = t[23];
let k;
t[24] === Symbol.for("react.memo_cache_sentinel") ? (k = O(e.label, e.labelHidden), t[24] = k) : k = t[24];
let d;
t[25] !== i ? (d = /* @__PURE__ */ I("span", { className: k, children: i }), t[25] = i, t[26] = d) : d = t[26];
let m;
t[27] !== A || t[28] !== y || t[29] !== l || t[30] !== h ? (m = (y || l) && /* @__PURE__ */ I($, { name: y, theme: h, source: l, className: A, "aria-hidden": "true" }), t[27] = A, t[28] = y, t[29] = l, t[30] = h, t[31] = m) : m = t[31];
let H;
return t[32] !== n || t[33] !== B || t[34] !== o || t[35] !== C || t[36] !== c || t[37] !== z || t[38] !== F || t[39] !== r || t[40] !== d || t[41] !== m ? (H = /* @__PURE__ */ L("button", { className: z, type: "button", onClick: B, ...n, ...c, "aria-disabled": F, "aria-busy": o, ref: C, children: [
r,
d,
m
] }), t[32] = n, t[33] = B, t[34] = o, t[35] = C, t[36] = c, t[37] = z, t[38] = F, t[39] = r, t[40] = d, t[41] = m, t[42] = H) : H = t[42], H;
});
U.displayName = "DSFloatingActionButton";
export {
U as DSFloatingActionButton
};