@breadstone-infrastructure/style-dictionary 0.0.12-beta.1

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 (46) hide show
  1. package/Index.d.ts +9 -0
  2. package/Index.d.ts.map +1 -0
  3. package/Index.js +20 -0
  4. package/Index.js.map +1 -0
  5. package/LICENSE +21 -0
  6. package/Preprocessors/Lint.d.ts +3 -0
  7. package/Preprocessors/Lint.d.ts.map +1 -0
  8. package/Preprocessors/Lint.js +65 -0
  9. package/Preprocessors/Lint.js.map +1 -0
  10. package/Preprocessors/Shadow.d.ts +3 -0
  11. package/Preprocessors/Shadow.d.ts.map +1 -0
  12. package/Preprocessors/Shadow.js +127 -0
  13. package/Preprocessors/Shadow.js.map +1 -0
  14. package/Transforms/Gradient.d.ts +3 -0
  15. package/Transforms/Gradient.d.ts.map +1 -0
  16. package/Transforms/Gradient.js +18 -0
  17. package/Transforms/Gradient.js.map +1 -0
  18. package/Transforms/LetterSpacing.d.ts +3 -0
  19. package/Transforms/LetterSpacing.d.ts.map +1 -0
  20. package/Transforms/LetterSpacing.js +21 -0
  21. package/Transforms/LetterSpacing.js.map +1 -0
  22. package/Transforms/List.d.ts +3 -0
  23. package/Transforms/List.d.ts.map +1 -0
  24. package/Transforms/List.js +14 -0
  25. package/Transforms/List.js.map +1 -0
  26. package/Transforms/NameSnakeUpperCase.d.ts +6 -0
  27. package/Transforms/NameSnakeUpperCase.d.ts.map +1 -0
  28. package/Transforms/NameSnakeUpperCase.js +20 -0
  29. package/Transforms/NameSnakeUpperCase.js.map +1 -0
  30. package/Transforms/QuoteString.d.ts +3 -0
  31. package/Transforms/QuoteString.d.ts.map +1 -0
  32. package/Transforms/QuoteString.js +14 -0
  33. package/Transforms/QuoteString.js.map +1 -0
  34. package/Transforms/Shadow.d.ts +3 -0
  35. package/Transforms/Shadow.d.ts.map +1 -0
  36. package/Transforms/Shadow.js +25 -0
  37. package/Transforms/Shadow.js.map +1 -0
  38. package/Utilities/Extract.d.ts +10 -0
  39. package/Utilities/Extract.d.ts.map +1 -0
  40. package/Utilities/Extract.js +38 -0
  41. package/Utilities/Extract.js.map +1 -0
  42. package/Utilities/GetValue.d.ts +9 -0
  43. package/Utilities/GetValue.d.ts.map +1 -0
  44. package/Utilities/GetValue.js +12 -0
  45. package/Utilities/GetValue.js.map +1 -0
  46. package/package.json +19 -0
