@welcome-back/brand 0.11.0 → 0.12.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.
package/README.md CHANGED
@@ -2,9 +2,13 @@
2
2
 
3
3
  WelcomeBack brand assets for React apps.
4
4
 
5
- Today the package has one component: **`RunnerLoader`**, the isotipo W running
6
- left. Its legs swing on their hips and cross under the body while the body bobs.
7
- Use it for loading moments that mean "on the way to the next step".
5
+ Two components:
6
+
7
+ - **`RunnerLoader`**, the isotipo W running left. Its legs swing on their hips
8
+ and cross under the body while the body bobs. Use it for loading moments that
9
+ mean "on the way to the next step".
10
+ - **`ModuleIcon`**, the illustrated icon of each dashboard module (see
11
+ [Module icons](#module-icons)).
8
12
 
9
13
  - React 18 or 19. Works in Next.js (App Router and Pages), Vite and plain React.
10
14
  - No CSS import, no Tailwind, no bundler setup: the animation ships inside the SVG.
@@ -20,6 +24,7 @@ Use it for loading moments that mean "on the way to the next step".
20
24
  - [Examples](#examples)
21
25
  - [POS design tokens](#pos-design-tokens)
22
26
  - [Product image frames](#product-image-frames)
27
+ - [Module icons](#module-icons)
23
28
  - [Accessibility](#accessibility)
24
29
  - [Where to use it, and where not](#where-to-use-it-and-where-not)
25
30
  - [Troubleshooting](#troubleshooting)
@@ -376,6 +381,50 @@ productImageKeptArea('16:9'); // { width: 1, height: 0.5625 } of the square, cen
376
381
 
377
382
  `PRODUCT_IMAGE_FRAMES` holds the raw `{ width, height }` of each frame.
378
383
 
384
+ ## Module icons
385
+
386
+ One illustrated icon per dashboard module, drawn on its cream tile, in the style
387
+ of the weekly product email. Design: Paper 01M72Y4K1ZCAWQ5WGA3CD16CFN (library)
388
+ and the B.00 home grid in Paper 01M6SCB9QBX9A2DGSX70XB4AH6.
389
+
390
+ ```tsx
391
+ import { ModuleIcon, MODULE_ICON_NAMES } from '@welcome-back/brand';
392
+
393
+ <ModuleIcon name="catalogo" className="w-22" />; // decorative, next to a visible label
394
+ <ModuleIcon name="finanzas" className="w-16" label="Finanzas" />; // alone: give it a name
395
+ MODULE_ICON_NAMES; // ['actividad', 'reporteria', …, 'configuracion'], home-grid order
396
+ ```
397
+
398
+ | Name | Drawing |
399
+ |---|---|
400
+ | `actividad` | Shop with an awning |
401
+ | `reporteria` | Chart on a stand and a magnifier |
402
+ | `finanzas` | Receipt, bill and coins |
403
+ | `catalogo` | Menu card and a coffee to go |
404
+ | `canales` | Phone with the digital menu and a delivery bag |
405
+ | `operaciones` | Open box with a bottle and bread |
406
+ | `fidelizacion` | Stamp card |
407
+ | `marketing` | Megaphone with a heart |
408
+ | `reputacion` | Review bubble and a star |
409
+ | `configuracion` | Sliders panel and a gear |
410
+
411
+ - **Size.** It is square: set a width. It reads well from 48 px. Under 48 px the
412
+ detail turns into noise: use a line icon (lucide) there, for example in a
413
+ sidebar.
414
+ - **Tile.** The cream tile and its border are part of the SVG. Add a shadow or a
415
+ radius on the parent if the surface needs one (the B.00 grid uses 88 px).
416
+ - **No text inside.** The art has no `<text>`, so it needs no font. A test
417
+ checks this.
418
+
419
+ ### Illustration colours
420
+
421
+ `ILLUSTRATION_COLOURS` holds the palette of the drawings. The same values are the
422
+ `--color-illus-*` tokens in the wb-ui design system file.
423
+
424
+ Soft colours are for art, strong colours are for app messages. Do not use these
425
+ as status colours, and never put `coral` on a badge or a pill with a number: it
426
+ reads as an error or a notification.
427
+
379
428
  ## Accessibility
380
429
 
381
430
  - **Give exactly one accessible name per loading state.** Either put `label` on
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MODULE_ICON_NAMES = void 0;
4
+ exports.ModuleIcon = ModuleIcon;
5
+ const jsx_runtime_1 = require("react/jsx-runtime");
6
+ const illustrationColours_js_1 = require("./illustrationColours.js");
7
+ const K = illustrationColours_js_1.ILLUSTRATION_COLOURS.ink;
8
+ const W = illustrationColours_js_1.ILLUSTRATION_COLOURS.white;
9
+ /** 2 px outline, 1.75 px detail, 1.5 px fine detail, in 120-unit art space. */
10
+ const line = (width = 2) => ({ stroke: K, strokeWidth: width });
11
+ const SPARK = { fill: "none", ...line(1.75) };
12
+ const STAR = "M0 -6 L1.76 -2.43 L5.71 -1.85 L2.85 0.93 L3.53 4.85 L0 3 L-3.53 4.85 L-2.85 0.93 L-5.71 -1.85 L-1.76 -2.43 Z";
13
+ // A coffee cup stamp on the loyalty card.
14
+ const CUP = (x, y) => `M${x - 2.5} ${y - 1.4}h4.2v1.8a2.1 2.1 0 0 1-4.2 0z M${x + 1.7} ${y - 0.9}a1.2 1.2 0 0 1 0 2.4`;
15
+ const coinStack = [86, 78, 70].map((y, i) => ((0, jsx_runtime_1.jsxs)("g", { children: [(0, jsx_runtime_1.jsx)("rect", { x: "72", y: y, width: "28", height: "6", fill: illustrationColours_js_1.ILLUSTRATION_COLOURS.yellow }), (0, jsx_runtime_1.jsx)("path", { d: `M72 ${y} V${y + 6} M100 ${y} V${y + 6}`, ...line() }), i === 0 ? ((0, jsx_runtime_1.jsx)("ellipse", { cx: "86", cy: y + 6, rx: "14", ry: "4.5", fill: illustrationColours_js_1.ILLUSTRATION_COLOURS.yellow, ...line() })) : ((0, jsx_runtime_1.jsx)("path", { d: `M72 ${y + 6} A14 4.5 0 0 0 100 ${y + 6}`, fill: illustrationColours_js_1.ILLUSTRATION_COLOURS.yellow, ...line() })), (0, jsx_runtime_1.jsx)("ellipse", { cx: "86", cy: y, rx: "14", ry: "4.5", fill: illustrationColours_js_1.ILLUSTRATION_COLOURS.yellow, ...line() })] }, y)));
16
+ const ART = {
17
+ // The shop: the business live today.
18
+ actividad: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("rect", { x: "26", y: "44", width: "68", height: "52", fill: W, ...line() }), (0, jsx_runtime_1.jsx)("rect", { x: "34", y: "56", width: "24", height: "22", rx: "3", fill: W, ...line(1.75) }), (0, jsx_runtime_1.jsx)("path", { d: "M40 56 L42 65 M52 56 L50 65", fill: "none", ...line(1.25) }), (0, jsx_runtime_1.jsx)("rect", { x: "37", y: "65", width: "18", height: "8", rx: "2", fill: illustrationColours_js_1.ILLUSTRATION_COLOURS.green, ...line(1.5) }), (0, jsx_runtime_1.jsx)("rect", { x: "66", y: "60", width: "20", height: "36", rx: "2", fill: illustrationColours_js_1.ILLUSTRATION_COLOURS.yellow, ...line() }), (0, jsx_runtime_1.jsx)("circle", { cx: "71", cy: "79", r: "1.4", fill: K }), (0, jsx_runtime_1.jsx)("rect", { x: "20", y: "30", width: "80", height: "12", rx: "3", fill: W, ...line() }), (0, jsx_runtime_1.jsx)("path", { d: "M36 31 V41 M52 31 V41 M68 31 V41 M84 31 V41", ...line(1.5) }), (0, jsx_runtime_1.jsx)("rect", { x: "37", y: "31", width: "14", height: "10", fill: illustrationColours_js_1.ILLUSTRATION_COLOURS.yellow }), (0, jsx_runtime_1.jsx)("rect", { x: "69", y: "31", width: "14", height: "10", fill: illustrationColours_js_1.ILLUSTRATION_COLOURS.yellow }), [20, 36, 52, 68, 84].map((x, i) => ((0, jsx_runtime_1.jsx)("path", { d: `M${x} 42 q8 8 16 0 Z`, fill: i % 2 ? illustrationColours_js_1.ILLUSTRATION_COLOURS.yellow : W, ...line(1.75) }, x))), (0, jsx_runtime_1.jsx)("rect", { x: "44", y: "15", width: "32", height: "12", rx: "6", fill: K }), (0, jsx_runtime_1.jsx)("path", { d: "M51 21 h18", stroke: illustrationColours_js_1.ILLUSTRATION_COLOURS.paper, strokeWidth: "1.75" }), (0, jsx_runtime_1.jsx)("path", { d: "M60 27 V30", ...line(1.75) }), (0, jsx_runtime_1.jsx)("path", { d: "M14 86 H26 L24 96 H16 Z", fill: illustrationColours_js_1.ILLUSTRATION_COLOURS.coral, ...line(1.75) }), (0, jsx_runtime_1.jsx)("path", { d: "M20 86 Q12 78 14 70 Q22 74 20 86 Q24 76 30 74 Q30 82 20 86", fill: illustrationColours_js_1.ILLUSTRATION_COLOURS.green, ...line(1.5) }), (0, jsx_runtime_1.jsx)("path", { d: "M88 14 l3 -5 M96 18 l5 -2 M84 10 l-1 -5", ...SPARK })] })),
19
+ // A chart on a stand and a magnifier.
20
+ reporteria: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("path", { d: "M36 80 L30 96 M64 80 L70 96 M50 80 V96", fill: "none", ...line() }), (0, jsx_runtime_1.jsx)("rect", { x: "14", y: "26", width: "74", height: "56", rx: "6", fill: W, ...line() }), (0, jsx_runtime_1.jsx)("path", { d: "M22 72 H80", ...line(1.25), strokeDasharray: "0.1 3" }), (0, jsx_runtime_1.jsx)("rect", { x: "24", y: "56", width: "11", height: "16", rx: "2", fill: illustrationColours_js_1.ILLUSTRATION_COLOURS.green, ...line(1.75) }), (0, jsx_runtime_1.jsx)("rect", { x: "41", y: "46", width: "11", height: "26", rx: "2", fill: illustrationColours_js_1.ILLUSTRATION_COLOURS.yellow, ...line(1.75) }), (0, jsx_runtime_1.jsx)("rect", { x: "58", y: "36", width: "11", height: "36", rx: "2", fill: illustrationColours_js_1.ILLUSTRATION_COLOURS.coral, ...line(1.75) }), (0, jsx_runtime_1.jsx)("path", { d: "M96 84 L105 93", ...line(6) }), (0, jsx_runtime_1.jsx)("circle", { cx: "86", cy: "74", r: "13", fill: W, ...line() }), (0, jsx_runtime_1.jsx)("circle", { cx: "86", cy: "74", r: "8.5", fill: illustrationColours_js_1.ILLUSTRATION_COLOURS.yellow, ...line(1.5) }), (0, jsx_runtime_1.jsx)("path", { d: "M81 71 Q83 68 86 68", fill: "none", stroke: W, strokeWidth: "1.75" }), (0, jsx_runtime_1.jsx)("path", { d: "M14 18 l-4 -3 M22 14 l-1 -5", ...SPARK })] })),
21
+ // A receipt, a bill and a stack of coins.
22
+ finanzas: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("path", { d: "M30 12 H62 V58 l-4 -3 l-4 3 l-4 -3 l-4 3 l-4 -3 l-4 3 l-4 -3 l-4 3 Z", fill: W, ...line() }), (0, jsx_runtime_1.jsx)("rect", { x: "36", y: "20", width: "16", height: "3", rx: "1.5", fill: K }), (0, jsx_runtime_1.jsx)("rect", { x: "36", y: "28", width: "20", height: "2.5", rx: "1.25", fill: illustrationColours_js_1.ILLUSTRATION_COLOURS.muted }), (0, jsx_runtime_1.jsx)("rect", { x: "36", y: "34", width: "14", height: "2.5", rx: "1.25", fill: illustrationColours_js_1.ILLUSTRATION_COLOURS.muted }), (0, jsx_runtime_1.jsxs)("g", { transform: "rotate(-8 44 70)", children: [(0, jsx_runtime_1.jsx)("rect", { x: "12", y: "52", width: "64", height: "36", rx: "5", fill: illustrationColours_js_1.ILLUSTRATION_COLOURS.green, ...line() }), (0, jsx_runtime_1.jsx)("rect", { x: "17", y: "57", width: "54", height: "26", rx: "3", fill: "none", ...line(1.25), strokeDasharray: "0.1 3" }), (0, jsx_runtime_1.jsx)("circle", { cx: "44", cy: "70", r: "8", fill: illustrationColours_js_1.ILLUSTRATION_COLOURS.paper, ...line(1.75) }), (0, jsx_runtime_1.jsx)("path", { d: "M46.8 66.6 c-1 -1.6 -5.6 -1.6 -5.6 0.9 s5.6 1.4 5.6 4 s-4.6 2.5 -5.6 0.9 M44 64.6 V75.4", fill: "none", ...line(1.5) })] }), coinStack, (0, jsx_runtime_1.jsx)("ellipse", { cx: "86", cy: "70", rx: "8.5", ry: "2.4", fill: "none", ...line(1.25) }), (0, jsx_runtime_1.jsx)("path", { d: "M92 52 l2 -6 M100 56 l5 -3 M84 50 l-1 -5", ...SPARK })] })),
23
+ // A menu card and a coffee to go.
24
+ catalogo: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("g", { transform: "rotate(-7 50 56)", children: [(0, jsx_runtime_1.jsx)("rect", { x: "20", y: "18", width: "58", height: "78", rx: "6", fill: W, ...line() }), (0, jsx_runtime_1.jsx)("rect", { x: "29", y: "27", width: "26", height: "5", rx: "2.5", fill: K }), [
25
+ [40, illustrationColours_js_1.ILLUSTRATION_COLOURS.yellow, 24, 14],
26
+ [56, illustrationColours_js_1.ILLUSTRATION_COLOURS.coral, 20, 16],
27
+ [72, illustrationColours_js_1.ILLUSTRATION_COLOURS.green, 22, 12],
28
+ ].map(([y, fill, a, b]) => ((0, jsx_runtime_1.jsxs)("g", { children: [(0, jsx_runtime_1.jsx)("rect", { x: "29", y: y, width: "11", height: "11", rx: "3", fill: fill, ...line(1.5) }), (0, jsx_runtime_1.jsx)("rect", { x: "45", y: y + 2, width: a, height: "3", rx: "1.5", fill: K }), (0, jsx_runtime_1.jsx)("rect", { x: "45", y: y + 7.5, width: b, height: "2.5", rx: "1.25", fill: illustrationColours_js_1.ILLUSTRATION_COLOURS.muted })] }, y)))] }), (0, jsx_runtime_1.jsx)("path", { d: "M80 52 q-3 -4 0 -8 q3 -4 0 -8 M89 52 q-3 -4 0 -8 q3 -4 0 -8", fill: "none", ...line(1.75) }), (0, jsx_runtime_1.jsx)("path", { d: "M72 64 H100 L96.5 96 H75.5 Z", fill: W, ...line() }), (0, jsx_runtime_1.jsx)("path", { d: "M73.6 75 H98.4 L97.5 85 H74.5 Z", fill: illustrationColours_js_1.ILLUSTRATION_COLOURS.yellow, ...line(1.75) }), (0, jsx_runtime_1.jsx)("rect", { x: "69", y: "57", width: "34", height: "7", rx: "3", fill: W, ...line() }), (0, jsx_runtime_1.jsx)("path", { d: "M14 26 l-5 -2 M16 18 l-3 -4 M24 14 l0 -5", ...SPARK })] })),
29
+ // A phone with the digital menu and a delivery bag.
30
+ canales: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("g", { transform: "rotate(-8 44 58)", children: [(0, jsx_runtime_1.jsx)("rect", { x: "22", y: "14", width: "44", height: "80", rx: "8", fill: W, ...line() }), (0, jsx_runtime_1.jsx)("rect", { x: "38", y: "19", width: "12", height: "3", rx: "1.5", fill: K }), (0, jsx_runtime_1.jsx)("rect", { x: "28", y: "28", width: "32", height: "10", rx: "3", fill: illustrationColours_js_1.ILLUSTRATION_COLOURS.yellow, ...line(1.5) }), [
31
+ [44, illustrationColours_js_1.ILLUSTRATION_COLOURS.coral],
32
+ [61, illustrationColours_js_1.ILLUSTRATION_COLOURS.green],
33
+ ].map(([y, fill]) => ((0, jsx_runtime_1.jsxs)("g", { children: [(0, jsx_runtime_1.jsx)("rect", { x: "28", y: y, width: "13", height: "12", rx: "3", fill: fill, ...line(1.5) }), (0, jsx_runtime_1.jsx)("rect", { x: "45", y: y + 2, width: "14", height: "3", rx: "1.5", fill: K }), (0, jsx_runtime_1.jsx)("rect", { x: "45", y: y + 7.5, width: "9", height: "2.5", rx: "1.25", fill: illustrationColours_js_1.ILLUSTRATION_COLOURS.muted })] }, y))), (0, jsx_runtime_1.jsx)("rect", { x: "28", y: "80", width: "32", height: "8", rx: "4", fill: K })] }), (0, jsx_runtime_1.jsx)("path", { d: "M76 46 Q84 32 92 46", fill: "none", ...line() }), (0, jsx_runtime_1.jsx)("path", { d: "M66 52 H102 L98 96 H70 Z", fill: illustrationColours_js_1.ILLUSTRATION_COLOURS.crust, ...line() }), (0, jsx_runtime_1.jsx)("path", { d: "M66 52 L70 46 H98 L102 52 Z", fill: illustrationColours_js_1.ILLUSTRATION_COLOURS.kraft, ...line() }), (0, jsx_runtime_1.jsx)("circle", { cx: "84", cy: "73", r: "8.5", fill: illustrationColours_js_1.ILLUSTRATION_COLOURS.yellow, ...line(1.75) }), (0, jsx_runtime_1.jsx)("path", { d: "M84 77 c-4 -3 -5 -5 -4 -6.5 c1 -1.3 3 -1 4 0.5 c1 -1.5 3 -1.8 4 -0.5 c1 1.5 0 3.5 -4 6.5z", fill: K }), (0, jsx_runtime_1.jsx)("path", { d: "M107 64 h5 M105 72 h8 M107 80 h4", ...SPARK })] })),
34
+ // An open box with a bottle and bread.
35
+ operaciones: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("path", { d: "M24 56 L38 46 H98 L84 56 Z", fill: illustrationColours_js_1.ILLUSTRATION_COLOURS.kraftDark, ...line() }), (0, jsx_runtime_1.jsx)("path", { d: "M44 52 V30 q0 -4 4 -6 V16 h7 v8 q4 2 4 6 V52", fill: W, ...line() }), (0, jsx_runtime_1.jsx)("rect", { x: "44", y: "34", width: "15", height: "9", fill: illustrationColours_js_1.ILLUSTRATION_COLOURS.yellow, ...line(1.5) }), (0, jsx_runtime_1.jsxs)("g", { transform: "rotate(32 74 36)", children: [(0, jsx_runtime_1.jsx)("rect", { x: "68", y: "12", width: "13", height: "46", rx: "6.5", fill: illustrationColours_js_1.ILLUSTRATION_COLOURS.crust, ...line() }), (0, jsx_runtime_1.jsx)("path", { d: "M71 22 l7 -3 M71 32 l7 -3 M71 42 l7 -3", fill: "none", ...line(1.5) })] }), (0, jsx_runtime_1.jsx)("path", { d: "M24 56 H84 V94 H24 Z", fill: illustrationColours_js_1.ILLUSTRATION_COLOURS.crust, ...line() }), (0, jsx_runtime_1.jsx)("path", { d: "M84 56 L98 46 V84 L84 94 Z", fill: illustrationColours_js_1.ILLUSTRATION_COLOURS.kraft, ...line() }), (0, jsx_runtime_1.jsx)("path", { d: "M24 56 L12 66 L22 72 L34 56", fill: illustrationColours_js_1.ILLUSTRATION_COLOURS.crust, ...line() }), (0, jsx_runtime_1.jsx)("rect", { x: "34", y: "68", width: "28", height: "16", rx: "2", fill: W, ...line(1.5) }), (0, jsx_runtime_1.jsx)("rect", { x: "38", y: "72", width: "14", height: "2.5", rx: "1.25", fill: K }), (0, jsx_runtime_1.jsx)("rect", { x: "38", y: "77.5", width: "18", height: "2.5", rx: "1.25", fill: illustrationColours_js_1.ILLUSTRATION_COLOURS.muted }), (0, jsx_runtime_1.jsx)("path", { d: "M18 36 l-4 -3 M26 30 l-1 -5", ...SPARK })] })),
36
+ // The stamp card, from the weekly email.
37
+ fidelizacion: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("rect", { x: "20", y: "30", width: "84", height: "54", rx: "8", transform: "rotate(7 60 60)", fill: illustrationColours_js_1.ILLUSTRATION_COLOURS.paperShade, ...line() }), (0, jsx_runtime_1.jsxs)("g", { transform: "rotate(-6 60 60)", children: [(0, jsx_runtime_1.jsx)("rect", { x: "14", y: "32", width: "92", height: "58", rx: "8", fill: W, ...line() }), (0, jsx_runtime_1.jsx)("rect", { x: "38", y: "40", width: "30", height: "3.5", rx: "1.75", fill: K }), (0, jsx_runtime_1.jsx)("rect", { x: "38", y: "47", width: "20", height: "2.5", rx: "1.25", fill: illustrationColours_js_1.ILLUSTRATION_COLOURS.muted }), (0, jsx_runtime_1.jsx)("rect", { x: "84", y: "40", width: "15", height: "8", rx: "4", fill: illustrationColours_js_1.ILLUSTRATION_COLOURS.yellow, ...line(1.25) }), [
38
+ [31, 64],
39
+ [48, 64],
40
+ [65, 64],
41
+ [82, 64],
42
+ [31, 79],
43
+ [48, 79],
44
+ ].map(([x, y]) => ((0, jsx_runtime_1.jsxs)("g", { children: [(0, jsx_runtime_1.jsx)("circle", { cx: x, cy: y, r: "6", fill: illustrationColours_js_1.ILLUSTRATION_COLOURS.yellow, ...line(1.5) }), (0, jsx_runtime_1.jsx)("path", { d: CUP(x, y), fill: "none", ...line(1.1) })] }, `${x}-${y}`))), (0, jsx_runtime_1.jsx)("circle", { cx: "65", cy: "79", r: "6", fill: "none", stroke: illustrationColours_js_1.ILLUSTRATION_COLOURS.muted, strokeWidth: "1.25", strokeDasharray: "2 2.2" }), (0, jsx_runtime_1.jsx)("circle", { cx: "82", cy: "79", r: "6.5", fill: K }), (0, jsx_runtime_1.jsx)("path", { d: "M82 82.4c-3.2-2.1-3.6-3.9-2.8-5 0.8-1 2.2-0.7 2.8 0.3 0.6-1 2-1.3 2.8-0.3 0.8 1.1 0.4 2.9-2.8 5z", fill: illustrationColours_js_1.ILLUSTRATION_COLOURS.yellow }), (0, jsx_runtime_1.jsx)("path", { d: "M94 56 V86", fill: "none", stroke: illustrationColours_js_1.ILLUSTRATION_COLOURS.paperBorder, strokeWidth: "2", strokeDasharray: "1.5 2.5" }), (0, jsx_runtime_1.jsx)("rect", { x: "20", y: "38", width: "13", height: "13", rx: "3.5", fill: K }), (0, jsx_runtime_1.jsx)("path", { d: "M24 42 l1.2 5 l1.3 -3.4 l1.3 3.4 l1.2 -5", fill: "none", stroke: illustrationColours_js_1.ILLUSTRATION_COLOURS.yellow, strokeWidth: "1.3" })] }), (0, jsx_runtime_1.jsx)("path", { d: "M100 20 L101.5 15 M105 25 L110 23 M104.5 19 L108 15.5", ...SPARK })] })),
45
+ // A megaphone with a heart.
46
+ marketing: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("g", { transform: "rotate(-14 52 62)", children: [(0, jsx_runtime_1.jsx)("path", { d: "M38 68 L44 90 H55 L50 70", fill: W, ...line() }), (0, jsx_runtime_1.jsx)("path", { d: "M30 52 L74 32 V88 L30 70 Z", fill: W, ...line() }), (0, jsx_runtime_1.jsx)("path", { d: "M44 46 V76", ...line(1.5) }), (0, jsx_runtime_1.jsx)("rect", { x: "18", y: "50", width: "14", height: "22", rx: "4", fill: illustrationColours_js_1.ILLUSTRATION_COLOURS.coral, ...line() }), (0, jsx_runtime_1.jsx)("ellipse", { cx: "74", cy: "60", rx: "7", ry: "28", fill: illustrationColours_js_1.ILLUSTRATION_COLOURS.yellow, ...line() }), (0, jsx_runtime_1.jsx)("ellipse", { cx: "74", cy: "60", rx: "3", ry: "14", fill: K }), (0, jsx_runtime_1.jsx)("path", { d: "M88 46 Q95 60 88 74 M96 38 Q107 60 96 82", fill: "none", ...line() })] }), (0, jsx_runtime_1.jsx)("path", { d: "M94 26 C94 22 99 21 100 25 C101 21 106 22 106 26 C106 30 100 34 100 34 C100 34 94 30 94 26 Z", fill: illustrationColours_js_1.ILLUSTRATION_COLOURS.coral, ...line(1.75) }), (0, jsx_runtime_1.jsx)("path", { d: "M100 14 V9 M90 17 l-3 -4 M110 17 l3 -4", ...SPARK })] })),
47
+ // A review bubble and a smiling star.
48
+ reputacion: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("path", { d: "M20 22 H84 Q92 22 92 30 V60 Q92 68 84 68 H42 L28 82 V68 H20 Q12 68 12 60 V30 Q12 22 20 22 Z", fill: W, ...line() }), [25, 39, 53, 67].map((x) => ((0, jsx_runtime_1.jsx)("path", { transform: `translate(${x} 38)`, d: STAR, fill: illustrationColours_js_1.ILLUSTRATION_COLOURS.yellow, ...line(1.5) }, x))), (0, jsx_runtime_1.jsx)("rect", { x: "21", y: "50", width: "42", height: "3", rx: "1.5", fill: K }), (0, jsx_runtime_1.jsx)("rect", { x: "21", y: "56.5", width: "28", height: "2.5", rx: "1.25", fill: illustrationColours_js_1.ILLUSTRATION_COLOURS.muted }), (0, jsx_runtime_1.jsx)("path", { transform: "translate(88 78) scale(2.6)", d: STAR, fill: illustrationColours_js_1.ILLUSTRATION_COLOURS.yellow, stroke: K, strokeWidth: "0.77" }), (0, jsx_runtime_1.jsx)("path", { d: "M84 78 q4 4 8 0", fill: "none", ...line(1.75) }), (0, jsx_runtime_1.jsx)("circle", { cx: "83.5", cy: "73", r: "1.4", fill: K }), (0, jsx_runtime_1.jsx)("circle", { cx: "92.5", cy: "73", r: "1.4", fill: K }), (0, jsx_runtime_1.jsx)("path", { d: "M104 54 l4 -4 M108 64 l5 0 M98 50 l1 -5", ...SPARK })] })),
49
+ // A sliders panel and a gear.
50
+ configuracion: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("rect", { x: "14", y: "20", width: "64", height: "72", rx: "6", fill: W, ...line() }), (0, jsx_runtime_1.jsx)("path", { d: "M24 36 H68 M24 56 H68 M24 76 H68", ...line() }), (0, jsx_runtime_1.jsx)("circle", { cx: "52", cy: "36", r: "6", fill: illustrationColours_js_1.ILLUSTRATION_COLOURS.yellow, ...line() }), (0, jsx_runtime_1.jsx)("circle", { cx: "34", cy: "56", r: "6", fill: illustrationColours_js_1.ILLUSTRATION_COLOURS.coral, ...line() }), (0, jsx_runtime_1.jsx)("circle", { cx: "60", cy: "76", r: "6", fill: illustrationColours_js_1.ILLUSTRATION_COLOURS.green, ...line() }), (0, jsx_runtime_1.jsxs)("g", { transform: "translate(88 76)", children: [[0, 45, 90, 135, 180, 225, 270, 315].map((deg) => ((0, jsx_runtime_1.jsx)("rect", { x: "-4.5", y: "-22", width: "9", height: "11", rx: "2", transform: `rotate(${deg})`, fill: illustrationColours_js_1.ILLUSTRATION_COLOURS.yellow, ...line(1.75) }, deg))), (0, jsx_runtime_1.jsx)("circle", { r: "15", fill: illustrationColours_js_1.ILLUSTRATION_COLOURS.yellow, ...line() }), (0, jsx_runtime_1.jsx)("circle", { r: "6", fill: illustrationColours_js_1.ILLUSTRATION_COLOURS.paper, ...line() })] }), (0, jsx_runtime_1.jsx)("path", { d: "M92 26 l3 -5 M100 32 l5 -2 M88 20 l-1 -5", ...SPARK })] })),
51
+ };
52
+ /** The dashboard modules that have an icon, in home-grid order. */
53
+ exports.MODULE_ICON_NAMES = Object.keys(ART);
54
+ /**
55
+ * An illustrated dashboard-module icon on its cream tile. Size it with width
56
+ * (it is square). Reads well from 48 px; under that, use a line icon.
57
+ */
58
+ function ModuleIcon({ name, className, label }) {
59
+ const a11y = label
60
+ ? { role: "img", "aria-label": label }
61
+ : { "aria-hidden": true };
62
+ return ((0, jsx_runtime_1.jsxs)("svg", { viewBox: "0 0 120 120", className: className ? `wb-module-icon ${className}` : "wb-module-icon", strokeLinecap: "round", strokeLinejoin: "round", ...a11y, children: [(0, jsx_runtime_1.jsx)("rect", { x: "0.5", y: "0.5", width: "119", height: "119", rx: "30", fill: illustrationColours_js_1.ILLUSTRATION_COLOURS.paper, stroke: illustrationColours_js_1.ILLUSTRATION_COLOURS.paperBorder }), (0, jsx_runtime_1.jsx)("ellipse", { cx: "60", cy: "99", rx: "44", ry: "4.5", fill: illustrationColours_js_1.ILLUSTRATION_COLOURS.shadow }), ART[name]] }));
63
+ }
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ILLUSTRATION_COLOURS = void 0;
4
+ /**
5
+ * Colours of the illustrated icons (Paper 01M72Y4K1ZCAWQ5WGA3CD16CFN, style of
6
+ * the weekly product email). The same values are the `--color-illus-*` tokens
7
+ * in the wb-ui design system file.
8
+ *
9
+ * Drawings only. Soft colours are for art, strong colours are for app
10
+ * messages: never use these as status colours, and never put coral on a badge
11
+ * or a pill with a number (it reads as an error or a notification).
12
+ */
13
+ exports.ILLUSTRATION_COLOURS = {
14
+ ink: "#1D1D1F",
15
+ paper: "#FFFAF0",
16
+ paperBorder: "#EDEADE",
17
+ paperShade: "#F1EADB",
18
+ shadow: "#1D1D1F12",
19
+ muted: "#1D1D1F55",
20
+ white: "#FFFFFF",
21
+ yellow: "#FFE45C",
22
+ green: "#BFD98A",
23
+ coral: "#F07B5A",
24
+ crust: "#F2D49B",
25
+ kraft: "#E3BE7A",
26
+ kraftDark: "#C9A060",
27
+ };
package/dist/cjs/index.js CHANGED
@@ -1,8 +1,13 @@
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.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.ILLUSTRATION_COLOURS = 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
+ var ModuleIcon_js_1 = require("./ModuleIcon.js");
7
+ Object.defineProperty(exports, "ModuleIcon", { enumerable: true, get: function () { return ModuleIcon_js_1.ModuleIcon; } });
8
+ Object.defineProperty(exports, "MODULE_ICON_NAMES", { enumerable: true, get: function () { return ModuleIcon_js_1.MODULE_ICON_NAMES; } });
9
+ var illustrationColours_js_1 = require("./illustrationColours.js");
10
+ Object.defineProperty(exports, "ILLUSTRATION_COLOURS", { enumerable: true, get: function () { return illustrationColours_js_1.ILLUSTRATION_COLOURS; } });
6
11
  var posTokens_js_1 = require("./posTokens.js");
