@tamagui/create-theme 1.61.3 → 1.62.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.
Files changed (54) hide show
  1. package/dist/cjs/applyMask.js +13 -25
  2. package/dist/cjs/applyMask.js.map +1 -1
  3. package/dist/cjs/applyMask.native.js +61 -0
  4. package/dist/cjs/applyMask.native.js.map +6 -0
  5. package/dist/cjs/combineMasks.js +24 -38
  6. package/dist/cjs/combineMasks.js.map +1 -1
  7. package/dist/cjs/combineMasks.native.js +45 -0
  8. package/dist/cjs/combineMasks.native.js.map +6 -0
  9. package/dist/cjs/createTheme.js +15 -33
  10. package/dist/cjs/createTheme.js.map +1 -1
  11. package/dist/cjs/createTheme.native.js +56 -0
  12. package/dist/cjs/createTheme.native.js.map +6 -0
  13. package/dist/cjs/createThemeTypes.js +3 -6
  14. package/dist/cjs/createThemeTypes.js.map +1 -1
  15. package/dist/cjs/createThemeTypes.native.js +15 -0
  16. package/dist/cjs/createThemeTypes.native.js.map +6 -0
  17. package/dist/cjs/helpers.js +5 -9
  18. package/dist/cjs/helpers.js.map +1 -1
  19. package/dist/cjs/helpers.native.js +36 -0
  20. package/dist/cjs/helpers.native.js.map +6 -0
  21. package/dist/cjs/index.js +4 -8
  22. package/dist/cjs/index.js.map +1 -1
  23. package/dist/cjs/index.native.js +30 -0
  24. package/dist/cjs/index.native.js.map +6 -0
  25. package/dist/cjs/isMinusZero.js +6 -10
  26. package/dist/cjs/isMinusZero.js.map +1 -1
  27. package/dist/cjs/isMinusZero.native.js +28 -0
  28. package/dist/cjs/isMinusZero.native.js.map +6 -0
  29. package/dist/cjs/masks.js +45 -78
  30. package/dist/cjs/masks.js.map +1 -1
  31. package/dist/cjs/masks.native.js +100 -0
  32. package/dist/cjs/masks.native.js.map +6 -0
  33. package/dist/cjs/tests.js +10 -25
  34. package/dist/cjs/tests.js.map +1 -1
  35. package/dist/cjs/tests.native.js +17 -0
  36. package/dist/cjs/tests.native.js.map +6 -0
  37. package/dist/cjs/themeInfo.js +7 -16
  38. package/dist/cjs/themeInfo.js.map +1 -1
  39. package/dist/cjs/themeInfo.native.js +34 -0
  40. package/dist/cjs/themeInfo.native.js.map +6 -0
  41. package/dist/esm/applyMask.js +7 -14
  42. package/dist/esm/applyMask.js.map +1 -1
  43. package/dist/esm/combineMasks.js +18 -27
  44. package/dist/esm/combineMasks.js.map +1 -1
  45. package/dist/esm/createTheme.js +9 -22
  46. package/dist/esm/createTheme.js.map +1 -1
  47. package/dist/esm/isMinusZero.js +1 -1
  48. package/dist/esm/masks.js +39 -67
  49. package/dist/esm/masks.js.map +1 -1
  50. package/dist/esm/tests.js +9 -21
  51. package/dist/esm/tests.js.map +1 -1
  52. package/dist/esm/themeInfo.js +2 -7
  53. package/dist/esm/themeInfo.js.map +1 -1
  54. package/package.json +3 -3
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from == "object" || typeof from == "function")
8
+ for (let key of __getOwnPropNames(from))
9
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
+ return to;
11
+ }, __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
12
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
13
+ var src_exports = {};
14
+ module.exports = __toCommonJS(src_exports);
15
+ __reExport(src_exports, require("./createTheme"), module.exports);
16
+ __reExport(src_exports, require("./masks"), module.exports);
17
+ __reExport(src_exports, require("./combineMasks"), module.exports);
18
+ __reExport(src_exports, require("./applyMask"), module.exports);
19
+ __reExport(src_exports, require("./createThemeTypes"), module.exports);
20
+ __reExport(src_exports, require("./helpers"), module.exports);
21
+ // Annotate the CommonJS export names for ESM import in node:
22
+ 0 && (module.exports = {
23
+ ...require("./createTheme"),
24
+ ...require("./masks"),
25
+ ...require("./combineMasks"),
26
+ ...require("./applyMask"),
27
+ ...require("./createThemeTypes"),
28
+ ...require("./helpers")
29
+ });
30
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/index.tsx"],
4
+ "mappings": ";;;;;;;;;;;;AAAA;AAAA;AAAA,wBAAc,0BAAd;AACA,wBAAc,oBADd;AAEA,wBAAc,2BAFd;AAGA,wBAAc,wBAHd;AAIA,wBAAc,+BAJd;AAKA,wBAAc,sBALd;",
5
+ "names": []
6
+ }
@@ -1,28 +1,24 @@
1
- "use strict";
2
1
  var __defProp = Object.defineProperty;
