@primer/primitives 11.4.0-rc.ac67c881 → 11.4.0-rc.daff2d10
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/build/filters/hasLlmExtensions.d.ts +7 -0
- package/dist/build/filters/hasLlmExtensions.js +11 -0
- package/dist/build/filters/index.d.ts +1 -0
- package/dist/build/filters/index.js +1 -0
- package/dist/build/formats/index.d.ts +1 -0
- package/dist/build/formats/index.js +1 -0
- package/dist/build/formats/markdownLlmGuidelines.d.ts +8 -0
- package/dist/build/formats/markdownLlmGuidelines.js +93 -0
- package/dist/build/platforms/index.d.ts +1 -0
- package/dist/build/platforms/index.js +1 -0
- package/dist/build/platforms/llmGuidelines.d.ts +2 -0
- package/dist/build/platforms/llmGuidelines.js +16 -0
- package/dist/build/primerStyleDictionary.js +5 -1
- package/dist/build/schemas/borderToken.d.ts +6 -0
- package/dist/build/schemas/borderToken.js +6 -0
- package/dist/build/schemas/colorToken.d.ts +4 -0
- package/dist/build/schemas/colorToken.js +2 -0
- package/dist/build/schemas/cubicBezierToken.d.ts +6 -0
- package/dist/build/schemas/cubicBezierToken.js +10 -2
- package/dist/build/schemas/dimensionToken.d.ts +4 -0
- package/dist/build/schemas/dimensionToken.js +2 -0
- package/dist/build/schemas/durationToken.d.ts +6 -0
- package/dist/build/schemas/durationToken.js +6 -0
- package/dist/build/schemas/fontFamilyToken.d.ts +4 -0
- package/dist/build/schemas/fontFamilyToken.js +2 -0
- package/dist/build/schemas/fontWeightToken.d.ts +4 -0
- package/dist/build/schemas/fontWeightToken.js +2 -0
- package/dist/build/schemas/gradientToken.d.ts +4 -0
- package/dist/build/schemas/gradientToken.js +2 -0
- package/dist/build/schemas/llmExtension.d.ts +9 -0
- package/dist/build/schemas/llmExtension.js +11 -0
- package/dist/build/schemas/numberToken.d.ts +4 -0
- package/dist/build/schemas/numberToken.js +2 -0
- package/dist/build/schemas/shadowToken.d.ts +4 -0
- package/dist/build/schemas/shadowToken.js +2 -0
- package/dist/build/schemas/stringToken.d.ts +6 -0
- package/dist/build/schemas/stringToken.js +6 -0
- package/dist/build/schemas/transitionToken.d.ts +6 -0
- package/dist/build/schemas/transitionToken.js +6 -0
- package/dist/build/schemas/typographyToken.d.ts +6 -0
- package/dist/build/schemas/typographyToken.js +6 -0
- package/dist/build/schemas/viewportRangeToken.d.ts +6 -0
- package/dist/build/schemas/viewportRangeToken.js +6 -0
- package/dist/css/base/motion/motion.css +5 -4
- package/dist/css/functional/size/border.css +9 -14
- package/dist/css/functional/size/radius.css +7 -0
- package/dist/css/functional/themes/dark-colorblind-high-contrast.css +170 -170
- package/dist/css/functional/themes/dark-colorblind.css +170 -170
- package/dist/css/functional/themes/dark-dimmed-high-contrast.css +170 -170
- package/dist/css/functional/themes/dark-dimmed.css +170 -170
- package/dist/css/functional/themes/dark-high-contrast.css +170 -170
- package/dist/css/functional/themes/dark-tritanopia-high-contrast.css +170 -170
- package/dist/css/functional/themes/dark-tritanopia.css +170 -170
- package/dist/css/functional/themes/dark.css +170 -170
- package/dist/css/functional/themes/light-colorblind-high-contrast.css +170 -170
- package/dist/css/functional/themes/light-colorblind.css +170 -170
- package/dist/css/functional/themes/light-high-contrast.css +170 -170
- package/dist/css/functional/themes/light-tritanopia-high-contrast.css +170 -170
- package/dist/css/functional/themes/light-tritanopia.css +170 -170
- package/dist/css/functional/themes/light.css +170 -170
- package/dist/css/functional/typography/typography.css +4 -4
- package/dist/css/primitives.css +1 -0
- package/dist/docs/base/motion/motion.json +85 -8
- package/dist/docs/functional/size/border.json +42 -177
- package/dist/docs/functional/size/radius.json +209 -0
- package/dist/docs/functional/themes/dark-colorblind-high-contrast.json +897 -87
- package/dist/docs/functional/themes/dark-colorblind.json +897 -87
- package/dist/docs/functional/themes/dark-dimmed-high-contrast.json +897 -87
- package/dist/docs/functional/themes/dark-dimmed.json +935 -125
- package/dist/docs/functional/themes/dark-high-contrast.json +897 -87
- package/dist/docs/functional/themes/dark-tritanopia-high-contrast.json +897 -87
- package/dist/docs/functional/themes/dark-tritanopia.json +897 -87
- package/dist/docs/functional/themes/dark.json +897 -87
- package/dist/docs/functional/themes/light-colorblind-high-contrast.json +897 -87
- package/dist/docs/functional/themes/light-colorblind.json +897 -87
- package/dist/docs/functional/themes/light-high-contrast.json +897 -87
- package/dist/docs/functional/themes/light-tritanopia-high-contrast.json +897 -87
- package/dist/docs/functional/themes/light-tritanopia.json +897 -87
- package/dist/docs/functional/themes/light.json +897 -87
- package/dist/docs/functional/typography/typography.json +172 -8
- package/dist/fallbacks/base/motion/motion.json +1 -0
- package/dist/fallbacks/functional/size/border.json +0 -5
- package/dist/fallbacks/functional/size/radius.json +7 -0
- package/dist/figma/dimension/dimension.json +30 -20
- package/dist/figma/themes/dark-colorblind.json +83 -0
- package/dist/figma/themes/dark-dimmed.json +132 -49
- package/dist/figma/themes/dark-high-contrast.json +83 -0
- package/dist/figma/themes/dark-tritanopia.json +83 -0
- package/dist/figma/themes/dark.json +83 -0
- package/dist/figma/themes/light-colorblind.json +83 -0
- package/dist/figma/themes/light-high-contrast.json +83 -0
- package/dist/figma/themes/light-tritanopia.json +83 -0
- package/dist/figma/themes/light.json +83 -0
- package/dist/figma/typography/typography.json +44 -40
- package/dist/internalCss/dark-colorblind-high-contrast.css +188 -198
- package/dist/internalCss/dark-colorblind.css +188 -198
- package/dist/internalCss/dark-dimmed-high-contrast.css +188 -198
- package/dist/internalCss/dark-dimmed.css +188 -198
- package/dist/internalCss/dark-high-contrast.css +188 -198
- package/dist/internalCss/dark-tritanopia-high-contrast.css +188 -198
- package/dist/internalCss/dark-tritanopia.css +188 -198
- package/dist/internalCss/dark.css +188 -198
- package/dist/internalCss/light-colorblind-high-contrast.css +188 -198
- package/dist/internalCss/light-colorblind.css +188 -198
- package/dist/internalCss/light-high-contrast.css +188 -198
- package/dist/internalCss/light-tritanopia-high-contrast.css +188 -198
- package/dist/internalCss/light-tritanopia.css +188 -198
- package/dist/internalCss/light.css +188 -198
- package/dist/styleLint/base/motion/motion.json +85 -8
- package/dist/styleLint/functional/size/border.json +34 -169
- package/dist/styleLint/functional/size/radius.json +209 -0
- package/dist/styleLint/functional/themes/dark-colorblind-high-contrast.json +812 -2
- package/dist/styleLint/functional/themes/dark-colorblind.json +812 -2
- package/dist/styleLint/functional/themes/dark-dimmed-high-contrast.json +812 -2
- package/dist/styleLint/functional/themes/dark-dimmed.json +850 -40
- package/dist/styleLint/functional/themes/dark-high-contrast.json +812 -2
- package/dist/styleLint/functional/themes/dark-tritanopia-high-contrast.json +812 -2
- package/dist/styleLint/functional/themes/dark-tritanopia.json +812 -2
- package/dist/styleLint/functional/themes/dark.json +812 -2
- package/dist/styleLint/functional/themes/light-colorblind-high-contrast.json +812 -2
- package/dist/styleLint/functional/themes/light-colorblind.json +812 -2
- package/dist/styleLint/functional/themes/light-high-contrast.json +812 -2
- package/dist/styleLint/functional/themes/light-tritanopia-high-contrast.json +812 -2
- package/dist/styleLint/functional/themes/light-tritanopia.json +812 -2
- package/dist/styleLint/functional/themes/light.json +812 -2
- package/dist/styleLint/functional/typography/typography.json +168 -4
- package/guidelines/color.llm.md +16 -0
- package/guidelines/guidelines.llm.md +34 -0
- package/guidelines/motion.llm.md +41 -0
- package/guidelines/spacing.llm.md +20 -0
- package/guidelines/typography.llm.md +14 -0
- package/package.json +4 -2
- package/src/tokens/base/motion/easing.json5 +39 -4
- package/src/tokens/functional/color/bgColor.json5 +157 -0
- package/src/tokens/functional/color/borderColor.json5 +146 -0
- package/src/tokens/functional/color/fgColor.json5 +93 -1
- package/src/tokens/functional/shadow/shadow.json5 +10 -0
- package/src/tokens/functional/size/border.json5 +17 -69
- package/src/tokens/functional/size/radius.json5 +90 -0
- package/src/tokens/functional/typography/font-stack.json5 +60 -0
- package/src/tokens/functional/typography/typography.json5 +67 -44
- package/token-guidelines.llm.md +546 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { TransformedToken } from 'style-dictionary/types';
|
|
2
|
+
/**
|
|
3
|
+
* @description Checks if token has LLM extensions (`org.primer.llm` in `$extensions`)
|
|
4
|
+
* @param arguments [TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
|
|
5
|
+
* @returns boolean
|
|
6
|
+
*/
|
|
7
|
+
export declare const hasLlmExtensions: (token: TransformedToken) => boolean;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description Checks if token has LLM extensions (`org.primer.llm` in `$extensions`)
|
|
3
|
+
* @param arguments [TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
|
|
4
|
+
* @returns boolean
|
|
5
|
+
*/
|
|
6
|
+
export const hasLlmExtensions = (token) => {
|
|
7
|
+
return (token.$extensions !== undefined &&
|
|
8
|
+
token.$extensions !== null &&
|
|
9
|
+
typeof token.$extensions === 'object' &&
|
|
10
|
+
'org.primer.llm' in token.$extensions);
|
|
11
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { cssCustomMedia } from './cssCustomMedia.js';
|
|
2
2
|
export { cssAdvanced } from './cssAdvanced.js';
|
|
3
|
+
export { markdownLlmGuidelines } from './markdownLlmGuidelines.js';
|
|
3
4
|
export { jsonFigma } from './jsonFigma.js';
|
|
4
5
|
export { javascriptCommonJs } from './javascriptCommonJs.js';
|
|
5
6
|
export { javascriptEsm } from './javascriptEsm.js';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { cssCustomMedia } from './cssCustomMedia.js';
|
|
2
2
|
export { cssAdvanced } from './cssAdvanced.js';
|
|
3
|
+
export { markdownLlmGuidelines } from './markdownLlmGuidelines.js';
|
|
3
4
|
export { jsonFigma } from './jsonFigma.js';
|
|
4
5
|
export { javascriptCommonJs } from './javascriptCommonJs.js';
|
|
5
6
|
export { javascriptEsm } from './javascriptEsm.js';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { FormatFn } from 'style-dictionary/types';
|
|
2
|
+
/**
|
|
3
|
+
* @description Outputs a markdown file with LLM token guidelines, extracting
|
|
4
|
+
* description from $description and usage/rules from $extensions['org.primer.llm']
|
|
5
|
+
* @param FormatFnArguments
|
|
6
|
+
* @returns formatted markdown `string`
|
|
7
|
+
*/
|
|
8
|
+
export declare const markdownLlmGuidelines: FormatFn;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { sortByName } from 'style-dictionary/utils';
|
|
11
|
+
/**
|
|
12
|
+
* Extracts category from token name
|
|
13
|
+
* - For "base-*" tokens, uses second word (e.g., "base-easing-ease" -> "easing")
|
|
14
|
+
* - Otherwise uses first word (e.g., "bgColor-danger-emphasis" -> "bgColor")
|
|
15
|
+
*/
|
|
16
|
+
function extractCategory(tokenName) {
|
|
17
|
+
const parts = tokenName.split('-');
|
|
18
|
+
if (parts[0] === 'base' && parts[1]) {
|
|
19
|
+
return parts[1];
|
|
20
|
+
}
|
|
21
|
+
return parts[0] || 'other';
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Formats category name for display
|
|
25
|
+
*/
|
|
26
|
+
function formatCategoryName(category) {
|
|
27
|
+
const categoryMap = {
|
|
28
|
+
bgColor: 'background color',
|
|
29
|
+
fgColor: 'text and foreground color',
|
|
30
|
+
};
|
|
31
|
+
if (categoryMap[category]) {
|
|
32
|
+
return categoryMap[category];
|
|
33
|
+
}
|
|
34
|
+
// Capitalize first letter
|
|
35
|
+
return category.charAt(0).toUpperCase() + category.slice(1);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* @description Outputs a markdown file with LLM token guidelines, extracting
|
|
39
|
+
* description from $description and usage/rules from $extensions['org.primer.llm']
|
|
40
|
+
* @param FormatFnArguments
|
|
41
|
+
* @returns formatted markdown `string`
|
|
42
|
+
*/
|
|
43
|
+
export const markdownLlmGuidelines = (_a) => __awaiter(void 0, [_a], void 0, function* ({ dictionary }) {
|
|
44
|
+
var _b;
|
|
45
|
+
const tokens = dictionary.allTokens.sort(sortByName);
|
|
46
|
+
const guidelines = [];
|
|
47
|
+
for (const token of tokens) {
|
|
48
|
+
const llmExt = (_b = token.$extensions) === null || _b === void 0 ? void 0 : _b['org.primer.llm'];
|
|
49
|
+
if (!llmExt)
|
|
50
|
+
continue;
|
|
51
|
+
const guideline = {
|
|
52
|
+
name: token.name,
|
|
53
|
+
category: extractCategory(token.name),
|
|
54
|
+
};
|
|
55
|
+
if (token.$description && typeof token.$description === 'string') {
|
|
56
|
+
guideline.description = token.$description;
|
|
57
|
+
}
|
|
58
|
+
if (llmExt.usage && Array.isArray(llmExt.usage)) {
|
|
59
|
+
guideline.usage = llmExt.usage;
|
|
60
|
+
}
|
|
61
|
+
if (llmExt.rules && typeof llmExt.rules === 'string') {
|
|
62
|
+
guideline.rules = llmExt.rules;
|
|
63
|
+
}
|
|
64
|
+
guidelines.push(guideline);
|
|
65
|
+
}
|
|
66
|
+
// Group by category
|
|
67
|
+
const grouped = {};
|
|
68
|
+
for (const guideline of guidelines) {
|
|
69
|
+
if (!Object.hasOwn(grouped, guideline.category)) {
|
|
70
|
+
grouped[guideline.category] = [];
|
|
71
|
+
}
|
|
72
|
+
grouped[guideline.category].push(guideline);
|
|
73
|
+
}
|
|
74
|
+
// Build markdown output
|
|
75
|
+
const lines = ['# Token Guidelines', ''];
|
|
76
|
+
for (const category of Object.keys(grouped).sort()) {
|
|
77
|
+
lines.push(`## ${formatCategoryName(category)}`, '');
|
|
78
|
+
for (const guideline of grouped[category]) {
|
|
79
|
+
lines.push(`### ${guideline.name}`);
|
|
80
|
+
if (guideline.description) {
|
|
81
|
+
lines.push(guideline.description);
|
|
82
|
+
}
|
|
83
|
+
if (guideline.usage && guideline.usage.length > 0) {
|
|
84
|
+
lines.push(`**Usage:** ${guideline.usage.join(', ')}`);
|
|
85
|
+
}
|
|
86
|
+
if (guideline.rules) {
|
|
87
|
+
lines.push(`**Rules:** ${guideline.rules}`);
|
|
88
|
+
}
|
|
89
|
+
lines.push('');
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return lines.join('\n');
|
|
93
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { hasLlmExtensions } from '../filters/index.js';
|
|
2
|
+
export const llmGuidelines = (outputFile, prefix, buildPath) => ({
|
|
3
|
+
prefix,
|
|
4
|
+
buildPath,
|
|
5
|
+
transforms: ['name/pathToKebabCase'],
|
|
6
|
+
files: [
|
|
7
|
+
{
|
|
8
|
+
destination: outputFile,
|
|
9
|
+
format: 'json/llm-guidelines',
|
|
10
|
+
filter: hasLlmExtensions,
|
|
11
|
+
options: {
|
|
12
|
+
outputReferences: false,
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
],
|
|
16
|
+
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import StyleDictionary from 'style-dictionary';
|
|
2
2
|
import { borderToCss, colorToRgbAlpha, colorToHex, colorToRgbaFloat, cubicBezierToCss, dimensionToRem, dimensionToPixelUnitless, durationToCss, figmaAttributes, fontFamilyToCss, fontFamilyToFigma, fontWeightToNumber, gradientToCss, jsonDeprecated, namePathToDotNotation, namePathToCamelCase, namePathToPascalCase, namePathToKebabCase, namePathToSlashNotation, namePathToFigma, shadowToCss, typographyToCss, dimensionToRemPxArray, floatToPixel, floatToPixelUnitless, transitionToCss, } from './transformers/index.js';
|
|
3
|
-
import { javascriptCommonJs, javascriptEsm, typescriptExportDefinition, jsonNestedPrefixed, cssCustomMedia, jsonOneDimensional, jsonPostCssFallback, cssAdvanced, jsonFigma, } from './formats/index.js';
|
|
3
|
+
import { javascriptCommonJs, javascriptEsm, typescriptExportDefinition, jsonNestedPrefixed, cssCustomMedia, jsonOneDimensional, jsonPostCssFallback, cssAdvanced, jsonFigma, markdownLlmGuidelines, } from './formats/index.js';
|
|
4
4
|
import { themeOverrides } from './preprocessors/themeOverrides.js';
|
|
5
5
|
import { colorAlphaToCss } from './transformers/colorAlphaToCss.js';
|
|
6
6
|
/**
|
|
@@ -55,6 +55,10 @@ PrimerStyleDictionary.registerFormat({
|
|
|
55
55
|
name: 'json/figma',
|
|
56
56
|
format: jsonFigma,
|
|
57
57
|
});
|
|
58
|
+
PrimerStyleDictionary.registerFormat({
|
|
59
|
+
name: 'json/llm-guidelines',
|
|
60
|
+
format: markdownLlmGuidelines,
|
|
61
|
+
});
|
|
58
62
|
/**
|
|
59
63
|
* Transformers
|
|
60
64
|
*
|
|
@@ -31,4 +31,10 @@ export declare const borderToken: z.ZodObject<{
|
|
|
31
31
|
width: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"0">, z.ZodLiteral<0>]>, z.ZodString]>;
|
|
32
32
|
}, z.core.$strip>, z.ZodString]>;
|
|
33
33
|
$type: z.ZodLiteral<"string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "transition" | "dimension" | "duration" | "gradient" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange">;
|
|
34
|
+
$extensions: z.ZodOptional<z.ZodObject<{
|
|
35
|
+
'org.primer.llm': z.ZodOptional<z.ZodObject<{
|
|
36
|
+
usage: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
37
|
+
rules: z.ZodOptional<z.ZodString>;
|
|
38
|
+
}, z.core.$strip>>;
|
|
39
|
+
}, z.core.$strip>>;
|
|
34
40
|
}, z.core.$strict>;
|
|
@@ -4,6 +4,7 @@ import { referenceValue } from './referenceValue.js';
|
|
|
4
4
|
import { colorHexValue } from './colorHexValue.js';
|
|
5
5
|
import { dimensionValue } from './dimensionValue.js';
|
|
6
6
|
import { tokenType } from './tokenType.js';
|
|
7
|
+
import { llmExtension } from './llmExtension.js';
|
|
7
8
|
export const borderValue = z.object({
|
|
8
9
|
color: z.union([colorHexValue, referenceValue]),
|
|
9
10
|
style: z.enum(['solid', 'dashed', 'dotted', 'double', 'groove', 'ridge', 'outset', 'inset']),
|
|
@@ -13,5 +14,10 @@ export const borderToken = baseToken
|
|
|
13
14
|
.extend({
|
|
14
15
|
$value: z.union([borderValue, referenceValue]),
|
|
15
16
|
$type: tokenType('border'),
|
|
17
|
+
$extensions: z
|
|
18
|
+
.object({
|
|
19
|
+
'org.primer.llm': llmExtension,
|
|
20
|
+
})
|
|
21
|
+
.optional(),
|
|
16
22
|
})
|
|
17
23
|
.strict();
|
|
@@ -98,5 +98,9 @@ export declare const colorToken: z.ZodObject<{
|
|
|
98
98
|
alpha: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodAny>>>;
|
|
99
99
|
}, z.core.$strict>]>>;
|
|
100
100
|
}, z.core.$strict>>;
|
|
101
|
+
'org.primer.llm': z.ZodOptional<z.ZodObject<{
|
|
102
|
+
usage: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
103
|
+
rules: z.ZodOptional<z.ZodString>;
|
|
104
|
+
}, z.core.$strip>>;
|
|
101
105
|
}, z.core.$strict>>;
|
|
102
106
|
}, z.core.$strict>;
|
|
@@ -6,6 +6,7 @@ import { baseToken } from './baseToken.js';
|
|
|
6
6
|
import { collection, mode } from './collections.js';
|
|
7
7
|
import { scopes } from './scopes.js';
|
|
8
8
|
import { tokenType } from './tokenType.js';
|
|
9
|
+
import { llmExtension } from './llmExtension.js';
|
|
9
10
|
const baseColorToken = baseToken.extend({
|
|
10
11
|
$value: z.union([colorHexValue, referenceValue]),
|
|
11
12
|
alpha: alphaValue.optional().nullable(),
|
|
@@ -75,6 +76,7 @@ export const colorToken = baseColorToken
|
|
|
75
76
|
})
|
|
76
77
|
.strict()
|
|
77
78
|
.optional(),
|
|
79
|
+
'org.primer.llm': llmExtension,
|
|
78
80
|
})
|
|
79
81
|
.strict()
|
|
80
82
|
.optional(),
|
|
@@ -4,4 +4,10 @@ export declare const cubicBezierToken: z.ZodObject<{
|
|
|
4
4
|
$deprecated: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>>;
|
|
5
5
|
$value: z.ZodUnion<readonly [z.ZodArray<z.ZodNumber>, z.ZodString]>;
|
|
6
6
|
$type: z.ZodLiteral<"string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "transition" | "dimension" | "duration" | "gradient" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange">;
|
|
7
|
+
$extensions: z.ZodOptional<z.ZodObject<{
|
|
8
|
+
'org.primer.llm': z.ZodOptional<z.ZodObject<{
|
|
9
|
+
usage: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
10
|
+
rules: z.ZodOptional<z.ZodString>;
|
|
11
|
+
}, z.core.$strip>>;
|
|
12
|
+
}, z.core.$strip>>;
|
|
7
13
|
}, z.core.$strict>;
|
|
@@ -2,7 +2,15 @@ import { z } from 'zod';
|
|
|
2
2
|
import { baseToken } from './baseToken.js';
|
|
3
3
|
import { referenceValue } from './referenceValue.js';
|
|
4
4
|
import { tokenType } from './tokenType.js';
|
|
5
|
-
|
|
5
|
+
import { llmExtension } from './llmExtension.js';
|
|
6
|
+
export const cubicBezierToken = baseToken
|
|
7
|
+
.extend({
|
|
6
8
|
$value: z.union([z.array(z.number()).length(4), referenceValue]),
|
|
7
9
|
$type: tokenType('cubicBezier'),
|
|
8
|
-
|
|
10
|
+
$extensions: z
|
|
11
|
+
.object({
|
|
12
|
+
'org.primer.llm': llmExtension,
|
|
13
|
+
})
|
|
14
|
+
.optional(),
|
|
15
|
+
})
|
|
16
|
+
.strict();
|
|
@@ -10,5 +10,9 @@ export declare const dimensionToken: z.ZodObject<{
|
|
|
10
10
|
scopes: z.ZodArray<z.ZodString>;
|
|
11
11
|
group: z.ZodOptional<z.ZodString>;
|
|
12
12
|
}, z.core.$strip>;
|
|
13
|
+
'org.primer.llm': z.ZodOptional<z.ZodObject<{
|
|
14
|
+
usage: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
15
|
+
rules: z.ZodOptional<z.ZodString>;
|
|
16
|
+
}, z.core.$strip>>;
|
|
13
17
|
}, z.core.$strip>>;
|
|
14
18
|
}, z.core.$strict>;
|
|
@@ -5,6 +5,7 @@ import { collection } from './collections.js';
|
|
|
5
5
|
import { scopes } from './scopes.js';
|
|
6
6
|
import { dimensionValue } from './dimensionValue.js';
|
|
7
7
|
import { tokenType } from './tokenType.js';
|
|
8
|
+
import { llmExtension } from './llmExtension.js';
|
|
8
9
|
export const dimensionToken = baseToken
|
|
9
10
|
.extend({
|
|
10
11
|
$value: z.union([dimensionValue, referenceValue]),
|
|
@@ -29,6 +30,7 @@ export const dimensionToken = baseToken
|
|
|
29
30
|
]),
|
|
30
31
|
group: z.string().optional(),
|
|
31
32
|
}),
|
|
33
|
+
'org.primer.llm': llmExtension,
|
|
32
34
|
})
|
|
33
35
|
.optional(),
|
|
34
36
|
})
|
|
@@ -4,4 +4,10 @@ export declare const durationToken: z.ZodObject<{
|
|
|
4
4
|
$deprecated: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>>;
|
|
5
5
|
$value: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
|
|
6
6
|
$type: z.ZodLiteral<"string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "transition" | "dimension" | "duration" | "gradient" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange">;
|
|
7
|
+
$extensions: z.ZodOptional<z.ZodObject<{
|
|
8
|
+
'org.primer.llm': z.ZodOptional<z.ZodObject<{
|
|
9
|
+
usage: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
10
|
+
rules: z.ZodOptional<z.ZodString>;
|
|
11
|
+
}, z.core.$strip>>;
|
|
12
|
+
}, z.core.$strip>>;
|
|
7
13
|
}, z.core.$strict>;
|
|
@@ -3,9 +3,15 @@ import { baseToken } from './baseToken.js';
|
|
|
3
3
|
import { referenceValue } from './referenceValue.js';
|
|
4
4
|
import { durationValue } from './durationValue.js';
|
|
5
5
|
import { tokenType } from './tokenType.js';
|
|
6
|
+
import { llmExtension } from './llmExtension.js';
|
|
6
7
|
export const durationToken = baseToken
|
|
7
8
|
.extend({
|
|
8
9
|
$value: z.union([durationValue, referenceValue]),
|
|
9
10
|
$type: tokenType('duration'),
|
|
11
|
+
$extensions: z
|
|
12
|
+
.object({
|
|
13
|
+
'org.primer.llm': llmExtension,
|
|
14
|
+
})
|
|
15
|
+
.optional(),
|
|
10
16
|
})
|
|
11
17
|
.strict();
|
|
@@ -9,5 +9,9 @@ export declare const fontFamilyToken: z.ZodObject<{
|
|
|
9
9
|
collection: z.ZodOptional<z.ZodString>;
|
|
10
10
|
scopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
11
11
|
}, z.core.$strip>;
|
|
12
|
+
'org.primer.llm': z.ZodOptional<z.ZodObject<{
|
|
13
|
+
usage: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
14
|
+
rules: z.ZodOptional<z.ZodString>;
|
|
15
|
+
}, z.core.$strip>>;
|
|
12
16
|
}, z.core.$strip>>;
|
|
13
17
|
}, z.core.$strict>;
|
|
@@ -4,6 +4,7 @@ import { baseToken } from './baseToken.js';
|
|
|
4
4
|
import { tokenType } from './tokenType.js';
|
|
5
5
|
import { collection } from './collections.js';
|
|
6
6
|
import { scopes } from './scopes.js';
|
|
7
|
+
import { llmExtension } from './llmExtension.js';
|
|
7
8
|
export const fontFamilyToken = baseToken
|
|
8
9
|
.extend({
|
|
9
10
|
$value: z.union([z.string(), referenceValue]),
|
|
@@ -14,6 +15,7 @@ export const fontFamilyToken = baseToken
|
|
|
14
15
|
collection: collection(['base/typography', 'typography']).optional(),
|
|
15
16
|
scopes: scopes(['fontFamily']).optional(),
|
|
16
17
|
}),
|
|
18
|
+
'org.primer.llm': llmExtension,
|
|
17
19
|
})
|
|
18
20
|
.optional(),
|
|
19
21
|
})
|
|
@@ -9,5 +9,9 @@ export declare const fontWeightToken: z.ZodObject<{
|
|
|
9
9
|
collection: z.ZodOptional<z.ZodString>;
|
|
10
10
|
scopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
11
11
|
}, z.core.$strip>;
|
|
12
|
+
'org.primer.llm': z.ZodOptional<z.ZodObject<{
|
|
13
|
+
usage: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
14
|
+
rules: z.ZodOptional<z.ZodString>;
|
|
15
|
+
}, z.core.$strip>>;
|
|
12
16
|
}, z.core.$strip>>;
|
|
13
17
|
}, z.core.$strict>;
|
|
@@ -5,6 +5,7 @@ import { baseToken } from './baseToken.js';
|
|
|
5
5
|
import { tokenType } from './tokenType.js';
|
|
6
6
|
import { collection } from './collections.js';
|
|
7
7
|
import { scopes } from './scopes.js';
|
|
8
|
+
import { llmExtension } from './llmExtension.js';
|
|
8
9
|
export const fontWeightToken = baseToken
|
|
9
10
|
.extend({
|
|
10
11
|
$type: tokenType('fontWeight'),
|
|
@@ -15,6 +16,7 @@ export const fontWeightToken = baseToken
|
|
|
15
16
|
collection: collection(['base/typography', 'typography']).optional(),
|
|
16
17
|
scopes: scopes(['fontWeight']).optional(),
|
|
17
18
|
}),
|
|
19
|
+
'org.primer.llm': llmExtension,
|
|
18
20
|
})
|
|
19
21
|
.optional(),
|
|
20
22
|
})
|
|
@@ -11,5 +11,9 @@ export declare const gradientToken: z.ZodObject<{
|
|
|
11
11
|
'org.primer.gradient': z.ZodObject<{
|
|
12
12
|
angle: z.ZodOptional<z.ZodNumber>;
|
|
13
13
|
}, z.core.$strip>;
|
|
14
|
+
'org.primer.llm': z.ZodOptional<z.ZodObject<{
|
|
15
|
+
usage: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
16
|
+
rules: z.ZodOptional<z.ZodString>;
|
|
17
|
+
}, z.core.$strip>>;
|
|
14
18
|
}, z.core.$strip>>;
|
|
15
19
|
}, z.core.$strict>;
|
|
@@ -3,6 +3,7 @@ import { baseToken } from './baseToken.js';
|
|
|
3
3
|
import { referenceValue } from './referenceValue.js';
|
|
4
4
|
import { tokenType } from './tokenType.js';
|
|
5
5
|
import { colorHexValue } from './colorHexValue.js';
|
|
6
|
+
import { llmExtension } from './llmExtension.js';
|
|
6
7
|
export const gradientToken = baseToken
|
|
7
8
|
.extend({
|
|
8
9
|
$value: z.union([
|
|
@@ -20,6 +21,7 @@ export const gradientToken = baseToken
|
|
|
20
21
|
'org.primer.gradient': z.object({
|
|
21
22
|
angle: z.number().int().min(0).max(360).optional(),
|
|
22
23
|
}),
|
|
24
|
+
'org.primer.llm': llmExtension,
|
|
23
25
|
})
|
|
24
26
|
.optional(),
|
|
25
27
|
})
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Schema for org.primer.llm extension
|
|
4
|
+
* Used to provide LLM-friendly metadata for tokens
|
|
5
|
+
*/
|
|
6
|
+
export declare const llmExtension: z.ZodOptional<z.ZodObject<{
|
|
7
|
+
usage: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
8
|
+
rules: z.ZodOptional<z.ZodString>;
|
|
9
|
+
}, z.core.$strip>>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Schema for org.primer.llm extension
|
|
4
|
+
* Used to provide LLM-friendly metadata for tokens
|
|
5
|
+
*/
|
|
6
|
+
export const llmExtension = z
|
|
7
|
+
.object({
|
|
8
|
+
usage: z.array(z.string()).optional(),
|
|
9
|
+
rules: z.string().optional(),
|
|
10
|
+
})
|
|
11
|
+
.optional();
|
|
@@ -12,5 +12,9 @@ export declare const numberToken: z.ZodObject<{
|
|
|
12
12
|
collection: z.ZodOptional<z.ZodString>;
|
|
13
13
|
scopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
14
14
|
}, z.core.$strip>>;
|
|
15
|
+
'org.primer.llm': z.ZodOptional<z.ZodObject<{
|
|
16
|
+
usage: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
17
|
+
rules: z.ZodOptional<z.ZodString>;
|
|
18
|
+
}, z.core.$strip>>;
|
|
15
19
|
}, z.core.$strip>>;
|
|
16
20
|
}, z.core.$strict>;
|
|
@@ -4,6 +4,7 @@ import { referenceValue } from './referenceValue.js';
|
|
|
4
4
|
import { tokenType } from './tokenType.js';
|
|
5
5
|
import { scopes } from './scopes.js';
|
|
6
6
|
import { collection } from './collections.js';
|
|
7
|
+
import { llmExtension } from './llmExtension.js';
|
|
7
8
|
export const numberToken = baseToken
|
|
8
9
|
.extend({
|
|
9
10
|
$value: z.union([z.number(), referenceValue]),
|
|
@@ -21,6 +22,7 @@ export const numberToken = baseToken
|
|
|
21
22
|
scopes: scopes(['fontWeight', 'lineHeight']).optional(),
|
|
22
23
|
})
|
|
23
24
|
.optional(),
|
|
25
|
+
'org.primer.llm': llmExtension,
|
|
24
26
|
})
|
|
25
27
|
.optional(),
|
|
26
28
|
})
|
|
@@ -226,5 +226,9 @@ export declare const shadowToken: z.ZodObject<{
|
|
|
226
226
|
}, z.core.$strict>>]>;
|
|
227
227
|
}, z.core.$strict>]>>;
|
|
228
228
|
}, z.core.$strict>>;
|
|
229
|
+
'org.primer.llm': z.ZodOptional<z.ZodObject<{
|
|
230
|
+
usage: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
231
|
+
rules: z.ZodOptional<z.ZodString>;
|
|
232
|
+
}, z.core.$strip>>;
|
|
229
233
|
}, z.core.$strip>>;
|
|
230
234
|
}, z.core.$strict>;
|
|
@@ -6,6 +6,7 @@ import { alphaValue } from './alphaValue.js';
|
|
|
6
6
|
import { dimensionValue } from './dimensionValue.js';
|
|
7
7
|
import { tokenType } from './tokenType.js';
|
|
8
8
|
import { collection, mode } from './collections.js';
|
|
9
|
+
import { llmExtension } from './llmExtension.js';
|
|
9
10
|
export const shadowValue = z
|
|
10
11
|
.object({
|
|
11
12
|
color: z.union([colorHexValue, referenceValue]),
|
|
@@ -58,6 +59,7 @@ export const shadowToken = baseToken
|
|
|
58
59
|
})
|
|
59
60
|
.strict()
|
|
60
61
|
.optional(),
|
|
62
|
+
'org.primer.llm': llmExtension,
|
|
61
63
|
})
|
|
62
64
|
.optional(),
|
|
63
65
|
})
|
|
@@ -4,4 +4,10 @@ export declare const stringToken: z.ZodObject<{
|
|
|
4
4
|
$deprecated: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>>;
|
|
5
5
|
$value: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
|
|
6
6
|
$type: z.ZodLiteral<"string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "transition" | "dimension" | "duration" | "gradient" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange">;
|
|
7
|
+
$extensions: z.ZodOptional<z.ZodObject<{
|
|
8
|
+
'org.primer.llm': z.ZodOptional<z.ZodObject<{
|
|
9
|
+
usage: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
10
|
+
rules: z.ZodOptional<z.ZodString>;
|
|
11
|
+
}, z.core.$strip>>;
|
|
12
|
+
}, z.core.$strip>>;
|
|
7
13
|
}, z.core.$strict>;
|
|
@@ -2,9 +2,15 @@ import { z } from 'zod';
|
|
|
2
2
|
import { baseToken } from './baseToken.js';
|
|
3
3
|
import { referenceValue } from './referenceValue.js';
|
|
4
4
|
import { tokenType } from './tokenType.js';
|
|
5
|
+
import { llmExtension } from './llmExtension.js';
|
|
5
6
|
export const stringToken = baseToken
|
|
6
7
|
.extend({
|
|
7
8
|
$value: z.union([z.string(), referenceValue]),
|
|
8
9
|
$type: tokenType('string'),
|
|
10
|
+
$extensions: z
|
|
11
|
+
.object({
|
|
12
|
+
'org.primer.llm': llmExtension,
|
|
13
|
+
})
|
|
14
|
+
.optional(),
|
|
9
15
|
})
|
|
10
16
|
.strict();
|
|
@@ -8,4 +8,10 @@ export declare const transitionToken: z.ZodObject<{
|
|
|
8
8
|
delay: z.ZodOptional<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodString]>, z.ZodString]>>;
|
|
9
9
|
}, z.core.$strip>, z.ZodString]>;
|
|
10
10
|
$type: z.ZodLiteral<"string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "transition" | "dimension" | "duration" | "gradient" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange">;
|
|
11
|
+
$extensions: z.ZodOptional<z.ZodObject<{
|
|
12
|
+
'org.primer.llm': z.ZodOptional<z.ZodObject<{
|
|
13
|
+
usage: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
14
|
+
rules: z.ZodOptional<z.ZodString>;
|
|
15
|
+
}, z.core.$strip>>;
|
|
16
|
+
}, z.core.$strip>>;
|
|
11
17
|
}, z.core.$strict>;
|
|
@@ -4,6 +4,7 @@ import { referenceValue } from './referenceValue.js';
|
|
|
4
4
|
import { durationToken } from './durationToken.js';
|
|
5
5
|
import { cubicBezierToken } from './cubicBezierToken.js';
|
|
6
6
|
import { tokenType } from './tokenType.js';
|
|
7
|
+
import { llmExtension } from './llmExtension.js';
|
|
7
8
|
export const transitionToken = baseToken
|
|
8
9
|
.extend({
|
|
9
10
|
$value: z.union([
|
|
@@ -15,5 +16,10 @@ export const transitionToken = baseToken
|
|
|
15
16
|
referenceValue,
|
|
16
17
|
]),
|
|
17
18
|
$type: tokenType('transition'),
|
|
19
|
+
$extensions: z
|
|
20
|
+
.object({
|
|
21
|
+
'org.primer.llm': llmExtension,
|
|
22
|
+
})
|
|
23
|
+
.optional(),
|
|
18
24
|
})
|
|
19
25
|
.strict();
|
|
@@ -15,4 +15,10 @@ export declare const typographyToken: z.ZodObject<{
|
|
|
15
15
|
fontFamily: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
|
|
16
16
|
}, z.core.$strip>, z.ZodString]>;
|
|
17
17
|
$type: z.ZodLiteral<"string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "transition" | "dimension" | "duration" | "gradient" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange">;
|
|
18
|
+
$extensions: z.ZodOptional<z.ZodObject<{
|
|
19
|
+
'org.primer.llm': z.ZodOptional<z.ZodObject<{
|
|
20
|
+
usage: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
21
|
+
rules: z.ZodOptional<z.ZodString>;
|
|
22
|
+
}, z.core.$strip>>;
|
|
23
|
+
}, z.core.$strip>>;
|
|
18
24
|
}, z.core.$strict>;
|
|
@@ -4,6 +4,7 @@ import { dimensionValue } from './dimensionValue.js';
|
|
|
4
4
|
import { baseToken } from './baseToken.js';
|
|
5
5
|
import { fontWeightValue } from './fontWeightValue.js';
|
|
6
6
|
import { tokenType } from './tokenType.js';
|
|
7
|
+
import { llmExtension } from './llmExtension.js';
|
|
7
8
|
export const typographyValue = z.object({
|
|
8
9
|
fontSize: z.union([dimensionValue, referenceValue]),
|
|
9
10
|
lineHeight: z.union([dimensionValue, referenceValue]).optional(),
|
|
@@ -14,5 +15,10 @@ export const typographyToken = baseToken
|
|
|
14
15
|
.extend({
|
|
15
16
|
$value: z.union([typographyValue, referenceValue]),
|
|
16
17
|
$type: tokenType('typography'),
|
|
18
|
+
$extensions: z
|
|
19
|
+
.object({
|
|
20
|
+
'org.primer.llm': llmExtension,
|
|
21
|
+
})
|
|
22
|
+
.optional(),
|
|
17
23
|
})
|
|
18
24
|
.strict();
|
|
@@ -4,4 +4,10 @@ export declare const viewportRangeToken: z.ZodObject<{
|
|
|
4
4
|
$deprecated: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>>;
|
|
5
5
|
$value: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
|
|
6
6
|
$type: z.ZodLiteral<"string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "transition" | "dimension" | "duration" | "gradient" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange">;
|
|
7
|
+
$extensions: z.ZodOptional<z.ZodObject<{
|
|
8
|
+
'org.primer.llm': z.ZodOptional<z.ZodObject<{
|
|
9
|
+
usage: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
10
|
+
rules: z.ZodOptional<z.ZodString>;
|
|
11
|
+
}, z.core.$strip>>;
|
|
12
|
+
}, z.core.$strip>>;
|
|
7
13
|
}, z.core.$strict>;
|
|
@@ -2,9 +2,15 @@ import { z } from 'zod';
|
|
|
2
2
|
import { baseToken } from './baseToken.js';
|
|
3
3
|
import { referenceValue } from './referenceValue.js';
|
|
4
4
|
import { tokenType } from './tokenType.js';
|
|
5
|
+
import { llmExtension } from './llmExtension.js';
|
|
5
6
|
export const viewportRangeToken = baseToken
|
|
6
7
|
.extend({
|
|
7
8
|
$value: z.union([z.string(), referenceValue]),
|
|
8
9
|
$type: tokenType('custom-viewportRange'),
|
|
10
|
+
$extensions: z
|
|
11
|
+
.object({
|
|
12
|
+
'org.primer.llm': llmExtension,
|
|
13
|
+
})
|
|
14
|
+
.optional(),
|
|
9
15
|
})
|
|
10
16
|
.strict();
|