openproject-primer_view_components 0.48.2 → 0.49.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +45 -0
- data/app/assets/javascripts/{app/components → components}/primer/primer.d.ts +3 -4
- data/app/assets/javascripts/primer_view_components.js +1 -1
- data/app/assets/javascripts/primer_view_components.js.map +1 -1
- data/app/assets/styles/primer_view_components.css +1 -1
- data/app/assets/styles/primer_view_components.css.map +1 -1
- data/app/components/primer/alpha/action_bar.css.map +1 -1
- data/app/components/primer/alpha/action_bar.pcss +7 -4
- data/app/components/primer/alpha/action_bar_element.js +0 -3
- data/app/components/primer/alpha/action_bar_element.ts +0 -4
- data/app/components/primer/alpha/action_list.css +1 -1
- data/app/components/primer/alpha/action_list.css.map +1 -1
- data/app/components/primer/alpha/action_list.pcss +25 -8
- data/app/components/primer/alpha/action_list.rb +1 -1
- data/app/components/primer/alpha/auto_complete.css +1 -1
- data/app/components/primer/alpha/auto_complete.css.map +1 -1
- data/app/components/primer/alpha/auto_complete.pcss +7 -7
- data/app/components/primer/alpha/banner.css +1 -1
- data/app/components/primer/alpha/banner.css.map +1 -1
- data/app/components/primer/alpha/banner.pcss +6 -2
- data/app/components/primer/alpha/button_marketing.css.map +1 -1
- data/app/components/primer/alpha/button_marketing.pcss +11 -4
- data/app/components/primer/alpha/dialog.css +1 -1
- data/app/components/primer/alpha/dialog.css.json +2 -1
- data/app/components/primer/alpha/dialog.css.map +1 -1
- data/app/components/primer/alpha/dialog.pcss +39 -13
- data/app/components/primer/alpha/dialog.rb +5 -1
- data/app/components/primer/alpha/dropdown.css +1 -1
- data/app/components/primer/alpha/dropdown.css.map +1 -1
- data/app/components/primer/alpha/dropdown.pcss +45 -11
- data/app/components/primer/alpha/layout.css.map +1 -1
- data/app/components/primer/alpha/layout.pcss +3 -2
- data/app/components/primer/alpha/menu.css.map +1 -1
- data/app/components/primer/alpha/menu.pcss +7 -0
- data/app/components/primer/alpha/overlay.css.map +1 -1
- data/app/components/primer/alpha/overlay.pcss +3 -3
- data/app/components/primer/alpha/segmented_control.css.map +1 -1
- data/app/components/primer/alpha/segmented_control.pcss +15 -8
- data/app/components/primer/alpha/select_panel.html.erb +8 -5
- data/app/components/primer/alpha/select_panel.rb +26 -1
- data/app/components/primer/alpha/select_panel_element.js +9 -3
- data/app/components/primer/alpha/select_panel_element.ts +10 -4
- data/app/components/primer/alpha/stack.css +1 -0
- data/app/components/primer/alpha/stack.css.json +90 -0
- data/app/components/primer/alpha/stack.css.map +1 -0
- data/app/components/primer/alpha/stack.html.erb +3 -0
- data/app/components/primer/alpha/stack.pcss +297 -0
- data/app/components/primer/alpha/stack.rb +185 -0
- data/app/components/primer/alpha/stack_item.css +1 -0
- data/app/components/primer/alpha/stack_item.css.json +12 -0
- data/app/components/primer/alpha/stack_item.css.map +1 -0
- data/app/components/primer/alpha/stack_item.html.erb +3 -0
- data/app/components/primer/alpha/stack_item.pcss +31 -0
- data/app/components/primer/alpha/stack_item.rb +54 -0
- data/app/components/primer/alpha/tab_nav.css +1 -1
- data/app/components/primer/alpha/tab_nav.css.map +1 -1
- data/app/components/primer/alpha/tab_nav.pcss +12 -3
- data/app/components/primer/alpha/text_field.css +1 -1
- data/app/components/primer/alpha/text_field.css.map +1 -1
- data/app/components/primer/alpha/text_field.pcss +29 -22
- data/app/components/primer/alpha/toggle_switch.css +1 -1
- data/app/components/primer/alpha/toggle_switch.css.map +1 -1
- data/app/components/primer/alpha/toggle_switch.pcss +6 -3
- data/app/components/primer/alpha/underline_nav.css +1 -1
- data/app/components/primer/alpha/underline_nav.css.map +1 -1
- data/app/components/primer/alpha/underline_nav.pcss +8 -2
- data/app/components/primer/base_component.rb +1 -1
- data/app/components/primer/beta/avatar.css +1 -1
- data/app/components/primer/beta/avatar.css.map +1 -1
- data/app/components/primer/beta/avatar.pcss +4 -1
- data/app/components/primer/beta/avatar_stack.css +1 -1
- data/app/components/primer/beta/avatar_stack.css.map +1 -1
- data/app/components/primer/beta/avatar_stack.pcss +9 -2
- data/app/components/primer/beta/blankslate.css +1 -1
- data/app/components/primer/beta/blankslate.css.map +1 -1
- data/app/components/primer/beta/blankslate.pcss +24 -3
- data/app/components/primer/beta/border_box.css +1 -1
- data/app/components/primer/beta/border_box.css.map +1 -1
- data/app/components/primer/beta/border_box.pcss +8 -4
- data/app/components/primer/beta/breadcrumbs.css.map +1 -1
- data/app/components/primer/beta/breadcrumbs.pcss +5 -1
- data/app/components/primer/beta/button.css +1 -1
- data/app/components/primer/beta/button.css.map +1 -1
- data/app/components/primer/beta/button.pcss +31 -27
- data/app/components/primer/beta/button_group.css.map +1 -1
- data/app/components/primer/beta/button_group.pcss +1 -0
- data/app/components/primer/beta/counter.css +1 -1
- data/app/components/primer/beta/counter.css.map +1 -1
- data/app/components/primer/beta/counter.pcss +3 -1
- data/app/components/primer/beta/flash.css.map +1 -1
- data/app/components/primer/beta/flash.pcss +7 -4
- data/app/components/primer/beta/label.css.map +1 -1
- data/app/components/primer/beta/label.pcss +4 -0
- data/app/components/primer/beta/popover.css +1 -1
- data/app/components/primer/beta/popover.css.map +1 -1
- data/app/components/primer/beta/popover.pcss +15 -7
- data/app/components/primer/beta/progress_bar.css +1 -1
- data/app/components/primer/beta/progress_bar.css.map +1 -1
- data/app/components/primer/beta/progress_bar.pcss +2 -2
- data/app/components/primer/beta/state.css +1 -1
- data/app/components/primer/beta/state.css.map +1 -1
- data/app/components/primer/beta/state.pcss +6 -1
- data/app/components/primer/beta/subhead.css.map +1 -1
- data/app/components/primer/beta/subhead.pcss +3 -0
- data/app/components/primer/beta/timeline_item.css.map +1 -1
- data/app/components/primer/beta/timeline_item.pcss +11 -0
- data/app/components/primer/beta/truncate.css.map +1 -1
- data/app/components/primer/beta/truncate.pcss +1 -0
- data/app/components/primer/dialog_helper.js +0 -1
- data/app/components/primer/dialog_helper.ts +0 -1
- data/app/components/primer/primer.d.ts +3 -4
- data/app/components/primer/primer.js +3 -4
- data/app/components/primer/primer.pcss +6 -4
- data/app/components/primer/primer.ts +3 -4
- data/app/components/primer/responsive_arg.rb +66 -0
- data/app/forms/caption_template_form/places_bellevue_caption.html.erb +1 -0
- data/app/forms/caption_template_form/places_lopez_caption.html.erb +1 -0
- data/app/forms/caption_template_form/places_seattle_caption.html.erb +1 -0
- data/app/forms/caption_template_form.rb +6 -0
- data/app/forms/check_box_group_form.rb +1 -1
- data/app/forms/radio_button_group_form.rb +5 -1
- data/app/lib/primer/attributes_helper.rb +1 -1
- data/{lib → app/lib}/primer/forms/base_component.rb +0 -8
- data/{lib → app/lib}/primer/forms/button.rb +5 -2
- data/{lib → app/lib}/primer/forms/check_box_group.html.erb +3 -3
- data/{lib → app/lib}/primer/forms/check_box_group.rb +1 -1
- data/{lib → app/lib}/primer/forms/dsl/check_box_input.rb +4 -8
- data/{lib → app/lib}/primer/forms/dsl/input.rb +13 -1
- data/{lib → app/lib}/primer/forms/dsl/radio_button_input.rb +4 -0
- data/{lib → app/lib}/primer/forms/group.html.erb +1 -1
- data/{lib → app/lib}/primer/forms/group.rb +5 -0
- data/{lib → app/lib}/primer/forms/radio_button_group.html.erb +3 -3
- data/{lib → app/lib}/primer/forms/radio_button_group.rb +1 -1
- data/{lib → app/lib}/primer/forms/select.html.erb +0 -1
- data/lib/primer/view_components/linters/details_menu_migration.rb +3 -2
- data/lib/primer/view_components/version.rb +2 -2
- data/lib/primer/yard/component_manifest.rb +0 -1
- data/previews/primer/alpha/action_bar_preview/inline.html.erb +1 -1
- data/previews/primer/alpha/dialog_preview/autofocus_element.html.erb +1 -1
- data/previews/primer/alpha/dialog_preview/custom_header.html.erb +3 -1
- data/previews/primer/alpha/dialog_preview/dialog_inside_overlay.html.erb +4 -4
- data/previews/primer/alpha/dialog_preview/nested_dialog.html.erb +1 -1
- data/previews/primer/alpha/dialog_preview/scroll_container.html.erb +11 -2
- data/previews/primer/alpha/dialog_preview/with_footer.html.erb +2 -2
- data/previews/primer/alpha/dialog_preview/with_form.html.erb +2 -2
- data/previews/primer/alpha/dialog_preview/with_text_input.html.erb +1 -1
- data/previews/primer/alpha/dialog_preview.rb +4 -2
- data/previews/primer/alpha/overlay_preview/in_a_sticky_container.html.erb +1 -1
- data/previews/primer/alpha/overlay_preview/overlay_with_header_filter.html.erb +1 -1
- data/previews/primer/alpha/select_panel_preview/_interaction_subject_js.html.erb +1 -1
- data/previews/primer/alpha/select_panel_preview/custom_loading_description.html.erb +23 -0
- data/previews/primer/alpha/select_panel_preview/custom_loading_label.html.erb +21 -0
- data/previews/primer/alpha/select_panel_preview/remote_fetch_filter_failure.html.erb +4 -2
- data/previews/primer/alpha/select_panel_preview/scroll_container.html.erb +49 -0
- data/previews/primer/alpha/select_panel_preview.rb +40 -2
- data/previews/primer/alpha/stack_item_preview/default.html.erb +5 -0
- data/previews/primer/alpha/stack_item_preview/playground.html.erb +11 -0
- data/previews/primer/alpha/stack_item_preview.rb +40 -0
- data/previews/primer/alpha/stack_preview/playground.html.erb +5 -0
- data/previews/primer/alpha/stack_preview.rb +88 -0
- data/previews/primer/alpha/text_field_preview/input_group_leading_action_menu.html.erb +1 -2
- data/previews/primer/alpha/tooltip_preview/tooltip_inside_primer_overlay.html.erb +2 -2
- data/previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb +1 -1
- data/previews/primer/alpha/underline_nav_preview/default.html.erb +1 -1
- data/previews/primer/alpha/underline_nav_preview/playground.html.erb +1 -1
- data/previews/primer/beta/auto_complete_preview/with_submit_button.html.erb +18 -18
- data/previews/primer/beta/breadcrumbs_preview/with_deprecated_truncate.html.erb +3 -1
- data/previews/primer/beta/button_preview/summary_as_button.html.erb +0 -1
- data/previews/primer/beta/subhead_preview/actions.html.erb +0 -1
- data/previews/primer/open_project/feedback_dialog_preview/additional_content.html.erb +1 -1
- data/previews/primer/open_project/feedback_dialog_preview/custom_footer.html.erb +1 -1
- data/previews/primer/open_project/feedback_dialog_preview/playground.html.erb +2 -2
- data/previews/primer/open_project/page_header_preview/actions.html.erb +1 -1
- data/previews/primer/open_project/page_header_preview/playground.html.erb +2 -2
- data/previews/primer/open_project/sub_header_preview/action_menu_buttons.html.erb +1 -1
- data/static/arguments.json +112 -30
- data/static/audited_at.json +2 -1
- data/static/classes.json +6 -0
- data/static/constants.json +172 -9
- data/static/info_arch.json +248 -98
- data/static/previews.json +107 -47
- data/static/statuses.json +2 -1
- metadata +137 -120
- data/app/assets/javascripts/app/components/primer/alpha/image_crop.d.ts +0 -1
- data/app/components/primer/alpha/image_crop.d.ts +0 -1
- data/app/components/primer/alpha/image_crop.html.erb +0 -12
- data/app/components/primer/alpha/image_crop.js +0 -1
- data/app/components/primer/alpha/image_crop.rb +0 -28
- data/app/components/primer/alpha/image_crop.ts +0 -1
- data/previews/primer/alpha/image_crop_preview.rb +0 -31
- /data/app/assets/javascripts/{app/components → components}/primer/alpha/action_bar_element.d.ts +0 -0
- /data/app/assets/javascripts/{app/components → components}/primer/alpha/action_list.d.ts +0 -0
- /data/app/assets/javascripts/{app/components → components}/primer/alpha/action_menu/action_menu_element.d.ts +0 -0
- /data/app/assets/javascripts/{app/components → components}/primer/alpha/dropdown/menu.d.ts +0 -0
- /data/app/assets/javascripts/{app/components → components}/primer/alpha/dropdown.d.ts +0 -0
- /data/app/assets/javascripts/{app/components → components}/primer/alpha/modal_dialog.d.ts +0 -0
- /data/app/assets/javascripts/{app/components → components}/primer/alpha/segmented_control.d.ts +0 -0
- /data/app/assets/javascripts/{app/components → components}/primer/alpha/select_panel_element.d.ts +0 -0
- /data/app/assets/javascripts/{app/components → components}/primer/alpha/tab_container.d.ts +0 -0
- /data/app/assets/javascripts/{app/components → components}/primer/alpha/toggle_switch.d.ts +0 -0
- /data/app/assets/javascripts/{app/components → components}/primer/alpha/tool_tip.d.ts +0 -0
- /data/app/assets/javascripts/{app/components → components}/primer/alpha/x_banner.d.ts +0 -0
- /data/app/assets/javascripts/{app/components → components}/primer/anchored_position.d.ts +0 -0
- /data/app/assets/javascripts/{app/components → components}/primer/aria_live.d.ts +0 -0
- /data/app/assets/javascripts/{app/components → components}/primer/beta/auto_complete/auto_complete.d.ts +0 -0
- /data/app/assets/javascripts/{app/components → components}/primer/beta/clipboard_copy.d.ts +0 -0
- /data/app/assets/javascripts/{app/components → components}/primer/beta/nav_list.d.ts +0 -0
- /data/app/assets/javascripts/{app/components → components}/primer/beta/nav_list_group_element.d.ts +0 -0
- /data/app/assets/javascripts/{app/components → components}/primer/beta/relative_time.d.ts +0 -0
- /data/app/assets/javascripts/{app/components → components}/primer/dialog_helper.d.ts +0 -0
- /data/app/assets/javascripts/{app/components → components}/primer/focus_group.d.ts +0 -0
- /data/app/assets/javascripts/{app/components → components}/primer/open_project/page_header_element.d.ts +0 -0
- /data/app/assets/javascripts/{app/components → components}/primer/open_project/sub_header_element.d.ts +0 -0
- /data/app/assets/javascripts/{app/components → components}/primer/open_project/zen_mode_button.d.ts +0 -0
- /data/app/assets/javascripts/{app/components → components}/primer/scrollable_region.d.ts +0 -0
- /data/app/assets/javascripts/{app/components → components}/primer/shared_events.d.ts +0 -0
- /data/{lib → app/lib}/primer/forms/action_menu.html.erb +0 -0
- /data/{lib → app/lib}/primer/forms/action_menu.rb +0 -0
- /data/{lib → app/lib}/primer/forms/acts_as_component.rb +0 -0
- /data/{lib → app/lib}/primer/forms/auto_complete.html.erb +0 -0
- /data/{lib → app/lib}/primer/forms/auto_complete.rb +0 -0
- /data/{lib → app/lib}/primer/forms/base.html.erb +0 -0
- /data/{lib → app/lib}/primer/forms/base.rb +0 -0
- /data/{lib → app/lib}/primer/forms/buffer_rewriter.rb +0 -0
- /data/{lib → app/lib}/primer/forms/builder.rb +0 -0
- /data/{lib → app/lib}/primer/forms/button.html.erb +0 -0
- /data/{lib → app/lib}/primer/forms/caption.html.erb +0 -0
- /data/{lib → app/lib}/primer/forms/caption.rb +0 -0
- /data/{lib → app/lib}/primer/forms/check_box.html.erb +0 -0
- /data/{lib → app/lib}/primer/forms/check_box.rb +0 -0
- /data/{lib → app/lib}/primer/forms/dsl/action_menu_input.rb +0 -0
- /data/{lib → app/lib}/primer/forms/dsl/auto_complete_input.rb +0 -0
- /data/{lib → app/lib}/primer/forms/dsl/button_input.rb +0 -0
- /data/{lib → app/lib}/primer/forms/dsl/check_box_group_input.rb +0 -0
- /data/{lib → app/lib}/primer/forms/dsl/form_object.rb +0 -0
- /data/{lib → app/lib}/primer/forms/dsl/form_reference_input.rb +0 -0
- /data/{lib → app/lib}/primer/forms/dsl/hidden_input.rb +0 -0
- /data/{lib → app/lib}/primer/forms/dsl/input_group.rb +0 -0
- /data/{lib → app/lib}/primer/forms/dsl/input_methods.rb +0 -0
- /data/{lib → app/lib}/primer/forms/dsl/multi_input.rb +0 -0
- /data/{lib → app/lib}/primer/forms/dsl/radio_button_group_input.rb +0 -0
- /data/{lib → app/lib}/primer/forms/dsl/select_input.rb +0 -0
- /data/{lib → app/lib}/primer/forms/dsl/submit_button_input.rb +0 -0
- /data/{lib → app/lib}/primer/forms/dsl/text_area_input.rb +0 -0
- /data/{lib → app/lib}/primer/forms/dsl/text_field_input.rb +0 -0
- /data/{lib → app/lib}/primer/forms/dsl/toggle_switch_input.rb +0 -0
- /data/{lib → app/lib}/primer/forms/form_control.html.erb +0 -0
- /data/{lib → app/lib}/primer/forms/form_control.rb +0 -0
- /data/{lib → app/lib}/primer/forms/form_list.html.erb +0 -0
- /data/{lib → app/lib}/primer/forms/form_list.rb +0 -0
- /data/{lib → app/lib}/primer/forms/form_reference.html.erb +0 -0
- /data/{lib → app/lib}/primer/forms/form_reference.rb +0 -0
- /data/{lib → app/lib}/primer/forms/hidden_field.html.erb +0 -0
- /data/{lib → app/lib}/primer/forms/hidden_field.rb +0 -0
- /data/{lib → app/lib}/primer/forms/multi.html.erb +0 -0
- /data/{lib → app/lib}/primer/forms/multi.rb +0 -0
- /data/{lib → app/lib}/primer/forms/primer_base_component_wrapper.html.erb +0 -0
- /data/{lib → app/lib}/primer/forms/primer_base_component_wrapper.rb +0 -0
- /data/{lib → app/lib}/primer/forms/primer_multi_input.d.ts +0 -0
- /data/{lib → app/lib}/primer/forms/primer_multi_input.js +0 -0
- /data/{lib → app/lib}/primer/forms/primer_multi_input.ts +0 -0
- /data/{lib → app/lib}/primer/forms/primer_text_field.d.ts +0 -0
- /data/{lib → app/lib}/primer/forms/primer_text_field.js +0 -0
- /data/{lib → app/lib}/primer/forms/primer_text_field.ts +0 -0
- /data/{lib → app/lib}/primer/forms/radio_button.html.erb +0 -0
- /data/{lib → app/lib}/primer/forms/radio_button.rb +0 -0
- /data/{lib → app/lib}/primer/forms/select.rb +0 -0
- /data/{lib → app/lib}/primer/forms/separator.html.erb +0 -0
- /data/{lib → app/lib}/primer/forms/separator.rb +0 -0
- /data/{lib → app/lib}/primer/forms/spacing_wrapper.html.erb +0 -0
- /data/{lib → app/lib}/primer/forms/spacing_wrapper.rb +0 -0
- /data/{lib → app/lib}/primer/forms/submit_button.html.erb +0 -0
- /data/{lib → app/lib}/primer/forms/submit_button.rb +0 -0
- /data/{lib → app/lib}/primer/forms/text_area.html.erb +0 -0
- /data/{lib → app/lib}/primer/forms/text_area.rb +0 -0
- /data/{lib → app/lib}/primer/forms/text_field.html.erb +0 -0
- /data/{lib → app/lib}/primer/forms/text_field.rb +0 -0
- /data/{lib → app/lib}/primer/forms/toggle_switch.html.erb +0 -0
- /data/{lib → app/lib}/primer/forms/toggle_switch.rb +0 -0
- /data/{lib → app/lib}/primer/forms/toggle_switch_form.rb +0 -0
- /data/{lib → app/lib}/primer/forms/toggle_switch_input.d.ts +0 -0
- /data/{lib → app/lib}/primer/forms/toggle_switch_input.js +0 -0
- /data/{lib → app/lib}/primer/forms/toggle_switch_input.ts +0 -0
- /data/{lib → app/lib}/primer/forms/utils.rb +0 -0
- /data/{lib → app/lib}/primer/forms/validation_message.html.erb +0 -0
- /data/{lib → app/lib}/primer/forms/validation_message.rb +0 -0
- /data/{lib → app/lib}/primer/forms.rb +0 -0
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
<form>
|
7
7
|
<label for="dialog-text-input-example">Example input</label>
|
8
|
-
<input id="dialog-text-input-example" type="text" value="Some text goes in here">
|
8
|
+
<input id="dialog-text-input-example" type="text" value="Some text goes in here" autocomplete="off">
|
9
9
|
</form>
|
10
10
|
<% end %>
|
11
11
|
<% end %>
|
@@ -235,8 +235,9 @@ module Primer
|
|
235
235
|
# @param visually_hide_title [Boolean] toggle
|
236
236
|
# @param button_text [String] text
|
237
237
|
# @param body_text [String] text
|
238
|
+
# @param disable_scroll [Boolean] toggle
|
238
239
|
# @snapshot interactive
|
239
|
-
def scroll_container(title: "Test Dialog", subtitle: nil, position: :center, size: :medium, button_text: "Show Dialog", body_text: "Content", position_narrow: :fullscreen, visually_hide_title: false)
|
240
|
+
def scroll_container(title: "Test Dialog", subtitle: nil, position: :center, size: :medium, button_text: "Show Dialog", body_text: "Content", position_narrow: :fullscreen, visually_hide_title: false, disable_scroll: true)
|
240
241
|
render_with_template(locals: {
|
241
242
|
title: title,
|
242
243
|
subtitle: subtitle,
|
@@ -245,7 +246,8 @@ module Primer
|
|
245
246
|
button_text: button_text,
|
246
247
|
body_text: body_text,
|
247
248
|
position_narrow: position_narrow,
|
248
|
-
visually_hide_title: visually_hide_title
|
249
|
+
visually_hide_title: visually_hide_title,
|
250
|
+
disable_scroll: disable_scroll
|
249
251
|
})
|
250
252
|
end
|
251
253
|
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<% subject_id = SecureRandom.hex %>
|
2
|
+
|
3
|
+
<%# We set src and fetch_strategy: :local here to make the loading spinner and description remain visible %>
|
4
|
+
<%= render(Primer::Alpha::SelectPanel.new(
|
5
|
+
id: "select-panel",
|
6
|
+
data: { interaction_subject: subject_id },
|
7
|
+
src: select_panel_items_path(
|
8
|
+
select_variant: :multiple,
|
9
|
+
selected_items: selected_items,
|
10
|
+
),
|
11
|
+
select_variant: :multiple,
|
12
|
+
fetch_strategy: :local,
|
13
|
+
open_on_load: open_on_load,
|
14
|
+
loading_label: "Custom loading content... please wait...",
|
15
|
+
loading_description: "This is a custom loading description"
|
16
|
+
)) do |panel| %>
|
17
|
+
<% panel.with_show_button { "Sci-fi equipment" } %>
|
18
|
+
<% panel.with_footer(show_divider: true) do %>
|
19
|
+
I'm a footer!
|
20
|
+
<% end %>
|
21
|
+
<% end %>
|
22
|
+
|
23
|
+
<%= render partial: "primer/alpha/select_panel_preview/interaction_subject_js", locals: { subject_id: subject_id } %>
|
@@ -0,0 +1,21 @@
|
|
1
|
+
<% subject_id = SecureRandom.hex %>
|
2
|
+
|
3
|
+
<%# We set src and fetch_strategy: :local here to make the loading spinner remain visible %>
|
4
|
+
<%= render(Primer::Alpha::SelectPanel.new(
|
5
|
+
data: { interaction_subject: subject_id },
|
6
|
+
src: select_panel_items_path(
|
7
|
+
select_variant: :multiple,
|
8
|
+
selected_items: selected_items,
|
9
|
+
),
|
10
|
+
select_variant: :multiple,
|
11
|
+
fetch_strategy: :local,
|
12
|
+
open_on_load: open_on_load,
|
13
|
+
loading_label: "Custom loading content... please wait..."
|
14
|
+
)) do |panel| %>
|
15
|
+
<% panel.with_show_button { "Sci-fi equipment" } %>
|
16
|
+
<% panel.with_footer(show_divider: true) do %>
|
17
|
+
I'm a footer!
|
18
|
+
<% end %>
|
19
|
+
<% end %>
|
20
|
+
|
21
|
+
<%= render partial: "primer/alpha/select_panel_preview/interaction_subject_js", locals: { subject_id: subject_id } %>
|
@@ -3,9 +3,11 @@
|
|
3
3
|
<%= render(Primer::Alpha::SelectPanel.new(
|
4
4
|
data: { interaction_subject: subject_id },
|
5
5
|
# passing a uuid here causes the request to succeed the first time and fail all subsequent times
|
6
|
-
|
6
|
+
# set show_results to false to simulate an initial load with no items
|
7
|
+
src: select_panel_items_path(show_results: show_results.to_s, fail: "true", uuid: SecureRandom.uuid),
|
7
8
|
fetch_strategy: :remote,
|
8
|
-
open_on_load: open_on_load
|
9
|
+
open_on_load: open_on_load,
|
10
|
+
**system_arguments
|
9
11
|
)) do |panel| %>
|
10
12
|
<% panel.with_show_button { "Sci-fi equipment" } %>
|
11
13
|
<% end %>
|
@@ -0,0 +1,49 @@
|
|
1
|
+
<% subject_id = SecureRandom.hex %>
|
2
|
+
|
3
|
+
<%= render(Primer::Alpha::SelectPanel.new(
|
4
|
+
data: { interaction_subject: subject_id },
|
5
|
+
fetch_strategy: :local,
|
6
|
+
open_on_load: open_on_load,
|
7
|
+
)) do |panel| %>
|
8
|
+
<% panel.with_show_button { "Panel" } %>
|
9
|
+
<% panel.with_item(label: "Item 1") %>
|
10
|
+
<% panel.with_item(label: "Item 2") %>
|
11
|
+
<% panel.with_item(label: "Item 3") %>
|
12
|
+
<% panel.with_item(label: "Item 4") %>
|
13
|
+
<% panel.with_footer(show_divider: true) do %>
|
14
|
+
I'm a footer!
|
15
|
+
<% end %>
|
16
|
+
<% end %>
|
17
|
+
|
18
|
+
<%= render partial: "primer/alpha/select_panel_preview/interaction_subject_js", locals: { subject_id: subject_id } %>
|
19
|
+
|
20
|
+
<!-- just some lorem ipsum -->
|
21
|
+
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut etiam sit amet nisl purus in. Amet risus nullam eget felis. Consectetur adipiscing elit ut aliquam purus sit amet luctus. Non quam lacus suspendisse faucibus interdum. Tempus iaculis urna id volutpat lacus laoreet non curabitur. Ipsum nunc aliquet bibendum enim facilisis gravida. Egestas pretium aenean pharetra magna. Amet mattis vulputate enim nulla aliquet. Diam vel quam elementum pulvinar etiam non. Tempor orci eu lobortis elementum. Arcu non odio euismod lacinia at quis risus sed.</p>
|
22
|
+
|
23
|
+
<p>Aenean pharetra magna ac placerat vestibulum lectus mauris. Aenean euismod elementum nisi quis eleifend quam. Duis at tellus at urna condimentum. Tortor dignissim convallis aenean et tortor. Eget nullam non nisi est sit amet facilisis magna. Fermentum et sollicitudin ac orci phasellus egestas tellus. Ac turpis egestas maecenas pharetra convallis posuere morbi leo urna. In nisl nisi scelerisque eu. A erat nam at lectus. Dolor magna eget est lorem. Volutpat diam ut venenatis tellus in metus vulputate eu scelerisque. Eros donec ac odio tempor orci dapibus ultrices in iaculis. Aenean et tortor at risus. Suspendisse sed nisi lacus sed viverra tellus in. Arcu felis bibendum ut tristique et.</p>
|
24
|
+
|
25
|
+
<p>At ultrices mi tempus imperdiet nulla malesuada pellentesque elit. Nisl suscipit adipiscing bibendum est ultricies integer quis. Nec sagittis aliquam malesuada bibendum arcu vitae elementum curabitur. Malesuada fames ac turpis egestas maecenas. Fames ac turpis egestas sed tempus urna et pharetra. Vitae elementum curabitur vitae nunc sed velit dignissim sodales ut. Nisi lacus sed viverra tellus in hac habitasse platea. Arcu non odio euismod lacinia at quis risus sed vulputate. Ac placerat vestibulum lectus mauris ultrices eros. Magna sit amet purus gravida quis blandit turpis. Arcu felis bibendum ut tristique. Egestas congue quisque egestas diam in arcu cursus. Pretium aenean pharetra magna ac placerat. Diam maecenas sed enim ut sem viverra. Egestas sed sed risus pretium quam vulputate dignissim suspendisse. Tincidunt id aliquet risus feugiat in. A cras semper auctor neque vitae tempus. Eu lobortis elementum nibh tellus molestie. Neque ornare aenean euismod elementum nisi quis eleifend.</p>
|
26
|
+
|
27
|
+
<p>Sed nisi lacus sed viverra tellus in. Nisl condimentum id venenatis a condimentum vitae. Integer malesuada nunc vel risus commodo viverra maecenas accumsan. Magnis dis parturient montes nascetur ridiculus mus mauris vitae ultricies. Nulla facilisi cras fermentum odio eu. Adipiscing elit pellentesque habitant morbi tristique senectus. Urna condimentum mattis pellentesque id. Arcu cursus euismod quis viverra nibh cras pulvinar. Elementum integer enim neque volutpat ac. Euismod nisi porta lorem mollis aliquam ut porttitor. Mauris nunc congue nisi vitae suscipit tellus mauris a. Volutpat blandit aliquam etiam erat velit. Risus sed vulputate odio ut. Ut sem nulla pharetra diam. Turpis massa sed elementum tempus egestas sed sed risus pretium. Cras sed felis eget velit aliquet sagittis. Imperdiet massa tincidunt nunc pulvinar sapien et ligula. Rhoncus est pellentesque elit ullamcorper dignissim cras tincidunt lobortis feugiat.</p>
|
28
|
+
|
29
|
+
<p>Eget felis eget nunc lobortis mattis aliquam faucibus. Enim nunc faucibus a pellentesque sit amet. Luctus accumsan tortor posuere ac ut consequat. Sed euismod nisi porta lorem mollis aliquam ut porttitor leo. Tincidunt tortor aliquam nulla facilisi cras fermentum odio. Lobortis elementum nibh tellus molestie nunc non blandit. Luctus accumsan tortor posuere ac ut consequat semper. Etiam tempor orci eu lobortis elementum. Posuere ac ut consequat semper. Feugiat nisl pretium fusce id velit ut tortor pretium viverra. Aliquam id diam maecenas ultricies mi eget mauris pharetra. Maecenas ultricies mi eget mauris pharetra et. Sodales ut eu sem integer vitae justo eget magna fermentum. Ac placerat vestibulum lectus mauris ultrices eros in cursus. Eu non diam phasellus vestibulum lorem sed risus. Facilisi nullam vehicula ipsum a arcu cursus vitae congue mauris. Mauris pharetra et ultrices neque ornare. Aliquam ultrices sagittis orci a. Diam maecenas ultricies mi eget mauris pharetra. Molestie ac feugiat sed lectus vestibulum mattis ullamcorper velit sed.</p>
|
30
|
+
|
31
|
+
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut etiam sit amet nisl purus in. Amet risus nullam eget felis. Consectetur adipiscing elit ut aliquam purus sit amet luctus. Non quam lacus suspendisse faucibus interdum. Tempus iaculis urna id volutpat lacus laoreet non curabitur. Ipsum nunc aliquet bibendum enim facilisis gravida. Egestas pretium aenean pharetra magna. Amet mattis vulputate enim nulla aliquet. Diam vel quam elementum pulvinar etiam non. Tempor orci eu lobortis elementum. Arcu non odio euismod lacinia at quis risus sed.</p>
|
32
|
+
|
33
|
+
<p>Aenean pharetra magna ac placerat vestibulum lectus mauris. Aenean euismod elementum nisi quis eleifend quam. Duis at tellus at urna condimentum. Tortor dignissim convallis aenean et tortor. Eget nullam non nisi est sit amet facilisis magna. Fermentum et sollicitudin ac orci phasellus egestas tellus. Ac turpis egestas maecenas pharetra convallis posuere morbi leo urna. In nisl nisi scelerisque eu. A erat nam at lectus. Dolor magna eget est lorem. Volutpat diam ut venenatis tellus in metus vulputate eu scelerisque. Eros donec ac odio tempor orci dapibus ultrices in iaculis. Aenean et tortor at risus. Suspendisse sed nisi lacus sed viverra tellus in. Arcu felis bibendum ut tristique et.</p>
|
34
|
+
|
35
|
+
<p>At ultrices mi tempus imperdiet nulla malesuada pellentesque elit. Nisl suscipit adipiscing bibendum est ultricies integer quis. Nec sagittis aliquam malesuada bibendum arcu vitae elementum curabitur. Malesuada fames ac turpis egestas maecenas. Fames ac turpis egestas sed tempus urna et pharetra. Vitae elementum curabitur vitae nunc sed velit dignissim sodales ut. Nisi lacus sed viverra tellus in hac habitasse platea. Arcu non odio euismod lacinia at quis risus sed vulputate. Ac placerat vestibulum lectus mauris ultrices eros. Magna sit amet purus gravida quis blandit turpis. Arcu felis bibendum ut tristique. Egestas congue quisque egestas diam in arcu cursus. Pretium aenean pharetra magna ac placerat. Diam maecenas sed enim ut sem viverra. Egestas sed sed risus pretium quam vulputate dignissim suspendisse. Tincidunt id aliquet risus feugiat in. A cras semper auctor neque vitae tempus. Eu lobortis elementum nibh tellus molestie. Neque ornare aenean euismod elementum nisi quis eleifend.</p>
|
36
|
+
|
37
|
+
<p>Sed nisi lacus sed viverra tellus in. Nisl condimentum id venenatis a condimentum vitae. Integer malesuada nunc vel risus commodo viverra maecenas accumsan. Magnis dis parturient montes nascetur ridiculus mus mauris vitae ultricies. Nulla facilisi cras fermentum odio eu. Adipiscing elit pellentesque habitant morbi tristique senectus. Urna condimentum mattis pellentesque id. Arcu cursus euismod quis viverra nibh cras pulvinar. Elementum integer enim neque volutpat ac. Euismod nisi porta lorem mollis aliquam ut porttitor. Mauris nunc congue nisi vitae suscipit tellus mauris a. Volutpat blandit aliquam etiam erat velit. Risus sed vulputate odio ut. Ut sem nulla pharetra diam. Turpis massa sed elementum tempus egestas sed sed risus pretium. Cras sed felis eget velit aliquet sagittis. Imperdiet massa tincidunt nunc pulvinar sapien et ligula. Rhoncus est pellentesque elit ullamcorper dignissim cras tincidunt lobortis feugiat.</p>
|
38
|
+
|
39
|
+
<p>Eget felis eget nunc lobortis mattis aliquam faucibus. Enim nunc faucibus a pellentesque sit amet. Luctus accumsan tortor posuere ac ut consequat. Sed euismod nisi porta lorem mollis aliquam ut porttitor leo. Tincidunt tortor aliquam nulla facilisi cras fermentum odio. Lobortis elementum nibh tellus molestie nunc non blandit. Luctus accumsan tortor posuere ac ut consequat semper. Etiam tempor orci eu lobortis elementum. Posuere ac ut consequat semper. Feugiat nisl pretium fusce id velit ut tortor pretium viverra. Aliquam id diam maecenas ultricies mi eget mauris pharetra. Maecenas ultricies mi eget mauris pharetra et. Sodales ut eu sem integer vitae justo eget magna fermentum. Ac placerat vestibulum lectus mauris ultrices eros in cursus. Eu non diam phasellus vestibulum lorem sed risus. Facilisi nullam vehicula ipsum a arcu cursus vitae congue mauris. Mauris pharetra et ultrices neque ornare. Aliquam ultrices sagittis orci a. Diam maecenas ultricies mi eget mauris pharetra. Molestie ac feugiat sed lectus vestibulum mattis ullamcorper velit sed.</p>
|
40
|
+
|
41
|
+
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut etiam sit amet nisl purus in. Amet risus nullam eget felis. Consectetur adipiscing elit ut aliquam purus sit amet luctus. Non quam lacus suspendisse faucibus interdum. Tempus iaculis urna id volutpat lacus laoreet non curabitur. Ipsum nunc aliquet bibendum enim facilisis gravida. Egestas pretium aenean pharetra magna. Amet mattis vulputate enim nulla aliquet. Diam vel quam elementum pulvinar etiam non. Tempor orci eu lobortis elementum. Arcu non odio euismod lacinia at quis risus sed.</p>
|
42
|
+
|
43
|
+
<p>Aenean pharetra magna ac placerat vestibulum lectus mauris. Aenean euismod elementum nisi quis eleifend quam. Duis at tellus at urna condimentum. Tortor dignissim convallis aenean et tortor. Eget nullam non nisi est sit amet facilisis magna. Fermentum et sollicitudin ac orci phasellus egestas tellus. Ac turpis egestas maecenas pharetra convallis posuere morbi leo urna. In nisl nisi scelerisque eu. A erat nam at lectus. Dolor magna eget est lorem. Volutpat diam ut venenatis tellus in metus vulputate eu scelerisque. Eros donec ac odio tempor orci dapibus ultrices in iaculis. Aenean et tortor at risus. Suspendisse sed nisi lacus sed viverra tellus in. Arcu felis bibendum ut tristique et.</p>
|
44
|
+
|
45
|
+
<p>At ultrices mi tempus imperdiet nulla malesuada pellentesque elit. Nisl suscipit adipiscing bibendum est ultricies integer quis. Nec sagittis aliquam malesuada bibendum arcu vitae elementum curabitur. Malesuada fames ac turpis egestas maecenas. Fames ac turpis egestas sed tempus urna et pharetra. Vitae elementum curabitur vitae nunc sed velit dignissim sodales ut. Nisi lacus sed viverra tellus in hac habitasse platea. Arcu non odio euismod lacinia at quis risus sed vulputate. Ac placerat vestibulum lectus mauris ultrices eros. Magna sit amet purus gravida quis blandit turpis. Arcu felis bibendum ut tristique. Egestas congue quisque egestas diam in arcu cursus. Pretium aenean pharetra magna ac placerat. Diam maecenas sed enim ut sem viverra. Egestas sed sed risus pretium quam vulputate dignissim suspendisse. Tincidunt id aliquet risus feugiat in. A cras semper auctor neque vitae tempus. Eu lobortis elementum nibh tellus molestie. Neque ornare aenean euismod elementum nisi quis eleifend.</p>
|
46
|
+
|
47
|
+
<p>Sed nisi lacus sed viverra tellus in. Nisl condimentum id venenatis a condimentum vitae. Integer malesuada nunc vel risus commodo viverra maecenas accumsan. Magnis dis parturient montes nascetur ridiculus mus mauris vitae ultricies. Nulla facilisi cras fermentum odio eu. Adipiscing elit pellentesque habitant morbi tristique senectus. Urna condimentum mattis pellentesque id. Arcu cursus euismod quis viverra nibh cras pulvinar. Elementum integer enim neque volutpat ac. Euismod nisi porta lorem mollis aliquam ut porttitor. Mauris nunc congue nisi vitae suscipit tellus mauris a. Volutpat blandit aliquam etiam erat velit. Risus sed vulputate odio ut. Ut sem nulla pharetra diam. Turpis massa sed elementum tempus egestas sed sed risus pretium. Cras sed felis eget velit aliquet sagittis. Imperdiet massa tincidunt nunc pulvinar sapien et ligula. Rhoncus est pellentesque elit ullamcorper dignissim cras tincidunt lobortis feugiat.</p>
|
48
|
+
|
49
|
+
<p>Eget felis eget nunc lobortis mattis aliquam faucibus. Enim nunc faucibus a pellentesque sit amet. Luctus accumsan tortor posuere ac ut consequat. Sed euismod nisi porta lorem mollis aliquam ut porttitor leo. Tincidunt tortor aliquam nulla facilisi cras fermentum odio. Lobortis elementum nibh tellus molestie nunc non blandit. Luctus accumsan tortor posuere ac ut consequat semper. Etiam tempor orci eu lobortis elementum. Posuere ac ut consequat semper. Feugiat nisl pretium fusce id velit ut tortor pretium viverra. Aliquam id diam maecenas ultricies mi eget mauris pharetra. Maecenas ultricies mi eget mauris pharetra et. Sodales ut eu sem integer vitae justo eget magna fermentum. Ac placerat vestibulum lectus mauris ultrices eros in cursus. Eu non diam phasellus vestibulum lorem sed risus. Facilisi nullam vehicula ipsum a arcu cursus vitae congue mauris. Mauris pharetra et ultrices neque ornare. Aliquam ultrices sagittis orci a. Diam maecenas ultricies mi eget mauris pharetra. Molestie ac feugiat sed lectus vestibulum mattis ullamcorper velit sed.</p>
|
@@ -91,6 +91,24 @@ module Primer
|
|
91
91
|
render_with_template(locals: { open_on_load: open_on_load, selected_items: selected_items })
|
92
92
|
end
|
93
93
|
|
94
|
+
# @label Custom loading label
|
95
|
+
#
|
96
|
+
# @snapshot interactive
|
97
|
+
# @param open_on_load toggle
|
98
|
+
# @param selected_items text
|
99
|
+
def custom_loading_label(open_on_load: false, selected_items: "Phaser")
|
100
|
+
render_with_template(locals: { open_on_load: open_on_load, selected_items: selected_items })
|
101
|
+
end
|
102
|
+
|
103
|
+
# @label Custom loading description
|
104
|
+
#
|
105
|
+
# @snapshot interactive
|
106
|
+
# @param open_on_load toggle
|
107
|
+
# @param selected_items text
|
108
|
+
def custom_loading_description(open_on_load: false, selected_items: "Phaser")
|
109
|
+
render_with_template(locals: { open_on_load: open_on_load, selected_items: selected_items })
|
110
|
+
end
|
111
|
+
|
94
112
|
# @label Local fetch (no results)
|
95
113
|
#
|
96
114
|
# @snapshot interactive
|
@@ -208,8 +226,21 @@ module Primer
|
|
208
226
|
#
|
209
227
|
# @snapshot interactive
|
210
228
|
# @param open_on_load toggle
|
211
|
-
|
212
|
-
|
229
|
+
# @param banner_scheme [Symbol] select [danger, warning]
|
230
|
+
# @param show_results toggle
|
231
|
+
def remote_fetch_filter_failure(
|
232
|
+
open_on_load: false,
|
233
|
+
banner_scheme: :danger,
|
234
|
+
show_results: true
|
235
|
+
)
|
236
|
+
render_with_template(locals: {
|
237
|
+
open_on_load: open_on_load,
|
238
|
+
show_results: show_results,
|
239
|
+
system_arguments: {
|
240
|
+
# .to_sym workaround for https://github.com/lookbook-hq/lookbook/issues/640
|
241
|
+
banner_scheme: banner_scheme.to_sym
|
242
|
+
}
|
243
|
+
})
|
213
244
|
end
|
214
245
|
|
215
246
|
# @label Eventually local fetch initial failure
|
@@ -251,6 +282,13 @@ module Primer
|
|
251
282
|
def no_values(open_on_load: false)
|
252
283
|
render_with_template(locals: { open_on_load: open_on_load })
|
253
284
|
end
|
285
|
+
|
286
|
+
# @label Scroll container
|
287
|
+
#
|
288
|
+
# @param open_on_load toggle
|
289
|
+
def scroll_container(open_on_load: false)
|
290
|
+
render_with_template(locals: { open_on_load: open_on_load })
|
291
|
+
end
|
254
292
|
end
|
255
293
|
end
|
256
294
|
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<div class="d-flex">
|
2
|
+
<%= render(Primer::Alpha::StackItem.new(**system_arguments, p: 3, m: 1, bg: :success, border_radius: 2)) do %>
|
3
|
+
Adjust this item
|
4
|
+
<% end %>
|
5
|
+
<%= render(Primer::Alpha::StackItem.new(p: 3, m: 1, bg: :accent, border_radius: 2)) do %>
|
6
|
+
Fixed width
|
7
|
+
<% end %>
|
8
|
+
<%= render(Primer::Alpha::StackItem.new(p: 3, m: 1, bg: :attention, border_radius: 2)) do %>
|
9
|
+
Fixed width
|
10
|
+
<% end %>
|
11
|
+
</div>
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Primer
|
4
|
+
module Alpha
|
5
|
+
# @label StackItem
|
6
|
+
class StackItemPreview < ViewComponent::Preview
|
7
|
+
# @label Default
|
8
|
+
def default
|
9
|
+
end
|
10
|
+
|
11
|
+
# @label Playground
|
12
|
+
#
|
13
|
+
# @param tag text
|
14
|
+
# @param grow toggle
|
15
|
+
# @param grow_narrow toggle
|
16
|
+
# @param grow_regular toggle
|
17
|
+
# @param grow_wide toggle
|
18
|
+
def playground(
|
19
|
+
tag: Primer::Alpha::StackItem::DEFAULT_TAG,
|
20
|
+
grow: Primer::Alpha::StackItem::GrowArg::DEFAULT,
|
21
|
+
grow_narrow: Primer::Alpha::StackItem::GrowArg::DEFAULT,
|
22
|
+
grow_regular: Primer::Alpha::StackItem::GrowArg::DEFAULT,
|
23
|
+
grow_wide: Primer::Alpha::StackItem::GrowArg::DEFAULT
|
24
|
+
)
|
25
|
+
render_with_template(locals: {
|
26
|
+
system_arguments: {
|
27
|
+
tag: tag,
|
28
|
+
grow: control_values_for(grow, grow_narrow, grow_regular, grow_wide)
|
29
|
+
}
|
30
|
+
})
|
31
|
+
end
|
32
|
+
|
33
|
+
private
|
34
|
+
|
35
|
+
def control_values_for(normal, narrow, regular, wide)
|
36
|
+
[narrow, regular, wide].any? ? { narrow: narrow, regular: regular, wide: wide} : normal
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,5 @@
|
|
1
|
+
<%= render(Primer::Alpha::Stack.new(**system_arguments)) do %>
|
2
|
+
<%= render(Primer::BaseComponent.new(tag: :div, p: 3, bg: :success, border_radius: 2)) { "First" } %>
|
3
|
+
<%= render(Primer::BaseComponent.new(tag: :div, p: 3, bg: :accent, border_radius: 2)) { "Second" } %>
|
4
|
+
<%= render(Primer::BaseComponent.new(tag: :div, p: 3, bg: :attention, border_radius: 2)) { "Third" } %>
|
5
|
+
<% end %>
|
@@ -0,0 +1,88 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Primer
|
4
|
+
module Alpha
|
5
|
+
# @label Stack
|
6
|
+
class StackPreview < ViewComponent::Preview
|
7
|
+
# @label Default
|
8
|
+
def default
|
9
|
+
render(Primer::Alpha::Stack.new(border: true, border_color: :success_emphasis)) do
|
10
|
+
"Hello, world!"
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
# @label Playground
|
15
|
+
#
|
16
|
+
# @param tag text
|
17
|
+
# @param justify [Symbol] select {{ Primer::Alpha::Stack::JustifyArg::OPTIONS }}
|
18
|
+
# @param justify_narrow [Symbol] select {{ Primer::Alpha::Stack::JustifyArg::OPTIONS }}
|
19
|
+
# @param justify_regular [Symbol] select {{ Primer::Alpha::Stack::JustifyArg::OPTIONS }}
|
20
|
+
# @param justify_wide [Symbol] select {{ Primer::Alpha::Stack::JustifyArg::OPTIONS }}
|
21
|
+
# @param gap [Symbol] select {{ Primer::Alpha::Stack::GapArg::OPTIONS }}
|
22
|
+
# @param gap_narrow [Symbol] select {{ Primer::Alpha::Stack::GapArg::OPTIONS }}
|
23
|
+
# @param gap_regular [Symbol] select {{ Primer::Alpha::Stack::GapArg::OPTIONS }}
|
24
|
+
# @param gap_wide [Symbol] select {{ Primer::Alpha::Stack::GapArg::OPTIONS }}
|
25
|
+
# @param direction [Symbol] select {{ Primer::Alpha::Stack::DirectionArg::OPTIONS }}
|
26
|
+
# @param direction_narrow [Symbol] select {{ Primer::Alpha::Stack::DirectionArg::OPTIONS }}
|
27
|
+
# @param direction_regular [Symbol] select {{ Primer::Alpha::Stack::DirectionArg::OPTIONS }}
|
28
|
+
# @param direction_wide [Symbol] select {{ Primer::Alpha::Stack::DirectionArg::OPTIONS }}
|
29
|
+
# @param align [Symbol] select {{ Primer::Alpha::Stack::AlignArg::OPTIONS }}
|
30
|
+
# @param align_narrow [Symbol] select {{ Primer::Alpha::Stack::AlignArg::OPTIONS }}
|
31
|
+
# @param align_regular [Symbol] select {{ Primer::Alpha::Stack::AlignArg::OPTIONS }}
|
32
|
+
# @param align_wide [Symbol] select {{ Primer::Alpha::Stack::AlignArg::OPTIONS }}
|
33
|
+
# @param wrap [Symbol] select {{ Primer::Alpha::Stack::WrapArg::OPTIONS }}
|
34
|
+
# @param wrap_narrow [Symbol] select {{ Primer::Alpha::Stack::WrapArg::OPTIONS }}
|
35
|
+
# @param wrap_regular [Symbol] select {{ Primer::Alpha::Stack::WrapArg::OPTIONS }}
|
36
|
+
# @param wrap_wide [Symbol] select {{ Primer::Alpha::Stack::WrapArg::OPTIONS }}
|
37
|
+
# @param padding [Symbol] select {{ Primer::Alpha::Stack::PaddingArg::OPTIONS }}
|
38
|
+
# @param padding_narrow [Symbol] select {{ Primer::Alpha::Stack::PaddingArg::OPTIONS }}
|
39
|
+
# @param padding_regular [Symbol] select {{ Primer::Alpha::Stack::PaddingArg::OPTIONS }}
|
40
|
+
# @param padding_wide [Symbol] select {{ Primer::Alpha::Stack::PaddingArg::OPTIONS }}
|
41
|
+
def playground(
|
42
|
+
tag: Primer::Alpha::StackItem::DEFAULT_TAG,
|
43
|
+
justify: Primer::Alpha::Stack::JustifyArg::DEFAULT,
|
44
|
+
justify_narrow: nil,
|
45
|
+
justify_regular: nil,
|
46
|
+
justify_wide: nil,
|
47
|
+
gap: Primer::Alpha::Stack::GapArg::DEFAULT,
|
48
|
+
gap_narrow: nil,
|
49
|
+
gap_regular: nil,
|
50
|
+
gap_wide: nil,
|
51
|
+
direction: Primer::Alpha::Stack::DirectionArg::DEFAULT,
|
52
|
+
direction_narrow: nil,
|
53
|
+
direction_regular: nil,
|
54
|
+
direction_wide: nil,
|
55
|
+
align: Primer::Alpha::Stack::AlignArg::DEFAULT,
|
56
|
+
align_narrow: nil,
|
57
|
+
align_regular: nil,
|
58
|
+
align_wide: nil,
|
59
|
+
wrap: Primer::Alpha::Stack::WrapArg::DEFAULT,
|
60
|
+
wrap_narrow: nil,
|
61
|
+
wrap_regular: nil,
|
62
|
+
wrap_wide: nil,
|
63
|
+
padding: Primer::Alpha::Stack::PaddingArg::DEFAULT,
|
64
|
+
padding_narrow: nil,
|
65
|
+
padding_regular: nil,
|
66
|
+
padding_wide: nil
|
67
|
+
)
|
68
|
+
render_with_template(locals: {
|
69
|
+
system_arguments: {
|
70
|
+
tag: tag,
|
71
|
+
justify: control_values_for(justify, justify_narrow, justify_regular, justify_wide),
|
72
|
+
gap: control_values_for(gap, gap_narrow, gap_regular, gap_wide),
|
73
|
+
direction: control_values_for(direction, direction_narrow, direction_regular, direction_wide),
|
74
|
+
wrap: control_values_for(wrap, wrap_narrow, wrap_regular, wrap_wide),
|
75
|
+
padding: control_values_for(padding, padding_narrow, padding_regular, padding_wide),
|
76
|
+
align: control_values_for(align, align_narrow, align_regular, align_wide),
|
77
|
+
}
|
78
|
+
})
|
79
|
+
end
|
80
|
+
|
81
|
+
private
|
82
|
+
|
83
|
+
def control_values_for(normal, narrow, regular, wide)
|
84
|
+
[narrow, regular, wide].any? ? { narrow: narrow, regular: regular, wide: wide } : normal
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
@@ -1,5 +1,4 @@
|
|
1
|
-
|
2
|
-
<%= render(Primer::BaseComponent.new(tag: :div, flex_items: :center, display: :flex)) do %>
|
1
|
+
<%= render(Primer::BaseComponent.new(tag: :div, flex_items: :center, display: :flex)) do %>
|
3
2
|
<%= form_with(url: action_menu_form_action_path(format: route_format)) do |f| %>
|
4
3
|
<%= render(Primer::Alpha::ActionMenu.new(select_variant: :single, form_arguments: { builder: f, name: "foo" })) do |menu| %>
|
5
4
|
<% menu.with_show_button(classes: "rounded-right-0 border-right-0") { |button| button.with_trailing_action_icon(icon: :"triangle-down"); "Filter" } %>
|
@@ -6,10 +6,10 @@
|
|
6
6
|
Open Overlay
|
7
7
|
<% b.with_tooltip(text: "Opens an overlay") %>
|
8
8
|
<% end %>
|
9
|
-
<% d.with_header do
|
9
|
+
<% d.with_header do %>
|
10
10
|
An overlay
|
11
11
|
<% end %>
|
12
|
-
<% d.with_body do
|
12
|
+
<% d.with_body do %>
|
13
13
|
|
14
14
|
<%= render(Primer::Beta::Button.new(id: "overlay-button")) do |b| %>
|
15
15
|
<% b.with_tooltip(text: "This is a tooltip in an Overlay") %>
|
@@ -1,20 +1,20 @@
|
|
1
1
|
<div class="d-flex flex-items-start flex-column flex-sm-row flex-sm-items-end" style="gap: .5rem">
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
2
|
+
<%= render(
|
3
|
+
Primer::Beta::AutoComplete.new(
|
4
|
+
label_text: label_text,
|
5
|
+
input_id: input_id,
|
6
|
+
list_id: list_id,
|
7
|
+
src: autocomplete_index_path,
|
8
|
+
show_clear_button: show_clear_button,
|
9
|
+
visually_hide_label: visually_hide_label,
|
10
|
+
placeholder: placeholder,
|
11
|
+
size: size,
|
12
|
+
full_width: full_width,
|
13
|
+
disabled: disabled,
|
14
|
+
invalid: invalid,
|
15
|
+
input_name: input_name
|
16
|
+
)) do |component| %>
|
17
|
+
<% component.with_leading_visual_icon(icon: :search) %>
|
18
|
+
<% end %>
|
19
|
+
<%= render(Primer::Beta::Button.new(scheme: :primary)) { "Submit" } %>
|
20
20
|
</div>
|
@@ -8,7 +8,9 @@
|
|
8
8
|
<%= render(Primer::Beta::Breadcrumbs.new) do |breadcrumbs| %>
|
9
9
|
<% texts.each_with_index do |text, i| %>
|
10
10
|
<% breadcrumbs.with_item(href: "##{i}") do %>
|
11
|
-
<%=
|
11
|
+
<%=
|
12
|
+
render(Primer::Truncate.new(inline: true, max_width: 135)) { text } # rubocop:disable Migrations/TruncateComponent
|
13
|
+
%>
|
12
14
|
<% end %>
|
13
15
|
<% end %>
|
14
16
|
<% end %>
|
@@ -4,12 +4,12 @@
|
|
4
4
|
<% message.with_heading(tag: :h2).with_content("Awesome!") %>
|
5
5
|
<% message.with_description { "Great! Everything worked well." } if show_description %>
|
6
6
|
<% end %>
|
7
|
-
<%
|
7
|
+
<% if show_additional_content %>
|
8
8
|
<% dialog.with_additional_content(display: :inline) do %>
|
9
9
|
<%= render(Primer::Alpha::Banner.new) { "Some additional content below" } %>
|
10
10
|
<% end %>
|
11
11
|
<% end %>
|
12
|
-
<%
|
12
|
+
<% if custom_footer %>
|
13
13
|
<% dialog.with_footer do %>
|
14
14
|
<%= render(Primer::Beta::Button.new("data-close-dialog-id": "my-dialog")) { "Cancel" } %>
|
15
15
|
<%= render(Primer::Beta::Button.new(scheme: :primary)) { "Accept" } %>
|
@@ -8,7 +8,7 @@
|
|
8
8
|
<% component.with_breadcrumbs([{ href: "/foo", text: "Foo" }, { href: "/bar", text: "Bar" }, "Baz"]) %>
|
9
9
|
<% component.with_action_text { "An additional hint" } %>
|
10
10
|
<% component.with_action_link(mobile_icon: "link", mobile_label: "Community", href: "https://community.openproject.com", target: "_blank") { "Go to community" } %>
|
11
|
-
<% component.with_action_button(mobile_icon: "star", mobile_label: "Star") do |button
|
11
|
+
<% component.with_action_button(mobile_icon: "star", mobile_label: "Star") do |button| %>
|
12
12
|
<% button.with_leading_visual_icon(icon: "star") %>
|
13
13
|
Star
|
14
14
|
<% end %>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<%= render Primer::OpenProject::PageHeader.new(state: in_edit_state ? :edit : :show) do |header| %>
|
2
|
-
<%=
|
2
|
+
<%= header.with_title(variant: variant) do |t| %>
|
3
3
|
<% if in_edit_state %>
|
4
4
|
<%= t.with_editable_form(model: nil, update_path: "/foo", cancel_path: "/bar") %>
|
5
5
|
<% end %>
|
@@ -20,7 +20,7 @@
|
|
20
20
|
<% end %>
|
21
21
|
<% end %>
|
22
22
|
<% if with_tab_nav %>
|
23
|
-
<% header.with_tab_nav(label: "label") do |nav
|
23
|
+
<% header.with_tab_nav(label: "label") do |nav| %>
|
24
24
|
<% nav.with_tab(selected: true, href: "#") { "Tab 1" } %>
|
25
25
|
<% nav.with_tab(href: "#") { "Tab 2" } %>
|
26
26
|
<% nav.with_tab(href: "#") { "Tab 3" } %>
|