@mrshmllw/smores-react 2.4.4 → 2.4.5
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/README.md
CHANGED
@@ -35,10 +35,10 @@ $ npm install @mrshmllw/smores-react
|
|
35
35
|
|
36
36
|
Before starting, make sure that `CHANGELOG.md` is updated according to [keepachangelog.com](https://keepachangelog.com/en/1.0.0/) with the latest release notes. If not, make a PR updating it before continuing.
|
37
37
|
|
38
|
-
1. Checkout a new branch from the `
|
38
|
+
1. Checkout a new branch from the `main` branch, update Changelog and _bump_ the project version.
|
39
39
|
|
40
40
|
```
|
41
|
-
git checkout
|
41
|
+
git checkout main
|
42
42
|
git pull
|
43
43
|
git checkout -b [branch_name]
|
44
44
|
```
|
@@ -49,10 +49,10 @@ git checkout -b [branch_name]
|
|
49
49
|
npm version [major | minor | patch]
|
50
50
|
```
|
51
51
|
|
52
|
-
3. When merged, go the the `
|
52
|
+
3. When merged, go the the `main` branch, pull and push the new tag to `origin`
|
53
53
|
|
54
54
|
```
|
55
|
-
git checkout
|
55
|
+
git checkout main
|
56
56
|
git pull
|
57
57
|
git push origin --tags
|
58
58
|
```
|
@@ -0,0 +1,67 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import styled from 'styled-components';
|
3
|
+
import { Text } from '../Text';
|
4
|
+
import { theme } from '../theme';
|
5
|
+
export const CheckBox = ({ id, checked, children, toggle }) => (React.createElement(BoxContainer, { id: id },
|
6
|
+
React.createElement(Text, { tag: "span", typo: "base" }, children),
|
7
|
+
React.createElement("input", { type: "checkbox", checked: checked, onChange: toggle }),
|
8
|
+
React.createElement(Checkmark, null)));
|
9
|
+
const Checkmark = styled.span `
|
10
|
+
position: absolute;
|
11
|
+
left: 0;
|
12
|
+
width: 24px;
|
13
|
+
height: 24px;
|
14
|
+
border: solid 1px ${theme.colors.secondary};
|
15
|
+
box-sizing: border-box;
|
16
|
+
border-radius: 1px;
|
17
|
+
|
18
|
+
&:after {
|
19
|
+
content: '';
|
20
|
+
position: absolute;
|
21
|
+
display: none;
|
22
|
+
top: 3px;
|
23
|
+
left: 7px;
|
24
|
+
width: 5px;
|
25
|
+
height: 12px;
|
26
|
+
border: solid white;
|
27
|
+
border-width: 0 2px 2px 0;
|
28
|
+
-webkit-transform: rotate(45deg);
|
29
|
+
-ms-transform: rotate(45deg);
|
30
|
+
transform: rotate(45deg);
|
31
|
+
}
|
32
|
+
`;
|
33
|
+
const BoxContainer = styled.label `
|
34
|
+
position: relative;
|
35
|
+
display: flex;
|
36
|
+
align-items: center;
|
37
|
+
padding-left: 32px;
|
38
|
+
user-select: none;
|
39
|
+
cursor: pointer;
|
40
|
+
|
41
|
+
input {
|
42
|
+
position: absolute;
|
43
|
+
opacity: 0;
|
44
|
+
cursor: pointer;
|
45
|
+
|
46
|
+
&:checked ~ ${Checkmark} {
|
47
|
+
background-color: ${theme.colors.secondary};
|
48
|
+
border: solid 1px ${theme.colors.secondary};
|
49
|
+
}
|
50
|
+
|
51
|
+
&:checked ~ ${Checkmark}:after {
|
52
|
+
display: block;
|
53
|
+
}
|
54
|
+
}
|
55
|
+
|
56
|
+
&:hover {
|
57
|
+
${Checkmark} {
|
58
|
+
background-color: ${theme.colors.background};
|
59
|
+
border: solid 1px ${theme.colors.secondary};
|
60
|
+
}
|
61
|
+
}
|
62
|
+
|
63
|
+
@media (min-width: 768px) {
|
64
|
+
padding-left: 32px;
|
65
|
+
}
|
66
|
+
`;
|
67
|
+
//# sourceMappingURL=CheckBox.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"CheckBox.js","sourceRoot":"","sources":["../../src/CheckBoxGroup/CheckBox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAA;AAC5C,OAAO,MAAM,MAAM,mBAAmB,CAAA;AAEtC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAShC,MAAM,CAAC,MAAM,QAAQ,GAAc,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CACxE,oBAAC,YAAY,IAAC,EAAE,EAAE,EAAE;IAClB,oBAAC,IAAI,IAAC,GAAG,EAAC,MAAM,EAAC,IAAI,EAAC,MAAM,IACzB,QAAQ,CACJ;IAEP,+BAAO,IAAI,EAAC,UAAU,EAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAI;IAC7D,oBAAC,SAAS,OAAG,CACA,CAChB,CAAA;AAED,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAA;;;;;sBAKP,KAAK,CAAC,MAAM,CAAC,SAAS;;;;;;;;;;;;;;;;;;CAkB3C,CAAA;AAED,MAAM,YAAY,GAAG,MAAM,CAAC,KAAK,CAAA;;;;;;;;;;;;;kBAaf,SAAS;0BACD,KAAK,CAAC,MAAM,CAAC,SAAS;0BACtB,KAAK,CAAC,MAAM,CAAC,SAAS;;;kBAG9B,SAAS;;;;;;MAMrB,SAAS;0BACW,KAAK,CAAC,MAAM,CAAC,UAAU;0BACvB,KAAK,CAAC,MAAM,CAAC,SAAS;;;;;;;CAO/C,CAAA"}
|