@primer/react 0.0.0-20260814130501 → 0.0.0-20260814135639

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 (50) hide show
  1. package/CHANGELOG.md +24 -1
  2. package/dist/ActionBar/ActionBar.js +10 -8
  3. package/dist/ActionList/Group-d89306a8.css +2 -0
  4. package/dist/ActionList/Group-d89306a8.css.map +1 -0
  5. package/dist/ActionList/Group.module.css.js +2 -2
  6. package/dist/ActionList/Heading.js +2 -1
  7. package/dist/ActionList/Item.js +282 -277
  8. package/dist/ActionList/LinkItem.js +11 -3
  9. package/dist/ActionList/index.d.ts +3 -0
  10. package/dist/ActionList/shared.d.ts +4 -0
  11. package/dist/AvatarStack/{AvatarStack-9bb5649f.css → AvatarStack-e6a99916.css} +2 -2
  12. package/dist/AvatarStack/AvatarStack-e6a99916.css.map +1 -0
  13. package/dist/AvatarStack/AvatarStack.module.css.js +1 -1
  14. package/dist/CounterLabel/CounterLabel.js +5 -2
  15. package/dist/Details/Details.js +2 -1
  16. package/dist/Dialog/Dialog.js +3 -2
  17. package/dist/NavList/NavList.d.ts +4 -2
  18. package/dist/NavList/NavList.js +87 -45
  19. package/dist/PageHeader/PageHeader.js +2 -1
  20. package/dist/Popover/Popover.d.ts +1 -0
  21. package/dist/Popover/Popover.js +84 -47
  22. package/dist/Portal/Portal.js +91 -29
  23. package/dist/Radio/Radio.js +1 -1
  24. package/dist/SelectPanel/SelectPanel.js +26 -25
  25. package/dist/ThemeContext.d.ts +20 -0
  26. package/dist/ThemeProvider.d.ts +3 -0
  27. package/dist/ThemeProvider.js +39 -129
  28. package/dist/TooltipV2/Tooltip.js +3 -2
  29. package/dist/TreeView/TreeView.js +0 -1
  30. package/dist/UnderlineNav/UnderlineNav.d.ts +3 -2
  31. package/dist/UnderlineNav/UnderlineNav.js +1 -1
  32. package/dist/deprecated/ActionList/List.js +2 -1
  33. package/dist/experimental/SelectPanel2/SelectPanel.js +7 -4
  34. package/dist/hooks/useFocusZone.js +2 -1
  35. package/dist/hooks/useMenuInitialFocus.js +72 -57
  36. package/dist/internal/components/ThemeProviderBase.js +50 -0
  37. package/dist/internal/hooks/useThemeProvider.js +71 -0
  38. package/dist/legacy-theme/ts/color-schemes.js +3942 -3942
  39. package/dist/next/ThemeProvider.d.ts +7 -0
  40. package/dist/next/ThemeProvider.js +35 -0
  41. package/dist/next/index.d.ts +4 -1
  42. package/dist/next/index.js +3 -1
  43. package/dist/theme.d.ts +16 -54
  44. package/dist/useTheme.d.ts +2 -14
  45. package/generated/components.json +12 -1
  46. package/generated/hooks.json +2 -7
  47. package/package.json +8 -10
  48. package/dist/ActionList/Group-efcb39da.css +0 -2
  49. package/dist/ActionList/Group-efcb39da.css.map +0 -1
  50. package/dist/AvatarStack/AvatarStack-9bb5649f.css.map +0 -1
@@ -0,0 +1,7 @@
1
+ import { ThemeProviderProps } from "../ThemeProvider.js";
2
+ import React from "react";
3
+
4
+ //#region src/next/ThemeProvider.d.ts
5
+ declare const ThemeProvider: React.FC<React.PropsWithChildren<ThemeProviderProps>>;
6
+ //#endregion
7
+ export { ThemeProvider, ThemeProvider as default };
@@ -0,0 +1,35 @@
1
+ import { ThemeProviderBase } from "../internal/components/ThemeProviderBase.js";
2
+ import { useThemeProvider } from "../internal/hooks/useThemeProvider.js";
3
+ import { c } from "react-compiler-runtime";
4
+ import { jsx } from "react/jsx-runtime";
5
+ //#region src/next/ThemeProvider.tsx
6
+ const ThemeProvider = (t0) => {
7
+ const $ = c(7);
8
+ let children;
9
+ let props;
10
+ if ($[0] !== t0) {
11
+ ({children, ...props} = t0);
12
+ $[0] = t0;
13
+ $[1] = children;
14
+ $[2] = props;
15
+ } else {
16
+ children = $[1];
17
+ props = $[2];
18
+ }
19
+ const { value } = useThemeProvider(props);
20
+ let t1;
21
+ if ($[3] !== children || $[4] !== props.contextOnly || $[5] !== value) {
22
+ t1 = /*#__PURE__*/ jsx(ThemeProviderBase, {
23
+ contextOnly: props.contextOnly,
24
+ value,
25
+ children
26
+ });
27
+ $[3] = children;
28
+ $[4] = props.contextOnly;
29
+ $[5] = value;
30
+ $[6] = t1;
31
+ } else t1 = $[6];
32
+ return t1;
33
+ };
34
+ //#endregion
35
+ export { ThemeProvider, ThemeProvider as default };
@@ -1,2 +1,5 @@
1
+ import { ThemeProviderProps } from "../ThemeProvider.js";
2
+ import { useColorSchemeVar, useTheme } from "../useTheme.js";
1
3
  import { Tooltip, TooltipProps } from "../TooltipV2/Tooltip.js";
