@anoki/fse-ui
Version:
FSE UI components library
3 lines (2 loc) • 1.74 kB
JavaScript
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./components/ui/Button/Button.css');const e=require("./index.cjs237.js"),B=require("./index.cjs310.js"),I=require("./index.cjs239.js");;/* empty css */const N=require("./index.cjs61.js"),l=require("./index.cjs226.js"),T=require("./index.cjs196.js"),_=require("./index.cjs189.js"),k=require("./index.cjs208.js"),v=({children:r,variant:s,variantBg:p="bg-white",bg:j="primary",textColor:d="white",border:m="white",size:h="3",className:b,disabled:o,loading:t,onClick:f,type:a="button",form:E,asLink:x,href:R,isExternal:u=!1,target:q=void 0,rel:w=void 0,icon:n=void 0,fwClassName:y="fw-bold",...i})=>{const C=s?"":B.createColorClasses({bg:j,text:d,border:m}),S={2:"fs-6 py-x12 px-x24",3:"fs-7 py-x12 px-x24",4:"fs-6 py-x4 px-x8",5:"fs-7 md-fs-6 md-px-x16 py-x12"},c=I.clsx("ui-button",S[h],s&&`ui-button-${s} ${p}`,!s&&C,{"ui-button-disabled":o||t},{"ui-button-loading":t},b,y);if(x){const g=x;return e.jsxRuntimeExports.jsx(g,{target:u?"_blank":q,rel:u?"noopener noreferrer":w,href:R,className:c,...i,children:r})}const $=()=>{switch(n){case"info":return e.jsxRuntimeExports.jsx(k.Info,{height:16});case"download":return e.jsxRuntimeExports.jsx(_.Download,{height:16});case"expand":return e.jsxRuntimeExports.jsx(T.Expand,{width:18,height:18});default:return null}};return e.jsxRuntimeExports.jsxs("button",{type:a,form:E,className:c,onClick:f,disabled:o||t,...i,children:[n&&e.jsxRuntimeExports.jsxs(N.Col,{mr:"x8",children:[!t&&e.jsxRuntimeExports.jsx($,{}),t?e.jsxRuntimeExports.jsx(l.Spinner,{height:16}):null]}),r,t&&!n?e.jsxRuntimeExports.jsx(l.Spinner,{height:16}):null]})};exports.Button=v;
//# sourceMappingURL=index.cjs32.js.map