@primer/react 0.0.0-20260714202217 → 0.0.0-20260715113945

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 (56) hide show
  1. package/CHANGELOG.md +15 -3
  2. package/dist/ActionBar/ActionBar-3767d551.css +2 -0
  3. package/dist/ActionBar/ActionBar-3767d551.css.map +1 -0
  4. package/dist/ActionBar/ActionBar.js +1 -1
  5. package/dist/ActionBar/ActionBar.module.css.js +1 -1
  6. package/dist/ActionList/Group.js +2 -2
  7. package/dist/ActionList/Item.js +1 -1
  8. package/dist/ActionList/List.js +11 -17
  9. package/dist/ActionMenu/ActionMenu.js +1 -1
  10. package/dist/AnchoredOverlay/AnchoredOverlay.js +5 -10
  11. package/dist/Autocomplete/AutocompleteInput.js +7 -10
  12. package/dist/Autocomplete/AutocompleteMenu.js +3 -2
  13. package/dist/Breadcrumbs/Breadcrumbs.js +4 -1
  14. package/dist/ButtonGroup/ButtonGroup.js +5 -12
  15. package/dist/Checkbox/Checkbox.js +3 -10
  16. package/dist/Dialog/Dialog.js +3 -10
  17. package/dist/FeatureFlags/DefaultFeatureFlags.js +1 -2
  18. package/dist/FilteredActionList/FilteredActionList.js +4 -15
  19. package/dist/FilteredActionList/FilteredActionListInput.d.ts +1 -1
  20. package/dist/FilteredActionList/useAnnouncements.js +20 -14
  21. package/dist/LabelGroup/LabelGroup-db41f443.css +2 -0
  22. package/dist/LabelGroup/LabelGroup-db41f443.css.map +1 -0
  23. package/dist/LabelGroup/LabelGroup.module.css.js +1 -1
  24. package/dist/NavList/NavList.js +1 -1
  25. package/dist/Overlay/Overlay.js +1 -1
  26. package/dist/PageHeader/PageHeader.js +10 -19
  27. package/dist/PageLayout/PageLayout.js +1 -1
  28. package/dist/SelectPanel/SelectPanel.js +1 -1
  29. package/dist/TextInput/TextInput.js +3 -10
  30. package/dist/TextInputWithTokens/TextInputWithTokens.js +1 -1
  31. package/dist/TooltipV2/Tooltip.js +4 -10
  32. package/dist/TreeView/TreeView.js +6 -3
  33. package/dist/experimental/SelectPanel2/SelectPanel.js +2 -2
  34. package/dist/experimental/Tabs/types.d.ts +2 -2
  35. package/dist/experimental/Tabs/useTabList.js +7 -15
  36. package/dist/experimental/UnderlinePanels/UnderlinePanels.js +1 -1
  37. package/dist/experimental/index.js +4 -4
  38. package/dist/hooks/useAnchoredPosition.js +14 -1
  39. package/dist/hooks/useDialog.js +2 -1
  40. package/dist/hooks/useMergedRefs.js +1 -4
  41. package/dist/hooks/useProvidedRefOrCreate.d.ts +10 -7
  42. package/dist/hooks/useProvidedRefOrCreate.js +10 -7
  43. package/dist/hooks/useScrollFlash.js +2 -1
  44. package/dist/index.js +4 -4
  45. package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroup.js +1 -1
  46. package/dist/internal/components/UnderlineTabbedInterface-70ae932b.css +2 -0
  47. package/dist/internal/components/UnderlineTabbedInterface-70ae932b.css.map +1 -0
  48. package/dist/internal/components/UnderlineTabbedInterface.module.css.js +1 -1
  49. package/dist/utils/warning.js +3 -2
  50. package/package.json +2 -2
  51. package/dist/ActionBar/ActionBar-e63def3c.css +0 -2
  52. package/dist/ActionBar/ActionBar-e63def3c.css.map +0 -1
  53. package/dist/LabelGroup/LabelGroup-7d19205a.css +0 -2
  54. package/dist/LabelGroup/LabelGroup-7d19205a.css.map +0 -1
  55. package/dist/internal/components/UnderlineTabbedInterface-25587345.css +0 -2
  56. package/dist/internal/components/UnderlineTabbedInterface-25587345.css.map +0 -1
@@ -1,9 +1,7 @@
1
- import { useMergedRefs } from "../hooks/useMergedRefs.js";
2
1
  import { useProvidedRefOrCreate } from "../hooks/useProvidedRefOrCreate.js";
3
2
  import { warning } from "../utils/warning.js";
4
- import { useFeatureFlag } from "../FeatureFlags/useFeatureFlag.js";
5
- import { isResponsiveValue } from "../hooks/useResponsiveValue.js";
6
3
  import { isSlot } from "../utils/is-slot.js";
4
+ import { isResponsiveValue } from "../hooks/useResponsiveValue.js";
7
5
  import { getResponsiveAttributes } from "../internal/utils/getResponsiveAttributes.js";
8
6
  import Heading from "../Heading/Heading.js";
9
7
  import Link from "../Link/Link.js";
@@ -12,7 +10,7 @@ import PageHeader_module_css_default from "./PageHeader.module.css.js";
12
10
  import { c } from "react-compiler-runtime";
13
11
  import { clsx } from "clsx";
14
12
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
15
- import React, { useEffect, useRef } from "react";
13
+ import React, { useEffect } from "react";
16
14
  import { ArrowLeftIcon } from "@primer/octicons-react";
17
15
  //#region src/PageHeader/PageHeader.tsx
