@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.
- package/CHANGELOG.md +24 -1
- package/dist/ActionBar/ActionBar.js +10 -8
- package/dist/ActionList/Group-d89306a8.css +2 -0
- package/dist/ActionList/Group-d89306a8.css.map +1 -0
- package/dist/ActionList/Group.module.css.js +2 -2
- package/dist/ActionList/Heading.js +2 -1
- package/dist/ActionList/Item.js +282 -277
- package/dist/ActionList/LinkItem.js +11 -3
- package/dist/ActionList/index.d.ts +3 -0
- package/dist/ActionList/shared.d.ts +4 -0
- package/dist/AvatarStack/{AvatarStack-9bb5649f.css → AvatarStack-e6a99916.css} +2 -2
- package/dist/AvatarStack/AvatarStack-e6a99916.css.map +1 -0
- package/dist/AvatarStack/AvatarStack.module.css.js +1 -1
- package/dist/CounterLabel/CounterLabel.js +5 -2
- package/dist/Details/Details.js +2 -1
- package/dist/Dialog/Dialog.js +3 -2
- package/dist/NavList/NavList.d.ts +4 -2
- package/dist/NavList/NavList.js +87 -45
- package/dist/PageHeader/PageHeader.js +2 -1
- package/dist/Popover/Popover.d.ts +1 -0
- package/dist/Popover/Popover.js +84 -47
- package/dist/Portal/Portal.js +91 -29
- package/dist/Radio/Radio.js +1 -1
- package/dist/SelectPanel/SelectPanel.js +26 -25
- package/dist/ThemeContext.d.ts +20 -0
- package/dist/ThemeProvider.d.ts +3 -0
- package/dist/ThemeProvider.js +39 -129
- package/dist/TooltipV2/Tooltip.js +3 -2
- package/dist/TreeView/TreeView.js +0 -1
- package/dist/UnderlineNav/UnderlineNav.d.ts +3 -2
- package/dist/UnderlineNav/UnderlineNav.js +1 -1
- package/dist/deprecated/ActionList/List.js +2 -1
- package/dist/experimental/SelectPanel2/SelectPanel.js +7 -4
- package/dist/hooks/useFocusZone.js +2 -1
- package/dist/hooks/useMenuInitialFocus.js +72 -57
- package/dist/internal/components/ThemeProviderBase.js +50 -0
- package/dist/internal/hooks/useThemeProvider.js +71 -0
- package/dist/legacy-theme/ts/color-schemes.js +3942 -3942
- package/dist/next/ThemeProvider.d.ts +7 -0
- package/dist/next/ThemeProvider.js +35 -0
- package/dist/next/index.d.ts +4 -1
- package/dist/next/index.js +3 -1
- package/dist/theme.d.ts +16 -54
- package/dist/useTheme.d.ts +2 -14
- package/generated/components.json +12 -1
- package/generated/hooks.json +2 -7
- package/package.json +8 -10
- package/dist/ActionList/Group-efcb39da.css +0 -2
- package/dist/ActionList/Group-efcb39da.css.map +0 -1
- package/dist/AvatarStack/AvatarStack-9bb5649f.css.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,15 +1,38 @@
|
|
|
1
1
|
# @primer/react
|
|
2
2
|
|
|
3
|
-
## 0.0.0-
|
|
3
|
+
## 0.0.0-20260814135639
|
|
4
4
|
|
|
5
5
|
### Minor Changes
|
|
6
6
|
|
|
7
|
+
- [#8212](https://github.com/primer/react/pull/8212) [`9ac9343`](https://github.com/primer/react/commit/9ac9343a70fd0f70413a42cd27baf562a74dd4fc) Thanks [@mattcosta7](https://github.com/mattcosta7)! - ThemeProvider: Add a CSS-variable-based implementation to `@primer/react/next`
|
|
8
|
+
and deprecate the legacy JavaScript theme implementation.
|
|
9
|
+
|
|
7
10
|
- [#8233](https://github.com/primer/react/pull/8233) [`6cbfecc`](https://github.com/primer/react/commit/6cbfecc13c8f9ae4315c84774752d4408f9d2616) Thanks [@rickyzhangca](https://github.com/rickyzhangca)! - UnderlinePanels: add controlled `value`/`defaultValue`/`onChange` and `activationMode` props, keyed to a per-`Tab`/`Panel` `value`, for data-driven tabs. Behind the `primer_react_underline_panels_controlled` feature flag; the existing `aria-selected`/`onSelect` API is unchanged.
|
|
8
11
|
|
|
12
|
+
- [#8303](https://github.com/primer/react/pull/8303) [`a88cc69`](https://github.com/primer/react/commit/a88cc693539e2b9aa836623c737e860e7203e73a) Thanks [@TylerJDev](https://github.com/TylerJDev)! - NavList: Add a `tooltipText` prop to items
|
|
13
|
+
|
|
9
14
|
### Patch Changes
|
|
10
15
|
|
|
16
|
+
- [#8276](https://github.com/primer/react/pull/8276) [`5069f8a`](https://github.com/primer/react/commit/5069f8a7cb95544ce14122e97d67c8a1279f8a08) Thanks [@copilot-swe-agent](https://github.com/apps/copilot-swe-agent)! - Portal: Render nothing while server rendering and during hydration instead of accessing the DOM during render, fixing server rendering support. Client-only renders are unchanged and still mount portaled content in the same commit.
|
|
17
|
+
|
|
11
18
|
- Fake entry to force publishing
|
|
12
19
|
|
|
20
|
+
- [#8260](https://github.com/primer/react/pull/8260) [`24d0831`](https://github.com/primer/react/commit/24d0831d34b13e3b4bac8afcfa2ccd5795cd9a9d) Thanks [@liuliu-dev](https://github.com/liuliu-dev)! - UnderlineNav: Keep item icons visible by default at the medium breakpoint and above
|
|
21
|
+
|
|
22
|
+
## 38.35.1
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- [#8258](https://github.com/primer/react/pull/8258) [`edbcd94`](https://github.com/primer/react/commit/edbcd942354ff45148c2623be8b543ef8789a20f) Thanks [@llastflowers](https://github.com/llastflowers)! - Update `AvatarStack` to not reserve space when collapsed
|
|
27
|
+
|
|
28
|
+
- [#8273](https://github.com/primer/react/pull/8273) [`0c1e401`](https://github.com/primer/react/commit/0c1e401b6b0d57f95f8115ea90af78281751a766) Thanks [@liuliu-dev](https://github.com/liuliu-dev)! - NavList: Exclude group headings from navigation list item counts
|
|
29
|
+
|
|
30
|
+
## 38.35.0
|
|
31
|
+
|
|
32
|
+
### Minor Changes
|
|
33
|
+
|
|
34
|
+
- [#8253](https://github.com/primer/react/pull/8253) [`da3df9a`](https://github.com/primer/react/commit/da3df9aba582c7bcedbe69f1bdc5ab64ac90d32b) Thanks [@llastflowers](https://github.com/llastflowers)! - Add default Esc-to-dismiss support to `Popover` component
|
|
35
|
+
|
|
13
36
|
## 38.34.0
|
|
14
37
|
|
|
15
38
|
### Minor Changes
|
|
@@ -133,14 +133,15 @@ const ActionBarIconButton = /*#__PURE__*/ forwardRef(({ disabled, onClick, ...pr
|
|
|
133
133
|
disabled,
|
|
134
134
|
onClick
|
|
135
135
|
]));
|
|
136
|
+
const clickHandler = useCallback((event) => {
|
|
137
|
+
if (disabled) return;
|
|
138
|
+
onClick === null || onClick === void 0 || onClick(event);
|
|
139
|
+
}, [disabled, onClick]);
|
|
136
140
|
return /*#__PURE__*/ jsx(IconButton, {
|
|
137
141
|
"aria-disabled": disabled,
|
|
138
142
|
ref: mergedRef,
|
|
139
143
|
size,
|
|
140
|
-
onClick:
|
|
141
|
-
if (disabled) return;
|
|
142
|
-
onClick === null || onClick === void 0 || onClick(event);
|
|
143
|
-
}, [disabled, onClick]),
|
|
144
|
+
onClick: clickHandler,
|
|
144
145
|
...props,
|
|
145
146
|
variant: "invisible",
|
|
146
147
|
"data-overflowing": dataOverflowingAttr
|
|
@@ -163,14 +164,15 @@ const ActionBarButton = /*#__PURE__*/ forwardRef(({ disabled, onClick, ...props
|
|
|
163
164
|
disabled,
|
|
164
165
|
onClick
|
|
165
166
|
]));
|
|
167
|
+
const clickHandler = useCallback((event) => {
|
|
168
|
+
if (disabled) return;
|
|
169
|
+
onClick === null || onClick === void 0 || onClick(event);
|
|
170
|
+
}, [disabled, onClick]);
|
|
166
171
|
return /*#__PURE__*/ jsx(ButtonComponent, {
|
|
167
172
|
"aria-disabled": disabled,
|
|
168
173
|
ref: mergedRef,
|
|
169
174
|
size,
|
|
170
|
-
onClick:
|
|
171
|
-
if (disabled) return;
|
|
172
|
-
onClick === null || onClick === void 0 || onClick(event);
|
|
173
|
-
}, [disabled, onClick]),
|
|
175
|
+
onClick: clickHandler,
|
|
174
176
|
...props,
|
|
175
177
|
variant: "invisible",
|
|
176
178
|
"data-overflowing": dataOverflowingAttr
|
|
@@ -0,0 +1,2 @@
|
|
|
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-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-d89306a8.css.map */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/ActionList/Group.module.css.js"],"names":[],"mappings":"AAAA,4BACE,eAKF,CAHE,8CACE,2CACF,CAGF,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-d89306a8.css","sourcesContent":[".Group {\n list-style: none;\n\n &:not(:first-child) {\n margin-block-start: var(--base-size-8);\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,9 +1,9 @@
|
|
|
1
|
-
import "./Group-
|
|
1
|
+
import "./Group-d89306a8.css";
|
|
2
2
|
//#region src/ActionList/Group.module.css.js
|
|
3
3
|
var Group_module_css_default = {
|
|
4
4
|
"Group": "prc-ActionList-Group-lMIPQ",
|
|
5
|
-
"GroupHeadingWrap": "prc-ActionList-GroupHeadingWrap-laXcX",
|
|
6
5
|
"GroupList": "prc-ActionList-GroupList-V5B3-",
|
|
6
|
+
"GroupHeadingWrap": "prc-ActionList-GroupHeadingWrap-laXcX",
|
|
7
7
|
"GroupHeading": "prc-ActionList-GroupHeading-STzxi",
|
|
8
8
|
"GroupHeadingTrailingAction": "prc-ActionList-GroupHeadingTrailingAction-jnb64"
|
|
9
9
|
};
|
|
@@ -37,7 +37,8 @@ const Heading = /*#__PURE__*/ forwardRef((t0, forwardedRef) => {
|
|
|
37
37
|
t1 = $[6];
|
|
38
38
|
}
|
|
39
39
|
const visuallyHidden = t1 === void 0 ? false : t1;
|
|
40
|
-
const
|
|
40
|
+
const innerRef = React.useRef(null);
|
|
41
|
+
const mergedRef = useMergedRefs(forwardedRef, innerRef);
|
|
41
42
|
const { headingId, variant: listVariant } = React.useContext(ListContext);
|
|
42
43
|
const { container } = React.useContext(ActionListContainerContext);
|
|
43
44
|
!(container !== "ActionMenu") && invariant(false, "ActionList.Heading shouldn't be used within an ActionMenu container. Menus are labelled by the menu button's name.");
|