dsh-peak-checker 0.1.0 → 0.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/LICENSE +21 -0
- package/README.md +57 -0
- package/cordis.patch.yml +6 -6
- package/lib/client.js +107 -0
- package/lib/index.js +7 -7
- package/lib/peak.js +8 -4
- package/lib/types/index.d.ts +1 -2
- package/lib/types/peak.d.ts +3 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +61 -46
- package/lib/client/index.js +0 -24
- package/lib/client/styles.css +0 -25
- package/lib/client/styles.js +0 -18
- package/lib/clients/index.js +0 -1
- package/lib/clients/styles.js +0 -1
- package/lib/types/client/index.d.ts +0 -4
- package/lib/types/client/styles.d.ts +0 -2
- package/lib/types/clients/index.d.ts +0 -1
- package/lib/types/clients/styles.d.ts +0 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 The dsh-peak-checker authors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# dsh-peak-checker
|
|
2
|
+
|
|
3
|
+
在 DSH(DeepSeek Harness)输入框工具行显示当前是否处于 **DeepSeek API 高峰时段**。
|
|
4
|
+
|
|
5
|
+
Shows whether the DeepSeek API is currently in **peak hours** as a small badge in the DSH composer toolbar.
|
|
6
|
+
|
|
7
|
+
## 高峰时段 / Peak windows
|
|
8
|
+
|
|
9
|
+
按北京时间(UTC+8)判断,其余时间均为空闲:/ Evaluated in Beijing time (UTC+8); everything else is off-peak.
|
|
10
|
+
|
|
11
|
+
| 时段 / Window | 是否高峰 / Peak |
|
|
12
|
+
| --- | --- |
|
|
13
|
+
| 周一至周五 09:00–12:00 / Mon–Fri 09:00–12:00 | 高峰 / peak |
|
|
14
|
+
| 周一至周五 14:00–18:00 / Mon–Fri 14:00–18:00 | 高峰 / peak |
|
|
15
|
+
| 周末全天 / weekends, all day | 空闲 / off-peak |
|
|
16
|
+
| 其他时间 / any other time | 空闲 / off-peak |
|
|
17
|
+
|
|
18
|
+
徽标每 30 秒自动刷新,跨过高/低峰边界时无需刷新页面。/ The badge re-evaluates every 30 seconds, so it crosses peak boundaries without a page reload.
|
|
19
|
+
|
|
20
|
+
## 安装 / Install
|
|
21
|
+
|
|
22
|
+
把本包加入 DSH profile 的依赖并在 `dsh.profile.bundles` 中启用,然后重启 DSH web:
|
|
23
|
+
|
|
24
|
+
```jsonc
|
|
25
|
+
// ~/.dsh/profiles/web/package.json
|
|
26
|
+
{
|
|
27
|
+
"dependencies": { "dsh-peak-checker": "^0.1.1" },
|
|
28
|
+
"dsh": { "profile": { "bundles": ["@deepseek-ai/dsh-base", "@deepseek-ai/dsh-web-app", "dsh-peak-checker"] } }
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
插件随 bundle 的 `dsh.bundle.patch` 自动插入 Loader 行,无需修改 `cordis.patch.yml` 以外的配置。
|
|
33
|
+
The bundle patch inserts the Loader row automatically.
|
|
34
|
+
|
|
35
|
+
## 包结构 / What is inside
|
|
36
|
+
|
|
37
|
+
| 路径 / Path | 作用 / Role |
|
|
38
|
+
| --- | --- |
|
|
39
|
+
| `lib/index.js` | 宿主半:仅作为 Loader 行存在 / host half (Loader row only) |
|
|
40
|
+
| `lib/client.js` | 浏览器半:DSH 客户端插件 bundle / browser half, a `window.__ModuleLoader__` bundle |
|
|
41
|
+
| `lib/peak.js` | 高峰时段判断逻辑 / peak-window logic |
|
|
42
|
+
| `cordis.patch.yml` | 插入 Loader 行的 bundle patch / bundle patch inserting the Loader row |
|
|
43
|
+
|
|
44
|
+
`lib/client.js` 由 `scripts/build-client.mjs` 用 esbuild 生成:把 `src/client/index.tsx` 打成 lazy-CJS,再由 `window.__ModuleLoader__.load({ id, factory })` 注册;`react` 作为 DSH 客户端基线模块保持 external。
|
|
45
|
+
The client bundle is built with esbuild into the lazy-CJS factory form DSH's module loader expects, with React left external.
|
|
46
|
+
|
|
47
|
+
## 开发 / Development
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
npm run build # tsc (host half + types) + esbuild (client bundle)
|
|
51
|
+
npm run typecheck # host and client type checks
|
|
52
|
+
npm test # unit tests, including a simulated DSH module loader
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## License
|
|
56
|
+
|
|
57
|
+
MIT
|
package/cordis.patch.yml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
# dsh-peak-checker bundle patch.
|
|
2
|
+
# The bundle inserts its own Loader row; the client half is discovered from that
|
|
3
|
+
# row's `dsh.client` declaration and served to the browser as a plugin bundle.
|
|
4
|
+
- insert:
|
|
5
|
+
- id: dsh-peak-checker
|
|
6
|
+
name: dsh-peak-checker
|
package/lib/client.js
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/* dsh-peak-checker client half — generated by scripts/build-client.mjs; do not edit. */
|
|
2
|
+
window.__ModuleLoader__.load({id:"dsh-peak-checker",factory:require=>{var module={exports:{}};var exports=module.exports;
|
|
3
|
+
"use strict";
|
|
4
|
+
var __create = Object.create;
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __export = (target, all) => {
|
|
11
|
+
for (var name in all)
|
|
12
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
13
|
+
};
|
|
14
|
+
var __copyProps = (to, from, except, desc) => {
|
|
15
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
16
|
+
for (let key of __getOwnPropNames(from))
|
|
17
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
18
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
23
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
24
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
25
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
26
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
27
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
28
|
+
mod
|
|
29
|
+
));
|
|
30
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
31
|
+
|
|
32
|
+
// src/client/index.tsx
|
|
33
|
+
var index_exports = {};
|
|
34
|
+
__export(index_exports, {
|
|
35
|
+
apply: () => apply,
|
|
36
|
+
inject: () => inject
|
|
37
|
+
});
|
|
38
|
+
module.exports = __toCommonJS(index_exports);
|
|
39
|
+
var React = __toESM(require("react"), 1);
|
|
40
|
+
|
|
41
|
+
// src/peak.ts
|
|
42
|
+
var BEIJING_OFFSET_MS = 8 * 36e5;
|
|
43
|
+
function getPeakState(date = /* @__PURE__ */ new Date()) {
|
|
44
|
+
const bj = new Date(date.getTime() + BEIJING_OFFSET_MS);
|
|
45
|
+
const day = bj.getUTCDay();
|
|
46
|
+
const minutes = bj.getUTCHours() * 60 + bj.getUTCMinutes();
|
|
47
|
+
const isWeekday = day >= 1 && day <= 5;
|
|
48
|
+
if (!isWeekday) return "off-peak";
|
|
49
|
+
const inMorningPeak = minutes >= 9 * 60 && minutes < 12 * 60;
|
|
50
|
+
const inAfternoonPeak = minutes >= 14 * 60 && minutes < 18 * 60;
|
|
51
|
+
return inMorningPeak || inAfternoonPeak ? "peak" : "off-peak";
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// src/client/styles.ts
|
|
55
|
+
function badgeStyle(isPeak) {
|
|
56
|
+
return {
|
|
57
|
+
display: "inline-flex",
|
|
58
|
+
alignItems: "center",
|
|
59
|
+
gap: 4,
|
|
60
|
+
padding: "2px 8px",
|
|
61
|
+
borderRadius: 999,
|
|
62
|
+
fontSize: 11,
|
|
63
|
+
fontWeight: 500,
|
|
64
|
+
lineHeight: "18px",
|
|
65
|
+
whiteSpace: "nowrap",
|
|
66
|
+
userSelect: "none",
|
|
67
|
+
cursor: "default",
|
|
68
|
+
color: isPeak ? "var(--dsh-color-warning, #b45309)" : "var(--dsh-color-success, #15803d)",
|
|
69
|
+
background: isPeak ? "rgba(234, 179, 8, 0.12)" : "rgba(34, 197, 94, 0.12)",
|
|
70
|
+
border: `1px solid ${isPeak ? "rgba(234, 179, 8, 0.35)" : "rgba(34, 197, 94, 0.35)"}`
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// src/client/index.tsx
|
|
75
|
+
var inject = ["slots"];
|
|
76
|
+
var SLOT_NAME = "conversation.input.left";
|
|
77
|
+
var REFRESH_MS = 3e4;
|
|
78
|
+
function apply(ctx) {
|
|
79
|
+
ctx.slots.inject(
|
|
80
|
+
SLOT_NAME,
|
|
81
|
+
() => ctx.slots.register(
|
|
82
|
+
{ name: SLOT_NAME, id: "dsh-peak-checker", order: 30 },
|
|
83
|
+
PeakIndicator
|
|
84
|
+
)
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
function PeakIndicator() {
|
|
88
|
+
const [state, setState] = React.useState(getPeakState);
|
|
89
|
+
React.useEffect(() => {
|
|
90
|
+
setState(getPeakState());
|
|
91
|
+
const timer = window.setInterval(() => setState(getPeakState()), REFRESH_MS);
|
|
92
|
+
return () => window.clearInterval(timer);
|
|
93
|
+
}, []);
|
|
94
|
+
const isPeak = state === "peak";
|
|
95
|
+
return /* @__PURE__ */ React.createElement(
|
|
96
|
+
"span",
|
|
97
|
+
{
|
|
98
|
+
"data-dsh-peak-state": state,
|
|
99
|
+
title: isPeak ? "\u5F53\u524D\u4E3A DeepSeek API \u9AD8\u5CF0\u65F6\u6BB5\uFF08\u5317\u4EAC\u65F6\u95F4\u5468\u4E00\u81F3\u5468\u4E94 09:00\u201312:00\u300114:00\u201318:00\uFF09" : "\u5F53\u524D\u4E3A DeepSeek API \u7A7A\u95F2\u65F6\u6BB5",
|
|
100
|
+
style: badgeStyle(isPeak)
|
|
101
|
+
},
|
|
102
|
+
/* @__PURE__ */ React.createElement("span", { style: { fontSize: 8, lineHeight: 1 } }, "\u25CF"),
|
|
103
|
+
isPeak ? "\u9AD8\u5CF0" : "\u7A7A\u95F2"
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
return module.exports}})
|
package/lib/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
// src/index.ts
|
|
2
|
+
//
|
|
3
|
+
// Host half. This plugin only contributes browser UI, so the host half exists
|
|
4
|
+
// solely as the Loader row that the client module system scans for a
|
|
5
|
+
// `dsh.client` declaration. It intentionally has no host-plane behavior.
|
|
1
6
|
export const name = 'dsh-peak-checker';
|
|
2
|
-
export function apply(
|
|
3
|
-
|
|
4
|
-
console.log('[dsh-peak-indicator] host half loaded');
|
|
5
|
-
return () => {
|
|
6
|
-
console.log('[dsh-peak-indicator] host half unloaded');
|
|
7
|
-
};
|
|
8
|
-
});
|
|
7
|
+
export function apply() {
|
|
8
|
+
// Nothing to do on the host plane.
|
|
9
9
|
}
|
package/lib/peak.js
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
|
+
/** Beijing time offset from UTC, in milliseconds. */
|
|
2
|
+
const BEIJING_OFFSET_MS = 8 * 3_600_000;
|
|
1
3
|
/**
|
|
2
4
|
* 按北京时间 (UTC+8) 判断当前是否处于 DeepSeek API 高峰时段。
|
|
3
5
|
* 高峰:周一至周五 09:00–12:00、14:00–18:00
|
|
4
6
|
* 空闲:其余时间(含周末全天)
|
|
7
|
+
*
|
|
8
|
+
* 实现说明:先把时刻平移到北京时间,再用 UTC getter 读取,因此结果与
|
|
9
|
+
* 运行机器的本地时区、夏令时规则完全无关。
|
|
5
10
|
*/
|
|
6
11
|
export function getPeakState(date = new Date()) {
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const minutes = bj.getHours() * 60 + bj.getMinutes();
|
|
12
|
+
const bj = new Date(date.getTime() + BEIJING_OFFSET_MS);
|
|
13
|
+
const day = bj.getUTCDay(); // 0=周日, 1=周一, ..., 6=周六
|
|
14
|
+
const minutes = bj.getUTCHours() * 60 + bj.getUTCMinutes();
|
|
11
15
|
const isWeekday = day >= 1 && day <= 5;
|
|
12
16
|
if (!isWeekday)
|
|
13
17
|
return 'off-peak';
|
package/lib/types/index.d.ts
CHANGED
package/lib/types/peak.d.ts
CHANGED
|
@@ -3,6 +3,9 @@ export type PeakState = 'peak' | 'off-peak';
|
|
|
3
3
|
* 按北京时间 (UTC+8) 判断当前是否处于 DeepSeek API 高峰时段。
|
|
4
4
|
* 高峰:周一至周五 09:00–12:00、14:00–18:00
|
|
5
5
|
* 空闲:其余时间(含周末全天)
|
|
6
|
+
*
|
|
7
|
+
* 实现说明:先把时刻平移到北京时间,再用 UTC getter 读取,因此结果与
|
|
8
|
+
* 运行机器的本地时区、夏令时规则完全无关。
|
|
6
9
|
*/
|
|
7
10
|
export declare function getPeakState(date?: Date): PeakState;
|
|
8
11
|
/** 供 UI 直接用:是否高峰 */
|
package/locale/en.json
ADDED
package/locale/zh.json
ADDED
package/package.json
CHANGED
|
@@ -1,46 +1,61 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "dsh-peak-checker",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "在 DSH 输入框工具行显示当前是否处于 DeepSeek API 高峰时段",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
"default": "./lib/client
|
|
16
|
-
},
|
|
17
|
-
"./
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
"
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "dsh-peak-checker",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "在 DSH 输入框工具行显示当前是否处于 DeepSeek API 高峰时段",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"main": "lib/index.js",
|
|
8
|
+
"types": "lib/types/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./lib/types/index.d.ts",
|
|
12
|
+
"default": "./lib/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./client": {
|
|
15
|
+
"default": "./lib/client.js"
|
|
16
|
+
},
|
|
17
|
+
"./locale/*.json": "./locale/*.json",
|
|
18
|
+
"./package.json": "./package.json"
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"lib",
|
|
22
|
+
"cordis.patch.yml",
|
|
23
|
+
"locale",
|
|
24
|
+
"README.md"
|
|
25
|
+
],
|
|
26
|
+
"scripts": {
|
|
27
|
+
"build": "tsc -p tsconfig.json && node scripts/build-client.mjs",
|
|
28
|
+
"typecheck": "tsc -p tsconfig.client.json && tsc -p tsconfig.json --noEmit",
|
|
29
|
+
"test": "vitest run",
|
|
30
|
+
"prepack": "npm run build"
|
|
31
|
+
},
|
|
32
|
+
"keywords": [
|
|
33
|
+
"dsh-plugin",
|
|
34
|
+
"deepseek-harness",
|
|
35
|
+
"dsh",
|
|
36
|
+
"deepseek",
|
|
37
|
+
"peak-hours"
|
|
38
|
+
],
|
|
39
|
+
"engines": {
|
|
40
|
+
"node": "^22.19.0 || >=24.0.0"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@types/node": "^22.0.0",
|
|
44
|
+
"@types/react": "^18.3.0",
|
|
45
|
+
"esbuild": "^0.28.0",
|
|
46
|
+
"typescript": "^5.7.0",
|
|
47
|
+
"vitest": "^3.0.0"
|
|
48
|
+
},
|
|
49
|
+
"dsh": {
|
|
50
|
+
"bundle": {
|
|
51
|
+
"patch": "./cordis.patch.yml"
|
|
52
|
+
},
|
|
53
|
+
"client": {
|
|
54
|
+
"platform": "web",
|
|
55
|
+
"immediately": true,
|
|
56
|
+
"inject": [
|
|
57
|
+
"@deepseek-ai/dsh-client-ui-conversation"
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
package/lib/client/index.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { getPeakState } from "../peak.js";
|
|
3
|
-
import { badgeStyle } from "./styles.js";
|
|
4
|
-
export const name = 'dsh-peak-checker-client';
|
|
5
|
-
export const inject = ['slots'];
|
|
6
|
-
export function apply(ctx) {
|
|
7
|
-
const slots = ctx.slots;
|
|
8
|
-
if (!slots)
|
|
9
|
-
return;
|
|
10
|
-
slots.inject('conversation.input.left', () => {
|
|
11
|
-
slots.register({
|
|
12
|
-
name: 'conversation.input.left',
|
|
13
|
-
id: 'dsh-peak-indicator',
|
|
14
|
-
order: 30,
|
|
15
|
-
}, PeakIndicator);
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
function PeakIndicator() {
|
|
19
|
-
const state = getPeakState();
|
|
20
|
-
const isPeak = state === 'peak';
|
|
21
|
-
return (_jsxs("span", { title: isPeak
|
|
22
|
-
? '当前为 DeepSeek API 高峰时段(北京时间周一至周五 09:00–12:00、14:00–18:00)'
|
|
23
|
-
: '当前为 DeepSeek API 空闲时段', style: badgeStyle(isPeak), children: [_jsx("span", { style: { fontSize: 8, lineHeight: 1 }, children: "\u25CF" }), isPeak ? '高峰' : '空闲'] }));
|
|
24
|
-
}
|
package/lib/client/styles.css
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
.dsh-peak-indicator {
|
|
2
|
-
display: inline-flex;
|
|
3
|
-
align-items: center;
|
|
4
|
-
gap: 4px;
|
|
5
|
-
padding: 2px 8px;
|
|
6
|
-
border-radius: 999px;
|
|
7
|
-
font-size: 11px;
|
|
8
|
-
font-weight: 500;
|
|
9
|
-
line-height: 18px;
|
|
10
|
-
white-space: nowrap;
|
|
11
|
-
user-select: none;
|
|
12
|
-
cursor: default;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.dsh-peak-indicator--peak {
|
|
16
|
-
color: var(--dsh-color-warning, #b45309);
|
|
17
|
-
background: rgba(234, 179, 8, 0.12);
|
|
18
|
-
border: 1px solid rgba(234, 179, 8, 0.35);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.dsh-peak-indicator--off-peak {
|
|
22
|
-
color: var(--dsh-color-success, #15803d);
|
|
23
|
-
background: rgba(34, 197, 94, 0.12);
|
|
24
|
-
border: 1px solid rgba(34, 197, 94, 0.35);
|
|
25
|
-
}
|
package/lib/client/styles.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export function badgeStyle(isPeak) {
|
|
2
|
-
return {
|
|
3
|
-
display: 'inline-flex',
|
|
4
|
-
alignItems: 'center',
|
|
5
|
-
gap: 4,
|
|
6
|
-
padding: '2px 8px',
|
|
7
|
-
borderRadius: 999,
|
|
8
|
-
fontSize: 11,
|
|
9
|
-
fontWeight: 500,
|
|
10
|
-
lineHeight: '18px',
|
|
11
|
-
whiteSpace: 'nowrap',
|
|
12
|
-
userSelect: 'none',
|
|
13
|
-
cursor: 'default',
|
|
14
|
-
color: isPeak ? 'var(--dsh-color-warning, #b45309)' : 'var(--dsh-color-success, #15803d)',
|
|
15
|
-
background: isPeak ? 'rgba(234, 179, 8, 0.12)' : 'rgba(34, 197, 94, 0.12)',
|
|
16
|
-
border: `1px solid ${isPeak ? 'rgba(234, 179, 8, 0.35)' : 'rgba(34, 197, 94, 0.35)'}`,
|
|
17
|
-
};
|
|
18
|
-
}
|
package/lib/clients/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "../client/index.js";
|
package/lib/clients/styles.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { badgeStyle } from "../client/styles.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '../client/index.tsx';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { badgeStyle } from '../client/styles.ts';
|