@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.
@@ -5,6 +5,8 @@ import { Image } from '@muon/components/image';
5
5
  import styles from './card-styles.css';
6
6
 
7
7
  /**
8
+ * A card is a container for content.
9
+ *
8
10
  * @element card
9
11
  */
10
12
  export class Card extends ScopedElementsMixin(ImageHolderMixin(CardMixin(MuonElement))) {
@@ -9,8 +9,8 @@ import {
9
9
 
10
10
  import styles from './image-styles.css';
11
11
 
12
- /**.
13
- * Loading images with default lazy loading
12
+ /**
13
+ * Loading images with default lazy loading.
14
14
  *
15
15
  * @element image
16
16
  */
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@muonic/muon",
3
- "version": "0.0.2-experimental-151-6e27a7a.0",
3
+ "version": "0.0.2-experimental-152-a931dc2.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -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'],
@@ -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
+ };