Skip to content

Commit 447329e

Browse files
authored
Merge pull request #8 from skbkontur/dark-theme
Dark theme
2 parents 7b45c23 + 8342db0 commit 447329e

File tree

81 files changed

+3561
-2499
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+3561
-2499
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## v1.3.x - 2021.05.31
4+
- Add support for dark theme using react-ui ThemeContext
5+
- Update supported peerDependencies versions range
6+
37
## v1.2.7 - 2021.03.26
48
- Fix bug with TaskDataJsonSerializer: add TimeGuid and Timestamp converters
59

cassandra-distributed-task-queue-ui/.storybook/main.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ module.exports = {
1717
exclude: /node_modules/,
1818
},
1919
{
20-
test: /\.(c|le)ss$/,
20+
test: /\.css$/,
2121
loaders: [
2222
require.resolve("style-loader"),
2323
{
@@ -28,7 +28,6 @@ module.exports = {
2828
},
2929
},
3030
},
31-
require.resolve("less-loader"),
3231
],
3332
},
3433
{
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import '../public/index.css';

cassandra-distributed-task-queue-ui/.stylelintrc.json

Lines changed: 0 additions & 9 deletions
This file was deleted.

cassandra-distributed-task-queue-ui/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@ import ReactDom from "react-dom";
44
import { Switch, Redirect, Route } from "react-router";
55
import { BrowserRouter } from "react-router-dom";
66

7-
import { RtqMonitoringApiFake } from "./RtqMonitoringApiFake";
87
import { RemoteTaskQueueApplication, RtqMonitoringApi, ICustomRenderer } from "./src";
98
import { RtqMonitoringSearchRequest } from "./src/Domain/Api/RtqMonitoringSearchRequest";
109
import { RtqMonitoringTaskModel } from "./src/Domain/Api/RtqMonitoringTaskModel";
1110
import { TimeUtils } from "./src/Domain/Utils/TimeUtils";
1211
import { RangeSelector } from "./src/components/DateTimeRangePicker/RangeSelector";
12+
import { RtqMonitoringApiFake } from "./stories/Api/RtqMonitoringApiFake";
1313

1414
const rtqApiPrefix = "/remote-task-queue/";
1515

1616
export const rtqMonitoringApi =
1717
process.env.API === "fake" ? new RtqMonitoringApiFake() : new RtqMonitoringApi(rtqApiPrefix);
1818

19-
class CustomRenderer implements ICustomRenderer {
19+
export class CustomRenderer implements ICustomRenderer {
2020
public getRelatedTasksLocation(taskDetails: RtqMonitoringTaskModel): Nullable<RtqMonitoringSearchRequest> {
2121
const documentCirculationId =
2222
taskDetails.taskData && typeof taskDetails.taskData["DocumentCirculationId"] === "string"

cassandra-distributed-task-queue-ui/package.json

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"build:clean": "rimraf dist",
2424
"build:tsc": "tsc --project tsconfig.prod.json",
2525
"build:patch": "node ./patch-version",
26-
"build:copy:src": "copyfiles --up 1 \"src/**/*.js\" \"src/**/*.less\" dist",
26+
"build:copy:src": "copyfiles --up 1 \"src/**/*.js\" dist",
2727
"build:copy:meta": "copyfiles --flat package.json \"../*.md\" ../LICENSE dist",
2828
"build:pack": "cd dist && npm pack",
2929
"build:types": "dotnet ts-gen --assembly ./../Cassandra.DistributedTaskQueue.Monitoring.TestService/bin/net5.0/SkbKontur.Cassandra.DistributedTaskQueue.Monitoring.TestService.dll --outputDir ./src/Domain/Api --nullabilityMode Pessimistic",
@@ -33,16 +33,15 @@
3333
"lint": "run-s \"lint:*\"",
3434
"lint:tsc": "tsc --noEmit",
3535
"lint:eslint": "eslint ./ --ext .js,.jsx,.ts,.tsx",
36-
"lint:stylelint": "stylelint \"./**/*.less\"",
3736
"test": "mocha **/*.test.ts"
3837
},
3938
"peerDependencies": {
40-
"@skbkontur/react-icons": ">=3 <=4",
41-
"@skbkontur/react-ui": ">=2 <3",
39+
"@skbkontur/react-icons": ">=3 <=5",
40+
"@skbkontur/react-ui": ">=2 <=3",
4241
"react": ">=16 <=17",
4342
"react-dom": ">=16 <=17",
44-
"react-router": ">=4 <=5",
45-
"react-router-dom": ">=4 <=5"
43+
"react-router": ">=5.1.0 <=6",
44+
"react-router-dom": ">=5.1.0 <=6"
4645
},
4746
"dependencies": {
4847
"@skbkontur/react-stack-layout": "^1.0.3",
@@ -64,8 +63,8 @@
6463
"@babel/preset-typescript": "^7.12.7",
6564
"@babel/runtime": "^7.12.5",
6665
"@pmmmwh/react-refresh-webpack-plugin": "^0.4.3",
67-
"@skbkontur/react-icons": "^4.4.0",
68-
"@skbkontur/react-ui": "^2.13.0",
66+
"@skbkontur/react-icons": "^5.0.0",
67+
"@skbkontur/react-ui": "^3.0.0",
6968
"@storybook/addon-actions": "^6.1.15",
7069
"@storybook/addons": "^6.1.15",
7170
"@storybook/react": "^6.1.15",
@@ -90,8 +89,6 @@
9089
"eslint-plugin-import": "^2.22.1",
9190
"eslint-plugin-prettier": "^3.3.1",
9291
"eslint-plugin-react": "^7.22.0",
93-
"less": "^4.1.0",
94-
"less-loader": "^7.3.0",
9592
"mocha": "^8.2.1",
9693
"npm-run-all": "^4.1.5",
9794
"prettier": "^2.2.1",
@@ -103,9 +100,6 @@
103100
"rimraf": "^3.0.2",
104101
"storybook-react-router": "^1.0.8",
105102
"style-loader": "^2.0.0",
106-
"stylelint": "^13.9.0",
107-
"stylelint-config-css-modules": "^2.2.0",
108-
"stylelint-config-standard": "^20.0.0",
109103
"tslib": "^2.1.0",
110104
"typescript": "^4.1.3",
111105
"url-loader": "^4.1.1",
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
@font-face {
2+
font-family: 'Segoe UI';
3+
font-weight: 300;
4+
src: local('Segoe UI Semilight');
5+
}
6+
7+
@font-face {
8+
font-family: 'Segoe UI';
9+
font-weight: 400;
10+
src: local('Segoe UI');
11+
}
12+
13+
@font-face {
14+
font-family: 'Segoe UI';
15+
font-weight: 600;
16+
src: local('Segoe UI Semibold');
17+
}
18+
19+
@font-face {
20+
font-family: 'Segoe UI';
21+
font-weight: 700;
22+
src: local('Segoe UI Bold');
23+
}
24+
25+
body {
26+
font-family: 'Segoe UI', 'Helvetica', 'Arial', 'Tahoma', sans-serif;
27+
font-size: 14px;
28+
line-height: 20px;
29+
color: #333;
30+
margin: 0;
31+
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { RouteComponentProps } from "react-router";
1+
import { match } from "react-router";
22

33
export class RouteUtils {
4-
public static backUrl(props: RouteComponentProps): string {
5-
return props.match.url.endsWith("/") ? ".." : ".";
4+
public static backUrl(match: match<{}>) {
5+
return match.url.endsWith("/") ? ".." : ".";
66
}
77
}

cassandra-distributed-task-queue-ui/src/components/Accordion/Accordion.less

Lines changed: 0 additions & 58 deletions
This file was deleted.
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
import { css } from "@skbkontur/react-ui/lib/theming/Emotion";
2+
import { Theme } from "@skbkontur/react-ui/lib/theming/Theme";
3+
4+
import { baseSize } from "../Layouts/CommonLayout.styles";
5+
6+
export const jsStyles = {
7+
valueWrapper(): string {
8+
return css`
9+
padding-left: ${4 * baseSize}px;
10+
`;
11+
},
12+
13+
titleBlockHasTitle(t: Theme): string {
14+
return css`
15+
&:hover a {
16+
color: ${t.linkColor};
17+
}
18+
`;
19+
},
20+
21+
toggleAllLink(): string {
22+
return css`
23+
display: inline-block;
24+
margin-left: ${2 * baseSize}px;
25+
`;
26+
},
27+
28+
stringWrapper(t: Theme): string {
29+
return css`
30+
padding: ${baseSize}px 0 ${baseSize}px ${4 * baseSize}px;
31+
32+
& + .stringWrapper {
33+
border-top: 1px solid ${t.borderColorGrayLight};
34+
}
35+
`;
36+
},
37+
38+
toggleButton(): string {
39+
return css`
40+
color: inherit;
41+
font-size: inherit;
42+
font-family: inherit;
43+
background: none;
44+
border: none;
45+
padding: ${baseSize}px 0;
46+
margin-left: ${-4 * baseSize}px;
47+
cursor: pointer;
48+
outline: none;
49+
text-transform: capitalize;
50+
`;
51+
},
52+
53+
toggleButtonText(): string {
54+
return css`
55+
margin-left: ${baseSize}px;
56+
`;
57+
},
58+
59+
title(): string {
60+
return css`
61+
text-transform: capitalize;
62+
min-width: 140px;
63+
display: inline-block;
64+
padding-right: ${2 * baseSize}px;
65+
`;
66+
},
67+
68+
value(): string {
69+
return css`
70+
min-width: 1%;
71+
word-wrap: break-word;
72+
`;
73+
},
74+
75+
mutedKeyword(t: Theme): string {
76+
return css`
77+
color: ${t.textColorDisabled};
78+
`;
79+
},
80+
};

0 commit comments

Comments
 (0)