@kvdbil/components 14.3.2 → 14.3.3
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
|
-
import s from"react";import t,{css as
|
|
1
|
+
import s from"react";import t,{css as r}from"styled-components";import x from"../../icons/components/CheckmarkIcon.js";import{generateNameHash as b}from"../../shared/helpers.js";import i from"../../theme.js";import{BodyText as g}from"../../typography/BodyText/index.js";import{BackgroundStyles as u}from"../IconButton.js";import"../../shared/media-queries.js";const f=r`
|
|
2
2
|
width: 24px;
|
|
3
3
|
height: 24px;
|
|
4
4
|
|
|
@@ -6,7 +6,7 @@ import s from"react";import t,{css as o}from"styled-components";import x from"..
|
|
|
6
6
|
width: 15px;
|
|
7
7
|
height: 15px;
|
|
8
8
|
}
|
|
9
|
-
`,k=
|
|
9
|
+
`,k=r`
|
|
10
10
|
width: 32px;
|
|
11
11
|
height: 32px;
|
|
12
12
|
|
|
@@ -14,10 +14,10 @@ import s from"react";import t,{css as o}from"styled-components";import x from"..
|
|
|
14
14
|
width: 22px;
|
|
15
15
|
height: 22px;
|
|
16
16
|
}
|
|
17
|
-
`,n={regular:f,large:k},y=
|
|
17
|
+
`,n={regular:f,large:k},y=r`
|
|
18
18
|
cursor: default;
|
|
19
19
|
border: 2px solid ${i.colors.gray.light2};
|
|
20
|
-
`,$=e=>
|
|
20
|
+
`,$=e=>r`
|
|
21
21
|
svg {
|
|
22
22
|
opacity: 1;
|
|
23
23
|
}
|
|
@@ -27,15 +27,16 @@ import s from"react";import t,{css as o}from"styled-components";import x from"..
|
|
|
27
27
|
|
|
28
28
|
background: ${i.colors[e].main};
|
|
29
29
|
border: 2px solid ${i.colors[e].main};
|
|
30
|
-
`,
|
|
30
|
+
`,v=r`
|
|
31
31
|
background: ${i.colors.gray.light2};
|
|
32
32
|
z-index: 1;
|
|
33
|
-
`,
|
|
33
|
+
`,z=r`
|
|
34
34
|
border: 2px solid ${i.colors.error.dark};
|
|
35
35
|
`,D=t.div`
|
|
36
36
|
display: flex;
|
|
37
37
|
align-items: flex-start;
|
|
38
38
|
box-sizing: border-box;
|
|
39
|
+
position: relative;
|
|
39
40
|
`,E=t.input.attrs({type:"checkbox"})`
|
|
40
41
|
position: absolute;
|
|
41
42
|
appearance: none;
|
|
@@ -72,12 +73,12 @@ import s from"react";import t,{css as o}from"styled-components";import x from"..
|
|
|
72
73
|
|
|
73
74
|
${e=>e.isChecked&&$(e.color)};
|
|
74
75
|
${e=>e.isDisabled&&y};
|
|
75
|
-
${e=>e.hasError&&
|
|
76
|
-
${e=>e.isChecked&&e.isDisabled&&
|
|
76
|
+
${e=>e.hasError&&z};
|
|
77
|
+
${e=>e.isChecked&&e.isDisabled&&v};
|
|
77
78
|
`,w=t(g)`
|
|
78
79
|
flex: 1;
|
|
79
80
|
cursor: ${({isDisabled:e})=>e?"default":"pointer"};
|
|
80
81
|
user-select: none;
|
|
81
|
-
color: ${({theme:e,isDisabled:
|
|
82
|
+
color: ${({theme:e,isDisabled:o})=>o?e.colors.text.disabled:e.colors.text.dark};
|
|
82
83
|
margin-left: 0.5rem;
|
|
83
|
-
`,p=({name:e=b("check-box"),isDisabled:
|
|
84
|
+
`,p=({name:e=b("check-box"),isDisabled:o=!1,size:a="regular",checked:l=!1,color:c="secondary",hasError:h=!1,label:d,...m})=>s.createElement(D,null,s.createElement(E,{...m,type:"checkbox",checked:l,"data-validate":"checked",name:e,id:e,color:c,disabled:o,isDisabled:o,boxSize:a}),s.createElement(j,{size:a,color:c,isChecked:l,isDisabled:o,hasError:h},s.createElement(x,null)),d&&s.createElement(w,{as:"label",htmlFor:e,isDisabled:o},d));export{p as CheckBox,p as default};
|