@primer/primitives 11.4.1-rc.edbe0e39 → 11.5.0-rc.27b40184
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_SPEC.md +14 -5
- package/dist/build/schemas/borderToken.d.ts +45 -3
- package/dist/build/schemas/borderToken.js +2 -1
- package/dist/build/schemas/colorToken.d.ts +639 -30
- package/dist/build/schemas/colorToken.js +3 -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 +1 -1
- package/dist/build/schemas/dimensionToken.d.ts +1 -1
- package/dist/build/schemas/durationToken.d.ts +1 -1
- package/dist/build/schemas/fontFamilyToken.d.ts +1 -1
- package/dist/build/schemas/fontWeightToken.d.ts +1 -1
- package/dist/build/schemas/gradientToken.d.ts +23 -2
- package/dist/build/schemas/gradientToken.js +2 -1
- package/dist/build/schemas/numberToken.d.ts +1 -1
- package/dist/build/schemas/shadowToken.d.ts +1079 -43
- package/dist/build/schemas/shadowToken.js +8 -2
- package/dist/build/schemas/stringToken.d.ts +1 -1
- package/dist/build/schemas/tokenType.d.ts +1 -1
- package/dist/build/schemas/transitionToken.d.ts +1 -1
- package/dist/build/schemas/typographyToken.d.ts +1 -1
- package/dist/build/schemas/viewportRangeToken.d.ts +1 -1
- package/dist/build/transformers/borderToCss.js +3 -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/durationToCss.js +4 -4
- package/dist/build/transformers/gradientToCss.js +2 -1
- package/dist/build/transformers/shadowToCss.js +4 -1
- package/dist/build/transformers/utilities/normalizeColorValue.d.ts +23 -0
- package/dist/build/transformers/utilities/normalizeColorValue.js +74 -0
- package/dist/build/types/borderTokenValue.d.ts +2 -1
- package/dist/build/types/shadowTokenValue.d.ts +2 -1
- package/dist/css/base/motion/motion.css +1 -1
- package/dist/css/functional/size/radius.css +1 -1
- package/dist/css/functional/size/size-coarse.css +1 -0
- package/dist/css/functional/size/size-fine.css +1 -0
- package/dist/css/functional/size/size.css +5 -0
- package/dist/css/functional/themes/dark-colorblind-high-contrast.css +22 -10
- package/dist/css/functional/themes/dark-colorblind.css +22 -10
- package/dist/css/functional/themes/dark-dimmed-high-contrast.css +22 -10
- package/dist/css/functional/themes/dark-dimmed.css +22 -10
- package/dist/css/functional/themes/dark-high-contrast.css +22 -10
- package/dist/css/functional/themes/dark-tritanopia-high-contrast.css +22 -10
- package/dist/css/functional/themes/dark-tritanopia.css +22 -10
- package/dist/css/functional/themes/dark.css +22 -10
- package/dist/css/functional/themes/light-colorblind-high-contrast.css +14 -2
- package/dist/css/functional/themes/light-colorblind.css +20 -8
- package/dist/css/functional/themes/light-high-contrast.css +14 -2
- package/dist/css/functional/themes/light-tritanopia-high-contrast.css +14 -2
- package/dist/css/functional/themes/light-tritanopia.css +20 -8
- package/dist/css/functional/themes/light.css +20 -8
- package/dist/docs/functional/size/radius.json +2 -2
- package/dist/docs/functional/size/size-coarse.json +55 -2
- package/dist/docs/functional/size/size-fine.json +55 -2
- package/dist/docs/functional/size/size.json +135 -0
- package/dist/docs/functional/themes/dark-colorblind-high-contrast.json +2502 -372
- package/dist/docs/functional/themes/dark-colorblind.json +2492 -370
- package/dist/docs/functional/themes/dark-dimmed-high-contrast.json +2355 -205
- package/dist/docs/functional/themes/dark-dimmed.json +2382 -212
- package/dist/docs/functional/themes/dark-high-contrast.json +2507 -373
- package/dist/docs/functional/themes/dark-tritanopia-high-contrast.json +2517 -375
- package/dist/docs/functional/themes/dark-tritanopia.json +2499 -353
- package/dist/docs/functional/themes/dark.json +2501 -371
- package/dist/docs/functional/themes/light-colorblind-high-contrast.json +2354 -204
- package/dist/docs/functional/themes/light-colorblind.json +2344 -202
- package/dist/docs/functional/themes/light-high-contrast.json +2359 -205
- package/dist/docs/functional/themes/light-tritanopia-high-contrast.json +2359 -205
- package/dist/docs/functional/themes/light-tritanopia.json +2354 -204
- package/dist/docs/functional/themes/light.json +2359 -205
- package/dist/fallbacks/functional/size/size-coarse.json +2 -1
- package/dist/fallbacks/functional/size/size-fine.json +2 -1
- package/dist/fallbacks/functional/size/size.json +5 -0
- package/dist/figma/dimension/dimension.json +56 -1
- package/dist/figma/themes/dark-colorblind.json +49 -1
- package/dist/figma/themes/dark-dimmed.json +51 -3
- package/dist/figma/themes/dark-high-contrast.json +49 -1
- package/dist/figma/themes/dark-tritanopia.json +49 -1
- package/dist/figma/themes/dark.json +49 -1
- package/dist/figma/themes/light-colorblind.json +49 -1
- package/dist/figma/themes/light-high-contrast.json +49 -1
- package/dist/figma/themes/light-tritanopia.json +49 -1
- package/dist/figma/themes/light.json +49 -1
- package/dist/internalCss/dark-colorblind-high-contrast.css +22 -10
- package/dist/internalCss/dark-colorblind.css +22 -10
- package/dist/internalCss/dark-dimmed-high-contrast.css +22 -10
- package/dist/internalCss/dark-dimmed.css +22 -10
- package/dist/internalCss/dark-high-contrast.css +22 -10
- package/dist/internalCss/dark-tritanopia-high-contrast.css +22 -10
- package/dist/internalCss/dark-tritanopia.css +22 -10
- package/dist/internalCss/dark.css +22 -10
- package/dist/internalCss/light-colorblind-high-contrast.css +14 -2
- package/dist/internalCss/light-colorblind.css +20 -8
- package/dist/internalCss/light-high-contrast.css +14 -2
- package/dist/internalCss/light-tritanopia-high-contrast.css +14 -2
- package/dist/internalCss/light-tritanopia.css +20 -8
- package/dist/internalCss/light.css +20 -8
- package/dist/styleLint/functional/size/radius.json +2 -2
- package/dist/styleLint/functional/size/size-coarse.json +57 -4
- package/dist/styleLint/functional/size/size-fine.json +57 -4
- package/dist/styleLint/functional/size/size.json +135 -0
- package/dist/styleLint/functional/themes/dark-colorblind-high-contrast.json +2491 -349
- package/dist/styleLint/functional/themes/dark-colorblind.json +2481 -347
- package/dist/styleLint/functional/themes/dark-dimmed-high-contrast.json +2516 -354
- package/dist/styleLint/functional/themes/dark-dimmed.json +2543 -361
- package/dist/styleLint/functional/themes/dark-high-contrast.json +2496 -350
- package/dist/styleLint/functional/themes/dark-tritanopia-high-contrast.json +2506 -352
- package/dist/styleLint/functional/themes/dark-tritanopia.json +2511 -353
- package/dist/styleLint/functional/themes/dark.json +2491 -349
- package/dist/styleLint/functional/themes/light-colorblind-high-contrast.json +2514 -352
- package/dist/styleLint/functional/themes/light-colorblind.json +2505 -351
- package/dist/styleLint/functional/themes/light-high-contrast.json +2371 -205
- package/dist/styleLint/functional/themes/light-tritanopia-high-contrast.json +2519 -353
- package/dist/styleLint/functional/themes/light-tritanopia.json +2515 -353
- package/dist/styleLint/functional/themes/light.json +2520 -354
- package/package.json +4 -3
- package/src/tokens/base/color/dark/dark.dimmed.json5 +405 -81
- package/src/tokens/base/color/dark/dark.high-contrast.json5 +405 -81
- package/src/tokens/base/color/dark/dark.json5 +475 -95
- package/src/tokens/base/color/dark/display-dark.json5 +960 -192
- package/src/tokens/base/color/light/display-light.json5 +960 -192
- package/src/tokens/base/color/light/light.high-contrast.json5 +405 -81
- package/src/tokens/base/color/light/light.json5 +475 -95
- package/src/tokens/base/size/size.json5 +194 -194
- package/src/tokens/component/button.json5 +368 -65
- package/src/tokens/component/reactionButton.json5 +20 -4
- package/src/tokens/functional/border/border.json5 +29 -1
- package/src/tokens/functional/color/bgColor.json5 +10 -2
- package/src/tokens/functional/color/borderColor.json5 +8 -1
- package/src/tokens/functional/color/control.json5 +160 -32
- package/src/tokens/functional/color/fgColor.json5 +5 -1
- package/src/tokens/functional/color/syntax.json5 +10 -2
- package/src/tokens/functional/shadow/shadow.json5 +576 -0
- package/src/tokens/functional/size/radius.json5 +1 -1
- package/src/tokens/functional/size/size-coarse.json5 +15 -0
- package/src/tokens/functional/size/size-fine.json5 +15 -0
- package/src/tokens/functional/size/size.json5 +50 -0
package/DESIGN_TOKENS_SPEC.md
CHANGED
|
@@ -101,6 +101,12 @@ Composite border tokens combining color, width, and style.
|
|
|
101
101
|
|
|
102
102
|
**Tokens:** border-default, border-disabled, border-emphasis, border-muted, border-transparent
|
|
103
103
|
|
|
104
|
+
### draft
|
|
105
|
+
**Tokens:** border-draft-emphasis, border-draft-muted
|
|
106
|
+
|
|
107
|
+
### border-translucent
|
|
108
|
+
Semi-transparent border shorthand for overlays and layered elements. Border-specific token — no bgColor-translucent counterpart exists by design.
|
|
109
|
+
|
|
104
110
|
## Border Colors
|
|
105
111
|
|
|
106
112
|
Border color tokens for boundaries, dividers, and outlines.
|
|
@@ -140,10 +146,15 @@ Subtle border for secondary elements and light separators
|
|
|
140
146
|
**R:** Use for subtle borders and separators. Less prominent than border.default.
|
|
141
147
|
|
|
142
148
|
### borderColor-translucent
|
|
143
|
-
Semi-transparent border for overlays and layered elements
|
|
149
|
+
Semi-transparent border for overlays and layered elements. Border-specific token — no bgColor-translucent counterpart exists by design.
|
|
144
150
|
**U:** overlay-border, translucent-border
|
|
145
151
|
**R:** Use for semi-transparent borders on overlays. Works well with translucent backgrounds.
|
|
146
152
|
|
|
153
|
+
### borderColor-transparent
|
|
154
|
+
Fully transparent border
|
|
155
|
+
**U:** border-color, border-styling
|
|
156
|
+
**R:** These are COLOR-ONLY tokens (resolve to a hex value like #cf222e). Use for the CSS `border-color` property. Do NOT use for the CSS `border` shorthand — use border.* tokens instead.
|
|
157
|
+
|
|
147
158
|
## Border Radius
|
|
148
159
|
|
|
149
160
|
Corner radius tokens for rounded elements.
|
|
@@ -154,7 +165,7 @@ Use this border radius for pill shaped elements
|
|
|
154
165
|
**R:** Use for avatars and pill-shaped elements. Do NOT use for rectangular containers.
|
|
155
166
|
|
|
156
167
|
### borderRadius-large
|
|
157
|
-
Large border radius (12px). Use for larger containers, dialogs, or when more visual softness is desired.
|
|
168
|
+
Large border radius (12px). Use for larger containers, dialogs, or when more visual softness is desired.
|
|
158
169
|
**U:** card, dialog, modal
|
|
159
170
|
**R:** Recommended for dialogs and modals.
|
|
160
171
|
|
|
@@ -222,9 +233,7 @@ Tokens for interactive controls like buttons, inputs, and selects.
|
|
|
222
233
|
**Scale:** Use xsmall/small for dense layouts, medium for default UI, large/xlarge for prominent CTAs.
|
|
223
234
|
|
|
224
235
|
**Size patterns:**
|
|
225
|
-
- `control-[xsmall, small, medium, large, xlarge]-[gap, lineBoxHeight, paddingBlock, paddingInline-normal, size]`
|
|
226
|
-
- `control-[xsmall, medium, large, xlarge]-paddingInline-spacious`
|
|
227
|
-
- `control-[xsmall, small, medium]-paddingInline-condensed`
|
|
236
|
+
- `control-[xsmall, small, medium, large, xlarge]-[gap, lineBoxHeight, paddingBlock, paddingInline-condensed, paddingInline-normal, paddingInline-spacious, size]`
|
|
228
237
|
|
|
229
238
|
**State variants:**
|
|
230
239
|
- `control-checked-[bgColor-active, bgColor-disabled, bgColor-hover, bgColor-rest, borderColor-active, borderColor-disabled, borderColor-hover, borderColor-rest, fgColor-disabled, fgColor-rest]`
|
|
@@ -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";
|
|
@@ -24,7 +45,28 @@ export declare const borderToken: z.ZodObject<{
|
|
|
24
45
|
$description: z.ZodOptional<z.ZodString>;
|
|
25
46
|
$deprecated: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>>;
|
|
26
47
|
$value: z.ZodUnion<readonly [z.ZodObject<{
|
|
27
|
-
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]>;
|
|
28
70
|
style: z.ZodEnum<{
|
|
29
71
|
inset: "inset";
|
|
30
72
|
solid: "solid";
|
|
@@ -44,7 +86,7 @@ export declare const borderToken: z.ZodObject<{
|
|
|
44
86
|
}>;
|
|
45
87
|
}, z.core.$strict>, z.ZodString]>;
|
|
46
88
|
}, z.core.$strip>, z.ZodString]>;
|
|
47
|
-
$type: z.ZodLiteral<"number" | "border" | "color" | "fontFamily" | "fontWeight" | "transition" | "
|
|
89
|
+
$type: z.ZodLiteral<"number" | "border" | "color" | "fontFamily" | "fontWeight" | "transition" | "duration" | "dimension" | "gradient" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange" | "custom-string">;
|
|
48
90
|
$extensions: z.ZodOptional<z.ZodObject<{
|
|
49
91
|
'org.primer.llm': z.ZodOptional<z.ZodObject<{
|
|
50
92
|
usage: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -2,11 +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';
|
|
7
8
|
import { llmExtension } from './llmExtension.js';
|
|
8
9
|
export const borderValue = z.object({
|
|
9
|
-
color: z.union([colorHexValue, referenceValue]),
|
|
10
|
+
color: z.union([colorHexValue, colorW3cValue, referenceValue]),
|
|
10
11
|
style: z.enum(['solid', 'dashed', 'dotted', 'double', 'groove', 'ridge', 'outset', 'inset']),
|
|
11
12
|
width: z.union([dimensionValue, referenceValue]),
|
|
12
13
|
});
|