primer_view_components 0.18.2 → 0.19.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +20 -0
  3. data/app/assets/javascripts/primer_view_components.js +1 -1
  4. data/app/assets/javascripts/primer_view_components.js.map +1 -1
  5. data/app/assets/styles/primer_view_components.css +1 -1
  6. data/app/assets/styles/primer_view_components.css.map +1 -1
  7. data/app/components/primer/alpha/action_bar_element.js +4 -6
  8. data/app/components/primer/alpha/action_menu/action_menu_element.js +12 -19
  9. data/app/components/primer/alpha/banner.rb +17 -3
  10. data/app/components/primer/alpha/modal_dialog.js +8 -10
  11. data/app/components/primer/alpha/segmented_control.js +2 -3
  12. data/app/components/primer/alpha/tool_tip.js +5 -7
  13. data/app/components/primer/beta/button.css +1 -1
  14. data/app/components/primer/beta/button.css.json +0 -1
  15. data/app/components/primer/beta/button.css.map +1 -1
  16. data/app/components/primer/beta/button.pcss +1 -5
  17. data/app/components/primer/beta/button_group.rb +53 -1
  18. data/app/components/primer/beta/flash.rb +3 -1
  19. data/app/components/primer/beta/nav_list.js +6 -10
  20. data/app/components/primer/beta/nav_list_group_element.js +2 -3
  21. data/app/components/primer/dialog_helper.js +5 -7
  22. data/app/components/primer/focus_group.js +9 -12
  23. data/lib/primer/deprecations.yml +5 -0
  24. data/lib/primer/forms/primer_multi_input.js +2 -3
  25. data/lib/primer/forms/primer_text_field.js +2 -4
  26. data/lib/primer/view_components/version.rb +2 -2
  27. data/previews/primer/beta/button_group_preview/with_menu_button.html.erb +7 -0
  28. data/previews/primer/beta/button_group_preview.rb +6 -0
  29. data/static/arguments.json +23 -1
  30. data/static/audited_at.json +1 -0
  31. data/static/constants.json +3 -0
  32. data/static/info_arch.json +68 -4
  33. data/static/previews.json +14 -1
  34. data/static/statuses.json +2 -1
  35. metadata +3 -3
  36. data/previews/primer/beta/button_group_preview/action_menus.html.erb +0 -8
@@ -11,13 +11,12 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
11
11
  };
12
12
  var _DialogHelperElement_abortController;
