@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.
Files changed (116) hide show
  1. package/dist/build/schemas/alphaValue.d.ts +1 -1
  2. package/dist/build/schemas/alphaValue.js +8 -3
  3. package/dist/build/schemas/baseToken.d.ts +2 -8
  4. package/dist/build/schemas/borderToken.d.ts +30 -47
  5. package/dist/build/schemas/collections.d.ts +2 -2
  6. package/dist/build/schemas/collections.js +16 -6
  7. package/dist/build/schemas/colorHexValue.d.ts +1 -1
  8. package/dist/build/schemas/colorHexValue.js +8 -3
  9. package/dist/build/schemas/colorToken.d.ts +81 -789
  10. package/dist/build/schemas/colorToken.js +1 -1
  11. package/dist/build/schemas/cubicBezierToken.d.ts +4 -15
  12. package/dist/build/schemas/designToken.d.ts +1 -1
  13. package/dist/build/schemas/dimensionToken.d.ts +8 -53
  14. package/dist/build/schemas/dimensionValue.d.ts +1 -1
  15. package/dist/build/schemas/dimensionValue.js +8 -3
  16. package/dist/build/schemas/durationToken.d.ts +4 -15
  17. package/dist/build/schemas/durationValue.d.ts +1 -1
  18. package/dist/build/schemas/durationValue.js +8 -3
  19. package/dist/build/schemas/fontFamilyToken.d.ts +8 -47
  20. package/dist/build/schemas/fontWeightToken.d.ts +8 -47
  21. package/dist/build/schemas/fontWeightValue.d.ts +1 -1
  22. package/dist/build/schemas/fontWeightValue.js +8 -3
  23. package/dist/build/schemas/gradientToken.d.ts +8 -53
  24. package/dist/build/schemas/numberToken.d.ts +9 -64
  25. package/dist/build/schemas/referenceValue.d.ts +1 -1
  26. package/dist/build/schemas/referenceValue.js +8 -3
  27. package/dist/build/schemas/scopes.d.ts +1 -1
  28. package/dist/build/schemas/scopes.js +8 -3
  29. package/dist/build/schemas/shadowToken.d.ts +210 -2136
  30. package/dist/build/schemas/shadowToken.js +0 -9
  31. package/dist/build/schemas/stringToken.d.ts +4 -15
  32. package/dist/build/schemas/tokenName.d.ts +1 -1
  33. package/dist/build/schemas/tokenName.js +8 -3
  34. package/dist/build/schemas/transitionToken.d.ts +8 -35
  35. package/dist/build/schemas/typographyToken.d.ts +14 -55
  36. package/dist/build/schemas/validTokenType.d.ts +1 -1
  37. package/dist/build/schemas/validTokenType.js +8 -3
  38. package/dist/build/schemas/viewportRangeToken.d.ts +4 -15
  39. package/dist/build/types/tokenBuildInput.d.ts +2 -0
  40. package/dist/build/utilities/log.js +0 -3
  41. package/dist/css/functional/themes/dark-colorblind-high-contrast.css +30 -0
  42. package/dist/css/functional/themes/dark-colorblind.css +30 -0
  43. package/dist/css/functional/themes/dark-dimmed-high-contrast.css +30 -0
  44. package/dist/css/functional/themes/dark-dimmed.css +30 -0
  45. package/dist/css/functional/themes/dark-high-contrast.css +30 -0
  46. package/dist/css/functional/themes/dark-tritanopia-high-contrast.css +30 -0
  47. package/dist/css/functional/themes/dark-tritanopia.css +30 -0
  48. package/dist/css/functional/themes/dark.css +30 -0
  49. package/dist/css/functional/themes/light-colorblind-high-contrast.css +30 -0
  50. package/dist/css/functional/themes/light-colorblind.css +30 -0
  51. package/dist/css/functional/themes/light-high-contrast.css +30 -0
  52. package/dist/css/functional/themes/light-tritanopia-high-contrast.css +30 -0
  53. package/dist/css/functional/themes/light-tritanopia.css +30 -0
  54. package/dist/css/functional/themes/light.css +30 -0
  55. package/dist/docs/functional/themes/dark-colorblind-high-contrast.json +693 -0
  56. package/dist/docs/functional/themes/dark-colorblind.json +693 -0
  57. package/dist/docs/functional/themes/dark-dimmed-high-contrast.json +689 -0
  58. package/dist/docs/functional/themes/dark-dimmed.json +689 -0
  59. package/dist/docs/functional/themes/dark-high-contrast.json +689 -0
  60. package/dist/docs/functional/themes/dark-tritanopia-high-contrast.json +691 -0
  61. package/dist/docs/functional/themes/dark-tritanopia.json +693 -0
  62. package/dist/docs/functional/themes/dark.json +689 -0
  63. package/dist/docs/functional/themes/light-colorblind-high-contrast.json +691 -0
  64. package/dist/docs/functional/themes/light-colorblind.json +691 -0
  65. package/dist/docs/functional/themes/light-high-contrast.json +689 -0
  66. package/dist/docs/functional/themes/light-tritanopia-high-contrast.json +691 -0
  67. package/dist/docs/functional/themes/light-tritanopia.json +691 -0
  68. package/dist/docs/functional/themes/light.json +689 -0
  69. package/dist/figma/figma.json +4 -14
  70. package/dist/figma/themes/dark-colorblind.json +257 -0
  71. package/dist/figma/themes/dark-dimmed.json +255 -0
  72. package/dist/figma/themes/dark-high-contrast.json +255 -0
  73. package/dist/figma/themes/dark-tritanopia.json +257 -0
  74. package/dist/figma/themes/dark.json +255 -0
  75. package/dist/figma/themes/light-colorblind.json +256 -0
  76. package/dist/figma/themes/light-high-contrast.json +255 -0
  77. package/dist/figma/themes/light-tritanopia.json +256 -0
  78. package/dist/figma/themes/light.json +255 -0
  79. package/dist/internalCss/dark-colorblind-high-contrast.css +30 -0
  80. package/dist/internalCss/dark-colorblind.css +30 -0
  81. package/dist/internalCss/dark-dimmed-high-contrast.css +30 -0
  82. package/dist/internalCss/dark-dimmed.css +30 -0
  83. package/dist/internalCss/dark-high-contrast.css +30 -0
  84. package/dist/internalCss/dark-tritanopia-high-contrast.css +30 -0
  85. package/dist/internalCss/dark-tritanopia.css +30 -0
  86. package/dist/internalCss/dark.css +30 -0
  87. package/dist/internalCss/light-colorblind-high-contrast.css +30 -0
  88. package/dist/internalCss/light-colorblind.css +30 -0
  89. package/dist/internalCss/light-high-contrast.css +30 -0
  90. package/dist/internalCss/light-tritanopia-high-contrast.css +30 -0
  91. package/dist/internalCss/light-tritanopia.css +30 -0
  92. package/dist/internalCss/light.css +30 -0
  93. package/dist/styleLint/functional/themes/dark-colorblind-high-contrast.json +693 -0
  94. package/dist/styleLint/functional/themes/dark-colorblind.json +693 -0
  95. package/dist/styleLint/functional/themes/dark-dimmed-high-contrast.json +689 -0
  96. package/dist/styleLint/functional/themes/dark-dimmed.json +689 -0
  97. package/dist/styleLint/functional/themes/dark-high-contrast.json +689 -0
  98. package/dist/styleLint/functional/themes/dark-tritanopia-high-contrast.json +691 -0
  99. package/dist/styleLint/functional/themes/dark-tritanopia.json +693 -0
  100. package/dist/styleLint/functional/themes/dark.json +689 -0
  101. package/dist/styleLint/functional/themes/light-colorblind-high-contrast.json +691 -0
  102. package/dist/styleLint/functional/themes/light-colorblind.json +691 -0
  103. package/dist/styleLint/functional/themes/light-high-contrast.json +689 -0
  104. package/dist/styleLint/functional/themes/light-tritanopia-high-contrast.json +691 -0
  105. package/dist/styleLint/functional/themes/light-tritanopia.json +691 -0
  106. package/dist/styleLint/functional/themes/light.json +689 -0
  107. package/package.json +16 -16
  108. package/src/tokens/component/progressBar.json5 +145 -0
  109. package/src/tokens/functional/color/bgColor.json5 +48 -0
  110. package/src/tokens/functional/color/borderColor.json5 +64 -0
  111. package/src/tokens/functional/color/fgColor.json5 +14 -0
  112. package/dist/figma/themes/dark-colorblind-high-contrast.json +0 -14181
  113. package/dist/figma/themes/dark-dimmed-high-contrast.json +0 -14175
  114. package/dist/figma/themes/dark-tritanopia-high-contrast.json +0 -14177
  115. package/dist/figma/themes/light-colorblind-high-contrast.json +0 -14161
  116. 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.ZodEffects<z.ZodAny, any, any>;
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().refine(value => typeof value === 'number' && value >= 0 && value <= 1, value => ({
4
- message: schemaErrorMessage(`Invalid alpha value: "${value}" (${typeof value})`, 'Alpha value must be a number between 0 and 1.'),
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
- }, "strict", z.ZodTypeAny, {
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.ZodEffects<z.ZodString, string, string>, z.ZodEffects<z.ZodString, string, string>]>;
4
- style: z.ZodEnum<["solid", "dashed", "dotted", "double", "groove", "ridge", "outset", "inset"]>;
5
- width: z.ZodUnion<[z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodLiteral<"0">, z.ZodLiteral<0>]>, z.ZodEffects<z.ZodString, string, string>]>;
6
- }, "strip", z.ZodTypeAny, {
7
- width: string | 0;
8
- color: string;
9
- style: "inset" | "solid" | "dashed" | "dotted" | "double" | "groove" | "ridge" | "outset";
10
- }, {
11
- width: string | 0;
12
- color: string;
13
- style: "inset" | "solid" | "dashed" | "dotted" | "double" | "groove" | "ridge" | "outset";
14
- }>;
15
- export declare const borderToken: z.ZodObject<z.objectUtil.extendShape<{
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
- $value: z.ZodUnion<[z.ZodObject<{
20
- color: z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodEffects<z.ZodString, string, string>]>;
21
- style: z.ZodEnum<["solid", "dashed", "dotted", "double", "groove", "ridge", "outset", "inset"]>;
22
- width: z.ZodUnion<[z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodLiteral<"0">, z.ZodLiteral<0>]>, z.ZodEffects<z.ZodString, string, string>]>;
23
- }, "strip", z.ZodTypeAny, {
24
- width: string | 0;
25
- color: string;
26
- style: "inset" | "solid" | "dashed" | "dotted" | "double" | "groove" | "ridge" | "outset";
27
- }, {
28
- width: string | 0;
29
- color: string;
30
- style: "inset" | "solid" | "dashed" | "dotted" | "double" | "groove" | "ridge" | "outset";
31
- }>, z.ZodEffects<z.ZodString, string, string>]>;
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
- }>, "strict", z.ZodTypeAny, {
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.ZodEffects<z.ZodString, string, string>;
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.ZodEffects<z.ZodString, string, string>;
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().refine(value => collections.includes(value), value => ({
5
- message: schemaErrorMessage(`Invalid collection: "${value}"`, `Valid collections are ${joinFriendly(collections)}`),
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().refine(value => modes.includes(value), value => ({
10
- message: schemaErrorMessage(`Invalid mode: "${value}"`, `Valid modes are ${joinFriendly(modes)}`),
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.ZodEffects<z.ZodString, string, string>;
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().refine(color => colorHexRegex.test(color), color => ({
8
- message: schemaErrorMessage(`Invalid color: "${color}"`, 'Color must be a hex string or a reference to a color token.'),
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
+ });