primer_view_components 0.0.12 → 0.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +7 -1
  3. data/app/components/primer/avatar_component.rb +11 -11
  4. data/app/components/primer/base_component.rb +55 -7
  5. data/app/components/primer/blankslate_component.html.erb +1 -1
  6. data/app/components/primer/blankslate_component.rb +6 -6
  7. data/app/components/primer/border_box_component.html.erb +5 -5
  8. data/app/components/primer/border_box_component.rb +34 -34
  9. data/app/components/primer/box_component.rb +5 -5
  10. data/app/components/primer/breadcrumb_component.html.erb +2 -2
  11. data/app/components/primer/breadcrumb_component.rb +12 -12
  12. data/app/components/primer/button_component.rb +9 -9
  13. data/app/components/primer/counter_component.rb +9 -9
  14. data/app/components/primer/details_component.html.erb +1 -1
  15. data/app/components/primer/details_component.rb +15 -15
  16. data/app/components/primer/dropdown_menu_component.html.erb +1 -1
  17. data/app/components/primer/dropdown_menu_component.rb +6 -6
  18. data/app/components/primer/flash_component.html.erb +2 -2
  19. data/app/components/primer/flash_component.rb +13 -13
  20. data/app/components/primer/flex_component.rb +5 -5
  21. data/app/components/primer/flex_item_component.rb +5 -5
  22. data/app/components/primer/heading_component.rb +4 -4
  23. data/app/components/primer/label_component.rb +9 -9
  24. data/app/components/primer/layout_component.html.erb +1 -1
  25. data/app/components/primer/layout_component.rb +6 -6
  26. data/app/components/primer/link_component.rb +8 -8
  27. data/app/components/primer/octicon_component.rb +10 -10
  28. data/app/components/primer/popover_component.html.erb +1 -1
  29. data/app/components/primer/popover_component.rb +26 -26
  30. data/app/components/primer/progress_bar_component.html.erb +2 -2
  31. data/app/components/primer/progress_bar_component.rb +14 -14
  32. data/app/components/primer/spinner_component.html.erb +1 -1
  33. data/app/components/primer/spinner_component.rb +9 -9
  34. data/app/components/primer/state_component.rb +8 -8
  35. data/app/components/primer/subhead_component.html.erb +4 -4
  36. data/app/components/primer/subhead_component.rb +26 -26
  37. data/app/components/primer/text_component.rb +5 -5
  38. data/app/components/primer/timeline_item_component.html.erb +4 -4
  39. data/app/components/primer/timeline_item_component.rb +28 -28
  40. data/app/components/primer/underline_nav_component.html.erb +1 -1
  41. data/app/components/primer/underline_nav_component.rb +5 -5
  42. data/lib/primer/classify.rb +2 -4
  43. data/lib/primer/view_components/version.rb +1 -1
  44. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c05ad651f3b5b7815ccb7f623f098b488019c938c11b1d00ee93e467ec535b55
4
- data.tar.gz: aafd79851c5e551d193d5282536806a1446ada7e12d1d25ba29437e58d7b1212
3
+ metadata.gz: 055f773c8e99df5c9bce23d6a5199e71148d0331d6abe6c02fd1f16321a54130
4
+ data.tar.gz: e5310f927e76533daa46918acb24b48ea7bdd684a8f8e4c9090e3545a2e7f3fd
5
5
  SHA512:
6
- metadata.gz: 30d274cb5271343b460ca8bfc1dc08317eff24ef71213633537acedf34eca63ffcb58a1581b5a95a678d5b88d1ec5229467c5b96dc7c3f2fa7aa918ce45b8426
7
- data.tar.gz: 7806725e6845939d302bde336a73a89a1b1918e878a6b15666b157e2d8b4ce53535d630e2960d1077cc8bb7ba7867a60eadfd346ecda15fabce07aaacaabbb3d
6
+ metadata.gz: e6b7159b56e4a0674a7ec68e4aa0666bb2a3e3cb5ef7b90e8c418149200af1255789adc87e4b3955a9a2d6e97afb9ebe2746928ccb32ece3395c28de315206dc
7
+ data.tar.gz: cc962a06f62249016eccfd224ab3655117ac193fa7f6ebb40aff91212690464047f95e2822bf4b5c8ae83d8c82df02e955f0c8ffc350e9aed85c313623388a61
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## main
4
4
 
