primer_view_components 0.33.0 → 0.35.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (288) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +67 -0
  3. data/app/assets/javascripts/{app/components → components}/primer/primer.d.ts +3 -4
  4. data/app/assets/javascripts/primer_view_components.js +1 -1
  5. data/app/assets/javascripts/primer_view_components.js.map +1 -1
  6. data/app/assets/styles/primer_view_components.css +1 -1
  7. data/app/assets/styles/primer_view_components.css.map +1 -1
  8. data/app/components/primer/alpha/action_bar.css.map +1 -1
  9. data/app/components/primer/alpha/action_bar.pcss +7 -4
  10. data/app/components/primer/alpha/action_bar_element.js +0 -3
  11. data/app/components/primer/alpha/action_bar_element.ts +0 -4
  12. data/app/components/primer/alpha/action_list.css +1 -1
  13. data/app/components/primer/alpha/action_list.css.map +1 -1
  14. data/app/components/primer/alpha/action_list.pcss +25 -8
  15. data/app/components/primer/alpha/action_list.rb +1 -1
  16. data/app/components/primer/alpha/auto_complete.css +1 -1
  17. data/app/components/primer/alpha/auto_complete.css.map +1 -1
  18. data/app/components/primer/alpha/auto_complete.pcss +7 -7
  19. data/app/components/primer/alpha/banner.css +1 -1
  20. data/app/components/primer/alpha/banner.css.map +1 -1
  21. data/app/components/primer/alpha/banner.pcss +6 -2
  22. data/app/components/primer/alpha/button_marketing.css.map +1 -1
  23. data/app/components/primer/alpha/button_marketing.pcss +11 -4
  24. data/app/components/primer/alpha/dialog.css +1 -1
  25. data/app/components/primer/alpha/dialog.css.json +2 -1
  26. data/app/components/primer/alpha/dialog.css.map +1 -1
  27. data/app/components/primer/alpha/dialog.pcss +39 -13
  28. data/app/components/primer/alpha/dialog.rb +5 -1
  29. data/app/components/primer/alpha/dropdown.css +1 -1
  30. data/app/components/primer/alpha/dropdown.css.map +1 -1
  31. data/app/components/primer/alpha/dropdown.pcss +45 -11
  32. data/app/components/primer/alpha/layout.css.map +1 -1
  33. data/app/components/primer/alpha/layout.pcss +3 -2
  34. data/app/components/primer/alpha/menu.css.map +1 -1
  35. data/app/components/primer/alpha/menu.pcss +7 -0
  36. data/app/components/primer/alpha/overlay.css.map +1 -1
  37. data/app/components/primer/alpha/overlay.pcss +3 -3
  38. data/app/components/primer/alpha/segmented_control.css.map +1 -1
  39. data/app/components/primer/alpha/segmented_control.pcss +15 -8
  40. data/app/components/primer/alpha/select_panel.css +1 -0
  41. data/app/components/primer/alpha/select_panel.css.json +7 -0
  42. data/app/components/primer/alpha/select_panel.css.map +1 -0
  43. data/app/components/primer/alpha/select_panel.html.erb +21 -17
  44. data/app/components/primer/alpha/select_panel.pcss +7 -0
  45. data/app/components/primer/alpha/select_panel.rb +69 -5
  46. data/app/components/primer/alpha/select_panel_element.js +15 -9
  47. data/app/components/primer/alpha/select_panel_element.ts +16 -9
  48. data/app/components/primer/alpha/stack.css +1 -0
  49. data/app/components/primer/alpha/stack.css.json +90 -0
  50. data/app/components/primer/alpha/stack.css.map +1 -0
  51. data/app/components/primer/alpha/stack.html.erb +3 -0
  52. data/app/components/primer/alpha/stack.pcss +297 -0
  53. data/app/components/primer/alpha/stack.rb +185 -0
  54. data/app/components/primer/alpha/stack_item.css +1 -0
  55. data/app/components/primer/alpha/stack_item.css.json +12 -0
  56. data/app/components/primer/alpha/stack_item.css.map +1 -0
  57. data/app/components/primer/alpha/stack_item.html.erb +3 -0
  58. data/app/components/primer/alpha/stack_item.pcss +31 -0
  59. data/app/components/primer/alpha/stack_item.rb +54 -0
  60. data/app/components/primer/alpha/tab_nav.css +1 -1
  61. data/app/components/primer/alpha/tab_nav.css.map +1 -1
  62. data/app/components/primer/alpha/tab_nav.pcss +12 -3
  63. data/app/components/primer/alpha/text_field.css +1 -1
  64. data/app/components/primer/alpha/text_field.css.map +1 -1
  65. data/app/components/primer/alpha/text_field.pcss +29 -22
  66. data/app/components/primer/alpha/toggle_switch.css +1 -1
  67. data/app/components/primer/alpha/toggle_switch.css.map +1 -1
  68. data/app/components/primer/alpha/toggle_switch.pcss +6 -3
  69. data/app/components/primer/alpha/underline_nav.css +1 -1
  70. data/app/components/primer/alpha/underline_nav.css.map +1 -1
  71. data/app/components/primer/alpha/underline_nav.pcss +8 -2
  72. data/app/components/primer/base_component.rb +1 -1
  73. data/app/components/primer/beta/avatar.css +1 -1
  74. data/app/components/primer/beta/avatar.css.map +1 -1
  75. data/app/components/primer/beta/avatar.pcss +4 -1
  76. data/app/components/primer/beta/avatar_stack.css +1 -1
  77. data/app/components/primer/beta/avatar_stack.css.map +1 -1
  78. data/app/components/primer/beta/avatar_stack.pcss +9 -2
  79. data/app/components/primer/beta/blankslate.css +1 -1
  80. data/app/components/primer/beta/blankslate.css.map +1 -1
  81. data/app/components/primer/beta/blankslate.pcss +24 -3
  82. data/app/components/primer/beta/border_box.css +1 -1
  83. data/app/components/primer/beta/border_box.css.map +1 -1
  84. data/app/components/primer/beta/border_box.pcss +8 -4
  85. data/app/components/primer/beta/breadcrumbs.css.map +1 -1
  86. data/app/components/primer/beta/breadcrumbs.pcss +5 -1
  87. data/app/components/primer/beta/button.css +1 -1
  88. data/app/components/primer/beta/button.css.map +1 -1
  89. data/app/components/primer/beta/button.pcss +31 -27
  90. data/app/components/primer/beta/button_group.css.map +1 -1
  91. data/app/components/primer/beta/button_group.pcss +1 -0
  92. data/app/components/primer/beta/counter.css +1 -1
  93. data/app/components/primer/beta/counter.css.map +1 -1
  94. data/app/components/primer/beta/counter.pcss +3 -1
  95. data/app/components/primer/beta/flash.css.map +1 -1
  96. data/app/components/primer/beta/flash.pcss +7 -4
  97. data/app/components/primer/beta/label.css +1 -1
  98. data/app/components/primer/beta/label.css.map +1 -1
  99. data/app/components/primer/beta/label.pcss +7 -4
  100. data/app/components/primer/beta/popover.css +1 -1
  101. data/app/components/primer/beta/popover.css.map +1 -1
  102. data/app/components/primer/beta/popover.pcss +15 -7
  103. data/app/components/primer/beta/progress_bar.css +1 -1
  104. data/app/components/primer/beta/progress_bar.css.map +1 -1
  105. data/app/components/primer/beta/progress_bar.pcss +2 -2
  106. data/app/components/primer/beta/state.css +1 -1
  107. data/app/components/primer/beta/state.css.map +1 -1
  108. data/app/components/primer/beta/state.pcss +6 -1
  109. data/app/components/primer/beta/subhead.css.map +1 -1
  110. data/app/components/primer/beta/subhead.pcss +3 -0
  111. data/app/components/primer/beta/timeline_item.css.map +1 -1
  112. data/app/components/primer/beta/timeline_item.pcss +11 -0
  113. data/app/components/primer/beta/truncate.css.map +1 -1
  114. data/app/components/primer/beta/truncate.pcss +1 -0
  115. data/app/components/primer/component.rb +4 -0
  116. data/app/components/primer/dialog_helper.js +0 -1
  117. data/app/components/primer/dialog_helper.ts +0 -1
  118. data/app/components/primer/primer.d.ts +3 -4
  119. data/app/components/primer/primer.js +3 -4
  120. data/app/components/primer/primer.pcss +6 -3
  121. data/app/components/primer/primer.ts +3 -4
  122. data/app/components/primer/responsive_arg.rb +66 -0
  123. data/app/forms/caption_template_form/places_bellevue_caption.html.erb +1 -0
  124. data/app/forms/caption_template_form/places_lopez_caption.html.erb +1 -0
  125. data/app/forms/caption_template_form/places_seattle_caption.html.erb +1 -0
  126. data/app/forms/caption_template_form.rb +6 -0
  127. data/app/forms/check_box_group_form.rb +1 -1
  128. data/app/forms/radio_button_group_form.rb +5 -1
  129. data/app/lib/primer/attributes_helper.rb +1 -1
  130. data/{lib → app/lib}/primer/forms/base_component.rb +0 -8
  131. data/{lib → app/lib}/primer/forms/button.rb +5 -2
  132. data/{lib → app/lib}/primer/forms/check_box_group.html.erb +3 -3
  133. data/{lib → app/lib}/primer/forms/check_box_group.rb +1 -1
  134. data/{lib → app/lib}/primer/forms/dsl/check_box_input.rb +4 -8
  135. data/{lib → app/lib}/primer/forms/dsl/input.rb +13 -1
  136. data/{lib → app/lib}/primer/forms/dsl/radio_button_input.rb +4 -0
  137. data/{lib → app/lib}/primer/forms/group.html.erb +1 -1
  138. data/{lib → app/lib}/primer/forms/group.rb +5 -0
  139. data/{lib → app/lib}/primer/forms/primer_text_field.js +1 -0
  140. data/{lib → app/lib}/primer/forms/primer_text_field.ts +1 -0
  141. data/{lib → app/lib}/primer/forms/radio_button_group.html.erb +3 -3
  142. data/{lib → app/lib}/primer/forms/radio_button_group.rb +1 -1
  143. data/{lib → app/lib}/primer/forms/select.html.erb +0 -1
  144. data/lib/primer/view_components/linters/details_menu_migration.rb +3 -2
  145. data/lib/primer/view_components/version.rb +1 -1
  146. data/lib/primer/yard/component_manifest.rb +0 -1
  147. data/lib/rubocop/cop/primer/primer_octicon.rb +1 -1
  148. data/previews/primer/alpha/action_bar_preview/inline.html.erb +1 -1
  149. data/previews/primer/alpha/dialog_preview/autofocus_element.html.erb +1 -1
  150. data/previews/primer/alpha/dialog_preview/custom_header.html.erb +3 -1
  151. data/previews/primer/alpha/dialog_preview/dialog_inside_overlay.html.erb +4 -4
  152. data/previews/primer/alpha/dialog_preview/nested_dialog.html.erb +1 -1
  153. data/previews/primer/alpha/dialog_preview/scroll_container.html.erb +11 -2
  154. data/previews/primer/alpha/dialog_preview/with_footer.html.erb +2 -2
  155. data/previews/primer/alpha/dialog_preview/with_form.html.erb +2 -2
  156. data/previews/primer/alpha/dialog_preview/with_text_input.html.erb +1 -1
  157. data/previews/primer/alpha/dialog_preview.rb +4 -2
  158. data/previews/primer/alpha/overlay_preview/in_a_sticky_container.html.erb +1 -1
  159. data/previews/primer/alpha/overlay_preview/overlay_with_header_filter.html.erb +1 -1
  160. data/previews/primer/alpha/select_panel_preview/_interaction_subject_js.html.erb +1 -1
  161. data/previews/primer/alpha/select_panel_preview/custom_loading_description.html.erb +23 -0
  162. data/previews/primer/alpha/select_panel_preview/custom_loading_label.html.erb +21 -0
  163. data/previews/primer/alpha/select_panel_preview/list_of_links.html.erb +1 -1
  164. data/previews/primer/alpha/select_panel_preview/local_fetch.html.erb +2 -1
  165. data/previews/primer/alpha/select_panel_preview/remote_fetch_filter_failure.html.erb +4 -2
  166. data/previews/primer/alpha/select_panel_preview/scroll_container.html.erb +49 -0
  167. data/previews/primer/alpha/select_panel_preview.rb +47 -9
  168. data/previews/primer/alpha/stack_item_preview/default.html.erb +5 -0
  169. data/previews/primer/alpha/stack_item_preview/playground.html.erb +11 -0
  170. data/previews/primer/alpha/stack_item_preview.rb +40 -0
  171. data/previews/primer/alpha/stack_preview/playground.html.erb +5 -0
  172. data/previews/primer/alpha/stack_preview.rb +88 -0
  173. data/previews/primer/alpha/text_field_preview/input_group_leading_action_menu.html.erb +1 -2
  174. data/previews/primer/alpha/tooltip_preview/tooltip_inside_primer_overlay.html.erb +2 -2
  175. data/previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb +1 -1
  176. data/previews/primer/alpha/underline_nav_preview/default.html.erb +1 -1
  177. data/previews/primer/alpha/underline_nav_preview/playground.html.erb +1 -1
  178. data/previews/primer/beta/auto_complete_preview/with_submit_button.html.erb +18 -18
  179. data/previews/primer/beta/breadcrumbs_preview/with_deprecated_truncate.html.erb +3 -1
  180. data/previews/primer/beta/button_preview/summary_as_button.html.erb +0 -1
  181. data/previews/primer/beta/subhead_preview/actions.html.erb +0 -1
  182. data/static/arguments.json +112 -30
  183. data/static/audited_at.json +2 -1
  184. data/static/classes.json +12 -0
  185. data/static/constants.json +155 -8
  186. data/static/info_arch.json +248 -98
  187. data/static/previews.json +107 -47
  188. data/static/statuses.json +2 -1
  189. metadata +138 -117
  190. data/app/assets/javascripts/app/components/primer/alpha/image_crop.d.ts +0 -1
  191. data/app/components/primer/alpha/image_crop.d.ts +0 -1
  192. data/app/components/primer/alpha/image_crop.html.erb +0 -12
  193. data/app/components/primer/alpha/image_crop.js +0 -1
  194. data/app/components/primer/alpha/image_crop.rb +0 -28
  195. data/app/components/primer/alpha/image_crop.ts +0 -1
  196. data/previews/primer/alpha/image_crop_preview.rb +0 -31
  197. /data/app/assets/javascripts/{app/components → components}/primer/alpha/action_bar_element.d.ts +0 -0
  198. /data/app/assets/javascripts/{app/components → components}/primer/alpha/action_list.d.ts +0 -0
  199. /data/app/assets/javascripts/{app/components → components}/primer/alpha/action_menu/action_menu_element.d.ts +0 -0
  200. /data/app/assets/javascripts/{app/components → components}/primer/alpha/dropdown/menu.d.ts +0 -0
  201. /data/app/assets/javascripts/{app/components → components}/primer/alpha/dropdown.d.ts +0 -0
  202. /data/app/assets/javascripts/{app/components → components}/primer/alpha/modal_dialog.d.ts +0 -0
  203. /data/app/assets/javascripts/{app/components → components}/primer/alpha/segmented_control.d.ts +0 -0
  204. /data/app/assets/javascripts/{app/components → components}/primer/alpha/select_panel_element.d.ts +0 -0
  205. /data/app/assets/javascripts/{app/components → components}/primer/alpha/tab_container.d.ts +0 -0
  206. /data/app/assets/javascripts/{app/components → components}/primer/alpha/toggle_switch.d.ts +0 -0
  207. /data/app/assets/javascripts/{app/components → components}/primer/alpha/tool_tip.d.ts +0 -0
  208. /data/app/assets/javascripts/{app/components → components}/primer/alpha/x_banner.d.ts +0 -0
  209. /data/app/assets/javascripts/{app/components → components}/primer/anchored_position.d.ts +0 -0
  210. /data/app/assets/javascripts/{app/components → components}/primer/aria_live.d.ts +0 -0
  211. /data/app/assets/javascripts/{app/components → components}/primer/beta/auto_complete/auto_complete.d.ts +0 -0
  212. /data/app/assets/javascripts/{app/components → components}/primer/beta/clipboard_copy.d.ts +0 -0
  213. /data/app/assets/javascripts/{app/components → components}/primer/beta/nav_list.d.ts +0 -0
  214. /data/app/assets/javascripts/{app/components → components}/primer/beta/nav_list_group_element.d.ts +0 -0
  215. /data/app/assets/javascripts/{app/components → components}/primer/beta/relative_time.d.ts +0 -0
  216. /data/app/assets/javascripts/{app/components → components}/primer/dialog_helper.d.ts +0 -0
  217. /data/app/assets/javascripts/{app/components → components}/primer/focus_group.d.ts +0 -0
  218. /data/app/assets/javascripts/{app/components → components}/primer/scrollable_region.d.ts +0 -0
  219. /data/app/assets/javascripts/{app/components → components}/primer/shared_events.d.ts +0 -0
  220. /data/{lib → app/lib}/primer/forms/action_menu.html.erb +0 -0
  221. /data/{lib → app/lib}/primer/forms/action_menu.rb +0 -0
  222. /data/{lib → app/lib}/primer/forms/acts_as_component.rb +0 -0
  223. /data/{lib → app/lib}/primer/forms/auto_complete.html.erb +0 -0
  224. /data/{lib → app/lib}/primer/forms/auto_complete.rb +0 -0
  225. /data/{lib → app/lib}/primer/forms/base.html.erb +0 -0
  226. /data/{lib → app/lib}/primer/forms/base.rb +0 -0
  227. /data/{lib → app/lib}/primer/forms/buffer_rewriter.rb +0 -0
  228. /data/{lib → app/lib}/primer/forms/builder.rb +0 -0
  229. /data/{lib → app/lib}/primer/forms/button.html.erb +0 -0
  230. /data/{lib → app/lib}/primer/forms/caption.html.erb +0 -0
  231. /data/{lib → app/lib}/primer/forms/caption.rb +0 -0
  232. /data/{lib → app/lib}/primer/forms/check_box.html.erb +0 -0
  233. /data/{lib → app/lib}/primer/forms/check_box.rb +0 -0
  234. /data/{lib → app/lib}/primer/forms/dsl/action_menu_input.rb +0 -0
  235. /data/{lib → app/lib}/primer/forms/dsl/auto_complete_input.rb +0 -0
  236. /data/{lib → app/lib}/primer/forms/dsl/button_input.rb +0 -0
  237. /data/{lib → app/lib}/primer/forms/dsl/check_box_group_input.rb +0 -0
  238. /data/{lib → app/lib}/primer/forms/dsl/form_object.rb +0 -0
  239. /data/{lib → app/lib}/primer/forms/dsl/form_reference_input.rb +0 -0
  240. /data/{lib → app/lib}/primer/forms/dsl/hidden_input.rb +0 -0
  241. /data/{lib → app/lib}/primer/forms/dsl/input_group.rb +0 -0
  242. /data/{lib → app/lib}/primer/forms/dsl/input_methods.rb +0 -0
  243. /data/{lib → app/lib}/primer/forms/dsl/multi_input.rb +0 -0
  244. /data/{lib → app/lib}/primer/forms/dsl/radio_button_group_input.rb +0 -0
  245. /data/{lib → app/lib}/primer/forms/dsl/select_input.rb +0 -0
  246. /data/{lib → app/lib}/primer/forms/dsl/submit_button_input.rb +0 -0
  247. /data/{lib → app/lib}/primer/forms/dsl/text_area_input.rb +0 -0
  248. /data/{lib → app/lib}/primer/forms/dsl/text_field_input.rb +0 -0
  249. /data/{lib → app/lib}/primer/forms/dsl/toggle_switch_input.rb +0 -0
  250. /data/{lib → app/lib}/primer/forms/form_control.html.erb +0 -0
  251. /data/{lib → app/lib}/primer/forms/form_control.rb +0 -0
  252. /data/{lib → app/lib}/primer/forms/form_list.html.erb +0 -0
  253. /data/{lib → app/lib}/primer/forms/form_list.rb +0 -0
  254. /data/{lib → app/lib}/primer/forms/form_reference.html.erb +0 -0
  255. /data/{lib → app/lib}/primer/forms/form_reference.rb +0 -0
  256. /data/{lib → app/lib}/primer/forms/hidden_field.html.erb +0 -0
  257. /data/{lib → app/lib}/primer/forms/hidden_field.rb +0 -0
  258. /data/{lib → app/lib}/primer/forms/multi.html.erb +0 -0
  259. /data/{lib → app/lib}/primer/forms/multi.rb +0 -0
  260. /data/{lib → app/lib}/primer/forms/primer_base_component_wrapper.html.erb +0 -0
  261. /data/{lib → app/lib}/primer/forms/primer_base_component_wrapper.rb +0 -0
  262. /data/{lib → app/lib}/primer/forms/primer_multi_input.d.ts +0 -0
  263. /data/{lib → app/lib}/primer/forms/primer_multi_input.js +0 -0
  264. /data/{lib → app/lib}/primer/forms/primer_multi_input.ts +0 -0
  265. /data/{lib → app/lib}/primer/forms/primer_text_field.d.ts +0 -0
  266. /data/{lib → app/lib}/primer/forms/radio_button.html.erb +0 -0
  267. /data/{lib → app/lib}/primer/forms/radio_button.rb +0 -0
  268. /data/{lib → app/lib}/primer/forms/select.rb +0 -0
  269. /data/{lib → app/lib}/primer/forms/separator.html.erb +0 -0
  270. /data/{lib → app/lib}/primer/forms/separator.rb +0 -0
  271. /data/{lib → app/lib}/primer/forms/spacing_wrapper.html.erb +0 -0
  272. /data/{lib → app/lib}/primer/forms/spacing_wrapper.rb +0 -0
  273. /data/{lib → app/lib}/primer/forms/submit_button.html.erb +0 -0
  274. /data/{lib → app/lib}/primer/forms/submit_button.rb +0 -0
  275. /data/{lib → app/lib}/primer/forms/text_area.html.erb +0 -0
  276. /data/{lib → app/lib}/primer/forms/text_area.rb +0 -0
  277. /data/{lib → app/lib}/primer/forms/text_field.html.erb +0 -0
  278. /data/{lib → app/lib}/primer/forms/text_field.rb +0 -0
  279. /data/{lib → app/lib}/primer/forms/toggle_switch.html.erb +0 -0
  280. /data/{lib → app/lib}/primer/forms/toggle_switch.rb +0 -0
  281. /data/{lib → app/lib}/primer/forms/toggle_switch_form.rb +0 -0
  282. /data/{lib → app/lib}/primer/forms/toggle_switch_input.d.ts +0 -0
  283. /data/{lib → app/lib}/primer/forms/toggle_switch_input.js +0 -0
  284. /data/{lib → app/lib}/primer/forms/toggle_switch_input.ts +0 -0
  285. /data/{lib → app/lib}/primer/forms/utils.rb +0 -0
  286. /data/{lib → app/lib}/primer/forms/validation_message.html.erb +0 -0
  287. /data/{lib → app/lib}/primer/forms/validation_message.rb +0 -0
  288. /data/{lib → app/lib}/primer/forms.rb +0 -0
