@primer/primitives 9.1.2 → 10.0.0-rc.6651a0c1
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/dist/css/functional/themes/dark-colorblind.css +4 -4
- package/dist/css/functional/themes/dark-high-contrast.css +20 -20
- package/dist/css/functional/themes/light-high-contrast.css +14 -14
- package/dist/css/functional/typography/typography.css +20 -20
- package/dist/css/primitives.css +20 -20
- 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 +18 -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 +2310 -3186
- package/dist/docs/functional/themes/dark-dimmed.json +2300 -2794
- package/dist/docs/functional/themes/dark-high-contrast.json +2520 -5038
- package/dist/docs/functional/themes/dark-tritanopia.json +2351 -3003
- package/dist/docs/functional/themes/dark.json +2270 -2270
- package/dist/docs/functional/themes/light-colorblind.json +2298 -3124
- package/dist/docs/functional/themes/light-high-contrast.json +2419 -4645
- package/dist/docs/functional/themes/light-tritanopia.json +2330 -2990
- package/dist/docs/functional/themes/light.json +2260 -2260
- package/dist/docs/functional/typography/typography.json +206 -206
- package/dist/figma/dimension/dimension.json +489 -489
- package/dist/figma/figma.json +11 -3
- package/dist/figma/scales/dark-dimmed.json +38 -38
- package/dist/figma/scales/dark-high-constrast.json +38 -38
- package/dist/figma/scales/dark.json +35 -35
- package/dist/figma/scales/light-high-constrast.json +40 -40
- package/dist/figma/scales/light.json +40 -40
- package/dist/figma/shadows/dark-colorblind.json +280 -280
- package/dist/figma/shadows/dark-dimmed.json +280 -280
- package/dist/figma/shadows/dark-high-contrast.json +280 -280
- package/dist/figma/shadows/dark-tritanopia.json +280 -280
- package/dist/figma/shadows/dark.json +280 -280
- package/dist/figma/shadows/light-colorblind.json +281 -281
- package/dist/figma/shadows/light-high-contrast.json +281 -281
- package/dist/figma/shadows/light-tritanopia.json +281 -281
- package/dist/figma/shadows/light.json +281 -281
- package/dist/figma/themes/dark-colorblind.json +4991 -5854
- package/dist/figma/themes/dark-dimmed.json +5314 -5799
- package/dist/figma/themes/dark-high-contrast.json +4210 -6679
- package/dist/figma/themes/dark-tritanopia.json +5165 -5817
- package/dist/figma/themes/dark.json +5534 -5537
- package/dist/figma/themes/light-colorblind.json +4857 -5669
- package/dist/figma/themes/light-high-contrast.json +4198 -6372
- package/dist/figma/themes/light-tritanopia.json +4901 -5529
- package/dist/figma/themes/light.json +5349 -5349
- package/dist/figma/typography/typography.json +112 -156
- package/dist/internalCss/dark-colorblind.css +4 -4
- package/dist/internalCss/dark-high-contrast.css +20 -20
- package/dist/internalCss/light-high-contrast.css +14 -14
- 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 +12 -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 +1171 -2047
- package/dist/styleLint/functional/themes/dark-dimmed.json +1160 -1654
- package/dist/styleLint/functional/themes/dark-high-contrast.json +1307 -3825
- package/dist/styleLint/functional/themes/dark-tritanopia.json +1232 -1884
- package/dist/styleLint/functional/themes/dark.json +1140 -1140
- package/dist/styleLint/functional/themes/light-colorblind.json +1198 -2024
- package/dist/styleLint/functional/themes/light-high-contrast.json +1270 -3496
- package/dist/styleLint/functional/themes/light-tritanopia.json +1205 -1865
- package/dist/styleLint/functional/themes/light.json +1130 -1130
- package/dist/styleLint/functional/typography/typography.json +114 -114
- package/package.json +18 -10
- package/src/tokens/functional/color/dark/overrides/dark.high-contrast.json5 +4 -4
- package/src/tokens/functional/color/dark/overrides/dark.protanopia-deuteranopia.json5 +6 -0
- package/src/tokens/functional/color/dark/overrides/dark.tritanopia.json5 +21 -3
- package/src/tokens/functional/color/dark/primitives-dark.json5 +3 -3
- package/src/tokens/functional/color/light/overrides/light.protanopia-deuteranopia.json5 +4 -1
- package/src/tokens/functional/color/light/overrides/light.tritanopia.json5 +4 -1
- package/src/tokens/functional/color/light/primitives-light.json5 +2 -2
- package/dist/build/PrimerStyleDictionary.d.ts +0 -9
- package/dist/build/PrimerStyleDictionary.js +0 -92
- package/dist/build/filters/index.d.ts +0 -13
- package/dist/build/filters/index.js +0 -29
- package/dist/build/filters/isBorder.d.ts +0 -7
- package/dist/build/filters/isBorder.js +0 -12
- package/dist/build/filters/isColor.d.ts +0 -7
- package/dist/build/filters/isColor.js +0 -12
- package/dist/build/filters/isColorWithAlpha.d.ts +0 -7
- package/dist/build/filters/isColorWithAlpha.js +0 -13
- package/dist/build/filters/isColorWithMix.d.ts +0 -7
- package/dist/build/filters/isColorWithMix.js +0 -28
- package/dist/build/filters/isDeprecated.d.ts +0 -7
- package/dist/build/filters/isDeprecated.js +0 -12
- package/dist/build/filters/isDimension.d.ts +0 -7
- package/dist/build/filters/isDimension.js +0 -12
- package/dist/build/filters/isDuration.d.ts +0 -7
- package/dist/build/filters/isDuration.js +0 -12
- package/dist/build/filters/isFontFamily.d.ts +0 -7
- package/dist/build/filters/isFontFamily.js +0 -12
- package/dist/build/filters/isFontWeight.d.ts +0 -7
- package/dist/build/filters/isFontWeight.js +0 -12
- package/dist/build/filters/isFromFile.d.ts +0 -8
- package/dist/build/filters/isFromFile.js +0 -14
- package/dist/build/filters/isNumber.d.ts +0 -7
- package/dist/build/filters/isNumber.js +0 -10
- package/dist/build/filters/isShadow.d.ts +0 -7
- package/dist/build/filters/isShadow.js +0 -12
- package/dist/build/filters/isSource.d.ts +0 -7
- package/dist/build/filters/isSource.js +0 -12
- package/dist/build/filters/isTypography.d.ts +0 -7
- package/dist/build/filters/isTypography.js +0 -12
- package/dist/build/formats/cssAdvanced.d.ts +0 -2
- package/dist/build/formats/cssAdvanced.js +0 -84
- package/dist/build/formats/cssCustomMedia.d.ts +0 -7
- package/dist/build/formats/cssCustomMedia.js +0 -25
- package/dist/build/formats/index.d.ts +0 -9
- package/dist/build/formats/index.js +0 -21
- package/dist/build/formats/javascriptCommonJs.d.ts +0 -7
- package/dist/build/formats/javascriptCommonJs.js +0 -25
- package/dist/build/formats/javascriptEsm.d.ts +0 -7
- package/dist/build/formats/javascriptEsm.js +0 -25
- package/dist/build/formats/jsonFigma.d.ts +0 -7
- package/dist/build/formats/jsonFigma.js +0 -116
- package/dist/build/formats/jsonNestedPrefixed.d.ts +0 -8
- package/dist/build/formats/jsonNestedPrefixed.js +0 -28
- package/dist/build/formats/jsonOneDimensional.d.ts +0 -8
- package/dist/build/formats/jsonOneDimensional.js +0 -24
- package/dist/build/formats/jsonPostCssFallback.d.ts +0 -8
- package/dist/build/formats/jsonPostCssFallback.js +0 -21
- package/dist/build/formats/typescriptExportDefinition.d.ts +0 -7
- package/dist/build/formats/typescriptExportDefinition.js +0 -166
- package/dist/build/formats/utilities/jsonToFlat.d.ts +0 -11
- package/dist/build/formats/utilities/jsonToFlat.js +0 -12
- package/dist/build/formats/utilities/jsonToNestedValue.d.ts +0 -8
- package/dist/build/formats/utilities/jsonToNestedValue.js +0 -25
- package/dist/build/formats/utilities/prefixTokens.d.ts +0 -8
- package/dist/build/formats/utilities/prefixTokens.js +0 -17
- package/dist/build/parsers/index.d.ts +0 -1
- package/dist/build/parsers/index.js +0 -5
- package/dist/build/parsers/w3cJsonParser.d.ts +0 -6
- package/dist/build/parsers/w3cJsonParser.js +0 -27
- package/dist/build/platforms/css.d.ts +0 -2
- package/dist/build/platforms/css.js +0 -87
- package/dist/build/platforms/deprecatedJson.d.ts +0 -2
- package/dist/build/platforms/deprecatedJson.js +0 -17
- package/dist/build/platforms/docJson.d.ts +0 -2
- package/dist/build/platforms/docJson.js +0 -34
- package/dist/build/platforms/fallbacks.d.ts +0 -2
- package/dist/build/platforms/fallbacks.js +0 -34
- package/dist/build/platforms/figma.d.ts +0 -2
- package/dist/build/platforms/figma.js +0 -53
- package/dist/build/platforms/index.d.ts +0 -10
- package/dist/build/platforms/index.js +0 -23
- package/dist/build/platforms/javascript.d.ts +0 -2
- package/dist/build/platforms/javascript.js +0 -30
- package/dist/build/platforms/json.d.ts +0 -2
- package/dist/build/platforms/json.js +0 -32
- package/dist/build/platforms/styleLint.d.ts +0 -2
- package/dist/build/platforms/styleLint.js +0 -34
- package/dist/build/platforms/typeDefinitions.d.ts +0 -2
- package/dist/build/platforms/typeDefinitions.js +0 -30
- package/dist/build/platforms/typescript.d.ts +0 -2
- package/dist/build/platforms/typescript.js +0 -30
- package/dist/build/schemas/alphaValue.d.ts +0 -2
- package/dist/build/schemas/alphaValue.js +0 -8
- package/dist/build/schemas/baseToken.d.ts +0 -11
- package/dist/build/schemas/baseToken.js +0 -10
- package/dist/build/schemas/borderToken.d.ts +0 -51
- package/dist/build/schemas/borderToken.js +0 -20
- package/dist/build/schemas/collections.d.ts +0 -6
- package/dist/build/schemas/collections.js +0 -18
- package/dist/build/schemas/colorHexValue.d.ts +0 -2
- package/dist/build/schemas/colorHexValue.js +0 -12
- package/dist/build/schemas/colorToken.d.ts +0 -80
- package/dist/build/schemas/colorToken.js +0 -52
- package/dist/build/schemas/designToken.d.ts +0 -2
- package/dist/build/schemas/designToken.js +0 -37
- package/dist/build/schemas/dimensionToken.d.ts +0 -52
- package/dist/build/schemas/dimensionToken.js +0 -36
- package/dist/build/schemas/dimensionValue.d.ts +0 -2
- package/dist/build/schemas/dimensionValue.js +0 -12
- package/dist/build/schemas/durationToken.d.ts +0 -18
- package/dist/build/schemas/durationToken.js +0 -14
- package/dist/build/schemas/durationValue.d.ts +0 -2
- package/dist/build/schemas/durationValue.js +0 -8
- package/dist/build/schemas/fontFamilyToken.d.ts +0 -52
- package/dist/build/schemas/fontFamilyToken.js +0 -23
- package/dist/build/schemas/fontWeightToken.d.ts +0 -52
- package/dist/build/schemas/fontWeightToken.js +0 -24
- package/dist/build/schemas/fontWeightValue.d.ts +0 -2
- package/dist/build/schemas/fontWeightValue.js +0 -9
- package/dist/build/schemas/numberToken.d.ts +0 -71
- package/dist/build/schemas/numberToken.js +0 -30
- package/dist/build/schemas/referenceValue.d.ts +0 -2
- package/dist/build/schemas/referenceValue.js +0 -8
- package/dist/build/schemas/scopes.d.ts +0 -5
- package/dist/build/schemas/scopes.js +0 -34
- package/dist/build/schemas/shadowToken.d.ts +0 -157
- package/dist/build/schemas/shadowToken.js +0 -46
- package/dist/build/schemas/stringToken.d.ts +0 -18
- package/dist/build/schemas/stringToken.js +0 -13
- package/dist/build/schemas/tokenName.d.ts +0 -2
- package/dist/build/schemas/tokenName.js +0 -8
- package/dist/build/schemas/tokenType.d.ts +0 -3
- package/dist/build/schemas/tokenType.js +0 -6
- package/dist/build/schemas/typographyToken.d.ts +0 -59
- package/dist/build/schemas/typographyToken.js +0 -21
- package/dist/build/schemas/validTokenType.d.ts +0 -5
- package/dist/build/schemas/validTokenType.js +0 -34
- package/dist/build/schemas/viewportRangeToken.d.ts +0 -18
- package/dist/build/schemas/viewportRangeToken.js +0 -13
- package/dist/build/transformers/borderToCss.d.ts +0 -8
- package/dist/build/transformers/borderToCss.js +0 -38
- package/dist/build/transformers/colorToHex.d.ts +0 -8
- package/dist/build/transformers/colorToHex.js +0 -26
- package/dist/build/transformers/colorToHexMix.d.ts +0 -8
- package/dist/build/transformers/colorToHexMix.js +0 -25
- package/dist/build/transformers/colorToRgbAlpha.d.ts +0 -8
- package/dist/build/transformers/colorToRgbAlpha.js +0 -22
- package/dist/build/transformers/colorToRgbaFloat.d.ts +0 -8
- package/dist/build/transformers/colorToRgbaFloat.js +0 -50
- package/dist/build/transformers/dimensionToPixelUnitless.d.ts +0 -8
- package/dist/build/transformers/dimensionToPixelUnitless.js +0 -50
- package/dist/build/transformers/dimensionToRem.d.ts +0 -8
- package/dist/build/transformers/dimensionToRem.js +0 -47
- package/dist/build/transformers/dimensionToRemPxArray.d.ts +0 -8
- package/dist/build/transformers/dimensionToRemPxArray.js +0 -47
- package/dist/build/transformers/durationToCss.d.ts +0 -8
- package/dist/build/transformers/durationToCss.js +0 -30
- package/dist/build/transformers/figmaAttributes.d.ts +0 -8
- package/dist/build/transformers/figmaAttributes.js +0 -57
- package/dist/build/transformers/floatToPixel.d.ts +0 -15
- package/dist/build/transformers/floatToPixel.js +0 -41
- package/dist/build/transformers/fontFamilyToCss.d.ts +0 -14
- package/dist/build/transformers/fontFamilyToCss.js +0 -40
- package/dist/build/transformers/fontFamilyToFigma.d.ts +0 -14
- package/dist/build/transformers/fontFamilyToFigma.js +0 -46
- package/dist/build/transformers/fontWeightToNumber.d.ts +0 -9
- package/dist/build/transformers/fontWeightToNumber.js +0 -53
- package/dist/build/transformers/index.d.ts +0 -24
- package/dist/build/transformers/index.js +0 -51
- package/dist/build/transformers/jsonDeprecated.d.ts +0 -8
- package/dist/build/transformers/jsonDeprecated.js +0 -16
- package/dist/build/transformers/namePathToCamelCase.d.ts +0 -8
- package/dist/build/transformers/namePathToCamelCase.js +0 -14
- package/dist/build/transformers/namePathToDotNotation.d.ts +0 -8
- package/dist/build/transformers/namePathToDotNotation.js +0 -33
- package/dist/build/transformers/namePathToFigma.d.ts +0 -9
- package/dist/build/transformers/namePathToFigma.js +0 -24
- package/dist/build/transformers/namePathToKebabCase.d.ts +0 -8
- package/dist/build/transformers/namePathToKebabCase.js +0 -18
- package/dist/build/transformers/namePathToPascalCase.d.ts +0 -8
- package/dist/build/transformers/namePathToPascalCase.js +0 -14
- package/dist/build/transformers/namePathToSlashNotation.d.ts +0 -8
- package/dist/build/transformers/namePathToSlashNotation.js +0 -18
- package/dist/build/transformers/shadowToCss.d.ts +0 -8
- package/dist/build/transformers/shadowToCss.js +0 -35
- package/dist/build/transformers/typographyToCss.d.ts +0 -8
- package/dist/build/transformers/typographyToCss.js +0 -29
- package/dist/build/transformers/utilities/alpha.d.ts +0 -9
- package/dist/build/transformers/utilities/alpha.js +0 -20
- package/dist/build/transformers/utilities/checkRequiredTokenProperties.d.ts +0 -7
- package/dist/build/transformers/utilities/checkRequiredTokenProperties.js +0 -17
- package/dist/build/transformers/utilities/getTokenValue.d.ts +0 -2
- package/dist/build/transformers/utilities/getTokenValue.js +0 -18
- package/dist/build/transformers/utilities/hasSpaceInString.d.ts +0 -1
- package/dist/build/transformers/utilities/hasSpaceInString.js +0 -10
- package/dist/build/transformers/utilities/hexToRgbaFloat.d.ts +0 -2
- package/dist/build/transformers/utilities/hexToRgbaFloat.js +0 -33
- package/dist/build/transformers/utilities/invalidTokenError.d.ts +0 -7
- package/dist/build/transformers/utilities/invalidTokenError.js +0 -26
- package/dist/build/transformers/utilities/isRgbaFloat.d.ts +0 -7
- package/dist/build/transformers/utilities/isRgbaFloat.js +0 -24
- package/dist/build/transformers/utilities/mix.d.ts +0 -5
- package/dist/build/transformers/utilities/mix.js +0 -40
- package/dist/build/transformers/utilities/rgbaFloatToHex.d.ts +0 -6
- package/dist/build/transformers/utilities/rgbaFloatToHex.js +0 -15
- package/dist/build/utilities/copyFromDir.d.ts +0 -8
- package/dist/build/utilities/copyFromDir.js +0 -34
- package/dist/build/utilities/filterStringArray.d.ts +0 -1
- package/dist/build/utilities/filterStringArray.js +0 -17
- package/dist/build/utilities/getFlag.d.ts +0 -8
- package/dist/build/utilities/getFlag.js +0 -16
- package/dist/build/utilities/index.d.ts +0 -3
- package/dist/build/utilities/index.js +0 -9
- package/dist/build/utilities/joinFriendly.d.ts +0 -1
- package/dist/build/utilities/joinFriendly.js +0 -5
- package/dist/build/utilities/schemaErrorMessage.d.ts +0 -1
- package/dist/build/utilities/schemaErrorMessage.js +0 -5
- package/dist/build/utilities/toCamelCase.d.ts +0 -1
- package/dist/build/utilities/toCamelCase.js +0 -20
- package/dist/build/utilities/toPascalCase.d.ts +0 -1
- package/dist/build/utilities/toPascalCase.js +0 -17
- package/dist/build/utilities/treeWalker.d.ts +0 -8
- package/dist/build/utilities/treeWalker.js +0 -27
- package/dist/build/utilities/upperCaseFirstCharacter.d.ts +0 -8
- package/dist/build/utilities/upperCaseFirstCharacter.js +0 -14
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@primer/primitives",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "10.0.0-rc.6651a0c1",
|
|
4
4
|
"description": "Typography, spacing, and color primitives for Primer design system",
|
|
5
|
+
"type": "module",
|
|
5
6
|
"files": [
|
|
6
7
|
"dist",
|
|
7
8
|
"src/tokens"
|
|
@@ -22,11 +23,11 @@
|
|
|
22
23
|
},
|
|
23
24
|
"homepage": "https://github.com/primer/primitives#readme",
|
|
24
25
|
"scripts": {
|
|
25
|
-
"build": "npm run
|
|
26
|
+
"build": "npm run clean && npm run build:tokens && npm run build:fallbacks && npm run build:figma",
|
|
26
27
|
"build:tokens": "tsx ./scripts/buildTokens.ts",
|
|
27
28
|
"build:fallbacks": "tsx ./scripts/buildFallbacks.ts",
|
|
28
29
|
"build:figma": "tsx scripts/buildFigma.ts",
|
|
29
|
-
"
|
|
30
|
+
"clean": "rm -rf dist",
|
|
30
31
|
"tokenJson:check": "tsx scripts/diffThemes.ts && tsx scripts/diffTokenProps.ts",
|
|
31
32
|
"contrast:check": "tsx scripts/color-contrast.ts",
|
|
32
33
|
"format": "prettier --write '**/*.{js,jsx,ts,tsx,md,mdx,css}'",
|
|
@@ -45,7 +46,6 @@
|
|
|
45
46
|
},
|
|
46
47
|
"prettier": "@github/prettier-config",
|
|
47
48
|
"dependencies": {
|
|
48
|
-
"prettier": "3.3",
|
|
49
49
|
"@prettier/sync": "^0.5.2"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
@@ -53,14 +53,15 @@
|
|
|
53
53
|
"@changesets/changelog-github": "^0.5.0",
|
|
54
54
|
"@changesets/cli": "^2.27.7",
|
|
55
55
|
"@github/prettier-config": "^0.0.6",
|
|
56
|
-
"@playwright/test": "^1.
|
|
57
|
-
"@types/node": "^20.14.
|
|
56
|
+
"@playwright/test": "^1.47.1",
|
|
57
|
+
"@types/node": "^20.14.11",
|
|
58
58
|
"@typescript-eslint/eslint-plugin": "^7.15.0",
|
|
59
59
|
"@typescript-eslint/parser": "^7.15.0",
|
|
60
|
-
"@vitest/coverage-v8": "^2.0.
|
|
60
|
+
"@vitest/coverage-v8": "^2.0.3",
|
|
61
61
|
"color-blend": "^4.0.0",
|
|
62
62
|
"color2k": "^2.0.3",
|
|
63
63
|
"console-table-printer": "^2.12.1",
|
|
64
|
+
"esbuild": "^0.23.1",
|
|
64
65
|
"eslint": "^8.57.0",
|
|
65
66
|
"eslint-config-prettier": "^9.1.0",
|
|
66
67
|
"eslint-import-resolver-typescript": "3.6",
|
|
@@ -73,11 +74,18 @@
|
|
|
73
74
|
"eslint-plugin-storybook": "^0.8.0",
|
|
74
75
|
"json5": "^2.2.1",
|
|
75
76
|
"markdown-table-ts": "^1.0.3",
|
|
76
|
-
"
|
|
77
|
-
"
|
|
77
|
+
"prettier": "^3.3.3",
|
|
78
|
+
"style-dictionary": "^4.0.1",
|
|
79
|
+
"tsx": "^4.19.0",
|
|
78
80
|
"typescript": "5.5",
|
|
79
|
-
"vitest": "^2.0.
|
|
81
|
+
"vitest": "^2.0.3",
|
|
80
82
|
"zod": "3.23",
|
|
81
83
|
"zod-validation-error": "3.3"
|
|
84
|
+
},
|
|
85
|
+
"peerDependencies": {
|
|
86
|
+
"style-dictionary": "^4.0.1"
|
|
87
|
+
},
|
|
88
|
+
"optionalDependencies": {
|
|
89
|
+
"@rollup/rollup-linux-x64-gnu": "^4.22.0"
|
|
82
90
|
}
|
|
83
91
|
}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
$type: 'color',
|
|
15
15
|
},
|
|
16
16
|
disabled: {
|
|
17
|
-
$value: '{base.color.neutral.
|
|
17
|
+
$value: '{base.color.neutral.8}',
|
|
18
18
|
$type: 'color',
|
|
19
19
|
},
|
|
20
20
|
neutral: {
|
|
@@ -194,7 +194,7 @@
|
|
|
194
194
|
},
|
|
195
195
|
upsell: {
|
|
196
196
|
muted: {
|
|
197
|
-
|
|
197
|
+
$value: '{borderColor.done.muted}',
|
|
198
198
|
$type: 'color',
|
|
199
199
|
alpha: 1,
|
|
200
200
|
},
|
|
@@ -468,7 +468,7 @@
|
|
|
468
468
|
active: {
|
|
469
469
|
$value: '{bgColor.danger.emphasis}',
|
|
470
470
|
$type: 'color',
|
|
471
|
-
mix: null
|
|
471
|
+
mix: null,
|
|
472
472
|
},
|
|
473
473
|
},
|
|
474
474
|
},
|
|
@@ -938,5 +938,5 @@
|
|
|
938
938
|
$type: 'color',
|
|
939
939
|
alpha: 1,
|
|
940
940
|
},
|
|
941
|
-
}
|
|
941
|
+
},
|
|
942
942
|
}
|
|
@@ -60,6 +60,9 @@
|
|
|
60
60
|
muted: {
|
|
61
61
|
$value: '{bgColor.neutral.muted}',
|
|
62
62
|
$type: 'color',
|
|
63
|
+
$extensions: {
|
|
64
|
+
alpha: 0.1,
|
|
65
|
+
},
|
|
63
66
|
},
|
|
64
67
|
emphasis: {
|
|
65
68
|
$value: '{bgColor.neutral.emphasis}',
|
|
@@ -83,6 +86,9 @@
|
|
|
83
86
|
muted: {
|
|
84
87
|
$value: '{borderColor.muted}',
|
|
85
88
|
$type: 'color',
|
|
89
|
+
$extensions: {
|
|
90
|
+
alpha: 0.4,
|
|
91
|
+
},
|
|
86
92
|
},
|
|
87
93
|
emphasis: {
|
|
88
94
|
$value: '{borderColor.emphasis}',
|
|
@@ -73,7 +73,9 @@
|
|
|
73
73
|
muted: {
|
|
74
74
|
$value: '{base.color.blue.4}',
|
|
75
75
|
$type: 'color',
|
|
76
|
-
|
|
76
|
+
$extensions: {
|
|
77
|
+
alpha: 0.4,
|
|
78
|
+
},
|
|
77
79
|
},
|
|
78
80
|
emphasis: {
|
|
79
81
|
$value: '{base.color.blue.5}',
|
|
@@ -84,7 +86,9 @@
|
|
|
84
86
|
muted: {
|
|
85
87
|
$value: '{base.color.red.4}',
|
|
86
88
|
$type: 'color',
|
|
87
|
-
|
|
89
|
+
$extensions: {
|
|
90
|
+
alpha: 0.4,
|
|
91
|
+
},
|
|
88
92
|
},
|
|
89
93
|
emphasis: {
|
|
90
94
|
$value: '{base.color.red.5}',
|
|
@@ -95,7 +99,9 @@
|
|
|
95
99
|
muted: {
|
|
96
100
|
$value: '{base.color.red.4}',
|
|
97
101
|
$type: 'color',
|
|
98
|
-
|
|
102
|
+
$extensions: {
|
|
103
|
+
alpha: 0.4,
|
|
104
|
+
},
|
|
99
105
|
},
|
|
100
106
|
emphasis: {
|
|
101
107
|
$value: '{base.color.red.5}',
|
|
@@ -106,6 +112,9 @@
|
|
|
106
112
|
muted: {
|
|
107
113
|
$value: '{borderColor.default}',
|
|
108
114
|
$type: 'color',
|
|
115
|
+
$extensions: {
|
|
116
|
+
alpha: 0.4,
|
|
117
|
+
},
|
|
109
118
|
},
|
|
110
119
|
emphasis: {
|
|
111
120
|
$value: '{borderColor.emphasis}',
|
|
@@ -119,14 +128,23 @@
|
|
|
119
128
|
num: {
|
|
120
129
|
$value: '{base.color.blue.3}',
|
|
121
130
|
$type: 'color',
|
|
131
|
+
$extensions: {
|
|
132
|
+
alpha: 0.3,
|
|
133
|
+
},
|
|
122
134
|
},
|
|
123
135
|
line: {
|
|
124
136
|
$value: '{base.color.blue.4}',
|
|
125
137
|
$type: 'color',
|
|
138
|
+
$extensions: {
|
|
139
|
+
alpha: 0.15,
|
|
140
|
+
},
|
|
126
141
|
},
|
|
127
142
|
word: {
|
|
128
143
|
$value: '{base.color.blue.4}',
|
|
129
144
|
$type: 'color',
|
|
145
|
+
$extensions: {
|
|
146
|
+
alpha: 0.4,
|
|
147
|
+
},
|
|
130
148
|
},
|
|
131
149
|
},
|
|
132
150
|
},
|
|
@@ -85,6 +85,7 @@
|
|
|
85
85
|
$value: '{base.color.neutral.8}',
|
|
86
86
|
$type: 'color',
|
|
87
87
|
$extensions: {
|
|
88
|
+
alpha: 0.6,
|
|
88
89
|
'org.primer.figma': {
|
|
89
90
|
collection: 'mode',
|
|
90
91
|
mode: 'dark',
|
|
@@ -92,7 +93,6 @@
|
|
|
92
93
|
scopes: ['fgColor'],
|
|
93
94
|
},
|
|
94
95
|
},
|
|
95
|
-
alpha: 0.6,
|
|
96
96
|
},
|
|
97
97
|
link: {
|
|
98
98
|
$value: '{fgColor.accent}',
|
|
@@ -597,6 +597,7 @@
|
|
|
597
597
|
$value: '{base.color.red.4}',
|
|
598
598
|
$type: 'color',
|
|
599
599
|
$extensions: {
|
|
600
|
+
alpha: 0.1,
|
|
600
601
|
'org.primer.figma': {
|
|
601
602
|
collection: 'mode',
|
|
602
603
|
mode: 'dark',
|
|
@@ -607,7 +608,6 @@
|
|
|
607
608
|
},
|
|
608
609
|
},
|
|
609
610
|
},
|
|
610
|
-
alpha: 0.1,
|
|
611
611
|
},
|
|
612
612
|
emphasis: {
|
|
613
613
|
$value: '{base.color.red.5}',
|
|
@@ -630,6 +630,7 @@
|
|
|
630
630
|
$value: '{bgColor.danger.muted}',
|
|
631
631
|
$type: 'color',
|
|
632
632
|
$extensions: {
|
|
633
|
+
alpha: 0.1,
|
|
633
634
|
'org.primer.figma': {
|
|
634
635
|
collection: 'mode',
|
|
635
636
|
mode: 'dark',
|
|
@@ -640,7 +641,6 @@
|
|
|
640
641
|
},
|
|
641
642
|
},
|
|
642
643
|
},
|
|
643
|
-
alpha: 0.1,
|
|
644
644
|
},
|
|
645
645
|
emphasis: {
|
|
646
646
|
$value: '{bgColor.danger.emphasis}',
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
emphasis: {
|
|
36
36
|
$value: '{base.color.blue.5}',
|
|
37
37
|
$type: 'color',
|
|
38
|
-
mix: null
|
|
38
|
+
mix: null,
|
|
39
39
|
},
|
|
40
40
|
},
|
|
41
41
|
open: {
|
|
@@ -86,6 +86,9 @@
|
|
|
86
86
|
muted: {
|
|
87
87
|
$value: '{borderColor.default}',
|
|
88
88
|
$type: 'color',
|
|
89
|
+
$extensions: {
|
|
90
|
+
alpha: 0.4,
|
|
91
|
+
},
|
|
89
92
|
},
|
|
90
93
|
emphasis: {
|
|
91
94
|
$value: '{borderColor.emphasis}',
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
emphasis: {
|
|
32
32
|
$value: '{base.color.blue.5}',
|
|
33
33
|
$type: 'color',
|
|
34
|
-
mix: null
|
|
34
|
+
mix: null,
|
|
35
35
|
},
|
|
36
36
|
},
|
|
37
37
|
open: {
|
|
@@ -103,6 +103,9 @@
|
|
|
103
103
|
muted: {
|
|
104
104
|
$value: '{borderColor.default}',
|
|
105
105
|
$type: 'color',
|
|
106
|
+
$extensions: {
|
|
107
|
+
alpha: 0.4,
|
|
108
|
+
},
|
|
106
109
|
},
|
|
107
110
|
emphasis: {
|
|
108
111
|
$value: '{borderColor.emphasis}',
|
|
@@ -118,7 +118,7 @@
|
|
|
118
118
|
group: 'semantic',
|
|
119
119
|
scopes: ['fgColor'],
|
|
120
120
|
},
|
|
121
|
-
}
|
|
121
|
+
},
|
|
122
122
|
},
|
|
123
123
|
accent: {
|
|
124
124
|
$value: '{base.color.blue.5}',
|
|
@@ -806,7 +806,7 @@
|
|
|
806
806
|
scopes: ['borderColor'],
|
|
807
807
|
},
|
|
808
808
|
},
|
|
809
|
-
alpha: 0.1
|
|
809
|
+
alpha: 0.1,
|
|
810
810
|
},
|
|
811
811
|
transparent: {
|
|
812
812
|
$value: '{base.color.transparent}',
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import StyleDictionary from 'style-dictionary';
|
|
2
|
-
/**
|
|
3
|
-
* @name {@link PrimerStyleDictionary}
|
|
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
|
-
* @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
|
-
* @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
|
-
*/
|
|
9
|
-
export declare const PrimerStyleDictionary: StyleDictionary.Core;
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
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");
|
|
11
|
-
/**
|
|
12
|
-
* Parsers
|
|
13
|
-
*
|
|
14
|
-
*/
|
|
15
|
-
style_dictionary_1.default.registerParser(parsers_1.w3cJsonParser);
|
|
16
|
-
/**
|
|
17
|
-
* Formats
|
|
18
|
-
*
|
|
19
|
-
*/
|
|
20
|
-
style_dictionary_1.default.registerFormat({
|
|
21
|
-
name: 'css/advanced',
|
|
22
|
-
formatter: formats_1.cssAdvanced,
|
|
23
|
-
});
|
|
24
|
-
style_dictionary_1.default.registerFormat({
|
|
25
|
-
name: 'css/customMedia',
|
|
26
|
-
formatter: formats_1.cssCustomMedia,
|
|
27
|
-
});
|
|
28
|
-
style_dictionary_1.default.registerFormat({
|
|
29
|
-
name: 'javascript/esm',
|
|
30
|
-
formatter: formats_1.javascriptEsm,
|
|
31
|
-
});
|
|
32
|
-
style_dictionary_1.default.registerFormat({
|
|
33
|
-
name: 'javascript/commonJs',
|
|
34
|
-
formatter: formats_1.javascriptCommonJs,
|
|
35
|
-
});
|
|
36
|
-
style_dictionary_1.default.registerFormat({
|
|
37
|
-
name: 'typescript/export-definition',
|
|
38
|
-
formatter: formats_1.typescriptExportDefinition,
|
|
39
|
-
});
|
|
40
|
-
style_dictionary_1.default.registerFormat({
|
|
41
|
-
name: 'json/nested-prefixed',
|
|
42
|
-
formatter: formats_1.jsonNestedPrefixed,
|
|
43
|
-
});
|
|
44
|
-
style_dictionary_1.default.registerFormat({
|
|
45
|
-
name: 'json/one-dimensional',
|
|
46
|
-
formatter: formats_1.jsonOneDimensional,
|
|
47
|
-
});
|
|
48
|
-
style_dictionary_1.default.registerFormat({
|
|
49
|
-
name: 'json/postCss-fallback',
|
|
50
|
-
formatter: formats_1.jsonPostCssFallback,
|
|
51
|
-
});
|
|
52
|
-
style_dictionary_1.default.registerFormat({
|
|
53
|
-
name: 'json/figma',
|
|
54
|
-
formatter: formats_1.jsonFigma,
|
|
55
|
-
});
|
|
56
|
-
/**
|
|
57
|
-
* Transformers
|
|
58
|
-
*
|
|
59
|
-
*/
|
|
60
|
-
style_dictionary_1.default.registerTransform(Object.assign({ name: 'color/rgbAlpha' }, transformers_1.colorToRgbAlpha));
|
|
61
|
-
style_dictionary_1.default.registerTransform(Object.assign({ name: 'color/rgbaFloat' }, transformers_1.colorToRgbaFloat));
|
|
62
|
-
style_dictionary_1.default.registerTransform(Object.assign({ name: 'color/hexMix' }, transformers_1.colorToHexMix));
|
|
63
|
-
style_dictionary_1.default.registerTransform(Object.assign({ name: 'color/hex' }, transformers_1.colorToHex));
|
|
64
|
-
style_dictionary_1.default.registerTransform(Object.assign({ name: 'float/pixel' }, transformers_1.floatToPixel));
|
|
65
|
-
style_dictionary_1.default.registerTransform(Object.assign({ name: 'float/pixelUnitless' }, transformers_1.floatToPixelUnitless));
|
|
66
|
-
style_dictionary_1.default.registerTransform(Object.assign({ name: 'dimension/rem' }, transformers_1.dimensionToRem));
|
|
67
|
-
style_dictionary_1.default.registerTransform(Object.assign({ name: 'dimension/remPxArray' }, transformers_1.dimensionToRemPxArray));
|
|
68
|
-
style_dictionary_1.default.registerTransform(Object.assign({ name: 'dimension/pixelUnitless' }, transformers_1.dimensionToPixelUnitless));
|
|
69
|
-
style_dictionary_1.default.registerTransform(Object.assign({ name: 'duration/css' }, transformers_1.durationToCss));
|
|
70
|
-
style_dictionary_1.default.registerTransform(Object.assign({ name: 'figma/attributes' }, transformers_1.figmaAttributes));
|
|
71
|
-
style_dictionary_1.default.registerTransform(Object.assign({ name: 'json/deprecated' }, transformers_1.jsonDeprecated));
|
|
72
|
-
style_dictionary_1.default.registerTransform(Object.assign({ name: 'name/pathToCamelCase' }, transformers_1.namePathToCamelCase));
|
|
73
|
-
style_dictionary_1.default.registerTransform(Object.assign({ name: 'name/pathToPascalCase' }, transformers_1.namePathToPascalCase));
|
|
74
|
-
style_dictionary_1.default.registerTransform(Object.assign({ name: 'name/pathToDotNotation' }, transformers_1.namePathToDotNotation));
|
|
75
|
-
style_dictionary_1.default.registerTransform(Object.assign({ name: 'name/pathToFigma' }, transformers_1.namePathToFigma));
|
|
76
|
-
style_dictionary_1.default.registerTransform(Object.assign({ name: 'name/pathToCamelCase' }, transformers_1.namePathToCamelCase));
|
|
77
|
-
style_dictionary_1.default.registerTransform(Object.assign({ name: 'name/pathToKebabCase' }, transformers_1.namePathToKebabCase));
|
|
78
|
-
style_dictionary_1.default.registerTransform(Object.assign({ name: 'name/pathToSlashNotation' }, transformers_1.namePathToSlashNotation));
|
|
79
|
-
style_dictionary_1.default.registerTransform(Object.assign({ name: 'shadow/css' }, transformers_1.shadowToCss));
|
|
80
|
-
style_dictionary_1.default.registerTransform(Object.assign({ name: 'border/css' }, transformers_1.borderToCss));
|
|
81
|
-
style_dictionary_1.default.registerTransform(Object.assign({ name: 'typography/css' }, transformers_1.typographyToCss));
|
|
82
|
-
style_dictionary_1.default.registerTransform(Object.assign({ name: 'fontWeight/number' }, transformers_1.fontWeightToNumber));
|
|
83
|
-
style_dictionary_1.default.registerTransform(Object.assign({ name: 'fontFamily/css' }, transformers_1.fontFamilyToCss));
|
|
84
|
-
style_dictionary_1.default.registerTransform(Object.assign({ name: 'fontFamily/figma' }, transformers_1.fontFamilyToFigma));
|
|
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;
|
|
@@ -1,13 +0,0 @@
|
|
|
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 { isFromFile } from './isFromFile';
|
|
8
|
-
export { isFontFamily } from './isFontFamily';
|
|
9
|
-
export { isFontWeight } from './isFontWeight';
|
|
10
|
-
export { isNumber } from './isNumber';
|
|
11
|
-
export { isShadow } from './isShadow';
|
|
12
|
-
export { isSource } from './isSource';
|
|
13
|
-
export { isTypography } from './isTypography';
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isTypography = exports.isSource = exports.isShadow = exports.isNumber = exports.isFontWeight = exports.isFontFamily = exports.isFromFile = exports.isDeprecated = exports.isDimension = exports.isColorWithMix = exports.isColorWithAlpha = exports.isColor = exports.isBorder = void 0;
|
|
4
|
-
var isBorder_1 = require("./isBorder");
|
|
5
|
-
Object.defineProperty(exports, "isBorder", { enumerable: true, get: function () { return isBorder_1.isBorder; } });
|
|
6
|
-
var isColor_1 = require("./isColor");
|
|
7
|
-
Object.defineProperty(exports, "isColor", { enumerable: true, get: function () { return isColor_1.isColor; } });
|
|
8
|
-
var isColorWithAlpha_1 = require("./isColorWithAlpha");
|
|
9
|
-
Object.defineProperty(exports, "isColorWithAlpha", { enumerable: true, get: function () { return isColorWithAlpha_1.isColorWithAlpha; } });
|
|
10
|
-
var isColorWithMix_1 = require("./isColorWithMix");
|
|
11
|
-
Object.defineProperty(exports, "isColorWithMix", { enumerable: true, get: function () { return isColorWithMix_1.isColorWithMix; } });
|
|
12
|
-
var isDimension_1 = require("./isDimension");
|
|
13
|
-
Object.defineProperty(exports, "isDimension", { enumerable: true, get: function () { return isDimension_1.isDimension; } });
|
|
14
|
-
var isDeprecated_1 = require("./isDeprecated");
|
|
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,7 +0,0 @@
|
|
|
1
|
-
import type StyleDictionary from 'style-dictionary';
|
|
2
|
-
/**
|
|
3
|
-
* @description Checks if token is of $type `border`
|
|
4
|
-
* @param arguments [StyleDictionary.TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
|
|
5
|
-
* @returns boolean
|
|
6
|
-
*/
|
|
7
|
-
export declare const isBorder: (token: StyleDictionary.TransformedToken) => boolean;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isBorder = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* @description Checks if token is of $type `border`
|
|
6
|
-
* @param arguments [StyleDictionary.TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
|
|
7
|
-
* @returns boolean
|
|
8
|
-
*/
|
|
9
|
-
const isBorder = (token) => {
|
|
10
|
-
return token.$type === 'border';
|
|
11
|
-
};
|
|
12
|
-
exports.isBorder = isBorder;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type StyleDictionary from 'style-dictionary';
|
|
2
|
-
/**
|
|
3
|
-
* @description Checks if token is of $type `color`
|
|
4
|
-
* @param token [StyleDictionary.TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
|
|
5
|
-
* @returns boolean
|
|
6
|
-
*/
|
|
7
|
-
export declare const isColor: (token: StyleDictionary.TransformedToken) => boolean;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isColor = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* @description Checks if token is of $type `color`
|
|
6
|
-
* @param token [StyleDictionary.TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
|
|
7
|
-
* @returns boolean
|
|
8
|
-
*/
|
|
9
|
-
const isColor = (token) => {
|
|
10
|
-
return token.$type === 'color';
|
|
11
|
-
};
|
|
12
|
-
exports.isColor = isColor;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type StyleDictionary from 'style-dictionary';
|
|
2
|
-
/**
|
|
3
|
-
* @description Checks if token is color with an alpha value
|
|
4
|
-
* @param arguments [StyleDictionary.TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
|
|
5
|
-
* @returns boolean
|
|
6
|
-
*/
|
|
7
|
-
export declare const isColorWithAlpha: (token: StyleDictionary.TransformedToken) => boolean;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isColorWithAlpha = void 0;
|
|
4
|
-
const isColor_1 = require("./isColor");
|
|
5
|
-
/**
|
|
6
|
-
* @description Checks if token is color with an alpha value
|
|
7
|
-
* @param arguments [StyleDictionary.TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
|
|
8
|
-
* @returns boolean
|
|
9
|
-
*/
|
|
10
|
-
const isColorWithAlpha = (token) => {
|
|
11
|
-
return (0, isColor_1.isColor)(token) && token.alpha !== undefined && typeof token.alpha === 'number';
|
|
12
|
-
};
|
|
13
|
-
exports.isColorWithAlpha = isColorWithAlpha;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type StyleDictionary from 'style-dictionary';
|
|
2
|
-
/**
|
|
3
|
-
* @description Checks if token is color and has a mix property
|
|
4
|
-
* @param arguments [StyleDictionary.TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
|
|
5
|
-
* @returns boolean
|
|
6
|
-
*/
|
|
7
|
-
export declare const isColorWithMix: (token: StyleDictionary.TransformedToken) => boolean;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isColorWithMix = void 0;
|
|
4
|
-
const isColor_1 = require("./isColor");
|
|
5
|
-
const throwError = (token) => {
|
|
6
|
-
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
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* @description Checks if token is color and has a mix property
|
|
10
|
-
* @param arguments [StyleDictionary.TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
|
|
11
|
-
* @returns boolean
|
|
12
|
-
*/
|
|
13
|
-
const isColorWithMix = (token) => {
|
|
14
|
-
// no color or no mix property
|
|
15
|
-
if (!(0, isColor_1.isColor)(token) || token.mix === undefined || token.mix === null) {
|
|
16
|
-
return false;
|
|
17
|
-
}
|
|
18
|
-
// invalid mix property
|
|
19
|
-
if (typeof token.mix.color !== 'string' ||
|
|
20
|
-
typeof token.mix.weight !== 'number' ||
|
|
21
|
-
token.mix.weight < 0 ||
|
|
22
|
-
token.mix.weight > 1) {
|
|
23
|
-
throwError(token);
|
|
24
|
-
}
|
|
25
|
-
// valid mix property
|
|
26
|
-
return true;
|
|
27
|
-
};
|
|
28
|
-
exports.isColorWithMix = isColorWithMix;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type StyleDictionary from 'style-dictionary';
|
|
2
|
-
/**
|
|
3
|
-
* @description Checks if token has a valid `deprecated` property
|
|
4
|
-
* @param arguments [StyleDictionary.TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
|
|
5
|
-
* @returns boolean
|
|
6
|
-
*/
|
|
7
|
-
export declare const isDeprecated: (token: StyleDictionary.TransformedToken) => boolean;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isDeprecated = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* @description Checks if token has a valid `deprecated` property
|
|
6
|
-
* @param arguments [StyleDictionary.TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
|
|
7
|
-
* @returns boolean
|
|
8
|
-
*/
|
|
9
|
-
const isDeprecated = (token) => {
|
|
10
|
-
return token.deprecated === true || typeof token.deprecated === 'string';
|
|
11
|
-
};
|
|
12
|
-
exports.isDeprecated = isDeprecated;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type StyleDictionary from 'style-dictionary';
|
|
2
|
-
/**
|
|
3
|
-
* @description Checks if token is of $type `dimension`
|
|
4
|
-
* @param arguments [StyleDictionary.TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
|
|
5
|
-
* @returns boolean
|
|
6
|
-
*/
|
|
7
|
-
export declare const isDimension: (token: StyleDictionary.TransformedToken) => boolean;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isDimension = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* @description Checks if token is of $type `dimension`
|
|
6
|
-
* @param arguments [StyleDictionary.TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
|
|
7
|
-
* @returns boolean
|
|
8
|
-
*/
|
|
9
|
-
const isDimension = (token) => {
|
|
10
|
-
return token.$type === 'dimension';
|
|
11
|
-
};
|
|
12
|
-
exports.isDimension = isDimension;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type StyleDictionary from 'style-dictionary';
|
|
2
|
-
/**
|
|
3
|
-
* @description Checks if token is of $type `duration`
|
|
4
|
-
* @param token [StyleDictionary.TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
|
|
5
|
-
* @returns boolean
|
|
6
|
-
*/
|
|
7
|
-
export declare const isDuration: (token: StyleDictionary.TransformedToken) => boolean;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isDuration = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* @description Checks if token is of $type `duration`
|
|
6
|
-
* @param token [StyleDictionary.TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
|
|
7
|
-
* @returns boolean
|
|
8
|
-
*/
|
|
9
|
-
const isDuration = (token) => {
|
|
10
|
-
return token.$type === 'duration';
|
|
11
|
-
};
|
|
12
|
-
exports.isDuration = isDuration;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type StyleDictionary from 'style-dictionary';
|
|
2
|
-
/**
|
|
3
|
-
* @description Checks if token is of $type `isFontFamily`
|
|
4
|
-
* @param arguments [StyleDictionary.TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
|
|
5
|
-
* @returns boolean
|
|
6
|
-
*/
|
|
7
|
-
export declare const isFontFamily: (token: StyleDictionary.TransformedToken) => boolean;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isFontFamily = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* @description Checks if token is of $type `isFontFamily`
|
|
6
|
-
* @param arguments [StyleDictionary.TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
|
|
7
|
-
* @returns boolean
|
|
8
|
-
*/
|
|
9
|
-
const isFontFamily = (token) => {
|
|
10
|
-
return token.$type === 'fontFamily';
|
|
11
|
-
};
|
|
12
|
-
exports.isFontFamily = isFontFamily;
|