Skip to content

Commit 0aae04c

Browse files
Merge pull request #16 from wintondeshong/feature/initial-atom-components
Initial atom components
2 parents 74a7971 + 295e0b2 commit 0aae04c

File tree

69 files changed

+1919
-50
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+1919
-50
lines changed

.storybook/config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ import { withKnobs } from "@storybook/addon-knobs";
44
import { withInfo } from "@storybook/addon-info";
55
import "./storybook.css";
66
import "assets/scss/andculturecode-javascript-react-components.scss";
7+
import { IconUtils } from "utilities/icon-utils";
8+
import { SvgIcons } from "atoms/constants/svg-icons";
9+
10+
IconUtils.register(SvgIcons);
711

812
setDefaults({
913
header: true,

src/assets/scss/4-elements/__elements.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,11 @@
1212

1313
@import "anchors";
1414
@import "buttons";
15+
@import "checkboxes";
16+
@import "fieldsets";
17+
@import "forms";
18+
@import "headings";
19+
@import "inputs";
20+
@import "lists";
21+
@import "paragraphs";
22+
@import "text-area";
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
.e-checkbox {
2+
@include font-style(
3+
$font-primary,
4+
"small",
5+
get-color("primary", "black"),
6+
400,
7+
20px
8+
);
9+
@include padding-left(36px);
10+
@include margin(2px, 0px);
11+
display: block;
12+
position: relative;
13+
cursor: pointer;
14+
-webkit-user-select: none;
15+
-moz-user-select: none;
16+
-ms-user-select: none;
17+
user-select: none;
18+
19+
&.-disabled {
20+
cursor: not-allowed;
21+
}
22+
23+
&:hover input ~ .e-checkbox__checkmark {
24+
background-color: #ccc;
25+
}
26+
27+
input {
28+
position: absolute;
29+
opacity: 0;
30+
cursor: pointer;
31+
height: 0;
32+
width: 0;
33+
34+
&:checked ~ .e-checkbox__checkmark:after {
35+
display: block;
36+
}
37+
38+
&:focus ~ .e-checkbox__checkmark {
39+
border-color: get-color-neutral("dark-text");
40+
}
41+
}
42+
43+
&__checkmark {
44+
position: absolute;
45+
top: 0;
46+
left: 0;
47+
height: 20px;
48+
width: 20px;
49+
border: 1px solid #bdc4c9;
50+
box-sizing: border-box;
51+
border-radius: 5px;
52+
53+
&:after {
54+
content: "";
55+
position: absolute;
56+
display: none;
57+
}
58+
59+
&:after {
60+
left: 7px;
61+
top: 4px;
62+
width: 5px;
63+
height: 10px;
64+
border: solid get-color("neutral", "dark-text");
65+
border-width: 0 3px 3px 0;
66+
-webkit-transform: rotate(45deg);
67+
-ms-transform: rotate(45deg);
68+
transform: rotate(45deg);
69+
}
70+
}
71+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
fieldset {
2+
border: none;
3+
margin: none;
4+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/*------------------------------------*\
2+
FORMS
3+
\*------------------------------------*/
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/*------------------------------------*\
2+
HEADINGS
3+
\*------------------------------------*/
4+
5+
h1,
6+
h2,
7+
h3,
8+
h4,
9+
h5,
10+
h6 {
11+
-webkit-margin-before: 0;
12+
-webkit-margin-after: 0;
13+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
input {
2+
@include placeholder() {
3+
color: get-color-neutral("70");
4+
}
5+
@include font-style($font-primary, "base", get-color-neutral("90"), 400);
6+
@include padding(13px, 18px);
7+
8+
border: 1px solid get-color-neutral("30");
9+
border-radius: 5px;
10+
box-sizing: border-box;
11+
12+
&:focus {
13+
@include placeholder() {
14+
color: get-color-neutral("50");
15+
}
16+
}
17+
&:placeholder-shown {
18+
text-overflow: ellipsis;
19+
}
20+
21+
&[type="email"]:disabled,
22+
&[type="password"]:disabled,
23+
&[type="text"]:disabled {
24+
background-color: get-color-neutral("05");
25+
border-color: get-color-neutral("50");
26+
-webkit-text-fill-color: get-color-neutral("90");
27+
opacity: 1; /* required on iOS */
28+
cursor: not-allowed;
29+
}
30+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*------------------------------------*\
2+
LISTS
3+
\*------------------------------------*/
4+
5+
ul {
6+
position: relative;
7+
list-style: none;
8+
margin-left: 0;
9+
10+
> li {
11+
@include margin-bottom(10px);
12+
}
13+
14+
&.-has-icon {
15+
li {
16+
@include padding-left(10px);
17+
}
18+
19+
&.-check > li:before {
20+
position: absolute;
21+
left: 0;
22+
font-size: 20px;
23+
}
24+
}
25+
}
26+
27+
ol {
28+
> li {
29+
@include margin-bottom(10px);
30+
}
31+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/*------------------------------------*\
2+
PARAGRAPHS
3+
\*------------------------------------*/
4+
5+
p {
6+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
textarea {
2+
@include placeholder() {
3+
color: get-color-neutral("70");
4+
}
5+
@include font-style(
6+
$font-primary,
7+
"base",
8+
get-color-neutral("dark-text"),
9+
400
10+
);
11+
@include padding(13px, 18px);
12+
13+
&:focus {
14+
@include placeholder() {
15+
color: get-color-neutral("50");
16+
}
17+
}
18+
19+
border: 1px solid get-color-neutral("30");
20+
border-radius: 5px;
21+
box-sizing: border-box;
22+
}

0 commit comments

Comments
 (0)