UNPKG

sate-lib

Version:

A lightweight and modular React component library designed for modern web interfaces. **SATE Lib** powers the [sate.menu](https://sate.menu) platform with reusable, scalable, and themeable UI components.

1 lines 871 B
import{jsx as e,jsxs as i}from"react/jsx-runtime";import{Icon as r}from"../icon/icon.js";import s from"./button.styles.module.js";import{Noise as t}from"./noise.js";function a({href:a,variant:l="filled",size:o="large",icon:n,iconPosition:m="left",label:c,loading:d,disabled:u,className:f="",...h}){let g="large"===o||"medium"===o?24:"small"===o?18:16,p=(()=>{switch(o){case"small":return"bodyDefaultEmphasis";case"medium":return"bodyLargeEmphasis";case"large":return"bodyXLargeEmphasis";default:return""}})(),b=[s.button,s[l],s[o],p,d&&s.loading,n&&s.icon,"right"===m&&s.directionRight,f].filter(Boolean).join(" ");return a?i("a",{className:b,href:a,...h,children:[n&&e(r,{name:n,size:g}),c,"filled"===l&&e(t,{className:s.noise})]}):i("button",{className:b,disabled:u,...h,children:[n&&e(r,{name:n,size:g}),c,"filled"===l&&e(t,{className:s.noise})]})}export{a as Button};