7
12
  Object.defineProperty(exports, "POS_DARK_CLASS", { enumerable: true, get: function () { return posTokens_js_1.POS_DARK_CLASS; } });
8
13
  Object.defineProperty(exports, "POS_DARK_TOKENS", { enumerable: true, get: function () { return posTokens_js_1.POS_DARK_TOKENS; } });
@@ -0,0 +1,27 @@
1
+ declare const ART: {
2
+ actividad: import("react").JSX.Element;
3
+ reporteria: import("react").JSX.Element;
4
+ finanzas: import("react").JSX.Element;
5
+ catalogo: import("react").JSX.Element;
6
+ canales: import("react").JSX.Element;
7
+ operaciones: import("react").JSX.Element;
8
+ fidelizacion: import("react").JSX.Element;
9
+ marketing: import("react").JSX.Element;
10
+ reputacion: import("react").JSX.Element;
11
+ configuracion: import("react").JSX.Element;
12
+ };
13
+ export type ModuleIconName = keyof typeof ART;
14
+ /** The dashboard modules that have an icon, in home-grid order. */
15
+ export declare const MODULE_ICON_NAMES: ModuleIconName[];
16
+ export interface ModuleIconProps {
17
+ name: ModuleIconName;
18
+ className?: string;
19
+ /** Accessible name. Without it the icon is decorative (aria-hidden). */
20
+ label?: string;
21
+ }
22
+ /**
23
+ * An illustrated dashboard-module icon on its cream tile. Size it with width
24
+ * (it is square). Reads well from 48 px; under that, use a line icon.
25
+ */
26
+ export declare function ModuleIcon({ name, className, label }: ModuleIconProps): import("react").JSX.Element;
27
+ export {};
@@ -0,0 +1,59 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { ILLUSTRATION_COLOURS as C } from "./illustrationColours.js";
3
+ const K = C.ink;
4
+ const W = C.white;
5
+ /** 2 px outline, 1.75 px detail, 1.5 px fine detail, in 120-unit art space. */
6
+ const line = (width = 2) => ({ stroke: K, strokeWidth: width });
7
+ const SPARK = { fill: "none", ...line(1.75) };
8
+ const STAR = "M0 -6 L1.76 -2.43 L5.71 -1.85 L2.85 0.93 L3.53 4.85 L0 3 L-3.53 4.85 L-2.85 0.93 L-5.71 -1.85 L-1.76 -2.43 Z";
9
+ // A coffee cup stamp on the loyalty card.
10
+ const CUP = (x, y) => `M${x - 2.5} ${y - 1.4}h4.2v1.8a2.1 2.1 0 0 1-4.2 0z M${x + 1.7} ${y - 0.9}a1.2 1.2 0 0 1 0 2.4`;
11
+ const coinStack = [86, 78, 70].map((y, i) => (_jsxs("g", { children: [_jsx("rect", { x: "72", y: y, width: "28", height: "6", fill: C.yellow }), _jsx("path", { d: `M72 ${y} V${y + 6} M100 ${y} V${y + 6}`, ...line() }), i === 0 ? (_jsx("ellipse", { cx: "86", cy: y + 6, rx: "14", ry: "4.5", fill: C.yellow, ...line() })) : (_jsx("path", { d: `M72 ${y + 6} A14 4.5 0 0 0 100 ${y + 6}`, fill: C.yellow, ...line() })), _jsx("ellipse", { cx: "86", cy: y, rx: "14", ry: "4.5", fill: C.yellow, ...line() })] }, y)));
12
+ const ART = {
13
+ // The shop: the business live today.
14
+ actividad: (_jsxs(_Fragment, { children: [_jsx("rect", { x: "26", y: "44", width: "68", height: "52", fill: W, ...line() }), _jsx("rect", { x: "34", y: "56", width: "24", height: "22", rx: "3", fill: W, ...line(1.75) }), _jsx("path", { d: "M40 56 L42 65 M52 56 L50 65", fill: "none", ...line(1.25) }), _jsx("rect", { x: "37", y: "65", width: "18", height: "8", rx: "2", fill: C.green, ...line(1.5) }), _jsx("rect", { x: "66", y: "60", width: "20", height: "36", rx: "2", fill: C.yellow, ...line() }), _jsx("circle", { cx: "71", cy: "79", r: "1.4", fill: K }), _jsx("rect", { x: "20", y: "30", width: "80", height: "12", rx: "3", fill: W, ...line() }), _jsx("path", { d: "M36 31 V41 M52 31 V41 M68 31 V41 M84 31 V41", ...line(1.5) }), _jsx("rect", { x: "37", y: "31", width: "14", height: "10", fill: C.yellow }), _jsx("rect", { x: "69", y: "31", width: "14", height: "10", fill: C.yellow }), [20, 36, 52, 68, 84].map((x, i) => (_jsx("path", { d: `M${x} 42 q8 8 16 0 Z`, fill: i % 2 ? C.yellow : W, ...line(1.75) }, x))), _jsx("rect", { x: "44", y: "15", width: "32", height: "12", rx: "6", fill: K }), _jsx("path", { d: "M51 21 h18", stroke: C.paper, strokeWidth: "1.75" }), _jsx("path", { d: "M60 27 V30", ...line(1.75) }), _jsx("path", { d: "M14 86 H26 L24 96 H16 Z", fill: C.coral, ...line(1.75) }), _jsx("path", { d: "M20 86 Q12 78 14 70 Q22 74 20 86 Q24 76 30 74 Q30 82 20 86", fill: C.green, ...line(1.5) }), _jsx("path", { d: "M88 14 l3 -5 M96 18 l5 -2 M84 10 l-1 -5", ...SPARK })] })),
15
+ // A chart on a stand and a magnifier.
16
+ reporteria: (_jsxs(_Fragment, { children: [_jsx("path", { d: "M36 80 L30 96 M64 80 L70 96 M50 80 V96", fill: "none", ...line() }), _jsx("rect", { x: "14", y: "26", width: "74", height: "56", rx: "6", fill: W, ...line() }), _jsx("path", { d: "M22 72 H80", ...line(1.25), strokeDasharray: "0.1 3" }), _jsx("rect", { x: "24", y: "56", width: "11", height: "16", rx: "2", fill: C.green, ...line(1.75) }), _jsx("rect", { x: "41", y: "46", width: "11", height: "26", rx: "2", fill: C.yellow, ...line(1.75) }), _jsx("rect", { x: "58", y: "36", width: "11", height: "36", rx: "2", fill: C.coral, ...line(1.75) }), _jsx("path", { d: "M96 84 L105 93", ...line(6) }), _jsx("circle", { cx: "86", cy: "74", r: "13", fill: W, ...line() }), _jsx("circle", { cx: "86", cy: "74", r: "8.5", fill: C.yellow, ...line(1.5) }), _jsx("path", { d: "M81 71 Q83 68 86 68", fill: "none", stroke: W, strokeWidth: "1.75" }), _jsx("path", { d: "M14 18 l-4 -3 M22 14 l-1 -5", ...SPARK })] })),
17
+ // A receipt, a bill and a stack of coins.
18
+ finanzas: (_jsxs(_Fragment, { children: [_jsx("path", { d: "M30 12 H62 V58 l-4 -3 l-4 3 l-4 -3 l-4 3 l-4 -3 l-4 3 l-4 -3 l-4 3 Z", fill: W, ...line() }), _jsx("rect", { x: "36", y: "20", width: "16", height: "3", rx: "1.5", fill: K }), _jsx("rect", { x: "36", y: "28", width: "20", height: "2.5", rx: "1.25", fill: C.muted }), _jsx("rect", { x: "36", y: "34", width: "14", height: "2.5", rx: "1.25", fill: C.muted }), _jsxs("g", { transform: "rotate(-8 44 70)", children: [_jsx("rect", { x: "12", y: "52", width: "64", height: "36", rx: "5", fill: C.green, ...line() }), _jsx("rect", { x: "17", y: "57", width: "54", height: "26", rx: "3", fill: "none", ...line(1.25), strokeDasharray: "0.1 3" }), _jsx("circle", { cx: "44", cy: "70", r: "8", fill: C.paper, ...line(1.75) }), _jsx("path", { d: "M46.8 66.6 c-1 -1.6 -5.6 -1.6 -5.6 0.9 s5.6 1.4 5.6 4 s-4.6 2.5 -5.6 0.9 M44 64.6 V75.4", fill: "none", ...line(1.5) })] }), coinStack, _jsx("ellipse", { cx: "86", cy: "70", rx: "8.5", ry: "2.4", fill: "none", ...line(1.25) }), _jsx("path", { d: "M92 52 l2 -6 M100 56 l5 -3 M84 50 l-1 -5", ...SPARK })] })),
19
+ // A menu card and a coffee to go.
20
+ catalogo: (_jsxs(_Fragment, { children: [_jsxs("g", { transform: "rotate(-7 50 56)", children: [_jsx("rect", { x: "20", y: "18", width: "58", height: "78", rx: "6", fill: W, ...line() }), _jsx("rect", { x: "29", y: "27", width: "26", height: "5", rx: "2.5", fill: K }), [
21
+ [40, C.yellow, 24, 14],
22
+ [56, C.coral, 20, 16],
23
+ [72, C.green, 22, 12],
24
+ ].map(([y, fill, a, b]) => (_jsxs("g", { children: [_jsx("rect", { x: "29", y: y, width: "11", height: "11", rx: "3", fill: fill, ...line(1.5) }), _jsx("rect", { x: "45", y: y + 2, width: a, height: "3", rx: "1.5", fill: K }), _jsx("rect", { x: "45", y: y + 7.5, width: b, height: "2.5", rx: "1.25", fill: C.muted })] }, y)))] }), _jsx("path", { d: "M80 52 q-3 -4 0 -8 q3 -4 0 -8 M89 52 q-3 -4 0 -8 q3 -4 0 -8", fill: "none", ...line(1.75) }), _jsx("path", { d: "M72 64 H100 L96.5 96 H75.5 Z", fill: W, ...line() }), _jsx("path", { d: "M73.6 75 H98.4 L97.5 85 H74.5 Z", fill: C.yellow, ...line(1.75) }), _jsx("rect", { x: "69", y: "57", width: "34", height: "7", rx: "3", fill: W, ...line() }), _jsx("path", { d: "M14 26 l-5 -2 M16 18 l-3 -4 M24 14 l0 -5", ...SPARK })] })),
25
+ // A phone with the digital menu and a delivery bag.
26
+ canales: (_jsxs(_Fragment, { children: [_jsxs("g", { transform: "rotate(-8 44 58)", children: [_jsx("rect", { x: "22", y: "14", width: "44", height: "80", rx: "8", fill: W, ...line() }), _jsx("rect", { x: "38", y: "19", width: "12", height: "3", rx: "1.5", fill: K }), _jsx("rect", { x: "28", y: "28", width: "32", height: "10", rx: "3", fill: C.yellow, ...line(1.5) }), [
27
+ [44, C.coral],
28
+ [61, C.green],
29
+ ].map(([y, fill]) => (_jsxs("g", { children: [_jsx("rect", { x: "28", y: y, width: "13", height: "12", rx: "3", fill: fill, ...line(1.5) }), _jsx("rect", { x: "45", y: y + 2, width: "14", height: "3", rx: "1.5", fill: K }), _jsx("rect", { x: "45", y: y + 7.5, width: "9", height: "2.5", rx: "1.25", fill: C.muted })] }, y))), _jsx("rect", { x: "28", y: "80", width: "32", height: "8", rx: "4", fill: K })] }), _jsx("path", { d: "M76 46 Q84 32 92 46", fill: "none", ...line() }), _jsx("path", { d: "M66 52 H102 L98 96 H70 Z", fill: C.crust, ...line() }), _jsx("path", { d: "M66 52 L70 46 H98 L102 52 Z", fill: C.kraft, ...line() }), _jsx("circle", { cx: "84", cy: "73", r: "8.5", fill: C.yellow, ...line(1.75) }), _jsx("path", { d: "M84 77 c-4 -3 -5 -5 -4 -6.5 c1 -1.3 3 -1 4 0.5 c1 -1.5 3 -1.8 4 -0.5 c1 1.5 0 3.5 -4 6.5z", fill: K }), _jsx("path", { d: "M107 64 h5 M105 72 h8 M107 80 h4", ...SPARK })] })),
30
+ // An open box with a bottle and bread.
31
+ operaciones: (_jsxs(_Fragment, { children: [_jsx("path", { d: "M24 56 L38 46 H98 L84 56 Z", fill: C.kraftDark, ...line() }), _jsx("path", { d: "M44 52 V30 q0 -4 4 -6 V16 h7 v8 q4 2 4 6 V52", fill: W, ...line() }), _jsx("rect", { x: "44", y: "34", width: "15", height: "9", fill: C.yellow, ...line(1.5) }), _jsxs("g", { transform: "rotate(32 74 36)", children: [_jsx("rect", { x: "68", y: "12", width: "13", height: "46", rx: "6.5", fill: C.crust, ...line() }), _jsx("path", { d: "M71 22 l7 -3 M71 32 l7 -3 M71 42 l7 -3", fill: "none", ...line(1.5) })] }), _jsx("path", { d: "M24 56 H84 V94 H24 Z", fill: C.crust, ...line() }), _jsx("path", { d: "M84 56 L98 46 V84 L84 94 Z", fill: C.kraft, ...line() }), _jsx("path", { d: "M24 56 L12 66 L22 72 L34 56", fill: C.crust, ...line() }), _jsx("rect", { x: "34", y: "68", width: "28", height: "16", rx: "2", fill: W, ...line(1.5) }), _jsx("rect", { x: "38", y: "72", width: "14", height: "2.5", rx: "1.25", fill: K }), _jsx("rect", { x: "38", y: "77.5", width: "18", height: "2.5", rx: "1.25", fill: C.muted }), _jsx("path", { d: "M18 36 l-4 -3 M26 30 l-1 -5", ...SPARK })] })),
32
+ // The stamp card, from the weekly email.
33
+ fidelizacion: (_jsxs(_Fragment, { children: [_jsx("rect", { x: "20", y: "30", width: "84", height: "54", rx: "8", transform: "rotate(7 60 60)", fill: C.paperShade, ...line() }), _jsxs("g", { transform: "rotate(-6 60 60)", children: [_jsx("rect", { x: "14", y: "32", width: "92", height: "58", rx: "8", fill: W, ...line() }), _jsx("rect", { x: "38", y: "40", width: "30", height: "3.5", rx: "1.75", fill: K }), _jsx("rect", { x: "38", y: "47", width: "20", height: "2.5", rx: "1.25", fill: C.muted }), _jsx("rect", { x: "84", y: "40", width: "15", height: "8", rx: "4", fill: C.yellow, ...line(1.25) }), [
34
+ [31, 64],
35
+ [48, 64],
36
+ [65, 64],
37
+ [82, 64],
38
+ [31, 79],
39
+ [48, 79],
40
+ ].map(([x, y]) => (_jsxs("g", { children: [_jsx("circle", { cx: x, cy: y, r: "6", fill: C.yellow, ...line(1.5) }), _jsx("path", { d: CUP(x, y), fill: "none", ...line(1.1) })] }, `${x}-${y}`))), _jsx("circle", { cx: "65", cy: "79", r: "6", fill: "none", stroke: C.muted, strokeWidth: "1.25", strokeDasharray: "2 2.2" }), _jsx("circle", { cx: "82", cy: "79", r: "6.5", fill: K }), _jsx("path", { d: "M82 82.4c-3.2-2.1-3.6-3.9-2.8-5 0.8-1 2.2-0.7 2.8 0.3 0.6-1 2-1.3 2.8-0.3 0.8 1.1 0.4 2.9-2.8 5z", fill: C.yellow }), _jsx("path", { d: "M94 56 V86", fill: "none", stroke: C.paperBorder, strokeWidth: "2", strokeDasharray: "1.5 2.5" }), _jsx("rect", { x: "20", y: "38", width: "13", height: "13", rx: "3.5", fill: K }), _jsx("path", { d: "M24 42 l1.2 5 l1.3 -3.4 l1.3 3.4 l1.2 -5", fill: "none", stroke: C.yellow, strokeWidth: "1.3" })] }), _jsx("path", { d: "M100 20 L101.5 15 M105 25 L110 23 M104.5 19 L108 15.5", ...SPARK })] })),
41
+ // A megaphone with a heart.
42
+ marketing: (_jsxs(_Fragment, { children: [_jsxs("g", { transform: "rotate(-14 52 62)", children: [_jsx("path", { d: "M38 68 L44 90 H55 L50 70", fill: W, ...line() }), _jsx("path", { d: "M30 52 L74 32 V88 L30 70 Z", fill: W, ...line() }), _jsx("path", { d: "M44 46 V76", ...line(1.5) }), _jsx("rect", { x: "18", y: "50", width: "14", height: "22", rx: "4", fill: C.coral, ...line() }), _jsx("ellipse", { cx: "74", cy: "60", rx: "7", ry: "28", fill: C.yellow, ...line() }), _jsx("ellipse", { cx: "74", cy: "60", rx: "3", ry: "14", fill: K }), _jsx("path", { d: "M88 46 Q95 60 88 74 M96 38 Q107 60 96 82", fill: "none", ...line() })] }), _jsx("path", { d: "M94 26 C94 22 99 21 100 25 C101 21 106 22 106 26 C106 30 100 34 100 34 C100 34 94 30 94 26 Z", fill: C.coral, ...line(1.75) }), _jsx("path", { d: "M100 14 V9 M90 17 l-3 -4 M110 17 l3 -4", ...SPARK })] })),
43
+ // A review bubble and a smiling star.
44
+ reputacion: (_jsxs(_Fragment, { children: [_jsx("path", { d: "M20 22 H84 Q92 22 92 30 V60 Q92 68 84 68 H42 L28 82 V68 H20 Q12 68 12 60 V30 Q12 22 20 22 Z", fill: W, ...line() }), [25, 39, 53, 67].map((x) => (_jsx("path", { transform: `translate(${x} 38)`, d: STAR, fill: C.yellow, ...line(1.5) }, x))), _jsx("rect", { x: "21", y: "50", width: "42", height: "3", rx: "1.5", fill: K }), _jsx("rect", { x: "21", y: "56.5", width: "28", height: "2.5", rx: "1.25", fill: C.muted }), _jsx("path", { transform: "translate(88 78) scale(2.6)", d: STAR, fill: C.yellow, stroke: K, strokeWidth: "0.77" }), _jsx("path", { d: "M84 78 q4 4 8 0", fill: "none", ...line(1.75) }), _jsx("circle", { cx: "83.5", cy: "73", r: "1.4", fill: K }), _jsx("circle", { cx: "92.5", cy: "73", r: "1.4", fill: K }), _jsx("path", { d: "M104 54 l4 -4 M108 64 l5 0 M98 50 l1 -5", ...SPARK })] })),
45
+ // A sliders panel and a gear.
46
+ configuracion: (_jsxs(_Fragment, { children: [_jsx("rect", { x: "14", y: "20", width: "64", height: "72", rx: "6", fill: W, ...line() }), _jsx("path", { d: "M24 36 H68 M24 56 H68 M24 76 H68", ...line() }), _jsx("circle", { cx: "52", cy: "36", r: "6", fill: C.yellow, ...line() }), _jsx("circle", { cx: "34", cy: "56", r: "6", fill: C.coral, ...line() }), _jsx("circle", { cx: "60", cy: "76", r: "6", fill: C.green, ...line() }), _jsxs("g", { transform: "translate(88 76)", children: [[0, 45, 90, 135, 180, 225, 270, 315].map((deg) => (_jsx("rect", { x: "-4.5", y: "-22", width: "9", height: "11", rx: "2", transform: `rotate(${deg})`, fill: C.yellow, ...line(1.75) }, deg))), _jsx("circle", { r: "15", fill: C.yellow, ...line() }), _jsx("circle", { r: "6", fill: C.paper, ...line() })] }), _jsx("path", { d: "M92 26 l3 -5 M100 32 l5 -2 M88 20 l-1 -5", ...SPARK })] })),
47
+ };
48
+ /** The dashboard modules that have an icon, in home-grid order. */
49
+ export const MODULE_ICON_NAMES = Object.keys(ART);
50
+ /**
51
+ * An illustrated dashboard-module icon on its cream tile. Size it with width
52
+ * (it is square). Reads well from 48 px; under that, use a line icon.
53
+ */
54
+ export function ModuleIcon({ name, className, label }) {
55
+ const a11y = label
56
+ ? { role: "img", "aria-label": label }
57
+ : { "aria-hidden": true };
58
+ return (_jsxs("svg", { viewBox: "0 0 120 120", className: className ? `wb-module-icon ${className}` : "wb-module-icon", strokeLinecap: "round", strokeLinejoin: "round", ...a11y, children: [_jsx("rect", { x: "0.5", y: "0.5", width: "119", height: "119", rx: "30", fill: C.paper, stroke: C.paperBorder }), _jsx("ellipse", { cx: "60", cy: "99", rx: "44", ry: "4.5", fill: C.shadow }), ART[name]] }));
59
+ }
@@ -131,6 +131,6 @@ export declare const DEFAULT_CATEGORY_SLOT: CategorySlot;
131
131
  /** Slot for the n-th category in tree order (0-based): 1…8, then 1… again. */
