openproject-primer_view_components 0.48.1 → 0.49.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (291) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +51 -0
  3. data/app/assets/javascripts/{app/components → components}/primer/open_project/zen_mode_button.d.ts +4 -0
  4. data/app/assets/javascripts/{app/components → components}/primer/primer.d.ts +3 -4
  5. data/app/assets/javascripts/primer_view_components.js +1 -1
  6. data/app/assets/javascripts/primer_view_components.js.map +1 -1
  7. data/app/assets/styles/primer_view_components.css +1 -1
  8. data/app/assets/styles/primer_view_components.css.map +1 -1
  9. data/app/components/primer/alpha/action_bar.css.map +1 -1
  10. data/app/components/primer/alpha/action_bar.pcss +7 -4
  11. data/app/components/primer/alpha/action_bar_element.js +0 -3
  12. data/app/components/primer/alpha/action_bar_element.ts +0 -4
  13. data/app/components/primer/alpha/action_list.css +1 -1
  14. data/app/components/primer/alpha/action_list.css.map +1 -1
  15. data/app/components/primer/alpha/action_list.pcss +25 -8
  16. data/app/components/primer/alpha/action_list.rb +1 -1
  17. data/app/components/primer/alpha/auto_complete.css +1 -1
  18. data/app/components/primer/alpha/auto_complete.css.map +1 -1
  19. data/app/components/primer/alpha/auto_complete.pcss +7 -7
  20. data/app/components/primer/alpha/banner.css +1 -1
  21. data/app/components/primer/alpha/banner.css.map +1 -1
  22. data/app/components/primer/alpha/banner.pcss +6 -2
  23. data/app/components/primer/alpha/button_marketing.css.map +1 -1
  24. data/app/components/primer/alpha/button_marketing.pcss +11 -4
  25. data/app/components/primer/alpha/dialog.css +1 -1
  26. data/app/components/primer/alpha/dialog.css.json +2 -1
  27. data/app/components/primer/alpha/dialog.css.map +1 -1
  28. data/app/components/primer/alpha/dialog.pcss +39 -13
  29. data/app/components/primer/alpha/dialog.rb +5 -1
  30. data/app/components/primer/alpha/dropdown.css +1 -1
  31. data/app/components/primer/alpha/dropdown.css.map +1 -1
  32. data/app/components/primer/alpha/dropdown.pcss +45 -11
  33. data/app/components/primer/alpha/layout.css.map +1 -1
  34. data/app/components/primer/alpha/layout.pcss +3 -2
  35. data/app/components/primer/alpha/menu.css.map +1 -1
  36. data/app/components/primer/alpha/menu.pcss +7 -0
  37. data/app/components/primer/alpha/overlay.css.map +1 -1
  38. data/app/components/primer/alpha/overlay.pcss +3 -3
  39. data/app/components/primer/alpha/segmented_control.css.map +1 -1
  40. data/app/components/primer/alpha/segmented_control.pcss +15 -8
  41. data/app/components/primer/alpha/select_panel.html.erb +8 -5
  42. data/app/components/primer/alpha/select_panel.rb +26 -1
  43. data/app/components/primer/alpha/select_panel_element.js +9 -3
  44. data/app/components/primer/alpha/select_panel_element.ts +10 -4
  45. data/app/components/primer/alpha/stack.css +1 -0
  46. data/app/components/primer/alpha/stack.css.json +90 -0
  47. data/app/components/primer/alpha/stack.css.map +1 -0
  48. data/app/components/primer/alpha/stack.html.erb +3 -0
  49. data/app/components/primer/alpha/stack.pcss +297 -0
  50. data/app/components/primer/alpha/stack.rb +185 -0
  51. data/app/components/primer/alpha/stack_item.css +1 -0
  52. data/app/components/primer/alpha/stack_item.css.json +12 -0
  53. data/app/components/primer/alpha/stack_item.css.map +1 -0
  54. data/app/components/primer/alpha/stack_item.html.erb +3 -0
  55. data/app/components/primer/alpha/stack_item.pcss +31 -0
  56. data/app/components/primer/alpha/stack_item.rb +54 -0
  57. data/app/components/primer/alpha/tab_nav.css +1 -1
  58. data/app/components/primer/alpha/tab_nav.css.map +1 -1
  59. data/app/components/primer/alpha/tab_nav.pcss +12 -3
  60. data/app/components/primer/alpha/text_field.css +1 -1
  61. data/app/components/primer/alpha/text_field.css.map +1 -1
  62. data/app/components/primer/alpha/text_field.pcss +29 -22
  63. data/app/components/primer/alpha/toggle_switch.css +1 -1
  64. data/app/components/primer/alpha/toggle_switch.css.map +1 -1
  65. data/app/components/primer/alpha/toggle_switch.pcss +6 -3
  66. data/app/components/primer/alpha/underline_nav.css +1 -1
  67. data/app/components/primer/alpha/underline_nav.css.map +1 -1
  68. data/app/components/primer/alpha/underline_nav.pcss +8 -2
  69. data/app/components/primer/base_component.rb +1 -1
  70. data/app/components/primer/beta/avatar.css +1 -1
  71. data/app/components/primer/beta/avatar.css.map +1 -1
  72. data/app/components/primer/beta/avatar.pcss +4 -1
  73. data/app/components/primer/beta/avatar_stack.css +1 -1
  74. data/app/components/primer/beta/avatar_stack.css.map +1 -1
  75. data/app/components/primer/beta/avatar_stack.pcss +9 -2
  76. data/app/components/primer/beta/blankslate.css +1 -1
  77. data/app/components/primer/beta/blankslate.css.map +1 -1
  78. data/app/components/primer/beta/blankslate.pcss +24 -3
  79. data/app/components/primer/beta/border_box.css +1 -1
  80. data/app/components/primer/beta/border_box.css.map +1 -1
  81. data/app/components/primer/beta/border_box.pcss +8 -4
  82. data/app/components/primer/beta/breadcrumbs.css.map +1 -1
  83. data/app/components/primer/beta/breadcrumbs.pcss +5 -1
  84. data/app/components/primer/beta/button.css +1 -1
  85. data/app/components/primer/beta/button.css.map +1 -1
  86. data/app/components/primer/beta/button.pcss +31 -27
  87. data/app/components/primer/beta/button_group.css.map +1 -1
  88. data/app/components/primer/beta/button_group.pcss +1 -0
  89. data/app/components/primer/beta/counter.css +1 -1
  90. data/app/components/primer/beta/counter.css.map +1 -1
  91. data/app/components/primer/beta/counter.pcss +3 -1
  92. data/app/components/primer/beta/flash.css.map +1 -1
  93. data/app/components/primer/beta/flash.pcss +7 -4
  94. data/app/components/primer/beta/label.css.map +1 -1
  95. data/app/components/primer/beta/label.pcss +4 -0
  96. data/app/components/primer/beta/popover.css +1 -1
  97. data/app/components/primer/beta/popover.css.map +1 -1
  98. data/app/components/primer/beta/popover.pcss +15 -7
  99. data/app/components/primer/beta/progress_bar.css +1 -1
  100. data/app/components/primer/beta/progress_bar.css.map +1 -1
  101. data/app/components/primer/beta/progress_bar.pcss +2 -2
  102. data/app/components/primer/beta/state.css +1 -1
  103. data/app/components/primer/beta/state.css.map +1 -1
  104. data/app/components/primer/beta/state.pcss +6 -1
  105. data/app/components/primer/beta/subhead.css.map +1 -1
  106. data/app/components/primer/beta/subhead.pcss +3 -0
  107. data/app/components/primer/beta/timeline_item.css.map +1 -1
  108. data/app/components/primer/beta/timeline_item.pcss +11 -0
  109. data/app/components/primer/beta/truncate.css.map +1 -1
  110. data/app/components/primer/beta/truncate.pcss +1 -0
  111. data/app/components/primer/dialog_helper.js +0 -1
  112. data/app/components/primer/dialog_helper.ts +0 -1
  113. data/app/components/primer/open_project/zen_mode_button.d.ts +4 -0
  114. data/app/components/primer/open_project/zen_mode_button.js +14 -6
  115. data/app/components/primer/open_project/zen_mode_button.ts +18 -5
  116. data/app/components/primer/primer.d.ts +3 -4
  117. data/app/components/primer/primer.js +3 -4
  118. data/app/components/primer/primer.pcss +6 -4
  119. data/app/components/primer/primer.ts +3 -4
  120. data/app/components/primer/responsive_arg.rb +66 -0
  121. data/app/forms/caption_template_form/places_bellevue_caption.html.erb +1 -0
  122. data/app/forms/caption_template_form/places_lopez_caption.html.erb +1 -0
  123. data/app/forms/caption_template_form/places_seattle_caption.html.erb +1 -0
  124. data/app/forms/caption_template_form.rb +6 -0
  125. data/app/forms/check_box_group_form.rb +1 -1
  126. data/app/forms/radio_button_group_form.rb +5 -1
  127. data/app/lib/primer/attributes_helper.rb +1 -1
  128. data/{lib → app/lib}/primer/forms/base_component.rb +0 -8
  129. data/{lib → app/lib}/primer/forms/button.rb +5 -2
  130. data/{lib → app/lib}/primer/forms/check_box_group.html.erb +3 -3
  131. data/{lib → app/lib}/primer/forms/check_box_group.rb +1 -1
  132. data/{lib → app/lib}/primer/forms/dsl/check_box_input.rb +4 -8
  133. data/{lib → app/lib}/primer/forms/dsl/input.rb +13 -1
  134. data/{lib → app/lib}/primer/forms/dsl/radio_button_input.rb +4 -0
  135. data/{lib → app/lib}/primer/forms/group.html.erb +1 -1
  136. data/{lib → app/lib}/primer/forms/group.rb +5 -0
  137. data/{lib → app/lib}/primer/forms/radio_button_group.html.erb +3 -3
  138. data/{lib → app/lib}/primer/forms/radio_button_group.rb +1 -1
  139. data/{lib → app/lib}/primer/forms/select.html.erb +0 -1
  140. data/lib/primer/view_components/linters/details_menu_migration.rb +3 -2
  141. data/lib/primer/view_components/version.rb +2 -2
  142. data/lib/primer/yard/component_manifest.rb +0 -1
  143. data/previews/primer/alpha/action_bar_preview/inline.html.erb +1 -1
  144. data/previews/primer/alpha/dialog_preview/autofocus_element.html.erb +1 -1
  145. data/previews/primer/alpha/dialog_preview/custom_header.html.erb +3 -1
  146. data/previews/primer/alpha/dialog_preview/dialog_inside_overlay.html.erb +4 -4
  147. data/previews/primer/alpha/dialog_preview/nested_dialog.html.erb +1 -1
  148. data/previews/primer/alpha/dialog_preview/scroll_container.html.erb +11 -2
  149. data/previews/primer/alpha/dialog_preview/with_footer.html.erb +2 -2
  150. data/previews/primer/alpha/dialog_preview/with_form.html.erb +2 -2
  151. data/previews/primer/alpha/dialog_preview/with_text_input.html.erb +1 -1
  152. data/previews/primer/alpha/dialog_preview.rb +4 -2
  153. data/previews/primer/alpha/overlay_preview/in_a_sticky_container.html.erb +1 -1
  154. data/previews/primer/alpha/overlay_preview/overlay_with_header_filter.html.erb +1 -1
  155. data/previews/primer/alpha/select_panel_preview/_interaction_subject_js.html.erb +1 -1
  156. data/previews/primer/alpha/select_panel_preview/custom_loading_description.html.erb +23 -0
  157. data/previews/primer/alpha/select_panel_preview/custom_loading_label.html.erb +21 -0
  158. data/previews/primer/alpha/select_panel_preview/remote_fetch_filter_failure.html.erb +4 -2
  159. data/previews/primer/alpha/select_panel_preview/scroll_container.html.erb +49 -0
  160. data/previews/primer/alpha/select_panel_preview.rb +40 -2
  161. data/previews/primer/alpha/stack_item_preview/default.html.erb +5 -0
  162. data/previews/primer/alpha/stack_item_preview/playground.html.erb +11 -0
  163. data/previews/primer/alpha/stack_item_preview.rb +40 -0
  164. data/previews/primer/alpha/stack_preview/playground.html.erb +5 -0
  165. data/previews/primer/alpha/stack_preview.rb +88 -0
  166. data/previews/primer/alpha/text_field_preview/input_group_leading_action_menu.html.erb +1 -2
  167. data/previews/primer/alpha/tooltip_preview/tooltip_inside_primer_overlay.html.erb +2 -2
  168. data/previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb +1 -1
  169. data/previews/primer/alpha/underline_nav_preview/default.html.erb +1 -1
  170. data/previews/primer/alpha/underline_nav_preview/playground.html.erb +1 -1
  171. data/previews/primer/beta/auto_complete_preview/with_submit_button.html.erb +18 -18
  172. data/previews/primer/beta/breadcrumbs_preview/with_deprecated_truncate.html.erb +3 -1
  173. data/previews/primer/beta/button_preview/summary_as_button.html.erb +0 -1
  174. data/previews/primer/beta/subhead_preview/actions.html.erb +0 -1
  175. data/previews/primer/open_project/feedback_dialog_preview/additional_content.html.erb +1 -1
  176. data/previews/primer/open_project/feedback_dialog_preview/custom_footer.html.erb +1 -1
  177. data/previews/primer/open_project/feedback_dialog_preview/playground.html.erb +2 -2
  178. data/previews/primer/open_project/page_header_preview/actions.html.erb +1 -1
  179. data/previews/primer/open_project/page_header_preview/playground.html.erb +2 -2
  180. data/previews/primer/open_project/sub_header_preview/action_menu_buttons.html.erb +1 -1
  181. data/static/arguments.json +112 -30
  182. data/static/audited_at.json +2 -1
  183. data/static/classes.json +6 -0
  184. data/static/constants.json +172 -9
  185. data/static/info_arch.json +248 -98
  186. data/static/previews.json +107 -47
  187. data/static/statuses.json +2 -1
  188. metadata +137 -120
  189. data/app/assets/javascripts/app/components/primer/alpha/image_crop.d.ts +0 -1
  190. data/app/components/primer/alpha/image_crop.d.ts +0 -1
  191. data/app/components/primer/alpha/image_crop.html.erb +0 -12
  192. data/app/components/primer/alpha/image_crop.js +0 -1
  193. data/app/components/primer/alpha/image_crop.rb +0 -28
  194. data/app/components/primer/alpha/image_crop.ts +0 -1
  195. data/previews/primer/alpha/image_crop_preview.rb +0 -31
  196. /data/app/assets/javascripts/{app/components → components}/primer/alpha/action_bar_element.d.ts +0 -0
  197. /data/app/assets/javascripts/{app/components → components}/primer/alpha/action_list.d.ts +0 -0
  198. /data/app/assets/javascripts/{app/components → components}/primer/alpha/action_menu/action_menu_element.d.ts +0 -0
  199. /data/app/assets/javascripts/{app/components → components}/primer/alpha/dropdown/menu.d.ts +0 -0
  200. /data/app/assets/javascripts/{app/components → components}/primer/alpha/dropdown.d.ts +0 -0
  201. /data/app/assets/javascripts/{app/components → components}/primer/alpha/modal_dialog.d.ts +0 -0
  202. /data/app/assets/javascripts/{app/components → components}/primer/alpha/segmented_control.d.ts +0 -0
  203. /data/app/assets/javascripts/{app/components → components}/primer/alpha/select_panel_element.d.ts +0 -0
  204. /data/app/assets/javascripts/{app/components → components}/primer/alpha/tab_container.d.ts +0 -0
  205. /data/app/assets/javascripts/{app/components → components}/primer/alpha/toggle_switch.d.ts +0 -0
  206. /data/app/assets/javascripts/{app/components → components}/primer/alpha/tool_tip.d.ts +0 -0
  207. /data/app/assets/javascripts/{app/components → components}/primer/alpha/x_banner.d.ts +0 -0
  208. /data/app/assets/javascripts/{app/components → components}/primer/anchored_position.d.ts +0 -0
  209. /data/app/assets/javascripts/{app/components → components}/primer/aria_live.d.ts +0 -0
  210. /data/app/assets/javascripts/{app/components → components}/primer/beta/auto_complete/auto_complete.d.ts +0 -0
  211. /data/app/assets/javascripts/{app/components → components}/primer/beta/clipboard_copy.d.ts +0 -0
  212. /data/app/assets/javascripts/{app/components → components}/primer/beta/nav_list.d.ts +0 -0
  213. /data/app/assets/javascripts/{app/components → components}/primer/beta/nav_list_group_element.d.ts +0 -0
  214. /data/app/assets/javascripts/{app/components → components}/primer/beta/relative_time.d.ts +0 -0
  215. /data/app/assets/javascripts/{app/components → components}/primer/dialog_helper.d.ts +0 -0
  216. /data/app/assets/javascripts/{app/components → components}/primer/focus_group.d.ts +0 -0
  217. /data/app/assets/javascripts/{app/components → components}/primer/open_project/page_header_element.d.ts +0 -0
  218. /data/app/assets/javascripts/{app/components → components}/primer/open_project/sub_header_element.d.ts +0 -0
  219. /data/app/assets/javascripts/{app/components → components}/primer/scrollable_region.d.ts +0 -0
  220. /data/app/assets/javascripts/{app/components → components}/primer/shared_events.d.ts +0 -0
  221. /data/{lib → app/lib}/primer/forms/action_menu.html.erb +0 -0
  222. /data/{lib → app/lib}/primer/forms/action_menu.rb +0 -0
  223. /data/{lib → app/lib}/primer/forms/acts_as_component.rb +0 -0
  224. /data/{lib → app/lib}/primer/forms/auto_complete.html.erb +0 -0
  225. /data/{lib → app/lib}/primer/forms/auto_complete.rb +0 -0
  226. /data/{lib → app/lib}/primer/forms/base.html.erb +0 -0
  227. /data/{lib → app/lib}/primer/forms/base.rb +0 -0
  228. /data/{lib → app/lib}/primer/forms/buffer_rewriter.rb +0 -0
  229. /data/{lib → app/lib}/primer/forms/builder.rb +0 -0
  230. /data/{lib → app/lib}/primer/forms/button.html.erb +0 -0
  231. /data/{lib → app/lib}/primer/forms/caption.html.erb +0 -0
  232. /data/{lib → app/lib}/primer/forms/caption.rb +0 -0
  233. /data/{lib → app/lib}/primer/forms/check_box.html.erb +0 -0
  234. /data/{lib → app/lib}/primer/forms/check_box.rb +0 -0
  235. /data/{lib → app/lib}/primer/forms/dsl/action_menu_input.rb +0 -0
  236. /data/{lib → app/lib}/primer/forms/dsl/auto_complete_input.rb +0 -0
  237. /data/{lib → app/lib}/primer/forms/dsl/button_input.rb +0 -0
  238. /data/{lib → app/lib}/primer/forms/dsl/check_box_group_input.rb +0 -0
  239. /data/{lib → app/lib}/primer/forms/dsl/form_object.rb +0 -0
  240. /data/{lib → app/lib}/primer/forms/dsl/form_reference_input.rb +0 -0
  241. /data/{lib → app/lib}/primer/forms/dsl/hidden_input.rb +0 -0
  242. /data/{lib → app/lib}/primer/forms/dsl/input_group.rb +0 -0
  243. /data/{lib → app/lib}/primer/forms/dsl/input_methods.rb +0 -0
  244. /data/{lib → app/lib}/primer/forms/dsl/multi_input.rb +0 -0
  245. /data/{lib → app/lib}/primer/forms/dsl/radio_button_group_input.rb +0 -0
  246. /data/{lib → app/lib}/primer/forms/dsl/select_input.rb +0 -0
  247. /data/{lib → app/lib}/primer/forms/dsl/submit_button_input.rb +0 -0
  248. /data/{lib → app/lib}/primer/forms/dsl/text_area_input.rb +0 -0
  249. /data/{lib → app/lib}/primer/forms/dsl/text_field_input.rb +0 -0
  250. /data/{lib → app/lib}/primer/forms/dsl/toggle_switch_input.rb +0 -0
  251. /data/{lib → app/lib}/primer/forms/form_control.html.erb +0 -0
  252. /data/{lib → app/lib}/primer/forms/form_control.rb +0 -0
  253. /data/{lib → app/lib}/primer/forms/form_list.html.erb +0 -0
  254. /data/{lib → app/lib}/primer/forms/form_list.rb +0 -0
  255. /data/{lib → app/lib}/primer/forms/form_reference.html.erb +0 -0
  256. /data/{lib → app/lib}/primer/forms/form_reference.rb +0 -0
  257. /data/{lib → app/lib}/primer/forms/hidden_field.html.erb +0 -0
  258. /data/{lib → app/lib}/primer/forms/hidden_field.rb +0 -0
  259. /data/{lib → app/lib}/primer/forms/multi.html.erb +0 -0
  260. /data/{lib → app/lib}/primer/forms/multi.rb +0 -0
  261. /data/{lib → app/lib}/primer/forms/primer_base_component_wrapper.html.erb +0 -0
  262. /data/{lib → app/lib}/primer/forms/primer_base_component_wrapper.rb +0 -0
  263. /data/{lib → app/lib}/primer/forms/primer_multi_input.d.ts +0 -0
  264. /data/{lib → app/lib}/primer/forms/primer_multi_input.js +0 -0
  265. /data/{lib → app/lib}/primer/forms/primer_multi_input.ts +0 -0
  266. /data/{lib → app/lib}/primer/forms/primer_text_field.d.ts +0 -0
  267. /data/{lib → app/lib}/primer/forms/primer_text_field.js +0 -0
  268. /data/{lib → app/lib}/primer/forms/primer_text_field.ts +0 -0
  269. /data/{lib → app/lib}/primer/forms/radio_button.html.erb +0 -0
  270. /data/{lib → app/lib}/primer/forms/radio_button.rb +0 -0
  271. /data/{lib → app/lib}/primer/forms/select.rb +0 -0
  272. /data/{lib → app/lib}/primer/forms/separator.html.erb +0 -0
  273. /data/{lib → app/lib}/primer/forms/separator.rb +0 -0
  274. /data/{lib → app/lib}/primer/forms/spacing_wrapper.html.erb +0 -0
  275. /data/{lib → app/lib}/primer/forms/spacing_wrapper.rb +0 -0
  276. /data/{lib → app/lib}/primer/forms/submit_button.html.erb +0 -0
  277. /data/{lib → app/lib}/primer/forms/submit_button.rb +0 -0
  278. /data/{lib → app/lib}/primer/forms/text_area.html.erb +0 -0
  279. /data/{lib → app/lib}/primer/forms/text_area.rb +0 -0
  280. /data/{lib → app/lib}/primer/forms/text_field.html.erb +0 -0
  281. /data/{lib → app/lib}/primer/forms/text_field.rb +0 -0
  282. /data/{lib → app/lib}/primer/forms/toggle_switch.html.erb +0 -0
  283. /data/{lib → app/lib}/primer/forms/toggle_switch.rb +0 -0
  284. /data/{lib → app/lib}/primer/forms/toggle_switch_form.rb +0 -0
  285. /data/{lib → app/lib}/primer/forms/toggle_switch_input.d.ts +0 -0
  286. /data/{lib → app/lib}/primer/forms/toggle_switch_input.js +0 -0
  287. /data/{lib → app/lib}/primer/forms/toggle_switch_input.ts +0 -0
  288. /data/{lib → app/lib}/primer/forms/utils.rb +0 -0
  289. /data/{lib → app/lib}/primer/forms/validation_message.html.erb +0 -0
  290. /data/{lib → app/lib}/primer/forms/validation_message.rb +0 -0
  291. /data/{lib → app/lib}/primer/forms.rb +0 -0
