primer_view_components 0.0.104 → 0.0.105

Sign up to get free protection for your applications and to get access to all the features.
Files changed (116) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +20 -0
  3. data/app/assets/javascripts/primer_view_components.js +1 -1
  4. data/app/assets/javascripts/primer_view_components.js.map +1 -1
  5. data/app/assets/styles/primer_view_components.css +1 -1
  6. data/app/assets/styles/primer_view_components.css.map +1 -1
  7. data/app/components/primer/alpha/action_list/item.rb +2 -2
  8. data/app/components/primer/alpha/action_list.rb +2 -0
  9. data/app/components/primer/alpha/image.rb +50 -0
  10. data/app/components/primer/{image_crop.d.ts → alpha/image_crop.d.ts} +0 -0
  11. data/app/components/primer/{image_crop.html.erb → alpha/image_crop.html.erb} +0 -0
  12. data/app/components/primer/{image_crop.js → alpha/image_crop.js} +0 -0
  13. data/app/components/primer/alpha/image_crop.rb +39 -0
  14. data/app/components/primer/{image_crop.ts → alpha/image_crop.ts} +0 -0
  15. data/app/components/primer/alpha/nav_list/item.rb +2 -0
  16. data/app/components/primer/alpha/nav_list/section.rb +2 -0
  17. data/app/components/primer/alpha/segmented_control/item.html.erb +13 -0
  18. data/app/components/primer/alpha/segmented_control/item.rb +29 -0
  19. data/app/components/primer/alpha/segmented_control.css +1 -0
  20. data/app/components/primer/alpha/segmented_control.css.map +1 -0
  21. data/app/components/primer/alpha/segmented_control.d.ts +11 -0
  22. data/app/components/primer/alpha/segmented_control.html.erb +7 -0
  23. data/app/components/primer/alpha/segmented_control.js +48 -0
  24. data/app/components/primer/alpha/segmented_control.pcss +121 -0
  25. data/app/components/primer/alpha/segmented_control.rb +92 -0
  26. data/app/components/primer/alpha/segmented_control.ts +41 -0
  27. data/app/components/primer/alpha/tooltip.rb +2 -2
  28. data/app/components/primer/beta/auto_complete/item.rb +2 -2
  29. data/app/components/primer/beta/avatar.rb +1 -1
  30. data/app/components/primer/beta/blankslate.rb +4 -4
  31. data/app/components/primer/beta/breadcrumbs.rb +1 -1
  32. data/app/components/primer/beta/button.rb +1 -1
  33. data/app/components/primer/beta/label.rb +100 -0
  34. data/app/components/primer/beta/link.rb +99 -0
  35. data/app/components/primer/component.rb +1 -0
  36. data/app/components/primer/image.rb +2 -41
  37. data/app/components/primer/image_crop.rb +2 -32
  38. data/app/components/primer/label_component.rb +2 -93
  39. data/app/components/primer/link_component.rb +2 -92
  40. data/app/components/primer/primer.d.ts +2 -1
  41. data/app/components/primer/primer.js +2 -1
  42. data/app/components/primer/primer.pcss +1 -0
  43. data/app/components/primer/primer.ts +2 -1
  44. data/app/components/primer/subhead_component.rb +1 -1
  45. data/app/components/primer/time_ago_component.rb +2 -0
  46. data/app/helpers/primer/form_helper.rb +1 -0
  47. data/app/lib/primer/view_helper.rb +1 -1
  48. data/lib/primer/deprecations.rb +4 -0
  49. data/lib/primer/form_components.rb +1 -0
  50. data/lib/primer/view_components/linters/argument_mappers/label.rb +4 -4
  51. data/lib/primer/view_components/linters/label_component_migration_counter.rb +3 -3
  52. data/lib/primer/view_components/version.rb +1 -1
  53. data/lib/rubocop/config/default.yml +0 -3
  54. data/lib/rubocop/cop/primer/deprecated_label_schemes.rb +3 -3
  55. data/lib/rubocop/cop/primer/deprecated_label_variants.rb +5 -5
  56. data/lib/tasks/docs.rake +12 -7
  57. data/lib/tasks/test.rake +23 -26
  58. data/previews/primer/alpha/action_list_preview.rb +29 -0
  59. data/previews/primer/alpha/auto_complete_preview.rb +10 -0
  60. data/previews/primer/alpha/button_marketing_preview.rb +9 -0
  61. data/previews/primer/alpha/dialog_preview.rb +18 -1
  62. data/previews/primer/alpha/hidden_text_expander_preview.rb +7 -0
  63. data/previews/primer/alpha/image_crop_preview.rb +31 -0
  64. data/previews/primer/alpha/layout_preview.rb +15 -0
  65. data/previews/primer/alpha/nav_list_preview.rb +29 -0
  66. data/previews/primer/alpha/segmented_control_preview.rb +75 -0
  67. data/previews/primer/alpha/tab_panels_preview.rb +15 -0
  68. data/previews/primer/alpha/text_field_preview.rb +58 -0
  69. data/previews/primer/alpha/toggle_switch_preview.rb +4 -0
  70. data/previews/primer/alpha/tooltip_preview.rb +13 -3
  71. data/previews/primer/alpha/underline_nav_preview/playground.html.erb +8 -0
  72. data/previews/primer/alpha/underline_nav_preview.rb +15 -0
  73. data/previews/primer/alpha/underline_panels_preview.rb +15 -0
  74. data/previews/primer/beta/auto_complete_item_preview/playground.html.erb +9 -0
  75. data/previews/primer/beta/auto_complete_item_preview.rb +14 -0
  76. data/previews/primer/beta/auto_complete_preview.rb +20 -0
  77. data/previews/primer/beta/avatar_preview.rb +9 -0
  78. data/previews/primer/beta/avatar_stack_preview.rb +15 -0
  79. data/previews/primer/beta/base_button_preview.rb +9 -0
  80. data/previews/primer/beta/blankslate_preview.rb +12 -0
  81. data/previews/primer/beta/border_box_preview.rb +14 -0
  82. data/previews/primer/beta/breadcrumbs_preview.rb +11 -0
  83. data/previews/primer/beta/button_group_preview.rb +12 -0
  84. data/previews/primer/beta/close_button_preview.rb +7 -0
  85. data/previews/primer/beta/counter_preview.rb +11 -0
  86. data/previews/primer/beta/details_preview.rb +15 -0
  87. data/previews/primer/beta/flash_preview.rb +12 -0
  88. data/previews/primer/beta/heading_preview.rb +8 -0
  89. data/previews/primer/beta/label_preview.rb +26 -0
  90. data/previews/primer/beta/link_preview.rb +41 -0
  91. data/previews/primer/beta/text_preview.rb +8 -0
  92. data/previews/primer/beta/truncate_preview.rb +7 -0
  93. data/previews/primer/clipboard_copy_preview.rb +8 -0
  94. data/previews/primer/dropdown_preview.rb +18 -0
  95. data/previews/primer/hellip_button_preview.rb +8 -0
  96. data/previews/primer/layout_component_preview.rb +13 -1
  97. data/previews/primer/local_time_component_preview.rb +13 -0
  98. data/previews/primer/markdown_preview.rb +277 -266
  99. data/previews/primer/menu_component_preview/playground.html.erb +17 -0
  100. data/previews/primer/menu_component_preview.rb +4 -1
  101. data/previews/primer/octicon_component_preview.rb +8 -0
  102. data/previews/primer/popover_component_preview.rb +15 -1
  103. data/previews/primer/progress_bar_component_preview.rb +12 -1
  104. data/previews/primer/spinner_component_preview.rb +7 -0
  105. data/previews/primer/state_component_preview.rb +11 -1
  106. data/previews/primer/subhead_component_preview.rb +17 -0
  107. data/previews/primer/time_ago_component_preview.rb +8 -0
  108. data/previews/primer/timeline_item_component_preview.rb +12 -1
  109. data/static/arguments.json +300 -138
  110. data/static/audited_at.json +6 -0
  111. data/static/constants.json +86 -71
  112. data/static/statuses.json +10 -4
  113. metadata +27 -9
  114. data/previews/primer/image_crop_preview.rb +0 -22
  115. data/previews/primer/label_component_preview.rb +0 -15
  116. data/previews/primer/link_component_preview.rb +0 -29
