@primer/react 0.0.0-20260403172816 → 0.0.0-20260403183748

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # @primer/react
2
2
 
3
- ## 0.0.0-20260403172816
3
+ ## 0.0.0-20260403183748
4
4
 
5
5
  ### Minor Changes
6
6
 
@@ -1 +1 @@
1
- {"version":3,"file":"List.d.ts","sourceRoot":"","sources":["../../src/ActionList/List.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyB,MAAM,OAAO,CAAA;AAuF7C,QAAA,MAAM,IAAI,GA3Ea,EAAE,SAAS,KAAK,CAAC,WAAW;;;;;;;;;;;;;;;;;;;;oDA2ER,CAAA;AAI3C,OAAO,EAAC,IAAI,EAAC,CAAA"}
1
+ {"version":3,"file":"List.d.ts","sourceRoot":"","sources":["../../src/ActionList/List.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiB,MAAM,OAAO,CAAA;AAuFrC,QAAA,MAAM,IAAI,GA3Ea,EAAE,SAAS,KAAK,CAAC,WAAW;;;;;;;;;;;;;;;;;;;;oDA2ER,CAAA;AAI3C,OAAO,EAAC,IAAI,EAAC,CAAA"}
@@ -1,5 +1,5 @@
1
1
  import { c } from 'react-compiler-runtime';
2
- import React, { useRef } from 'react';
2
+ import React from 'react';
3
3
  import { fixedForwardRef } from '../utils/modern-polymorphic.js';
4
4
  import { ActionListContainerContext } from './ActionListContainerContext.js';
5
5
  import { useSlots } from '../hooks/useSlots.js';
@@ -10,12 +10,12 @@ import { useFocusZone } from '../hooks/useFocusZone.js';
10
10
  import { clsx } from 'clsx';
11
11
  import classes from './ActionList.module.css.js';
12
12
  import { jsx, jsxs } from 'react/jsx-runtime';
13
- import { useMergedRefs } from '../hooks/useMergedRefs.js';
13
+ import { useProvidedRefOrCreate } from '../hooks/useProvidedRefOrCreate.js';
14
14
  import { FocusKeys } from '@primer/behaviors';
15
15
 
16
16
  const UnwrappedList = (props, forwardedRef) => {
17
17
  var _slots$heading$props$;
18
- const $ = c(36);
18
+ const $ = c(37);
19
19
  let className;
20
20
  let restProps;
21
21
  let role;
@@ -78,8 +78,7 @@ const UnwrappedList = (props, forwardedRef) => {
78
78
  } = React.useContext(ActionListContainerContext);
79
79
  const ariaLabelledBy = slots.heading ? (_slots$heading$props$ = slots.heading.props.id) !== null && _slots$heading$props$ !== void 0 ? _slots$heading$props$ : headingId : listLabelledBy;
80
80
  const listRole = role || listRoleFromContainer;
81
- const listRef = useRef(null);
82
- const mergedRef = useMergedRefs(forwardedRef, listRef);
81
+ const listRef = useProvidedRefOrCreate(forwardedRef);
83
82
  let enableFocusZone = false;
84
83
  if (enableFocusZoneFromContainer !== undefined) {
85
84
  enableFocusZone = enableFocusZoneFromContainer;
@@ -98,23 +97,24 @@ const UnwrappedList = (props, forwardedRef) => {
98
97
  const t5 = !enableFocusZone;
99
98
  const t6 = listRole === "menu" || container === "SelectPanel" || container === "FilteredActionList" ? "wrap" : undefined;
100
99
  let t7;
101
- if ($[11] !== t5 || $[12] !== t6) {
100
+ if ($[11] !== listRef || $[12] !== t5 || $[13] !== t6) {
102
101
  t7 = {
103
102
  disabled: t5,
104
103
  containerRef: listRef,
105
104
  bindKeys: FocusKeys.ArrowVertical | FocusKeys.HomeAndEnd | FocusKeys.PageUpDown,
106
105
  focusOutBehavior: t6
107
106
  };
108
- $[11] = t5;
109
- $[12] = t6;
110
- $[13] = t7;
107
+ $[11] = listRef;
108
+ $[12] = t5;
109
+ $[13] = t6;
110
+ $[14] = t7;
111
111
  } else {
112
- t7 = $[13];
112
+ t7 = $[14];
113
113
  }
114
114
  useFocusZone(t7);
115
115
  const t8 = selectionVariant || containerSelectionVariant;
116
116
  let t9;
117
- if ($[14] !== headingId || $[15] !== listRole || $[16] !== showDividers || $[17] !== t8 || $[18] !== variant) {
117
+ if ($[15] !== headingId || $[16] !== listRole || $[17] !== showDividers || $[18] !== t8 || $[19] !== variant) {
118
118
  t9 = {
119
119
  variant,
120
120
  selectionVariant: t8,
@@ -122,62 +122,62 @@ const UnwrappedList = (props, forwardedRef) => {
122
122
  role: listRole,
123
123
  headingId
124
124
  };
125
- $[14] = headingId;
126
- $[15] = listRole;
127
- $[16] = showDividers;
128
- $[17] = t8;
129
- $[18] = variant;
130
- $[19] = t9;
125
+ $[15] = headingId;
126
+ $[16] = listRole;
127
+ $[17] = showDividers;
128
+ $[18] = t8;
129
+ $[19] = variant;
130
+ $[20] = t9;
131
131
  } else {
132
- t9 = $[19];
132
+ t9 = $[20];
133
133
  }
134
134
  const listContextValue = t9;
135
135
  const t10 = slots.heading;
136
136
  let t11;
137
- if ($[20] !== className) {
137
+ if ($[21] !== className) {
138
138
  t11 = clsx(classes.ActionList, className);
139
- $[20] = className;
140
- $[21] = t11;
139
+ $[21] = className;
140
+ $[22] = t11;
141
141
  } else {
142
- t11 = $[21];
142
+ t11 = $[22];
143
143
  }
144
144
  let t12;
145
- if ($[22] !== Component || $[23] !== ariaLabelledBy || $[24] !== childrenWithoutSlots || $[25] !== listRole || $[26] !== mergedRef || $[27] !== restProps || $[28] !== showDividers || $[29] !== t11 || $[30] !== variant) {
145
+ if ($[23] !== Component || $[24] !== ariaLabelledBy || $[25] !== childrenWithoutSlots || $[26] !== listRef || $[27] !== listRole || $[28] !== restProps || $[29] !== showDividers || $[30] !== t11 || $[31] !== variant) {
146
146
  t12 = /*#__PURE__*/jsx(Component, {
147
147
  className: t11,
148
148
  role: listRole,
149
149
  "aria-labelledby": ariaLabelledBy,
150
- ref: mergedRef,
150
+ ref: listRef,
151
151
  "data-dividers": showDividers,
152
152
  "data-variant": variant,
153
153
  ...restProps,
154
154
  children: childrenWithoutSlots
155
155
  });
156
- $[22] = Component;
157
- $[23] = ariaLabelledBy;
158
- $[24] = childrenWithoutSlots;
159
- $[25] = listRole;
160
- $[26] = mergedRef;
161
- $[27] = restProps;
162
- $[28] = showDividers;
163
- $[29] = t11;
164
- $[30] = variant;
165
- $[31] = t12;
156
+ $[23] = Component;
157
+ $[24] = ariaLabelledBy;
158
+ $[25] = childrenWithoutSlots;
159
+ $[26] = listRef;
160
+ $[27] = listRole;
161
+ $[28] = restProps;
162
+ $[29] = showDividers;
163
+ $[30] = t11;
164
+ $[31] = variant;
165
+ $[32] = t12;
166
166
  } else {
167
- t12 = $[31];
167
+ t12 = $[32];
168
168
  }
169
169
  let t13;
170
- if ($[32] !== listContextValue || $[33] !== slots.heading || $[34] !== t12) {
170
+ if ($[33] !== listContextValue || $[34] !== slots.heading || $[35] !== t12) {
171
171
  t13 = /*#__PURE__*/jsxs(ListContext.Provider, {
172
172
  value: listContextValue,
173
173
  children: [t10, t12]
174
174
  });
175
- $[32] = listContextValue;
176
- $[33] = slots.heading;
177
- $[34] = t12;
178
- $[35] = t13;
175
+ $[33] = listContextValue;
176
+ $[34] = slots.heading;
177
+ $[35] = t12;
178
+ $[36] = t13;
179
179
  } else {
180
- t13 = $[35];
180
+ t13 = $[36];
181
181
  }
182
182
  return t13;
183
183
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@primer/react",
3
3
  "type": "module",
4
- "version": "0.0.0-20260403172816",
4
+ "version": "0.0.0-20260403183748",
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",