-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add loading content parameter (#3074)
Co-authored-by: owenniblock <owenniblock@users.noreply.github.com> Co-authored-by: Cameron Dutro <camertron@gmail.com> Co-authored-by: camertron <camertron@users.noreply.github.com>
- Loading branch information
1 parent
bf44ee5
commit 25109d0
Showing
28 changed files
with
174 additions
and
1 deletion.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
'@primer/view-components': minor | ||
--- | ||
|
||
[SelectPanel] replace loading label using parameter loading_label | ||
[SelectPanel] show additional loading content with loading_description |
Binary file added
BIN
+16.4 KB
...test.ts-snapshots/primer/alpha/select_panel/custom_loading_description/dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+16.4 KB
...pshots/primer/alpha/select_panel/custom_loading_description/dark_colorblind.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+17.7 KB
...-snapshots/primer/alpha/select_panel/custom_loading_description/dark_dimmed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+15.8 KB
...ots/primer/alpha/select_panel/custom_loading_description/dark_high_contrast.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+26.8 KB
...t.ts-snapshots/primer/alpha/select_panel/custom_loading_description/default.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+26.8 KB
...t.ts-snapshots/primer/alpha/select_panel/custom_loading_description/focused.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+16.7 KB
...est.ts-snapshots/primer/alpha/select_panel/custom_loading_description/light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+16.7 KB
...shots/primer/alpha/select_panel/custom_loading_description/light_colorblind.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+16.7 KB
...ts/primer/alpha/select_panel/custom_loading_description/light_high_contrast.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+12.9 KB
...shots.test.ts-snapshots/primer/alpha/select_panel/custom_loading_label/dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+12.9 KB
...ts-snapshots/primer/alpha/select_panel/custom_loading_label/dark_colorblind.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+14.2 KB
...est.ts-snapshots/primer/alpha/select_panel/custom_loading_label/dark_dimmed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+12.4 KB
...snapshots/primer/alpha/select_panel/custom_loading_label/dark_high_contrast.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+26.8 KB
...ts.test.ts-snapshots/primer/alpha/select_panel/custom_loading_label/default.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+26.8 KB
...ts.test.ts-snapshots/primer/alpha/select_panel/custom_loading_label/focused.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+13.2 KB
...hots.test.ts-snapshots/primer/alpha/select_panel/custom_loading_label/light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+13.2 KB
...s-snapshots/primer/alpha/select_panel/custom_loading_label/light_colorblind.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+13.3 KB
...napshots/primer/alpha/select_panel/custom_loading_label/light_high_contrast.png
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
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
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
23 changes: 23 additions & 0 deletions
23
previews/primer/alpha/select_panel_preview/custom_loading_description.html.erb
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<% subject_id = SecureRandom.hex %> | ||
<%# We set src and fetch_strategy: :local here to make the loading spinner and description remain visible %> | ||
<%= render(Primer::Alpha::SelectPanel.new( | ||
id: "select-panel", | ||
data: { interaction_subject: subject_id }, | ||
src: select_panel_items_path( | ||
select_variant: :multiple, | ||
selected_items: selected_items, | ||
), | ||
select_variant: :multiple, | ||
fetch_strategy: :local, | ||
open_on_load: open_on_load, | ||
loading_label: "Custom loading content... please wait...", | ||
loading_description: "This is a custom loading description" | ||
)) do |panel| %> | ||
<% panel.with_show_button { "Sci-fi equipment" } %> | ||
<% panel.with_footer(show_divider: true) do %> | ||
I'm a footer! | ||
<% end %> | ||
<% end %> | ||
<%= render partial: "primer/alpha/select_panel_preview/interaction_subject_js", locals: { subject_id: subject_id } %> |
21 changes: 21 additions & 0 deletions
21
previews/primer/alpha/select_panel_preview/custom_loading_label.html.erb
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<% subject_id = SecureRandom.hex %> | ||
<%# We set src and fetch_strategy: :local here to make the loading spinner remain visible %> | ||
<%= render(Primer::Alpha::SelectPanel.new( | ||
data: { interaction_subject: subject_id }, | ||
src: select_panel_items_path( | ||
select_variant: :multiple, | ||
selected_items: selected_items, | ||
), | ||
select_variant: :multiple, | ||
fetch_strategy: :local, | ||
open_on_load: open_on_load, | ||
loading_label: "Custom loading content... please wait..." | ||
)) do |panel| %> | ||
<% panel.with_show_button { "Sci-fi equipment" } %> | ||
<% panel.with_footer(show_divider: true) do %> | ||
I'm a footer! | ||
<% end %> | ||
<% end %> | ||
<%= render partial: "primer/alpha/select_panel_preview/interaction_subject_js", locals: { subject_id: subject_id } %> |
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
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
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
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