Skip to content

Commit 676815c

Browse files
authored
Merge pull request #135 from opf/bump/primer-upstream
Bump/primer upstream to 0.26.1
2 parents 86cc9a5 + c9f0ade commit 676815c

25 files changed

Lines changed: 174 additions & 100 deletions

File tree

.changeset/perfect-jobs-pretend.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@openproject/primer-view-components': patch
3+
---
4+
5+
Revert tab-container-element upgrade
106 Bytes
Loading
128 Bytes
Loading
135 Bytes
Loading
128 Bytes
Loading
148 Bytes
Loading
154 Bytes
Loading

app/components/primer/alpha/tab_nav.pcss

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@
1313
overflow: hidden;
1414
}
1515

16-
.tabnav::part(tablist-wrapper) {
17-
margin-bottom: var(--stack-gap-normal);
18-
border-bottom: var(--borderWidth-thin) solid var(--borderColor-default);
19-
}
20-
2116
.tabnav-tab {
2217
display: inline-block;
2318
flex-shrink: 0;
@@ -71,11 +66,6 @@
7166
}
7267
}
7368

74-
tab-container .tabnav-tab {
75-
margin-bottom: -1px;
76-
}
77-
78-
7969
/* Tabnav extras
8070
**
8171
** Tabnav extras are non-tab elements that sit in the tabnav. Usually they're

app/components/primer/alpha/tab_panels.html.erb

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1-
<%= render Primer::BaseComponent.new(**@system_arguments) do %>
2-
<%= extra if @align == :left %>
3-
<% tabs.each do |tab| %>
4-
<%= tab %>
1+
<%= tab_container_wrapper(with_panel: true, **@wrapper_arguments) do %>
2+
<%= render Primer::BaseComponent.new(**@system_arguments) do %>
3+
<%= extra if @align == :left %>
4+
<%= render Primer::BaseComponent.new(**@body_arguments) do %>
5+
<% tabs.each do |tab| %>
6+
<%= tab %>
7+
<% end %>
8+
<% end %>
9+
<%= extra if @align == :right %>
510
<% end %>
6-
<%= extra if @align == :right %>
711
<% tabs.each do |tab| %>
812
<%= tab.panel %>
913
<% end %>

app/components/primer/alpha/tab_panels.rb

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class TabPanels < Primer::Component
2626
Primer::Alpha::Navigation::Tab.new(
2727
selected: selected,
2828
with_panel: true,
29-
list: false,
29+
list: true,
3030
panel_id: "panel-#{id}",
3131
**system_arguments
3232
)
@@ -43,14 +43,23 @@ class TabPanels < Primer::Component
4343

4444
# @param label [String] Sets an `aria-label` that helps assistive technology users understand the purpose of the tabs.
4545
# @param align [Symbol] <%= one_of(Primer::TabNavHelper::EXTRA_ALIGN_OPTIONS) %> - Defaults to <%= Primer::TabNavHelper::EXTRA_ALIGN_DEFAULT %>
46+
# @param body_arguments [Hash] <%= link_to_system_arguments_docs %> for the body wrapper.
47+
# @param wrapper_arguments [Hash] <%= link_to_system_arguments_docs %> for the `TabContainer` wrapper.
4648
# @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
4749
def initialize(label:, body_arguments: {}, wrapper_arguments: {}, **system_arguments)
4850
@align = EXTRA_ALIGN_DEFAULT
51+
@wrapper_arguments = wrapper_arguments
4952

50-
@system_arguments = { **deny_tag_argument(**system_arguments), **deny_tag_argument(**wrapper_arguments) }
51-
@system_arguments[:tag] = :"tab-container"
53+
@system_arguments = deny_tag_argument(**system_arguments)
54+
@system_arguments[:tag] = :div
5255
@system_arguments[:classes] = tab_nav_classes(@system_arguments[:classes])
53-
@system_arguments[:"aria-label"] = label
56+
57+
@body_arguments = deny_tag_argument(**body_arguments)
58+
@body_arguments[:tag] = :ul
59+
@body_arguments[:classes] = tab_nav_body_classes(@body_arguments[:classes])
60+
61+
@body_arguments[:role] = :tablist
62+
@body_arguments[:"aria-label"] = label
5463
end
5564

5665
def before_render

0 commit comments

Comments
 (0)