@adam-milo/ui 1.0.82 → 1.0.83
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index4.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("react"),o=require("./index55.cjs"),a=require("@adam-milo/icons"),r=require("./index53.cjs"),n=require("./index60.cjs"),i={sm:"sm",md:"md",lg:"lg"},s={sm:"sm",md:"md",lg:"lg"},l=t.forwardRef(({size:l="md",variant:d="default",icon:c,children:u,disabled:b,loading:m=!1,iconColor:y,iconStrokeWidth:v,"aria-label":g,"data-testid":x,"data-cy":p,...S},j)=>{const[w,f]=t.useState(!1),[h,q]=t.useState(!1),M=o.cn(n.baseStyles,n.variantStyles[d],n.sizeStyles[l]),z=b||m,B=(()=>{if(!m&&!z)return"rainbow-overlay"===d?h?"var(--overlay-rainbow-50)":w?"var(--overlay-rainbow-40)":"var(--overlay-rainbow-15)":"outlined-green"===d?h?"var(--overlay-green-blue-15)":w?"var(--overlay-green-blue-10)":void 0:void 0})(),I=m?`${g||"Button"} - Loading`:g;return e.jsxs("button",{ref:j,type:"button",disabled:z,className:M,style:{...B&&{backgroundImage:B},...S.style},onMouseEnter:()=>!m&&f(!0),onMouseLeave:()=>f(!1),onMouseDown:()=>!m&&q(!0),onMouseUp:()=>q(!1),"aria-label":u?void 0:I,"aria-busy":m,"data-testid":x||"icon-button","data-cy":p||"icon-button",...S,children:[m?e.jsx(r.Spinner,{size:s[l],color:"teal",label:`${g||"Button"} loading`,"data-cy":"icon-button-spinner"}):e.jsx(a.Icon,{name:c,size:i[l],decorative:!!u,customColor:y,customStrokeWidth:v}),u&&e.jsx("span",{className:"text-[var(--color-system-text)] font-normal whitespace-nowrap","data-cy":"icon-button-text",children:u})]})});l.displayName="IconButton",exports.IconButton=l;
|
package/dist/index4.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsxs as
|
|
2
|
-
return
|
|
1
|
+
import{jsxs as o,jsx as e}from"react/jsx-runtime";import{forwardRef as t,useState as a}from"react";import{cn as r}from"./index55.js";import{Icon as n}from"@adam-milo/icons";import{Spinner as i}from"./index53.js";import{sizeStyles as l,variantStyles as d,baseStyles as s}from"./index60.js";const m={sm:"sm",md:"md",lg:"lg"},c={sm:"sm",md:"md",lg:"lg"},u=t(({size:t="md",variant:u="default",icon:b,children:v,disabled:y,loading:p=!1,iconColor:g,iconStrokeWidth:f,"aria-label":x,"data-testid":w,"data-cy":h,...j},M)=>{const[k,z]=a(!1),[B,N]=a(!1),C=r(s,d[u],l[t]),I=y||p,L=(()=>{if(!p&&!I)return"rainbow-overlay"===u?B?"var(--overlay-rainbow-50)":k?"var(--overlay-rainbow-40)":"var(--overlay-rainbow-15)":"outlined-green"===u?B?"var(--overlay-green-blue-15)":k?"var(--overlay-green-blue-10)":void 0:void 0})(),S=p?`${x||"Button"} - Loading`:x;/* @__PURE__ */
|
|
2
|
+
return o("button",{ref:M,type:"button",disabled:I,className:C,style:{...L&&{backgroundImage:L},...j.style},onMouseEnter:()=>!p&&z(!0),onMouseLeave:()=>z(!1),onMouseDown:()=>!p&&N(!0),onMouseUp:()=>N(!1),"aria-label":v?void 0:S,"aria-busy":p,"data-testid":w||"icon-button","data-cy":h||"icon-button",...j,children:[p?/* @__PURE__ */e(i,{size:c[t],color:"teal",label:`${x||"Button"} loading`,"data-cy":"icon-button-spinner"}):/* @__PURE__ */e(n,{name:b,size:m[t],decorative:!!v,customColor:g,customStrokeWidth:f}),v&&/* @__PURE__ */e("span",{className:"text-[var(--color-system-text)] font-normal whitespace-nowrap","data-cy":"icon-button-text",children:v})]})});u.displayName="IconButton";export{u as IconButton};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconButton.component.d.ts","sourceRoot":"","sources":["../../../../../src/components/core/icon-button/IconButton.component.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAI1D,YAAY,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAc1D,eAAO,MAAM,UAAU,+
|
|
1
|
+
{"version":3,"file":"IconButton.component.d.ts","sourceRoot":"","sources":["../../../../../src/components/core/icon-button/IconButton.component.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAI1D,YAAY,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAc1D,eAAO,MAAM,UAAU,+GAgGtB,CAAC"}
|