@@ -3,4 +3,3 @@
3
3
  <%= builder.select(@input.name, options, @input.select_arguments, **@input.input_arguments) %>
4
4
  <% end %>
5
5
  <% end %>
6
-
@@ -16,7 +16,7 @@ module ERBLint
16
16
 
17
17
  # Allow custom pattern matching for ERB nodes
18
18
  class ConfigSchema < LinterConfig
19
- property :custom_erb_pattern, accepts: array_of?(Regexp),
19
+ property :custom_erb_pattern, accepts: array_of?(String),
20
20
  default: -> { [] }
21
21
  end
22
22
  self.config_schema = ConfigSchema
@@ -51,7 +51,8 @@ module ERBLint
51
51
  if @config.custom_erb_pattern.empty?
52
52
  nil
53
53
  else
54
- Regexp.new(@config.custom_erb_pattern.join("|"), true)
54
+ regexes = @config.custom_erb_pattern.map { |pattern| Regexp.new(pattern, true) }
55
+ Regexp.new(regexes.join("|"), true)
55
56
  end
56
57
  end
57
58
 
@@ -5,7 +5,7 @@ module Primer
5
5
  module ViewComponents
6
6
  module VERSION
7
7
  MAJOR = 0
8
- MINOR = 33
8
+ MINOR = 35
9
9
  PATCH = 0
