@muonic/muon 0.0.2-experimental-151-6e27a7a.0 → 0.0.2-experimental-152-a931dc2.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.
- package/components/card/src/card-component.js +2 -0
- package/components/image/src/image-component.js +2 -2
- package/components/inputter/src/inputter-component.js +2 -2
- package/package.json +1 -1
- package/scripts/style-dictionary.mjs +10 -0
- package/scripts/utils/index.mjs +3 -0
- package/tokens/utils/formats/reference.js +17 -0
|
@@ -205,8 +205,8 @@ export class Inputter extends ScopedElementsMixin(ValidationMixin(MaskMixin(Muon
|
|
|
205
205
|
}
|
|
206
206
|
}
|
|
207
207
|
|
|
208
|
-
|
|
209
|
-
* InputterDetail component to handle helper text
|
|
208
|
+
/**
|
|
209
|
+
* InputterDetail component to handle helper text.
|
|
210
210
|
*
|
|
211
211
|
* @element inputter-detail
|
|
212
212
|
* @private
|
package/package.json
CHANGED
|
@@ -21,6 +21,16 @@ export default {
|
|
|
21
21
|
}
|
|
22
22
|
]
|
|
23
23
|
},
|
|
24
|
+
ref: {
|
|
25
|
+
buildPath: path.join(buildPath, 'json/'),
|
|
26
|
+
transforms: ['color/css', 'size/rem'],
|
|
27
|
+
files: [
|
|
28
|
+
{
|
|
29
|
+
destination: 'muon-tokens-reference.json',
|
|
30
|
+
format: 'json/reference'
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
},
|
|
24
34
|
es6: {
|
|
25
35
|
buildPath: path.join(buildPath, 'es6/'),
|
|
26
36
|
transforms: ['name/cti/constant', 'color/css', 'size/rem'],
|
package/scripts/utils/index.mjs
CHANGED
|
@@ -12,6 +12,7 @@ import path from 'path';
|
|
|
12
12
|
import styleConfig from '../style-dictionary.mjs';
|
|
13
13
|
import colorTransform from '../../tokens/utils/transforms/color.js';
|
|
14
14
|
import stringTransform from '../../tokens/utils/transforms/string.js';
|
|
15
|
+
import jsonReference from '../../tokens/utils/formats/reference.js';
|
|
15
16
|
|
|
16
17
|
import { fileURLToPath } from 'url';
|
|
17
18
|
|
|
@@ -234,6 +235,8 @@ const styleDictionary = async () => {
|
|
|
234
235
|
|
|
235
236
|
const styleDict = StyleDictionary.extend(styleConfig);
|
|
236
237
|
|
|
238
|
+
styleDict.registerFormat(jsonReference);
|
|
239
|
+
|
|
237
240
|
styleDict.registerFormat({
|
|
238
241
|
name: 'css/fonts',
|
|
239
242
|
formatter: cssFontTemplate
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
name: 'json/reference',
|
|
3
|
+
formatter: function ({ dictionary }) {
|
|
4
|
+
const tokens = dictionary.allTokens.map((token) => {
|
|
5
|
+
token.usesReference = dictionary.usesReference(token.original.value);
|
|
6
|
+
if (token.usesReference) {
|
|
7
|
+
token.references = dictionary.getReferences(token.original.value);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
token.nestedName = token.path.join('.').toLowerCase();
|
|
11
|
+
|
|
12
|
+
return token;
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
return JSON.stringify(tokens, null, 2);
|
|
16
|
+
}
|
|
17
|
+
};
|