@remvst/design-system 1.1.1 → 1.3.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.
Files changed (43) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/lib/alignment/alignment.js +6 -13
  3. package/lib/animations/animations.js +2 -6
  4. package/lib/balanced-row/balanced-row.js +7 -13
  5. package/lib/balanced-stack/balanced-stack.js +7 -13
  6. package/lib/buttons/buttons.js +5 -12
  7. package/lib/component-with-class-name.js +4 -10
  8. package/lib/dialog-layout/dialog-layout.css +76 -0
  9. package/lib/dialog-layout/dialog-layout.d.ts +12 -0
  10. package/lib/dialog-layout/dialog-layout.js +28 -0
  11. package/lib/dim/dim.css +11 -0
  12. package/lib/dim/dim.js +3 -7
  13. package/lib/dim/transitioning-dim.css +78 -0
  14. package/lib/dim/transitioning-dim.d.ts +10 -0
  15. package/lib/dim/transitioning-dim.js +26 -0
  16. package/lib/flow-list/flow-list.js +7 -13
  17. package/lib/focusable.js +5 -11
  18. package/lib/frame/frame.js +3 -7
  19. package/lib/gauge/gauge.js +6 -14
  20. package/lib/highlightable-row/highlightable-row.d.ts +0 -1
  21. package/lib/highlightable-row/highlightable-row.js +3 -7
  22. package/lib/index.d.ts +2 -0
  23. package/lib/index.js +24 -38
  24. package/lib/key-value-layout/key-value-layout.js +3 -7
  25. package/lib/labels/labels.js +9 -19
  26. package/lib/screen-column-layout/screen-column-layout.js +8 -17
  27. package/lib/screen-stack-layout/screen-stack-layout.js +6 -13
  28. package/lib/scrollable-content/scrollable-content.js +3 -7
  29. package/lib/slider/slider.js +8 -17
  30. package/lib/spacing/spacing.js +2 -6
  31. package/lib/stack-list/stack-list.js +7 -13
  32. package/lib/tabs/tabs.js +7 -14
  33. package/lib/typography/typography.js +2 -6
  34. package/package.json +24 -27
  35. package/src/dialog-layout/dialog-layout.css +76 -0
  36. package/src/dialog-layout/dialog-layout.tsx +35 -0
  37. package/src/dim/dim.css +11 -0
  38. package/src/dim/transitioning-dim.css +78 -0
  39. package/src/dim/transitioning-dim.tsx +39 -0
  40. package/src/index.ts +2 -0
  41. package/tsconfig.json +7 -7
  42. package/.github/workflows/check.yaml +0 -22
  43. package/.prettierrc +0 -4
