@remvst/design-system 0.0.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/.github/workflows/check.yaml +22 -0
- package/README.md +5 -0
- package/lib/alignment/alignment.css +24 -0
- package/lib/alignment/alignment.d.ts +14 -0
- package/lib/alignment/alignment.js +33 -0
- package/lib/animations/animations.css +125 -0
- package/lib/animations/animations.d.ts +8 -0
- package/lib/animations/animations.js +23 -0
- package/lib/balanced-row/balanced-row.css +9 -0
- package/lib/balanced-row/balanced-row.d.ts +5 -0
- package/lib/balanced-row/balanced-row.js +16 -0
- package/lib/balanced-stack/balanced-stack.css +10 -0
- package/lib/balanced-stack/balanced-stack.d.ts +5 -0
- package/lib/balanced-stack/balanced-stack.js +16 -0
- package/lib/buttons/buttons.css +10 -0
- package/lib/buttons/buttons.d.ts +5 -0
- package/lib/buttons/buttons.js +12 -0
- package/lib/component-with-class-name.d.ts +5 -0
- package/lib/component-with-class-name.js +15 -0
- package/lib/dim/dim.css +5 -0
- package/lib/dim/dim.d.ts +5 -0
- package/lib/dim/dim.js +12 -0
- package/lib/flow-list/flow-list.css +10 -0
- package/lib/flow-list/flow-list.d.ts +5 -0
- package/lib/flow-list/flow-list.js +16 -0
- package/lib/focusable.d.ts +13 -0
- package/lib/focusable.js +31 -0
- package/lib/frame/frame.css +3 -0
- package/lib/frame/frame.d.ts +5 -0
- package/lib/frame/frame.js +12 -0
- package/lib/gauge/gauge.css +24 -0
- package/lib/gauge/gauge.d.ts +10 -0
- package/lib/gauge/gauge.js +18 -0
- package/lib/highlightable-row/highlightable-row.css +11 -0
- package/lib/highlightable-row/highlightable-row.d.ts +11 -0
- package/lib/highlightable-row/highlightable-row.js +15 -0
- package/lib/index.d.ts +22 -0
- package/lib/index.js +38 -0
- package/lib/key-value-layout/key-value-layout.css +15 -0
- package/lib/key-value-layout/key-value-layout.d.ts +5 -0
- package/lib/key-value-layout/key-value-layout.js +12 -0
- package/lib/labels/labels.css +39 -0
- package/lib/labels/labels.d.ts +23 -0
- package/lib/labels/labels.js +54 -0
- package/lib/reset/reset.css +13 -0
- package/lib/screen-column-layout/screen-column-layout.css +126 -0
- package/lib/screen-column-layout/screen-column-layout.d.ts +20 -0
- package/lib/screen-column-layout/screen-column-layout.js +47 -0
- package/lib/screen-stack-layout/screen-stack-layout.css +26 -0
- package/lib/screen-stack-layout/screen-stack-layout.d.ts +14 -0
- package/lib/screen-stack-layout/screen-stack-layout.js +33 -0
- package/lib/scrollable-content/scrollable-content.css +5 -0
- package/lib/scrollable-content/scrollable-content.d.ts +5 -0
- package/lib/scrollable-content/scrollable-content.js +12 -0
- package/lib/slider/slider.css +85 -0
- package/lib/slider/slider.d.ts +18 -0
- package/lib/slider/slider.js +47 -0
- package/lib/spacing/spacing.css +9 -0
- package/lib/spacing/spacing.d.ts +10 -0
- package/lib/spacing/spacing.js +14 -0
- package/lib/stack-list/stack-list.css +4 -0
- package/lib/stack-list/stack-list.d.ts +5 -0
- package/lib/stack-list/stack-list.js +16 -0
- package/lib/tabs/tabs.css +24 -0
- package/lib/tabs/tabs.d.ts +13 -0
- package/lib/tabs/tabs.js +25 -0
- package/lib/typography/typography.css +9 -0
- package/lib/typography/typography.d.ts +10 -0
- package/lib/typography/typography.js +14 -0
- package/package.json +27 -0
- package/src/alignment/alignment.css +24 -0
- package/src/alignment/alignment.tsx +18 -0
- package/src/animations/animations.css +125 -0
- package/src/animations/animations.ts +21 -0
- package/src/assets.d.ts +1 -0
- package/src/balanced-row/balanced-row.css +9 -0
- package/src/balanced-row/balanced-row.tsx +16 -0
- package/src/balanced-stack/balanced-stack.css +10 -0
- package/src/balanced-stack/balanced-stack.tsx +16 -0
- package/src/buttons/buttons.css +10 -0
- package/src/buttons/buttons.tsx +6 -0
- package/src/component-with-class-name.tsx +15 -0
- package/src/dim/dim.css +5 -0
- package/src/dim/dim.tsx +6 -0
- package/src/flow-list/flow-list.css +10 -0
- package/src/flow-list/flow-list.tsx +16 -0
- package/src/focusable.tsx +48 -0
- package/src/frame/frame.css +3 -0
- package/src/frame/frame.tsx +6 -0
- package/src/gauge/gauge.css +24 -0
- package/src/gauge/gauge.tsx +25 -0
- package/src/highlightable-row/highlightable-row.css +11 -0
- package/src/highlightable-row/highlightable-row.tsx +17 -0
- package/src/index.ts +23 -0
- package/src/key-value-layout/key-value-layout.css +15 -0
- package/src/key-value-layout/key-value-layout.tsx +6 -0
- package/src/labels/labels.css +39 -0
- package/src/labels/labels.tsx +30 -0
- package/src/reset/reset.css +13 -0
- package/src/screen-column-layout/screen-column-layout.css +126 -0
- package/src/screen-column-layout/screen-column-layout.tsx +26 -0
- package/src/screen-stack-layout/screen-stack-layout.css +26 -0
- package/src/screen-stack-layout/screen-stack-layout.tsx +18 -0
- package/src/scrollable-content/scrollable-content.css +5 -0
- package/src/scrollable-content/scrollable-content.tsx +6 -0
- package/src/slider/slider.css +85 -0
- package/src/slider/slider.tsx +61 -0
- package/src/spacing/spacing.css +9 -0
- package/src/spacing/spacing.ts +11 -0
- package/src/stack-list/stack-list.css +4 -0
- package/src/stack-list/stack-list.tsx +16 -0
- package/src/tabs/tabs.css +24 -0
- package/src/tabs/tabs.tsx +29 -0
- package/src/typography/typography.css +9 -0
- package/src/typography/typography.ts +11 -0
- package/tsconfig.json +13 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
.key-value-layout {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: row;
|
|
4
|
+
flex-wrap: nowrap;
|
|
5
|
+
justify-content: space-between;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.key-value-layout > *:first-child {
|
|
9
|
+
flex: 1 0 auto;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.key-value-layout > * {
|
|
13
|
+
align-self: center;
|
|
14
|
+
max-width: 50%;
|
|
15
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
.label-giant {
|
|
2
|
+
font-size: 100px;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.label-large {
|
|
6
|
+
font-size: var(--font-size-l);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.label-medium {
|
|
10
|
+
font-size: var(--font-size-m);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.label-small {
|
|
14
|
+
font-size: var(--font-size-s);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.label-tiny {
|
|
18
|
+
font-size: var(--font-size-xs);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.main-title {
|
|
22
|
+
text-align: center;
|
|
23
|
+
font-size: var(--font-size-xxl);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.text-block {
|
|
27
|
+
font-size: var(--font-size-m);
|
|
28
|
+
color: white;
|
|
29
|
+
padding: 10px 10%;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.text-block p {
|
|
33
|
+
margin: 10px 0px;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.text-block ul {
|
|
37
|
+
margin-left: 20px;
|
|
38
|
+
list-style-type: square;
|
|
39
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ComponentWithClassName } from "../component-with-class-name";
|
|
2
|
+
import "./labels.css";
|
|
3
|
+
|
|
4
|
+
export class GiantLabel extends ComponentWithClassName {
|
|
5
|
+
readonly className = "label label-giant";
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export class LargeLabel extends ComponentWithClassName {
|
|
9
|
+
readonly className = "label label-large";
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export class MediumLabel extends ComponentWithClassName {
|
|
13
|
+
readonly className = "label label-medium";
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export class SmallLabel extends ComponentWithClassName {
|
|
17
|
+
readonly className = "label label-small";
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export class TinyLabel extends ComponentWithClassName {
|
|
21
|
+
readonly className = "label label-tiny";
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export class MainTitle extends ComponentWithClassName {
|
|
25
|
+
readonly className = "label main-title";
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export class TextBlock extends ComponentWithClassName {
|
|
29
|
+
readonly className = "text-block";
|
|
30
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
.screen-layout-column {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: row;
|
|
4
|
+
height: 100%;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.screen-layout-column > * {
|
|
8
|
+
height: 100%;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.screen-layout-column > .screen-layout-column-main-column {
|
|
12
|
+
flex: 0 0 45%;
|
|
13
|
+
background-color: rgba(0, 0, 0, 0.7);
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.screen-layout-column
|
|
19
|
+
> .screen-layout-column-main-column
|
|
20
|
+
> .screen-layout-column-main-column-header {
|
|
21
|
+
flex-basis: 40%;
|
|
22
|
+
flex-shrink: 0;
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-direction: column;
|
|
25
|
+
justify-content: center;
|
|
26
|
+
padding-left: 5%;
|
|
27
|
+
padding-right: 5%;
|
|
28
|
+
text-align: center;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.screen-layout-column
|
|
32
|
+
> .screen-layout-column-main-column
|
|
33
|
+
> .screen-layout-column-main-column-footer {
|
|
34
|
+
flex-basis: 100px;
|
|
35
|
+
display: flex;
|
|
36
|
+
flex-direction: column;
|
|
37
|
+
justify-content: center;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.screen-layout-column
|
|
41
|
+
> .screen-layout-column-main-column
|
|
42
|
+
> .screen-layout-column-main-column-content {
|
|
43
|
+
flex: 1 0 0;
|
|
44
|
+
overflow: hidden auto;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.screen-layout-column > .screen-layout-column-central-content {
|
|
48
|
+
flex: 1 1 auto;
|
|
49
|
+
display: flex;
|
|
50
|
+
flex-direction: column;
|
|
51
|
+
padding: 10%;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.mobile .screen-layout-column > .screen-central-content {
|
|
55
|
+
display: none;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.mobile .screen-layout-column > .screen-layout-column-main-column {
|
|
59
|
+
flex-basis: 100%;
|
|
60
|
+
background: transparent;
|
|
61
|
+
justify-content: start;
|
|
62
|
+
padding-left: 10px;
|
|
63
|
+
padding-right: 10px;
|
|
64
|
+
margin-left: auto;
|
|
65
|
+
margin-right: auto;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.mobile
|
|
69
|
+
.screen-layout-column
|
|
70
|
+
> .screen-layout-column-main-column
|
|
71
|
+
> .screen-layout-column-main-column-header {
|
|
72
|
+
flex-basis: 30%;
|
|
73
|
+
flex-shrink: 1;
|
|
74
|
+
justify-content: end;
|
|
75
|
+
padding-left: 20px;
|
|
76
|
+
padding-right: 20px;
|
|
77
|
+
position: relative;
|
|
78
|
+
z-index: 1;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.mobile
|
|
82
|
+
.screen-layout-column
|
|
83
|
+
> .screen-layout-column-main-column
|
|
84
|
+
> .screen-layout-column-main-column-content {
|
|
85
|
+
flex: 0 1 auto;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.mobile
|
|
89
|
+
.screen-layout-column
|
|
90
|
+
> .screen-layout-column-main-column
|
|
91
|
+
> .screen-layout-column-main-column-footer {
|
|
92
|
+
padding-top: 50px;
|
|
93
|
+
justify-content: end;
|
|
94
|
+
flex-basis: auto;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.mobile .screen-layout-column .screen-layout-column-main-column-content,
|
|
98
|
+
.mobile .screen-layout-column .screen-layout-column-main-column-footer {
|
|
99
|
+
background-color: rgba(0, 0, 0, 0.7);
|
|
100
|
+
padding: 5px;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.mobile
|
|
104
|
+
.screen-layout-column
|
|
105
|
+
> .screen-layout-column-main-column
|
|
106
|
+
> .screen-layout-column-main-column-header
|
|
107
|
+
.main-title {
|
|
108
|
+
color: black;
|
|
109
|
+
text-shadow: none;
|
|
110
|
+
background: white;
|
|
111
|
+
margin: 0px;
|
|
112
|
+
|
|
113
|
+
position: relative;
|
|
114
|
+
top: 20px;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.mobile .screen-layout-column .screen-layout-column-main-column-content {
|
|
118
|
+
padding-top: 30px;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.mobile
|
|
122
|
+
.main-menu
|
|
123
|
+
.screen-layout-column
|
|
124
|
+
.screen-layout-column-main-column-content {
|
|
125
|
+
padding: 5px;
|
|
126
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ComponentWithClassName } from "../component-with-class-name";
|
|
2
|
+
import "./screen-column-layout.css";
|
|
3
|
+
|
|
4
|
+
export class ScreenColumnLayout extends ComponentWithClassName {
|
|
5
|
+
protected readonly className = "screen-layout-column";
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export class ScreenColumnLayoutMainColumn extends ComponentWithClassName {
|
|
9
|
+
protected readonly className = "screen-layout-column-main-column";
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export class ScreenColumnLayoutMainColumnHeader extends ComponentWithClassName {
|
|
13
|
+
protected readonly className = "screen-layout-column-main-column-header";
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export class ScreenColumnLayoutMainColumnFooter extends ComponentWithClassName {
|
|
17
|
+
protected readonly className = "screen-layout-column-main-column-footer";
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export class ScreenColumnLayoutMainColumnContent extends ComponentWithClassName {
|
|
21
|
+
protected readonly className = "screen-layout-column-main-column-content";
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export class ScreenColumnLayoutCentralContent extends ComponentWithClassName {
|
|
25
|
+
protected readonly className = "screen-layout-column-central-content";
|
|
26
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
.screen-stack-layout {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
margin: auto;
|
|
5
|
+
height: 100%;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.screen-stack-layout-top,
|
|
9
|
+
.screen-stack-layout-bottom {
|
|
10
|
+
flex: 0 0 100px;
|
|
11
|
+
display: flex;
|
|
12
|
+
justify-content: center;
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.screen-stack-layout-content {
|
|
17
|
+
flex: 1 1 auto;
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
overflow: hidden;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.screen-stack-layout-content > * {
|
|
24
|
+
flex: 1 1 auto;
|
|
25
|
+
max-height: 100%;
|
|
26
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ComponentWithClassName } from "../component-with-class-name";
|
|
2
|
+
import "./screen-stack-layout.css";
|
|
3
|
+
|
|
4
|
+
export class ScreenStackLayout extends ComponentWithClassName {
|
|
5
|
+
protected readonly className = "screen-stack-layout";
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export class ScreenStackLayoutTop extends ComponentWithClassName {
|
|
9
|
+
protected readonly className = "screen-stack-layout-top";
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export class ScreenStackLayoutContent extends ComponentWithClassName {
|
|
13
|
+
protected readonly className = "screen-stack-layout-content";
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export class ScreenStackLayoutBottom extends ComponentWithClassName {
|
|
17
|
+
protected readonly className = "screen-stack-layout-bottom";
|
|
18
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
input[type="range"] {
|
|
2
|
+
background: transparent;
|
|
3
|
+
cursor: pointer;
|
|
4
|
+
appearance: none;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
input[type="range"]::-webkit-slider-thumb {
|
|
8
|
+
-webkit-appearance: none;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
input[type="range"]:focus {
|
|
12
|
+
outline: none; /* Removes the blue border. You should probably do some kind of focus styling for accessibility reasons though. */
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
input[type="range"]::-webkit-slider-thumb {
|
|
16
|
+
-webkit-appearance: none;
|
|
17
|
+
border: none;
|
|
18
|
+
background: #000;
|
|
19
|
+
margin-top: -10px; /* You need to specify a margin in Chrome, but in Firefox and IE it is automatic */
|
|
20
|
+
width: 20px;
|
|
21
|
+
height: 20px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
input[type="range"]::-moz-range-thumb {
|
|
25
|
+
border: none;
|
|
26
|
+
box-shadow: 0px 2px #000;
|
|
27
|
+
height: 15px;
|
|
28
|
+
width: 15px;
|
|
29
|
+
background: #fff;
|
|
30
|
+
border-radius: 0px;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
input[type="range"]::-webkit-slider-runnable-track {
|
|
34
|
+
width: 100%;
|
|
35
|
+
height: 0px;
|
|
36
|
+
background-color: #fff;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
input[type="range"]::-moz-range-track {
|
|
40
|
+
width: 100%;
|
|
41
|
+
height: 2px;
|
|
42
|
+
background-color: #fff;
|
|
43
|
+
box-shadow: 0px 2px #000;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.labelled-slider {
|
|
47
|
+
background-color: white;
|
|
48
|
+
padding: 1px;
|
|
49
|
+
position: relative;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.labelled-slider > *:nth-child(1) {
|
|
53
|
+
width: 100%;
|
|
54
|
+
height: 100%;
|
|
55
|
+
display: block;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.labelled-slider > *:nth-child(2) {
|
|
59
|
+
min-width: 50px;
|
|
60
|
+
text-align: right;
|
|
61
|
+
position: absolute;
|
|
62
|
+
right: 0;
|
|
63
|
+
top: 100%;
|
|
64
|
+
margin: 0;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.labelled-slider input[type="range"] {
|
|
68
|
+
height: 20px;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.labelled-slider input[type="range"]::-moz-range-thumb {
|
|
72
|
+
width: 0px;
|
|
73
|
+
box-shadow: none;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.labelled-slider input[type="range"]::-moz-range-progress {
|
|
77
|
+
background: black;
|
|
78
|
+
height: 100%;
|
|
79
|
+
width: 100%;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.labelled-slider input[type="range"]::-moz-range-track {
|
|
83
|
+
background-color: transparent;
|
|
84
|
+
box-shadow: none;
|
|
85
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { TinyLabel } from "../labels/labels";
|
|
3
|
+
import "./slider.css";
|
|
4
|
+
|
|
5
|
+
export default class Slider extends React.Component<
|
|
6
|
+
React.InputHTMLAttributes<HTMLInputElement>,
|
|
7
|
+
HTMLInputElement
|
|
8
|
+
> {
|
|
9
|
+
render(): React.ReactNode {
|
|
10
|
+
return <input type="range" {...this.props} />;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
interface Props extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
15
|
+
label: (value: number) => string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
interface State {
|
|
19
|
+
value: number;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export class LabelledSlider extends React.Component<Props, State> {
|
|
23
|
+
constructor(props: Props) {
|
|
24
|
+
super(props);
|
|
25
|
+
this.state = {
|
|
26
|
+
value: (props.value as number) || 0,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
static percentageLabel(value: number): string {
|
|
31
|
+
return `${Math.round(value * 100)}%`;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
static rawValue(value: number): string {
|
|
35
|
+
return value.toString();
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
render(): React.ReactNode {
|
|
39
|
+
const sliderProps = {
|
|
40
|
+
value: this.props.value,
|
|
41
|
+
step: this.props.step,
|
|
42
|
+
min: this.props.min,
|
|
43
|
+
max: this.props.max,
|
|
44
|
+
onChange: (e: any) => {
|
|
45
|
+
this.setState({ value: parseFloat(e.target.value) });
|
|
46
|
+
if (this.props.onChange) {
|
|
47
|
+
this.props.onChange(e);
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
return (
|
|
53
|
+
<div className="labelled-slider">
|
|
54
|
+
<Slider {...sliderProps} />
|
|
55
|
+
<TinyLabel>
|
|
56
|
+
{this.props.label ? this.props.label(this.state.value) : ""}
|
|
57
|
+
</TinyLabel>
|
|
58
|
+
</div>
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import "./spacing.css";
|
|
2
|
+
|
|
3
|
+
export class Spacing {
|
|
4
|
+
static readonly xxl = "var(--spacing-xxl)";
|
|
5
|
+
static readonly xl = "var(--spacing-xl)";
|
|
6
|
+
static readonly l = "var(--spacing-l)";
|
|
7
|
+
static readonly m = "var(--spacing-m)";
|
|
8
|
+
static readonly s = "var(--spacing-s)";
|
|
9
|
+
static readonly xs = "var(--spacing-xs)";
|
|
10
|
+
static readonly xxs = "var(--spacing-xxs)";
|
|
11
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./stack-list.css";
|
|
3
|
+
|
|
4
|
+
export class StackList extends React.Component<
|
|
5
|
+
React.HTMLAttributes<HTMLDivElement>
|
|
6
|
+
> {
|
|
7
|
+
render() {
|
|
8
|
+
return (
|
|
9
|
+
<div className="stack-list" {...this.props}>
|
|
10
|
+
{React.Children.map(this.props.children, (child, i) => {
|
|
11
|
+
return <div key={`child-${i}`}>{child}</div>;
|
|
12
|
+
})}
|
|
13
|
+
</div>
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
.tab-layout {
|
|
2
|
+
flex: 0 1 auto;
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: row;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.tab-layout > * {
|
|
8
|
+
flex: 1 0 0px;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.tab {
|
|
12
|
+
border-bottom: 2px solid transparent;
|
|
13
|
+
cursor: pointer;
|
|
14
|
+
padding: 5px;
|
|
15
|
+
font-size: 15px;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.tab:focus {
|
|
19
|
+
background-color: rgba(255, 255, 255, 0.2);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.tab.selected {
|
|
23
|
+
border-bottom-color: white;
|
|
24
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Focusable } from "../focusable";
|
|
3
|
+
import "./tabs.css";
|
|
4
|
+
|
|
5
|
+
export class TabLayout extends React.Component<
|
|
6
|
+
React.HTMLAttributes<HTMLDivElement>
|
|
7
|
+
> {
|
|
8
|
+
render() {
|
|
9
|
+
return (
|
|
10
|
+
<div className="tab-layout" {...this.props}>
|
|
11
|
+
{this.props.children}
|
|
12
|
+
</div>
|
|
13
|
+
);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
interface TabProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
18
|
+
selected?: boolean;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export class Tab extends Focusable<TabProps> {
|
|
22
|
+
get className(): string {
|
|
23
|
+
let className = "tab";
|
|
24
|
+
if (this.props.selected) {
|
|
25
|
+
className += " selected";
|
|
26
|
+
}
|
|
27
|
+
return className;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import "./typography.css";
|
|
2
|
+
|
|
3
|
+
export class Typography {
|
|
4
|
+
static readonly xxl = "var(--font-size-xxl)";
|
|
5
|
+
static readonly xl = "var(--font-size-xl)";
|
|
6
|
+
static readonly l = "var(--font-size-l)";
|
|
7
|
+
static readonly m = "var(--font-size-m)";
|
|
8
|
+
static readonly s = "var(--font-size-s)";
|
|
9
|
+
static readonly xs = "var(--font-size-xs)";
|
|
10
|
+
static readonly xxs = "var(--font-size-xxs)";
|
|
11
|
+
}
|
package/tsconfig.json
ADDED