2
- export { Tooltip, type TooltipProps };
4
+ import { ThemeProvider } from "./ThemeProvider.js";
5
+ export { ThemeProvider, type ThemeProviderProps, Tooltip, type TooltipProps, useColorSchemeVar, useTheme };
@@ -1,3 +1,5 @@
1
1
  "use client";
2
+ import { useColorSchemeVar, useTheme } from "../useTheme.js";
2
3
  import { Tooltip } from "../TooltipV2/Tooltip.js";
3
- export { Tooltip };
4
+ import { ThemeProvider } from "./ThemeProvider.js";
5
+ export { ThemeProvider, Tooltip, useColorSchemeVar, useTheme };
package/dist/theme.d.ts CHANGED
@@ -1082,6 +1082,7 @@ declare const theme: {
1082
1082
  }>;
1083
1083
  }>;
1084
1084
  };
1085
+ /** @deprecated Use `ThemeProvider` from `@primer/react/next` to migrate away from JavaScript theme values. */
1085
1086
  type ThemeColors = {
1086
1087
  fg: {
1087
1088
  default: string;
@@ -1106,60 +1107,21 @@ type ThemeColors = {
1106
1107
  muted: string;
1107
1108
  subtle: string;
1108
1109
  };
1109
- accent: {
1110
- fg: string;
1111
- emphasis: string;
1112
- muted: string;
1113
- subtle: string;
1114
- };
1115
- success: {
1116
- fg: string;
1117
- emphasis: string;
1118
- muted: string;
1119
- subtle: string;
1120
- };
1121
- attention: {
1122
- fg: string;
1123
- emphasis: string;
1124
- muted: string;
1125
- subtle: string;
1126
- };
1127
- severe: {
1128
- fg: string;
1129
- emphasis: string;
1130
- muted: string;
1131
- subtle: string;
1132
- };
1133
- danger: {
1134
- fg: string;
1135
- emphasis: string;
1136
- muted: string;
1137
- subtle: string;
1138
- };
1139
- open: {
1140
- fg: string;
1141
- emphasis: string;
1142
- muted: string;
1143
- subtle: string;
1144
- };
1145
- closed: {
1146
- fg: string;
1147
- emphasis: string;
1148
- muted: string;
1149
- subtle: string;
1150
- };
1151
- done: {
1152
- fg: string;
1153
- emphasis: string;
1154
- muted: string;
1155
- subtle: string;
1156
- };
1157
- sponsors: {
1158
- fg: string;
1159
- emphasis: string;
1160
- muted: string;
1161
- subtle: string;
1162
- };
1110
+ accent: ThemeRole;
1111
+ success: ThemeRole;
1112
+ attention: ThemeRole;
1113
+ severe: ThemeRole;
1114
+ danger: ThemeRole;
1115
+ open: ThemeRole;
1116
+ closed: ThemeRole;
1117
+ done: ThemeRole;
1118
+ sponsors: ThemeRole;
1119
+ };
1120
+ type ThemeRole = {
1121
+ fg: string;
1122
+ emphasis: string;
1123
+ muted: string;
1124
+ subtle: string;
1163
1125
  };
1164
1126
  type ThemeShadows = {
1165
1127
  shadow: {
@@ -1,19 +1,7 @@
1
- import { ColorMode, ColorModeWithAuto, Theme } 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
- theme?: Theme;
7
- colorScheme?: string;
8
- colorMode?: ColorModeWithAuto;
9
- resolvedColorMode?: ColorMode;
10
- resolvedColorScheme?: string;
11
- dayScheme?: string;
12
- nightScheme?: string;
13
- setColorMode: React.Dispatch<React.SetStateAction<ColorModeWithAuto>>;
14
- setDayScheme: React.Dispatch<React.SetStateAction<string>>;
15
- setNightScheme: React.Dispatch<React.SetStateAction<string>>;
16
- };
4
+ declare function useTheme(): ThemeContextValue;
17
5
  declare function useColorSchemeVar(values: Partial<Record<string, string>>, fallback: string): string;
18
6
  //#endregion
19
7
  export { useColorSchemeVar, useTheme };
@@ -5659,6 +5659,11 @@
5659
5659
  "type": "(event: MouseEvent | TouchEvent) => void",
5660
5660
  "description": "Callback fired when a click is detected outside the popover content"
5661
5661
  },
5662
+ {
5663
+ "name": "onEscape",
5664
+ "type": "(event: KeyboardEvent) => void",
5665
+ "description": "Callback fired when the Escape key is pressed while the popover is open"
5666
+ },
5662
5667
  {
5663
5668
  "name": "ignoreClickRefs",
5664
5669
  "type": "React.RefObject<HTMLElement>[]",
@@ -9037,7 +9042,7 @@
9037
9042
  },
9038
9043
  {
9039
9044
  "id": "components-underlinenav-features--overflow-template",
9040
- "code": "({ initialSelectedIndex = 1 }: { initialSelectedIndex?: number }) => {\n const [selectedIndex, setSelectedIndex] = React.useState<number | null>(\n initialSelectedIndex,\n )\n return (\n <UnderlineNav aria-label=\"Repository\">\n {items.map((item, index) => (\n <UnderlineNav.Item\n key={item.navigation}\n leadingVisual={item.icon}\n aria-current={index === selectedIndex ? 'page' : undefined}\n // Set so that navigation in interaction tests does not cause the\n // page to load the storybook iframe URL and instead keeps the test in\n // the local preview\n target=\"_self\"\n onSelect={(event) => {\n event.preventDefault()\n setSelectedIndex(index)\n }}\n counter={item.counter}\n href={item.href}\n >\n {item.navigation}\n </UnderlineNav.Item>\n ))}\n </UnderlineNav>\n )\n}"
9045
+ "code": "({ initialSelectedIndex = 1 }: { initialSelectedIndex?: number }) => {\n const [selectedIndex, setSelectedIndex] = React.useState<number | null>(\n initialSelectedIndex,\n )\n return (\n <UnderlineNav aria-label=\"Repository\" hideIconsBreakpoint=\"medium\">\n {items.map((item, index) => (\n <UnderlineNav.Item\n key={item.navigation}\n leadingVisual={item.icon}\n aria-current={index === selectedIndex ? 'page' : undefined}\n // Set so that navigation in interaction tests does not cause the\n // page to load the storybook iframe URL and instead keeps the test in\n // the local preview\n target=\"_self\"\n onSelect={(event) => {\n event.preventDefault()\n setSelectedIndex(index)\n }}\n counter={item.counter}\n href={item.href}\n >\n {item.navigation}\n </UnderlineNav.Item>\n ))}\n </UnderlineNav>\n )\n}"
9041
9046
  },
9042
9047
  {
9043
9048
  "id": "components-underlinenav-features--overflow-on-narrow-screen",
@@ -9073,6 +9078,12 @@
9073
9078
  "defaultValue": "false",
9074
9079
  "description": "Whether the navigation items are in loading state. Component waits for all the counters to finish loading to prevent multiple layout shifts."
9075
9080
  },
9081
+ {
9082
+ "name": "hideIconsBreakpoint",
9083
+ "type": "'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge' | null",
9084
+ "defaultValue": "'medium'",
9085
+ "description": "Controls the container width below which icons are hidden to save space. To keep icons visible in a narrow container, use a smaller breakpoint such as `xsmall`, or set to `null` to always show icons."
9086
+ },
9076
9087
  {
9077
9088
  "name": "variant",
9078
9089
  "type": "'inset' | 'flush'",
@@ -960,11 +960,6 @@
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
- },
968
963
  {
969
964
  "name": "colorMode",
970
965
  "type": "'auto' | 'day' | 'night' | 'light' | 'dark'",
@@ -993,7 +988,7 @@
993
988
  {
994
989
  "name": "theme",
995
990
  "type": "Theme",
996
- "description": "The theme object that is applied."
991
+ "description": "Deprecated: Use `ThemeProvider` from `@primer/react/next` to migrate away from JavaScript theme values."
997
992
  },
998
993
  {
999
994
  "name": "colorScheme",
@@ -1008,7 +1003,7 @@
1008
1003
  {
1009
1004
  "name": "resolvedColorScheme",
1010
1005
  "type": "string",
1011
- "description": "The name of the current color scheme."
1006
+ "description": "Deprecated: Use `colorScheme` with `ThemeProvider` from `@primer/react/next`."
1012
1007
  },
1013
1008
  {
1014
1009
  "name": "resolvedColorMode",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@primer/react",
3
3
  "type": "module",
4
- "version": "0.0.0-20260814130501",
4
+ "version": "0.0.0-20260814135639",
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,7 +45,6 @@
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",
49
48
  "lint:npm": "publint --types",
50
49
  "lint:react-compiler": "node script/lint-react-compiler.ts",
51
50
  "storybook": "storybook",
@@ -64,7 +63,6 @@
64
63
  ],
65
64
  "files": [
66
65
  "dist",
67
- "!dist/legacy-theme/ts/colors",
68
66
  "generated",
69
67
  "CHANGELOG.md"
70
68
  ],
@@ -110,12 +108,12 @@
110
108
  "@primer/doc-gen": "^0.0.1",
111
109
  "@primer/react-compiler-check": "^0.0.0",
112
110
  "@rolldown/plugin-babel": "^0.2.3",
113
- "@storybook/addon-a11y": "10.5.0",
114
- "@storybook/addon-docs": "10.5.0",
115
- "@storybook/addon-links": "10.5.0",
116
- "@storybook/addon-mcp": "^0.6.0",
111
+ "@storybook/addon-a11y": "10.5.5",
112
+ "@storybook/addon-docs": "10.5.5",
113
+ "@storybook/addon-links": "10.5.5",
114
+ "@storybook/addon-mcp": "^0.7.0",
117
115
  "@storybook/icons": "^2.1.0",
118
- "@storybook/react-vite": "10.5.0",
116
+ "@storybook/react-vite": "10.5.5",
119
117
  "@testing-library/dom": "^10.4.0",
120
118
  "@testing-library/jest-dom": "^6.4.5",
121
119
  "@testing-library/react": "^16.3.0",
@@ -168,11 +166,11 @@
168
166
  "react-is": "18.3.1",
169
167
  "recast": "0.23.7",
170
168
  "rimraf": "5.0.5",
171
- "rolldown": "^1.1.4",
169
+ "rolldown": "^1.2.2",
172
170
  "rolldown-plugin-dts": "^0.26.0",
173
171
  "rolldown-plugin-import-css": "^0.0.0",
174
172
  "rolldown-plugin-preserve-directives": "^0.0.0",
175
- "storybook": "10.5.0",
173
+ "storybook": "10.5.5",
176
174
  "terser": "5.36.0",
177
175
  "ts-toolbelt": "9.6.0",
178
176
  "tsx": "4.20.3",
@@ -1,2 +0,0 @@
1
- .prc-ActionList-Group-lMIPQ{list-style:none}.prc-ActionList-Group-lMIPQ:not(:first-child){margin-block-start:var(--base-size-8,.5rem)}.prc-ActionList-Group-lMIPQ:not(:first-child):has(.prc-ActionList-GroupHeadingWrap-laXcX+ul>.prc-ActionList-GroupHeadingWrap-laXcX)>.prc-ActionList-GroupHeadingWrap-laXcX{display:none}.prc-ActionList-GroupList-V5B3-{padding-inline-start:0}.prc-ActionList-GroupHeadingWrap-laXcX{color:var(--fgColor-muted,#59636e);display:flex;flex-direction:column;font-size:var(--text-body-size-small,.75rem);font-weight:var(--base-text-weight-semibold,600);line-height:18px;padding-block:var(--base-size-6,.375rem);padding-inline:var(--base-size-16,1rem)}.prc-ActionList-GroupHeadingWrap-laXcX:where([data-variant=filled]){background:var(--bgColor-muted,#f6f8fa);border-bottom:var(--borderWidth-thin,.0625rem) solid var(--borderColor-muted,#d1d9e0b3);border-top:var(--borderWidth-thin,.0625rem) solid var(--borderColor-muted,#d1d9e0b3);margin-block-end:var(--base-size-8,.5rem);margin-block-start:calc(var(--base-size-8,.5rem) - var(--borderWidth-thin,.0625rem));padding-inline:var(--base-size-16,1rem)}.prc-ActionList-GroupHeadingWrap-laXcX:where([data-variant=filled]):first-child{margin-block-start:0}.prc-ActionList-GroupHeading-STzxi{align-self:flex-start;color:var(--fgColor-muted,#59636e);font-size:var(--text-body-size-small,.75rem);font-weight:var(--base-text-weight-semibold,600);margin:0}.prc-ActionList-GroupHeadingWrap-laXcX[data-has-trailing-action]{align-items:center;flex-direction:row;gap:var(--base-size-8,.5rem);justify-content:space-between}.prc-ActionList-GroupHeadingWrap-laXcX[data-has-trailing-action]>.prc-ActionList-GroupHeading-STzxi{align-self:center}.prc-ActionList-GroupHeadingTrailingAction-jnb64{align-items:center;display:inline-flex;margin-inline-start:auto}
2
- /*# sourceMappingURL=Group-efcb39da.css.map */
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/ActionList/Group.module.css.js"],"names":[],"mappings":"AAAA,4BACE,eAcF,CAZE,8CACE,2CAUF,CAJI,2KACE,YACF,CAKN,gCACE,sBACF,CAEA,uCAQE,kCAA2B,CAP3B,YAAa,CAQb,qBAAsB,CAPtB,4CAAsC,CACtC,gDAA6C,CAI7C,gBAAiB,CAIjB,wCAAiC,CADjC,uCAoBF,CAjBE,oEAIE,uCAAgC,CAEhC,uFAAqE,CADrE,oFAAkE,CAFlE,yCAAoC,CADpC,oFAAsE,CAKtE,uCAKF,CAHE,gFACE,oBACF,CAQJ,mCAKE,qBAAsB,CADtB,kCAA2B,CAF3B,4CAAsC,CACtC,gDAA6C,CAF7C,QAKF,CAEA,iEAEE,kBAAmB,CADnB,kBAAmB,CAGnB,4BAAuB,CADvB,6BAMF,CAHE,oGACE,iBACF,CAGF,iDAEE,kBAAmB,CADnB,mBAAoB,CAEpB,wBACF","file":"Group-efcb39da.css","sourcesContent":[".Group {\n list-style: none;\n\n &:not(:first-child) {\n margin-block-start: var(--base-size-8);\n\n /* If somebody tries to pass the `title` prop AND a `NavList.GroupHeading` as a child, hide the `ActionList.GroupHeading */\n /* stylelint-disable-next-line selector-max-specificity, selector-pseudo-class-disallowed-list -- scoped to CSS Module, audited (github/github-ui#17224) */\n &:has(.GroupHeadingWrap + ul > .GroupHeadingWrap) {\n /* stylelint-disable-next-line selector-max-specificity */\n & > .GroupHeadingWrap {\n display: none;\n }\n }\n }\n}\n\n.GroupList {\n padding-inline-start: 0;\n}\n\n.GroupHeadingWrap {\n display: flex;\n font-size: var(--text-body-size-small);\n font-weight: var(--base-text-weight-semibold);\n\n /* line-height: var(--text-body-lineHeight-small); use when FF rolls out */\n /* stylelint-disable-next-line primer/typography */\n line-height: 18px;\n color: var(--fgColor-muted);\n flex-direction: column;\n padding-inline: var(--base-size-16);\n padding-block: var(--base-size-6);\n\n &:where([data-variant='filled']) {\n /* stylelint-disable-next-line primer/spacing */\n margin-block-start: calc(var(--base-size-8) - var(--borderWidth-thin));\n margin-block-end: var(--base-size-8);\n background: var(--bgColor-muted);\n border-top: solid var(--borderWidth-thin) var(--borderColor-muted);\n border-bottom: solid var(--borderWidth-thin) var(--borderColor-muted);\n padding-inline: var(--base-size-16);\n\n &:first-child {\n margin-block-start: 0;\n }\n }\n\n /* & + ul:has(.GroupHeadingWrap) {\n outline: solid 1px red;\n } */\n}\n\n.GroupHeading {\n margin: 0;\n font-size: var(--text-body-size-small);\n font-weight: var(--base-text-weight-semibold);\n color: var(--fgColor-muted);\n align-self: flex-start;\n}\n\n.GroupHeadingWrap[data-has-trailing-action] {\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n gap: var(--base-size-8);\n\n & > .GroupHeading {\n align-self: center;\n }\n}\n\n.GroupHeadingTrailingAction {\n display: inline-flex;\n align-items: center;\n margin-inline-start: auto;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/AvatarStack/AvatarStack.module.css.js"],"names":[],"mappings":"AACA,mCACE,yBAA0B,CAC1B,qDAA0D,CAC1D,eAAgB,CAChB,kBAAmB,CAGnB,YAAa,CAEb,+BAAgC,CAChC,iBAAkB,CAFlB,kCAAmC,CAFnC,iBA2GF,CArGE,iEACE,kDAAqD,CACrD,oEACF,CAEA,+DACE,kDAAqD,CACrD,oEACF,CAGE,mDADF,4DAEI,2CAUJ,CATE,CAEA,oCALF,4DAMI,4CAMJ,CALE,CAEA,sCATF,4DAUI,yCAEJ,CADE,CAIA,sJAEE,+EACF,CAGF,uHAEE,qBACF,CAEA,yIAEE,sBACF,CAEA,kEAME,yFACF,CAEA,wFAOE,4JAIF,CAEA,sFAME,+GACF,CAEA,yFAOE,gKAIF,CAEA,uFAME,+GAAkH,CAElH,oDACF,CAEA,6DACE,cAAe,CAEf,aACF,CAGF,uCAEE,YAAa,CADb,iBAMF,CAHE,oEACE,iBACF,CAGF,kCACE,6CAA8C,CAG9C,YAAa,CAIb,aAAc,CAFd,+BAAgC,CAChC,eAAgB,CAJhB,iBAAkB,CAMlB,iHAI4B,CAR5B,8BAoHF,CAzGE,mGAEE,uDACF,CAGA,wFACE,iBACF,CAGA,mGAEE,qBACF,CAGA,qHAEE,sBACF,CAEA,8CACE,qBACF,CAEA,iDAEE,gDAAmD,CAKnD,sBAAuB,CAQvB,8HAEK,CAdL,+BAAiC,CACjC,gDAEM,CAeN,YACF,CAGA,+GACE,yFACF,CAGA,+GAEE,yFACF,CAGA,kHACE,oDAAqD,CAGrD,0CACF,CAGA,kHAEE,0CACF,CAGA,kHAEE,0CACF,CAEA,4GACE,SACF,CAEA,6GACE,SACF,CAEA,6GACE,SACF,CAEA,6GACE,SACF,CAEA,6GACE,SACF,CAEA,iDAEE,SAAU,CADV,iBAEF,CAGF,uJAEE,UAsBF,CApBE,iHACE,gBAAiB,CAEjB,6CAAuC,CASvC,yEAEK,CATL,SAAU,CADV,kBAeF,CAnBA,0GACE,gBAAiB,CAEjB,6CAAuC,CASvC,yEAEK,CATL,SAAU,CADV,kBAeF,CAHE,sHACE,qBACF,CAFA,6HACE,qBACF","file":"AvatarStack-9bb5649f.css","sourcesContent":["/* stylelint-disable selector-max-specificity */\n.AvatarStack {\n --avatar-border-width: 1px;\n --mask-size: calc(100% + (var(--avatar-border-width) * 2));\n --mask-start: -1;\n --opacity-step: 15%;\n\n position: relative;\n display: flex;\n min-width: var(--avatar-stack-size);\n height: var(--avatar-stack-size);\n isolation: isolate;\n\n &:where([data-variant='cascade']) {\n --overlap-size: calc(var(--avatar-stack-size) * 0.55);\n --overlap-size-avatar-three-plus: calc(var(--avatar-stack-size) * 0.85);\n }\n\n &:where([data-variant='stack']) {\n --overlap-size: calc(var(--avatar-stack-size) * 0.55);\n --overlap-size-avatar-three-plus: calc(var(--avatar-stack-size) * 0.55);\n }\n\n &:where([data-responsive]) {\n @media screen and (--viewportRange-narrow) {\n --avatar-stack-size: var(--stackSize-narrow);\n }\n\n @media screen and (--viewportRange-regular) {\n --avatar-stack-size: var(--stackSize-regular);\n }\n\n @media screen and (--viewportRange-wide) {\n --avatar-stack-size: var(--stackSize-wide);\n }\n }\n\n &:where([data-avatar-count='1'][data-shape='circle']) {\n .AvatarItem:where([data-component='Avatar']) {\n /* stylelint-disable-next-line primer/box-shadow */\n box-shadow: 0 0 0 var(--avatar-border-width) var(--avatar-borderColor);\n }\n }\n\n &:where([data-avatar-count='1'][data-shape='square']) .AvatarItem {\n /* stylelint-disable-next-line primer/box-shadow */\n box-shadow: 1px 0 rgb(0, 0, 0, 1);\n }\n\n &:where([data-avatar-count='1'][data-shape='square'][data-align-right]) .AvatarItem {\n /* stylelint-disable-next-line primer/box-shadow */\n box-shadow: -1px 0 rgb(0, 0, 0, 1);\n }\n\n &:where([data-avatar-count='2']) {\n /*\n MIN-WIDTH CALC FORMULA EXPLAINED:\n avatar size ➡️ var(--avatar-stack-size)\n plus the visible part of the 2nd avatar ➡️ var(--avatar-stack-size) - var(--overlap-size)\n */\n min-width: calc(var(--avatar-stack-size) + (var(--avatar-stack-size) - var(--overlap-size)));\n }\n\n &:where([data-avatar-count='3'][data-variant='cascade']) {\n /*\n MIN-WIDTH CALC FORMULA EXPLAINED:\n avatar size ➡️ var(--avatar-stack-size)\n plus the visible part of the 2nd avatar ➡️ var(--avatar-stack-size) - var(--overlap-size)\n plus the visible part of the 3rd avatar ➡️ var(--avatar-stack-size) - var(--overlap-size-avatar-three-plus)\n */\n min-width: calc(\n var(--avatar-stack-size) + (var(--avatar-stack-size) - var(--overlap-size)) +\n (var(--avatar-stack-size) - var(--overlap-size-avatar-three-plus))\n );\n }\n\n &:where([data-avatar-count='3'][data-variant='stack']) {\n /*\n MIN-WIDTH CALC FORMULA EXPLAINED:\n avatar size ➡️ var(--avatar-stack-size)\n plus the visible part of the 2nd avatar & 3rd avatar ➡️ var(--avatar-stack-size) - var(--overlap-size-avatar-three-plus) * 2\n */\n min-width: calc(var(--avatar-stack-size) + (var(--avatar-stack-size) - var(--overlap-size-avatar-three-plus)) * 2);\n }\n\n &:where([data-avatar-count='3+'][data-variant='cascade']) {\n /*\n MIN-WIDTH CALC FORMULA EXPLAINED:\n avatar size ➡️ var(--avatar-stack-size)\n plus the visible part of the 2nd avatar ➡️ var(--avatar-stack-size) - var(--overlap-size)\n plus the visible part of the 3rd AND 4th avatar ➡️ (var(--avatar-stack-size) - var(--overlap-size-avatar-three-plus)) * 2\n */\n min-width: calc(\n var(--avatar-stack-size) + (var(--avatar-stack-size) - var(--overlap-size)) +\n (var(--avatar-stack-size) - var(--overlap-size-avatar-three-plus)) * 2\n );\n }\n\n &:where([data-avatar-count='3+'][data-variant='stack']) {\n /*\n MIN-WIDTH CALC FORMULA EXPLAINED:\n avatar size ➡️ var(--avatar-stack-size)\n plus the visible part of the 2nd to 4th avatars ➡️ var(--avatar-stack-size) - var(--overlap-size-avatar-three-plus) * 3\n */\n min-width: calc(var(--avatar-stack-size) + (var(--avatar-stack-size) - var(--overlap-size-avatar-three-plus)) * 3);\n\n --overlap-size: var(--overlap-size-avatar-three-plus);\n }\n\n &:where([data-align-right]) {\n --mask-start: 1;\n\n direction: rtl;\n }\n}\n\n.AvatarStackBody {\n position: absolute;\n display: flex;\n\n &:where([data-disable-expand]) {\n position: relative;\n }\n}\n\n.AvatarItem {\n --avatarSize-regular: var(--avatar-stack-size);\n\n position: relative;\n display: flex;\n width: var(--avatar-stack-size);\n height: var(--avatar-stack-size);\n overflow: hidden;\n flex-shrink: 0;\n transition:\n margin 0.2s ease-in-out,\n opacity 0.2s ease-in-out,\n mask-position 0.2s ease-in-out,\n mask-size 0.2s ease-in-out;\n\n /* stylelint-disable-next-line selector-no-qualifying-type */\n .AvatarStack:where([data-shape='circle']) &:is(img) {\n /* stylelint-disable-next-line primer/box-shadow */\n box-shadow: 0 0 0 var(--avatar-border-width) transparent;\n }\n\n /* stylelint-disable-next-line selector-pseudo-class-disallowed-list -- scoped to CSS Module, audited (github/github-ui#17224) */\n &:not([data-component='Avatar']):not(:has([data-square])) {\n border-radius: 50%;\n }\n\n /* stylelint-disable-next-line selector-no-qualifying-type */\n .AvatarStack:where([data-shape='square']) &:is(img) {\n /* stylelint-disable-next-line primer/box-shadow */\n box-shadow: 1px 0 rgb(255, 255, 255, 1);\n }\n\n /* stylelint-disable-next-line selector-no-qualifying-type */\n .AvatarStack:where([data-shape='square'][data-align-right]) &:is(img) {\n /* stylelint-disable-next-line primer/box-shadow */\n box-shadow: -1px 0 rgb(255, 255, 255, 1);\n }\n\n &:first-child {\n margin-inline-start: 0;\n }\n\n &:nth-child(n + 2) {\n /* stylelint-disable-next-line primer/spacing */\n margin-inline-start: calc(var(--overlap-size) * -1);\n mask-repeat: no-repeat, no-repeat;\n mask-size:\n var(--mask-size) var(--mask-size),\n auto;\n mask-composite: exclude;\n\n /*\n HORIZONTAL POSITION CALC FORMULA EXPLAINED:\n width of the visible part of the avatar ➡️ var(--avatar-stack-size) - var(--overlap-size)\n multiply by -1 for left-aligned, 1 for right-aligned ➡️ var(--mask-start)\n subtract the avatar border width ➡️ var(--avatar-border-width)\n */\n mask-position:\n calc((var(--avatar-stack-size) - var(--overlap-size)) * var(--mask-start) - var(--avatar-border-width)) center,\n 0 0;\n\n /* HACK: This padding fixes a weird rendering bug where a tiiiiny outline is visible at the edges of the element */\n /* stylelint-disable-next-line primer/spacing */\n padding: 0.1px;\n }\n\n /* Circular mask */\n .AvatarStack:where([data-shape='circle']) &:nth-child(n + 2) {\n mask-image: radial-gradient(at 50% 50%, rgb(0, 0, 0) 70%, rgb(0, 0, 0, 0) 71%), linear-gradient(rgb(0, 0, 0) 0 0);\n }\n\n /* Square mask */\n .AvatarStack:where([data-shape='square']) &:nth-child(n + 2) {\n /* stylelint-disable-next-line declaration-property-value-no-unknown */\n mask-image: linear-gradient(at 50% 50%, rgb(0, 0, 0) 70%, rgb(0, 0, 0, 0) 71%), linear-gradient(rgb(0, 0, 0) 0 0);\n }\n\n /* Cascade variant override for nth-child(n + 3) */\n .AvatarStack:where([data-variant='cascade']) &:nth-child(n + 3) {\n --overlap-size: var(--overlap-size-avatar-three-plus);\n\n /* stylelint-disable-next-line alpha-value-notation */\n opacity: calc(100% - 2 * var(--opacity-step));\n }\n\n /* Cascade variant override for nth-child(n + 4) */\n .AvatarStack:where([data-variant='cascade']) &:nth-child(n + 4) {\n /* stylelint-disable-next-line alpha-value-notation */\n opacity: calc(100% - 3 * var(--opacity-step));\n }\n\n /* Cascade variant override for nth-child(n + 5) */\n .AvatarStack:where([data-variant='cascade']) &:nth-child(n + 5) {\n /* stylelint-disable-next-line alpha-value-notation */\n opacity: calc(100% - 4 * var(--opacity-step));\n }\n\n .AvatarStack:where([data-shape='square']) &:nth-child(1) {\n z-index: 5;\n }\n\n .AvatarStack:where([data-shape='square']) &:nth-child(2) {\n z-index: 4;\n }\n\n .AvatarStack:where([data-shape='square']) &:nth-child(3) {\n z-index: 3;\n }\n\n .AvatarStack:where([data-shape='square']) &:nth-child(4) {\n z-index: 2;\n }\n\n .AvatarStack:where([data-shape='square']) &:nth-child(5) {\n z-index: 1;\n }\n\n &:nth-child(n + 6) {\n visibility: hidden;\n opacity: 0;\n }\n}\n\n.AvatarStackBody:not([data-disable-expand]):hover,\n.AvatarStackBody:not([data-disable-expand]):focus-within {\n width: auto;\n\n .AvatarItem {\n --mask-size: 100%; /* reset size of the mask to prevent unintentially clipping due to the additional size created by the border width */\n\n margin-inline-start: var(--base-size-4);\n visibility: visible;\n opacity: 1;\n\n /*\n HORIZONTAL POSITION CALC FORMULA EXPLAINED:\n width of the full avatar ➡️ var(--avatar-stack-size)\n multiply by -1 for left-aligned, 1 for right-aligned ➡️ var(--mask-start)\n */\n mask-position:\n calc(var(--avatar-stack-size) * var(--mask-start)) center,\n 0 0;\n\n &:first-child {\n margin-inline-start: 0;\n }\n }\n}\n"]}