5
+ ## 0.0.13
6
+
7
+ * Add support for `xl` breakpoint.
8
+
9
+ *Joel Hawksley*
10
+
5
11
  ## 0.0.12
6
12
 
7
13
  * Adds support for disabling inline box-sizing style for `SpinnerComponent` via style parameter `Primer::SpinnerComponent.new(style: nil)`.
@@ -88,7 +94,7 @@
88
94
 
89
95
  ## 0.0.3
90
96
 
91
- * Add support for responsive `float` style argument.
97
+ * Add support for responsive `float` system argument.
92
98
 
93
99
  *Joel Hawksley*
94
100
 
@@ -15,25 +15,25 @@ module Primer
15
15
  # @param alt [String] Passed through to alt on img tag
16
16
  # @param size [Integer] Adds the avatar-small class if less than 24
17
17
  # @param square [Boolean] Used to create a square avatar.
18
- def initialize(src:, alt:, size: 20, square: false, **kwargs)
19
- @kwargs = kwargs
20
- @kwargs[:tag] = :img
21
- @kwargs[:src] = src
22
- @kwargs[:alt] = alt
23
- @kwargs[:size] = size
24
- @kwargs[:height] = size
25
- @kwargs[:width] = size
18
+ def initialize(src:, alt:, size: 20, square: false, **system_arguments)
19
+ @system_arguments = system_arguments
20
+ @system_arguments[:tag] = :img
21
+ @system_arguments[:src] = src
22
+ @system_arguments[:alt] = alt
23
+ @system_arguments[:size] = size
24
+ @system_arguments[:height] = size
25
+ @system_arguments[:width] = size
26
26
 