132
132
  export declare function categorySlotForIndex(index: number): CategorySlot;
133
133
  /** CSS variables of the palette: --wb-cat-N (swatch), -tint, -slot, -ink. */
134
- export declare const CATEGORY_PALETTE_TOKENS: Record<"--wb-cat-1" | "--wb-cat-1-tint" | "--wb-cat-1-slot" | "--wb-cat-1-ink" | "--wb-cat-8" | "--wb-cat-8-tint" | "--wb-cat-8-slot" | "--wb-cat-8-ink" | "--wb-cat-2" | "--wb-cat-2-tint" | "--wb-cat-2-slot" | "--wb-cat-2-ink" | "--wb-cat-3" | "--wb-cat-3-tint" | "--wb-cat-3-slot" | "--wb-cat-3-ink" | "--wb-cat-4" | "--wb-cat-4-tint" | "--wb-cat-4-slot" | "--wb-cat-4-ink" | "--wb-cat-5" | "--wb-cat-5-tint" | "--wb-cat-5-slot" | "--wb-cat-5-ink" | "--wb-cat-6" | "--wb-cat-6-tint" | "--wb-cat-6-slot" | "--wb-cat-6-ink" | "--wb-cat-7" | "--wb-cat-7-tint" | "--wb-cat-7-slot" | "--wb-cat-7-ink", string>;
134
+ export declare const CATEGORY_PALETTE_TOKENS: Record<"--wb-cat-2" | "--wb-cat-2-tint" | "--wb-cat-2-slot" | "--wb-cat-2-ink" | "--wb-cat-1" | "--wb-cat-1-tint" | "--wb-cat-1-slot" | "--wb-cat-1-ink" | "--wb-cat-6" | "--wb-cat-6-tint" | "--wb-cat-6-slot" | "--wb-cat-6-ink" | "--wb-cat-3" | "--wb-cat-3-tint" | "--wb-cat-3-slot" | "--wb-cat-3-ink" | "--wb-cat-8" | "--wb-cat-8-tint" | "--wb-cat-8-slot" | "--wb-cat-8-ink" | "--wb-cat-4" | "--wb-cat-4-tint" | "--wb-cat-4-slot" | "--wb-cat-4-ink" | "--wb-cat-5" | "--wb-cat-5-tint" | "--wb-cat-5-slot" | "--wb-cat-5-ink" | "--wb-cat-7" | "--wb-cat-7-tint" | "--wb-cat-7-slot" | "--wb-cat-7-ink", string>;
135
135
  /** The same variables with the dark values. */
