@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 `Master` branch, update Changelog and _bump_ the project version.
38
+ 1. Checkout a new branch from the `main` branch, update Changelog and _bump_ the project version.
39
39
 
40
40
  ```
41
- git checkout master
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 `master` branch, pull and push the new tag to `origin`
52
+ 3. When merged, go the the `main` branch, pull and push the new tag to `origin`
53
53
 
54
54
  ```
55
- git checkout master
55
+ git checkout main
56
56
  git pull
57
57
  git push origin --tags
58
58
  ```
@@ -33,7 +33,7 @@ const Wrapper = styled(Box)(({ borderTop, fullBorder }) => css `
33
33
 
34
34
  ${fullBorder &&
35
35
  css `
36
- border: 1px solid ${theme.colors.subtext};
36
+ border: 1px solid ${theme.colors.outline};
37
37
  border-radius: 8px;
38
38
  margin-bottom: 14px;
39
39
  padding: 20px 15px;
@@ -0,0 +1,9 @@
1
+ import { FC, ReactNode } from 'react';
2
+ declare type Props = {
3
+ id: string;
4
+ checked: boolean;
5
+ children: ReactNode;
6
+ toggle: () => void;
7
+ };
8
+ export declare const CheckBox: FC<Props>;
9
+ export {};
@@ -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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrshmllw/smores-react",
3
- "version": "2.4.4",
3
+ "version": "2.4.5",
4
4
  "main": "./dist/index.js",
5
5
  "description": "Collection of React components used by Marshmallow Technology",
6
6
  "keywords": [