@breadstone-infrastructure/style-dictionary 0.0.177 → 0.0.179

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.
@@ -1,2 +1,3 @@
1
1
  export * from './tailwindFormat';
2
+ export * from './tailwindFormat2';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/formats/tailwind/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/formats/tailwind/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC"}
@@ -15,4 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./tailwindFormat"), exports);
18
+ __exportStar(require("./tailwindFormat2"), exports);
18
19
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/formats/tailwind/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/formats/tailwind/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC;AACjC,oDAAkC"}
@@ -3,16 +3,11 @@ import type { Format } from 'style-dictionary/types';
3
3
  * Style-Dictionary format that outputs a CommonJS `tailwind.config.js`,
4
4
  * exporting the theme configuration as `module.exports = …`.
5
5
  */
6
- export declare const tailwindConfigCjsFormat: Format;
7
- /**
8
- * Style-Dictionary format that outputs an ESM `tailwind.config.mjs`,
9
- * exporting the theme configuration as `export default { … }`.
10
- */
11
- export declare const tailwindConfigEsmFormat: Format;
6
+ export declare const tailwindPresetFormat: Format;
12
7
  /**
13
8
  * Style-Dictionary format that generates a Tailwind plugin module.
14
9
  * Exports a proper Tailwind CSS plugin that can be added to the plugins array
15
10
  * in tailwind.config.js.
16
11
  */
17
- export declare const tailwindPluginJsFormat: Format;
12
+ export declare const tailwindPluginFormat: Format;
18
13
  //# sourceMappingURL=tailwindFormat.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tailwindFormat.d.ts","sourceRoot":"","sources":["../../../src/formats/tailwind/tailwindFormat.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAKrD;;;GAGG;AACH,eAAO,MAAM,uBAAuB,EAAE,MAarC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,uBAAuB,EAAE,MAarC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,EAAE,MA2BpC,CAAC"}
