@things-factory/shell 10.1.258 → 10.1.259

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.
@@ -1,3 +1,4 @@
1
+ /* Destructive colors inherit the shared light/dark semantic palette, independently of the brand. */
1
2
  .domain-theme-cherry-red {
2
3
  --md-sys-color-primary: rgb(211 47 47);
3
4
  --md-sys-color-surface-tint: rgb(211 47 47);
@@ -12,10 +13,6 @@
12
13
  --md-sys-color-on-tertiary: rgb(255 255 255);
13
14
  --md-sys-color-tertiary-container: rgb(252 228 236);
14
15
  --md-sys-color-on-tertiary-container: rgb(136 14 79);
15
- --md-sys-color-error: #fe594e;
16
- --md-sys-color-on-error: rgb(255 255 255);
17
- --md-sys-color-error-container: rgb(255 218 215);
18
- --md-sys-color-on-error-container: #fe594e;
19
16
  --md-sys-color-background: rgb(255 250 250);
20
17
  --md-sys-color-on-background: rgb(35 25 25);
21
18
  --md-sys-color-surface: rgb(255 250 250);
@@ -64,10 +61,6 @@
64
61
  --md-sys-color-on-tertiary: rgb(136 14 79);
65
62
  --md-sys-color-tertiary-container: rgb(173 20 87);
66
63
  --md-sys-color-on-tertiary-container: rgb(252 228 236);
67
- --md-sys-color-error: #fbafa9;
68
- --md-sys-color-on-error: #fe594e;
69
- --md-sys-color-error-container: #fe594e;
70
- --md-sys-color-on-error-container: #fbafa9;
71
64
  --md-sys-color-background: rgb(25 17 17);
72
65
  --md-sys-color-on-background: rgb(238 226 226);
73
66
  --md-sys-color-surface: rgb(25 17 17);
@@ -1,3 +1,4 @@
1
+ /* Destructive colors inherit the shared light/dark semantic palette, independently of the brand. */
1
2
  .domain-theme-forest-green {
2
3
  --md-sys-color-primary: rgb(56 142 60);
3
4
  --md-sys-color-surface-tint: rgb(56 142 60);
@@ -12,10 +13,6 @@
12
13
  --md-sys-color-on-tertiary: rgb(255 255 255);
13
14
  --md-sys-color-tertiary-container: rgb(178 223 219);
14
15
  --md-sys-color-on-tertiary-container: rgb(0 77 64);
15
- --md-sys-color-error: #fe594e;
16
- --md-sys-color-on-error: rgb(255 255 255);
17
- --md-sys-color-error-container: rgb(255 218 215);
18
- --md-sys-color-on-error-container: #fe594e;
19
16
  --md-sys-color-background: rgb(250 253 250);
20
17
  --md-sys-color-on-background: rgb(25 32 25);
21
18
  --md-sys-color-surface: rgb(250 253 250);
@@ -64,10 +61,6 @@
64
61
  --md-sys-color-on-tertiary: rgb(0 77 64);
65
62
  --md-sys-color-tertiary-container: rgb(0 105 92);
66
63
  --md-sys-color-on-tertiary-container: rgb(178 223 219);
67
- --md-sys-color-error: #fbafa9;
68
- --md-sys-color-on-error: #fe594e;
69
- --md-sys-color-error-container: #fe594e;
70
- --md-sys-color-on-error-container: #fbafa9;
71
64
  --md-sys-color-background: rgb(17 22 17);
72
65
  --md-sys-color-on-background: rgb(226 235 226);
73
66
  --md-sys-color-surface: rgb(17 22 17);
@@ -1,3 +1,4 @@
1
+ /* Destructive colors inherit the shared light/dark semantic palette, independently of the brand. */
1
2
  .domain-theme-ocean-blue {
2
3
  --md-sys-color-primary: rgb(30 136 229);
3
4
  --md-sys-color-surface-tint: rgb(30 136 229);
@@ -12,10 +13,6 @@
12
13
  --md-sys-color-on-tertiary: rgb(255 255 255);
13
14
  --md-sys-color-tertiary-container: rgb(178 235 242);
14
15
  --md-sys-color-on-tertiary-container: rgb(0 96 100);
15
- --md-sys-color-error: #fe594e;
16
- --md-sys-color-on-error: rgb(255 255 255);
17
- --md-sys-color-error-container: rgb(255 218 215);
18
- --md-sys-color-on-error-container: #fe594e;
19
16
  --md-sys-color-background: rgb(250 252 255);
20
17
  --md-sys-color-on-background: rgb(23 29 35);
21
18
  --md-sys-color-surface: rgb(250 252 255);
@@ -64,10 +61,6 @@
64
61
  --md-sys-color-on-tertiary: rgb(0 96 100);
65
62
  --md-sys-color-tertiary-container: rgb(0 131 143);
66
63
  --md-sys-color-on-tertiary-container: rgb(178 235 242);
67
- --md-sys-color-error: #fbafa9;
68
- --md-sys-color-on-error: #fe594e;
69
- --md-sys-color-error-container: #fe594e;
70
- --md-sys-color-on-error-container: #fbafa9;
71
64
  --md-sys-color-background: rgb(16 22 28);
72
65
  --md-sys-color-on-background: rgb(226 234 242);
73
66
  --md-sys-color-surface: rgb(16 22 28);
@@ -1,3 +1,4 @@
1
+ /* Destructive colors inherit the shared light/dark semantic palette, independently of the brand. */
1
2
  .domain-theme-royal-purple {
2
3
  --md-sys-color-primary: rgb(123 31 162);
3
4
  --md-sys-color-surface-tint: rgb(123 31 162);
@@ -12,10 +13,6 @@
12
13
  --md-sys-color-on-tertiary: rgb(255 255 255);
13
14
  --md-sys-color-tertiary-container: rgb(209 196 233);
14
15
  --md-sys-color-on-tertiary-container: rgb(49 27 146);
15
- --md-sys-color-error: #fe594e;
16
- --md-sys-color-on-error: rgb(255 255 255);
17
- --md-sys-color-error-container: rgb(255 218 215);
18
- --md-sys-color-on-error-container: #fe594e;
19
16
  --md-sys-color-background: rgb(253 250 255);
20
17
  --md-sys-color-on-background: rgb(30 25 35);
21
18
  --md-sys-color-surface: rgb(253 250 255);
@@ -64,10 +61,6 @@
64
61
  --md-sys-color-on-tertiary: rgb(49 27 146);
65
62
  --md-sys-color-tertiary-container: rgb(69 39 160);
66
63
  --md-sys-color-on-tertiary-container: rgb(209 196 233);
67
- --md-sys-color-error: #fbafa9;
68
- --md-sys-color-on-error: #fe594e;
69
- --md-sys-color-error-container: #fe594e;
70
- --md-sys-color-on-error-container: #fbafa9;
71
64
  --md-sys-color-background: rgb(20 16 25);
72
65
  --md-sys-color-on-background: rgb(230 226 236);
73
66
  --md-sys-color-surface: rgb(20 16 25);
@@ -1,3 +1,4 @@
1
+ /* Destructive colors inherit the shared light/dark semantic palette, independently of the brand. */
1
2
  .domain-theme-sunset-orange {
2
3
  --md-sys-color-primary: rgb(245 124 0);
3
4
  --md-sys-color-surface-tint: rgb(245 124 0);
@@ -12,10 +13,6 @@
12
13
  --md-sys-color-on-tertiary: rgb(0 0 0);
13
14
  --md-sys-color-tertiary-container: rgb(255 249 196);
14
15
  --md-sys-color-on-tertiary-container: rgb(255 143 0);
15
- --md-sys-color-error: #fe594e;
16
- --md-sys-color-on-error: rgb(255 255 255);
17
- --md-sys-color-error-container: rgb(255 218 215);
18
- --md-sys-color-on-error-container: #fe594e;
19
16
  --md-sys-color-background: rgb(255 252 248);
20
17
  --md-sys-color-on-background: rgb(35 30 24);
21
18
  --md-sys-color-surface: rgb(255 252 248);
@@ -64,10 +61,6 @@
64
61
  --md-sys-color-on-tertiary: rgb(255 143 0);
65
62
  --md-sys-color-tertiary-container: rgb(255 160 0);
66
63
  --md-sys-color-on-tertiary-container: rgb(255 249 196);
67
- --md-sys-color-error: #fbafa9;
68
- --md-sys-color-on-error: #fe594e;
69
- --md-sys-color-error-container: #fe594e;
70
- --md-sys-color-on-error-container: #fbafa9;
71
64
  --md-sys-color-background: rgb(24 20 14);
72
65
  --md-sys-color-on-background: rgb(234 228 220);
73
66
  --md-sys-color-surface: rgb(24 20 14);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/shell",
3
- "version": "10.1.258",
3
+ "version": "10.1.259",
4
4
  "description": "Core module for framework",
5
5
  "bin": {
6
6
  "things-factory": "bin/things-factory",
@@ -142,5 +142,5 @@
142
142
  "pg": "^8.7.3",
143
143
  "sqlite3": "^5.0.8"
144
144
  },
145
- "gitHead": "c7b7e3b4e9aa1b36a246ccee312a4124a50924dd"
145
+ "gitHead": "e7283779ee700b4b124226f0ad22d7c1e4063ae7"
146
146
  }
@@ -0,0 +1,28 @@
1
+ import { test } from 'node:test'
2
+ import assert from 'node:assert/strict'
3
+ import { readFileSync, readdirSync } from 'node:fs'
4
+
5
+ const directory = new URL('../client/themes/', import.meta.url)
6
+ const declarations = text => Object.fromEntries([...text.matchAll(/(--md-sys-color-(?:on-)?error(?:-container)?):\s*([^;]+);/g)].map(match => [match[1], match[2].trim()]))
7
+ function luminance(color) {
8
+ const channels = color.startsWith('#')
9
+ ? color.slice(1).match(/../g).map(part => parseInt(part, 16))
10
+ : color.match(/[\d.]+/g).slice(0, 3).map(Number)
11
+ return channels.map(n => n / 255).map(n => n <= .04045 ? n / 12.92 : ((n + .055) / 1.055) ** 2.4).reduce((sum, n, i) => sum + n * [.2126, .7152, .0722][i], 0)
12
+ }
13
+ for (const mode of ['light', 'dark']) {
14
+ test(`${mode}: both destructive foreground/background pairs retain readable contrast`, () => {
15
+ const colors = declarations(readFileSync(new URL(`${mode}.css`, directory), 'utf8'))
16
+ for (const suffix of ['', '-container']) {
17
+ const a = luminance(colors[`--md-sys-color-error${suffix}`])
18
+ const b = luminance(colors[`--md-sys-color-on-error${suffix}`])
19
+ const contrast = (Math.max(a, b) + .05) / (Math.min(a, b) + .05)
20
+ assert.ok(contrast >= 4.5, `${mode}${suffix}: ${contrast.toFixed(2)}`)
21
+ }
22
+ })
23
+ }
24
+ for (const file of readdirSync(directory).filter(name => /^domain-theme-.*\.css$/.test(name))) {
25
+ test(`${file}: branding inherits destructive colors from the shared light/dark palette`, () => {
26
+ assert.deepEqual(declarations(readFileSync(new URL(file, directory), 'utf8')), {})
27
+ })
28
+ }