136
- export declare const CATEGORY_PALETTE_DARK_TOKENS: Record<"--wb-cat-1" | "--wb-cat-1-tint" | "--wb-cat-1-slot" | "--wb-cat-1-ink" | "--wb-cat-8" | "--wb-cat-8-tint" | "--wb-cat-8-slot" | "--wb-cat-8-ink" | "--wb-cat-2" | "--wb-cat-2-tint" | "--wb-cat-2-slot" | "--wb-cat-2-ink" | "--wb-cat-3" | "--wb-cat-3-tint" | "--wb-cat-3-slot" | "--wb-cat-3-ink" | "--wb-cat-4" | "--wb-cat-4-tint" | "--wb-cat-4-slot" | "--wb-cat-4-ink" | "--wb-cat-5" | "--wb-cat-5-tint" | "--wb-cat-5-slot" | "--wb-cat-5-ink" | "--wb-cat-6" | "--wb-cat-6-tint" | "--wb-cat-6-slot" | "--wb-cat-6-ink" | "--wb-cat-7" | "--wb-cat-7-tint" | "--wb-cat-7-slot" | "--wb-cat-7-ink", string>;
136
+ export declare const CATEGORY_PALETTE_DARK_TOKENS: Record<"--wb-cat-2" | "--wb-cat-2-tint" | "--wb-cat-2-slot" | "--wb-cat-2-ink" | "--wb-cat-1" | "--wb-cat-1-tint" | "--wb-cat-1-slot" | "--wb-cat-1-ink" | "--wb-cat-6" | "--wb-cat-6-tint" | "--wb-cat-6-slot" | "--wb-cat-6-ink" | "--wb-cat-3" | "--wb-cat-3-tint" | "--wb-cat-3-slot" | "--wb-cat-3-ink" | "--wb-cat-8" | "--wb-cat-8-tint" | "--wb-cat-8-slot" | "--wb-cat-8-ink" | "--wb-cat-4" | "--wb-cat-4-tint" | "--wb-cat-4-slot" | "--wb-cat-4-ink" | "--wb-cat-5" | "--wb-cat-5-tint" | "--wb-cat-5-slot" | "--wb-cat-5-ink" | "--wb-cat-7" | "--wb-cat-7-tint" | "--wb-cat-7-slot" | "--wb-cat-7-ink", string>;
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Colours of the illustrated icons (Paper 01M72Y4K1ZCAWQ5WGA3CD16CFN, style of
3
+ * the weekly product email). The same values are the `--color-illus-*` tokens
4
+ * in the wb-ui design system file.
5
+ *
6
+ * Drawings only. Soft colours are for art, strong colours are for app
7
+ * messages: never use these as status colours, and never put coral on a badge
8
+ * or a pill with a number (it reads as an error or a notification).
9
+ */
10
+ export declare const ILLUSTRATION_COLOURS: {
11
+ readonly ink: "#1D1D1F";
12
+ readonly paper: "#FFFAF0";
13
+ readonly paperBorder: "#EDEADE";
14
+ readonly paperShade: "#F1EADB";
15
+ readonly shadow: "#1D1D1F12";
16
+ readonly muted: "#1D1D1F55";
17
+ readonly white: "#FFFFFF";
18
+ readonly yellow: "#FFE45C";
19
+ readonly green: "#BFD98A";
20
+ readonly coral: "#F07B5A";
21
+ readonly crust: "#F2D49B";
22
+ readonly kraft: "#E3BE7A";
23
+ readonly kraftDark: "#C9A060";
24
+ };
25
+ export type IllustrationColour = keyof typeof ILLUSTRATION_COLOURS;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Colours of the illustrated icons (Paper 01M72Y4K1ZCAWQ5WGA3CD16CFN, style of
3
+ * the weekly product email). The same values are the `--color-illus-*` tokens
4
+ * in the wb-ui design system file.
5
+ *
6
+ * Drawings only. Soft colours are for art, strong colours are for app
7
+ * messages: never use these as status colours, and never put coral on a badge
8
+ * or a pill with a number (it reads as an error or a notification).
9
+ */
10
+ export const ILLUSTRATION_COLOURS = {
11
+ ink: "#1D1D1F",
12
+ paper: "#FFFAF0",
13
+ paperBorder: "#EDEADE",
14
+ paperShade: "#F1EADB",
15
+ shadow: "#1D1D1F12",
16
+ muted: "#1D1D1F55",
17
+ white: "#FFFFFF",
18
+ yellow: "#FFE45C",
19
+ green: "#BFD98A",
20
+ coral: "#F07B5A",
21
+ crust: "#F2D49B",
22
+ kraft: "#E3BE7A",
23
+ kraftDark: "#C9A060",
24
+ };
@@ -1,5 +1,9 @@
1
1
  export { RunnerLoader } from "./RunnerLoader.js";