13
13
  function dialogInvokerButtonHandler(event) {
14
- var _a;
15
14
  const target = event.target;
16
- const button = target === null || target === void 0 ? void 0 : target.closest('button');
15
+ const button = target?.closest('button');
17
16
  if (!button || button.hasAttribute('disabled') || button.getAttribute('aria-disabled') === 'true')
18
17
  return;
19
18
  // If the user is clicking a valid dialog trigger
20
- let dialogId = button === null || button === void 0 ? void 0 : button.getAttribute('data-show-dialog-id');
19
+ let dialogId = button?.getAttribute('data-show-dialog-id');
21
20
  if (dialogId) {
22
21
  const dialog = document.getElementById(dialogId);
23
22
  if (dialog instanceof HTMLDialogElement) {
@@ -36,7 +35,7 @@ function dialogInvokerButtonHandler(event) {
36
35
  let node = button;
37
36
  let fixed = false;
38
37
  while (node) {
39
- node = (_a = node.parentElement) === null || _a === void 0 ? void 0 : _a.closest('[popover]:not(:popover-open)');
38
+ node = node.parentElement?.closest('[popover]:not(:popover-open)');
40
39
  if (node && node.popover === 'auto') {
41
40
  node.classList.add('dialog-inside-popover-fix');
42
41
  node.popover = 'manual';
@@ -93,14 +92,13 @@ export class DialogHelperElement extends HTMLElement {
93
92
  }).observe(this, { subtree: true, attributeFilter: ['open'] });
94
93
  }
95
94
  disconnectedCallback() {
96
- var _a;
97
- (_a = __classPrivateFieldGet(this, _DialogHelperElement_abortController, "f")) === null || _a === void 0 ? void 0 : _a.abort();
95
+ __classPrivateFieldGet(this, _DialogHelperElement_abortController, "f")?.abort();
98
96
  }
99
97
  handleEvent(event) {
100
98
  const target = event.target;
101
99
  const dialog = this.dialog;
102
100
  // The click target _must_ be the dialog element itself, and not elements underneath or inside.
103
- if (target !== dialog || !(dialog === null || dialog === void 0 ? void 0 : dialog.open))
101
+ if (target !== dialog || !dialog?.open)
104
102
  return;
105
103
  const rect = dialog.getBoundingClientRect();
106
104
  const clickWasInsideDialog = rect.top <= event.clientY &&
@@ -13,7 +13,7 @@ var _FocusGroupElement_instances, _FocusGroupElement_retainSignal, _FocusGroupEl
13
13
  import '@oddbird/popover-polyfill';
14
14
  const validSelectors = ['[role="menuitem"]', '[role="menuitemcheckbox"]', '[role="menuitemradio"]'];
15
15
  const menuItemSelector = validSelectors.map(selector => `:not([hidden]) > ${selector}`).join(', ');
16
- const getMnemonicFor = (item) => { var _a; return (_a = item.textContent) === null || _a === void 0 ? void 0 : _a.trim()[0].toLowerCase(); };
16
+ const getMnemonicFor = (item) => item.textContent?.trim()[0].toLowerCase();
17
17
  const printable = /^\S$/;
18
18
  class FocusGroupElement extends HTMLElement {
19
19
  constructor() {
@@ -54,26 +54,23 @@ class FocusGroupElement extends HTMLElement {
54
54
  this.addEventListener('focusin', this, { signal });
55
55
  }
56
56
  disconnectedCallback() {
57
- var _a;
58
- (_a = __classPrivateFieldGet(this, _FocusGroupElement_abortController, "f")) === null || _a === void 0 ? void 0 : _a.abort();
57
+ __classPrivateFieldGet(this, _FocusGroupElement_abortController, "f")?.abort();
59
58
  }
60
59
  handleEvent(event) {
61
- var _a;
62
60
  const { direction, nowrap } = this;
63
61
  if (event.type === 'focusin') {
64
62
  if (this.retain && event.target instanceof Element && event.target.matches(menuItemSelector)) {
65
- (_a = __classPrivateFieldGet(this, _FocusGroupElement_retainSignal, "f")) === null || _a === void 0 ? void 0 : _a.abort();
63
+ __classPrivateFieldGet(this, _FocusGroupElement_retainSignal, "f")?.abort();
66
64
  const { signal } = (__classPrivateFieldSet(this, _FocusGroupElement_retainSignal, new AbortController(), "f"));
67
65
  for (const item of __classPrivateFieldGet(this, _FocusGroupElement_instances, "a", _FocusGroupElement_items_get)) {
68
66
  item.setAttribute('tabindex', item === event.target ? '0' : '-1');
69
67
  const popover = event.target.closest('[popover]');
70
- if (item === event.target && (popover === null || popover === void 0 ? void 0 : popover.popover) === 'auto' && popover.closest('focus-group') === this) {
68
+ if (item === event.target && popover?.popover === 'auto' && popover.closest('focus-group') === this) {
71
69
  popover.addEventListener('toggle', (toggleEvent) => {
72
- var _a, _b;
73
70
  if (!(toggleEvent.target instanceof Element))
74
71
  return;
75
72
  if (toggleEvent.newState === 'closed') {
76
- (_a = __classPrivateFieldGet(this, _FocusGroupElement_retainSignal, "f")) === null || _a === void 0 ? void 0 : _a.abort();
73
+ __classPrivateFieldGet(this, _FocusGroupElement_retainSignal, "f")?.abort();
77
74
  item.setAttribute('tabindex', '-1');
78
75
  if (popover.id) {
79
76
  const invoker = this.querySelector(`[popovertarget="${popover.id}"]`);
@@ -81,7 +78,7 @@ class FocusGroupElement extends HTMLElement {
81
78
  invoker.setAttribute('tabindex', '0');
82
79
  }
83
80
  else {
84
- (_b = __classPrivateFieldGet(this, _FocusGroupElement_instances, "a", _FocusGroupElement_items_get)[0]) === null || _b === void 0 ? void 0 : _b.setAttribute('tabindex', '0');
81
+ __classPrivateFieldGet(this, _FocusGroupElement_instances, "a", _FocusGroupElement_items_get)[0]?.setAttribute('tabindex', '0');
85
82
  }
86
83
  }
87
84
  }
@@ -146,13 +143,13 @@ class FocusGroupElement extends HTMLElement {
146
143
  let el = focusEl;
147
144
  do {
148
145
  el = el.closest(`[popover]:not(:popover-open)`);
149
- if ((el === null || el === void 0 ? void 0 : el.popover) === 'auto' && !['ArrowRight', 'ArrowLeft'].includes(event.key)) {
146
+ if (el?.popover === 'auto' && !['ArrowRight', 'ArrowLeft'].includes(event.key)) {
150
147
  el.showPopover();
151
148
  }
152
- el = (el === null || el === void 0 ? void 0 : el.parentElement) || null;
149
+ el = el?.parentElement || null;
153
150
  } while (el);
154
151
  }
155
- focusEl === null || focusEl === void 0 ? void 0 : focusEl.focus();
152
+ focusEl?.focus();
156
153
  }
157
154
  }
158
155
  }
@@ -33,6 +33,11 @@ deprecations:
33
33
  autocorrect: true
34
34
  replacement: "Primer::Beta::AutoComplete::Item"
35
35
 
36
+ - component: "Primer::Beta::Flash"
37
+ autocorrect: false
38
+ replacement: "Primer::Alpha::Banner"
39
+ guide: "https://primer.style/components/banner/rails/alpha"
40
+
36
41
  - component: "Primer::BlankslateComponent"
37
42
  autocorrect: true
38
43
  replacement: "Primer::Beta::Blankslate"
@@ -8,7 +8,6 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
8
8
  import { controller, targets } from '@github/catalyst';
9
9
  let PrimerMultiInputElement = class PrimerMultiInputElement extends HTMLElement {
10
10
  activateField(name) {
11
- var _a, _b;
12
11
  const fieldWithName = this.findField(name);
13
12
  if (!fieldWithName)
14
13
  return;
@@ -17,11 +16,11 @@ let PrimerMultiInputElement = class PrimerMultiInputElement extends HTMLElement
17
16
  continue;
18
17
  field.setAttribute('disabled', 'disabled');
19
18
  field.setAttribute('hidden', 'hidden');
20
- (_a = field.parentElement) === null || _a === void 0 ? void 0 : _a.setAttribute('hidden', 'hidden');
19
+ field.parentElement?.setAttribute('hidden', 'hidden');
21
20
  }
22
21
  fieldWithName.removeAttribute('disabled');
23
22
  fieldWithName.removeAttribute('hidden');
24
- (_b = fieldWithName.parentElement) === null || _b === void 0 ? void 0 : _b.removeAttribute('hidden');
23
+ fieldWithName.parentElement?.removeAttribute('hidden');
25
24
  }
26
25
  findField(name) {
27
26
  for (const field of this.fields) {
@@ -27,8 +27,7 @@ class PrimerTextFieldElement extends HTMLElement {
27
27
  _PrimerTextFieldElement_abortController.set(this, void 0);
28
28
  }
29
29
  connectedCallback() {
30
- var _a;
31
- (_a = __classPrivateFieldGet(this, _PrimerTextFieldElement_abortController, "f")) === null || _a === void 0 ? void 0 : _a.abort();
30
+ __classPrivateFieldGet(this, _PrimerTextFieldElement_abortController, "f")?.abort();
32
31
  const { signal } = (__classPrivateFieldSet(this, _PrimerTextFieldElement_abortController, new AbortController(), "f"));
33
32
  this.inputElement.addEventListener('auto-check-success', async (event) => {
34
33
  const message = await event.detail.response.text();
@@ -45,8 +44,7 @@ class PrimerTextFieldElement extends HTMLElement {
45
44
  }, { signal });
46
45
  }
47
46
  disconnectedCallback() {
48
- var _a;
49
- (_a = __classPrivateFieldGet(this, _PrimerTextFieldElement_abortController, "f")) === null || _a === void 0 ? void 0 : _a.abort();
47
+ __classPrivateFieldGet(this, _PrimerTextFieldElement_abortController, "f")?.abort();
50
48
  }
51
49
  clearContents() {
52
50
  this.inputElement.value = '';
@@ -5,8 +5,8 @@ module Primer
5
5
  module ViewComponents
6
6
  module VERSION
7
7
  MAJOR = 0
8
- MINOR = 18
9
- PATCH = 2
8
+ MINOR = 19
9
+ PATCH = 0
10
10
 
11
11
  STRING = [MAJOR, MINOR, PATCH].join(".")
12
12
  end
@@ -0,0 +1,7 @@
1
+ <%= render(Primer::Beta::ButtonGroup.new) do |component| %>
2
+ <% component.with_button { "Main menu" } %>
3
+ <% component.with_menu_button(button_arguments: { "aria-label": "secondary menu" }, menu_arguments: { anchor_align: :end }) do |menu, button| %>
4
+ <% menu.with_item(label: "Item 1", item_id: :item1) %>
5
+ <% menu.with_item(label: "Item 2", item_id: :item2) %>
6
+ <% end %>
7
+ <% end %>
@@ -39,6 +39,12 @@ module Primer
39
39
  end
40
40
  end
41
41
 
42
+ # @label With menu button
43
+ #
44
+ # @snapshot
45
+ def with_menu_button
46
+ end
47
+
42
48
  # @label Icon buttons
43
49
  #
44
50
  # @param size [Symbol] select [medium, small]
@@ -3436,6 +3436,28 @@
3436
3436
  }
3437
3437
  ]
3438
3438
  },
3439
+ {
3440
+ "component": "ButtonGroup::MenuButton",
3441
+ "status": "alpha",
3442
+ "a11y_reviewed": false,
3443
+ "short_name": "ButtonGroupMenuButton",
3444
+ "source": "https://github.com/primer/view_components/tree/main/app/components/primer/beta/button_group/menu_button.rb",
3445
+ "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/beta/button_group/menu_button/default/",
3446
+ "parameters": [
3447
+ {
3448
+ "name": "menu_arguments",
3449
+ "type": "Hash",
3450
+ "default": "`{}`",
3451
+ "description": "The arguments accepted by [ActionMenu](/components/alpha/actionmenu)."
3452
+ },
3453
+ {
3454
+ "name": "button_arguments",
3455
+ "type": "Hash",
3456
+ "default": "`{}`",
3457
+ "description": "The arguments accepted by [Button](/components/beta/button) or [IconButton](/components/beta/iconbutton), depending on the value of the `icon:` argument."
3458
+ }
3459
+ ]
3460
+ },
3439
3461
  {
3440
3462
  "component": "ClipboardCopy",
3441
3463
  "status": "beta",
@@ -3648,7 +3670,7 @@
3648
3670
  },
3649
3671
  {
3650
3672
  "component": "Flash",
3651
- "status": "beta",
3673
+ "status": "deprecated",
3652
3674
  "a11y_reviewed": false,
3653
3675
  "short_name": "Flash",
3654
3676
  "source": "https://github.com/primer/view_components/tree/main/app/components/primer/beta/flash.rb",
@@ -75,6 +75,7 @@
75
75
  "Primer::Beta::Breadcrumbs::Item": "",
76
76
  "Primer::Beta::Button": "",
77
77
  "Primer::Beta::ButtonGroup": "",
78
+ "Primer::Beta::ButtonGroup::MenuButton": "",
78
79
  "Primer::Beta::ClipboardCopy": "",
79
80
  "Primer::Beta::ClipboardCopyBaseButton": "",
80
81
  "Primer::Beta::ClipboardCopyButton": "",
@@ -848,6 +848,9 @@
848
848
  ]
849
849
  },
850
850
  "Primer::Beta::ButtonGroup": {
851
+ "MenuButton": "Primer::Beta::ButtonGroup::MenuButton"
852
+ },
853
+ "Primer::Beta::ButtonGroup::MenuButton": {
851
854
  },
852
855
  "Primer::Beta::ClipboardCopy": {
853
856
  },
@@ -2232,7 +2232,7 @@
2232
2232
  {
2233
2233
  "fully_qualified_name": "Primer::Alpha::Banner",
2234
2234
  "description": "Use `Banner` to highlight important information.",
2235
- "accessibility_docs": "Depending on the scenario, some Banners may need to receive focus when they appear. This helps to maximize discoverability of the message, especially in critical scenarios. Visit the [Banner's Accessibility section](https://primer.style/components/banner#accessibility) or defer to the accessibility team to determine if your scenario requires focusing the banner.\n\nTo properly focus a banner, add a `tabindex=\"-1\"` to the Banner container, and focus that container (one way is using the [`focus()` API](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus)).\n\nFor more information about the focus management technique, visit the [Accessible Banner Prototype docs](https://github.com/github/accessibility/blob/main/docs/coaching-recommendations/toast-flash-banner/accessible-banner-prototype.md#consideration). This guidance is subject to change.",
2235
+ "accessibility_docs": "Given that Banner is made visually prominent to sighted users through the use of icons and color, consider providing a heading and designating the Banner as a region landmark to improve navigability and discoverability of the Banner of assistive technology users. At this time, the PVC Banner does not render a heading nor render as a region landmark by default. This may be introduced in the future [as a breaking API change](https://github.com/primer/view_components/issues/2619). For now, consider providing an appropriate heading inside of the Banner and rendering the Banner as a `<section>` tag with `aria-labelledby=\"switch-this-with-banner-heading-id\"` to implicitly designate the Banner as a region landmark.\n\nA Banner can be used in one of two ways – to highlight information on a page, or to communicate an urgent message/feedback for a user action. For the latter scenario, it may be necessary to use a live region or focus management technique to ensure that the Banner is discoverable and accessible for all users. Otherwise, the Banner can easily be missed, including by those using magnification software or screen reader users who may not realize that a Banner has appeared. The appropriate technique to use is highly context-dependent. Visit the [Banner's Accessibility section](https://primer.style/components/banner#accessibility) or defer to the accessibility team to determine if your scenario requires either techniques.\n\n### Announcing a Banner\n When a Banner is used to communicate non-critical feedback, or is used in critical scenarios where moving focus is considered too disruptive, use a live region announcement to announce the content of the Banner to screen reader users.\n\n Live regions can be finicky and don't work well when injected dynamically. Setting a live region attribute on the Banner itself is discouraged as it will not announce as expected for most screen readers.\n\n To ensure a Banner is announced reliably, make sure that there's a live region container that is already on the page. When the Banner is shown, populate the live region container with the content of the Banner. This can be done in one of two ways. The first is to rely on a global live region container that is guaranteed to be on the page. When the Banner appears, populate this global live region container with the Banner content. The second technique is to hide or show the Banner within a live region wrapper that is guaranteed to always be on the page.\n\n For more information about either technique, visit [Staff only: Challenges with live regions](https://github.com/github/accessibility/blob/main/docs/coaching-recommendations/toast-flash-banner/accessible-banner-prototype.md#challenges-with-dynamically-inserted-live-region). This guidance is subject to change.\n\n### Focusing a Banner\n Focusing a Banner when it appears helps to maximize discoverability of the message, especially in critical scenarios.\n\n To properly focus a banner, add a `tabindex=\"-1\"` to the Banner container, and focus that container (one way is using the [`focus()` API](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus)).\n\n For more information about the focus management technique, visit the [Staff only: Accessible Banner Prototype docs](https://github.com/github/accessibility/blob/main/docs/coaching-recommendations/toast-flash-banner/accessible-banner-prototype.md#consideration). This guidance is subject to change.",
2236
2236
  "is_form_component": false,
2237
2237
  "is_published": true,
2238
2238
  "requires_js": true,
@@ -11038,7 +11038,7 @@
11038
11038
  "slots": [
11039
11039
  {
11040
11040
  "name": "buttons",
11041
- "description": "List of buttons to be rendered. Add buttons via the `#with_button` and `#with_clipboard_copy_button` methods (see below).",
11041
+ "description": "List of buttons to be rendered. Add buttons via the `#with_button`, `#with_menu_button`, and `#with_clipboard_copy_button` methods (see below).",
11042
11042
  "parameters": [
11043
11043
 
11044
11044
  ]
@@ -11063,6 +11063,18 @@
11063
11063
  }
11064
11064
  ]
11065
11065
  },
11066
+ {
11067
+ "name": "with_menu_button",
11068
+ "description": "Adds a button that activates a menu when clicked.",
11069
+ "parameters": [
11070
+ {
11071
+ "name": "system_arguments",
11072
+ "type": "Hash",
11073
+ "default": "N/A",
11074
+ "description": "The arguments accepted by {{#link_to_component}}Primer::Beta::ButtonGroup::MenuButton{{/link_to_component}}."
11075
+ }
11076
+ ]
11077
+ },
11066
11078
  {
11067
11079
  "name": "with_clipboard_copy_button",
11068
11080
  "description": "Adds a {{#link_to_component}}Primer::Beta::ClipboardCopyButton{{/link_to_component}}.",
@@ -11116,6 +11128,19 @@
11116
11128
  ]
11117
11129
  }
11118
11130
  },
11131
+ {
11132
+ "preview_path": "primer/beta/button_group/with_menu_button",
11133
+ "name": "with_menu_button",
11134
+ "snapshot": "true",
11135
+ "skip_rules": {
11136
+ "wont_fix": [
11137
+ "region"
11138
+ ],
11139
+ "will_fix": [
11140
+ "color-contrast"
11141
+ ]
11142
+ }
11143
+ },
11119
11144
  {
11120
11145
  "preview_path": "primer/beta/button_group/icon_buttons",
11121
11146
  "name": "icon_buttons",
@@ -11157,7 +11182,46 @@
11157
11182
  }
11158
11183
  ],
11159
11184
  "subcomponents": [
11185
+ {
11186
+ "fully_qualified_name": "Primer::Beta::ButtonGroup::MenuButton",
11187
+ "description": "Renders a button in a {{#link_to_component}}Primer::Beta::ButtonGroup{{/link_to_component}} that displays an {{#link_to_component}}Primer::Alpha::ActionMenu{{/link_to_component}} when clicked.\nThis component should not be used outside of a `ButtonGroup` context.\n\nThis component yields both the button and the list to the block when rendered.\n\n```erb\n<%= render(Primer::Beta::ButtonGroup.new) do |group| %>\n <% group.with_menu_button do |menu, button| %>\n <% menu.with_item(label: \"Item 1\") %>\n <% button.with_trailing_visual_icon(icon: \"triangle-down\") %>\n <% end %>\n<% end %>\n```",
11188
+ "accessibility_docs": null,
11189
+ "is_form_component": false,
11190
+ "is_published": true,
11191
+ "requires_js": false,
11192
+ "component": "ButtonGroup::MenuButton",
11193
+ "status": "alpha",
11194
+ "a11y_reviewed": false,
11195
+ "short_name": "ButtonGroupMenuButton",
11196
+ "source": "https://github.com/primer/view_components/tree/main/app/components/primer/beta/button_group/menu_button.rb",
11197
+ "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/beta/button_group/menu_button/default/",
11198
+ "parameters": [
11199
+ {
11200
+ "name": "menu_arguments",
11201
+ "type": "Hash",
11202
+ "default": "`{}`",
11203
+ "description": "The arguments accepted by {{#link_to_component}}Primer::Alpha::ActionMenu{{/link_to_component}}."
11204
+ },
11205
+ {
11206
+ "name": "button_arguments",
11207
+ "type": "Hash",
11208
+ "default": "`{}`",
11209
+ "description": "The arguments accepted by {{#link_to_component}}Primer::Beta::Button{{/link_to_component}} or {{#link_to_component}}Primer::Beta::IconButton{{/link_to_component}}, depending on the value of the `icon:` argument."
11210
+ }
11211
+ ],
11212
+ "slots": [
11160
11213
 
11214
+ ],
11215
+ "methods": [
11216
+
11217
+ ],
11218
+ "previews": [
11219
+
11220
+ ],
11221
+ "subcomponents": [
11222
+
11223
+ ]
11224
+ }
11161
11225
  ]
11162
11226
  },
11163
11227
  {
@@ -11890,13 +11954,13 @@
11890
11954
  },
11891
11955
  {
11892
11956
  "fully_qualified_name": "Primer::Beta::Flash",
11893
- "description": "Use `Flash` to inform users of successful or pending actions.",
11957
+ "description": "This component has been deprecated. Use [Banner]({{#link_to_component}}Primer::Alpha::Banner{{/link_to_component}}) instead.\n\nUse `Flash` to inform users of successful or pending actions.",
11894
11958
  "accessibility_docs": null,
11895
11959
  "is_form_component": false,
11896
11960
  "is_published": true,
11897
11961
  "requires_js": false,
11898
11962
  "component": "Flash",
11899
- "status": "beta",
11963
+ "status": "deprecated",
11900
11964
  "a11y_reviewed": false,
11901
11965
  "short_name": "Flash",
11902
11966
  "source": "https://github.com/primer/view_components/tree/main/app/components/primer/beta/flash.rb",
data/static/previews.json CHANGED
@@ -2236,6 +2236,19 @@
2236
2236
  ]
2237
2237
  }
2238
2238
  },
2239
+ {
2240
+ "preview_path": "primer/beta/button_group/with_menu_button",
2241
+ "name": "with_menu_button",
2242
+ "snapshot": "true",
2243
+ "skip_rules": {
2244
+ "wont_fix": [
2245
+ "region"
2246
+ ],
2247
+ "will_fix": [
2248
+ "color-contrast"
2249
+ ]
2250
+ }
2251
+ },
2239
2252
  {
2240
2253
  "preview_path": "primer/beta/button_group/icon_buttons",
2241
2254
  "name": "icon_buttons",
@@ -3361,7 +3374,7 @@
3361
3374
  {
3362
3375
  "name": "flash",
3363
3376
  "component": "Flash",
3364
- "status": "beta",
3377
+ "status": "deprecated",
3365
3378
  "lookup_path": "primer/beta/flash",
3366
3379
  "examples": [
3367
3380
  {
data/static/statuses.json CHANGED
@@ -75,13 +75,14 @@
75
75
  "Primer::Beta::Breadcrumbs::Item": "alpha",
76
76
  "Primer::Beta::Button": "beta",
77
77
  "Primer::Beta::ButtonGroup": "beta",
78
+ "Primer::Beta::ButtonGroup::MenuButton": "alpha",
78
79
  "Primer::Beta::ClipboardCopy": "beta",
79
80
  "Primer::Beta::ClipboardCopyBaseButton": "beta",
80
81
  "Primer::Beta::ClipboardCopyButton": "beta",
81
82
  "Primer::Beta::CloseButton": "beta",
82
83
  "Primer::Beta::Counter": "beta",
83
84
  "Primer::Beta::Details": "beta",
84
- "Primer::Beta::Flash": "beta",
85
+ "Primer::Beta::Flash": "deprecated",
85
86
  "Primer::Beta::Heading": "beta",
86
87
  "Primer::Beta::IconButton": "beta",
87
88
  "Primer::Beta::Label": "beta",
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: primer_view_components
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.18.2
4
+ version: 0.19.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GitHub Open Source
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-02-12 00:00:00.000000000 Z
11
+ date: 2024-02-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionview
@@ -795,7 +795,7 @@ files:
795
795
  - previews/primer/beta/border_box_preview.rb
796
796
  - previews/primer/beta/breadcrumbs_preview.rb
797
797
  - previews/primer/beta/button_group_preview.rb
798
- - previews/primer/beta/button_group_preview/action_menus.html.erb
798
+ - previews/primer/beta/button_group_preview/with_menu_button.html.erb
799
799
  - previews/primer/beta/button_preview.rb
800
800
  - previews/primer/beta/button_preview/all_schemes.html.erb
801
801
  - previews/primer/beta/button_preview/invisible_all_visuals.html.erb
@@ -1,8 +0,0 @@
1
- <%= render(Primer::Beta::ButtonGroup.new) do |component| %>
2
- <% component.with_button() { "Main menu" } %>
3
- <% component.with_button(icon: "triangle-down", "aria-label": "secondary menu", data: { "menu-id": "my-id" }) %>
4
- <% end %>
5
-
6
- <%= render(Primer::Alpha::ActionMenu.new(anchor_align: :end, menu_id: "my-id")) do |component| %>
7
- <% component.with_item(label: "Item", tag: :button, value: "") %>
8
- <% end %>