@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
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { c } from "../../utils/react-compiler-runtime.js";
|
|
1
2
|
import FilteredSearch_module_css_default from "./FilteredSearch.module.css.js";
|
|
2
|
-
import { c } from "react-compiler-runtime";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
import { clsx } from "clsx";
|
|
5
5
|
//#region src/deprecated/FilteredSearch/FilteredSearch.tsx
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { c } from "../../utils/react-compiler-runtime.js";
|
|
1
2
|
import UnderlineNav_module_css_default from "./UnderlineNav.module.css.js";
|
|
2
|
-
import { c } from "react-compiler-runtime";
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { clsx } from "clsx";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { c } from "../../utils/react-compiler-runtime.js";
|
|
1
2
|
import IssueLabel_module_css_default from "./IssueLabel.module.css.js";
|
|
2
|
-
import { c } from "react-compiler-runtime";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
import { clsx } from "clsx";
|
|
5
5
|
import { readableColor } from "color2k";
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
+
import { c } from "../../utils/react-compiler-runtime.js";
|
|
1
2
|
import useIsomorphicLayoutEffect from "../../utils/useIsomorphicLayoutEffect.js";
|
|
2
|
-
import { useFeatureFlag } from "../../FeatureFlags/useFeatureFlag.js";
|
|
3
3
|
import { useControllableState } from "../../hooks/useControllableState.js";
|
|
4
4
|
import { TabsContext } from "./TabsContext.js";
|
|
5
|
-
import { c } from "react-compiler-runtime";
|
|
6
5
|
import React, { useId } from "react";
|
|
7
6
|
import { jsx } from "react/jsx-runtime";
|
|
8
7
|
//#region src/experimental/Tabs/Tabs.tsx
|
|
@@ -15,12 +14,11 @@ import { jsx } from "react/jsx-runtime";
|
|
|
15
14
|
*/
|
|
16
15
|
function Tabs(props) {
|
|
17
16
|
var _props$id, _props$activationMode, _props$defaultValue;
|
|
18
|
-
const $ = c(
|
|
17
|
+
const $ = c(15);
|
|
19
18
|
const { children, onValueChange } = props;
|
|
20
19
|
const generatedId = useId();
|
|
21
20
|
const groupId = (_props$id = props.id) !== null && _props$id !== void 0 ? _props$id : generatedId;
|
|
22
|
-
const
|
|
23
|
-
const activationMode = controlledApiEnabled ? (_props$activationMode = props.activationMode) !== null && _props$activationMode !== void 0 ? _props$activationMode : "automatic" : "automatic";
|
|
21
|
+
const activationMode = (_props$activationMode = props.activationMode) !== null && _props$activationMode !== void 0 ? _props$activationMode : "automatic";
|
|
24
22
|
const t0 = (_props$defaultValue = props.defaultValue) !== null && _props$defaultValue !== void 0 ? _props$defaultValue : props.value;
|
|
25
23
|
let t1;
|
|
26
24
|
if ($[0] !== props.value || $[1] !== t0) {
|
|
@@ -37,7 +35,7 @@ function Tabs(props) {
|
|
|
37
35
|
const [focusedValue, setFocusedValue] = React.useState();
|
|
38
36
|
const savedOnValueChange = React.useRef(onValueChange);
|
|
39
37
|
let t2;
|
|
40
|
-
if ($[3] !== activationMode || $[4] !==
|
|
38
|
+
if ($[3] !== activationMode || $[4] !== focusedValue || $[5] !== groupId || $[6] !== selectedValue || $[7] !== setSelectedValue) {
|
|
41
39
|
t2 = {
|
|
42
40
|
groupId,
|
|
43
41
|
selectedValue,
|
|
@@ -46,7 +44,7 @@ function Tabs(props) {
|
|
|
46
44
|
selectTab(value) {
|
|
47
45
|
var _savedOnValueChange$c;
|
|
48
46
|
setFocusedValue(void 0);
|
|
49
|
-
if (
|
|
47
|
+
if (value === selectedValue) return;
|
|
50
48
|
setSelectedValue(value);
|
|
51
49
|
(_savedOnValueChange$c = savedOnValueChange.current) === null || _savedOnValueChange$c === void 0 || _savedOnValueChange$c.call(savedOnValueChange, { value });
|
|
52
50
|
},
|
|
@@ -55,39 +53,38 @@ function Tabs(props) {
|
|
|
55
53
|
}
|
|
56
54
|
};
|
|
57
55
|
$[3] = activationMode;
|
|
58
|
-
$[4] =
|
|
59
|
-
$[5] =
|
|
60
|
-
$[6] =
|
|
61
|
-
$[7] =
|
|
62
|
-
$[8] =
|
|
63
|
-
|
|
64
|
-
} else t2 = $[9];
|
|
56
|
+
$[4] = focusedValue;
|
|
57
|
+
$[5] = groupId;
|
|
58
|
+
$[6] = selectedValue;
|
|
59
|
+
$[7] = setSelectedValue;
|
|
60
|
+
$[8] = t2;
|
|
61
|
+
} else t2 = $[8];
|
|
65
62
|
const contextValue = t2;
|
|
66
63
|
let t3;
|
|
67
64
|
let t4;
|
|
68
|
-
if ($[
|
|
65
|
+
if ($[9] !== onValueChange) {
|
|
69
66
|
t3 = () => {
|
|
70
67
|
savedOnValueChange.current = onValueChange;
|
|
71
68
|
};
|
|
72
69
|
t4 = [onValueChange];
|
|
73
|
-
$[
|
|
74
|
-
$[
|
|
75
|
-
$[
|
|
70
|
+
$[9] = onValueChange;
|
|
71
|
+
$[10] = t3;
|
|
72
|
+
$[11] = t4;
|
|
76
73
|
} else {
|
|
77
|
-
t3 = $[
|
|
78
|
-
t4 = $[
|
|
74
|
+
t3 = $[10];
|
|
75
|
+
t4 = $[11];
|
|
79
76
|
}
|
|
80
77
|
useIsomorphicLayoutEffect(t3, t4);
|
|
81
78
|
let t5;
|
|
82
|
-
if ($[
|
|
79
|
+
if ($[12] !== children || $[13] !== contextValue) {
|
|
83
80
|
t5 = /*#__PURE__*/ jsx(TabsContext.Provider, {
|
|
84
81
|
value: contextValue,
|
|
85
82
|
children
|
|
86
83
|
});
|
|
87
|
-
$[
|
|
88
|
-
$[
|
|
89
|
-
$[
|
|
90
|
-
} else t5 = $[
|
|
84
|
+
$[12] = children;
|
|
85
|
+
$[13] = contextValue;
|
|
86
|
+
$[14] = t5;
|
|
87
|
+
} else t5 = $[14];
|
|
91
88
|
return t5;
|
|
92
89
|
}
|
|
93
90
|
//#endregion
|
|
@@ -1,31 +1,28 @@
|
|
|
1
|
+
import { c } from "../../utils/react-compiler-runtime.js";
|
|
1
2
|
import { useMergedRefs } from "../../hooks/useMergedRefs.js";
|
|
2
3
|
import { useProvidedRefOrCreate } from "../../hooks/useProvidedRefOrCreate.js";
|
|
3
4
|
import { useFeatureFlag } from "../../FeatureFlags/useFeatureFlag.js";
|
|
4
|
-
import { c } from "react-compiler-runtime";
|
|
5
5
|
import { useRef } from "react";
|
|
6
6
|
//#region src/experimental/Tabs/useTabList.ts
|
|
7
7
|
function useTabList(props) {
|
|
8
|
-
const $ = c(
|
|
8
|
+
const $ = c(9);
|
|
9
9
|
const { "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-orientation": ariaOrientation } = props;
|
|
10
10
|
const mergedRefEnabled = useFeatureFlag("primer_react_merged_forwarded_refs");
|
|
11
|
-
const controlledApiEnabled = useFeatureFlag("primer_react_underline_panels_controlled");
|
|
12
11
|
const tabListRef = useRef(null);
|
|
13
12
|
const mergedRef = useMergedRefs(tabListRef, props.ref);
|
|
14
13
|
const providedOrCreatedRef = useProvidedRefOrCreate(props.ref);
|
|
15
14
|
const readRef = mergedRefEnabled ? tabListRef : providedOrCreatedRef;
|
|
16
15
|
const appliedRef = mergedRefEnabled ? mergedRef : providedOrCreatedRef;
|
|
17
16
|
let t0;
|
|
18
|
-
if ($[0] !== ariaOrientation || $[1] !==
|
|
17
|
+
if ($[0] !== ariaOrientation || $[1] !== readRef) {
|
|
19
18
|
t0 = (event) => {
|
|
20
19
|
const { current: tablist } = readRef;
|
|
21
20
|
if (tablist === null) return;
|
|
22
21
|
const tabs = getFocusableTabs(tablist);
|
|
23
22
|
const getCurrentIndex = () => {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
if (focusedIndex !== -1) return focusedIndex;
|
|
28
|
-
}
|
|
23
|
+
const activeElement = tablist.ownerDocument.activeElement;
|
|
24
|
+
const focusedIndex = activeElement instanceof HTMLElement ? tabs.indexOf(activeElement) : -1;
|
|
25
|
+
if (focusedIndex !== -1) return focusedIndex;
|
|
29
26
|
return tabs.findIndex(_temp);
|
|
30
27
|
};
|
|
31
28
|
const isVertical = ariaOrientation === "vertical";
|
|
@@ -50,14 +47,13 @@ function useTabList(props) {
|
|
|
50
47
|
}
|
|
51
48
|
};
|
|
52
49
|
$[0] = ariaOrientation;
|
|
53
|
-
$[1] =
|
|
54
|
-
$[2] =
|
|
55
|
-
|
|
56
|
-
} else t0 = $[3];
|
|
50
|
+
$[1] = readRef;
|
|
51
|
+
$[2] = t0;
|
|
52
|
+
} else t0 = $[2];
|
|
57
53
|
const onKeyDown = t0;
|
|
58
54
|
const t1 = ariaOrientation !== null && ariaOrientation !== void 0 ? ariaOrientation : "horizontal";
|
|
59
55
|
let t2;
|
|
60
|
-
if ($[
|
|
56
|
+
if ($[3] !== appliedRef || $[4] !== ariaLabel || $[5] !== ariaLabelledby || $[6] !== onKeyDown || $[7] !== t1) {
|
|
61
57
|
t2 = { tabListProps: {
|
|
62
58
|
ref: appliedRef,
|
|
63
59
|
"aria-label": ariaLabel,
|
|
@@ -66,13 +62,13 @@ function useTabList(props) {
|
|
|
66
62
|
role: "tablist",
|
|
67
63
|
onKeyDown
|
|
68
64
|
} };
|
|
69
|
-
$[
|
|
70
|
-
$[
|
|
71
|
-
$[
|
|
72
|
-
$[
|
|
73
|
-
$[
|
|
74
|
-
$[
|
|
75
|
-
} else t2 = $[
|
|
65
|
+
$[3] = appliedRef;
|
|
66
|
+
$[4] = ariaLabel;
|
|
67
|
+
$[5] = ariaLabelledby;
|
|
68
|
+
$[6] = onKeyDown;
|
|
69
|
+
$[7] = t1;
|
|
70
|
+
$[8] = t2;
|
|
71
|
+
} else t2 = $[8];
|
|
76
72
|
return t2;
|
|
77
73
|
}
|
|
78
74
|
function _temp(tab) {
|
|
@@ -3,7 +3,6 @@ import { useResizeObserver } from "../../hooks/useResizeObserver.js";
|
|
|
3
3
|
import { useId as useId$1 } from "../../hooks/useId.js";
|
|
4
4
|
import { warning } from "../../utils/warning.js";
|
|
5
5
|
import { isSlot } from "../../utils/is-slot.js";
|
|
6
|
-
import { useFeatureFlag } from "../../FeatureFlags/useFeatureFlag.js";
|
|
7
6
|
import { invariant } from "../../utils/invariant.js";
|
|
8
7
|
import { UnderlineItem, UnderlineItemList, UnderlineWrapper } from "../../internal/components/UnderlineTabbedInterface.js";
|
|
9
8
|
import UnderlinePanels_module_css_default from "./UnderlinePanels.module.css.js";
|
|
@@ -19,12 +18,8 @@ const UnderlinePanelsContext = /*#__PURE__*/ createContext({
|
|
|
19
18
|
iconsVisible: true,
|
|
20
19
|
loadingCounters: void 0
|
|
21
20
|
});
|
|
22
|
-
const UnderlinePanels = ({ "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, children, loadingCounters, className, value:
|
|
21
|
+
const UnderlinePanels = ({ "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, children, loadingCounters, className, value: controlledValue, defaultValue, onChange, activationMode = "automatic", ...props }) => {
|
|
23
22
|
var _tabValues$;
|
|
24
|
-
const controlledApiEnabled = useFeatureFlag("primer_react_underline_panels_controlled");
|
|
25
|
-
const controlledValue = controlledApiEnabled ? valueProp : void 0;
|
|
26
|
-
const defaultValue = controlledApiEnabled ? defaultValueProp : void 0;
|
|
27
|
-
const onChange = controlledApiEnabled ? onChangeProp : void 0;
|
|
28
23
|
const [iconsVisible, setIconsVisible] = useState(true);
|
|
29
24
|
const wrapperRef = useRef(null);
|
|
30
25
|
const listRef = useRef(null);
|
|
@@ -34,14 +29,14 @@ const UnderlinePanels = ({ "aria-label": ariaLabel, "aria-labelledby": ariaLabel
|
|
|
34
29
|
let panelIndex = 0;
|
|
35
30
|
const childrenWithProps = Children.map(children, (child) => {
|
|
36
31
|
if (/*#__PURE__*/ isValidElement(child) && (child.type === Tab || isSlot(child, Tab))) {
|
|
37
|
-
var
|
|
38
|
-
const value = (
|
|
32
|
+
var _child$props$value;
|
|
33
|
+
const value = (_child$props$value = child.props.value) !== null && _child$props$value !== void 0 ? _child$props$value : `${tabIndex}`;
|
|
39
34
|
tabIndex++;
|
|
40
35
|
return /*#__PURE__*/ cloneElement(child, { value });
|
|
41
36
|
}
|
|
42
37
|
if (/*#__PURE__*/ isValidElement(child) && (child.type === Panel || isSlot(child, Panel))) {
|
|
43
|
-
var
|
|
44
|
-
const value = (
|
|
38
|
+
var _child$props$value2;
|
|
39
|
+
const value = (_child$props$value2 = child.props.value) !== null && _child$props$value2 !== void 0 ? _child$props$value2 : `${panelIndex}`;
|
|
45
40
|
panelIndex++;
|
|
46
41
|
return /*#__PURE__*/ cloneElement(child, { value });
|
|
47
42
|
}
|
|
@@ -74,11 +69,11 @@ const UnderlinePanels = ({ "aria-label": ariaLabel, "aria-labelledby": ariaLabel
|
|
|
74
69
|
tabValues,
|
|
75
70
|
panelValues
|
|
76
71
|
];
|
|
77
|
-
}, [children
|
|
72
|
+
}, [children]);
|
|
78
73
|
const isControlled = controlledValue !== void 0;
|
|
79
74
|
const [uncontrolledValue, setUncontrolledValue] = useState(() => {
|
|
80
|
-
var
|
|
81
|
-
return (
|
|
75
|
+
var _ref;
|
|
76
|
+
return (_ref = defaultValue !== null && defaultValue !== void 0 ? defaultValue : selectedFromProps) !== null && _ref !== void 0 ? _ref : "0";
|
|
82
77
|
});
|
|
83
78
|
const [prevSelectedFromProps, setPrevSelectedFromProps] = useState(selectedFromProps);
|
|
84
79
|
if (!isControlled && selectedFromProps !== prevSelectedFromProps) {
|
package/dist/hooks/useDetails.js
CHANGED
package/dist/hooks/useDialog.js
CHANGED
package/dist/hooks/useMedia.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { c } from "../utils/react-compiler-runtime.js";
|
|
1
2
|
import { warning } from "../utils/warning.js";
|
|
2
3
|
import { MatchMediaContext } from "./MatchMediaContext.js";
|
|
3
|
-
import { c } from "react-compiler-runtime";
|
|
4
4
|
import { useContext, useSyncExternalStore } from "react";
|
|
5
5
|
//#region src/hooks/useMedia.ts
|
|
6
6
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { c } from "../utils/react-compiler-runtime.js";
|
|
1
2
|
import { useMenuInitialFocus } from "./useMenuInitialFocus.js";
|
|
2
3
|
import { useMnemonics } from "./useMnemonics.js";
|
|
3
|
-
import { c } from "react-compiler-runtime";
|
|
4
4
|
import React from "react";
|
|
5
5
|
import { iterateFocusableElements } from "@primer/behaviors/utils";
|
|
6
6
|
//#region src/hooks/useMenuKeyboardNavigation.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { c } from "../utils/react-compiler-runtime.js";
|
|
1
2
|
import { isExperimentalReactVersion, reactMajorVersion } from "../utils/environment.js";
|
|
2
|
-
import { c } from "react-compiler-runtime";
|
|
3
3
|
import { version } from "react";
|
|
4
4
|
//#region src/hooks/useMergedRefs.ts
|
|
5
5
|
var _version$split$;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { c } from "../utils/react-compiler-runtime.js";
|
|
1
2
|
import { useProvidedRefOrCreate } from "./useProvidedRefOrCreate.js";
|
|
2
|
-
import { c } from "react-compiler-runtime";
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { iterateFocusableElements } from "@primer/behaviors/utils";
|
|
5
5
|
//#region src/hooks/useMnemonics.ts
|
package/dist/hooks/useOverlay.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { c } from "../utils/react-compiler-runtime.js";
|
|
1
2
|
import { useOnOutsideClick } from "./useOnOutsideClick.js";
|
|
2
3
|
import { useProvidedRefOrCreate } from "./useProvidedRefOrCreate.js";
|
|
3
4
|
import { useOnEscapePress } from "./useOnEscapePress.js";
|
|
4
5
|
import { useOpenAndCloseFocus } from "./useOpenAndCloseFocus.js";
|
|
5
|
-
import { c } from "react-compiler-runtime";
|
|
6
6
|
//#region src/hooks/useOverlay.tsx
|
|
7
7
|
const useOverlay = (t0) => {
|
|
8
8
|
const $ = c(13);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { c } from "../../utils/react-compiler-runtime.js";
|
|
1
2
|
import ButtonReset_module_css_default from "./ButtonReset.module.css.js";
|
|
2
|
-
import { c } from "react-compiler-runtime";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
import { clsx } from "clsx";
|
|
5
5
|
//#region src/internal/components/ButtonReset.tsx
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { c } from "../../../utils/react-compiler-runtime.js";
|
|
1
2
|
import { useId as useId$1 } from "../../../hooks/useId.js";
|
|
2
3
|
import { useSlots } from "../../../hooks/useSlots.js";
|
|
3
4
|
import VisuallyHidden from "../../../_VisuallyHidden.js";
|
|
@@ -7,7 +8,6 @@ import CheckboxOrRadioGroup_module_css_default from "./CheckboxOrRadioGroup.modu
|
|
|
7
8
|
import CheckboxOrRadioGroupCaption from "./CheckboxOrRadioGroupCaption.js";
|
|
8
9
|
import CheckboxOrRadioGroupLabel from "./CheckboxOrRadioGroupLabel.js";
|
|
9
10
|
import CheckboxOrRadioGroupValidation from "./CheckboxOrRadioGroupValidation.js";
|
|
10
|
-
import { c } from "react-compiler-runtime";
|
|
11
11
|
import React from "react";
|
|
12
12
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
13
13
|
import { clsx } from "clsx";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { c } from "../../../utils/react-compiler-runtime.js";
|
|
1
2
|
import Text_default from "../../../Text/Text.js";
|
|
2
3
|
import CheckboxOrRadioGroupContext from "./CheckboxOrRadioGroupContext.js";
|
|
3
4
|
import CheckboxOrRadioGroup_module_css_default from "./CheckboxOrRadioGroup.module.css.js";
|
|
4
|
-
import { c } from "react-compiler-runtime";
|
|
5
5
|
import React from "react";
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
7
7
|
import { clsx } from "clsx";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { c } from "../../../utils/react-compiler-runtime.js";
|
|
1
2
|
import VisuallyHidden from "../../../_VisuallyHidden.js";
|
|
2
3
|
import CheckboxOrRadioGroupContext from "./CheckboxOrRadioGroupContext.js";
|
|
3
4
|
import CheckboxOrRadioGroup_module_css_default from "./CheckboxOrRadioGroup.module.css.js";
|
|
4
5
|
import { Stack } from "../../../Stack/index.js";
|
|
5
|
-
import { c } from "react-compiler-runtime";
|
|
6
6
|
import React from "react";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
import { clsx } from "clsx";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { c } from "../../../utils/react-compiler-runtime.js";
|
|
1
2
|
import CheckboxOrRadioGroupContext from "./CheckboxOrRadioGroupContext.js";
|
|
2
3
|
import InputValidation from "../InputValidation.js";
|
|
3
|
-
import { c } from "react-compiler-runtime";
|
|
4
4
|
import React from "react";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
//#region src/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupValidation.tsx
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { c } from "../../utils/react-compiler-runtime.js";
|
|
1
2
|
import InputLabel_module_css_default from "./InputLabel.module.css.js";
|
|
2
|
-
import { c } from "react-compiler-runtime";
|
|
3
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
import { clsx } from "clsx";
|
|
5
5
|
//#region src/internal/components/InputLabel.tsx
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { c } from "../../utils/react-compiler-runtime.js";
|
|
1
2
|
import Text_default from "../../Text/Text.js";
|
|
2
3
|
import InputValidation_module_css_default from "./InputValidation.module.css.js";
|
|
3
|
-
import { c } from "react-compiler-runtime";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { clsx } from "clsx";
|
|
6
6
|
import { AlertFillIcon, CheckCircleFillIcon } from "@primer/octicons-react";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { c } from "../../utils/react-compiler-runtime.js";
|
|
1
2
|
import useIsomorphicLayoutEffect from "../../utils/useIsomorphicLayoutEffect.js";
|
|
2
3
|
import { OverflowObserverContext } from "../hooks/useOverflowObserver.js";
|
|
3
|
-
import { c } from "react-compiler-runtime";
|
|
4
4
|
import { useEffect, useRef } from "react";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
//#region src/internal/components/OverflowObserverProvider.tsx
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { c } from "../../utils/react-compiler-runtime.js";
|
|
1
2
|
import { Tooltip } from "../../TooltipV2/Tooltip.js";
|
|
2
3
|
import { IconButton } from "../../Button/IconButton.js";
|
|
3
4
|
import { ButtonComponent } from "../../Button/Button.js";
|
|
4
5
|
import TextInputInnerAction_module_css_default from "./TextInputInnerAction.module.css.js";
|
|
5
|
-
import { c } from "react-compiler-runtime";
|
|
6
6
|
import { forwardRef } from "react";
|
|
7
7
|
import { Fragment as Fragment$1, jsx } from "react/jsx-runtime";
|
|
8
8
|
import { clsx } from "clsx";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { c } from "../../utils/react-compiler-runtime.js";
|
|
1
2
|
import Spinner from "../../Spinner/Spinner.js";
|
|
2
3
|
import TextInputInnerVisualSlot_module_css_default from "./TextInputInnerVisualSlot.module.css.js";
|
|
3
|
-
import { c } from "react-compiler-runtime";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { clsx } from "clsx";
|
|
6
6
|
//#region src/internal/components/TextInputInnerVisualSlot.tsx
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { c } from "../../utils/react-compiler-runtime.js";
|
|
1
2
|
import TextInputWrapper_module_css_default from "./TextInputWrapper.module.css.js";
|
|
2
|
-
import { c } from "react-compiler-runtime";
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
import { clsx } from "clsx";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { c } from "../../utils/react-compiler-runtime.js";
|
|
1
2
|
import { ThemeContext } from "../../ThemeContext.js";
|
|
2
|
-
import { c } from "react-compiler-runtime";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
//#region src/internal/components/ThemeProviderBase.tsx
|
|
5
5
|
const ThemeProviderBase = (t0) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { c } from "../../utils/react-compiler-runtime.js";
|
|
1
2
|
import CounterLabel from "../../CounterLabel/CounterLabel.js";
|
|
2
3
|
import UnderlineTabbedInterface_module_css_default from "./UnderlineTabbedInterface.module.css.js";
|
|
3
|
-
import { c } from "react-compiler-runtime";
|
|
4
4
|
import React, { forwardRef } from "react";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { clsx } from "clsx";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { c } from "../../utils/react-compiler-runtime.js";
|
|
1
2
|
import UnstyledTextInput_module_css_default from "./UnstyledTextInput.module.css.js";
|
|
2
|
-
import { c } from "react-compiler-runtime";
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
import { clsx } from "clsx";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { c } from "../../utils/react-compiler-runtime.js";
|
|
1
2
|
import ValidationAnimationContainer_module_css_default from "./ValidationAnimationContainer.module.css.js";
|
|
2
|
-
import { c } from "react-compiler-runtime";
|
|
3
3
|
import { useState } from "react";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
//#region src/internal/components/ValidationAnimationContainer.tsx
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c } from "react-compiler-runtime";
|
|
1
|
+
import { c } from "../../utils/react-compiler-runtime.js";
|
|
2
2
|
import { createContext, useContext, useRef, useSyncExternalStore } from "react";
|
|
3
3
|
//#region src/internal/hooks/useOverflowObserver.ts
|
|
4
4
|
/** Subscribe a single observed element to the shared `IntersectionObserver`. Returns an unsubscribe function. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { c } from "../../utils/react-compiler-runtime.js";
|
|
1
2
|
import { useSyncedState } from "../../hooks/useSyncedState.js";
|
|
2
3
|
import { useTheme } from "../../useTheme.js";
|
|
3
|
-
import { c } from "react-compiler-runtime";
|
|
4
4
|
import React from "react";
|
|
5
5
|
//#region src/internal/hooks/useThemeProvider.ts
|
|
6
6
|
const defaultColorMode = "day";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { c } from "../utils/react-compiler-runtime.js";
|
|
1
2
|
import { useEffectOnce } from "../internal/hooks/useEffectOnce.js";
|
|
2
3
|
import { useEffectCallback } from "../internal/hooks/useEffectCallback.js";
|
|
3
|
-
import { c } from "react-compiler-runtime";
|
|
4
|
-
import { announceFromElement } from "@primer/live-region-element";
|
|
5
4
|
import { useEffect, useRef } from "react";
|
|
5
|
+
import { announceFromElement } from "@primer/live-region-element";
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
7
7
|
//#region src/live-region/Announce.tsx
|
|
8
8
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { c } from "../utils/react-compiler-runtime.js";
|
|
1
2
|
import { ThemeProviderBase } from "../internal/components/ThemeProviderBase.js";
|
|
2
3
|
import { useThemeProvider } from "../internal/hooks/useThemeProvider.js";
|
|
3
|
-
import { c } from "react-compiler-runtime";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
//#region src/next/ThemeProvider.tsx
|
|
6
6
|
const ThemeProvider = (t0) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { c } from "./react-compiler-runtime.js";
|
|
1
2
|
import useIsomorphicLayoutEffect from "./useIsomorphicLayoutEffect.js";
|
|
2
|
-
import { c } from "react-compiler-runtime";
|
|
3
3
|
import { createContext, useContext, useEffect, useId, useReducer, useRef, useState } from "react";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
//#region src/utils/descendant-registry.tsx
|