@@ -1,6 +1,6 @@
1
1
 
2
2
  <%= render(Primer::BaseComponent.new(tag: :div, flex_items: :center, display: :flex)) do %>
3
- <%= render(Primer::Beta::Heading.new(tag: :h1, font_size: 3, mr: 2)) { "Title" }%>
3
+ <%= render(Primer::Beta::Heading.new(tag: :h1, font_size: 3, mr: 2)) { "Title" } %>
4
4
  <%= render(Primer::Alpha::ActionBar.new) do |component| %>
5
5
  <% component.with_item_icon_button(icon: :search, label: "Search") %>
6
6
  <% component.with_item_icon_button(icon: :pencil, label: "Edit") %>
@@ -2,7 +2,7 @@
2
2
  <% d.with_show_button { "Show Dialog" } %>
3
3
  <% d.with_body do %>
4
4
  <form>
5
- <input type="text" placeholder="This element is focused on open" autofocus>
5
+ <input type="text" placeholder="This element is focused on open" autofocus autocomplete="off">
6
6
  </form>
7
7
  <% end %>
8
8
  <% end %>
@@ -1,6 +1,8 @@
1
1
  <%= render(Primer::Alpha::Dialog.new(id: "my-dialog", title: title, subtitle: subtitle, visually_hide_title: false)) do |d| %>
