@udixio/theme 1.1.0 → 1.3.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 (98) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/bin/main.ts +85 -0
  3. package/dist/API.d.ts +1 -0
  4. package/dist/API.d.ts.map +1 -1
  5. package/dist/bin.cjs +64 -0
  6. package/dist/bin.js +63 -0
  7. package/dist/browser.cjs +39 -0
  8. package/dist/browser.js +39 -0
  9. package/dist/color/color.manager.d.ts.map +1 -1
  10. package/dist/color/default-color.d.ts.map +1 -1
  11. package/dist/config/config.interface.d.ts.map +1 -0
  12. package/dist/config/define-config.d.ts.map +1 -0
  13. package/dist/config/index.d.ts +3 -0
  14. package/dist/config/index.d.ts.map +1 -0
  15. package/dist/config/index.node.d.ts +2 -0
  16. package/dist/config/index.node.d.ts.map +1 -0
  17. package/dist/config/resolver-config.d.ts +11 -0
  18. package/dist/config/resolver-config.d.ts.map +1 -0
  19. package/dist/define-config-B1QPKKY_.js +430 -0
  20. package/dist/define-config-BGgVazsr.cjs +429 -0
  21. package/dist/index.browser.d.ts +2 -0
  22. package/dist/index.browser.d.ts.map +1 -0
  23. package/dist/index.d.ts +2 -2
  24. package/dist/index.d.ts.map +1 -1
  25. package/dist/index.node.d.ts +4 -0
  26. package/dist/index.node.d.ts.map +1 -0
  27. package/dist/load-from-path-BSrT4DOj.js +39 -0
  28. package/dist/load-from-path-BuN8RpOs.cjs +78 -0
  29. package/dist/loader/index.d.ts +2 -0
  30. package/dist/loader/index.d.ts.map +1 -0
  31. package/dist/loader/index.node.d.ts +3 -0
  32. package/dist/loader/index.node.d.ts.map +1 -0
  33. package/dist/loader/load-from-path.d.ts +5 -0
  34. package/dist/loader/load-from-path.d.ts.map +1 -0
  35. package/dist/loader/loader.d.ts +3 -0
  36. package/dist/loader/loader.d.ts.map +1 -0
  37. package/dist/loader/unplugin.d.ts +16 -0
  38. package/dist/loader/unplugin.d.ts.map +1 -0
  39. package/dist/{index.js → loader-Bc0bstAD.js} +172 -661
  40. package/dist/{index.cjs → loader-YNN5hAF3.cjs} +148 -678
  41. package/dist/material-color-utilities/dynamic_color.d.ts +9 -15
  42. package/dist/material-color-utilities/dynamic_color.d.ts.map +1 -1
  43. package/dist/material-color-utilities/toneDeltaPair.d.ts +9 -2
  44. package/dist/material-color-utilities/toneDeltaPair.d.ts.map +1 -1
  45. package/dist/node.cjs +191 -0
  46. package/dist/node.js +170 -0
  47. package/dist/plugin/plugin.api.d.ts +1 -1
  48. package/dist/plugin/plugin.api.d.ts.map +1 -1
  49. package/dist/theme/scheme.d.ts +1 -1
  50. package/dist/theme/scheme.d.ts.map +1 -1
  51. package/dist/theme/variants/fidelity.variant.d.ts +3 -0
  52. package/dist/theme/variants/fidelity.variant.d.ts.map +1 -0
  53. package/dist/theme/variants/index.d.ts +1 -0
  54. package/dist/theme/variants/index.d.ts.map +1 -1
  55. package/package.json +27 -10
  56. package/src/API.ts +4 -0
  57. package/src/color/color.manager.ts +10 -8
  58. package/src/color/default-color.ts +82 -34
  59. package/src/config/index.node.ts +1 -0
  60. package/src/{adapter → config}/index.ts +0 -1
  61. package/src/config/resolver-config.ts +49 -0
  62. package/src/index.browser.ts +1 -0
  63. package/src/index.node.ts +3 -0
  64. package/src/index.ts +2 -2
  65. package/src/loader/index.node.ts +2 -0
  66. package/src/loader/index.ts +1 -0
  67. package/src/loader/load-from-path.ts +9 -0
  68. package/src/{adapter/adapter.abstract.ts → loader/loader.ts} +23 -28
  69. package/src/loader/unplugin.ts +158 -0
  70. package/src/material-color-utilities/dynamic_color.ts +18 -120
  71. package/src/material-color-utilities/toneDeltaPair.ts +91 -2
  72. package/src/plugin/plugin.api.ts +4 -4
  73. package/src/theme/scheme.ts +7 -1
  74. package/src/theme/variants/fidelity.variant.ts +38 -0
  75. package/src/theme/variants/index.ts +2 -0
  76. package/vite.config.ts +18 -4
  77. package/dist/adapter/adapter.abstract.d.ts +0 -10
  78. package/dist/adapter/adapter.abstract.d.ts.map +0 -1
  79. package/dist/adapter/config.interface.d.ts.map +0 -1
  80. package/dist/adapter/define-config.d.ts.map +0 -1
  81. package/dist/adapter/file-adapter.mixin.d.ts +0 -18
  82. package/dist/adapter/file-adapter.mixin.d.ts.map +0 -1
  83. package/dist/adapter/index.d.ts +0 -4
  84. package/dist/adapter/index.d.ts.map +0 -1
  85. package/dist/adapters/index.d.ts +0 -3
  86. package/dist/adapters/index.d.ts.map +0 -1
  87. package/dist/adapters/node.adapter.d.ts +0 -7
  88. package/dist/adapters/node.adapter.d.ts.map +0 -1
  89. package/dist/adapters/vite.adapter.d.ts +0 -3
  90. package/dist/adapters/vite.adapter.d.ts.map +0 -1
  91. package/src/adapter/file-adapter.mixin.ts +0 -72
  92. package/src/adapters/index.ts +0 -2
  93. package/src/adapters/node.adapter.ts +0 -57
  94. package/src/adapters/vite.adapter.ts +0 -79
  95. /package/dist/{adapter → config}/config.interface.d.ts +0 -0
  96. /package/dist/{adapter → config}/define-config.d.ts +0 -0
  97. /package/src/{adapter → config}/config.interface.ts +0 -0
  98. /package/src/{adapter → config}/define-config.ts +0 -0
