@primer/primitives 9.1.2 → 10.0.0-rc.367a0502
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/package.json +9 -8
- 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
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.colorHexValue = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
const schemaErrorMessage_1 = require("../utilities/schemaErrorMessage");
|
|
6
|
-
const colorHex3RegEx = '^#[0-9a-f]{3}$';
|
|
7
|
-
const colorHex6RegEx = '^#[0-9a-f]{6}$';
|
|
8
|
-
const colorHex8RegEx = '^#[0-9a-f]{8}$';
|
|
9
|
-
const colorHexRegex = new RegExp(`(${colorHex3RegEx})|(${colorHex6RegEx})|(${colorHex8RegEx})`, 'i');
|
|
10
|
-
exports.colorHexValue = zod_1.z.string().refine(color => colorHexRegex.test(color), color => ({
|
|
11
|
-
message: (0, schemaErrorMessage_1.schemaErrorMessage)(`Invalid color: "${color}"`, 'Color must be a hex string or a reference to a color token.'),
|
|
12
|
-
}));
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export declare const colorToken: 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.ZodEffects<z.ZodString, string, string>, z.ZodEffects<z.ZodString, string, string>]>;
|
|
7
|
-
$type: z.ZodLiteral<"string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "shadow" | "typography" | "duration" | "custom-viewportRange">;
|
|
8
|
-
alpha: z.ZodNullable<z.ZodOptional<z.ZodEffects<z.ZodAny, any, any>>>;
|
|
9
|
-
mix: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
10
|
-
color: z.ZodString;
|
|
11
|
-
weight: z.ZodNumber;
|
|
12
|
-
}, "strip", z.ZodTypeAny, {
|
|
13
|
-
color: string;
|
|
14
|
-
weight: number;
|
|
15
|
-
}, {
|
|
16
|
-
color: string;
|
|
17
|
-
weight: number;
|
|
18
|
-
}>>>;
|
|
19
|
-
$extensions: z.ZodOptional<z.ZodObject<{
|
|
20
|
-
'org.primer.figma': z.ZodObject<{
|
|
21
|
-
collection: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
22
|
-
mode: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
23
|
-
scopes: z.ZodOptional<z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], string[]>>;
|
|
24
|
-
}, "strip", z.ZodTypeAny, {
|
|
25
|
-
mode?: string | undefined;
|
|
26
|
-
collection?: string | undefined;
|
|
27
|
-
scopes?: string[] | undefined;
|
|
28
|
-
}, {
|
|
29
|
-
mode?: string | undefined;
|
|
30
|
-
collection?: string | undefined;
|
|
31
|
-
scopes?: string[] | undefined;
|
|
32
|
-
}>;
|
|
33
|
-
}, "strip", z.ZodTypeAny, {
|
|
34
|
-
'org.primer.figma': {
|
|
35
|
-
mode?: string | undefined;
|
|
36
|
-
collection?: string | undefined;
|
|
37
|
-
scopes?: string[] | undefined;
|
|
38
|
-
};
|
|
39
|
-
}, {
|
|
40
|
-
'org.primer.figma': {
|
|
41
|
-
mode?: string | undefined;
|
|
42
|
-
collection?: string | undefined;
|
|
43
|
-
scopes?: string[] | undefined;
|
|
44
|
-
};
|
|
45
|
-
}>>;
|
|
46
|
-
}>, "strict", z.ZodTypeAny, {
|
|
47
|
-
$type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "shadow" | "typography" | "duration" | "custom-viewportRange";
|
|
48
|
-
$value: string;
|
|
49
|
-
alpha?: any;
|
|
50
|
-
mix?: {
|
|
51
|
-
color: string;
|
|
52
|
-
weight: number;
|
|
53
|
-
} | null | undefined;
|
|
54
|
-
deprecated?: string | boolean | undefined;
|
|
55
|
-
$extensions?: {
|
|
56
|
-
'org.primer.figma': {
|
|
57
|
-
mode?: string | undefined;
|
|
58
|
-
collection?: string | undefined;
|
|
59
|
-
scopes?: string[] | undefined;
|
|
60
|
-
};
|
|
61
|
-
} | undefined;
|
|
62
|
-
$description?: string | undefined;
|
|
63
|
-
}, {
|
|
64
|
-
$type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "shadow" | "typography" | "duration" | "custom-viewportRange";
|
|
65
|
-
$value: string;
|
|
66
|
-
alpha?: any;
|
|
67
|
-
mix?: {
|
|
68
|
-
color: string;
|
|
69
|
-
weight: number;
|
|
70
|
-
} | null | undefined;
|
|
71
|
-
deprecated?: string | boolean | undefined;
|
|
72
|
-
$extensions?: {
|
|
73
|
-
'org.primer.figma': {
|
|
74
|
-
mode?: string | undefined;
|
|
75
|
-
collection?: string | undefined;
|
|
76
|
-
scopes?: string[] | undefined;
|
|
77
|
-
};
|
|
78
|
-
} | undefined;
|
|
79
|
-
$description?: string | undefined;
|
|
80
|
-
}>;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.colorToken = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
const colorHexValue_1 = require("./colorHexValue");
|
|
6
|
-
const referenceValue_1 = require("./referenceValue");
|
|
7
|
-
const alphaValue_1 = require("./alphaValue");
|
|
8
|
-
const baseToken_1 = require("./baseToken");
|
|
9
|
-
const collections_1 = require("./collections");
|
|
10
|
-
const scopes_1 = require("./scopes");
|
|
11
|
-
const tokenType_1 = require("./tokenType");
|
|
12
|
-
exports.colorToken = baseToken_1.baseToken
|
|
13
|
-
.extend({
|
|
14
|
-
$value: zod_1.z.union([colorHexValue_1.colorHexValue, referenceValue_1.referenceValue]),
|
|
15
|
-
$type: (0, tokenType_1.tokenType)('color'),
|
|
16
|
-
alpha: alphaValue_1.alphaValue.optional().nullable(),
|
|
17
|
-
mix: zod_1.z
|
|
18
|
-
.object({
|
|
19
|
-
color: zod_1.z.string(),
|
|
20
|
-
weight: zod_1.z.number().min(0).max(1),
|
|
21
|
-
})
|
|
22
|
-
.nullable()
|
|
23
|
-
.optional(),
|
|
24
|
-
$extensions: zod_1.z
|
|
25
|
-
.object({
|
|
26
|
-
'org.primer.figma': zod_1.z.object({
|
|
27
|
-
collection: (0, collections_1.collection)([
|
|
28
|
-
'base/color/light',
|
|
29
|
-
'base/color/light-high-contrast',
|
|
30
|
-
'base/color/dark',
|
|
31
|
-
'base/color/dark-dimmed',
|
|
32
|
-
'base/color/dark-high-contrast',
|
|
33
|
-
'mode',
|
|
34
|
-
'pattern/mode',
|
|
35
|
-
]).optional(),
|
|
36
|
-
mode: (0, collections_1.mode)([
|
|
37
|
-
'light',
|
|
38
|
-
'dark',
|
|
39
|
-
'dark dimmed',
|
|
40
|
-
'light high contrast',
|
|
41
|
-
'dark high contrast',
|
|
42
|
-
'light colorblind',
|
|
43
|
-
'dark colorblind',
|
|
44
|
-
'light tritanopia',
|
|
45
|
-
'dark tritanopia',
|
|
46
|
-
]).optional(),
|
|
47
|
-
scopes: (0, scopes_1.scopes)(['all', 'bgColor', 'fgColor', 'borderColor', 'effectColor']).optional(),
|
|
48
|
-
}),
|
|
49
|
-
})
|
|
50
|
-
.optional(),
|
|
51
|
-
})
|
|
52
|
-
.strict();
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.designToken = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
const tokenName_1 = require("./tokenName");
|
|
6
|
-
const stringToken_1 = require("./stringToken");
|
|
7
|
-
const viewportRangeToken_1 = require("./viewportRangeToken");
|
|
8
|
-
const numberToken_1 = require("./numberToken");
|
|
9
|
-
const fontWeightToken_1 = require("./fontWeightToken");
|
|
10
|
-
const typographyToken_1 = require("./typographyToken");
|
|
11
|
-
const borderToken_1 = require("./borderToken");
|
|
12
|
-
const dimensionToken_1 = require("./dimensionToken");
|
|
13
|
-
const colorToken_1 = require("./colorToken");
|
|
14
|
-
const fontFamilyToken_1 = require("./fontFamilyToken");
|
|
15
|
-
const shadowToken_1 = require("./shadowToken");
|
|
16
|
-
const durationToken_1 = require("./durationToken");
|
|
17
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
18
|
-
// @ts-ignore: TODO: fix this
|
|
19
|
-
exports.designToken = zod_1.z.record(tokenName_1.tokenName, zod_1.z.lazy(() => {
|
|
20
|
-
return zod_1.z.union([
|
|
21
|
-
zod_1.z.discriminatedUnion('$type', [
|
|
22
|
-
colorToken_1.colorToken,
|
|
23
|
-
dimensionToken_1.dimensionToken,
|
|
24
|
-
shadowToken_1.shadowToken,
|
|
25
|
-
borderToken_1.borderToken,
|
|
26
|
-
fontFamilyToken_1.fontFamilyToken,
|
|
27
|
-
fontWeightToken_1.fontWeightToken,
|
|
28
|
-
typographyToken_1.typographyToken,
|
|
29
|
-
viewportRangeToken_1.viewportRangeToken,
|
|
30
|
-
numberToken_1.numberToken,
|
|
31
|
-
durationToken_1.durationToken,
|
|
32
|
-
stringToken_1.stringToken,
|
|
33
|
-
]),
|
|
34
|
-
// referenceToken,
|
|
35
|
-
exports.designToken,
|
|
36
|
-
]);
|
|
37
|
-
}));
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export declare const dimensionToken: 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.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" | "duration" | "custom-viewportRange">;
|
|
8
|
-
$extensions: z.ZodOptional<z.ZodObject<{
|
|
9
|
-
'org.primer.figma': z.ZodObject<{
|
|
10
|
-
collection: z.ZodEffects<z.ZodString, string, string>;
|
|
11
|
-
scopes: z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], string[]>;
|
|
12
|
-
}, "strip", z.ZodTypeAny, {
|
|
13
|
-
collection: string;
|
|
14
|
-
scopes: string[];
|
|
15
|
-
}, {
|
|
16
|
-
collection: string;
|
|
17
|
-
scopes: string[];
|
|
18
|
-
}>;
|
|
19
|
-
}, "strip", z.ZodTypeAny, {
|
|
20
|
-
'org.primer.figma': {
|
|
21
|
-
collection: string;
|
|
22
|
-
scopes: string[];
|
|
23
|
-
};
|
|
24
|
-
}, {
|
|
25
|
-
'org.primer.figma': {
|
|
26
|
-
collection: string;
|
|
27
|
-
scopes: string[];
|
|
28
|
-
};
|
|
29
|
-
}>>;
|
|
30
|
-
}>, "strict", z.ZodTypeAny, {
|
|
31
|
-
$type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "shadow" | "typography" | "duration" | "custom-viewportRange";
|
|
32
|
-
$value: string | 0;
|
|
33
|
-
deprecated?: string | boolean | undefined;
|
|
34
|
-
$extensions?: {
|
|
35
|
-
'org.primer.figma': {
|
|
36
|
-
collection: string;
|
|
37
|
-
scopes: string[];
|
|
38
|
-
};
|
|
39
|
-
} | undefined;
|
|
40
|
-
$description?: string | undefined;
|
|
41
|
-
}, {
|
|
42
|
-
$type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "shadow" | "typography" | "duration" | "custom-viewportRange";
|
|
43
|
-
$value: string | 0;
|
|
44
|
-
deprecated?: string | boolean | undefined;
|
|
45
|
-
$extensions?: {
|
|
46
|
-
'org.primer.figma': {
|
|
47
|
-
collection: string;
|
|
48
|
-
scopes: string[];
|
|
49
|
-
};
|
|
50
|
-
} | undefined;
|
|
51
|
-
$description?: string | undefined;
|
|
52
|
-
}>;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.dimensionToken = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
const baseToken_1 = require("./baseToken");
|
|
6
|
-
const referenceValue_1 = require("./referenceValue");
|
|
7
|
-
const collections_1 = require("./collections");
|
|
8
|
-
const scopes_1 = require("./scopes");
|
|
9
|
-
const dimensionValue_1 = require("./dimensionValue");
|
|
10
|
-
const tokenType_1 = require("./tokenType");
|
|
11
|
-
exports.dimensionToken = baseToken_1.baseToken
|
|
12
|
-
.extend({
|
|
13
|
-
$value: zod_1.z.union([dimensionValue_1.dimensionValue, referenceValue_1.referenceValue]),
|
|
14
|
-
$type: (0, tokenType_1.tokenType)('dimension'),
|
|
15
|
-
$extensions: zod_1.z
|
|
16
|
-
.object({
|
|
17
|
-
'org.primer.figma': zod_1.z.object({
|
|
18
|
-
collection: (0, collections_1.collection)(['base/size', 'functional/size', 'pattern/size', 'typography']),
|
|
19
|
-
scopes: (0, scopes_1.scopes)([
|
|
20
|
-
'all',
|
|
21
|
-
'size',
|
|
22
|
-
'gap',
|
|
23
|
-
'radius',
|
|
24
|
-
'borderColor',
|
|
25
|
-
'effectFloat',
|
|
26
|
-
'fontSize',
|
|
27
|
-
'letterSpacing',
|
|
28
|
-
'lineHeight',
|
|
29
|
-
'paragraphSpacing',
|
|
30
|
-
'paragraphIndent',
|
|
31
|
-
]),
|
|
32
|
-
}),
|
|
33
|
-
})
|
|
34
|
-
.optional(),
|
|
35
|
-
})
|
|
36
|
-
.strict();
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.dimensionValue = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
const schemaErrorMessage_1 = require("../utilities/schemaErrorMessage");
|
|
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`),
|
|
9
|
-
})),
|
|
10
|
-
zod_1.z.literal('0'),
|
|
11
|
-
zod_1.z.literal(0),
|
|
12
|
-
]);
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export declare const durationToken: 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.ZodEffects<z.ZodString, string, string>, z.ZodEffects<z.ZodString, string, string>]>;
|
|
7
|
-
$type: z.ZodLiteral<"string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "shadow" | "typography" | "duration" | "custom-viewportRange">;
|
|
8
|
-
}>, "strict", z.ZodTypeAny, {
|
|
9
|
-
$type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "shadow" | "typography" | "duration" | "custom-viewportRange";
|
|
10
|
-
$value: string;
|
|
11
|
-
deprecated?: string | boolean | undefined;
|
|
12
|
-
$description?: string | undefined;
|
|
13
|
-
}, {
|
|
14
|
-
$type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "shadow" | "typography" | "duration" | "custom-viewportRange";
|
|
15
|
-
$value: string;
|
|
16
|
-
deprecated?: string | boolean | undefined;
|
|
17
|
-
$description?: string | undefined;
|
|
18
|
-
}>;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.durationToken = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
const baseToken_1 = require("./baseToken");
|
|
6
|
-
const referenceValue_1 = require("./referenceValue");
|
|
7
|
-
const durationValue_1 = require("./durationValue");
|
|
8
|
-
const tokenType_1 = require("./tokenType");
|
|
9
|
-
exports.durationToken = baseToken_1.baseToken
|
|
10
|
-
.extend({
|
|
11
|
-
$value: zod_1.z.union([durationValue_1.durationValue, referenceValue_1.referenceValue]),
|
|
12
|
-
$type: (0, tokenType_1.tokenType)('duration'),
|
|
13
|
-
})
|
|
14
|
-
.strict();
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.durationValue = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
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"`),
|
|
8
|
-
}));
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export declare const fontFamilyToken: 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.ZodString, z.ZodEffects<z.ZodString, string, string>]>;
|
|
7
|
-
$type: z.ZodLiteral<"string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "shadow" | "typography" | "duration" | "custom-viewportRange">;
|
|
8
|
-
$extensions: z.ZodOptional<z.ZodObject<{
|
|
9
|
-
'org.primer.figma': z.ZodObject<{
|
|
10
|
-
collection: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
11
|
-
scopes: z.ZodOptional<z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], string[]>>;
|
|
12
|
-
}, "strip", z.ZodTypeAny, {
|
|
13
|
-
collection?: string | undefined;
|
|
14
|
-
scopes?: string[] | undefined;
|
|
15
|
-
}, {
|
|
16
|
-
collection?: string | undefined;
|
|
17
|
-
scopes?: string[] | undefined;
|
|
18
|
-
}>;
|
|
19
|
-
}, "strip", z.ZodTypeAny, {
|
|
20
|
-
'org.primer.figma': {
|
|
21
|
-
collection?: string | undefined;
|
|
22
|
-
scopes?: string[] | undefined;
|
|
23
|
-
};
|
|
24
|
-
}, {
|
|
25
|
-
'org.primer.figma': {
|
|
26
|
-
collection?: string | undefined;
|
|
27
|
-
scopes?: string[] | undefined;
|
|
28
|
-
};
|
|
29
|
-
}>>;
|
|
30
|
-
}>, "strict", z.ZodTypeAny, {
|
|
31
|
-
$type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "shadow" | "typography" | "duration" | "custom-viewportRange";
|
|
32
|
-
$value: string;
|
|
33
|
-
deprecated?: string | boolean | undefined;
|
|
34
|
-
$extensions?: {
|
|
35
|
-
'org.primer.figma': {
|
|
36
|
-
collection?: string | undefined;
|
|
37
|
-
scopes?: string[] | undefined;
|
|
38
|
-
};
|
|
39
|
-
} | undefined;
|
|
40
|
-
$description?: string | undefined;
|
|
41
|
-
}, {
|
|
42
|
-
$type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "shadow" | "typography" | "duration" | "custom-viewportRange";
|
|
43
|
-
$value: string;
|
|
44
|
-
deprecated?: string | boolean | undefined;
|
|
45
|
-
$extensions?: {
|
|
46
|
-
'org.primer.figma': {
|
|
47
|
-
collection?: string | undefined;
|
|
48
|
-
scopes?: string[] | undefined;
|
|
49
|
-
};
|
|
50
|
-
} | undefined;
|
|
51
|
-
$description?: string | undefined;
|
|
52
|
-
}>;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fontFamilyToken = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
const referenceValue_1 = require("./referenceValue");
|
|
6
|
-
const baseToken_1 = require("./baseToken");
|
|
7
|
-
const tokenType_1 = require("./tokenType");
|
|
8
|
-
const collections_1 = require("./collections");
|
|
9
|
-
const scopes_1 = require("./scopes");
|
|
10
|
-
exports.fontFamilyToken = baseToken_1.baseToken
|
|
11
|
-
.extend({
|
|
12
|
-
$value: zod_1.z.union([zod_1.z.string(), referenceValue_1.referenceValue]),
|
|
13
|
-
$type: (0, tokenType_1.tokenType)('fontFamily'),
|
|
14
|
-
$extensions: zod_1.z
|
|
15
|
-
.object({
|
|
16
|
-
'org.primer.figma': zod_1.z.object({
|
|
17
|
-
collection: (0, collections_1.collection)(['base/typography', 'typography']).optional(),
|
|
18
|
-
scopes: (0, scopes_1.scopes)(['fontFamily']).optional(),
|
|
19
|
-
}),
|
|
20
|
-
})
|
|
21
|
-
.optional(),
|
|
22
|
-
})
|
|
23
|
-
.strict();
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export declare const fontWeightToken: z.ZodObject<z.objectUtil.extendShape<{
|
|
3
|
-
$description: z.ZodOptional<z.ZodString>;
|
|
4
|
-
deprecated: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>;
|
|
5
|
-
}, {
|
|
6
|
-
$type: z.ZodLiteral<"string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "shadow" | "typography" | "duration" | "custom-viewportRange">;
|
|
7
|
-
$value: z.ZodUnion<[z.ZodEffects<z.ZodNumber, number, number>, z.ZodEffects<z.ZodString, string, string>]>;
|
|
8
|
-
$extensions: z.ZodOptional<z.ZodObject<{
|
|
9
|
-
'org.primer.figma': z.ZodObject<{
|
|
10
|
-
collection: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
11
|
-
scopes: z.ZodOptional<z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], string[]>>;
|
|
12
|
-
}, "strip", z.ZodTypeAny, {
|
|
13
|
-
collection?: string | undefined;
|
|
14
|
-
scopes?: string[] | undefined;
|
|
15
|
-
}, {
|
|
16
|
-
collection?: string | undefined;
|
|
17
|
-
scopes?: string[] | undefined;
|
|
18
|
-
}>;
|
|
19
|
-
}, "strip", z.ZodTypeAny, {
|
|
20
|
-
'org.primer.figma': {
|
|
21
|
-
collection?: string | undefined;
|
|
22
|
-
scopes?: string[] | undefined;
|
|
23
|
-
};
|
|
24
|
-
}, {
|
|
25
|
-
'org.primer.figma': {
|
|
26
|
-
collection?: string | undefined;
|
|
27
|
-
scopes?: string[] | undefined;
|
|
28
|
-
};
|
|
29
|
-
}>>;
|
|
30
|
-
}>, "strict", z.ZodTypeAny, {
|
|
31
|
-
$type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "shadow" | "typography" | "duration" | "custom-viewportRange";
|
|
32
|
-
$value: string | number;
|
|
33
|
-
deprecated?: string | boolean | undefined;
|
|
34
|
-
$extensions?: {
|
|
35
|
-
'org.primer.figma': {
|
|
36
|
-
collection?: string | undefined;
|
|
37
|
-
scopes?: string[] | undefined;
|
|
38
|
-
};
|
|
39
|
-
} | undefined;
|
|
40
|
-
$description?: string | undefined;
|
|
41
|
-
}, {
|
|
42
|
-
$type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "shadow" | "typography" | "duration" | "custom-viewportRange";
|
|
43
|
-
$value: string | number;
|
|
44
|
-
deprecated?: string | boolean | undefined;
|
|
45
|
-
$extensions?: {
|
|
46
|
-
'org.primer.figma': {
|
|
47
|
-
collection?: string | undefined;
|
|
48
|
-
scopes?: string[] | undefined;
|
|
49
|
-
};
|
|
50
|
-
} | undefined;
|
|
51
|
-
$description?: string | undefined;
|
|
52
|
-
}>;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fontWeightToken = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
const fontWeightValue_1 = require("./fontWeightValue");
|
|
6
|
-
const referenceValue_1 = require("./referenceValue");
|
|
7
|
-
const baseToken_1 = require("./baseToken");
|
|
8
|
-
const tokenType_1 = require("./tokenType");
|
|
9
|
-
const collections_1 = require("./collections");
|
|
10
|
-
const scopes_1 = require("./scopes");
|
|
11
|
-
exports.fontWeightToken = baseToken_1.baseToken
|
|
12
|
-
.extend({
|
|
13
|
-
$type: (0, tokenType_1.tokenType)('fontWeight'),
|
|
14
|
-
$value: zod_1.z.union([fontWeightValue_1.fontWeightValue, referenceValue_1.referenceValue]),
|
|
15
|
-
$extensions: zod_1.z
|
|
16
|
-
.object({
|
|
17
|
-
'org.primer.figma': zod_1.z.object({
|
|
18
|
-
collection: (0, collections_1.collection)(['base/typography', 'typography']).optional(),
|
|
19
|
-
scopes: (0, scopes_1.scopes)(['fontWeight']).optional(),
|
|
20
|
-
}),
|
|
21
|
-
})
|
|
22
|
-
.optional(),
|
|
23
|
-
})
|
|
24
|
-
.strict();
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fontWeightValue = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
const schemaErrorMessage_1 = require("../utilities/schemaErrorMessage");
|
|
6
|
-
const allowed = [100, 200, 300, 400, 500, 600, 700, 800, 900, 950];
|
|
7
|
-
exports.fontWeightValue = zod_1.z.number().refine(value => allowed.includes(value), value => ({
|
|
8
|
-
message: (0, schemaErrorMessage_1.schemaErrorMessage)(`Invalid font weight value: "${value}"`, `Font weight must be one of ${allowed.join(', ')}`),
|
|
9
|
-
}));
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export declare const numberToken: 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.ZodNumber, z.ZodEffects<z.ZodString, string, string>]>;
|
|
7
|
-
$type: z.ZodLiteral<"string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "shadow" | "typography" | "duration" | "custom-viewportRange">;
|
|
8
|
-
$extensions: z.ZodOptional<z.ZodObject<{
|
|
9
|
-
'org.primer.data': z.ZodOptional<z.ZodObject<{
|
|
10
|
-
fontSize: z.ZodOptional<z.ZodNumber>;
|
|
11
|
-
}, "strip", z.ZodTypeAny, {
|
|
12
|
-
fontSize?: number | undefined;
|
|
13
|
-
}, {
|
|
14
|
-
fontSize?: number | undefined;
|
|
15
|
-
}>>;
|
|
16
|
-
'org.primer.figma': z.ZodOptional<z.ZodObject<{
|
|
17
|
-
collection: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
18
|
-
scopes: z.ZodOptional<z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], string[]>>;
|
|
19
|
-
}, "strip", z.ZodTypeAny, {
|
|
20
|
-
collection?: string | undefined;
|
|
21
|
-
scopes?: string[] | undefined;
|
|
22
|
-
}, {
|
|
23
|
-
collection?: string | undefined;
|
|
24
|
-
scopes?: string[] | undefined;
|
|
25
|
-
}>>;
|
|
26
|
-
}, "strip", z.ZodTypeAny, {
|
|
27
|
-
'org.primer.data'?: {
|
|
28
|
-
fontSize?: number | undefined;
|
|
29
|
-
} | undefined;
|
|
30
|
-
'org.primer.figma'?: {
|
|
31
|
-
collection?: string | undefined;
|
|
32
|
-
scopes?: string[] | undefined;
|
|
33
|
-
} | undefined;
|
|
34
|
-
}, {
|
|
35
|
-
'org.primer.data'?: {
|
|
36
|
-
fontSize?: number | undefined;
|
|
37
|
-
} | undefined;
|
|
38
|
-
'org.primer.figma'?: {
|
|
39
|
-
collection?: string | undefined;
|
|
40
|
-
scopes?: string[] | undefined;
|
|
41
|
-
} | undefined;
|
|
42
|
-
}>>;
|
|
43
|
-
}>, "strict", z.ZodTypeAny, {
|
|
44
|
-
$type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "shadow" | "typography" | "duration" | "custom-viewportRange";
|
|
45
|
-
$value: string | number;
|
|
46
|
-
deprecated?: string | boolean | undefined;
|
|
47
|
-
$extensions?: {
|
|
48
|
-
'org.primer.data'?: {
|
|
49
|
-
fontSize?: number | undefined;
|
|
50
|
-
} | undefined;
|
|
51
|
-
'org.primer.figma'?: {
|
|
52
|
-
collection?: string | undefined;
|
|
53
|
-
scopes?: string[] | undefined;
|
|
54
|
-
} | undefined;
|
|
55
|
-
} | undefined;
|
|
56
|
-
$description?: string | undefined;
|
|
57
|
-
}, {
|
|
58
|
-
$type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "shadow" | "typography" | "duration" | "custom-viewportRange";
|
|
59
|
-
$value: string | number;
|
|
60
|
-
deprecated?: string | boolean | undefined;
|
|
61
|
-
$extensions?: {
|
|
62
|
-
'org.primer.data'?: {
|
|
63
|
-
fontSize?: number | undefined;
|
|
64
|
-
} | undefined;
|
|
65
|
-
'org.primer.figma'?: {
|
|
66
|
-
collection?: string | undefined;
|
|
67
|
-
scopes?: string[] | undefined;
|
|
68
|
-
} | undefined;
|
|
69
|
-
} | undefined;
|
|
70
|
-
$description?: string | undefined;
|
|
71
|
-
}>;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.numberToken = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
const baseToken_1 = require("./baseToken");
|
|
6
|
-
const referenceValue_1 = require("./referenceValue");
|
|
7
|
-
const tokenType_1 = require("./tokenType");
|
|
8
|
-
const scopes_1 = require("./scopes");
|
|
9
|
-
const collections_1 = require("./collections");
|
|
10
|
-
exports.numberToken = baseToken_1.baseToken
|
|
11
|
-
.extend({
|
|
12
|
-
$value: zod_1.z.union([zod_1.z.number(), referenceValue_1.referenceValue]),
|
|
13
|
-
$type: (0, tokenType_1.tokenType)('number'),
|
|
14
|
-
$extensions: zod_1.z
|
|
15
|
-
.object({
|
|
16
|
-
'org.primer.data': zod_1.z
|
|
17
|
-
.object({
|
|
18
|
-
fontSize: zod_1.z.number().optional(),
|
|
19
|
-
})
|
|
20
|
-
.optional(),
|
|
21
|
-
'org.primer.figma': zod_1.z
|
|
22
|
-
.object({
|
|
23
|
-
collection: (0, collections_1.collection)(['typography']).optional(),
|
|
24
|
-
scopes: (0, scopes_1.scopes)(['fontWeight', 'lineHeight']).optional(),
|
|
25
|
-
})
|
|
26
|
-
.optional(),
|
|
27
|
-
})
|
|
28
|
-
.optional(),
|
|
29
|
-
})
|
|
30
|
-
.strict();
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.referenceValue = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
const schemaErrorMessage_1 = require("../utilities/schemaErrorMessage");
|
|
6
|
-
exports.referenceValue = zod_1.z.string().refine(ref => /^{\w+(\.\w+)*(\.\w+|\.@)}$/.test(ref), ref => ({
|
|
7
|
-
message: (0, schemaErrorMessage_1.schemaErrorMessage)(`Invalid reference: "${ref}"`, 'Reference must be a string in the format "{path.to.token}".'),
|
|
8
|
-
}));
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
declare const validScopes: readonly ["all", "bgColor", "fgColor", "borderColor", "borderWidth", "size", "gap", "radius", "effectColor", "effectFloat", "opacity", "fontFamily", "fontStyle", "fontWeight", "fontSize", "lineHeight", "letterSpacing", "paragraphSpacing", "paragraphIndent"];
|
|
3
|
-
export type ValidScope = (typeof validScopes)[number];
|
|
4
|
-
export declare const scopes: (scopeSubset?: ValidScope[]) => z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], string[]>;
|
|
5
|
-
export {};
|