primer_view_components 0.36.4 → 0.37.0

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.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +26 -0
  3. data/app/assets/javascripts/components/primer/beta/details_toggle_element.d.ts +39 -0
  4. data/app/assets/javascripts/components/primer/primer.d.ts +1 -0
  5. data/app/assets/javascripts/primer_view_components.js +1 -1
  6. data/app/assets/javascripts/primer_view_components.js.map +1 -1
  7. data/app/components/primer/alpha/action_menu/action_menu_element.js +13 -3
  8. data/app/components/primer/alpha/action_menu/action_menu_element.ts +14 -2
  9. data/app/components/primer/alpha/dropdown.rb +8 -0
  10. data/app/components/primer/alpha/form_control.rb +47 -7
  11. data/app/components/primer/alpha/toggle_switch.html.erb +1 -1
  12. data/app/components/primer/alpha/toggle_switch.js +1 -0
  13. data/app/components/primer/alpha/toggle_switch.rb +14 -2
  14. data/app/components/primer/alpha/toggle_switch.ts +1 -0
  15. data/app/components/primer/beta/button.html.erb +1 -1
  16. data/app/components/primer/beta/button.rb +2 -1
  17. data/app/components/primer/beta/details.html.erb +8 -6
  18. data/app/components/primer/beta/details.rb +42 -0
  19. data/app/components/primer/beta/details_toggle_element.d.ts +39 -0
  20. data/app/components/primer/beta/details_toggle_element.js +60 -0
  21. data/app/components/primer/beta/details_toggle_element.ts +57 -0
  22. data/app/components/primer/beta/markdown.rb +1 -0
  23. data/app/components/primer/beta/nav_list.rb +1 -1
  24. data/app/components/primer/primer.d.ts +1 -0
  25. data/app/components/primer/primer.js +1 -0
  26. data/app/components/primer/primer.ts +1 -0
  27. data/app/lib/primer/forms/action_menu.html.erb +1 -1
  28. data/app/lib/primer/forms/action_menu.rb +5 -0
  29. data/lib/primer/view_components/version.rb +2 -2
  30. data/lib/primer/yard/component_manifest.rb +11 -10
  31. data/lib/primer/yard/lookbook_pages_backend.rb +8 -0
  32. data/previews/primer/alpha/action_menu_preview/multiple_select_form.html.erb +1 -1
  33. data/previews/primer/alpha/form_control_preview/playground.html.erb +14 -6
  34. data/previews/primer/alpha/overlay_preview.rb +0 -31
  35. data/previews/primer/alpha/select_preview.rb +6 -6
  36. data/previews/primer/alpha/text_field_preview.rb +22 -22
  37. data/previews/primer/alpha/toggle_switch_preview.rb +4 -0
  38. data/previews/primer/alpha/tooltip_preview.rb +1 -1
  39. data/previews/primer/beta/details_preview.rb +12 -0
  40. data/previews/primer/beta/markdown_preview.rb +9 -9
  41. data/previews/primer/beta/relative_time_preview.rb +20 -10
  42. data/static/arguments.json +18 -0
  43. data/static/constants.json +4 -0
  44. data/static/info_arch.json +140 -70
  45. data/static/previews.json +27 -52
  46. metadata +6 -4
  47. data/previews/primer/alpha/overlay_preview/in_an_action_menu.html.erb +0 -13
  48. data/previews/primer/alpha/overlay_preview/overlay_with_header_filter.html.erb +0 -16
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5fa8931f54f0a1ea7e96a8f7dc72323c811477dfb7e21cf52cb498ceededb018
4
- data.tar.gz: 7ca20dbba30de7fa61b73adc4a7ee52bee45319aa8d30b0f491a50e1951c8e75
3
+ metadata.gz: 48d0b15134dda5d38739520d067818c81d06344965cde7ed6d10029ab9cadb81
4
+ data.tar.gz: 425ae41adeda53e6d6bef3993f05482f48014755b76d819063b706bb56d8dd19
5
5
  SHA512:
