@primer/react 0.0.0-20260731202127 → 0.0.0-20260803202204
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/CHANGELOG.md +3 -9
- package/dist/Avatar/Avatar-fa0ccdca.css +2 -0
- package/dist/Avatar/Avatar-fa0ccdca.css.map +1 -0
- package/dist/Avatar/Avatar.module.css.js +1 -1
- package/dist/ThemeProvider.d.ts +4 -1
- package/dist/ThemeProvider.js +76 -43
- package/dist/index.d.ts +2 -2
- package/dist/legacy-theme/ts/color-schemes.js +4252 -0
- package/dist/theme.d.ts +1142 -1
- package/dist/theme.js +3 -1
- package/dist/useTheme.d.ts +3 -1
- package/dist/utils/types/KeyPaths.d.ts +4 -0
- package/generated/hooks.json +15 -0
- package/package.json +4 -1
- package/dist/Avatar/Avatar-61b19061.css +0 -2
- package/dist/Avatar/Avatar-61b19061.css.map +0 -1
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 };
|
package/dist/useTheme.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { ColorMode, ColorModeWithAuto } from "./ThemeProvider.js";
|
|
1
|
+
import { ColorMode, ColorModeWithAuto, Theme } from "./ThemeProvider.js";
|
|
2
2
|
import React from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/useTheme.d.ts
|
|
5
5
|
declare function useTheme(): {
|
|
6
|
+
theme?: Theme;
|
|
6
7
|
colorScheme?: string;
|
|
7
8
|
colorMode?: ColorModeWithAuto;
|
|
8
9
|
resolvedColorMode?: ColorMode;
|
|
10
|
+
resolvedColorScheme?: string;
|
|
9
11
|
dayScheme?: string;
|
|
10
12
|
nightScheme?: string;
|
|
11
13
|
setColorMode: React.Dispatch<React.SetStateAction<ColorModeWithAuto>>;
|
package/generated/hooks.json
CHANGED
|
@@ -960,6 +960,11 @@
|
|
|
960
960
|
{
|
|
961
961
|
"name": "ThemeProviderProps",
|
|
962
962
|
"properties": [
|
|
963
|
+
{
|
|
964
|
+
"name": "theme",
|
|
965
|
+
"type": "{[key: string]: any}",
|
|
966
|
+
"description": "The theme object to be applied."
|
|
967
|
+
},
|
|
963
968
|
{
|
|
964
969
|
"name": "colorMode",
|
|
965
970
|
"type": "'auto' | 'day' | 'night' | 'light' | 'dark'",
|
|
@@ -985,6 +990,11 @@
|
|
|
985
990
|
{
|
|
986
991
|
"name": "ThemeData",
|
|
987
992
|
"properties": [
|
|
993
|
+
{
|
|
994
|
+
"name": "theme",
|
|
995
|
+
"type": "Theme",
|
|
996
|
+
"description": "The theme object that is applied."
|
|
997
|
+
},
|
|
988
998
|
{
|
|
989
999
|
"name": "colorScheme",
|
|
990
1000
|
"type": "string",
|
|
@@ -995,6 +1005,11 @@
|
|
|
995
1005
|
"type": "'auto' | 'day' | 'night' | 'light' | 'dark'",
|
|
996
1006
|
"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
1007
|
},
|
|
1008
|
+
{
|
|
1009
|
+
"name": "resolvedColorScheme",
|
|
1010
|
+
"type": "string",
|
|
1011
|
+
"description": "The name of the current color scheme."
|
|
1012
|
+
},
|
|
998
1013
|
{
|
|
999
1014
|
"name": "resolvedColorMode",
|
|
1000
1015
|
"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-
|
|
4
|
+
"version": "0.0.0-20260803202204",
|
|
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",
|
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
"build:docs:preview": "NODE_OPTIONS=--openssl-legacy-provider script/build-docs preview",
|
|
46
46
|
"build:components.json": "tsx script/components-json/build.ts",
|
|
47
47
|
"build:hooks.json": "tsx script/hooks-json/build.ts",
|
|
48
|
+
"build:precompile-color-schemes": "tsx script/precompile-color-schemes.ts",
|
|
48
49
|
"lint:npm": "publint --types",
|
|
49
50
|
"lint:react-compiler": "node script/lint-react-compiler.ts",
|
|
50
51
|
"storybook": "storybook",
|
|
@@ -63,6 +64,7 @@
|
|
|
63
64
|
],
|
|
64
65
|
"files": [
|
|
65
66
|
"dist",
|
|
67
|
+
"!dist/legacy-theme/ts/colors",
|
|
66
68
|
"generated",
|
|
67
69
|
"CHANGELOG.md"
|
|
68
70
|
],
|
|
@@ -84,6 +86,7 @@
|
|
|
84
86
|
"@tanstack/react-virtual": "^3.13.18",
|
|
85
87
|
"clsx": "^2.1.1",
|
|
86
88
|
"color2k": "^2.0.3",
|
|
89
|
+
"deepmerge": "^4.3.1",
|
|
87
90
|
"focus-visible": "^5.2.1",
|
|
88
91
|
"history": "^5.0.0",
|
|
89
92
|
"hsluv": "1.0.1",
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
:where(.prc-Avatar-Avatar-0xaUi){border-radius:50%;box-shadow:0 0 0 1px var(--avatar-borderColor,#1f232826);display:inline-block;height:var(--avatarSize-regular);line-height:1;overflow:hidden;vertical-align:middle;width:var(--avatarSize-regular)}:where(.prc-Avatar-Avatar-0xaUi):where([data-square]){border-radius:clamp(4px,calc(var(--avatarSize-regular) - 24px),var(--borderRadius-medium,.375rem))}@media screen and (max-width:calc(48rem - 0.02px)){:where(.prc-Avatar-Avatar-0xaUi):where([data-responsive]){height:var(--avatarSize-narrow);width:var(--avatarSize-narrow)}}@media screen and (min-width:48rem){:where(.prc-Avatar-Avatar-0xaUi):where([data-responsive]){height:var(--avatarSize-regular);width:var(--avatarSize-regular)}}@media screen and (min-width:87.5rem){:where(.prc-Avatar-Avatar-0xaUi):where([data-responsive]){height:var(--avatarSize-wide);width:var(--avatarSize-wide)}}
|
|
2
|
-
/*# sourceMappingURL=Avatar-61b19061.css.map */
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/Avatar/Avatar.module.css.js"],"names":[],"mappings":"AAAA,iCAQE,iBAAkB,CAElB,wDAA+C,CAT/C,oBAAqB,CAErB,gCAAiC,CAGjC,aAAc,CAFd,eAAgB,CAGhB,qBAAsB,CALtB,+BA+BF,CArBE,sDAEE,kGACF,CAGE,mDADF,0DAGI,+BAAgC,CADhC,8BAaJ,CAXE,CAEA,oCANF,0DAQI,gCAAiC,CADjC,+BAQJ,CANE,CAEA,sCAXF,0DAaI,6BAA8B,CAD9B,4BAGJ,CADE","file":"Avatar-61b19061.css","sourcesContent":[":where(.Avatar) {\n display: inline-block;\n width: var(--avatarSize-regular);\n height: var(--avatarSize-regular);\n overflow: hidden; /* Ensure page layout in Firefox should images fail to load */\n /* stylelint-disable-next-line primer/typography */\n line-height: 1;\n vertical-align: middle;\n border-radius: 50%;\n /* stylelint-disable-next-line primer/box-shadow */\n box-shadow: 0 0 0 1px var(--avatar-borderColor);\n\n &:where([data-square]) {\n /* stylelint-disable-next-line primer/borders */\n border-radius: clamp(4px, calc(var(--avatarSize-regular) - 24px), var(--borderRadius-medium));\n }\n\n &:where([data-responsive]) {\n @media screen and (--viewportRange-narrow) {\n width: var(--avatarSize-narrow);\n height: var(--avatarSize-narrow);\n }\n\n @media screen and (--viewportRange-regular) {\n width: var(--avatarSize-regular);\n height: var(--avatarSize-regular);\n }\n\n @media screen and (--viewportRange-wide) {\n width: var(--avatarSize-wide);\n height: var(--avatarSize-wide);\n }\n }\n}\n"]}
|