-
-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a99615f
commit d75fb3c
Showing
11 changed files
with
199 additions
and
112 deletions.
There are no files selected for viewing
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,100 @@ | ||
<%= render Polaris::BaseComponent.new(tag: 'div', **@system_arguments) do %> | ||
<%= polaris_vertical_stack do %> | ||
<% content_with_actions = capture do %> | ||
<%= polaris_vertical_stack(classes: "Polaris-Banner__ContentWrapper", gap: within_container? ? "1" : "3") do %> | ||
<% if content.present? || action || secondary_action %> | ||
|
||
<%= polaris_horizontal_stack(classes: "Polaris-Banner__TopBar", wrap: false, gap: within_container? ? "1" : "2") do %> | ||
<% unless @hide_icon %> | ||
<%= polaris_box do %> | ||
<%= render_icon %> | ||
<% if content.present? %> | ||
<%= polaris_box(padding_inline_end: within_container? ? "2" : nil) do %> | ||
<%= content %> | ||
<% end %> | ||
<% end %> | ||
<% if @title.present? %> | ||
<%= polaris_box(padding_inline_end: "4") do %> | ||
<%= polaris_text(as: :h2, variant: :headingMd, break_word: true) do %> | ||
<%= @title %> | ||
|
||
<% if action || secondary_action %> | ||
<%= polaris_box do %> | ||
<%= polaris_button_group do |group| %> | ||
<% if action %> | ||
<% group.with_item do %> | ||
<%= polaris_box(padding_inline_end: "1") do %> | ||
<%= action %> | ||
<% end %> | ||
<% end %> | ||
<% end %> | ||
|
||
<% if secondary_action %> | ||
<% group.with_item do %> | ||
<%= secondary_action %> | ||
<% end %> | ||
<% end %> | ||
<% end %> | ||
<% end %> | ||
<% end %> | ||
<% if dismiss_button %> | ||
<div class="Polaris-Banner__Dismiss"> | ||
<%= dismiss_button %> | ||
</div> | ||
<% end %> | ||
<% end %> | ||
|
||
<%= polaris_box(padding: within_container? ? "2" : "4") do %> | ||
<%= polaris_vertical_stack(classes: "Polaris-Banner__ContentWrapper", gap: within_container? ? "1" : "3") do %> | ||
<% if content.present? || action || secondary_action %> | ||
|
||
<%= polaris_box(padding_inline_end: within_container? ? "2" : nil) do %> | ||
<%= content %> | ||
<% end %> | ||
<% end %> | ||
<% end %> | ||
<% end %> | ||
|
||
<% if action || secondary_action %> | ||
<%= polaris_box do %> | ||
<%= polaris_button_group do |group| %> | ||
<% if action %> | ||
<% group.with_item do %> | ||
<%= polaris_box(padding_inline_end: "1") do %> | ||
<%= action %> | ||
<% end %> | ||
<% end %> | ||
<%= render Polaris::BaseComponent.new(**system_arguments) do %> | ||
<% if has_title? && !within_container? %> | ||
<%= polaris_box(width: "100%") do %> | ||
<%= polaris_vertical_stack do %> | ||
<%= polaris_box(classes: "Polaris-Banner__TopBar") do %> | ||
<%= polaris_horizontal_stack(align: :space_between, block_align: :center, wrap: false, gap: "2") do %> | ||
<%= polaris_horizontal_stack(wrap: false, gap: "1") do %> | ||
<% unless @hide_icon %> | ||
<%= polaris_box do %> | ||
<%= render_icon %> | ||
<% end %> | ||
|
||
<% if secondary_action %> | ||
<% group.with_item do %> | ||
<%= secondary_action %> | ||
<% end %> | ||
<% end %> | ||
<% if has_title? %> | ||
<%= polaris_text(as: :h2, variant: :headingSm, break_word: true) do %> | ||
<%= @title %> | ||
<% end %> | ||
<% end %> | ||
<% end %> | ||
<% if dismiss_button %> | ||
<%= polaris_box(classes: "Polaris-Banner__DismissButton") do %> | ||
<%= dismiss_button %> | ||
<% end %> | ||
<% end %> | ||
<% end %> | ||
<% end %> | ||
<% if has_content? %> | ||
<%= polaris_box(padding: "4") do %> | ||
<%= content_with_actions %> | ||
<% end %> | ||
<% end %> | ||
<% end %> | ||
<% end %> | ||
<% else %> | ||
<%= polaris_box(width: "100%", padding: within_container? ? "2" : "3") do %> | ||
<%= polaris_horizontal_stack(align: :space_between, block_align: :start, wrap: false, gap: "2") do %> | ||
<%= polaris_horizontal_stack(wrap: false, gap: "1") do %> | ||
<% unless @hide_icon %> | ||
<%= polaris_box(classes: "Polaris-Banner__InlineIcon") do %> | ||
<%= render_icon %> | ||
<% end %> | ||
<% end %> | ||
<%= polaris_box( | ||
padding: within_container? ? nil : "1", | ||
padding_block_start: (has_title? || within_container?) ? nil : "1_5", | ||
) do %> | ||
<%= polaris_vertical_stack(gap: "1") do %> | ||
<% if has_title? %> | ||
<%= polaris_text(as: :h2, variant: :headingSm, break_word: true) do %> | ||
<%= @title %> | ||
<% end %> | ||
<% end %> | ||
<% if has_content? %> | ||
<%= content_with_actions %> | ||
<% end %> | ||
<% end %> | ||
<% end %> | ||
<% end %> | ||
<% if dismiss_button %> | ||
<%= polaris_box(classes: "Polaris-Banner__DismissButton") do %> | ||
<%= dismiss_button %> | ||
<% end %> | ||
|
||
<% end %> | ||
<% end %> | ||
<% end %> | ||
|
||
<% end %> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.