@primer/primitives 11.4.1-rc.6196071f → 11.4.1-rc.7729391c
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/borderToken.d.ts +16 -2
- package/dist/build/schemas/dimensionToken.d.ts +8 -1
- package/dist/build/schemas/dimensionValue.d.ts +24 -1
- package/dist/build/schemas/dimensionValue.js +20 -1
- package/dist/build/schemas/shadowToken.d.ts +672 -84
- package/dist/build/schemas/typographyToken.d.ts +32 -4
- 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/utilities/parseDimension.d.ts +12 -0
- package/dist/build/transformers/utilities/parseDimension.js +31 -0
- package/dist/build/types/dimensionTokenValue.d.ts +9 -0
- 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 +20 -5
- package/dist/docs/functional/size/breakpoints.json +24 -6
- package/dist/docs/functional/size/radius.json +16 -4
- package/dist/docs/functional/size/size.json +60 -15
- package/dist/docs/functional/typography/typography.json +8 -2
- 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 +21 -6
- package/dist/styleLint/functional/size/breakpoints.json +24 -6
- package/dist/styleLint/functional/size/radius.json +17 -5
- package/dist/styleLint/functional/size/size-coarse.json +3 -3
- package/dist/styleLint/functional/size/size-fine.json +3 -3
- package/dist/styleLint/functional/size/size.json +111 -66
- package/dist/styleLint/functional/themes/dark-colorblind-high-contrast.json +27 -27
- package/dist/styleLint/functional/themes/dark-colorblind.json +27 -27
- package/dist/styleLint/functional/themes/dark-dimmed-high-contrast.json +27 -27
- package/dist/styleLint/functional/themes/dark-dimmed.json +27 -27
- package/dist/styleLint/functional/themes/dark-high-contrast.json +27 -27
- package/dist/styleLint/functional/themes/dark-tritanopia-high-contrast.json +27 -27
- package/dist/styleLint/functional/themes/dark-tritanopia.json +27 -27
- package/dist/styleLint/functional/themes/dark.json +27 -27
- package/dist/styleLint/functional/themes/light-colorblind-high-contrast.json +27 -27
- package/dist/styleLint/functional/themes/light-colorblind.json +27 -27
- package/dist/styleLint/functional/themes/light-high-contrast.json +27 -27
- package/dist/styleLint/functional/themes/light-tritanopia-high-contrast.json +27 -27
- package/dist/styleLint/functional/themes/light-tritanopia.json +27 -27
- package/dist/styleLint/functional/themes/light.json +27 -27
- package/dist/styleLint/functional/typography/typography.json +28 -22
- package/package.json +1 -1
- package/src/tokens/base/size/size.json5 +19 -19
- package/src/tokens/base/typography/typography.json5 +6 -6
- package/src/tokens/functional/size/border.json5 +5 -5
- package/src/tokens/functional/size/breakpoints.json5 +6 -6
- package/src/tokens/functional/size/radius.json5 +4 -4
- package/src/tokens/functional/size/size.json5 +15 -15
- package/src/tokens/functional/typography/typography.json5 +8 -4
- package/dist/removed/testing.json5 +0 -4
- package/src/tokens/removed/testing.json5 +0 -4
|
@@ -11,7 +11,14 @@ export declare const borderValue: z.ZodObject<{
|
|
|
11
11
|
ridge: "ridge";
|
|
12
12
|
outset: "outset";
|
|
13
13
|
}>;
|
|
14
|
-
width: z.ZodUnion<readonly [z.ZodUnion<readonly [z.
|
|
14
|
+
width: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
|
|
15
|
+
value: z.ZodNumber;
|
|
16
|
+
unit: z.ZodEnum<{
|
|
17
|
+
em: "em";
|
|
18
|
+
px: "px";
|
|
19
|
+
rem: "rem";
|
|
20
|
+
}>;
|
|
21
|
+
}, z.core.$strict>, z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"0">, z.ZodLiteral<0>]>]>, z.ZodString]>;
|
|
15
22
|
}, z.core.$strip>;
|
|
16
23
|
export declare const borderToken: z.ZodObject<{
|
|
17
24
|
$description: z.ZodOptional<z.ZodString>;
|
|
@@ -28,7 +35,14 @@ export declare const borderToken: z.ZodObject<{
|
|
|
28
35
|
ridge: "ridge";
|
|
29
36
|
outset: "outset";
|
|
30
37
|
}>;
|
|
31
|
-
width: z.ZodUnion<readonly [z.ZodUnion<readonly [z.
|
|
38
|
+
width: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
|
|
39
|
+
value: z.ZodNumber;
|
|
40
|
+
unit: z.ZodEnum<{
|
|
41
|
+
em: "em";
|
|
42
|
+
px: "px";
|
|
43
|
+
rem: "rem";
|
|
44
|
+
}>;
|
|
45
|
+
}, z.core.$strict>, z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"0">, z.ZodLiteral<0>]>]>, z.ZodString]>;
|
|
32
46
|
}, z.core.$strip>, z.ZodString]>;
|
|
33
47
|
$type: z.ZodLiteral<"string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "transition" | "dimension" | "duration" | "gradient" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange">;
|
|
34
48
|
$extensions: z.ZodOptional<z.ZodObject<{
|
|
@@ -2,7 +2,14 @@ import { z } from 'zod';
|
|
|
2
2
|
export declare const dimensionToken: z.ZodObject<{
|
|
3
3
|
$description: z.ZodOptional<z.ZodString>;
|
|
4
4
|
$deprecated: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>>;
|
|
5
|
-
$value: z.ZodUnion<readonly [z.ZodUnion<readonly [z.
|
|
5
|
+
$value: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
|
|
6
|
+
value: z.ZodNumber;
|
|
7
|
+
unit: z.ZodEnum<{
|
|
8
|
+
em: "em";
|
|
9
|
+
px: "px";
|
|
10
|
+
rem: "rem";
|
|
11
|
+
}>;
|
|
12
|
+
}, z.core.$strict>, z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"0">, z.ZodLiteral<0>]>]>, z.ZodString]>;
|
|
6
13
|
$type: z.ZodLiteral<"string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "transition" | "dimension" | "duration" | "gradient" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange">;
|
|
7
14
|
$extensions: z.ZodOptional<z.ZodObject<{
|
|
8
15
|
'org.primer.figma': z.ZodOptional<z.ZodObject<{
|
|
@@ -1,2 +1,25 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* W3C DTCG dimension value format
|
|
4
|
+
* @link https://www.designtokens.org/tr/drafts/format/#dimension
|
|
5
|
+
*/
|
|
6
|
+
export declare const dimensionValueObject: z.ZodObject<{
|
|
7
|
+
value: z.ZodNumber;
|
|
8
|
+
unit: z.ZodEnum<{
|
|
9
|
+
em: "em";
|
|
10
|
+
px: "px";
|
|
11
|
+
rem: "rem";
|
|
12
|
+
}>;
|
|
13
|
+
}, z.core.$strict>;
|
|
14
|
+
/**
|
|
15
|
+
* Dimension value - supports both W3C DTCG object format and legacy string format
|
|
16
|
+
* Note: Transformers only accept W3C format, but schema validates both for migration period
|
|
17
|
+
*/
|
|
18
|
+
export declare const dimensionValue: z.ZodUnion<readonly [z.ZodObject<{
|
|
19
|
+
value: z.ZodNumber;
|
|
20
|
+
unit: z.ZodEnum<{
|
|
21
|
+
em: "em";
|
|
22
|
+
px: "px";
|
|
23
|
+
rem: "rem";
|
|
24
|
+
}>;
|
|
25
|
+
}, z.core.$strict>, z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"0">, z.ZodLiteral<0>]>]>;
|
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { schemaErrorMessage } from '../utilities/index.js';
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* W3C DTCG dimension value format
|
|
5
|
+
* @link https://www.designtokens.org/tr/drafts/format/#dimension
|
|
6
|
+
*/
|
|
7
|
+
export const dimensionValueObject = z
|
|
8
|
+
.object({
|
|
9
|
+
value: z.number(),
|
|
10
|
+
unit: z.enum(['px', 'rem', 'em']),
|
|
11
|
+
})
|
|
12
|
+
.strict();
|
|
13
|
+
/**
|
|
14
|
+
* Legacy dimension value format (string with unit)
|
|
15
|
+
* @deprecated Use W3C DTCG object format instead
|
|
16
|
+
*/
|
|
17
|
+
const dimensionValueLegacy = z.union([
|
|
4
18
|
z.string().superRefine((dim, ctx) => {
|
|
5
19
|
if (!/(^-?[0-9]+\.?[0-9]*(px|rem)$|^-?[0-9]+\.?[0-9]*em$)/.test(dim)) {
|
|
6
20
|
ctx.addIssue({
|
|
@@ -12,3 +26,8 @@ export const dimensionValue = z.union([
|
|
|
12
26
|
z.literal('0'),
|
|
13
27
|
z.literal(0),
|
|
14
28
|
]);
|
|
29
|
+
/**
|
|
30
|
+
* Dimension value - supports both W3C DTCG object format and legacy string format
|
|
31
|
+
* Note: Transformers only accept W3C format, but schema validates both for migration period
|
|
32
|
+
*/
|
|
33
|
+
export const dimensionValue = z.union([dimensionValueObject, dimensionValueLegacy]);
|