@@ -1,6 +1,5 @@
1
1
  import { TonalPalette } from '@material/material-color-utilities';
2
2
  import { ContrastCurve } from './contrastCurve';
3
- import { ToneDeltaPair } from './toneDeltaPair';
4
3
  import { Scheme } from '../theme/scheme';
5
4
  import { Hct } from './htc';
6
5
  /**
@@ -24,7 +23,7 @@ import { Hct } from './htc';
24
23
  * against its background should behave in various contrast levels options.
25
24
  * Must used together with `background`. When not provided or resolved as
26
25
  * undefined, the contrast curve is calculated based on other constraints.
27
- * @param toneDeltaPair A `ToneDeltaPair` object specifying a tone delta
26
+ * @param adjustTone A `AdjustTone` object specifying a tone delta
28
27
  * constraint between two colors. One of them must be the color being
29
28
  * constructed. When not provided or resolved as undefined, the tone is
30
29
  * calculated based on other constraints.
@@ -38,17 +37,12 @@ export interface FromPaletteOptions {
38
37
  background?: (scheme: Scheme) => DynamicColor | undefined;
39
38
  secondBackground?: (scheme: Scheme) => DynamicColor | undefined;
40
39
  contrastCurve?: (scheme: Scheme) => ContrastCurve | undefined;
41
- toneDeltaPair?: (scheme: Scheme) => ToneDeltaPair | undefined;
40
+ adjustTone?: (scheme: Scheme) => AdjustTone | undefined;
42
41
  }
43
- /**
44
- * Returns a new DynamicColor that is the same as the original color, but with
45
- * the extended dynamic color's constraints for the given spec version.
46
- *
47
- * @param originlColor The original color.
48
- * @param specVersion The spec version to extend.
49
- * @param extendedColor The color with the values to extend.
50
- */
51
- export declare function extendSpecVersion(originlColor: DynamicColor, extendedColor: DynamicColor): DynamicColor;
42
+ export type AdjustTone = (args: {
43
+ scheme: Scheme;
44
+ dynamicColor: DynamicColor;
45
+ }) => number;
52
46
  /**
53
47
  * A color that adjusts itself based on UI state provided by DynamicScheme.
54
48
  *
@@ -69,7 +63,7 @@ export declare class DynamicColor {
69
63
  readonly background?: ((scheme: Scheme) => DynamicColor | undefined) | undefined;
70
64
  readonly secondBackground?: ((scheme: Scheme) => DynamicColor | undefined) | undefined;
71
65
  readonly contrastCurve?: ((scheme: Scheme) => ContrastCurve | undefined) | undefined;
72
- readonly toneDeltaPair?: ((scheme: Scheme) => ToneDeltaPair | undefined) | undefined;
66
+ readonly adjustTone?: ((scheme: Scheme) => AdjustTone | undefined) | undefined;
73
67
  private readonly hctCache;
74
68
  /**
75
69
  * The base constructor for DynamicColor.
@@ -100,11 +94,11 @@ export declare class DynamicColor {
100
94
  * @param contrastCurve A `ContrastCurve` object specifying how its contrast
101
95
  * against its background should behave in various contrast levels
102
96
  * options.
103
- * @param toneDeltaPair A `ToneDeltaPair` object specifying a tone delta
97
+ * @param adjustTone A `AdjustTone` object specifying a tone delta
104
98
  * constraint between two colors. One of them must be the color being
105
99
  * constructed.
106
100
  */
