@primer/view-components 0.43.3-rc.72689e8b → 0.43.3-rc.759cce6b
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/app/assets/javascripts/components/primer/beta/details_toggle_element.d.ts +4 -3
- package/app/assets/javascripts/primer_view_components.js +1 -1
- package/app/assets/javascripts/primer_view_components.js.map +1 -1
- package/app/components/primer/alpha/action_list.js +0 -2
- package/app/components/primer/alpha/toggle_switch.js +1 -0
- package/app/components/primer/beta/details_toggle_element.d.ts +4 -3
- package/app/components/primer/beta/details_toggle_element.js +12 -7
- package/app/components/primer/beta/nav_list.js +0 -1
- package/app/components/primer/beta/nav_list_group_element.js +1 -0
- package/package.json +5 -8
- package/static/info_arch.json +13 -0
- package/static/previews.json +13 -0
@@ -17,7 +17,6 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
17
17
|
};
|
18
18
|
var _ActionListElement_truncationObserver;
|
19
19
|
import { controller } from '@github/catalyst';
|
20
|
-
// eslint-disable-next-line custom-elements/no-exports-with-element
|
21
20
|
export class ActionListTruncationObserver {
|
22
21
|
constructor(el) {
|
23
22
|
this.resizeObserver = new ResizeObserver(entries => {
|
@@ -67,6 +66,5 @@ let ActionListElement = class ActionListElement extends HTMLElement {
|
|
67
66
|
_ActionListElement_truncationObserver = new WeakMap();
|
68
67
|
ActionListElement = __decorate([
|
69
68
|
controller
|
70
|
-
// eslint-disable-next-line custom-elements/expose-class-on-global
|
71
69
|
], ActionListElement);
|
72
70
|
export { ActionListElement };
|
@@ -144,6 +144,7 @@ let ToggleSwitchElement = class ToggleSwitchElement extends HTMLElement {
|
|
144
144
|
headers: requestHeaders,
|
145
145
|
body,
|
146
146
|
});
|
147
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
147
148
|
}
|
148
149
|
catch (error) {
|
149
150
|
throw new Error('A network error occurred, please try again.');
|
@@ -3,9 +3,10 @@
|
|
3
3
|
* ensures the <details> and <summary> elements markup is properly accessible by
|
4
4
|
* updating the aria-label and aria-expanded attributes on click.
|
5
5
|
*
|
6
|
-
* aria-label values
|
7
|
-
*
|
8
|
-
*
|
6
|
+
* aria-label values are only set if provided via the `data-aria-label-open` and
|
7
|
+
* `data-aria-label-closed` attributes on the summary target. If these attributes
|
8
|
+
* are not present, no aria-label will be set, allowing screen readers to use
|
9
|
+
* the visible text content.
|
9
10
|
*
|
10
11
|
* @example
|
11
12
|
* ```html
|
@@ -10,9 +10,10 @@ import { controller, target } from '@github/catalyst';
|
|
10
10
|
* ensures the <details> and <summary> elements markup is properly accessible by
|
11
11
|
* updating the aria-label and aria-expanded attributes on click.
|
12
12
|
*
|
13
|
-
* aria-label values
|
14
|
-
*
|
15
|
-
*
|
13
|
+
* aria-label values are only set if provided via the `data-aria-label-open` and
|
14
|
+
* `data-aria-label-closed` attributes on the summary target. If these attributes
|
15
|
+
* are not present, no aria-label will be set, allowing screen readers to use
|
16
|
+
* the visible text content.
|
16
17
|
*
|
17
18
|
* @example
|
18
19
|
* ```html
|
@@ -37,13 +38,17 @@ let DetailsToggleElement = class DetailsToggleElement extends HTMLElement {
|
|
37
38
|
toggle() {
|
38
39
|
const detailsIsOpen = this.detailsTarget.hasAttribute('open');
|
39
40
|
if (detailsIsOpen) {
|
40
|
-
const ariaLabelClosed = this.summaryTarget.getAttribute('data-aria-label-closed')
|
41
|
-
|
41
|
+
const ariaLabelClosed = this.summaryTarget.getAttribute('data-aria-label-closed');
|
42
|
+
if (ariaLabelClosed) {
|
43
|
+
this.summaryTarget.setAttribute('aria-label', ariaLabelClosed);
|
44
|
+
}
|
42
45
|
this.summaryTarget.setAttribute('aria-expanded', 'false');
|
43
46
|
}
|
44
47
|
else {
|
45
|
-
const ariaLabelOpen = this.summaryTarget.getAttribute('data-aria-label-open')
|
46
|
-
|
48
|
+
const ariaLabelOpen = this.summaryTarget.getAttribute('data-aria-label-open');
|
49
|
+
if (ariaLabelOpen) {
|
50
|
+
this.summaryTarget.setAttribute('aria-label', ariaLabelOpen);
|
51
|
+
}
|
47
52
|
this.summaryTarget.setAttribute('aria-expanded', 'true');
|
48
53
|
}
|
49
54
|
}
|
@@ -16,7 +16,6 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
16
16
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
17
17
|
};
|
18
18
|
var _NavListElement_instances, _NavListElement_truncationObserver, _NavListElement_findSelectedNavItemById, _NavListElement_findSelectedNavItemByHref, _NavListElement_findSelectedNavItemByCurrentLocation, _NavListElement_select, _NavListElement_deselect, _NavListElement_findParentMenu;
|
19
|
-
/* eslint-disable custom-elements/expose-class-on-global */
|
20
19
|
import { controller, target, targets } from '@github/catalyst';
|
21
20
|
import { ActionListTruncationObserver } from '../alpha/action_list';
|
22
21
|
let NavListElement = class NavListElement extends HTMLElement {
|
@@ -62,6 +62,7 @@ let NavListGroupElement = class NavListGroupElement extends HTMLElement {
|
|
62
62
|
if (this.currentPage === this.totalPages) {
|
63
63
|
this.showMoreItem.hidden = true;
|
64
64
|
}
|
65
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
65
66
|
}
|
66
67
|
catch (err) {
|
67
68
|
// Ignore network errors
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@primer/view-components",
|
3
|
-
"version": "0.43.3-rc.
|
3
|
+
"version": "0.43.3-rc.759cce6b",
|
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",
|
@@ -72,16 +72,13 @@
|
|
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",
|
75
|
-
"@typescript-eslint/eslint-plugin": "^7.0.1",
|
76
|
-
"@typescript-eslint/parser": "^7.0.1",
|
77
75
|
"axe-core": "^4.7.1",
|
78
76
|
"chokidar-cli": "^3.0.0",
|
79
77
|
"cssnano": "^7.0.1",
|
80
|
-
"eslint": "^
|
81
|
-
"eslint-plugin-
|
82
|
-
"
|
83
|
-
"
|
84
|
-
"markdownlint-cli2": "^0.17.2",
|
78
|
+
"eslint": "^9.10.0",
|
79
|
+
"eslint-plugin-github": "^6.0.0",
|
80
|
+
"glob": "^11.0.2",
|
81
|
+
"markdownlint-cli2": "^0.18.1",
|
85
82
|
"mocha": "^11.0.1",
|
86
83
|
"playwright": "^1.49.1",
|
87
84
|
"postcss": "^8.4.16",
|
package/static/info_arch.json
CHANGED
@@ -13108,6 +13108,19 @@
|
|
13108
13108
|
"color-contrast"
|
13109
13109
|
]
|
13110
13110
|
}
|
13111
|
+
},
|
13112
|
+
{
|
13113
|
+
"preview_path": "primer/beta/details/with_aria_labels",
|
13114
|
+
"name": "with_aria_labels",
|
13115
|
+
"snapshot": "false",
|
13116
|
+
"skip_rules": {
|
13117
|
+
"wont_fix": [
|
13118
|
+
"region"
|
13119
|
+
],
|
13120
|
+
"will_fix": [
|
13121
|
+
"color-contrast"
|
13122
|
+
]
|
13123
|
+
}
|
13111
13124
|
}
|
13112
13125
|
],
|
13113
13126
|
"subcomponents": []
|
package/static/previews.json
CHANGED
@@ -3157,6 +3157,19 @@
|
|
3157
3157
|
"color-contrast"
|
3158
3158
|
]
|
3159
3159
|
}
|
3160
|
+
},
|
3161
|
+
{
|
3162
|
+
"preview_path": "primer/beta/details/with_aria_labels",
|
3163
|
+
"name": "with_aria_labels",
|
3164
|
+
"snapshot": "false",
|
3165
|
+
"skip_rules": {
|
3166
|
+
"wont_fix": [
|
3167
|
+
"region"
|
3168
|
+
],
|
3169
|
+
"will_fix": [
|
3170
|
+
"color-contrast"
|
3171
|
+
]
|
3172
|
+
}
|
3160
3173
|
}
|
3161
3174
|
]
|
3162
3175
|
},
|