@remvst/design-system 1.0.0 → 1.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.
Files changed (77) hide show
  1. package/.github/workflows/check.yaml +19 -19
  2. package/.prettierrc +4 -0
  3. package/lib/alignment/alignment.css +13 -13
  4. package/lib/alignment/alignment.d.ts +1 -1
  5. package/lib/alignment/alignment.js +1 -1
  6. package/lib/animations/animations.css +90 -90
  7. package/lib/balanced-row/balanced-row.css +4 -4
  8. package/lib/balanced-stack/balanced-stack.css +5 -5
  9. package/lib/buttons/buttons.css +5 -5
  10. package/lib/buttons/buttons.d.ts +1 -1
  11. package/lib/buttons/buttons.js +1 -1
  12. package/lib/dim/dim.css +3 -3
  13. package/lib/flow-list/flow-list.css +5 -5
  14. package/lib/focusable.js +2 -2
  15. package/lib/frame/frame.css +1 -1
  16. package/lib/gauge/gauge.css +16 -16
  17. package/lib/highlightable-row/highlightable-row.css +3 -3
  18. package/lib/highlightable-row/highlightable-row.js +1 -1
  19. package/lib/index.d.ts +1 -1
  20. package/lib/index.js +1 -1
  21. package/lib/key-value-layout/key-value-layout.css +7 -7
  22. package/lib/labels/labels.css +13 -13
  23. package/lib/reset/reset.css +8 -8
  24. package/lib/screen-column-layout/screen-column-layout.css +77 -77
  25. package/lib/screen-stack-layout/screen-stack-layout.css +14 -14
  26. package/lib/scrollable-content/scrollable-content.css +3 -3
  27. package/lib/slider/slider.css +44 -44
  28. package/lib/spacing/spacing.css +7 -7
  29. package/lib/stack-list/stack-list.css +2 -2
  30. package/lib/tabs/tabs.css +10 -10
  31. package/lib/typography/typography.css +7 -7
  32. package/package.json +26 -25
  33. package/src/alignment/alignment.css +13 -13
  34. package/src/alignment/alignment.tsx +5 -5
  35. package/src/animations/animations.css +90 -90
  36. package/src/animations/animations.ts +14 -14
  37. package/src/balanced-row/balanced-row.css +4 -4
  38. package/src/balanced-row/balanced-row.tsx +10 -10
  39. package/src/balanced-stack/balanced-stack.css +5 -5
  40. package/src/balanced-stack/balanced-stack.tsx +10 -10
  41. package/src/buttons/buttons.css +5 -5
  42. package/src/buttons/buttons.tsx +2 -2
  43. package/src/component-with-class-name.tsx +8 -8
  44. package/src/dim/dim.css +3 -3
  45. package/src/dim/dim.tsx +1 -1
  46. package/src/flow-list/flow-list.css +5 -5
  47. package/src/flow-list/flow-list.tsx +10 -10
  48. package/src/focusable.tsx +35 -35
  49. package/src/frame/frame.css +1 -1
  50. package/src/frame/frame.tsx +1 -1
  51. package/src/gauge/gauge.css +16 -16
  52. package/src/gauge/gauge.tsx +19 -16
  53. package/src/highlightable-row/highlightable-row.css +3 -3
  54. package/src/highlightable-row/highlightable-row.tsx +10 -8
  55. package/src/index.ts +1 -1
  56. package/src/key-value-layout/key-value-layout.css +7 -7
  57. package/src/key-value-layout/key-value-layout.tsx +1 -1
  58. package/src/labels/labels.css +13 -13
  59. package/src/labels/labels.tsx +7 -7
  60. package/src/reset/reset.css +8 -8
  61. package/src/screen-column-layout/screen-column-layout.css +77 -77
  62. package/src/screen-column-layout/screen-column-layout.tsx +6 -6
  63. package/src/screen-stack-layout/screen-stack-layout.css +14 -14
  64. package/src/screen-stack-layout/screen-stack-layout.tsx +4 -4
  65. package/src/scrollable-content/scrollable-content.css +3 -3
  66. package/src/scrollable-content/scrollable-content.tsx +1 -1
  67. package/src/slider/slider.css +44 -44
  68. package/src/slider/slider.tsx +45 -45
  69. package/src/spacing/spacing.css +7 -7
  70. package/src/spacing/spacing.ts +7 -7
  71. package/src/stack-list/stack-list.css +2 -2
  72. package/src/stack-list/stack-list.tsx +10 -10
  73. package/src/tabs/tabs.css +10 -10
  74. package/src/tabs/tabs.tsx +15 -15
  75. package/src/typography/typography.css +7 -7
  76. package/src/typography/typography.ts +7 -7
  77. package/tsconfig.json +11 -11
@@ -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
- React.InputHTMLAttributes<HTMLInputElement>,
7
- HTMLInputElement
6
+ React.InputHTMLAttributes<HTMLInputElement>,
7
+ HTMLInputElement
8
8
  > {
9
- render(): React.ReactNode {
10
- return <input type="range" {...this.props} />;
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
- label: (value: number) => string;
15
+ label: (value: number) => string;
16
16
  }
17
17
 
18
18
  interface State {
19
- value: number;
19
+ value: number;
20
20
  }
21
21
 
22
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
- }
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
  }
@@ -1,9 +1,9 @@
1
1
  :root {
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;
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
  }
@@ -1,11 +1,11 @@
1
1
  import "./spacing.css";
2
2
 
3
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)";
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
  }
@@ -1,4 +1,4 @@
1
1
  .stack-list {
2
- display: flex;
3
- flex-direction: column;
2
+ display: flex;
3
+ flex-direction: column;
4
4
  }
@@ -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
- React.HTMLAttributes<HTMLDivElement>
5
+ React.HTMLAttributes<HTMLDivElement>
6
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
- }
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
- flex: 0 1 auto;
3
- display: flex;
4
- flex-direction: row;
2
+ flex: 0 1 auto;
3
+ display: flex;
4
+ flex-direction: row;
5
5
  }
6
6
 
7
7
  .tab-layout > * {
8
- flex: 1 0 0px;
8
+ flex: 1 0 0px;
9
9
  }
10
10
 
11
11
  .tab {
12
- border-bottom: 2px solid transparent;
13
- cursor: pointer;
14
- padding: 5px;
15
- font-size: 15px;
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
- background-color: rgba(255, 255, 255, 0.2);
19
+ background-color: rgba(255, 255, 255, 0.2);
20
20
  }
21
21
 
22
22
  .tab.selected {
23
- border-bottom-color: white;
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
- React.HTMLAttributes<HTMLDivElement>
6
+ React.HTMLAttributes<HTMLDivElement>
7
7
  > {
8
- render() {
9
- return (
10
- <div className="tab-layout" {...this.props}>
11
- {this.props.children}
12
- </div>
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
- selected?: boolean;
18
+ selected?: boolean;
19
19
  }
20
20
 
21
21
  export class Tab extends Focusable<TabProps> {
22
- get className(): string {
23
- let className = "tab";
24
- if (this.props.selected) {
25
- className += " selected";
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
- --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;
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
- 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)";
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
- "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"]
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
  }