1
+ {"version":3,"file":"tailwindFormat.d.ts","sourceRoot":"","sources":["../../../src/formats/tailwind/tailwindFormat.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAsB,MAAM,EAAgB,MAAM,wBAAwB,CAAC;AAKvF;;;GAGG;AACH,eAAO,MAAM,oBAAoB,EAAE,MAgBlC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,EAAE,MA8BlC,CAAC"}
@@ -1,15 +1,15 @@
1
1
  "use strict";
2
2
  // #region Imports
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.tailwindPluginJsFormat = exports.tailwindConfigEsmFormat = exports.tailwindConfigCjsFormat = void 0;
4
+ exports.tailwindPluginFormat = exports.tailwindPresetFormat = void 0;
5
5
  const buildTailwindConfig_js_1 = require("./buildTailwindConfig.js");
6
6
  // #endregion
7
7
  /**
8
8
  * Style-Dictionary format that outputs a CommonJS `tailwind.config.js`,
9
9
  * exporting the theme configuration as `module.exports = …`.
10
10
  */
11
- exports.tailwindConfigCjsFormat = {
12
- name: 'tailwind/config/cjs',
11
+ exports.tailwindPresetFormat = {
12
+ name: 'tailwind/preset/js',
13
13
  format({ dictionary, options }) {
14
14
  const config = (0, buildTailwindConfig_js_1.buildTailwindConfig)(dictionary.allTokens, options.ignoredTokenNames ?? []);
15
15
  const header = `// ------------------------------------------------------------------------------
@@ -22,31 +22,13 @@ exports.tailwindConfigCjsFormat = {
22
22
  return `${header}\n\nmodule.exports = ${JSON.stringify(config, null, 2)};\n`;
23
23
  }
24
24
  };
25
- /**
26
- * Style-Dictionary format that outputs an ESM `tailwind.config.mjs`,
27
- * exporting the theme configuration as `export default { … }`.
28
- */
29
- exports.tailwindConfigEsmFormat = {
30
- name: 'tailwind/config/esm',
31
- format({ dictionary, options }) {
32
- const config = (0, buildTailwindConfig_js_1.buildTailwindConfig)(dictionary.allTokens, options.ignoredTokenNames ?? []);
33
- const header = `// ------------------------------------------------------------------------------
34
- // <auto-generated>
35
- // This code was generated by a tool.
36
- // Changes to this file may cause incorrect behavior and will be lost if
37
- // the code is regenerated.
38
- // </auto-generated>
39
- // ------------------------------------------------------------------------------`;
40
- return `${header}\n\nexport default ${JSON.stringify(config, null, 2)};\n`;
41
- }
42
- };
43
25
  /**
44
26
  * Style-Dictionary format that generates a Tailwind plugin module.
45
27
  * Exports a proper Tailwind CSS plugin that can be added to the plugins array
46
28
  * in tailwind.config.js.
47
29
  */
48
- exports.tailwindPluginJsFormat = {
49
- name: 'tailwind/plugin',
30
+ exports.tailwindPluginFormat = {
31
+ name: 'tailwind/plugin/js',
50
32
  format({ dictionary, options }) {
51
33
  const config = (0, buildTailwindConfig_js_1.buildTailwindConfig)(dictionary.allTokens, options.ignoredTokenNames ?? []);
52
34
  const themeSection = JSON.stringify(config.theme, null, 2);
@@ -1 +1 @@
1
- {"version":3,"file":"tailwindFormat.js","sourceRoot":"","sources":["../../../src/formats/tailwind/tailwindFormat.ts"],"names":[],"mappings":";AAAA,kBAAkB;;;AAGlB,qEAA+D;AAE/D,aAAa;AAEb;;;GAGG;AACU,QAAA,uBAAuB,GAAW;IAC3C,IAAI,EAAE,qBAAqB;IAC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indFormat.js","sourceRoot":"","sources":["../../../src/formats/tailwind/tailwindFormat.ts"],"names":[],"mappings":";AAAA,kBAAkB;;;AAGlB,qEAA+D;AAE/D,aAAa;AAEb;;;GAGG;AACU,QAAA,oBAAoB,GAAW;IACxC,IAAI,EAAE,oBAAoB;IAC1B,MAAM,CAAC,EAAE,UAAU,EAAE,OAAO,EAG3B;QACG,MAAM,MAAM,GAAG,IAAA,4CAAmB,EAAC,UAAU,CAAC,SAAS,EAAE,OAAO,CAAC,iBAAiB,IAAI,EAAE,CAAC,CAAC;QAC1F,MAAM,MAAM,GAAG;;;;;;kFAM2D,CAAC;QAC3E,OAAO,GAAG,MAAM,wBAAwB,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC;IACjF,CAAC;CACJ,CAAC;AAEF;;;;GAIG;AACU,QAAA,oBAAoB,GAAW;IACxC,IAAI,EAAE,oBAAoB;IAC1B,MAAM,CAAC,EAAE,UAAU,EAAE,OAAO,EAG3B;QACG,MAAM,MAAM,GAAG,IAAA,4CAAmB,EAAC,UAAU,CAAC,SAAS,EAAE,OAAO,CAAC,iBAAiB,IAAI,EAAE,CAAC,CAAC;QAC1F,MAAM,YAAY,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QAC3D,MAAM,MAAM,GAAG;;;;;;kFAM2D,CAAC;QAE3E,OAAO,GAAG,MAAM;;;;;;;;;;;KAWnB,YAAY;CAChB,CAAC;IACE,CAAC;CACJ,CAAC"}
@@ -0,0 +1,13 @@
1
+ import type { Format } from 'style-dictionary/types';
2
+ /**
3
+ * Style-Dictionary format that outputs a CommonJS `tailwind.config.js`,
4
+ * exporting the theme configuration as `module.exports = …`.
5
+ */
6
+ export declare const tailwindPresetTsFormat: Format;
7
+ /**
8
+ * Style-Dictionary format that generates a Tailwind plugin module.
9
+ * Exports a proper Tailwind CSS plugin that can be added to the plugins array
10
+ * in tailwind.config.js.
11
+ */
12
+ export declare const tailwindPluginTsFormat: Format;
13
+ //# sourceMappingURL=tailwindFormat2.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tailwindFormat2.d.ts","sourceRoot":"","sources":["../../../src/formats/tailwind/tailwindFormat2.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAsB,MAAM,EAAgB,MAAM,wBAAwB,CAAC;AAKvF;;;GAGG;AACH,eAAO,MAAM,sBAAsB,EAAE,MAuBpC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,EAAE,MAgCpC,CAAC"}
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ // #region Imports
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.tailwindPluginTsFormat = exports.tailwindPresetTsFormat = void 0;
5
+ const buildTailwindConfig_js_1 = require("./buildTailwindConfig.js");
6
+ // #endregion
7
+ /**
8
+ * Style-Dictionary format that outputs a CommonJS `tailwind.config.js`,
9
+ * exporting the theme configuration as `module.exports = …`.
10
+ */
11
+ exports.tailwindPresetTsFormat = {
12
+ name: 'tailwind/preset/ts',
13
+ format({ dictionary, options }) {
14
+ const config = (0, buildTailwindConfig_js_1.buildTailwindConfig)(dictionary.allTokens, options.ignoredTokenNames ?? []);
15
+ const header = `// ------------------------------------------------------------------------------
16
+ // <auto-generated>
17
+ // This code was generated by a tool.
18
+ // Changes to this file may cause incorrect behavior and will be lost if
19
+ // the code is regenerated.
20
+ // </auto-generated>
21
+ // ------------------------------------------------------------------------------`;
22
+ return `
23
+ ${header}
24
+
25
+ import { Config } from 'tailwindcss';
26
+
27
+ export const config: Partial<Config> = ${JSON.stringify(config, null, 2)};
28
+ `.trim();
29
+ }
30
+ };
31
+ /**
32
+ * Style-Dictionary format that generates a Tailwind plugin module.
33
+ * Exports a proper Tailwind CSS plugin that can be added to the plugins array
34
+ * in tailwind.config.js.
35
+ */
36
+ exports.tailwindPluginTsFormat = {
37
+ name: 'tailwind/plugin/ts',
38
+ format({ dictionary, options }) {
39
+ const config = (0, buildTailwindConfig_js_1.buildTailwindConfig)(dictionary.allTokens, options.ignoredTokenNames ?? []);
40
+ const themeSection = JSON.stringify(config.theme, null, 2);
41
+ const header = `// ------------------------------------------------------------------------------
42
+ // <auto-generated>
43
+ // This code was generated by a tool.
44
+ // Changes to this file may cause incorrect behavior and will be lost if
45
+ // the code is regenerated.
46
+ // </auto-generated>
47
+ // ------------------------------------------------------------------------------`;
48
+ return `${header}
49
+
50
+ import createPlugin from 'tailwindcss/plugin';
51
+
52
+ export const plugin = createPlugin(function({ addUtilities, theme, e }) {
53
+ // Optional: Add custom utilities here
54
+ // Example: Custom shadow utilities
55
+ // const shadows = theme('boxShadow') || {};
56
+ // const shadowUtils = Object.entries(shadows).reduce((acc, [key, value]) => {
57
+ // acc['.' + e('shadow-' + key)] = { boxShadow: value };
58
+ // return acc;
59
+ // }, {});
60
+ // addUtilities(shadowUtils);
61
+ }, ${themeSection});
62
+ `.trim();
63
+ }
64
+ };
65
+ //# sourceMappingURL=tailwindFormat2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tailwindFormat2.js","sourceRoot":"","sources":["../../../src/formats/tailwind/tailwindFormat2.ts"],"names":[],"mappings":";AAAA,kBAAkB;;;AAGlB,qEAA+D;AAE/D,aAAa;AAEb;;;GAGG;AACU,QAAA,sBAAsB,GAAW;IAC1C,IAAI,EAAE,oBAAoB;IAC1B,MAAM,CAAC,EAAE,UAAU,EAAE,OAAO,EAG3B;QACG,MAAM,MAAM,GAAG,IAAA,4CAAmB,EAAC,UAAU,CAAC,SAAS,EAAE,OAAO,CAAC,iBAAiB,IAAI,EAAE,CAAC,CAAC;QAC1F,MAAM,MAAM,GAAG;;;;;;kFAM2D,CAAC;QAE3E,OAAO;EACb,MAAM;;;;yCAIiC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;SAC/D,CAAC,IAAI,EAAE,CAAC;IACb,CAAC;CACJ,CAAC;AAEF;;;;GAIG;AACU,QAAA,sBAAsB,GAAW;IAC1C,IAAI,EAAE,oBAAoB;IAC1B,MAAM,CAAC,EAAE,UAAU,EAAE,OAAO,EAG3B;QACG,MAAM,MAAM,GAAG,IAAA,4CAAmB,EAAC,UAAU,CAAC,SAAS,EAAE,OAAO,CAAC,iBAAiB,IAAI,EAAE,CAAC,CAAC;QAC1F,MAAM,YAAY,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QAC3D,MAAM,MAAM,GAAG;;;;;;kFAM2D,CAAC;QAE3E,OAAO,GAAG,MAAM;;;;;;;;;;;;;KAanB,YAAY;CAChB,CAAC,IAAI,EAAE,CAAC;IACL,CAAC;CACJ,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@breadstone-infrastructure/style-dictionary",
3
3
  "description": "Common style-dictionary classes and functions",
4
- "version": "0.0.177",
4
+ "version": "0.0.179",
5
5
  "license": "MIT",
6
6
  "author": "andre.wehlert <awehlert@breadstone.de> (https://www.breadstone.de)",
7
7
  "repository": {
@@ -13,7 +13,7 @@
13
13
  "module": "./index.js",
14
14
  "types": "./index.d.ts",
15
15
  "dependencies": {
16
- "@breadstone-infrastructure/utilities": "^0.0.177",
16
+ "@breadstone-infrastructure/utilities": "^0.0.179",
17
17
  "chroma-js": "^3.2.0",
18
18
  "style-dictionary": "^4.4.0",
19
19
  "tailwindcss": "^3.4.18"