@primer/primitives 11.1.0-rc.f0583fc7 → 11.2.0-rc.1012e204
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/schemas/alphaValue.d.ts +1 -1
- package/dist/build/schemas/alphaValue.js +8 -3
- package/dist/build/schemas/baseToken.d.ts +2 -8
- package/dist/build/schemas/borderToken.d.ts +30 -47
- package/dist/build/schemas/collections.d.ts +2 -2
- package/dist/build/schemas/collections.js +16 -6
- package/dist/build/schemas/colorHexValue.d.ts +1 -1
- package/dist/build/schemas/colorHexValue.js +8 -3
- package/dist/build/schemas/colorToken.d.ts +81 -789
- package/dist/build/schemas/colorToken.js +1 -1
- package/dist/build/schemas/cubicBezierToken.d.ts +4 -15
- package/dist/build/schemas/designToken.d.ts +1 -1
- package/dist/build/schemas/dimensionToken.d.ts +8 -53
- package/dist/build/schemas/dimensionValue.d.ts +1 -1
- package/dist/build/schemas/dimensionValue.js +8 -3
- package/dist/build/schemas/durationToken.d.ts +4 -15
- package/dist/build/schemas/durationValue.d.ts +1 -1
- package/dist/build/schemas/durationValue.js +8 -3
- package/dist/build/schemas/fontFamilyToken.d.ts +8 -47
- package/dist/build/schemas/fontWeightToken.d.ts +8 -47
- package/dist/build/schemas/fontWeightValue.d.ts +1 -1
- package/dist/build/schemas/fontWeightValue.js +8 -3
- package/dist/build/schemas/gradientToken.d.ts +8 -53
- package/dist/build/schemas/numberToken.d.ts +9 -64
- package/dist/build/schemas/referenceValue.d.ts +1 -1
- package/dist/build/schemas/referenceValue.js +8 -3
- package/dist/build/schemas/scopes.d.ts +1 -1
- package/dist/build/schemas/scopes.js +8 -3
- package/dist/build/schemas/shadowToken.d.ts +210 -2136
- package/dist/build/schemas/shadowToken.js +0 -9
- package/dist/build/schemas/stringToken.d.ts +4 -15
- package/dist/build/schemas/tokenName.d.ts +1 -1
- package/dist/build/schemas/tokenName.js +8 -3
- package/dist/build/schemas/transitionToken.d.ts +8 -35
- package/dist/build/schemas/typographyToken.d.ts +14 -55
- package/dist/build/schemas/validTokenType.d.ts +1 -1
- package/dist/build/schemas/validTokenType.js +8 -3
- package/dist/build/schemas/viewportRangeToken.d.ts +4 -15
- package/dist/build/types/tokenBuildInput.d.ts +2 -0
- package/dist/build/utilities/log.js +0 -3
- package/dist/css/functional/themes/dark-colorblind-high-contrast.css +30 -0
- package/dist/css/functional/themes/dark-colorblind.css +30 -0
- package/dist/css/functional/themes/dark-dimmed-high-contrast.css +30 -0
- package/dist/css/functional/themes/dark-dimmed.css +30 -0
- package/dist/css/functional/themes/dark-high-contrast.css +30 -0
- package/dist/css/functional/themes/dark-tritanopia-high-contrast.css +30 -0
- package/dist/css/functional/themes/dark-tritanopia.css +30 -0
- package/dist/css/functional/themes/dark.css +30 -0
- package/dist/css/functional/themes/light-colorblind-high-contrast.css +30 -0
- package/dist/css/functional/themes/light-colorblind.css +30 -0
- package/dist/css/functional/themes/light-high-contrast.css +30 -0
- package/dist/css/functional/themes/light-tritanopia-high-contrast.css +30 -0
- package/dist/css/functional/themes/light-tritanopia.css +30 -0
- package/dist/css/functional/themes/light.css +30 -0
- package/dist/docs/functional/themes/dark-colorblind-high-contrast.json +693 -0
- package/dist/docs/functional/themes/dark-colorblind.json +693 -0
- package/dist/docs/functional/themes/dark-dimmed-high-contrast.json +689 -0
- package/dist/docs/functional/themes/dark-dimmed.json +689 -0
- package/dist/docs/functional/themes/dark-high-contrast.json +689 -0
- package/dist/docs/functional/themes/dark-tritanopia-high-contrast.json +691 -0
- package/dist/docs/functional/themes/dark-tritanopia.json +693 -0
- package/dist/docs/functional/themes/dark.json +689 -0
- package/dist/docs/functional/themes/light-colorblind-high-contrast.json +691 -0
- package/dist/docs/functional/themes/light-colorblind.json +691 -0
- package/dist/docs/functional/themes/light-high-contrast.json +689 -0
- package/dist/docs/functional/themes/light-tritanopia-high-contrast.json +691 -0
- package/dist/docs/functional/themes/light-tritanopia.json +691 -0
- package/dist/docs/functional/themes/light.json +689 -0
- package/dist/figma/figma.json +4 -14
- package/dist/figma/themes/dark-colorblind.json +257 -0
- package/dist/figma/themes/dark-dimmed.json +255 -0
- package/dist/figma/themes/dark-high-contrast.json +255 -0
- package/dist/figma/themes/dark-tritanopia.json +257 -0
- package/dist/figma/themes/dark.json +255 -0
- package/dist/figma/themes/light-colorblind.json +256 -0
- package/dist/figma/themes/light-high-contrast.json +255 -0
- package/dist/figma/themes/light-tritanopia.json +256 -0
- package/dist/figma/themes/light.json +255 -0
- package/dist/internalCss/dark-colorblind-high-contrast.css +30 -0
- package/dist/internalCss/dark-colorblind.css +30 -0
- package/dist/internalCss/dark-dimmed-high-contrast.css +30 -0
- package/dist/internalCss/dark-dimmed.css +30 -0
- package/dist/internalCss/dark-high-contrast.css +30 -0
- package/dist/internalCss/dark-tritanopia-high-contrast.css +30 -0
- package/dist/internalCss/dark-tritanopia.css +30 -0
- package/dist/internalCss/dark.css +30 -0
- package/dist/internalCss/light-colorblind-high-contrast.css +30 -0
- package/dist/internalCss/light-colorblind.css +30 -0
- package/dist/internalCss/light-high-contrast.css +30 -0
- package/dist/internalCss/light-tritanopia-high-contrast.css +30 -0
- package/dist/internalCss/light-tritanopia.css +30 -0
- package/dist/internalCss/light.css +30 -0
- package/dist/styleLint/functional/themes/dark-colorblind-high-contrast.json +693 -0
- package/dist/styleLint/functional/themes/dark-colorblind.json +693 -0
- package/dist/styleLint/functional/themes/dark-dimmed-high-contrast.json +689 -0
- package/dist/styleLint/functional/themes/dark-dimmed.json +689 -0
- package/dist/styleLint/functional/themes/dark-high-contrast.json +689 -0
- package/dist/styleLint/functional/themes/dark-tritanopia-high-contrast.json +691 -0
- package/dist/styleLint/functional/themes/dark-tritanopia.json +693 -0
- package/dist/styleLint/functional/themes/dark.json +689 -0
- package/dist/styleLint/functional/themes/light-colorblind-high-contrast.json +691 -0
- package/dist/styleLint/functional/themes/light-colorblind.json +691 -0
- package/dist/styleLint/functional/themes/light-high-contrast.json +689 -0
- package/dist/styleLint/functional/themes/light-tritanopia-high-contrast.json +691 -0
- package/dist/styleLint/functional/themes/light-tritanopia.json +691 -0
- package/dist/styleLint/functional/themes/light.json +689 -0
- package/package.json +16 -16
- package/src/tokens/component/progressBar.json5 +145 -0
- package/src/tokens/functional/color/bgColor.json5 +48 -0
- package/src/tokens/functional/color/borderColor.json5 +64 -0
- package/src/tokens/functional/color/fgColor.json5 +14 -0
- package/dist/figma/themes/dark-colorblind-high-contrast.json +0 -14181
- package/dist/figma/themes/dark-dimmed-high-contrast.json +0 -14175
- package/dist/figma/themes/dark-tritanopia-high-contrast.json +0 -14177
- package/dist/figma/themes/light-colorblind-high-contrast.json +0 -14161
- package/dist/figma/themes/light-tritanopia-high-contrast.json +0 -14160
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export declare const alphaValue: z.
|
|
2
|
+
export declare const alphaValue: z.ZodAny;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { schemaErrorMessage } from '../utilities/index.js';
|
|
3
|
-
export const alphaValue = z.any().
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
export const alphaValue = z.any().superRefine((value, ctx) => {
|
|
4
|
+
if (!(typeof value === 'number' && value >= 0 && value <= 1)) {
|
|
5
|
+
ctx.addIssue({
|
|
6
|
+
code: z.ZodIssueCode.custom,
|
|
7
|
+
message: schemaErrorMessage(`Invalid alpha value: "${value}" (${typeof value})`, 'Alpha value must be a number between 0 and 1.'),
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
});
|
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const baseToken: z.ZodObject<{
|
|
3
3
|
$description: z.ZodOptional<z.ZodString>;
|
|
4
|
-
$deprecated: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>;
|
|
5
|
-
},
|
|
6
|
-
$description?: string | undefined;
|
|
7
|
-
$deprecated?: string | boolean | undefined;
|
|
8
|
-
}, {
|
|
9
|
-
$description?: string | undefined;
|
|
10
|
-
$deprecated?: string | boolean | undefined;
|
|
11
|
-
}>;
|
|
4
|
+
$deprecated: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>>;
|
|
5
|
+
}, z.core.$strict>;
|
|
@@ -1,51 +1,34 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const borderValue: z.ZodObject<{
|
|
3
|
-
color: z.ZodUnion<[z.
|
|
4
|
-
style: z.ZodEnum<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
3
|
+
color: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
|
|
4
|
+
style: z.ZodEnum<{
|
|
5
|
+
inset: "inset";
|
|
6
|
+
solid: "solid";
|
|
7
|
+
dashed: "dashed";
|
|
8
|
+
dotted: "dotted";
|
|
9
|
+
double: "double";
|
|
10
|
+
groove: "groove";
|
|
11
|
+
ridge: "ridge";
|
|
12
|
+
outset: "outset";
|
|
13
|
+
}>;
|
|
14
|
+
width: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"0">, z.ZodLiteral<0>]>, z.ZodString]>;
|
|
15
|
+
}, z.core.$strip>;
|
|
16
|
+
export declare const borderToken: z.ZodObject<{
|
|
16
17
|
$description: z.ZodOptional<z.ZodString>;
|
|
17
|
-
$deprecated: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
18
|
+
$deprecated: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>>;
|
|
19
|
+
$value: z.ZodUnion<readonly [z.ZodObject<{
|
|
20
|
+
color: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
|
|
21
|
+
style: z.ZodEnum<{
|
|
22
|
+
inset: "inset";
|
|
23
|
+
solid: "solid";
|
|
24
|
+
dashed: "dashed";
|
|
25
|
+
dotted: "dotted";
|
|
26
|
+
double: "double";
|
|
27
|
+
groove: "groove";
|
|
28
|
+
ridge: "ridge";
|
|
29
|
+
outset: "outset";
|
|
30
|
+
}>;
|
|
31
|
+
width: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"0">, z.ZodLiteral<0>]>, z.ZodString]>;
|
|
32
|
+
}, z.core.$strip>, z.ZodString]>;
|
|
32
33
|
$type: z.ZodLiteral<"string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "transition" | "dimension" | "duration" | "gradient" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange">;
|
|
33
|
-
}
|
|
34
|
-
$value: string | {
|
|
35
|
-
width: string | 0;
|
|
36
|
-
color: string;
|
|
37
|
-
style: "inset" | "solid" | "dashed" | "dotted" | "double" | "groove" | "ridge" | "outset";
|
|
38
|
-
};
|
|
39
|
-
$type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "transition" | "dimension" | "duration" | "gradient" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange";
|
|
40
|
-
$description?: string | undefined;
|
|
41
|
-
$deprecated?: string | boolean | undefined;
|
|
42
|
-
}, {
|
|
43
|
-
$value: string | {
|
|
44
|
-
width: string | 0;
|
|
45
|
-
color: string;
|
|
46
|
-
style: "inset" | "solid" | "dashed" | "dotted" | "double" | "groove" | "ridge" | "outset";
|
|
47
|
-
};
|
|
48
|
-
$type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "transition" | "dimension" | "duration" | "gradient" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange";
|
|
49
|
-
$description?: string | undefined;
|
|
50
|
-
$deprecated?: string | boolean | undefined;
|
|
51
|
-
}>;
|
|
34
|
+
}, z.core.$strict>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
type Collections = 'base/color/light' | 'base/color/light-high-contrast' | 'base/color/dark' | 'base/color/dark-dimmed' | 'base/color/dark-high-contrast' | 'base/typography' | 'mode' | 'pattern/mode' | 'base/size' | 'functional/size' | 'pattern/size' | 'typography';
|
|
3
|
-
export declare const collection: (collections: Collections[]) => z.
|
|
3
|
+
export declare const collection: (collections: Collections[]) => z.ZodString;
|
|
4
4
|
type Modes = 'light' | 'dark' | 'dark dimmed' | 'dark dimmed high contrast' | 'light high contrast' | 'dark high contrast' | 'light protanopia deuteranopia' | 'dark protanopia deuteranopia' | 'light tritanopia' | 'dark tritanopia' | 'light high contrast protanopia deuteranopia' | 'dark high contrast protanopia deuteranopia' | 'light high contrast tritanopia' | 'dark high contrast tritanopia';
|
|
5
|
-
export declare const mode: (modes: Modes[]) => z.
|
|
5
|
+
export declare const mode: (modes: Modes[]) => z.ZodString;
|
|
6
6
|
export {};
|
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { joinFriendly, schemaErrorMessage } from '../utilities/index.js';
|
|
3
3
|
export const collection = (collections) => {
|
|
4
|
-
return z.string().
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
return z.string().superRefine((value, ctx) => {
|
|
5
|
+
if (!collections.includes(value)) {
|
|
6
|
+
ctx.addIssue({
|
|
7
|
+
code: 'custom',
|
|
8
|
+
message: schemaErrorMessage(`Invalid collection: "${value}"`, `Valid collections are ${joinFriendly(collections)}`),
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
});
|
|
7
12
|
};
|
|
8
13
|
export const mode = (modes) => {
|
|
9
|
-
return z.string().
|
|
10
|
-
|
|
11
|
-
|
|
14
|
+
return z.string().superRefine((value, ctx) => {
|
|
15
|
+
if (!modes.includes(value)) {
|
|
16
|
+
ctx.addIssue({
|
|
17
|
+
code: 'custom',
|
|
18
|
+
message: schemaErrorMessage(`Invalid mode: "${value}"`, `Valid modes are ${joinFriendly(modes)}`),
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
});
|
|
12
22
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export declare const colorHexValue: z.
|
|
2
|
+
export declare const colorHexValue: z.ZodString;
|
|
@@ -4,6 +4,11 @@ const colorHex3RegEx = '^#[0-9a-f]{3}$';
|
|
|
4
4
|
const colorHex6RegEx = '^#[0-9a-f]{6}$';
|
|
5
5
|
const colorHex8RegEx = '^#[0-9a-f]{8}$';
|
|
6
6
|
const colorHexRegex = new RegExp(`(${colorHex3RegEx})|(${colorHex6RegEx})|(${colorHex8RegEx})`, 'i');
|
|
7
|
-
export const colorHexValue = z.string().
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
export const colorHexValue = z.string().superRefine((color, ctx) => {
|
|
8
|
+
if (!colorHexRegex.test(color)) {
|
|
9
|
+
ctx.addIssue({
|
|
10
|
+
code: 'custom',
|
|
11
|
+
message: schemaErrorMessage(`Invalid color: "${color}"`, 'Color must be a hex string or a reference to a color token.'),
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
});
|