3
2
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
5
  var __export = (target, all) => {
7
6
  for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
7
+ __defProp(target, name, { get: all[name], enumerable: !0 });
8
+ }, __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from == "object" || typeof from == "function")
12
10
  for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
11
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
12
  return to;
17
13
  };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
19
15
  var isMinusZero_exports = {};
20
16
  __export(isMinusZero_exports, {
21
17
  isMinusZero: () => isMinusZero
22
18
  });
23
19
  module.exports = __toCommonJS(isMinusZero_exports);
24
20
  function isMinusZero(value) {
25
- return 1 / value === -Infinity;
21
+ return 1 / value === -1 / 0;
26
22
  }
27
23
  // Annotate the CommonJS export names for ESM import in node:
28
24
  0 && (module.exports = {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/isMinusZero.tsx"],
4
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,SAAS,YAAY,OAAe;AACzC,SAAO,IAAI,UAAU;AACvB;",
4
+ "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,SAAS,YAAY,OAAe;AACzC,SAAO,IAAI,UAAU;AACvB;",
5
5
  "names": []
6
6
  }
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: !0 });
9
+ }, __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from == "object" || typeof from == "function")
11
+ for (let key of __getOwnPropNames(from))
12
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
+ return to;
14
+ };
15
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
16
+ var isMinusZero_exports = {};
17
+ __export(isMinusZero_exports, {
18
+ isMinusZero: () => isMinusZero
19
+ });
20
+ module.exports = __toCommonJS(isMinusZero_exports);
21
+ function isMinusZero(value) {
22
+ return 1 / value === -1 / 0;
23
+ }
24
+ // Annotate the CommonJS export names for ESM import in node:
25
+ 0 && (module.exports = {
26
+ isMinusZero
27
+ });
28
+ //# sourceMappingURL=isMinusZero.js.map
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/isMinusZero.tsx"],
4
+ "mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,SAAS,YAAY,OAAe;AACzC,SAAO,IAAI,UAAU;AACvB;",
5
+ "names": []
6
+ }
package/dist/cjs/masks.js CHANGED
@@ -1,21 +1,17 @@
1
- "use strict";
2
1
  var __defProp = Object.defineProperty;
3
2
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
5
  var __export = (target, all) => {
7
6
  for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
7
+ __defProp(target, name, { get: all[name], enumerable: !0 });
8
+ }, __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from == "object" || typeof from == "function")
12
10
  for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
11
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
12
  return to;
17
13
  };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
19
15
  var masks_exports = {};