10
10
 
11
11
  STRING = [MAJOR, MINOR, PATCH].join(".")
@@ -14,7 +14,6 @@ module Primer
14
14
  Primer::Alpha::HellipButton => {},
15
15
  Primer::Alpha::Image => {},
16
16
  Primer::Alpha::OcticonSymbols => {},
17
- Primer::Alpha::ImageCrop => { js: true },
18
17
  Primer::IconButton => { js: true },
19
18
  Primer::Beta::AutoComplete => { js: true },
20
19
  Primer::Beta::AutoComplete::Item => {},
@@ -200,7 +200,7 @@ module RuboCop
200
200
  def kwargs(node)
201
201
  return node.arguments.last if node.arguments.size > 1
202
202
 
203
- OpenStruct.new(keys: [], pairs: [], type: :hash)
203
+ RuboCop::AST::HashNode.new("hash")
204
204
  end
205
205
 
206
206
  def icon(node)
@@ -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 } %>
@@ -8,7 +8,7 @@
8
8
  )) do |panel| %>
9
9
  <% panel.with_show_button { "Panel" } %>
10
10
  <% panel.with_item(label: "GitHub", href: "https://github.com") %>
11
- <% panel.with_item(label: "Microsoft", href: "https://microsoft.com") %>
11
+ <% panel.with_item(label: "Microsoft", href: "https://microsoft.com", active: true) %>
12
12
  <% panel.with_item(label: "Primer", href: "https://primer.style") %>
