UNPKG

@stihl-design-system/components

Version:

Welcome to the STIHL Design System react component library.

88 lines (87 loc) 3.87 kB
"use client"; import { jsxs as q, jsx as S } from "react/jsx-runtime"; import { d as J } from "./chunks/index.D-sRdssb.js"; import { c as T } from "./chunks/index.DL9mof6u.js"; import { D as K } from "./chunks/Icon.CDLyB7Pv.js"; import { DSSpinner as M } from "./spinner.C9qCeq0R.js"; import { Tooltip as $ } from "./tooltip.Cj3AvYgB.js"; import { forwardRef as P } from "react"; import './assets/floatingactionbutton.l0nvFiJU.css';const Q = "ds-floating-action-button_root_1any0_1", U = "ds-floating-action-button_root--dark_1any0_70", V = "ds-floating-action-button_root--small_1any0_108", W = "ds-floating-action-button_loader_1any0_129", X = "ds-floating-action-button_icon--hidden_1any0_141", Y = "ds-floating-action-button_label--hidden_1any0_145", l = { root: Q, rootDark: U, rootSmall: V, loader: W, iconHidden: X, labelHidden: Y }, Z = P((z, B) => { const t = J.c(51); let s, r, c, n, i, d, p, _, h, g, y, a; t[0] !== z ? ({ aria: s, children: r, className: c, disabled: p, iconName: _, iconSource: n, loading: h, size: g, theme: y, tooltip: a, onClick: i, ...d } = z, t[0] = z, t[1] = s, t[2] = r, t[3] = c, t[4] = n, t[5] = i, t[6] = d, t[7] = p, t[8] = _, t[9] = h, t[10] = g, t[11] = y, t[12] = a) : (s = t[1], r = t[2], c = t[3], n = t[4], i = t[5], d = t[6], p = t[7], _ = t[8], h = t[9], g = t[10], y = t[11], a = t[12]); const D = p === void 0 ? !1 : p, N = _ === void 0 ? "placeholder" : _, o = h === void 0 ? !1 : h, G = g === void 0 ? "medium" : g, k = y === void 0 ? "light" : y, E = k === "dark", F = G === "small"; let C; t[13] !== c || t[14] !== E || t[15] !== F ? (C = T(l.root, l.rootIconOnlySmall, c, { [l.rootDark]: E, [l.rootSmall]: F }), t[13] = c, t[14] = E, t[15] = F, t[16] = C) : C = t[16]; const I = C; let H; t[17] !== o ? (H = T(l.icon, { [l.iconHidden]: o }), t[17] = o, t[18] = H) : H = t[18]; const w = H; let v; t[19] !== D || t[20] !== o || t[21] !== i ? (v = (e) => { if (D || o) { e.preventDefault(); return; } i && i(e); }, t[19] = D, t[20] = o, t[21] = i, t[22] = v) : v = t[22]; const L = v, R = D || o; let m; t[23] !== o ? (m = o && /* @__PURE__ */ S(M, { className: l.loader, aria: { "aria-label": "Loading state" } }), t[23] = o, t[24] = m) : m = t[24]; let x; t[25] === Symbol.for("react.memo_cache_sentinel") ? (x = T(l.label, l.labelHidden), t[25] = x) : x = t[25]; let f; t[26] !== r ? (f = /* @__PURE__ */ S("span", { className: x, children: r }), t[26] = r, t[27] = f) : f = t[27]; let u; t[28] !== w || t[29] !== N || t[30] !== n || t[31] !== k ? (u = (N || n) && /* @__PURE__ */ S(K, { name: N, theme: k, source: n, className: w, "aria-hidden": "true" }), t[28] = w, t[29] = N, t[30] = n, t[31] = k, t[32] = u) : u = t[32]; let A; t[33] !== s || t[34] !== L || t[35] !== o || t[36] !== B || t[37] !== d || t[38] !== I || t[39] !== R || t[40] !== m || t[41] !== f || t[42] !== u ? (A = /* @__PURE__ */ q("button", { className: I, type: "button", onClick: L, ...s, ...d, "aria-disabled": R, "aria-busy": o, ref: B, children: [ m, f, u ] }), t[33] = s, t[34] = L, t[35] = o, t[36] = B, t[37] = d, t[38] = I, t[39] = R, t[40] = m, t[41] = f, t[42] = u, t[43] = A) : A = t[43]; const O = A; if (a) { let e; t[44] !== O ? (e = /* @__PURE__ */ S($.Anchor, { children: O }), t[44] = O, t[45] = e) : e = t[45]; let b; t[46] !== a ? (b = /* @__PURE__ */ S($.Content, { children: a }), t[46] = a, t[47] = b) : b = t[47]; let j; return t[48] !== e || t[49] !== b ? (j = /* @__PURE__ */ q($, { placement: "top", tooltipOffset: 6, children: [ e, b ] }), t[48] = e, t[49] = b, t[50] = j) : j = t[50], j; } return O; }); Z.displayName = "DSFloatingActionButton"; export { Z as DSFloatingActionButton };