6
- metadata.gz: c79de0f967b25ff41b28b9115759cf36275f7386e249ad40581bc073d6a3123fe5b0a97767d06398ca0a8a883ea90ec2895b0efde22ab259f206b6e52ee667a8
7
- data.tar.gz: 8e81addbf7b1424c1040771bef7771e0f6c7a7dc4715ca5dd357d7888169892e3b6e500419cfe08f4a99bac315d711158b5f6bd1c424f199a1b89e2f1dc748ab
6
+ metadata.gz: 469423a2e543d62487242aa586b64605e1fb803a7ff0891bd2b0b0a1856c4b1c55751995bc5774c90556de78f0b33f3cb63c1120c13ac32dedebe40c40b4e8c5
7
+ data.tar.gz: 4ecefa48eaf484b0a3f340cfb46aa75aa26a1d9787ccedc325c98bcd45433bd4f64a235ff2ecd6b216e322858fab17cf694ecc2a099c604ec4b7801adb5292e6
data/CHANGELOG.md CHANGED
@@ -1,5 +1,31 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 0.37.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#3292](https://github.com/primer/view_components/pull/3292) [`66637a4`](https://github.com/primer/view_components/commit/66637a4869431a53bcb39b24b907da7b930729ed) Thanks [@ktravers](https://github.com/ktravers)! - Improve Details component accessibility by setting aria-label and aria-expanded attributes correctly on initial render and when toggled open/closed.
8
+
9
+ ### Patch Changes
10
+
11
+ - [#3327](https://github.com/primer/view_components/pull/3327) [`e3e29b0`](https://github.com/primer/view_components/commit/e3e29b0e983b494fce7bdd95390908d4583ede16) Thanks [@acbreton](https://github.com/acbreton)! - Prevent scroll when opening `ActionMenu`s.
12
+
13
+ - [#3319](https://github.com/primer/view_components/pull/3319) [`42db9dd`](https://github.com/primer/view_components/commit/42db9dd724b0edd3806fdc0661f248d87b0d8f5f) Thanks [@ktravers](https://github.com/ktravers)! - Adds optional autofocus to ToggleSwitch
14
+
15
+ - [#3291](https://github.com/primer/view_components/pull/3291) [`aeaeb96`](https://github.com/primer/view_components/commit/aeaeb9632f651bbfbb45c630a1d088b1fe3303b8) Thanks [@francinelucca](https://github.com/francinelucca)! - fix(ToggleSwitch): add X-Requested-With header
16
+
17
+ - [#3318](https://github.com/primer/view_components/pull/3318) [`081e5dd`](https://github.com/primer/view_components/commit/081e5dd9f2912dc3b7070f2af5c235c31b5a306c) Thanks [@kendallgassner](https://github.com/kendallgassner)! - [ActionMenuForm] Add aria-describedby to the ActionMenuForm's button so that the label is describing the button
18
+
19
+ - [#3316](https://github.com/primer/view_components/pull/3316) [`4552438`](https://github.com/primer/view_components/commit/45524387a016bb8dab7555bd40ff4dd2e84f3bb2) Thanks [@camertron](https://github.com/camertron)! - Correct accessibility issues in FormControl examples and address missing aria attributes
20
+
21
+ - [#3303](https://github.com/primer/view_components/pull/3303) [`7fbd8da`](https://github.com/primer/view_components/commit/7fbd8da673f4a4c9459712379c240a923784f42d) Thanks [@camertron](https://github.com/camertron)! - Do not populate dynamic label with active item in multi-select mode
22
+
23
+ ## 0.36.5
24
+
25
+ ### Patch Changes
26
+
27
+ - [#3270](https://github.com/primer/view_components/pull/3270) [`fa16aec`](https://github.com/primer/view_components/commit/fa16aec26afb654a627c5c7ed68812f1fa807d0a) Thanks [@khiga8](https://github.com/khiga8)! - Ensure counter content is exposed to screen reader users
28
+
3
29
  ## 0.36.4
4
30
 
5
31
  ### Patch Changes
@@ -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 {};
@@ -25,3 +25,4 @@ import '../../lib/primer/forms/primer_text_field';
25
25
  import '../../lib/primer/forms/toggle_switch_input';
26
26
  import './alpha/action_menu/action_menu_element';
27
27
  import './alpha/select_panel_element';
28
+ import './beta/details_toggle_element';