@primer/primitives 9.1.2 → 10.0.0-rc.2963a70e
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 +2 -2
- package/dist/build/PrimerStyleDictionary.d.ts +1 -2
- package/dist/build/PrimerStyleDictionary.js +52 -64
- package/dist/build/filters/index.d.ts +14 -13
- package/dist/build/filters/index.js +14 -29
- package/dist/build/filters/isBorder.d.ts +3 -3
- package/dist/build/filters/isBorder.js +2 -6
- package/dist/build/filters/isColor.d.ts +3 -3
- package/dist/build/filters/isColor.js +8 -7
- package/dist/build/filters/isColorWithAlpha.d.ts +3 -3
- package/dist/build/filters/isColorWithAlpha.js +4 -8
- package/dist/build/filters/isColorWithMix.d.ts +3 -3
- package/dist/build/filters/isColorWithMix.js +4 -8
- package/dist/build/filters/isCubicBezier.d.ts +7 -0
- package/dist/build/filters/isCubicBezier.js +10 -0
- package/dist/build/filters/isDeprecated.d.ts +3 -3
- package/dist/build/filters/isDeprecated.js +2 -6
- package/dist/build/filters/isDimension.d.ts +3 -3
- package/dist/build/filters/isDimension.js +2 -6
- package/dist/build/filters/isDuration.d.ts +3 -3
- package/dist/build/filters/isDuration.js +2 -6
- package/dist/build/filters/isFontFamily.d.ts +3 -3
- package/dist/build/filters/isFontFamily.js +2 -6
- package/dist/build/filters/isFontWeight.d.ts +3 -3
- package/dist/build/filters/isFontWeight.js +2 -6
- package/dist/build/filters/isFromFile.d.ts +3 -3
- package/dist/build/filters/isFromFile.js +2 -6
- package/dist/build/filters/isNumber.d.ts +3 -3
- package/dist/build/filters/isNumber.js +4 -6
- package/dist/build/filters/isShadow.d.ts +3 -3
- package/dist/build/filters/isShadow.js +2 -6
- package/dist/build/filters/isSource.d.ts +3 -3
- package/dist/build/filters/isSource.js +2 -6
- package/dist/build/filters/isTypography.d.ts +3 -3
- package/dist/build/filters/isTypography.js +2 -6
- package/dist/build/formats/cssAdvanced.d.ts +2 -2
- package/dist/build/formats/cssAdvanced.js +22 -20
- package/dist/build/formats/cssCustomMedia.d.ts +2 -2
- package/dist/build/formats/cssCustomMedia.js +16 -15
- package/dist/build/formats/index.d.ts +9 -9
- package/dist/build/formats/index.js +9 -21
- package/dist/build/formats/javascriptCommonJs.d.ts +2 -2
- package/dist/build/formats/javascriptCommonJs.js +17 -16
- package/dist/build/formats/javascriptEsm.d.ts +2 -2
- package/dist/build/formats/javascriptEsm.js +17 -16
- package/dist/build/formats/jsonFigma.d.ts +2 -2
- package/dist/build/formats/jsonFigma.js +27 -22
- package/dist/build/formats/jsonNestedPrefixed.d.ts +3 -3
- package/dist/build/formats/jsonNestedPrefixed.js +17 -15
- package/dist/build/formats/jsonOneDimensional.d.ts +3 -3
- package/dist/build/formats/jsonOneDimensional.js +24 -16
- package/dist/build/formats/jsonPostCssFallback.d.ts +3 -3
- package/dist/build/formats/jsonPostCssFallback.js +5 -12
- package/dist/build/formats/typescriptExportDefinition.d.ts +2 -2
- package/dist/build/formats/typescriptExportDefinition.js +50 -46
- package/dist/build/formats/utilities/getPropName.d.ts +1 -0
- package/dist/build/formats/utilities/getPropName.js +16 -0
- package/dist/build/formats/utilities/jsonToFlat.d.ts +2 -2
- package/dist/build/formats/utilities/jsonToFlat.js +1 -5
- package/dist/build/formats/utilities/jsonToNestedValue.d.ts +2 -2
- package/dist/build/formats/utilities/jsonToNestedValue.js +4 -6
- package/dist/build/formats/utilities/prefixTokens.d.ts +2 -2
- package/dist/build/formats/utilities/prefixTokens.js +1 -5
- package/dist/build/parsers/index.d.ts +1 -1
- package/dist/build/parsers/index.js +1 -5
- package/dist/build/parsers/w3cJsonParser.d.ts +2 -2
- package/dist/build/parsers/w3cJsonParser.js +7 -9
- package/dist/build/platforms/css.d.ts +1 -1
- package/dist/build/platforms/css.js +20 -11
- package/dist/build/platforms/deprecatedJson.d.ts +1 -1
- package/dist/build/platforms/deprecatedJson.js +3 -7
- package/dist/build/platforms/docJson.d.ts +1 -1
- package/dist/build/platforms/docJson.js +8 -7
- package/dist/build/platforms/fallbacks.d.ts +1 -1
- package/dist/build/platforms/fallbacks.js +3 -7
- package/dist/build/platforms/figma.d.ts +1 -1
- package/dist/build/platforms/figma.js +21 -14
- package/dist/build/platforms/index.d.ts +10 -10
- package/dist/build/platforms/index.js +10 -23
- package/dist/build/platforms/javascript.d.ts +1 -1
- package/dist/build/platforms/javascript.js +3 -7
- package/dist/build/platforms/json.d.ts +1 -1
- package/dist/build/platforms/json.js +3 -7
- package/dist/build/platforms/styleLint.d.ts +1 -1
- package/dist/build/platforms/styleLint.js +3 -7
- package/dist/build/platforms/typeDefinitions.d.ts +1 -1
- package/dist/build/platforms/typeDefinitions.js +6 -10
- package/dist/build/platforms/typescript.d.ts +1 -1
- package/dist/build/platforms/typescript.js +3 -7
- package/dist/build/schemas/alphaValue.js +4 -7
- package/dist/build/schemas/baseToken.d.ts +2 -2
- package/dist/build/schemas/baseToken.js +4 -7
- package/dist/build/schemas/borderToken.d.ts +5 -5
- package/dist/build/schemas/borderToken.js +13 -16
- package/dist/build/schemas/collections.js +8 -14
- package/dist/build/schemas/colorHexValue.js +4 -7
- package/dist/build/schemas/colorToken.d.ts +20 -15
- package/dist/build/schemas/colorToken.js +24 -24
- package/dist/build/schemas/cubicBezierToken.d.ts +18 -0
- package/dist/build/schemas/cubicBezierToken.js +8 -0
- package/dist/build/schemas/designToken.js +30 -32
- package/dist/build/schemas/dimensionToken.d.ts +5 -5
- package/dist/build/schemas/dimensionToken.js +14 -17
- package/dist/build/schemas/dimensionValue.js +7 -10
- package/dist/build/schemas/durationToken.d.ts +5 -5
- package/dist/build/schemas/durationToken.js +8 -11
- package/dist/build/schemas/durationValue.js +4 -7
- package/dist/build/schemas/fontFamilyToken.d.ts +5 -5
- package/dist/build/schemas/fontFamilyToken.js +13 -16
- package/dist/build/schemas/fontWeightToken.d.ts +5 -5
- package/dist/build/schemas/fontWeightToken.js +14 -17
- package/dist/build/schemas/fontWeightValue.js +4 -7
- package/dist/build/schemas/numberToken.d.ts +5 -5
- package/dist/build/schemas/numberToken.js +15 -18
- package/dist/build/schemas/referenceValue.js +4 -7
- package/dist/build/schemas/scopes.js +5 -10
- package/dist/build/schemas/shadowToken.d.ts +5 -5
- package/dist/build/schemas/shadowToken.js +23 -26
- package/dist/build/schemas/stringToken.d.ts +5 -5
- package/dist/build/schemas/stringToken.js +7 -10
- package/dist/build/schemas/tokenName.js +4 -7
- package/dist/build/schemas/tokenType.d.ts +2 -2
- package/dist/build/schemas/tokenType.js +2 -6
- package/dist/build/schemas/typographyToken.d.ts +5 -5
- package/dist/build/schemas/typographyToken.js +14 -17
- package/dist/build/schemas/validTokenType.d.ts +1 -1
- package/dist/build/schemas/validTokenType.js +10 -13
- package/dist/build/schemas/viewportRangeToken.d.ts +5 -5
- package/dist/build/schemas/viewportRangeToken.js +7 -10
- package/dist/build/transformers/borderToCss.d.ts +3 -3
- package/dist/build/transformers/borderToCss.js +16 -16
- package/dist/build/transformers/colorToHex.d.ts +2 -2
- package/dist/build/transformers/colorToHex.js +11 -13
- package/dist/build/transformers/colorToHexMix.d.ts +2 -2
- package/dist/build/transformers/colorToHexMix.js +10 -15
- package/dist/build/transformers/colorToRgbAlpha.d.ts +2 -2
- package/dist/build/transformers/colorToRgbAlpha.js +10 -12
- package/dist/build/transformers/colorToRgbaFloat.d.ts +2 -2
- package/dist/build/transformers/colorToRgbaFloat.js +24 -28
- package/dist/build/transformers/cubicBezierToCss.d.ts +8 -0
- package/dist/build/transformers/cubicBezierToCss.js +23 -0
- package/dist/build/transformers/dimensionToPixelUnitless.d.ts +2 -2
- package/dist/build/transformers/dimensionToPixelUnitless.js +13 -14
- package/dist/build/transformers/dimensionToRem.d.ts +2 -2
- package/dist/build/transformers/dimensionToRem.js +12 -13
- package/dist/build/transformers/dimensionToRemPxArray.d.ts +2 -2
- package/dist/build/transformers/dimensionToRemPxArray.js +11 -12
- package/dist/build/transformers/durationToCss.d.ts +2 -2
- package/dist/build/transformers/durationToCss.js +10 -11
- package/dist/build/transformers/figmaAttributes.d.ts +2 -2
- package/dist/build/transformers/figmaAttributes.js +3 -5
- package/dist/build/transformers/floatToPixel.d.ts +4 -4
- package/dist/build/transformers/floatToPixel.js +12 -14
- package/dist/build/transformers/fontFamilyToCss.d.ts +2 -2
- package/dist/build/transformers/fontFamilyToCss.js +10 -13
- package/dist/build/transformers/fontFamilyToFigma.d.ts +3 -3
- package/dist/build/transformers/fontFamilyToFigma.js +15 -17
- package/dist/build/transformers/fontWeightToNumber.d.ts +2 -2
- package/dist/build/transformers/fontWeightToNumber.js +8 -11
- package/dist/build/transformers/index.d.ts +25 -24
- package/dist/build/transformers/index.js +25 -51
- package/dist/build/transformers/jsonDeprecated.d.ts +2 -2
- package/dist/build/transformers/jsonDeprecated.js +6 -8
- package/dist/build/transformers/namePathToCamelCase.d.ts +2 -2
- package/dist/build/transformers/namePathToCamelCase.js +5 -7
- package/dist/build/transformers/namePathToDotNotation.d.ts +2 -2
- package/dist/build/transformers/namePathToDotNotation.js +6 -8
- package/dist/build/transformers/namePathToFigma.d.ts +3 -3
- package/dist/build/transformers/namePathToFigma.js +5 -8
- package/dist/build/transformers/namePathToKebabCase.d.ts +2 -2
- package/dist/build/transformers/namePathToKebabCase.js +4 -6
- package/dist/build/transformers/namePathToPascalCase.d.ts +2 -2
- package/dist/build/transformers/namePathToPascalCase.js +5 -7
- package/dist/build/transformers/namePathToSlashNotation.d.ts +2 -2
- package/dist/build/transformers/namePathToSlashNotation.js +4 -6
- package/dist/build/transformers/shadowToCss.d.ts +2 -2
- package/dist/build/transformers/shadowToCss.js +14 -15
- package/dist/build/transformers/typographyToCss.d.ts +2 -2
- package/dist/build/transformers/typographyToCss.js +13 -15
- package/dist/build/transformers/utilities/alpha.d.ts +1 -1
- package/dist/build/transformers/utilities/alpha.js +4 -8
- package/dist/build/transformers/utilities/checkRequiredTokenProperties.js +1 -5
- package/dist/build/transformers/utilities/getTokenValue.d.ts +2 -2
- package/dist/build/transformers/utilities/getTokenValue.js +10 -12
- package/dist/build/transformers/utilities/hasSpaceInString.js +1 -5
- package/dist/build/transformers/utilities/hexToRgbaFloat.d.ts +1 -1
- package/dist/build/transformers/utilities/hexToRgbaFloat.js +1 -5
- package/dist/build/transformers/utilities/invalidTokenError.d.ts +1 -1
- package/dist/build/transformers/utilities/invalidTokenError.js +11 -10
- package/dist/build/transformers/utilities/isRgbaFloat.js +1 -5
- package/dist/build/transformers/utilities/mix.js +5 -7
- package/dist/build/transformers/utilities/rgbaFloatToHex.js +1 -5
- package/dist/build/types/Border.d.ts +5 -0
- package/dist/build/types/BorderTokenValue.d.ts +10 -0
- package/dist/build/types/ColorHex.d.ts +4 -0
- package/dist/build/types/PlatformInitializer.d.ts +11 -0
- package/dist/build/types/Shadow.d.ts +5 -0
- package/dist/build/types/ShadowTokenValue.d.ts +14 -0
- package/dist/build/types/SizeEm.d.ts +4 -0
- package/dist/build/types/SizePx.d.ts +4 -0
- package/dist/build/types/SizeRem.d.ts +4 -0
- package/dist/build/types/StyleDictionaryConfigGenerator.d.ts +15 -0
- package/dist/build/types/TokenBuildInput.d.ts +8 -0
- package/dist/build/types/TypographyTokenValue.d.ts +12 -0
- package/dist/build/types/w3cTransformedToken.d.ts +8 -0
- package/dist/build/utilities/copyFromDir.d.ts +2 -2
- package/dist/build/utilities/copyFromDir.js +7 -10
- package/dist/build/utilities/filterStringArray.js +1 -5
- package/dist/build/utilities/getFlag.js +1 -5
- package/dist/build/utilities/index.d.ts +9 -3
- package/dist/build/utilities/index.js +9 -9
- package/dist/build/utilities/joinFriendly.js +1 -5
- package/dist/build/utilities/schemaErrorMessage.js +1 -5
- package/dist/build/utilities/toCamelCase.js +5 -9
- package/dist/build/utilities/toPascalCase.js +5 -9
- package/dist/build/utilities/treeWalker.js +2 -6
- package/dist/build/utilities/upperCaseFirstCharacter.js +1 -5
- package/dist/css/base/motion/motion.css +17 -0
- package/dist/css/functional/motion/motion.css +4 -3
- package/dist/css/functional/themes/dark-colorblind.css +58 -38
- package/dist/css/functional/themes/dark-dimmed.css +44 -24
- package/dist/css/functional/themes/dark-high-contrast.css +62 -42
- package/dist/css/functional/themes/dark-tritanopia.css +44 -24
- package/dist/css/functional/themes/dark.css +42 -22
- package/dist/css/functional/themes/light-colorblind.css +60 -40
- package/dist/css/functional/themes/light-high-contrast.css +58 -38
- package/dist/css/functional/themes/light-tritanopia.css +42 -22
- package/dist/css/functional/themes/light.css +42 -22
- package/dist/css/functional/typography/typography.css +43 -43
- package/dist/css/primitives.css +64 -46
- package/dist/docs/base/motion/motion.json +205 -0
- package/dist/docs/base/size/size.json +76 -76
- package/dist/docs/base/typography/typography.json +16 -16
- package/dist/docs/functional/motion/motion.json +33 -18
- package/dist/docs/functional/size/border.json +56 -56
- package/dist/docs/functional/size/breakpoints.json +24 -24
- package/dist/docs/functional/size/size-coarse.json +12 -12
- package/dist/docs/functional/size/size-fine.json +12 -12
- package/dist/docs/functional/size/size.json +264 -264
- package/dist/docs/functional/size/viewport.json +24 -24
- package/dist/docs/functional/themes/dark-colorblind.json +2868 -3462
- package/dist/docs/functional/themes/dark-dimmed.json +2826 -3016
- package/dist/docs/functional/themes/dark-high-contrast.json +2822 -5100
- package/dist/docs/functional/themes/dark-tritanopia.json +2829 -3203
- package/dist/docs/functional/themes/dark.json +2808 -2520
- package/dist/docs/functional/themes/light-colorblind.json +2604 -3150
- package/dist/docs/functional/themes/light-high-contrast.json +2653 -4609
- package/dist/docs/functional/themes/light-tritanopia.json +2546 -2960
- package/dist/docs/functional/themes/light.json +2590 -2312
- package/dist/docs/functional/typography/typography.json +206 -206
- package/dist/fallbacks/base/motion/motion.json +17 -0
- package/dist/fallbacks/functional/motion/motion.json +1 -0
- package/dist/figma/dimension/dimension.json +492 -492
- package/dist/figma/figma.json +21 -13
- package/dist/figma/scales/dark-dimmed.json +3536 -656
- package/dist/figma/scales/dark-high-constrast.json +3535 -655
- package/dist/figma/scales/dark.json +3371 -491
- package/dist/figma/scales/light-high-constrast.json +3532 -652
- package/dist/figma/scales/light.json +3367 -487
- package/dist/figma/shadows/dark-colorblind.json +199 -199
- package/dist/figma/shadows/dark-dimmed.json +199 -199
- package/dist/figma/shadows/dark-high-contrast.json +199 -199
- package/dist/figma/shadows/dark-tritanopia.json +199 -199
- package/dist/figma/shadows/dark.json +199 -199
- package/dist/figma/shadows/light-colorblind.json +189 -189
- package/dist/figma/shadows/light-high-contrast.json +191 -191
- package/dist/figma/shadows/light-tritanopia.json +189 -189
- package/dist/figma/shadows/light.json +189 -189
- package/dist/figma/themes/dark-colorblind.json +4470 -5204
- package/dist/figma/themes/dark-dimmed.json +4771 -5081
- package/dist/figma/themes/dark-high-contrast.json +4189 -6548
- package/dist/figma/themes/dark-tritanopia.json +4629 -5153
- package/dist/figma/themes/dark.json +5072 -4916
- package/dist/figma/themes/light-colorblind.json +4490 -5127
- package/dist/figma/themes/light-high-contrast.json +4170 -6201
- package/dist/figma/themes/light-tritanopia.json +4525 -5027
- package/dist/figma/themes/light.json +4982 -4825
- package/dist/figma/typography/typography.json +159 -203
- package/dist/internalCss/dark-colorblind.css +58 -38
- package/dist/internalCss/dark-dimmed.css +44 -24
- package/dist/internalCss/dark-high-contrast.css +62 -42
- package/dist/internalCss/dark-tritanopia.css +44 -24
- package/dist/internalCss/dark.css +42 -22
- package/dist/internalCss/light-colorblind.css +60 -40
- package/dist/internalCss/light-high-contrast.css +58 -38
- package/dist/internalCss/light-tritanopia.css +42 -22
- package/dist/internalCss/light.css +42 -22
- package/dist/styleLint/base/motion/motion.json +205 -0
- package/dist/styleLint/base/size/size.json +38 -38
- package/dist/styleLint/base/typography/typography.json +8 -8
- package/dist/styleLint/functional/motion/motion.json +27 -12
- package/dist/styleLint/functional/size/border.json +30 -30
- package/dist/styleLint/functional/size/breakpoints.json +12 -12
- package/dist/styleLint/functional/size/size-coarse.json +6 -6
- package/dist/styleLint/functional/size/size-fine.json +6 -6
- package/dist/styleLint/functional/size/size.json +132 -132
- package/dist/styleLint/functional/size/viewport.json +12 -12
- package/dist/styleLint/functional/themes/dark-colorblind.json +1644 -2238
- package/dist/styleLint/functional/themes/dark-dimmed.json +1699 -1889
- package/dist/styleLint/functional/themes/dark-high-contrast.json +1627 -3905
- package/dist/styleLint/functional/themes/dark-tritanopia.json +1704 -2078
- package/dist/styleLint/functional/themes/dark.json +1692 -1404
- package/dist/styleLint/functional/themes/light-colorblind.json +1506 -2052
- package/dist/styleLint/functional/themes/light-high-contrast.json +1515 -3471
- package/dist/styleLint/functional/themes/light-tritanopia.json +1434 -1848
- package/dist/styleLint/functional/themes/light.json +1474 -1196
- package/dist/styleLint/functional/typography/typography.json +114 -114
- package/package.json +22 -22
- package/src/tokens/base/motion/easing.json5 +26 -0
- package/src/tokens/base/motion/timing.json5 +50 -0
- package/src/tokens/functional/color/dark/app-dark.json5 +203 -88
- package/src/tokens/functional/color/dark/data-vis-dark.json5 +20 -20
- package/src/tokens/functional/color/dark/display-dark.json5 +95 -95
- package/src/tokens/functional/color/dark/overrides/dark.dimmed.json5 +0 -8
- package/src/tokens/functional/color/dark/overrides/dark.high-contrast.json5 +43 -30
- package/src/tokens/functional/color/dark/overrides/dark.protanopia-deuteranopia.json5 +62 -30
- package/src/tokens/functional/color/dark/overrides/dark.tritanopia.json5 +53 -12
- package/src/tokens/functional/color/dark/patterns-dark.json5 +16 -4
- package/src/tokens/functional/color/dark/primitives-dark.json5 +4 -4
- package/src/tokens/functional/color/light/app-light.json5 +195 -85
- package/src/tokens/functional/color/light/data-vis-light.json5 +20 -20
- package/src/tokens/functional/color/light/overrides/light.high-contrast.json5 +25 -25
- package/src/tokens/functional/color/light/overrides/light.protanopia-deuteranopia.json5 +65 -34
- package/src/tokens/functional/color/light/overrides/light.tritanopia.json5 +66 -11
- package/src/tokens/functional/color/light/patterns-light.json5 +13 -1
- package/src/tokens/functional/color/light/primitives-light.json5 +2 -2
- package/src/tokens/functional/motion/loading.json5 +1 -1
- package/src/tokens/functional/motion/patterns.json5 +9 -2
package/README.md
CHANGED
|
@@ -138,10 +138,10 @@ In this case you can create the follwing structure. The `@` will be removed from
|
|
|
138
138
|
bgColor: {
|
|
139
139
|
accent: {
|
|
140
140
|
'@': {
|
|
141
|
-
// values for accent (default)
|
|
141
|
+
// values for bgColor-accent (default)
|
|
142
142
|
},
|
|
143
143
|
muted: {
|
|
144
|
-
// values for accent-muted
|
|
144
|
+
// values for bgColor-accent-muted
|
|
145
145
|
},
|
|
146
146
|
},
|
|
147
147
|
},
|
|
@@ -2,8 +2,7 @@ import StyleDictionary from 'style-dictionary';
|
|
|
2
2
|
/**
|
|
3
3
|
* @name {@link PrimerStyleDictionary}
|
|
4
4
|
* @description Returns style dictionary object with primer preset that includes parsers, formats and transformers
|
|
5
|
-
* @parsers [w3cJsonParser](https://github.com/primer/primitives/blob/main/config//parsers/w3c-json-parser.ts)
|
|
6
5
|
* @formats [javascript/esm](https://github.com/primer/primitives/blob/main/config/formats/javascript-esm.ts), [javascript/commonJs](https://github.com/primer/primitives/blob/main/config/formats/javascript-commonJs.ts), [typescript/export-definition](https://github.com/primer/primitives/blob/main/config/formats/typescript-export-defition.ts)
|
|
7
6
|
* @transformers [color/rgbAlpha](https://github.com/primer/primitives/blob/main/config/tranformers/color-to-rgb-alpha.ts), [color/hexAlpha](https://github.com/primer/primitives/blob/main/config/tranformers/color-to-hex-alpha.ts), [color/hex](https://github.com/primer/primitives/blob/main/config/tranformers/color-to-hex6.ts), [json/deprecated](https://github.com/primer/primitives/blob/main/config/tranformers/json-deprecated.ts), [name/pathToDotNotation](https://github.com/primer/primitives/blob/main/config/tranformers/name-path-to-dot-notation.ts)
|
|
8
7
|
*/
|
|
9
|
-
export declare const PrimerStyleDictionary: StyleDictionary
|
|
8
|
+
export declare const PrimerStyleDictionary: StyleDictionary;
|
|
@@ -1,92 +1,80 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.PrimerStyleDictionary = void 0;
|
|
7
|
-
const style_dictionary_1 = __importDefault(require("style-dictionary"));
|
|
8
|
-
const parsers_1 = require("./parsers");
|
|
9
|
-
const transformers_1 = require("./transformers");
|
|
10
|
-
const formats_1 = require("./formats");
|
|
1
|
+
import StyleDictionary from 'style-dictionary';
|
|
2
|
+
import { borderToCss, colorToRgbAlpha, colorToHex, colorToHexMix, colorToRgbaFloat, cubicBezierToCss, dimensionToRem, dimensionToPixelUnitless, durationToCss, figmaAttributes, fontFamilyToCss, fontFamilyToFigma, fontWeightToNumber, jsonDeprecated, namePathToDotNotation, namePathToCamelCase, namePathToPascalCase, namePathToKebabCase, namePathToSlashNotation, namePathToFigma, shadowToCss, typographyToCss, dimensionToRemPxArray, floatToPixel, floatToPixelUnitless, } from './transformers/index.js';
|
|
3
|
+
import { javascriptCommonJs, javascriptEsm, typescriptExportDefinition, jsonNestedPrefixed, cssCustomMedia, jsonOneDimensional, jsonPostCssFallback, cssAdvanced, jsonFigma, } from './formats/index.js';
|
|
11
4
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
5
|
+
* @name {@link PrimerStyleDictionary}
|
|
6
|
+
* @description Returns style dictionary object with primer preset that includes parsers, formats and transformers
|
|
7
|
+
* @formats [javascript/esm](https://github.com/primer/primitives/blob/main/config/formats/javascript-esm.ts), [javascript/commonJs](https://github.com/primer/primitives/blob/main/config/formats/javascript-commonJs.ts), [typescript/export-definition](https://github.com/primer/primitives/blob/main/config/formats/typescript-export-defition.ts)
|
|
8
|
+
* @transformers [color/rgbAlpha](https://github.com/primer/primitives/blob/main/config/tranformers/color-to-rgb-alpha.ts), [color/hexAlpha](https://github.com/primer/primitives/blob/main/config/tranformers/color-to-hex-alpha.ts), [color/hex](https://github.com/primer/primitives/blob/main/config/tranformers/color-to-hex6.ts), [json/deprecated](https://github.com/primer/primitives/blob/main/config/tranformers/json-deprecated.ts), [name/pathToDotNotation](https://github.com/primer/primitives/blob/main/config/tranformers/name-path-to-dot-notation.ts)
|
|
14
9
|
*/
|
|
15
|
-
|
|
10
|
+
export const PrimerStyleDictionary = new StyleDictionary();
|
|
16
11
|
/**
|
|
17
12
|
* Formats
|
|
18
13
|
*
|
|
19
14
|
*/
|
|
20
|
-
|
|
15
|
+
PrimerStyleDictionary.registerFormat({
|
|
21
16
|
name: 'css/advanced',
|
|
22
|
-
|
|
17
|
+
format: cssAdvanced,
|
|
23
18
|
});
|
|
24
|
-
|
|
19
|
+
PrimerStyleDictionary.registerFormat({
|
|
25
20
|
name: 'css/customMedia',
|
|
26
|
-
|
|
21
|
+
format: cssCustomMedia,
|
|
27
22
|
});
|
|
28
|
-
|
|
23
|
+
PrimerStyleDictionary.registerFormat({
|
|
29
24
|
name: 'javascript/esm',
|
|
30
|
-
|
|
25
|
+
format: javascriptEsm,
|
|
31
26
|
});
|
|
32
|
-
|
|
27
|
+
PrimerStyleDictionary.registerFormat({
|
|
33
28
|
name: 'javascript/commonJs',
|
|
34
|
-
|
|
29
|
+
format: javascriptCommonJs,
|
|
35
30
|
});
|
|
36
|
-
|
|
31
|
+
PrimerStyleDictionary.registerFormat({
|
|
37
32
|
name: 'typescript/export-definition',
|
|
38
|
-
|
|
33
|
+
format: typescriptExportDefinition,
|
|
39
34
|
});
|
|
40
|
-
|
|
35
|
+
PrimerStyleDictionary.registerFormat({
|
|
41
36
|
name: 'json/nested-prefixed',
|
|
42
|
-
|
|
37
|
+
format: jsonNestedPrefixed,
|
|
43
38
|
});
|
|
44
|
-
|
|
39
|
+
PrimerStyleDictionary.registerFormat({
|
|
45
40
|
name: 'json/one-dimensional',
|
|
46
|
-
|
|
41
|
+
format: jsonOneDimensional,
|
|
47
42
|
});
|
|
48
|
-
|
|
43
|
+
PrimerStyleDictionary.registerFormat({
|
|
49
44
|
name: 'json/postCss-fallback',
|
|
50
|
-
|
|
45
|
+
format: jsonPostCssFallback,
|
|
51
46
|
});
|
|
52
|
-
|
|
47
|
+
PrimerStyleDictionary.registerFormat({
|
|
53
48
|
name: 'json/figma',
|
|
54
|
-
|
|
49
|
+
format: jsonFigma,
|
|
55
50
|
});
|
|
56
51
|
/**
|
|
57
52
|
* Transformers
|
|
58
53
|
*
|
|
59
54
|
*/
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
* @name {@link PrimerStyleDictionary}
|
|
87
|
-
* @description Returns style dictionary object with primer preset that includes parsers, formats and transformers
|
|
88
|
-
* @parsers [w3cJsonParser](https://github.com/primer/primitives/blob/main/config//parsers/w3c-json-parser.ts)
|
|
89
|
-
* @formats [javascript/esm](https://github.com/primer/primitives/blob/main/config/formats/javascript-esm.ts), [javascript/commonJs](https://github.com/primer/primitives/blob/main/config/formats/javascript-commonJs.ts), [typescript/export-definition](https://github.com/primer/primitives/blob/main/config/formats/typescript-export-defition.ts)
|
|
90
|
-
* @transformers [color/rgbAlpha](https://github.com/primer/primitives/blob/main/config/tranformers/color-to-rgb-alpha.ts), [color/hexAlpha](https://github.com/primer/primitives/blob/main/config/tranformers/color-to-hex-alpha.ts), [color/hex](https://github.com/primer/primitives/blob/main/config/tranformers/color-to-hex6.ts), [json/deprecated](https://github.com/primer/primitives/blob/main/config/tranformers/json-deprecated.ts), [name/pathToDotNotation](https://github.com/primer/primitives/blob/main/config/tranformers/name-path-to-dot-notation.ts)
|
|
91
|
-
*/
|
|
92
|
-
exports.PrimerStyleDictionary = style_dictionary_1.default;
|
|
55
|
+
PrimerStyleDictionary.registerTransform(colorToRgbAlpha);
|
|
56
|
+
PrimerStyleDictionary.registerTransform(colorToRgbaFloat);
|
|
57
|
+
PrimerStyleDictionary.registerTransform(colorToHexMix);
|
|
58
|
+
PrimerStyleDictionary.registerTransform(colorToHex);
|
|
59
|
+
PrimerStyleDictionary.registerTransform(cubicBezierToCss);
|
|
60
|
+
PrimerStyleDictionary.registerTransform(floatToPixel);
|
|
61
|
+
PrimerStyleDictionary.registerTransform(floatToPixelUnitless);
|
|
62
|
+
PrimerStyleDictionary.registerTransform(dimensionToRem);
|
|
63
|
+
PrimerStyleDictionary.registerTransform(dimensionToRemPxArray);
|
|
64
|
+
PrimerStyleDictionary.registerTransform(dimensionToPixelUnitless);
|
|
65
|
+
PrimerStyleDictionary.registerTransform(durationToCss);
|
|
66
|
+
PrimerStyleDictionary.registerTransform(figmaAttributes);
|
|
67
|
+
PrimerStyleDictionary.registerTransform(jsonDeprecated);
|
|
68
|
+
PrimerStyleDictionary.registerTransform(namePathToCamelCase);
|
|
69
|
+
PrimerStyleDictionary.registerTransform(namePathToPascalCase);
|
|
70
|
+
PrimerStyleDictionary.registerTransform(namePathToDotNotation);
|
|
71
|
+
PrimerStyleDictionary.registerTransform(namePathToFigma);
|
|
72
|
+
PrimerStyleDictionary.registerTransform(namePathToCamelCase);
|
|
73
|
+
PrimerStyleDictionary.registerTransform(namePathToKebabCase);
|
|
74
|
+
PrimerStyleDictionary.registerTransform(namePathToSlashNotation);
|
|
75
|
+
PrimerStyleDictionary.registerTransform(shadowToCss);
|
|
76
|
+
PrimerStyleDictionary.registerTransform(borderToCss);
|
|
77
|
+
PrimerStyleDictionary.registerTransform(typographyToCss);
|
|
78
|
+
PrimerStyleDictionary.registerTransform(fontWeightToNumber);
|
|
79
|
+
PrimerStyleDictionary.registerTransform(fontFamilyToCss);
|
|
80
|
+
PrimerStyleDictionary.registerTransform(fontFamilyToFigma);
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
export { isBorder } from './isBorder';
|
|
2
|
-
export { isColor } from './isColor';
|
|
3
|
-
export { isColorWithAlpha } from './isColorWithAlpha';
|
|
4
|
-
export { isColorWithMix } from './isColorWithMix';
|
|
5
|
-
export { isDimension } from './isDimension';
|
|
6
|
-
export { isDeprecated } from './isDeprecated';
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
12
|
-
export {
|
|
13
|
-
export {
|
|
1
|
+
export { isBorder } from './isBorder.js';
|
|
2
|
+
export { isColor } from './isColor.js';
|
|
3
|
+
export { isColorWithAlpha } from './isColorWithAlpha.js';
|
|
4
|
+
export { isColorWithMix } from './isColorWithMix.js';
|
|
5
|
+
export { isDimension } from './isDimension.js';
|
|
6
|
+
export { isDeprecated } from './isDeprecated.js';
|
|
7
|
+
export { isDuration } from './isDuration.js';
|
|
8
|
+
export { isFromFile } from './isFromFile.js';
|
|
9
|
+
export { isFontFamily } from './isFontFamily.js';
|
|
10
|
+
export { isFontWeight } from './isFontWeight.js';
|
|
11
|
+
export { isNumber } from './isNumber.js';
|
|
12
|
+
export { isShadow } from './isShadow.js';
|
|
13
|
+
export { isSource } from './isSource.js';
|
|
14
|
+
export { isTypography } from './isTypography.js';
|
|
@@ -1,29 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
Object.defineProperty(exports, "isDeprecated", { enumerable: true, get: function () { return isDeprecated_1.isDeprecated; } });
|
|
16
|
-
var isFromFile_1 = require("./isFromFile");
|
|
17
|
-
Object.defineProperty(exports, "isFromFile", { enumerable: true, get: function () { return isFromFile_1.isFromFile; } });
|
|
18
|
-
var isFontFamily_1 = require("./isFontFamily");
|
|
19
|
-
Object.defineProperty(exports, "isFontFamily", { enumerable: true, get: function () { return isFontFamily_1.isFontFamily; } });
|
|
20
|
-
var isFontWeight_1 = require("./isFontWeight");
|
|
21
|
-
Object.defineProperty(exports, "isFontWeight", { enumerable: true, get: function () { return isFontWeight_1.isFontWeight; } });
|
|
22
|
-
var isNumber_1 = require("./isNumber");
|
|
23
|
-
Object.defineProperty(exports, "isNumber", { enumerable: true, get: function () { return isNumber_1.isNumber; } });
|
|
24
|
-
var isShadow_1 = require("./isShadow");
|
|
25
|
-
Object.defineProperty(exports, "isShadow", { enumerable: true, get: function () { return isShadow_1.isShadow; } });
|
|
26
|
-
var isSource_1 = require("./isSource");
|
|
27
|
-
Object.defineProperty(exports, "isSource", { enumerable: true, get: function () { return isSource_1.isSource; } });
|
|
28
|
-
var isTypography_1 = require("./isTypography");
|
|
29
|
-
Object.defineProperty(exports, "isTypography", { enumerable: true, get: function () { return isTypography_1.isTypography; } });
|
|
1
|
+
export { isBorder } from './isBorder.js';
|
|
2
|
+
export { isColor } from './isColor.js';
|
|
3
|
+
export { isColorWithAlpha } from './isColorWithAlpha.js';
|
|
4
|
+
export { isColorWithMix } from './isColorWithMix.js';
|
|
5
|
+
export { isDimension } from './isDimension.js';
|
|
6
|
+
export { isDeprecated } from './isDeprecated.js';
|
|
7
|
+
export { isDuration } from './isDuration.js';
|
|
8
|
+
export { isFromFile } from './isFromFile.js';
|
|
9
|
+
export { isFontFamily } from './isFontFamily.js';
|
|
10
|
+
export { isFontWeight } from './isFontWeight.js';
|
|
11
|
+
export { isNumber } from './isNumber.js';
|
|
12
|
+
export { isShadow } from './isShadow.js';
|
|
13
|
+
export { isSource } from './isSource.js';
|
|
14
|
+
export { isTypography } from './isTypography.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import type { TransformedToken } from 'style-dictionary/types';
|
|
2
2
|
/**
|
|
3
3
|
* @description Checks if token is of $type `border`
|
|
4
|
-
* @param arguments [
|
|
4
|
+
* @param arguments [TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
|
|
5
5
|
* @returns boolean
|
|
6
6
|
*/
|
|
7
|
-
export declare const isBorder: (token:
|
|
7
|
+
export declare const isBorder: (token: TransformedToken) => boolean;
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isBorder = void 0;
|
|
4
1
|
/**
|
|
5
2
|
* @description Checks if token is of $type `border`
|
|
6
|
-
* @param arguments [
|
|
3
|
+
* @param arguments [TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
|
|
7
4
|
* @returns boolean
|
|
8
5
|
*/
|
|
9
|
-
const isBorder = (token) => {
|
|
6
|
+
export const isBorder = (token) => {
|
|
10
7
|
return token.$type === 'border';
|
|
11
8
|
};
|
|
12
|
-
exports.isBorder = isBorder;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import type { TransformedToken } from 'style-dictionary/types';
|
|
2
2
|
/**
|
|
3
3
|
* @description Checks if token is of $type `color`
|
|
4
|
-
* @param token [
|
|
4
|
+
* @param token [TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
|
|
5
5
|
* @returns boolean
|
|
6
6
|
*/
|
|
7
|
-
export declare const isColor: (token:
|
|
7
|
+
export declare const isColor: (token: TransformedToken) => boolean;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isColor = void 0;
|
|
4
1
|
/**
|
|
5
2
|
* @description Checks if token is of $type `color`
|
|
6
|
-
* @param token [
|
|
3
|
+
* @param token [TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
|
|
7
4
|
* @returns boolean
|
|
8
5
|
*/
|
|
9
|
-
const isColor = (token) => {
|
|
10
|
-
|
|
6
|
+
export const isColor = (token) => {
|
|
7
|
+
var _a;
|
|
8
|
+
const typeValue = (_a = token.$type) !== null && _a !== void 0 ? _a : token.type;
|
|
9
|
+
// if (token.path.join('-') === 'control-transparent-bgColor-selected') {
|
|
10
|
+
// console.log(typeValue === 'color', token)
|
|
11
|
+
// }
|
|
12
|
+
return typeValue === 'color';
|
|
11
13
|
};
|
|
12
|
-
exports.isColor = isColor;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import type { TransformedToken } from 'style-dictionary/types';
|
|
2
2
|
/**
|
|
3
3
|
* @description Checks if token is color with an alpha value
|
|
4
|
-
* @param arguments [
|
|
4
|
+
* @param arguments [TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
|
|
5
5
|
* @returns boolean
|
|
6
6
|
*/
|
|
7
|
-
export declare const isColorWithAlpha: (token:
|
|
7
|
+
export declare const isColorWithAlpha: (token: TransformedToken) => boolean;
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isColorWithAlpha = void 0;
|
|
4
|
-
const isColor_1 = require("./isColor");
|
|
1
|
+
import { isColor } from './isColor.js';
|
|
5
2
|
/**
|
|
6
3
|
* @description Checks if token is color with an alpha value
|
|
7
|
-
* @param arguments [
|
|
4
|
+
* @param arguments [TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
|
|
8
5
|
* @returns boolean
|
|
9
6
|
*/
|
|
10
|
-
const isColorWithAlpha = (token) => {
|
|
11
|
-
return
|
|
7
|
+
export const isColorWithAlpha = (token) => {
|
|
8
|
+
return isColor(token) && token.alpha !== undefined && typeof token.alpha === 'number';
|
|
12
9
|
};
|
|
13
|
-
exports.isColorWithAlpha = isColorWithAlpha;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import type { TransformedToken } from 'style-dictionary/types';
|
|
2
2
|
/**
|
|
3
3
|
* @description Checks if token is color and has a mix property
|
|
4
|
-
* @param arguments [
|
|
4
|
+
* @param arguments [TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
|
|
5
5
|
* @returns boolean
|
|
6
6
|
*/
|
|
7
|
-
export declare const isColorWithMix: (token:
|
|
7
|
+
export declare const isColorWithMix: (token: TransformedToken) => boolean;
|
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isColorWithMix = void 0;
|
|
4
|
-
const isColor_1 = require("./isColor");
|
|
1
|
+
import { isColor } from './isColor.js';
|
|
5
2
|
const throwError = (token) => {
|
|
6
3
|
throw new Error(`Invalid mix property on token: ${token.name}. "mix.color": ${token.mix.color}, "mix.weight": ${typeof token.mix.weight === 'string' ? `"${token.mix.weight}" (string)` : token.mix.weight} must be a number between 0 and 1. In file: "${token.filePath}".`);
|
|
7
4
|
};
|
|
8
5
|
/**
|
|
9
6
|
* @description Checks if token is color and has a mix property
|
|
10
|
-
* @param arguments [
|
|
7
|
+
* @param arguments [TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
|
|
11
8
|
* @returns boolean
|
|
12
9
|
*/
|
|
13
|
-
const isColorWithMix = (token) => {
|
|
10
|
+
export const isColorWithMix = (token) => {
|
|
14
11
|
// no color or no mix property
|
|
15
|
-
if (!
|
|
12
|
+
if (!isColor(token) || token.mix === undefined || token.mix === null) {
|
|
16
13
|
return false;
|
|
17
14
|
}
|
|
18
15
|
// invalid mix property
|
|
@@ -25,4 +22,3 @@ const isColorWithMix = (token) => {
|
|
|
25
22
|
// valid mix property
|
|
26
23
|
return true;
|
|
27
24
|
};
|
|
28
|
-
exports.isColorWithMix = isColorWithMix;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { TransformedToken } from 'style-dictionary/types';
|
|
2
|
+
/**
|
|
3
|
+
* @description Checks if token is of $type `cubicBezier`
|
|
4
|
+
* @param token [TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
|
|
5
|
+
* @returns boolean
|
|
6
|
+
*/
|
|
7
|
+
export declare const isCubicBezier: (token: TransformedToken) => boolean;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description Checks if token is of $type `cubicBezier`
|
|
3
|
+
* @param token [TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
|
|
4
|
+
* @returns boolean
|
|
5
|
+
*/
|
|
6
|
+
export const isCubicBezier = (token) => {
|
|
7
|
+
var _a;
|
|
8
|
+
const typeValue = (_a = token.$type) !== null && _a !== void 0 ? _a : token.type;
|
|
9
|
+
return typeValue === 'cubicBezier';
|
|
10
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import type { TransformedToken } from 'style-dictionary/types';
|
|
2
2
|
/**
|
|
3
3
|
* @description Checks if token has a valid `deprecated` property
|
|
4
|
-
* @param arguments [
|
|
4
|
+
* @param arguments [TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
|
|
5
5
|
* @returns boolean
|
|
6
6
|
*/
|
|
7
|
-
export declare const isDeprecated: (token:
|
|
7
|
+
export declare const isDeprecated: (token: TransformedToken) => boolean;
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isDeprecated = void 0;
|
|
4
1
|
/**
|
|
5
2
|
* @description Checks if token has a valid `deprecated` property
|
|
6
|
-
* @param arguments [
|
|
3
|
+
* @param arguments [TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
|
|
7
4
|
* @returns boolean
|
|
8
5
|
*/
|
|
9
|
-
const isDeprecated = (token) => {
|
|
6
|
+
export const isDeprecated = (token) => {
|
|
10
7
|
return token.deprecated === true || typeof token.deprecated === 'string';
|
|
11
8
|
};
|
|
12
|
-
exports.isDeprecated = isDeprecated;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import type { TransformedToken } from 'style-dictionary/types';
|
|
2
2
|
/**
|
|
3
3
|
* @description Checks if token is of $type `dimension`
|
|
4
|
-
* @param arguments [
|
|
4
|
+
* @param arguments [TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
|
|
5
5
|
* @returns boolean
|
|
6
6
|
*/
|
|
7
|
-
export declare const isDimension: (token:
|
|
7
|
+
export declare const isDimension: (token: TransformedToken) => boolean;
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isDimension = void 0;
|
|
4
1
|
/**
|
|
5
2
|
* @description Checks if token is of $type `dimension`
|
|
6
|
-
* @param arguments [
|
|
3
|
+
* @param arguments [TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
|
|
7
4
|
* @returns boolean
|
|
8
5
|
*/
|
|
9
|
-
const isDimension = (token) => {
|
|
6
|
+
export const isDimension = (token) => {
|
|
10
7
|
return token.$type === 'dimension';
|
|
11
8
|
};
|
|
12
|
-
exports.isDimension = isDimension;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import type { TransformedToken } from 'style-dictionary/types';
|
|
2
2
|
/**
|
|
3
3
|
* @description Checks if token is of $type `duration`
|
|
4
|
-
* @param token [
|
|
4
|
+
* @param token [TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
|
|
5
5
|
* @returns boolean
|
|
6
6
|
*/
|
|
7
|
-
export declare const isDuration: (token:
|
|
7
|
+
export declare const isDuration: (token: TransformedToken) => boolean;
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isDuration = void 0;
|
|
4
1
|
/**
|
|
5
2
|
* @description Checks if token is of $type `duration`
|
|
6
|
-
* @param token [
|
|
3
|
+
* @param token [TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
|
|
7
4
|
* @returns boolean
|
|
8
5
|
*/
|
|
9
|
-
const isDuration = (token) => {
|
|
6
|
+
export const isDuration = (token) => {
|
|
10
7
|
return token.$type === 'duration';
|
|
11
8
|
};
|
|
12
|
-
exports.isDuration = isDuration;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import type { TransformedToken } from 'style-dictionary/types';
|
|
2
2
|
/**
|
|
3
3
|
* @description Checks if token is of $type `isFontFamily`
|
|
4
|
-
* @param arguments [
|
|
4
|
+
* @param arguments [TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
|
|
5
5
|
* @returns boolean
|
|
6
6
|
*/
|
|
7
|
-
export declare const isFontFamily: (token:
|
|
7
|
+
export declare const isFontFamily: (token: TransformedToken) => boolean;
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isFontFamily = void 0;
|
|
4
1
|
/**
|
|
5
2
|
* @description Checks if token is of $type `isFontFamily`
|
|
6
|
-
* @param arguments [
|
|
3
|
+
* @param arguments [TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
|
|
7
4
|
* @returns boolean
|
|
8
5
|
*/
|
|
9
|
-
const isFontFamily = (token) => {
|
|
6
|
+
export const isFontFamily = (token) => {
|
|
10
7
|
return token.$type === 'fontFamily';
|
|
11
8
|
};
|
|
12
|
-
exports.isFontFamily = isFontFamily;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import type { TransformedToken } from 'style-dictionary/types';
|
|
2
2
|
/**
|
|
3
3
|
* @description Checks if token is of $type `fontWeight`
|
|
4
|
-
* @param arguments [
|
|
4
|
+
* @param arguments [TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
|
|
5
5
|
* @returns boolean
|
|
6
6
|
*/
|
|
7
|
-
export declare const isFontWeight: (token:
|
|
7
|
+
export declare const isFontWeight: (token: TransformedToken) => boolean;
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isFontWeight = void 0;
|
|
4
1
|
/**
|
|
5
2
|
* @description Checks if token is of $type `fontWeight`
|
|
6
|
-
* @param arguments [
|
|
3
|
+
* @param arguments [TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
|
|
7
4
|
* @returns boolean
|
|
8
5
|
*/
|
|
9
|
-
const isFontWeight = (token) => {
|
|
6
|
+
export const isFontWeight = (token) => {
|
|
10
7
|
return token.$type === 'fontWeight';
|
|
11
8
|
};
|
|
12
|
-
exports.isFontWeight = isFontWeight;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import type { TransformedToken } from 'style-dictionary/types';
|
|
2
2
|
/**
|
|
3
3
|
* @description Checks if token comes from a specific file
|
|
4
|
-
* @param token [
|
|
4
|
+
* @param token [TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
|
|
5
5
|
* @param files - array of file paths
|
|
6
6
|
* @returns boolean
|
|
7
7
|
*/
|
|
8
|
-
export declare const isFromFile: (token:
|
|
8
|
+
export declare const isFromFile: (token: TransformedToken, files: string[]) => boolean;
|
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isFromFile = void 0;
|
|
4
1
|
/**
|
|
5
2
|
* @description Checks if token comes from a specific file
|
|
6
|
-
* @param token [
|
|
3
|
+
* @param token [TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
|
|
7
4
|
* @param files - array of file paths
|
|
8
5
|
* @returns boolean
|
|
9
6
|
*/
|
|
10
|
-
const isFromFile = (token, files) => {
|
|
7
|
+
export const isFromFile = (token, files) => {
|
|
11
8
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
12
9
|
return (files === null || files === void 0 ? void 0 : files.includes(token.filePath)) === true;
|
|
13
10
|
};
|
|
14
|
-
exports.isFromFile = isFromFile;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import type { TransformedToken } from 'style-dictionary/types';
|
|
2
2
|
/**
|
|
3
3
|
* @description Checks if token type is a number
|
|
4
|
-
* @param token [
|
|
4
|
+
* @param token [TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
|
|
5
5
|
* @returns boolean
|
|
6
6
|
*/
|
|
7
|
-
export declare const isNumber: (token:
|
|
7
|
+
export declare const isNumber: (token: TransformedToken) => boolean;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isNumber = void 0;
|
|
4
1
|
/**
|
|
5
2
|
* @description Checks if token type is a number
|
|
6
|
-
* @param token [
|
|
3
|
+
* @param token [TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
|
|
7
4
|
* @returns boolean
|
|
8
5
|
*/
|
|
9
|
-
const isNumber = (token) =>
|
|
10
|
-
|
|
6
|
+
export const isNumber = (token) => {
|
|
7
|
+
return token.$type === 'number';
|
|
8
|
+
};
|