@adam-milo/ui 1.0.82 → 1.0.84

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"),r=require("./index55.cjs"),a=require("@adam-milo/icons"),o=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:c="default",icon:d,children:u,disabled:v,loading:b=!1,iconColor:m,iconStrokeWidth:y,"aria-label":g,"data-testid":x,"data-cy":w,...p},_)=>{const[f,h]=t.useState(!1),[j,S]=t.useState(!1),q=r.cn(n.baseStyles,n.variantStyles[c],n.sizeStyles[l]),k=v||b,z=(()=>{if(!b&&!k)return"rainbow-overlay"===c?j?"var(--overlay-rainbow-50)":f?"var(--overlay-rainbow-40)":"var(--overlay-rainbow-15)":"outlined-green"===c?j?"var(--overlay-green-blue-15)":f?"var(--overlay-green-blue-10)":void 0:void 0})(),I=b?`${g||"Button"} - Loading`:g;return e.jsxs("button",{ref:_,type:"button",disabled:k,className:q,style:{...z&&{backgroundImage:z},...p.style},onMouseEnter:()=>!b&&h(!0),onMouseLeave:()=>h(!1),onMouseDown:()=>!b&&S(!0),onMouseUp:()=>S(!1),"aria-label":u?void 0:I,"aria-busy":b,"data-testid":x||"icon-button","data-cy":w||"icon-button",...p,children:[b?e.jsx(o.Spinner,{size:s[l],color:"teal",label:`${g||"Button"} loading`,"data-cy":"icon-button-spinner"}):m||y?e.jsx("span",{style:{...m&&{color:m},...y&&{"--icon-sw":y}},className:r.cn("inline-flex",m&&"[&_svg_path]:fill-current [&_svg_circle]:fill-current [&_svg_rect]:fill-current",y&&"[&_svg_path]:[stroke-width:var(--icon-sw)] [&_svg_circle]:[stroke-width:var(--icon-sw)] [&_svg_line]:[stroke-width:var(--icon-sw)]"),children:e.jsx(a.Icon,{name:d,size:i[l],decorative:!!u})}):e.jsx(a.Icon,{name:d,size:i[l],decorative:!!u}),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;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),a=require("react"),t=require("./index55.cjs"),i=require("@adam-milo/icons"),o=require("./index53.cjs"),n=require("./index60.cjs"),r={sm:"sm",md:"md",lg:"lg"},s={sm:"sm",md:"md",lg:"lg"},l=a.forwardRef(({size:l="md",variant:c="default",icon:d,children:u,disabled:v,loading:b=!1,iconColor:m,iconStrokeWidth:y,"aria-label":g,"data-testid":x,"data-cy":f,...w},p)=>{const[_,h]=a.useState(!1),[j,S]=a.useState(!1),q=t.cn(n.baseStyles,n.variantStyles[c],n.sizeStyles[l]),k=v||b,z=(()=>{if(!b&&!k)return"rainbow-overlay"===c?j?"var(--overlay-rainbow-50)":_?"var(--overlay-rainbow-40)":"var(--overlay-rainbow-15)":"outlined-green"===c?j?"var(--overlay-green-blue-15)":_?"var(--overlay-green-blue-10)":void 0:void 0})(),I=b?`${g||"Button"} - Loading`:g;return e.jsxs("button",{ref:p,type:"button",disabled:k,className:q,style:{...z&&{backgroundImage:z},...w.style},onMouseEnter:()=>!b&&h(!0),onMouseLeave:()=>h(!1),onMouseDown:()=>!b&&S(!0),onMouseUp:()=>S(!1),"aria-label":u?void 0:I,"aria-busy":b,"data-testid":x||"icon-button","data-cy":f||"icon-button",...w,children:[b?e.jsx(o.Spinner,{size:s[l],color:"teal",label:`${g||"Button"} loading`,"data-cy":"icon-button-spinner"}):m||y?e.jsx("span",{style:{...m&&{"--icon-fill":m},...y&&{"--icon-sw":y}},className:t.cn("inline-flex",m&&"[&_svg_path]:![fill:var(--icon-fill)] [&_svg_circle]:![fill:var(--icon-fill)] [&_svg_rect]:![fill:var(--icon-fill)]",y&&"[&_svg_path]:![stroke-width:var(--icon-sw)] [&_svg_circle]:![stroke-width:var(--icon-sw)] [&_svg_line]:![stroke-width:var(--icon-sw)]"),children:e.jsx(i.Icon,{name:d,size:r[l],decorative:!!u})}):e.jsx(i.Icon,{name:d,size:r[l],decorative:!!u}),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 e,jsx as o}from"react/jsx-runtime";import{forwardRef as t,useState as a}from"react";import{cn as r}from"./index55.js";import{Icon as i}from"@adam-milo/icons";import{Spinner as n}from"./index53.js";import{sizeStyles as l,variantStyles as s,baseStyles as c}from"./index60.js";const d={sm:"sm",md:"md",lg:"lg"},m={sm:"sm",md:"md",lg:"lg"},v=t(({size:t="md",variant:v="default",icon:u,children:b,disabled:g,loading:p=!1,iconColor:y,iconStrokeWidth:f,"aria-label":w,"data-testid":_,"data-cy":h,...x},k)=>{const[j,z]=a(!1),[M,N]=a(!1),B=r(c,s[v],l[t]),I=g||p,L=(()=>{if(!p&&!I)return"rainbow-overlay"===v?M?"var(--overlay-rainbow-50)":j?"var(--overlay-rainbow-40)":"var(--overlay-rainbow-15)":"outlined-green"===v?M?"var(--overlay-green-blue-15)":j?"var(--overlay-green-blue-10)":void 0:void 0})(),$=p?`${w||"Button"} - Loading`:w;/* @__PURE__ */
2
- return e("button",{ref:k,type:"button",disabled:I,className:B,style:{...L&&{backgroundImage:L},...x.style},onMouseEnter:()=>!p&&z(!0),onMouseLeave:()=>z(!1),onMouseDown:()=>!p&&N(!0),onMouseUp:()=>N(!1),"aria-label":b?void 0:$,"aria-busy":p,"data-testid":_||"icon-button","data-cy":h||"icon-button",...x,children:[p?/* @__PURE__ */o(n,{size:m[t],color:"teal",label:`${w||"Button"} loading`,"data-cy":"icon-button-spinner"}):y||f?/* @__PURE__ */o("span",{style:{...y&&{color:y},...f&&{"--icon-sw":f}},className:r("inline-flex",y&&"[&_svg_path]:fill-current [&_svg_circle]:fill-current [&_svg_rect]:fill-current",f&&"[&_svg_path]:[stroke-width:var(--icon-sw)] [&_svg_circle]:[stroke-width:var(--icon-sw)] [&_svg_line]:[stroke-width:var(--icon-sw)]"),children:/* @__PURE__ */o(i,{name:u,size:d[t],decorative:!!b})}):/* @__PURE__ */o(i,{name:u,size:d[t],decorative:!!b}),b&&/* @__PURE__ */o("span",{className:"text-[var(--color-system-text)] font-normal whitespace-nowrap","data-cy":"icon-button-text",children:b})]})});v.displayName="IconButton";export{v as IconButton};
1
+ import{jsxs as o,jsx as e}from"react/jsx-runtime";import{forwardRef as a,useState as i}from"react";import{cn as t}from"./index55.js";import{Icon as r}from"@adam-milo/icons";import{Spinner as n}from"./index53.js";import{sizeStyles as l,variantStyles as s,baseStyles as c}from"./index60.js";const d={sm:"sm",md:"md",lg:"lg"},m={sm:"sm",md:"md",lg:"lg"},v=a(({size:a="md",variant:v="default",icon:u,children:b,disabled:f,loading:g=!1,iconColor:p,iconStrokeWidth:y,"aria-label":w,"data-testid":_,"data-cy":h,...x},k)=>{const[j,z]=i(!1),[M,N]=i(!1),B=t(c,s[v],l[a]),I=f||g,L=(()=>{if(!g&&!I)return"rainbow-overlay"===v?M?"var(--overlay-rainbow-50)":j?"var(--overlay-rainbow-40)":"var(--overlay-rainbow-15)":"outlined-green"===v?M?"var(--overlay-green-blue-15)":j?"var(--overlay-green-blue-10)":void 0:void 0})(),$=g?`${w||"Button"} - Loading`:w;/* @__PURE__ */
2
+ return o("button",{ref:k,type:"button",disabled:I,className:B,style:{...L&&{backgroundImage:L},...x.style},onMouseEnter:()=>!g&&z(!0),onMouseLeave:()=>z(!1),onMouseDown:()=>!g&&N(!0),onMouseUp:()=>N(!1),"aria-label":b?void 0:$,"aria-busy":g,"data-testid":_||"icon-button","data-cy":h||"icon-button",...x,children:[g?/* @__PURE__ */e(n,{size:m[a],color:"teal",label:`${w||"Button"} loading`,"data-cy":"icon-button-spinner"}):p||y?/* @__PURE__ */e("span",{style:{...p&&{"--icon-fill":p},...y&&{"--icon-sw":y}},className:t("inline-flex",p&&"[&_svg_path]:![fill:var(--icon-fill)] [&_svg_circle]:![fill:var(--icon-fill)] [&_svg_rect]:![fill:var(--icon-fill)]",y&&"[&_svg_path]:![stroke-width:var(--icon-sw)] [&_svg_circle]:![stroke-width:var(--icon-sw)] [&_svg_line]:![stroke-width:var(--icon-sw)]"),children:/* @__PURE__ */e(r,{name:u,size:d[a],decorative:!!b})}):/* @__PURE__ */e(r,{name:u,size:d[a],decorative:!!b}),b&&/* @__PURE__ */e("span",{className:"text-[var(--color-system-text)] font-normal whitespace-nowrap","data-cy":"icon-button-text",children:b})]})});v.displayName="IconButton";export{v as IconButton};
package/dist/index60.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=["m-0 font-inherit","inline-flex items-center justify-center","gap-2 flex-shrink-0","text-[var(--color-text)]","rounded-[0.75rem]","cursor-pointer select-none touch-manipulation","transition-all duration-200 ease-in-out","focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--color-text)]","disabled:cursor-not-allowed disabled:pointer-events-none"].join(" "),o={"rainbow-overlay":["border-none","disabled:bg-[var(--color-bg-secondary)]"].join(" "),"outlined-green":["border border-solid border-[var(--color-green-accent)]","bg-transparent","disabled:bg-[var(--color-bg-secondary)] disabled:border-[var(--color-border)]"].join(" "),default:["border-none bg-transparent","hover:bg-[var(--color-bg-secondary)]","active:bg-[var(--color-overlay-black-10)]","disabled:opacity-40"].join(" ")};exports.baseStyles=e,exports.sizeStyles={sm:"p-1.5 text-sm max-md:min-w-11 max-md:min-h-11",md:"p-2 text-base",lg:"p-3 text-lg w-[2.5rem] h-[2.5rem]"},exports.variantStyles=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=["m-0 font-inherit","inline-flex items-center justify-center","gap-2 flex-shrink-0","text-[var(--color-text)]","rounded-[0.75rem]","cursor-pointer select-none touch-manipulation","transition-all duration-200 ease-in-out","focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--color-text)]","disabled:cursor-not-allowed disabled:pointer-events-none"].join(" "),o={"rainbow-overlay":["border-none","disabled:bg-[var(--color-bg-secondary)]"].join(" "),"outlined-green":["border border-solid border-[var(--color-green-accent)]","bg-transparent","hover:bg-[var(--color-bg-secondary)]","active:bg-[var(--color-overlay-black-10)]","disabled:bg-[var(--color-bg-secondary)] disabled:border-[var(--color-border)]"].join(" "),default:["border-none bg-transparent","hover:bg-[var(--color-bg-secondary)]","active:bg-[var(--color-bg-secondary)]","disabled:opacity-40"].join(" ")};exports.baseStyles=e,exports.sizeStyles={sm:"p-1.5 text-sm max-md:min-w-11 max-md:min-h-11",md:"p-2 text-base",lg:"p-3 text-lg w-[2.5rem] h-[2.5rem]"},exports.variantStyles=o;
package/dist/index60.js CHANGED
@@ -1 +1 @@
1
- const e=["m-0 font-inherit","inline-flex items-center justify-center","gap-2 flex-shrink-0","text-[var(--color-text)]","rounded-[0.75rem]","cursor-pointer select-none touch-manipulation","transition-all duration-200 ease-in-out","focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--color-text)]","disabled:cursor-not-allowed disabled:pointer-events-none"].join(" "),o={"rainbow-overlay":["border-none","disabled:bg-[var(--color-bg-secondary)]"].join(" "),"outlined-green":["border border-solid border-[var(--color-green-accent)]","bg-transparent","disabled:bg-[var(--color-bg-secondary)] disabled:border-[var(--color-border)]"].join(" "),default:["border-none bg-transparent","hover:bg-[var(--color-bg-secondary)]","active:bg-[var(--color-overlay-black-10)]","disabled:opacity-40"].join(" ")},r={sm:"p-1.5 text-sm max-md:min-w-11 max-md:min-h-11",md:"p-2 text-base",lg:"p-3 text-lg w-[2.5rem] h-[2.5rem]"};export{e as baseStyles,r as sizeStyles,o as variantStyles};
1
+ const e=["m-0 font-inherit","inline-flex items-center justify-center","gap-2 flex-shrink-0","text-[var(--color-text)]","rounded-[0.75rem]","cursor-pointer select-none touch-manipulation","transition-all duration-200 ease-in-out","focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--color-text)]","disabled:cursor-not-allowed disabled:pointer-events-none"].join(" "),o={"rainbow-overlay":["border-none","disabled:bg-[var(--color-bg-secondary)]"].join(" "),"outlined-green":["border border-solid border-[var(--color-green-accent)]","bg-transparent","hover:bg-[var(--color-bg-secondary)]","active:bg-[var(--color-overlay-black-10)]","disabled:bg-[var(--color-bg-secondary)] disabled:border-[var(--color-border)]"].join(" "),default:["border-none bg-transparent","hover:bg-[var(--color-bg-secondary)]","active:bg-[var(--color-bg-secondary)]","disabled:opacity-40"].join(" ")},r={sm:"p-1.5 text-sm max-md:min-w-11 max-md:min-h-11",md:"p-2 text-base",lg:"p-3 text-lg w-[2.5rem] h-[2.5rem]"};export{e as baseStyles,r as sizeStyles,o as variantStyles};
@@ -1 +1 @@
1
- {"version":3,"file":"IconButton.styles.d.ts","sourceRoot":"","sources":["../../../../../src/components/core/icon-button/IconButton.styles.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,QAUZ,CAAC;AAEZ,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,iBAAiB,GAAG,gBAAgB,GAAG,SAAS,EAAE,MAAM,CAa1F,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,IAAI,GAAG,IAAI,GAAG,IAAI,EAAE,MAAM,CAIzD,CAAC"}
1
+ {"version":3,"file":"IconButton.styles.d.ts","sourceRoot":"","sources":["../../../../../src/components/core/icon-button/IconButton.styles.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,QAUZ,CAAC;AAEZ,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,iBAAiB,GAAG,gBAAgB,GAAG,SAAS,EAAE,MAAM,CAe1F,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,IAAI,GAAG,IAAI,GAAG,IAAI,EAAE,MAAM,CAIzD,CAAC"}