13
13
  <% panel.with_item(label: "Catalyst", href: "https://catalyst.rocks") %>
14
14
  <% end %>
@@ -4,7 +4,8 @@
4
4
  data: { interaction_subject: subject_id },
5
5
  select_variant: :multiple,
6
6
  fetch_strategy: :local,
7
- open_on_load: open_on_load
7
+ open_on_load: open_on_load,
8
+ show_filter: show_filter,
8
9
  )) do |panel| %>
9
10
  <% panel.with_show_button { "Panel" } %>
10
11
  <% panel.with_item(label: "Item 1") %>
@@ -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>
@@ -14,7 +14,6 @@ module Primer
14
14
  # @param dynamic_label toggle
15
15
  # @param dynamic_label_prefix text
16
16
  # @param dynamic_aria_label_prefix text
17
- # @param show_filter toggle
18
17
  # @param open_on_load toggle
19
18
  # @param anchor_align [Symbol] select [start, center, end]
20
19
  # @param anchor_side [Symbol] select [outside_bottom, outside_top, outside_left, outside_right]
@@ -29,7 +28,6 @@ module Primer
29
28
  dynamic_label: false,
30
29
  dynamic_label_prefix: nil,
31
30
  dynamic_aria_label_prefix: nil,
32
- show_filter: true,
33
31
  open_on_load: false,
