@primer/react 0.0.0-20260722112739 → 0.0.0-20260722182602

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 (69) hide show
  1. package/CHANGELOG.md +13 -9
  2. package/dist/ActionBar/ActionBar.js +4 -0
  3. package/dist/ActionBar/index.d.ts +4 -1
  4. package/dist/ActionList/Description.js +1 -0
  5. package/dist/ActionList/Divider.js +1 -0
  6. package/dist/ActionList/Group.js +1 -1
  7. package/dist/ActionList/List.js +20 -14
  8. package/dist/ActionList/TrailingAction.js +1 -0
  9. package/dist/AnchoredOverlay/AnchoredOverlay.js +6 -3
  10. package/dist/Autocomplete/AutocompleteInput.js +10 -7
  11. package/dist/Banner/Banner.js +2 -2
  12. package/dist/Blankslate/Blankslate.d.ts +15 -0
  13. package/dist/Blankslate/Blankslate.js +5 -0
  14. package/dist/ButtonGroup/ButtonGroup.js +15 -8
  15. package/dist/Checkbox/Checkbox.js +16 -9
  16. package/dist/DataTable/ErrorDialog.d.ts +3 -0
  17. package/dist/DataTable/ErrorDialog.js +1 -0
  18. package/dist/DataTable/Pagination.d.ts +3 -0
  19. package/dist/DataTable/Pagination.js +1 -0
  20. package/dist/DataTable/Table.d.ts +33 -0
  21. package/dist/DataTable/Table.js +12 -0
  22. package/dist/Details/Details.js +1 -1
  23. package/dist/Dialog/Dialog.js +12 -5
  24. package/dist/FeatureFlags/DefaultFeatureFlags.js +2 -1
  25. package/dist/FilteredActionList/FilteredActionList.js +31 -20
  26. package/dist/FilteredActionList/FilteredActionListInput.d.ts +4 -1
  27. package/dist/FilteredActionList/FilteredActionListInput.js +1 -0
  28. package/dist/FilteredActionList/FilteredActionListLoaders.d.ts +3 -0
  29. package/dist/FilteredActionList/FilteredActionListLoaders.js +1 -0
  30. package/dist/FormControl/FormControlCaption.d.ts +1 -0
  31. package/dist/FormControl/FormControlCaption.js +1 -0
  32. package/dist/FormControl/FormControlLabel.js +1 -0
  33. package/dist/FormControl/FormControlLeadingVisual.js +1 -0
  34. package/dist/Overlay/Overlay.js +1 -1
  35. package/dist/PageHeader/PageHeader.js +32 -23
  36. package/dist/PageLayout/PageLayout.js +2 -2
  37. package/dist/SegmentedControl/{SegmentedControl-a004561f.css → SegmentedControl-de65527b.css} +2 -2
  38. package/dist/SegmentedControl/{SegmentedControl-a004561f.css.map → SegmentedControl-de65527b.css.map} +1 -1
  39. package/dist/SegmentedControl/SegmentedControl.module.css.js +1 -1
  40. package/dist/SegmentedControl/SegmentedControlButton.js +2 -1
  41. package/dist/SegmentedControl/SegmentedControlIconButton.js +2 -1
  42. package/dist/SelectPanel/SelectPanel.d.ts +3 -0
  43. package/dist/SelectPanel/SelectPanel.js +2 -1
  44. package/dist/SelectPanel/SelectPanelMessage.js +1 -0
  45. package/dist/Stack/Stack.js +1 -0
  46. package/dist/TextInput/TextInput.js +13 -6
  47. package/dist/ThemeProvider.d.ts +4 -1
  48. package/dist/ThemeProvider.js +76 -43
  49. package/dist/Timeline/Timeline.js +3 -3
  50. package/dist/TooltipV2/Tooltip.js +19 -11
  51. package/dist/TopicTag/TopicTagGroup.d.ts +3 -0
  52. package/dist/TopicTag/TopicTagGroup.js +1 -0
  53. package/dist/experimental/Tabs/Tabs.js +3 -2
  54. package/dist/experimental/Tabs/types.d.ts +10 -3
  55. package/dist/experimental/Tabs/useTabList.js +18 -10
  56. package/dist/experimental/UnderlinePanels/UnderlinePanels.js +69 -42
  57. package/dist/experimental/index.js +5 -5
  58. package/dist/hooks/useMergedRefs.d.ts +4 -4
  59. package/dist/hooks/useMergedRefs.js +8 -5
  60. package/dist/hooks/useProvidedRefOrCreate.d.ts +7 -10
  61. package/dist/hooks/useProvidedRefOrCreate.js +7 -10
  62. package/dist/index.d.ts +2 -2
  63. package/dist/legacy-theme/ts/color-schemes.js +4252 -0
  64. package/dist/theme.d.ts +1142 -1
  65. package/dist/theme.js +3 -1
  66. package/dist/useTheme.d.ts +3 -1
  67. package/dist/utils/types/KeyPaths.d.ts +4 -0
  68. package/generated/hooks.json +15 -0
  69. package/package.json +4 -2
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,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>>;
@@ -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 };
@@ -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-20260722112739",
4
+ "version": "0.0.0-20260722182602",
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
  ],
@@ -75,7 +77,6 @@
75
77
  "dependencies": {
76
78
  "@github/mini-throttle": "^2.1.1",
77
79
  "@github/relative-time-element": "^5.0.0",
78
- "@github/tab-container-element": "^4.8.2",
79
80
  "@lit-labs/react": "1.2.1",
80
81
  "@oddbird/popover-polyfill": "^0.5.2",
81
82
  "@primer/behaviors": "^1.10.3",
@@ -85,6 +86,7 @@
85
86
  "@tanstack/react-virtual": "^3.13.18",
86
87
  "clsx": "^2.1.1",
87
88
  "color2k": "^2.0.3",
89
+ "deepmerge": "^4.3.1",
88
90
  "focus-visible": "^5.2.1",
89
91
  "history": "^5.0.0",
90
92
  "hsluv": "1.0.1",