@boxa-devops/depo-shared 1.0.4 → 1.0.5

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 (3) hide show
  1. package/README.md +13 -11
  2. package/package.json +6 -2
  3. package/tokens-kiosk.css +179 -0
package/README.md CHANGED
@@ -33,23 +33,25 @@
33
33
 
34
34
  ```sh
35
35
  pnpm install
36
- pnpm generate # openapi.json -> src/api.ts (после ../depo-api: make contract)
36
+ pnpm generate # openapi.json -> src/api.ts (после ../depo-api: make contract)
37
37
  pnpm lint
38
- pnpm typecheck # единственный гейт, видящий ошибку типов внутри пакета
38
+ pnpm typecheck # ошибки типов по исходникам
39
39
  pnpm test
40
- pnpm build # dist/: ESM + .d.ts + sourcemaps
40
+ pnpm build # dist/: ESM + .d.ts + sourcemaps
41
+ pnpm consumer-check # компиляция потребителя против тарболла, skipLibCheck OFF
42
+ pnpm preflight # тесты обоих фронтендов против этой копии контракта
41
43
  ```
42
44
 
43
45
  ## Релиз
44
46
 
45
- 1. `cd ../depo-api && make contract` — перегенерировать контракт сюда.
46
- 2. `pnpm generate && pnpm lint && pnpm typecheck && pnpm test && pnpm build`.
47
- 3. **Прогнать `pnpm test` в `depo-terminal` и `depo-admin`** — одной
48
- командой на оба это больше не сделать (было `pnpm -r test`).
49
- 4. Посмотреть `git diff openapi.json` глазами, поднять версию, записать
50
- в `CHANGELOG.md`.
51
- 5. Человек: `git commit`, `git tag vX.Y.Z`, `git push --follow-tags` →
52
- workflow публикует пакет.
47
+ 1. `cd ../depo-api && make release` — весь автоматический круг: генерация
48
+ контракта, все гейты здесь, плюс `preflight` (тесты обоих фронтендов
49
+ против этой рабочей копии). Останавливается и печатает диф.
50
+ 2. Прочитать `git diff openapi.json` глазами — это и есть гейт контракта.
51
+ 3. Поднять версию, запись в `CHANGELOG.md`.
52
+ 4. `git commit && git tag vX.Y.Z && git push --follow-tags` → workflow
53
+ публикует пакет в npmjs.
54
+ 5. Ничего. Dependabot во фронтендах сам откроет PR на новую версию.
53
55
 
54
56
  Правила версионирования и остальные детали — `CLAUDE.md`.
55
57
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@boxa-devops/depo-shared",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "Wire contract between depo-api, depo-terminal and depo-admin: generated API types, design tokens, shared guards.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",
@@ -14,6 +14,7 @@
14
14
  "src",
15
15
  "!src/**/*.test.ts",
16
16
  "tokens.css",
17
+ "tokens-kiosk.css",
17
18
  "permissions.json",
18
19
  "error_codes.json",
19
20
  "rules_fixtures.json",
@@ -26,6 +27,7 @@
26
27
  "default": "./dist/index.js"
27
28
  },
28
29
  "./tokens.css": "./tokens.css",
30
+ "./tokens-kiosk.css": "./tokens-kiosk.css",
29
31
  "./permissions.json": "./permissions.json",
30
32
  "./error_codes.json": "./error_codes.json",
31
33
  "./rules_fixtures.json": "./rules_fixtures.json",
@@ -50,6 +52,8 @@
50
52
  "build": "tsc -p tsconfig.build.json",
51
53
  "typecheck": "tsc --noEmit",
52
54
  "lint": "eslint src",
53
- "test": "vitest run"
55
+ "test": "vitest run",
56
+ "consumer-check": "node scripts/consumer-check.mjs",
57
+ "preflight": "node scripts/preflight.mjs"
54
58
  }
55
59
  }
