@primer/react 38.39.0-rc.fbea7df95 → 38.39.0
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 +4 -0
- package/dist/ActionList/Description.js +1 -1
- package/dist/ActionList/Divider.js +1 -1
- package/dist/ActionList/Group.js +1 -1
- package/dist/ActionList/GroupHeadingTrailingAction.js +1 -1
- package/dist/ActionList/Heading.js +1 -1
- package/dist/ActionList/Item.js +1 -1
- package/dist/ActionList/List.js +1 -1
- package/dist/ActionList/Selection.js +1 -1
- package/dist/ActionList/TrailingAction.js +1 -1
- package/dist/ActionList/Visuals.js +1 -1
- package/dist/Autocomplete/Autocomplete.js +1 -1
- package/dist/Autocomplete/AutocompleteMenu.js +2 -2
- package/dist/Autocomplete/AutocompleteOverlay.js +1 -1
- package/dist/Avatar/Avatar.js +1 -1
- package/dist/AvatarStack/AvatarStack.js +1 -1
- package/dist/Banner/Banner.js +1 -1
- package/dist/BaseStyles.js +1 -1
- package/dist/Blankslate/Blankslate.js +1 -1
- package/dist/BranchName/BranchName.js +1 -1
- package/dist/Breadcrumbs/Breadcrumbs.js +1 -1
- package/dist/Button/Button.js +1 -1
- package/dist/Button/IconButton.js +1 -1
- package/dist/Button/LinkButton.js +1 -1
- package/dist/ButtonGroup/ButtonGroup.js +1 -1
- package/dist/Card/Card.js +1 -1
- package/dist/CheckboxGroup/CheckboxGroup.js +1 -1
- package/dist/CircleBadge/CircleBadge.js +1 -1
- package/dist/ConfirmationDialog/ConfirmationDialog.js +1 -1
- package/dist/DataTable/DataTable.js +1 -1
- package/dist/DataTable/ErrorDialog.js +1 -1
- package/dist/DataTable/Pagination.js +1 -1
- package/dist/DataTable/Table.js +1 -1
- package/dist/DataTable/TableGroup.js +1 -1
- package/dist/DataTable/useTable.js +1 -1
- package/dist/Details/Details.js +1 -1
- package/dist/FeatureFlags/DefaultFeatureFlags.js +1 -2
- package/dist/FeatureFlags/FeatureFlags.js +1 -1
- package/dist/FeatureFlags/useFeatureFlag.js +1 -1
- package/dist/FilteredActionList/FilteredActionListInput.js +1 -1
- package/dist/FilteredActionList/FilteredActionListLoaders.js +1 -1
- package/dist/FilteredActionList/useAnnouncements.js +1 -1
- package/dist/Flash/Flash.js +1 -1
- package/dist/FormControl/FormControl.js +1 -1
- package/dist/FormControl/FormControlCaption.js +1 -1
- package/dist/FormControl/FormControlLabel.js +1 -1
- package/dist/FormControl/FormControlLeadingVisual.js +1 -1
- package/dist/FormControl/_FormControlContext.js +1 -1
- package/dist/FormControl/_FormControlValidation.js +1 -1
- package/dist/Header/Header.js +1 -1
- package/dist/Heading/Heading.js +1 -1
- package/dist/Hidden/Hidden.js +1 -1
- package/dist/InlineMessage/InlineMessage.js +1 -1
- package/dist/KeybindingHint/KeybindingHint.js +1 -1
- package/dist/KeybindingHint/components/Chord.js +1 -1
- package/dist/KeybindingHint/components/Key.js +1 -1
- package/dist/Label/Label.js +1 -1
- package/dist/Link/Link.js +1 -1
- package/dist/NavList/NavList.js +1 -1
- package/dist/Octicon/Octicon.js +1 -1
- package/dist/PageHeader/PageHeader.js +1 -1
- package/dist/PageLayout/DragHandle.js +1 -1
- package/dist/PageLayout/PageLayout.js +1 -1
- package/dist/PageLayout/usePaneWidth.js +1 -1
- package/dist/Pagehead/Pagehead.js +1 -1
- package/dist/Pagination/Pagination.js +1 -1
- package/dist/Popover/Popover.js +1 -1
- package/dist/Portal/Portal.js +1 -1
- package/dist/ProgressBar/ProgressBar.js +1 -1
- package/dist/Radio/Radio.js +1 -1
- package/dist/RadioGroup/RadioGroup.js +1 -1
- package/dist/RelativeTime/RelativeTime.js +1 -1
- package/dist/ScrollableRegion/ScrollableRegion.js +1 -1
- package/dist/SegmentedControl/SegmentedControl.js +1 -1
- package/dist/SegmentedControl/SegmentedControlAction.js +1 -1
- package/dist/SegmentedControl/SegmentedControlButton.js +1 -1
- package/dist/SegmentedControl/SegmentedControlDivider.js +1 -1
- package/dist/SegmentedControl/SegmentedControlIconButton.js +1 -1
- package/dist/Select/Select.js +1 -1
- package/dist/SelectPanel/SelectPanel.js +1 -1
- package/dist/SelectPanel/SelectPanelMessage.js +1 -1
- package/dist/SideNav.js +1 -1
- package/dist/Skeleton/SkeletonBox.js +1 -1
- package/dist/SkeletonAvatar/SkeletonAvatar.js +1 -1
- package/dist/SkeletonText/SkeletonText.js +1 -1
- package/dist/Spinner/Spinner.js +1 -1
- package/dist/SplitPageLayout/SplitPageLayout.js +1 -1
- package/dist/Stack/Stack.js +1 -1
- package/dist/StateLabel/StateLabel.js +1 -1
- package/dist/SubNav/SubNav.js +1 -1
- package/dist/TabNav/TabNav.js +1 -1
- package/dist/Text/Text.js +1 -1
- package/dist/TextInputWithTokens/TextInputWithTokens.js +1 -1
- package/dist/Textarea/Textarea.js +1 -1
- package/dist/ThemeProvider.js +1 -1
- package/dist/Timeline/Timeline.js +1 -1
- package/dist/ToggleSwitch/ToggleSwitch.js +1 -1
- package/dist/Token/IssueLabelToken.js +1 -1
- package/dist/Token/Token.js +1 -1
- package/dist/Token/TokenBase.js +1 -1
- package/dist/Token/_TokenTextContainer.js +1 -1
- package/dist/TopicTag/TopicTag.js +1 -1
- package/dist/TopicTag/TopicTagGroup.js +1 -1
- package/dist/TreeView/useRovingTabIndex.js +1 -1
- package/dist/TreeView/useTreeItemCache.js +1 -1
- package/dist/TreeView/useTypeahead.js +1 -1
- package/dist/UnderlineNav/UnderlineNav.js +1 -1
- package/dist/UnderlineNav/UnderlineNavItem.js +1 -1
- package/dist/VisuallyHidden/VisuallyHidden.js +1 -1
- package/dist/_VisuallyHidden.js +1 -1
- package/dist/deprecated/ActionList/Divider.js +1 -1
- package/dist/deprecated/ActionList/Group.js +1 -1
- package/dist/deprecated/ActionList/Header.js +1 -1
- package/dist/deprecated/ActionList/Item.js +1 -1
- package/dist/deprecated/ActionList/List.js +1 -1
- package/dist/deprecated/ActionMenu.js +1 -1
- package/dist/deprecated/DialogV1/Dialog.js +1 -1
- package/dist/deprecated/FilteredSearch/FilteredSearch.js +1 -1
- package/dist/deprecated/UnderlineNav/UnderlineNav.js +1 -1
- package/dist/experimental/IssueLabel/IssueLabel.js +1 -1
- package/dist/experimental/Tabs/Tabs.js +22 -25
- package/dist/experimental/Tabs/useTab.js +1 -1
- package/dist/experimental/Tabs/useTabList.js +17 -21
- package/dist/experimental/Tabs/useTabPanel.js +1 -1
- package/dist/experimental/UnderlinePanels/UnderlinePanels.js +8 -13
- package/dist/hooks/useDetails.js +1 -1
- package/dist/hooks/useDialog.js +1 -1
- package/dist/hooks/useMedia.js +1 -1
- package/dist/hooks/useMenuInitialFocus.js +1 -1
- package/dist/hooks/useMenuKeyboardNavigation.js +1 -1
- package/dist/hooks/useMergedRefs.js +1 -1
- package/dist/hooks/useMnemonics.js +1 -1
- package/dist/hooks/useOpenAndCloseFocus.js +1 -1
- package/dist/hooks/useOverflow.js +1 -1
- package/dist/hooks/useOverlay.js +1 -1
- package/dist/hooks/useProvidedStateOrCreate.js +1 -1
- package/dist/hooks/useRefObjectAsForwardedRef.js +1 -1
- package/dist/hooks/useRenderForcingRef.js +1 -1
- package/dist/hooks/useScrollFlash.js +1 -1
- package/dist/hooks/useSyncedState.js +1 -1
- package/dist/internal/components/ButtonReset.js +1 -1
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroup.js +1 -1
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupCaption.js +1 -1
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupLabel.js +1 -1
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupValidation.js +1 -1
- package/dist/internal/components/ConditionalWrapper.js +1 -1
- package/dist/internal/components/InputLabel.js +1 -1
- package/dist/internal/components/InputValidation.js +1 -1
- package/dist/internal/components/OverflowObserverProvider.js +1 -1
- package/dist/internal/components/TextInputInnerAction.js +1 -1
- package/dist/internal/components/TextInputInnerVisualSlot.js +1 -1
- package/dist/internal/components/TextInputWrapper.js +1 -1
- package/dist/internal/components/ThemeProviderBase.js +1 -1
- package/dist/internal/components/UnderlineTabbedInterface.js +1 -1
- package/dist/internal/components/UnstyledTextInput.js +1 -1
- package/dist/internal/components/ValidationAnimationContainer.js +1 -1
- package/dist/internal/hooks/useEffectCallback.js +1 -1
- package/dist/internal/hooks/useEffectOnce.js +1 -1
- package/dist/internal/hooks/useOverflowObserver.js +1 -1
- package/dist/internal/hooks/useThemeProvider.js +1 -1
- package/dist/live-region/Announce.js +2 -2
- package/dist/live-region/AriaAlert.js +1 -1
- package/dist/live-region/AriaStatus.js +1 -1
- package/dist/next/ThemeProvider.js +1 -1
- package/dist/utils/descendant-registry.js +1 -1
- package/dist/utils/react-compiler-runtime.js +32 -0
- package/generated/components.json +6 -6
- package/package.json +2 -2
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React, { useMemo } from "react";
|
|
2
|
+
//#region src/utils/react-compiler-runtime.ts
|
|
3
|
+
/**
|
|
4
|
+
* Local, bundled replacement for the `c` helper exported by
|
|
5
|
+
* `react-compiler-runtime`.
|
|
6
|
+
*
|
|
7
|
+
* The React Compiler emits `import {c} from 'react-compiler-runtime'`. The build
|
|
8
|
+
* aliases that import to this module so the helper is bundled into
|
|
9
|
+
* `@primer/react` as plain ES modules instead of being resolved as an external
|
|
10
|
+
* CommonJS dependency. Leaving it external ships a bare cross-chunk import that
|
|
11
|
+
* can crash (`TypeError: (0, t.c) is not a function`) when a consumer's bundle
|
|
12
|
+
* graph resolves a skewed or duplicate copy across independently-cached chunks.
|
|
13
|
+
*
|
|
14
|
+
* The behavior mirrors `react-compiler-runtime`: prefer React's built-in
|
|
15
|
+
* compiler runtime when it is available (React 19+), otherwise fall back to a
|
|
16
|
+
* `useMemo`-backed cache. This module is excluded from the React Compiler (see
|
|
17
|
+
* `script/react-compiler.mjs`) so it does not attempt to compile the helper that
|
|
18
|
+
* backs the compiler's own runtime.
|
|
19
|
+
*/
|
|
20
|
+
const MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel");
|
|
21
|
+
function useMemoCache(size) {
|
|
22
|
+
return useMemo(() => {
|
|
23
|
+
const cache = new Array(size);
|
|
24
|
+
for (let index = 0; index < size; index++) cache[index] = MEMO_CACHE_SENTINEL;
|
|
25
|
+
cache[MEMO_CACHE_SENTINEL] = true;
|
|
26
|
+
return cache;
|
|
27
|
+
}, []);
|
|
28
|
+
}
|
|
29
|
+
const builtinRuntime = React.__COMPILER_RUNTIME;
|
|
30
|
+
const c = typeof (builtinRuntime === null || builtinRuntime === void 0 ? void 0 : builtinRuntime.c) === "function" ? builtinRuntime.c : useMemoCache;
|
|
31
|
+
//#endregion
|
|
32
|
+
export { c, useMemoCache };
|
|
@@ -9775,19 +9775,19 @@
|
|
|
9775
9775
|
},
|
|
9776
9776
|
{
|
|
9777
9777
|
"id": "experimental-components-underlinepanels-features--controlled",
|
|
9778
|
-
"code": "() => {\n const [refType, setRefType] = useState('branch')\n return (\n <>\n <
|
|
9778
|
+
"code": "() => {\n const [refType, setRefType] = useState('branch')\n return (\n <>\n <UnderlinePanels\n aria-label=\"Ref type\"\n value={refType}\n onChange={({ value }) => {\n action('onChange')({\n value,\n })\n setRefType(value)\n }}\n >\n <UnderlinePanels.Tab value=\"branch\" icon={GitBranchIcon}>\n Branches\n </UnderlinePanels.Tab>\n <UnderlinePanels.Tab value=\"tag\" icon={TagIcon}>\n Tags\n </UnderlinePanels.Tab>\n <UnderlinePanels.Panel value=\"branch\">\n Find or create a branch…\n </UnderlinePanels.Panel>\n <UnderlinePanels.Panel value=\"tag\">\n Search or create a new tag…\n </UnderlinePanels.Panel>\n </UnderlinePanels>\n <p>\n Selected ref type: <strong>{refType}</strong>\n </p>\n </>\n )\n}"
|
|
9779
9779
|
},
|
|
9780
9780
|
{
|
|
9781
9781
|
"id": "experimental-components-underlinepanels-features--uncontrolled",
|
|
9782
|
-
"code": "() => (\n <>\n <
|
|
9782
|
+
"code": "() => (\n <>\n <UnderlinePanels\n aria-label=\"Ref type\"\n defaultValue=\"tag\"\n onChange={({ value }) => {\n action('onChange')({\n value,\n })\n }}\n >\n <UnderlinePanels.Tab value=\"branch\">Branches</UnderlinePanels.Tab>\n <UnderlinePanels.Tab value=\"tag\">Tags</UnderlinePanels.Tab>\n <UnderlinePanels.Panel value=\"branch\">\n Find or create a branch…\n </UnderlinePanels.Panel>\n <UnderlinePanels.Panel value=\"tag\">\n Search or create a new tag…\n </UnderlinePanels.Panel>\n </UnderlinePanels>\n </>\n)"
|
|
9783
9783
|
},
|
|
9784
9784
|
{
|
|
9785
9785
|
"id": "experimental-components-underlinepanels-features--manual-activation",
|
|
9786
|
-
"code": "() => {\n const [refType, setRefType] = useState('branch')\n return (\n <>\n <
|
|
9786
|
+
"code": "() => {\n const [refType, setRefType] = useState('branch')\n return (\n <>\n <p>\n With <code>activationMode="manual"</code>, arrow keys only\n move focus; press Enter or Space (or click) to commit selection. Prefer\n this when switching tabs triggers async work like a fetch.\n </p>\n <UnderlinePanels\n aria-label=\"Ref type\"\n value={refType}\n activationMode=\"manual\"\n onChange={({ value }) => {\n action('onChange')({\n value,\n })\n setRefType(value)\n }}\n >\n <UnderlinePanels.Tab value=\"branch\">Branches</UnderlinePanels.Tab>\n <UnderlinePanels.Tab value=\"tag\">Tags</UnderlinePanels.Tab>\n <UnderlinePanels.Panel value=\"branch\">\n Find or create a branch…\n </UnderlinePanels.Panel>\n <UnderlinePanels.Panel value=\"tag\">\n Search or create a new tag…\n </UnderlinePanels.Panel>\n </UnderlinePanels>\n </>\n )\n}"
|
|
9787
9787
|
},
|
|
9788
9788
|
{
|
|
9789
9789
|
"id": "experimental-components-underlinepanels-features--in-overlay",
|
|
9790
|
-
"code": "() => {\n const [open, setOpen] = useState(false)\n const [refType, setRefType] = useState('branch')\n return (\n <>\n <
|
|
9790
|
+
"code": "() => {\n const [open, setOpen] = useState(false)\n const [refType, setRefType] = useState('branch')\n return (\n <>\n <AnchoredOverlay\n open={open}\n onOpen={() => setOpen(true)}\n onClose={() => setOpen(false)}\n renderAnchor={(props) => <Button {...props}>Select ref type</Button>}\n overlayProps={{\n role: 'dialog',\n 'aria-modal': true,\n 'aria-label': 'Select a ref type',\n style: {\n width: '320px',\n },\n }}\n focusZoneSettings={{\n disabled: true,\n }}\n >\n <UnderlinePanels\n aria-label=\"Ref type\"\n value={refType}\n onChange={({ value }) => {\n action('onChange')({\n value,\n })\n setRefType(value)\n }}\n >\n <UnderlinePanels.Tab value=\"branch\">Branches</UnderlinePanels.Tab>\n <UnderlinePanels.Tab value=\"tag\">Tags</UnderlinePanels.Tab>\n <UnderlinePanels.Panel value=\"branch\">\n Find or create a branch…\n </UnderlinePanels.Panel>\n <UnderlinePanels.Panel value=\"tag\">\n Search or create a new tag…\n </UnderlinePanels.Panel>\n </UnderlinePanels>\n </AnchoredOverlay>\n </>\n )\n}"
|
|
9791
9791
|
}
|
|
9792
9792
|
],
|
|
9793
9793
|
"importPath": "@primer/react/experimental",
|
|
@@ -9808,7 +9808,7 @@
|
|
|
9808
9808
|
"name": "value",
|
|
9809
9809
|
"type": "string",
|
|
9810
9810
|
"defaultValue": "",
|
|
9811
|
-
"description": "The value of the selected tab, keyed to each `UnderlinePanels.Tab`/`UnderlinePanels.Panel` `value`. Provide this (with `onChange`) for a controlled component where the selected tab is the single source of truth.
|
|
9811
|
+
"description": "The value of the selected tab, keyed to each `UnderlinePanels.Tab`/`UnderlinePanels.Panel` `value`. Provide this (with `onChange`) for a controlled component where the selected tab is the single source of truth."
|
|
9812
9812
|
},
|
|
9813
9813
|
{
|
|
9814
9814
|
"name": "defaultValue",
|
|
@@ -9826,7 +9826,7 @@
|
|
|
9826
9826
|
"name": "activationMode",
|
|
9827
9827
|
"type": "'automatic' | 'manual'",
|
|
9828
9828
|
"defaultValue": "'automatic'",
|
|
9829
|
-
"description": "Controls how tabs are activated with the keyboard. `'automatic'` selects on focus (Arrow/Home/End select immediately); `'manual'` moves focus only and commits selection on Enter, Space, or click. Prefer `'manual'` when displaying a panel is not instant (e.g. it triggers a network request).
|
|
9829
|
+
"description": "Controls how tabs are activated with the keyboard. `'automatic'` selects on focus (Arrow/Home/End select immediately); `'manual'` moves focus only and commits selection on Enter, Space, or click. Prefer `'manual'` when displaying a panel is not instant (e.g. it triggers a network request)."
|
|
9830
9830
|
},
|
|
9831
9831
|
{
|
|
9832
9832
|
"name": "children",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@primer/react",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "38.39.0
|
|
4
|
+
"version": "38.39.0",
|
|
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",
|
|
@@ -90,7 +90,6 @@
|
|
|
90
90
|
"hsluv": "1.0.1",
|
|
91
91
|
"lodash.isempty": "^4.4.0",
|
|
92
92
|
"lodash.isobject": "^3.0.2",
|
|
93
|
-
"react-compiler-runtime": "^1.0.0",
|
|
94
93
|
"react-intersection-observer": "^10.0.3"
|
|
95
94
|
},
|
|
96
95
|
"devDependencies": {
|
|
@@ -162,6 +161,7 @@
|
|
|
162
161
|
"postcss-preset-primer": "^0.0.0",
|
|
163
162
|
"publint": "^0.3.15",
|
|
164
163
|
"react": "18.3.1",
|
|
164
|
+
"react-compiler-runtime": "^1.0.0",
|
|
165
165
|
"react-dom": "18.3.1",
|
|
166
166
|
"react-is": "18.3.1",
|
|
167
167
|
"recast": "0.23.7",
|