18
16
  const hiddenOnRegularAndWide = {
@@ -29,12 +27,7 @@ const Root = /*#__PURE__*/ React.forwardRef((t0, forwardedRef) => {
29
27
  const $ = c(17);
30
28
  const { children, className, as: t1, "aria-label": ariaLabel, role, hasBorder } = t0;
31
29
  const BaseComponent = t1 === void 0 ? "div" : t1;
32
- const mergedRefEnabled = useFeatureFlag("primer_react_merged_forwarded_refs");
33
- const internalRef = useRef(null);
34
- const mergedRef = useMergedRefs(internalRef, forwardedRef);
35
- const providedOrCreatedRef = useProvidedRefOrCreate(forwardedRef);
36
- const rootRef = mergedRefEnabled ? internalRef : providedOrCreatedRef;
37
- const appliedRef = mergedRefEnabled ? mergedRef : providedOrCreatedRef;
30
+ const rootRef = useProvidedRefOrCreate(forwardedRef);
38
31
  const hoistChildState = (nodes) => {
39
32
  const result = { hasNavigation: false };
40
33
  for (const child of React.Children.toArray(nodes)) {
@@ -96,9 +89,9 @@ const Root = /*#__PURE__*/ React.forwardRef((t0, forwardedRef) => {
96
89
  const t8 = getResponsiveAttributes("title-size-variant", titleVariant);
97
90
  const t9 = getNavHiddenDataAttributes(navigationHidden);
98
91
  let t10;
99
- if ($[6] !== BaseComponent || $[7] !== appliedRef || $[8] !== ariaLabel || $[9] !== children || $[10] !== role || $[11] !== t4 || $[12] !== t6 || $[13] !== t7 || $[14] !== t8 || $[15] !== t9) {
92
+ if ($[6] !== BaseComponent || $[7] !== ariaLabel || $[8] !== children || $[9] !== role || $[10] !== rootRef || $[11] !== t4 || $[12] !== t6 || $[13] !== t7 || $[14] !== t8 || $[15] !== t9) {
100
93
  t10 = /*#__PURE__*/ jsx(BaseComponent, {
101
- ref: appliedRef,
94
+ ref: rootRef,
102
95
  className: t4,
103
96
  "data-component": t5,
104
97
  "data-has-border": t6,
@@ -110,10 +103,10 @@ const Root = /*#__PURE__*/ React.forwardRef((t0, forwardedRef) => {
110
103
  children
111
104
  });
112
105
  $[6] = BaseComponent;
113
- $[7] = appliedRef;
114
- $[8] = ariaLabel;
115
- $[9] = children;
116
- $[10] = role;
106
+ $[7] = ariaLabel;
107
+ $[8] = children;
108
+ $[9] = role;
109
+ $[10] = rootRef;
117
110
  $[11] = t4;
118
111
  $[12] = t6;
119
112
  $[13] = t7;
@@ -302,9 +295,7 @@ const TitleArea = /*#__PURE__*/ React.forwardRef((t0, forwardedRef) => {
302
295
  const { children, className, hidden: t1, variant: t2 } = t0;
303
296
  const hidden = t1 === void 0 ? false : t1;
304
297
  const variant = t2 === void 0 ? "medium" : t2;
305
- const mergedRefEnabled = useFeatureFlag("primer_react_merged_forwarded_refs");
306
- const providedOrCreatedRef = useProvidedRefOrCreate(forwardedRef);
307
- const titleAreaRef = mergedRefEnabled ? forwardedRef : providedOrCreatedRef;
298
+ const titleAreaRef = useProvidedRefOrCreate(forwardedRef);
308
299
  let t3;
309
300
  if ($[0] !== className) {
310
301
  t3 = clsx(PageHeader_module_css_default.TitleArea, className);
@@ -1,8 +1,8 @@
1
1
  import { useMergedRefs } from "../hooks/useMergedRefs.js";
2
2
  import { useId as useId$1 } from "../hooks/useId.js";
3
3
  import { warning } from "../utils/warning.js";
4
- import { isResponsiveValue } from "../hooks/useResponsiveValue.js";
5
4
  import { useSlots } from "../hooks/useSlots.js";
5
+ import { isResponsiveValue } from "../hooks/useResponsiveValue.js";
6
6
  import { useOverflow } from "../hooks/useOverflow.js";
7
7
  import { getResponsiveAttributes } from "../internal/utils/getResponsiveAttributes.js";
8
8
  import PageLayout_module_css_default from "./PageLayout.module.css.js";
@@ -2,13 +2,13 @@ import { useProvidedRefOrCreate } from "../hooks/useProvidedRefOrCreate.js";
2
2
  import { useProvidedStateOrCreate } from "../hooks/useProvidedStateOrCreate.js";
3
3
  import { isAlphabetKey } from "../hooks/useMnemonics.js";
4
4
  import { useId as useId$1 } from "../hooks/useId.js";
5
- import { useFeatureFlag } from "../FeatureFlags/useFeatureFlag.js";
6
5
  import useSafeTimeout from "../hooks/useSafeTimeout.js";
7
6
  import { IconButton } from "../Button/IconButton.js";
8
7
  import { LinkButton } from "../Button/LinkButton.js";
9
8
  import { ButtonComponent } from "../Button/Button.js";
10
9
  import { useResponsiveValue } from "../hooks/useResponsiveValue.js";
11
10
  import Heading from "../Heading/Heading.js";
11
+ import { useFeatureFlag } from "../FeatureFlags/useFeatureFlag.js";
12
12
  import { AnchoredOverlay } from "../AnchoredOverlay/AnchoredOverlay.js";
13
13
  import { Banner } from "../Banner/index.js";
14
14
  import { useFormControlContext } from "../FormControl/_FormControlContext.js";
@@ -1,7 +1,5 @@
1
- import { useMergedRefs } from "../hooks/useMergedRefs.js";
2
1
  import { useProvidedRefOrCreate } from "../hooks/useProvidedRefOrCreate.js";
3
2
  import { AriaStatus } from "../live-region/AriaStatus.js";
4
- import { useFeatureFlag } from "../FeatureFlags/useFeatureFlag.js";
5
3
  import Text_default from "../Text/Text.js";
6
4
  import _VisuallyHidden_module_css_default from "../_VisuallyHidden.module.css.js";
7
5
  import VisuallyHidden from "../_VisuallyHidden.js";
@@ -13,19 +11,14 @@ import UnstyledTextInput from "../internal/components/UnstyledTextInput.js";
13
11
  import { getCharacterCountState } from "../utils/character-counter.js";
14
12
  import { clsx } from "clsx";
15
13
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
16
- import React, { useCallback, useId, useRef, useState } from "react";
14
+ import React, { useCallback, useId, useState } from "react";
17
15
  import { isValidElementType } from "react-is";
18
16
  import { AlertFillIcon } from "@primer/octicons-react";
19
17
  //#region src/TextInput/TextInput.tsx
20
18
  const TextInput = /*#__PURE__*/ React.forwardRef(({ icon: IconComponent, leadingVisual: LeadingVisual, trailingVisual: TrailingVisual, trailingAction, block, className, contrast, disabled, loading, loaderPosition = "auto", loaderText = "Loading", monospace, validationStatus, size: sizeProp, onFocus, onBlur, variant: variantProp, width: widthProp, minWidth: minWidthProp, maxWidth: maxWidthProp, type = "text", required, characterLimit, onChange, value, defaultValue, "data-component": dataComponent, ...inputProps }, ref) => {
21
19
  var _counter$isOverLimit;
22
20
  const [isInputFocused, setIsInputFocused] = useState(false);
23
- const mergedRefEnabled = useFeatureFlag("primer_react_merged_forwarded_refs");
24
- const internalRef = useRef(null);
25
- const mergedRef = useMergedRefs(internalRef, ref);
26
- const providedOrCreatedRef = useProvidedRefOrCreate(ref);
27
- const inputRef = mergedRefEnabled ? internalRef : providedOrCreatedRef;
28
- const appliedRef = mergedRefEnabled ? mergedRef : providedOrCreatedRef;
21
+ const inputRef = useProvidedRefOrCreate(ref);
29
22
  const isControlled = value !== void 0;
30
23
  const [uncontrolledLength, setUncontrolledLength] = useState(() => defaultValue !== void 0 ? String(defaultValue).length : 0);
31
24
  const currentLength = isControlled ? String(value).length : uncontrolledLength;
@@ -95,7 +88,7 @@ const TextInput = /*#__PURE__*/ React.forwardRef(({ icon: IconComponent, leading
95
88
  children: typeof LeadingVisual !== "string" && isValidElementType(LeadingVisual) ? /*#__PURE__*/ jsx(LeadingVisual, {}) : LeadingVisual
96
89
  }),
97
90
  /*#__PURE__*/ jsx(UnstyledTextInput, {
98
- ref: appliedRef,
91
+ ref: inputRef,
99
92
  disabled,
100
93
  onFocus: handleInputFocus,
101
94
  onBlur: handleInputBlur,
@@ -12,8 +12,8 @@ import { c } from "react-compiler-runtime";
12
12
  import { clsx } from "clsx";
13
13
  import { jsx, jsxs } from "react/jsx-runtime";
14
14
  import React, { useRef, useState } from "react";
15
- import { FocusKeys } from "@primer/behaviors";
16
15
  import { isFocusable } from "@primer/behaviors/utils";
16
+ import { FocusKeys } from "@primer/behaviors";
17
17
  import { isValidElementType } from "react-is";
18
18
  //#region src/TextInputWithTokens/TextInputWithTokens.tsx
19
19
  /**
@@ -1,9 +1,7 @@
1
- import { useMergedRefs } from "../hooks/useMergedRefs.js";
2
1
  import { useProvidedRefOrCreate } from "../hooks/useProvidedRefOrCreate.js";
3
2
  import { useOnEscapePress } from "../hooks/useOnEscapePress.js";
4
3
  import { useId as useId$1 } from "../hooks/useId.js";
5
4
  import { warning } from "../utils/warning.js";
6
- import { useFeatureFlag } from "../FeatureFlags/useFeatureFlag.js";
7
5
  import { invariant } from "../utils/invariant.js";
8
6
  import Tooltip_module_css_default from "./Tooltip.module.css.js";
9
7
  import VisuallyHidden from "../_VisuallyHidden.js";
@@ -82,12 +80,7 @@ const emptyKeybindingHints = [];
82
80
  const Tooltip = /*#__PURE__*/ React.forwardRef(({ direction = "s", text, type = "description", children, id, className, keybindingHint = emptyKeybindingHints, delay = "short", _privateDisableTooltip = false, ...rest }, forwardedRef) => {
83
81
  const tooltipId = useId$1(id);
84
82
  const child = Children.only(children);
85
- const mergedRefEnabled = useFeatureFlag("primer_react_merged_forwarded_refs");
86
- const internalRef = useRef(null);
87
- const mergedTriggerRef = useMergedRefs(internalRef, forwardedRef);
88
- const providedOrCreatedRef = useProvidedRefOrCreate(forwardedRef);
89
- const triggerRef = mergedRefEnabled ? internalRef : providedOrCreatedRef;
90
- const appliedTriggerRef = mergedRefEnabled ? mergedTriggerRef : providedOrCreatedRef;
83
+ const triggerRef = useProvidedRefOrCreate(forwardedRef);
91
84
  const tooltipElRef = useRef(null);
92
85
  const [calculatedDirection, setCalculatedDirection] = useState(direction);
93
86
  const [isPopoverOpen, setIsPopoverOpen] = useState(false);
@@ -164,7 +157,7 @@ const Tooltip = /*#__PURE__*/ React.forwardRef(({ direction = "s", text, type =
164
157
  return /*#__PURE__*/ jsx(TooltipContext.Provider, {
165
158
  value,
166
159
  children: /*#__PURE__*/ jsxs(Fragment, { children: [/*#__PURE__*/ React.isValidElement(child) && /*#__PURE__*/ React.cloneElement(child, {
167
- ref: appliedTriggerRef,
160
+ ref: triggerRef,
168
161
  "aria-describedby": (() => {
169
162
  if (type !== "description") return child.props["aria-describedby"];
170
163
  const existingDescribedBy = child.props["aria-describedby"];
@@ -191,12 +184,13 @@ const Tooltip = /*#__PURE__*/ React.forwardRef(({ direction = "s", text, type =
191
184
  (_child$props$onFocus = (_child$props3 = child.props).onFocus) === null || _child$props$onFocus === void 0 || _child$props$onFocus.call(_child$props3, event);
192
185
  },
193
186
  onMouseOverCapture: (event) => {
187
+ const delayTime = delayTimeMap[delay] || 50;
194
188
  openTimeoutRef.current = safeSetTimeout(() => {
195
189
  var _child$props$onMouseE, _child$props4;
196
190
  if (!openTimeoutRef.current) return;
197
191
  openTooltip();
198
192
  (_child$props$onMouseE = (_child$props4 = child.props).onMouseEnter) === null || _child$props$onMouseE === void 0 || _child$props$onMouseE.call(_child$props4, event);
199
- }, delayTimeMap[delay] || 50);
193
+ }, delayTime);
200
194
  },
201
195
  onMouseLeave: (event) => {
202
196
  var _child$props$onMouseL, _child$props5;
@@ -1,4 +1,6 @@
1
1
  import { useId as useId$1 } from "../hooks/useId.js";
2
+ import { isSlot } from "../utils/is-slot.js";
3
+ import { useSlots } from "../hooks/useSlots.js";
2
4
  import Spinner from "../Spinner/Spinner.js";
3
5
  import { AriaStatus } from "../live-region/AriaStatus.js";
4
6
  import { fixedForwardRef } from "../utils/modern-polymorphic.js";
@@ -10,8 +12,6 @@ import useSafeTimeout from "../hooks/useSafeTimeout.js";
10
12
  import { Tooltip } from "../TooltipV2/Tooltip.js";
11
13
  import { IconButton } from "../Button/IconButton.js";
12
14
  import { ButtonComponent } from "../Button/Button.js";
13
- import { isSlot } from "../utils/is-slot.js";
14
- import { useSlots } from "../hooks/useSlots.js";
15
15
  import { Dialog } from "../Dialog/Dialog.js";
16
16
  import { ConfirmationDialog } from "../ConfirmationDialog/ConfirmationDialog.js";
17
17
  import { ActionList } from "../ActionList/index.js";
@@ -349,7 +349,10 @@ const SubTree = ({ count, state, children, "aria-label": ariaLabel }) => {
349
349
  });
350
350
  setLoadingFocused(false);
351
351
  }
352
- } else if (state === "loading") announceUpdate(`${getAccessibleName(parentElement)} content loading`);
352
+ } else if (state === "loading") {
353
+ const parentName = getAccessibleName(parentElement);
354
+ announceUpdate(`${parentName} content loading`);
355
+ }
353
356
  }, [
354
357
  loadingFocused,
355
358
  previousState,
@@ -1,14 +1,14 @@
1
1
  import { useProvidedRefOrCreate } from "../../hooks/useProvidedRefOrCreate.js";
2
2
  import { useAnchoredPosition } from "../../hooks/useAnchoredPosition.js";
3
3
  import { useId as useId$1 } from "../../hooks/useId.js";
4
+ import { isSlot } from "../../utils/is-slot.js";
5
+ import { useSlots } from "../../hooks/useSlots.js";
4
6
  import Spinner from "../../Spinner/Spinner.js";
5
7
  import { AriaStatus } from "../../live-region/AriaStatus.js";
6
8
  import { invariant } from "../../utils/invariant.js";
7
9
  import { IconButton } from "../../Button/IconButton.js";
8
10
  import { ButtonComponent } from "../../Button/Button.js";
9
11
  import { useResponsiveValue } from "../../hooks/useResponsiveValue.js";
10
- import { isSlot } from "../../utils/is-slot.js";
11
- import { useSlots } from "../../hooks/useSlots.js";
12
12
  import { ActionListContainerContext } from "../../ActionList/ActionListContainerContext.js";
13
13
  import Heading from "../../Heading/Heading.js";
14
14
  import Link from "../../Link/Link.js";
@@ -73,7 +73,7 @@ type TabPanelProps = {
73
73
  value: string;
74
74
  };
75
75
  type TabListHookProps<T extends HTMLElement> = TabListProps & {
76
- /** Optional ref to use for the tablist. If none is provided, one will be generated automatically */ref?: React.Ref<T | null>;
76
+ /** Optional ref to use for the tablist. If none is provided, one will be generated automatically */ref?: React.RefObject<T>;
77
77
  };
78
78
  type TabListHookResult<T extends HTMLElement> = {
79
79
  /** Props to be spread onto the tablist element */tabListProps: {
@@ -81,7 +81,7 @@ type TabListHookResult<T extends HTMLElement> = {
81
81
  'aria-orientation': AriaAttributes['aria-orientation'];
82
82
  'aria-label': AriaAttributes['aria-label'];
83
83
  'aria-labelledby': AriaAttributes['aria-labelledby'];
84
- ref: React.Ref<T | null>;
84
+ ref: React.RefObject<T | null>;
85
85
  role: 'tablist';
86
86
  };
87
87
  };
@@ -1,18 +1,10 @@
1
- import { useMergedRefs } from "../../hooks/useMergedRefs.js";
2
1
  import { useProvidedRefOrCreate } from "../../hooks/useProvidedRefOrCreate.js";
3
- import { useFeatureFlag } from "../../FeatureFlags/useFeatureFlag.js";
4
2
  import { c } from "react-compiler-runtime";
5
- import { useRef } from "react";
6
3
  //#region src/experimental/Tabs/useTabList.ts
7
4
  function useTabList(props) {
8
5
  const $ = c(9);
9
6
  const { "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-orientation": ariaOrientation } = props;
10
- const mergedRefEnabled = useFeatureFlag("primer_react_merged_forwarded_refs");
11
- const internalRef = useRef(null);
12
- const mergedRef = useMergedRefs(internalRef, props.ref);
13
- const providedOrCreatedRef = useProvidedRefOrCreate(props.ref);
14
- const ref = mergedRefEnabled ? internalRef : providedOrCreatedRef;
15
- const appliedRef = mergedRefEnabled ? mergedRef : providedOrCreatedRef;
7
+ const ref = useProvidedRefOrCreate(props.ref);
16
8
  let t0;
17
9
  if ($[0] !== ariaOrientation || $[1] !== ref) {
18
10
  t0 = (event) => {
@@ -47,19 +39,19 @@ function useTabList(props) {
47
39
  const onKeyDown = t0;
48
40
  const t1 = ariaOrientation !== null && ariaOrientation !== void 0 ? ariaOrientation : "horizontal";
49
41
  let t2;
50
- if ($[3] !== appliedRef || $[4] !== ariaLabel || $[5] !== ariaLabelledby || $[6] !== onKeyDown || $[7] !== t1) {
42
+ if ($[3] !== ariaLabel || $[4] !== ariaLabelledby || $[5] !== onKeyDown || $[6] !== ref || $[7] !== t1) {
51
43
  t2 = { tabListProps: {
52
- ref: appliedRef,
44
+ ref,
53
45
  "aria-label": ariaLabel,
54
46
  "aria-labelledby": ariaLabelledby,
55
47
  "aria-orientation": t1,
56
48
  role: "tablist",
57
49
  onKeyDown
58
50
  } };
59
- $[3] = appliedRef;
60
- $[4] = ariaLabel;
61
- $[5] = ariaLabelledby;
62
- $[6] = onKeyDown;
51
+ $[3] = ariaLabel;
52
+ $[4] = ariaLabelledby;
53
+ $[5] = onKeyDown;
54
+ $[6] = ref;
63
55
  $[7] = t1;
64
56
  $[8] = t2;
65
57
  } else t2 = $[8];
@@ -1,8 +1,8 @@
1
1
  import useIsomorphicLayoutEffect from "../../utils/useIsomorphicLayoutEffect.js";
2
2
  import { useResizeObserver } from "../../hooks/useResizeObserver.js";
3
3
  import { useId as useId$1 } from "../../hooks/useId.js";
4
- import { invariant } from "../../utils/invariant.js";
5
4
  import { isSlot } from "../../utils/is-slot.js";
5
+ import { invariant } from "../../utils/invariant.js";
6
6
  import { createComponent } from "../../utils/create-component.js";
7
7
  import { UnderlineItem, UnderlineItemList, UnderlineWrapper } from "../../internal/components/UnderlineTabbedInterface.js";
8
8
  import UnderlinePanels_module_css_default from "./UnderlinePanels.module.css.js";
@@ -1,18 +1,18 @@
1
1
  "use client";
2
+ import { useSlots } from "../hooks/useSlots.js";
2
3
  import { Announce } from "../live-region/Announce.js";
3
4
  import { AriaAlert } from "../live-region/AriaAlert.js";
4
5
  import { AriaStatus } from "../live-region/AriaStatus.js";
5
6
  import { ButtonBase } from "../Button/ButtonBase.js";
6
- import { DefaultFeatureFlags } from "../FeatureFlags/DefaultFeatureFlags.js";
7
- import { FeatureFlags } from "../FeatureFlags/FeatureFlags.js";
8
- import { useFeatureFlag } from "../FeatureFlags/useFeatureFlag.js";
9
7
  import { KeybindingHint } from "../KeybindingHint/KeybindingHint.js";
10
8
  import { getAccessibleKeybindingHintString } from "../KeybindingHint/utils.js";
11
9
  import { Tooltip } from "../TooltipV2/Tooltip.js";
12
- import { useSlots } from "../hooks/useSlots.js";
13
10
  import { useOverflow } from "../hooks/useOverflow.js";
14
11
  import { ScrollableRegion } from "../ScrollableRegion/ScrollableRegion.js";
15
12
  import { Dialog } from "../Dialog/Dialog.js";
13
+ import { DefaultFeatureFlags } from "../FeatureFlags/DefaultFeatureFlags.js";
14
+ import { FeatureFlags } from "../FeatureFlags/FeatureFlags.js";
15
+ import { useFeatureFlag } from "../FeatureFlags/useFeatureFlag.js";
16
16
  import { Stack } from "../Stack/index.js";
17
17
  import { SkeletonBox } from "../Skeleton/SkeletonBox.js";
18
18
  import { FilteredActionListLoadingTypes } from "../FilteredActionList/constants.js";
@@ -106,6 +106,10 @@ function useAnchoredPosition(settings, dependencies = []) {
106
106
  }, [updatePosition]);
107
107
  useResizeObserver(updatePosition, void 0, [], enabled);
108
108
  useResizeObserver(updatePosition, floatingElementRef, [], enabled);
109
+ const scrollAncestorsCacheRef = React.useRef({
110
+ anchor: null,
111
+ scrollables: []
112
+ });
109
113
  React.useEffect(() => {
110
114
  if (!enabled) return;
111
115
  const anchorEl = anchorElementRef.current;
@@ -118,7 +122,16 @@ function useAnchoredPosition(settings, dependencies = []) {
118
122
  updatePosition();
119
123
  });
120
124
  };
121
- const scrollables = getScrollableAncestors(anchorEl);
125
+ const cache = scrollAncestorsCacheRef.current;
126
+ let scrollables;
127
+ if (cache.anchor === anchorEl) scrollables = cache.scrollables;
128
+ else {
129
+ scrollables = getScrollableAncestors(anchorEl);
130
+ scrollAncestorsCacheRef.current = {
131
+ anchor: anchorEl,
132
+ scrollables
133
+ };
134
+ }
122
135
  for (const scrollable of scrollables) scrollable.addEventListener("scroll", handleScroll);
123
136
  return () => {
124
137
  for (const scrollable of scrollables) scrollable.removeEventListener("scroll", handleScroll);
@@ -91,7 +91,8 @@ function useDialog(t0) {
91
91
  let t8;
92
92
  if ($[15] !== getFocusableItem) {
93
93
  t8 = (e_1) => {
94
- const focusableItem_0 = getFocusableItem(e_1, e_1.shiftKey ? -1 : 1);
94
+ const movement_0 = e_1.shiftKey ? -1 : 1;
95
+ const focusableItem_0 = getFocusableItem(e_1, movement_0);
95
96
  if (!focusableItem_0) return;
96
97
  focusableItem_0.focus();
97
98
  };
@@ -1,9 +1,7 @@
1
1
  import { isExperimentalReactVersion, reactMajorVersion } from "../utils/environment.js";
2
2
  import { c } from "react-compiler-runtime";
3
- import { version } from "react";
3
+ import "react";
4
4
  //#region src/hooks/useMergedRefs.ts
5
- var _version$split$;
6
- const majorReactVersion = parseInt((_version$split$ = version.split(".")[0]) !== null && _version$split$ !== void 0 ? _version$split$ : "18", 10);
7
5
  /**
8
6
  * Cleanup functions for refs were introduced in React 19. For feature detection,
9
7
  * we look to see if current version of React is >= 19 or if it is an
@@ -50,7 +48,6 @@ function useMergedRefs(refA, refB) {
50
48
  const cleanupA = setRef(refA, value);
51
49
  const cleanupB = setRef(refB, value);
52
50
  if (!supportsRefCleanup) return;
53
- if (majorReactVersion <= 18) return;
54
51
  return () => {
55
52
  if (cleanupA) cleanupA();
56
53
  else setRef(refA, null);
@@ -9,14 +9,17 @@ import React from "react";
9
9
  * @param providedRef The ref to use - if undefined, will use the ref from a call to React.useRef
10
10
  * @type TRef The type of the RefObject which should be created.
11
11
  *
12
- * @note This hook is overly restrictive in that it forces the provided ref to be a ref object rather than a callback.
13
- * In particular, it should **not** be used to merge internal refs with forwarded refs. For this, use
14
- * {@linkcode useMergedRefs} instead.
12
+ * @deprecated This hook is incompatible with forwarded callback refs. Prefer `useMergedRefs` with an internally
13
+ * created ref instead.
15
14
  *
16
- * The primary valid use case for this hook is for when the consumer is using the provided ref to point to an external
17
- * element, like an externally rendered anchor. This is 'backwards' from forwarded refs with respect to data flow; the
18
- * consumer is passing a reference to an external element, rather than passing a handle to obtain a reference to an
19
- * internal element.
15
+ * ```diff
16
+ * - const ref = useProvidedRefOrCreate(forwardedRef as RefObject<...>)
17
+ * + const ref = useRef(null)
18
+ * + const mergedRef = useMergedRefs(forwardedRef, ref)
19
+ *
20
+ * - return <div ref={ref} />
21
+ * + return <div ref={mergedRef} />
22
+ * ```
20
23
  */
21
24
  declare function useProvidedRefOrCreate<TRef>(providedRef?: React.RefObject<TRef | null>): React.RefObject<TRef | null>;
22
25
  //#endregion
@@ -8,14 +8,17 @@ import React from "react";
8
8
  * @param providedRef The ref to use - if undefined, will use the ref from a call to React.useRef
9
9
  * @type TRef The type of the RefObject which should be created.
10
10
  *
11
- * @note This hook is overly restrictive in that it forces the provided ref to be a ref object rather than a callback.
12
- * In particular, it should **not** be used to merge internal refs with forwarded refs. For this, use
13
- * {@linkcode useMergedRefs} instead.
11
+ * @deprecated This hook is incompatible with forwarded callback refs. Prefer `useMergedRefs` with an internally
12
+ * created ref instead.
14
13
  *
15
- * The primary valid use case for this hook is for when the consumer is using the provided ref to point to an external
16
- * element, like an externally rendered anchor. This is 'backwards' from forwarded refs with respect to data flow; the
17
- * consumer is passing a reference to an external element, rather than passing a handle to obtain a reference to an
18
- * internal element.
14
+ * ```diff
15
+ * - const ref = useProvidedRefOrCreate(forwardedRef as RefObject<...>)
16
+ * + const ref = useRef(null)
17
+ * + const mergedRef = useMergedRefs(forwardedRef, ref)
18
+ *
19
+ * - return <div ref={ref} />
20
+ * + return <div ref={mergedRef} />
21
+ * ```
19
22
  */
20
23
  function useProvidedRefOrCreate(providedRef) {
21
24
  const createdRef = React.useRef(null);
@@ -15,7 +15,8 @@ function useScrollFlash(scrollContainerRef) {
15
15
  if (!scrollContainer) return;
16
16
  const id = requestAnimationFrame(() => {
17
17
  const currentScroll = scrollContainer.scrollTop;
18
- scrollContainer.scrollTop = currentScroll < 1 ? currentScroll + 1 : currentScroll - 1;
18
+ const altScroll = currentScroll < 1 ? currentScroll + 1 : currentScroll - 1;
19
+ scrollContainer.scrollTop = altScroll;
19
20
  scrollContainer.scrollTop = currentScroll;
20
21
  });
21
22
  return () => cancelAnimationFrame(id);
package/dist/index.js CHANGED
@@ -9,12 +9,15 @@ import { VisuallyHidden } from "./VisuallyHidden/VisuallyHidden.js";
9
9
  import { useOnOutsideClick } from "./hooks/useOnOutsideClick.js";
10
10
  import { useProvidedRefOrCreate } from "./hooks/useProvidedRefOrCreate.js";
11
11
  import { useOnEscapePress } from "./hooks/useOnEscapePress.js";
12
+ import { useOpenAndCloseFocus } from "./hooks/useOpenAndCloseFocus.js";
12
13
  import useIsomorphicLayoutEffect from "./utils/useIsomorphicLayoutEffect.js";
13
14
  import { useResizeObserver } from "./hooks/useResizeObserver.js";
14
15
  import { useAnchoredPosition } from "./hooks/useAnchoredPosition.js";
15
- import { useOpenAndCloseFocus } from "./hooks/useOpenAndCloseFocus.js";
16
16
  import { useOverlay } from "./hooks/useOverlay.js";
17
+ import { useRefObjectAsForwardedRef } from "./hooks/useRefObjectAsForwardedRef.js";
17
18
  import { useId } from "./hooks/useId.js";
19
+ import { isSlot } from "./utils/is-slot.js";
20
+ import { useSlots } from "./hooks/useSlots.js";
18
21
  import Spinner from "./Spinner/Spinner.js";
19
22
  import CounterLabel from "./CounterLabel/CounterLabel.js";
20
23
  import { ButtonBase } from "./Button/ButtonBase.js";
@@ -25,8 +28,6 @@ import { IconButton } from "./Button/IconButton.js";
25
28
  import { LinkButton } from "./Button/LinkButton.js";
26
29
  import { ButtonComponent } from "./Button/Button.js";
27
30
  import { useResponsiveValue } from "./hooks/useResponsiveValue.js";
28
- import { isSlot } from "./utils/is-slot.js";
29
- import { useSlots } from "./hooks/useSlots.js";
30
31
  import { PageLayout } from "./PageLayout/PageLayout.js";
31
32
  import { SplitPageLayout } from "./SplitPageLayout/SplitPageLayout.js";
32
33
  import useDetails from "./hooks/useDetails.js";
@@ -38,7 +39,6 @@ import Portal_default from "./Portal/index.js";
38
39
  import { Dialog } from "./Dialog/Dialog.js";
39
40
  import { ConfirmationDialog } from "./ConfirmationDialog/ConfirmationDialog.js";
40
41
  import { useConfirm } from "./ConfirmationDialog/useConfirm.js";
41
- import { useRefObjectAsForwardedRef } from "./hooks/useRefObjectAsForwardedRef.js";
42
42
  import { createComponent } from "./utils/create-component.js";
43
43
  import { asSlot } from "./utils/as-slot.js";
44
44
  import Radio from "./Radio/Radio.js";
@@ -1,6 +1,6 @@
1
1
  import { useId as useId$1 } from "../../../hooks/useId.js";
2
- import VisuallyHidden from "../../../_VisuallyHidden.js";
3
2
  import { useSlots } from "../../../hooks/useSlots.js";
3
+ import VisuallyHidden from "../../../_VisuallyHidden.js";
4
4
  import ValidationAnimationContainer from "../ValidationAnimationContainer.js";
5
5
  import CheckboxOrRadioGroupContext from "./CheckboxOrRadioGroupContext.js";
6
6
  import CheckboxOrRadioGroup_module_css_default from "./CheckboxOrRadioGroup.module.css.js";
@@ -0,0 +1,2 @@
1
+ .prc-components-UnderlineWrapper-eT-Yj{align-items:flex-start;box-shadow:inset 0 -1px var(--borderColor-muted,#d1d9e0b3);display:flex;justify-content:flex-start;min-height:var(--control-xlarge-size,3rem);padding-top:var(--base-size-8,.5rem);padding-inline:var(--stack-padding-normal,1rem)}.prc-components-UnderlineWrapper-eT-Yj[data-variant=flush]{padding-inline:unset}.prc-components-UnderlineWrapper-eT-Yj[data-overflow-mode=wrap]{max-height:var(--control-xlarge-size,3rem);overflow:hidden}.prc-components-UnderlineWrapper-eT-Yj[data-overflow-mode=wrap] .prc-components-UnderlineItemList-xKlKC{flex-grow:1;flex-wrap:wrap;overflow:hidden}.prc-components-UnderlineItemList-xKlKC{contain:layout;display:flex;gap:var(--stack-gap-condensed,.5rem);list-style:none;margin:0;padding:0;white-space:nowrap}.prc-components-UnderlineItem-7fP-n,.prc-components-UnderlineItemList-xKlKC{align-items:center;position:relative}.prc-components-UnderlineItem-7fP-n{appearance:none;background-color:transparent;border:0;border-radius:var(--borderRadius-medium,.375rem);color:var(--fgColor-default,#1f2328);cursor:pointer;display:inline-flex;font:inherit;font-size:var(--text-body-size-medium,.875rem);height:32px;line-height:var(--text-body-lineHeight-medium,1.4285);margin-bottom:var(--base-size-8,.5rem);max-width:100%;padding-block:var(--base-size-6,.375rem);padding-inline:var(--base-size-8,.5rem);text-align:center;-webkit-text-decoration:none;text-decoration:none}@media (hover:hover){.prc-components-UnderlineItem-7fP-n:hover{background-color:var(--bgColor-neutral-muted,#818b981f);-webkit-text-decoration:none;text-decoration:none;transition:background-color .12s ease-out}}.prc-components-UnderlineItem-7fP-n:focus{box-shadow:inset 0 0 0 2px var(--fgColor-accent,#0969da);outline:2px solid transparent}.prc-components-UnderlineItem-7fP-n:focus:not(:focus-visible){box-shadow:none}.prc-components-UnderlineItem-7fP-n:focus-visible{box-shadow:inset 0 0 0 2px var(--fgColor-accent,#0969da);outline:2px solid transparent}.prc-components-UnderlineItem-7fP-n [data-content]:before{content:attr(data-content);display:block;font-weight:var(--base-text-weight-semibold,600);height:0;visibility:hidden;white-space:nowrap}.prc-components-UnderlineItem-7fP-n [data-component=icon]{align-items:center;color:var(--fgColor-muted,#59636e);display:inline-flex;margin-inline-end:var(--base-size-8,.5rem)}.prc-components-UnderlineItem-7fP-n [data-component=text]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.prc-components-UnderlineItem-7fP-n [data-component=counter]{align-items:center;display:flex;margin-inline-start:var(--base-size-8,.5rem)}.prc-components-UnderlineItem-7fP-n:after{background-color:transparent;content:"";height:2px;inset:auto 0 0;margin-bottom:calc(var(--base-size-8,.5rem)*-1);pointer-events:none;position:absolute}.prc-components-UnderlineItem-7fP-n[aria-current]:not([aria-current=false]) [data-component=text],.prc-components-UnderlineItem-7fP-n[aria-selected=true] [data-component=text]{font-weight:var(--base-text-weight-semibold,600)}.prc-components-UnderlineItem-7fP-n[aria-current]:not([aria-current=false]):after,.prc-components-UnderlineItem-7fP-n[aria-selected=true]:after{background-color:var(--underlineNav-borderColor-active,var(--color-primer-border-active,#fd8c73))}@media (forced-colors:active){.prc-components-UnderlineItem-7fP-n[aria-current]:not([aria-current=false]):after,.prc-components-UnderlineItem-7fP-n[aria-selected=true]:after{background-color:LinkText}}.prc-components-LoadingCounter-dBuLy{animation:prc-components-loadingCounterKeyFrames-8tMlf 1.2s ease-in-out infinite alternate;background-color:var(--bgColor-neutral-muted,#818b981f);border-color:var(--borderColor-default,#d1d9e0);border-radius:20px;display:inline-block;height:1rem;width:1.5rem}@keyframes prc-components-loadingCounterKeyFrames-8tMlf{0%{opacity:1}to{opacity:.2}}
2
+ /*# sourceMappingURL=UnderlineTabbedInterface-70ae932b.css.map */
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/internal/components/UnderlineTabbedInterface.module.css.js"],"names":[],"mappings":"AAAA,uCAME,sBAAuB,CAOvB,0DAAiD,CAZjD,YAAa,CAIb,0BAA2B,CAI3B,0CAAsC,CAPtC,oCAA+B,CAE/B,+CA2BF,CAhBE,2DAEE,oBACF,CAEA,gEAGE,0CAAsC,CADtC,eAQF,CALE,wGACE,WAAY,CACZ,cAAe,CACf,eACF,CAIJ,wCAcE,cAAe,CAZf,YAAa,CAMb,oCAA+B,CAF/B,eAAgB,CAFhB,QAAS,CADT,SAAU,CAEV,kBAUF,CAEA,4EAVE,kBAAmB,CANnB,iBA+CF,CA/BA,oCAmBE,eAAgB,CARhB,4BAA6B,CAC7B,QAAS,CACT,gDAAyC,CANzC,oCAA6B,CAG7B,cAAe,CAPf,mBAAoB,CACpB,YAAa,CACb,8CAAuC,CAWvC,WAAY,CAVZ,qDAAuD,CASvD,sCAAiC,CADjC,cAAe,CAOf,wCAAiC,CADjC,uCAAkC,CAZlC,iBAAkB,CAClB,4BAAqB,CAArB,oBAsBF,CAPE,qBACE,0CAEE,uDAA8C,CAD9C,4BAAqB,CAArB,oBAAqB,CAErB,yCACF,CACF,CAGF,0CAGE,wDAAiD,CAFjD,6BAQF,CAHE,8DACE,eACF,CAGF,kDAGE,wDAAiD,CAFjD,6BAGF,CAGA,0DAME,0BAA2B,CAL3B,aAAc,CAEd,gDAA6C,CAD7C,QAAS,CAGT,iBAAkB,CADlB,kBAGF,CAEA,0DAGE,kBAAmB,CADnB,kCAA2B,CAD3B,mBAAoB,CAGpB,0CACF,CAGA,0DACE,eAAgB,CAChB,sBAAuB,CACvB,kBACF,CAEA,6DAGE,kBAAmB,CADnB,YAAa,CADb,4CAGF,CAEA,0CAOE,4BAA6B,CAD7B,UAAW,CAFX,UAAW,CAFX,cAAe,CACf,+CAA4C,CAE5C,mBAAoB,CAJpB,iBAOF,CAEA,gLAEE,gDACF,CAEA,gJAGE,iGAMF,CAJE,8BALF,gJAOI,yBAEJ,CADE,CAGF,qCASE,0FAAsE,CAJtE,uDAA8C,CAC9C,+CAAwC,CAExC,kBAAmB,CAPnB,oBAAqB,CAErB,WAAY,CADZ,YAQF,CAEA,wDACE,GACE,SACF,CAEA,GACE,UACF,CACF","file":"UnderlineTabbedInterface-70ae932b.css","sourcesContent":[".UnderlineWrapper {\n display: flex;\n padding-top: var(--base-size-8);\n /* stylelint-disable-next-line primer/spacing */\n padding-inline: var(--stack-padding-normal);\n justify-content: flex-start;\n align-items: flex-start;\n\n /* make space for the underline */\n min-height: var(--control-xlarge-size);\n\n /* using a box-shadow instead of a border to accommodate 'overflow-y: hidden' on UnderlinePanels */\n /* stylelint-disable-next-line primer/box-shadow */\n box-shadow: inset 0 -1px var(--borderColor-muted);\n\n &[data-variant='flush'] {\n /* stylelint-disable-next-line primer/spacing */\n padding-inline: unset;\n }\n\n &[data-overflow-mode='wrap'] {\n /* Wrap items onto hidden next lines */\n overflow: hidden;\n max-height: var(--control-xlarge-size);\n\n .UnderlineItemList {\n flex-grow: 1;\n flex-wrap: wrap;\n overflow: hidden;\n }\n }\n}\n\n.UnderlineItemList {\n position: relative;\n display: flex;\n padding: 0;\n margin: 0;\n white-space: nowrap;\n list-style: none;\n align-items: center;\n gap: var(--stack-gap-condensed);\n\n /* Isolate the ResizeObserver-driven item swapping (UnderlineNav overflow menu / UnderlinePanels)\n so it can't invalidate ancestor layout. This element is already the positioned ancestor for the\n absolutely positioned overflow menu, and layout containment does not clip, so the menu still\n overflows the nav as before. */\n contain: layout;\n}\n\n.UnderlineItem {\n /* underline tab specific styles */\n position: relative;\n display: inline-flex;\n font: inherit;\n font-size: var(--text-body-size-medium);\n line-height: var(--text-body-lineHeight-medium, 1.4285);\n color: var(--fgColor-default);\n text-align: center;\n text-decoration: none;\n cursor: pointer;\n background-color: transparent;\n border: 0;\n border-radius: var(--borderRadius-medium);\n max-width: 100%;\n margin-bottom: var(--base-size-8);\n height: 32px;\n\n /* button resets */\n appearance: none;\n padding-inline: var(--base-size-8);\n padding-block: var(--base-size-6);\n align-items: center;\n\n @media (hover: hover) {\n &:hover {\n text-decoration: none;\n background-color: var(--bgColor-neutral-muted);\n transition: background-color 0.12s ease-out;\n }\n }\n}\n\n.UnderlineItem:focus {\n outline: 2px solid transparent;\n /* stylelint-disable-next-line primer/box-shadow */\n box-shadow: inset 0 0 0 2px var(--fgColor-accent);\n\n /* where focus-visible is supported, remove the focus box-shadow */\n &:not(:focus-visible) {\n box-shadow: none;\n }\n}\n\n.UnderlineItem:focus-visible {\n outline: 2px solid transparent;\n /* stylelint-disable-next-line primer/box-shadow */\n box-shadow: inset 0 0 0 2px var(--fgColor-accent);\n}\n\n/* renders a visibly hidden \"copy\" of the label in bold, reserving box space for when label becomes bold on selected */\n.UnderlineItem [data-content]::before {\n display: block;\n height: 0;\n font-weight: var(--base-text-weight-semibold);\n white-space: nowrap;\n visibility: hidden;\n content: attr(data-content);\n}\n\n.UnderlineItem [data-component='icon'] {\n display: inline-flex;\n color: var(--fgColor-muted);\n align-items: center;\n margin-inline-end: var(--base-size-8);\n}\n\n/* Truncate items if necessary (should only ever apply to the last item after everything else overflows) */\n.UnderlineItem [data-component='text'] {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.UnderlineItem [data-component='counter'] {\n margin-inline-start: var(--base-size-8);\n display: flex;\n align-items: center;\n}\n\n.UnderlineItem::after {\n position: absolute;\n inset: auto 0 0;\n margin-bottom: calc(-1 * var(--base-size-8));\n height: 2px;\n pointer-events: none;\n content: '';\n background-color: transparent;\n}\n\n.UnderlineItem[aria-current]:not([aria-current='false']) [data-component='text'],\n.UnderlineItem[aria-selected='true'] [data-component='text'] {\n font-weight: var(--base-text-weight-semibold);\n}\n\n.UnderlineItem[aria-current]:not([aria-current='false'])::after,\n.UnderlineItem[aria-selected='true']::after {\n /* stylelint-disable-next-line primer/colors */\n background-color: var(--underlineNav-borderColor-active, var(--color-primer-border-active, #fd8c73));\n\n @media (forced-colors: active) {\n /* Support for Window Force Color Mode https://learn.microsoft.com/en-us/fluent-ui/web-components/design-system/high-contrast */\n background-color: LinkText;\n }\n}\n\n.LoadingCounter {\n display: inline-block;\n width: 1.5rem;\n height: 1rem;\n /* 16px */\n background-color: var(--bgColor-neutral-muted);\n border-color: var(--borderColor-default);\n /* stylelint-disable-next-line primer/borders */\n border-radius: 20px;\n animation: loadingCounterKeyFrames 1.2s ease-in-out infinite alternate;\n}\n\n@keyframes loadingCounterKeyFrames {\n from {\n opacity: 1;\n }\n\n to {\n opacity: 0.2;\n }\n}\n"]}
@@ -1,4 +1,4 @@
1
- import "./UnderlineTabbedInterface-25587345.css";
1
+ import "./UnderlineTabbedInterface-70ae932b.css";
2
2
  //#region src/internal/components/UnderlineTabbedInterface.module.css.js
3
3
  var UnderlineTabbedInterface_module_css_default = {
4
4
  "UnderlineWrapper": "prc-components-UnderlineWrapper-eT-Yj",
@@ -5,9 +5,10 @@ const warn = function warn(message) {
5
5
  const warning = function warning(condition, format, ...args) {
6
6
  if (condition) {
7
7
  let index = 0;
8
- warn(format.replace(/%s/g, () => {
8
+ const message = format.replace(/%s/g, () => {
9
9
  return args[index++];
10
- }));
10
+ });
11
+ warn(message);
11
12
  }
12
13
  };
13
14
  //#endregion
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@primer/react",
3
3
  "type": "module",
4
- "version": "0.0.0-20260714202217",
4
+ "version": "0.0.0-20260715113945",
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",
@@ -169,7 +169,7 @@
169
169
  "react-is": "18.3.1",
170
170
  "recast": "0.23.7",
171
171
  "rimraf": "5.0.5",
172
- "rolldown": "^1.1.2",
172
+ "rolldown": "^1.1.4",
173
173
  "rolldown-plugin-dts": "^0.26.0",
174
174
  "rolldown-plugin-import-css": "^0.0.0",
175
175
  "rolldown-plugin-preserve-directives": "^0.0.0",
@@ -1,2 +0,0 @@
1
- .prc-ActionBar-List-9uz46{align-items:flex-start;animation:prc-ActionBar-detect-overflow-mAuJu linear;display:flex;gap:var(--actionbar-gap,var(--stack-gap-condensed,.5rem));height:var(--actionbar-height,var(--control-small-size,1.75rem));list-style:none;margin-bottom:-1px;min-width:0;overflow:hidden;position:relative;animation-timeline:scroll(self block)}.prc-ActionBar-List-9uz46[data-has-overflow=true]{--morebutton-display:flex}.prc-ActionBar-List-9uz46:where([data-size=small]){--actionbar-height:var(--control-small-size,1.75rem)}.prc-ActionBar-List-9uz46:where([data-size=medium]){--actionbar-height:var(--control-medium-size,2rem)}.prc-ActionBar-List-9uz46:where([data-size=large]){--actionbar-height:var(--control-large-size,2.5rem)}.prc-ActionBar-List-9uz46:where([data-gap=none]){--actionbar-gap:0}.prc-ActionBar-List-9uz46:where([data-gap=none]) .prc-ActionBar-Divider-6V8yH{padding:0 var(--base-size-8,.5rem)}.prc-ActionBar-List-9uz46:where([data-gap=condensed]){--actionbar-gap:var(--stack-gap-condensed,0.5rem)}.prc-ActionBar-List-9uz46 [data-overflowing]{visibility:hidden!important}@keyframes prc-ActionBar-detect-overflow-mAuJu{0%,to{--morebutton-display:flex}}.prc-ActionBar-Nav-9spON{align-items:center;display:flex;justify-content:flex-end;padding-inline:var(--base-size-16,1rem)}.prc-ActionBar-Nav-9spON:where([data-flush=true]){padding-inline:0}.prc-ActionBar-Divider-6V8yH:before{background:var(--borderColor-muted,#d1d9e0b3);content:"";display:block;height:var(--base-size-20,1.25rem);margin-top:calc((var(--actionbar-height) - var(--base-size-20,1.25rem))/2);width:var(--borderWidth-thin,.0625rem)}.prc-ActionBar-Group-peNCk,.prc-ActionBar-OverflowContainer-AkYZs{display:flex;gap:inherit}.prc-ActionBar-OverflowContainer-AkYZs{flex-wrap:wrap;justify-content:flex-end;overflow:hidden}.prc-ActionBar-OverflowContainer-AkYZs .prc-ActionBar-OverflowSpacer-tbHkV{height:var(--actionbar-height)}.prc-ActionBar-MoreButton-RHqpx{display:var(--morebutton-display,none)}
2
- /*# sourceMappingURL=ActionBar-e63def3c.css.map */
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/ActionBar/ActionBar.module.css.js"],"names":[],"mappings":"AAAA,0BASE,sBAAuB,CASvB,oDAAiC,CAhBjC,YAAa,CAQb,yDAAqD,CAGrD,gEAA0D,CAL1D,eAAgB,CADhB,kBAAmB,CAJnB,WAAY,CAQZ,eAAgB,CAVhB,iBAAkB,CAkBlB,qCAsCF,CAnCE,kDACE,yBACF,CAEA,mDACE,oDACF,CAEA,oDACE,kDACF,CAEA,mDACE,mDACF,CAGA,iDACE,iBAKF,CAHE,8EACE,kCACF,CAGF,sDACE,iDACF,CAEA,6CAIE,2BACF,CAGF,+CACE,MAEE,yBACF,CACF,CAEA,yBAIE,kBAAmB,CAHnB,YAAa,CAEb,wBAAyB,CADzB,uCAOF,CAHE,kDACE,gBACF,CAIA,oCAME,6CAAoC,CAFpC,UAAW,CAHX,aAAc,CAEd,kCAA2B,CAK3B,0EAAqE,CANrE,sCAOF,CAQF,kEAJE,YAAa,CACb,WAaF,CAVA,uCAEE,cAAe,CAEf,wBAAyB,CACzB,eAKF,CAHE,2EACE,8BACF,CAGF,gCACE,sCACF","file":"ActionBar-e63def3c.css","sourcesContent":[".List {\n position: relative;\n display: flex;\n min-width: 0;\n\n /* wonder why this is here */\n /* stylelint-disable-next-line primer/spacing */\n margin-bottom: -1px;\n list-style: none;\n align-items: flex-start;\n gap: var(--actionbar-gap, var(--stack-gap-condensed));\n overflow: hidden;\n /* Explicit height is required to clip wrapped items */\n height: var(--actionbar-height, var(--control-small-size));\n\n /* Scroll-based animations have no effect unless the container is scrollable (has overflow, even with overflow:hidden)\n so we can use them to detect overflow. It would be cleaner to use scroll-state container queries for this, but\n browser support for scroll-driven animations is slightly better. */\n animation: detect-overflow linear;\n animation-timeline: scroll(self block);\n\n /* After initial render, JS is used to control visibility which provides progressive enhancement for unsupported browsers */\n &[data-has-overflow='true'] {\n --morebutton-display: flex;\n }\n\n &:where([data-size='small']) {\n --actionbar-height: var(--control-small-size);\n }\n\n &:where([data-size='medium']) {\n --actionbar-height: var(--control-medium-size);\n }\n\n &:where([data-size='large']) {\n --actionbar-height: var(--control-large-size);\n }\n\n /* Gap scale (mirrors Stack) */\n &:where([data-gap='none']) {\n --actionbar-gap: 0;\n\n .Divider {\n padding: 0 var(--base-size-8);\n }\n }\n\n &:where([data-gap='condensed']) {\n --actionbar-gap: var(--stack-gap-condensed);\n }\n\n & [data-overflowing] {\n /* Hide overflowing items. Even though they are clipped by `overflow: hidden`, setting `visibility: hidden` ensures\n they can't accidentally be shown and also hides them from screen readers / keyboard nav. `!important` prevents\n consumers from unintentionally overriding this and breaking accessibility. */\n visibility: hidden !important;\n }\n}\n\n@keyframes detect-overflow {\n 0%,\n 100% {\n --morebutton-display: flex;\n }\n}\n\n.Nav {\n display: flex;\n padding-inline: var(--base-size-16);\n justify-content: flex-end;\n align-items: center;\n\n &:where([data-flush='true']) {\n padding-inline: 0;\n }\n}\n\n.Divider {\n &::before {\n display: block;\n width: var(--borderWidth-thin);\n height: var(--base-size-20);\n content: '';\n /* stylelint-disable-next-line primer/colors */\n background: var(--borderColor-muted);\n /* stylelint-disable-next-line primer/spacing */\n margin-top: calc((var(--actionbar-height) - var(--base-size-20)) / 2);\n }\n}\n\n.Group {\n display: flex;\n gap: inherit;\n}\n\n.OverflowContainer {\n display: flex;\n flex-wrap: wrap;\n gap: inherit;\n justify-content: flex-end;\n overflow: hidden;\n\n .OverflowSpacer {\n height: var(--actionbar-height);\n }\n}\n\n.MoreButton {\n display: var(--morebutton-display, none);\n}\n"]}
@@ -1,2 +0,0 @@
1
- .prc-LabelGroup-Container-E-ePP{display:flex;flex-wrap:nowrap;gap:var(--base-size-4,.25rem);line-height:1;max-width:100%;overflow:hidden}.prc-LabelGroup-Container-E-ePP:where([data-overflow=inline]){flex-wrap:wrap}.prc-LabelGroup-Container-E-ePP:where([data-list]){list-style-type:none;margin-block-end:0;margin-block-start:0;padding-inline-start:0}.prc-LabelGroup-ItemWrapper-GkO4t{align-items:center;display:flex;min-height:28px}.prc-LabelGroup-ItemWrapper--hidden-mdrB0{order:9999;pointer-events:none;visibility:hidden}.prc-LabelGroup-OverlayContainer-duQvd{align-items:flex-start;display:flex}.prc-LabelGroup-OverlayInner-nDXRC{display:flex;flex-wrap:wrap;gap:var(--base-size-4,.25rem)}.prc-LabelGroup-CloseButton-IyLno{flex-shrink:0}
2
- /*# sourceMappingURL=LabelGroup-7d19205a.css.map */
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/LabelGroup/LabelGroup.module.css.js"],"names":[],"mappings":"AAAA,gCACE,YAAa,CACb,gBAAiB,CACjB,6BAAuB,CAEvB,aAAc,CACd,cAAe,CACf,eAYF,CAVE,8DACE,cACF,CAEA,mDAIE,oBAAqB,CADrB,kBAAmB,CADnB,oBAAqB,CADrB,sBAIF,CAGF,kCAEE,kBAAmB,CADnB,YAAa,CAOb,eACF,CAEA,0CACE,UAAW,CACX,mBAAoB,CACpB,iBACF,CAEA,uCACE,sBAAuB,CACvB,YACF,CAEA,mCACE,YAAa,CACb,cAAe,CACf,6BACF,CAEA,kCACE,aACF","file":"LabelGroup-7d19205a.css","sourcesContent":[".Container {\n display: flex;\n flex-wrap: nowrap;\n gap: var(--base-size-4);\n /* stylelint-disable-next-line primer/typography */\n line-height: 1;\n max-width: 100%;\n overflow: hidden;\n\n &:where([data-overflow='inline']) {\n flex-wrap: wrap;\n }\n\n &:where([data-list]) {\n padding-inline-start: 0;\n margin-block-start: 0;\n margin-block-end: 0;\n list-style-type: none;\n }\n}\n\n.ItemWrapper {\n display: flex;\n align-items: center;\n /* This min-height matches the height of the expand/collapse button.\n Without it, the labels/tokens will do a slight layout shift when expanded.\n This is because the height of the first row will match the token sizes,\n but the height of the second row will be the height of the collapse button.\n */\n min-height: 28px;\n}\n\n.ItemWrapper--hidden {\n order: 9999;\n pointer-events: none;\n visibility: hidden;\n}\n\n.OverlayContainer {\n align-items: flex-start;\n display: flex;\n}\n\n.OverlayInner {\n display: flex;\n flex-wrap: wrap;\n gap: var(--base-size-4);\n}\n\n.CloseButton {\n flex-shrink: 0;\n}\n"]}