@@ -0,0 +1,179 @@
1
+ /* ============================================================================
2
+ Kiosk theme — «тёмное стекло» for depo-terminal.
3
+
4
+ OPT-IN OVERLAY on top of tokens.css. Import order matters:
5
+
6
+ @import "@boxa-devops/depo-shared/tokens.css";
7
+ @import "@boxa-devops/depo-shared/tokens-kiosk.css";
8
+
9
+ depo-admin imports only the first file and keeps the light «технический
10
+ формуляр» look. Everything here re-binds EXISTING token names, so the
11
+ consumers' bg-paper / text-ink / rounded-md utilities flip theme without
12
+ touching a single component. Only the handful of tokens at the end are new.
13
+
14
+ Semantics are preserved, not reused loosely: a *-ink token is still the
15
+ readable text color of its tint, it is simply light now instead of dark.
16
+
17
+ WCAG AA contrast (computed; normal text needs >= 4.5). Translucent values
18
+ are composited over the app background #070A0F first, and text on glass is
19
+ measured against the composited glass surface:
20
+ ink #F5F8FF on glass = 16.24 on app bg = 18.65
21
+ ink-2 rgba(255,255,255,.72) on glass = 9.40
22
+ ink-3 rgba(255,255,255,.52) on glass = 5.51 on app bg = 5.69
23
+ accent-lt #A8C4FF on glass = 9.87
24
+ white on accent #1D4ED8 = 6.70
25
+ white on accent-2 #3B6BF5 = 4.56
26
+ on-light #0A0E14 on a white control = 19.34
27
+ warn-ink #FEDF89 on warn-tint = 11.77
28
+ ok-ink #BBF7D0 on ok-tint = 12.62
29
+ danger-ink #FFC9C9 on danger-tint = 11.62
30
+ white on danger #D92D20 = 4.83
31
+ on-light on warn #FDB022 = 10.51
32
+ on-light on ok #32D583 = 10.11
33
+ ========================================================================= */
34
+
35
+ /* --- Self-hosted fonts (depot may live without internet: no CDN, ever) -----
36
+ Barlow and Space Grotesk ship latin-only here: Uzbek Latin needs nothing
37
+ beyond it (oʻ / gʻ use U+02BB, which is inside the latin subset). Russian
38
+ is served by the Inter Cyrillic faces already declared in tokens.css — the
39
+ unicode-range split below hands Cyrillic runs to Inter automatically, so RU
40
+ text stays typographically correct instead of falling back to a system
41
+ font. Neither family has Cyrillic glyphs at all, so this is not optional. */
42
+ @font-face {
43
+ font-family: "Barlow";
44
+ font-style: normal;
45
+ font-weight: 400;
46
+ font-display: swap;
47
+ src: url("/fonts/barlow-latin-400.woff2") format("woff2");
48
+ unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
49
+ U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191,
50
+ U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
51
+ }
52
+ @font-face {
53
+ font-family: "Barlow";
54
+ font-style: normal;
55
+ font-weight: 500;
56
+ font-display: swap;
57
+ src: url("/fonts/barlow-latin-500.woff2") format("woff2");
58
+ unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
59
+ U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191,
60
+ U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
61
+ }
62
+ @font-face {
63
+ font-family: "Barlow";
64
+ font-style: normal;
65
+ font-weight: 600;
66
+ font-display: swap;
67
+ src: url("/fonts/barlow-latin-600.woff2") format("woff2");
68
+ unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
69
+ U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191,
70
+ U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
71
+ }
72
+ @font-face {
73
+ font-family: "Barlow";
74
+ font-style: normal;
75
+ font-weight: 700;
76
+ font-display: swap;
77
+ src: url("/fonts/barlow-latin-700.woff2") format("woff2");
78
+ unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
79
+ U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191,
80
+ U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
81
+ }
82
+ @font-face {
83
+ font-family: "Space Grotesk";
84
+ font-style: normal;
85
+ font-weight: 300 700;
86
+ font-display: swap;
87
+ src: url("/fonts/space-grotesk-latin-wght.woff2") format("woff2-variations");
88
+ unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
89
+ U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191,
90
+ U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
91
+ }
92
+
93
+ @theme {
94
+ /* --- Neutrals: near-black room, translucent glass surfaces ------------- */
95
+ --color-steel: #070a0f; /* app background — the dark room */
96
+ --color-paper: rgb(255 255 255 / 0.07); /* glass surface: cards, header */
97
+ --color-ink: #f5f8ff; /* primary text */
98
+ --color-ink-2: rgb(255 255 255 / 0.72); /* secondary text */
99
+ --color-ink-3: rgb(255 255 255 / 0.52); /* muted text, placeholders */
100
+ --color-line: rgb(255 255 255 / 0.14); /* glass hairline */
101
+ --color-line-strong: rgb(255 255 255 / 0.3); /* emphasized rule */
102
+ --color-hover: rgb(255 255 255 / 0.12); /* glass lifted one step */
103
+
104
+ /* --- Accent: the design's electric blue -------------------------------- */
105
+ --color-accent: #1d4ed8;
106
+ --color-accent-2: #3b6bf5; /* hover of primary, gradient top stop */
107
+ --color-accent-tint: rgb(41 98 255 / 0.18); /* selected chip fill */
108
+ --color-accent-lt: #a8c4ff; /* links and accented text on glass */
109
+
110
+ /* --- Signals — still reserved for statuses & alarms --------------------- */
111
+ --color-danger: #d92d20;
112
+ --color-danger-ink: #ffc9c9;
113
+ --color-danger-tint: rgb(229 72 77 / 0.18);
114
+ --color-warn: #fdb022;
115
+ --color-warn-ink: #fedf89;
116
+ --color-warn-tint: rgb(247 144 9 / 0.18);
117
+ --color-ok: #32d583;
118
+ --color-ok-ink: #bbf7d0;
119
+ --color-ok-tint: rgb(50 213 131 / 0.16);
120
+
121
+ /* --- Status hues: same hue per status as the light theme, lifted so they
122
+ read as dots on a dark room instead of turning to mud. ------------ */
123
+ --color-st-blue: #60a5fa; /* IN_STOCK_NEW */
124
+ --color-st-green: #4ade80; /* IN_STOCK_OK */
125
+ --color-st-teal: #2dd4bf; /* INSTALLED */
126
+ --color-st-slate: #94a3b8; /* REMOVED, neutral/unknown */
127
+ --color-st-sky: #38bdf8; /* IN_TRANSIT, ACCEPTED */
128
+ --color-st-amber: #fdb022; /* IN_STOCK_DEFECT, IN_REPAIR, IN_PROGRESS */
129
+ --color-st-purple: #c084fc; /* AWAITING_QC */
130
+ --color-st-orange: #fb923c; /* AWAITING_DISPOSITION */
131
+ --color-st-indigo: #818cf8; /* PLANT_REPAIR, OPEN orders */
132
+ --color-st-violet: #a78bfa; /* ON_HOLD */
133
+ --color-st-red: #f87171; /* SCRAPPED, RETURNED */
134
+ --color-st-red-dark: #dc2626; /* LOST */
135
+ --color-st-stone: #bfa094; /* REPLACED */
136
+ --color-st-cyan: #22d3ee; /* repair event group on the history ribbon */
137
+
138
+ /* --- Type: Barlow for UI, Space Grotesk for identifiers and headings.
139
+ Inter stays in both stacks as the Cyrillic face. ------------------ */
140
+ --font-sans: "Barlow", "Inter", system-ui, -apple-system, "Segoe UI",
141
+ sans-serif;
142
+ --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
143
+ --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas,
144
+ monospace;
145
+
146
+ /* --- Radius: the formulyar's single 6px does not exist here. Controls are
147
+ pills (rounded-full), surfaces are soft rectangles. --------------- */
148
+ --radius-sm: 12px;
149
+ --radius-md: 18px;
150
+ --radius-lg: 24px;
151
+ --radius-xl: 30px;
152
+
153
+ /* --- Shadows: glass needs the inset top highlight, or it reads as flat
154
+ grey rather than lit glass. --------------------------------------- */
155
+ --shadow-rest: 0 1px 0 rgb(255 255 255 / 0.18) inset,
156
+ 0 8px 24px rgb(0 0 0 / 0.38);
157
+ --shadow-raise: 0 1px 0 rgb(255 255 255 / 0.28) inset,
158
+ 0 24px 56px rgb(0 0 0 / 0.5);
159
+
160
+ /* --- New here: no light-theme counterpart exists ----------------------- */
161
+
162
+ /* Text placed ON a light control (the active pill / tab is near-white). */
163
+ --color-on-light: #0a0e14;
164
+ /* Glass one step brighter — active pill, hovered card. */
165
+ --color-glass-2: rgb(255 255 255 / 0.12);
166
+ /* Near-white control fill: active tab, active series chip. */
167
+ --color-control: rgb(255 255 255 / 0.95);
168
+ /* Photo well behind a locomotive image before it loads. */
169
+ --color-well: #1a2230;
170
+
171
+ /* Room glows: three fixed radial washes behind everything. Decor only —
172
+ never a signal, so they are deliberately not the signal colors. */
173
+ --color-glow-blue: rgb(41 98 255 / 0.2);
174
+ --color-glow-teal: rgb(0 190 164 / 0.12);
175
+ --color-glow-amber: rgb(247 144 9 / 0.1);
176
+
177
+ /* Glass blur, one knob so every surface agrees. */
178
+ --blur-glass: 44px;
179
+ }