@mobilestockweb/button 0.0.7 → 0.0.9
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/index.js +7 -7
- package/package.json +4 -1
package/index.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var P=Object.create;var i=Object.defineProperty,S=Object.defineProperties,H=Object.getOwnPropertyDescriptor,M=Object.getOwnPropertyDescriptors,v=Object.getOwnPropertyNames,a=Object.getOwnPropertySymbols,A=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,C=Object.prototype.propertyIsEnumerable;var B=(o,t,n)=>t in o?i(o,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[t]=n,y=(o,t)=>{for(var n in t||(t={}))l.call(t,n)&&B(o,n,t[n]);if(a)for(var n of a(t))C.call(t,n)&&B(o,n,t[n]);return o},$=(o,t)=>S(o,M(t));var x=(o,t)=>{var n={};for(var r in o)l.call(o,r)&&t.indexOf(r)<0&&(n[r]=o[r]);if(o!=null&&a)for(var r of a(o))t.indexOf(r)<0&&C.call(o,r)&&(n[r]=o[r]);return n};var N=(o,t)=>{for(var n in t)i(o,n,{get:t[n],enumerable:!0})},L=(o,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let e of v(t))!l.call(o,e)&&e!==n&&i(o,e,{get:()=>t[e],enumerable:!(r=H(t,e))||r.enumerable});return o};var u=(o,t,n)=>(n=o!=null?P(A(o)):{},L(t||!o||!o.__esModule?i(n,"default",{value:o,enumerable:!0}):n,o)),R=o=>L(i({},"__esModule",{value:!0}),o);var q={};N(q,{default:()=>k});module.exports=R(q);var s=u(require("styled-components"));var w=require("@mui/material"),d=u(require("styled-components")),m=u(require("@mobilestockweb/tools")),c=require("react/jsx-runtime");function T({isLoading:o,text:t,children:n,$color:r}){switch(!0){case o:return(0,c.jsx)(z,{className:"circular",$color:r});case!!t:return(0,c.jsx)(E,{$color:r,children:t});default:return n}}var z=(0,d.default)(w.CircularProgress)`
|
|
2
2
|
width: 1rem !important;
|
|
3
3
|
height: 1rem !important;
|
|
4
|
-
color: ${({theme:t})=>t.colors.text.default};
|
|
5
4
|
svg {
|
|
6
5
|
margin-right: 0;
|
|
6
|
+
color: ${({$color:o})=>m.default.defineTextColor(o)};
|
|
7
7
|
}
|
|
8
|
-
`,
|
|
8
|
+
`,E=d.default.span`
|
|
9
9
|
text-transform: uppercase;
|
|
10
|
-
|
|
10
|
+
color: ${({$color:o})=>m.default.defineTextColor(o)};
|
|
11
|
+
`;var p=require("react/jsx-runtime");function k(e){var f=e,{isLoading:o,text:t,children:n}=f,r=x(f,["isLoading","text","children"]);var b,h;let g=(0,s.useTheme)();return(0,p.jsx)(O,$(y({},r),{$backgroundColor:((b=r==null?void 0:r.style)==null?void 0:b.backgroundColor)||g.colors.button.default,children:(0,p.jsx)(T,{isLoading:o,text:t,$color:((h=r==null?void 0:r.style)==null?void 0:h.backgroundColor)||g.colors.button.default,children:n})}))}var O=s.default.button`
|
|
11
12
|
display: flex;
|
|
12
13
|
align-items: center;
|
|
13
14
|
justify-content: center;
|
|
@@ -24,11 +25,10 @@
|
|
|
24
25
|
|
|
25
26
|
cursor: pointer;
|
|
26
27
|
|
|
27
|
-
box-shadow: 0 0.25rem 0.25rem ${({theme:
|
|
28
|
+
box-shadow: 0 0.25rem 0.25rem ${({theme:o})=>o.colors.button.shadow};
|
|
28
29
|
border: none;
|
|
29
30
|
border-radius: 0.4rem;
|
|
30
|
-
background-color: ${({
|
|
31
|
-
color: ${({theme:t})=>t.colors.text.default};
|
|
31
|
+
background-color: ${({$backgroundColor:o})=>o};
|
|
32
32
|
&:hover {
|
|
33
33
|
opacity: 0.8;
|
|
34
34
|
}
|
package/package.json
CHANGED