2
2
  export type { RunnerLoaderProps } from "./RunnerLoader.js";
3
+ export { ModuleIcon, MODULE_ICON_NAMES } from "./ModuleIcon.js";
4
+ export type { ModuleIconName, ModuleIconProps } from "./ModuleIcon.js";
5
+ export { ILLUSTRATION_COLOURS } from "./illustrationColours.js";
6
+ export type { IllustrationColour } from "./illustrationColours.js";
3
7
  export { POS_DARK_CLASS, POS_DARK_TOKENS, POS_TOKENS, POS_WIDE_MIN_WIDTH, posDarkTokensCss, posTokensCss, } from "./posTokens.js";
4
8
  export type { PosToken } from "./posTokens.js";
5
9
  export { CATEGORY_PALETTE, CATEGORY_PALETTE_DARK, CATEGORY_PALETTE_DARK_TOKENS, CATEGORY_PALETTE_TOKENS, DEFAULT_CATEGORY_SLOT, categorySlotForIndex, } from "./categoryPalette.js";
package/dist/esm/index.js CHANGED
@@ -1,4 +1,6 @@
1
1
  export { RunnerLoader } from "./RunnerLoader.js";
2
+ export { ModuleIcon, MODULE_ICON_NAMES } from "./ModuleIcon.js";
3
+ export { ILLUSTRATION_COLOURS } from "./illustrationColours.js";
2
4
  export { POS_DARK_CLASS, POS_DARK_TOKENS, POS_TOKENS, POS_WIDE_MIN_WIDTH, posDarkTokensCss, posTokensCss, } from "./posTokens.js";
