@welcome-back/brand 0.15.1 → 0.16.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.
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ILLUSTRATION_COLOURS = void 0;
3
+ exports.ILLUSTRATION_COLOURS_DARK = exports.ILLUSTRATION_COLOURS = void 0;
4
+ exports.moduleIconDarkCss = moduleIconDarkCss;
4
5
  /**
5
6
  * Colours of the illustrated icons (Paper 01M72Y4K1ZCAWQ5WGA3CD16CFN, style of
6
7
  * the weekly product email). The same values are the `--color-illus-*` tokens
@@ -25,3 +26,30 @@ exports.ILLUSTRATION_COLOURS = {
25
26
  kraft: "#E3BE7A",
26
27
  kraftDark: "#C9A060",
27
28
  };
29
+ /**
30
+ * Dark mode of the module icons (Paper 01M6SCB9QBX9A2DGSX70XB4AH6, frame
31
+ * «Íconos en modo oscuro», option B): dark tile, light lines, whites become
32
+ * dark grey. Yellow, green, coral and the food colours stay.
33
+ */
34
+ exports.ILLUSTRATION_COLOURS_DARK = {
35
+ ink: "#EDE8DC",
36
+ paper: "#2B2722",
37
+ paperBorder: "#3A352D",
38
+ paperShade: "#4A443A",
39
+ shadow: "#00000059",
40
+ muted: "#EDE8DC66",
41
+ white: "#3A352D",
42
+ };
43
+ /**
44
+ * CSS that repaints every `.wb-module-icon` under `scope` with the dark
45
+ * colours. A CSS rule beats an SVG presentation attribute, so the art keeps
46
+ * one drawing.
47
+ */
48
+ function moduleIconDarkCss(scope = ".dark") {
49
+ return Object.entries(exports.ILLUSTRATION_COLOURS_DARK)
50
+ .flatMap(([name, dark]) => {
51
+ const light = exports.ILLUSTRATION_COLOURS[name];
52
+ return ["fill", "stroke"].map((p) => `${scope} .wb-module-icon [${p}="${light}" i] { ${p}: ${dark}; }`);
53
+ })
54
+ .join("\n") + "\n";
55
+ }
package/dist/cjs/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.productImageKeptArea = exports.productImageAspectRatio = exports.PRODUCT_IMAGE_FRAMES = exports.categorySlotForIndex = exports.DEFAULT_CATEGORY_SLOT = exports.CATEGORY_PALETTE_TOKENS = exports.CATEGORY_PALETTE_DARK_TOKENS = exports.CATEGORY_PALETTE_DARK = exports.CATEGORY_PALETTE = exports.posTokensCss = exports.posDarkTokensCss = exports.POS_WIDE_MIN_WIDTH = exports.POS_TOKENS = exports.POS_DARK_TOKENS = exports.POS_DARK_CLASS = exports.ILLUSTRATION_COLOURS = exports.ILLUSTRATED_ICONS = exports.IllustratedIcon = exports.MODULE_ICON_NAMES = exports.ModuleIcon = exports.RunnerLoader = void 0;
3
+ exports.productImageKeptArea = exports.productImageAspectRatio = exports.PRODUCT_IMAGE_FRAMES = exports.categorySlotForIndex = exports.DEFAULT_CATEGORY_SLOT = exports.CATEGORY_PALETTE_TOKENS = exports.CATEGORY_PALETTE_DARK_TOKENS = exports.CATEGORY_PALETTE_DARK = exports.CATEGORY_PALETTE = exports.posTokensCss = exports.posDarkTokensCss = exports.POS_WIDE_MIN_WIDTH = exports.POS_TOKENS = exports.POS_DARK_TOKENS = exports.POS_DARK_CLASS = exports.moduleIconDarkCss = exports.ILLUSTRATION_COLOURS_DARK = exports.ILLUSTRATION_COLOURS = exports.ILLUSTRATED_ICONS = exports.IllustratedIcon = exports.MODULE_ICON_NAMES = exports.ModuleIcon = exports.RunnerLoader = void 0;
4
4
  var RunnerLoader_js_1 = require("./RunnerLoader.js");
5
5
  Object.defineProperty(exports, "RunnerLoader", { enumerable: true, get: function () { return RunnerLoader_js_1.RunnerLoader; } });
6
6
  var ModuleIcon_js_1 = require("./ModuleIcon.js");
