@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,22 @@
|
|
|
1
|
+
name: Check
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
branches:
|
|
5
|
+
- main
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
jobs:
|
|
8
|
+
check:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
concurrency:
|
|
11
|
+
group: deploy-web-${{ github.ref }}
|
|
12
|
+
cancel-in-progress: true
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/setup-node@v3
|
|
15
|
+
with:
|
|
16
|
+
node-version: 18
|
|
17
|
+
- name: Check out repository code
|
|
18
|
+
uses: actions/checkout@v3
|
|
19
|
+
- name: Install dependencies
|
|
20
|
+
run: npm install
|
|
21
|
+
- name: Test
|
|
22
|
+
run: npm test
|
package/README.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
.vertical-center {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
justify-content: center;
|
|
5
|
+
height: 100%;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.horizontal-center {
|
|
9
|
+
margin: auto;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.align-right {
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: row;
|
|
15
|
+
justify-content: end;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.narrow-column {
|
|
19
|
+
width: 100%;
|
|
20
|
+
max-width: 50%;
|
|
21
|
+
max-height: 100%;
|
|
22
|
+
margin-left: auto;
|
|
23
|
+
margin-right: auto;
|
|
24
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import "./alignment.css";
|
|
2
|
+
import { ComponentWithClassName } from "../component-with-class-name";
|
|
3
|
+
export declare class VerticalCenter extends ComponentWithClassName {
|
|
4
|
+
protected readonly className = "vertical-center";
|
|
5
|
+
}
|
|
6
|
+
export declare class HorizontalCenter extends ComponentWithClassName {
|
|
7
|
+
protected readonly className = "horizontal-center";
|
|
8
|
+
}
|
|
9
|
+
export declare class AlignRight extends ComponentWithClassName {
|
|
10
|
+
protected readonly className = "align-right";
|
|
11
|
+
}
|
|
12
|
+
export declare class NarrowColumn extends ComponentWithClassName {
|
|
13
|
+
protected readonly className = "narrow-column";
|
|
14
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NarrowColumn = exports.AlignRight = exports.HorizontalCenter = exports.VerticalCenter = void 0;
|
|
4
|
+
require("./alignment.css");
|
|
5
|
+
const component_with_class_name_1 = require("../component-with-class-name");
|
|
6
|
+
class VerticalCenter extends component_with_class_name_1.ComponentWithClassName {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
this.className = "vertical-center";
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
exports.VerticalCenter = VerticalCenter;
|
|
13
|
+
class HorizontalCenter extends component_with_class_name_1.ComponentWithClassName {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
|
+
this.className = "horizontal-center";
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.HorizontalCenter = HorizontalCenter;
|
|
20
|
+
class AlignRight extends component_with_class_name_1.ComponentWithClassName {
|
|
21
|
+
constructor() {
|
|
22
|
+
super(...arguments);
|
|
23
|
+
this.className = "align-right";
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.AlignRight = AlignRight;
|
|
27
|
+
class NarrowColumn extends component_with_class_name_1.ComponentWithClassName {
|
|
28
|
+
constructor() {
|
|
29
|
+
super(...arguments);
|
|
30
|
+
this.className = "narrow-column";
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.NarrowColumn = NarrowColumn;
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
.animate-in {
|
|
2
|
+
animation: animate-in 0.2s ease-out;
|
|
3
|
+
animation-fill-mode: both;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.zoom-in {
|
|
7
|
+
opacity: 1;
|
|
8
|
+
animation: zoom-in 0.2s ease-out;
|
|
9
|
+
animation-fill-mode: forwards;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.slide-up {
|
|
13
|
+
transform: none;
|
|
14
|
+
opacity: 0;
|
|
15
|
+
animation: slide-up 0.5s ease-out;
|
|
16
|
+
animation-fill-mode: forwards;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.slide-down {
|
|
20
|
+
transform: none;
|
|
21
|
+
opacity: 0;
|
|
22
|
+
animation: slide-down 0.1s linear;
|
|
23
|
+
animation-fill-mode: forwards;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.fade-in {
|
|
27
|
+
opacity: 0;
|
|
28
|
+
animation: fade-in 1s ease-out;
|
|
29
|
+
animation-fill-mode: forwards;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.shake {
|
|
33
|
+
position: relative;
|
|
34
|
+
animation: shake 0.2s;
|
|
35
|
+
animation-iteration-count: infinite;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@keyframes animate-in {
|
|
39
|
+
0% {
|
|
40
|
+
opacity: 0;
|
|
41
|
+
transform: scale(110%, 110%);
|
|
42
|
+
}
|
|
43
|
+
100% {
|
|
44
|
+
opacity: 1;
|
|
45
|
+
transform: translateY(0px);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
@keyframes zoom-in {
|
|
50
|
+
0% {
|
|
51
|
+
opacity: 1;
|
|
52
|
+
transform: none;
|
|
53
|
+
}
|
|
54
|
+
100% {
|
|
55
|
+
opacity: 0;
|
|
56
|
+
transform: scale(200%, 200%);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
@keyframes slide-up {
|
|
61
|
+
0% {
|
|
62
|
+
opacity: 0;
|
|
63
|
+
transform: translateY(50px);
|
|
64
|
+
}
|
|
65
|
+
100% {
|
|
66
|
+
opacity: 1;
|
|
67
|
+
transform: translateY(0px);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
@keyframes slide-down {
|
|
72
|
+
0% {
|
|
73
|
+
opacity: 0;
|
|
74
|
+
transform: translateY(-200px);
|
|
75
|
+
}
|
|
76
|
+
100% {
|
|
77
|
+
opacity: 1;
|
|
78
|
+
transform: translateY(0px);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
@keyframes fade-in {
|
|
83
|
+
0% {
|
|
84
|
+
opacity: 0;
|
|
85
|
+
}
|
|
86
|
+
100% {
|
|
87
|
+
opacity: 1;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
@keyframes shake {
|
|
92
|
+
0% {
|
|
93
|
+
transform: translate(4px, 4px);
|
|
94
|
+
}
|
|
95
|
+
10% {
|
|
96
|
+
transform: translate(-4px, -4px);
|
|
97
|
+
}
|
|
98
|
+
20% {
|
|
99
|
+
transform: translate(-4px, 0px);
|
|
100
|
+
}
|
|
101
|
+
30% {
|
|
102
|
+
transform: translate(4px, 4px);
|
|
103
|
+
}
|
|
104
|
+
40% {
|
|
105
|
+
transform: translate(4px, -4px);
|
|
106
|
+
}
|
|
107
|
+
50% {
|
|
108
|
+
transform: translate(-4px, 4px);
|
|
109
|
+
}
|
|
110
|
+
60% {
|
|
111
|
+
transform: translate(-4px, 4px);
|
|
112
|
+
}
|
|
113
|
+
70% {
|
|
114
|
+
transform: translate(4px, 4px);
|
|
115
|
+
}
|
|
116
|
+
80% {
|
|
117
|
+
transform: translate(-4px, -4px);
|
|
118
|
+
}
|
|
119
|
+
90% {
|
|
120
|
+
transform: translate(4px, 4px);
|
|
121
|
+
}
|
|
122
|
+
100% {
|
|
123
|
+
transform: translate(4px, -4px);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AnimateInSequence = void 0;
|
|
4
|
+
require("./animations.css");
|
|
5
|
+
class AnimateInSequence {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.delay = 0;
|
|
8
|
+
this.interval = 0.05;
|
|
9
|
+
this.animationClassName = "animate-in";
|
|
10
|
+
}
|
|
11
|
+
next(extraStyle = {}) {
|
|
12
|
+
const delay = this.delay;
|
|
13
|
+
this.delay += this.interval;
|
|
14
|
+
return {
|
|
15
|
+
className: this.animationClassName,
|
|
16
|
+
style: {
|
|
17
|
+
animationDelay: delay + "s",
|
|
18
|
+
...extraStyle,
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.AnimateInSequence = AnimateInSequence;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.BalancedRow = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
require("./balanced-row.css");
|
|
9
|
+
class BalancedRow extends react_1.default.Component {
|
|
10
|
+
render() {
|
|
11
|
+
return (react_1.default.createElement("div", { className: "balanced-row", ...this.props }, react_1.default.Children.map(this.props.children, (child, i) => {
|
|
12
|
+
return react_1.default.createElement("div", { key: `child-${i}` }, child);
|
|
13
|
+
})));
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.BalancedRow = BalancedRow;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.BalancedStack = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
require("./balanced-stack.css");
|
|
9
|
+
class BalancedStack extends react_1.default.Component {
|
|
10
|
+
render() {
|
|
11
|
+
return (react_1.default.createElement("div", { className: "balanced-stack" }, react_1.default.Children.map(this.props.children, (child, i) => {
|
|
12
|
+
return react_1.default.createElement("div", { key: `child-${i}` }, child);
|
|
13
|
+
})));
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.BalancedStack = BalancedStack;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MainButton = void 0;
|
|
4
|
+
require("./buttons.css");
|
|
5
|
+
const focusable_1 = require("../focusable");
|
|
6
|
+
class MainButton extends focusable_1.Focusable {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
this.className = "main-button";
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
exports.MainButton = MainButton;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export declare abstract class ComponentWithClassName<Props extends React.HTMLAttributes<HTMLDivElement> = React.HTMLAttributes<HTMLDivElement>> extends React.Component<Props> {
|
|
3
|
+
protected abstract readonly className: string;
|
|
4
|
+
render(): React.JSX.Element;
|
|
5
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ComponentWithClassName = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
class ComponentWithClassName extends react_1.default.Component {
|
|
9
|
+
render() {
|
|
10
|
+
const props = { ...this.props };
|
|
11
|
+
props.className = this.className + " " + (this.props.className || "");
|
|
12
|
+
return react_1.default.createElement("div", { ...props }, this.props.children);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.ComponentWithClassName = ComponentWithClassName;
|
package/lib/dim/dim.css
ADDED
package/lib/dim/dim.d.ts
ADDED
package/lib/dim/dim.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Dim = void 0;
|
|
4
|
+
const component_with_class_name_1 = require("../component-with-class-name");
|
|
5
|
+
require("./dim.css");
|
|
6
|
+
class Dim extends component_with_class_name_1.ComponentWithClassName {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
this.className = "dim";
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
exports.Dim = Dim;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.FlowList = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
require("./flow-list.css");
|
|
9
|
+
class FlowList extends react_1.default.Component {
|
|
10
|
+
render() {
|
|
11
|
+
return (react_1.default.createElement("div", { className: "flow-list", ...this.props }, react_1.default.Children.map(this.props.children, (child, i) => {
|
|
12
|
+
return react_1.default.createElement("div", { key: `child-${i}` }, child);
|
|
13
|
+
})));
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.FlowList = FlowList;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface Props extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
disabled?: boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare abstract class Focusable<PropsType extends Props = Props> extends React.Component<PropsType> {
|
|
6
|
+
protected abstract readonly className: string;
|
|
7
|
+
private divElement;
|
|
8
|
+
private onMouseOver;
|
|
9
|
+
private keyUp;
|
|
10
|
+
protected saneProps(): Props;
|
|
11
|
+
render(): React.JSX.Element;
|
|
12
|
+
}
|
|
13
|
+
export {};
|
package/lib/focusable.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Focusable = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
class Focusable extends react_1.default.Component {
|
|
9
|
+
onMouseOver() {
|
|
10
|
+
this.divElement.focus();
|
|
11
|
+
}
|
|
12
|
+
keyUp(event) {
|
|
13
|
+
if (this.props.disabled) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
17
|
+
this.divElement.click();
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
saneProps() {
|
|
21
|
+
return this.props;
|
|
22
|
+
}
|
|
23
|
+
render() {
|
|
24
|
+
const props = { ...this.saneProps() };
|
|
25
|
+
props.className = props.className || "";
|
|
26
|
+
props.className += " " + this.className;
|
|
27
|
+
props.className += " " + (this.props.disabled ? "disabled" : "");
|
|
28
|
+
return (react_1.default.createElement("div", { ...props, onMouseOver: () => this.onMouseOver(), onKeyUp: (e) => this.keyUp(e), ref: (div) => (this.divElement = div) }, props.children));
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.Focusable = Focusable;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Frame = void 0;
|
|
4
|
+
const focusable_1 = require("../focusable");
|
|
5
|
+
require("./frame.css");
|
|
6
|
+
class Frame extends focusable_1.Focusable {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
this.className = "frame";
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
exports.Frame = Frame;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
.gauge {
|
|
2
|
+
width: 100%;
|
|
3
|
+
height: 20px;
|
|
4
|
+
background-color: #444;
|
|
5
|
+
overflow: hidden;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.gauge > div {
|
|
9
|
+
height: 100%;
|
|
10
|
+
background-color: #fff;
|
|
11
|
+
transition: width 100ms linear;
|
|
12
|
+
position: relative;
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: row;
|
|
15
|
+
justify-content: end;
|
|
16
|
+
padding: var(--spacing-xxs);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.gauge > div > * {
|
|
20
|
+
color: black;
|
|
21
|
+
font-size: 15px;
|
|
22
|
+
flex: 0 0 auto;
|
|
23
|
+
align-self: center;
|
|
24
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Gauge = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
require("./gauge.css");
|
|
9
|
+
class Gauge extends react_1.default.Component {
|
|
10
|
+
render() {
|
|
11
|
+
return (react_1.default.createElement("div", { className: "gauge", ...this.props },
|
|
12
|
+
react_1.default.createElement("div", { style: {
|
|
13
|
+
width: `${Math.max(0, Math.min(100, this.props.value * 100))}%`,
|
|
14
|
+
} },
|
|
15
|
+
react_1.default.createElement("label", null, this.props.label))));
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.Gauge = Gauge;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
.highlightable-row {
|
|
2
|
+
background-color: rgba(0, 0, 0, 0.2);
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.highlightable-row:focus {
|
|
6
|
+
background-color: rgba(255, 255, 255, 0.2) !important;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.screen-layout-column > .screen-layout-column-main-column .highlightable-row {
|
|
10
|
+
background-color: transparent;
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Focusable } from "../focusable";
|
|
3
|
+
import "./highlightable-row.css";
|
|
4
|
+
interface Props extends React.HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
highlighted?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare class HighlightableRow extends Focusable<Props> {
|
|
8
|
+
protected saneProps(): Props;
|
|
9
|
+
protected get className(): string;
|
|
10
|
+
}
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HighlightableRow = void 0;
|
|
4
|
+
const focusable_1 = require("../focusable");
|
|
5
|
+
require("./highlightable-row.css");
|
|
6
|
+
class HighlightableRow extends focusable_1.Focusable {
|
|
7
|
+
saneProps() {
|
|
8
|
+
const { highlighted, ...other } = this.props;
|
|
9
|
+
return other;
|
|
10
|
+
}
|
|
11
|
+
get className() {
|
|
12
|
+
return "highlightable-row" + (this.props.highlighted ? " highlighted" : "");
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.HighlightableRow = HighlightableRow;
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import "./reset/reset.css";
|
|
2
|
+
export * from "./animations/animations";
|
|
3
|
+
export * from "./alignment/alignment";
|
|
4
|
+
export * from "./balanced-row/balanced-row";
|
|
5
|
+
export * from "./balanced-stack/balanced-stack";
|
|
6
|
+
export * from "./buttons/buttons";
|
|
7
|
+
export * from "./dim/dim";
|
|
8
|
+
export * from "./flow-list/flow-list";
|
|
9
|
+
export * from "./focusable";
|
|
10
|
+
export * from "./frame/frame";
|
|
11
|
+
export * from "./gauge/gauge";
|
|
12
|
+
export * from "./highlightable-row/highlightable-row";
|
|
13
|
+
export * from "./key-value-layout/key-value-layout";
|
|
14
|
+
export * from "./labels/labels";
|
|
15
|
+
export * from "./screen-column-layout/screen-column-layout";
|
|
16
|
+
export * from "./screen-stack-layout/screen-stack-layout";
|
|
17
|
+
export * from "./scrollable-content/scrollable-content";
|
|
18
|
+
export * from "./slider/slider";
|
|
19
|
+
export * from "./spacing/spacing";
|
|
20
|
+
export * from "./stack-list/stack-list";
|
|
21
|
+
export * from "./tabs/tabs";
|
|
22
|
+
export * from "./typography/typography";
|