style-dictionary 4.0.0-prerelease.9 → 4.0.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.
- package/README.md +29 -4
- package/bin/style-dictionary.js +33 -15
- package/examples/README.md +0 -4
- package/examples/advanced/assets-base64-embed/README.md +2 -2
- package/examples/advanced/assets-base64-embed/config.json +77 -68
- package/examples/advanced/assets-base64-embed/package.json +2 -1
- package/examples/advanced/assets-base64-embed/tokens/assets/fonts.json +6 -6
- package/examples/advanced/assets-base64-embed/tokens/assets/icons.json +28 -28
- package/examples/advanced/assets-base64-embed/tokens/assets/images.json +1 -1
- package/examples/advanced/assets-base64-embed/tokens/color/base.json +5 -5
- package/examples/advanced/assets-base64-embed/tokens/color/font.json +3 -3
- package/examples/advanced/assets-base64-embed/tokens/size/font.json +11 -7
- package/examples/advanced/create-react-app/package.json +2 -1
- package/examples/advanced/create-react-app/style-dictionary/config.json +13 -9
- package/examples/advanced/create-react-app/style-dictionary/tokens/color.json +22 -0
- package/examples/advanced/create-react-app/style-dictionary/tokens/font.json +34 -0
- package/examples/advanced/create-react-app/style-dictionary/tokens/spacing.json +16 -0
- package/examples/advanced/create-react-native-app/config.json +1 -1
- package/examples/advanced/create-react-native-app/metro.config.js +2 -1
- package/examples/advanced/create-react-native-app/package.json +2 -1
- package/examples/advanced/create-react-native-app/src/App.js +1 -0
- package/examples/advanced/create-react-native-app/style-dictionary/{properties → tokens}/color/brand.json +2 -6
- package/examples/advanced/create-react-native-app/style-dictionary/{properties → tokens}/size/size.json +2 -6
- package/examples/advanced/custom-parser/README.md +7 -4
- package/examples/advanced/custom-parser/package.json +2 -1
- package/examples/advanced/custom-parser/sd.config.js +14 -27
- package/examples/advanced/custom-parser/tokens/color/core.json +2 -2
- package/examples/advanced/custom-transforms/README.md +11 -11
- package/examples/advanced/custom-transforms/build.js +22 -30
- package/examples/advanced/custom-transforms/package.json +2 -1
- package/examples/advanced/custom-transforms/tokens/button.json +4 -3
- package/examples/advanced/custom-transforms/tokens/colors.json +7 -7
- package/examples/advanced/custom-transforms/tokens/font.json +7 -7
- package/examples/advanced/custom-transforms/tokens/spacing.json +5 -5
- package/examples/advanced/flutter/style_dictionary/config.json +42 -42
- package/examples/advanced/flutter/style_dictionary/tokens/color/background.json +9 -0
- package/examples/advanced/flutter/style_dictionary/tokens/color/core.json +10 -0
- package/examples/advanced/flutter/style_dictionary/tokens/color/font.json +9 -0
- package/examples/advanced/flutter/style_dictionary/tokens/size/font.json +9 -0
- package/examples/advanced/flutter/style_dictionary/tokens/size/padding.json +9 -0
- package/examples/advanced/font-face-rules/README.md +3 -2
- package/examples/advanced/font-face-rules/package.json +2 -1
- package/examples/advanced/font-face-rules/sd.config.js +4 -4
- package/examples/advanced/font-face-rules/tokens.json +8 -4
- package/examples/advanced/format-helpers/package.json +1 -1
- package/examples/advanced/format-helpers/sd.config.js +66 -62
- package/examples/advanced/format-helpers/tokens/color.json +5 -5
- package/examples/advanced/matching-build-files/config.js +17 -17
- package/examples/advanced/matching-build-files/package.json +2 -1
- package/examples/advanced/matching-build-files/tokens/button/base.json +14 -12
- package/examples/advanced/matching-build-files/tokens/color/base.json +10 -8
- package/examples/advanced/matching-build-files/tokens/index.js +3 -3
- package/examples/advanced/matching-build-files/tokens/size/base.json +14 -11
- package/examples/advanced/multi-brand-multi-platform/README.md +21 -21
- package/examples/advanced/multi-brand-multi-platform/build.js +3 -8
- package/examples/advanced/multi-brand-multi-platform/package.json +2 -1
- package/examples/advanced/multi-brand-multi-platform/tokens/brands/brand-1/color.json +3 -3
- package/examples/advanced/multi-brand-multi-platform/tokens/brands/brand-2/color.json +3 -3
- package/examples/advanced/multi-brand-multi-platform/tokens/brands/brand-3/color.json +3 -3
- package/examples/advanced/multi-brand-multi-platform/tokens/globals/button.json +4 -2
- package/examples/advanced/multi-brand-multi-platform/tokens/globals/color/base.json +11 -11
- package/examples/advanced/multi-brand-multi-platform/tokens/globals/color/font.json +4 -4
- package/examples/advanced/multi-brand-multi-platform/tokens/globals/font/index.json +3 -3
- package/examples/advanced/multi-brand-multi-platform/tokens/platforms/android/button.json +3 -2
- package/examples/advanced/multi-brand-multi-platform/tokens/platforms/android/font.json +2 -2
- package/examples/advanced/multi-brand-multi-platform/tokens/platforms/ios/button.json +3 -2
- package/examples/advanced/multi-brand-multi-platform/tokens/platforms/ios/font.json +2 -2
- package/examples/advanced/multi-brand-multi-platform/tokens/platforms/web/button.json +3 -2
- package/examples/advanced/multi-brand-multi-platform/tokens/platforms/web/font.json +2 -2
- package/examples/advanced/node-modules-as-config-and-properties/README.md +2 -2
- package/examples/advanced/node-modules-as-config-and-properties/components/button/base.js +3 -3
- package/examples/advanced/node-modules-as-config-and-properties/components/button/index.js +6 -3
- package/examples/advanced/node-modules-as-config-and-properties/components/button/primary.js +4 -3
- package/examples/advanced/node-modules-as-config-and-properties/components/button/secondary.js +4 -3
- package/examples/advanced/node-modules-as-config-and-properties/components/index.js +4 -2
- package/examples/advanced/node-modules-as-config-and-properties/config.js +23 -20
- package/examples/advanced/node-modules-as-config-and-properties/package.json +2 -1
- package/examples/advanced/node-modules-as-config-and-properties/tokens/color/background.js +1 -1
- package/examples/advanced/node-modules-as-config-and-properties/tokens/color/border.js +1 -1
- package/examples/advanced/node-modules-as-config-and-properties/tokens/color/brand.js +1 -1
- package/examples/advanced/node-modules-as-config-and-properties/tokens/color/core.js +5 -4
- package/examples/advanced/node-modules-as-config-and-properties/tokens/color/font.js +1 -1
- package/examples/advanced/node-modules-as-config-and-properties/tokens/color/index.js +12 -6
- package/examples/advanced/node-modules-as-config-and-properties/tokens/index.js +6 -3
- package/examples/advanced/node-modules-as-config-and-properties/tokens/size/border.js +1 -1
- package/examples/advanced/node-modules-as-config-and-properties/tokens/size/font.js +1 -1
- package/examples/advanced/node-modules-as-config-and-properties/tokens/size/index.js +1 -1
- package/examples/advanced/node-modules-as-config-and-properties/tokens/size/padding.js +1 -1
- package/examples/advanced/npm-module/package.json +2 -1
- package/examples/advanced/npm-module/tokens/color/base.json +5 -5
- package/examples/advanced/npm-module/tokens/color/font.json +3 -3
- package/examples/advanced/npm-module/tokens/size/font.json +11 -7
- package/examples/advanced/referencing_aliasing/package.json +2 -1
- package/examples/advanced/referencing_aliasing/tokens/button/button.json +8 -4
- package/examples/advanced/referencing_aliasing/tokens/color/base.json +9 -9
- package/examples/advanced/referencing_aliasing/tokens/color/font.json +3 -3
- package/examples/advanced/referencing_aliasing/tokens/size/font.json +11 -7
- package/examples/advanced/s3/config.json +63 -51
- package/examples/advanced/s3/package.json +2 -1
- package/examples/advanced/s3/tokens/assets/fonts.json +18 -0
- package/examples/advanced/s3/tokens/assets/icons.json +34 -0
- package/examples/advanced/s3/tokens/color/base.json +13 -0
- package/examples/advanced/s3/tokens/color/font.json +9 -0
- package/examples/advanced/s3/tokens/size/font.json +26 -0
- package/examples/advanced/s3/upload.js +2 -2
- package/examples/advanced/tokens-deprecation/build.js +13 -5
- package/examples/advanced/tokens-deprecation/package.json +2 -2
- package/examples/advanced/tokens-deprecation/templates/ios-plist.template.js +70 -0
- package/examples/advanced/tokens-deprecation/templates/web-scss.template.js +30 -0
- package/examples/advanced/transitive-transforms/package.json +3 -2
- package/examples/advanced/transitive-transforms/sd.config.js +37 -24
- package/examples/advanced/transitive-transforms/tokens/color/core.json5 +223 -155
- package/examples/advanced/transitive-transforms/tokens/color/font.json5 +21 -17
- package/examples/advanced/transitive-transforms/tokens/color/overlay.json5 +21 -15
- package/examples/advanced/variables-in-outputs/package.json +2 -1
- package/examples/advanced/variables-in-outputs/sd.config.js +26 -24
- package/examples/advanced/variables-in-outputs/tokens/color/background.json +4 -4
- package/examples/advanced/variables-in-outputs/tokens/color/palette.json +11 -11
- package/examples/advanced/yaml-tokens/package.json +2 -1
- package/examples/advanced/yaml-tokens/sd.config.js +17 -14
- package/examples/advanced/yaml-tokens/tokens/color/core.yaml +4 -0
- package/examples/basic/README.md +5 -179
- package/examples/basic/config.json +126 -105
- package/examples/basic/tokens/colors.json +40 -0
- package/examples/basic/tokens/dimensions.json +56 -0
- package/examples/basic/tokens/object-values.json +115 -0
- package/examples/basic/tokens/text.json +62 -0
- package/examples/complete/config.json +116 -85
- package/examples/complete/package.json +4 -3
- package/examples/complete/tokens/asset/font.json +10 -10
- package/examples/complete/tokens/color/background.json +58 -18
- package/examples/complete/tokens/color/base.json +256 -256
- package/examples/complete/tokens/color/border.json +10 -10
- package/examples/complete/tokens/color/brand.json +10 -10
- package/examples/complete/tokens/color/chart.json +9 -9
- package/examples/complete/tokens/color/font.json +22 -23
- package/examples/complete/tokens/content/icon.json +970 -970
- package/examples/complete/tokens/font.json +4 -2
- package/examples/complete/tokens/size/font.json +8 -8
- package/examples/complete/tokens/size/icon.json +5 -5
- package/examples/complete/tokens/size/padding.json +7 -7
- package/examples/complete/tokens/time.json +19 -19
- package/lib/Register.d.ts +24 -67
- package/lib/Register.js +146 -163
- package/lib/StyleDictionary.d.ts +114 -26
- package/lib/StyleDictionary.js +598 -86
- package/lib/cleanActions.d.ts +12 -6
- package/lib/cleanActions.js +16 -10
- package/lib/cleanDir.d.ts +8 -5
- package/lib/cleanDir.js +13 -8
- package/lib/cleanDirs.d.ts +6 -3
- package/lib/cleanDirs.js +15 -10
- package/lib/cleanFile.d.ts +8 -5
- package/lib/cleanFile.js +18 -10
- package/lib/cleanFiles.d.ts +6 -3
- package/lib/cleanFiles.js +15 -10
- package/lib/common/actions.d.ts +5 -5
- package/lib/common/actions.js +39 -30
- package/lib/common/filters.d.ts +2 -2
- package/lib/common/filters.js +2 -2
- package/lib/common/formatHelpers/createPropertyFormatter.d.ts +16 -12
- package/lib/common/formatHelpers/createPropertyFormatter.js +41 -24
- package/lib/common/formatHelpers/fileHeader.d.ts +17 -14
- package/lib/common/formatHelpers/fileHeader.js +27 -15
- package/lib/common/formatHelpers/formattedVariables.d.ts +16 -11
- package/lib/common/formatHelpers/formattedVariables.js +15 -8
- package/lib/common/formatHelpers/getTypeScriptType.d.ts +8 -6
- package/lib/common/formatHelpers/getTypeScriptType.js +7 -6
- package/lib/common/formatHelpers/iconsWithPrefix.d.ts +11 -8
- package/lib/common/formatHelpers/iconsWithPrefix.js +12 -9
- package/lib/common/formatHelpers/minifyDictionary.d.ts +5 -4
- package/lib/common/formatHelpers/minifyDictionary.js +7 -6
- package/lib/common/formatHelpers/setComposeObjectProperties.d.ts +6 -6
- package/lib/common/formatHelpers/setComposeObjectProperties.js +2 -2
- package/lib/common/formatHelpers/setSwiftFileProperties.d.ts +12 -9
- package/lib/common/formatHelpers/setSwiftFileProperties.js +7 -10
- package/lib/common/formatHelpers/sortByName.d.ts +3 -3
- package/lib/common/formatHelpers/sortByName.js +2 -2
- package/lib/common/formatHelpers/sortByReference.d.ts +5 -5
- package/lib/common/formatHelpers/sortByReference.js +5 -3
- package/lib/common/formats.d.ts +8 -17
- package/lib/common/formats.js +423 -252
- package/lib/common/templates/android/colors.template.d.ts +8 -1
- package/lib/common/templates/android/colors.template.js +24 -23
- package/lib/common/templates/android/dimens.template.d.ts +8 -1
- package/lib/common/templates/android/dimens.template.js +24 -22
- package/lib/common/templates/android/fontDimens.template.d.ts +8 -1
- package/lib/common/templates/android/fontDimens.template.js +24 -22
- package/lib/common/templates/android/integers.template.d.ts +8 -1
- package/lib/common/templates/android/integers.template.js +24 -22
- package/lib/common/templates/android/resources.template.d.ts +8 -6
- package/lib/common/templates/android/resources.template.js +33 -20
- package/lib/common/templates/android/strings.template.d.ts +8 -1
- package/lib/common/templates/android/strings.template.js +24 -22
- package/lib/common/templates/compose/object.kt.template.d.ts +9 -1
- package/lib/common/templates/compose/object.kt.template.js +25 -29
- package/lib/common/templates/css/fonts.css.template.d.ts +2 -1
- package/lib/common/templates/css/fonts.css.template.js +45 -28
- package/lib/common/templates/flutter/class.dart.template.d.ts +11 -1
- package/lib/common/templates/flutter/class.dart.template.js +22 -19
- package/lib/common/templates/ios/colors.h.template.d.ts +10 -1
- package/lib/common/templates/ios/colors.h.template.js +22 -21
- package/lib/common/templates/ios/colors.m.template.d.ts +10 -1
- package/lib/common/templates/ios/colors.m.template.js +22 -21
- package/lib/common/templates/ios/macros.template.d.ts +10 -1
- package/lib/common/templates/ios/macros.template.js +22 -20
- package/lib/common/templates/ios/plist.template.d.ts +9 -1
- package/lib/common/templates/ios/plist.template.js +53 -37
- package/lib/common/templates/ios/singleton.h.template.d.ts +8 -1
- package/lib/common/templates/ios/singleton.h.template.js +17 -18
- package/lib/common/templates/ios/singleton.m.template.d.ts +12 -1
- package/lib/common/templates/ios/singleton.m.template.js +61 -47
- package/lib/common/templates/ios/static.h.template.d.ts +10 -1
- package/lib/common/templates/ios/static.h.template.js +22 -20
- package/lib/common/templates/ios/static.m.template.d.ts +10 -1
- package/lib/common/templates/ios/static.m.template.js +28 -20
- package/lib/common/templates/ios/strings.h.template.d.ts +10 -1
- package/lib/common/templates/ios/strings.h.template.js +21 -20
- package/lib/common/templates/ios/strings.m.template.d.ts +11 -1
- package/lib/common/templates/ios/strings.m.template.js +50 -36
- package/lib/common/templates/ios-swift/any.swift.template.d.ts +11 -1
- package/lib/common/templates/ios-swift/any.swift.template.js +31 -25
- package/lib/common/templates/scss/map-deep.template.d.ts +8 -1
- package/lib/common/templates/scss/map-deep.template.js +45 -44
- package/lib/common/templates/scss/map-flat.template.d.ts +8 -1
- package/lib/common/templates/scss/map-flat.template.js +23 -30
- package/lib/common/templates/static-style-guide/index.html.template.d.ts +1 -1
- package/lib/common/templates/static-style-guide/index.html.template.js +2 -2
- package/lib/common/transformGroups.js +147 -99
- package/lib/common/transforms.d.ts +11 -4
- package/lib/common/transforms.js +565 -313
- package/lib/filterTokens.d.ts +9 -7
- package/lib/filterTokens.js +36 -16
- package/lib/fs-node.d.ts +5 -2
- package/lib/fs-node.js +14 -2
- package/lib/fs.d.ts +6 -7
- package/lib/fs.js +13 -5
- package/lib/performActions.d.ts +12 -7
- package/lib/performActions.js +16 -11
- package/lib/resolve.d.ts +1 -7
- package/lib/resolve.js +11 -2
- package/lib/transform/config.d.ts +5 -5
- package/lib/transform/config.js +97 -84
- package/lib/transform/object.d.ts +22 -16
- package/lib/transform/object.js +20 -12
- package/lib/transform/token.d.ts +17 -11
- package/lib/transform/token.js +30 -19
- package/lib/transform/tokenSetup.d.ts +4 -4
- package/lib/transform/tokenSetup.js +5 -5
- package/lib/utils/combineJSON.d.ts +12 -6
- package/lib/utils/combineJSON.js +44 -23
- package/lib/utils/convertToBase64.d.ts +7 -1
- package/lib/utils/convertToBase64.js +7 -3
- package/lib/utils/convertToDTCG.d.ts +38 -0
- package/lib/utils/convertToDTCG.js +199 -0
- package/lib/utils/createFormatArgs.d.ts +11 -24
- package/lib/utils/createFormatArgs.js +15 -15
- package/lib/utils/deepExtend.d.ts +9 -6
- package/lib/utils/deepExtend.js +18 -7
- package/lib/utils/deepmerge.d.ts +1 -1
- package/lib/utils/deepmerge.js +20 -2
- package/lib/utils/detectDtcgSyntax.d.ts +8 -0
- package/lib/utils/detectDtcgSyntax.js +39 -0
- package/lib/utils/downloadFile.d.ts +10 -0
- package/lib/utils/downloadFile.js +62 -0
- package/lib/utils/expandObjectTokens.d.ts +55 -0
- package/lib/utils/expandObjectTokens.js +258 -0
- package/lib/utils/flattenTokens.d.ts +4 -9
- package/lib/utils/flattenTokens.js +23 -16
- package/lib/utils/groupMessages.d.ts +10 -3
- package/lib/utils/groupMessages.js +17 -1
- package/lib/utils/index.d.ts +8 -1
- package/lib/utils/index.js +17 -1
- package/lib/utils/preprocess.d.ts +14 -7
- package/lib/utils/preprocess.js +22 -46
- package/lib/utils/references/createReferenceRegex.d.ts +2 -2
- package/lib/utils/references/createReferenceRegex.js +1 -1
- package/lib/utils/references/defaults.d.ts +1 -1
- package/lib/utils/references/defaults.js +1 -1
- package/lib/utils/references/getName.d.ts +3 -3
- package/lib/utils/references/getName.js +2 -2
- package/lib/utils/references/getPathFromName.js +1 -1
- package/lib/utils/references/getReferences.d.ts +10 -30
- package/lib/utils/references/getReferences.js +30 -38
- package/lib/utils/references/getValueByPath.d.ts +4 -4
- package/lib/utils/references/getValueByPath.js +2 -2
- package/lib/utils/references/outputReferencesFilter.d.ts +14 -0
- package/lib/utils/references/outputReferencesFilter.js +32 -0
- package/lib/utils/references/outputReferencesTransformed.d.ts +14 -0
- package/lib/utils/references/outputReferencesTransformed.js +30 -0
- package/lib/utils/references/resolveReferences.d.ts +12 -12
- package/lib/utils/references/resolveReferences.js +27 -27
- package/lib/utils/references/usesReferences.d.ts +3 -3
- package/lib/utils/references/usesReferences.js +1 -1
- package/lib/utils/resolveObject.d.ts +5 -4
- package/lib/utils/resolveObject.js +6 -4
- package/lib/utils/typeDtcgDelegate.d.ts +13 -0
- package/lib/utils/typeDtcgDelegate.js +44 -0
- package/package.json +36 -22
- package/types/Action.d.ts +8 -22
- package/types/Config.d.ts +76 -65
- package/types/DesignToken.d.ts +40 -59
- package/types/File.d.ts +19 -24
- package/types/Filter.d.ts +4 -18
- package/types/Format.d.ts +30 -41
- package/types/Parser.d.ts +6 -20
- package/types/Preprocessor.d.ts +4 -19
- package/types/Transform.d.ts +10 -24
- package/types/Volume.d.ts +4 -0
- package/types/index.d.ts +10 -27
- package/examples/advanced/auto-rebuild-watcher/README.md +0 -31
- package/examples/advanced/auto-rebuild-watcher/config.json +0 -69
- package/examples/advanced/auto-rebuild-watcher/package.json +0 -22
- package/examples/advanced/auto-rebuild-watcher/tokens/color/base.json +0 -13
- package/examples/advanced/auto-rebuild-watcher/tokens/color/font.json +0 -9
- package/examples/advanced/auto-rebuild-watcher/tokens/size/font.json +0 -22
- package/examples/advanced/component-cti/README.md +0 -88
- package/examples/advanced/component-cti/config.js +0 -73
- package/examples/advanced/component-cti/package.json +0 -20
- package/examples/advanced/component-cti/tokens/color/background.json +0 -9
- package/examples/advanced/component-cti/tokens/color/core.json +0 -10
- package/examples/advanced/component-cti/tokens/color/font.json +0 -9
- package/examples/advanced/component-cti/tokens/component/button.json +0 -19
- package/examples/advanced/component-cti/tokens/size/font.json +0 -9
- package/examples/advanced/component-cti/tokens/size/padding.json +0 -9
- package/examples/advanced/create-react-app/style-dictionary/properties/color.json +0 -18
- package/examples/advanced/create-react-app/style-dictionary/properties/font.json +0 -28
- package/examples/advanced/create-react-app/style-dictionary/properties/spacing.json +0 -13
- package/examples/advanced/custom-file-header/README.md +0 -44
- package/examples/advanced/custom-file-header/build.js +0 -120
- package/examples/advanced/custom-file-header/package.json +0 -15
- package/examples/advanced/custom-file-header/tokens/color.json +0 -9
- package/examples/advanced/custom-filters/README.md +0 -99
- package/examples/advanced/custom-filters/build.js +0 -24
- package/examples/advanced/custom-filters/config.json +0 -21
- package/examples/advanced/custom-filters/package.json +0 -20
- package/examples/advanced/custom-filters/tokens/spacing.json +0 -20
- package/examples/advanced/custom-formats-with-templates/README.md +0 -56
- package/examples/advanced/custom-formats-with-templates/build.js +0 -72
- package/examples/advanced/custom-formats-with-templates/config.json +0 -35
- package/examples/advanced/custom-formats-with-templates/package.json +0 -23
- package/examples/advanced/custom-formats-with-templates/properties/color/base.json +0 -13
- package/examples/advanced/custom-formats-with-templates/properties/color/font.json +0 -9
- package/examples/advanced/custom-formats-with-templates/properties/size/font.json +0 -22
- package/examples/advanced/custom-formats-with-templates/templates/android-xml.template +0 -30
- package/examples/advanced/custom-formats-with-templates/templates/android-xml_alt.hbs +0 -4
- package/examples/advanced/custom-formats-with-templates/templates/ios-plist.template +0 -24
- package/examples/advanced/custom-formats-with-templates/templates/ios-plist_alt.pug +0 -24
- package/examples/advanced/custom-formats-with-templates/templates/web-scss.template +0 -3
- package/examples/advanced/flutter/style_dictionary/properties/color/background.json +0 -9
- package/examples/advanced/flutter/style_dictionary/properties/color/core.json +0 -10
- package/examples/advanced/flutter/style_dictionary/properties/color/font.json +0 -9
- package/examples/advanced/flutter/style_dictionary/properties/size/font.json +0 -9
- package/examples/advanced/flutter/style_dictionary/properties/size/padding.json +0 -9
- package/examples/advanced/s3/properties/assets/fonts.json +0 -18
- package/examples/advanced/s3/properties/assets/icons.json +0 -34
- package/examples/advanced/s3/properties/color/base.json +0 -13
- package/examples/advanced/s3/properties/color/font.json +0 -9
- package/examples/advanced/s3/properties/size/font.json +0 -22
- package/examples/advanced/tokens-deprecation/templates/ios-plist.template +0 -30
- package/examples/advanced/tokens-deprecation/templates/web-scss.template +0 -16
- package/examples/basic/tokens/color/base.json +0 -13
- package/examples/basic/tokens/color/font.json +0 -9
- package/examples/basic/tokens/size/font.json +0 -22
- package/examples/complete/ios/README.md +0 -29
- package/lib/buildFile.d.ts +0 -19
- package/lib/buildFile.js +0 -186
- package/lib/buildFiles.d.ts +0 -16
- package/lib/buildFiles.js +0 -46
- package/types/FormatHelpers.d.ts +0 -0
- package/types/typeless-modules/bundled-glob.d.ts +0 -1
- package/types/typeless-modules/bundled-memfs.d.ts +0 -1
package/README.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
<a href="https://amzn.github.io/style-dictionary/#/version_3">What's new in Style Dictionary 3.0!</a>
|
|
3
3
|
</pre>
|
|
4
4
|
|
|
5
|
+
<pre>
|
|
6
|
+
<a href="https://github.com/amzn/style-dictionary#version-4">What's coming in Style Dictionary 4.0?</a>
|
|
7
|
+
</pre>
|
|
8
|
+
|
|
5
9
|
<img src="docs/assets/logo.png" alt="Style Dictionary logo and mascot" title=""Pascal"" width="100" align="right" />
|
|
6
10
|
|
|
7
11
|
[](https://badge.fury.io/js/style-dictionary)
|
|
@@ -162,7 +166,7 @@ This tells the style dictionary build system how and what to build. The default
|
|
|
162
166
|
}
|
|
163
167
|
```
|
|
164
168
|
|
|
165
|
-
|
|
|
169
|
+
| Property | Type | Description |
|
|
166
170
|
| :----------------------------------- | :---------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
167
171
|
| source | Array | An array of file path [globs](https://github.com/isaacs/node-glob) to design token files. Style Dictionary will do a deep merge of all of the token files, allowing you to organize your files files however you want. |
|
|
168
172
|
| include | Array | An array of file path [globs](https://github.com/isaacs/node-glob) to design token files that contain default styles. The Style Dictionary uses this as a base collection of tokens. The tokens found using the "source" attribute will overwrite tokens found using include. |
|
|
@@ -298,10 +302,10 @@ const StyleDictionary = require('style-dictionary').extend('config.json');
|
|
|
298
302
|
StyleDictionary.registerTransform({
|
|
299
303
|
name: 'time/seconds',
|
|
300
304
|
type: 'value',
|
|
301
|
-
|
|
302
|
-
return token.
|
|
305
|
+
filter: function (token) {
|
|
306
|
+
return token.type === 'time';
|
|
303
307
|
},
|
|
304
|
-
|
|
308
|
+
transform: function (token) {
|
|
305
309
|
return (parseInt(token.original.value) / 1000).toString() + 's';
|
|
306
310
|
},
|
|
307
311
|
});
|
|
@@ -311,6 +315,27 @@ StyleDictionary.buildAllPlatforms();
|
|
|
311
315
|
|
|
312
316
|
For more information on creating your own transforms and formats, take a look at our [docs](https://amzn.github.io/style-dictionary/).
|
|
313
317
|
|
|
318
|
+
## Version 4
|
|
319
|
+
|
|
320
|
+
In May 2021, we started [an issue / RFC, "What would you like to see in Style-Dictionary 4.0?"](https://github.com/amzn/style-dictionary/issues/643) to gather feedback on what the community would like to see.
|
|
321
|
+
Fortunately, in August 2023, the folks at [Tokens Studio](https://tokens.studio/) contacted us about co-maintaining this project, and leading the v4 release (and beyond)!
|
|
322
|
+
|
|
323
|
+
We have started working on the biggest and most important changes, like migrating to ESM, making the library browser-compatible out of the box, and supporting asynchronicity in Style-Dictionary's various APIs. There will be multiple prereleases to battle-test these changes before a final v4.0 is released.
|
|
324
|
+
|
|
325
|
+
You can follow [this roadmap board](https://github.com/orgs/amzn/projects/4/views/1?layout=board) to keep an eye on the developments for v4.0, we will also keep adding to this board when we encounter changes we'd like to see in v4.0 that would entail a breaking change. Absence of something in this roadmap does not mean we don't see value in it, but rather that it could also be added in a (non-breaking) minor release within v4.x.x.
|
|
326
|
+
|
|
327
|
+
### From the folks at Tokens Studio
|
|
328
|
+
|
|
329
|
+
Hi everyone! I'm Joren from Tokens Studio, a big fan of this project (see [Style-Dictionary-Play](https://www.style-dictionary-play.dev/), [Token Configurator](https://configurator.tokens.studio/), [sd-transforms](https://github.com/tokens-studio/sd-transforms)) and the main pusher behind leading a 4.0 release of this project, I think it would be good to explain from our perspective why we've made the move to collaborate with Amazon on this.
|
|
330
|
+
|
|
331
|
+
At Tokens Studio, we're a huge fan of Design Tokens and the workflows they enable. We believe exporting design tokens to various platforms is a key ingredient in ensuring that the journey from design to implementation code is smooth.
|
|
332
|
+
In our minds, Style-Dictionary has been the most popular and most flexible library for reaching that goal, and so we want to build on top of that.
|
|
333
|
+
Rather than starting our own spinoff tool, we much prefer bringing Style-Dictionary further, together with its vibrant community of contributors, which is why we reached out to Danny Banks.
|
|
334
|
+
|
|
335
|
+
I think it's important to stress that it is our shared vision to keep Style-Dictionary as an agnostic (so not "Tokens Studio"-specific) and flexible tool. As Tokens Studio, while we are highly incentivized to see this project progress further to strengthen our product journey, we value the open source community highly and want to make sure this library remains the go-to tool for exporting Design Tokens, whether you use Tokens Studio or not.
|
|
336
|
+
|
|
337
|
+
We are very open to feedback and collaboration, feel free to reach out to us in [our Slack](https://join.slack.com/t/tokens-studio/shared_invite/zt-1p8ea3m6t-C163oJcN9g3~YZTKRgo2hg) -> `style-dictionary-v4` channel!
|
|
338
|
+
|
|
314
339
|
## Mascot
|
|
315
340
|
|
|
316
341
|
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.
|
package/bin/style-dictionary.js
CHANGED
|
@@ -43,6 +43,12 @@ program
|
|
|
43
43
|
.command('build')
|
|
44
44
|
.description('Builds a style dictionary package from the current directory.')
|
|
45
45
|
.option('-c, --config <path>', 'set config path. defaults to ./config.json')
|
|
46
|
+
.option(
|
|
47
|
+
'-v, --verbose',
|
|
48
|
+
'enable verbose logging for reference errors, token collisions and filtered tokens with outputReferences',
|
|
49
|
+
)
|
|
50
|
+
.option('-n, --no-warn', 'disable all warnings, only success logs and fatal errors shown')
|
|
51
|
+
.option('-s, --silent', 'silence all logging, except for fatal errors')
|
|
46
52
|
.option(
|
|
47
53
|
'-p, --platform [platform]',
|
|
48
54
|
'only build specific platforms. Must be defined in the config',
|
|
@@ -57,6 +63,12 @@ program
|
|
|
57
63
|
'Removes files specified in the config of the style dictionary package of the current directory.',
|
|
58
64
|
)
|
|
59
65
|
.option('-c, --config <path>', 'set config path. defaults to ./config.json')
|
|
66
|
+
.option(
|
|
67
|
+
'-v, --verbose',
|
|
68
|
+
'enable verbose logging for reference errors, token collisions and filtered tokens with outputReferences',
|
|
69
|
+
)
|
|
70
|
+
.option('-n, --no-warn', 'disable all warnings, only success logs and fatal errors shown')
|
|
71
|
+
.option('-s, --silent', 'silence all logging, except for fatal errors')
|
|
60
72
|
.option(
|
|
61
73
|
'-p, --platform [platform]',
|
|
62
74
|
'only clean specific platform(s). Must be defined in the config',
|
|
@@ -76,7 +88,9 @@ program
|
|
|
76
88
|
}
|
|
77
89
|
/* eslint-disable no-console */
|
|
78
90
|
console.log('Copying starter files...\n');
|
|
79
|
-
node_fs.
|
|
91
|
+
node_fs.cpSync(path.join(__dirname, '..', 'examples', type), process.cwd(), {
|
|
92
|
+
recursive: true,
|
|
93
|
+
});
|
|
80
94
|
console.log('Source style dictionary starter files created!\n');
|
|
81
95
|
console.log(
|
|
82
96
|
'Running `style-dictionary build` for the first time to generate build artifacts.\n',
|
|
@@ -94,35 +108,39 @@ program.on('command:*', function () {
|
|
|
94
108
|
process.exit(1);
|
|
95
109
|
});
|
|
96
110
|
|
|
111
|
+
function getSD(configPath, options) {
|
|
112
|
+
let verbosity;
|
|
113
|
+
let warnings;
|
|
114
|
+
if (options.verbose || options.silent) {
|
|
115
|
+
verbosity = options.verbose ? 'verbose' : 'silent';
|
|
116
|
+
}
|
|
117
|
+
if (options.warn === false) {
|
|
118
|
+
warnings = 'disabled';
|
|
119
|
+
}
|
|
120
|
+
return new StyleDictionary(configPath, { verbosity, warnings });
|
|
121
|
+
}
|
|
122
|
+
|
|
97
123
|
async function styleDictionaryBuild(options) {
|
|
98
124
|
options = options || {};
|
|
99
125
|
const configPath = getConfigPath(options);
|
|
100
|
-
|
|
101
|
-
// Create a style dictionary object with the config
|
|
102
|
-
const styleDictionary = new StyleDictionary(configPath);
|
|
126
|
+
const sd = getSD(configPath, options);
|
|
103
127
|
|
|
104
128
|
if (options.platform && options.platform.length > 0) {
|
|
105
|
-
return Promise.all(
|
|
106
|
-
options.platforms.map((platform) => styleDictionary.buildPlatform(platform)),
|
|
107
|
-
);
|
|
129
|
+
return Promise.all(options.platforms.map((platform) => sd.buildPlatform(platform)));
|
|
108
130
|
} else {
|
|
109
|
-
return
|
|
131
|
+
return sd.buildAllPlatforms();
|
|
110
132
|
}
|
|
111
133
|
}
|
|
112
134
|
|
|
113
135
|
async function styleDictionaryClean(options) {
|
|
114
136
|
options = options || {};
|
|
115
137
|
const configPath = getConfigPath(options);
|
|
116
|
-
|
|
117
|
-
// Create a style dictionary object with the config
|
|
118
|
-
const styleDictionary = new StyleDictionary(configPath);
|
|
138
|
+
const sd = getSD(configPath, options);
|
|
119
139
|
|
|
120
140
|
if (options.platform && options.platform.length > 0) {
|
|
121
|
-
return Promise.all(
|
|
122
|
-
options.platforms.map((platform) => styleDictionary.cleanPlatform(platform)),
|
|
123
|
-
);
|
|
141
|
+
return Promise.all(options.platforms.map((platform) => sd.cleanPlatform(platform)));
|
|
124
142
|
} else {
|
|
125
|
-
return
|
|
143
|
+
return sd.cleanAllPlatforms();
|
|
126
144
|
}
|
|
127
145
|
}
|
|
128
146
|
|
package/examples/README.md
CHANGED
|
@@ -31,12 +31,8 @@ This is a more complete package and should have everything you need to get start
|
|
|
31
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
32
|
|
|
33
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
|
-
- [**auto-rebuild-watcher**](https://github.com/amzn/style-dictionary/tree/main/examples/advanced/auto-rebuild-watcher) shows how to setup a "watcher" that auto-rebuilds the tokens every time there is a change in the tokens.
|
|
35
|
-
- [**component-cti**](https://github.com/amzn/style-dictionary/tree/main/examples/advanced/component-cti) shows how to write component tokens and still use the CTI structure.
|
|
36
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.
|
|
37
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.
|
|
38
|
-
- [**custom-file-header**](https://github.com/amzn/style-dictionary/tree/main/examples/advanced/custom-file-header) shows how to define custom file headers and use them in output files.
|
|
39
|
-
- [**custom-formats-with-templates**](https://github.com/amzn/style-dictionary/tree/main/examples/advanced/custom-formats-with-templates) shows how to generate custom output formats using templates, useful when you need to distribute your design tokens into your own pipelines or scripts.
|
|
40
36
|
- [**custom-parser**](https://github.com/amzn/style-dictionary/tree/main/examples/advanced/custom-parser) shows how to use custom parsers for token files.
|
|
41
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.
|
|
42
38
|
- [**flutter**](https://github.com/amzn/style-dictionary/tree/main/examples/advanced/flutter) shows how to integrate with Flutter applications.
|
|
@@ -44,7 +44,7 @@ Open the `config.json` file and see how all the "assets/embed/\*" platform block
|
|
|
44
44
|
|
|
45
45
|
```
|
|
46
46
|
"assets/embed/json": {
|
|
47
|
-
"transforms": ["attribute/cti", "name/
|
|
47
|
+
"transforms": ["attribute/cti", "name/kebab", "asset/base64"],
|
|
48
48
|
"buildPath": "build/json/",
|
|
49
49
|
"files": [{
|
|
50
50
|
"destination": "assets_icons.json",
|
|
@@ -56,7 +56,7 @@ Open the `config.json` file and see how all the "assets/embed/\*" platform block
|
|
|
56
56
|
...
|
|
57
57
|
```
|
|
58
58
|
|
|
59
|
-
Here there are **three specific transforms**: _attribute/cti_ to assign the Category/Type/Item attributes to the tokens, _name/
|
|
59
|
+
Here there are **three specific transforms**: _attribute/cti_ to assign the Category/Type/Item attributes to the tokens, _name/kebab_ to assign them the correct name, and finally _asset/base64_ to take the path declared in the "value" of the tokens, convert the file at that path in base64 format, and assign the output of the base64 conversion to the "value" of the token.
|
|
60
60
|
|
|
61
61
|
If you take for example the file `assets/icons.json` you will see this declaration:
|
|
62
62
|
|
|
@@ -4,95 +4,104 @@
|
|
|
4
4
|
"scss": {
|
|
5
5
|
"transformGroup": "scss",
|
|
6
6
|
"buildPath": "build/scss/",
|
|
7
|
-
"files": [
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
"
|
|
12
|
-
"
|
|
7
|
+
"files": [
|
|
8
|
+
{
|
|
9
|
+
"destination": "colors.scss",
|
|
10
|
+
"format": "scss/variables",
|
|
11
|
+
"filter": {
|
|
12
|
+
"type": "color"
|
|
13
13
|
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"category": "size"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"destination": "sizes.scss",
|
|
17
|
+
"format": "scss/variables",
|
|
18
|
+
"filter": {
|
|
19
|
+
"type": "fontSize"
|
|
21
20
|
}
|
|
22
21
|
}
|
|
23
|
-
|
|
22
|
+
]
|
|
24
23
|
},
|
|
25
24
|
"json": {
|
|
26
25
|
"transformGroup": "web",
|
|
27
26
|
"buildPath": "build/json/",
|
|
28
|
-
"files": [
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
"files": [
|
|
28
|
+
{
|
|
29
|
+
"destination": "variables.json",
|
|
30
|
+
"format": "json/flat"
|
|
31
|
+
}
|
|
32
|
+
]
|
|
32
33
|
},
|
|
33
34
|
"assets/embed/scss": {
|
|
34
|
-
"transforms": ["attribute/cti", "name/
|
|
35
|
+
"transforms": ["attribute/cti", "name/kebab", "asset/base64"],
|
|
35
36
|
"buildPath": "build/scss/",
|
|
36
|
-
"files": [
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
|
|
37
|
+
"files": [
|
|
38
|
+
{
|
|
39
|
+
"destination": "assets_icons.scss",
|
|
40
|
+
"format": "scss/variables",
|
|
41
|
+
"filter": {
|
|
42
|
+
"attributes": {
|
|
43
|
+
"category": "asset",
|
|
44
|
+
"type": "icon"
|
|
45
|
+
}
|
|
43
46
|
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"destination": "assets_images.scss",
|
|
50
|
+
"format": "scss/variables",
|
|
51
|
+
"filter": {
|
|
52
|
+
"attributes": {
|
|
53
|
+
"category": "asset",
|
|
54
|
+
"type": "image"
|
|
55
|
+
}
|
|
52
56
|
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"destination": "assets_fonts.scss",
|
|
60
|
+
"format": "scss/variables",
|
|
61
|
+
"filter": {
|
|
62
|
+
"attributes": {
|
|
63
|
+
"category": "asset",
|
|
64
|
+
"type": "font"
|
|
65
|
+
}
|
|
61
66
|
}
|
|
62
67
|
}
|
|
63
|
-
|
|
68
|
+
]
|
|
64
69
|
},
|
|
65
70
|
"assets/embed/json": {
|
|
66
|
-
"transforms": ["attribute/cti", "name/
|
|
71
|
+
"transforms": ["attribute/cti", "name/kebab", "asset/base64"],
|
|
67
72
|
"buildPath": "build/json/",
|
|
68
|
-
"files": [
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
|
|
73
|
+
"files": [
|
|
74
|
+
{
|
|
75
|
+
"destination": "assets_icons.json",
|
|
76
|
+
"format": "json/flat",
|
|
77
|
+
"filter": {
|
|
78
|
+
"attributes": {
|
|
79
|
+
"category": "asset",
|
|
80
|
+
"type": "icon"
|
|
81
|
+
}
|
|
75
82
|
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"destination": "assets_images.json",
|
|
86
|
+
"format": "json/flat",
|
|
87
|
+
"filter": {
|
|
88
|
+
"attributes": {
|
|
89
|
+
"category": "asset",
|
|
90
|
+
"type": "image"
|
|
91
|
+
}
|
|
84
92
|
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"destination": "assets_fonts.json",
|
|
96
|
+
"format": "json/flat",
|
|
97
|
+
"filter": {
|
|
98
|
+
"attributes": {
|
|
99
|
+
"category": "asset",
|
|
100
|
+
"type": "font"
|
|
101
|
+
}
|
|
93
102
|
}
|
|
94
103
|
}
|
|
95
|
-
|
|
104
|
+
]
|
|
96
105
|
}
|
|
97
106
|
}
|
|
98
107
|
}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
"version": "1.0.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "build.js",
|
|
6
|
+
"type": "module",
|
|
6
7
|
"scripts": {
|
|
7
8
|
"build": "node_modules/.bin/style-dictionary build",
|
|
8
9
|
"clean": "rm -rf build",
|
|
@@ -11,6 +12,6 @@
|
|
|
11
12
|
"author": "",
|
|
12
13
|
"license": "Apache-2.0",
|
|
13
14
|
"devDependencies": {
|
|
14
|
-
"style-dictionary": "4.0.
|
|
15
|
+
"style-dictionary": "^4.0.1"
|
|
15
16
|
}
|
|
16
17
|
}
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
"asset": {
|
|
3
3
|
"font": {
|
|
4
4
|
"materialicons": {
|
|
5
|
-
"ttf"
|
|
6
|
-
"eot"
|
|
7
|
-
"woff"
|
|
8
|
-
"woff2": { "value": "assets/fonts/MaterialIcons-Regular.woff2" }
|
|
5
|
+
"ttf": { "value": "assets/fonts/MaterialIcons-Regular.ttf", "type": "asset" },
|
|
6
|
+
"eot": { "value": "assets/fonts/MaterialIcons-Regular.eot", "type": "asset" },
|
|
7
|
+
"woff": { "value": "assets/fonts/MaterialIcons-Regular.woff", "type": "asset" },
|
|
8
|
+
"woff2": { "value": "assets/fonts/MaterialIcons-Regular.woff2", "type": "asset" }
|
|
9
9
|
},
|
|
10
10
|
"opensans": {
|
|
11
|
-
"ttf"
|
|
11
|
+
"ttf": { "value": "assets/fonts/OpenSans-Regular.ttf", "type": "asset" }
|
|
12
12
|
},
|
|
13
13
|
"roboto": {
|
|
14
|
-
"ttf"
|
|
14
|
+
"ttf": { "value": "assets/fonts/Roboto-Regular.ttf", "type": "asset" }
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
}
|
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"asset": {
|
|
3
3
|
"icon": {
|
|
4
|
-
"alert-circle": { "value": "assets/icons/alert-circle.svg" },
|
|
5
|
-
"alert-octagon": { "value": "assets/icons/alert-octagon.svg" },
|
|
6
|
-
"alert-triangle": { "value": "assets/icons/alert-triangle.svg" },
|
|
7
|
-
"archive": { "value": "assets/icons/archive.svg" },
|
|
8
|
-
"book-open": { "value": "assets/icons/book-open.svg" },
|
|
9
|
-
"book": { "value": "assets/icons/book.svg" },
|
|
10
|
-
"bookmark": { "value": "assets/icons/bookmark.svg" },
|
|
11
|
-
"briefcase": { "value": "assets/icons/briefcase.svg" },
|
|
12
|
-
"calendar": { "value": "assets/icons/calendar.svg" },
|
|
13
|
-
"camera": { "value": "assets/icons/camera.svg" },
|
|
14
|
-
"check-circle": { "value": "assets/icons/check-circle.svg" },
|
|
15
|
-
"check-square": { "value": "assets/icons/check-square.svg" },
|
|
16
|
-
"database": { "value": "assets/icons/database.svg" },
|
|
17
|
-
"delete": { "value": "assets/icons/delete.svg" },
|
|
18
|
-
"dollar-sign": { "value": "assets/icons/dollar-sign.svg" },
|
|
19
|
-
"download-cloud": { "value": "assets/icons/download-cloud.svg" },
|
|
20
|
-
"edit-1": { "value": "assets/icons/edit-1.svg" },
|
|
21
|
-
"edit-2": { "value": "assets/icons/edit-2.svg" },
|
|
22
|
-
"edit-3": { "value": "assets/icons/edit-3.svg" },
|
|
23
|
-
"external-link": { "value": "assets/icons/external-link.svg" },
|
|
24
|
-
"file-text": { "value": "assets/icons/file-text.svg" },
|
|
25
|
-
"file": { "value": "assets/icons/file.svg" },
|
|
26
|
-
"film": { "value": "assets/icons/film.svg" },
|
|
27
|
-
"folder": { "value": "assets/icons/folder.svg" },
|
|
28
|
-
"gift": { "value": "assets/icons/gift.svg" },
|
|
29
|
-
"github": { "value": "assets/icons/github.svg" },
|
|
30
|
-
"globe": { "value": "assets/icons/globe.svg" },
|
|
31
|
-
"grid": { "value": "assets/icons/grid.svg" }
|
|
4
|
+
"alert-circle": { "value": "assets/icons/alert-circle.svg", "type": "asset" },
|
|
5
|
+
"alert-octagon": { "value": "assets/icons/alert-octagon.svg", "type": "asset" },
|
|
6
|
+
"alert-triangle": { "value": "assets/icons/alert-triangle.svg", "type": "asset" },
|
|
7
|
+
"archive": { "value": "assets/icons/archive.svg", "type": "asset" },
|
|
8
|
+
"book-open": { "value": "assets/icons/book-open.svg", "type": "asset" },
|
|
9
|
+
"book": { "value": "assets/icons/book.svg", "type": "asset" },
|
|
10
|
+
"bookmark": { "value": "assets/icons/bookmark.svg", "type": "asset" },
|
|
11
|
+
"briefcase": { "value": "assets/icons/briefcase.svg", "type": "asset" },
|
|
12
|
+
"calendar": { "value": "assets/icons/calendar.svg", "type": "asset" },
|
|
13
|
+
"camera": { "value": "assets/icons/camera.svg", "type": "asset" },
|
|
14
|
+
"check-circle": { "value": "assets/icons/check-circle.svg", "type": "asset" },
|
|
15
|
+
"check-square": { "value": "assets/icons/check-square.svg", "type": "asset" },
|
|
16
|
+
"database": { "value": "assets/icons/database.svg", "type": "asset" },
|
|
17
|
+
"delete": { "value": "assets/icons/delete.svg", "type": "asset" },
|
|
18
|
+
"dollar-sign": { "value": "assets/icons/dollar-sign.svg", "type": "asset" },
|
|
19
|
+
"download-cloud": { "value": "assets/icons/download-cloud.svg", "type": "asset" },
|
|
20
|
+
"edit-1": { "value": "assets/icons/edit-1.svg", "type": "asset" },
|
|
21
|
+
"edit-2": { "value": "assets/icons/edit-2.svg", "type": "asset" },
|
|
22
|
+
"edit-3": { "value": "assets/icons/edit-3.svg", "type": "asset" },
|
|
23
|
+
"external-link": { "value": "assets/icons/external-link.svg", "type": "asset" },
|
|
24
|
+
"file-text": { "value": "assets/icons/file-text.svg", "type": "asset" },
|
|
25
|
+
"file": { "value": "assets/icons/file.svg", "type": "asset" },
|
|
26
|
+
"film": { "value": "assets/icons/film.svg", "type": "asset" },
|
|
27
|
+
"folder": { "value": "assets/icons/folder.svg", "type": "asset" },
|
|
28
|
+
"gift": { "value": "assets/icons/gift.svg", "type": "asset" },
|
|
29
|
+
"github": { "value": "assets/icons/github.svg", "type": "asset" },
|
|
30
|
+
"globe": { "value": "assets/icons/globe.svg", "type": "asset" },
|
|
31
|
+
"grid": { "value": "assets/icons/grid.svg", "type": "asset" }
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
}
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
"color": {
|
|
3
3
|
"base": {
|
|
4
4
|
"gray": {
|
|
5
|
-
"light"
|
|
6
|
-
"medium": { "value": "#999999" },
|
|
7
|
-
"dark"
|
|
5
|
+
"light": { "value": "#CCCCCC", "type": "color" },
|
|
6
|
+
"medium": { "value": "#999999", "type": "color" },
|
|
7
|
+
"dark": { "value": "#111111", "type": "color" }
|
|
8
8
|
},
|
|
9
|
-
"red": { "value": "#FF0000" },
|
|
10
|
-
"green": { "value": "#00FF00" }
|
|
9
|
+
"red": { "value": "#FF0000", "type": "color" },
|
|
10
|
+
"green": { "value": "#00FF00", "type": "color" }
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"color": {
|
|
3
3
|
"font": {
|
|
4
|
-
"base"
|
|
5
|
-
"secondary": { "value": "{color.base.green.value}" },
|
|
6
|
-
"tertiary"
|
|
4
|
+
"base": { "value": "{color.base.red.value}", "type": "color" },
|
|
5
|
+
"secondary": { "value": "{color.base.green.value}", "type": "color" },
|
|
6
|
+
"tertiary": { "value": "{color.base.gray.light.value}", "type": "color" }
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
9
|
}
|
|
@@ -1,21 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"size": {
|
|
3
3
|
"font": {
|
|
4
|
-
"small"
|
|
4
|
+
"small": {
|
|
5
5
|
"value": "0.75",
|
|
6
|
-
"comment": "the small size of the font"
|
|
6
|
+
"comment": "the small size of the font",
|
|
7
|
+
"type": "fontSize"
|
|
7
8
|
},
|
|
8
9
|
"medium": {
|
|
9
10
|
"value": "1",
|
|
10
|
-
"comment": "the medium size of the font"
|
|
11
|
+
"comment": "the medium size of the font",
|
|
12
|
+
"type": "fontSize"
|
|
11
13
|
},
|
|
12
|
-
"large"
|
|
14
|
+
"large": {
|
|
13
15
|
"value": "2",
|
|
14
|
-
"comment": "the large size of the font"
|
|
16
|
+
"comment": "the large size of the font",
|
|
17
|
+
"type": "fontSize"
|
|
15
18
|
},
|
|
16
|
-
"base"
|
|
19
|
+
"base": {
|
|
17
20
|
"value": "{size.font.medium.value}",
|
|
18
|
-
"comment": "the base size of the font"
|
|
21
|
+
"comment": "the base size of the font",
|
|
22
|
+
"type": "fontSize"
|
|
19
23
|
}
|
|
20
24
|
}
|
|
21
25
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "style-dictionary-create-react-app",
|
|
3
3
|
"description": "",
|
|
4
|
+
"type": "module",
|
|
4
5
|
"version": "1.0.0",
|
|
5
6
|
"dependencies": {
|
|
6
7
|
"node-sass": "^7.0.0",
|
|
@@ -11,7 +12,7 @@
|
|
|
11
12
|
},
|
|
12
13
|
"devDependencies": {
|
|
13
14
|
"eslint-config-react-app": "^7.0.1",
|
|
14
|
-
"style-dictionary": "4.0.
|
|
15
|
+
"style-dictionary": "^4.0.1"
|
|
15
16
|
},
|
|
16
17
|
"resolutions": {
|
|
17
18
|
"immer": "8.0.1",
|
|
@@ -1,22 +1,26 @@
|
|
|
1
1
|
{
|
|
2
|
-
"source": ["./style-dictionary/
|
|
2
|
+
"source": ["./style-dictionary/tokens/**/*.json"],
|
|
3
3
|
"platforms": {
|
|
4
4
|
"scss": {
|
|
5
5
|
"transformGroup": "scss",
|
|
6
6
|
"buildPath": "./src/style-dictionary-dist/",
|
|
7
7
|
"prefix": "token",
|
|
8
|
-
"files": [
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
"files": [
|
|
9
|
+
{
|
|
10
|
+
"destination": "variables.scss",
|
|
11
|
+
"format": "scss/variables"
|
|
12
|
+
}
|
|
13
|
+
]
|
|
12
14
|
},
|
|
13
15
|
"js": {
|
|
14
16
|
"transformGroup": "js",
|
|
15
17
|
"buildPath": "./src/style-dictionary-dist/",
|
|
16
|
-
"files": [
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
"files": [
|
|
19
|
+
{
|
|
20
|
+
"destination": "variables.js",
|
|
21
|
+
"format": "javascript/es6"
|
|
22
|
+
}
|
|
23
|
+
]
|
|
20
24
|
}
|
|
21
25
|
}
|
|
22
26
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"color": {
|
|
3
|
+
"base": {
|
|
4
|
+
"primary": {
|
|
5
|
+
"value": "#61dafb",
|
|
6
|
+
"type": "color"
|
|
7
|
+
},
|
|
8
|
+
"secondary": {
|
|
9
|
+
"value": "#fc7aa5",
|
|
10
|
+
"type": "color"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"text": {
|
|
14
|
+
"value": "#666666",
|
|
15
|
+
"type": "color"
|
|
16
|
+
},
|
|
17
|
+
"background": {
|
|
18
|
+
"value": "#EEEEEE",
|
|
19
|
+
"type": "color"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|