3
5
  export { CATEGORY_PALETTE, CATEGORY_PALETTE_DARK, CATEGORY_PALETTE_DARK_TOKENS, CATEGORY_PALETTE_TOKENS, DEFAULT_CATEGORY_SLOT, categorySlotForIndex, } from "./categoryPalette.js";
4
6
  export { PRODUCT_IMAGE_FRAMES, productImageAspectRatio, productImageKeptArea, } from "./productImageFrames.js";
@@ -1,20 +1,24 @@
1
1
  export declare const POS_TOKENS: {
2
- readonly "--wb-cat-1": string;
3
- readonly "--wb-cat-1-tint": string;
4
- readonly "--wb-cat-1-slot": string;
5
- readonly "--wb-cat-1-ink": string;
6
- readonly "--wb-cat-8": string;
7
- readonly "--wb-cat-8-tint": string;
8
- readonly "--wb-cat-8-slot": string;
9
- readonly "--wb-cat-8-ink": string;
10
2
  readonly "--wb-cat-2": string;
11
3
  readonly "--wb-cat-2-tint": string;
12
4
  readonly "--wb-cat-2-slot": string;
13
5
  readonly "--wb-cat-2-ink": string;
6
+ readonly "--wb-cat-1": string;
7
+ readonly "--wb-cat-1-tint": string;
8
+ readonly "--wb-cat-1-slot": string;
9
+ readonly "--wb-cat-1-ink": string;
10
+ readonly "--wb-cat-6": string;
11
+ readonly "--wb-cat-6-tint": string;
12
+ readonly "--wb-cat-6-slot": string;
13
+ readonly "--wb-cat-6-ink": string;
14
14
  readonly "--wb-cat-3": string;
15
15
  readonly "--wb-cat-3-tint": string;
16
16
  readonly "--wb-cat-3-slot": string;
17
17
  readonly "--wb-cat-3-ink": string;
18
+ readonly "--wb-cat-8": string;
19
+ readonly "--wb-cat-8-tint": string;
20
+ readonly "--wb-cat-8-slot": string;
21
+ readonly "--wb-cat-8-ink": string;
18
22
  readonly "--wb-cat-4": string;
19
23
  readonly "--wb-cat-4-tint": string;
20
24
  readonly "--wb-cat-4-slot": string;
@@ -23,10 +27,6 @@ export declare const POS_TOKENS: {
23
27
  readonly "--wb-cat-5-tint": string;
24
28
  readonly "--wb-cat-5-slot": string;
25
29
  readonly "--wb-cat-5-ink": string;
26
- readonly "--wb-cat-6": string;
27
- readonly "--wb-cat-6-tint": string;
28
- readonly "--wb-cat-6-slot": string;
29
- readonly "--wb-cat-6-ink": string;
30
30
  readonly "--wb-cat-7": string;
31
31
  readonly "--wb-cat-7-tint": string;
32
32
  readonly "--wb-cat-7-slot": string;
@@ -100,22 +100,26 @@ export declare const POS_WIDE_MIN_WIDTH = 600;
100
100
  * <body>; the generated stylesheet carries that rule.
101
101
  */
102
102
  export declare const POS_DARK_TOKENS: {
103
- readonly "--wb-cat-1": string;
104
- readonly "--wb-cat-1-tint": string;
105
- readonly "--wb-cat-1-slot": string;
106
- readonly "--wb-cat-1-ink": string;
107
- readonly "--wb-cat-8": string;
108
- readonly "--wb-cat-8-tint": string;
109
- readonly "--wb-cat-8-slot": string;
110
- readonly "--wb-cat-8-ink": string;
111
103
  readonly "--wb-cat-2": string;
112
104
  readonly "--wb-cat-2-tint": string;
113
105
  readonly "--wb-cat-2-slot": string;
114
106
  readonly "--wb-cat-2-ink": string;
107
+ readonly "--wb-cat-1": string;
108
+ readonly "--wb-cat-1-tint": string;
109
+ readonly "--wb-cat-1-slot": string;
110
+ readonly "--wb-cat-1-ink": string;
111
+ readonly "--wb-cat-6": string;
112
+ readonly "--wb-cat-6-tint": string;
113
+ readonly "--wb-cat-6-slot": string;
114
+ readonly "--wb-cat-6-ink": string;
115
115
  readonly "--wb-cat-3": string;
116
116
  readonly "--wb-cat-3-tint": string;
117
117
  readonly "--wb-cat-3-slot": string;
118
118
  readonly "--wb-cat-3-ink": string;
119
+ readonly "--wb-cat-8": string;
120
+ readonly "--wb-cat-8-tint": string;
121
+ readonly "--wb-cat-8-slot": string;
122
+ readonly "--wb-cat-8-ink": string;
119
123
  readonly "--wb-cat-4": string;
120
124
  readonly "--wb-cat-4-tint": string;
121
125
  readonly "--wb-cat-4-slot": string;
@@ -124,10 +128,6 @@ export declare const POS_DARK_TOKENS: {
124
128
  readonly "--wb-cat-5-tint": string;
125
129
  readonly "--wb-cat-5-slot": string;
126
130
  readonly "--wb-cat-5-ink": string;
127
- readonly "--wb-cat-6": string;
128
- readonly "--wb-cat-6-tint": string;
129
- readonly "--wb-cat-6-slot": string;
130
- readonly "--wb-cat-6-ink": string;
131
131
  readonly "--wb-cat-7": string;
132
132
  readonly "--wb-cat-7-tint": string;
133
133
  readonly "--wb-cat-7-slot": string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@welcome-back/brand",
3
- "version": "0.11.0",
4
- "description": "WelcomeBack brand assets for React apps: the running-W loader and the POS design tokens.",
3
+ "version": "0.12.0",
4
+ "description": "WelcomeBack brand assets for React apps: the running-W loader, the module icons and the POS design tokens.",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {
7
7
  "type": "git",