107
- constructor(name: string, palette: (scheme: Scheme) => TonalPalette, tone: (scheme: Scheme) => number, isBackground: boolean, chromaMultiplier?: ((scheme: Scheme) => number) | undefined, background?: ((scheme: Scheme) => DynamicColor | undefined) | undefined, secondBackground?: ((scheme: Scheme) => DynamicColor | undefined) | undefined, contrastCurve?: ((scheme: Scheme) => ContrastCurve | undefined) | undefined, toneDeltaPair?: ((scheme: Scheme) => ToneDeltaPair | undefined) | undefined);
101
+ constructor(name: string, palette: (scheme: Scheme) => TonalPalette, tone: (scheme: Scheme) => number, isBackground: boolean, chromaMultiplier?: ((scheme: Scheme) => number) | undefined, background?: ((scheme: Scheme) => DynamicColor | undefined) | undefined, secondBackground?: ((scheme: Scheme) => DynamicColor | undefined) | undefined, contrastCurve?: ((scheme: Scheme) => ContrastCurve | undefined) | undefined, adjustTone?: ((scheme: Scheme) => AdjustTone | undefined) | undefined);
108
102
  /**
109
103
  * Create a DynamicColor defined by a TonalPalette and HCT tone.
110
104
  *
@@ -1 +1 @@
1
- {"version":3,"file":"dynamic_color.d.ts","sourceRoot":"","sources":["../../src/material-color-utilities/dynamic_color.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAyB,YAAY,EAAE,MAAM,oCAAoC,CAAC;AACzF,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5B;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,WAAW,kBAAkB;IACjC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,YAAY,CAAC;IAC1C,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAAC;IAClC,gBAAgB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAAC;IAC9C,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,UAAU,CAAC,EAAE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7D,UAAU,CAAC,GAAE,CAAC,MAAM,EAAE,MAAM,KAAK,UAAU,GAAG,SAAS,aAAA;IAsBlE;;;;;OAKG;IACH,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE,kBAAkB,GAAG,YAAY;IAc1D,MAAM,CAAC,4BAA4B,CACjC,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,YAAY,GAAG,SAAS,GACxD,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM;IAO7B;;;;;;;;OAQG;IACH,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM;IAiC5D;;;;;;;;;;OAUG;IACH,MAAM,CAAC,0BAA0B,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAIxD;;;OAGG;IACH,MAAM,CAAC,yBAAyB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAIvD;;;OAGG;IACH,MAAM,CAAC,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAUlD;;OAEG;IACH,KAAK,IAAI,YAAY;IAcrB;;;OAGG;IACH,UAAU;IAIV;;;;;;OAMG;IACH,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;IAI/B;;;;;;;OAOG;IACH,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;IAW3B;;;;;;;OAOG;IACH,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;CA6FhC"}
@@ -1,4 +1,5 @@
1
- import { DynamicColor } from './dynamic_color';
1
+ import { AdjustTone, DynamicColor } from './dynamic_color';
2
+ import { Scheme } from '../theme';
2
3
  /**
3
4
  * Describes the different in tone between colors.
4
5
  *
@@ -17,7 +18,7 @@ export type DeltaConstraint = 'exact' | 'nearer' | 'farther';
17
18
  * designers want tonal distance, literally contrast, between two colors that
18
19
  * don't have a background / foreground relationship or a contrast guarantee.
19
20
  */
