@remvst/design-system 1.0.0 → 1.1.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 +19 -19
- package/.prettierrc +4 -0
- package/lib/alignment/alignment.css +13 -13
- package/lib/alignment/alignment.d.ts +1 -1
- package/lib/alignment/alignment.js +1 -1
- package/lib/animations/animations.css +90 -90
- package/lib/balanced-row/balanced-row.css +4 -4
- package/lib/balanced-stack/balanced-stack.css +5 -5
- package/lib/buttons/buttons.css +5 -5
- package/lib/buttons/buttons.d.ts +3 -1
- package/lib/buttons/buttons.js +8 -1
- package/lib/dim/dim.css +3 -3
- package/lib/flow-list/flow-list.css +5 -5
- package/lib/focusable.d.ts +1 -0
- package/lib/focusable.js +6 -3
- package/lib/frame/frame.css +1 -1
- package/lib/gauge/gauge.css +16 -16
- package/lib/highlightable-row/highlightable-row.css +3 -3
- package/lib/highlightable-row/highlightable-row.js +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/key-value-layout/key-value-layout.css +7 -7
- package/lib/labels/labels.css +13 -13
- package/lib/reset/reset.css +8 -8
- package/lib/screen-column-layout/screen-column-layout.css +77 -77
- package/lib/screen-stack-layout/screen-stack-layout.css +14 -14
- package/lib/scrollable-content/scrollable-content.css +3 -3
- package/lib/slider/slider.css +44 -44
- package/lib/spacing/spacing.css +7 -7
- package/lib/stack-list/stack-list.css +2 -2
- package/lib/tabs/tabs.css +10 -10
- package/lib/typography/typography.css +7 -7
- package/package.json +26 -25
- package/src/alignment/alignment.css +13 -13
- package/src/alignment/alignment.tsx +5 -5
- package/src/animations/animations.css +90 -90
- package/src/animations/animations.ts +14 -14
- package/src/balanced-row/balanced-row.css +4 -4
- package/src/balanced-row/balanced-row.tsx +10 -10
- package/src/balanced-stack/balanced-stack.css +5 -5
- package/src/balanced-stack/balanced-stack.tsx +10 -10
- package/src/buttons/buttons.css +5 -5
- package/src/buttons/buttons.tsx +7 -2
- package/src/component-with-class-name.tsx +8 -8
- package/src/dim/dim.css +3 -3
- package/src/dim/dim.tsx +1 -1
- package/src/flow-list/flow-list.css +5 -5
- package/src/flow-list/flow-list.tsx +10 -10
- package/src/focusable.tsx +39 -35
- package/src/frame/frame.css +1 -1
- package/src/frame/frame.tsx +1 -1
- package/src/gauge/gauge.css +16 -16
- package/src/gauge/gauge.tsx +19 -16
- package/src/highlightable-row/highlightable-row.css +3 -3
- package/src/highlightable-row/highlightable-row.tsx +10 -8
- package/src/index.ts +1 -1
- package/src/key-value-layout/key-value-layout.css +7 -7
- package/src/key-value-layout/key-value-layout.tsx +1 -1
- package/src/labels/labels.css +13 -13
- package/src/labels/labels.tsx +7 -7
- package/src/reset/reset.css +8 -8
- package/src/screen-column-layout/screen-column-layout.css +77 -77
- package/src/screen-column-layout/screen-column-layout.tsx +6 -6
- package/src/screen-stack-layout/screen-stack-layout.css +14 -14
- package/src/screen-stack-layout/screen-stack-layout.tsx +4 -4
- package/src/scrollable-content/scrollable-content.css +3 -3
- package/src/scrollable-content/scrollable-content.tsx +1 -1
- package/src/slider/slider.css +44 -44
- package/src/slider/slider.tsx +45 -45
- package/src/spacing/spacing.css +7 -7
- package/src/spacing/spacing.ts +7 -7
- package/src/stack-list/stack-list.css +2 -2
- package/src/stack-list/stack-list.tsx +10 -10
- package/src/tabs/tabs.css +10 -10
- package/src/tabs/tabs.tsx +15 -15
- package/src/typography/typography.css +7 -7
- package/src/typography/typography.ts +7 -7
- package/tsconfig.json +11 -11
package/src/slider/slider.tsx
CHANGED
|
@@ -3,59 +3,59 @@ import { TinyLabel } from "../labels/labels";
|
|
|
3
3
|
import "./slider.css";
|
|
4
4
|
|
|
5
5
|
export default class Slider extends React.Component<
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
React.InputHTMLAttributes<HTMLInputElement>,
|
|
7
|
+
HTMLInputElement
|
|
8
8
|
> {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
render(): React.ReactNode {
|
|
10
|
+
return <input type="range" {...this.props} />;
|
|
11
|
+
}
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
interface Props extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
15
|
-
|
|
15
|
+
label: (value: number) => string;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
interface State {
|
|
19
|
-
|
|
19
|
+
value: number;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
export class LabelledSlider extends React.Component<Props, State> {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
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
61
|
}
|
package/src/spacing/spacing.css
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
:root {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
--spacing-xxl: 32px;
|
|
3
|
+
--spacing-xl: 24px;
|
|
4
|
+
--spacing-l: 20px;
|
|
5
|
+
--spacing-m: 16px;
|
|
6
|
+
--spacing-s: 12px;
|
|
7
|
+
--spacing-xs: 8px;
|
|
8
|
+
--spacing-xxs: 4px;
|
|
9
9
|
}
|
package/src/spacing/spacing.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import "./spacing.css";
|
|
2
2
|
|
|
3
3
|
export class Spacing {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
11
|
}
|
|
@@ -2,15 +2,15 @@ import React from "react";
|
|
|
2
2
|
import "./stack-list.css";
|
|
3
3
|
|
|
4
4
|
export class StackList extends React.Component<
|
|
5
|
-
|
|
5
|
+
React.HTMLAttributes<HTMLDivElement>
|
|
6
6
|
> {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
16
|
}
|
package/src/tabs/tabs.css
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
.tab-layout {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
flex: 0 1 auto;
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: row;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
.tab-layout > * {
|
|
8
|
-
|
|
8
|
+
flex: 1 0 0px;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
.tab {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
border-bottom: 2px solid transparent;
|
|
13
|
+
cursor: pointer;
|
|
14
|
+
padding: 5px;
|
|
15
|
+
font-size: 15px;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
.tab:focus {
|
|
19
|
-
|
|
19
|
+
background-color: rgba(255, 255, 255, 0.2);
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
.tab.selected {
|
|
23
|
-
|
|
23
|
+
border-bottom-color: white;
|
|
24
24
|
}
|
package/src/tabs/tabs.tsx
CHANGED
|
@@ -3,27 +3,27 @@ import { Focusable } from "../focusable";
|
|
|
3
3
|
import "./tabs.css";
|
|
4
4
|
|
|
5
5
|
export class TabLayout extends React.Component<
|
|
6
|
-
|
|
6
|
+
React.HTMLAttributes<HTMLDivElement>
|
|
7
7
|
> {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
render() {
|
|
9
|
+
return (
|
|
10
|
+
<div className="tab-layout" {...this.props}>
|
|
11
|
+
{this.props.children}
|
|
12
|
+
</div>
|
|
13
|
+
);
|
|
14
|
+
}
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
interface TabProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
18
|
-
|
|
18
|
+
selected?: boolean;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
export class Tab extends Focusable<TabProps> {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
get className(): string {
|
|
23
|
+
let className = "tab";
|
|
24
|
+
if (this.props.selected) {
|
|
25
|
+
className += " selected";
|
|
26
|
+
}
|
|
27
|
+
return className;
|
|
26
28
|
}
|
|
27
|
-
return className;
|
|
28
|
-
}
|
|
29
29
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
:root {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
--font-size-xxl: 32px;
|
|
3
|
+
--font-size-xl: 24px;
|
|
4
|
+
--font-size-l: 20px;
|
|
5
|
+
--font-size-m: 16px;
|
|
6
|
+
--font-size-s: 12px;
|
|
7
|
+
--font-size-xs: 8px;
|
|
8
|
+
--font-size-xxs: 4px;
|
|
9
9
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import "./typography.css";
|
|
2
2
|
|
|
3
3
|
export class Typography {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
11
|
}
|
package/tsconfig.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "es2020",
|
|
4
|
+
"module": "commonjs",
|
|
5
|
+
"esModuleInterop": true,
|
|
6
|
+
"allowJs": false,
|
|
7
|
+
"outDir": "./lib",
|
|
8
|
+
"declaration": true,
|
|
9
|
+
"jsx": "react"
|
|
10
|
+
},
|
|
11
|
+
"include": ["./src"],
|
|
12
|
+
"exclude": ["node_modules"]
|
|
13
13
|
}
|