@kvdbil/components 13.1.0 → 13.1.1
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("styled-components"),r=require("../../theme.js"),l=require("../Spinner/index.js"),s=require("../../typography/ButtonText/index.js"),i=require("./styles.js");function a(y){return y&&typeof y=="object"&&"default"in y?y:{default:y}}var o=a(e),n=a(t);const u=n.default.button`
|
|
2
2
|
${s.BasicButtonFontStyle}
|
|
3
3
|
box-sizing: border-box;
|
|
4
4
|
outline: none;
|
|
@@ -6,29 +6,29 @@
|
|
|
6
6
|
user-select: none;
|
|
7
7
|
position: relative;
|
|
8
8
|
border: none;
|
|
9
|
-
width: ${({fullWidth:
|
|
9
|
+
width: ${({fullWidth:y})=>y&&"100%"};
|
|
10
10
|
display: flex;
|
|
11
11
|
align-items: center;
|
|
12
|
-
justify-content: ${({sufixIcon:
|
|
12
|
+
justify-content: ${({sufixIcon:y,prefixIcon:x,isLoading:b})=>b||!y&&!x?"center":"space-between"};
|
|
13
13
|
|
|
14
|
-
${({size:
|
|
15
|
-
${({size:
|
|
16
|
-
${
|
|
17
|
-
${
|
|
18
|
-
${
|
|
19
|
-
${
|
|
14
|
+
${({size:y="small"})=>i.fontSizes[y]||s.ButtonRegularTextStyle}
|
|
15
|
+
${({size:y,isLoading:x,minWidth:b})=>t.css`
|
|
16
|
+
${y==="smaller"&&i.smallerSizeStyles(x,b)}
|
|
17
|
+
${y==="small"&&i.smallSizeStyles(x,b)}
|
|
18
|
+
${y==="regular"&&i.regularSizeStyles(x,b)}
|
|
19
|
+
${y==="large"&&i.largeSizeStyles(x,b)}
|
|
20
20
|
`}
|
|
21
21
|
background-color: transparent;
|
|
22
22
|
transition: color 0.3s ease, background-color 0.3s ease, border 0.3s ease;
|
|
23
|
-
${({variant:
|
|
24
|
-
${b?i.disabledColorStyles(h,
|
|
23
|
+
${({variant:y="solid",color:x="primary",disabled:b,theme:h})=>t.css`
|
|
24
|
+
${b?i.disabledColorStyles(h,y):i.colorStyles[y](h,x)}
|
|
25
25
|
`}
|
|
26
26
|
&:focus-visible {
|
|
27
|
-
box-shadow: 0px 0px 0px 1px ${({theme:
|
|
27
|
+
box-shadow: 0px 0px 0px 1px ${({theme:y})=>y.colors.gray.light5};
|
|
28
28
|
}
|
|
29
|
-
`,d={smaller:"1rem",small:"1rem",regular:"1.5rem",large:"1.5rem"},
|
|
29
|
+
`,d={smaller:"1rem",small:"1rem",regular:"1.5rem",large:"1.5rem"},f={smaller:"0.5rem",small:"0.5rem",regular:"1rem",large:"1rem"},c=n.default.span`
|
|
30
30
|
display: flex;
|
|
31
|
-
margin-right: ${({type:
|
|
32
|
-
margin-left: ${({type:
|
|
33
|
-
font-size: ${({size:
|
|
34
|
-
`,m=n.default(l.default)``,p={smaller:1,small:1,regular:1.5,large:1.5},g=e.forwardRef(({size:
|
|
31
|
+
margin-right: ${({type:y,size:x})=>y==="prefix"?f[x]:0};
|
|
32
|
+
margin-left: ${({type:y,size:x})=>y==="sufix"?f[x]:0};
|
|
33
|
+
font-size: ${({size:y})=>d[y]};
|
|
34
|
+
`,m=n.default(l.default)``,p={smaller:1,small:1,regular:1.5,large:1.5},g=e.forwardRef(({size:y="small",color:x="primary",variant:b="solid",fullWidth:h=!1,isDisabled:j=!1,isLoading:z=!1,children:$,sufixIcon:S,prefixIcon:v,minWidth:q,as:B="button",...E},I)=>o.default.createElement(u,{...E,as:B,minWidth:q,color:x,disabled:j||z,fullWidth:h,theme:r.default,variant:b,size:y,isLoading:z,ref:I,prefixIcon:v,sufixIcon:S},z?o.default.createElement(m,{color:r.default.colors.gray.light1,size:p[y]}):o.default.createElement(o.default.Fragment,null,v&&o.default.createElement(c,{size:y,type:"prefix"},v),typeof $=="string"?o.default.createElement("span",null,$):$,S&&o.default.createElement(c,{size:y,type:"sufix"},S))));g.displayName="Button",exports.Button=g,exports.default=g;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import l,{forwardRef as x}from"react";import
|
|
2
|
-
${
|
|
1
|
+
import l,{forwardRef as x}from"react";import i,{css as c}from"styled-components";import u from"../../theme.js";import B from"../Spinner/index.js";import{BasicButtonFontStyle as E,ButtonRegularTextStyle as j}from"../../typography/ButtonText/index.js";import{fontSizes as h,smallerSizeStyles as w,smallSizeStyles as z,regularSizeStyles as R,largeSizeStyles as k,disabledColorStyles as C,colorStyles as F}from"./styles.js";const T=i.button`
|
|
2
|
+
${E}
|
|
3
3
|
box-sizing: border-box;
|
|
4
4
|
outline: none;
|
|
5
5
|
cursor: pointer;
|
|
@@ -9,9 +9,9 @@ import l,{forwardRef as x}from"react";import m,{css as c}from"styled-components"
|
|
|
9
9
|
width: ${({fullWidth:e})=>e&&"100%"};
|
|
10
10
|
display: flex;
|
|
11
11
|
align-items: center;
|
|
12
|
-
justify-content: ${({sufixIcon:e,prefixIcon:r})
|
|
12
|
+
justify-content: ${({sufixIcon:e,prefixIcon:r,isLoading:t})=>!t&&(e||r)?"space-between":"center"};
|
|
13
13
|
|
|
14
|
-
${({size:e="small"})=>
|
|
14
|
+
${({size:e="small"})=>h[e]||j}
|
|
15
15
|
${({size:e,isLoading:r,minWidth:t})=>c`
|
|
16
16
|
${e==="smaller"&&w(r,t)}
|
|
17
17
|
${e==="small"&&z(r,t)}
|
|
@@ -26,9 +26,9 @@ import l,{forwardRef as x}from"react";import m,{css as c}from"styled-components"
|
|
|
26
26
|
&:focus-visible {
|
|
27
27
|
box-shadow: 0px 0px 0px 1px ${({theme:e})=>e.colors.gray.light5};
|
|
28
28
|
}
|
|
29
|
-
`,_={smaller:"1rem",small:"1rem",regular:"1.5rem",large:"1.5rem"},
|
|
29
|
+
`,_={smaller:"1rem",small:"1rem",regular:"1.5rem",large:"1.5rem"},y={smaller:"0.5rem",small:"0.5rem",regular:"1rem",large:"1rem"},g=i.span`
|
|
30
30
|
display: flex;
|
|
31
|
-
margin-right: ${({type:e,size:r})=>e==="prefix"?
|
|
32
|
-
margin-left: ${({type:e,size:r})=>e==="sufix"?
|
|
31
|
+
margin-right: ${({type:e,size:r})=>e==="prefix"?y[r]:0};
|
|
32
|
+
margin-left: ${({type:e,size:r})=>e==="sufix"?y[r]:0};
|
|
33
33
|
font-size: ${({size:e})=>_[e]};
|
|
34
|
-
`,v=
|
|
34
|
+
`,v=i(B)``,M={smaller:1,small:1,regular:1.5,large:1.5},p=x(({size:e="small",color:r="primary",variant:t="solid",fullWidth:o=!1,isDisabled:f=!1,isLoading:s=!1,children:a,sufixIcon:n,prefixIcon:m,minWidth:S,as:$="button",...b},d)=>l.createElement(T,{...b,as:$,minWidth:S,color:r,disabled:f||s,fullWidth:o,theme:u,variant:t,size:e,isLoading:s,ref:d,prefixIcon:m,sufixIcon:n},s?l.createElement(v,{color:u.colors.gray.light1,size:M[e]}):l.createElement(l.Fragment,null,m&&l.createElement(g,{size:e,type:"prefix"},m),typeof a=="string"?l.createElement("span",null,a):a,n&&l.createElement(g,{size:e,type:"sufix"},n))));p.displayName="Button";export{p as Button,p as default};
|