34
32
  anchor_align: :start,
35
33
  anchor_side: :outside_bottom,
@@ -47,7 +45,6 @@ module Primer
47
45
  dynamic_label: dynamic_label,
48
46
  dynamic_label_prefix: dynamic_label_prefix,
49
47
  dynamic_aria_label_prefix: dynamic_aria_label_prefix,
50
- show_filter: show_filter,
51
48
  open_on_load: open_on_load,
52
49
  anchor_align: anchor_align,
53
50
  anchor_side: anchor_side
@@ -59,9 +56,11 @@ module Primer
59
56
  #
60
57
  # @snapshot interactive
61
58
  # @param open_on_load toggle
62
- def default(open_on_load: false)
59
+ # @param show_filter toggle
60
+ def default(open_on_load: false, show_filter: true)
63
61
  render_with_template(template: "primer/alpha/select_panel_preview/local_fetch", locals: {
64
- open_on_load: open_on_load
62
+ open_on_load: open_on_load,
63
+ show_filter: show_filter
65
64
  })
66
65
  end
67
66
 
@@ -69,8 +68,9 @@ module Primer
69
68
  #
70
69
  # @snapshot interactive
71
70
  # @param open_on_load toggle
72
- def local_fetch(open_on_load: false)
73
- render_with_template(locals: { open_on_load: open_on_load })
71
+ # @param show_filter toggle
72
+ def local_fetch(open_on_load: false, show_filter: true)
73
+ render_with_template(locals: { open_on_load: open_on_load, show_filter: show_filter })
74
74
  end
75
75
 
76
76
  # @label Eventually local fetch
@@ -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" } %>