@primer/view-components 0.36.6-rc.f22d48ee → 0.37.0-rc.1b825e45
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 +39 -0
- package/app/assets/javascripts/components/primer/primer.d.ts +1 -0
- 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/beta/details_toggle_element.d.ts +39 -0
- package/app/components/primer/beta/details_toggle_element.js +60 -0
- package/app/components/primer/primer.d.ts +1 -0
- package/app/components/primer/primer.js +1 -0
- package/package.json +1 -1
- package/static/arguments.json +6 -0
- package/static/constants.json +4 -0
- package/static/info_arch.json +113 -17
- package/static/previews.json +13 -0
@@ -0,0 +1,39 @@
|
|
1
|
+
/**
|
2
|
+
* A companion Catalyst element for the Details view component. This element
|
3
|
+
* ensures the <details> and <summary> elements markup is properly accessible by
|
4
|
+
* updating the aria-label and aria-expanded attributes on click.
|
5
|
+
*
|
6
|
+
* aria-label values default to "Expand" and "Collapse". To override those
|
7
|
+
* values, use the `data-aria-label-open` and `data-aria-label-closed`
|
8
|
+
* attributes on the summary target.
|
9
|
+
*
|
10
|
+
* @example
|
11
|
+
* ```html
|
12
|
+
* <details-toggle>
|
13
|
+
* <details open=true data-target="details-toggle.detailsTarget">
|
14
|
+
* <summary
|
15
|
+
* aria-expanded="true"
|
16
|
+
* aria-label="Collapse me"
|
17
|
+
* data-target="details-toggle.summaryTarget"
|
18
|
+
* data-action="click:details-toggle#toggle"
|
19
|
+
* data-aria-label-closed="Expand me"
|
20
|
+
* data-aria-label-open="Collapse me"
|
21
|
+
* >
|
22
|
+
* Click me
|
23
|
+
* </summary>
|
24
|
+
* <div>Contents</div>
|
25
|
+
* </details>
|
26
|
+
* </details-toggle>
|
27
|
+
* ```
|
28
|
+
*/
|
29
|
+
declare class DetailsToggleElement extends HTMLElement {
|
30
|
+
detailsTarget: HTMLDetailsElement;
|
31
|
+
summaryTarget: HTMLElement;
|
32
|
+
toggle(): void;
|
33
|
+
}
|
34
|
+
declare global {
|
35
|
+
interface Window {
|
36
|
+
DetailsToggleElement: typeof DetailsToggleElement;
|
37
|
+
}
|
38
|
+
}
|
39
|
+
export {};
|