20
16
  __export(masks_exports, {
21
17
  createIdentityMask: () => createIdentityMask,
@@ -28,95 +24,66 @@ __export(masks_exports, {
28
24
  skipMask: () => skipMask
29
25
  });
30
26
  module.exports = __toCommonJS(masks_exports);
31
- var import_helpers = require("./helpers");
32
- var import_isMinusZero = require("./isMinusZero");
33
- const createMask = (createMask2) => typeof createMask2 === "function" ? { name: createMask2.name || "unnamed", mask: createMask2 } : createMask2;
34
- const skipMask = {
27
+ var import_helpers = require("./helpers"), import_isMinusZero = require("./isMinusZero");
28
+ const createMask = (createMask2) => typeof createMask2 == "function" ? { name: createMask2.name || "unnamed", mask: createMask2 } : createMask2, skipMask = {
35
29
  name: "skip-mask",
36
30
  mask: (template, opts) => {
37
31
  const { skip } = opts;
38
- const result = Object.fromEntries(
32
+ return Object.fromEntries(
39
33
  Object.entries(template).filter(([k]) => !skip || !(k in skip)).map(([k, v]) => [k, applyOverrides(k, v, opts)])
40
34
  );
41
- return result;
42
35
  }
43
36
  };
44
37
  function applyOverrides(key, value, opts) {
45
38
  if (!opts.override)
46
39
  return value;
47
40
  const override = opts.override[key];
48
- if (typeof override === "undefined")
49
- return value;
50
- if (typeof override === "string")
51
- return value;
52
- if (opts.overrideStrategy === "swap") {
53
- return override;
54
- }
55
- return value;
41
+ return typeof override > "u" || typeof override == "string" ? value : opts.overrideStrategy === "swap" ? override : value;
56
42
  }
57
43
  const createIdentityMask = () => ({
58
44
  name: "identity-mask",
59
45
  mask: (template) => template
60
- });
61
- const createInverseMask = () => {
62
- const mask = {
63
- name: "inverse-mask",
64
- mask: (template, opts) => {
65
- const inversed = (0, import_helpers.objectFromEntries)(
66
- (0, import_helpers.objectEntries)(template).map(([k, v]) => [k, -v])
67
- );
68
- return skipMask.mask(inversed, opts);
69
- }
70
- };
71
- return mask;
72
- };
73
- const createShiftMask = ({ inverse } = {}, defaultOptions) => {
74
- const mask = {
75
- name: "shift-mask",
76
- mask: (template, opts) => {
77
- const {
78
- override,
79
- overrideStrategy = "shift",
80
- max: maxIn,
81
- palette,
82
- min = 0,
83
- strength = 1
84
- } = { ...defaultOptions, ...opts };
85
- const values = Object.entries(template);
86
- const max = maxIn ?? (palette ? Object.values(palette).length - 1 : Infinity);
87
- const out = {};
88
- for (const [key, value] of values) {
89
- if (typeof value === "string")
90
- continue;
91
- if (typeof (override == null ? void 0 : override[key]) === "number") {
92
- const overrideVal = override[key];
93
- out[key] = overrideStrategy === "shift" ? value + overrideVal : overrideVal;
94
- continue;
95
- } else if (typeof (override == null ? void 0 : override[key]) === "string") {
96
- out[key] = override[key];
97
- continue;
98
- }
99
- const isPositive = value === 0 ? !(0, import_isMinusZero.isMinusZero)(value) : value >= 0;
100
- const direction = isPositive ? 1 : -1;
101
- const invert = inverse ? -1 : 1;
102
- const next = value + strength * direction * invert;
103
- const clamped = isPositive ? Math.max(min, Math.min(max, next)) : Math.min(-min, Math.max(-max, next));
104
- out[key] = clamped;
46
+ }), createInverseMask = () => ({
47
+ name: "inverse-mask",
48
+ mask: (template, opts) => {
49
+ const inversed = (0, import_helpers.objectFromEntries)(
50
+ (0, import_helpers.objectEntries)(template).map(([k, v]) => [k, -v])
51
+ );
52
+ return skipMask.mask(inversed, opts);
53
+ }
54
+ }), createShiftMask = ({ inverse } = {}, defaultOptions) => ({
55
+ name: "shift-mask",
56
+ mask: (template, opts) => {
57
+ const {
58
+ override,
59
+ overrideStrategy = "shift",
60
+ max: maxIn,
61
+ palette,
62
+ min = 0,
63
+ strength = 1
64
+ } = { ...defaultOptions, ...opts }, values = Object.entries(template), max = maxIn ?? (palette ? Object.values(palette).length - 1 : 1 / 0), out = {};
65
+ for (const [key, value] of values) {
66
+ if (typeof value == "string")
67
+ continue;
68
+ if (typeof override?.[key] == "number") {
69
+ const overrideVal = override[key];
70
+ out[key] = overrideStrategy === "shift" ? value + overrideVal : overrideVal;
71
+ continue;
72
+ } else if (typeof override?.[key] == "string") {
73
+ out[key] = override[key];
74
+ continue;
105
75
  }
106
- const skipped = skipMask.mask(out, opts);
107
- return skipped;
76
+ const isPositive = value === 0 ? !(0, import_isMinusZero.isMinusZero)(value) : value >= 0, direction = isPositive ? 1 : -1, invert = inverse ? -1 : 1, next = value + strength * direction * invert, clamped = isPositive ? Math.max(min, Math.min(max, next)) : Math.min(-min, Math.max(-max, next));
77
+ out[key] = clamped;
108
78
  }
109
- };
110
- return mask;
111
- };
112
- const createWeakenMask = (defaultOptions) => ({
79
+ return skipMask.mask(out, opts);
80
+ }
81
+ }), createWeakenMask = (defaultOptions) => ({
113
82
  name: "soften-mask",
114
83
  mask: createShiftMask({}, defaultOptions).mask
115
- });
116
- const createSoftenMask = createWeakenMask;
117
- const createStrengthenMask = (defaultOptions) => ({
84
+ }), createSoftenMask = createWeakenMask, createStrengthenMask = (defaultOptions) => ({
118
85
  name: "strengthen-mask",
119
- mask: createShiftMask({ inverse: true }, defaultOptions).mask
86
+ mask: createShiftMask({ inverse: !0 }, defaultOptions).mask
120
87
  });
121
88
  // Annotate the CommonJS export names for ESM import in node:
122
89
  0 && (module.exports = {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/masks.tsx"],
4
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,qBAAiD;AACjD,yBAA4B;AAErB,MAAM,aAAa,CACxBA,gBAEA,OAAOA,gBAAe,aAClB,EAAE,MAAMA,YAAW,QAAQ,WAAW,MAAMA,YAAW,IACvDA;AAEC,MAAM,WAAuB;AAAA,EAClC,MAAM;AAAA,EACN,MAAM,CAAC,UAAU,SAAS;AACxB,UAAM,EAAE,KAAK,IAAI;AACjB,UAAM,SAAS,OAAO;AAAA,MACpB,OAAO,QAAQ,QAAQ,EACpB,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE,KAAK,KAAK,EACrC,IAAI,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,eAAe,GAAG,GAAG,IAAI,CAAC,CAAC;AAAA,IACpD;AAEA,WAAO;AAAA,EACT;AACF;AAEA,SAAS,eAAe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cAAc;AAChE;AAAA,MACF,WAAW,OAAO,WAAW,GAAG,KAAM,UAAU;AAC9C,YAAI,GAAG,IAAI,SAAS,GAAG;AACvB;AAAA,MACF;AACA,YAAM,aAAa,UAAU,IAAI,KAAC,gCAAY,KAAK,IAAI,SAAS,GAC1D,YAAY,aAAa,IAAI,IAC7B,SAAS,UAAU,KAAK,GACxB,OAAO,QAAQ,WAAW,YAAY,QACtC,UAAU,aACZ,KAAK,IAAI,KAAK,KAAK,IAAI,KAAK,IAAI,CAAC,IACjC,KAAK,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,KAAK,IAAI,CAAC;AAEvC,UAAI,GAAG,IAAI;AAAA,IACb;AAGA,WADgB,SAAS,KAAK,KAAK,IAAI;AAAA,EAEzC;AACF,IAIW,mBAAmB,CAAC,oBAA8C;AAAA,EAC7E,MAAM;AAAA,EACN,MAAM,gBAAgB,CAAC,GAAG,cAAc,EAAE;AAC5C,IAEa,mBAAmB,kBAEnB,uBAAuB,CAAC,oBAA8C;AAAA,EACjF,MAAM;AAAA,EACN,MAAM,gBAAgB,EAAE,SAAS,GAAK,GAAG,cAAc,EAAE;AAC3D;",
5
5
  "names": ["createMask"]
6
6
  }
@@ -0,0 +1,100 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: !0 });
9
+ }, __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from == "object" || typeof from == "function")
11
+ for (let key of __getOwnPropNames(from))
12
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
+ return to;
14
+ };
15
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
16
+ var masks_exports = {};
17
+ __export(masks_exports, {
18
+ createIdentityMask: () => createIdentityMask,
19
+ createInverseMask: () => createInverseMask,
20
+ createMask: () => createMask,
21
+ createShiftMask: () => createShiftMask,
22
+ createSoftenMask: () => createSoftenMask,
23
+ createStrengthenMask: () => createStrengthenMask,
24
+ createWeakenMask: () => createWeakenMask,
25
+ skipMask: () => skipMask
26
+ });
27
+ module.exports = __toCommonJS(masks_exports);
28
+ var import_helpers = require("./helpers"), import_isMinusZero = require("./isMinusZero");
29
+ const createMask = (createMask2) => typeof createMask2 == "function" ? { name: createMask2.name || "unnamed", mask: createMask2 } : createMask2, skipMask = {
30
+ name: "skip-mask",
31
+ mask: (template, opts) => {
32
+ const { skip } = opts;
33
+ return Object.fromEntries(
34
+ Object.entries(template).filter(([k]) => !skip || !(k in skip)).map(([k, v]) => [k, applyOverrides(k, v, opts)])
35
+ );
36
+ }
37
+ };
38
+ function applyOverrides(key, value, opts) {
39
+ if (!opts.override)
40
+ return value;
41
+ const override = opts.override[key];
42
+ return typeof override > "u" || typeof override == "string" ? value : opts.overrideStrategy === "swap" ? override : value;
43
+ }
44
+ const createIdentityMask = () => ({
45
+ name: "identity-mask",
46
+ mask: (template) => template
47
+ }), createInverseMask = () => ({
48
+ name: "inverse-mask",
49
+ mask: (template, opts) => {
50
+ const inversed = (0, import_helpers.objectFromEntries)(
51
+ (0, import_helpers.objectEntries)(template).map(([k, v]) => [k, -v])
52
+ );
53
+ return skipMask.mask(inversed, opts);
54
+ }
55
+ }), createShiftMask = ({ inverse } = {}, defaultOptions) => ({
56
+ name: "shift-mask",
57
+ mask: (template, opts) => {
58
+ const {
59
+ override,
60
+ overrideStrategy = "shift",
61
+ max: maxIn,
62
+ palette,
63
+ min = 0,
64
+ strength = 1
65
+ } = { ...defaultOptions, ...opts }, values = Object.entries(template), max = maxIn ?? (palette ? Object.values(palette).length - 1 : 1 / 0), out = {};
66
+ for (const [key, value] of values) {
67
+ if (typeof value == "string")
68
+ continue;
69
+ if (typeof override?.[key] == "number") {
70
+ const overrideVal = override[key];
71
+ out[key] = overrideStrategy === "shift" ? value + overrideVal : overrideVal;
72
+ continue;
73
+ } else if (typeof override?.[key] == "string") {
74
+ out[key] = override[key];
75
+ continue;
76
+ }
77
+ const isPositive = value === 0 ? !(0, import_isMinusZero.isMinusZero)(value) : value >= 0, direction = isPositive ? 1 : -1, invert = inverse ? -1 : 1, next = value + strength * direction * invert, clamped = isPositive ? Math.max(min, Math.min(max, next)) : Math.min(-min, Math.max(-max, next));
78
+ out[key] = clamped;
79
+ }
80
+ return skipMask.mask(out, opts);
81
+ }
82
+ }), createWeakenMask = (defaultOptions) => ({
83
+ name: "soften-mask",
84
+ mask: createShiftMask({}, defaultOptions).mask
85
+ }), createSoftenMask = createWeakenMask, createStrengthenMask = (defaultOptions) => ({
86
+ name: "strengthen-mask",
87
+ mask: createShiftMask({ inverse: !0 }, defaultOptions).mask
88
+ });
89
+ // Annotate the CommonJS export names for ESM import in node:
90
+ 0 && (module.exports = {
91
+ createIdentityMask,
92
+ createInverseMask,
93
+ createMask,
94
+ createShiftMask,
95
+ createSoftenMask,
96
+ createStrengthenMask,
97
+ createWeakenMask,
98
+ skipMask
99
+ });
100
+ //# sourceMappingURL=masks.js.map
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/masks.tsx"],
4
+ "mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,qBAAiD,sBACjD,qBAA4B;AAErB,MAAM,aAAa,CACxBA,gBAEA,OAAOA,eAAe,aAClB,EAAE,MAAMA,YAAW,QAAQ,WAAW,MAAMA,YAAW,IACvDA,aAEO,WAAuB;AAAA,EAClC,MAAM;AAAA,EACN,MAAM,CAAC,UAAU,SAAS;AACxB,UAAM,EAAE,KAAK,IAAI;AAOjB,WANe,OAAO;AAAA,MACpB,OAAO,QAAQ,Q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M,cAAc,SAAS,GAAG;AAChC,YAAI,GAAG,IAAI,qBAAqB,UAAU,QAAQ,cAAc;AAChE;AAAA,MACF,WAAW,OAAO,WAAW,GAAG,KAAM,UAAU;AAC9C,YAAI,GAAG,IAAI,SAAS,GAAG;AACvB;AAAA,MACF;AACA,YAAM,aAAa,UAAU,IAAI,KAAC,gCAAY,KAAK,IAAI,SAAS,GAC1D,YAAY,aAAa,IAAI,IAC7B,SAAS,UAAU,KAAK,GACxB,OAAO,QAAQ,WAAW,YAAY,QACtC,UAAU,aACZ,KAAK,IAAI,KAAK,KAAK,IAAI,KAAK,IAAI,CAAC,IACjC,KAAK,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,KAAK,IAAI,CAAC;AAEvC,UAAI,GAAG,IAAI;AAAA,IACb;AAGA,WADgB,SAAS,KAAK,KAAK,IAAI;AAAA,EAEzC;AACF,IAIW,mBAAmB,CAAC,oBAA8C;AAAA,EAC7E,MAAM;AAAA,EACN,MAAM,gBAAgB,CAAC,GAAG,cAAc,EAAE;AAC5C,IAEa,mBAAmB,kBAEnB,uBAAuB,CAAC,oBAA8C;AAAA,EACjF,MAAM;AAAA,EACN,MAAM,gBAAgB,EAAE,SAAS,GAAK,GAAG,cAAc,EAAE;AAC3D;",
5
+ "names": ["createMask"]
6
+ }
package/dist/cjs/tests.js CHANGED
@@ -1,31 +1,16 @@
1
- "use strict";
2
- var import_applyMask = require("./applyMask");
3
- var import_createTheme = require("./createTheme");
4
- var import_masks = require("./masks");
1
+ var import_applyMask = require("./applyMask"), import_createTheme = require("./createTheme"), import_masks = require("./masks");
5
2
  if (process.env.NODE_ENV === "development") {
6
- const palette = ["0", "1", "2", "3", "-3", "-2", "-1", "-0"];
7
- const template = { bg: 1, fg: -1 };
8
- const stongerMask = (0, import_masks.createStrengthenMask)();
9
- const weakerMask = (0, import_masks.createWeakenMask)();
10
- const theme = (0, import_createTheme.createTheme)(palette, template);
11
- if (theme.bg !== "1")
12
- throw `\u274C`;
13
- if (theme.fg !== "-1")
14
- throw `\u274C`;
3
+ const palette = ["0", "1", "2", "3", "-3", "-2", "-1", "-0"], template = { bg: 1, fg: -1 }, stongerMask = (0, import_masks.createStrengthenMask)(), weakerMask = (0, import_masks.createWeakenMask)(), theme = (0, import_createTheme.createTheme)(palette, template);
4
+ if (theme.bg !== "1" || theme.fg !== "-1")
5
+ throw "\u274C";
15
6
  const str = (0, import_applyMask.applyMask)(theme, stongerMask);
16
- if (str.bg !== "0")
17
- throw `\u274C`;
18
- if (str.fg !== "-0")
19
- throw `\u274C`;
7
+ if (str.bg !== "0" || str.fg !== "-0")
8
+ throw "\u274C";
20
9
  const weak = (0, import_applyMask.applyMask)(theme, weakerMask);
21
- if (weak.bg !== "2")
22
- throw `\u274C`;
23
- if (weak.fg !== "-2")
24
- throw `\u274C`;
10
+ if (weak.bg !== "2" || weak.fg !== "-2")
11
+ throw "\u274C";
25
12
  const weak2 = (0, import_applyMask.applyMask)(theme, weakerMask, { strength: 2 });
26
- if (weak2.bg !== "3")
27
- throw `\u274C`;
28
- if (weak2.fg !== "-3")
29
- throw `\u274C`;
13
+ if (weak2.bg !== "3" || weak2.fg !== "-3")
14
+ throw "\u274C";
30
15
  }
31
16
  //# sourceMappingURL=tests.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/tests.tsx"],
4
- "mappings": ";AAAA,uBAA0B;AAC1B,yBAA4B;AAC5B,mBAAuD;AAGvD,IAAI,QAAQ,IAAI,aAAa,eAAe;AAC1C,QAAM,UAAU,CAAC,KAAK,KAAK,KAAK,KAAK,MAAM,MAAM,MAAM,IAAI;AAC3D,QAAM,WAAW,EAAE,IAAI,GAAG,IAAI,GAAG;AAEjC,QAAM,kBAAc,mCAAqB;AACzC,QAAM,iBAAa,+BAAiB;AAEpC,QAAM,YAAQ,gCAAY,SAAS,QAAQ;AAC3C,MAAI,MAAM,OAAO;AAAK,UAAM;AAC5B,MAAI,MAAM,OAAO;AAAM,UAAM;AAE7B,QAAM,UAAM,4BAAU,OAAO,WAAW;AACxC,MAAI,IAAI,OAAO;AAAK,UAAM;AAC1B,MAAI,IAAI,OAAO;AAAM,UAAM;AAE3B,QAAM,WAAO,4BAAU,OAAO,UAAU;AACxC,MAAI,KAAK,OAAO;AAAK,UAAM;AAC3B,MAAI,KAAK,OAAO;AAAM,UAAM;AAE5B,QAAM,YAAQ,4BAAU,OAAO,YAAY,EAAE,UAAU,EAAE,CAAC;AAC1D,MAAI,MAAM,OAAO;AAAK,UAAM;AAC5B,MAAI,MAAM,OAAO;AAAM,UAAM;AAC/B;",
4
+ "mappings": "AAAA,uBAA0B,wBAC1B,qBAA4B,0BAC5B,eAAuD;AAGvD,IAAI,QAAQ,IAAI,aAAa,eAAe;AAC1C,QAAM,UAAU,CAAC,KAAK,KAAK,KAAK,KAAK,MAAM,MAAM,MAAM,IAAI,GACrD,WAAW,EAAE,IAAI,GAAG,IAAI,GAAG,GAE3B,kBAAc,mCAAqB,GACnC,iBAAa,+BAAiB,GAE9B,YAAQ,gCAAY,SAAS,QAAQ;AAE3C,MADI,MAAM,OAAO,OACb,MAAM,OAAO;AAAM,UAAM;AAE7B,QAAM,UAAM,4BAAU,OAAO,WAAW;AAExC,MADI,IAAI,OAAO,OACX,IAAI,OAAO;AAAM,UAAM;AAE3B,QAAM,WAAO,4BAAU,OAAO,UAAU;AAExC,MADI,KAAK,OAAO,OACZ,KAAK,OAAO;AAAM,UAAM;AAE5B,QAAM,YAAQ,4BAAU,OAAO,YAAY,EAAE,UAAU,EAAE,CAAC;AAE1D,MADI,MAAM,OAAO,OACb,MAAM,OAAO;AAAM,UAAM;AAC/B;",
5
5
  "names": []
6
6
  }
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var import_applyMask = require("./applyMask"), import_createTheme = require("./createTheme"), import_masks = require("./masks");
3
+ if (process.env.NODE_ENV === "development") {
4
+ const palette = ["0", "1", "2", "3", "-3", "-2", "-1", "-0"], template = { bg: 1, fg: -1 }, stongerMask = (0, import_masks.createStrengthenMask)(), weakerMask = (0, import_masks.createWeakenMask)(), theme = (0, import_createTheme.createTheme)(palette, template);
5
+ if (theme.bg !== "1" || theme.fg !== "-1")
6
+ throw "\u274C";
7
+ const str = (0, import_applyMask.applyMask)(theme, stongerMask);
8
+ if (str.bg !== "0" || str.fg !== "-0")
9
+ throw "\u274C";
10
+ const weak = (0, import_applyMask.applyMask)(theme, weakerMask);
11
+ if (weak.bg !== "2" || weak.fg !== "-2")
12
+ throw "\u274C";
13
+ const weak2 = (0, import_applyMask.applyMask)(theme, weakerMask, { strength: 2 });
14
+ if (weak2.bg !== "3" || weak2.fg !== "-3")
15
+ throw "\u274C";
16
+ }
17
+ //# sourceMappingURL=tests.js.map
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/tests.tsx"],
4
+ "mappings": ";AAAA,uBAA0B,wBAC1B,qBAA4B,0BAC5B,eAAuD;AAGvD,IAAI,QAAQ,IAAI,aAAa,eAAe;AAC1C,QAAM,UAAU,CAAC,KAAK,KAAK,KAAK,KAAK,MAAM,MAAM,MAAM,IAAI,GACrD,WAAW,EAAE,IAAI,GAAG,IAAI,GAAG,GAE3B,kBAAc,mCAAqB,GACnC,iBAAa,+BAAiB,GAE9B,YAAQ,gCAAY,SAAS,QAAQ;AAE3C,MADI,MAAM,OAAO,OACb,MAAM,OAAO;AAAM,UAAM;AAE7B,QAAM,UAAM,4BAAU,OAAO,WAAW;AAExC,MADI,IAAI,OAAO,OACX,IAAI,OAAO;AAAM,UAAM;AAE3B,QAAM,WAAO,4BAAU,OAAO,UAAU;AAExC,MADI,KAAK,OAAO,OACZ,KAAK,OAAO;AAAM,UAAM;AAE5B,QAAM,YAAQ,4BAAU,OAAO,YAAY,EAAE,UAAU,EAAE,CAAC;AAE1D,MADI,MAAM,OAAO,OACb,MAAM,OAAO;AAAM,UAAM;AAC/B;",
5
+ "names": []
6
+ }
@@ -1,38 +1,29 @@
1
- "use strict";
2
1
  var __defProp = Object.defineProperty;
