@primer/react 0.0.0-20260311182527 → 0.0.0-20260311183958

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-20260311182527
3
+ ## 0.0.0-20260311183958
4
4
 
5
5
  ### Patch Changes
6
6
 
@@ -0,0 +1,2 @@
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);list-style:none;margin-bottom:-1px;min-width:0;overflow:hidden;position:relative;white-space:nowrap;animation-timeline:scroll(self block);--actionbar-height:var(--control-small-size,1.75rem);--morebutton-display:none}.prc-ActionBar-List-9uz46[data-has-overflow=true]{--morebutton-display:block}.prc-ActionBar-List-9uz46[data-size=medium]{--actionbar-height:var(--control-medium-size,2rem)}.prc-ActionBar-List-9uz46[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)}@keyframes prc-ActionBar-detect-overflow-mAuJu{0%,to{--morebutton-display:block}}.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,var(--color-border-muted));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}.prc-ActionBar-MoreButton-RHqpx{display:var(--morebutton-display)}
2
+ /*# sourceMappingURL=ActionBar-544d3fab.css.map */
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/ActionBar/ActionBar.module.css.js"],"names":[],"mappings":"AAAA,0BAUE,sBAAuB,CAIvB,oDAAiC,CAZjC,YAAa,CASb,yDAAqD,CAErD,8BAA+B,CAJ/B,eAAgB,CAFhB,kBAAmB,CAJnB,WAAY,CASZ,eAAgB,CAXhB,iBAAkB,CAOlB,kBAAmB,CAOnB,qCAAsC,CAEtC,oDAA6C,CAC7C,yBA2BF,CAzBE,kDAEE,0BACF,CAEA,4CACE,kDACF,CAEA,2CACE,mDACF,CAGA,iDACE,iBAKF,CAHE,8EACE,kCACF,CAGF,sDACE,iDACF,CAGF,+CACE,MAEE,0BACF,CACF,CAEA,yBAIE,kBAAmB,CAHnB,YAAa,CAEb,wBAAyB,CADzB,uCAOF,CAHE,kDACE,gBACF,CAIA,oCAME,6DAAoC,CAFpC,UAAW,CAHX,aAAc,CAEd,kCAA2B,CAK3B,0EAAqE,CANrE,sCAOF,CAQF,kEAJE,YAAa,CACb,WAQF,CALA,uCAEE,cAAe,CAEf,wBACF,CAEA,gCACE,iCACF","file":"ActionBar-544d3fab.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 white-space: nowrap;\n list-style: none;\n align-items: flex-start;\n gap: var(--actionbar-gap, var(--stack-gap-condensed));\n overflow: hidden;\n height: var(--actionbar-height);\n animation: detect-overflow linear;\n animation-timeline: scroll(self block);\n\n --actionbar-height: var(--control-small-size);\n --morebutton-display: none;\n\n &[data-has-overflow='true'] {\n /* Progressive enhancement: show overflow button on browsers that don't support scroll-driven animations */\n --morebutton-display: block;\n }\n\n &[data-size='medium'] {\n --actionbar-height: var(--control-medium-size);\n }\n\n &[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\n@keyframes detect-overflow {\n 0%,\n 100% {\n --morebutton-display: block;\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}\n\n.MoreButton {\n display: var(--morebutton-display);\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ActionBar.d.ts","sourceRoot":"","sources":["../../src/ActionBar/ActionBar.tsx"],"names":[],"mappings":"AACA,OAAO,KAAiF,MAAM,OAAO,CAAA;AAErG,OAAO,EAAa,KAAK,mBAAmB,EAAC,MAAM,eAAe,CAAA;AAElE,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,WAAW,CAAA;AAsC9C,KAAK,IAAI,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAA;AAExC,KAAK,SAAS,GACV;IACE,wDAAwD;IACxD,YAAY,EAAE,KAAK,CAAC,cAAc,CAAC,YAAY,CAAC,CAAA;IAChD,iBAAiB,CAAC,EAAE,SAAS,CAAA;CAC9B,GACD;IACE,YAAY,CAAC,EAAE,SAAS,CAAA;IACxB;;OAEG;IACH,iB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AAK,EAAE,sBAAsB,EAAE,CAAA;IAC/B;;;OAGG;IACH,YAAY,CAAC,EAAE,wBAAwB,CAAC,MAAM,CAAC,GAAG,MAAM,CAAA;IACxD;;OAEG;IACH,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAA;CAC9C,GAAG,eAAe,CAAA;AAqDnB,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC,cAAc,CAAC,CAyJvE,CAAA;AA2BD,eAAO,MAAM,mBAAmB,0FA8C/B,CAAA;AAMD,eAAO,MAAM,cAAc;;iCAezB,CAAA;AAEF,eAAO,MAAM,aAAa;IA5TxB,2CAA2C;kBAC7B,MAAM;IACpB,+BAA+B;UACzB,wBAAwB,CAAC,MAAM,CAAC;WAC/B,sBAAsB,EAAE;IAC/B;;;OAGG;mBACY,wBAAwB,CAAC,MAAM,CAAC,GAAG,MAAM;IACxD;;OAEG;qBACc,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC;;;;;;;;;;;wGAyV9C,CAAA;AAED,eAAO,MAAM,eAAe,yBAgB3B,CAAA"}
@@ -7,7 +7,7 @@ import { useFocusZone } from '../hooks/useFocusZone.js';
7
7
  import styles from './ActionBar.module.css.js';
8
8
  import { clsx } from 'clsx';
9
9
  import { createDescendantRegistry } from '../utils/descendant-registry.js';
10
- import { jsxs, jsx } from 'react/jsx-runtime';
10
+ import { jsx, jsxs } from 'react/jsx-runtime';
11
11
  import { useRefObjectAsForwardedRef } from '../hooks/useRefObjectAsForwardedRef.js';
12
12
  import { FocusKeys } from '@primer/behaviors';
13
13
  import { ActionMenu } from '../ActionMenu/ActionMenu.js';
@@ -71,7 +71,7 @@ const renderMenuItem = (item, index) => {
71
71
  };
72
72
  renderMenuItem.displayName = "renderMenuItem";
73
73
  const ActionBar = props => {
74
- const $ = c(51);
74
+ const $ = c(68);
75
75
  const {
76
76
  size: t0,
77
77
  children,
@@ -100,12 +100,18 @@ const ActionBar = props => {
100
100
  }
101
101
  useFocusZone(t3);
102
102
  let T0;
103
+ let T1;
104
+ let T2;
105
+ let T3;
103
106
  let t10;
104
107
  let t11;
105
108
  let t12;
106
109
  let t13;
107
110
  let t14;
108
111
  let t15;
112
+ let t16;
113
+ let t17;
114
+ let t18;
109
115
  let t4;
110
116
  let t5;
111
117
  let t6;
@@ -124,119 +130,117 @@ const ActionBar = props => {
124
130
  }
125
131
  }
126
132
  const groupedItems = groupedItemsMap;
127
- T0 = ActionBarContext.Provider;
128
- if ($[23] !== size) {
129
- t15 = {
133
+ T3 = ActionBarContext.Provider;
134
+ if ($[29] !== size) {
135
+ t18 = {
130
136
  size
131
137
  };
132
- $[23] = size;
133
- $[24] = t15;
138
+ $[29] = size;
139
+ $[30] = t18;
134
140
  } else {
135
- t15 = $[24];
141
+ t18 = $[30];
136
142
  }
137
- t12 = navRef;
138
- if ($[25] !== className) {
139
- t13 = clsx(className, styles.Nav);
140
- $[25] = className;
141
- $[26] = t13;
142
- } else {
143
- t13 = $[26];
144
- }
145
- t14 = flush;
146
- t4 = listRef;
147
- t5 = "toolbar";
148
- t6 = styles.List;
149
- t7 = ariaLabel;
150
- t8 = ariaLabelledBy;
151
- t9 = gap;
152
- let t16;
153
- if ($[27] !== children || $[28] !== setChildRegistry) {
154
- t16 = /*#__PURE__*/jsx(ActionBarItemsRegistry.Provider, {
155
- setRegistry: setChildRegistry,
156
- children: children
157
- });
158
- $[27] = children;
159
- $[28] = setChildRegistry;
160
- $[29] = t16;
143
+ t15 = navRef;
144
+ if ($[31] !== className) {
145
+ t16 = clsx(className, styles.Nav);
146
+ $[31] = className;
147
+ $[32] = t16;
161
148
  } else {
162
- t16 = $[29];
149
+ t16 = $[32];
163
150
  }
164
- if ($[30] !== size || $[31] !== t16) {
165
- t10 = /*#__PURE__*/jsx("div", {
151
+ t17 = flush;
152
+ t6 = listRef;
153
+ t7 = "toolbar";
154
+ t8 = styles.List;
155
+ t9 = ariaLabel;
156
+ t10 = ariaLabelledBy;
157
+ t11 = gap;
158
+ t12 = size;
159
+ t13 = overflowItems.length > 0;
160
+ if ($[33] !== children || $[34] !== setChildRegistry) {
161
+ t14 = /*#__PURE__*/jsx("div", {
166
162
  className: styles.OverflowContainer,
167
- "data-size": size,
168
- children: t16
163
+ children: /*#__PURE__*/jsx(ActionBarItemsRegistry.Provider, {
164
+ setRegistry: setChildRegistry,
165
+ children: children
166
+ })
169
167
  });
170
- $[30] = size;
171
- $[31] = t16;
172
- $[32] = t10;
168
+ $[33] = children;
169
+ $[34] = setChildRegistry;
170
+ $[35] = t14;
173
171
  } else {
174
- t10 = $[32];
172
+ t14 = $[35];
175
173
  }
176
- t11 = overflowItems.length > 0 && /*#__PURE__*/jsxs(ActionMenu, {
177
- children: [/*#__PURE__*/jsx(ActionMenu.Anchor, {
174
+ T2 = ActionMenu;
175
+ const t19 = `More ${ariaLabel} items`;
176
+ if ($[36] !== t19) {
177
+ t5 = /*#__PURE__*/jsx(ActionMenu.Anchor, {
178
178
  children: /*#__PURE__*/jsx(IconButton, {
179
179
  variant: "invisible",
180
- "aria-label": `More ${ariaLabel} items`,
181
- icon: KebabHorizontalIcon
182
- })
183
- }), /*#__PURE__*/jsx(ActionMenu.Overlay, {
184
- children: /*#__PURE__*/jsx(ActionList, {
185
- children: overflowItems.map(t17 => {
186
- const [id, menuItem] = t17;
187
- if (menuItem.type === "divider") {
188
- return /*#__PURE__*/jsx(ActionList.Divider, {}, id);
189
- }
190
- if (menuItem.type === "action") {
191
- const {
192
- onClick,
193
- icon: Icon,
194
- label,
195
- disabled
196
- } = menuItem;
197
- return /*#__PURE__*/jsxs(ActionList.Item, {
198
- onSelect: event => {
199
- typeof onClick === "function" && onClick(event);
200
- },
201
- disabled: disabled,
202
- children: [/*#__PURE__*/jsx(ActionList.LeadingVisual, {
203
- children: /*#__PURE__*/jsx(Icon, {})
204
- }), label]
205
- }, label);
206
- }
207
- if (menuItem.type === "menu") {
208
- const menuItems = menuItem.items;
209
- const {
210
- icon: Icon_0,
211
- label: label_0,
212
- returnFocusRef
213
- } = menuItem;
214
- return /*#__PURE__*/jsxs(ActionMenu, {
215
- children: [/*#__PURE__*/jsx(ActionMenu.Anchor, {
216
- children: /*#__PURE__*/jsxs(ActionList.Item, {
217
- children: [Icon_0 !== "none" ? /*#__PURE__*/jsx(ActionList.LeadingVisual, {
218
- children: /*#__PURE__*/jsx(Icon_0, {})
219
- }) : null, label_0]
220
- })
221
- }), /*#__PURE__*/jsx(ActionMenu.Overlay, {
222
- ...(returnFocusRef && {
223
- returnFocusRef
224
- }),
225
- children: /*#__PURE__*/jsx(ActionList, {
226
- children: menuItems.map(_temp2)
227
- })
228
- })]
229
- }, id);
230
- }
231
- const groupedMenuItems = groupedItems.get(id) || [];
232
- if (menuItem.type === "group") {
233
- return /*#__PURE__*/jsx(React.Fragment, {
234
- children: groupedMenuItems.map(_temp3)
235
- }, id);
236
- }
237
- })
180
+ "aria-label": t19,
181
+ icon: KebabHorizontalIcon,
182
+ className: styles.MoreButton
238
183
  })
239
- })]
184
+ });
185
+ $[36] = t19;
186
+ $[37] = t5;
187
+ } else {
188
+ t5 = $[37];
189
+ }
190
+ T1 = ActionMenu.Overlay;
191
+ T0 = ActionList;
192
+ t4 = overflowItems.map(t20 => {
193
+ const [id, menuItem] = t20;
194
+ if (menuItem.type === "divider") {
195
+ return /*#__PURE__*/jsx(ActionList.Divider, {}, id);
196
+ }
197
+ if (menuItem.type === "action") {
198
+ const {
199
+ onClick,
200
+ icon: Icon,
201
+ label,
202
+ disabled
203
+ } = menuItem;
204
+ return /*#__PURE__*/jsxs(ActionList.Item, {
205
+ onSelect: event => {
206
+ typeof onClick === "function" && onClick(event);
207
+ },
208
+ disabled: disabled,
209
+ children: [/*#__PURE__*/jsx(ActionList.LeadingVisual, {
210
+ children: /*#__PURE__*/jsx(Icon, {})
211
+ }), label]
212
+ }, label);
213
+ }
214
+ if (menuItem.type === "menu") {
215
+ const menuItems = menuItem.items;
216
+ const {
217
+ icon: Icon_0,
218
+ label: label_0,
219
+ returnFocusRef
220
+ } = menuItem;
221
+ return /*#__PURE__*/jsxs(ActionMenu, {
222
+ children: [/*#__PURE__*/jsx(ActionMenu.Anchor, {
223
+ children: /*#__PURE__*/jsxs(ActionList.Item, {
224
+ children: [Icon_0 !== "none" ? /*#__PURE__*/jsx(ActionList.LeadingVisual, {
225
+ children: /*#__PURE__*/jsx(Icon_0, {})
226
+ }) : null, label_0]
227
+ })
228
+ }), /*#__PURE__*/jsx(ActionMenu.Overlay, {
229
+ ...(returnFocusRef && {
230
+ returnFocusRef
231
+ }),
232
+ children: /*#__PURE__*/jsx(ActionList, {
233
+ children: menuItems.map(_temp2)
234
+ })
235
+ })]
236
+ }, id);
237
+ }
238
+ const groupedMenuItems = groupedItems.get(id) || [];
239
+ if (menuItem.type === "group") {
240
+ return /*#__PURE__*/jsx(React.Fragment, {
241
+ children: groupedMenuItems.map(_temp3)
242
+ }, id);
243
+ }
240
244
  });
241
245
  $[1] = ariaLabel;
242
246
  $[2] = ariaLabelledBy;
@@ -248,89 +252,139 @@ const ActionBar = props => {
248
252
  $[8] = setChildRegistry;
249
253
  $[9] = size;
250
254
  $[10] = T0;
251
- $[11] = t10;
252
- $[12] = t11;
253
- $[13] = t12;
254
- $[14] = t13;
255
- $[15] = t14;
256
- $[16] = t15;
257
- $[17] = t4;
258
- $[18] = t5;
259
- $[19] = t6;
260
- $[20] = t7;
261
- $[21] = t8;
262
- $[22] = t9;
255
+ $[11] = T1;
256
+ $[12] = T2;
257
+ $[13] = T3;
258
+ $[14] = t10;
259
+ $[15] = t11;
260
+ $[16] = t12;
261
+ $[17] = t13;
262
+ $[18] = t14;
263
+ $[19] = t15;
264
+ $[20] = t16;
265
+ $[21] = t17;
266
+ $[22] = t18;
267
+ $[23] = t4;
268
+ $[24] = t5;
269
+ $[25] = t6;
270
+ $[26] = t7;
271
+ $[27] = t8;
272
+ $[28] = t9;
263
273
  } else {
264
274
  T0 = $[10];
265
- t10 = $[11];
266
- t11 = $[12];
267
- t12 = $[13];
268
- t13 = $[14];
269
- t14 = $[15];
270
- t15 = $[16];
271
- t4 = $[17];
272
- t5 = $[18];
273
- t6 = $[19];
274
- t7 = $[20];
275
- t8 = $[21];
276
- t9 = $[22];
275
+ T1 = $[11];
276
+ T2 = $[12];
277
+ T3 = $[13];
278
+ t10 = $[14];
279
+ t11 = $[15];
280
+ t12 = $[16];
281
+ t13 = $[17];
282
+ t14 = $[18];
283
+ t15 = $[19];
284
+ t16 = $[20];
285
+ t17 = $[21];
286
+ t18 = $[22];
287
+ t4 = $[23];
288
+ t5 = $[24];
289
+ t6 = $[25];
290
+ t7 = $[26];
291
+ t8 = $[27];
292
+ t9 = $[28];
277
293
  }
278
- let t16;
279
- if ($[33] !== t10 || $[34] !== t11 || $[35] !== t4 || $[36] !== t5 || $[37] !== t6 || $[38] !== t7 || $[39] !== t8 || $[40] !== t9) {
280
- t16 = /*#__PURE__*/jsxs("div", {
281
- ref: t4,
282
- role: t5,
283
- className: t6,
284
- "aria-label": t7,
285
- "aria-labelledby": t8,
286
- "data-gap": t9,
287
- children: [t10, t11]
294
+ let t19;
295
+ if ($[38] !== T0 || $[39] !== t4) {
296
+ t19 = /*#__PURE__*/jsx(T0, {
297
+ children: t4
288
298
  });
289
- $[33] = t10;
290
- $[34] = t11;
291
- $[35] = t4;
292
- $[36] = t5;
293
- $[37] = t6;
294
- $[38] = t7;
295
- $[39] = t8;
296
- $[40] = t9;
297
- $[41] = t16;
299
+ $[38] = T0;
300
+ $[39] = t4;
301
+ $[40] = t19;
298
302
  } else {
299
- t16 = $[41];
303
+ t19 = $[40];
300
304
  }
301
- let t17;
302
- if ($[42] !== t12 || $[43] !== t13 || $[44] !== t14 || $[45] !== t16) {
303
- t17 = /*#__PURE__*/jsx("div", {
304
- ref: t12,
305
- className: t13,
306
- "data-flush": t14,
307
- children: t16
305
+ let t20;
306
+ if ($[41] !== T1 || $[42] !== t19) {
307
+ t20 = /*#__PURE__*/jsx(T1, {
308
+ children: t19
308
309
  });
309
- $[42] = t12;
310
- $[43] = t13;
311
- $[44] = t14;
312
- $[45] = t16;
313
- $[46] = t17;
310
+ $[41] = T1;
311
+ $[42] = t19;
312
+ $[43] = t20;
314
313
  } else {
315
- t17 = $[46];
314
+ t20 = $[43];
316
315
  }
317
- let t18;
318
- if ($[47] !== T0 || $[48] !== t15 || $[49] !== t17) {
319
- t18 = /*#__PURE__*/jsx(T0, {
320
- value: t15,
321
- children: t17
316
+ let t21;
317
+ if ($[44] !== T2 || $[45] !== t20 || $[46] !== t5) {
318
+ t21 = /*#__PURE__*/jsxs(T2, {
319
+ children: [t5, t20]
320
+ });
321
+ $[44] = T2;
322
+ $[45] = t20;
323
+ $[46] = t5;
324
+ $[47] = t21;
325
+ } else {
326
+ t21 = $[47];
327
+ }
328
+ let t22;
329
+ if ($[48] !== t10 || $[49] !== t11 || $[50] !== t12 || $[51] !== t13 || $[52] !== t14 || $[53] !== t21 || $[54] !== t6 || $[55] !== t7 || $[56] !== t8 || $[57] !== t9) {
330
+ t22 = /*#__PURE__*/jsxs("div", {
331
+ ref: t6,
332
+ role: t7,
333
+ className: t8,
334
+ "aria-label": t9,
335
+ "aria-labelledby": t10,
336
+ "data-gap": t11,
337
+ "data-size": t12,
338
+ "data-has-overflow": t13,
339
+ children: [t14, t21]
340
+ });
341
+ $[48] = t10;
342
+ $[49] = t11;
343
+ $[50] = t12;
344
+ $[51] = t13;
345
+ $[52] = t14;
346
+ $[53] = t21;
347
+ $[54] = t6;
348
+ $[55] = t7;
349
+ $[56] = t8;
350
+ $[57] = t9;
351
+ $[58] = t22;
352
+ } else {
353
+ t22 = $[58];
354
+ }
355
+ let t23;
356
+ if ($[59] !== t15 || $[60] !== t16 || $[61] !== t17 || $[62] !== t22) {
357
+ t23 = /*#__PURE__*/jsx("div", {
358
+ ref: t15,
359
+ className: t16,
360
+ "data-flush": t17,
361
+ children: t22
362
+ });
363
+ $[59] = t15;
364
+ $[60] = t16;
365
+ $[61] = t17;
366
+ $[62] = t22;
367
+ $[63] = t23;
368
+ } else {
369
+ t23 = $[63];
370
+ }
371
+ let t24;
372
+ if ($[64] !== T3 || $[65] !== t18 || $[66] !== t23) {
373
+ t24 = /*#__PURE__*/jsx(T3, {
374
+ value: t18,
375
+ children: t23
322
376
  });
323
- $[47] = T0;
324
- $[48] = t15;
325
- $[49] = t17;
326
- $[50] = t18;
377
+ $[64] = T3;
378
+ $[65] = t18;
379
+ $[66] = t23;
380
+ $[67] = t24;
327
381
  } else {
328
- t18 = $[50];
382
+ t24 = $[67];
329
383
  }
330
- return t18;
384
+ return t24;
331
385
  };
332
- function useIsOverflowing(ref) {
333
- const $ = c(4);
386
+ function useActionBarItem(ref, registryProps) {
387
+ const $ = c(7);
334
388
  let t0;
335
389
  if ($[0] !== ref) {
336
390
  t0 = onChange => {
@@ -355,7 +409,21 @@ function useIsOverflowing(ref) {
355
409
  } else {
356
410
  t1 = $[3];
357
411
  }
358
- return useSyncExternalStore(t0, t1, _temp4);
412
+ const isOverflowing = useSyncExternalStore(t0, t1, _temp4);
413
+ const id = ActionBarItemsRegistry.useRegisterDescendant(isOverflowing ? registryProps : null);
414
+ let t2;
415
+ if ($[4] !== id || $[5] !== isOverflowing) {
416
+ t2 = {
417
+ id,
418
+ isOverflowing
419
+ };
420
+ $[4] = id;
421
+ $[5] = isOverflowing;
422
+ $[6] = t2;
423
+ } else {
424
+ t2 = $[6];
425
+ }
426
+ return t2;
359
427
  }
360
428
  function _temp4() {
361
429
  return false;
@@ -373,20 +441,20 @@ const ActionBarIconButton = /*#__PURE__*/forwardRef(({
373
441
  const {
374
442
  groupId
375
443
  } = React.useContext(ActionBarGroupContext);
376
- const isOverflowing = useIsOverflowing(ref);
377
444
  const {
378
445
  ['aria-label']: ariaLabel,
379
446
  icon
380
447
  } = props;
381
- const registryProps = useMemo(() => ({
448
+ const {
449
+ isOverflowing
450
+ } = useActionBarItem(ref, useMemo(() => ({
382
451
  type: 'action',
383
452
  label: ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : '',
384
453
  icon,
385
454
  disabled: !!disabled,
386
455
  onClick: onClick,
387
456
  groupId: groupId !== null && groupId !== void 0 ? groupId : undefined
388
- }), [ariaLabel, icon, disabled, onClick, groupId]);
389
- ActionBarItemsRegistry.useRegisterDescendant(isOverflowing ? registryProps : null);
457
+ }), [ariaLabel, icon, disabled, onClick, groupId]));
390
458
  const clickHandler = useCallback(event => {
391
459
  if (disabled) return;
392
460
  onClick === null || onClick === void 0 ? void 0 : onClick(event);
@@ -412,7 +480,6 @@ const ActionBarGroup = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
412
480
  } = t0;
413
481
  const backupRef = useRef(null);
414
482
  const ref = forwardedRef !== null && forwardedRef !== void 0 ? forwardedRef : backupRef;
415
- const isOverflowing = useIsOverflowing(ref);
416
483
  let t1;
417
484
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
418
485
  t1 = {
@@ -422,8 +489,10 @@ const ActionBarGroup = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
422
489
  } else {
423
490
  t1 = $[0];
424
491
  }
425
- const registryProps = t1;
426
- const id = ActionBarItemsRegistry.useRegisterDescendant(isOverflowing ? registryProps : null);
492
+ const {
493
+ id,
494
+ isOverflowing
495
+ } = useActionBarItem(ref, t1);
427
496
  let t2;
428
497
  if ($[1] !== id) {
429
498
  t2 = {
@@ -499,7 +568,6 @@ const ActionBarMenu = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
499
568
  const backupRef = useRef(null);
500
569
  const ref = forwardedRef !== null && forwardedRef !== void 0 ? forwardedRef : backupRef;
501
570
  const [menuOpen, setMenuOpen] = useState(false);
502
- const isOverflowing = useIsOverflowing(ref);
503
571
  const t1 = overflowIcon ? overflowIcon : icon;
504
572
  let t2;
505
573
  if ($[7] !== ariaLabel || $[8] !== items || $[9] !== returnFocusRef || $[10] !== t1) {
@@ -518,8 +586,9 @@ const ActionBarMenu = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
518
586
  } else {
519
587
  t2 = $[11];
520
588
  }
521
- const registryProps = t2;
522
- ActionBarItemsRegistry.useRegisterDescendant(isOverflowing ? registryProps : null);
589
+ const {
590
+ isOverflowing
591
+ } = useActionBarItem(ref, t2);
523
592
  const t3 = isOverflowing || props["aria-hidden"];
524
593
  let t4;
525
594
  if ($[12] !== ariaLabel || $[13] !== icon || $[14] !== isOverflowing || $[15] !== props || $[16] !== t3) {
@@ -603,7 +672,6 @@ const ActionBarMenu = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
603
672
  const VerticalDivider = () => {
604
673
  const $ = c(3);
605
674
  const ref = useRef(null);
606
- const isOverflowing = useIsOverflowing(ref);
607
675
  let t0;
608
676
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
609
677
  t0 = {
@@ -613,8 +681,9 @@ const VerticalDivider = () => {
613
681
  } else {
614
682
  t0 = $[0];
615
683
  }
616
- const registryProps = t0;
617
- ActionBarItemsRegistry.useRegisterDescendant(isOverflowing ? registryProps : null);
684
+ const {
685
+ isOverflowing
686
+ } = useActionBarItem(ref, t0);
618
687
  let t1;
619
688
  if ($[1] !== isOverflowing) {
620
689
  t1 = /*#__PURE__*/jsx("div", {
@@ -1,5 +1,5 @@
1
- import './ActionBar-fbb539a4.css';
1
+ import './ActionBar-544d3fab.css';
2
2
 
3
- var styles = {"List":"prc-ActionBar-List-9uz46","Divider":"prc-ActionBar-Divider-6V8yH","Nav":"prc-ActionBar-Nav-9spON","Group":"prc-ActionBar-Group-peNCk","OverflowContainer":"prc-ActionBar-OverflowContainer-AkYZs"};
3
+ var styles = {"List":"prc-ActionBar-List-9uz46","detect-overflow":"prc-ActionBar-detect-overflow-mAuJu","Divider":"prc-ActionBar-Divider-6V8yH","Nav":"prc-ActionBar-Nav-9spON","Group":"prc-ActionBar-Group-peNCk","OverflowContainer":"prc-ActionBar-OverflowContainer-AkYZs","MoreButton":"prc-ActionBar-MoreButton-RHqpx"};
4
4
 
5
5
  export { styles as default };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@primer/react",
3
3
  "type": "module",
4
- "version": "0.0.0-20260311182527",
4
+ "version": "0.0.0-20260311183958",
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",
@@ -1,2 +0,0 @@
1
- .prc-ActionBar-List-9uz46{align-items:center;display:flex;gap:var(--actionbar-gap,var(--stack-gap-condensed,.5rem));list-style:none;margin-bottom:-1px;min-width:0;position:relative;white-space:nowrap}.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-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,var(--color-border-muted));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;height:var(--actionbar-height);justify-content:flex-end;overflow:hidden;--actionbar-height:var(--control-small-size,1.75rem)}.prc-ActionBar-OverflowContainer-AkYZs[data-size=medium]{--actionbar-height:var(--control-medium-size,2rem)}.prc-ActionBar-OverflowContainer-AkYZs[data-size=large]{--actionbar-height:var(--control-large-size,2.5rem)}
2
- /*# sourceMappingURL=ActionBar-fbb539a4.css.map */
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/ActionBar/ActionBar.module.css.js"],"names":[],"mappings":"AAAA,0BAUE,kBAAmB,CARnB,YAAa,CASb,yDAAqD,CAFrD,eAAgB,CAFhB,kBAAmB,CAJnB,WAAY,CAFZ,iBAAkB,CAOlB,kBAiBF,CAXE,iDACE,iBAKF,CAHE,8EACE,kCACF,CAGF,sDACE,iDACF,CAGF,yBAIE,kBAAmB,CAHnB,YAAa,CAEb,wBAAyB,CADzB,uCAOF,CAHE,kDACE,gBACF,CAIA,oCAME,6DAAoC,CAFpC,UAAW,CAHX,aAAc,CAEd,kCAA2B,CAK3B,0EAAqE,CANrE,sCAOF,CAQF,kEAJE,YAAa,CACb,WAoBF,CAjBA,uCAEE,cAAe,CAGf,8BAA+B,CAC/B,wBAAyB,CAFzB,eAAgB,CAIhB,oDASF,CAPE,yDACE,kDACF,CAEA,wDACE,mDACF","file":"ActionBar-fbb539a4.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 white-space: nowrap;\n list-style: none;\n align-items: center;\n gap: var(--actionbar-gap, var(--stack-gap-condensed));\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\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 overflow: hidden;\n height: var(--actionbar-height);\n justify-content: flex-end;\n\n --actionbar-height: var(--control-small-size);\n\n &[data-size='medium'] {\n --actionbar-height: var(--control-medium-size);\n }\n\n &[data-size='large'] {\n --actionbar-height: var(--control-large-size);\n }\n}\n"]}