20
- export declare class ToneDeltaPair {
21
+ declare class ToneDeltaPair {
21
22
  readonly roleA: DynamicColor;
22
23
  readonly roleB: DynamicColor;
23
24
  readonly delta: number;
@@ -50,5 +51,11 @@ export declare class ToneDeltaPair {
50
51
  * one role has two backgrounds.
51
52
  */
52
53
  constructor(roleA: DynamicColor, roleB: DynamicColor, delta: number, polarity: TonePolarity, stayTogether: boolean, constraint?: DeltaConstraint | undefined);
54
+ adjustedTone({ scheme, dynamicColor, }: {
55
+ scheme: Scheme;
56
+ dynamicColor: DynamicColor;
57
+ }): number;
53
58
  }
59
+ export declare const toneDeltaPair: (...params: ConstructorParameters<typeof ToneDeltaPair>) => AdjustTone;
60
+ export {};
54
61
  //# sourceMappingURL=toneDeltaPair.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"toneDeltaPair.d.ts","sourceRoot":"","sources":["../../src/material-color-utilities/toneDeltaPair.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C;;;;GAIG;AACH,MAAM,MAAM,YAAY,GACpB,QAAQ,GACR,SAAS,GACT,QAAQ,GACR,SAAS,GACT,iBAAiB,GACjB,kBAAkB,CAAC;AAEvB;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,CAAC;AAE7D;;;;;;;GAOG;AACH,qBAAa,aAAa;IA2BtB,QAAQ,CAAC,KAAK,EAAE,YAAY;IAC5B,QAAQ,CAAC,KAAK,EAAE,YAAY;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM;IACtB,QAAQ,CAAC,QAAQ,EAAE,YAAY;IAC/B,QAAQ,CAAC,YAAY,EAAE,OAAO;IAC9B,QAAQ,CAAC,UAAU,CAAC,EAAE,eAAe;IA/BvC;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;gBAEQ,KAAK,EAAE,YAAY,EACnB,KAAK,EAAE,YAAY,EACnB,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,YA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1,191 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") {
10
+ for (let key of __getOwnPropNames(from))
11
+ if (!__hasOwnProp.call(to, key) && key !== except)
12
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
+ }
14
+ return to;
15
+ };
16
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
17
+ // If the importer is in node compatibility mode or this is not an ESM
18
+ // file that has been converted to a CommonJS file using a Babel-
19
+ // compatible transform (i.e. "__esModule" has not been set), then set
20
+ // "default" to the CommonJS "module.exports" for node compatibility.
21
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
+ mod
23
+ ));
24
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
25
+ const loader = require("./loader-YNN5hAF3.cjs");
26
+ const defineConfig = require("./define-config-BGgVazsr.cjs");
27
+ const loadFromPath = require("./load-from-path-BuN8RpOs.cjs");
28
+ let unpluginInstance = null;
29
+ const createUnpluginTheme = async () => {
30
+ if (unpluginInstance) {
31
+ return unpluginInstance;
32
+ }
33
+ const { createUnplugin } = await import("unplugin");
34
+ unpluginInstance = createUnplugin((options = {}) => {
35
+ const { configPath = "./theme.config", verbose = false } = options;
36
+ let resolvedConfigPath;
37
+ if (global.NX_GRAPH_CREATION) {
38
+ return {
39
+ name: "udixio-theme"
40
+ };
41
+ }
42
+ const loadTheme = async () => {
43
+ try {
44
+ if (verbose) {
45
+ console.log(`🎨 Loading theme from: ${configPath}`);
46
+ }
47
+ const result = await loadFromPath.loadFromPath(configPath);
48
+ if (!resolvedConfigPath && (result == null ? void 0 : result.filePath)) {
49
+ resolvedConfigPath = result.filePath;
50
+ }
51
+ if (verbose) {
52
+ console.log(`✅ Theme loaded successfully!`);
53
+ }
54
+ } catch (error) {
55
+ console.error(`❌ Theme loading failed:`, error);
56
+ throw error;
57
+ }
58
+ };
59
+ return {
60
+ name: "udixio-theme",
61
+ // Hook appelé au début du build (tous les bundlers)
62
+ buildStart: async () => {
63
+ await loadTheme();
64
+ },
65
+ // Hook appelé pendant la génération (Rollup/Vite)
66
+ generateBundle: async () => {
67
+ await loadTheme();
68
+ },
69
+ // Support spécifique Vite pour HMR
70
+ vite: {
71
+ handleHotUpdate: async ({ server, file, modules }) => {
72
+ if (!resolvedConfigPath) {
73
+ const result = await loadFromPath.loadFromPath(configPath);
74
+ resolvedConfigPath = (result == null ? void 0 : result.filePath) || "";
75
+ }
76
+ if (resolvedConfigPath === file) {
77
+ if (verbose) {
78
+ console.log(`🔄 Theme config changed: ${file}`);
79
+ }
80
+ await loadTheme();
81
+ server.ws.send({ type: "full-reload", path: "*" });
82
+ return modules;
83
+ }
84
+ return;
85
+ }
86
+ },
87
+ // Support spécifique Webpack pour HMR
88
+ webpack: (compiler) => {
89
+ if (compiler.options.mode === "development") {
90
+ compiler.hooks.watchRun.tapAsync(
91
+ "udixio-theme",
92
+ async (compilation, callback) => {
93
+ const changedFiles = compilation.modifiedFiles || /* @__PURE__ */ new Set();
94
+ if (!resolvedConfigPath) {
95
+ const result = await loadFromPath.loadFromPath(configPath);
96
+ resolvedConfigPath = (result == null ? void 0 : result.filePath) || "";
97
+ }
98
+ if (changedFiles.has(resolvedConfigPath)) {
99
+ if (verbose) {
100
+ console.log(`🔄 Theme config changed: ${resolvedConfigPath}`);
101
+ }
102
+ await loadTheme();
103
+ }
104
+ callback();
105
+ }
106
+ );
107
+ }
108
+ },
109
+ // Support spécifique Rollup
110
+ rollup: {
111
+ watchChange: async (id) => {
112
+ if (!resolvedConfigPath) {
113
+ const result = await loadFromPath.loadFromPath(configPath);
114
+ resolvedConfigPath = (result == null ? void 0 : result.filePath) || "";
115
+ }
116
+ if (resolvedConfigPath === id) {
117
+ if (verbose) {
118
+ console.log(`🔄 Theme config changed: ${id}`);
119
+ }
120
+ await loadTheme();
121
+ }
122
+ }
123
+ }
124
+ };
125
+ });
126
+ return unpluginInstance;
127
+ };
128
+ const vitePlugin = async (options) => {
129
+ const plugin = await createUnpluginTheme();
130
+ return plugin.vite(options);
131
+ };
132
+ const webpackPlugin = async (options) => {
133
+ const plugin = await createUnpluginTheme();
134
+ return plugin.webpack(options);
135
+ };
136
+ const rollupPlugin = async (options) => {
137
+ const plugin = await createUnpluginTheme();
138
+ return plugin.rollup(options);
139
+ };
140
+ const esbuildPlugin = async (options) => {
141
+ const plugin = await createUnpluginTheme();
142
+ return plugin.esbuild(options);
143
+ };
144
+ const unpluginUdixioTheme = {
145
+ vite: vitePlugin,
146
+ webpack: webpackPlugin,
147
+ rollup: rollupPlugin,
148
+ esbuild: esbuildPlugin
149
+ };
150
+ exports.API = loader.API;
151
+ exports.AppContainer = loader.AppContainer;
152
+ exports.AppModule = loader.AppModule;
153
+ exports.ColorApi = loader.ColorApi;
154
+ exports.ColorManager = loader.ColorManager;
155
+ exports.ColorModule = loader.ColorModule;
156
+ exports.ConfigurableColor = loader.ConfigurableColor;
157
+ exports.ContrastCurve = loader.ContrastCurve;
158
+ exports.DynamicColor = loader.DynamicColor;
159
+ exports.PluginApi = loader.PluginApi;
160
+ exports.PluginModule = loader.PluginModule;
161
+ exports.Scheme = loader.Scheme;
162
+ exports.SchemeManager = loader.SchemeManager;
163
+ exports.ThemeApi = loader.ThemeApi;
164
+ exports.ThemeModule = loader.ThemeModule;
165
+ exports.Variant = loader.Variant;
166
+ exports.VariantManager = loader.VariantManager;
167
+ exports.bootstrap = loader.bootstrap;
168
+ exports.defaultColors = loader.defaultColors;
169
+ exports.getPiecewiseHue = loader.getPiecewiseHue;
170
+ exports.getRotatedHue = loader.getRotatedHue;
171
+ exports.highestSurface = loader.highestSurface;
172
+ exports.loader = loader.loader;
173
+ exports.registerModule = loader.registerModule;
174
+ exports.tonalSpotVariant = loader.tonalSpotVariant;
175
+ exports.toneDeltaPair = loader.toneDeltaPair;
176
+ exports.FontFamily = defineConfig.FontFamily;
177
+ exports.FontPlugin = defineConfig.FontPlugin;
178
+ exports.PluginAbstract = defineConfig.PluginAbstract;
179
+ exports.PluginImplAbstract = defineConfig.PluginImplAbstract;
180
+ exports.Variants = defineConfig.Variants;
181
+ exports.defineConfig = defineConfig.defineConfig;
182
+ exports.expressiveVariant = defineConfig.expressiveVariant;
183
+ exports.neutralVariant = defineConfig.neutralVariant;
184
+ exports.vibrantVariant = defineConfig.vibrantVariant;
185
+ exports.loadFromPath = loadFromPath.loadFromPath;
186
+ exports.resolveConfig = loadFromPath.resolveConfig;
187
+ exports.esbuildPlugin = esbuildPlugin;
188
+ exports.rollupPlugin = rollupPlugin;
189
+ exports.unpluginUdixioTheme = unpluginUdixioTheme;
190
+ exports.vitePlugin = vitePlugin;
191
+ exports.webpackPlugin = webpackPlugin;
package/dist/node.js ADDED
@@ -0,0 +1,170 @@
1
+ import { b, A, a, C, c, d, e, i, D, j, P, m, S, n, T, V, q, g, f, o, p, h, l, r, k, t } from "./loader-Bc0bstAD.js";
2
+ import { F, b as b2, P as P2, a as a2, V as V2, d as d2, e as e2, n as n2, v } from "./define-config-B1QPKKY_.js";
3
+ import { l as loadFromPath } from "./load-from-path-BSrT4DOj.js";
4
+ import { r as r2 } from "./load-from-path-BSrT4DOj.js";
5
+ let unpluginInstance = null;
6
+ const createUnpluginTheme = async () => {
7
+ if (unpluginInstance) {
8
+ return unpluginInstance;
9
+ }
10
+ const { createUnplugin } = await import("unplugin");
11
+ unpluginInstance = createUnplugin((options = {}) => {
12
+ const { configPath = "./theme.config", verbose = false } = options;
13
+ let resolvedConfigPath;
14
+ if (global.NX_GRAPH_CREATION) {
15
+ return {
16
+ name: "udixio-theme"
17
+ };
18
+ }
19
+ const loadTheme = async () => {
20
+ try {
21
+ if (verbose) {
22
+ console.log(`🎨 Loading theme from: ${configPath}`);
23
+ }
24
+ const result = await loadFromPath(configPath);
25
+ if (!resolvedConfigPath && (result == null ? void 0 : result.filePath)) {
26
+ resolvedConfigPath = result.filePath;
27
+ }
28
+ if (verbose) {
29
+ console.log(`✅ Theme loaded successfully!`);
30
+ }
31
+ } catch (error) {
32
+ console.error(`❌ Theme loading failed:`, error);
33
+ throw error;
34
+ }
35
+ };
36
+ return {
37
+ name: "udixio-theme",
38
+ // Hook appelé au début du build (tous les bundlers)
39
+ buildStart: async () => {
40
+ await loadTheme();
41
+ },
42
+ // Hook appelé pendant la génération (Rollup/Vite)
43
+ generateBundle: async () => {
44
+ await loadTheme();
45
+ },
46
+ // Support spécifique Vite pour HMR
47
+ vite: {
48
+ handleHotUpdate: async ({ server, file, modules }) => {
49
+ if (!resolvedConfigPath) {
50
+ const result = await loadFromPath(configPath);
51
+ resolvedConfigPath = (result == null ? void 0 : result.filePath) || "";
52
+ }
53
+ if (resolvedConfigPath === file) {
54
+ if (verbose) {
55
+ console.log(`🔄 Theme config changed: ${file}`);
56
+ }
57
+ await loadTheme();
58
+ server.ws.send({ type: "full-reload", path: "*" });
59
+ return modules;
60
+ }
61
+ return;
62
+ }
63
+ },
64
+ // Support spécifique Webpack pour HMR
65
+ webpack: (compiler) => {
66
+ if (compiler.options.mode === "development") {
67
+ compiler.hooks.watchRun.tapAsync(
68
+ "udixio-theme",
69
+ async (compilation, callback) => {
70
+ const changedFiles = compilation.modifiedFiles || /* @__PURE__ */ new Set();
71
+ if (!resolvedConfigPath) {
72
+ const result = await loadFromPath(configPath);
73
+ resolvedConfigPath = (result == null ? void 0 : result.filePath) || "";
74
+ }
75
+ if (changedFiles.has(resolvedConfigPath)) {
76
+ if (verbose) {
77
+ console.log(`🔄 Theme config changed: ${resolvedConfigPath}`);
78
+ }
79
+ await loadTheme();
80
+ }
81
+ callback();
82
+ }
83
+ );
84
+ }
85
+ },
86
+ // Support spécifique Rollup
87
+ rollup: {
88
+ watchChange: async (id) => {
89
+ if (!resolvedConfigPath) {
90
+ const result = await loadFromPath(configPath);
91
+ resolvedConfigPath = (result == null ? void 0 : result.filePath) || "";
92
+ }
93
+ if (resolvedConfigPath === id) {
94
+ if (verbose) {
95
+ console.log(`🔄 Theme config changed: ${id}`);
96
+ }
97
+ await loadTheme();
98
+ }
99
+ }
100
+ }
101
+ };
102
+ });
103
+ return unpluginInstance;
104
+ };
105
+ const vitePlugin = async (options) => {
106
+ const plugin = await createUnpluginTheme();
107
+ return plugin.vite(options);
108
+ };
109
+ const webpackPlugin = async (options) => {
110
+ const plugin = await createUnpluginTheme();
111
+ return plugin.webpack(options);
112
+ };
113
+ const rollupPlugin = async (options) => {
114
+ const plugin = await createUnpluginTheme();
115
+ return plugin.rollup(options);
116
+ };
117
+ const esbuildPlugin = async (options) => {
118
+ const plugin = await createUnpluginTheme();
119
+ return plugin.esbuild(options);
120
+ };
121
+ const unpluginUdixioTheme = {
122
+ vite: vitePlugin,
123
+ webpack: webpackPlugin,
124
+ rollup: rollupPlugin,
125
+ esbuild: esbuildPlugin
126
+ };
127
+ export {
128
+ b as API,
129
+ A as AppContainer,
130
+ a as AppModule,
131
+ C as ColorApi,
132
+ c as ColorManager,
133
+ d as ColorModule,
134
+ e as ConfigurableColor,
135
+ i as ContrastCurve,
136
+ D as DynamicColor,
137
+ F as FontFamily,
138
+ b2 as FontPlugin,
139
+ P2 as PluginAbstract,
140
+ j as PluginApi,
141
+ a2 as PluginImplAbstract,
142
+ P as PluginModule,
143
+ m as Scheme,
144
+ S as SchemeManager,
145
+ n as ThemeApi,
146
+ T as ThemeModule,
147
+ V as Variant,
148
+ q as VariantManager,
149
+ V2 as Variants,
150
+ g as bootstrap,
151
+ f as defaultColors,
152
+ d2 as defineConfig,
153
+ esbuildPlugin,
154
+ e2 as expressiveVariant,
155
+ o as getPiecewiseHue,
156
+ p as getRotatedHue,
157
+ h as highestSurface,
158
+ loadFromPath,
159
+ l as loader,
160
+ n2 as neutralVariant,
161
+ r as registerModule,
162
+ r2 as resolveConfig,
163
+ rollupPlugin,
164
+ k as tonalSpotVariant,
165
+ t as toneDeltaPair,
166
+ unpluginUdixioTheme,
167
+ v as vibrantVariant,
168
+ vitePlugin,
169
+ webpackPlugin
170
+ };
@@ -4,7 +4,7 @@ export declare class PluginApi {
4
4
  private plugins;
5
5
  addPlugin(plugin: PluginAbstract<any, any>): void;
6
6
  initPlugins(api: API): void;
7
- loadPlugins(): void;
7
+ loadPlugins(): Promise<void>;
8
8
  getPlugin<T extends PluginAbstract<any, any>>(plugin: new (...args: any) => T): T;
9
9
  }
