@primer/react 0.0.0-20260805190128 → 0.0.0-20260805200651

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/theme.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { fontStack } from "./utils/theme.js";
2
+ import { colorSchemes } from "./legacy-theme/ts/color-schemes.js";
2
3
  //#region src/theme.ts
3
4
  const theme = {
4
5
  animation: { easeOutCubic: "cubic-bezier(0.33, 1, 0.68, 1)" },
@@ -78,7 +79,8 @@ const theme = {
78
79
  "96px",
79
80
  "112px",
80
81
  "128px"
81
- ]
82
+ ],
83
+ colorSchemes
82
84
  };
83
85
  //#endregion
84
86
  export { theme as default };
@@ -1,17 +1,7 @@
1
- import { ColorMode, ColorModeWithAuto } from "./ThemeProvider.js";
2
- import React from "react";
1
+ import { ThemeContextValue } from "./ThemeContext.js";
3
2
 
4
3
  //#region src/useTheme.d.ts
5
- declare function useTheme(): {
6
- colorScheme?: string;
7
- colorMode?: ColorModeWithAuto;
8
- resolvedColorMode?: ColorMode;
9
- dayScheme?: string;
10
- nightScheme?: string;
11
- setColorMode: React.Dispatch<React.SetStateAction<ColorModeWithAuto>>;
12
- setDayScheme: React.Dispatch<React.SetStateAction<string>>;
13
- setNightScheme: React.Dispatch<React.SetStateAction<string>>;
14
- };
4
+ declare function useTheme(): ThemeContextValue;
15
5
  declare function useColorSchemeVar(values: Partial<Record<string, string>>, fallback: string): string;
16
6
  //#endregion
17
7
  export { useColorSchemeVar, useTheme };
@@ -0,0 +1,4 @@
1
+ //#region src/utils/types/KeyPaths.d.ts
2
+ type KeyPaths<O> = { [K in keyof O]: K extends string ? (O[K] extends Record<string, unknown> ? `${K}.${KeyPaths<O[K]>}` : `${K}`) : never }[keyof O];
3
+ //#endregion
4
+ export { KeyPaths };
@@ -985,6 +985,11 @@
985
985
  {
986
986
  "name": "ThemeData",
987
987
  "properties": [
988
+ {
989
+ "name": "theme",
990
+ "type": "Theme",
991
+ "description": "Deprecated: Use `ThemeProvider` from `@primer/react/next` to migrate away from JavaScript theme values."
992
+ },
988
993
  {
989
994
  "name": "colorScheme",
990
995
  "type": "string",
@@ -995,6 +1000,11 @@
995
1000
  "type": "'auto' | 'day' | 'night' | 'light' | 'dark'",
996
1001
  "description": "The color mode (for example: \"day\", \"night\") that is applied. If the color mode is \"auto\", the color mode is determined by the user's system preference."
997
1002
  },
1003
+ {
1004
+ "name": "resolvedColorScheme",
1005
+ "type": "string",
1006
+ "description": "Deprecated: Use `colorScheme` with `ThemeProvider` from `@primer/react/next`."
1007
+ },
998
1008
  {
999
1009
  "name": "resolvedColorMode",
1000
1010
  "type": "'day' | 'night' | 'light' | 'dark'",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@primer/react",
3
3
  "type": "module",
4
- "version": "0.0.0-20260805190128",
4
+ "version": "0.0.0-20260805200651",
5
5
  "description": "An implementation of GitHub's Primer Design System using React",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.js",
@@ -84,6 +84,7 @@
84
84
  "@tanstack/react-virtual": "^3.13.18",
85
85
  "clsx": "^2.1.1",
86
86
  "color2k": "^2.0.3",
87
+ "deepmerge": "^4.3.1",
87
88
  "focus-visible": "^5.2.1",
88
89
  "history": "^5.0.0",
89
90
  "hsluv": "1.0.1",