@primer/view-components 0.6.0 → 0.6.1-rc.2fc1a92e

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.
@@ -141,8 +141,11 @@ let ActionMenuElement = class ActionMenuElement extends HTMLElement {
141
141
  return;
142
142
  const ariaChecked = item.getAttribute('aria-checked');
143
143
  const checked = ariaChecked !== 'true';
144
- item.setAttribute('aria-checked', `${checked}`);
145
144
  if (this.selectVariant === 'single') {
145
+ // Only check, never uncheck here. Single-select mode does not allow unchecking a checked item.
146
+ if (checked) {
147
+ item.setAttribute('aria-checked', 'true');
148
+ }
146
149
  for (const checkedItem of this.querySelectorAll('[aria-checked]')) {
147
150
  if (checkedItem !== item) {
148
151
  checkedItem.setAttribute('aria-checked', 'false');
@@ -150,6 +153,10 @@ let ActionMenuElement = class ActionMenuElement extends HTMLElement {
150
153
  }
151
154
  __classPrivateFieldGet(this, _ActionMenuElement_instances, "m", _ActionMenuElement_setDynamicLabel).call(this);
152
155
  }
156
+ else {
157
+ // multi-select mode allows unchecking a checked item
158
+ item.setAttribute('aria-checked', `${checked}`);
159
+ }
153
160
  __classPrivateFieldGet(this, _ActionMenuElement_instances, "m", _ActionMenuElement_updateInput).call(this);
154
161
  if (event instanceof KeyboardEvent && event.target instanceof HTMLButtonElement) {
155
162
  // prevent buttons from being clicked twice
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primer/view-components",
3
- "version": "0.6.0",
3
+ "version": "0.6.1-rc.2fc1a92e",
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",
@@ -4248,7 +4248,18 @@
4248
4248
  "source": "https://github.com/primer/view_components/tree/main/app/components/primer/conditional_wrapper.rb",
4249
4249
  "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/conditional_wrapper/default/",
4250
4250
  "parameters": [
4251
-
4251
+ {
4252
+ "name": "condition",
4253
+ "type": "Boolean",
4254
+ "default": "N/A",
4255
+ "description": "Whether or not to wrap the content in a `Primer::BaseComponent`."
4256
+ },
4257
+ {
4258
+ "name": "base_component_arguments",
4259
+ "type": "Hash",
4260
+ "default": "N/A",
4261
+ "description": "The arguments to pass to `Primer::BaseComponent`."
4262
+ }
4252
4263
  ]
4253
4264
  },
4254
4265
  {