@primer/primitives 9.1.2 → 10.0.0-rc.0c3e84bf
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 +3 -7
- 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 +3 -3
- package/dist/build/schemas/baseToken.js +4 -7
- package/dist/build/schemas/borderToken.d.ts +6 -6
- 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 +37 -25
- package/dist/build/schemas/colorToken.js +25 -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 +15 -8
- package/dist/build/schemas/dimensionToken.js +15 -17
- package/dist/build/schemas/dimensionValue.js +7 -10
- package/dist/build/schemas/durationToken.d.ts +6 -6
- package/dist/build/schemas/durationToken.js +8 -11
- package/dist/build/schemas/durationValue.js +4 -7
- package/dist/build/schemas/fontFamilyToken.d.ts +8 -8
- package/dist/build/schemas/fontFamilyToken.js +13 -16
- package/dist/build/schemas/fontWeightToken.d.ts +8 -8
- package/dist/build/schemas/fontWeightToken.js +14 -17
- package/dist/build/schemas/fontWeightValue.js +4 -7
- package/dist/build/schemas/numberToken.d.ts +8 -8
- 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 +23 -16
- package/dist/build/schemas/shadowToken.js +27 -27
- package/dist/build/schemas/stringToken.d.ts +6 -6
- 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 +6 -6
- 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 +6 -6
- 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 +5 -7
- 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 +2561 -4201
- package/dist/docs/functional/themes/dark-dimmed.json +2610 -3892
- package/dist/docs/functional/themes/dark-high-contrast.json +2687 -5815
- package/dist/docs/functional/themes/dark-tritanopia.json +2613 -4059
- package/dist/docs/functional/themes/dark.json +2590 -3450
- package/dist/docs/functional/themes/light-colorblind.json +2568 -4168
- package/dist/docs/functional/themes/light-high-contrast.json +2686 -5526
- package/dist/docs/functional/themes/light-tritanopia.json +2542 -4026
- package/dist/docs/functional/themes/light.json +2570 -3436
- 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 +1442 -3082
- package/dist/styleLint/functional/themes/dark-dimmed.json +1486 -2768
- package/dist/styleLint/functional/themes/dark-high-contrast.json +1517 -4645
- package/dist/styleLint/functional/themes/dark-tritanopia.json +1480 -2926
- package/dist/styleLint/functional/themes/dark.json +1474 -2334
- package/dist/styleLint/functional/themes/light-colorblind.json +1428 -3028
- package/dist/styleLint/functional/themes/light-high-contrast.json +1524 -4364
- package/dist/styleLint/functional/themes/light-tritanopia.json +1416 -2900
- package/dist/styleLint/functional/themes/light.json +1454 -2320
- package/dist/styleLint/functional/typography/typography.json +114 -114
- package/package.json +33 -32
- 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 +236 -121
- package/src/tokens/functional/color/dark/data-vis-dark.json5 +40 -40
- package/src/tokens/functional/color/dark/display-dark.json5 +95 -95
- package/src/tokens/functional/color/dark/overrides/dark.dimmed.json5 +1 -9
- package/src/tokens/functional/color/dark/overrides/dark.high-contrast.json5 +44 -31
- 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.json +3963 -0
- package/src/tokens/functional/color/dark/patterns-dark.json5 +126 -277
- package/src/tokens/functional/color/dark/primitives-dark.json5 +81 -81
- package/src/tokens/functional/color/dark/syntax-dark.json5 +47 -47
- package/src/tokens/functional/color/light/app-light.json5 +179 -118
- package/src/tokens/functional/color/light/data-vis-light.json5 +40 -40
- package/src/tokens/functional/color/light/display-light.json5 +0 -95
- package/src/tokens/functional/color/light/overrides/light.high-contrast.json5 +25 -27
- package/src/tokens/functional/color/light/overrides/light.protanopia-deuteranopia.json5 +62 -34
- package/src/tokens/functional/color/light/overrides/light.tritanopia.json5 +63 -11
- package/src/tokens/functional/color/light/patterns-light.json5 +126 -276
- package/src/tokens/functional/color/light/primitives-light.json5 +2 -80
- package/src/tokens/functional/color/light/syntax-light.json5 +0 -47
- package/src/tokens/functional/motion/loading.json5 +1 -1
- package/src/tokens/functional/motion/patterns.json5 +9 -2
- package/src/tokens/functional/shadow/dark.json5 +0 -14
- package/src/tokens/functional/shadow/light.json5 +0 -13
|
@@ -1,30 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
const scopes_1 = require("./scopes");
|
|
11
|
-
const tokenType_1 = require("./tokenType");
|
|
12
|
-
exports.colorToken = baseToken_1.baseToken
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { colorHexValue } from './colorHexValue.js';
|
|
3
|
+
import { referenceValue } from './referenceValue.js';
|
|
4
|
+
import { alphaValue } from './alphaValue.js';
|
|
5
|
+
import { baseToken } from './baseToken.js';
|
|
6
|
+
import { collection, mode } from './collections.js';
|
|
7
|
+
import { scopes } from './scopes.js';
|
|
8
|
+
import { tokenType } from './tokenType.js';
|
|
9
|
+
export const colorToken = baseToken
|
|
13
10
|
.extend({
|
|
14
|
-
$value:
|
|
15
|
-
$type:
|
|
16
|
-
alpha:
|
|
17
|
-
mix:
|
|
11
|
+
$value: z.union([colorHexValue, referenceValue]),
|
|
12
|
+
$type: tokenType('color'),
|
|
13
|
+
alpha: alphaValue.optional().nullable(),
|
|
14
|
+
mix: z
|
|
18
15
|
.object({
|
|
19
|
-
color:
|
|
20
|
-
weight:
|
|
16
|
+
color: z.string(),
|
|
17
|
+
weight: z.number().min(0).max(1),
|
|
21
18
|
})
|
|
22
19
|
.nullable()
|
|
23
20
|
.optional(),
|
|
24
|
-
$extensions:
|
|
21
|
+
$extensions: z
|
|
25
22
|
.object({
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
alpha: z.number().min(0).max(1).optional().nullable(),
|
|
24
|
+
'org.primer.figma': z
|
|
25
|
+
.object({
|
|
26
|
+
collection: collection([
|
|
28
27
|
'base/color/light',
|
|
29
28
|
'base/color/light-high-contrast',
|
|
30
29
|
'base/color/dark',
|
|
@@ -33,7 +32,7 @@ exports.colorToken = baseToken_1.baseToken
|
|
|
33
32
|
'mode',
|
|
34
33
|
'pattern/mode',
|
|
35
34
|
]).optional(),
|
|
36
|
-
|
|
35
|
+
modeOverride: mode([
|
|
37
36
|
'light',
|
|
38
37
|
'dark',
|
|
39
38
|
'dark dimmed',
|
|
@@ -44,8 +43,10 @@ exports.colorToken = baseToken_1.baseToken
|
|
|
44
43
|
'light tritanopia',
|
|
45
44
|
'dark tritanopia',
|
|
46
45
|
]).optional(),
|
|
47
|
-
scopes:
|
|
48
|
-
|
|
46
|
+
scopes: scopes(['all', 'bgColor', 'fgColor', 'borderColor', 'effectColor']).optional(),
|
|
47
|
+
group: z.string().optional(),
|
|
48
|
+
})
|
|
49
|
+
.optional(),
|
|
49
50
|
})
|
|
50
51
|
.optional(),
|
|
51
52
|
})
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const cubicBezierToken: z.ZodObject<z.objectUtil.extendShape<{
|
|
3
|
+
$description: z.ZodOptional<z.ZodString>;
|
|
4
|
+
$deprecated: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>;
|
|
5
|
+
}, {
|
|
6
|
+
$value: z.ZodUnion<[z.ZodArray<z.ZodNumber, "many">, z.ZodEffects<z.ZodString, string, string>]>;
|
|
7
|
+
$type: z.ZodLiteral<"string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange">;
|
|
8
|
+
}>, "strict", z.ZodTypeAny, {
|
|
9
|
+
$value: string | number[];
|
|
10
|
+
$type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange";
|
|
11
|
+
$description?: string | undefined;
|
|
12
|
+
$deprecated?: string | boolean | undefined;
|
|
13
|
+
}, {
|
|
14
|
+
$value: string | number[];
|
|
15
|
+
$type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange";
|
|
16
|
+
$description?: string | undefined;
|
|
17
|
+
$deprecated?: string | boolean | undefined;
|
|
18
|
+
}>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { baseToken } from './baseToken.js';
|
|
3
|
+
import { referenceValue } from './referenceValue.js';
|
|
4
|
+
import { tokenType } from './tokenType.js';
|
|
5
|
+
export const cubicBezierToken = baseToken.extend({
|
|
6
|
+
$value: z.union([z.array(z.number()).length(4), referenceValue]),
|
|
7
|
+
$type: tokenType('cubicBezier'),
|
|
8
|
+
});
|
|
@@ -1,37 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const shadowToken_1 = require("./shadowToken");
|
|
16
|
-
const durationToken_1 = require("./durationToken");
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { tokenName } from './tokenName.js';
|
|
3
|
+
import { stringToken } from './stringToken.js';
|
|
4
|
+
import { viewportRangeToken } from './viewportRangeToken.js';
|
|
5
|
+
import { numberToken } from './numberToken.js';
|
|
6
|
+
import { fontWeightToken } from './fontWeightToken.js';
|
|
7
|
+
import { typographyToken } from './typographyToken.js';
|
|
8
|
+
import { borderToken } from './borderToken.js';
|
|
9
|
+
import { dimensionToken } from './dimensionToken.js';
|
|
10
|
+
import { colorToken } from './colorToken.js';
|
|
11
|
+
import { fontFamilyToken } from './fontFamilyToken.js';
|
|
12
|
+
import { shadowToken } from './shadowToken.js';
|
|
13
|
+
import { durationToken } from './durationToken.js';
|
|
14
|
+
import { cubicBezierToken } from './cubicBezierToken.js';
|
|
17
15
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
18
16
|
// @ts-ignore: TODO: fix this
|
|
19
|
-
|
|
20
|
-
return
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
17
|
+
export const designToken = z.record(tokenName, z.lazy(() => {
|
|
18
|
+
return z.union([
|
|
19
|
+
z.discriminatedUnion('$type', [
|
|
20
|
+
colorToken,
|
|
21
|
+
cubicBezierToken,
|
|
22
|
+
dimensionToken,
|
|
23
|
+
shadowToken,
|
|
24
|
+
borderToken,
|
|
25
|
+
fontFamilyToken,
|
|
26
|
+
fontWeightToken,
|
|
27
|
+
typographyToken,
|
|
28
|
+
viewportRangeToken,
|
|
29
|
+
numberToken,
|
|
30
|
+
durationToken,
|
|
31
|
+
stringToken,
|
|
33
32
|
]),
|
|
34
|
-
|
|
35
|
-
exports.designToken,
|
|
33
|
+
designToken,
|
|
36
34
|
]);
|
|
37
35
|
}));
|
|
@@ -1,52 +1,59 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const dimensionToken: z.ZodObject<z.objectUtil.extendShape<{
|
|
3
3
|
$description: z.ZodOptional<z.ZodString>;
|
|
4
|
-
deprecated: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>;
|
|
4
|
+
$deprecated: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>;
|
|
5
5
|
}, {
|
|
6
6
|
$value: z.ZodUnion<[z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodLiteral<"0">, z.ZodLiteral<0>]>, z.ZodEffects<z.ZodString, string, string>]>;
|
|
7
|
-
$type: z.ZodLiteral<"string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "shadow" | "typography" | "
|
|
7
|
+
$type: z.ZodLiteral<"string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange">;
|
|
8
8
|
$extensions: z.ZodOptional<z.ZodObject<{
|
|
9
9
|
'org.primer.figma': z.ZodObject<{
|
|
10
10
|
collection: z.ZodEffects<z.ZodString, string, string>;
|
|
11
11
|
scopes: z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], string[]>;
|
|
12
|
+
group: z.ZodOptional<z.ZodString>;
|
|
12
13
|
}, "strip", z.ZodTypeAny, {
|
|
13
14
|
collection: string;
|
|
14
15
|
scopes: string[];
|
|
16
|
+
group?: string | undefined;
|
|
15
17
|
}, {
|
|
16
18
|
collection: string;
|
|
17
19
|
scopes: string[];
|
|
20
|
+
group?: string | undefined;
|
|
18
21
|
}>;
|
|
19
22
|
}, "strip", z.ZodTypeAny, {
|
|
20
23
|
'org.primer.figma': {
|
|
21
24
|
collection: string;
|
|
22
25
|
scopes: string[];
|
|
26
|
+
group?: string | undefined;
|
|
23
27
|
};
|
|
24
28
|
}, {
|
|
25
29
|
'org.primer.figma': {
|
|
26
30
|
collection: string;
|
|
27
31
|
scopes: string[];
|
|
32
|
+
group?: string | undefined;
|
|
28
33
|
};
|
|
29
34
|
}>>;
|
|
30
35
|
}>, "strict", z.ZodTypeAny, {
|
|
31
|
-
$type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "shadow" | "typography" | "duration" | "custom-viewportRange";
|
|
32
36
|
$value: string | 0;
|
|
33
|
-
|
|
37
|
+
$type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange";
|
|
38
|
+
$description?: string | undefined;
|
|
39
|
+
$deprecated?: string | boolean | undefined;
|
|
34
40
|
$extensions?: {
|
|
35
41
|
'org.primer.figma': {
|
|
36
42
|
collection: string;
|
|
37
43
|
scopes: string[];
|
|
44
|
+
group?: string | undefined;
|
|
38
45
|
};
|
|
39
46
|
} | undefined;
|
|
40
|
-
$description?: string | undefined;
|
|
41
47
|
}, {
|
|
42
|
-
$type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "shadow" | "typography" | "duration" | "custom-viewportRange";
|
|
43
48
|
$value: string | 0;
|
|
44
|
-
|
|
49
|
+
$type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange";
|
|
50
|
+
$description?: string | undefined;
|
|
51
|
+
$deprecated?: string | boolean | undefined;
|
|
45
52
|
$extensions?: {
|
|
46
53
|
'org.primer.figma': {
|
|
47
54
|
collection: string;
|
|
48
55
|
scopes: string[];
|
|
56
|
+
group?: string | undefined;
|
|
49
57
|
};
|
|
50
58
|
} | undefined;
|
|
51
|
-
$description?: string | undefined;
|
|
52
59
|
}>;
|
|
@@ -1,22 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
const dimensionValue_1 = require("./dimensionValue");
|
|
10
|
-
const tokenType_1 = require("./tokenType");
|
|
11
|
-
exports.dimensionToken = baseToken_1.baseToken
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { baseToken } from './baseToken.js';
|
|
3
|
+
import { referenceValue } from './referenceValue.js';
|
|
4
|
+
import { collection } from './collections.js';
|
|
5
|
+
import { scopes } from './scopes.js';
|
|
6
|
+
import { dimensionValue } from './dimensionValue.js';
|
|
7
|
+
import { tokenType } from './tokenType.js';
|
|
8
|
+
export const dimensionToken = baseToken
|
|
12
9
|
.extend({
|
|
13
|
-
$value:
|
|
14
|
-
$type:
|
|
15
|
-
$extensions:
|
|
10
|
+
$value: z.union([dimensionValue, referenceValue]),
|
|
11
|
+
$type: tokenType('dimension'),
|
|
12
|
+
$extensions: z
|
|
16
13
|
.object({
|
|
17
|
-
'org.primer.figma':
|
|
18
|
-
collection:
|
|
19
|
-
scopes:
|
|
14
|
+
'org.primer.figma': z.object({
|
|
15
|
+
collection: collection(['base/size', 'functional/size', 'pattern/size', 'typography']),
|
|
16
|
+
scopes: scopes([
|
|
20
17
|
'all',
|
|
21
18
|
'size',
|
|
22
19
|
'gap',
|
|
@@ -29,6 +26,7 @@ exports.dimensionToken = baseToken_1.baseToken
|
|
|
29
26
|
'paragraphSpacing',
|
|
30
27
|
'paragraphIndent',
|
|
31
28
|
]),
|
|
29
|
+
group: z.string().optional(),
|
|
32
30
|
}),
|
|
33
31
|
})
|
|
34
32
|
.optional(),
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
exports.dimensionValue = zod_1.z.union([
|
|
7
|
-
zod_1.z.string().refine(dim => /(^-?[0-9]+(px|rem)$|^-?[0-9]+\.?[0-9]*em$)/.test(dim), val => ({
|
|
8
|
-
message: (0, schemaErrorMessage_1.schemaErrorMessage)(`Invalid dimension: "${val}"`, `Dimension must be a string with a unit (px, rem or em) or 0`),
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { schemaErrorMessage } from '../utilities/index.js';
|
|
3
|
+
export const dimensionValue = z.union([
|
|
4
|
+
z.string().refine(dim => /(^-?[0-9]+(px|rem)$|^-?[0-9]+\.?[0-9]*em$)/.test(dim), val => ({
|
|
5
|
+
message: schemaErrorMessage(`Invalid dimension: "${val}"`, `Dimension must be a string with a unit (px, rem or em) or 0`),
|
|
9
6
|
})),
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
z.literal('0'),
|
|
8
|
+
z.literal(0),
|
|
12
9
|
]);
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const durationToken: z.ZodObject<z.objectUtil.extendShape<{
|
|
3
3
|
$description: z.ZodOptional<z.ZodString>;
|
|
4
|
-
deprecated: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>;
|
|
4
|
+
$deprecated: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>;
|
|
5
5
|
}, {
|
|
6
6
|
$value: z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodEffects<z.ZodString, string, string>]>;
|
|
7
|
-
$type: z.ZodLiteral<"string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "shadow" | "typography" | "
|
|
7
|
+
$type: z.ZodLiteral<"string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange">;
|
|
8
8
|
}>, "strict", z.ZodTypeAny, {
|
|
9
|
-
$type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "shadow" | "typography" | "duration" | "custom-viewportRange";
|
|
10
9
|
$value: string;
|
|
11
|
-
|
|
10
|
+
$type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange";
|
|
12
11
|
$description?: string | undefined;
|
|
12
|
+
$deprecated?: string | boolean | undefined;
|
|
13
13
|
}, {
|
|
14
|
-
$type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "shadow" | "typography" | "duration" | "custom-viewportRange";
|
|
15
14
|
$value: string;
|
|
16
|
-
|
|
15
|
+
$type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange";
|
|
17
16
|
$description?: string | undefined;
|
|
17
|
+
$deprecated?: string | boolean | undefined;
|
|
18
18
|
}>;
|
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
const durationValue_1 = require("./durationValue");
|
|
8
|
-
const tokenType_1 = require("./tokenType");
|
|
9
|
-
exports.durationToken = baseToken_1.baseToken
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { baseToken } from './baseToken.js';
|
|
3
|
+
import { referenceValue } from './referenceValue.js';
|
|
4
|
+
import { durationValue } from './durationValue.js';
|
|
5
|
+
import { tokenType } from './tokenType.js';
|
|
6
|
+
export const durationToken = baseToken
|
|
10
7
|
.extend({
|
|
11
|
-
$value:
|
|
12
|
-
$type:
|
|
8
|
+
$value: z.union([durationValue, referenceValue]),
|
|
9
|
+
$type: tokenType('duration'),
|
|
13
10
|
})
|
|
14
11
|
.strict();
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const schemaErrorMessage_1 = require("../utilities/schemaErrorMessage");
|
|
6
|
-
exports.durationValue = zod_1.z.string().refine(duration => /(^[0-9]+ms$)/.test(duration), val => ({
|
|
7
|
-
message: (0, schemaErrorMessage_1.schemaErrorMessage)(`Invalid duration: "${val}"`, `A duration must be a string with an "ms"`),
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { schemaErrorMessage } from '../utilities/index.js';
|
|
3
|
+
export const durationValue = z.string().refine(duration => /(^[0-9]+ms$)/.test(duration), val => ({
|
|
4
|
+
message: schemaErrorMessage(`Invalid duration: "${val}"`, `A duration must be a string with an "ms"`),
|
|
8
5
|
}));
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const fontFamilyToken: z.ZodObject<z.objectUtil.extendShape<{
|
|
3
3
|
$description: z.ZodOptional<z.ZodString>;
|
|
4
|
-
deprecated: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>;
|
|
4
|
+
$deprecated: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>;
|
|
5
5
|
}, {
|
|
6
6
|
$value: z.ZodUnion<[z.ZodString, z.ZodEffects<z.ZodString, string, string>]>;
|
|
7
|
-
$type: z.ZodLiteral<"string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "shadow" | "typography" | "
|
|
7
|
+
$type: z.ZodLiteral<"string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange">;
|
|
8
8
|
$extensions: z.ZodOptional<z.ZodObject<{
|
|
9
9
|
'org.primer.figma': z.ZodObject<{
|
|
10
10
|
collection: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
@@ -28,25 +28,25 @@ export declare const fontFamilyToken: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
28
28
|
};
|
|
29
29
|
}>>;
|
|
30
30
|
}>, "strict", z.ZodTypeAny, {
|
|
31
|
-
$type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "shadow" | "typography" | "duration" | "custom-viewportRange";
|
|
32
31
|
$value: string;
|
|
33
|
-
|
|
32
|
+
$type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange";
|
|
33
|
+
$description?: string | undefined;
|
|
34
|
+
$deprecated?: string | boolean | undefined;
|
|
34
35
|
$extensions?: {
|
|
35
36
|
'org.primer.figma': {
|
|
36
37
|
collection?: string | undefined;
|
|
37
38
|
scopes?: string[] | undefined;
|
|
38
39
|
};
|
|
39
40
|
} | undefined;
|
|
40
|
-
$description?: string | undefined;
|
|
41
41
|
}, {
|
|
42
|
-
$type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "shadow" | "typography" | "duration" | "custom-viewportRange";
|
|
43
42
|
$value: string;
|
|
44
|
-
|
|
43
|
+
$type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange";
|
|
44
|
+
$description?: string | undefined;
|
|
45
|
+
$deprecated?: string | boolean | undefined;
|
|
45
46
|
$extensions?: {
|
|
46
47
|
'org.primer.figma': {
|
|
47
48
|
collection?: string | undefined;
|
|
48
49
|
scopes?: string[] | undefined;
|
|
49
50
|
};
|
|
50
51
|
} | undefined;
|
|
51
|
-
$description?: string | undefined;
|
|
52
52
|
}>;
|
|
@@ -1,21 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
const collections_1 = require("./collections");
|
|
9
|
-
const scopes_1 = require("./scopes");
|
|
10
|
-
exports.fontFamilyToken = baseToken_1.baseToken
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { referenceValue } from './referenceValue.js';
|
|
3
|
+
import { baseToken } from './baseToken.js';
|
|
4
|
+
import { tokenType } from './tokenType.js';
|
|
5
|
+
import { collection } from './collections.js';
|
|
6
|
+
import { scopes } from './scopes.js';
|
|
7
|
+
export const fontFamilyToken = baseToken
|
|
11
8
|
.extend({
|
|
12
|
-
$value:
|
|
13
|
-
$type:
|
|
14
|
-
$extensions:
|
|
9
|
+
$value: z.union([z.string(), referenceValue]),
|
|
10
|
+
$type: tokenType('fontFamily'),
|
|
11
|
+
$extensions: z
|
|
15
12
|
.object({
|
|
16
|
-
'org.primer.figma':
|
|
17
|
-
collection:
|
|
18
|
-
scopes:
|
|
13
|
+
'org.primer.figma': z.object({
|
|
14
|
+
collection: collection(['base/typography', 'typography']).optional(),
|
|
15
|
+
scopes: scopes(['fontFamily']).optional(),
|
|
19
16
|
}),
|
|
20
17
|
})
|
|
21
18
|
.optional(),
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const fontWeightToken: z.ZodObject<z.objectUtil.extendShape<{
|
|
3
3
|
$description: z.ZodOptional<z.ZodString>;
|
|
4
|
-
deprecated: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>;
|
|
4
|
+
$deprecated: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>;
|
|
5
5
|
}, {
|
|
6
|
-
$type: z.ZodLiteral<"string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "shadow" | "typography" | "
|
|
6
|
+
$type: z.ZodLiteral<"string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange">;
|
|
7
7
|
$value: z.ZodUnion<[z.ZodEffects<z.ZodNumber, number, number>, z.ZodEffects<z.ZodString, string, string>]>;
|
|
8
8
|
$extensions: z.ZodOptional<z.ZodObject<{
|
|
9
9
|
'org.primer.figma': z.ZodObject<{
|
|
@@ -28,25 +28,25 @@ export declare const fontWeightToken: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
28
28
|
};
|
|
29
29
|
}>>;
|
|
30
30
|
}>, "strict", z.ZodTypeAny, {
|
|
31
|
-
$type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "shadow" | "typography" | "duration" | "custom-viewportRange";
|
|
32
31
|
$value: string | number;
|
|
33
|
-
|
|
32
|
+
$type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange";
|
|
33
|
+
$description?: string | undefined;
|
|
34
|
+
$deprecated?: string | boolean | undefined;
|
|
34
35
|
$extensions?: {
|
|
35
36
|
'org.primer.figma': {
|
|
36
37
|
collection?: string | undefined;
|
|
37
38
|
scopes?: string[] | undefined;
|
|
38
39
|
};
|
|
39
40
|
} | undefined;
|
|
40
|
-
$description?: string | undefined;
|
|
41
41
|
}, {
|
|
42
|
-
$type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "shadow" | "typography" | "duration" | "custom-viewportRange";
|
|
43
42
|
$value: string | number;
|
|
44
|
-
|
|
43
|
+
$type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange";
|
|
44
|
+
$description?: string | undefined;
|
|
45
|
+
$deprecated?: string | boolean | undefined;
|
|
45
46
|
$extensions?: {
|
|
46
47
|
'org.primer.figma': {
|
|
47
48
|
collection?: string | undefined;
|
|
48
49
|
scopes?: string[] | undefined;
|
|
49
50
|
};
|
|
50
51
|
} | undefined;
|
|
51
|
-
$description?: string | undefined;
|
|
52
52
|
}>;
|
|
@@ -1,22 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
const collections_1 = require("./collections");
|
|
10
|
-
const scopes_1 = require("./scopes");
|
|
11
|
-
exports.fontWeightToken = baseToken_1.baseToken
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { fontWeightValue } from './fontWeightValue.js';
|
|
3
|
+
import { referenceValue } from './referenceValue.js';
|
|
4
|
+
import { baseToken } from './baseToken.js';
|
|
5
|
+
import { tokenType } from './tokenType.js';
|
|
6
|
+
import { collection } from './collections.js';
|
|
7
|
+
import { scopes } from './scopes.js';
|
|
8
|
+
export const fontWeightToken = baseToken
|
|
12
9
|
.extend({
|
|
13
|
-
$type:
|
|
14
|
-
$value:
|
|
15
|
-
$extensions:
|
|
10
|
+
$type: tokenType('fontWeight'),
|
|
11
|
+
$value: z.union([fontWeightValue, referenceValue]),
|
|
12
|
+
$extensions: z
|
|
16
13
|
.object({
|
|
17
|
-
'org.primer.figma':
|
|
18
|
-
collection:
|
|
19
|
-
scopes:
|
|
14
|
+
'org.primer.figma': z.object({
|
|
15
|
+
collection: collection(['base/typography', 'typography']).optional(),
|
|
16
|
+
scopes: scopes(['fontWeight']).optional(),
|
|
20
17
|
}),
|
|
21
18
|
})
|
|
22
19
|
.optional(),
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.fontWeightValue = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
const schemaErrorMessage_1 = require("../utilities/schemaErrorMessage");
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { schemaErrorMessage } from '../utilities/index.js';
|
|
6
3
|
const allowed = [100, 200, 300, 400, 500, 600, 700, 800, 900, 950];
|
|
7
|
-
|
|
8
|
-
message:
|
|
4
|
+
export const fontWeightValue = z.number().refine(value => allowed.includes(value), value => ({
|
|
5
|
+
message: schemaErrorMessage(`Invalid font weight value: "${value}"`, `Font weight must be one of ${allowed.join(', ')}`),
|
|
9
6
|
}));
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const numberToken: z.ZodObject<z.objectUtil.extendShape<{
|
|
3
3
|
$description: z.ZodOptional<z.ZodString>;
|
|
4
|
-
deprecated: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>;
|
|
4
|
+
$deprecated: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>;
|
|
5
5
|
}, {
|
|
6
6
|
$value: z.ZodUnion<[z.ZodNumber, z.ZodEffects<z.ZodString, string, string>]>;
|
|
7
|
-
$type: z.ZodLiteral<"string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "shadow" | "typography" | "
|
|
7
|
+
$type: z.ZodLiteral<"string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange">;
|
|
8
8
|
$extensions: z.ZodOptional<z.ZodObject<{
|
|
9
9
|
'org.primer.data': z.ZodOptional<z.ZodObject<{
|
|
10
10
|
fontSize: z.ZodOptional<z.ZodNumber>;
|
|
@@ -41,9 +41,10 @@ export declare const numberToken: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
41
41
|
} | undefined;
|
|
42
42
|
}>>;
|
|
43
43
|
}>, "strict", z.ZodTypeAny, {
|
|
44
|
-
$type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "shadow" | "typography" | "duration" | "custom-viewportRange";
|
|
45
44
|
$value: string | number;
|
|
46
|
-
|
|
45
|
+
$type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange";
|
|
46
|
+
$description?: string | undefined;
|
|
47
|
+
$deprecated?: string | boolean | undefined;
|
|
47
48
|
$extensions?: {
|
|
48
49
|
'org.primer.data'?: {
|
|
49
50
|
fontSize?: number | undefined;
|
|
@@ -53,11 +54,11 @@ export declare const numberToken: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
53
54
|
scopes?: string[] | undefined;
|
|
54
55
|
} | undefined;
|
|
55
56
|
} | undefined;
|
|
56
|
-
$description?: string | undefined;
|
|
57
57
|
}, {
|
|
58
|
-
$type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "shadow" | "typography" | "duration" | "custom-viewportRange";
|
|
59
58
|
$value: string | number;
|
|
60
|
-
|
|
59
|
+
$type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange";
|
|
60
|
+
$description?: string | undefined;
|
|
61
|
+
$deprecated?: string | boolean | undefined;
|
|
61
62
|
$extensions?: {
|
|
62
63
|
'org.primer.data'?: {
|
|
63
64
|
fontSize?: number | undefined;
|
|
@@ -67,5 +68,4 @@ export declare const numberToken: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
67
68
|
scopes?: string[] | undefined;
|
|
68
69
|
} | undefined;
|
|
69
70
|
} | undefined;
|
|
70
|
-
$description?: string | undefined;
|
|
71
71
|
}>;
|