@@ -1,54 +1,44 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TextBlock = exports.MainTitle = exports.TinyLabel = exports.SmallLabel = exports.MediumLabel = exports.LargeLabel = exports.GiantLabel = void 0;
4
- const component_with_class_name_1 = require("../component-with-class-name");
5
- require("./labels.css");
6
- class GiantLabel extends component_with_class_name_1.ComponentWithClassName {
1
+ import { ComponentWithClassName } from "../component-with-class-name";
2
+ import "./labels.css";
3
+ export class GiantLabel extends ComponentWithClassName {
7
4
  constructor() {
8
5
  super(...arguments);
9
6
  this.className = "label label-giant";
10
7
  }
11
8
  }
12
- exports.GiantLabel = GiantLabel;
13
- class LargeLabel extends component_with_class_name_1.ComponentWithClassName {
9
+ export class LargeLabel extends ComponentWithClassName {
14
10
  constructor() {
15
11
  super(...arguments);
16
12
  this.className = "label label-large";
17
13
  }
18
14
  }
19
- exports.LargeLabel = LargeLabel;
20
- class MediumLabel extends component_with_class_name_1.ComponentWithClassName {
15
+ export class MediumLabel extends ComponentWithClassName {
21
16
  constructor() {
22
17
  super(...arguments);
23
18
  this.className = "label label-medium";
24
19
  }
25
20
  }
26
- exports.MediumLabel = MediumLabel;
27
- class SmallLabel extends component_with_class_name_1.ComponentWithClassName {
21
+ export class SmallLabel extends ComponentWithClassName {
28
22
  constructor() {
29
23
  super(...arguments);
30
24
  this.className = "label label-small";
31
25
  }
32
26
  }
33
- exports.SmallLabel = SmallLabel;
34
- class TinyLabel extends component_with_class_name_1.ComponentWithClassName {
27
+ export class TinyLabel extends ComponentWithClassName {
35
28
  constructor() {
36
29
  super(...arguments);
37
30
  this.className = "label label-tiny";
38
31
  }
39
32
  }
40
- exports.TinyLabel = TinyLabel;
41
- class MainTitle extends component_with_class_name_1.ComponentWithClassName {
33
+ export class MainTitle extends ComponentWithClassName {
42
34
  constructor() {
43
35
  super(...arguments);
44
36
  this.className = "label main-title";
45
37
  }
46
38
  }
47
- exports.MainTitle = MainTitle;
48
- class TextBlock extends component_with_class_name_1.ComponentWithClassName {
39
+ export class TextBlock extends ComponentWithClassName {
49
40
  constructor() {
50
41
  super(...arguments);
51
42
  this.className = "text-block";
52
43
  }
53
44
  }
54
- exports.TextBlock = TextBlock;
@@ -1,47 +1,38 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ScreenColumnLayoutCentralContent = exports.ScreenColumnLayoutMainColumnContent = exports.ScreenColumnLayoutMainColumnFooter = exports.ScreenColumnLayoutMainColumnHeader = exports.ScreenColumnLayoutMainColumn = exports.ScreenColumnLayout = void 0;
4
- const component_with_class_name_1 = require("../component-with-class-name");
5
- require("./screen-column-layout.css");
6
- class ScreenColumnLayout extends component_with_class_name_1.ComponentWithClassName {
1
+ import { ComponentWithClassName } from "../component-with-class-name";
2
+ import "./screen-column-layout.css";
3
+ export class ScreenColumnLayout extends ComponentWithClassName {
7
4
  constructor() {
8
5
  super(...arguments);
9
6
  this.className = "screen-layout-column";
10
7
  }
11
8
  }
12
- exports.ScreenColumnLayout = ScreenColumnLayout;
13
- class ScreenColumnLayoutMainColumn extends component_with_class_name_1.ComponentWithClassName {
9
+ export class ScreenColumnLayoutMainColumn extends ComponentWithClassName {
14
10
  constructor() {
15
11
  super(...arguments);
16
12
  this.className = "screen-layout-column-main-column";
17
13
  }
18
14
  }
19
- exports.ScreenColumnLayoutMainColumn = ScreenColumnLayoutMainColumn;
20
- class ScreenColumnLayoutMainColumnHeader extends component_with_class_name_1.ComponentWithClassName {
15
+ export class ScreenColumnLayoutMainColumnHeader extends ComponentWithClassName {
21
16
  constructor() {
22
17
  super(...arguments);
23
18
  this.className = "screen-layout-column-main-column-header";
24
19
  }
25
20
  }
26
- exports.ScreenColumnLayoutMainColumnHeader = ScreenColumnLayoutMainColumnHeader;
27
- class ScreenColumnLayoutMainColumnFooter extends component_with_class_name_1.ComponentWithClassName {
21
+ export class ScreenColumnLayoutMainColumnFooter extends ComponentWithClassName {
28
22
  constructor() {
29
23
  super(...arguments);
30
24
  this.className = "screen-layout-column-main-column-footer";
31
25
  }
32
26
  }
33
- exports.ScreenColumnLayoutMainColumnFooter = ScreenColumnLayoutMainColumnFooter;
34
- class ScreenColumnLayoutMainColumnContent extends component_with_class_name_1.ComponentWithClassName {
27
+ export class ScreenColumnLayoutMainColumnContent extends ComponentWithClassName {
35
28
  constructor() {
36
29
  super(...arguments);
37
30
  this.className = "screen-layout-column-main-column-content";
38
31
  }
39
32
  }
40
- exports.ScreenColumnLayoutMainColumnContent = ScreenColumnLayoutMainColumnContent;
41
- class ScreenColumnLayoutCentralContent extends component_with_class_name_1.ComponentWithClassName {
33
+ export class ScreenColumnLayoutCentralContent extends ComponentWithClassName {
42
34
  constructor() {
43
35
  super(...arguments);
44
36
  this.className = "screen-layout-column-central-content";
45
37
  }
46
38
  }
47
- exports.ScreenColumnLayoutCentralContent = ScreenColumnLayoutCentralContent;
@@ -1,33 +1,26 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ScreenStackLayoutBottom = exports.ScreenStackLayoutContent = exports.ScreenStackLayoutTop = exports.ScreenStackLayout = void 0;
4
- const component_with_class_name_1 = require("../component-with-class-name");
5
- require("./screen-stack-layout.css");
6
- class ScreenStackLayout extends component_with_class_name_1.ComponentWithClassName {
1
+ import { ComponentWithClassName } from "../component-with-class-name";
2
+ import "./screen-stack-layout.css";
3
+ export class ScreenStackLayout extends ComponentWithClassName {
7
4
  constructor() {
8
5
  super(...arguments);
9
6
  this.className = "screen-stack-layout";
10
7
  }
11
8
  }
12
- exports.ScreenStackLayout = ScreenStackLayout;
13
- class ScreenStackLayoutTop extends component_with_class_name_1.ComponentWithClassName {
9
+ export class ScreenStackLayoutTop extends ComponentWithClassName {
14
10
  constructor() {
15
11
  super(...arguments);
16
12
  this.className = "screen-stack-layout-top";
17
13
  }
18
14
  }
19
- exports.ScreenStackLayoutTop = ScreenStackLayoutTop;
20
- class ScreenStackLayoutContent extends component_with_class_name_1.ComponentWithClassName {
15
+ export class ScreenStackLayoutContent extends ComponentWithClassName {
21
16
  constructor() {
22
17
  super(...arguments);
23
18
  this.className = "screen-stack-layout-content";
24
19
  }
25
20
  }
26
- exports.ScreenStackLayoutContent = ScreenStackLayoutContent;
27
- class ScreenStackLayoutBottom extends component_with_class_name_1.ComponentWithClassName {
21
+ export class ScreenStackLayoutBottom extends ComponentWithClassName {
28
22
  constructor() {
29
23
  super(...arguments);
30
24
  this.className = "screen-stack-layout-bottom";
31
25
  }
32
26
  }
33
- exports.ScreenStackLayoutBottom = ScreenStackLayoutBottom;
@@ -1,12 +1,8 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ScrollableContent = void 0;
4
- const component_with_class_name_1 = require("../component-with-class-name");
5
- require("./scrollable-content.css");
6
- class ScrollableContent extends component_with_class_name_1.ComponentWithClassName {
1
+ import { ComponentWithClassName } from "../component-with-class-name";
2
+ import "./scrollable-content.css";
3
+ export class ScrollableContent extends ComponentWithClassName {
7
4
  constructor() {
8
5
  super(...arguments);
9
6
  this.className = "scrollable-content";
10
7
  }
11
8
  }
12
- exports.ScrollableContent = ScrollableContent;
@@ -1,19 +1,13 @@
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.LabelledSlider = void 0;
7
- const react_1 = __importDefault(require("react"));
8
- const labels_1 = require("../labels/labels");
9
- require("./slider.css");
10
- class Slider extends react_1.default.Component {
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import React from "react";
3
+ import { TinyLabel } from "../labels/labels";
4
+ import "./slider.css";
5
+ export default class Slider extends React.Component {
11
6
  render() {
12
- return react_1.default.createElement("input", { type: "range", ...this.props });
7
+ return _jsx("input", { type: "range", ...this.props });
13
8
  }
14
9
  }
15
- exports.default = Slider;
16
- class LabelledSlider extends react_1.default.Component {
10
+ export class LabelledSlider extends React.Component {
17
11
  constructor(props) {
18
12
  super(props);
19
13
  this.state = {
@@ -39,9 +33,6 @@ class LabelledSlider extends react_1.default.Component {
39
33
  }
40
34
  },
41
35
  };
42
- return (react_1.default.createElement("div", { className: "labelled-slider" },
43
- react_1.default.createElement(Slider, { ...sliderProps }),
44
- react_1.default.createElement(labels_1.TinyLabel, null, this.props.label ? this.props.label(this.state.value) : "")));
36
+ return (_jsxs("div", { className: "labelled-slider", children: [_jsx(Slider, { ...sliderProps }), _jsx(TinyLabel, { children: this.props.label ? this.props.label(this.state.value) : "" })] }));
45
37
  }
46
38
  }
47
- exports.LabelledSlider = LabelledSlider;
@@ -1,10 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Spacing = void 0;
4
- require("./spacing.css");
5
- class Spacing {
1
+ import "./spacing.css";
2
+ export class Spacing {
6
3
  }
7
- exports.Spacing = Spacing;
8
4
  Spacing.xxl = "var(--spacing-xxl)";
9
5
  Spacing.xl = "var(--spacing-xl)";
10
6
  Spacing.l = "var(--spacing-l)";
@@ -1,16 +1,10 @@
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.StackList = void 0;
7
- const react_1 = __importDefault(require("react"));
8
- require("./stack-list.css");
9
- class StackList extends react_1.default.Component {
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import React from "react";
3
+ import "./stack-list.css";
4
+ export class StackList extends React.Component {
10
5
  render() {
11
- return (react_1.default.createElement("div", { className: "stack-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
- })));
6
+ return (_jsx("div", { className: "stack-list", ...this.props, children: React.Children.map(this.props.children, (child, i) => {
7
+ return _jsx("div", { children: child }, `child-${i}`);
8
+ }) }));
14
9
  }
15
10
  }
16
- exports.StackList = StackList;
package/lib/tabs/tabs.js CHANGED
@@ -1,19 +1,13 @@
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.Tab = exports.TabLayout = void 0;
7
- const react_1 = __importDefault(require("react"));
8
- const focusable_1 = require("../focusable");
9
- require("./tabs.css");
10
- class TabLayout extends react_1.default.Component {
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import React from "react";
3
+ import { Focusable } from "../focusable";
4
+ import "./tabs.css";
5
+ export class TabLayout extends React.Component {
11
6
  render() {
12
- return (react_1.default.createElement("div", { className: "tab-layout", ...this.props }, this.props.children));
7
+ return (_jsx("div", { className: "tab-layout", ...this.props, children: this.props.children }));
13
8
  }
14
9
  }
15
- exports.TabLayout = TabLayout;
16
- class Tab extends focusable_1.Focusable {
10
+ export class Tab extends Focusable {
17
11
  get className() {
18
12
  let className = "tab";
19
13
  if (this.props.selected) {
@@ -22,4 +16,3 @@ class Tab extends focusable_1.Focusable {
22
16
  return className;
23
17
  }
24
18
  }
25
- exports.Tab = Tab;
@@ -1,10 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Typography = void 0;
4
- require("./typography.css");
5
- class Typography {
1
+ import "./typography.css";
2
+ export class Typography {
6
3
  }
7
- exports.Typography = Typography;
8
4
  Typography.xxl = "var(--font-size-xxl)";
9
5
  Typography.xl = "var(--font-size-xl)";
10
6
  Typography.l = "var(--font-size-l)";
package/package.json CHANGED
@@ -1,28 +1,25 @@
1
1
  {
2
- "name": "@remvst/design-system",
3
- "version": "1.1.1",
4
- "description": "",
5
- "main": "lib/index.js",
6
- "scripts": {
7
- "prettier:fix": "prettier . --write",
8
- "prettier:check": "prettier . --check",
9
- "copy-files": "copyfiles -u 1 src/**/*.css lib/",
10
- "build": "rm -rf lib && tsc && npm run copy-files",
11
- "prepublishOnly": "npm i && npm run build",
12
- "test": "npm run prettier:check && npm run build"
13
- },
14
- "keywords": [],
15
- "author": "Rémi Vansteelandt",
16
- "license": "",
17
- "dependencies": {
18
- "@types/react": "^18.2.45",
19
- "react": "^18.2.0",
20
- "typescript": "^5.2.2"
21
- },
22
- "devDependencies": {
23
- "copyfiles": "^2.4.1",
24
- "prettier": "3.1.1",
25
- "prettier-plugin-organize-imports": "^3.2.4",
26
- "rimraf": "^5.0.5"
27
- }
28
- }
2
+ "name": "@remvst/design-system",
3
+ "version": "1.3.0",
4
+ "description": "",
5
+ "main": "lib/index.js",
6
+ "keywords": [],
7
+ "author": "Rémi Vansteelandt",
8
+ "license": "",
9
+ "peerDependencies": {
10
+ "@types/react": "^18.2.45",
11
+ "react": "^18.2.0"
12
+ },
13
+ "devDependencies": {
14
+ "@types/react": "^18.2.45",
15
+ "copyfiles": "^2.4.1",
16
+ "react": "^18.2.0",
17
+ "rimraf": "^5.0.5",
18
+ "typescript": "^7.0.2"
19
+ },
20
+ "scripts": {
21
+ "copy-files": "copyfiles -u 1 src/**/*.css lib/",
22
+ "build": "rm -rf lib && tsc && npm run copy-files",
23
+ "test": "npm run build"
24
+ }
25
+ }
@@ -0,0 +1,76 @@
1
+ .dialog-layout {
2
+ margin: var(--spacing-l);
3
+ background: #000;
4
+ overflow: hidden;
5
+ width: 90%;
6
+ max-width: 320px;
7
+
8
+ height: 100%;
9
+ max-height: 50%;
10
+
11
+ display: flex;
12
+ flex-direction: column;
13
+
14
+ position: relative;
15
+
16
+ color: white;
17
+ }
18
+
19
+ .dialog-layout.modal {
20
+ max-width: 800px;
21
+ flex: 1 0 auto;
22
+ max-height: 90%;
23
+ }
24
+
25
+ .dialog-layout.packed {
26
+ height: auto;
27
+ }
28
+
29
+ .dialog-layout-top-bar {
30
+ display: flex;
31
+ flex-direction: row;
32
+ flex: 0 0 15%;
33
+ }
34
+
35
+ .dialog-layout-bottom-bar {
36
+ display: flex;
37
+ flex-direction: row;
38
+ flex: 0 0 15%;
39
+ }
40
+
41
+ .dialog-layout-top-bar > * {
42
+ display: flex;
43
+ flex-direction: row;
44
+ align-items: center;
45
+ justify-content: center;
46
+ }
47
+
48
+ .dialog-layout-top-bar-left {
49
+ flex: 0 0 20%;
50
+ }
51
+
52
+ .dialog-layout-top-bar-center {
53
+ flex: 1 1 auto;
54
+ overflow: hidden;
55
+ }
56
+
57
+ .dialog-layout-top-bar-right {
58
+ flex: 0 0 20%;
59
+ }
60
+
61
+ .dialog-layout-content {
62
+ flex: 1 1 auto;
63
+ display: flex;
64
+ flex-direction: column;
65
+ overflow-x: hidden;
66
+ overflow-y: auto;
67
+ }
68
+
69
+ .dialog-layout-bottom-bar .flow-list {
70
+ flex: 1 0 100%;
71
+ align-items: stretch;
72
+ }
73
+
74
+ .dialog-layout-bottom-bar .flow-list .main-button {
75
+ height: 100%;
76
+ }
@@ -0,0 +1,35 @@
1
+ import React from "react";
2
+ import "./dialog-layout.css";
3
+
4
+ export function DialogLayout(
5
+ props: React.PropsWithChildren & { isModal?: boolean; isPacked?: boolean },
6
+ ) {
7
+ const classes = ["dialog-layout"];
8
+ if (props.isModal) classes.push("modal");
9
+ if (props.isPacked) classes.push("packed");
10
+ return <div className={classes.join(" ")}>{props.children}</div>;
11
+ }
12
+
13
+ export function DialogTopBar(props: React.PropsWithChildren) {
14
+ return <div className="dialog-layout-top-bar">{props.children}</div>;
15
+ }
16
+
17
+ export function DialogBottomBar(props: React.PropsWithChildren) {
18
+ return <div className="dialog-layout-bottom-bar">{props.children}</div>;
19
+ }
20
+
21
+ export function DialogTopBarLeft(props: React.PropsWithChildren) {
22
+ return <div className="dialog-layout-top-bar-left">{props.children}</div>;
23
+ }
24
+
25
+ export function DialogTopBarCenter(props: React.PropsWithChildren) {
26
+ return <div className="dialog-layout-top-bar-center">{props.children}</div>;
27
+ }
28
+
29
+ export function DialogTopBarRight(props: React.PropsWithChildren) {
30
+ return <div className="dialog-layout-top-bar-right">{props.children}</div>;
31
+ }
32
+
33
+ export function DialogContent(props: React.PropsWithChildren) {
34
+ return <div className="dialog-layout-content">{props.children}</div>;
35
+ }
package/src/dim/dim.css CHANGED
@@ -2,4 +2,15 @@
2
2
  width: 100%;
3
3
  height: 100%;
4
4
  background-color: rgba(0, 0, 0, 0.5);
5
+
6
+ position: relative;
7
+ z-index: 2;
8
+ overflow: hidden;
9
+
10
+ display: flex;
11
+ flex-direction: column;
12
+ align-items: center;
13
+ justify-content: center;
14
+
15
+ backdrop-filter: blur(5px);
5
16
  }
@@ -0,0 +1,78 @@
1
+ :root {
2
+ --slide-in: slide-up 0.2s cubic-bezier(0.33, 1, 0.68, 1) 1;
3
+ --slide-out: slide-down 0.2s cubic-bezier(0.33, 1, 0.68, 1) 1 forwards;
4
+ --slide-in-x: slide-right 0.2s cubic-bezier(0.33, 1, 0.68, 1) 1;
5
+ --slide-out-x: slide-left 0.2s cubic-bezier(0.33, 1, 0.68, 1) 1 forwards;
6
+ --fade-in: fade-in 0.2s linear 1;
7
+ --fade-out: fade-out 0.2s linear 1 forwards;
8
+ }
9
+
10
+ @keyframes slide-up {
11
+ 0% {
12
+ transform: translateY(100%);
13
+ }
14
+ 100% {
15
+ transform: translateY(0%);
16
+ }
17
+ }
18
+
19
+ @keyframes slide-down {
20
+ 0% {
21
+ transform: translateY(0%);
22
+ }
23
+ 100% {
24
+ transform: translateY(100%);
25
+ }
26
+ }
27
+
28
+ @keyframes slide-right {
29
+ 0% {
30
+ transform: translateX(-100%);
31
+ }
32
+ 100% {
33
+ transform: translateX(0%);
34
+ }
35
+ }
36
+
37
+ @keyframes slide-left {
38
+ 0% {
39
+ transform: translateX(0%);
40
+ }
41
+ 100% {
42
+ transform: translateX(-100%);
43
+ }
44
+ }
45
+
46
+ @keyframes fade-in {
47
+ 0% {
48
+ opacity: 0%;
49
+ }
50
+ 100% {
51
+ opacity: 100%;
52
+ }
53
+ }
54
+
55
+ @keyframes fade-out {
56
+ 0% {
57
+ opacity: 100%;
58
+ }
59
+ 100% {
60
+ opacity: 0%;
61
+ }
62
+ }
63
+
64
+ .dim.opening {
65
+ animation: var(--fade-in);
66
+ }
67
+
68
+ .dim.closing {
69
+ animation: var(--fade-out);
70
+ }
71
+
72
+ .dim.opening .dialog-layout {
73
+ animation: var(--slide-in);
74
+ }
75
+
76
+ .dim.closing .dialog-layout {
77
+ animation: var(--slide-out);
78
+ }
@@ -0,0 +1,39 @@
1
+ import React from "react";
2
+ import { Dim } from "./dim";
3
+ import "./transitioning-dim.css";
4
+
5
+ export class TransitioningDim extends React.Component<
6
+ React.PropsWithChildren,
7
+ { closing: boolean; animateOutListener(): void }
8
+ > {
9
+ constructor(props: React.PropsWithChildren) {
10
+ super(props);
11
+ this.state = {
12
+ closing: false,
13
+ animateOutListener() {},
14
+ };
15
+ }
16
+
17
+ animateOut(): Promise<void> {
18
+ return new Promise((resolve, reject) => {
19
+ this.setState({
20
+ closing: true,
21
+ animateOutListener: resolve,
22
+ });
23
+
24
+ // Safety in case the animation code suckssss
25
+ setTimeout(resolve, 300);
26
+ });
27
+ }
28
+
29
+ render() {
30
+ return (
31
+ <Dim
32
+ onAnimationEnd={this.state.animateOutListener}
33
+ className={this.state.closing ? "closing" : "opening"}
34
+ >
35
+ {this.props.children}
36
+ </Dim>
37
+ );
38
+ }
39
+ }
package/src/index.ts CHANGED
@@ -5,7 +5,9 @@ export * from "./animations/animations";
5
5
  export * from "./balanced-row/balanced-row";
6
6
  export * from "./balanced-stack/balanced-stack";
7
7
  export * from "./buttons/buttons";
8
+ export * from "./dialog-layout/dialog-layout";
8
9
  export * from "./dim/dim";
10
+ export * from "./dim/transitioning-dim";
9
11
  export * from "./flow-list/flow-list";
10
12
  export * from "./focusable";
11
13
  export * from "./frame/frame";
package/tsconfig.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
+ "extends": "../../tsconfig.base.json",
2
3
  "compilerOptions": {
3
4
  "target": "es2020",
4
- "module": "commonjs",
5
- "esModuleInterop": true,
6
- "allowJs": false,
5
+ "module": "ESNext",
6
+ "moduleResolution": "bundler",
7
7
  "outDir": "./lib",
8
- "declaration": true,
9
- "jsx": "react"
8
+ "jsx": "react-jsx",
9
+ "strict": false,
10
+ "rootDir": "./src"
10
11
  },
11
- "include": ["./src"],
12
- "exclude": ["node_modules"]
12
+ "include": ["./src"]
13
13
  }
@@ -1,22 +0,0 @@
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: check-${{ 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/.prettierrc DELETED
@@ -1,4 +0,0 @@
1
- {
2
- "plugins": ["prettier-plugin-organize-imports"],
3
- "tabWidth": 4
4
- }