2
2
  <% d.with_header(show_divider: show_divider) do %>
3
- <button class="btn">Custom Header Controls</button>
3
+ <%= render(Primer::Beta::Button.new) do %>
4
+ Custom Header Controls
5
+ <% end %>
4
6
  <% end %>
5
7
  <% d.with_show_button { button_text } %>
6
8
  <% d.with_body { "Hello World" } %>
@@ -5,16 +5,16 @@
5
5
  <% d.with_show_button { button_text } %>
6
6
  <% d.with_body { body_text } %>
7
7
  <% d.with_footer(show_divider: true) do %>
8
- <%= render(Primer::ButtonComponent.new(data: { "close-dialog-id": "dialog-one" })) { "Cancel" } %>
8
+ <%= render(Primer::Beta::Button.new(data: { "close-dialog-id": "dialog-one" })) { "Cancel" } %>
9
9
  <% end %>
10
10
  <% end %>
11
11
  <% end %>
12
12
  <% end %>
13
13
 
14
- <script type="module">
15
- document.getElementById('overlay-show-first-overlay')?.addEventListener('click', e => {
14
+ <script>
15
+ document.getElementById('overlay-show-first-overlay')?.addEventListener('click', e => {
16
16
  setTimeout(() => {
17
- document.getElementById('first-overlay').querySelector('button')?.click()
17
+ document.getElementById('first-overlay').querySelector('button')?.click()
18
18
  });
19
19
  });
20
20
  </script>
@@ -14,7 +14,7 @@
14
14
  <% end %>
15
15
 
16
16
  <div style="margin-top:2rem">
17
- <%= render(Primer::Beta::Flash.new(scheme: :warning)) do %>
17
+ <%= render(Primer::Alpha::Banner.new(scheme: :warning)) do %>
18
18
  <p>Please be careful nesting dialogs! Note that in this example, opening the second dialog does not close the first.</p>
19
19
  <p>Closing a dialog while opening a dialog inside, will cause both to be invisible which will lead to undesired effects!</p>
20
20
  <% end %>
@@ -1,6 +1,15 @@
1
- <%= render(Primer::Alpha::Dialog.new(id: "dialog-one", title: title, position: position, subtitle: subtitle, visually_hide_title: false)) do |d| %>
1
+ <%= render(Primer::Alpha::Dialog.new(
2
+ id: "dialog-one",
3
+ title: title,
4
+ subtitle: subtitle,
5
+ size: size,
6
+ position: position,
7
+ position_narrow: position_narrow,
8
+ visually_hide_title: visually_hide_title,
9
+ disable_scroll: disable_scroll
10
+ )) do |d| %>
2
11
  <% d.with_show_button { button_text } %>
3
- <% d.with_body { body_text} %>
12
+ <% d.with_body { body_text } %>
4
13
  <% end %>
5
14
 
6
15
  <!-- just some lorem ipsum -->
@@ -2,7 +2,7 @@
2
2
  <% d.with_show_button { button_text } %>
3
3
  <% d.with_body { "Content" } %>
4
4
  <% d.with_footer(show_divider: show_divider) do %>
5
- <%= render(Primer::ButtonComponent.new(data: { "close-dialog-id": "my-dialog" })) { "Cancel" } %>
6
- <%= render(Primer::ButtonComponent.new(scheme: :primary)) { "Submit" } %>
5
+ <%= render(Primer::Beta::Button.new(data: { "close-dialog-id": "my-dialog" })) { "Cancel" } %>
6
+ <%= render(Primer::Beta::Button.new(scheme: :primary)) { "Submit" } %>
7
7
  <% end %>
8
8
  <% end %>
@@ -5,8 +5,8 @@
5
5
  This is a custom dialog with the body and footer wrapped in a form tag.
6
6
  <% end %>
7
7
  <%= render(Primer::Alpha::Dialog::Footer.new(show_divider: show_divider)) do %>
8
- <%= render(Primer::ButtonComponent.new(data: { "close-dialog-id": "my-dialog" })) { "Cancel" } %>
9
- <%= render(Primer::ButtonComponent.new(scheme: :primary)) { "Submit" } %>
8
+ <%= render(Primer::Beta::Button.new(data: { "close-dialog-id": "my-dialog" })) { "Cancel" } %>
9
+ <%= render(Primer::Beta::Button.new(scheme: :primary)) { "Submit" } %>
10
10
  <% end %>
11
11
  </form>
12
12
  <% end %>
@@ -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
 
@@ -16,4 +16,4 @@
16
16
  <% d.with_body { "This is a long body for the overlay dialog. <br>".html_safe * 20 } %>
17
17
  <% end %>
18
18
  </div>
19
- <div style="height:3000px;"></div>
19
+ <div style="height:3000px;"></div>
@@ -13,4 +13,4 @@
13
13
  <% d.with_show_button { "Show Overlay" } %>
14
14
  <% d.with_footer { "Large Dialog Footer" } %>
15
15
  <% d.with_body { "This is a long body for the overlay dialog. <br>".html_safe * 20 } %>
16
- <% end %>
16
+ <% end %>
@@ -1,4 +1,4 @@
1
- <script type="application/javascript">
1
+ <script>
2
2
  function ready(fn) {
3
3
  if (document.readyState !== 'loading') {
4
4
  fn()
@@ -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
- src: select_panel_items_path(fail: "true", uuid: SecureRandom.uuid),
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
- def remote_fetch_filter_failure(open_on_load: false)
212
- render_with_template(locals: { open_on_load: open_on_load })
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,5 @@
1
+ <div class="d-flex border color-border-success-emphasis">
2
+ <%= render(Primer::Alpha::StackItem.new(border: true, border_color: :danger_emphasis)) do %>
3
+ Hello, world!
4
+ <% end %>
5
+ </div>
@@ -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") %>
@@ -13,7 +13,7 @@
13
13
  <% end %>
14
14
  <label>
15
15
  An input
16
- <input type="text" id="input">
16
+ <input type="text" id="input" autocomplete="off">
17
17
  </label>
18
18
  <script>
19
19
  document.querySelector('#my-dialog').addEventListener('close', function () {
@@ -3,6 +3,6 @@
3
3
  <% component.with_tab(href: "#", selected: i.zero?) { "Item #{i + 1}" } %>
4
4
  <% end %>
5
5
  <% component.with_actions do %>
6
- <%= render(Primer::ButtonComponent.new) { "Button" } %>
6
+ <%= render(Primer::Beta::Button.new) { "Button" } %>
7
7
  <% end %>
8
8
  <% end %>
@@ -3,6 +3,6 @@
3
3
  <% component.with_tab(href: "#", selected: i.zero?) { "Item #{i + 1}" } %>
4
4
  <% end %>
5
5
  <% component.with_actions do %>
6
- <%= render(Primer::ButtonComponent.new) { "Button" } %>
6
+ <%= render(Primer::Beta::Button.new) { "Button" } %>
7
7
  <% end %>
8
8
  <% end %>
@@ -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
- <%= 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::ButtonComponent.new(scheme: :primary)) { "Submit" } %>
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
- <%= render(Primer::Truncate.new(inline: true, max_width: 135)) { text } %>
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 %>
@@ -11,4 +11,3 @@
11
11
  <% end %>
12
12
  <p>A wrapping `details` tag is required when using the button with the `:summary` tag</p>
13
13
  </details>
14
-
@@ -11,4 +11,3 @@
11
11
  <% end %>
12
12
  <% end %>
13
13
  <% end %>
14
-
@@ -5,5 +5,5 @@
5
5
  <% end %>
6
6
  <% dialog.with_additional_content do %>
7
7
  <% render(Primer::Beta::Text.new) { "You can render whatever component you want here." } %>
8
- <% end %>
8
+ <% end %>
9
9
  <% end %>