Skip to content

Commit 36ea822

Browse files
committed
Merge remote-tracking branch 'origin/main' into bump/primer-upstream
2 parents df67026 + afdcd51 commit 36ea822

File tree

16 files changed

+100
-14
lines changed

16 files changed

+100
-14
lines changed
14 Bytes
Loading
12 Bytes
Loading
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- button "Drag to reorder"
46 Bytes
Loading

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# CHANGELOG
22

3+
## 0.82.1
4+
5+
### Patch Changes
6+
7+
- [#419](https://github.com/opf/primer_view_components/pull/419) [`62a3462`](https://github.com/opf/primer_view_components/commit/62a3462b142b00dea14415df678ec283a9aac52a) Thanks [@myabc](https://github.com/myabc)! - DragHandle: Add accessibility attributes (role, tabindex, aria-label).
8+
9+
- [#423](https://github.com/opf/primer_view_components/pull/423) [`576b200`](https://github.com/opf/primer_view_components/commit/576b2004469d834bbf97df6d5d35651a911b6be1) Thanks [@HDinger](https://github.com/HDinger)! - Let Banner component react on container size instead of screen size
10+
311
## 0.82.0
412

513
### Minor Changes

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
openproject-primer_view_components (0.82.0)
4+
openproject-primer_view_components (0.82.1)
55
actionview (>= 7.2.0)
66
activesupport (>= 7.2.0)
77
openproject-octicons (>= 19.30.1)

app/components/primer/alpha/banner.pcss

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
/* Banner alert */
2+
x-banner {
3+
container-type: inline-size;
4+
display: block;
5+
}
26

37
.Banner {
48
position: relative;
@@ -14,7 +18,7 @@
1418
grid-template-rows: min-content;
1519

1620
/* `sm` breakpoint variation */
17-
@media (max-width: 543.98px) {
21+
@container (max-width: 543.98px) {
1822
grid-template-areas:
1923
'visual message close'
2024
'. actions actions';

app/components/primer/open_project/drag_handle.rb

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,29 @@ class DragHandle < Primer::Component
1111
DEFAULT_SIZE = Primer::Beta::Octicon::SIZE_DEFAULT
1212
SIZE_OPTIONS = Primer::Beta::Octicon::SIZE_OPTIONS
1313

14+
# @param size [Symbol] <%= one_of(Primer::OpenProject::DragHandle::SIZE_OPTIONS) %>
15+
# @param label [String] String that can be read by assistive technology. A label should be short and concise. See the accessibility section for more information.
1416
# @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
15-
def initialize(size: Primer::OpenProject::DragHandle::DEFAULT_SIZE, **system_arguments)
16-
@system_arguments = system_arguments
17+
def initialize(size: Primer::OpenProject::DragHandle::DEFAULT_SIZE, label: I18n.t("drag_handle.button_drag"), **system_arguments)
18+
@system_arguments = deny_tag_argument(**system_arguments)
19+
20+
deny_aria_key(
21+
:label,
22+
"instead of `aria-label`, include `label` on the component initializer.",
23+
**@system_arguments
24+
)
1725
@system_arguments[:tag] = "div"
18-
@system_arguments[:classes] =
19-
class_names(
20-
@system_arguments[:classes],
21-
"DragHandle"
22-
)
26+
@system_arguments[:role] = "button"
27+
@system_arguments[:tabindex] = 0
28+
@system_arguments[:classes] = class_names(
29+
@system_arguments[:classes],
30+
"DragHandle"
31+
)
32+
33+
@system_arguments[:aria] = merge_aria(
34+
@system_arguments,
35+
aria: { label: label }
36+
)
2337

2438
@size = fetch_or_fallback(Primer::OpenProject::DragHandle::SIZE_OPTIONS, size, Primer::OpenProject::DragHandle::DEFAULT_SIZE)
2539
end

config/locales/en.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ en:
88
button_filter: "Filter"
99
button_save: "Save"
1010

11+
drag_handle:
12+
button_drag: "Drag to reorder"
13+
1114
filterable_tree_view:
1215
filter_mode:
1316
all: "All"

demo/Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: ..
33
specs:
4-
openproject-primer_view_components (0.82.0)
4+
openproject-primer_view_components (0.82.1)
55
actionview (>= 7.2.0)
66
activesupport (>= 7.2.0)
77
openproject-octicons (>= 19.30.1)

0 commit comments

Comments
 (0)