@@ -3,6 +3,23 @@
3
3
  module Primer
4
4
  # @label SubheadComponent
5
5
  class SubheadComponentPreview < ViewComponent::Preview
6
+ # @label Playground
7
+ #
8
+ # @param spacious [Boolean]
9
+ # @param hide_border [Boolean]
10
+ # @param heading_danger [Boolean]
11
+ # @param heading_tag [Symbol] select [div, h1, h2, h3, h4, h5, h6]
12
+ def playground(spacious: false, hide_border: false, heading_tag: :div, heading_danger: false)
13
+ render(Primer::SubheadComponent.new(spacious: spacious, hide_border: hide_border)) do |component|
14
+ component.with_heading(tag: heading_tag, danger: heading_danger) do
15
+ "My Heading"
16
+ end
17
+ component.with_description do
18
+ "My Description"
19
+ end
20
+ end
21
+ end
22
+
6
23
  # @label Default Options
7
24
  #
8
25
  # @param spacious [Boolean]
@@ -3,6 +3,14 @@
3
3
  module Primer
4
4
  # @label TimeAgoComponent
5
5
  class TimeAgoComponentPreview < ViewComponent::Preview
6
+ # @label Playground
7
+ #
8
+ # @param time datetime-local
9
+ # @param micro [Boolean] toggle
10
+ def playground(time: Time.zone.now.to_s, micro: false)
11
+ render(Primer::TimeAgoComponent.new(time: DateTime.parse(time), micro: micro))
12
+ end
13
+
6
14
  # @param time datetime-local
7
15
  # @param micro [Boolean] toggle
8
16
  def default(time: Time.zone.now.to_s, micro: false)
@@ -3,7 +3,18 @@
3
3
  module Primer
4
4
  # @label TimelineItemComponent
5
5
  class TimelineItemComponentPreview < ViewComponent::Preview
6
- # @label Default Options
6
+ # @label Playground
7
+ #
8
+ # @param condensed [Boolean]
9
+ def playground(condensed: false)
10
+ render(Primer::TimelineItemComponent.new(condensed: condensed)) do |component|
11
+ component.with_avatar(src: Primer::ExampleImage::BASE64_SRC, alt: "octocat")
12
+ component.with_badge(bg: :success_emphasis, color: :on_emphasis, icon: :check)
13
+ component.with_body { "Success!" }
14
+ end
15
+ end
16
+
17
+ # @label Default
7
18
  #
8
19
  # @param condensed [Boolean]
9
20
  def default(condensed: false)