package/Index.d.ts ADDED
@@ -0,0 +1,9 @@
1
+ export { letterSpacingTransform } from './Transforms/LetterSpacing';
2
+ export { shadowCssTransform } from './Transforms/Shadow';
3
+ export { nameSnakeUpperCaseTransform } from './Transforms/NameSnakeUpperCase';
4
+ export { gradientTransform } from './Transforms/Gradient';
5
+ export { quoteStringTransform } from './Transforms/QuoteString';
6
+ export { listTransfrom } from './Transforms/List';
7
+ export { expandShadowPreprocessor } from './Preprocessors/Shadow';
8
+ export { lintPreprocessor } from './Preprocessors/Lint';
9
+ //# sourceMappingURL=Index.d.ts.map
package/Index.d.ts.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Index.d.ts","sourceRoot":"","sources":["../src/Index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,2BAA2B,EAAE,MAAM,iCAAiC,CAAC;AAC9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC"}
package/Index.js ADDED
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.lintPreprocessor = exports.expandShadowPreprocessor = exports.listTransfrom = exports.quoteStringTransform = exports.gradientTransform = exports.nameSnakeUpperCaseTransform = exports.shadowCssTransform = exports.letterSpacingTransform = void 0;
4
+ var LetterSpacing_1 = require("./Transforms/LetterSpacing");
5
+ Object.defineProperty(exports, "letterSpacingTransform", { enumerable: true, get: function () { return LetterSpacing_1.letterSpacingTransform; } });
6
+ var Shadow_1 = require("./Transforms/Shadow");
7
+ Object.defineProperty(exports, "shadowCssTransform", { enumerable: true, get: function () { return Shadow_1.shadowCssTransform; } });
8
+ var NameSnakeUpperCase_1 = require("./Transforms/NameSnakeUpperCase");
9
+ Object.defineProperty(exports, "nameSnakeUpperCaseTransform", { enumerable: true, get: function () { return NameSnakeUpperCase_1.nameSnakeUpperCaseTransform; } });
10
+ var Gradient_1 = require("./Transforms/Gradient");
11
+ Object.defineProperty(exports, "gradientTransform", { enumerable: true, get: function () { return Gradient_1.gradientTransform; } });
12
+ var QuoteString_1 = require("./Transforms/QuoteString");
13
+ Object.defineProperty(exports, "quoteStringTransform", { enumerable: true, get: function () { return QuoteString_1.quoteStringTransform; } });
14
+ var List_1 = require("./Transforms/List");
15
+ Object.defineProperty(exports, "listTransfrom", { enumerable: true, get: function () { return List_1.listTransfrom; } });
16
+ var Shadow_2 = require("./Preprocessors/Shadow");
17
+ Object.defineProperty(exports, "expandShadowPreprocessor", { enumerable: true, get: function () { return Shadow_2.expandShadowPreprocessor; } });
18
+ var Lint_1 = require("./Preprocessors/Lint");
19
+ Object.defineProperty(exports, "lintPreprocessor", { enumerable: true, get: function () { return Lint_1.lintPreprocessor; } });
20
+ //# sourceMappingURL=Index.js.map
package/Index.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Index.js","sourceRoot":"","sources":["../src/Index.ts"],"names":[],"mappings":";;;AAAA,4DAAoE;AAA3D,uHAAA,sBAAsB,OAAA;AAC/B,8CAAyD;AAAhD,4GAAA,kBAAkB,OAAA;AAC3B,sEAA8E;AAArE,iIAAA,2BAA2B,OAAA;AACpC,kDAA0D;AAAjD,6GAAA,iBAAiB,OAAA;AAC1B,wDAAgE;AAAvD,mHAAA,oBAAoB,OAAA;AAC7B,0CAAkD;AAAzC,qGAAA,aAAa,OAAA;AAEtB,iDAAkE;AAAzD,kHAAA,wBAAwB,OAAA;AACjC,6CAAwD;AAA/C,wGAAA,gBAAgB,OAAA"}
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) Breadstone
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,3 @@
1
+ import type { Preprocessor } from 'style-dictionary/types';
2
+ export declare const lintPreprocessor: Preprocessor;
3
+ //# sourceMappingURL=Lint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Lint.d.ts","sourceRoot":"","sources":["../../src/Preprocessors/Lint.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAsB,YAAY,EAA0B,MAAM,wBAAwB,CAAC;AA4DvG,eAAO,MAAM,gBAAgB,EAAE,YAkB9B,CAAC"}
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ // #region Imports
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.lintPreprocessor = void 0;
5
+ // #endregion
6
+ const REQUIRED_TOKEN_PROPS = ['value'];
7
+ function isToken(obj) {
8
+ return typeof obj === 'object' && obj !== null && 'value' in obj;
9
+ }
10
+ function lintToken(token, path) {
11
+ const errors = [];
12
+ console.log(`🔍 Linting token: ${path.join('.')}`);
13
+ for (const prop of REQUIRED_TOKEN_PROPS) {
14
+ if (!(prop in token)) {
15
+ errors.push(`❌ Missing property "${prop}" in token: ${path.join('.')}`);
16
+ }
17
+ }
18
+ if (typeof token.value === 'undefined') {
19
+ errors.push(`❌ Token has no value: ${path.join('.')}`);
20
+ }
21
+ else if (typeof token.value !== 'string' &&
22
+ typeof token.value !== 'number' &&
23
+ typeof token.value !== 'boolean' &&
24
+ typeof token.value !== 'object') {
25
+ errors.push(`❌ Invalid token value type in: ${path.join('.')}`);
26
+ }
27
+ return errors;
28
+ }
29
+ function walkTokens(node, path = []) {
30
+ if (Array.isArray(node)) {
31
+ return [];
32
+ }
33
+ if (isToken(node)) {
34
+ return lintToken(node, path);
35
+ }
36
+ if (typeof node === 'object' && node !== null) {
37
+ let allErrors = [];
38
+ for (const [key, value] of Object.entries(node)) {
39
+ const fullPath = [...path, key];
40
+ console.debug(`🔎 Visiting: ${fullPath.join('.')}`);
41
+ const subErrors = walkTokens(value, fullPath);
42
+ if (subErrors.length > 0) {
43
+ allErrors = allErrors.concat(subErrors);
44
+ }
45
+ }
46
+ return allErrors;
47
+ }
48
+ return [];
49
+ }
50
+ exports.lintPreprocessor = {
51
+ name: 'lint/tokens',
52
+ preprocessor: (dictionary, _config) => {
53
+ console.log('🚀 Starting linting of design tokens...');
54
+ const errors = walkTokens(dictionary);
55
+ if (errors.length > 0) {
56
+ for (const error of errors) {
57
+ console.error(error);
58
+ }
59
+ throw new Error(`Token validation failed with ${errors.length} error(s).`);
60
+ }
61
+ console.log('✅ Token validation passed.');
62
+ return dictionary;
63
+ }
64
+ };
65
+ //# sourceMappingURL=Lint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Lint.js","sourceRoot":"","sources":["../../src/Preprocessors/Lint.ts"],"names":[],"mappings":";AAAA,kBAAkB;;;AAIlB,aAAa;AAEb,MAAM,oBAAoB,GAAG,CAAC,OAAO,CAAU,CAAC;AAEhD,SAAS,OAAO,CAAC,GAAY;IACzB,OAAO,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI,IAAI,OAAO,IAAI,GAAG,CAAC;AACrE,CAAC;AAED,SAAS,SAAS,CAAC,KAA8B,EAAE,IAAmB;IAClE,MAAM,MAAM,GAAkB,EAAE,CAAC;IAEjC,OAAO,CAAC,GAAG,CAAC,qBAAqB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAEnD,KAAK,MAAM,IAAI,IAAI,oBAAoB,EAAE,CAAC;QACtC,IAAI,CAAC,CAAC,IAAI,IAAI,KAAK,CAAC,EAAE,CAAC;YACnB,MAAM,CAAC,IAAI,CAAC,uBAAuB,IAAI,eAAe,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAC5E,CAAC;IACL,CAAC;IAED,IAAI,OAAO,KAAK,CAAC,KAAK,KAAK,WAAW,EAAE,CAAC;QACrC,MAAM,CAAC,IAAI,CAAC,yBAAyB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAC3D,CAAC;SAAM,IACH,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ;QAC/B,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ;QAC/B,OAAO,KAAK,CAAC,KAAK,KAAK,SAAS;QAChC,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ,EACjC,CAAC;QACC,MAAM,CAAC,IAAI,C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AAC,CAAC;QAEtC,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACpB,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;gBACzB,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YACzB,CAAC;YACD,MAAM,IAAI,KAAK,CAAC,gCAAgC,MAAM,CAAC,MAAM,YAAY,CAAC,CAAC;QAC/E,CAAC;QAED,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;QAE1C,OAAO,UAAU,CAAC;IACtB,CAAC;CACJ,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Preprocessor } from 'style-dictionary/types';
2
+ export declare const expandShadowPreprocessor: Preprocessor;
3
+ //# sourceMappingURL=Shadow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Shadow.d.ts","sourceRoot":"","sources":["../../src/Preprocessors/Shadow.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAsB,YAAY,EAA0B,MAAM,wBAAwB,CAAC;AAuHvG,eAAO,MAAM,wBAAwB,EAAE,YAuCtC,CAAC"}
@@ -0,0 +1,127 @@
1
+ "use strict";
2
+ // #region Imports
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.expandShadowPreprocessor = void 0;
5
+ const SHADOW_PARTS = ['offsetX', 'offsetY', 'blur', 'spread', 'color'];
6
+ const shadowTypeStrategy = {
7
+ color: (value) => ({
8
+ value,
9
+ type: 'color'
10
+ }),
11
+ offsetX: (value) => ({
12
+ value,
13
+ type: 'size'
14
+ }),
15
+ offsetY: (value) => ({
16
+ value,
17
+ type: 'size'
18
+ }),
19
+ blur: (value) => ({
20
+ value,
21
+ type: 'size'
22
+ }),
23
+ spread: (value) => ({
24
+ value,
25
+ type: 'size'
26
+ })
27
+ };
28
+ function isTokenShadow(input) {
29
+ if (typeof input !== 'object' || input === null || input.type !== 'shadow' || !('value' in input)) {
30
+ return false;
31
+ }
32
+ const value = input.value;
33
+ const isValid = (v) => typeof v === 'object' && v !== null && SHADOW_PARTS.every((part) => part in v);
34
+ return Array.isArray(value) ? value.every(isValid) : isValid(value);
35
+ }
36
+ function buildReference(path, part, index) {
37
+ return `{${[...path, part, String(index), 'value'].join('.')}}`;
38
+ }
39
+ function buildTokenStructure(path, input) {
40
+ const layers = Array.isArray(input) ? input : [input];
41
+ const result = {};
42
+ for (const part of SHADOW_PARTS) {
43
+ const partValues = {};
44
+ for (let i = 0; i < layers.length; i++) {
45
+ partValues[i] = shadowTypeStrategy[part](layers[i][part]);
46
+ }
47
+ result[part] = partValues;
48
+ }
49
+ // result._ = {
50
+ // value: layers.map((_, i) => SHADOW_PARTS.map((p) => buildShadowReference(path, p, i)).join(' ')).join(', '),
51
+ // type: 'shadow'
52
+ // };
53
+ return result;
54
+ }
55
+ function assignDeep(target, path, value) {
56
+ let cursor = target;
57
+ for (let i = 0; i < path.length - 1; i++) {
58
+ cursor[path[i]] ??= {};
59
+ cursor = cursor[path[i]];
60
+ }
61
+ cursor[path[path.length - 1]] = value;
62
+ }
63
+ function mergeTokens(target, source) {
64
+ const isObject = (obj) => obj && typeof obj === 'object' && !Array.isArray(obj);
65
+ for (const key of Object.keys(source)) {
66
+ const srcVal = source[key];
67
+ const tgtVal = target[key];
68
+ if (isObject(srcVal) && tgtVal && typeof tgtVal === 'object' && 'value' in tgtVal) {
69
+ if (!('_' in tgtVal)) {
70
+ target[key] = {
71
+ _: { ...tgtVal },
72
+ ...srcVal
73
+ };
74
+ }
75
+ else {
76
+ target[key] = srcVal;
77
+ }
78
+ continue;
79
+ }
80
+ if (Array.isArray(srcVal) && Array.isArray(tgtVal)) {
81
+ target[key] = [...tgtVal, ...srcVal];
82
+ }
83
+ else if (isObject(srcVal) && isObject(tgtVal)) {
84
+ target[key] = mergeTokens({ ...tgtVal }, srcVal);
85
+ }
86
+ else {
87
+ target[key] = srcVal;
88
+ }
89
+ }
90
+ return target;
91
+ }
92
+ exports.expandShadowPreprocessor = {
93
+ name: 'shadow/expand',
94
+ preprocessor: (dictionary, _config) => {
95
+ const result = {};
96
+ const visitedPaths = new Set();
97
+ function visit(node, path) {
98
+ const pathKey = path.join('.');
99
+ if (visitedPaths.has(pathKey)) {
100
+ return;
101
+ }
102
+ visitedPaths.add(pathKey);
103
+ for (const [key, value] of Object.entries(node)) {
104
+ const currentPath = [...path, key];
105
+ try {
106
+ if (isTokenShadow(value)) {
107
+ const expanded = buildTokenStructure(currentPath, value.value);
108
+ assignDeep(result, currentPath, expanded);
109
+ }
110
+ else if (typeof value === 'object' && value !== null && !Array.isArray(value)) {
111
+ visit(value, currentPath);
112
+ }
113
+ }
114
+ catch (err) {
115
+ console.error('Error at path:', currentPath.join('.'), err);
116
+ }
117
+ }
118
+ }
119
+ visit(structuredClone(dictionary), []);
120
+ return mergeTokens(structuredClone(dictionary), result);
121
+ // return {
122
+ // ...dictionary,
123
+ // ...result
124
+ // };
125
+ }
126
+ };
127
+ //# sourceMappingURL=Shadow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Shadow.js","sourceRoot":"","sources":["../../src/Preprocessors/Shadow.ts"],"names":[],"mappings":";AAAA,kBAAkB;;;AAelB,MAAM,YAAY,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAwE,CAAC;AAE9I,MAAM,kBAAkB,GAGnB;IACD,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACf,KAAK;QACL,IAAI,EAAE,OAAO;KAChB,CAAC;IACF,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACjB,KAAK;QACL,IAAI,EAAE,MAAM;KACf,CAAC;IACF,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACjB,KAAK;QACL,IAAI,EAAE,MAAM;KACf,CAAC;IACF,IAAI,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACd,KAAK;QACL,IAAI,EAAE,MAAM;KACf,C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AG,CAAC,OAAO,CAAC,EAAE,CAAC;gBAC5B,OAAO;YACX,CAAC;YAED,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;YAE1B,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC9C,MAAM,WAAW,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,CAAC,CAAC;gBAEnC,IAAI,CAAC;oBACD,IAAI,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC;wBACvB,MAAM,QAAQ,GAAG,mBAAmB,CAAC,WAAW,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;wBAC/D,UAAU,CAAC,MAAM,EAAE,WAAW,EAAE,QAAQ,CAAC,CAAC;oBAC9C,CAAC;yBAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;wBAC9E,KAAK,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;oBAC9B,CAAC;gBACL,CAAC;gBAAC,OAAO,GAAG,EAAE,CAAC;oBACX,OAAO,CAAC,KAAK,CAAC,gBAAgB,EAAE,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC;gBAChE,CAAC;YACL,CAAC;QACL,CAAC;QAED,KAAK,CAAC,eAAe,CAAC,UAAU,CAAC,EAAE,EAAE,CAAC,CAAC;QAEvC,OAAO,WAAW,CAAC,eAAe,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC,CAAC;QAExD,WAAW;QACX,qBAAqB;QACrB,gBAAgB;QAChB,KAAK;IACT,CAAC;CACJ,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Transform } from 'style-dictionary/types';
2
+ export declare const gradientTransform: Transform;
3
+ //# sourceMappingURL=Gradient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Gradient.d.ts","sourceRoot":"","sources":["../../src/Transforms/Gradient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAoB,MAAM,wBAAwB,CAAC;AAQ1E,eAAO,MAAM,iBAAiB,EAAE,SAa/B,CAAC"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.gradientTransform = void 0;
4
+ const GetValue_js_1 = require("../Utilities/GetValue.js");
5
+ exports.gradientTransform = {
6
+ name: 'gradient/css',
7
+ type: 'value',
8
+ transitive: true,
9
+ filter: (token) => token.$type === 'gradient' || token.type === 'gradient',
10
+ transform: (token) => {
11
+ const tokenValue = (0, GetValue_js_1.getValue)(token);
12
+ const stops = tokenValue
13
+ .map((stop) => `${stop.color}${stop.position ? ` ${Math.floor(stop.position * 100)}%` : ''}`)
14
+ .join(', ');
15
+ return `${token.angle ? `${token.angle}, ` : ''}${stops}`;
16
+ }
17
+ };
18
+ //# sourceMappingURL=Gradient.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Gradient.js","sourceRoot":"","sources":["../../src/Transforms/Gradient.ts"],"names":[],"mappings":";;;AACA,0DAAoD;AAOvC,QAAA,iBAAiB,GAAc;IACxC,IAAI,EAAE,cAAc;IACpB,IAAI,EAAE,OAAO;IACb,UAAU,EAAE,IAAI;IAChB,MAAM,EAAE,CAAC,KAAuB,EAAW,EAAE,CAAC,KAAK,CAAC,KAAK,KAAK,UAAU,IAAI,KAAK,CAAC,IAAI,KAAK,UAAU;IACrG,SAAS,EAAE,CAAC,KAAuB,EAAE,EAAE;QACnC,MAAM,UAAU,GAAG,IAAA,sBAAQ,EAAuB,KAAK,CAAC,CAAC;QACzD,MAAM,KAAK,GAAG,UAAU;aACnB,GAAG,CAAC,CAAC,IAAmB,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;aAC3G,IAAI,CAAC,IAAI,CAAC,CAAC;QAEhB,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,EAAE,CAAC;IAC9D,CAAC;CACJ,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Transform } from 'style-dictionary/types';
2
+ export declare const letterSpacingTransform: Transform;
3
+ //# sourceMappingURL=LetterSpacing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LetterSpacing.d.ts","sourceRoot":"","sources":["../../src/Transforms/LetterSpacing.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAIxD,eAAO,MAAM,sBAAsB,EAAE,SAgBpC,CAAC"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ // #region Imports
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.letterSpacingTransform = void 0;
5
+ // #endregion
6
+ exports.letterSpacingTransform = {
7
+ type: 'value',
8
+ transitive: true,
9
+ name: 'letterSpacing/css/calc',
10
+ filter: (token) => !!(token.type === 'letterSpacing' && typeof token.value === 'string' && token.value === '' && Boolean(token.attributes)),
11
+ transform: (token) => {
12
+ if (token.attributes) {
13
+ const tracking = token.attributes.tracking;
14
+ const spacing = token.attributes.spacing;
15
+ const px = `${tracking / spacing}px`;
16
+ return px;
17
+ }
18
+ return token.value;
19
+ }
20
+ };
21
+ //# sourceMappingURL=LetterSpacing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LetterSpacing.js","sourceRoot":"","sources":["../../src/Transforms/LetterSpacing.ts"],"names":[],"mappings":";AAAA,kBAAkB;;;AAIlB,aAAa;AAEA,QAAA,sBAAsB,GAAc;IAC7C,IAAI,EAAE,OAAO;IACb,UAAU,EAAE,IAAI;IAChB,IAAI,EAAE,wBAAwB;IAC9B,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,KAAK,eAAe,IAAI,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,KAAK,KAAK,EAAE,IAAI,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IAC3I,SAAS,EAAE,CAAC,KAAK,EAAE,EAAE;QACjB,IAAI,KAAK,CAAC,UAAU,EAAE,CAAC;YACnB,MAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,CAAC,QAAkB,CAAC;YACrD,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,OAAiB,CAAC;YAEnD,MAAM,EAAE,GAAG,GAAG,QAAQ,GAAG,OAAO,IAAI,CAAC;YACrC,OAAO,EAAE,CAAC;QACd,CAAC;QAED,OAAO,KAAK,CAAC,KAAK,CAAC;IACvB,CAAC;CACJ,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Transform } from 'style-dictionary/types';
2
+ export declare const listTransfrom: Transform;
3
+ //# sourceMappingURL=List.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"List.d.ts","sourceRoot":"","sources":["../../src/Transforms/List.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAoB,MAAM,wBAAwB,CAAC;AAK1E,eAAO,MAAM,aAAa,EAAE,SAM3B,CAAC"}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ // #region Imports
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.listTransfrom = void 0;
5
+ const GetValue_1 = require("../Utilities/GetValue");
6
+ // #endregion
7
+ exports.listTransfrom = {
8
+ name: 'list/scss',
9
+ type: 'value',
10
+ transitive: true,
11
+ filter: (token) => Array.isArray(token.value),
12
+ transform: (token) => `(${(0, GetValue_1.getValue)(token).join(', ')})`
13
+ };
14
+ //# sourceMappingURL=List.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"List.js","sourceRoot":"","sources":["../../src/Transforms/List.ts"],"names":[],"mappings":";AAAA,kBAAkB;;;AAGlB,oDAAiD;AAEjD,aAAa;AAEA,QAAA,aAAa,GAAc;IACpC,IAAI,EAAE,WAAW;IACjB,IAAI,EAAE,OAAO;IACb,UAAU,EAAE,IAAI;IAChB,MAAM,EAAE,CAAC,KAAK,EAAW,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC;IACtD,SAAS,EAAE,CAAC,KAAuB,EAAE,EAAE,CAAC,IAAI,IAAA,mBAAQ,EAAgB,KAAK,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG;CAC3F,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { Transform } from 'style-dictionary/types';
2
+ /**
3
+ * `nameSnakeUpperCaseTransform` - Transforms the name of a token to snake upper case.
4
+ */
5
+ export declare const nameSnakeUpperCaseTransform: Transform;
6
+ //# sourceMappingURL=NameSnakeUpperCase.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NameSnakeUpperCase.d.ts","sourceRoot":"","sources":["../../src/Transforms/NameSnakeUpperCase.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAkB,SAAS,EAAoB,MAAM,wBAAwB,CAAC;AAK1F;;GAEG;AACH,eAAO,MAAM,2BAA2B,EAAE,SAYzC,CAAC"}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ // #region Imports
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.nameSnakeUpperCaseTransform = void 0;
5
+ const utilities_1 = require("@breadstone-infrastructure/utilities");
6
+ // #endregion
7
+ /**
8
+ * `nameSnakeUpperCaseTransform` - Transforms the name of a token to snake upper case.
9
+ */
10
+ exports.nameSnakeUpperCaseTransform = {
11
+ name: 'name/snake/upper',
12
+ type: 'name',
13
+ transform: (token, platform) => {
14
+ const name = utilities_1.StringExtensions.toSnakeCase([platform?.prefix, ...token.path]
15
+ .filter((part) => typeof part === 'string')
16
+ .join('-')).toUpperCase();
17
+ return name;
18
+ }
19
+ };
20
+ //# sourceMappingURL=NameSnakeUpperCase.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NameSnakeUpperCase.js","sourceRoot":"","sources":["../../src/Transforms/NameSnakeUpperCase.ts"],"names":[],"mappings":";AAAA,kBAAkB;;;AAGlB,oEAAwE;AAExE,aAAa;AAEb;;GAEG;AACU,QAAA,2BAA2B,GAAc;IAClD,IAAI,EAAE,kBAAkB;IACxB,IAAI,EAAE,MAAM;IACZ,SAAS,EAAE,CAAC,KAAuB,EAAE,QAAyB,EAAU,EAAE;QACtE,MAAM,IAAI,GAAG,4BAAgB,CAAC,WAAW,CACrC,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC;aAC5B,MAAM,CAAC,CAAC,IAAa,EAAkB,EAAE,CAAC,OAAO,IAAI,KAAK,QAAQ,CAAC;aACnE,IAAI,CAAC,GAAG,CAAC,CACjB,CAAC,WAAW,EAAE,CAAC;QAEhB,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Transform } from 'style-dictionary/types';
2
+ export declare const quoteStringTransform: Transform;
3
+ //# sourceMappingURL=QuoteString.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"QuoteString.d.ts","sourceRoot":"","sources":["../../src/Transforms/QuoteString.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAoB,MAAM,wBAAwB,CAAC;AAK1E,eAAO,MAAM,oBAAoB,EAAE,SAMlC,CAAC"}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ // #region Imports
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.quoteStringTransform = void 0;
5
+ const GetValue_1 = require("../Utilities/GetValue");
6
+ // #endregion
7
+ exports.quoteStringTransform = {
8
+ name: 'value/quote-string',
9
+ type: 'value',
10
+ transitive: true,
11
+ filter: (token) => token.$type === 'string' || token.type === 'string',
12
+ transform: (token) => `"${(0, GetValue_1.getValue)(token)}"`
13
+ };
14
+ //# sourceMappingURL=QuoteString.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"QuoteString.js","sourceRoot":"","sources":["../../src/Transforms/QuoteString.ts"],"names":[],"mappings":";AAAA,kBAAkB;;;AAGlB,oDAAiD;AAEjD,aAAa;AAEA,QAAA,oBAAoB,GAAc;IAC3C,IAAI,EAAE,oBAAoB;IAC1B,IAAI,EAAE,OAAO;IACb,UAAU,EAAE,IAAI;IAChB,MAAM,EAAE,CAAC,KAAK,EAAW,EAAE,CAAC,KAAK,CAAC,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ;IAC/E,SAAS,EAAE,CAAC,KAAuB,EAAE,EAAE,CAAC,IAAI,IAAA,mBAAQ,EAAS,KAAK,CAAC,GAAG;CACzE,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Transform } from 'style-dictionary/types';
2
+ export declare const shadowCssTransform: Transform;
3
+ //# sourceMappingURL=Shadow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Shadow.d.ts","sourceRoot":"","sources":["../../src/Transforms/Shadow.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAoB,MAAM,wBAAwB,CAAC;AAyB1E,eAAO,MAAM,kBAAkB,EAAE,SAkBhC,CAAC"}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ // #region Imports
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.shadowCssTransform = void 0;
5
+ const GetValue_js_1 = require("../Utilities/GetValue.js");
6
+ function formatShadow({ offsetX = '0', offsetY = '0', blur = '0', spread = '0', color, inset = false }) {
7
+ return `${offsetX} ${offsetY} ${blur} ${spread} ${color} ${inset ? 'inset' : ''}`.trim();
8
+ }
9
+ exports.shadowCssTransform = {
10
+ name: 'shadow/css',
11
+ type: 'value',
12
+ transitive: true,
13
+ filter: (token) => token.$type === 'shadow' || token.type === 'shadow',
14
+ transform: (token) => {
15
+ const tokenValue = (0, GetValue_js_1.getValue)(token);
16
+ if (Array.isArray(tokenValue)) {
17
+ return tokenValue.map(formatShadow).join(', ');
18
+ }
19
+ if (typeof tokenValue === 'object') {
20
+ return formatShadow(tokenValue);
21
+ }
22
+ return tokenValue;
23
+ }
24
+ };
25
+ //# sourceMappingURL=Shadow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Shadow.js","sourceRoot":"","sources":["../../src/Transforms/Shadow.ts"],"names":[],"mappings":";AAAA,kBAAkB;;;AAGlB,0DAAoD;AAapD,SAAS,YAAY,CAAC,EAClB,OAAO,GAAG,GAAG,EACb,OAAO,GAAG,GAAG,EACb,IAAI,GAAG,GAAG,EACV,MAAM,GAAG,GAAG,EACZ,KAAK,EACL,KAAK,GAAG,KAAK,EACF;IACX,OAAO,GAAG,OAAO,IAAI,OAAO,IAAI,IAAI,IAAI,MAAM,IAAI,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC;AAC7F,CAAC;AAEY,QAAA,kBAAkB,GAAc;IACzC,IAAI,EAAE,YAAY;IAClB,IAAI,EAAE,OAAO;IACb,UAAU,EAAE,IAAI;IAChB,MAAM,EAAE,CAAC,KAAK,EAAW,EAAE,CAAC,KAAK,CAAC,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ;IAC/E,SAAS,EAAE,CAAC,KAAuB,EAAE,EAAE;QACnC,MAAM,UAAU,GAAG,IAAA,sBAAQ,EAAe,KAAK,CAAC,CAAC;QAEjD,IAAI,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;YAC5B,OAAO,UAAU,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACnD,CAAC;QAED,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE,CAAC;YACjC,OAAO,YAAY,CAAC,UAAU,CAAC,CAAC;QACpC,CAAC;QAED,OAAO,UAAU,CAAC;IACtB,CAAC;CACJ,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { DesignToken } from 'style-dictionary/types';
2
+ /**
3
+ * Recursively extracts all tokens of a given type from a nested token structure.
4
+ *
5
+ * @param tokens Root tokens object (nested structure)
6
+ * @param matchType Type to match (e.g. "shadow", "color")
7
+ * @returns Flat map of tokens with dot-path keys
8
+ */
9
+ export declare function extractTokensByType(tokens: Record<string, any>, matchType: string): Record<string, DesignToken>;
10
+ //# sourceMappingURL=Extract.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Extract.d.ts","sourceRoot":"","sources":["../../src/Utilities/Extract.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAI1D;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAC/B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC3B,SAAS,EAAE,MAAM,GAClB,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CA6B7B"}
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ // #region Imports
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.extractTokensByType = extractTokensByType;
5
+ // #endregion
6
+ /**
7
+ * Recursively extracts all tokens of a given type from a nested token structure.
8
+ *
9
+ * @param tokens Root tokens object (nested structure)
10
+ * @param matchType Type to match (e.g. "shadow", "color")
11
+ * @returns Flat map of tokens with dot-path keys
12
+ */
13
+ function extractTokensByType(tokens, matchType) {
14
+ const result = {};
15
+ const walk = (node, path = []) => {
16
+ if (typeof node !== 'object' || node === null) {
17
+ return;
18
+ }
19
+ const type = node?.type ?? node?.$type;
20
+ const value = node?.value ?? node?.$value;
21
+ const isToken = typeof value !== 'undefined' && (type || node?.name || node?.comment);
22
+ if (isToken && type === matchType) {
23
+ const key = path.join('.');
24
+ result[key] = {
25
+ ...node,
26
+ key
27
+ };
28
+ }
29
+ for (const [k, v] of Object.entries(node)) {
30
+ if (typeof v === 'object') {
31
+ walk(v, [...path, k]);
32
+ }
33
+ }
34
+ };
35
+ walk(tokens);
36
+ return result;
37
+ }
38
+ //# sourceMappingURL=Extract.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Extract.js","sourceRoot":"","sources":["../../src/Utilities/Extract.ts"],"names":[],"mappings":";AAAA,kBAAkB;;AAalB,kDAgCC;AAzCD,aAAa;AAEb;;;;;;GAMG;AACH,SAAgB,mBAAmB,CAC/B,MAA2B,EAC3B,SAAiB;IAEjB,MAAM,MAAM,GAAgC,EAAE,CAAC;IAE/C,MAAM,IAAI,GAAG,CAAC,IAAS,EAAE,OAAsB,EAAE,EAAQ,EAAE;QACvD,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;YAAC,OAAO;QAAC,CAAC;QAE1D,MAAM,IAAI,GAAG,IAAI,EAAE,IAAI,IAAI,IAAI,EAAE,KAAK,CAAC;QACvC,MAAM,KAAK,GAAG,IAAI,EAAE,KAAK,IAAI,IAAI,EAAE,MAAM,CAAC;QAE1C,MAAM,OAAO,GAAG,OAAO,KAAK,KAAK,WAAW,IAAI,CAAC,IAAI,IAAI,IAAI,EAAE,IAAI,IAAI,IAAI,EAAE,OAAO,CAAC,CAAC;QAEtF,IAAI,OAAO,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YAChC,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YAC3B,MAAM,CAAC,GAAG,CAAC,GAAG;gBACV,GAAG,IAAI;gBACP,GAAG;aACN,CAAC;QACN,CAAC;QAED,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;YACxC,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE,CAAC;gBACxB,IAAI,CAAC,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;YAC1B,CAAC;QACL,CAAC;IACL,CAAC,CAAC;IAEF,IAAI,CAAC,MAAM,CAAC,CAAC;IAEb,OAAO,MAAM,CAAC;AAClB,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { TransformedToken } from 'style-dictionary/types';
2
+ /**
3
+ * getValue
4
+ * @description Returns the value of the design token, either token.value or token.$value
5
+ * @param token StyleDictionary.DesignToken
6
+ * @returns token value
7
+ */
8
+ export declare const getValue: <T>(token: TransformedToken | Record<string, unknown>) => T;
9
+ //# sourceMappingURL=GetValue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GetValue.d.ts","sourceRoot":"","sources":["../../src/Utilities/GetValue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE/D;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,GAAI,CAAC,SAAS,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAG,CAAgC,CAAC"}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getValue = void 0;
4
+ /**
5
+ * getValue
6
+ * @description Returns the value of the design token, either token.value or token.$value
7
+ * @param token StyleDictionary.DesignToken
8
+ * @returns token value
9
+ */
10
+ const getValue = (token) => token.value ?? token.$value;
11
+ exports.getValue = getValue;
12
+ //# sourceMappingURL=GetValue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GetValue.js","sourceRoot":"","sources":["../../src/Utilities/GetValue.ts"],"names":[],"mappings":";;;AAEA;;;;;GAKG;AACI,MAAM,QAAQ,GAAG,CAAI,KAAiD,EAAK,EAAE,CAAC,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,CAAC;AAApG,QAAA,QAAQ,YAA4F"}
package/package.json ADDED
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "@breadstone-infrastructure/style-dictionary",
3
+ "description": "Common style-dictionary classes and functions",
4
+ "version": "0.0.12-beta.1",
5
+ "license": "MIT",
6
+ "author": "andre.wehlert <awehlert@breadstone.de> (https://www.breadstone.de)",
7
+ "repository": {
8
+ "url": "git+ssh://git@github.com/RueDeRennes/mosaik.git"
9
+ },
10
+ "type": "commonjs",
11
+ "main": "./Index.js",
12
+ "commonjs": "./Index.js",
13
+ "module": "./Index.js",
14
+ "types": "./Index.d.ts",
15
+ "dependencies": {
16
+ "@breadstone-infrastructure/utilities": "^0.0.12-beta.1",
17
+ "style-dictionary": "^4.4.0"
18
+ }
19
+ }