@remvst/design-system 1.0.1 → 1.1.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/lib/buttons/buttons.css +8 -0
- package/lib/buttons/buttons.d.ts +2 -0
- package/lib/buttons/buttons.js +7 -0
- package/lib/focusable.d.ts +1 -0
- package/lib/focusable.js +4 -1
- package/package.json +1 -1
- package/src/buttons/buttons.css +8 -0
- package/src/buttons/buttons.tsx +5 -0
- package/src/focusable.tsx +5 -1
package/lib/buttons/buttons.css
CHANGED
|
@@ -2,9 +2,17 @@
|
|
|
2
2
|
text-align: center;
|
|
3
3
|
cursor: pointer;
|
|
4
4
|
font-size: 20px;
|
|
5
|
+
|
|
6
|
+
display: flex;
|
|
7
|
+
justify-content: center;
|
|
8
|
+
align-items: center;
|
|
5
9
|
}
|
|
6
10
|
|
|
7
11
|
.main-button.disabled {
|
|
8
12
|
color: #888;
|
|
9
13
|
pointer-events: none;
|
|
10
14
|
}
|
|
15
|
+
|
|
16
|
+
.main-button > span {
|
|
17
|
+
flex: 1;
|
|
18
|
+
}
|
package/lib/buttons/buttons.d.ts
CHANGED
package/lib/buttons/buttons.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.MainButton = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
4
8
|
const focusable_1 = require("../focusable");
|
|
5
9
|
require("./buttons.css");
|
|
6
10
|
class MainButton extends focusable_1.Focusable {
|
|
@@ -8,5 +12,8 @@ class MainButton extends focusable_1.Focusable {
|
|
|
8
12
|
super(...arguments);
|
|
9
13
|
this.className = "main-button";
|
|
10
14
|
}
|
|
15
|
+
renderChildren() {
|
|
16
|
+
return react_1.default.createElement("span", null, super.renderChildren());
|
|
17
|
+
}
|
|
11
18
|
}
|
|
12
19
|
exports.MainButton = MainButton;
|
package/lib/focusable.d.ts
CHANGED
package/lib/focusable.js
CHANGED
|
@@ -25,7 +25,10 @@ class Focusable extends react_1.default.Component {
|
|
|
25
25
|
props.className = props.className || "";
|
|
26
26
|
props.className += " " + this.className;
|
|
27
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) },
|
|
28
|
+
return (react_1.default.createElement("div", { ...props, onMouseOver: () => this.onMouseOver(), onKeyUp: (e) => this.keyUp(e), ref: (div) => (this.divElement = div) }, this.renderChildren()));
|
|
29
|
+
}
|
|
30
|
+
renderChildren() {
|
|
31
|
+
return react_1.default.createElement(react_1.default.Fragment, null, this.props.children);
|
|
29
32
|
}
|
|
30
33
|
}
|
|
31
34
|
exports.Focusable = Focusable;
|
package/package.json
CHANGED
package/src/buttons/buttons.css
CHANGED
|
@@ -2,9 +2,17 @@
|
|
|
2
2
|
text-align: center;
|
|
3
3
|
cursor: pointer;
|
|
4
4
|
font-size: 20px;
|
|
5
|
+
|
|
6
|
+
display: flex;
|
|
7
|
+
justify-content: center;
|
|
8
|
+
align-items: center;
|
|
5
9
|
}
|
|
6
10
|
|
|
7
11
|
.main-button.disabled {
|
|
8
12
|
color: #888;
|
|
9
13
|
pointer-events: none;
|
|
10
14
|
}
|
|
15
|
+
|
|
16
|
+
.main-button > span {
|
|
17
|
+
flex: 1;
|
|
18
|
+
}
|
package/src/buttons/buttons.tsx
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
|
+
import React, { JSX } from "react";
|
|
1
2
|
import { Focusable } from "../focusable";
|
|
2
3
|
import "./buttons.css";
|
|
3
4
|
|
|
4
5
|
export class MainButton extends Focusable {
|
|
5
6
|
protected readonly className = "main-button";
|
|
7
|
+
|
|
8
|
+
protected renderChildren(): JSX.Element {
|
|
9
|
+
return <span>{super.renderChildren()}</span>;
|
|
10
|
+
}
|
|
6
11
|
}
|
package/src/focusable.tsx
CHANGED
|
@@ -41,8 +41,12 @@ export abstract class Focusable<
|
|
|
41
41
|
onKeyUp={(e) => this.keyUp(e)}
|
|
42
42
|
ref={(div) => (this.divElement = div)}
|
|
43
43
|
>
|
|
44
|
-
{
|
|
44
|
+
{this.renderChildren()}
|
|
45
45
|
</div>
|
|
46
46
|
);
|
|
47
47
|
}
|
|
48
|
+
|
|
49
|
+
protected renderChildren() {
|
|
50
|
+
return <>{this.props.children}</>;
|
|
51
|
+
}
|
|
48
52
|
}
|