style-dictionary 5.1.1 → 5.1.4

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 (63) hide show
  1. package/README.md +2 -2
  2. package/examples/README.md +25 -25
  3. package/examples/advanced/assets-base64-embed/package.json +1 -1
  4. package/examples/advanced/create-react-app/package.json +1 -1
  5. package/examples/advanced/create-react-native-app/package.json +1 -1
  6. package/examples/advanced/custom-parser/package.json +1 -1
  7. package/examples/advanced/custom-transforms/package.json +1 -1
  8. package/examples/advanced/font-face-rules/package.json +1 -1
  9. package/examples/advanced/format-helpers/package.json +1 -1
  10. package/examples/advanced/matching-build-files/package.json +1 -1
  11. package/examples/advanced/multi-brand-multi-platform/package.json +1 -1
  12. package/examples/advanced/node-modules-as-config-and-properties/package.json +2 -2
  13. package/examples/advanced/npm-module/package.json +1 -1
  14. package/examples/advanced/referencing_aliasing/package.json +1 -1
  15. package/examples/advanced/s3/package.json +1 -1
  16. package/examples/advanced/tailwind-preset/package.json +1 -1
  17. package/examples/advanced/tokens-deprecation/package.json +1 -1
  18. package/examples/advanced/transitive-transforms/package.json +1 -1
  19. package/examples/advanced/variables-in-outputs/package.json +1 -1
  20. package/examples/advanced/yaml-tokens/package.json +1 -1
  21. package/examples/complete/StyleDictionary.podspec +1 -1
  22. package/examples/complete/android/demo/build.gradle +1 -1
  23. package/examples/complete/android/demo/src/androidTest/java/com/amazon/styledictionaryexample/ApplicationTest.java +1 -1
  24. package/examples/complete/android/demo/src/main/AndroidManifest.xml +1 -1
  25. package/examples/complete/android/demo/src/main/java/com/amazon/styledictionaryexample/BaseActivity.kt +1 -1
  26. package/examples/complete/android/demo/src/main/java/com/amazon/styledictionaryexample/MainActivity.kt +5 -5
  27. package/examples/complete/android/demo/src/main/java/com/amazon/styledictionaryexample/color/BackgroundColorActivity.kt +5 -5
  28. package/examples/complete/android/demo/src/main/java/com/amazon/styledictionaryexample/color/BaseColorActivity.kt +7 -7
  29. package/examples/complete/android/demo/src/main/java/com/amazon/styledictionaryexample/color/BaseColorListItem.kt +2 -2
  30. package/examples/complete/android/demo/src/main/java/com/amazon/styledictionaryexample/color/ColorDetailFragment.kt +6 -6
  31. package/examples/complete/android/demo/src/main/java/com/amazon/styledictionaryexample/color/ColorsActivity.kt +3 -3
  32. package/examples/complete/android/demo/src/main/java/com/amazon/styledictionaryexample/color/FontColorActivity.kt +5 -5
  33. package/examples/complete/android/demo/src/main/java/com/amazon/styledictionaryexample/icon/IconDetailActivity.kt +3 -3
  34. package/examples/complete/android/demo/src/main/java/com/amazon/styledictionaryexample/icon/IconDetailFragment.kt +5 -5
  35. package/examples/complete/android/demo/src/main/java/com/amazon/styledictionaryexample/icon/IconListActivity.kt +6 -6
  36. package/examples/complete/android/demo/src/main/java/com/amazon/styledictionaryexample/models/Property.kt +1 -1
  37. package/examples/complete/android/demo/src/main/java/com/amazon/styledictionaryexample/models/StyleDictionaryNode.kt +1 -1
  38. package/examples/complete/android/demo/src/main/java/com/amazon/styledictionaryexample/property/PropertiesActivity.kt +6 -6
  39. package/examples/complete/android/demo/src/main/java/com/amazon/styledictionaryexample/property/PropertyDetailActivity.kt +5 -5
  40. package/examples/complete/android/demo/src/main/java/com/amazon/styledictionaryexample/property/PropertyFragment.kt +5 -5
  41. package/examples/complete/android/demo/src/main/java/com/amazon/styledictionaryexample/property/PropertyRecyclerViewAdapter.kt +4 -4
  42. package/examples/complete/android/demo/src/main/java/com/amazon/styledictionaryexample/util/StringHelper.kt +1 -1
  43. package/examples/complete/android/demo/src/main/java/com/amazon/styledictionaryexample/util/StyleDictionaryHelper.kt +3 -3
  44. package/examples/complete/android/demo/src/main/res/layout/activity_background_color.xml +1 -1
  45. package/examples/complete/android/demo/src/main/res/layout/activity_base_color.xml +1 -1
  46. package/examples/complete/android/demo/src/main/res/layout/activity_colors.xml +1 -1
  47. package/examples/complete/android/demo/src/main/res/layout/activity_font_color.xml +1 -1
  48. package/examples/complete/android/demo/src/main/res/layout/activity_icon_detail.xml +1 -1
  49. package/examples/complete/android/demo/src/main/res/layout/activity_icon_list.xml +2 -2
  50. package/examples/complete/android/demo/src/main/res/layout/activity_main.xml +1 -1
  51. package/examples/complete/android/demo/src/main/res/layout/activity_properties.xml +2 -2
  52. package/examples/complete/android/demo/src/main/res/layout/activity_property_detail.xml +1 -1
  53. package/examples/complete/android/demo/src/main/res/layout/fragment_color_detail.xml +1 -1
  54. package/examples/complete/android/demo/src/main/res/layout/fragment_property_list.xml +2 -2
  55. package/examples/complete/android/demo/src/main/res/layout/icon_detail.xml +1 -1
  56. package/examples/complete/android/demo/src/test/java/com/amazon/styledictionaryexample/ExampleUnitTest.java +1 -1
  57. package/examples/complete/ios/Demo/Pods/Local Podspecs/StyleDictionary.podspec.json +3 -8
  58. package/examples/complete/ios/Demo/Pods/Target Support Files/Pods-StyleDictionary_Demo/Pods-StyleDictionary_Demo-acknowledgements.markdown +1 -1
  59. package/examples/complete/ios/Demo/Pods/Target Support Files/Pods-StyleDictionary_Demo/Pods-StyleDictionary_Demo-acknowledgements.plist +1 -1
  60. package/lib/StyleDictionary.js +1 -1
  61. package/lib/common/transforms.js +10 -4
  62. package/lib/transform/token.js +17 -13
  63. package/package.json +6 -7