3
2
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
5
  var __export = (target, all) => {
7
6
  for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
7
+ __defProp(target, name, { get: all[name], enumerable: !0 });
8
+ }, __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from == "object" || typeof from == "function")
12
10
  for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
11
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
12
  return to;
17
13
  };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
19
15
  var themeInfo_exports = {};
20
16
  __export(themeInfo_exports, {
21
17
  getThemeInfo: () => getThemeInfo,
22
18
  setThemeInfo: () => setThemeInfo
23
19
  });
24
20
  module.exports = __toCommonJS(themeInfo_exports);
25
- const THEME_INFO = /* @__PURE__ */ new Map();
26
- const getThemeInfo = (theme, name) => {
27
- return THEME_INFO.get(name || JSON.stringify(theme));
28
- };
29
- const setThemeInfo = (theme, info) => {
21
+ const THEME_INFO = /* @__PURE__ */ new Map(), getThemeInfo = (theme, name) => THEME_INFO.get(name || JSON.stringify(theme)), setThemeInfo = (theme, info) => {
30
22
  const next = {
31
23
  ...info,
32
24
  cache: /* @__PURE__ */ new Map()
33
25
  };
34
- THEME_INFO.set(info.name || JSON.stringify(theme), next);
35
- THEME_INFO.set(JSON.stringify(info.definition), next);
26
+ THEME_INFO.set(info.name || JSON.stringify(theme), next), THEME_INFO.set(JSON.stringify(info.definition), next);
36
27
  };
37
28
  // Annotate the CommonJS export names for ESM import in node:
38
29
  0 && (module.exports = {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/themeInfo.tsx"],
4
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAcA,MAAM,aAAa,oBAAI,IAAuB;AAEvC,MAAM,eAAe,CAC1B,OACA,SAC0B;AAC1B,SAAO,WAAW,IAAI,QAAQ,KAAK,UAAU,KAAK,CAAC;AACrD;AAEO,MAAM,eAAe,CAC1B,OACA,SAGG;AACH,QAAM,OAAO;AAAA,IACX,GAAG;AAAA,IACH,OAAO,oBAAI,IAAI;AAAA,EACjB;AACA,aAAW,IAAI,KAAK,QAAQ,KAAK,UAAU,KAAK,GAAG,IAAI;AACvD,aAAW,IAAI,KAAK,UAAU,KAAK,UAAU,GAAG,IAAI;AACtD;",
4
+ "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAcA,MAAM,aAAa,oBAAI,IAAuB,GAEjC,eAAe,CAC1B,OACA,SAEO,WAAW,IAAI,QAAQ,KAAK,UAAU,KAAK,CAAC,GAGxC,eAAe,CAC1B,OACA,SAGG;AACH,QAAM,OAAO;AAAA,IACX,GAAG;AAAA,IACH,OAAO,oBAAI,IAAI;AAAA,EACjB;AACA,aAAW,IAAI,KAAK,QAAQ,KAAK,UAAU,KAAK,GAAG,IAAI,GACvD,WAAW,IAAI,KAAK,UAAU,KAAK,UAAU,GAAG,IAAI;AACtD;",
5
5
  "names": []
6
6
  }
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: !0 });
9
+ }, __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from == "object" || typeof from == "function")
11
+ for (let key of __getOwnPropNames(from))
12
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
+ return to;
14
+ };
15
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
16
+ var themeInfo_exports = {};
17
+ __export(themeInfo_exports, {
18
+ getThemeInfo: () => getThemeInfo,
19
+ setThemeInfo: () => setThemeInfo
20
+ });
21
+ module.exports = __toCommonJS(themeInfo_exports);
22
+ const THEME_INFO = /* @__PURE__ */ new Map(), getThemeInfo = (theme, name) => THEME_INFO.get(name || JSON.stringify(theme)), setThemeInfo = (theme, info) => {
23
+ const next = {
24
+ ...info,
25
+ cache: /* @__PURE__ */ new Map()
26
+ };
27
+ THEME_INFO.set(info.name || JSON.stringify(theme), next), THEME_INFO.set(JSON.stringify(info.definition), next);
28
+ };
29
+ // Annotate the CommonJS export names for ESM import in node:
30
+ 0 && (module.exports = {
31
+ getThemeInfo,
32
+ setThemeInfo
33
+ });
34
+ //# sourceMappingURL=themeInfo.js.map
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/themeInfo.tsx"],
4
+ "mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAcA,MAAM,aAAa,oBAAI,IAAuB,GAEjC,eAAe,CAC1B,OACA,SAEO,WAAW,IAAI,QAAQ,KAAK,UAAU,KAAK,CAAC,GAGxC,eAAe,CAC1B,OACA,SAGG;AACH,QAAM,OAAO;AAAA,IACX,GAAG;AAAA,IACH,OAAO,oBAAI,IAAI;AAAA,EACjB;AACA,aAAW,IAAI,KAAK,QAAQ,KAAK,UAAU,KAAK,GAAG,IAAI,GACvD,WAAW,IAAI,KAAK,UAAU,KAAK,UAAU,GAAG,IAAI;AACtD;",
5
+ "names": []
6
+ }