@udixio/theme 2.1.2 → 2.1.6

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/CHANGELOG.md CHANGED
@@ -1,3 +1,25 @@
1
+ ## 2.1.6 (2025-12-16)
2
+
3
+ This was a version bump only for @udixio/theme to align it with other projects, there were no code changes.
4
+
5
+ ## 2.1.5 (2025-12-16)
6
+
7
+ This was a version bump only for @udixio/theme to align it with other projects, there were no code changes.
8
+
9
+ ## 2.1.4 (2025-12-16)
10
+
11
+ This was a version bump only for @udixio/theme to align it with other projects, there were no code changes.
12
+
13
+ ## 2.1.3 (2025-11-05)
14
+
15
+ ### 🩹 Fixes
16
+
17
+ - **theme:** simplify tone calculation and enhance custom palette handling ([b7bb339](https://github.com/Udixio/UI/commit/b7bb339))
18
+
19
+ ### ❤️ Thank You
20
+
21
+ - Joël VIGREUX
22
+
1
23
  ## 2.1.2 (2025-10-17)
2
24
 
3
25
  ### 🩹 Fixes
package/dist/bin.cjs CHANGED
@@ -2,7 +2,7 @@
2
2
  const commander = require("commander");
3
3
  const chokidar = require("chokidar");
4
4
  const chalk = require("chalk");
5
- const loadFromPath = require("./load-from-path-pZQNcEPJ.cjs");
5
+ const loadFromPath = require("./load-from-path-C3UAcZqv.cjs");
6
6
  const program = new commander.Command();
7
7
  async function runOnce(configPath) {
8
8
  try {
package/dist/bin.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Command } from "commander";
2
2
  import chokidar from "chokidar";
3
3
  import chalk from "chalk";
4
- import { l as loadFromPath } from "./load-from-path-BPJUOVxu.js";
4
+ import { l as loadFromPath } from "./load-from-path-BCh7ss_Z.js";
5
5
  const program = new Command();
6
6
  async function runOnce(configPath) {
7
7
  try {
package/dist/browser.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const loader = require("./loader-CQxzpARY.cjs");
4
- const font_plugin = require("./font.plugin-DLv04PSX.cjs");
3
+ const loader = require("./loader-BbjdPvAo.cjs");
4
+ const font_plugin = require("./font.plugin-CkYgSR9K.cjs");
5
5
  exports.API = loader.API;
6
6
  exports.AppContainer = loader.AppContainer;
7
7
  exports.AppModule = loader.AppModule;
package/dist/browser.js CHANGED
@@ -1,5 +1,5 @@
1
- import { A, a, b, h, i, C, j, k, e, f, o, n, q, D, P, r, s, v, u, V, z, c, d, m, F, g, w, x, l, p, G, B, t, y, E } from "./loader-qCj0ikgY.js";
2
- import { F as F2, b as b2, P as P2, a as a2, d as d2 } from "./font.plugin-CDZs7YLM.js";
1
+ import { A, a, b, h, i, C, j, k, e, f, o, n, q, D, P, r, s, v, u, V, z, c, d, m, F, g, w, x, l, p, G, B, t, y, E } from "./loader-C-8QkFag.js";
2
+ import { F as F2, b as b2, P as P2, a as a2, d as d2 } from "./font.plugin-BU5iUqHq.js";
3
3
  export {
4
4
  A as API,
5
5
  a as AppContainer,
@@ -1,7 +1,7 @@
1
1
  var __defProp = Object.defineProperty;
2
2
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
3
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
- import "./loader-qCj0ikgY.js";
4
+ import "./loader-C-8QkFag.js";
5
5
  class PluginAbstract {
6
6
  constructor(options) {
7
7
  __publicField(this, "options");
@@ -2,7 +2,7 @@
2
2
  var __defProp = Object.defineProperty;
3
3
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4
4
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
- require("./loader-CQxzpARY.cjs");
5
+ require("./loader-BbjdPvAo.cjs");
6
6
  class PluginAbstract {
7
7
  constructor(options) {
8
8
  __publicField(this, "options");
@@ -1,4 +1,4 @@
1
- import { p as loader } from "./loader-qCj0ikgY.js";
1
+ import { p as loader } from "./loader-C-8QkFag.js";
2
2
  import * as fs from "node:fs";
3
3
  async function resolveConfig(configPath = "./theme.config") {
4
4
  const { createJiti } = await import("jiti");
@@ -21,7 +21,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
21
21
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
22
  mod
23
23
  ));
24
- const loader = require("./loader-CQxzpARY.cjs");
24
+ const loader = require("./loader-BbjdPvAo.cjs");
25
25
  const fs = require("node:fs");
26
26
  var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;
27
27
  function _interopNamespaceDefault(e) {
@@ -44,7 +44,7 @@ const fs__namespace = /* @__PURE__ */ _interopNamespaceDefault(fs);
44
44
  async function resolveConfig(configPath = "./theme.config") {
45
45
  const { createJiti } = await import("jiti");
46
46
  const { resolve } = await import("pathe");
47
- const jiti = createJiti(typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === "SCRIPT" && _documentCurrentScript.src || new URL("load-from-path-pZQNcEPJ.cjs", document.baseURI).href, {
47
+ const jiti = createJiti(typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === "SCRIPT" && _documentCurrentScript.src || new URL("load-from-path-C3UAcZqv.cjs", document.baseURI).href, {
48
48
  debug: process.env.NODE_ENV === "development",
49
49
  fsCache: true,
50
50
  interopDefault: true
@@ -2729,7 +2729,7 @@ class PaletteApi {
2729
2729
  Hct.fromInt(materialColorUtilities.argbFromHex(callback))
2730
2730
  );
2731
2731
  } else {
2732
- this.paletteManager.add(key, callback);
2732
+ this.paletteManager.addCustomPalette(key, callback);
2733
2733
  }
2734
2734
  });
2735
2735
  }
@@ -2759,8 +2759,13 @@ class PaletteManager {
2759
2759
  ...this._palettes
2760
2760
  };
2761
2761
  }
2762
- addCustomPalette(key, color) {
2763
- const palette = Palette.fromVariant(key, color, this.context);
2762
+ addCustomPalette(key, args) {
2763
+ let palette;
2764
+ if (args instanceof Hct) {
2765
+ palette = Palette.fromVariant(key, args, this.context);
2766
+ } else {
2767
+ palette = new Palette(key, args, this.context);
2768
+ }
2764
2769
  this.add(key, palette);
2765
2770
  this.colorApi.addFromCustomPalette(key);
2766
2771
  }
@@ -3148,13 +3153,7 @@ const udixioVariant = variant({
3148
3153
  [colorKey]: {
3149
3154
  palette: () => palettes.get(colorKey),
3150
3155
  tone: () => {
3151
- if (ctx.variant.name === "neutral") {
3152
- return ctx.isDark ? tMinC(palettes.get(colorKey), 0, 98) : tMaxC(palettes.get(colorKey));
3153
- } else if (ctx.variant.name === "vibrant") {
3154
- return tMaxC(palettes.get(colorKey), 0, ctx.isDark ? 90 : 98);
3155
- } else {
3156
- return ctx.isDark ? 80 : tMaxC(palettes.get(colorKey));
3157
- }
3156
+ return ctx.isDark ? 80 : tMaxC(palettes.get(colorKey));
3158
3157
  },
3159
3158
  isBackground: true,
3160
3159
  background: () => highestSurface(ctx, colors2),
@@ -2728,7 +2728,7 @@ class PaletteApi {
2728
2728
  Hct.fromInt(argbFromHex(callback))
2729
2729
  );
2730
2730
  } else {
2731
- this.paletteManager.add(key, callback);
2731
+ this.paletteManager.addCustomPalette(key, callback);
2732
2732
  }
2733
2733
  });
2734
2734
  }
@@ -2758,8 +2758,13 @@ class PaletteManager {
2758
2758
  ...this._palettes
2759
2759
  };
2760
2760
  }
2761
- addCustomPalette(key, color) {
2762
- const palette = Palette.fromVariant(key, color, this.context);
2761
+ addCustomPalette(key, args) {
2762
+ let palette;
2763
+ if (args instanceof Hct) {
2764
+ palette = Palette.fromVariant(key, args, this.context);
2765
+ } else {
2766
+ palette = new Palette(key, args, this.context);
2767
+ }
2763
2768
  this.add(key, palette);
2764
2769
  this.colorApi.addFromCustomPalette(key);
2765
2770
  }
@@ -3147,13 +3152,7 @@ const udixioVariant = variant({
3147
3152
  [colorKey]: {
3148
3153
  palette: () => palettes.get(colorKey),
3149
3154
  tone: () => {
3150
- if (ctx.variant.name === "neutral") {
3151
- return ctx.isDark ? tMinC(palettes.get(colorKey), 0, 98) : tMaxC(palettes.get(colorKey));
3152
- } else if (ctx.variant.name === "vibrant") {
3153
- return tMaxC(palettes.get(colorKey), 0, ctx.isDark ? 90 : 98);
3154
- } else {
3155
- return ctx.isDark ? 80 : tMaxC(palettes.get(colorKey));
3156
- }
3155
+ return ctx.isDark ? 80 : tMaxC(palettes.get(colorKey));
3157
3156
  },
3158
3157
  isBackground: true,
3159
3158
  background: () => highestSurface(ctx, colors2),
package/dist/node.cjs CHANGED
@@ -22,9 +22,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
22
22
  mod
23
23
  ));
24
24
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
25
- const loader = require("./loader-CQxzpARY.cjs");
26
- const font_plugin = require("./font.plugin-DLv04PSX.cjs");
27
- const loadFromPath = require("./load-from-path-pZQNcEPJ.cjs");
25
+ const loader = require("./loader-BbjdPvAo.cjs");
26
+ const font_plugin = require("./font.plugin-CkYgSR9K.cjs");
27
+ const loadFromPath = require("./load-from-path-C3UAcZqv.cjs");
28
28
  let unpluginInstance = null;
29
29
  const createUnpluginTheme = async () => {
30
30
  if (unpluginInstance) {
package/dist/node.js CHANGED
@@ -1,7 +1,7 @@
1
- import { A, a, b, h, i, C, j, k, e, f, o, n, q, D, P, r, s, v, u, V, z, c, d, m, F, g, w, x, l, p, G, B, t, y, E } from "./loader-qCj0ikgY.js";
2
- import { F as F2, b as b2, P as P2, a as a2, d as d2 } from "./font.plugin-CDZs7YLM.js";
3
- import { l as loadFromPath } from "./load-from-path-BPJUOVxu.js";
4
- import { r as r2 } from "./load-from-path-BPJUOVxu.js";
1
+ import { A, a, b, h, i, C, j, k, e, f, o, n, q, D, P, r, s, v, u, V, z, c, d, m, F, g, w, x, l, p, G, B, t, y, E } from "./loader-C-8QkFag.js";
2
+ import { F as F2, b as b2, P as P2, a as a2, d as d2 } from "./font.plugin-BU5iUqHq.js";
3
+ import { l as loadFromPath } from "./load-from-path-BCh7ss_Z.js";
4
+ import { r as r2 } from "./load-from-path-BCh7ss_Z.js";
5
5
  let unpluginInstance = null;
6
6
  const createUnpluginTheme = async () => {
7
7
  if (unpluginInstance) {
@@ -11,7 +11,7 @@ export declare class PaletteManager {
11
11
  context: Context;
12
12
  colorApi: ColorApi;
13
13
  });
14
- addCustomPalette(key: string, color: Hct): void;
14
+ addCustomPalette(key: string, args: Hct | PaletteCallback): void;
15
15
  add(key: string, palette: PaletteCallback | Palette): void;
16
16
  get(key: 'primary' | 'secondary' | 'tertiary' | 'neutral' | 'neutralVariant' | 'error' | string): Palette;
17
17
  private set;
@@ -1 +1 @@
1
- {"version":3,"file":"palette.manager.d.ts","sourceRoot":"","sources":["../../src/palette/palette.manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,GAAG,EAAE,MAAM,iCAAiC,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEpC,qBAAa,cAAc;IACzB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAM;IACxC,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,QAAQ,CAAC;IAEnB,IAAI,QAAQ,IAAI,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAKhD;gBAEW,IAAI,EAAE;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,QAAQ,EAAE,QAAQ,CAAA;KAAE;IAW1D,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG;IAMxC,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,GAAG,OAAO,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AO,GAAG,IAAI;CAS3D"}
@@ -1 +1 @@
1
- {"version":3,"file":"udixio.variant.d.ts","sourceRoot":"","sources":["../../../src/variant/variants/udixio.variant.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2C,OAAO,EAAE,MAAM,YAAY,CAAC;AAuD9E,eAAO,MAAM,aAAa,EAAE,OAsxB1B,CAAC"}
1
+ {"version":3,"file":"udixio.variant.d.ts","sourceRoot":"","sources":["../../../src/variant/variants/udixio.variant.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2C,OAAO,EAAE,MAAM,YAAY,CAAC;AAuD9E,eAAO,MAAM,aAAa,EAAE,OA8wB1B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@udixio/theme",
3
- "version": "2.1.2",
3
+ "version": "2.1.6",
4
4
  "type": "module",
5
5
  "main": "./dist/node.js",
6
6
  "module": "./dist/node.js",
@@ -45,7 +45,7 @@
45
45
  "url": "https://github.com/Udixio/UI.git"
46
46
  },
47
47
  "publishConfig": {
48
- "registry": "https://registry.npmjs.org/",
48
+ "provenance": true,
49
49
  "access": "public"
50
50
  }
51
51
  }
@@ -19,7 +19,7 @@ export class PaletteApi {
19
19
  Hct.fromInt(argbFromHex(callback)),
20
20
  );
21
21
  } else {
22
- this.paletteManager.add(key, callback);
22
+ this.paletteManager.addCustomPalette(key, callback);
23
23
  }
24
24
  });
25
25
  }
@@ -26,8 +26,13 @@ export class PaletteManager {
26
26
  );
27
27
  }
28
28
 
29
- addCustomPalette(key: string, color: Hct) {
30
- const palette = Palette.fromVariant(key, color, this.context);
29
+ addCustomPalette(key: string, args: Hct | PaletteCallback): void {
30
+ let palette: Palette;
31
+ if (args instanceof Hct) {
32
+ palette = Palette.fromVariant(key, args, this.context);
33
+ } else {
34
+ palette = new Palette(key, args, this.context);
35
+ }
31
36
  this.add(key, palette);
32
37
  this.colorApi.addFromCustomPalette(key);
33
38
  }
@@ -124,15 +124,7 @@ export const udixioVariant: Variant = variant({
124
124
  [colorKey]: {
125
125
  palette: () => palettes.get(colorKey),
126
126
  tone: () => {
127
- if (ctx.variant.name === 'neutral') {
128
- return ctx.isDark
129
- ? tMinC(palettes.get(colorKey), 0, 98)
130
- : tMaxC(palettes.get(colorKey));
131
- } else if (ctx.variant.name === 'vibrant') {
132
- return tMaxC(palettes.get(colorKey), 0, ctx.isDark ? 90 : 98);
133
- } else {
134
- return ctx.isDark ? 80 : tMaxC(palettes.get(colorKey));
135
- }
127
+ return ctx.isDark ? 80 : tMaxC(palettes.get(colorKey));
136
128
  },
137
129
  isBackground: true,
138
130
  background: () => highestSurface(ctx, colors),