@@ -11,6 +11,8 @@ Object.defineProperty(exports, "IllustratedIcon", { enumerable: true, get: funct
11
11
  Object.defineProperty(exports, "ILLUSTRATED_ICONS", { enumerable: true, get: function () { return IllustratedIcon_js_1.ILLUSTRATED_ICONS; } });
12
12
  var illustrationColours_js_1 = require("./illustrationColours.js");
13
13
  Object.defineProperty(exports, "ILLUSTRATION_COLOURS", { enumerable: true, get: function () { return illustrationColours_js_1.ILLUSTRATION_COLOURS; } });
14
+ Object.defineProperty(exports, "ILLUSTRATION_COLOURS_DARK", { enumerable: true, get: function () { return illustrationColours_js_1.ILLUSTRATION_COLOURS_DARK; } });
15
+ Object.defineProperty(exports, "moduleIconDarkCss", { enumerable: true, get: function () { return illustrationColours_js_1.moduleIconDarkCss; } });
14
16
  var posTokens_js_1 = require("./posTokens.js");
15
17
  Object.defineProperty(exports, "POS_DARK_CLASS", { enumerable: true, get: function () { return posTokens_js_1.POS_DARK_CLASS; } });
16
18
  Object.defineProperty(exports, "POS_DARK_TOKENS", { enumerable: true, get: function () { return posTokens_js_1.POS_DARK_TOKENS; } });
@@ -23,3 +23,23 @@ export declare const ILLUSTRATION_COLOURS: {
23
23
  readonly kraftDark: "#C9A060";
24
24
  };
25
25
  export type IllustrationColour = keyof typeof ILLUSTRATION_COLOURS;
26
+ /**
27
+ * Dark mode of the module icons (Paper 01M6SCB9QBX9A2DGSX70XB4AH6, frame
28
+ * «Íconos en modo oscuro», option B): dark tile, light lines, whites become
29
+ * dark grey. Yellow, green, coral and the food colours stay.
30
+ */
31
+ export declare const ILLUSTRATION_COLOURS_DARK: {
32
+ readonly ink: "#EDE8DC";
33
+ readonly paper: "#2B2722";
34
+ readonly paperBorder: "#3A352D";
35
+ readonly paperShade: "#4A443A";
36
+ readonly shadow: "#00000059";
37
+ readonly muted: "#EDE8DC66";
38
+ readonly white: "#3A352D";
39
+ };
40
+ /**
41
+ * CSS that repaints every `.wb-module-icon` under `scope` with the dark
42
+ * colours. A CSS rule beats an SVG presentation attribute, so the art keeps
43
+ * one drawing.
44
+ */
45
+ export declare function moduleIconDarkCss(scope?: string): string;
@@ -22,3 +22,30 @@ export const ILLUSTRATION_COLOURS = {
22
22
  kraft: "#E3BE7A",
23
23
  kraftDark: "#C9A060",
24
24
  };
25
+ /**
26
+ * Dark mode of the module icons (Paper 01M6SCB9QBX9A2DGSX70XB4AH6, frame
27
+ * «Íconos en modo oscuro», option B): dark tile, light lines, whites become
28
+ * dark grey. Yellow, green, coral and the food colours stay.
29
+ */
30
+ export const ILLUSTRATION_COLOURS_DARK = {
31
+ ink: "#EDE8DC",
32
+ paper: "#2B2722",
33
+ paperBorder: "#3A352D",
34
+ paperShade: "#4A443A",
35
+ shadow: "#00000059",
36
+ muted: "#EDE8DC66",
37
+ white: "#3A352D",
38
+ };
39
+ /**
40
+ * CSS that repaints every `.wb-module-icon` under `scope` with the dark
41
+ * colours. A CSS rule beats an SVG presentation attribute, so the art keeps
42
+ * one drawing.
43
+ */
44
+ export function moduleIconDarkCss(scope = ".dark") {
45
+ return Object.entries(ILLUSTRATION_COLOURS_DARK)
46
+ .flatMap(([name, dark]) => {
47
+ const light = ILLUSTRATION_COLOURS[name];
48
+ return ["fill", "stroke"].map((p) => `${scope} .wb-module-icon [${p}="${light}" i] { ${p}: ${dark}; }`);
49
+ })
50
+ .join("\n") + "\n";
51
+ }
@@ -4,7 +4,7 @@ export { ModuleIcon, MODULE_ICON_NAMES } from "./ModuleIcon.js";
4
4
  export type { ModuleIconName, ModuleIconProps } from "./ModuleIcon.js";
5
5
  export { IllustratedIcon, ILLUSTRATED_ICONS } from "./IllustratedIcon.js";
6
6
  export type { IllustratedIconName, IllustratedIconProps } from "./IllustratedIcon.js";
7
- export { ILLUSTRATION_COLOURS } from "./illustrationColours.js";
7
+ export { ILLUSTRATION_COLOURS, ILLUSTRATION_COLOURS_DARK, moduleIconDarkCss } from "./illustrationColours.js";
8
8
  export type { IllustrationColour } from "./illustrationColours.js";
9
9
  export { POS_DARK_CLASS, POS_DARK_TOKENS, POS_TOKENS, POS_WIDE_MIN_WIDTH, posDarkTokensCss, posTokensCss, } from "./posTokens.js";
10
10
  export type { PosToken } from "./posTokens.js";
package/dist/esm/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  export { RunnerLoader } from "./RunnerLoader.js";
2
2
  export { ModuleIcon, MODULE_ICON_NAMES } from "./ModuleIcon.js";
3
3
  export { IllustratedIcon, ILLUSTRATED_ICONS } from "./IllustratedIcon.js";
4
- export { ILLUSTRATION_COLOURS } from "./illustrationColours.js";
4
+ export { ILLUSTRATION_COLOURS, ILLUSTRATION_COLOURS_DARK, moduleIconDarkCss } from "./illustrationColours.js";
5
5
  export { POS_DARK_CLASS, POS_DARK_TOKENS, POS_TOKENS, POS_WIDE_MIN_WIDTH, posDarkTokensCss, posTokensCss, } from "./posTokens.js";
6
6
  export { CATEGORY_PALETTE, CATEGORY_PALETTE_DARK, CATEGORY_PALETTE_DARK_TOKENS, CATEGORY_PALETTE_TOKENS, DEFAULT_CATEGORY_SLOT, categorySlotForIndex, } from "./categoryPalette.js";
7
7
  export { PRODUCT_IMAGE_FRAMES, productImageAspectRatio, productImageKeptArea, } from "./productImageFrames.js";
@@ -0,0 +1,15 @@
1
+ /* Generated from src/illustrationColours.ts by scripts/write-pos-tokens-css.mjs. Do not edit. */
2
+ .dark .wb-module-icon [fill="#1D1D1F" i] { fill: #EDE8DC; }
3
+ .dark .wb-module-icon [stroke="#1D1D1F" i] { stroke: #EDE8DC; }
4
+ .dark .wb-module-icon [fill="#FFFAF0" i] { fill: #2B2722; }
5
+ .dark .wb-module-icon [stroke="#FFFAF0" i] { stroke: #2B2722; }
6
+ .dark .wb-module-icon [fill="#EDEADE" i] { fill: #3A352D; }
7
+ .dark .wb-module-icon [stroke="#EDEADE" i] { stroke: #3A352D; }
8
+ .dark .wb-module-icon [fill="#F1EADB" i] { fill: #4A443A; }
9
+ .dark .wb-module-icon [stroke="#F1EADB" i] { stroke: #4A443A; }
10
+ .dark .wb-module-icon [fill="#1D1D1F12" i] { fill: #00000059; }
11
+ .dark .wb-module-icon [stroke="#1D1D1F12" i] { stroke: #00000059; }
12
+ .dark .wb-module-icon [fill="#1D1D1F55" i] { fill: #EDE8DC66; }
13
+ .dark .wb-module-icon [stroke="#1D1D1F55" i] { stroke: #EDE8DC66; }
14
+ .dark .wb-module-icon [fill="#FFFFFF" i] { fill: #3A352D; }
15
+ .dark .wb-module-icon [stroke="#FFFFFF" i] { stroke: #3A352D; }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@welcome-back/brand",
3
- "version": "0.15.1",
3
+ "version": "0.16.0",
4
4
  "description": "WelcomeBack brand assets for React apps: the running-W loader, the module icons, 108 illustrated icons and the POS design tokens.",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {
@@ -18,7 +18,8 @@
18
18
  "import": "./dist/esm/index.js",
19
19
  "require": "./dist/cjs/index.js"
20
20
  },
21
- "./pos-tokens.css": "./dist/pos-tokens.css"
21
+ "./pos-tokens.css": "./dist/pos-tokens.css",
22
+ "./module-icon-dark.css": "./dist/module-icon-dark.css"
22
23
  },
23
24
  "files": [
24
25
  "dist"