@primer/primitives 11.4.0-rc.f798df25 → 11.4.1-rc.14fb4bb1
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/DESIGN_TOKENS_GUIDE.md +185 -0
- package/DESIGN_TOKENS_SPEC.md +565 -0
- 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/jsonFigma.js +8 -1
- package/dist/build/formats/markdownLlmGuidelines.d.ts +11 -0
- package/dist/build/formats/markdownLlmGuidelines.js +1168 -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 +17 -0
- package/dist/build/preprocessors/inheritGroupProperties.d.ts +7 -0
- package/dist/build/preprocessors/inheritGroupProperties.js +70 -0
- package/dist/build/primerStyleDictionary.js +7 -1
- package/dist/build/schemas/borderToken.d.ts +67 -5
- package/dist/build/schemas/borderToken.js +8 -1
- package/dist/build/schemas/colorToken.d.ts +643 -30
- package/dist/build/schemas/colorToken.js +5 -2
- package/dist/build/schemas/colorW3cValue.d.ts +28 -0
- package/dist/build/schemas/colorW3cValue.js +42 -0
- package/dist/build/schemas/cubicBezierToken.d.ts +7 -1
- package/dist/build/schemas/cubicBezierToken.js +10 -2
- package/dist/build/schemas/designToken.d.ts +1 -1
- package/dist/build/schemas/designToken.js +113 -21
- package/dist/build/schemas/dimensionToken.d.ts +15 -4
- package/dist/build/schemas/dimensionToken.js +6 -2
- package/dist/build/schemas/dimensionValue.d.ts +12 -1
- package/dist/build/schemas/dimensionValue.js +10 -13
- package/dist/build/schemas/durationToken.d.ts +14 -2
- package/dist/build/schemas/durationToken.js +6 -0
- package/dist/build/schemas/durationValue.d.ts +11 -1
- package/dist/build/schemas/durationValue.js +13 -3
- package/dist/build/schemas/fontFamilyToken.d.ts +5 -1
- package/dist/build/schemas/fontFamilyToken.js +2 -0
- package/dist/build/schemas/fontWeightToken.d.ts +5 -1
- package/dist/build/schemas/fontWeightToken.js +2 -0
- package/dist/build/schemas/gradientToken.d.ts +27 -2
- package/dist/build/schemas/gradientToken.js +4 -1
- package/dist/build/schemas/llmExtension.d.ts +9 -0
- package/dist/build/schemas/llmExtension.js +11 -0
- package/dist/build/schemas/numberToken.d.ts +5 -1
- package/dist/build/schemas/numberToken.js +2 -0
- package/dist/build/schemas/shadowToken.d.ts +1755 -127
- package/dist/build/schemas/shadowToken.js +10 -2
- package/dist/build/schemas/stringToken.d.ts +7 -1
- package/dist/build/schemas/stringToken.js +7 -1
- package/dist/build/schemas/tokenType.d.ts +1 -1
- package/dist/build/schemas/transitionToken.d.ts +21 -3
- package/dist/build/schemas/transitionToken.js +6 -0
- package/dist/build/schemas/typographyToken.d.ts +25 -5
- package/dist/build/schemas/typographyToken.js +7 -1
- package/dist/build/schemas/validTokenType.d.ts +6 -2
- package/dist/build/schemas/validTokenType.js +72 -18
- package/dist/build/schemas/viewportRangeToken.d.ts +7 -1
- package/dist/build/schemas/viewportRangeToken.js +6 -0
- package/dist/build/transformers/borderToCss.js +19 -1
- package/dist/build/transformers/colorAlphaToCss.js +6 -3
- package/dist/build/transformers/colorToHex.js +5 -2
- package/dist/build/transformers/colorToRgbAlpha.js +5 -2
- package/dist/build/transformers/colorToRgbaFloat.js +5 -0
- package/dist/build/transformers/dimensionToPixelUnitless.d.ts +3 -2
- package/dist/build/transformers/dimensionToPixelUnitless.js +22 -26
- package/dist/build/transformers/dimensionToRem.d.ts +2 -1
- package/dist/build/transformers/dimensionToRem.js +21 -22
- package/dist/build/transformers/dimensionToRemPxArray.d.ts +2 -1
- package/dist/build/transformers/dimensionToRemPxArray.js +21 -22
- package/dist/build/transformers/durationToCss.d.ts +2 -1
- package/dist/build/transformers/durationToCss.js +18 -11
- package/dist/build/transformers/gradientToCss.js +2 -1
- package/dist/build/transformers/shadowToCss.js +15 -1
- package/dist/build/transformers/utilities/normalizeColorValue.d.ts +23 -0
- package/dist/build/transformers/utilities/normalizeColorValue.js +74 -0
- package/dist/build/transformers/utilities/parseDimension.d.ts +12 -0
- package/dist/build/transformers/utilities/parseDimension.js +31 -0
- package/dist/build/types/borderTokenValue.d.ts +5 -2
- package/dist/build/types/dimensionTokenValue.d.ts +9 -0
- package/dist/build/types/shadowTokenValue.d.ts +8 -5
- 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/size/size-coarse.css +3 -3
- package/dist/css/functional/size/size-fine.css +3 -3
- package/dist/css/functional/size/viewport.css +1 -1
- package/dist/css/functional/themes/dark-colorblind-high-contrast.css +204 -200
- package/dist/css/functional/themes/dark-colorblind.css +204 -200
- package/dist/css/functional/themes/dark-dimmed-high-contrast.css +204 -200
- package/dist/css/functional/themes/dark-dimmed.css +204 -200
- package/dist/css/functional/themes/dark-high-contrast.css +204 -200
- package/dist/css/functional/themes/dark-tritanopia-high-contrast.css +204 -200
- package/dist/css/functional/themes/dark-tritanopia.css +204 -200
- package/dist/css/functional/themes/dark.css +204 -200
- package/dist/css/functional/themes/light-colorblind-high-contrast.css +204 -200
- package/dist/css/functional/themes/light-colorblind.css +204 -200
- package/dist/css/functional/themes/light-high-contrast.css +204 -200
- package/dist/css/functional/themes/light-tritanopia-high-contrast.css +204 -200
- package/dist/css/functional/themes/light-tritanopia.css +204 -200
- package/dist/css/functional/themes/light.css +204 -200
- package/dist/css/functional/typography/typography.css +4 -4
- package/dist/css/primitives.css +5 -0
- package/dist/docs/base/motion/motion.json +181 -32
- package/dist/docs/base/size/size.json +76 -19
- package/dist/docs/base/typography/typography.json +24 -6
- package/dist/docs/functional/size/border.json +66 -186
- package/dist/docs/functional/size/breakpoints.json +24 -6
- package/dist/docs/functional/size/radius.json +221 -0
- package/dist/docs/functional/size/size-coarse.json +45 -3
- package/dist/docs/functional/size/size-fine.json +45 -3
- package/dist/docs/functional/size/size.json +60 -15
- package/dist/docs/functional/size/viewport.json +2 -2
- package/dist/docs/functional/themes/dark-colorblind-high-contrast.json +3563 -436
- package/dist/docs/functional/themes/dark-colorblind.json +3563 -436
- package/dist/docs/functional/themes/dark-dimmed-high-contrast.json +3563 -436
- package/dist/docs/functional/themes/dark-dimmed.json +3601 -474
- package/dist/docs/functional/themes/dark-high-contrast.json +3563 -436
- package/dist/docs/functional/themes/dark-tritanopia-high-contrast.json +3563 -436
- package/dist/docs/functional/themes/dark-tritanopia.json +3563 -436
- package/dist/docs/functional/themes/dark.json +3563 -436
- package/dist/docs/functional/themes/light-colorblind-high-contrast.json +3569 -442
- package/dist/docs/functional/themes/light-colorblind.json +3566 -439
- package/dist/docs/functional/themes/light-high-contrast.json +3569 -442
- package/dist/docs/functional/themes/light-tritanopia-high-contrast.json +3569 -442
- package/dist/docs/functional/themes/light-tritanopia.json +3566 -439
- package/dist/docs/functional/themes/light.json +3566 -439
- package/dist/docs/functional/typography/typography.json +180 -10
- package/dist/fallbacks/base/motion/motion.json +49 -12
- package/dist/fallbacks/functional/size/border.json +0 -5
- package/dist/fallbacks/functional/size/radius.json +7 -0
- package/dist/fallbacks/functional/size/viewport.json +1 -1
- package/dist/figma/dimension/dimension.json +30 -20
- package/dist/figma/themes/dark-colorblind.json +85 -0
- package/dist/figma/themes/dark-dimmed.json +134 -49
- package/dist/figma/themes/dark-high-contrast.json +85 -0
- package/dist/figma/themes/dark-tritanopia.json +85 -0
- package/dist/figma/themes/dark.json +85 -0
- package/dist/figma/themes/light-colorblind.json +89 -4
- package/dist/figma/themes/light-high-contrast.json +89 -4
- package/dist/figma/themes/light-tritanopia.json +89 -4
- package/dist/figma/themes/light.json +89 -4
- package/dist/figma/typography/typography.json +44 -40
- package/dist/internalCss/dark-colorblind-high-contrast.css +218 -228
- package/dist/internalCss/dark-colorblind.css +218 -228
- package/dist/internalCss/dark-dimmed-high-contrast.css +218 -228
- package/dist/internalCss/dark-dimmed.css +218 -228
- package/dist/internalCss/dark-high-contrast.css +218 -228
- package/dist/internalCss/dark-tritanopia-high-contrast.css +218 -228
- package/dist/internalCss/dark-tritanopia.css +218 -228
- package/dist/internalCss/dark.css +218 -228
- package/dist/internalCss/light-colorblind-high-contrast.css +218 -228
- package/dist/internalCss/light-colorblind.css +218 -228
- package/dist/internalCss/light-high-contrast.css +218 -228
- package/dist/internalCss/light-tritanopia-high-contrast.css +218 -228
- package/dist/internalCss/light-tritanopia.css +218 -228
- package/dist/internalCss/light.css +218 -228
- package/dist/styleLint/base/motion/motion.json +181 -32
- package/dist/styleLint/base/size/size.json +76 -19
- package/dist/styleLint/base/typography/typography.json +30 -12
- package/dist/styleLint/functional/size/border.json +61 -181
- package/dist/styleLint/functional/size/breakpoints.json +24 -6
- package/dist/styleLint/functional/size/radius.json +221 -0
- package/dist/styleLint/functional/size/size-coarse.json +45 -3
- package/dist/styleLint/functional/size/size-fine.json +45 -3
- package/dist/styleLint/functional/size/size.json +111 -66
- package/dist/styleLint/functional/size/viewport.json +2 -2
- package/dist/styleLint/functional/themes/dark-colorblind-high-contrast.json +3603 -368
- package/dist/styleLint/functional/themes/dark-colorblind.json +3603 -368
- package/dist/styleLint/functional/themes/dark-dimmed-high-contrast.json +3603 -368
- package/dist/styleLint/functional/themes/dark-dimmed.json +3641 -406
- package/dist/styleLint/functional/themes/dark-high-contrast.json +3603 -368
- package/dist/styleLint/functional/themes/dark-tritanopia-high-contrast.json +3603 -368
- package/dist/styleLint/functional/themes/dark-tritanopia.json +3603 -368
- package/dist/styleLint/functional/themes/dark.json +3603 -368
- package/dist/styleLint/functional/themes/light-colorblind-high-contrast.json +3609 -374
- package/dist/styleLint/functional/themes/light-colorblind.json +3606 -371
- package/dist/styleLint/functional/themes/light-high-contrast.json +3609 -374
- package/dist/styleLint/functional/themes/light-tritanopia-high-contrast.json +3609 -374
- package/dist/styleLint/functional/themes/light-tritanopia.json +3606 -371
- package/dist/styleLint/functional/themes/light.json +3606 -371
- package/dist/styleLint/functional/typography/typography.json +196 -26
- package/package.json +9 -5
- package/src/tokens/base/motion/easing.json5 +39 -4
- package/src/tokens/base/motion/timing.json5 +12 -12
- package/src/tokens/base/size/size.json5 +194 -194
- package/src/tokens/base/typography/typography.json5 +6 -6
- package/src/tokens/component/avatar.json5 +72 -44
- package/src/tokens/component/button.json5 +1545 -1193
- package/src/tokens/functional/border/border.json5 +29 -1
- package/src/tokens/functional/color/bgColor.json5 +165 -0
- package/src/tokens/functional/color/borderColor.json5 +146 -0
- package/src/tokens/functional/color/control.json5 +24 -0
- package/src/tokens/functional/color/data-vis.json5 +7 -0
- package/src/tokens/functional/color/display.json5 +7 -0
- package/src/tokens/functional/color/fgColor.json5 +101 -1
- package/src/tokens/functional/color/focus.json5 +5 -0
- package/src/tokens/functional/color/selection.json5 +5 -0
- package/src/tokens/functional/color/syntax.json5 +14 -0
- package/src/tokens/functional/shadow/shadow.json5 +1264 -163
- package/src/tokens/functional/size/border.json5 +25 -77
- package/src/tokens/functional/size/breakpoints.json5 +6 -6
- package/src/tokens/functional/size/radius.json5 +90 -0
- package/src/tokens/functional/size/size-coarse.json5 +24 -3
- package/src/tokens/functional/size/size-fine.json5 +45 -24
- package/src/tokens/functional/size/size.json5 +50 -15
- package/src/tokens/functional/size/viewport.json5 +1 -1
- package/src/tokens/functional/typography/font-stack.json5 +60 -0
- package/src/tokens/functional/typography/typography.json5 +71 -44
- package/dist/build/parsers/index.d.ts +0 -1
- package/dist/build/parsers/index.js +0 -1
- package/dist/build/parsers/w3cJsonParser.d.ts +0 -6
- package/dist/build/parsers/w3cJsonParser.js +0 -25
- package/dist/removed/testing.json5 +0 -4
- package/src/tokens/removed/testing.json5 +0 -4
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { hasLlmExtensions } from '../filters/index.js';
|
|
2
|
+
export const llmGuidelines = (outputFile, prefix, buildPath) => ({
|
|
3
|
+
prefix,
|
|
4
|
+
buildPath,
|
|
5
|
+
preprocessors: ['inheritGroupProperties'],
|
|
6
|
+
transforms: ['name/pathToKebabCase'],
|
|
7
|
+
files: [
|
|
8
|
+
{
|
|
9
|
+
destination: outputFile,
|
|
10
|
+
format: 'json/llm-guidelines',
|
|
11
|
+
filter: hasLlmExtensions,
|
|
12
|
+
options: {
|
|
13
|
+
outputReferences: false,
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
],
|
|
17
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Preprocessor } from 'style-dictionary/types';
|
|
2
|
+
/**
|
|
3
|
+
* Preprocessor that inherits group-level $description and $extensions to child tokens.
|
|
4
|
+
* This enables W3C Design Tokens group properties to be available on individual tokens
|
|
5
|
+
* during formatting.
|
|
6
|
+
*/
|
|
7
|
+
export declare const inheritGroupProperties: Preprocessor;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Recursively walks tokens and inherits group-level properties to child tokens.
|
|
3
|
+
* Group properties ($description, $extensions at group level) are merged into child tokens
|
|
4
|
+
* that don't have their own values for those properties.
|
|
5
|
+
*
|
|
6
|
+
* Per W3C Design Tokens spec: https://www.designtokens.org/tr/drafts/format/#group-properties
|
|
7
|
+
*/
|
|
8
|
+
function inheritProperties(tokens, inheritedProps = {}) {
|
|
9
|
+
var _a;
|
|
10
|
+
const result = {};
|
|
11
|
+
// Extract group-level properties from current level
|
|
12
|
+
const currentGroupProps = {};
|
|
13
|
+
if (typeof tokens.$description === 'string') {
|
|
14
|
+
currentGroupProps.$description = tokens.$description;
|
|
15
|
+
}
|
|
16
|
+
if (tokens.$extensions && typeof tokens.$extensions === 'object') {
|
|
17
|
+
currentGroupProps.$extensions = tokens.$extensions;
|
|
18
|
+
}
|
|
19
|
+
// Merge inherited with current (current takes precedence)
|
|
20
|
+
const mergedProps = Object.assign(Object.assign({}, inheritedProps), currentGroupProps);
|
|
21
|
+
// Merge $extensions deeply
|
|
22
|
+
if (inheritedProps.$extensions || currentGroupProps.$extensions) {
|
|
23
|
+
mergedProps.$extensions = Object.assign(Object.assign({}, inheritedProps.$extensions), currentGroupProps.$extensions);
|
|
24
|
+
}
|
|
25
|
+
for (const [key, value] of Object.entries(tokens)) {
|
|
26
|
+
// Skip group-level properties (they're inherited, not copied)
|
|
27
|
+
if (key === '$description' || key === '$extensions') {
|
|
28
|
+
continue;
|
|
29
|
+
}
|
|
30
|
+
if (typeof value !== 'object' || value === null) {
|
|
31
|
+
result[key] = value;
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
const tokenValue = value;
|
|
35
|
+
// Check if this is a design token (has $value or value)
|
|
36
|
+
if ('$value' in tokenValue || 'value' in tokenValue) {
|
|
37
|
+
// It's a token - merge inherited properties
|
|
38
|
+
const token = tokenValue;
|
|
39
|
+
// Only inherit $description if token doesn't have its own
|
|
40
|
+
const inheritedDescription = !token.$description && mergedProps.$description ? mergedProps.$description : undefined;
|
|
41
|
+
// Merge $extensions (token-level takes precedence over inherited)
|
|
42
|
+
let mergedExtensions = token.$extensions;
|
|
43
|
+
if (mergedProps.$extensions) {
|
|
44
|
+
const inheritedLlm = mergedProps.$extensions['org.primer.llm'];
|
|
45
|
+
const tokenLlm = (_a = token.$extensions) === null || _a === void 0 ? void 0 : _a['org.primer.llm'];
|
|
46
|
+
if (inheritedLlm && !tokenLlm) {
|
|
47
|
+
// Token has no LLM extension, inherit from group
|
|
48
|
+
mergedExtensions = Object.assign(Object.assign({}, token.$extensions), { 'org.primer.llm': inheritedLlm });
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
result[key] = Object.assign(Object.assign(Object.assign({}, token), (inheritedDescription ? { $description: inheritedDescription } : {})), (mergedExtensions ? { $extensions: mergedExtensions } : {}));
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
// It's a nested group - recurse with merged properties
|
|
55
|
+
result[key] = inheritProperties(tokenValue, mergedProps);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return result;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Preprocessor that inherits group-level $description and $extensions to child tokens.
|
|
62
|
+
* This enables W3C Design Tokens group properties to be available on individual tokens
|
|
63
|
+
* during formatting.
|
|
64
|
+
*/
|
|
65
|
+
export const inheritGroupProperties = {
|
|
66
|
+
name: 'inheritGroupProperties',
|
|
67
|
+
preprocessor: (dictionary) => {
|
|
68
|
+
return inheritProperties(dictionary);
|
|
69
|
+
},
|
|
70
|
+
};
|
|
@@ -1,7 +1,8 @@
|
|
|
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
|
+
import { inheritGroupProperties } from './preprocessors/inheritGroupProperties.js';
|
|
5
6
|
import { colorAlphaToCss } from './transformers/colorAlphaToCss.js';
|
|
6
7
|
/**
|
|
7
8
|
* @name {@link PrimerStyleDictionary}
|
|
@@ -55,6 +56,10 @@ PrimerStyleDictionary.registerFormat({
|
|
|
55
56
|
name: 'json/figma',
|
|
56
57
|
format: jsonFigma,
|
|
57
58
|
});
|
|
59
|
+
PrimerStyleDictionary.registerFormat({
|
|
60
|
+
name: 'json/llm-guidelines',
|
|
61
|
+
format: markdownLlmGuidelines,
|
|
62
|
+
});
|
|
58
63
|
/**
|
|
59
64
|
* Transformers
|
|
60
65
|
*
|
|
@@ -88,3 +93,4 @@ PrimerStyleDictionary.registerTransform(fontFamilyToCss);
|
|
|
88
93
|
PrimerStyleDictionary.registerTransform(fontFamilyToFigma);
|
|
89
94
|
PrimerStyleDictionary.registerTransform(gradientToCss);
|
|
90
95
|
PrimerStyleDictionary.registerPreprocessor(themeOverrides);
|
|
96
|
+
PrimerStyleDictionary.registerPreprocessor(inheritGroupProperties);
|
|
@@ -1,6 +1,27 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const borderValue: z.ZodObject<{
|
|
3
|
-
color: z.ZodUnion<readonly [z.ZodString, z.
|
|
3
|
+
color: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
4
|
+
colorSpace: z.ZodEnum<{
|
|
5
|
+
"display-p3": "display-p3";
|
|
6
|
+
srgb: "srgb";
|
|
7
|
+
rec2020: "rec2020";
|
|
8
|
+
"srgb-linear": "srgb-linear";
|
|
9
|
+
hsl: "hsl";
|
|
10
|
+
hwb: "hwb";
|
|
11
|
+
lab: "lab";
|
|
12
|
+
lch: "lch";
|
|
13
|
+
oklab: "oklab";
|
|
14
|
+
oklch: "oklch";
|
|
15
|
+
"a98-rgb": "a98-rgb";
|
|
16
|
+
"prophoto-rgb": "prophoto-rgb";
|
|
17
|
+
xyz: "xyz";
|
|
18
|
+
"xyz-d50": "xyz-d50";
|
|
19
|
+
"xyz-d65": "xyz-d65";
|
|
20
|
+
}>;
|
|
21
|
+
components: z.ZodTuple<[z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"none">]>, z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"none">]>, z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"none">]>], null>;
|
|
22
|
+
alpha: z.ZodOptional<z.ZodNumber>;
|
|
23
|
+
hex: z.ZodOptional<z.ZodString>;
|
|
24
|
+
}, z.core.$strict>, z.ZodString]>;
|
|
4
25
|
style: z.ZodEnum<{
|
|
5
26
|
inset: "inset";
|
|
6
27
|
solid: "solid";
|
|
@@ -11,13 +32,41 @@ export declare const borderValue: z.ZodObject<{
|
|
|
11
32
|
ridge: "ridge";
|
|
12
33
|
outset: "outset";
|
|
13
34
|
}>;
|
|
14
|
-
width: z.ZodUnion<readonly [z.
|
|
35
|
+
width: z.ZodUnion<readonly [z.ZodObject<{
|
|
36
|
+
value: z.ZodNumber;
|
|
37
|
+
unit: z.ZodEnum<{
|
|
38
|
+
em: "em";
|
|
39
|
+
px: "px";
|
|
40
|
+
rem: "rem";
|
|
41
|
+
}>;
|
|
42
|
+
}, z.core.$strict>, z.ZodString]>;
|
|
15
43
|
}, z.core.$strip>;
|
|
16
44
|
export declare const borderToken: z.ZodObject<{
|
|
17
45
|
$description: z.ZodOptional<z.ZodString>;
|
|
18
46
|
$deprecated: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>>;
|
|
19
47
|
$value: z.ZodUnion<readonly [z.ZodObject<{
|
|
20
|
-
color: z.ZodUnion<readonly [z.ZodString, z.
|
|
48
|
+
color: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
49
|
+
colorSpace: z.ZodEnum<{
|
|
50
|
+
"display-p3": "display-p3";
|
|
51
|
+
srgb: "srgb";
|
|
52
|
+
rec2020: "rec2020";
|
|
53
|
+
"srgb-linear": "srgb-linear";
|
|
54
|
+
hsl: "hsl";
|
|
55
|
+
hwb: "hwb";
|
|
56
|
+
lab: "lab";
|
|
57
|
+
lch: "lch";
|
|
58
|
+
oklab: "oklab";
|
|
59
|
+
oklch: "oklch";
|
|
60
|
+
"a98-rgb": "a98-rgb";
|
|
61
|
+
"prophoto-rgb": "prophoto-rgb";
|
|
62
|
+
xyz: "xyz";
|
|
63
|
+
"xyz-d50": "xyz-d50";
|
|
64
|
+
"xyz-d65": "xyz-d65";
|
|
65
|
+
}>;
|
|
66
|
+
components: z.ZodTuple<[z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"none">]>, z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"none">]>, z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"none">]>], null>;
|
|
67
|
+
alpha: z.ZodOptional<z.ZodNumber>;
|
|
68
|
+
hex: z.ZodOptional<z.ZodString>;
|
|
69
|
+
}, z.core.$strict>, z.ZodString]>;
|
|
21
70
|
style: z.ZodEnum<{
|
|
22
71
|
inset: "inset";
|
|
23
72
|
solid: "solid";
|
|
@@ -28,7 +77,20 @@ export declare const borderToken: z.ZodObject<{
|
|
|
28
77
|
ridge: "ridge";
|
|
29
78
|
outset: "outset";
|
|
30
79
|
}>;
|
|
31
|
-
width: z.ZodUnion<readonly [z.
|
|
80
|
+
width: z.ZodUnion<readonly [z.ZodObject<{
|
|
81
|
+
value: z.ZodNumber;
|
|
82
|
+
unit: z.ZodEnum<{
|
|
83
|
+
em: "em";
|
|
84
|
+
px: "px";
|
|
85
|
+
rem: "rem";
|
|
86
|
+
}>;
|
|
87
|
+
}, z.core.$strict>, z.ZodString]>;
|
|
32
88
|
}, z.core.$strip>, z.ZodString]>;
|
|
33
|
-
$type: z.ZodLiteral<"
|
|
89
|
+
$type: z.ZodLiteral<"number" | "border" | "color" | "fontFamily" | "fontWeight" | "transition" | "duration" | "dimension" | "gradient" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange" | "custom-string">;
|
|
90
|
+
$extensions: z.ZodOptional<z.ZodObject<{
|
|
91
|
+
'org.primer.llm': z.ZodOptional<z.ZodObject<{
|
|
92
|
+
usage: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
93
|
+
rules: z.ZodOptional<z.ZodString>;
|
|
94
|
+
}, z.core.$strip>>;
|
|
95
|
+
}, z.core.$strip>>;
|
|
34
96
|
}, z.core.$strict>;
|
|
@@ -2,10 +2,12 @@ import { z } from 'zod';
|
|
|
2
2
|
import { baseToken } from './baseToken.js';
|
|
3
3
|
import { referenceValue } from './referenceValue.js';
|
|
4
4
|
import { colorHexValue } from './colorHexValue.js';
|
|
5
|
+
import { colorW3cValue } from './colorW3cValue.js';
|
|
5
6
|
import { dimensionValue } from './dimensionValue.js';
|
|
6
7
|
import { tokenType } from './tokenType.js';
|
|
8
|
+
import { llmExtension } from './llmExtension.js';
|
|
7
9
|
export const borderValue = z.object({
|
|
8
|
-
color: z.union([colorHexValue, referenceValue]),
|
|
10
|
+
color: z.union([colorHexValue, colorW3cValue, referenceValue]),
|
|
9
11
|
style: z.enum(['solid', 'dashed', 'dotted', 'double', 'groove', 'ridge', 'outset', 'inset']),
|
|
10
12
|
width: z.union([dimensionValue, referenceValue]),
|
|
11
13
|
});
|
|
@@ -13,5 +15,10 @@ export const borderToken = baseToken
|
|
|
13
15
|
.extend({
|
|
14
16
|
$value: z.union([borderValue, referenceValue]),
|
|
15
17
|
$type: tokenType('border'),
|
|
18
|
+
$extensions: z
|
|
19
|
+
.object({
|
|
20
|
+
'org.primer.llm': llmExtension,
|
|
21
|
+
})
|
|
22
|
+
.optional(),
|
|
16
23
|
})
|
|
17
24
|
.strict();
|