@kvdbil/components 8.2.1 → 8.3.0
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/cjs/components/CheckBox/index.js +1 -1
- package/cjs/components/IconButton.js +7 -7
- package/esm/components/CheckBox/index.js +9 -9
- package/esm/components/IconButton.js +8 -8
- package/package.json +1 -1
- package/types/components/CheckBox/index.d.ts +1 -1
- package/types/components/IconButton.d.ts +2 -1
|
@@ -78,4 +78,4 @@
|
|
|
78
78
|
user-select: none;
|
|
79
79
|
color: ${({theme:x,isDisabled:k})=>k?x.colors.text.disabled:x.colors.text.dark};
|
|
80
80
|
margin-left: 0.5rem;
|
|
81
|
-
`,g=({name:x=t.generateNameHash("check-box"),isDisabled:k=!1,size:j="regular",checked:
|
|
81
|
+
`,g=({name:x=t.generateNameHash("check-box"),isDisabled:k=!1,size:j="regular",checked:y=!1,color:v="secondary",onClick:q,label:$,...D})=>d.default.createElement(p,null,d.default.createElement(o.default,{noTabIndex:!0,onClick:q,isActive:y,isDisabled:k,color:v},d.default.createElement(b,{...D,checked:y,"data-validate":"checked",name:x,id:x,color:v,disabled:k,isDisabled:k}),d.default.createElement(m,{size:j,color:v,isChecked:y,isDisabled:k},d.default.createElement(s.default,null))),$&&d.default.createElement(f,{as:"label",htmlFor:x,isDisabled:k},$));exports.CheckBox=g,exports.default=g;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("styled-components");function o(s){return s&&typeof s=="object"&&"default"in s?s:{default:s}}var i=o(e),r=o(t);const
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("styled-components");function o(s){return s&&typeof s=="object"&&"default"in s?s:{default:s}}var i=o(e),r=o(t);const n=t.css`
|
|
2
2
|
background-color: transparent;
|
|
3
|
-
`,
|
|
3
|
+
`,c=t.css`
|
|
4
4
|
background-color: ${({theme:s,color:b})=>s.colors[b].main};
|
|
5
5
|
opacity: 0.1;
|
|
6
|
-
${s=>s.isDisabled&&
|
|
6
|
+
${s=>s.isDisabled&&n};
|
|
7
7
|
`,a=r.default.div`
|
|
8
8
|
cursor: ${s=>s.isDisabled?"default":"pointer"};
|
|
9
9
|
outline: none;
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
:hover {
|
|
21
21
|
.button-background {
|
|
22
22
|
transition: background-color ${"400ms"};
|
|
23
|
-
${
|
|
23
|
+
${c}
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
|
|
@@ -28,14 +28,14 @@
|
|
|
28
28
|
.button-background {
|
|
29
29
|
transition: background-color ${"400ms"};
|
|
30
30
|
animation: FocusRipple ${"1500ms"} 0ms infinite alternate-reverse;
|
|
31
|
-
${
|
|
31
|
+
${c}
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
:active {
|
|
36
36
|
.button-background {
|
|
37
37
|
animation: ActiveRipple ${"750ms"};
|
|
38
|
-
${
|
|
38
|
+
${c}
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
|
|
@@ -72,4 +72,4 @@
|
|
|
72
72
|
|
|
73
73
|
position: absolute;
|
|
74
74
|
border-radius: 10rem;
|
|
75
|
-
`;exports.BackgroundStyles=
|
|
75
|
+
`;exports.BackgroundStyles=c,exports.default=({children:s,isActive:b,isDisabled:p,onClick:d,noTabIndex:f=!1,color:m})=>i.default.createElement(a,{color:m,isActive:b,isDisabled:p,onClick:u=>{u.stopPropagation(),u.preventDefault(),u.persist(),p||typeof d!="function"||d(u)},onKeyDown:u=>{u.key!=="Enter"||p||typeof d!="function"||(u.persist(),d(u))},tabIndex:p||f?void 0:0},i.default.createElement(l,{className:"button-background"}),s);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import o from"react";import
|
|
1
|
+
import o from"react";import s,{css as r}from"styled-components";import{generateNameHash as p}from"../../shared/helpers.js";import i from"../../theme.js";import{BodyText as g}from"../../typography/BodyText/index.js";import x,{BackgroundStyles as u}from"../IconButton.js";import b from"../../icons/components/CheckmarkIcon.js";import"../../shared/media-queries.js";const y=r`
|
|
2
2
|
width: 24px;
|
|
3
3
|
height: 24px;
|
|
4
4
|
|
|
@@ -6,7 +6,7 @@ import o from"react";import c,{css as r}from"styled-components";import{generateN
|
|
|
6
6
|
width: 15px;
|
|
7
7
|
height: 15px;
|
|
8
8
|
}
|
|
9
|
-
`,
|
|
9
|
+
`,f=r`
|
|
10
10
|
width: 32px;
|
|
11
11
|
height: 32px;
|
|
12
12
|
|
|
@@ -14,7 +14,7 @@ import o from"react";import c,{css as r}from"styled-components";import{generateN
|
|
|
14
14
|
width: 22px;
|
|
15
15
|
height: 22px;
|
|
16
16
|
}
|
|
17
|
-
`,
|
|
17
|
+
`,k={regular:y,large:f},$=r`
|
|
18
18
|
cursor: default;
|
|
19
19
|
border: 2px solid ${i.colors.gray.light2};
|
|
20
20
|
`,v=e=>r`
|
|
@@ -29,11 +29,11 @@ import o from"react";import c,{css as r}from"styled-components";import{generateN
|
|
|
29
29
|
border: 2px solid ${i.colors[e].main};
|
|
30
30
|
`,C=r`
|
|
31
31
|
background: ${i.colors.gray.light2};
|
|
32
|
-
`,j=
|
|
32
|
+
`,j=s.div`
|
|
33
33
|
display: flex;
|
|
34
34
|
align-items: center;
|
|
35
35
|
box-sizing: border-box;
|
|
36
|
-
`,w=
|
|
36
|
+
`,w=s.input.attrs({type:"checkbox"})`
|
|
37
37
|
position: absolute;
|
|
38
38
|
appearance: none;
|
|
39
39
|
width: 100%;
|
|
@@ -52,7 +52,7 @@ import o from"react";import c,{css as r}from"styled-components";import{generateN
|
|
|
52
52
|
transition: background-color 400ms;
|
|
53
53
|
${u}
|
|
54
54
|
}
|
|
55
|
-
`,z=
|
|
55
|
+
`,z=s.span`
|
|
56
56
|
box-sizing: border-box;
|
|
57
57
|
cursor: pointer;
|
|
58
58
|
display: flex;
|
|
@@ -62,7 +62,7 @@ import o from"react";import c,{css as r}from"styled-components";import{generateN
|
|
|
62
62
|
|
|
63
63
|
border: 2px solid ${i.colors.gray.dark5};
|
|
64
64
|
|
|
65
|
-
${e=>
|
|
65
|
+
${e=>k[e.size]};
|
|
66
66
|
|
|
67
67
|
svg {
|
|
68
68
|
opacity: 0;
|
|
@@ -73,9 +73,9 @@ import o from"react";import c,{css as r}from"styled-components";import{generateN
|
|
|
73
73
|
${e=>e.isDisabled&&$};
|
|
74
74
|
|
|
75
75
|
${e=>e.isChecked&&e.isDisabled&&C};
|
|
76
|
-
`,B=
|
|
76
|
+
`,B=s(g)`
|
|
77
77
|
cursor: ${({isDisabled:e})=>e?"default":"pointer"};
|
|
78
78
|
user-select: none;
|
|
79
79
|
color: ${({theme:e,isDisabled:t})=>t?e.colors.text.disabled:e.colors.text.dark};
|
|
80
80
|
margin-left: 0.5rem;
|
|
81
|
-
`,l=({name:e=p("check-box"),isDisabled:t=!1,size:d="regular",checked:a,color:
|
|
81
|
+
`,l=({name:e=p("check-box"),isDisabled:t=!1,size:d="regular",checked:a=!1,color:c="secondary",onClick:m,label:n,...h})=>o.createElement(j,null,o.createElement(x,{noTabIndex:!0,onClick:m,isActive:a,isDisabled:t,color:c},o.createElement(w,{...h,checked:a,"data-validate":"checked",name:e,id:e,color:c,disabled:t,isDisabled:t}),o.createElement(z,{size:d,color:c,isChecked:a,isDisabled:t},o.createElement(b,null))),n&&o.createElement(B,{as:"label",htmlFor:e,isDisabled:t},n));export{l as CheckBox,l as default};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import a from"react";import i,{css as s}from"styled-components";const f=s`
|
|
2
2
|
background-color: transparent;
|
|
3
|
-
`,l="400ms",
|
|
3
|
+
`,l="400ms",b="1500ms",k="750ms",c=s`
|
|
4
4
|
background-color: ${({theme:o,color:r})=>o.colors[r].main};
|
|
5
5
|
opacity: 0.1;
|
|
6
|
-
${o=>o.isDisabled&&
|
|
7
|
-
`,
|
|
6
|
+
${o=>o.isDisabled&&f};
|
|
7
|
+
`,g=i.div`
|
|
8
8
|
cursor: ${o=>o.isDisabled?"default":"pointer"};
|
|
9
9
|
outline: none;
|
|
10
10
|
|
|
@@ -27,14 +27,14 @@ import i from"react";import a,{css as s}from"styled-components";const m=s`
|
|
|
27
27
|
:focus {
|
|
28
28
|
.button-background {
|
|
29
29
|
transition: background-color ${l};
|
|
30
|
-
animation: FocusRipple ${
|
|
30
|
+
animation: FocusRipple ${b} 0ms infinite alternate-reverse;
|
|
31
31
|
${c}
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
:active {
|
|
36
36
|
.button-background {
|
|
37
|
-
animation: ActiveRipple ${
|
|
37
|
+
animation: ActiveRipple ${k};
|
|
38
38
|
${c}
|
|
39
39
|
}
|
|
40
40
|
}
|
|
@@ -62,7 +62,7 @@ import i from"react";import a,{css as s}from"styled-components";const m=s`
|
|
|
62
62
|
clip-path: circle(50%);
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
-
`,
|
|
65
|
+
`,h=i.div`
|
|
66
66
|
top: 0;
|
|
67
67
|
left: 0;
|
|
68
68
|
|
|
@@ -72,4 +72,4 @@ import i from"react";import a,{css as s}from"styled-components";const m=s`
|
|
|
72
72
|
|
|
73
73
|
position: absolute;
|
|
74
74
|
border-radius: 10rem;
|
|
75
|
-
`,
|
|
75
|
+
`,y=({children:o,isActive:r,isDisabled:e,onClick:n,noTabIndex:p=!1,color:u})=>{const d=t=>{t.key==="Enter"&&!e&&typeof n=="function"&&(t.persist(),n(t))},m=t=>{t.stopPropagation(),t.preventDefault(),t.persist(),!e&&typeof n=="function"&&n(t)};return a.createElement(g,{color:u,isActive:r,isDisabled:e,onClick:m,onKeyDown:d,tabIndex:e||p?void 0:0},a.createElement(h,{className:"button-background"}),o)};export{c as BackgroundStyles,y as default};
|
package/package.json
CHANGED
|
@@ -9,7 +9,8 @@ interface Props {
|
|
|
9
9
|
children: ReactNode;
|
|
10
10
|
isActive: boolean;
|
|
11
11
|
isDisabled: boolean;
|
|
12
|
+
noTabIndex?: boolean;
|
|
12
13
|
onClick?(event: MouseEvent<HTMLDivElement> | KeyboardEvent<HTMLDivElement>): void;
|
|
13
14
|
}
|
|
14
|
-
declare const IconButton: ({ children, isActive, isDisabled, onClick, color, }: Props) => JSX.Element;
|
|
15
|
+
declare const IconButton: ({ children, isActive, isDisabled, onClick, noTabIndex, color, }: Props) => JSX.Element;
|
|
15
16
|
export default IconButton;
|