@primer/view-components 0.44.0-rc.2b4579f7 → 0.44.0-rc.385b39ff

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.
@@ -11,10 +11,6 @@ export declare class ActionMenuElement extends HTMLElement {
11
11
  #private;
12
12
  includeFragment: IncludeFragmentElement;
13
13
  overlay: AnchoredPositionElement;
14
- list: HTMLElement;
15
- static validItemRoles: string[];
16
- static validSelectors: string[];
17
- static menuItemSelectors: string[];
18
14
  get selectVariant(): SelectVariant;
19
15
  set selectVariant(variant: SelectVariant);
20
16
  get dynamicLabelPrefix(): string;
@@ -22,7 +18,6 @@ export declare class ActionMenuElement extends HTMLElement {
22
18
  get dynamicLabel(): boolean;
23
19
  set dynamicLabel(value: boolean);
24
20
  get popoverElement(): HTMLElement | null;
25
- get childPopoverElements(): HTMLElement[];
26
21
  get invokerElement(): HTMLButtonElement | null;
27
22
  get invokerLabel(): HTMLElement | null;
28
23
  get selectedItems(): SelectedItem[];
@@ -15,14 +15,13 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
15
15
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
16
16
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
17
17
  };
18
- var _ActionMenuElement_instances, _a, _ActionMenuElement_abortController, _ActionMenuElement_originalLabel, _ActionMenuElement_inputName, _ActionMenuElement_invokerBeingClicked, _ActionMenuElement_intersectionObserver, _ActionMenuElement_focusZoneStack, _ActionMenuElement_updateLevels, _ActionMenuElement_softDisableItems, _ActionMenuElement_potentiallyDisallowActivation, _ActionMenuElement_isAnchorActivationViaSpace, _ActionMenuElement_isClipboardActivationViaKeyboard, _ActionMenuElement_isActivation, _ActionMenuElement_handleItemKeyboardEvent, _ActionMenuElement_handleToggleEvent, _ActionMenuElement_handleInvokerActivated, _ActionMenuElement_handleDialogItemActivated, _ActionMenuElement_handleItemActivated, _ActionMenuElement_handleIncludeFragmentReplaced, _ActionMenuElement_handleFocusOut, _ActionMenuElement_show, _ActionMenuElement_hide, _ActionMenuElement_isOpen, _ActionMenuElement_setDynamicLabel, _ActionMenuElement_updateInput, _ActionMenuElement_firstItem_get, _ActionMenuElement_subMenuForItem, _ActionMenuElement_itemForSubMenu;
19
- var ActionMenuElement_1;
18
+ var _ActionMenuElement_instances, _ActionMenuElement_abortController, _ActionMenuElement_originalLabel, _ActionMenuElement_inputName, _ActionMenuElement_invokerBeingClicked, _ActionMenuElement_intersectionObserver, _ActionMenuElement_softDisableItems, _ActionMenuElement_potentiallyDisallowActivation, _ActionMenuElement_isAnchorActivationViaSpace, _ActionMenuElement_isActivation, _ActionMenuElement_handleInvokerActivated, _ActionMenuElement_handleDialogItemActivated, _ActionMenuElement_handleItemActivated, _ActionMenuElement_handleIncludeFragmentReplaced, _ActionMenuElement_handleFocusOut, _ActionMenuElement_show, _ActionMenuElement_hide, _ActionMenuElement_isOpen, _ActionMenuElement_setDynamicLabel, _ActionMenuElement_updateInput, _ActionMenuElement_firstItem_get;
20
19
  import { controller, target } from '@github/catalyst';
21
20
  import '@oddbird/popover-polyfill';
22
21
  import { observeMutationsUntilConditionMet } from '../../utils';
23
- import { ActionMenuFocusZoneStack } from './action_menu_focus_zone_stack';
24
- import { ClipboardCopyElement } from '@github/clipboard-copy-element';
25
- let ActionMenuElement = ActionMenuElement_1 = _a = class ActionMenuElement extends HTMLElement {
22
+ const validSelectors = ['[role="menuitem"]', '[role="menuitemcheckbox"]', '[role="menuitemradio"]'];
23
+ const menuItemSelectors = validSelectors.map(selector => `:not([hidden]) > ${selector}`);
24
+ let ActionMenuElement = class ActionMenuElement extends HTMLElement {
26
25
  constructor() {
27
26
  super(...arguments);
28
27
  _ActionMenuElement_instances.add(this);
@@ -31,7 +30,6 @@ let ActionMenuElement = ActionMenuElement_1 = _a = class ActionMenuElement exten
31
30
  _ActionMenuElement_inputName.set(this, '');
32
31
  _ActionMenuElement_invokerBeingClicked.set(this, false);
33
32
  _ActionMenuElement_intersectionObserver.set(this, void 0);
34
- _ActionMenuElement_focusZoneStack.set(this, void 0);
35
33
  }
36
34
  get selectVariant() {
37
35
  return this.getAttribute('data-select-variant');
@@ -62,10 +60,6 @@ let ActionMenuElement = ActionMenuElement_1 = _a = class ActionMenuElement exten
62
60
  get popoverElement() {
63
61
  return this.invokerElement?.popoverTargetElement || null;
64
62
  }
65
- // i.e. sub-menus
66
- get childPopoverElements() {
67
- return Array.from(this.overlay.querySelectorAll('anchored-position'));
68
- }
69
63
  get invokerElement() {
70
64
  const id = this.querySelector('[role=menu]')?.id;
71
65
  if (!id)
@@ -102,7 +96,7 @@ let ActionMenuElement = ActionMenuElement_1 = _a = class ActionMenuElement exten
102
96
  this.addEventListener('mouseover', this, { signal });
103
97
  this.addEventListener('focusout', this, { signal });
104
98
  this.addEventListener('mousedown', this, { signal });
105
- this.addEventListener('toggle', this, { signal, capture: true });
99
+ this.popoverElement?.addEventListener('toggle', this, { signal });
106
100
  __classPrivateFieldGet(this, _ActionMenuElement_instances, "m", _ActionMenuElement_setDynamicLabel).call(this);
107
101
  __classPrivateFieldGet(this, _ActionMenuElement_instances, "m", _ActionMenuElement_updateInput).call(this);
108
102
  __classPrivateFieldGet(this, _ActionMenuElement_instances, "m", _ActionMenuElement_softDisableItems).call(this);
@@ -140,10 +134,6 @@ let ActionMenuElement = ActionMenuElement_1 = _a = class ActionMenuElement exten
140
134
  if (!this.includeFragment) {
141
135
  this.setAttribute('data-ready', 'true');
142
136
  }
143
- const levelObserver = new MutationObserver(() => __classPrivateFieldGet(this, _ActionMenuElement_instances, "m", _ActionMenuElement_updateLevels).call(this));
144
- levelObserver.observe(this, { childList: true, subtree: true });
145
- __classPrivateFieldGet(this, _ActionMenuElement_instances, "m", _ActionMenuElement_updateLevels).call(this);
146
- __classPrivateFieldSet(this, _ActionMenuElement_focusZoneStack, new ActionMenuFocusZoneStack(), "f");
147
137
  }
148
138
  disconnectedCallback() {
149
139
  __classPrivateFieldGet(this, _ActionMenuElement_abortController, "f").abort();
@@ -151,9 +141,10 @@ let ActionMenuElement = ActionMenuElement_1 = _a = class ActionMenuElement exten
151
141
  handleEvent(event) {
152
142
  const targetIsInvoker = this.invokerElement?.contains(event.target);
153
143
  const eventIsActivation = __classPrivateFieldGet(this, _ActionMenuElement_instances, "m", _ActionMenuElement_isActivation).call(this, event);
154
- if (event.type === 'toggle' && event instanceof ToggleEvent) {
155
- __classPrivateFieldGet(this, _ActionMenuElement_instances, "m", _ActionMenuElement_handleToggleEvent).call(this, event);
156
- return;
144
+ if (event.type === 'toggle' && event.newState === 'open') {
145
+ window.requestAnimationFrame(() => {
146
+ __classPrivateFieldGet(this, _ActionMenuElement_instances, "a", _ActionMenuElement_firstItem_get)?.focus();
147
+ });
157
148
  }
158
149
  if (targetIsInvoker && event.type === 'mousedown') {
159
150
  __classPrivateFieldSet(this, _ActionMenuElement_invokerBeingClicked, true, "f");
@@ -181,7 +172,7 @@ let ActionMenuElement = ActionMenuElement_1 = _a = class ActionMenuElement exten
181
172
  });
182
173
  return;
183
174
  }
184
- const item = event.target.closest(ActionMenuElement_1.menuItemSelectors.join(','));
175
+ const item = event.target.closest(menuItemSelectors.join(','));
185
176
  const targetIsItem = item !== null;
186
177
  if (targetIsItem && eventIsActivation) {
187
178
  if (__classPrivateFieldGet(this, _ActionMenuElement_instances, "m", _ActionMenuElement_potentiallyDisallowActivation).call(this, event))
@@ -200,26 +191,15 @@ let ActionMenuElement = ActionMenuElement_1 = _a = class ActionMenuElement exten
200
191
  event.preventDefault();
201
192
  item.click();
202
193
  }
203
- const subMenu = __classPrivateFieldGet(this, _ActionMenuElement_instances, "m", _ActionMenuElement_subMenuForItem).call(this, item);
204
- if (subMenu) {
205
- // Prevent submitting a form when clicking on sub-menu items
206
- event.preventDefault();
207
- subMenu.showPopover();
208
- return;
209
- }
210
194
  __classPrivateFieldGet(this, _ActionMenuElement_instances, "m", _ActionMenuElement_handleItemActivated).call(this, item);
211
195
  return;
212
196
  }
213
197
  if (event.type === 'include-fragment-replaced') {
214
198
  __classPrivateFieldGet(this, _ActionMenuElement_instances, "m", _ActionMenuElement_handleIncludeFragmentReplaced).call(this);
215
- return;
216
- }
217
- if (targetIsItem && event instanceof KeyboardEvent) {
218
- __classPrivateFieldGet(this, _ActionMenuElement_instances, "m", _ActionMenuElement_handleItemKeyboardEvent).call(this, event, item);
219
199
  }
220
200
  }
221
201
  get items() {
222
- return Array.from(this.querySelectorAll(ActionMenuElement_1.menuItemSelectors.join(',')));
202
+ return Array.from(this.querySelectorAll(menuItemSelectors.join(',')));
223
203
  }
224
204
  getItemById(itemId) {
225
205
  return this.querySelector(`li[data-item-id="${itemId}"`);
@@ -294,18 +274,10 @@ _ActionMenuElement_originalLabel = new WeakMap();
294
274
  _ActionMenuElement_inputName = new WeakMap();
295
275
  _ActionMenuElement_invokerBeingClicked = new WeakMap();
296
276
  _ActionMenuElement_intersectionObserver = new WeakMap();
297
- _ActionMenuElement_focusZoneStack = new WeakMap();
298
277
  _ActionMenuElement_instances = new WeakSet();
299
- _ActionMenuElement_updateLevels = function _ActionMenuElement_updateLevels() {
300
- let idx = 1;
301
- for (const menu of this.querySelectorAll('[role=menu]')) {
302
- menu.setAttribute('data-level', idx.toString());
303
- idx++;
304
- }
305
- };
306
278
  _ActionMenuElement_softDisableItems = function _ActionMenuElement_softDisableItems() {
307
279
  const { signal } = __classPrivateFieldGet(this, _ActionMenuElement_abortController, "f");
308
- for (const item of this.querySelectorAll(ActionMenuElement_1.validSelectors.join(','))) {
280
+ for (const item of this.querySelectorAll(validSelectors.join(','))) {
309
281
  item.addEventListener('click', __classPrivateFieldGet(this, _ActionMenuElement_instances, "m", _ActionMenuElement_potentiallyDisallowActivation).bind(this), { signal });
310
282
  item.addEventListener('keydown', __classPrivateFieldGet(this, _ActionMenuElement_instances, "m", _ActionMenuElement_potentiallyDisallowActivation).bind(this), { signal });
311
283
  }
@@ -313,7 +285,7 @@ _ActionMenuElement_softDisableItems = function _ActionMenuElement_softDisableIte
313
285
  _ActionMenuElement_potentiallyDisallowActivation = function _ActionMenuElement_potentiallyDisallowActivation(event) {
314
286
  if (!__classPrivateFieldGet(this, _ActionMenuElement_instances, "m", _ActionMenuElement_isActivation).call(this, event))
315
287
  return false;
316
- const item = event.target.closest(ActionMenuElement_1.menuItemSelectors.join(','));
288
+ const item = event.target.closest(menuItemSelectors.join(','));
317
289
  if (!item)
318
290
  return false;
319
291
  if (item.getAttribute('aria-disabled')) {
@@ -333,57 +305,11 @@ _ActionMenuElement_isAnchorActivationViaSpace = function _ActionMenuElement_isAn
333
305
  !(event.ctrlKey || event.altKey || event.metaKey || event.shiftKey) &&
334
306
  event.key === ' ');
335
307
  };
336
- _ActionMenuElement_isClipboardActivationViaKeyboard = function _ActionMenuElement_isClipboardActivationViaKeyboard(event) {
337
- return (event.target instanceof ClipboardCopyElement &&
338
- event instanceof KeyboardEvent &&
339
- event.type === 'keydown' &&
340
- !(event.ctrlKey || event.altKey || event.metaKey || event.shiftKey) &&
341
- (event.key === ' ' || event.key === 'Enter'));
342
- };
343
308
  _ActionMenuElement_isActivation = function _ActionMenuElement_isActivation(event) {
344
309
  // Some browsers fire MouseEvents (Firefox) and others fire PointerEvents (Chrome). Activating an item via
345
310
  // enter or space counterintuitively fires one of these rather than a KeyboardEvent. Since PointerEvent
346
311
  // inherits from MouseEvent, it is enough to check for MouseEvent here.
347
- return ((event instanceof MouseEvent && event.type === 'click') ||
348
- __classPrivateFieldGet(this, _ActionMenuElement_instances, "m", _ActionMenuElement_isAnchorActivationViaSpace).call(this, event) ||
349
- __classPrivateFieldGet(this, _ActionMenuElement_instances, "m", _ActionMenuElement_isClipboardActivationViaKeyboard).call(this, event));
350
- };
351
- _ActionMenuElement_handleItemKeyboardEvent = function _ActionMenuElement_handleItemKeyboardEvent(event, item) {
352
- switch (event.key) {
353
- case 'ArrowRight': {
354
- const subMenu = __classPrivateFieldGet(this, _ActionMenuElement_instances, "m", _ActionMenuElement_subMenuForItem).call(this, item);
355
- subMenu?.showPopover();
356
- break;
357
- }
358
- case 'ArrowLeft':
359
- if (item.closest('role[menu]') !== this.list) {
360
- const overlay = item.closest('anchored-position');
361
- overlay?.hidePopover();
362
- }
363
- break;
364
- }
365
- };
366
- _ActionMenuElement_handleToggleEvent = function _ActionMenuElement_handleToggleEvent(event) {
367
- const subMenu = event.target;
368
- if (event.newState === 'open') {
369
- // allow tabbing away from primary menu, but trap focus in sub-menus
370
- const isPrimaryMenu = subMenu === this.overlay;
371
- __classPrivateFieldGet(this, _ActionMenuElement_focusZoneStack, "f").push(subMenu, { trapFocus: !isPrimaryMenu });
372
- window.requestAnimationFrame(() => {
373
- const firstItem = subMenu.querySelector(ActionMenuElement_1.menuItemSelectors.join(','));
374
- firstItem?.focus();
375
- });
376
- }
377
- else {
378
- // Note that this will also cause focus to return to the invoker button, which is
379
- // desirable
380
- __classPrivateFieldGet(this, _ActionMenuElement_focusZoneStack, "f").pop(subMenu);
381
- const item = __classPrivateFieldGet(this, _ActionMenuElement_instances, "m", _ActionMenuElement_itemForSubMenu).call(this, subMenu);
382
- const openPopover = document.querySelector(':popover-open');
383
- if (item && !openPopover) {
384
- item.focus();
385
- }
386
- }
312
+ return (event instanceof MouseEvent && event.type === 'click') || __classPrivateFieldGet(this, _ActionMenuElement_instances, "m", _ActionMenuElement_isAnchorActivationViaSpace).call(this, event);
387
313
  };
388
314
  _ActionMenuElement_handleInvokerActivated = function _ActionMenuElement_handleInvokerActivated(event) {
389
315
  event.preventDefault();
@@ -486,9 +412,6 @@ _ActionMenuElement_show = function _ActionMenuElement_show() {
486
412
  };
487
413
  _ActionMenuElement_hide = function _ActionMenuElement_hide() {
488
414
  this.popoverElement?.hidePopover();
489
- for (const child of this.childPopoverElements) {
490
- child.hidePopover();
491
- }
492
415
  };
493
416
  _ActionMenuElement_isOpen = function _ActionMenuElement_isOpen() {
494
417
  return this.popoverElement?.matches(':popover-open');
@@ -553,35 +476,15 @@ _ActionMenuElement_updateInput = function _ActionMenuElement_updateInput() {
553
476
  }
554
477
  };
555
478
  _ActionMenuElement_firstItem_get = function _ActionMenuElement_firstItem_get() {
556
- return this.querySelector(ActionMenuElement_1.menuItemSelectors.join(','));
557
- };
558
- _ActionMenuElement_subMenuForItem = function _ActionMenuElement_subMenuForItem(item) {
559
- const popoverId = item.getAttribute('popovertarget');
560
- if (popoverId) {
561
- return this.querySelector(`[id="${popoverId}"]`);
562
- }
563
- return null;
479
+ return this.querySelector(menuItemSelectors.join(','));
564
480
  };
565
- _ActionMenuElement_itemForSubMenu = function _ActionMenuElement_itemForSubMenu(subMenu) {
566
- const anchorId = subMenu.getAttribute('anchor');
567
- if (anchorId) {
568
- return this.querySelector(`[id="${anchorId}"]`);
569
- }
570
- return null;
571
- };
572
- ActionMenuElement.validItemRoles = ['menuitem', 'menuitemcheckbox', 'menuitemradio'];
573
- ActionMenuElement.validSelectors = ActionMenuElement_1.validItemRoles.map(role => `[role="${role}"]`);
574
- ActionMenuElement.menuItemSelectors = ActionMenuElement_1.validSelectors.map(selector => `:not([hidden]) > ${selector}`);
575
481
  __decorate([
576
482
  target
577
483
  ], ActionMenuElement.prototype, "includeFragment", void 0);
578
484
  __decorate([
579
485
  target
580
486
  ], ActionMenuElement.prototype, "overlay", void 0);
581
- __decorate([
582
- target
583
- ], ActionMenuElement.prototype, "list", void 0);
584
- ActionMenuElement = ActionMenuElement_1 = __decorate([
487
+ ActionMenuElement = __decorate([
585
488
  controller
586
489
  ], ActionMenuElement);
587
490
  export { ActionMenuElement };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primer/view-components",
3
- "version": "0.44.0-rc.2b4579f7",
3
+ "version": "0.44.0-rc.385b39ff",
4
4
  "description": "ViewComponents for the Primer Design System",
5
5
  "main": "app/assets/javascripts/primer_view_components.js",
6
6
  "module": "app/components/primer/primer.js",
@@ -325,11 +325,77 @@
325
325
  "source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/action_menu.rb",
326
326
  "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/action_menu/default/",
327
327
  "parameters": [
328
+ {
329
+ "name": "menu_id",
330
+ "type": "String",
331
+ "default": "`self.class.generate_id`",
332
+ "description": "Id of the menu."
333
+ },
334
+ {
335
+ "name": "anchor_align",
336
+ "type": "Symbol",
337
+ "default": "`:start`",
338
+ "description": "One of `:center`, `:end`, or `:start`.."
339
+ },
340
+ {
341
+ "name": "anchor_side",
342
+ "type": "Symbol",
343
+ "default": "`:outside_bottom`",
344
+ "description": "One of `:inside_bottom`, `:inside_center`, `:inside_left`, `:inside_right`, `:inside_top`, `:outside_bottom`, `:outside_left`, `:outside_right`, or `:outside_top`.."
345
+ },
346
+ {
347
+ "name": "size",
348
+ "type": "Symbol",
349
+ "default": "`:auto`",
350
+ "description": "One of `:auto`, `:large`, `:medium`, `:medium_portrait`, `:small`, or `:xlarge`.."
351
+ },
352
+ {
353
+ "name": "src",
354
+ "type": "String",
355
+ "default": "`nil`",
356
+ "description": "Used with an `include-fragment` element to load menu content from the given source URL."
357
+ },
358
+ {
359
+ "name": "preload",
360
+ "type": "Boolean",
361
+ "default": "`false`",
362
+ "description": "When true, and src is present, loads the `include-fragment` on trigger hover."
363
+ },
364
+ {
365
+ "name": "dynamic_label",
366
+ "type": "Boolean",
367
+ "default": "`false`",
368
+ "description": "Whether or not to display the text of the currently selected item in the show button."
369
+ },
370
+ {
371
+ "name": "dynamic_label_prefix",
372
+ "type": "String",
373
+ "default": "`nil`",
374
+ "description": "If provided, the prefix is prepended to the dynamic label and displayed in the show button."
375
+ },
376
+ {
377
+ "name": "select_variant",
378
+ "type": "Symbol",
379
+ "default": "`:none`",
380
+ "description": "One of `:multiple`, `:none`, or `:single`."
381
+ },
382
+ {
383
+ "name": "form_arguments",
384
+ "type": "Hash",
385
+ "default": "`{}`",
386
+ "description": "Allows an `ActionMenu` to act as a select list in multi- and single-select modes. Pass the `builder:` and `name:` options to this hash. `builder:` should be an instance of `ActionView::Helpers::FormBuilder`, which are created by the standard Rails `#form_with` and `#form_for` helpers. The `name:` option is the desired name of the field that will be included in the params sent to the server on form submission."
387
+ },
388
+ {
389
+ "name": "overlay_arguments",
390
+ "type": "Hash",
391
+ "default": "`{}`",
392
+ "description": "Arguments to pass to the underlying [Overlay](/components/alpha/overlay)"
393
+ },
328
394
  {
329
395
  "name": "system_arguments",
330
396
  "type": "Hash",
331
397
  "default": "N/A",
332
- "description": "The arguments accepted by [ActionMenu::PrimaryMenu](/components/alpha/actionmenuprimarymenu)."
398
+ "description": "[System arguments](/system-arguments)."
333
399
  }
334
400
  ]
335
401
  },
@@ -418,7 +484,7 @@
418
484
  "name": "system_arguments",
419
485
  "type": "Hash",
420
486
  "default": "N/A",
421
- "description": "The arguments accepted by [ActionMenu::ListWrapper](/components/alpha/actionmenulistwrapper)"
487
+ "description": "The arguments accepted by [ActionList](/components/alpha/actionlist)"
422
488
  }
423
489
  ]
424
490
  },
@@ -444,171 +510,6 @@
444
510
  }
445
511
  ]
446
512
  },
447
- {
448
- "component": "ActionMenu::Menu",
449
- "status": "alpha",
450
- "a11y_reviewed": false,
451
- "short_name": "ActionMenuMenu",
452
- "source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/action_menu/menu.rb",
453
- "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/action_menu/menu/default/",
454
- "parameters": [
455
- {
456
- "name": "anchor_align",
457
- "type": "Symbol",
458
- "default": "N/A",
459
- "description": "One of `:center`, `:end`, or `:start`."
460
- },
461
- {
462
- "name": "anchor_side",
463
- "type": "Symbol",
464
- "default": "N/A",
465
- "description": "One of `:inside_bottom`, `:inside_center`, `:inside_left`, `:inside_right`, `:inside_top`, `:outside_bottom`, `:outside_left`, `:outside_right`, or `:outside_top`."
466
- },
467
- {
468
- "name": "menu_id",
469
- "type": "String",
470
- "default": "`self.class.generate_id`",
471
- "description": "Id of the menu."
472
- },
473
- {
474
- "name": "size",
475
- "type": "Symbol",
476
- "default": "`:auto`",
477
- "description": "One of `:auto`, `:large`, `:medium`, `:medium_portrait`, `:small`, or `:xlarge`."
478
- },
479
- {
480
- "name": "src",
481
- "type": "String",
482
- "default": "`nil`",
483
- "description": "Used with an `include-fragment` element to load menu content from the given source URL."
484
- },
485
- {
486
- "name": "preload",
487
- "type": "Boolean",
488
- "default": "`false`",
489
- "description": "When true, and src is present, loads the `include-fragment` on trigger hover."
490
- },
491
- {
492
- "name": "select_variant",
493
- "type": "Symbol",
494
- "default": "`:none`",
495
- "description": "One of `:multiple`, `:none`, or `:single`."
496
- },
497
- {
498
- "name": "form_arguments",
499
- "type": "Hash",
500
- "default": "`{}`",
501
- "description": "Allows an `ActionMenu` to act as a select list in multi- and single-select modes. Pass the `builder:` and `name:` options to this hash. `builder:` should be an instance of `ActionView::Helpers::FormBuilder`, which are created by the standard Rails `#form_with` and `#form_for` helpers. The `name:` option is the desired name of the field that will be included in the params sent to the server on form submission."
502
- },
503
- {
504
- "name": "overlay_arguments",
505
- "type": "Hash",
506
- "default": "`{}`",
507
- "description": "Arguments to pass to the underlying [Overlay](/components/alpha/overlay)"
508
- },
509
- {
510
- "name": "list_arguments",
511
- "type": "Hash",
512
- "default": "`{}`",
513
- "description": "Arguments to pass to the underlying [ActionMenu::List](/components/alpha/actionmenulist)"
514
- },
515
- {
516
- "name": "system_arguments",
517
- "type": "Hash",
518
- "default": "N/A",
519
- "description": "[System arguments](/system-arguments)."
520
- }
521
- ]
522
- },
523
- {
524
- "component": "ActionMenu::PrimaryMenu",
525
- "status": "alpha",
526
- "a11y_reviewed": false,
527
- "short_name": "ActionMenuPrimaryMenu",
528
- "source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/action_menu/primary_menu.rb",
529
- "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/action_menu/primary_menu/default/",
530
- "parameters": [
531
- {
532
- "name": "anchor_align",
533
- "type": "Symbol",
534
- "default": "`:start`",
535
- "description": "One of `:center`, `:end`, or `:start`."
536
- },
537
- {
538
- "name": "anchor_side",
539
- "type": "Symbol",
540
- "default": "`:outside_bottom`",
541
- "description": "One of `:inside_bottom`, `:inside_center`, `:inside_left`, `:inside_right`, `:inside_top`, `:outside_bottom`, `:outside_left`, `:outside_right`, or `:outside_top`."
542
- },
543
- {
544
- "name": "dynamic_label",
545
- "type": "Boolean",
546
- "default": "`false`",
547
- "description": "Whether or not to display the text of the currently selected item in the show button."
548
- },
549
- {
550
- "name": "dynamic_label_prefix",
551
- "type": "String",
552
- "default": "`nil`",
553
- "description": "If provided, the prefix is prepended to the dynamic label and displayed in the show button."
554
- },
555
- {
556
- "name": "system_arguments",
557
- "type": "Hash",
558
- "default": "N/A",
559
- "description": "[System arguments](/system-arguments)."
560
- }
561
- ]
562
- },
563
- {
564
- "component": "ActionMenu::SubMenu",
565
- "status": "alpha",
566
- "a11y_reviewed": false,
567
- "short_name": "ActionMenuSubMenu",
568
- "source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/action_menu/sub_menu.rb",
569
- "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/action_menu/sub_menu/default/",
570
- "parameters": [
571
- {
572
- "name": "menu_id",
573
- "type": "String",
574
- "default": "`self.class.generate_id`",
575
- "description": "Id of the menu."
576
- },
577
- {
578
- "name": "anchor_align",
579
- "type": "Symbol",
580
- "default": "`:start`",
581
- "description": "One of `:center`, `:end`, or `:start`."
582
- },
583
- {
584
- "name": "anchor_side",
585
- "type": "Symbol",
586
- "default": "`:outside_right`",
587
- "description": "One of `:inside_bottom`, `:inside_center`, `:inside_left`, `:inside_right`, `:inside_top`, `:outside_bottom`, `:outside_left`, `:outside_right`, or `:outside_top`."
588
- },
589
- {
590
- "name": "overlay_arguments",
591
- "type": "Hash",
592
- "default": "`{}`",
593
- "description": "Arguments to pass to the underlying [Overlay](/components/alpha/overlay)"
594
- },
595
- {
596
- "name": "system_arguments",
597
- "type": "Hash",
598
- "default": "N/A",
599
- "description": "[System arguments](/system-arguments)."
600
- }
601
- ]
602
- },
603
- {
604
- "component": "ActionMenu::SubMenuItem",
605
- "status": "alpha",
606
- "a11y_reviewed": false,
607
- "short_name": "ActionMenuSubMenuItem",
608
- "source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/action_menu/sub_menu_item.rb",
609
- "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/action_menu/sub_menu_item/default/",
610
- "parameters": []
611
- },
612
513
  {
613
514
  "component": "AutoComplete",
614
515
  "status": "deprecated",
@@ -12,10 +12,6 @@
12
12
  "Primer::Alpha::ActionMenu::Heading": "",
13
13
  "Primer::Alpha::ActionMenu::List": "",
14
14
  "Primer::Alpha::ActionMenu::ListWrapper": "2023-07-10",
15
- "Primer::Alpha::ActionMenu::Menu": "",
16
- "Primer::Alpha::ActionMenu::PrimaryMenu": "",
17
- "Primer::Alpha::ActionMenu::SubMenu": "",
18
- "Primer::Alpha::ActionMenu::SubMenuItem": "",
19
15
  "Primer::Alpha::AutoComplete": "",
20
16
  "Primer::Alpha::AutoComplete::Item": "",
21
17
  "Primer::Alpha::Banner": "",
@@ -152,15 +152,18 @@
152
152
  ]
153
153
  },
154
154
  "Primer::Alpha::ActionMenu": {
155
+ "DEFAULT_PRELOAD": false,
156
+ "DEFAULT_SELECT_VARIANT": "none",
155
157
  "GeneratedSlotMethods": "Primer::Alpha::ActionMenu::GeneratedSlotMethods",
156
158
  "Group": "Primer::Alpha::ActionMenu::Group",
157
159
  "Heading": "Primer::Alpha::ActionMenu::Heading",
158
160
  "List": "Primer::Alpha::ActionMenu::List",
159
161
  "ListWrapper": "Primer::Alpha::ActionMenu::ListWrapper",
160
- "Menu": "Primer::Alpha::ActionMenu::Menu",
161
- "PrimaryMenu": "Primer::Alpha::ActionMenu::PrimaryMenu",
162
- "SubMenu": "Primer::Alpha::ActionMenu::SubMenu",
163
- "SubMenuItem": "Primer::Alpha::ActionMenu::SubMenuItem"
162
+ "SELECT_VARIANT_OPTIONS": [
163
+ "single",
164
+ "multiple",
165
+ "none"
166
+ ]
164
167
  },
165
168
  "Primer::Alpha::ActionMenu::Group": {
166
169
  "GeneratedSlotMethods": "Primer::Alpha::ActionMenu::Group::GeneratedSlotMethods"
@@ -180,29 +183,6 @@
180
183
  "Primer::Alpha::ActionMenu::ListWrapper": {
181
184
  "GeneratedSlotMethods": "Primer::Alpha::ActionMenu::ListWrapper::GeneratedSlotMethods"
182
185
  },
183
- "Primer::Alpha::ActionMenu::Menu": {
184
- "DEFAULT_PRELOAD": false,
185
- "DEFAULT_SELECT_VARIANT": "none",
186
- "GeneratedSlotMethods": "Primer::Alpha::ActionMenu::Menu::GeneratedSlotMethods",
187
- "SELECT_VARIANT_OPTIONS": [
188
- "single",
189
- "multiple",
190
- "none"
191
- ]
192
- },
193
- "Primer::Alpha::ActionMenu::PrimaryMenu": {
194
- "DEFAULT_ANCHOR_ALIGN": "start",
195
- "DEFAULT_ANCHOR_SIDE": "outside_bottom",
196
- "GeneratedSlotMethods": "Primer::Alpha::ActionMenu::PrimaryMenu::GeneratedSlotMethods"
197
- },
198
- "Primer::Alpha::ActionMenu::SubMenu": {
199
- "DEFAULT_ANCHOR_ALIGN": "start",
200
- "DEFAULT_ANCHOR_SIDE": "outside_right",
201
- "GeneratedSlotMethods": "Primer::Alpha::ActionMenu::SubMenu::GeneratedSlotMethods"
202
- },
203
- "Primer::Alpha::ActionMenu::SubMenuItem": {
204
- "GeneratedSlotMethods": "Primer::Alpha::ActionMenu::SubMenuItem::GeneratedSlotMethods"
205
- },
206
186
  "Primer::Alpha::AutoComplete": {
207
187
  "GeneratedSlotMethods": "Primer::Alpha::AutoComplete::GeneratedSlotMethods",
208
188
  "Item": "Primer::Alpha::AutoComplete::Item"