UNPKG

welcome-ui

Version:

Customizable design system with react, typescript, tailwindcss and ariakit.

66 lines (65 loc) 2.25 kB
"use client"; import './Button.css'; import { jsxs as o, jsx as r, Fragment as z } from "react/jsx-runtime"; import { B as b } from "./HMKTUWOU-NkVXWCyR.js"; import { useButtonGroup as h } from "./ButtonGroup.js"; import { Loader as x } from "./Loader.js"; import { c as B } from "./index-B6iGEm-i.js"; import { f as N } from "./forwardRefWithAs-8eP3ZN15.js"; import "react"; const w = "_root_k9ec7_12", $ = "_loader_k9ec7_213", j = { root: w, "wui-icon-font": "_wui-icon-font_k9ec7_66", "size-sm": "_size-sm_k9ec7_77", "size-md": "_size-md_k9ec7_84", "size-lg": "_size-lg_k9ec7_91", "variant-primary": "_variant-primary_k9ec7_98", "variant-primary-neutral": "_variant-primary-neutral_k9ec7_106", "variant-primary-ai": "_variant-primary-ai_k9ec7_117", "rotate-gradient": "_rotate-gradient_k9ec7_1", "variant-primary-danger": "_variant-primary-danger_k9ec7_149", "variant-secondary": "_variant-secondary_k9ec7_161", "variant-secondary-danger": "_variant-secondary-danger_k9ec7_176", "variant-tertiary": "_variant-tertiary_k9ec7_191", "variant-tertiary-danger": "_variant-tertiary-danger_k9ec7_202", loader: $, "loader-children": "_loader-children_k9ec7_223" }, e = B(j), D = N( ({ accessibleWhenDisabled: s = !0, as: t, children: i, className: _ = "", disabled: c = !1, isLoading: a = !1, size: d = "lg", variant: l = "primary", ...m }, p) => { const { disabled: v, size: u, variant: y } = h(), k = v || c || a, f = y || l, g = u || d, n = t || "button"; return /* @__PURE__ */ o( b, { ...n === "button" ? { type: "button" } : {}, ...m, accessibleWhenDisabled: s, className: e("root", `variant-${f}`, `size-${g}`, _), disabled: k, ref: p, render: t ? /* @__PURE__ */ r(n, {}) : void 0, children: [ a ? /* @__PURE__ */ o(z, { children: [ /* @__PURE__ */ r("div", { className: e("loader"), children: /* @__PURE__ */ r(x, { size: "xs" }) }), /* @__PURE__ */ r("div", { className: e("loader-children"), children: i }) ] }) : null, !a && i ] } ); } ); D.displayName = "Button"; export { D as Button, j as buttonClasses };