@wordpress/theme 0.1.0 → 0.2.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 +69 -9
- package/bin/generate-default-ramps/index.ts +49 -0
- package/bin/generate-primitive-tokens/index.ts +14 -9
- package/bin/terrazzo-plugin-ds-tokens-docs/index.ts +5 -24
- package/bin/terrazzo-plugin-figma-ds-token-manager/index.ts +11 -4
- package/bin/terrazzo-plugin-inline-alias-values/index.ts +84 -0
- package/bin/terrazzo-plugin-known-wpds-css-variables/index.ts +19 -39
- package/build/color-ramps/index.js +21 -39
- package/build/color-ramps/index.js.map +3 -3
- package/build/color-ramps/lib/color-utils.js +39 -0
- package/build/color-ramps/lib/color-utils.js.map +7 -0
- package/build/color-ramps/lib/constants.js +20 -27
- package/build/color-ramps/lib/constants.js.map +3 -3
- package/build/color-ramps/lib/default-ramps.js +220 -0
- package/build/color-ramps/lib/default-ramps.js.map +7 -0
- package/build/color-ramps/lib/find-color-with-constraints.js +60 -91
- package/build/color-ramps/lib/find-color-with-constraints.js.map +3 -3
- package/build/color-ramps/lib/index.js +77 -119
- package/build/color-ramps/lib/index.js.map +3 -3
- package/build/color-ramps/lib/ramp-configs.js +15 -14
- package/build/color-ramps/lib/ramp-configs.js.map +2 -2
- package/build/color-ramps/lib/register-color-spaces.js +7 -0
- package/build/color-ramps/lib/register-color-spaces.js.map +7 -0
- package/build/color-ramps/lib/taper-chroma.js +35 -27
- package/build/color-ramps/lib/taper-chroma.js.map +3 -3
- package/build/color-ramps/lib/types.js +2 -1
- package/build/color-ramps/lib/types.js.map +1 -1
- package/build/color-ramps/lib/utils.js +75 -11
- package/build/color-ramps/lib/utils.js.map +2 -2
- package/build/context.js +3 -2
- package/build/context.js.map +1 -1
- package/build/index.js +2 -1
- package/build/index.js.map +1 -1
- package/build/lock-unlock.js +3 -2
- package/build/lock-unlock.js.map +1 -1
- package/build/prebuilt/js/design-tokens.js +19 -11
- package/build/prebuilt/js/design-tokens.js.map +2 -2
- package/build/prebuilt/json/figma.json +165 -783
- package/build/prebuilt/ts/color-tokens.js +137 -0
- package/build/prebuilt/ts/color-tokens.js.map +7 -0
- package/build/private-apis.js +3 -2
- package/build/private-apis.js.map +1 -1
- package/build/theme-provider.js +19 -17
- package/build/theme-provider.js.map +4 -4
- package/build/token-id.js +30 -0
- package/build/token-id.js.map +7 -0
- package/build/types/css-modules.d.js +0 -1
- package/build/types.js +2 -1
- package/build/types.js.map +1 -1
- package/build/use-theme-provider-styles.js +67 -62
- package/build/use-theme-provider-styles.js.map +3 -3
- package/build-module/color-ramps/index.js +20 -28
- package/build-module/color-ramps/index.js.map +2 -2
- package/build-module/color-ramps/lib/color-utils.js +19 -0
- package/build-module/color-ramps/lib/color-utils.js.map +7 -0
- package/build-module/color-ramps/lib/constants.js +14 -11
- package/build-module/color-ramps/lib/constants.js.map +2 -2
- package/build-module/color-ramps/lib/default-ramps.js +196 -0
- package/build-module/color-ramps/lib/default-ramps.js.map +7 -0
- package/build-module/color-ramps/lib/find-color-with-constraints.js +61 -87
- package/build-module/color-ramps/lib/find-color-with-constraints.js.map +2 -2
- package/build-module/color-ramps/lib/index.js +85 -109
- package/build-module/color-ramps/lib/index.js.map +3 -3
- package/build-module/color-ramps/lib/ramp-configs.js +14 -13
- package/build-module/color-ramps/lib/ramp-configs.js.map +2 -2
- package/build-module/color-ramps/lib/register-color-spaces.js +7 -0
- package/build-module/color-ramps/lib/register-color-spaces.js.map +7 -0
- package/build-module/color-ramps/lib/taper-chroma.js +40 -16
- package/build-module/color-ramps/lib/taper-chroma.js.map +2 -2
- package/build-module/color-ramps/lib/utils.js +70 -6
- package/build-module/color-ramps/lib/utils.js.map +2 -2
- package/build-module/context.js +2 -1
- package/build-module/context.js.map +1 -1
- package/build-module/index.js +1 -0
- package/build-module/index.js.map +1 -1
- package/build-module/lock-unlock.js +2 -1
- package/build-module/lock-unlock.js.map +1 -1
- package/build-module/prebuilt/js/design-tokens.js +18 -10
- package/build-module/prebuilt/js/design-tokens.js.map +2 -2
- package/build-module/prebuilt/json/figma.json +165 -783
- package/build-module/prebuilt/ts/color-tokens.js +117 -0
- package/build-module/prebuilt/ts/color-tokens.js.map +7 -0
- package/build-module/private-apis.js +2 -1
- package/build-module/private-apis.js.map +1 -1
- package/build-module/theme-provider.js +18 -6
- package/build-module/theme-provider.js.map +3 -3
- package/build-module/token-id.js +6 -0
- package/build-module/token-id.js.map +7 -0
- package/build-module/use-theme-provider-styles.js +69 -57
- package/build-module/use-theme-provider-styles.js.map +2 -2
- package/build-types/color-ramps/index.d.ts +9 -16
- package/build-types/color-ramps/index.d.ts.map +1 -1
- package/build-types/color-ramps/lib/color-utils.d.ts +22 -0
- package/build-types/color-ramps/lib/color-utils.d.ts.map +1 -0
- package/build-types/color-ramps/lib/constants.d.ts +7 -9
- package/build-types/color-ramps/lib/constants.d.ts.map +1 -1
- package/build-types/color-ramps/lib/default-ramps.d.ts +7 -0
- package/build-types/color-ramps/lib/default-ramps.d.ts.map +1 -0
- package/build-types/color-ramps/lib/find-color-with-constraints.d.ts +8 -7
- package/build-types/color-ramps/lib/find-color-with-constraints.d.ts.map +1 -1
- package/build-types/color-ramps/lib/index.d.ts +5 -2
- package/build-types/color-ramps/lib/index.d.ts.map +1 -1
- package/build-types/color-ramps/lib/register-color-spaces.d.ts +2 -0
- package/build-types/color-ramps/lib/register-color-spaces.d.ts.map +1 -0
- package/build-types/color-ramps/lib/taper-chroma.d.ts +7 -3
- package/build-types/color-ramps/lib/taper-chroma.d.ts.map +1 -1
- package/build-types/color-ramps/lib/utils.d.ts +28 -5
- package/build-types/color-ramps/lib/utils.d.ts.map +1 -1
- package/build-types/color-ramps/stories/index.story.d.ts.map +1 -1
- package/build-types/prebuilt/ts/color-tokens.d.ts +7 -0
- package/build-types/prebuilt/ts/color-tokens.d.ts.map +1 -0
- package/build-types/stories/index.story.d.ts.map +1 -1
- package/build-types/theme-provider.d.ts.map +1 -1
- package/build-types/token-id.d.ts +9 -0
- package/build-types/token-id.d.ts.map +1 -0
- package/build-types/use-theme-provider-styles.d.ts +4 -0
- package/build-types/use-theme-provider-styles.d.ts.map +1 -1
- package/docs/ds-tokens.md +22 -156
- package/package.json +19 -9
- package/src/color-ramps/index.ts +24 -41
- package/src/color-ramps/lib/color-utils.ts +34 -0
- package/src/color-ramps/lib/constants.ts +13 -9
- package/src/color-ramps/lib/default-ramps.ts +200 -0
- package/src/color-ramps/lib/find-color-with-constraints.ts +83 -116
- package/src/color-ramps/lib/index.ts +107 -145
- package/src/color-ramps/lib/ramp-configs.ts +3 -3
- package/src/color-ramps/lib/register-color-spaces.ts +13 -0
- package/src/color-ramps/lib/taper-chroma.ts +47 -19
- package/src/color-ramps/lib/utils.ts +117 -14
- package/src/color-ramps/stories/index.story.tsx +16 -22
- package/src/color-ramps/test/__snapshots__/index.test.ts.snap +45722 -376
- package/src/color-ramps/test/index.test.ts +68 -29
- package/src/prebuilt/css/design-tokens.css +88 -355
- package/src/prebuilt/js/design-tokens.js +17 -10
- package/src/prebuilt/json/figma.json +165 -783
- package/src/prebuilt/ts/color-tokens.ts +117 -0
- package/src/stories/index.story.tsx +4 -18
- package/src/test/token-id.test.ts +12 -0
- package/src/token-id.ts +9 -0
- package/src/use-theme-provider-styles.ts +67 -60
- package/terrazzo.config.ts +15 -12
- package/tokens/color.json +221 -69
- package/tokens/dimension.json +75 -0
- package/tsconfig.bin.json +13 -0
- package/tsconfig.bin.tsbuildinfo +1 -0
- package/tsconfig.json +6 -4
- package/tsconfig.src.json +9 -0
- package/tsconfig.src.tsbuildinfo +1 -0
- package/bin/build-tokens.js +0 -83
- package/build/color-ramps/lib/cache-utils.js +0 -57
- package/build/color-ramps/lib/cache-utils.js.map +0 -7
- package/build/prebuilt/ts/design-tokens.js +0 -354
- package/build/prebuilt/ts/design-tokens.js.map +0 -7
- package/build/style.module.css.js +0 -2
- package/build-module/color-ramps/lib/cache-utils.js +0 -31
- package/build-module/color-ramps/lib/cache-utils.js.map +0 -7
- package/build-module/prebuilt/ts/design-tokens.js +0 -334
- package/build-module/prebuilt/ts/design-tokens.js.map +0 -7
- package/build-module/style.module.css.js +0 -1
- package/build-style/style.css +0 -3
- package/build-types/color-ramps/lib/cache-utils.d.ts +0 -22
- package/build-types/color-ramps/lib/cache-utils.d.ts.map +0 -1
- package/build-types/prebuilt/ts/design-tokens.d.ts +0 -7
- package/build-types/prebuilt/ts/design-tokens.d.ts.map +0 -1
- package/src/color-ramps/lib/cache-utils.ts +0 -56
- package/src/prebuilt/ts/design-tokens.ts +0 -335
- package/tokens/spacing.json +0 -45
- package/tsconfig.tsbuildinfo +0 -1
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to2, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to2, key) && key !== except)
|
|
13
|
+
__defProp(to2, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to2;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// packages/theme/src/color-ramps/lib/color-utils.ts
|
|
20
|
+
var color_utils_exports = {};
|
|
21
|
+
__export(color_utils_exports, {
|
|
22
|
+
getColorString: () => getColorString,
|
|
23
|
+
getContrast: () => getContrast
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(color_utils_exports);
|
|
26
|
+
var import_fn = require("colorjs.io/fn");
|
|
27
|
+
var import_register_color_spaces = require("./register-color-spaces");
|
|
28
|
+
function getColorString(color) {
|
|
29
|
+
return (0, import_fn.serialize)((0, import_fn.to)(color, import_fn.sRGB), { format: "hex", inGamut: true });
|
|
30
|
+
}
|
|
31
|
+
function getContrast(colorA, colorB) {
|
|
32
|
+
return (0, import_fn.contrastWCAG21)(colorA, colorB);
|
|
33
|
+
}
|
|
34
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
35
|
+
0 && (module.exports = {
|
|
36
|
+
getColorString,
|
|
37
|
+
getContrast
|
|
38
|
+
});
|
|
39
|
+
//# sourceMappingURL=color-utils.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/color-ramps/lib/color-utils.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport {\n\tto,\n\tserialize,\n\tcontrastWCAG21,\n\tsRGB,\n\ttype ColorTypes,\n} from 'colorjs.io/fn';\n\n/**\n * Internal dependencies\n */\nimport './register-color-spaces';\n\n/**\n * Get string representation of a color\n * @param color Color object to stringify\n * @return String representation\n */\nexport function getColorString( color: ColorTypes ): string {\n\treturn serialize( to( color, sRGB ), { format: 'hex', inGamut: true } );\n}\n\n/**\n * Get contrast value between two colors\n * @param colorA First color\n * @param colorB Second color\n * @return WCAG 2.1 contrast ratio\n */\nexport function getContrast( colorA: ColorTypes, colorB: ColorTypes ): number {\n\treturn contrastWCAG21( colorA, colorB );\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,gBAMO;AAKP,mCAAO;AAOA,SAAS,eAAgB,OAA4B;AAC3D,aAAO,yBAAW,cAAI,OAAO,cAAK,GAAG,EAAE,QAAQ,OAAO,SAAS,KAAK,CAAE;AACvE;AAQO,SAAS,YAAa,QAAoB,QAA6B;AAC7E,aAAO,0BAAgB,QAAQ,MAAO;AACvC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,56 +1,48 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
1
|
var __defProp = Object.defineProperty;
|
|
4
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
5
|
var __export = (target, all) => {
|
|
9
6
|
for (var name in all)
|
|
10
7
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
8
|
};
|
|
12
|
-
var __copyProps = (
|
|
9
|
+
var __copyProps = (to2, from, except, desc) => {
|
|
13
10
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
11
|
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(
|
|
16
|
-
__defProp(
|
|
12
|
+
if (!__hasOwnProp.call(to2, key) && key !== except)
|
|
13
|
+
__defProp(to2, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
14
|
}
|
|
18
|
-
return
|
|
15
|
+
return to2;
|
|
19
16
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// packages/theme/src/color-ramps/lib/constants.ts
|
|
29
20
|
var constants_exports = {};
|
|
30
21
|
__export(constants_exports, {
|
|
31
22
|
ACCENT_SCALE_BASE_LIGHTNESS_THRESHOLDS: () => ACCENT_SCALE_BASE_LIGHTNESS_THRESHOLDS,
|
|
32
23
|
BLACK: () => BLACK,
|
|
33
24
|
CONTRAST_COMBINATIONS: () => CONTRAST_COMBINATIONS,
|
|
25
|
+
CONTRAST_EPSILON: () => CONTRAST_EPSILON,
|
|
34
26
|
DEFAULT_SEED_COLORS: () => DEFAULT_SEED_COLORS,
|
|
35
|
-
LIGHTNESS_EPSILON: () => LIGHTNESS_EPSILON,
|
|
36
27
|
MAX_BISECTION_ITERATIONS: () => MAX_BISECTION_ITERATIONS,
|
|
37
28
|
UNIVERSAL_CONTRAST_TOPUP: () => UNIVERSAL_CONTRAST_TOPUP,
|
|
38
29
|
WHITE: () => WHITE,
|
|
39
30
|
WHITE_TEXT_CONTRAST_MARGIN: () => WHITE_TEXT_CONTRAST_MARGIN
|
|
40
31
|
});
|
|
41
32
|
module.exports = __toCommonJS(constants_exports);
|
|
42
|
-
var
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
33
|
+
var import_fn = require("colorjs.io/fn");
|
|
34
|
+
var import_register_color_spaces = require("./register-color-spaces");
|
|
35
|
+
var WHITE = (0, import_fn.to)("white", import_fn.OKLCH);
|
|
36
|
+
var BLACK = (0, import_fn.to)("black", import_fn.OKLCH);
|
|
37
|
+
var UNIVERSAL_CONTRAST_TOPUP = 0.012;
|
|
38
|
+
var WHITE_TEXT_CONTRAST_MARGIN = 3.1;
|
|
39
|
+
var ACCENT_SCALE_BASE_LIGHTNESS_THRESHOLDS = {
|
|
48
40
|
lighter: { min: 0.2, max: 0.4 },
|
|
49
41
|
darker: { min: 0.75, max: 0.98 }
|
|
50
42
|
};
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
43
|
+
var CONTRAST_EPSILON = 4e-3;
|
|
44
|
+
var MAX_BISECTION_ITERATIONS = 10;
|
|
45
|
+
var CONTRAST_COMBINATIONS = [
|
|
54
46
|
{
|
|
55
47
|
bgs: ["surface1", "surface2", "surface3"],
|
|
56
48
|
fgs: ["fgSurface3", "fgSurface4"],
|
|
@@ -82,11 +74,12 @@ const CONTRAST_COMBINATIONS = [
|
|
|
82
74
|
target: 3
|
|
83
75
|
}
|
|
84
76
|
];
|
|
85
|
-
|
|
77
|
+
var DEFAULT_SEED_COLORS = {
|
|
86
78
|
bg: "#f8f8f8",
|
|
87
79
|
primary: "#3858e9",
|
|
88
80
|
info: "#0090ff",
|
|
89
81
|
success: "#4ab866",
|
|
82
|
+
caution: "#f0d149",
|
|
90
83
|
warning: "#f0b849",
|
|
91
84
|
error: "#cc1818"
|
|
92
85
|
};
|
|
@@ -95,8 +88,8 @@ const DEFAULT_SEED_COLORS = {
|
|
|
95
88
|
ACCENT_SCALE_BASE_LIGHTNESS_THRESHOLDS,
|
|
96
89
|
BLACK,
|
|
97
90
|
CONTRAST_COMBINATIONS,
|
|
91
|
+
CONTRAST_EPSILON,
|
|
98
92
|
DEFAULT_SEED_COLORS,
|
|
99
|
-
LIGHTNESS_EPSILON,
|
|
100
93
|
MAX_BISECTION_ITERATIONS,
|
|
101
94
|
UNIVERSAL_CONTRAST_TOPUP,
|
|
102
95
|
WHITE,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/color-ramps/lib/constants.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\nimport
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": [
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport { to, OKLCH } from 'colorjs.io/fn';\n\n/**\n * Internal dependencies\n */\nimport './register-color-spaces';\nimport type { Ramp } from './types';\n\nexport const WHITE = to( 'white', OKLCH );\nexport const BLACK = to( 'black', OKLCH );\n\n// Margin added to target contrasts to counter for algorithm approximations and rounding errors.\n// - the `CONTRAST_EPSILON` value is 0.004, so the real contrast can be lower by this amount.\n// - the max contrast between adjacent RGB values is 1.016, so half of the difference (0.008) can be rounding error.\n// - the sum is 0.012: the margin we add to ensure that the target contrast is met after all the rounding.\nexport const UNIVERSAL_CONTRAST_TOPUP = 0.012;\n\n// When enabling \"lighter direction\" bias, this is the amount by which\n// black text contrast needs to be greater than white text contrast.\n// The higher the value, the stronger the preference for white text.\n// The current value has been determined empirically as the highest value\n// that won't cause the algo not to be able to correctly solve all contrasts.\nexport const WHITE_TEXT_CONTRAST_MARGIN = 3.1;\n\n// These values are used as thresholds when trying to match the background\n// ramp's lightness while calculating an accent ramp. They prevent the accent\n// scale from being pinned to lightness values in the middle of the range,\n// which would cause the algorithm to struggle to satisfy the accent scale\n// constraints and therefore produce unexpected results.\nexport const ACCENT_SCALE_BASE_LIGHTNESS_THRESHOLDS = {\n\tlighter: { min: 0.2, max: 0.4 },\n\tdarker: { min: 0.75, max: 0.98 },\n} as const;\n\n// Contrast precision we aim for. Approximately 1/256, resolution of an 8-bit number.\nexport const CONTRAST_EPSILON = 4e-3;\n\nexport const MAX_BISECTION_ITERATIONS = 10;\n\nexport const CONTRAST_COMBINATIONS: {\n\tbgs: ( keyof Ramp )[];\n\tfgs: ( keyof Ramp )[];\n\ttarget: number;\n}[] = [\n\t{\n\t\tbgs: [ 'surface1', 'surface2', 'surface3' ],\n\t\tfgs: [ 'fgSurface3', 'fgSurface4' ],\n\t\ttarget: 4.5,\n\t},\n\t{\n\t\tbgs: [ 'surface4', 'surface5' ],\n\t\tfgs: [ 'fgSurface4' ],\n\t\ttarget: 4.5,\n\t},\n\t{\n\t\tbgs: [ 'bgFill1' ],\n\t\tfgs: [ 'fgFill' ],\n\t\ttarget: 4.5,\n\t},\n\t{\n\t\tbgs: [ 'bgFillInverted1' ],\n\t\tfgs: [ 'fgFillInverted' ],\n\t\ttarget: 4.5,\n\t},\n\t{\n\t\tbgs: [ 'bgFillInverted1' ],\n\t\tfgs: [ 'fgFillInverted' ],\n\t\ttarget: 4.5,\n\t},\n\t{\n\t\tbgs: [ 'surface1', 'surface2', 'surface3' ],\n\t\tfgs: [ 'stroke3' ],\n\t\ttarget: 3,\n\t},\n];\n\n// Used when generating the DTCG tokens and the static color ramps.\nexport const DEFAULT_SEED_COLORS = {\n\tbg: '#f8f8f8',\n\tprimary: '#3858e9',\n\tinfo: '#0090ff',\n\tsuccess: '#4ab866',\n\tcaution: '#f0d149',\n\twarning: '#f0b849',\n\terror: '#cc1818',\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,gBAA0B;AAK1B,mCAAO;AAGA,IAAM,YAAQ,cAAI,SAAS,eAAM;AACjC,IAAM,YAAQ,cAAI,SAAS,eAAM;AAMjC,IAAM,2BAA2B;AAOjC,IAAM,6BAA6B;AAOnC,IAAM,yCAAyC;AAAA,EACrD,SAAS,EAAE,KAAK,KAAK,KAAK,IAAI;AAAA,EAC9B,QAAQ,EAAE,KAAK,MAAM,KAAK,KAAK;AAChC;AAGO,IAAM,mBAAmB;AAEzB,IAAM,2BAA2B;AAEjC,IAAM,wBAIP;AAAA,EACL;AAAA,IACC,KAAK,CAAE,YAAY,YAAY,UAAW;AAAA,IAC1C,KAAK,CAAE,cAAc,YAAa;AAAA,IAClC,QAAQ;AAAA,EACT;AAAA,EACA;AAAA,IACC,KAAK,CAAE,YAAY,UAAW;AAAA,IAC9B,KAAK,CAAE,YAAa;AAAA,IACpB,QAAQ;AAAA,EACT;AAAA,EACA;AAAA,IACC,KAAK,CAAE,SAAU;AAAA,IACjB,KAAK,CAAE,QAAS;AAAA,IAChB,QAAQ;AAAA,EACT;AAAA,EACA;AAAA,IACC,KAAK,CAAE,iBAAkB;AAAA,IACzB,KAAK,CAAE,gBAAiB;AAAA,IACxB,QAAQ;AAAA,EACT;AAAA,EACA;AAAA,IACC,KAAK,CAAE,iBAAkB;AAAA,IACzB,KAAK,CAAE,gBAAiB;AAAA,IACxB,QAAQ;AAAA,EACT;AAAA,EACA;AAAA,IACC,KAAK,CAAE,YAAY,YAAY,UAAW;AAAA,IAC1C,KAAK,CAAE,SAAU;AAAA,IACjB,QAAQ;AAAA,EACT;AACD;AAGO,IAAM,sBAAsB;AAAA,EAClC,IAAI;AAAA,EACJ,SAAS;AAAA,EACT,MAAM;AAAA,EACN,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,OAAO;AACR;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// packages/theme/src/color-ramps/lib/default-ramps.ts
|
|
20
|
+
var default_ramps_exports = {};
|
|
21
|
+
__export(default_ramps_exports, {
|
|
22
|
+
DEFAULT_RAMPS: () => DEFAULT_RAMPS
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(default_ramps_exports);
|
|
25
|
+
var DEFAULT_RAMPS = {
|
|
26
|
+
bg: {
|
|
27
|
+
ramp: {
|
|
28
|
+
surface2: { color: "#f8f8f8", warning: false },
|
|
29
|
+
bgFill1: { color: "#555", warning: false },
|
|
30
|
+
fgFill: { color: "#f0f0f0", warning: false },
|
|
31
|
+
bgFill2: { color: "#494949", warning: false },
|
|
32
|
+
surface6: { color: "#d3d3d3", warning: false },
|
|
33
|
+
surface5: { color: "#e3e3e3", warning: false },
|
|
34
|
+
surface4: { color: "#eaeaea", warning: false },
|
|
35
|
+
surface3: { color: "#fff", warning: false },
|
|
36
|
+
fgSurface4: { color: "#1e1e1e", warning: false },
|
|
37
|
+
fgSurface3: { color: "#6e6e6e", warning: false },
|
|
38
|
+
fgSurface2: { color: "#8b8b8b", warning: false },
|
|
39
|
+
fgSurface1: { color: "#ababab", warning: false },
|
|
40
|
+
stroke3: { color: "#8b8b8b", warning: false },
|
|
41
|
+
stroke4: { color: "#6d6d6d", warning: false },
|
|
42
|
+
stroke2: { color: "#adadad", warning: false },
|
|
43
|
+
stroke1: { color: "#cfcfcf", warning: false },
|
|
44
|
+
bgFillDark: { color: "#1e1e1e", warning: false },
|
|
45
|
+
fgFillDark: { color: "#f0f0f0", warning: false },
|
|
46
|
+
bgFillInverted2: { color: "#1e1e1e", warning: false },
|
|
47
|
+
bgFillInverted1: { color: "#2d2d2d", warning: false },
|
|
48
|
+
fgFillInverted: { color: "#f0f0f0", warning: false },
|
|
49
|
+
surface1: { color: "#f0f0f0", warning: false }
|
|
50
|
+
},
|
|
51
|
+
direction: "darker"
|
|
52
|
+
},
|
|
53
|
+
primary: {
|
|
54
|
+
ramp: {
|
|
55
|
+
bgFill1: { color: "#3858e9", warning: false },
|
|
56
|
+
fgFill: { color: "#eff0f2", warning: false },
|
|
57
|
+
bgFill2: { color: "#2e49da", warning: false },
|
|
58
|
+
surface2: { color: "#f6f8fc", warning: false },
|
|
59
|
+
surface6: { color: "#c7d3ef", warning: false },
|
|
60
|
+
surface5: { color: "#dce3f5", warning: false },
|
|
61
|
+
surface4: { color: "#e5ebf7", warning: false },
|
|
62
|
+
surface3: { color: "#fff", warning: false },
|
|
63
|
+
fgSurface4: { color: "#080071", warning: false },
|
|
64
|
+
fgSurface3: { color: "#3858e9", warning: false },
|
|
65
|
+
fgSurface2: { color: "#5881ff", warning: false },
|
|
66
|
+
fgSurface1: { color: "#84a9ff", warning: false },
|
|
67
|
+
stroke3: { color: "#3858e9", warning: false },
|
|
68
|
+
stroke4: { color: "#2337c8", warning: false },
|
|
69
|
+
stroke2: { color: "#6d83bf", warning: false },
|
|
70
|
+
stroke1: { color: "#91a2cf", warning: false },
|
|
71
|
+
bgFillDark: { color: "#1b1e26", warning: false },
|
|
72
|
+
fgFillDark: { color: "#eff0f2", warning: false },
|
|
73
|
+
bgFillInverted2: { color: "#1b1e26", warning: false },
|
|
74
|
+
bgFillInverted1: { color: "#12009f", warning: false },
|
|
75
|
+
fgFillInverted: { color: "#eff0f2", warning: false },
|
|
76
|
+
surface1: { color: "#edf0fa", warning: false }
|
|
77
|
+
},
|
|
78
|
+
direction: "darker"
|
|
79
|
+
},
|
|
80
|
+
info: {
|
|
81
|
+
ramp: {
|
|
82
|
+
bgFill1: { color: "#0090ff", warning: false },
|
|
83
|
+
fgFill: { color: "#1b1e23", warning: false },
|
|
84
|
+
bgFill2: { color: "#0081ef", warning: false },
|
|
85
|
+
surface2: { color: "#f5f9fd", warning: false },
|
|
86
|
+
surface6: { color: "#bed6f1", warning: false },
|
|
87
|
+
surface5: { color: "#d5e5f6", warning: false },
|
|
88
|
+
surface4: { color: "#e0ebf8", warning: false },
|
|
89
|
+
surface3: { color: "#fff", warning: false },
|
|
90
|
+
fgSurface4: { color: "#001758", warning: false },
|
|
91
|
+
fgSurface3: { color: "#006dd9", warning: false },
|
|
92
|
+
fgSurface2: { color: "#008cfb", warning: false },
|
|
93
|
+
fgSurface1: { color: "#53b1ff", warning: false },
|
|
94
|
+
stroke3: { color: "#006dd9", warning: false },
|
|
95
|
+
stroke4: { color: "#004eb8", warning: false },
|
|
96
|
+
stroke2: { color: "#5d8fc6", warning: false },
|
|
97
|
+
stroke1: { color: "#8aaed6", warning: false },
|
|
98
|
+
bgFillDark: { color: "#1b1e23", warning: false },
|
|
99
|
+
fgFillDark: { color: "#eff0f2", warning: false },
|
|
100
|
+
bgFillInverted2: { color: "#1b1e23", warning: false },
|
|
101
|
+
bgFillInverted1: { color: "#002675", warning: false },
|
|
102
|
+
fgFillInverted: { color: "#eff0f2", warning: false },
|
|
103
|
+
surface1: { color: "#eaf1fa", warning: false }
|
|
104
|
+
},
|
|
105
|
+
direction: "darker"
|
|
106
|
+
},
|
|
107
|
+
success: {
|
|
108
|
+
ramp: {
|
|
109
|
+
bgFill1: { color: "#4ab866", warning: false },
|
|
110
|
+
fgFill: { color: "#1b1f1c", warning: false },
|
|
111
|
+
bgFill2: { color: "#37a857", warning: false },
|
|
112
|
+
surface2: { color: "#f0fcf2", warning: false },
|
|
113
|
+
surface6: { color: "#7eea95", warning: false },
|
|
114
|
+
surface5: { color: "#b7f2c1", warning: false },
|
|
115
|
+
surface4: { color: "#cdf5d3", warning: false },
|
|
116
|
+
surface3: { color: "#fff", warning: false },
|
|
117
|
+
fgSurface4: { color: "#002b00", warning: false },
|
|
118
|
+
fgSurface3: { color: "#008031", warning: false },
|
|
119
|
+
fgSurface2: { color: "#2c9f4e", warning: false },
|
|
120
|
+
fgSurface1: { color: "#54c16f", warning: false },
|
|
121
|
+
stroke3: { color: "#008031", warning: false },
|
|
122
|
+
stroke4: { color: "#006314", warning: false },
|
|
123
|
+
stroke2: { color: "#61986b", warning: false },
|
|
124
|
+
stroke1: { color: "#77ba84", warning: false },
|
|
125
|
+
bgFillDark: { color: "#1b1f1c", warning: false },
|
|
126
|
+
fgFillDark: { color: "#edf2ed", warning: false },
|
|
127
|
+
bgFillInverted2: { color: "#1b1f1c", warning: false },
|
|
128
|
+
bgFillInverted1: { color: "#003800", warning: false },
|
|
129
|
+
fgFillInverted: { color: "#edf2ed", warning: false },
|
|
130
|
+
surface1: { color: "#ddf8e1", warning: false }
|
|
131
|
+
},
|
|
132
|
+
direction: "darker"
|
|
133
|
+
},
|
|
134
|
+
caution: {
|
|
135
|
+
ramp: {
|
|
136
|
+
bgFill1: { color: "#f0d149", warning: false },
|
|
137
|
+
fgFill: { color: "#1f1e1b", warning: false },
|
|
138
|
+
bgFill2: { color: "#ddbe30", warning: false },
|
|
139
|
+
surface2: { color: "#fdf9e7", warning: false },
|
|
140
|
+
surface6: { color: "#ecd367", warning: false },
|
|
141
|
+
surface5: { color: "#f5e399", warning: false },
|
|
142
|
+
surface4: { color: "#f8ebb5", warning: false },
|
|
143
|
+
surface3: { color: "#fff", warning: false },
|
|
144
|
+
fgSurface4: { color: "#291d00", warning: false },
|
|
145
|
+
fgSurface3: { color: "#876b00", warning: false },
|
|
146
|
+
fgSurface2: { color: "#a78900", warning: false },
|
|
147
|
+
fgSurface1: { color: "#c9aa00", warning: false },
|
|
148
|
+
stroke3: { color: "#876b00", warning: false },
|
|
149
|
+
stroke4: { color: "#675000", warning: false },
|
|
150
|
+
stroke2: { color: "#978c60", warning: false },
|
|
151
|
+
stroke1: { color: "#b8ab75", warning: false },
|
|
152
|
+
bgFillDark: { color: "#1f1e1b", warning: false },
|
|
153
|
+
fgFillDark: { color: "#f6f1da", warning: false },
|
|
154
|
+
bgFillInverted2: { color: "#1f1e1b", warning: false },
|
|
155
|
+
bgFillInverted1: { color: "#3a2b00", warning: false },
|
|
156
|
+
fgFillInverted: { color: "#f6f1da", warning: false },
|
|
157
|
+
surface1: { color: "#faf1cd", warning: false }
|
|
158
|
+
},
|
|
159
|
+
direction: "darker"
|
|
160
|
+
},
|
|
161
|
+
warning: {
|
|
162
|
+
ramp: {
|
|
163
|
+
bgFill1: { color: "#f0b849", warning: false },
|
|
164
|
+
fgFill: { color: "#1f1e1b", warning: false },
|
|
165
|
+
bgFill2: { color: "#dea633", warning: false },
|
|
166
|
+
surface2: { color: "#fdf7ee", warning: false },
|
|
167
|
+
surface6: { color: "#f1ce90", warning: false },
|
|
168
|
+
surface5: { color: "#f6e0bb", warning: false },
|
|
169
|
+
surface4: { color: "#f8e9cd", warning: false },
|
|
170
|
+
surface3: { color: "#fff", warning: false },
|
|
171
|
+
fgSurface4: { color: "#2f1800", warning: false },
|
|
172
|
+
fgSurface3: { color: "#976300", warning: false },
|
|
173
|
+
fgSurface2: { color: "#b78100", warning: false },
|
|
174
|
+
fgSurface1: { color: "#d9a22e", warning: false },
|
|
175
|
+
stroke3: { color: "#976300", warning: false },
|
|
176
|
+
stroke4: { color: "#754900", warning: false },
|
|
177
|
+
stroke2: { color: "#9f8860", warning: false },
|
|
178
|
+
stroke1: { color: "#c2a776", warning: false },
|
|
179
|
+
bgFillDark: { color: "#1f1e1b", warning: false },
|
|
180
|
+
fgFillDark: { color: "#f3f0e9", warning: false },
|
|
181
|
+
bgFillInverted2: { color: "#1f1e1b", warning: false },
|
|
182
|
+
bgFillInverted1: { color: "#432600", warning: false },
|
|
183
|
+
fgFillInverted: { color: "#f3f0e9", warning: false },
|
|
184
|
+
surface1: { color: "#faefdc", warning: false }
|
|
185
|
+
},
|
|
186
|
+
direction: "darker"
|
|
187
|
+
},
|
|
188
|
+
error: {
|
|
189
|
+
ramp: {
|
|
190
|
+
bgFill1: { color: "#cc1818", warning: false },
|
|
191
|
+
fgFill: { color: "#f2efef", warning: false },
|
|
192
|
+
bgFill2: { color: "#bc0001", warning: false },
|
|
193
|
+
surface2: { color: "#fdf6f5", warning: false },
|
|
194
|
+
surface6: { color: "#f5c9c2", warning: false },
|
|
195
|
+
surface5: { color: "#f9dcd8", warning: false },
|
|
196
|
+
surface4: { color: "#fae5e2", warning: false },
|
|
197
|
+
surface3: { color: "#fff", warning: false },
|
|
198
|
+
fgSurface4: { color: "#4a0000", warning: false },
|
|
199
|
+
fgSurface3: { color: "#cc1818", warning: false },
|
|
200
|
+
fgSurface2: { color: "#f84d41", warning: false },
|
|
201
|
+
fgSurface1: { color: "#ff8373", warning: false },
|
|
202
|
+
stroke3: { color: "#cc1818", warning: false },
|
|
203
|
+
stroke4: { color: "#a70000", warning: false },
|
|
204
|
+
stroke2: { color: "#ca675c", warning: false },
|
|
205
|
+
stroke1: { color: "#dc8e83", warning: false },
|
|
206
|
+
bgFillDark: { color: "#231c1b", warning: false },
|
|
207
|
+
fgFillDark: { color: "#f2efef", warning: false },
|
|
208
|
+
bgFillInverted2: { color: "#231c1b", warning: false },
|
|
209
|
+
bgFillInverted1: { color: "#680000", warning: false },
|
|
210
|
+
fgFillInverted: { color: "#f2efef", warning: false },
|
|
211
|
+
surface1: { color: "#fcedea", warning: false }
|
|
212
|
+
},
|
|
213
|
+
direction: "darker"
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
217
|
+
0 && (module.exports = {
|
|
218
|
+
DEFAULT_RAMPS
|
|
219
|
+
});
|
|
220
|
+
//# sourceMappingURL=default-ramps.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/color-ramps/lib/default-ramps.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Internal dependencies\n */\nimport type { RampResult } from './types';\nimport type { DEFAULT_SEED_COLORS } from './constants';\n\nexport const DEFAULT_RAMPS: Record<\n\tkeyof typeof DEFAULT_SEED_COLORS,\n\tRampResult\n> = {\n\tbg: {\n\t\tramp: {\n\t\t\tsurface2: { color: '#f8f8f8', warning: false },\n\t\t\tbgFill1: { color: '#555', warning: false },\n\t\t\tfgFill: { color: '#f0f0f0', warning: false },\n\t\t\tbgFill2: { color: '#494949', warning: false },\n\t\t\tsurface6: { color: '#d3d3d3', warning: false },\n\t\t\tsurface5: { color: '#e3e3e3', warning: false },\n\t\t\tsurface4: { color: '#eaeaea', warning: false },\n\t\t\tsurface3: { color: '#fff', warning: false },\n\t\t\tfgSurface4: { color: '#1e1e1e', warning: false },\n\t\t\tfgSurface3: { color: '#6e6e6e', warning: false },\n\t\t\tfgSurface2: { color: '#8b8b8b', warning: false },\n\t\t\tfgSurface1: { color: '#ababab', warning: false },\n\t\t\tstroke3: { color: '#8b8b8b', warning: false },\n\t\t\tstroke4: { color: '#6d6d6d', warning: false },\n\t\t\tstroke2: { color: '#adadad', warning: false },\n\t\t\tstroke1: { color: '#cfcfcf', warning: false },\n\t\t\tbgFillDark: { color: '#1e1e1e', warning: false },\n\t\t\tfgFillDark: { color: '#f0f0f0', warning: false },\n\t\t\tbgFillInverted2: { color: '#1e1e1e', warning: false },\n\t\t\tbgFillInverted1: { color: '#2d2d2d', warning: false },\n\t\t\tfgFillInverted: { color: '#f0f0f0', warning: false },\n\t\t\tsurface1: { color: '#f0f0f0', warning: false },\n\t\t},\n\t\tdirection: 'darker',\n\t},\n\tprimary: {\n\t\tramp: {\n\t\t\tbgFill1: { color: '#3858e9', warning: false },\n\t\t\tfgFill: { color: '#eff0f2', warning: false },\n\t\t\tbgFill2: { color: '#2e49da', warning: false },\n\t\t\tsurface2: { color: '#f6f8fc', warning: false },\n\t\t\tsurface6: { color: '#c7d3ef', warning: false },\n\t\t\tsurface5: { color: '#dce3f5', warning: false },\n\t\t\tsurface4: { color: '#e5ebf7', warning: false },\n\t\t\tsurface3: { color: '#fff', warning: false },\n\t\t\tfgSurface4: { color: '#080071', warning: false },\n\t\t\tfgSurface3: { color: '#3858e9', warning: false },\n\t\t\tfgSurface2: { color: '#5881ff', warning: false },\n\t\t\tfgSurface1: { color: '#84a9ff', warning: false },\n\t\t\tstroke3: { color: '#3858e9', warning: false },\n\t\t\tstroke4: { color: '#2337c8', warning: false },\n\t\t\tstroke2: { color: '#6d83bf', warning: false },\n\t\t\tstroke1: { color: '#91a2cf', warning: false },\n\t\t\tbgFillDark: { color: '#1b1e26', warning: false },\n\t\t\tfgFillDark: { color: '#eff0f2', warning: false },\n\t\t\tbgFillInverted2: { color: '#1b1e26', warning: false },\n\t\t\tbgFillInverted1: { color: '#12009f', warning: false },\n\t\t\tfgFillInverted: { color: '#eff0f2', warning: false },\n\t\t\tsurface1: { color: '#edf0fa', warning: false },\n\t\t},\n\t\tdirection: 'darker',\n\t},\n\tinfo: {\n\t\tramp: {\n\t\t\tbgFill1: { color: '#0090ff', warning: false },\n\t\t\tfgFill: { color: '#1b1e23', warning: false },\n\t\t\tbgFill2: { color: '#0081ef', warning: false },\n\t\t\tsurface2: { color: '#f5f9fd', warning: false },\n\t\t\tsurface6: { color: '#bed6f1', warning: false },\n\t\t\tsurface5: { color: '#d5e5f6', warning: false },\n\t\t\tsurface4: { color: '#e0ebf8', warning: false },\n\t\t\tsurface3: { color: '#fff', warning: false },\n\t\t\tfgSurface4: { color: '#001758', warning: false },\n\t\t\tfgSurface3: { color: '#006dd9', warning: false },\n\t\t\tfgSurface2: { color: '#008cfb', warning: false },\n\t\t\tfgSurface1: { color: '#53b1ff', warning: false },\n\t\t\tstroke3: { color: '#006dd9', warning: false },\n\t\t\tstroke4: { color: '#004eb8', warning: false },\n\t\t\tstroke2: { color: '#5d8fc6', warning: false },\n\t\t\tstroke1: { color: '#8aaed6', warning: false },\n\t\t\tbgFillDark: { color: '#1b1e23', warning: false },\n\t\t\tfgFillDark: { color: '#eff0f2', warning: false },\n\t\t\tbgFillInverted2: { color: '#1b1e23', warning: false },\n\t\t\tbgFillInverted1: { color: '#002675', warning: false },\n\t\t\tfgFillInverted: { color: '#eff0f2', warning: false },\n\t\t\tsurface1: { color: '#eaf1fa', warning: false },\n\t\t},\n\t\tdirection: 'darker',\n\t},\n\tsuccess: {\n\t\tramp: {\n\t\t\tbgFill1: { color: '#4ab866', warning: false },\n\t\t\tfgFill: { color: '#1b1f1c', warning: false },\n\t\t\tbgFill2: { color: '#37a857', warning: false },\n\t\t\tsurface2: { color: '#f0fcf2', warning: false },\n\t\t\tsurface6: { color: '#7eea95', warning: false },\n\t\t\tsurface5: { color: '#b7f2c1', warning: false },\n\t\t\tsurface4: { color: '#cdf5d3', warning: false },\n\t\t\tsurface3: { color: '#fff', warning: false },\n\t\t\tfgSurface4: { color: '#002b00', warning: false },\n\t\t\tfgSurface3: { color: '#008031', warning: false },\n\t\t\tfgSurface2: { color: '#2c9f4e', warning: false },\n\t\t\tfgSurface1: { color: '#54c16f', warning: false },\n\t\t\tstroke3: { color: '#008031', warning: false },\n\t\t\tstroke4: { color: '#006314', warning: false },\n\t\t\tstroke2: { color: '#61986b', warning: false },\n\t\t\tstroke1: { color: '#77ba84', warning: false },\n\t\t\tbgFillDark: { color: '#1b1f1c', warning: false },\n\t\t\tfgFillDark: { color: '#edf2ed', warning: false },\n\t\t\tbgFillInverted2: { color: '#1b1f1c', warning: false },\n\t\t\tbgFillInverted1: { color: '#003800', warning: false },\n\t\t\tfgFillInverted: { color: '#edf2ed', warning: false },\n\t\t\tsurface1: { color: '#ddf8e1', warning: false },\n\t\t},\n\t\tdirection: 'darker',\n\t},\n\tcaution: {\n\t\tramp: {\n\t\t\tbgFill1: { color: '#f0d149', warning: false },\n\t\t\tfgFill: { color: '#1f1e1b', warning: false },\n\t\t\tbgFill2: { color: '#ddbe30', warning: false },\n\t\t\tsurface2: { color: '#fdf9e7', warning: false },\n\t\t\tsurface6: { color: '#ecd367', warning: false },\n\t\t\tsurface5: { color: '#f5e399', warning: false },\n\t\t\tsurface4: { color: '#f8ebb5', warning: false },\n\t\t\tsurface3: { color: '#fff', warning: false },\n\t\t\tfgSurface4: { color: '#291d00', warning: false },\n\t\t\tfgSurface3: { color: '#876b00', warning: false },\n\t\t\tfgSurface2: { color: '#a78900', warning: false },\n\t\t\tfgSurface1: { color: '#c9aa00', warning: false },\n\t\t\tstroke3: { color: '#876b00', warning: false },\n\t\t\tstroke4: { color: '#675000', warning: false },\n\t\t\tstroke2: { color: '#978c60', warning: false },\n\t\t\tstroke1: { color: '#b8ab75', warning: false },\n\t\t\tbgFillDark: { color: '#1f1e1b', warning: false },\n\t\t\tfgFillDark: { color: '#f6f1da', warning: false },\n\t\t\tbgFillInverted2: { color: '#1f1e1b', warning: false },\n\t\t\tbgFillInverted1: { color: '#3a2b00', warning: false },\n\t\t\tfgFillInverted: { color: '#f6f1da', warning: false },\n\t\t\tsurface1: { color: '#faf1cd', warning: false },\n\t\t},\n\t\tdirection: 'darker',\n\t},\n\twarning: {\n\t\tramp: {\n\t\t\tbgFill1: { color: '#f0b849', warning: false },\n\t\t\tfgFill: { color: '#1f1e1b', warning: false },\n\t\t\tbgFill2: { color: '#dea633', warning: false },\n\t\t\tsurface2: { color: '#fdf7ee', warning: false },\n\t\t\tsurface6: { color: '#f1ce90', warning: false },\n\t\t\tsurface5: { color: '#f6e0bb', warning: false },\n\t\t\tsurface4: { color: '#f8e9cd', warning: false },\n\t\t\tsurface3: { color: '#fff', warning: false },\n\t\t\tfgSurface4: { color: '#2f1800', warning: false },\n\t\t\tfgSurface3: { color: '#976300', warning: false },\n\t\t\tfgSurface2: { color: '#b78100', warning: false },\n\t\t\tfgSurface1: { color: '#d9a22e', warning: false },\n\t\t\tstroke3: { color: '#976300', warning: false },\n\t\t\tstroke4: { color: '#754900', warning: false },\n\t\t\tstroke2: { color: '#9f8860', warning: false },\n\t\t\tstroke1: { color: '#c2a776', warning: false },\n\t\t\tbgFillDark: { color: '#1f1e1b', warning: false },\n\t\t\tfgFillDark: { color: '#f3f0e9', warning: false },\n\t\t\tbgFillInverted2: { color: '#1f1e1b', warning: false },\n\t\t\tbgFillInverted1: { color: '#432600', warning: false },\n\t\t\tfgFillInverted: { color: '#f3f0e9', warning: false },\n\t\t\tsurface1: { color: '#faefdc', warning: false },\n\t\t},\n\t\tdirection: 'darker',\n\t},\n\terror: {\n\t\tramp: {\n\t\t\tbgFill1: { color: '#cc1818', warning: false },\n\t\t\tfgFill: { color: '#f2efef', warning: false },\n\t\t\tbgFill2: { color: '#bc0001', warning: false },\n\t\t\tsurface2: { color: '#fdf6f5', warning: false },\n\t\t\tsurface6: { color: '#f5c9c2', warning: false },\n\t\t\tsurface5: { color: '#f9dcd8', warning: false },\n\t\t\tsurface4: { color: '#fae5e2', warning: false },\n\t\t\tsurface3: { color: '#fff', warning: false },\n\t\t\tfgSurface4: { color: '#4a0000', warning: false },\n\t\t\tfgSurface3: { color: '#cc1818', warning: false },\n\t\t\tfgSurface2: { color: '#f84d41', warning: false },\n\t\t\tfgSurface1: { color: '#ff8373', warning: false },\n\t\t\tstroke3: { color: '#cc1818', warning: false },\n\t\t\tstroke4: { color: '#a70000', warning: false },\n\t\t\tstroke2: { color: '#ca675c', warning: false },\n\t\t\tstroke1: { color: '#dc8e83', warning: false },\n\t\t\tbgFillDark: { color: '#231c1b', warning: false },\n\t\t\tfgFillDark: { color: '#f2efef', warning: false },\n\t\t\tbgFillInverted2: { color: '#231c1b', warning: false },\n\t\t\tbgFillInverted1: { color: '#680000', warning: false },\n\t\t\tfgFillInverted: { color: '#f2efef', warning: false },\n\t\t\tsurface1: { color: '#fcedea', warning: false },\n\t\t},\n\t\tdirection: 'darker',\n\t},\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAMO,IAAM,gBAGT;AAAA,EACH,IAAI;AAAA,IACH,MAAM;AAAA,MACL,UAAU,EAAE,OAAO,WAAW,SAAS,MAAM;AAAA,MAC7C,SAAS,EAAE,OAAO,QAAQ,SAAS,MAAM;AAAA,MACzC,QAAQ,EAAE,OAAO,WAAW,SAAS,MAAM;AAAA,MAC3C,SAAS,EAAE,OAAO,WAAW,SAAS,MAAM;AAAA,MAC5C,UAAU,EAAE,OAAO,WAAW,SAAS,MAAM;AAAA,MAC7C,UAAU,EAAE,OAAO,WAAW,SAAS,MAAM;AAAA,MAC7C,UAAU,EAAE,OAAO,WAAW,SAAS,MAAM;AAAA,MAC7C,UAAU,EAAE,OAAO,QAAQ,SAAS,MAAM;AAAA,MAC1C,YAAY,E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,WAAW,SAAS,MAAM;AAAA,MAC/C,YAAY,EAAE,OAAO,WAAW,SAAS,MAAM;AAAA,MAC/C,iBAAiB,EAAE,OAAO,WAAW,SAAS,MAAM;AAAA,MACpD,iBAAiB,EAAE,OAAO,WAAW,SAAS,MAAM;AAAA,MACpD,gBAAgB,EAAE,OAAO,WAAW,SAAS,MAAM;AAAA,MACnD,UAAU,EAAE,OAAO,WAAW,SAAS,MAAM;AAAA,IAC9C;AAAA,IACA,WAAW;AAAA,EACZ;AACD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
1
|
var __defProp = Object.defineProperty;
|
|
4
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
5
|
var __export = (target, all) => {
|
|
9
6
|
for (var name in all)
|
|
@@ -17,121 +14,93 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
14
|
}
|
|
18
15
|
return to;
|
|
19
16
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// packages/theme/src/color-ramps/lib/find-color-with-constraints.ts
|
|
29
20
|
var find_color_with_constraints_exports = {};
|
|
30
21
|
__export(find_color_with_constraints_exports, {
|
|
31
22
|
findColorMeetingRequirements: () => findColorMeetingRequirements
|
|
32
23
|
});
|
|
33
24
|
module.exports = __toCommonJS(find_color_with_constraints_exports);
|
|
34
|
-
var
|
|
25
|
+
var import_fn = require("colorjs.io/fn");
|
|
26
|
+
var import_register_color_spaces = require("./register-color-spaces");
|
|
35
27
|
var import_utils = require("./utils");
|
|
36
28
|
var import_constants = require("./constants");
|
|
37
|
-
var
|
|
29
|
+
var import_color_utils = require("./color-utils");
|
|
38
30
|
var import_taper_chroma = require("./taper-chroma");
|
|
31
|
+
function cdiff(c1, c2) {
|
|
32
|
+
return Math.log(c1 / c2);
|
|
33
|
+
}
|
|
39
34
|
function findColorMeetingRequirements(reference, seed, target, direction, {
|
|
40
35
|
lightnessConstraint,
|
|
41
|
-
taperChromaOptions
|
|
42
|
-
strict = true,
|
|
43
|
-
debug = false
|
|
36
|
+
taperChromaOptions
|
|
44
37
|
} = {}) {
|
|
45
38
|
if (target <= 1) {
|
|
46
|
-
return {
|
|
39
|
+
return {
|
|
40
|
+
color: reference,
|
|
41
|
+
reached: true,
|
|
42
|
+
achieved: 1
|
|
43
|
+
};
|
|
47
44
|
}
|
|
48
|
-
|
|
49
|
-
let newL =
|
|
50
|
-
let newC = seed.
|
|
45
|
+
function getColorForL(l) {
|
|
46
|
+
let newL = l;
|
|
47
|
+
let newC = (0, import_fn.get)(seed, [import_fn.OKLCH, "c"]);
|
|
51
48
|
if (taperChromaOptions) {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
newL
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
new import_colorjs.default("oklch", [newL, newC, seed.oklch.h])
|
|
60
|
-
);
|
|
61
|
-
const exactLContrast = (0, import_cache_utils.getCachedContrast)(reference, colorWithExactL);
|
|
62
|
-
if (debug) {
|
|
63
|
-
console.log(
|
|
64
|
-
`Succeeded with ${lightnessConstraint.type} lightness`,
|
|
65
|
-
lightnessConstraint.value,
|
|
66
|
-
colorWithExactL.oklch.l
|
|
67
|
-
);
|
|
49
|
+
const tapered = (0, import_taper_chroma.taperChroma)(seed, newL, taperChromaOptions);
|
|
50
|
+
if ("l" in tapered && "c" in tapered) {
|
|
51
|
+
newL = tapered.l;
|
|
52
|
+
newC = tapered.c;
|
|
53
|
+
} else {
|
|
54
|
+
return tapered;
|
|
55
|
+
}
|
|
68
56
|
}
|
|
69
|
-
|
|
57
|
+
return (0, import_utils.clampToGamut)({
|
|
58
|
+
spaceId: "oklch",
|
|
59
|
+
coords: [newL, newC, (0, import_fn.get)(seed, [import_fn.OKLCH, "h"])]
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
const mostContrastingL = direction === "lighter" ? 1 : 0;
|
|
63
|
+
const mostContrastingColor = direction === "lighter" ? import_constants.WHITE : import_constants.BLACK;
|
|
64
|
+
const highestContrast = (0, import_color_utils.getContrast)(reference, mostContrastingColor);
|
|
65
|
+
if (lightnessConstraint) {
|
|
66
|
+
const colorWithExactL = getColorForL(lightnessConstraint.value);
|
|
67
|
+
const exactLContrast = (0, import_color_utils.getContrast)(reference, colorWithExactL);
|
|
68
|
+
const exactLContrastMeetsTarget = cdiff(exactLContrast, target) >= -import_constants.CONTRAST_EPSILON;
|
|
69
|
+
if (exactLContrastMeetsTarget || lightnessConstraint.type === "force") {
|
|
70
70
|
return {
|
|
71
71
|
color: colorWithExactL,
|
|
72
|
-
reached:
|
|
73
|
-
achieved: exactLContrast
|
|
72
|
+
reached: exactLContrastMeetsTarget,
|
|
73
|
+
achieved: exactLContrast,
|
|
74
|
+
deficit: exactLContrastMeetsTarget ? cdiff(exactLContrast, highestContrast) : cdiff(target, exactLContrast)
|
|
74
75
|
};
|
|
75
76
|
}
|
|
76
77
|
}
|
|
77
|
-
|
|
78
|
-
const mostContrastingColor = direction === "lighter" ? import_constants.WHITE : import_constants.BLACK;
|
|
79
|
-
const highestPossibleContrast = (0, import_cache_utils.getCachedContrast)(
|
|
80
|
-
reference,
|
|
81
|
-
mostContrastingColor
|
|
82
|
-
);
|
|
83
|
-
if (highestPossibleContrast < target) {
|
|
84
|
-
if (strict) {
|
|
85
|
-
throw new Error(
|
|
86
|
-
`Contrast target ${target.toFixed(
|
|
87
|
-
2
|
|
88
|
-
)}:1 unreachable in ${direction} direction against ${mostContrastingColor.toString()}(boundary achieves ${highestPossibleContrast.toFixed(
|
|
89
|
-
3
|
|
90
|
-
)}:1).`
|
|
91
|
-
);
|
|
92
|
-
}
|
|
93
|
-
if (debug) {
|
|
94
|
-
console.log(
|
|
95
|
-
"Did not succeeded because it reached the limit",
|
|
96
|
-
mostContrastingL
|
|
97
|
-
);
|
|
98
|
-
}
|
|
78
|
+
if (cdiff(highestContrast, target) <= import_constants.CONTRAST_EPSILON) {
|
|
99
79
|
return {
|
|
100
80
|
color: mostContrastingColor,
|
|
101
|
-
reached:
|
|
102
|
-
achieved:
|
|
81
|
+
reached: cdiff(highestContrast, target) >= -import_constants.CONTRAST_EPSILON,
|
|
82
|
+
achieved: highestContrast,
|
|
83
|
+
deficit: cdiff(target, highestContrast)
|
|
103
84
|
};
|
|
104
85
|
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
));
|
|
118
|
-
}
|
|
119
|
-
const newColor = (0, import_utils.clampToGamut)(
|
|
120
|
-
new import_colorjs.default("oklch", [newL, newC, seed.oklch.h])
|
|
121
|
-
);
|
|
122
|
-
const newContrast = (0, import_cache_utils.getCachedContrast)(reference, newColor);
|
|
123
|
-
if (newContrast >= target) {
|
|
124
|
-
betterL = newL;
|
|
125
|
-
bestContrastFound = newContrast;
|
|
126
|
-
resultingColor = newColor;
|
|
127
|
-
} else {
|
|
128
|
-
worseL = newL;
|
|
129
|
-
}
|
|
130
|
-
}
|
|
86
|
+
const lowerL = (0, import_fn.get)(reference, [import_fn.OKLCH, "l"]);
|
|
87
|
+
const lowerContrast = cdiff(1, target);
|
|
88
|
+
const upperL = mostContrastingL;
|
|
89
|
+
const upperContrast = cdiff(highestContrast, target);
|
|
90
|
+
const bestColor = (0, import_utils.solveWithBisect)(
|
|
91
|
+
getColorForL,
|
|
92
|
+
(c) => cdiff((0, import_color_utils.getContrast)(reference, c), target),
|
|
93
|
+
lowerL,
|
|
94
|
+
lowerContrast,
|
|
95
|
+
upperL,
|
|
96
|
+
upperContrast
|
|
97
|
+
);
|
|
131
98
|
return {
|
|
132
|
-
color:
|
|
99
|
+
color: bestColor,
|
|
133
100
|
reached: true,
|
|
134
|
-
achieved:
|
|
101
|
+
achieved: target,
|
|
102
|
+
// Negative number that specifies how much room we have.
|
|
103
|
+
deficit: cdiff(target, highestContrast)
|
|
135
104
|
};
|
|
136
105
|
}
|
|
137
106
|
// Annotate the CommonJS export names for ESM import in node:
|