UNPKG

@stihl-design-system/components

Version:

Welcome to the STIHL Design System react component library.

82 lines (81 loc) 3.83 kB
"use client"; import { jsxs as A, jsx as $ } from "react/jsx-runtime"; import { d as G } from "./chunks/index.CgTHIF3K.js"; import { c as q } from "./chunks/index.CEyLAtio.js"; import { D as J } from "./chunks/Icon.CAXZUNWo.js"; import { DSSpinner as K } from "./spinner.t5FHjIEK.js"; import { forwardRef as M } from "react"; import './assets/buttonround.C-l_HArD.css';const P = "ds-button-round_root_oobgt_1", Q = "ds-button-round_root--highlight_oobgt_75", U = "ds-button-round_root--dark-highlight_oobgt_75", V = "ds-button-round_root--filled_oobgt_151", W = "ds-button-round_root--dark-filled_oobgt_317", X = "ds-button-round_root--icon-only-small_oobgt_571", Y = "ds-button-round_loader_oobgt_588", Z = "ds-button-round_icon--hidden_oobgt_600", oo = "ds-button-round_label--hidden_oobgt_604", to = "ds-button-round_label--loading_oobgt_616", l = { root: P, rootHighlight: Q, rootDarkHighlight: U, rootFilled: V, rootDarkFilled: W, rootIconOnlySmall: X, loader: Y, iconHidden: Z, labelHidden: oo, labelLoading: to }, lo = M((v, C) => { const o = G.c(47); let n, s, a, e, i, d, h, b, u, m, _; o[0] !== v ? ({ children: s, aria: n, className: a, disabled: h, iconName: b, iconSource: e, loading: u, theme: m, variant: _, onClick: i, ...d } = v, o[0] = v, o[1] = n, o[2] = s, o[3] = a, o[4] = e, o[5] = i, o[6] = d, o[7] = h, o[8] = b, o[9] = u, o[10] = m, o[11] = _) : (n = o[1], s = o[2], a = o[3], e = o[4], i = o[5], d = o[6], h = o[7], b = o[8], u = o[9], m = o[10], _ = o[11]); const k = h === void 0 ? !1 : h, p = b === void 0 ? "placeholder" : b, t = u === void 0 ? !1 : u, F = m === void 0 ? "light" : m, f = _ === void 0 ? "filled" : _, x = f === "filled", I = f === "highlight", L = F === "dark" && f === "filled", O = F === "dark" && f === "highlight"; let D; o[12] !== a || o[13] !== x || o[14] !== I || o[15] !== L || o[16] !== O ? (D = q(l.root, l.rootIconOnlySmall, a, { [l.rootFilled]: x, [l.rootHighlight]: I, [l.rootDarkFilled]: L, [l.rootDarkHighlight]: O }), o[12] = a, o[13] = x, o[14] = I, o[15] = L, o[16] = O, o[17] = D) : D = o[17]; const R = D; let H; o[18] !== t ? (H = q(l.label, l.labelHidden, { [l.labelLoading]: t }), o[18] = t, o[19] = H) : H = o[19]; const j = H; let N; o[20] !== t ? (N = q(l.icon, { [l.iconHidden]: t }), o[20] = t, o[21] = N) : N = o[21]; const B = N, w = F === "light" && f === "filled" ? "dark" : "light"; let S; o[22] !== k || o[23] !== t || o[24] !== i ? (S = (z) => { if (k || t) { z.preventDefault(); return; } i && i(z); }, o[22] = k, o[23] = t, o[24] = i, o[25] = S) : S = o[25]; const E = S, T = k || t; let r; o[26] !== t ? (r = t && /* @__PURE__ */ $(K, { className: l.loader, aria: { "aria-label": "Loading state" } }), o[26] = t, o[27] = r) : r = o[27]; let c; o[28] !== s || o[29] !== j ? (c = /* @__PURE__ */ $("span", { className: j, children: s }), o[28] = s, o[29] = j, o[30] = c) : c = o[30]; let g; o[31] !== B || o[32] !== p || o[33] !== e || o[34] !== w ? (g = (p || e) && /* @__PURE__ */ $(J, { name: p, theme: w, source: e, className: B, "aria-hidden": "true" }), o[31] = B, o[32] = p, o[33] = e, o[34] = w, o[35] = g) : g = o[35]; let y; return o[36] !== n || o[37] !== E || o[38] !== t || o[39] !== C || o[40] !== d || o[41] !== R || o[42] !== T || o[43] !== r || o[44] !== c || o[45] !== g ? (y = /* @__PURE__ */ A("button", { className: R, type: "button", onClick: E, ...n, ...d, "aria-disabled": T, "aria-busy": t, ref: C, children: [ r, c, g ] }), o[36] = n, o[37] = E, o[38] = t, o[39] = C, o[40] = d, o[41] = R, o[42] = T, o[43] = r, o[44] = c, o[45] = g, o[46] = y) : y = o[46], y; }); lo.displayName = "DSButtonRound"; export { lo as DSButtonRound };