@welcome-back/brand 0.6.1 → 0.7.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 +13 -0
- package/dist/cjs/categoryPalette.js +22 -3
- package/dist/cjs/index.js +7 -1
- package/dist/cjs/posTokens.js +54 -1
- package/dist/esm/categoryPalette.d.ts +58 -3
- package/dist/esm/categoryPalette.js +21 -2
- package/dist/esm/index.d.ts +2 -2
- package/dist/esm/index.js +2 -2
- package/dist/esm/posTokens.d.ts +79 -0
- package/dist/esm/posTokens.js +53 -1
- package/dist/pos-tokens.css +63 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -320,6 +320,19 @@ POS_TOKENS['--wb-accent']; // '#171717'
|
|
|
320
320
|
|
|
321
321
|
`posTokensCss(selector)` returns the same rule for another selector.
|
|
322
322
|
|
|
323
|
+
`POS_WIDE_MIN_WIDTH` (600) is the one layout switch: below it is phone /
|
|
324
|
+
payment terminal, from it on is tablet. It is a number because media queries
|
|
325
|
+
cannot read a CSS variable; pos-ui uses it as the `wide` screen in Tailwind.
|
|
326
|
+
|
|
327
|
+
### Dark
|
|
328
|
+
|
|
329
|
+
`POS_DARK_TOKENS` holds a dark value for every colour token (Paper F4, direction A
|
|
330
|
+
«Warm night», owner 2026-10-21); sizes, radius and type do not change. The
|
|
331
|
+
generated `pos-tokens.css` also carries the rule `.theme-dark { … }`, so an app
|
|
332
|
+
turns dark by putting `POS_DARK_CLASS` (`theme-dark`) on `<body>`. Dark is a
|
|
333
|
+
per-device setting, never automatic. `CATEGORY_PALETTE_DARK` has the same 8
|
|
334
|
+
colours, slot for slot, and passes the same contrast test on the dark card.
|
|
335
|
+
|
|
323
336
|
### Category colours
|
|
324
337
|
|
|
325
338
|
`CATEGORY_PALETTE` (`src/categoryPalette.ts`) is the 8-colour set of the POS
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CATEGORY_PALETTE_TOKENS = exports.DEFAULT_CATEGORY_SLOT = exports.CATEGORY_PALETTE = void 0;
|
|
3
|
+
exports.CATEGORY_PALETTE_DARK_TOKENS = exports.CATEGORY_PALETTE_TOKENS = exports.DEFAULT_CATEGORY_SLOT = exports.CATEGORY_PALETTE_DARK = exports.CATEGORY_PALETTE = void 0;
|
|
4
4
|
exports.categorySlotForIndex = categorySlotForIndex;
|
|
5
5
|
exports.CATEGORY_PALETTE = [
|
|
6
6
|
{ name: "Dorado", swatch: "#a07c2b", tint: "#f3ecdd", slot: "#eae2d0", ink: "#785d20" },
|
|
@@ -12,16 +12,35 @@ exports.CATEGORY_PALETTE = [
|
|
|
12
12
|
{ name: "Pizarra", swatch: "#5e7a80", tint: "#eaeeee", slot: "#dce2e3", ink: "#465c60" },
|
|
13
13
|
{ name: "Piedra", swatch: "#8a7f6e", tint: "#f0eeec", slot: "#e5e3df", ink: "#685f52" },
|
|
14
14
|
];
|
|
15
|
+
/**
|
|
16
|
+
* The same 8 colours for the dark look (F4 A «Warm night», owner 2026-10-21),
|
|
17
|
+
* slot for slot. Tint and slot are the swatch mixed into the dark card
|
|
18
|
+
* (#1a1917) at 20 % and 32 %; ink is the swatch mixed with white at 55 %;
|
|
19
|
+
* the swatch is 18 % lighter. Text on a dark tint is #f2f0ea and #b8b3a7.
|
|
20
|
+
*/
|
|
21
|
+
exports.CATEGORY_PALETTE_DARK = [
|
|
22
|
+
{ name: "Dorado", swatch: "#b19451", tint: "#352d1b", slot: "#45391d", ink: "#d4c4a0" },
|
|
23
|
+
{ name: "Azul mar", swatch: "#4798b6", tint: "#1b2e34", slot: "#1c3a45", ink: "#9ac6d7" },
|
|
24
|
+
{ name: "Terracota", swatch: "#c2785f", tint: "#39261e", slot: "#4c2e23", ink: "#deb5a7" },
|
|
25
|
+
{ name: "Verde", swatch: "#66a279", tint: "#233025", slot: "#283e2d", ink: "#abccb6" },
|
|
26
|
+
{ name: "Ciruela", swatch: "#ae729e", tint: "#34252e", slot: "#442c3b", ink: "#d2b2ca" },
|
|
27
|
+
{ name: "Azul", swatch: "#6289c2", tint: "#212a37", slot: "#26354a", ink: "#a9bede" },
|
|
28
|
+
{ name: "Pizarra", swatch: "#7b9297", tint: "#282c2c", slot: "#303839", ink: "#b7c3c6" },
|
|
29
|
+
{ name: "Piedra", swatch: "#9f9688", tint: "#302d28", slot: "#3e3a33", ink: "#cac5be" },
|
|
30
|
+
];
|
|
15
31
|
/** The neutral slot a category gets when nothing else applies. */
|
|
16
32
|
exports.DEFAULT_CATEGORY_SLOT = 8;
|
|
17
33
|
/** Slot for the n-th category in tree order (0-based): 1…8, then 1… again. */
|
|
18
34
|
function categorySlotForIndex(index) {
|
|
19
35
|
return ((((index % 8) + 8) % 8) + 1);
|
|
20
36
|
}
|
|
21
|
-
|
|
22
|
-
exports.CATEGORY_PALETTE_TOKENS = Object.fromEntries(exports.CATEGORY_PALETTE.flatMap((c, i) => [
|
|
37
|
+
const paletteTokens = (palette) => Object.fromEntries(palette.flatMap((c, i) => [
|
|
23
38
|
[`--wb-cat-${i + 1}`, c.swatch],
|
|
24
39
|
[`--wb-cat-${i + 1}-tint`, c.tint],
|
|
25
40
|
[`--wb-cat-${i + 1}-slot`, c.slot],
|
|
26
41
|
[`--wb-cat-${i + 1}-ink`, c.ink],
|
|
27
42
|
]));
|
|
43
|
+
/** CSS variables of the palette: --wb-cat-N (swatch), -tint, -slot, -ink. */
|
|
44
|
+
exports.CATEGORY_PALETTE_TOKENS = paletteTokens(exports.CATEGORY_PALETTE);
|
|
45
|
+
/** The same variables with the dark values. */
|
|
46
|
+
exports.CATEGORY_PALETTE_DARK_TOKENS = paletteTokens(exports.CATEGORY_PALETTE_DARK);
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,13 +1,19 @@
|
|
|
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 = exports.posTokensCss = exports.POS_TOKENS = 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.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 posTokens_js_1 = require("./posTokens.js");
|
|
7
|
+
Object.defineProperty(exports, "POS_DARK_CLASS", { enumerable: true, get: function () { return posTokens_js_1.POS_DARK_CLASS; } });
|
|
8
|
+
Object.defineProperty(exports, "POS_DARK_TOKENS", { enumerable: true, get: function () { return posTokens_js_1.POS_DARK_TOKENS; } });
|
|
7
9
|
Object.defineProperty(exports, "POS_TOKENS", { enumerable: true, get: function () { return posTokens_js_1.POS_TOKENS; } });
|
|
10
|
+
Object.defineProperty(exports, "POS_WIDE_MIN_WIDTH", { enumerable: true, get: function () { return posTokens_js_1.POS_WIDE_MIN_WIDTH; } });
|
|
11
|
+
Object.defineProperty(exports, "posDarkTokensCss", { enumerable: true, get: function () { return posTokens_js_1.posDarkTokensCss; } });
|
|
8
12
|
Object.defineProperty(exports, "posTokensCss", { enumerable: true, get: function () { return posTokens_js_1.posTokensCss; } });
|
|
9
13
|
var categoryPalette_js_1 = require("./categoryPalette.js");
|
|
10
14
|
Object.defineProperty(exports, "CATEGORY_PALETTE", { enumerable: true, get: function () { return categoryPalette_js_1.CATEGORY_PALETTE; } });
|
|
15
|
+
Object.defineProperty(exports, "CATEGORY_PALETTE_DARK", { enumerable: true, get: function () { return categoryPalette_js_1.CATEGORY_PALETTE_DARK; } });
|
|
16
|
+
Object.defineProperty(exports, "CATEGORY_PALETTE_DARK_TOKENS", { enumerable: true, get: function () { return categoryPalette_js_1.CATEGORY_PALETTE_DARK_TOKENS; } });
|
|
11
17
|
Object.defineProperty(exports, "CATEGORY_PALETTE_TOKENS", { enumerable: true, get: function () { return categoryPalette_js_1.CATEGORY_PALETTE_TOKENS; } });
|
|
12
18
|
Object.defineProperty(exports, "DEFAULT_CATEGORY_SLOT", { enumerable: true, get: function () { return categoryPalette_js_1.DEFAULT_CATEGORY_SLOT; } });
|
|
13
19
|
Object.defineProperty(exports, "categorySlotForIndex", { enumerable: true, get: function () { return categoryPalette_js_1.categorySlotForIndex; } });
|
package/dist/cjs/posTokens.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.POS_TOKENS = void 0;
|
|
3
|
+
exports.POS_DARK_CLASS = exports.POS_DARK_TOKENS = exports.POS_WIDE_MIN_WIDTH = exports.POS_TOKENS = void 0;
|
|
4
4
|
exports.posTokensCss = posTokensCss;
|
|
5
|
+
exports.posDarkTokensCss = posDarkTokensCss;
|
|
5
6
|
/**
|
|
6
7
|
* The WelcomeBack POS look: the CSS custom properties pos-ui paints with, and
|
|
7
8
|
* the ones the dashboard's POS / KDS previews copy. One source, so a preview
|
|
@@ -82,12 +83,64 @@ exports.POS_TOKENS = {
|
|
|
82
83
|
"--wb-text-body": "15px",
|
|
83
84
|
"--wb-text-small": "13px",
|
|
84
85
|
"--wb-text-caption": "12px",
|
|
86
|
+
// Keypad digits and product initials (weight 600). Owner, 2026-10-21.
|
|
87
|
+
"--wb-text-key": "26px",
|
|
85
88
|
"--wb-font": "'Inter'",
|
|
86
89
|
// Category colours: --wb-cat-1 … --wb-cat-8 (+ -tint, -slot, -ink).
|
|
87
90
|
...categoryPalette_js_1.CATEGORY_PALETTE_TOKENS,
|
|
88
91
|
};
|
|
92
|
+
/**
|
|
93
|
+
* The one layout switch of the POS: below this width is phone / payment
|
|
94
|
+
* terminal (sheets, narrow money), from it on is tablet. Media queries cannot
|
|
95
|
+
* read a CSS variable, so it is a number for the app's breakpoint config.
|
|
96
|
+
*/
|
|
97
|
+
exports.POS_WIDE_MIN_WIDTH = 600;
|
|
98
|
+
/**
|
|
99
|
+
* The dark look (Paper F4, direction A «Warm night», owner 2026-10-21): a
|
|
100
|
+
* value for every colour token; sizes, radius and type do not change. Dark
|
|
101
|
+
* is a per-device setting, never automatic. pos-ui puts `.theme-dark` on
|
|
102
|
+
* <body>; the generated stylesheet carries that rule.
|
|
103
|
+
*/
|
|
104
|
+
exports.POS_DARK_TOKENS = {
|
|
105
|
+
"--wb-primary": "#f2f0ea",
|
|
106
|
+
"--wb-accent": "#f2f0ea",
|
|
107
|
+
"--wb-on-accent": "#121110",
|
|
108
|
+
"--wb-on-accent-soft": "rgba(18, 17, 16, 0.12)",
|
|
109
|
+
"--wb-accent-soft": "rgba(242, 240, 234, 0.08)",
|
|
110
|
+
"--wb-bg": "#121110",
|
|
111
|
+
"--wb-surface": "#1a1917",
|
|
112
|
+
"--wb-surface2": "#24221f",
|
|
113
|
+
"--wb-ticket-bg": "#1f1d1a",
|
|
114
|
+
"--wb-border": "#3b3832",
|
|
115
|
+
"--wb-veil": "rgba(18, 17, 16, 0.72)",
|
|
116
|
+
"--wb-text": "#f2f0ea",
|
|
117
|
+
"--wb-muted": "#b8b3a7",
|
|
118
|
+
"--wb-success": "#22c55e",
|
|
119
|
+
"--wb-success-soft": "rgba(34, 197, 94, 0.15)",
|
|
120
|
+
"--wb-success-strong": "#4ade80",
|
|
121
|
+
"--wb-amber": "#f59e0b",
|
|
122
|
+
"--wb-amber-soft": "rgba(245, 158, 11, 0.15)",
|
|
123
|
+
"--wb-error": "#ef4444",
|
|
124
|
+
"--wb-error-soft": "rgba(239, 68, 68, 0.15)",
|
|
125
|
+
"--wb-amber-strong": "#fbbf24",
|
|
126
|
+
"--wb-error-strong": "#f87171",
|
|
127
|
+
"--wb-soldout": "#413115",
|
|
128
|
+
"--wb-soldout-ink": "#fcd34d",
|
|
129
|
+
"--wb-faint": "#8f8a7e",
|
|
130
|
+
"--wb-primary-soft": "rgba(242, 240, 234, 0.15)",
|
|
131
|
+
"--wb-ring-soft": "rgba(242, 240, 234, 0.5)",
|
|
132
|
+
"--wb-brand": "#f2f0ea",
|
|
133
|
+
...categoryPalette_js_1.CATEGORY_PALETTE_DARK_TOKENS,
|
|
134
|
+
};
|
|
135
|
+
/** The class pos-ui puts on <body> for the dark look. */
|
|
136
|
+
exports.POS_DARK_CLASS = "theme-dark";
|
|
89
137
|
/** The tokens as one CSS rule, for apps that load them as a stylesheet. */
|
|
90
138
|
function posTokensCss(selector = ":root") {
|
|
91
139
|
const lines = Object.entries(exports.POS_TOKENS).map(([name, value]) => ` ${name}: ${value};`);
|
|
92
140
|
return `${selector} {\n${lines.join("\n")}\n}\n`;
|
|
93
141
|
}
|
|
142
|
+
/** The dark values as one CSS rule (default selector `.theme-dark`). */
|
|
143
|
+
function posDarkTokensCss(selector = `.${exports.POS_DARK_CLASS}`) {
|
|
144
|
+
const lines = Object.entries(exports.POS_DARK_TOKENS).map(([name, value]) => ` ${name}: ${value};`);
|
|
145
|
+
return `${selector} {\n${lines.join("\n")}\n}\n`;
|
|
146
|
+
}
|
|
@@ -65,12 +65,67 @@ export declare const CATEGORY_PALETTE: readonly [{
|
|
|
65
65
|
readonly slot: "#e5e3df";
|
|
66
66
|
readonly ink: "#685f52";
|
|
67
67
|
}];
|
|
68
|
+
/**
|
|
69
|
+
* The same 8 colours for the dark look (F4 A «Warm night», owner 2026-10-21),
|
|
70
|
+
* slot for slot. Tint and slot are the swatch mixed into the dark card
|
|
71
|
+
* (#1a1917) at 20 % and 32 %; ink is the swatch mixed with white at 55 %;
|
|
72
|
+
* the swatch is 18 % lighter. Text on a dark tint is #f2f0ea and #b8b3a7.
|
|
73
|
+
*/
|
|
74
|
+
export declare const CATEGORY_PALETTE_DARK: readonly [{
|
|
75
|
+
readonly name: "Dorado";
|
|
76
|
+
readonly swatch: "#b19451";
|
|
77
|
+
readonly tint: "#352d1b";
|
|
78
|
+
readonly slot: "#45391d";
|
|
79
|
+
readonly ink: "#d4c4a0";
|
|
80
|
+
}, {
|
|
81
|
+
readonly name: "Azul mar";
|
|
82
|
+
readonly swatch: "#4798b6";
|
|
83
|
+
readonly tint: "#1b2e34";
|
|
84
|
+
readonly slot: "#1c3a45";
|
|
85
|
+
readonly ink: "#9ac6d7";
|
|
86
|
+
}, {
|
|
87
|
+
readonly name: "Terracota";
|
|
88
|
+
readonly swatch: "#c2785f";
|
|
89
|
+
readonly tint: "#39261e";
|
|
90
|
+
readonly slot: "#4c2e23";
|
|
91
|
+
readonly ink: "#deb5a7";
|
|
92
|
+
}, {
|
|
93
|
+
readonly name: "Verde";
|
|
94
|
+
readonly swatch: "#66a279";
|
|
95
|
+
readonly tint: "#233025";
|
|
96
|
+
readonly slot: "#283e2d";
|
|
97
|
+
readonly ink: "#abccb6";
|
|
98
|
+
}, {
|
|
99
|
+
readonly name: "Ciruela";
|
|
100
|
+
readonly swatch: "#ae729e";
|
|
101
|
+
readonly tint: "#34252e";
|
|
102
|
+
readonly slot: "#442c3b";
|
|
103
|
+
readonly ink: "#d2b2ca";
|
|
104
|
+
}, {
|
|
105
|
+
readonly name: "Azul";
|
|
106
|
+
readonly swatch: "#6289c2";
|
|
107
|
+
readonly tint: "#212a37";
|
|
108
|
+
readonly slot: "#26354a";
|
|
109
|
+
readonly ink: "#a9bede";
|
|
110
|
+
}, {
|
|
111
|
+
readonly name: "Pizarra";
|
|
112
|
+
readonly swatch: "#7b9297";
|
|
113
|
+
readonly tint: "#282c2c";
|
|
114
|
+
readonly slot: "#303839";
|
|
115
|
+
readonly ink: "#b7c3c6";
|
|
116
|
+
}, {
|
|
117
|
+
readonly name: "Piedra";
|
|
118
|
+
readonly swatch: "#9f9688";
|
|
119
|
+
readonly tint: "#302d28";
|
|
120
|
+
readonly slot: "#3e3a33";
|
|
121
|
+
readonly ink: "#cac5be";
|
|
122
|
+
}];
|
|
68
123
|
export type CategorySlot = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8;
|
|
69
124
|
/** The neutral slot a category gets when nothing else applies. */
|
|
70
125
|
export declare const DEFAULT_CATEGORY_SLOT: CategorySlot;
|
|
71
126
|
/** Slot for the n-th category in tree order (0-based): 1…8, then 1… again. */
|
|
72
127
|
export declare function categorySlotForIndex(index: number): CategorySlot;
|
|
73
|
-
type CategoryVar = `--wb-cat-${CategorySlot}${"" | "-tint" | "-slot" | "-ink"}`;
|
|
74
128
|
/** CSS variables of the palette: --wb-cat-N (swatch), -tint, -slot, -ink. */
|
|
75
|
-
export declare const CATEGORY_PALETTE_TOKENS: Record<
|
|
76
|
-
|
|
129
|
+
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>;
|
|
130
|
+
/** The same variables with the dark values. */
|
|
131
|
+
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>;
|
|
@@ -8,16 +8,35 @@ export const CATEGORY_PALETTE = [
|
|
|
8
8
|
{ name: "Pizarra", swatch: "#5e7a80", tint: "#eaeeee", slot: "#dce2e3", ink: "#465c60" },
|
|
9
9
|
{ name: "Piedra", swatch: "#8a7f6e", tint: "#f0eeec", slot: "#e5e3df", ink: "#685f52" },
|
|
10
10
|
];
|
|
11
|
+
/**
|
|
12
|
+
* The same 8 colours for the dark look (F4 A «Warm night», owner 2026-10-21),
|
|
13
|
+
* slot for slot. Tint and slot are the swatch mixed into the dark card
|
|
14
|
+
* (#1a1917) at 20 % and 32 %; ink is the swatch mixed with white at 55 %;
|
|
15
|
+
* the swatch is 18 % lighter. Text on a dark tint is #f2f0ea and #b8b3a7.
|
|
16
|
+
*/
|
|
17
|
+
export const CATEGORY_PALETTE_DARK = [
|
|
18
|
+
{ name: "Dorado", swatch: "#b19451", tint: "#352d1b", slot: "#45391d", ink: "#d4c4a0" },
|
|
19
|
+
{ name: "Azul mar", swatch: "#4798b6", tint: "#1b2e34", slot: "#1c3a45", ink: "#9ac6d7" },
|
|
20
|
+
{ name: "Terracota", swatch: "#c2785f", tint: "#39261e", slot: "#4c2e23", ink: "#deb5a7" },
|
|
21
|
+
{ name: "Verde", swatch: "#66a279", tint: "#233025", slot: "#283e2d", ink: "#abccb6" },
|
|
22
|
+
{ name: "Ciruela", swatch: "#ae729e", tint: "#34252e", slot: "#442c3b", ink: "#d2b2ca" },
|
|
23
|
+
{ name: "Azul", swatch: "#6289c2", tint: "#212a37", slot: "#26354a", ink: "#a9bede" },
|
|
24
|
+
{ name: "Pizarra", swatch: "#7b9297", tint: "#282c2c", slot: "#303839", ink: "#b7c3c6" },
|
|
25
|
+
{ name: "Piedra", swatch: "#9f9688", tint: "#302d28", slot: "#3e3a33", ink: "#cac5be" },
|
|
26
|
+
];
|
|
11
27
|
/** The neutral slot a category gets when nothing else applies. */
|
|
12
28
|
export const DEFAULT_CATEGORY_SLOT = 8;
|
|
13
29
|
/** Slot for the n-th category in tree order (0-based): 1…8, then 1… again. */
|
|
14
30
|
export function categorySlotForIndex(index) {
|
|
15
31
|
return ((((index % 8) + 8) % 8) + 1);
|
|
16
32
|
}
|
|
17
|
-
|
|
18
|
-
export const CATEGORY_PALETTE_TOKENS = Object.fromEntries(CATEGORY_PALETTE.flatMap((c, i) => [
|
|
33
|
+
const paletteTokens = (palette) => Object.fromEntries(palette.flatMap((c, i) => [
|
|
19
34
|
[`--wb-cat-${i + 1}`, c.swatch],
|
|
20
35
|
[`--wb-cat-${i + 1}-tint`, c.tint],
|
|
21
36
|
[`--wb-cat-${i + 1}-slot`, c.slot],
|
|
22
37
|
[`--wb-cat-${i + 1}-ink`, c.ink],
|
|
23
38
|
]));
|
|
39
|
+
/** CSS variables of the palette: --wb-cat-N (swatch), -tint, -slot, -ink. */
|
|
40
|
+
export const CATEGORY_PALETTE_TOKENS = paletteTokens(CATEGORY_PALETTE);
|
|
41
|
+
/** The same variables with the dark values. */
|
|
42
|
+
export const CATEGORY_PALETTE_DARK_TOKENS = paletteTokens(CATEGORY_PALETTE_DARK);
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export { RunnerLoader } from "./RunnerLoader.js";
|
|
2
2
|
export type { RunnerLoaderProps } from "./RunnerLoader.js";
|
|
3
|
-
export { POS_TOKENS, posTokensCss } from "./posTokens.js";
|
|
3
|
+
export { POS_DARK_CLASS, POS_DARK_TOKENS, POS_TOKENS, POS_WIDE_MIN_WIDTH, posDarkTokensCss, posTokensCss, } from "./posTokens.js";
|
|
4
4
|
export type { PosToken } from "./posTokens.js";
|
|
5
|
-
export { CATEGORY_PALETTE, CATEGORY_PALETTE_TOKENS, DEFAULT_CATEGORY_SLOT, categorySlotForIndex, } from "./categoryPalette.js";
|
|
5
|
+
export { CATEGORY_PALETTE, CATEGORY_PALETTE_DARK, CATEGORY_PALETTE_DARK_TOKENS, CATEGORY_PALETTE_TOKENS, DEFAULT_CATEGORY_SLOT, categorySlotForIndex, } from "./categoryPalette.js";
|
|
6
6
|
export type { CategoryColour, CategorySlot } from "./categoryPalette.js";
|
|
7
7
|
export { PRODUCT_IMAGE_FRAMES, productImageAspectRatio, productImageKeptArea, } from "./productImageFrames.js";
|
|
8
8
|
export type { ProductImageFrame } from "./productImageFrames.js";
|
package/dist/esm/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { RunnerLoader } from "./RunnerLoader.js";
|
|
2
|
-
export { POS_TOKENS, posTokensCss } from "./posTokens.js";
|
|
3
|
-
export { CATEGORY_PALETTE, CATEGORY_PALETTE_TOKENS, DEFAULT_CATEGORY_SLOT, categorySlotForIndex, } from "./categoryPalette.js";
|
|
2
|
+
export { POS_DARK_CLASS, POS_DARK_TOKENS, POS_TOKENS, POS_WIDE_MIN_WIDTH, posDarkTokensCss, posTokensCss, } from "./posTokens.js";
|
|
3
|
+
export { CATEGORY_PALETTE, CATEGORY_PALETTE_DARK, CATEGORY_PALETTE_DARK_TOKENS, CATEGORY_PALETTE_TOKENS, DEFAULT_CATEGORY_SLOT, categorySlotForIndex, } from "./categoryPalette.js";
|
|
4
4
|
export { PRODUCT_IMAGE_FRAMES, productImageAspectRatio, productImageKeptArea, } from "./productImageFrames.js";
|
package/dist/esm/posTokens.d.ts
CHANGED
|
@@ -76,8 +76,87 @@ export declare const POS_TOKENS: {
|
|
|
76
76
|
readonly "--wb-text-body": "15px";
|
|
77
77
|
readonly "--wb-text-small": "13px";
|
|
78
78
|
readonly "--wb-text-caption": "12px";
|
|
79
|
+
readonly "--wb-text-key": "26px";
|
|
79
80
|
readonly "--wb-font": "'Inter'";
|
|
80
81
|
};
|
|
81
82
|
export type PosToken = keyof typeof POS_TOKENS;
|
|
83
|
+
/**
|
|
84
|
+
* The one layout switch of the POS: below this width is phone / payment
|
|
85
|
+
* terminal (sheets, narrow money), from it on is tablet. Media queries cannot
|
|
86
|
+
* read a CSS variable, so it is a number for the app's breakpoint config.
|
|
87
|
+
*/
|
|
88
|
+
export declare const POS_WIDE_MIN_WIDTH = 600;
|
|
89
|
+
/**
|
|
90
|
+
* The dark look (Paper F4, direction A «Warm night», owner 2026-10-21): a
|
|
91
|
+
* value for every colour token; sizes, radius and type do not change. Dark
|
|
92
|
+
* is a per-device setting, never automatic. pos-ui puts `.theme-dark` on
|
|
93
|
+
* <body>; the generated stylesheet carries that rule.
|
|
94
|
+
*/
|
|
95
|
+
export declare const POS_DARK_TOKENS: {
|
|
96
|
+
readonly "--wb-cat-1": string;
|
|
97
|
+
readonly "--wb-cat-1-tint": string;
|
|
98
|
+
readonly "--wb-cat-1-slot": string;
|
|
99
|
+
readonly "--wb-cat-1-ink": string;
|
|
100
|
+
readonly "--wb-cat-8": string;
|
|
101
|
+
readonly "--wb-cat-8-tint": string;
|
|
102
|
+
readonly "--wb-cat-8-slot": string;
|
|
103
|
+
readonly "--wb-cat-8-ink": string;
|
|
104
|
+
readonly "--wb-cat-2": string;
|
|
105
|
+
readonly "--wb-cat-2-tint": string;
|
|
106
|
+
readonly "--wb-cat-2-slot": string;
|
|
107
|
+
readonly "--wb-cat-2-ink": string;
|
|
108
|
+
readonly "--wb-cat-3": string;
|
|
109
|
+
readonly "--wb-cat-3-tint": string;
|
|
110
|
+
readonly "--wb-cat-3-slot": string;
|
|
111
|
+
readonly "--wb-cat-3-ink": string;
|
|
112
|
+
readonly "--wb-cat-4": string;
|
|
113
|
+
readonly "--wb-cat-4-tint": string;
|
|
114
|
+
readonly "--wb-cat-4-slot": string;
|
|
115
|
+
readonly "--wb-cat-4-ink": string;
|
|
116
|
+
readonly "--wb-cat-5": string;
|
|
117
|
+
readonly "--wb-cat-5-tint": string;
|
|
118
|
+
readonly "--wb-cat-5-slot": string;
|
|
119
|
+
readonly "--wb-cat-5-ink": string;
|
|
120
|
+
readonly "--wb-cat-6": string;
|
|
121
|
+
readonly "--wb-cat-6-tint": string;
|
|
122
|
+
readonly "--wb-cat-6-slot": string;
|
|
123
|
+
readonly "--wb-cat-6-ink": string;
|
|
124
|
+
readonly "--wb-cat-7": string;
|
|
125
|
+
readonly "--wb-cat-7-tint": string;
|
|
126
|
+
readonly "--wb-cat-7-slot": string;
|
|
127
|
+
readonly "--wb-cat-7-ink": string;
|
|
128
|
+
readonly "--wb-primary": "#f2f0ea";
|
|
129
|
+
readonly "--wb-accent": "#f2f0ea";
|
|
130
|
+
readonly "--wb-on-accent": "#121110";
|
|
131
|
+
readonly "--wb-on-accent-soft": "rgba(18, 17, 16, 0.12)";
|
|
132
|
+
readonly "--wb-accent-soft": "rgba(242, 240, 234, 0.08)";
|
|
133
|
+
readonly "--wb-bg": "#121110";
|
|
134
|
+
readonly "--wb-surface": "#1a1917";
|
|
135
|
+
readonly "--wb-surface2": "#24221f";
|
|
136
|
+
readonly "--wb-ticket-bg": "#1f1d1a";
|
|
137
|
+
readonly "--wb-border": "#3b3832";
|
|
138
|
+
readonly "--wb-veil": "rgba(18, 17, 16, 0.72)";
|
|
139
|
+
readonly "--wb-text": "#f2f0ea";
|
|
140
|
+
readonly "--wb-muted": "#b8b3a7";
|
|
141
|
+
readonly "--wb-success": "#22c55e";
|
|
142
|
+
readonly "--wb-success-soft": "rgba(34, 197, 94, 0.15)";
|
|
143
|
+
readonly "--wb-success-strong": "#4ade80";
|
|
144
|
+
readonly "--wb-amber": "#f59e0b";
|
|
145
|
+
readonly "--wb-amber-soft": "rgba(245, 158, 11, 0.15)";
|
|
146
|
+
readonly "--wb-error": "#ef4444";
|
|
147
|
+
readonly "--wb-error-soft": "rgba(239, 68, 68, 0.15)";
|
|
148
|
+
readonly "--wb-amber-strong": "#fbbf24";
|
|
149
|
+
readonly "--wb-error-strong": "#f87171";
|
|
150
|
+
readonly "--wb-soldout": "#413115";
|
|
151
|
+
readonly "--wb-soldout-ink": "#fcd34d";
|
|
152
|
+
readonly "--wb-faint": "#8f8a7e";
|
|
153
|
+
readonly "--wb-primary-soft": "rgba(242, 240, 234, 0.15)";
|
|
154
|
+
readonly "--wb-ring-soft": "rgba(242, 240, 234, 0.5)";
|
|
155
|
+
readonly "--wb-brand": "#f2f0ea";
|
|
156
|
+
};
|
|
157
|
+
/** The class pos-ui puts on <body> for the dark look. */
|
|
158
|
+
export declare const POS_DARK_CLASS = "theme-dark";
|
|
82
159
|
/** The tokens as one CSS rule, for apps that load them as a stylesheet. */
|
|
83
160
|
export declare function posTokensCss(selector?: string): string;
|
|
161
|
+
/** The dark values as one CSS rule (default selector `.theme-dark`). */
|
|
162
|
+
export declare function posDarkTokensCss(selector?: string): string;
|
package/dist/esm/posTokens.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* pos-ui imports the generated `@welcome-back/brand/pos-tokens.css`; React code
|
|
10
10
|
* reads `POS_TOKENS`.
|
|
11
11
|
*/
|
|
12
|
-
import { CATEGORY_PALETTE_TOKENS } from "./categoryPalette.js";
|
|
12
|
+
import { CATEGORY_PALETTE_DARK_TOKENS, CATEGORY_PALETTE_TOKENS } from "./categoryPalette.js";
|
|
13
13
|
export const POS_TOKENS = {
|
|
14
14
|
// Monochrome chrome on a warm ivory canvas (pos-ui DESIGN.md §3).
|
|
15
15
|
"--wb-primary": "#171717",
|
|
@@ -78,12 +78,64 @@ export const POS_TOKENS = {
|
|
|
78
78
|
"--wb-text-body": "15px",
|
|
79
79
|
"--wb-text-small": "13px",
|
|
80
80
|
"--wb-text-caption": "12px",
|
|
81
|
+
// Keypad digits and product initials (weight 600). Owner, 2026-10-21.
|
|
82
|
+
"--wb-text-key": "26px",
|
|
81
83
|
"--wb-font": "'Inter'",
|
|
82
84
|
// Category colours: --wb-cat-1 … --wb-cat-8 (+ -tint, -slot, -ink).
|
|
83
85
|
...CATEGORY_PALETTE_TOKENS,
|
|
84
86
|
};
|
|
87
|
+
/**
|
|
88
|
+
* The one layout switch of the POS: below this width is phone / payment
|
|
89
|
+
* terminal (sheets, narrow money), from it on is tablet. Media queries cannot
|
|
90
|
+
* read a CSS variable, so it is a number for the app's breakpoint config.
|
|
91
|
+
*/
|
|
92
|
+
export const POS_WIDE_MIN_WIDTH = 600;
|
|
93
|
+
/**
|
|
94
|
+
* The dark look (Paper F4, direction A «Warm night», owner 2026-10-21): a
|
|
95
|
+
* value for every colour token; sizes, radius and type do not change. Dark
|
|
96
|
+
* is a per-device setting, never automatic. pos-ui puts `.theme-dark` on
|
|
97
|
+
* <body>; the generated stylesheet carries that rule.
|
|
98
|
+
*/
|
|
99
|
+
export const POS_DARK_TOKENS = {
|
|
100
|
+
"--wb-primary": "#f2f0ea",
|
|
101
|
+
"--wb-accent": "#f2f0ea",
|
|
102
|
+
"--wb-on-accent": "#121110",
|
|
103
|
+
"--wb-on-accent-soft": "rgba(18, 17, 16, 0.12)",
|
|
104
|
+
"--wb-accent-soft": "rgba(242, 240, 234, 0.08)",
|
|
105
|
+
"--wb-bg": "#121110",
|
|
106
|
+
"--wb-surface": "#1a1917",
|
|
107
|
+
"--wb-surface2": "#24221f",
|
|
108
|
+
"--wb-ticket-bg": "#1f1d1a",
|
|
109
|
+
"--wb-border": "#3b3832",
|
|
110
|
+
"--wb-veil": "rgba(18, 17, 16, 0.72)",
|
|
111
|
+
"--wb-text": "#f2f0ea",
|
|
112
|
+
"--wb-muted": "#b8b3a7",
|
|
113
|
+
"--wb-success": "#22c55e",
|
|
114
|
+
"--wb-success-soft": "rgba(34, 197, 94, 0.15)",
|
|
115
|
+
"--wb-success-strong": "#4ade80",
|
|
116
|
+
"--wb-amber": "#f59e0b",
|
|
117
|
+
"--wb-amber-soft": "rgba(245, 158, 11, 0.15)",
|
|
118
|
+
"--wb-error": "#ef4444",
|
|
119
|
+
"--wb-error-soft": "rgba(239, 68, 68, 0.15)",
|
|
120
|
+
"--wb-amber-strong": "#fbbf24",
|
|
121
|
+
"--wb-error-strong": "#f87171",
|
|
122
|
+
"--wb-soldout": "#413115",
|
|
123
|
+
"--wb-soldout-ink": "#fcd34d",
|
|
124
|
+
"--wb-faint": "#8f8a7e",
|
|
125
|
+
"--wb-primary-soft": "rgba(242, 240, 234, 0.15)",
|
|
126
|
+
"--wb-ring-soft": "rgba(242, 240, 234, 0.5)",
|
|
127
|
+
"--wb-brand": "#f2f0ea",
|
|
128
|
+
...CATEGORY_PALETTE_DARK_TOKENS,
|
|
129
|
+
};
|
|
130
|
+
/** The class pos-ui puts on <body> for the dark look. */
|
|
131
|
+
export const POS_DARK_CLASS = "theme-dark";
|
|
85
132
|
/** The tokens as one CSS rule, for apps that load them as a stylesheet. */
|
|
86
133
|
export function posTokensCss(selector = ":root") {
|
|
87
134
|
const lines = Object.entries(POS_TOKENS).map(([name, value]) => ` ${name}: ${value};`);
|
|
88
135
|
return `${selector} {\n${lines.join("\n")}\n}\n`;
|
|
89
136
|
}
|
|
137
|
+
/** The dark values as one CSS rule (default selector `.theme-dark`). */
|
|
138
|
+
export function posDarkTokensCss(selector = `.${POS_DARK_CLASS}`) {
|
|
139
|
+
const lines = Object.entries(POS_DARK_TOKENS).map(([name, value]) => ` ${name}: ${value};`);
|
|
140
|
+
return `${selector} {\n${lines.join("\n")}\n}\n`;
|
|
141
|
+
}
|
package/dist/pos-tokens.css
CHANGED
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
--wb-text-body: 15px;
|
|
46
46
|
--wb-text-small: 13px;
|
|
47
47
|
--wb-text-caption: 12px;
|
|
48
|
+
--wb-text-key: 26px;
|
|
48
49
|
--wb-font: 'Inter';
|
|
49
50
|
--wb-cat-1: #a07c2b;
|
|
50
51
|
--wb-cat-1-tint: #f3ecdd;
|
|
@@ -79,3 +80,65 @@
|
|
|
79
80
|
--wb-cat-8-slot: #e5e3df;
|
|
80
81
|
--wb-cat-8-ink: #685f52;
|
|
81
82
|
}
|
|
83
|
+
.theme-dark {
|
|
84
|
+
--wb-primary: #f2f0ea;
|
|
85
|
+
--wb-accent: #f2f0ea;
|
|
86
|
+
--wb-on-accent: #121110;
|
|
87
|
+
--wb-on-accent-soft: rgba(18, 17, 16, 0.12);
|
|
88
|
+
--wb-accent-soft: rgba(242, 240, 234, 0.08);
|
|
89
|
+
--wb-bg: #121110;
|
|
90
|
+
--wb-surface: #1a1917;
|
|
91
|
+
--wb-surface2: #24221f;
|
|
92
|
+
--wb-ticket-bg: #1f1d1a;
|
|
93
|
+
--wb-border: #3b3832;
|
|
94
|
+
--wb-veil: rgba(18, 17, 16, 0.72);
|
|
95
|
+
--wb-text: #f2f0ea;
|
|
96
|
+
--wb-muted: #b8b3a7;
|
|
97
|
+
--wb-success: #22c55e;
|
|
98
|
+
--wb-success-soft: rgba(34, 197, 94, 0.15);
|
|
99
|
+
--wb-success-strong: #4ade80;
|
|
100
|
+
--wb-amber: #f59e0b;
|
|
101
|
+
--wb-amber-soft: rgba(245, 158, 11, 0.15);
|
|
102
|
+
--wb-error: #ef4444;
|
|
103
|
+
--wb-error-soft: rgba(239, 68, 68, 0.15);
|
|
104
|
+
--wb-amber-strong: #fbbf24;
|
|
105
|
+
--wb-error-strong: #f87171;
|
|
106
|
+
--wb-soldout: #413115;
|
|
107
|
+
--wb-soldout-ink: #fcd34d;
|
|
108
|
+
--wb-faint: #8f8a7e;
|
|
109
|
+
--wb-primary-soft: rgba(242, 240, 234, 0.15);
|
|
110
|
+
--wb-ring-soft: rgba(242, 240, 234, 0.5);
|
|
111
|
+
--wb-brand: #f2f0ea;
|
|
112
|
+
--wb-cat-1: #b19451;
|
|
113
|
+
--wb-cat-1-tint: #352d1b;
|
|
114
|
+
--wb-cat-1-slot: #45391d;
|
|
115
|
+
--wb-cat-1-ink: #d4c4a0;
|
|
116
|
+
--wb-cat-2: #4798b6;
|
|
117
|
+
--wb-cat-2-tint: #1b2e34;
|
|
118
|
+
--wb-cat-2-slot: #1c3a45;
|
|
119
|
+
--wb-cat-2-ink: #9ac6d7;
|
|
120
|
+
--wb-cat-3: #c2785f;
|
|
121
|
+
--wb-cat-3-tint: #39261e;
|
|
122
|
+
--wb-cat-3-slot: #4c2e23;
|
|
123
|
+
--wb-cat-3-ink: #deb5a7;
|
|
124
|
+
--wb-cat-4: #66a279;
|
|
125
|
+
--wb-cat-4-tint: #233025;
|
|
126
|
+
--wb-cat-4-slot: #283e2d;
|
|
127
|
+
--wb-cat-4-ink: #abccb6;
|
|
128
|
+
--wb-cat-5: #ae729e;
|
|
129
|
+
--wb-cat-5-tint: #34252e;
|
|
130
|
+
--wb-cat-5-slot: #442c3b;
|
|
131
|
+
--wb-cat-5-ink: #d2b2ca;
|
|
132
|
+
--wb-cat-6: #6289c2;
|
|
133
|
+
--wb-cat-6-tint: #212a37;
|
|
134
|
+
--wb-cat-6-slot: #26354a;
|
|
135
|
+
--wb-cat-6-ink: #a9bede;
|
|
136
|
+
--wb-cat-7: #7b9297;
|
|
137
|
+
--wb-cat-7-tint: #282c2c;
|
|
138
|
+
--wb-cat-7-slot: #303839;
|
|
139
|
+
--wb-cat-7-ink: #b7c3c6;
|
|
140
|
+
--wb-cat-8: #9f9688;
|
|
141
|
+
--wb-cat-8-tint: #302d28;
|
|
142
|
+
--wb-cat-8-slot: #3e3a33;
|
|
143
|
+
--wb-cat-8-ink: #cac5be;
|
|
144
|
+
}
|