27
- @kwargs[:classes] = class_names(
27
+ @system_arguments[:classes] = class_names(
28
28
  "avatar",
29
- kwargs[:classes],
29
+ system_arguments[:classes],
30
30
  "avatar--small" => size < SMALL_THRESHOLD,
31
31
  "CircleBadge" => !square
32
32
  )
33
33
  end
34
34
 
35
35
  def call
36
- render(Primer::BaseComponent.new(**@kwargs)) { content }
36
+ render(Primer::BaseComponent.new(**@system_arguments)) { content }
37
37
  end
38
38
  end
39
39
  end
@@ -1,22 +1,70 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Primer
4
- # Base component used by other Primer components.
4
+ # All Primer ViewComponents accept a standard set of options called System Arguments, mimicking the [styled-system API](https://styled-system.com/table) [used by Primer React](https://primer.style/components/system-props).
5
+ #
6
+ # Under the hood, System Arguments are [mapped](https://github.com/primer/view_components/blob/main/lib/primer/classify.rb) to Primer CSS classes, with any remaining options passed to Rails' [`content_tag`](https://api.rubyonrails.org/classes/ActionView/Helpers/TagHelper.html#method-i-content_tag).
7
+ #
8
+ # ## Responsive values
9
+ #
10
+ # To apply different values across responsive breakpoints, pass an array with up to five values in the order `[default, small, medium, large, xlarge]`. To skip a breakpoint, pass `nil`.
11
+ #
12
+ # For example:
13
+ #
14
+ # ```erb
15
+ # <%= render Primer::HeadingComponent.new(mt: [0, nil, nil, 4, 2]) do %>
16
+ # Hello world
17
+ # <% end %>
18
+ # ```
19
+ #
20
+ # Renders:
21
+ #
22
+ # ```html
23
+ # <h1 class="mt-0 mt-lg-4 mt-xl-2">Hello world</h1>
24
+ # ```
25
+ #
5
26
  class BaseComponent < Primer::Component
6
27
  TEST_SELECTOR_TAG = :test_selector
7
28
 
29
+ # @param m [Integer] Margin. <%= one_of((-6..6).to_a) %>
30
+ # @param mt [Integer] Margin left. <%= one_of((-6..6).to_a) %>
31
+ # @param mr [Integer] Margin right. <%= one_of((-6..6).to_a) %>
32
+ # @param mb [Integer] Margin bottom. <%= one_of((-6..6).to_a) %>
33
+ # @param ml [Integer] Margin left. <%= one_of((-6..6).to_a) %>
34
+ # @param mx [Integer] Horizontal margins. <%= one_of((-6..6).to_a + [:auto]) %>
35
+ # @param my [Integer] Vertical margins. <%= one_of((-6..6).to_a) %>
36
+ # @param m [Integer] Padding. <%= one_of((0..6).to_a) %>
37
+ # @param mt [Integer] Padding left. <%= one_of((0..6).to_a) %>
38
+ # @param mr [Integer] Padding right. <%= one_of((0..6).to_a) %>
39
+ # @param mb [Integer] Padding bottom. <%= one_of((0..6).to_a) %>
40
+ # @param ml [Integer] Padding left. <%= one_of((0..6).to_a) %>
41
+ # @param mx [Integer] Horizontal padding. <%= one_of((0..6).to_a) %>
42
+ # @param my [Integer] Vertical padding. <%= one_of((0..6).to_a) %>
8
43
  #
9
- # @example 34|Default
10
- # <%= render(Primer::BaseComponent.new(tag: :a, href: "http://www.google.com", mt: 4)) { "Link" } %>
44
+ # @param position [Symbol] <%= one_of([:relative, :absolute, :fixed]) %>
11
45
  #
12
- # @param tag [Symbol] HTML tag name to be passed to tag.send(tag)
46
+ # @param top [Boolean] If `false`, sets `top: 0`.
47
+ # @param right [Boolean] If `false`, sets `right: 0`.
48
+ # @param bottom [Boolean] If `false`, sets `bottom: 0`.
49
+ # @param left [Boolean] If `false`, sets `left: 0`.
50
+ #
51
+ # @param display [Symbol] <%= one_of([:block, :none, :inline, :inline_block, :table, :table_cell]) %>
52
+ #
53
+ # @param hide [Symbol] Hide the element at a specific breakpoint. <%= one_of([:sm, :md, :lg, :xl]) %>
54
+ #
55
+ # @param vertical_align [Symbol] <%= one_of([:baseline, :top, :middle, :bottom, :text_top, :text_bottom]) %>
56
+ #
57
+ # @param float [Symbol] <%= one_of([:left, :right]) %>
58
+ #
59
+ # @param font_size [String] <%= one_of(["00", "0", "1", "2", "3", "4", "5", "6"]) %>
60
+ # @param tag [Symbol] HTML tag name to be passed to `tag.send`
13
61
  # @param classes [String] CSS class name value to be concatenated with generated Primer CSS classes
14
- def initialize(tag:, classes: nil, **args)
62
+ def initialize(tag:, classes: nil, **system_arguments)
15
63
  @tag = tag
16
- @result = Primer::Classify.call(**args.merge(classes: classes))
64
+ @result = Primer::Classify.call(**system_arguments.merge(classes: classes))
17
65
 
18
66
  # Filter out Primer keys so they don't get assigned as HTML attributes
19
- @content_tag_args = add_test_selector(args).except(*Primer::Classify::VALID_KEYS)
67
+ @content_tag_args = add_test_selector(system_arguments).except(*Primer::Classify::VALID_KEYS)
20
68
  end
21
69
 
22
70
  def call
@@ -1,4 +1,4 @@
1
- <%= render Primer::BaseComponent.new(**@kwargs) do %>
1
+ <%= render Primer::BaseComponent.new(**@system_arguments) do %>
2
2
  <% if @icon.present? %>
3
3
  <%= render(Primer::OcticonComponent.new(
4
4
  icon: @icon,
@@ -56,7 +56,7 @@ module Primer
56
56
  # @param title [String] Text that appears in a larger bold font.
57
57
  # @param title_tag [Symbol] HTML tag to use for title.
58
58
  # @param icon [String] Octicon icon to use at top of component.
59
- # @param icon_size [Symbol] <%= one_of(Primer::OcticonComponent::SIZE_MAPPINGS.keys) %>
59
+ # @param icon_size [Symbol] <%= one_of(Primer::OcticonComponent::SIZE_MAPPINGS) %>
60
60
  # @param image_src [String] Image to display.
61
61
  # @param image_alt [String] Alt text for image.
62
62
  # @param description [String] Text that appears below the title. Typically a whole sentence.
@@ -87,12 +87,12 @@ module Primer
87
87
  large: false,
88
88
  spacious: false,
89
89
 
90
- **kwargs
90
+ **system_arguments
91
91
  )
92
- @kwargs = kwargs
93
- @kwargs[:tag] ||= :div
94
- @kwargs[:classes] = class_names(
95
- @kwargs[:classes],
92
+ @system_arguments = system_arguments
93
+ @system_arguments[:tag] ||= :div
94
+ @system_arguments[:classes] = class_names(
95
+ @system_arguments[:classes],
96
96
  "blankslate",
97
97
  "blankslate-narrow": narrow,
98
98
  "blankslate-large": large,
@@ -1,25 +1,25 @@
1
- <%= render Primer::BaseComponent.new(**@kwargs) do %>
1
+ <%= render Primer::BaseComponent.new(**@system_arguments) do %>
2
2
  <% if header %>
3
- <%= render Primer::BaseComponent.new(**header.kwargs) do %>
3
+ <%= render Primer::BaseComponent.new(**header.system_arguments) do %>
4
4
  <%= header.content %>
5
5
  <% end %>
6
6
  <% end %>
7
7
  <% if body %>
8
- <%= render Primer::BaseComponent.new(**body.kwargs) do %>
8
+ <%= render Primer::BaseComponent.new(**body.system_arguments) do %>
9
9
  <%= body.content %>
10
10
  <% end %>
11
11
  <% end %>
12
12
  <% if rows.any? %>
13
13
  <ul>
14
14
  <% rows.each do |row| %>
15
- <%= render Primer::BaseComponent.new(**row.kwargs) do %>
15
+ <%= render Primer::BaseComponent.new(**row.system_arguments) do %>
16
16
  <%= row.content %>
17
17
  <% end %>
18
18
  <% end %>
19
19
  </ul>
20
20
  <% end %>
21
21
  <% if footer %>
22
- <%= render Primer::BaseComponent.new(**footer.kwargs) do %>
22
+ <%= render Primer::BaseComponent.new(**footer.system_arguments) do %>
23
23
  <%= footer.content %>
24
24
  <% end %>
25
25
  <% end %>
@@ -20,13 +20,13 @@ module Primer
20
20
  # component.slot(:footer) { "Footer" }
21
21
  # end %>
22
22
  #
23
- # @param kwargs [Hash] <%= link_to_style_arguments_docs %>
24
- def initialize(**kwargs)
25
- @kwargs = kwargs
26
- @kwargs[:tag] = :div
27
- @kwargs[:classes] = class_names(
23
+ # @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
24
+ def initialize(**system_arguments)
25
+ @system_arguments = system_arguments
26
+ @system_arguments[:tag] = :div
27
+ @system_arguments[:classes] = class_names(
28
28
  "Box",
29
- kwargs[:classes]
29
+ system_arguments[:classes]
30
30
  )
31
31
  end
32
32
 
@@ -35,53 +35,53 @@ module Primer
35
35
  end
36
36
 
37
37
  class Header < Primer::Slot
38
- attr_reader :kwargs
39
- # @param kwargs [Hash] <%= link_to_style_arguments_docs %>
40
- def initialize(**kwargs)
41
- @kwargs = kwargs
42
- @kwargs[:tag] = :div
43
- @kwargs[:classes] = class_names(
38
+ attr_reader :system_arguments
39
+ # @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
40
+ def initialize(**system_arguments)
41
+ @system_arguments = system_arguments
42
+ @system_arguments[:tag] = :div
43
+ @system_arguments[:classes] = class_names(
44
44
  "Box-header",
45
- kwargs[:classes]
45
+ system_arguments[:classes]
46
46
  )
47
47
  end
48
48
  end
49
49
 
50
50
  class Body < Primer::Slot
51
- attr_reader :kwargs
52
- # @param kwargs [Hash] <%= link_to_style_arguments_docs %>
53
- def initialize(**kwargs)
54
- @kwargs = kwargs
55
- @kwargs[:tag] = :div
56
- @kwargs[:classes] = class_names(
51
+ attr_reader :system_arguments
52
+ # @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
53
+ def initialize(**system_arguments)
54
+ @system_arguments = system_arguments
55
+ @system_arguments[:tag] = :div
56
+ @system_arguments[:classes] = class_names(
57
57
  "Box-body",
58
- kwargs[:classes]
58
+ system_arguments[:classes]
59
59
  )
60
60
  end
61
61
  end
62
62
 
63
63
  class Footer < Primer::Slot
64
- attr_reader :kwargs
65
- # @param kwargs [Hash] <%= link_to_style_arguments_docs %>
66
- def initialize(**kwargs)
67
- @kwargs = kwargs
68
- @kwargs[:tag] = :div
69
- @kwargs[:classes] = class_names(
64
+ attr_reader :system_arguments
65
+ # @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
66
+ def initialize(**system_arguments)
67
+ @system_arguments = system_arguments
68
+ @system_arguments[:tag] = :div
69
+ @system_arguments[:classes] = class_names(
70
70
  "Box-footer",
71
- kwargs[:classes]
71
+ system_arguments[:classes]
72
72
  )
73
73
  end
74
74
  end
75
75
 
76
76
  class Row < Primer::Slot
77
- attr_reader :kwargs
78
- # @param kwargs [Hash] <%= link_to_style_arguments_docs %>
79
- def initialize(**kwargs)
80
- @kwargs = kwargs
81
- @kwargs[:tag] = :li
82
- @kwargs[:classes] = class_names(
77
+ attr_reader :system_arguments
78
+ # @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
79
+ def initialize(**system_arguments)
80
+ @system_arguments = system_arguments
81
+ @system_arguments[:tag] = :li
82
+ @system_arguments[:classes] = class_names(
83
83
  "Box-row",
84
- kwargs[:classes]
84
+ system_arguments[:classes]
85
85
  )
86
86
  end
87
87
  end
@@ -3,14 +3,14 @@
3
3
  module Primer
4
4
  # A basic wrapper component for most layout related needs.
5
5
  class BoxComponent < Primer::Component
6
- # @param kwargs [Hash] <%= link_to_style_arguments_docs %>
7
- def initialize(**kwargs)
8
- @kwargs = kwargs
9
- @kwargs[:tag] = :div
6
+ # @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
7
+ def initialize(**system_arguments)
8
+ @system_arguments = system_arguments
9
+ @system_arguments[:tag] = :div
10
10
  end
11
11
 
12
12
  def call
13
- render(Primer::BaseComponent.new(**@kwargs)) { content }
13
+ render(Primer::BaseComponent.new(**@system_arguments)) { content }
14
14
  end
15
15
  end
16
16
  end
@@ -1,8 +1,8 @@
1
- <%= render Primer::BaseComponent.new(**@kwargs) do %>
1
+ <%= render Primer::BaseComponent.new(**@system_arguments) do %>
2
2
  <ol>
3
3
  <% items.each do |item| %>
4
4
  <%# The <li> and <a> need to be on the same line to prevent unwanted whitespace %>
5
- <%= render Primer::BaseComponent.new(**item.kwargs) do %><%- if item.href.present? %><a href="<%= item.href %>"><%= item.content %></a><%- else %><%= item.content %><%- end %><%- end %>
5
+ <%= render Primer::BaseComponent.new(**item.system_arguments) do %><%- if item.href.present? %><a href="<%= item.href %>"><%= item.content %></a><%- else %><%= item.content %><%- end %><%- end %>
6
6
  <% end %>
7
7
  </ol>
8
8
  <% end %>
@@ -14,11 +14,11 @@ module Primer
14
14
  # <% component.slot(:item, selected: true) do %>Team<% end %>
15
15
  # <% end %>
16
16
  #
17
- # @param kwargs [Hash] <%= link_to_style_arguments_docs %>
18
- def initialize(**kwargs)
19
- @kwargs = kwargs
20
- @kwargs[:tag] = :nav
21
- @kwargs[:aria] = { label: "Breadcrumb" }
17
+ # @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
18
+ def initialize(**system_arguments)
19
+ @system_arguments = system_arguments
20
+ @system_arguments[:tag] = :nav
21
+ @system_arguments[:aria] = { label: "Breadcrumb" }
22
22
  end
23
23
 
24
24
  def render?
@@ -27,18 +27,18 @@ module Primer
27
27
 
28
28
  # _Note: if both `href` and `selected: true` are passed in, `href` will be ignored and the item will not be rendered as a link._
29
29
  class BreadcrumbItem < Primer::Slot
30
- attr_reader :href, :kwargs
30
+ attr_reader :href, :system_arguments
31
31
 
32
32
  # @param href [String] The URL to link to.
33
33
  # @param selected [Boolean] Whether or not the item is selected and not rendered as a link.
34
- # @param kwargs [Hash] <%= link_to_style_arguments_docs %>
35
- def initialize(href: nil, selected: false, **kwargs)
36
- @href, @kwargs = href, kwargs
34
+ # @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
35
+ def initialize(href: nil, selected: false, **system_arguments)
36
+ @href, @system_arguments = href, system_arguments
37
37
 
38
38
  @href = nil if selected
39
- @kwargs[:tag] = :li
40
- @kwargs[:"aria-current"] = "page" if selected
41
- @kwargs[:classes] = "breadcrumb-item #{@kwargs[:classes]}"
39
+ @system_arguments[:tag] = :li
40
+ @system_arguments[:"aria-current"] = "page" if selected
41
+ @system_arguments[:classes] = "breadcrumb-item #{@system_arguments[:classes]}"
42
42
  end
43
43
  end
44
44
  end
@@ -48,20 +48,20 @@ module Primer
48
48
  tag: DEFAULT_TAG,
49
49
  type: DEFAULT_TYPE,
50
50
  group_item: false,
51
- **kwargs
51
+ **system_arguments
52
52
  )
53
- @kwargs = kwargs
54
- @kwargs[:tag] = fetch_or_fallback(TAG_OPTIONS, tag, DEFAULT_TAG)
53
+ @system_arguments = system_arguments
54
+ @system_arguments[:tag] = fetch_or_fallback(TAG_OPTIONS, tag, DEFAULT_TAG)
55
55
 
56
- if @kwargs[:tag] == :a
57
- @kwargs[:role] = :button
56
+ if @system_arguments[:tag] == :a
57
+ @system_arguments[:role] = :button
58
58
  else
59
- @kwargs[:type] = type
59
+ @system_arguments[:type] = type
60
60
  end
61
61
 
62
- @kwargs[:classes] = class_names(
62
+ @system_arguments[:classes] = class_names(
63
63
  "btn",
64
- kwargs[:classes],
64
+ system_arguments[:classes],
65
65
  BUTTON_TYPE_MAPPINGS[fetch_or_fallback(BUTTON_TYPE_OPTIONS, button_type, DEFAULT_BUTTON_TYPE)],
66
66
  VARIANT_MAPPINGS[fetch_or_fallback(VARIANT_OPTIONS, variant, DEFAULT_VARIANT)],
67
67
  "BtnGroup-item" => group_item
@@ -69,7 +69,7 @@ module Primer
69
69
  end
70
70
 
71
71
  def call
72
- render(Primer::BaseComponent.new(**@kwargs)) { content }
72
+ render(Primer::BaseComponent.new(**@system_arguments)) { content }
73
73
  end
74
74
  end
75
75
  end
@@ -20,7 +20,7 @@ module Primer
20
20
  # @param hide_if_zero [Boolean] If true, a `hidden` attribute is added to the counter if `count` is zero.
21
21
  # @param text [String] Text to display instead of count.
22
22
  # @param round [Boolean] Whether to apply our standard rounding logic to value.
23
- # @param kwargs [Hash] Style arguments to be passed to Primer::Classify
23
+ # @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
24
24
  def initialize(
25
25
  count: 0,
26
26
  scheme: DEFAULT_SCHEME,
@@ -28,23 +28,23 @@ module Primer
28
28
  hide_if_zero: false,
29
29
  text: "",
30
30
  round: false,
31
- **kwargs
31
+ **system_arguments
32
32
  )
33
- @count, @limit, @hide_if_zero, @text, @round, @kwargs = count, limit, hide_if_zero, text, round, kwargs
33
+ @count, @limit, @hide_if_zero, @text, @round, @system_arguments = count, limit, hide_if_zero, text, round, system_arguments
34
34
 
35
- @kwargs[:title] = title
36
- @kwargs[:tag] = :span
37
- @kwargs[:classes] = class_names(
38
- @kwargs[:classes],
35
+ @system_arguments[:title] = title
36
+ @system_arguments[:tag] = :span
37
+ @system_arguments[:classes] = class_names(
38
+ @system_arguments[:classes],
39
39
  SCHEME_MAPPINGS[fetch_or_fallback(SCHEME_MAPPINGS.keys, scheme, DEFAULT_SCHEME)]
40
40
  )
41
41
  if count == 0 && hide_if_zero
42
- @kwargs[:hidden] = true
42
+ @system_arguments[:hidden] = true
43
43
  end
44
44
  end
45
45
 
46
46
  def call
47
- render(Primer::BaseComponent.new(**@kwargs)) { value }
47
+ render(Primer::BaseComponent.new(**@system_arguments)) { value }
48
48
  end
49
49
 
50
50
  private