Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SelectPanel] Filter input border and loading/error panel min-height #3044

Merged
merged 24 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
d29394d
Addresses SelectPanel design changes.
jamieshark Aug 30, 2024
5b70b56
Removes unneeded margin from divider.
jamieshark Aug 30, 2024
afc7d1f
Adds SelectPanel stylesheet and min height to loading / error panel.
jamieshark Aug 30, 2024
21559cf
move banner error to render with filter input.
jamieshark Aug 30, 2024
f6e0e94
Adjust min height for footer.
jamieshark Aug 30, 2024
c5c8232
Changeset.
jamieshark Aug 30, 2024
e25e242
bit of cleanup
jamieshark Aug 30, 2024
692d02c
Favor show_divider param over rendering actual divider.
jamieshark Sep 3, 2024
ffcd186
Generating component snapshots
jamieshark Sep 3, 2024
474afaf
Remove unused static class.
jamieshark Sep 3, 2024
0afe261
Adds item limit param to SelectPanel Playground.
jamieshark Sep 3, 2024
6392dea
Generating component snapshots
jamieshark Sep 3, 2024
d950a6b
Add fallback param.
jamieshark Sep 3, 2024
a83dfab
Generating component snapshots
jamieshark Sep 3, 2024
66d2497
Better return statement for limit_items.
jamieshark Sep 3, 2024
95c0140
Merge branch 'main' into jshark/select-panel-design
jamieshark Sep 5, 2024
eb55b50
Generating component snapshots
jamieshark Sep 5, 2024
d9684af
Design changes for margin in banner and font size.
jamieshark Sep 6, 2024
87d215d
Generating component snapshots
jamieshark Sep 6, 2024
52bf15c
Adds min height to empty panel.
jamieshark Sep 9, 2024
0d7cbc7
Add min height for no results.
jamieshark Sep 9, 2024
e6a35e3
Generating component snapshots
jamieshark Sep 9, 2024
319f859
Merge branch 'main' into jshark/select-panel-design
jamieshark Sep 10, 2024
9eb76f1
Remove limit items from playground.
jamieshark Sep 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/light-foxes-scream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@primer/view-components': patch
---

SelectPanel - design bug fixes. Adds a divider below the filter, adjusts min height for loading and error states, moves banner error above input filter."
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 15 additions & 14 deletions app/components/primer/alpha/select_panel.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,23 @@
<dialog-helper>
<%= show_button %>
<%= render(@dialog) do %>
<%= render Primer::Alpha::Dialog::Header.new(id: "#{@panel_id}-dialog", title: @title) do |header| %>
<%= render Primer::Alpha::Dialog::Header.new(id: "#{@panel_id}-dialog", title: @title, show_divider: show_filter?) do |header| %>
<% if subtitle? %>
<% header.with_subtitle do %>
<%= subtitle %>
<% end %>
<% end %>
<% if show_filter? %>
<% header.with_filter do %>
<div data-target="select-panel.bannerErrorElement" hidden>
<%= render Primer::Alpha::Banner.new(scheme: :danger, mb: 2) do %>
<% if error_content? %>
<%= error_content %>
<% else %>
<h2 class="f6 text-normal">Sorry, something went wrong.</h2>
<% end %>
<% end %>
</div>
<%= render(Primer::BaseComponent.new(
tag: :"remote-input",
aria: { owns: @body_id },
Expand All @@ -36,16 +45,7 @@
<% end %>
<% end %>
<% end %>
<div data-target="select-panel.bannerErrorElement" hidden>
<%= render Primer::Alpha::Banner.new(scheme: :danger, full: true, mt: 2) do %>
<% if error_content? %>
<%= error_content %>
<% else %>
<h2 class="f5">Sorry, something went wrong.</h2>
<% end %>
<% end %>
</div>
<%= render Primer::Alpha::Dialog::Body.new(mt: 2, p: 0) do %>
<%= render Primer::Alpha::Dialog::Body.new(mt: show_filter? ? 0 : 2, p: 0) do %>
<focus-group direction="vertical" mnemonics retain>
<div class="sr-only" aria-live="polite" aria-atomic="true" data-target="select-panel.ariaLiveContainer"></div>
<%= render(Primer::BaseComponent.new(
Expand All @@ -67,7 +67,8 @@
display: :flex,
align_items: :center,
justify_content: :center,
text_align: :center
text_align: :center,
classes: "SelectPanel-loadingPanel"
)) do %>
<div data-hide-on-error>
<%= render Primer::Beta::Spinner.new(aria: { label: "Loading content..." }, data: { target: "select-panel.bodySpinner" }) %>
Expand All @@ -78,7 +79,7 @@
<% else %>
<div class="pt-2 pb-2">
<%= render Primer::Beta::Octicon.new(icon: :alert, color: :danger) %>
<h2 class="f5">Sorry, something went wrong.</h2>
<h2 class="f5 mt-2">Sorry, something went wrong.</h2>
</div>
<% end %>
</div>
Expand All @@ -88,7 +89,7 @@
<%= render(@list) %>
<% end %>
</div>
<div data-target="select-panel.noResults" class="color-border-muted text-center" hidden>
<div data-target="select-panel.noResults" class="color-border-muted text-center d-flex flex-items-center flex-justify-center SelectPanel-emptyPanel" hidden>
<h2 class="v-align-middle m-3 f5"><%= @no_results_label %></h2>
</div>
<% end %>
Expand Down
7 changes: 7 additions & 0 deletions app/components/primer/alpha/select_panel.pcss
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.SelectPanel-loadingPanel {
camertron marked this conversation as resolved.
Show resolved Hide resolved
min-height: min(var(--overlay-height) - 10rem, 100vh - 2rem);
}

.SelectPanel-emptyPanel {
min-height: min(var(--overlay-height) - 10rem, 100vh - 2rem);
}
1 change: 1 addition & 0 deletions app/components/primer/primer.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
@import "./alpha/button_marketing.pcss";
@import "./alpha/toggle_switch.pcss";
@import "./alpha/underline_nav.pcss";
@import "./alpha/select_panel.pcss";
@import "./alpha/segmented_control.pcss";
@import "./alpha/menu.pcss";

Expand Down
Loading