10
10
  //# sourceMappingURL=plugin.api.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.api.d.ts","sourceRoot":"","sources":["../../src/plugin/plugin.api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAE7B,qBAAa,SAAS;IACpB,OAAO,CAAC,OAAO,CAA+C;IAEvD,SAAS,CAAC,MAAM,EAAE,cAAc,CAAC,GAAG,EAAE,GAAG,CAAC;IAI1C,WAAW,CAAC,GAAG,EAAE,GAAG;IA2BpB,WAAW;IAMX,SAAS,CAAC,CAAC,SAAS,cAAc,CAAC,GAAG,EAAE,GAAG,CAAC,EACjD,MAAM,EAAE,KAAK,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC,GAC9B,CAAC;CAKL"}
1
+ {"version":3,"file":"plugin.api.d.ts","sourceRoot":"","sources":["../../src/plugin/plugin.api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAE7B,qBAAa,SAAS;IACpB,OAAO,CAAC,OAAO,CAA+C;IAEvD,SAAS,CAAC,MAAM,EAAE,cAAc,CAAC,GAAG,EAAE,GAAG,CAAC;IAI1C,WAAW,CAAC,GAAG,EAAE,GAAG;IA2Bd,WAAW;IAMjB,SAAS,CAAC,CAAC,SAAS,cAAc,CAAC,GAAG,EAAE,GAAG,CAAC,EACjD,MAAM,EAAE,KAAK,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC,GAC9B,CAAC;CAKL"}
@@ -11,7 +11,7 @@ export interface SchemeOptions {
11
11
  export declare class Scheme {
12
12
  readonly options: SchemeOptions;
13
13
  constructor(options: SchemeOptions);
14
- get variant(): 'expressive' | 'neutral' | 'tonalSpot' | 'vibrant' | string;
14
+ get variant(): 'expressive' | 'neutral' | 'tonalSpot' | 'vibrant' | 'fidelity' | string;
15
15
  get contrastLevel(): number;
16
16
  get isDark(): boolean;
17
17
  get sourceColorHct(): Hct;
@@ -1 +1 @@
1
- {"version":3,"file":"scheme.d.ts","sourceRoot":"","sources":["../../src/theme/scheme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAClE,OAAO,EAAE,GAAG,EAAE,MAAM,iCAAiC,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,MAAM,WAAW,aAAa;IAC5B,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IACpC,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,qBAAa,MAAM;IACL,QAAQ,CAAC,OAAO,EAAE,aAAa;gBAAtB,OAAO,EAAE,aAAa;IAE3C,IAAI,OAAO,IAAI,YAAY,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,MAAM,CAEzE;IAED,IAAI,aAAa,WAKhB;IAED,IAAI,MAAM,YAKT;IAED,IAAI,cAAc,QAKjB;IAED,UAAU,CACR,GAAG,EACC,SAAS,GACT,WAAW,GACX,UAAU,GACV,SAAS,GACT,gBAAgB,GAChB,OAAO,GACP,MAAM,GACT,YAAY;CAUhB"}
1
+ {"version":3,"file":"scheme.d.ts","sourceRoot":"","sources":["../../src/theme/scheme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAClE,OAAO,EAAE,GAAG,EAAE,MAAM,iCAAiC,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,MAAM,WAAW,aAAa;IAC5B,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IACpC,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,qBAAa,MAAM;IACL,QAAQ,CAAC,OAAO,EAAE,aAAa;gBAAtB,OAAO,EAAE,aAAa;IAE3C,IAAI,OAAO,IACP,YAAY,GACZ,SAAS,GACT,WAAW,GACX,SAAS,GACT,UAAU,GACV,MAAM,CAET;IAED,IAAI,aAAa,WAKhB;IAED,IAAI,MAAM,YAKT;IAED,IAAI,cAAc,QAKjB;IAED,UAAU,CACR,GAAG,EACC,SAAS,GACT,WAAW,GACX,UAAU,GACV,SAAS,GACT,gBAAgB,GAChB,OAAO,GACP,MAAM,GACT,YAAY;CAUhB"}
@@ -0,0 +1,3 @@
1
+ import { Variant } from '../variant';
2
+ export declare const fidelityVariant: Variant;
3
+ //# sourceMappingURL=fidelity.variant.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fidelity.variant.d.ts","sourceRoot":"","sources":["../../../src/theme/variants/fidelity.variant.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkC,OAAO,EAAE,MAAM,YAAY,CAAC;AAGrE,eAAO,MAAM,eAAe,EAAE,OAkC7B,CAAC"}
@@ -7,5 +7,6 @@ export declare const Variants: {
7
7
  Neutral: import('..').Variant;
8
8
  TonalSpot: import('..').Variant;
9
9
  Vibrant: import('..').Variant;
10
+ Fidelity: import('..').Variant;
10
11
  };
11
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/theme/variants/index.ts"],"names":[],"mappings":"AAKA,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAElC,eAAO,MAAM,QAAQ;;;;;CAKpB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/theme/variants/index.ts"],"names":[],"mappings":"AAMA,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAElC,eAAO,MAAM,QAAQ;;;;;;CAMpB,CAAC"}
package/package.json CHANGED
@@ -1,28 +1,45 @@
1
1
  {
2
2
  "name": "@udixio/theme",
3
- "version": "1.1.0",
3
+ "version": "1.3.0",
4
4
  "type": "module",
5
- "main": "./dist/index.js",
6
- "module": "./dist/index.js",
7
- "types": "./dist/index.d.ts",
5
+ "main": "./dist/node.js",
6
+ "module": "./dist/node.js",
7
+ "types": "./dist/node.d.ts",
8
8
  "exports": {
9
9
  "./package.json": "./package.json",
10
10
  ".": {
11
- "development": "./src/index.ts",
12
- "types": "./dist/index.d.ts",
13
- "import": "./dist/index.js",
14
- "require": "./dist/index.cjs",
15
- "default": "./dist/index.js"
11
+ "development": "./src/index.node.ts",
12
+ "types": "./dist/index.node.d.ts",
13
+ "browser": {
14
+ "import": "./dist/browser.js",
15
+ "require": "./dist/browser.cjs"
16
+ },
17
+ "node": {
18
+ "import": "./dist/node.js",
19
+ "require": "./dist/node.cjs",
20
+ "default": "./dist/node.js"
21
+ },
22
+ "import": "./dist/node.js",
23
+ "require": "./dist/node.cjs"
16
24
  }
17
25
  },
26
+ "bin": {
27
+ "udixio-theme": "./dist/bin.js"
28
+ },
18
29
  "dependencies": {
19
30
  "pathe": "^2.0.3",
20
31
  "jiti": "^2.5.1",
21
32
  "awilix": "^12.0.5",
22
33
  "@material/material-color-utilities": "^0.3.0",
23
34
  "replace-in-file": "^8.3.0",
24
- "tailwindcss": "^4.1.11"
35
+ "tailwindcss": "^4.1.11",
36
+ "chokidar": "^4.0.3",
37
+ "mri": "^1.2.0",
38
+ "commander": "^14.0.0",
39
+ "chalk": "^5.6.0",
40
+ "unplugin": "^2.3.8"
25
41
  },
42
+ "devDependencies": {},
26
43
  "repository": {
27
44
  "type": "git",
28
45
  "url": "https://github.com/Udixio/UI.git"
package/src/API.ts CHANGED
@@ -20,4 +20,8 @@ export class API {
20
20
  this.colors = colorApi;
21
21
  this.themes = themeApi;
22
22
  }
23
+
24
+ async load() {
25
+ return this.plugins.loadPlugins();
26
+ }
23
27
  }
@@ -1,4 +1,4 @@
1
- import { DynamicColor, ToneDeltaPair } from '../material-color-utilities';
1
+ import { DynamicColor, toneDeltaPair } from '../material-color-utilities';
2
2
  import { Scheme, SchemeManager } from '../theme';
3
3
 
4
4
  import { ColorOptions, ConfigurableColor } from './configurable-color';
@@ -91,6 +91,8 @@ export class ColorManager {
91
91
  const onColorContainerKey = ('on' +
92
92
  ColorKey +
93
93
  'Container') as DynamicColorKey;
94
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
95
+ // @ts-expect-error
94
96
  const inverseColorKey = ('inverse' + ColorKey) as DynamicColorKey;
95
97
  const colorFixedKey = (colorKey + 'Fixed') as DynamicColorKey;
96
98
  const colorFixedDimKey = (colorKey + 'FixedDim') as DynamicColorKey;
@@ -115,8 +117,8 @@ export class ColorManager {
115
117
  isBackground: true,
116
118
  background: (s) => highestSurface(s, this),
117
119
  contrastCurve: (s) => getCurve(4.5),
118
- toneDeltaPair: (s) =>
119
- new ToneDeltaPair(
120
+ adjustTone: (s) =>
121
+ toneDeltaPair(
120
122
  this.get(colorContainerKey).getMaterialColor(),
121
123
  this.get(colorKey).getMaterialColor(),
122
124
  5,
@@ -137,8 +139,8 @@ export class ColorManager {
137
139
  isBackground: true,
138
140
  background: (s) => this.get('surfaceContainerHigh').getMaterialColor(),
139
141
  contrastCurve: (s) => getCurve(4.5),
140
- toneDeltaPair: (s) =>
141
- new ToneDeltaPair(
142
+ adjustTone: (s) =>
143
+ toneDeltaPair(
142
144
  this.get(colorDimKey).getMaterialColor(),
143
145
  this.get(colorKey).getMaterialColor(),
144
146
  5,
@@ -167,7 +169,7 @@ export class ColorManager {
167
169
  },
168
170
  isBackground: true,
169
171
  background: (s) => highestSurface(s, this),
170
- toneDeltaPair: (s) => undefined,
172
+ adjustTone: (s) => undefined,
171
173
  contrastCurve: (s) => (s.contrastLevel > 0 ? getCurve(1.5) : undefined),
172
174
  });
173
175
  this.createOrUpdate(onColorContainerKey, {
@@ -189,8 +191,8 @@ export class ColorManager {
189
191
  palette: (s) => s.getPalette(colorKey),
190
192
  tone: (s) => this.get(colorFixedKey).getMaterialColor().getTone(s),
191
193
  isBackground: true,
192
- toneDeltaPair: (s) =>
193
- new ToneDeltaPair(
194
+ adjustTone: (s) =>
195
+ toneDeltaPair(
194
196
  this.get(colorFixedDimKey).getMaterialColor(),
195
197
  this.get(colorFixedKey).getMaterialColor(),
196
198
  5,