@primer/view-components 0.50.0-rc.ef9d20ff → 0.50.1-rc.3610a3c7

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.
@@ -1 +1 @@
1
- .tabnav{border-bottom:var(--borderWidth-thin) solid var(--borderColor-default);margin-bottom:var(--stack-gap-normal);margin-top:0}.tabnav-tabs{display:flex;margin-bottom:calc(var(--borderWidth-thin)*-1);overflow:hidden}.tabnav-tab{background-color:initial;border:var(--borderWidth-thin) solid #0000;border-bottom:0;color:var(--fgColor-muted);display:inline-block;flex-shrink:0;font-size:var(--text-body-size-medium);line-height:23px;padding:var(--base-size-8) var(--control-medium-paddingInline-spacious);-webkit-text-decoration:none;text-decoration:none;transition:color .2s cubic-bezier(.3,0,.5,1)}.tabnav-tab.selected,.tabnav-tab[aria-current]:not([aria-current=false]),.tabnav-tab[aria-selected=true]{background-color:var(--bgColor-default);border-color:var(--borderColor-default);border-radius:var(--borderRadius-medium) var(--borderRadius-medium) 0 0;color:var(--fgColor-default)}:is(.tabnav-tab.selected,.tabnav-tab[aria-selected=true],.tabnav-tab[aria-current]:not([aria-current=false])) .octicon{color:inherit}.tabnav-tab:hover{color:var(--fgColor-default);-webkit-text-decoration:none;text-decoration:none;transition-duration:.1s}.tabnav-tab:focus,.tabnav-tab:focus-visible{border-radius:var(--borderRadius-medium) var(--borderRadius-medium) 0 0!important;outline-offset:-6px}.tabnav-tab .octicon,.tabnav-tab:active{color:var(--fgColor-muted)}.tabnav-tab .octicon{margin-right:var(--control-small-gap)}.tabnav-tab .Counter{color:inherit;margin-left:var(--control-small-gap)}.tabnav-extra{color:var(--fgColor-muted);display:inline-block;font-size:var(--text-body-size-small);margin-left:10px;padding-top:10px}.tabnav-extra>.octicon{margin-right:var(--base-size-2)}a.tabnav-extra:hover{color:var(--fgColor-accent);-webkit-text-decoration:none;text-decoration:none}.tabnav-btn{margin-left:var(--controlStack-medium-gap-condensed)}
1
+ .tabnav{border-bottom:var(--borderWidth-thin) solid var(--borderColor-default);margin-bottom:var(--stack-gap-normal);margin-top:0}.tabnav-tabs{display:flex;margin-bottom:calc(var(--borderWidth-thin)*-1);overflow-x:auto;overflow-y:hidden}.tabnav-tab,.tabnav-tabs>li{flex-shrink:0}.tabnav-tab{background-color:initial;border:var(--borderWidth-thin) solid #0000;border-bottom:0;color:var(--fgColor-muted);display:inline-block;font-size:var(--text-body-size-medium);line-height:23px;padding:var(--base-size-8) var(--control-medium-paddingInline-spacious);-webkit-text-decoration:none;text-decoration:none;transition:color .2s cubic-bezier(.3,0,.5,1)}.tabnav-tab.selected,.tabnav-tab[aria-current]:not([aria-current=false]),.tabnav-tab[aria-selected=true]{background-color:var(--bgColor-default);border-color:var(--borderColor-default);border-radius:var(--borderRadius-medium) var(--borderRadius-medium) 0 0;color:var(--fgColor-default)}:is(.tabnav-tab.selected,.tabnav-tab[aria-selected=true],.tabnav-tab[aria-current]:not([aria-current=false])) .octicon{color:inherit}.tabnav-tab:hover{color:var(--fgColor-default);-webkit-text-decoration:none;text-decoration:none;transition-duration:.1s}.tabnav-tab:focus,.tabnav-tab:focus-visible{border-radius:var(--borderRadius-medium) var(--borderRadius-medium) 0 0!important;outline-offset:-6px}.tabnav-tab .octicon,.tabnav-tab:active{color:var(--fgColor-muted)}.tabnav-tab .octicon{margin-right:var(--control-small-gap)}.tabnav-tab .Counter{color:inherit;margin-left:var(--control-small-gap)}.tabnav-extra{color:var(--fgColor-muted);display:inline-block;font-size:var(--text-body-size-small);margin-left:10px;padding-top:10px}.tabnav-extra>.octicon{margin-right:var(--base-size-2)}a.tabnav-extra:hover{color:var(--fgColor-accent);-webkit-text-decoration:none;text-decoration:none}.tabnav-btn{margin-left:var(--controlStack-medium-gap-condensed)}
@@ -4,6 +4,7 @@
4
4
  ".tabnav",
5
5
  ".tabnav-tabs",
6
6
  ".tabnav-tab",
7
+ ".tabnav-tabs>li",
7
8
  ".tabnav-tab.selected",
8
9
  ".tabnav-tab[aria-current]:not([aria-current=false])",
9
10
  ".tabnav-tab[aria-selected=true]",
@@ -15,7 +15,7 @@ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (
15
15
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
16
16
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
17
17
  };
18
- var _TreeViewSubTreeNodeElement_instances, _TreeViewSubTreeNodeElement_expanded, _TreeViewSubTreeNodeElement_loadingState, _TreeViewSubTreeNodeElement_abortController, _TreeViewSubTreeNodeElement_activeElementIsLoader, _TreeViewSubTreeNodeElement_handleToggleEvent, _TreeViewSubTreeNodeElement_handleIncludeFragmentEvent, _TreeViewSubTreeNodeElement_handleRetryButtonEvent, _TreeViewSubTreeNodeElement_handleKeyboardEvent, _TreeViewSubTreeNodeElement_handleCheckboxEvent, _TreeViewSubTreeNodeElement_update, _TreeViewSubTreeNodeElement_checkboxElement_get;
18
+ var _TreeViewSubTreeNodeElement_instances, _TreeViewSubTreeNodeElement_expanded, _TreeViewSubTreeNodeElement_loadingState, _TreeViewSubTreeNodeElement_abortController, _TreeViewSubTreeNodeElement_activeElementIsLoader, _TreeViewSubTreeNodeElement_handleToggleEvent, _TreeViewSubTreeNodeElement_handleIncludeFragmentEvent, _TreeViewSubTreeNodeElement_handleRetryButtonEvent, _TreeViewSubTreeNodeElement_handleKeyboardEvent, _TreeViewSubTreeNodeElement_handleCheckboxEvent, _TreeViewSubTreeNodeElement_update, _TreeViewSubTreeNodeElement_isIncludeFragment, _TreeViewSubTreeNodeElement_checkboxElement_get;
19
19
  import { controller, target } from '@github/catalyst';
20
20
  import { observeMutationsUntilConditionMet } from '../../utils';
21
21
  let TreeViewSubTreeNodeElement = class TreeViewSubTreeNodeElement extends HTMLElement {
@@ -134,6 +134,10 @@ let TreeViewSubTreeNodeElement = class TreeViewSubTreeNodeElement extends HTMLEl
134
134
  // sub-tree and no node in the entire tree can be focused
135
135
  const previousNode = this.subTree.querySelector("[tabindex='0']");
136
136
  previousNode?.setAttribute('tabindex', '-1');
137
+ // Also check if the subtree element itself is an include-fragment with role="treeitem" and has focus
138
+ if (__classPrivateFieldGet(this, _TreeViewSubTreeNodeElement_instances, "m", _TreeViewSubTreeNodeElement_isIncludeFragment).call(this) && this.subTree.getAttribute('tabindex') === '0') {
139
+ this.subTree.setAttribute('tabindex', '-1');
140
+ }
137
141
  this.node.setAttribute('tabindex', '0');
138
142
  this.treeView.dispatchEvent(new CustomEvent('treeViewNodeCollapsed', {
139
143
  bubbles: true,
@@ -237,6 +241,10 @@ _TreeViewSubTreeNodeElement_handleIncludeFragmentEvent = function _TreeViewSubTr
237
241
  // request succeeded but element has not yet been replaced
238
242
  case 'include-fragment-replace':
239
243
  __classPrivateFieldSet(this, _TreeViewSubTreeNodeElement_activeElementIsLoader, document.activeElement === this.loadingIndicator.closest('[role=treeitem]'), "f");
244
+ // Also check if the include-fragment itself has focus (when it has role="treeitem")
245
+ if (!__classPrivateFieldGet(this, _TreeViewSubTreeNodeElement_activeElementIsLoader, "f") && document.activeElement === this.subTree && __classPrivateFieldGet(this, _TreeViewSubTreeNodeElement_instances, "m", _TreeViewSubTreeNodeElement_isIncludeFragment).call(this)) {
246
+ __classPrivateFieldSet(this, _TreeViewSubTreeNodeElement_activeElementIsLoader, true, "f");
247
+ }
240
248
  this.loadingState = 'success';
241
249
  break;
242
250
  case 'include-fragment-replaced':
@@ -332,6 +340,13 @@ _TreeViewSubTreeNodeElement_update = function _TreeViewSubTreeNodeElement_update
332
340
  if (this.expanded) {
333
341
  if (this.subTree)
334
342
  this.subTree.hidden = false;
343
+ if (__classPrivateFieldGet(this, _TreeViewSubTreeNodeElement_instances, "m", _TreeViewSubTreeNodeElement_isIncludeFragment).call(this)) {
344
+ this.subTree.setAttribute('role', 'treeitem');
345
+ // Ensure the include-fragment can participate in roving tab index
346
+ if (!this.subTree.hasAttribute('tabindex')) {
347
+ this.subTree.setAttribute('tabindex', '-1');
348
+ }
349
+ }
335
350
  this.node.setAttribute('aria-expanded', 'true');
336
351
  this.treeView?.expandAncestorsForNode(this);
337
352
  if (this.iconPair) {
@@ -345,6 +360,11 @@ _TreeViewSubTreeNodeElement_update = function _TreeViewSubTreeNodeElement_update
345
360
  else {
346
361
  if (this.subTree)
347
362
  this.subTree.hidden = true;
363
+ if (__classPrivateFieldGet(this, _TreeViewSubTreeNodeElement_instances, "m", _TreeViewSubTreeNodeElement_isIncludeFragment).call(this)) {
364
+ this.subTree.removeAttribute('role');
365
+ // Remove tabindex when role is removed
366
+ this.subTree.removeAttribute('tabindex');
367
+ }
348
368
  this.node.setAttribute('aria-expanded', 'false');
349
369
  if (this.iconPair) {
350
370
  this.iconPair.showCollapsed();
@@ -375,6 +395,9 @@ _TreeViewSubTreeNodeElement_update = function _TreeViewSubTreeNodeElement_update
375
395
  this.loadingFailureMessage.hidden = true;
376
396
  }
377
397
  };
398
+ _TreeViewSubTreeNodeElement_isIncludeFragment = function _TreeViewSubTreeNodeElement_isIncludeFragment() {
399
+ return this.subTree?.getAttribute('data-target')?.includes('tree-view-sub-tree-node.includeFragment') ?? false;
400
+ };
378
401
  _TreeViewSubTreeNodeElement_checkboxElement_get = function _TreeViewSubTreeNodeElement_checkboxElement_get() {
379
402
  return this.querySelector('.TreeViewItemCheckbox');
380
403
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primer/view-components",
3
- "version": "0.50.0-rc.ef9d20ff",
3
+ "version": "0.50.1-rc.3610a3c7",
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",
@@ -68,7 +68,7 @@
68
68
  "@github/markdownlint-github": "^0.8.0",
69
69
  "@github/prettier-config": "0.0.6",
70
70
  "@playwright/test": "^1.57.0",
71
- "@primer/css": "22.0.2",
71
+ "@primer/css": "22.1.0",
72
72
  "@primer/stylelint-config": "^13.1.1",
73
73
  "@rollup/plugin-node-resolve": "^16.0.1",
74
74
  "@rollup/plugin-typescript": "^8.3.3",
@@ -78,14 +78,14 @@
78
78
  "eslint": "^9.10.0",
79
79
  "eslint-plugin-github": "^6.0.0",
80
80
  "glob": "^11.0.2",
81
- "markdownlint-cli2": "^0.19.1",
81
+ "markdownlint-cli2": "^0.20.0",
82
82
  "mocha": "^11.0.1",
83
83
  "playwright": "^1.57.0",
84
84
  "postcss": "^8.4.16",
85
85
  "postcss-cli": "^11.0.0",
86
86
  "postcss-import": "^16.0.0",
87
87
  "postcss-mixins": "^12.1.2",
88
- "postcss-preset-env": "^10.0.2",
88
+ "postcss-preset-env": "^11.1.2",
89
89
  "prettier": "^3.3.2",
90
90
  "rollup": "^2.79.1",
91
91
  "rollup-plugin-terser": "^7.0.2",
@@ -4629,7 +4629,7 @@
4629
4629
  {
4630
4630
  "fully_qualified_name": "Primer::Alpha::Layout",
4631
4631
  "description": "`Layout` provides foundational patterns for responsive pages.\n`Layout` can be used for simple two-column pages, or it can be nested to provide flexible 3-column experiences.\n On smaller screens, `Layout` uses vertically stacked rows to display content.\n\n`Layout` flows as both column, when there's enough horizontal space to render both `Main` and `Sidebar`side-by-side (on a desktop of tablet device, per instance);\nor it flows as a row, when `Main` and `Sidebar` are stacked vertically (e.g. on a mobile device).\n`Layout` should always work in any screen size.",
4632
- "accessibility_docs": "Keyboard navigation follows the markup order. Decide carefully how the focus order should be be by deciding whether\n`main` or `sidebar` comes first in code. The code order won’t affect the visual position.",
4632
+ "accessibility_docs": "Keyboard navigation follows the markup order. Decide carefully how the focus order should be be by deciding whether\n`main` or `sidebar` comes first in code. The code order won't affect the visual position.\n\nWhen using `row_placement: :none` on the sidebar, the sidebar content will be hidden at narrow viewports.\nThis may cause WCAG 1.4.10 Reflow failures if the sidebar contains essential content. Only use `:none`\nwhen the sidebar content is non-essential or available elsewhere on the page.",
4633
4633
  "is_form_component": false,
4634
4634
  "is_published": true,
4635
4635
  "requires_js": false,
@@ -4704,7 +4704,7 @@
4704
4704
  "name": "row_placement",
4705
4705
  "type": "Symbol",
4706
4706
  "default": "N/A",
4707
- "description": "Sidebar placement when `Layout` is in row mode. One of `:end`, `:none`, or `:start`."
4707
+ "description": "Sidebar placement when `Layout` is in row mode. One of `:end`, `:none`, or `:start`. **Note:** Using `:none` hides the sidebar at narrow viewports, which may cause WCAG 1.4.10 Reflow issues if the sidebar contains essential content."
4708
4708
  },
4709
4709
  {
4710
4710
  "name": "system_arguments",
@@ -5312,7 +5312,8 @@
5312
5312
  "snapshot": "true",
5313
5313
  "skip_rules": {
5314
5314
  "wont_fix": [
5315
- "region"
5315
+ "region",
5316
+ "label-title-only"
5316
5317
  ],
5317
5318
  "will_fix": [
5318
5319
  "color-contrast"
@@ -6059,19 +6060,6 @@
6059
6060
  ]
6060
6061
  }
6061
6062
  },
6062
- {
6063
- "preview_path": "primer/alpha/overlay/menu_no_header",
6064
- "name": "menu_no_header",
6065
- "snapshot": "false",
6066
- "skip_rules": {
6067
- "wont_fix": [
6068
- "region"
6069
- ],
6070
- "will_fix": [
6071
- "color-contrast"
6072
- ]
6073
- }
6074
- },
6075
6063
  {
6076
6064
  "preview_path": "primer/alpha/overlay/middle_of_page",
6077
6065
  "name": "middle_of_page",
@@ -9157,6 +9145,19 @@
9157
9145
  ]
9158
9146
  }
9159
9147
  },
9148
+ {
9149
+ "preview_path": "primer/alpha/text_field/show_clear_button_with_custom_label",
9150
+ "name": "show_clear_button_with_custom_label",
9151
+ "snapshot": "true",
9152
+ "skip_rules": {
9153
+ "wont_fix": [
9154
+ "region"
9155
+ ],
9156
+ "will_fix": [
9157
+ "color-contrast"
9158
+ ]
9159
+ }
9160
+ },
9160
9161
  {
9161
9162
  "preview_path": "primer/alpha/text_field/full_width",
9162
9163
  "name": "full_width",
@@ -4883,7 +4883,8 @@
4883
4883
  "snapshot": "true",
4884
4884
  "skip_rules": {
4885
4885
  "wont_fix": [
4886
- "region"
4886
+ "region",
4887
+ "label-title-only"
4887
4888
  ],
4888
4889
  "will_fix": [
4889
4890
  "color-contrast"
@@ -5130,19 +5131,6 @@
5130
5131
  ]
5131
5132
  }
5132
5133
  },
5133
- {
5134
- "preview_path": "primer/alpha/overlay/menu_no_header",
5135
- "name": "menu_no_header",
5136
- "snapshot": "false",
5137
- "skip_rules": {
5138
- "wont_fix": [
5139
- "region"
5140
- ],
5141
- "will_fix": [
5142
- "color-contrast"
5143
- ]
5144
- }
5145
- },
5146
5134
  {
5147
5135
  "preview_path": "primer/alpha/overlay/middle_of_page",
5148
5136
  "name": "middle_of_page",
@@ -7141,6 +7129,19 @@
7141
7129
  ]
7142
7130
  }
7143
7131
  },
7132
+ {
7133
+ "preview_path": "primer/alpha/text_field/show_clear_button_with_custom_label",
7134
+ "name": "show_clear_button_with_custom_label",
7135
+ "snapshot": "true",
7136
+ "skip_rules": {
7137
+ "wont_fix": [
7138
+ "region"
7139
+ ],
7140
+ "will_fix": [
7141
+ "color-contrast"
7142
+ ]
7143
+ }
7144
+ },
7144
7145
  {
7145
7146
  "preview_path": "primer/alpha/text_field/full_width",
7146
7147
  "name": "full_width",