package/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  [![npm version](https://img.shields.io/npm/v/style-dictionary.svg?style=flat-square)](https://badge.fury.io/js/style-dictionary)
8
8
  [![license](https://img.shields.io/npm/l/style-dictionary.svg?style=flat-square)](https://github.com/style-dictionary/style-dictionary/blob/main/LICENSE)
9
- [![PRs welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://github.com/amzn/style-dictionary/blob/main/CONTRIBUTING.md#submitting-pull-requests)
9
+ [![PRs welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://github.com/style-dictionary/style-dictionary/blob/main/CONTRIBUTING.md#submitting-pull-requests)
10
10
  [![GitHub Workflow Status](https://github.com/style-dictionary/style-dictionary/actions/workflows/verify.yml/badge.svg)](https://github.com/style-dictionary/style-dictionary/actions)
11
11
  [![downloads](https://img.shields.io/npm/dm/style-dictionary.svg?style=flat-square)](https://www.npmjs.com/package/style-dictionary)
12
12
 
@@ -316,7 +316,7 @@ For more information on creating your own transforms and formats, take a look at
316
316
 
317
317
  ## Mascot
318
318
 
319
- The mascot for Style Dictionary is ["Pascal"](https://github.com/amzn/style-dictionary/issues/97) the chameleon (seen below). You can also find them blending in as the logo throughout the documentation.
319
+ The mascot for Style Dictionary is ["Pascal"](https://github.com/style-dictionary/style-dictionary/issues/97) the chameleon (seen below). You can also find them blending in as the logo throughout the documentation.
320
320
 
321
321
  <img src="docs/src/assets/logo.png" alt="Style Dictionary logo and mascot" title="&quot;Pascal&quot;" width="240" />
322
322
 
@@ -1,8 +1,8 @@
1
- <img src="https://github.com/amzn/style-dictionary/raw/main/docs/assets/logo.png" alt="Style Dictionary logo" title="StyleDictionary" width="100" align="right" />
1
+ <img src="https://github.com/style-dictionary/style-dictionary/raw/main/docs/assets/logo.png" alt="Style Dictionary logo" title="StyleDictionary" width="100" align="right" />
2
2
 
3
3
  # Examples
4
4
 
5
- To get you started, there are some example packages included that you can use. You can [take a look at the code on Github](https://github.com/amzn/style-dictionary/tree/main/examples/) or you can use the CLI included to generate a new package using some of these examples. Here is how you can do that:
5
+ To get you started, there are some example packages included that you can use. You can [take a look at the code on Github](https://github.com/style-dictionary/style-dictionary/tree/main/examples/) or you can use the CLI included to generate a new package using some of these examples. Here is how you can do that:
6
6
 
7
7
  ```bash
8
8
  $ mkdir MyFolder
@@ -14,41 +14,41 @@ Where `[example]` is one of: `basic`, `complete`.
14
14
 
15
15
  ## Basic
16
16
 
17
- [View on Github](https://github.com/amzn/style-dictionary/tree/main/examples/basic)
17
+ [View on Github](https://github.com/style-dictionary/style-dictionary/tree/main/examples/basic)
18
18
 
19
19
  This example code is bare-bones to show you what this framework can do. Use this if you want to play around with what the Style Dictionary can do.
20
20
 
21
21
  ## Complete
22
22
 
23
- [View on Github](https://github.com/amzn/style-dictionary/tree/main/examples/complete)
23
+ [View on Github](https://github.com/style-dictionary/style-dictionary/tree/main/examples/complete)
24
24
 
25
25
  This is a more complete package and should have everything you need to get started. This package can be consumed as a Cocoapod on iOS, as a node module for web, and as a local library for Android.
26
26
 
27
27
  ## Advanced
28
28
 
29
- [View the folder](https://github.com/amzn/style-dictionary/tree/main/examples/advanced)
30
-
31
- If you want to look at more advanced examples of possible applications and customizations of Style Dictionary, the [`examples/advanced`](https://github.com/amzn/style-dictionary/tree/main/examples/advanced/) folder on GitHub contains these extra folders:
32
-
33
- - [**assets-base64-embed**](https://github.com/amzn/style-dictionary/tree/main/examples/advanced/assets-base64-embed) shows how it's possible to embed and distribute assets – like images, icons and fonts – directly as design tokens.
34
- - [**create-react-app**](https://github.com/amzn/style-dictionary/tree/main/examples/advanced/create-react-app) shows how to integrate Style Dictionary into a React application.
35
- - [**create-react-native-app**](https://github.com/amzn/style-dictionary/tree/main/examples/advanced/create-react-native-app) shows how to integrate Style Dictionary into a React Native application.
36
- - [**custom-parser**](https://github.com/amzn/style-dictionary/tree/main/examples/advanced/custom-parser) shows how to use custom parsers for token files.
37
- - [**custom-transforms**](https://github.com/amzn/style-dictionary/tree/main/examples/advanced/custom-transforms) shows how to use custom transforms (and transformGroups) to apply custom "transformations" to the design tokens.
38
- - [**flutter**](https://github.com/amzn/style-dictionary/tree/main/examples/advanced/flutter) shows how to integrate with Flutter applications.
39
- - [**matching-build-files**](https://github.com/amzn/style-dictionary/tree/main/examples/advanced/matching-build-files) shows how to output files 1-to-1 with source files.
40
- - [**multi-brand-multi-platform**](https://github.com/amzn/style-dictionary/tree/main/examples/advanced/multi-brand-multi-platform) shows how to set up Style Dictionary to support a multi-brand (for brand theming) and multi-platform (web, iOS, Android) solution, with token values depending on brand and platforms.
41
- - [**node-modules-as-config-and-properties**](https://github.com/amzn/style-dictionary/tree/main/examples/advanced/node-modules-as-config-and-properties) shows how to use Javascript rather than JSON for configuration and token files.
42
- - [**npm-module**](https://github.com/amzn/style-dictionary/tree/main/examples/advanced/npm-module) shows how to set up a style dictionary as an npm module, either to publish to a local npm service or to publish externally.
43
- - [**referencing_aliasing**](https://github.com/amzn/style-dictionary/tree/main/examples/advanced/referencing_aliasing) shows how to use referencing (or "aliasing") to reference a value -or an attribute– of a token and assign it to the value –or attribute– of another token.
44
- - [**s3**](https://github.com/amzn/style-dictionary/tree/main/examples/advanced/s3) shows how to set up a style dictionary to build files for different platforms (web, iOS, Android) and upload those build artifacts, together with a group of assets, to an S3 bucket.
45
- - [**tokens-deprecation**](https://github.com/amzn/style-dictionary/tree/main/examples/advanced/tokens-deprecation) shows one way to deprecate tokens by adding metadata to tokens and using custom formats to output comments in the generated files.
46
- - [**transitive-transforms**](https://github.com/amzn/style-dictionary/tree/main/examples/advanced/transitive-transforms) shows how to use transitive transforms to transform references
47
- - [**variables-in-outputs**](https://github.com/amzn/style-dictionary/tree/main/examples/advanced/variables-in-outputs) shows you how to use the `outputReferences` option to generate files variable references in them.
48
- - [**yaml-tokens**](https://github.com/amzn/style-dictionary/tree/main/examples/advanced/yaml-tokens) shows how to use a custom parser to define your source files in YAML rather than JSON.
29
+ [View the folder](https://github.com/style-dictionary/style-dictionary/tree/main/examples/advanced)
30
+
31
+ If you want to look at more advanced examples of possible applications and customizations of Style Dictionary, the [`examples/advanced`](https://github.com/style-dictionary/style-dictionary/tree/main/examples/advanced/) folder on GitHub contains these extra folders:
32
+
33
+ - [**assets-base64-embed**](https://github.com/style-dictionary/style-dictionary/tree/main/examples/advanced/assets-base64-embed) shows how it's possible to embed and distribute assets – like images, icons and fonts – directly as design tokens.
34
+ - [**create-react-app**](https://github.com/style-dictionary/style-dictionary/tree/main/examples/advanced/create-react-app) shows how to integrate Style Dictionary into a React application.
35
+ - [**create-react-native-app**](https://github.com/style-dictionary/style-dictionary/tree/main/examples/advanced/create-react-native-app) shows how to integrate Style Dictionary into a React Native application.
36
+ - [**custom-parser**](https://github.com/style-dictionary/style-dictionary/tree/main/examples/advanced/custom-parser) shows how to use custom parsers for token files.
37
+ - [**custom-transforms**](https://github.com/style-dictionary/style-dictionary/tree/main/examples/advanced/custom-transforms) shows how to use custom transforms (and transformGroups) to apply custom "transformations" to the design tokens.
38
+ - [**flutter**](https://github.com/style-dictionary/style-dictionary/tree/main/examples/advanced/flutter) shows how to integrate with Flutter applications.
39
+ - [**matching-build-files**](https://github.com/style-dictionary/style-dictionary/tree/main/examples/advanced/matching-build-files) shows how to output files 1-to-1 with source files.
40
+ - [**multi-brand-multi-platform**](https://github.com/style-dictionary/style-dictionary/tree/main/examples/advanced/multi-brand-multi-platform) shows how to set up Style Dictionary to support a multi-brand (for brand theming) and multi-platform (web, iOS, Android) solution, with token values depending on brand and platforms.
41
+ - [**node-modules-as-config-and-properties**](https://github.com/style-dictionary/style-dictionary/tree/main/examples/advanced/node-modules-as-config-and-properties) shows how to use Javascript rather than JSON for configuration and token files.
42
+ - [**npm-module**](https://github.com/style-dictionary/style-dictionary/tree/main/examples/advanced/npm-module) shows how to set up a style dictionary as an npm module, either to publish to a local npm service or to publish externally.
43
+ - [**referencing_aliasing**](https://github.com/style-dictionary/style-dictionary/tree/main/examples/advanced/referencing_aliasing) shows how to use referencing (or "aliasing") to reference a value -or an attribute– of a token and assign it to the value –or attribute– of another token.
44
+ - [**s3**](https://github.com/style-dictionary/style-dictionary/tree/main/examples/advanced/s3) shows how to set up a style dictionary to build files for different platforms (web, iOS, Android) and upload those build artifacts, together with a group of assets, to an S3 bucket.
45
+ - [**tokens-deprecation**](https://github.com/style-dictionary/style-dictionary/tree/main/examples/advanced/tokens-deprecation) shows one way to deprecate tokens by adding metadata to tokens and using custom formats to output comments in the generated files.
46
+ - [**transitive-transforms**](https://github.com/style-dictionary/style-dictionary/tree/main/examples/advanced/transitive-transforms) shows how to use transitive transforms to transform references
47
+ - [**variables-in-outputs**](https://github.com/style-dictionary/style-dictionary/tree/main/examples/advanced/variables-in-outputs) shows you how to use the `outputReferences` option to generate files variable references in them.
48
+ - [**yaml-tokens**](https://github.com/style-dictionary/style-dictionary/tree/main/examples/advanced/yaml-tokens) shows how to use a custom parser to define your source files in YAML rather than JSON.
49
49
 
50
50
  ---
51
51
 
52
52
  #### Do you think an example is missing?<br/>Do you want to see another example added to the project?<br/>Do you have a working example that we can add to the list?
53
53
 
54
- Fantastic! Let us know by [filing an issue](https://github.com/amzn/style-dictionary/issues) or sending us an email: style-dictionary@amazon.com.
54
+ Fantastic! Let us know by [filing an issue](https://github.com/style-dictionary/style-dictionary/issues).
@@ -12,6 +12,6 @@
12
12
  "author": "",
13
13
  "license": "Apache-2.0",
14
14
  "devDependencies": {
15
- "style-dictionary": "^5.1.1"
15
+ "style-dictionary": "^5.1.4"
16
16
  }
17
17
  }
@@ -12,7 +12,7 @@
12
12
  },
13
13
  "devDependencies": {
14
14
  "eslint-config-react-app": "^7.0.1",
15
- "style-dictionary": "^5.1.1"
15
+ "style-dictionary": "^5.1.4"
16
16
  },
17
17
  "resolutions": {
18
18
  "immer": "8.0.1",
@@ -29,7 +29,7 @@
29
29
  "eslint-config-react-app": "^7.0.1",
30
30
  "jest": "~25.2.6",
31
31
  "react-test-renderer": "~16.13.1",
32
- "style-dictionary": "^5.1.1"
32
+ "style-dictionary": "^5.1.4"
33
33
  },
34
34
  "jest": {
35
35
  "preset": "react-native"
@@ -10,6 +10,6 @@
10
10
  "author": "",
11
11
  "license": "Apache-2.0",
12
12
  "devDependencies": {
13
- "style-dictionary": "^5.1.1"
13
+ "style-dictionary": "^5.1.4"
14
14
  }
15
15
  }
@@ -16,6 +16,6 @@
16
16
  "author": "",
17
17
  "license": "Apache-2.0",
18
18
  "devDependencies": {
19
- "style-dictionary": "^5.1.1"
19
+ "style-dictionary": "^5.1.4"
20
20
  }
21
21
  }
@@ -9,6 +9,6 @@
9
9
  },
10
10
  "license": "Apache-2.0",
11
11
  "devDependencies": {
12
- "style-dictionary": "^5.1.1"
12
+ "style-dictionary": "^5.1.4"
13
13
  }
14
14
  }
@@ -10,6 +10,6 @@
10
10
  "author": "",
11
11
  "license": "Apache-2.0",
12
12
  "devDependencies": {
13
- "style-dictionary": "^5.1.1"
13
+ "style-dictionary": "^5.1.4"
14
14
  }
15
15
  }
@@ -17,6 +17,6 @@
17
17
  "author": "Kelly Harrop <kn.harrop@gmail.com>",
18
18
  "license": "Apache-2.0",
19
19
  "devDependencies": {
20
- "style-dictionary": "^5.1.1"
20
+ "style-dictionary": "^5.1.4"
21
21
  }
22
22
  }
@@ -16,6 +16,6 @@
16
16
  "author": "",
17
17
  "license": "Apache-2.0",
18
18
  "devDependencies": {
19
- "style-dictionary": "^5.1.1"
19
+ "style-dictionary": "^5.1.4"
20
20
  }
21
21
  }
@@ -11,7 +11,7 @@
11
11
  },
12
12
  "repository": {
13
13
  "type": "git",
14
- "url": "git://github.com/amzn/style-dictionary.git"
14
+ "url": "git://github.com/style-dictionary/style-dictionary.git"
15
15
  },
16
16
  "author": "",
17
17
  "license": "Apache-2.0",
@@ -20,7 +20,7 @@
20
20
  },
21
21
  "homepage": "https://github.com/dbanksdesign/style-dictionary-node#readme",
22
22
  "devDependencies": {
23
- "style-dictionary": "^5.1.1",
23
+ "style-dictionary": "^5.1.4",
24
24
  "tinycolor2": "^1.4.1"
25
25
  }
26
26
  }
@@ -17,6 +17,6 @@
17
17
  "author": "",
18
18
  "license": "Apache-2.0",
19
19
  "devDependencies": {
20
- "style-dictionary": "^5.1.1"
20
+ "style-dictionary": "^5.1.4"
21
21
  }
22
22
  }
@@ -16,6 +16,6 @@
16
16
  "author": "",
17
17
  "license": "Apache-2.0",
18
18
  "devDependencies": {
19
- "style-dictionary": "^5.1.1"
19
+ "style-dictionary": "^5.1.4"
20
20
  }
21
21
  }
@@ -16,6 +16,6 @@
16
16
  "devDependencies": {
17
17
  "aws-sdk": "^2.7.21",
18
18
  "fs-extra": "^1.0.0",
19
- "style-dictionary": "^5.1.1"
19
+ "style-dictionary": "^5.1.4"
20
20
  }
21
21
  }
@@ -10,7 +10,7 @@
10
10
  },
11
11
  "license": "Apache-2.0",
12
12
  "devDependencies": {
13
- "style-dictionary": "^5.1.1",
13
+ "style-dictionary": "^5.1.4",
14
14
  "tailwindcss": "^3.4.15",
15
15
  "mocha": "^10.2.0",
16
16
  "chai": "^5.1.1"
@@ -16,6 +16,6 @@
16
16
  "author": "",
17
17
  "license": "Apache-2.0",
18
18
  "devDependencies": {
19
- "style-dictionary": "^5.1.1"
19
+ "style-dictionary": "^5.1.4"
20
20
  }
21
21
  }
@@ -12,6 +12,6 @@
12
12
  "license": "ISC",
13
13
  "devDependencies": {
14
14
  "colorjs.io": "^0.5.2",
15
- "style-dictionary": "^5.1.1"
15
+ "style-dictionary": "^5.1.4"
16
16
  }
17
17
  }
@@ -11,6 +11,6 @@
11
11
  "author": "",
12
12
  "license": "MIT",
13
13
  "devDependencies": {
14
- "style-dictionary": "^5.1.1"
14
+ "style-dictionary": "^5.1.4"
15
15
  }
16
16
  }
@@ -10,7 +10,7 @@
10
10
  "author": "",
11
11
  "license": "Apache-2.0",
12
12
  "devDependencies": {
13
- "style-dictionary": "^5.1.1",
13
+ "style-dictionary": "^5.1.4",
14
14
  "yaml": "^1.10.0"
15
15
  }
16
16
  }
@@ -8,7 +8,7 @@ An example StyleDictionary cocoapod and example app.
8
8
  DESC
9
9
  s.homepage = 'homepage'
10
10
  s.license = { :type => 'Apache-2.0', :file => 'LICENSE' }
11
- s.author = { 'Danny Banks' => 'djb@amazon.com' }
11
+ s.author = { 'Danny Banks' => 'dbanks.design@gmail.com' }
12
12
  s.source = { :git => '', :tag => s.version.to_s }
13
13
  s.platform = :ios
14
14
  s.source_files = 'ios/Classes/**/*.{h,m}'
@@ -5,7 +5,7 @@ android {
5
5
  compileSdkVersion 30
6
6
 
7
7
  defaultConfig {
8
- applicationId "com.amazon.styledictionaryexample"
8
+ applicationId "com.styledictionaryexample"
9
9
  minSdkVersion 23
10
10
  targetSdkVersion 30
11
11
  versionCode 1
@@ -1,4 +1,4 @@
1
- package com.amazon.styledictionaryexample;
1
+ package com.styledictionaryexample;
2
2
 
3
3
  import android.app.Application;
4
4
  import android.test.ApplicationTestCase;
@@ -1,6 +1,6 @@
1
1
  <?xml version="1.0" encoding="utf-8"?>
2
2
  <manifest xmlns:android="http://schemas.android.com/apk/res/android"
3
- package="com.amazon.styledictionaryexample">
3
+ package="com.styledictionaryexample">
4
4
 
5
5
  <application
6
6
  android:allowBackup="true"
@@ -1,4 +1,4 @@
1
- package com.amazon.styledictionaryexample
1
+ package com.styledictionaryexample
2
2
 
3
3
  import android.content.Intent
4
4
  import android.view.MenuItem
@@ -1,14 +1,14 @@
1
- package com.amazon.styledictionaryexample
1
+ package com.styledictionaryexample
2
2
 
3
3
  import android.content.Intent
4
4
  import android.graphics.Typeface
5
5
  import android.os.Bundle
6
6
  import android.view.View
7
7
  import android.widget.Button
8
- import com.amazon.styledictionaryexample.color.ColorsActivity
9
- import com.amazon.styledictionaryexample.icon.IconListActivity
10
- import com.amazon.styledictionaryexample.property.PropertiesActivity
11
- import com.amazon.styledictionaryexample.util.StyleDictionaryHelper
8
+ import com.styledictionaryexample.color.ColorsActivity
9
+ import com.styledictionaryexample.icon.IconListActivity
10
+ import com.styledictionaryexample.property.PropertiesActivity
11
+ import com.styledictionaryexample.util.StyleDictionaryHelper
12
12
 
13
13
  @Suppress("UNUSED_PARAMETER")
14
14
  class MainActivity : BaseActivity() {
@@ -1,4 +1,4 @@
1
- package com.amazon.styledictionaryexample.color
1
+ package com.styledictionaryexample.color
2
2
 
3
3
  import android.os.Bundle
4
4
  import android.view.LayoutInflater
@@ -6,10 +6,10 @@ import android.view.View
6
6
  import android.view.ViewGroup
7
7
  import android.widget.TextView
8
8
  import androidx.recyclerview.widget.RecyclerView
9
- import com.amazon.styledictionaryexample.BaseActivity
10
- import com.amazon.styledictionaryexample.R
11
- import com.amazon.styledictionaryexample.models.Property
12
- import com.amazon.styledictionaryexample.util.StyleDictionaryHelper
9
+ import com.styledictionaryexample.BaseActivity
10
+ import com.styledictionaryexample.R
11
+ import com.styledictionaryexample.models.Property
12
+ import com.styledictionaryexample.util.StyleDictionaryHelper
13
13
  import java.util.*
14
14
 
15
15
  class BackgroundColorActivity : BaseActivity() {
@@ -1,4 +1,4 @@
1
- package com.amazon.styledictionaryexample.color
1
+ package com.styledictionaryexample.color
2
2
 
3
3
  import android.os.Bundle
4
4
  import android.view.LayoutInflater
@@ -6,12 +6,12 @@ import android.view.View
6
6
  import android.view.ViewGroup
7
7
  import android.widget.TextView
8
8
  import androidx.recyclerview.widget.RecyclerView
9
- import com.amazon.styledictionaryexample.BaseActivity
10
- import com.amazon.styledictionaryexample.R
11
- import com.amazon.styledictionaryexample.color.BaseColorListItem.BaseColorHeaderItem
12
- import com.amazon.styledictionaryexample.color.BaseColorListItem.BaseColorItem
13
- import com.amazon.styledictionaryexample.models.StyleDictionaryNode
14
- import com.amazon.styledictionaryexample.util.StyleDictionaryHelper
9
+ import com.styledictionaryexample.BaseActivity
10
+ import com.styledictionaryexample.R
11
+ import com.styledictionaryexample.color.BaseColorListItem.BaseColorHeaderItem
12
+ import com.styledictionaryexample.color.BaseColorListItem.BaseColorItem
13
+ import com.styledictionaryexample.models.StyleDictionaryNode
14
+ import com.styledictionaryexample.util.StyleDictionaryHelper
15
15
  import java.util.*
16
16
 
17
17
  class BaseColorActivity : BaseActivity() {
@@ -1,6 +1,6 @@
1
- package com.amazon.styledictionaryexample.color
1
+ package com.styledictionaryexample.color
2
2
 
3
- import com.amazon.styledictionaryexample.models.Property
3
+ import com.styledictionaryexample.models.Property
4
4
 
5
5
  interface BaseColorListItem {
6
6
  val isHeader: Boolean
@@ -1,4 +1,4 @@
1
- package com.amazon.styledictionaryexample.color
1
+ package com.styledictionaryexample.color
2
2
 
3
3
  import android.annotation.SuppressLint
4
4
  import android.os.Bundle
@@ -7,11 +7,11 @@ import android.view.View
7
7
  import android.view.ViewGroup
8
8
  import android.widget.TextView
9
9
  import androidx.fragment.app.Fragment
10
- import com.amazon.styledictionaryexample.R
11
- import com.amazon.styledictionaryexample.models.Property
12
- import com.amazon.styledictionaryexample.property.PropertyDetailActivity
13
- import com.amazon.styledictionaryexample.util.StringHelper
14
- import com.amazon.styledictionaryexample.util.StyleDictionaryHelper
10
+ import com.styledictionaryexample.R
11
+ import com.styledictionaryexample.models.Property
12
+ import com.styledictionaryexample.property.PropertyDetailActivity
13
+ import com.styledictionaryexample.util.StringHelper
14
+ import com.styledictionaryexample.util.StyleDictionaryHelper
15
15
 
16
16
  class ColorDetailFragment : Fragment() {
17
17
  private var property: Property? = null
@@ -1,13 +1,13 @@
1
1
  @file:Suppress("UNUSED_PARAMETER")
2
2
 
3
- package com.amazon.styledictionaryexample.color
3
+ package com.styledictionaryexample.color
4
4
 
5
5
  import android.content.Intent
6
6
  import android.os.Bundle
7
7
  import android.view.View
8
8
  import android.widget.Button
9
- import com.amazon.styledictionaryexample.BaseActivity
10
- import com.amazon.styledictionaryexample.R
9
+ import com.styledictionaryexample.BaseActivity
10
+ import com.styledictionaryexample.R
11
11
 
12
12
  class ColorsActivity : BaseActivity() {
13
13
  private var baseButton: Button? = null
@@ -1,4 +1,4 @@
1
- package com.amazon.styledictionaryexample.color
1
+ package com.styledictionaryexample.color
2
2
 
3
3
  import android.os.Bundle
4
4
  import android.view.LayoutInflater
@@ -6,10 +6,10 @@ import android.view.View
6
6
  import android.view.ViewGroup
7
7
  import android.widget.TextView
8
8
  import androidx.recyclerview.widget.RecyclerView
9
- import com.amazon.styledictionaryexample.BaseActivity
10
- import com.amazon.styledictionaryexample.R
11
- import com.amazon.styledictionaryexample.models.Property
12
- import com.amazon.styledictionaryexample.util.StyleDictionaryHelper
9
+ import com.styledictionaryexample.BaseActivity
10
+ import com.styledictionaryexample.R
11
+ import com.styledictionaryexample.models.Property
12
+ import com.styledictionaryexample.util.StyleDictionaryHelper
13
13
  import java.util.*
14
14
 
15
15
  class FontColorActivity : BaseActivity() {
@@ -1,8 +1,8 @@
1
- package com.amazon.styledictionaryexample.icon
1
+ package com.styledictionaryexample.icon
2
2
 
3
3
  import android.os.Bundle
4
- import com.amazon.styledictionaryexample.BaseActivity
5
- import com.amazon.styledictionaryexample.R
4
+ import com.styledictionaryexample.BaseActivity
5
+ import com.styledictionaryexample.R
6
6
 
7
7
  /**
8
8
  * An activity representing a single Icon detail screen. This
@@ -1,4 +1,4 @@
1
- package com.amazon.styledictionaryexample.icon
1
+ package com.styledictionaryexample.icon
2
2
 
3
3
  import android.annotation.SuppressLint
4
4
  import android.graphics.Typeface
@@ -8,10 +8,10 @@ import android.view.View
8
8
  import android.view.ViewGroup
9
9
  import android.widget.TextView
10
10
  import androidx.fragment.app.Fragment
11
- import com.amazon.styledictionaryexample.R
12
- import com.amazon.styledictionaryexample.models.Property
13
- import com.amazon.styledictionaryexample.util.StringHelper
14
- import com.amazon.styledictionaryexample.util.StyleDictionaryHelper
11
+ import com.styledictionaryexample.R
12
+ import com.styledictionaryexample.models.Property
13
+ import com.styledictionaryexample.util.StringHelper
14
+ import com.styledictionaryexample.util.StyleDictionaryHelper
15
15
 
16
16
  /**
17
17
  * A fragment representing a single Icon detail screen.
@@ -1,4 +1,4 @@
1
- package com.amazon.styledictionaryexample.icon
1
+ package com.styledictionaryexample.icon
2
2
 
3
3
  import android.content.Intent
4
4
  import android.graphics.Typeface
@@ -8,11 +8,11 @@ import android.view.View
8
8
  import android.view.ViewGroup
9
9
  import android.widget.TextView
10
10
  import androidx.recyclerview.widget.RecyclerView
11
- import com.amazon.styledictionaryexample.BaseActivity
12
- import com.amazon.styledictionaryexample.R
13
- import com.amazon.styledictionaryexample.models.Property
14
- import com.amazon.styledictionaryexample.util.StringHelper
15
- import com.amazon.styledictionaryexample.util.StyleDictionaryHelper
11
+ import com.styledictionaryexample.BaseActivity
12
+ import com.styledictionaryexample.R
13
+ import com.styledictionaryexample.models.Property
14
+ import com.styledictionaryexample.util.StringHelper
15
+ import com.styledictionaryexample.util.StyleDictionaryHelper
16
16
  import java.util.*
17
17
 
18
18
  /**
@@ -1,4 +1,4 @@
1
- package com.amazon.styledictionaryexample.models
1
+ package com.styledictionaryexample.models
2
2
 
3
3
  import com.fasterxml.jackson.annotation.JsonIgnoreProperties
4
4
 
@@ -1,4 +1,4 @@
1
- package com.amazon.styledictionaryexample.models
1
+ package com.styledictionaryexample.models
2
2
 
3
3
  data class StyleDictionaryNode(
4
4
  val name: String,
@@ -1,15 +1,15 @@
1
- package com.amazon.styledictionaryexample.property
1
+ package com.styledictionaryexample.property
2
2
 
3
3
  import android.content.Intent
4
4
  import android.os.Bundle
5
5
  import android.transition.Slide
6
6
  import android.view.Gravity
7
7
  import androidx.fragment.app.Fragment
8
- import com.amazon.styledictionaryexample.BaseActivity
9
- import com.amazon.styledictionaryexample.R
10
- import com.amazon.styledictionaryexample.models.StyleDictionaryNode
11
- import com.amazon.styledictionaryexample.property.PropertyFragment.OnListFragmentInteractionListener
12
- import com.amazon.styledictionaryexample.util.StyleDictionaryHelper
8
+ import com.styledictionaryexample.BaseActivity
9
+ import com.styledictionaryexample.R
10
+ import com.styledictionaryexample.models.StyleDictionaryNode
11
+ import com.styledictionaryexample.property.PropertyFragment.OnListFragmentInteractionListener
12
+ import com.styledictionaryexample.util.StyleDictionaryHelper
13
13
  import java.util.*
14
14
 
15
15
  class PropertiesActivity : BaseActivity(), OnListFragmentInteractionListener {
@@ -1,11 +1,11 @@
1
- package com.amazon.styledictionaryexample.property
1
+ package com.styledictionaryexample.property
2
2
 
3
3
  import android.os.Bundle
4
4
  import androidx.fragment.app.Fragment
5
- import com.amazon.styledictionaryexample.BaseActivity
6
- import com.amazon.styledictionaryexample.R
7
- import com.amazon.styledictionaryexample.color.ColorDetailFragment
8
- import com.amazon.styledictionaryexample.icon.IconDetailFragment
5
+ import com.styledictionaryexample.BaseActivity
6
+ import com.styledictionaryexample.R
7
+ import com.styledictionaryexample.color.ColorDetailFragment
8
+ import com.styledictionaryexample.icon.IconDetailFragment
9
9
 
10
10
  class PropertyDetailActivity : BaseActivity() {
11
11
  override fun onCreate(savedInstanceState: Bundle?) {
@@ -1,4 +1,4 @@
1
- package com.amazon.styledictionaryexample.property
1
+ package com.styledictionaryexample.property
2
2
 
3
3
  import android.content.Context
4
4
  import android.os.Bundle
@@ -7,10 +7,10 @@ import android.view.View
7
7
  import android.view.ViewGroup
8
8
  import androidx.fragment.app.Fragment
9
9
  import androidx.recyclerview.widget.RecyclerView
10
- import com.amazon.styledictionaryexample.R
11
- import com.amazon.styledictionaryexample.models.StyleDictionaryNode
12
- import com.amazon.styledictionaryexample.property.PropertyFragment.OnListFragmentInteractionListener
13
- import com.amazon.styledictionaryexample.util.StyleDictionaryHelper
10
+ import com.styledictionaryexample.R
11
+ import com.styledictionaryexample.models.StyleDictionaryNode
12
+ import com.styledictionaryexample.property.PropertyFragment.OnListFragmentInteractionListener
13
+ import com.styledictionaryexample.util.StyleDictionaryHelper
14
14
  import java.util.*
15
15
 
16
16
  /**
@@ -1,13 +1,13 @@
1
- package com.amazon.styledictionaryexample.property
1
+ package com.styledictionaryexample.property
2
2
 
3
3
  import android.view.LayoutInflater
4
4
  import android.view.View
5
5
  import android.view.ViewGroup
6
6
  import android.widget.TextView
7
7
  import androidx.recyclerview.widget.RecyclerView
8
- import com.amazon.styledictionaryexample.R
9
- import com.amazon.styledictionaryexample.models.StyleDictionaryNode
10
- import com.amazon.styledictionaryexample.property.PropertyFragment.OnListFragmentInteractionListener
8
+ import com.styledictionaryexample.R
9
+ import com.styledictionaryexample.models.StyleDictionaryNode
10
+ import com.styledictionaryexample.property.PropertyFragment.OnListFragmentInteractionListener
11
11
 
12
12
  /**
13
13
  * [RecyclerView.Adapter] that can display a [StyleDictionaryNode] and makes a call to the
@@ -1,4 +1,4 @@
1
- package com.amazon.styledictionaryexample.util
1
+ package com.styledictionaryexample.util
2
2
 
3
3
  object StringHelper {
4
4
  fun nameToDisplay(str: String): String {
@@ -1,8 +1,8 @@
1
- package com.amazon.styledictionaryexample.util
1
+ package com.styledictionaryexample.util
2
2
 
3
3
  import android.content.Context
4
- import com.amazon.styledictionaryexample.models.Property
5
- import com.amazon.styledictionaryexample.models.StyleDictionaryNode
4
+ import com.styledictionaryexample.models.Property
5
+ import com.styledictionaryexample.models.StyleDictionaryNode
6
6
  import com.fasterxml.jackson.databind.ObjectMapper
7
7
  import com.fasterxml.jackson.datatype.jsonorg.JsonOrgModule
8
8
  import org.json.JSONException
@@ -7,5 +7,5 @@
7
7
  android:layout_width="match_parent"
8
8
  android:layout_height="match_parent"
9
9
  app:layoutManager="LinearLayoutManager"
10
- tools:context="com.amazon.styledictionaryexample.color.BackgroundColorActivity"
10
+ tools:context="com.styledictionaryexample.color.BackgroundColorActivity"
11
11
  tools:listitem="@layout/icon_list_content" />
@@ -11,5 +11,5 @@
11
11
  android:paddingTop="0dp"
12
12
  android:paddingBottom="@dimen/size_padding_medium"
13
13
  app:layoutManager="LinearLayoutManager"
14
- tools:context="com.amazon.styledictionaryexample.color.BaseColorActivity"
14
+ tools:context="com.styledictionaryexample.color.BaseColorActivity"
15
15
  tools:listitem="@layout/base_color_list_content" />
@@ -8,7 +8,7 @@
8
8
  android:paddingLeft="@dimen/activity_horizontal_margin"
9
9
  android:paddingRight="@dimen/activity_horizontal_margin"
10
10
  android:paddingTop="@dimen/activity_vertical_margin"
11
- tools:context="com.amazon.styledictionaryexample.color.ColorsActivity">
11
+ tools:context="com.styledictionaryexample.color.ColorsActivity">
12
12
 
13
13
  <LinearLayout
14
14
  android:orientation="vertical"
@@ -7,5 +7,5 @@
7
7
  android:layout_width="match_parent"
8
8
  android:layout_height="match_parent"
9
9
  app:layoutManager="LinearLayoutManager"
10
- tools:context="com.amazon.styledictionaryexample.color.FontColorActivity"
10
+ tools:context="com.styledictionaryexample.color.FontColorActivity"
11
11
  tools:listitem="@layout/icon_list_content" />
@@ -3,5 +3,5 @@
3
3
  android:id="@+id/icon_detail_container"
4
4
  android:layout_width="match_parent"
5
5
  android:layout_height="match_parent"
6
- tools:context="com.amazon.styledictionaryexample.icon.IconDetailActivity"
6
+ tools:context="com.styledictionaryexample.icon.IconDetailActivity"
7
7
  tools:ignore="MergeRootFrame" />
@@ -3,9 +3,9 @@
3
3
  xmlns:app="http://schemas.android.com/apk/res-auto"
4
4
  xmlns:tools="http://schemas.android.com/tools"
5
5
  android:id="@+id/icon_list"
6
- android:name="com.amazon.styledictionaryexample.IconListFragment"
6
+ android:name="com.styledictionaryexample.IconListFragment"
7
7
  android:layout_width="match_parent"
8
8
  android:layout_height="match_parent"
9
9
  app:layoutManager="LinearLayoutManager"
10
- tools:context="com.amazon.styledictionaryexample.icon.IconListActivity"
10
+ tools:context="com.styledictionaryexample.icon.IconListActivity"
11
11
  tools:listitem="@layout/icon_list_content" />
@@ -8,7 +8,7 @@
8
8
  android:paddingRight="@dimen/size_padding_medium"
9
9
  android:paddingTop="@dimen/size_padding_medium"
10
10
  android:paddingBottom="@dimen/size_padding_medium"
11
- tools:context="com.amazon.styledictionaryexample.MainActivity">
11
+ tools:context="com.styledictionaryexample.MainActivity">
12
12
 
13
13
  <LinearLayout
14
14
  android:orientation="vertical"
@@ -5,10 +5,10 @@
5
5
  android:layout_width="match_parent"
6
6
  android:layout_height="match_parent"
7
7
  android:background="@color/color_background_base"
8
- tools:context="com.amazon.styledictionaryexample.property.PropertiesActivity">
8
+ tools:context="com.styledictionaryexample.property.PropertiesActivity">
9
9
  <fragment
10
10
  android:layout_width="match_parent"
11
11
  android:layout_height="match_parent"
12
12
  android:id="@+id/activity_properties_list_fragment"
13
- android:name="com.amazon.styledictionaryexample.property.PropertyFragment" />
13
+ android:name="com.styledictionaryexample.property.PropertyFragment" />
14
14
  </RelativeLayout>
@@ -4,5 +4,5 @@
4
4
  android:id="@+id/property_detail_container"
5
5
  android:layout_width="match_parent"
6
6
  android:layout_height="match_parent"
7
- tools:context="com.amazon.styledictionaryexample.property.PropertyDetailActivity"
7
+ tools:context="com.styledictionaryexample.property.PropertyDetailActivity"
8
8
  tools:ignore="MergeRootFrame" />
@@ -3,7 +3,7 @@
3
3
  android:layout_width="match_parent"
4
4
  android:layout_height="match_parent"
5
5
  android:orientation="vertical"
6
- tools:context="com.amazon.styledictionaryexample.color.ColorDetailFragment">
6
+ tools:context="com.styledictionaryexample.color.ColorDetailFragment">
7
7
 
8
8
  <View
9
9
  android:layout_width="match_parent"
@@ -3,11 +3,11 @@
3
3
  xmlns:app="http://schemas.android.com/apk/res-auto"
4
4
  xmlns:tools="http://schemas.android.com/tools"
5
5
  android:id="@+id/list"
6
- android:name="com.amazon.styledictionaryexample.PropertyFragment"
6
+ android:name="com.styledictionaryexample.PropertyFragment"
7
7
  android:layout_width="match_parent"
8
8
  android:layout_height="match_parent"
9
9
  android:background="@color/color_background_base"
10
10
  app:layoutManager="LinearLayoutManager"
11
- tools:context="com.amazon.styledictionaryexample.property.PropertyFragment"
11
+ tools:context="com.styledictionaryexample.property.PropertyFragment"
12
12
  tools:listitem="@layout/fragment_property_list_item"
13
13
  android:scrollbars="vertical" />
@@ -1,7 +1,7 @@
1
1
  <LinearLayout
2
2
  xmlns:android="http://schemas.android.com/apk/res/android"
3
3
  xmlns:tools="http://schemas.android.com/tools"
4
- tools:context="com.amazon.styledictionaryexample.icon.IconDetailFragment"
4
+ tools:context="com.styledictionaryexample.icon.IconDetailFragment"
5
5
  android:layout_width="match_parent"
6
6
  android:layout_height="wrap_content"
7
7
  android:background="@color/color_background_base"
@@ -1,4 +1,4 @@
1
- package com.amazon.styledictionaryexample;
1
+ package com.styledictionaryexample;
2
2
 
3
3
  import org.junit.Test;
4
4
 
@@ -9,7 +9,7 @@
9
9
  "file": "LICENSE"
10
10
  },
11
11
  "authors": {
12
- "Danny Banks": "djb@amazon.com"
12
+ "Danny Banks": "dbanks.design@gmail.com"
13
13
  },
14
14
  "source": {
15
15
  "git": "",
@@ -21,12 +21,7 @@
21
21
  "source_files": "ios/Classes/**/*.{h,m}",
22
22
  "public_header_files": "ios/Classes/**/*.h",
23
23
  "resource_bundles": {
24
- "StyleDictionary": [
25
- "assets/**/*"
26
- ]
24
+ "StyleDictionary": ["assets/**/*"]
27
25
  },
28
- "frameworks": [
29
- "UIKit",
30
- "QuartzCore"
31
- ]
26
+ "frameworks": ["UIKit", "QuartzCore"]
32
27
  }
@@ -3,7 +3,7 @@ This application makes use of the following third party libraries:
3
3
 
4
4
  ## StyleDictionary
5
5
 
6
- Copyright (c) 2017 Danny Banks <djb@amazon.com>
6
+ Copyright (c) 2017 Danny Banks <dbanks.design@gmail.com>
7
7
 
8
8
  Permission is hereby granted, free of charge, to any person obtaining a copy
9
9
  of this software and associated documentation files (the "Software"), to deal
@@ -14,7 +14,7 @@
14
14
  </dict>
15
15
  <dict>
16
16
  <key>FooterText</key>
17
- <string>Copyright (c) 2017 Danny Banks &lt;djb@amazon.com&gt;
17
+ <string>Copyright (c) 2017 Danny Banks &lt;dbanks.design@gmail.com&gt;
18
18
 
19
19
  Permission is hereby granted, free of charge, to any person obtaining a copy
20
20
  of this software and associated documentation files (the "Software"), to deal
@@ -67,7 +67,7 @@ export default class StyleDictionary extends Register {
67
67
  // Placeholder is transformed on prepublish -> see scripts/inject-version.js
68
68
  // Another option might be import pkg from './package.json' with { "type": "json" } which would work in both browser and node, but support is not there yet.
69
69
  // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import#browser_compatibility
70
- static VERSION = '5.1.1';
70
+ static VERSION = '5.1.4';
71
71
 
72
72
  /** @returns {Config} */
73
73
  get options() {
@@ -105,7 +105,9 @@ function wrapValueWithDoubleQuote(token, options) {
105
105
  * @returns {string}
106
106
  */
107
107
  function throwSizeError(name, value, unitType) {
108
- throw `Invalid Number: '${name}: ${value}' is not a valid number, cannot transform to '${unitType}' \n`;
108
+ throw new Error(
109
+ `Invalid Number: '${name}: ${value}' is not a valid number, cannot transform to '${unitType}' \n`,
110
+ );
109
111
  }
110
112
 
111
113
  /**
@@ -828,13 +830,17 @@ export default {
828
830
  filter: (token, options) => isDimension(token, options) || isFontSize(token, options),
829
831
  transform: function (token, _, options) {
830
832
  const nonParsed = options.usesDtcg ? token.$value : token.value;
831
- // if the dimension already has a unit (non-digit / . period character)
833
+ const parsedVal = parseFloat(nonParsed);
834
+
835
+ if (isNaN(parsedVal)) throwSizeError(token.name, nonParsed, 'rem');
836
+
837
+ // if the dimension already has a unit (non-digit / . period character or any arbitrary character)
832
838
  if (`${nonParsed}`.match(/[^0-9.-]+$/)) {
833
839
  return nonParsed;
834
840
  }
835
- const parsedVal = parseFloat(nonParsed);
836
- if (isNaN(parsedVal)) throwSizeError(token.name, nonParsed, 'rem');
841
+
837
842
  if (parsedVal === 0) return Number.isInteger(nonParsed) ? 0 : '0';
843
+
838
844
  return parsedVal + 'rem';
839
845
  },
840
846
  },
@@ -46,20 +46,24 @@ async function _transformTokenWrapper(transform, token, config, options, vol) {
46
46
  try {
47
47
  to_ret = await transform.transform(token, config, options, vol);
48
48
  } catch (e) {
49
- if (e instanceof Error) {
50
- const transformError = createErrorMessage(token, e, transform.name, !!options?.usesDtcg);
51
- // collect the errors so we can warn the user at the end of the run
52
- GroupMessages.add(TRANSFORM_ERRORS, transformError);
49
+ const message = e instanceof Error ? e.message : String(e);
50
+ const transformError = createErrorMessage(
51
+ token,
52
+ e instanceof Error ? e : new Error(message),
53
+ transform.name,
54
+ !!options?.usesDtcg,
55
+ );
56
+ // collect the errors so we can warn the user at the end of the run
57
+ GroupMessages.add(TRANSFORM_ERRORS, transformError);
53
58
 
54
- // Return a sensible fallback value
55
- switch (transform.type) {
56
- case 'attribute':
57
- return token.attributes;
58
- case 'name':
59
- return token.name;
60
- case 'value':
61
- return options.usesDtcg ? token.$value : token.value;
62
- }
59
+ // Return a sensible fallback value
60
+ switch (transform.type) {
61
+ case 'attribute':
62
+ return token.attributes;
63
+ case 'name':
64
+ return token.name;
65
+ case 'value':
66
+ return options.usesDtcg ? token.$value : token.value;
63
67
  }
64
68
  }
65
69
  return to_ret;
package/package.json CHANGED
@@ -1,12 +1,11 @@
1
1
  {
2
2
  "name": "style-dictionary",
3
- "version": "5.1.1",
3
+ "version": "5.1.4",
4
4
  "description": "Style once, use everywhere. A build system for creating cross-platform styles.",
5
5
  "keywords": [
6
6
  "style dictionary",
7
7
  "style",
8
8
  "dictionary",
9
- "amazon",
10
9
  "css",
11
10
  "design",
12
11
  "tokens",
@@ -97,27 +96,27 @@
97
96
  },
98
97
  "repository": {
99
98
  "type": "git",
100
- "url": "git://github.com/amzn/style-dictionary.git"
99
+ "url": "git://github.com/style-dictionary/style-dictionary.git"
101
100
  },
102
101
  "author": "Style Dictionary",
103
102
  "license": "Apache-2.0",
104
103
  "bugs": {
105
- "url": "https://github.com/amzn/style-dictionary/issues"
104
+ "url": "https://github.com/style-dictionary/style-dictionary/issues"
106
105
  },
107
106
  "contributors": [
108
107
  "Yuliya Baran <baranyu@amazon.com>",
109
108
  "Charles Dorner <dornerc@amazon.com>",
110
109
  "Dustin Boudreau <boudrd@amazon.com>",
111
- "Danny Banks <djb@amazon.com>",
110
+ "Danny Banks <dbanks.design@gmail.com>",
112
111
  "Joren Broekema <joren.broekema@gmail.com>"
113
112
  ],
114
- "homepage": "https://github.com/amzn/style-dictionary",
113
+ "homepage": "https://styledictionary.com",
115
114
  "overrides": {
116
115
  "tmp": "0.2.5"
117
116
  },
118
117
  "dependencies": {
119
118
  "@bundled-es-modules/deepmerge": "^4.3.1",
120
- "@bundled-es-modules/glob": "^11.0.3",
119
+ "@bundled-es-modules/glob": "^11.1.0",
121
120
  "@bundled-es-modules/memfs": "^4.9.4",
122
121
  "@zip.js/zip.js": "^2.7.44",
123
122
  "chalk": "^5.3.0",