graphen 1.10.20 → 2.0.1
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/dist/css.js +1 -1
- package/dist/scripts.js +1 -1
- package/package.json +1 -1
- package/src/components/Badge/index.tsx +29 -0
- package/src/components/Badge/styles/_styles.scss +38 -0
- package/src/components/Body/styles/_styles.scss +6 -2
- package/src/components/Button/styles/_styles.scss +63 -28
- package/src/components/Card/styles/_styles.scss +5 -6
- package/src/components/Dropdown/integration/dropdown.spec.js +9 -5
- package/src/components/Input/styles/_styles.scss +36 -9
- package/src/components/Link/styles/_styles.scss +5 -2
- package/src/components/Logo/index.tsx +2 -1
- package/src/components/Logo/styles/_styles.scss +24 -2
- package/src/components/SectionHeader/styles/_styles.scss +40 -0
- package/src/components/Separator/styles/_styles.scss +4 -3
- package/src/example/styles/_docs.scss +709 -0
- package/src/example.scss +3 -0
- package/src/example.tsx +955 -660
- package/src/index.ts +2 -0
- package/src/style.scss +2 -0
- package/src/variables/_brand.scss +2 -1
- package/src/variables/_sizes.scss +3 -3
- package/src/variables/integration/colors.spec.js +21 -17
- package/dist/18ca3004c8aec4f105976c8c7f11083b.jpg +0 -0
- package/dist/example.js +0 -2
- package/dist/example.js.LICENSE.txt +0 -44
- package/dist/styles.css +0 -1
package/package.json
CHANGED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import classNames from "classnames";
|
|
3
|
+
|
|
4
|
+
type Props = {
|
|
5
|
+
className?: string;
|
|
6
|
+
type?: "default" | "info" | "success" | "danger";
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
showPulse?: boolean;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
function Badge({
|
|
12
|
+
className = "",
|
|
13
|
+
type = "default",
|
|
14
|
+
children = null,
|
|
15
|
+
showPulse = false,
|
|
16
|
+
}: Props) {
|
|
17
|
+
const classes = classNames("gc-badge", className, {
|
|
18
|
+
[`gc-badge--${type}`]: type !== "default",
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<span className={classes}>
|
|
23
|
+
{showPulse && <span className="gc-badge__pulse" aria-hidden="true" />}
|
|
24
|
+
{children}
|
|
25
|
+
</span>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export default Badge;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
.gc-badge {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
gap: 6px;
|
|
5
|
+
height: 22px;
|
|
6
|
+
padding: 0 8px;
|
|
7
|
+
background: $gb-color-component;
|
|
8
|
+
border: 1px solid $gb-color-component-dark;
|
|
9
|
+
border-radius: 999px;
|
|
10
|
+
color: $gb-color-text;
|
|
11
|
+
font-family: $gb-font-mono;
|
|
12
|
+
font-size: 11px;
|
|
13
|
+
|
|
14
|
+
&__pulse {
|
|
15
|
+
width: 6px;
|
|
16
|
+
height: 6px;
|
|
17
|
+
background: currentcolor;
|
|
18
|
+
border-radius: 50%;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&--success {
|
|
22
|
+
background: rgba($gb-color-success, 0.1);
|
|
23
|
+
border-color: rgba($gb-color-success, 0.3);
|
|
24
|
+
color: $gb-color-success;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
&--danger {
|
|
28
|
+
background: rgba($gb-color-danger, 0.1);
|
|
29
|
+
border-color: rgba($gb-color-danger, 0.3);
|
|
30
|
+
color: $gb-color-danger;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&--info {
|
|
34
|
+
background: rgba($gb-color-info, 0.1);
|
|
35
|
+
border-color: rgba($gb-color-info, 0.3);
|
|
36
|
+
color: $gb-color-info;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -8,9 +8,13 @@
|
|
|
8
8
|
margin: 0;
|
|
9
9
|
min-height: 100vh;
|
|
10
10
|
font-family: $gb-font;
|
|
11
|
-
font-weight:
|
|
12
|
-
font-size:
|
|
11
|
+
font-weight: 400;
|
|
12
|
+
font-size: 15px;
|
|
13
|
+
line-height: 1.55;
|
|
13
14
|
color: $gb-color-text;
|
|
15
|
+
background: $color-white;
|
|
16
|
+
font-feature-settings: 'ss01', 'cv11';
|
|
17
|
+
-webkit-font-smoothing: antialiased;
|
|
14
18
|
|
|
15
19
|
a {
|
|
16
20
|
cursor: pointer;
|
|
@@ -1,75 +1,110 @@
|
|
|
1
1
|
.gc-btn {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: center;
|
|
5
|
+
gap: 8px;
|
|
4
6
|
box-sizing: border-box;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
touch-action: manipulation;
|
|
9
|
-
cursor: pointer;
|
|
7
|
+
height: 36px;
|
|
8
|
+
padding: 0 14px;
|
|
9
|
+
background: $gb-color-component;
|
|
10
10
|
border: 1px solid transparent;
|
|
11
|
-
white-space: nowrap;
|
|
12
11
|
border-radius: $radius-medium;
|
|
12
|
+
color: $gb-color-text;
|
|
13
|
+
font-family: $gb-font;
|
|
14
|
+
font-size: 13.5px;
|
|
15
|
+
font-weight: 500;
|
|
16
|
+
text-align: center;
|
|
17
|
+
text-decoration: none;
|
|
18
|
+
white-space: nowrap;
|
|
19
|
+
cursor: pointer;
|
|
13
20
|
user-select: none;
|
|
14
21
|
vertical-align: middle;
|
|
22
|
+
touch-action: manipulation;
|
|
23
|
+
transition: background-color 0.12s, border-color 0.12s, color 0.12s, transform 0.04s;
|
|
24
|
+
|
|
25
|
+
&:hover {
|
|
26
|
+
background: $gb-color-component-dark;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&:active {
|
|
30
|
+
transform: translateY(1px);
|
|
31
|
+
}
|
|
15
32
|
|
|
16
33
|
&--medium {
|
|
17
|
-
|
|
34
|
+
height: 36px;
|
|
18
35
|
}
|
|
19
36
|
|
|
20
37
|
&--small {
|
|
21
|
-
|
|
38
|
+
height: 28px;
|
|
39
|
+
padding: 0 10px;
|
|
40
|
+
font-size: 12.5px;
|
|
41
|
+
border-radius: $radius-small;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&--large {
|
|
45
|
+
height: 44px;
|
|
46
|
+
padding: 0 18px;
|
|
47
|
+
font-size: 14.5px;
|
|
48
|
+
border-radius: 7px;
|
|
22
49
|
}
|
|
23
50
|
|
|
24
51
|
&--full {
|
|
52
|
+
display: flex;
|
|
25
53
|
width: 100%;
|
|
26
|
-
display: block;
|
|
27
54
|
}
|
|
28
55
|
|
|
29
56
|
&--primary {
|
|
30
|
-
background
|
|
57
|
+
background: $gb-color-primary;
|
|
31
58
|
color: $color-white;
|
|
32
59
|
|
|
33
60
|
&:hover {
|
|
34
|
-
background
|
|
61
|
+
background: darken($gb-color-primary, 10%);
|
|
35
62
|
}
|
|
36
63
|
}
|
|
37
64
|
|
|
65
|
+
&--outline,
|
|
38
66
|
&--secondary {
|
|
39
67
|
background: $color-white;
|
|
40
|
-
color: $gb-color-
|
|
41
|
-
|
|
42
|
-
border-style: solid;
|
|
43
|
-
border-color: $gb-color-primary;
|
|
68
|
+
border-color: $gb-color-component-dark;
|
|
69
|
+
color: $gb-color-text;
|
|
44
70
|
|
|
45
71
|
&:hover {
|
|
46
|
-
|
|
47
|
-
color:
|
|
72
|
+
background: $gb-color-component;
|
|
73
|
+
border-color: $gb-color-text;
|
|
48
74
|
}
|
|
49
75
|
}
|
|
50
76
|
|
|
77
|
+
&--ghost,
|
|
51
78
|
&--tertiary {
|
|
52
|
-
background:
|
|
53
|
-
color: $gb-color-
|
|
54
|
-
|
|
79
|
+
background: transparent;
|
|
80
|
+
color: $gb-color-text;
|
|
81
|
+
|
|
82
|
+
&:hover {
|
|
83
|
+
background: $gb-color-component;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
&--success {
|
|
88
|
+
background: $gb-color-success;
|
|
89
|
+
color: $color-white;
|
|
55
90
|
|
|
56
91
|
&:hover {
|
|
57
|
-
|
|
92
|
+
background: darken($gb-color-success, 10%);
|
|
58
93
|
}
|
|
59
94
|
}
|
|
60
95
|
|
|
61
96
|
&--danger {
|
|
62
|
-
background
|
|
97
|
+
background: $gb-color-danger;
|
|
63
98
|
color: $color-white;
|
|
64
99
|
|
|
65
100
|
&:hover {
|
|
66
|
-
background
|
|
101
|
+
background: darken($gb-color-danger, 10%);
|
|
67
102
|
}
|
|
68
103
|
}
|
|
69
104
|
|
|
70
|
-
&--disabled
|
|
71
|
-
|
|
72
|
-
|
|
105
|
+
&--disabled,
|
|
106
|
+
&[disabled] {
|
|
107
|
+
opacity: 0.45;
|
|
73
108
|
cursor: not-allowed;
|
|
74
109
|
pointer-events: none;
|
|
75
110
|
}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
.gc-card {
|
|
2
|
-
|
|
3
|
-
border
|
|
4
|
-
border-radius: $radius-
|
|
5
|
-
padding:
|
|
2
|
+
background: $color-white;
|
|
3
|
+
border: 1px solid $gb-color-component-dark;
|
|
4
|
+
border-radius: $radius-large;
|
|
5
|
+
padding: 18px;
|
|
6
|
+
box-shadow: 0 1px 0 rgba(20, 20, 28, 0.04), 0 1px 2px rgba(20, 20, 28, 0.04);
|
|
6
7
|
|
|
7
8
|
&--default {
|
|
8
9
|
background-color: $gb-color-component-light;
|
|
9
|
-
border-color: $gb-color-component-dark;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
&--gradient {
|
|
13
13
|
background: linear-gradient(#f5f5f5, #fff 10%);
|
|
14
|
-
border-color: $gb-color-component-dark;
|
|
15
14
|
}
|
|
16
15
|
}
|
|
@@ -1,22 +1,26 @@
|
|
|
1
1
|
describe("dropdown menu", () => {
|
|
2
2
|
it("should open dropdown and pick a value", () => {
|
|
3
|
-
cy.visit("localhost:3000");
|
|
3
|
+
cy.visit("http://localhost:3000");
|
|
4
|
+
|
|
5
|
+
cy.get("#dropdown").scrollIntoView();
|
|
6
|
+
|
|
4
7
|
cy.get("[data-cy=dropdown-button]")
|
|
5
8
|
.first()
|
|
9
|
+
.should("contain", "Red")
|
|
6
10
|
.click()
|
|
7
11
|
.get("[data-cy=dropdown-item]")
|
|
8
|
-
.contains("
|
|
12
|
+
.contains("Blue")
|
|
9
13
|
.click()
|
|
10
14
|
.get("[data-cy=dropdown-button]")
|
|
11
|
-
.should("contain", "
|
|
15
|
+
.should("contain", "Blue");
|
|
12
16
|
|
|
13
17
|
cy.get("[data-cy=dropdown-button]")
|
|
14
18
|
.first()
|
|
15
19
|
.click()
|
|
16
20
|
.get("[data-cy=dropdown-item]")
|
|
17
|
-
.contains("
|
|
21
|
+
.contains("Red")
|
|
18
22
|
.click()
|
|
19
23
|
.get("[data-cy=dropdown-button]")
|
|
20
|
-
.should("contain", "
|
|
24
|
+
.should("contain", "Red");
|
|
21
25
|
});
|
|
22
26
|
});
|
|
@@ -9,33 +9,60 @@
|
|
|
9
9
|
|
|
10
10
|
&__label {
|
|
11
11
|
display: block;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
margin-bottom: 6px;
|
|
13
|
+
padding-left: 2px;
|
|
14
|
+
color: $gb-color-text;
|
|
15
|
+
font-size: 13px;
|
|
16
|
+
font-weight: 500;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
&__field {
|
|
20
20
|
box-sizing: border-box;
|
|
21
21
|
display: block;
|
|
22
|
-
border-radius: $radius-medium;
|
|
23
22
|
width: 100%;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
height: 36px;
|
|
24
|
+
padding: 0 12px;
|
|
25
|
+
background: $color-white;
|
|
27
26
|
border: 1px solid $gb-color-component-dark;
|
|
27
|
+
border-radius: $radius-medium;
|
|
28
|
+
color: $gb-color-text;
|
|
29
|
+
font-family: $gb-font;
|
|
30
|
+
font-size: 13.5px;
|
|
31
|
+
outline: none;
|
|
32
|
+
transition: border-color 0.12s, box-shadow 0.12s;
|
|
33
|
+
|
|
34
|
+
&::placeholder {
|
|
35
|
+
color: $color-boulder;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&:focus {
|
|
39
|
+
border-color: $gb-color-primary;
|
|
40
|
+
box-shadow: 0 0 0 3px rgba($gb-color-primary, 0.18);
|
|
41
|
+
}
|
|
28
42
|
|
|
29
43
|
&--success {
|
|
30
44
|
border-color: $gb-color-success;
|
|
45
|
+
|
|
46
|
+
&:focus {
|
|
47
|
+
box-shadow: 0 0 0 3px rgba($gb-color-success, 0.18);
|
|
48
|
+
}
|
|
31
49
|
}
|
|
32
50
|
|
|
33
51
|
&--danger {
|
|
34
52
|
border-color: $gb-color-danger;
|
|
53
|
+
|
|
54
|
+
&:focus {
|
|
55
|
+
box-shadow: 0 0 0 3px rgba($gb-color-danger, 0.18);
|
|
56
|
+
}
|
|
35
57
|
}
|
|
36
58
|
|
|
37
59
|
&:disabled {
|
|
38
60
|
border: 0;
|
|
61
|
+
opacity: 0.6;
|
|
39
62
|
}
|
|
40
63
|
}
|
|
64
|
+
|
|
65
|
+
&--full &__field {
|
|
66
|
+
max-width: 100%;
|
|
67
|
+
}
|
|
41
68
|
}
|
|
@@ -1,20 +1,23 @@
|
|
|
1
1
|
.gc-link {
|
|
2
2
|
cursor: pointer;
|
|
3
3
|
text-decoration: none;
|
|
4
|
+
transition: color 0.12s, border-color 0.12s;
|
|
4
5
|
|
|
5
6
|
&--primary {
|
|
6
7
|
color: $gb-color-link;
|
|
8
|
+
border-bottom: 1px solid rgba($gb-color-link, 0.3);
|
|
7
9
|
|
|
8
10
|
&:hover {
|
|
9
|
-
color:
|
|
11
|
+
border-bottom-color: $gb-color-link;
|
|
10
12
|
}
|
|
11
13
|
}
|
|
12
14
|
|
|
13
15
|
&--default {
|
|
14
16
|
color: $gb-color-text;
|
|
17
|
+
border-bottom: 1px solid rgba($gb-color-text, 0.25);
|
|
15
18
|
|
|
16
19
|
&:hover {
|
|
17
|
-
color:
|
|
20
|
+
border-bottom-color: $gb-color-text;
|
|
18
21
|
}
|
|
19
22
|
}
|
|
20
23
|
}
|
|
@@ -12,7 +12,8 @@ function Logo({ className = "", onClick = () => {} }: Props) {
|
|
|
12
12
|
/* eslint-disable jsx-a11y/no-static-element-interactions */
|
|
13
13
|
return (
|
|
14
14
|
<span onClick={onClick} className={logoClasses}>
|
|
15
|
-
|
|
15
|
+
CODA
|
|
16
|
+
<span className="gc-logo__cursor" aria-hidden="true" />
|
|
16
17
|
</span>
|
|
17
18
|
);
|
|
18
19
|
/* eslint-enable jsx-a11y/no-static-element-interactions */
|
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
.gc-logo {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
align-items: baseline;
|
|
4
|
+
font-family: $gb-font-mono;
|
|
5
|
+
font-size: 22px;
|
|
6
|
+
font-weight: 500;
|
|
7
|
+
letter-spacing: 0.04em;
|
|
4
8
|
color: $gb-color-logo;
|
|
9
|
+
|
|
10
|
+
&__cursor {
|
|
11
|
+
display: inline-block;
|
|
12
|
+
width: 0.5em;
|
|
13
|
+
height: 1em;
|
|
14
|
+
margin-left: 4px;
|
|
15
|
+
background: $gb-color-primary;
|
|
16
|
+
transform: translateY(2px);
|
|
17
|
+
animation: gc-logo-blink 1.1s steps(1) infinite;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@keyframes gc-logo-blink {
|
|
22
|
+
50% { opacity: 0; }
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@media (prefers-reduced-motion: reduce) {
|
|
26
|
+
.gc-logo__cursor { animation: none; }
|
|
5
27
|
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
.gc-section-header {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
gap: 12px;
|
|
5
|
+
padding: 14px 18px;
|
|
6
|
+
background: $gb-color-component;
|
|
7
|
+
border: 1px solid $gb-color-component-dark;
|
|
8
|
+
border-radius: $radius-large;
|
|
9
|
+
|
|
10
|
+
&__icon {
|
|
11
|
+
display: grid;
|
|
12
|
+
place-items: center;
|
|
13
|
+
width: 32px;
|
|
14
|
+
height: 32px;
|
|
15
|
+
background: rgba($gb-color-primary, 0.14);
|
|
16
|
+
border-radius: 8px;
|
|
17
|
+
color: $gb-color-primary;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
&__title {
|
|
21
|
+
font-size: 15px;
|
|
22
|
+
font-weight: 500;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&__sub {
|
|
26
|
+
margin-left: auto;
|
|
27
|
+
font-size: 13px;
|
|
28
|
+
color: $color-boulder;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
&--success &__icon {
|
|
32
|
+
background: rgba($gb-color-success, 0.14);
|
|
33
|
+
color: $gb-color-success;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&--danger &__icon {
|
|
37
|
+
background: rgba($gb-color-danger, 0.14);
|
|
38
|
+
color: $gb-color-danger;
|
|
39
|
+
}
|
|
40
|
+
}
|