primer_view_components 0.0.12 → 0.0.17

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +39 -1
  3. data/app/components/primer/avatar_component.rb +11 -11
  4. data/app/components/primer/base_component.rb +102 -9
  5. data/app/components/primer/blankslate_component.html.erb +5 -5
  6. data/app/components/primer/blankslate_component.rb +31 -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/component.rb +1 -0
  14. data/app/components/primer/counter_component.rb +16 -15
  15. data/app/components/primer/details_component.html.erb +1 -1
  16. data/app/components/primer/details_component.rb +15 -15
  17. data/app/components/primer/dropdown_menu_component.html.erb +1 -1
  18. data/app/components/primer/dropdown_menu_component.rb +6 -6
  19. data/app/components/primer/flash_component.html.erb +2 -2
  20. data/app/components/primer/flash_component.rb +14 -16
  21. data/app/components/primer/flex_component.rb +5 -5
  22. data/app/components/primer/flex_item_component.rb +5 -5
  23. data/app/components/primer/heading_component.rb +4 -4
  24. data/app/components/primer/label_component.rb +22 -16
  25. data/app/components/primer/layout_component.html.erb +1 -1
  26. data/app/components/primer/layout_component.rb +6 -6
  27. data/app/components/primer/link_component.rb +9 -9
  28. data/app/components/primer/octicon_component.rb +10 -10
  29. data/app/components/primer/popover_component.html.erb +1 -1
  30. data/app/components/primer/popover_component.rb +27 -27
  31. data/app/components/primer/progress_bar_component.html.erb +2 -2
  32. data/app/components/primer/progress_bar_component.rb +16 -16
  33. data/app/components/primer/slot.rb +1 -0
  34. data/app/components/primer/spinner_component.html.erb +1 -1
  35. data/app/components/primer/spinner_component.rb +9 -9
  36. data/app/components/primer/state_component.rb +8 -8
  37. data/app/components/primer/subhead_component.html.erb +4 -4
  38. data/app/components/primer/subhead_component.rb +26 -26
  39. data/app/components/primer/text_component.rb +5 -5
  40. data/app/components/primer/timeline_item_component.html.erb +4 -4
  41. data/app/components/primer/timeline_item_component.rb +28 -28
  42. data/app/components/primer/underline_nav_component.html.erb +1 -1
  43. data/app/components/primer/underline_nav_component.rb +5 -5
  44. data/app/components/primer/view_components.rb +1 -0
  45. data/lib/primer/classify.rb +7 -6
  46. data/lib/primer/fetch_or_fallback_helper.rb +8 -0
  47. data/lib/primer/join_style_arguments_helper.rb +13 -0
  48. data/lib/primer/view_components/version.rb +1 -1
  49. metadata +3 -2
@@ -1,4 +1,4 @@
1
- <%= render(Primer::FlexComponent.new(**@kwargs)) do %>
1
+ <%= render(Primer::FlexComponent.new(**@system_arguments)) do %>
2
2
  <% if @side == :left %>
3
3
  <%= render Primer::BaseComponent.new(tag: :div, classes: "flex-shrink-0", col: (@responsive ? [12, nil, @sidebar_col] : @sidebar_col), mb: (@responsive ? [4, nil, 0] : nil)) do %>
4
4
  <%= sidebar %>
@@ -27,16 +27,16 @@ module Primer
27
27
  # @param responsive [Boolean] Whether to collapse layout to a single column at smaller widths.
28
28
  # @param side [Symbol] Which side to display the sidebar on. <%= one_of(Primer::LayoutComponent::ALLOWED_SIDES) %>
29
29
  # @param sidebar_col [Integer] Sidebar column width.
30
- # @param kwargs [Hash] <%= link_to_style_arguments_docs %>
31
- def initialize(responsive: false, side: DEFAULT_SIDE, sidebar_col: DEFAULT_SIDEBAR_COL, **kwargs)
32
- @kwargs = kwargs
30
+ # @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
31
+ def initialize(responsive: false, side: DEFAULT_SIDE, sidebar_col: DEFAULT_SIDEBAR_COL, **system_arguments)
32
+ @system_arguments = system_arguments
33
33
  @side = fetch_or_fallback(ALLOWED_SIDES, side, DEFAULT_SIDE)
34
34
  @responsive = responsive
35
- @kwargs[:classes] = class_names(
35
+ @system_arguments[:classes] = class_names(
36
36
  "gutter-condensed gutter-lg",
37
- @kwargs[:classes]
37
+ @system_arguments[:classes]
38
38
  )
39
- @kwargs[:direction] = responsive ? [:column, nil, :row] : nil
39
+ @system_arguments[:direction] = responsive ? [:column, nil, :row] : nil
40
40
 
41
41
  @sidebar_col = fetch_or_fallback(ALLOWED_SIDEBAR_COLS, sidebar_col, DEFAULT_SIDEBAR_COL)
42
42
  @main_col = MAX_COL - @sidebar_col
@@ -11,19 +11,19 @@ module Primer
11
11
  #
12
12
  # @param href [String] URL to be used for the Link
13
13
  # @param muted [Boolean] Uses light gray for Link color, and blue on hover
14
- # @param kwargs [Hash] <%= link_to_style_arguments_docs %>
15
- def initialize(href:, muted: false, **kwargs)
16
- @kwargs = kwargs
17
- @kwargs[:tag] = :a
18
- @kwargs[:href] = href
19
- @kwargs[:classes] = class_names(
20
- @kwargs[:classes],
21
- "muted-link" => fetch_or_fallback([true, false], muted, false)
14
+ # @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
15
+ def initialize(href:, muted: false, **system_arguments)
16
+ @system_arguments = system_arguments
17
+ @system_arguments[:tag] = :a
18
+ @system_arguments[:href] = href
19
+ @system_arguments[:classes] = class_names(
20
+ @system_arguments[:classes],
21
+ "muted-link" => fetch_or_fallback_boolean(muted, false)
22
22
  )
23
23
  end
24
24
 
25
25
  def call
26
- render(Primer::BaseComponent.new(**@kwargs)) { content }
26
+ render(Primer::BaseComponent.new(**@system_arguments)) { content }
27
27
  end
28
28
  end
29
29
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Primer
4
- # Renders an [Octicon](https://primer.style/octicons/) with <%= link_to_style_arguments_docs %>.
4
+ # Renders an [Octicon](https://primer.style/octicons/) with <%= link_to_system_arguments_docs %>.
5
5
  class OcticonComponent < Primer::Component
6
6
  include Primer::ClassNameHelper
7
7
  include OcticonsHelper
@@ -24,22 +24,22 @@ module Primer
24
24
  # <%= render(Primer::OcticonComponent.new(icon: "x", size: :large)) %>
25
25
  #
26
26
  # @param icon [String] Name of [Octicon](https://primer.style/octicons/) to use.
27
- # @param size [Symbol] <%= one_of(Primer::OcticonComponent::SIZE_OPTIONS) %>
28
- # @param kwargs [Hash] <%= link_to_style_arguments_docs %>
29
- def initialize(icon:, size: SIZE_DEFAULT, **kwargs)
30
- @icon, @kwargs = icon, kwargs
27
+ # @param size [Symbol] <%= one_of(Primer::OcticonComponent::SIZE_MAPPINGS) %>
28
+ # @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
29
+ def initialize(icon:, size: SIZE_DEFAULT, **system_arguments)
30
+ @icon, @system_arguments = icon, system_arguments
31
31
 
32
- @kwargs[:class] = Primer::Classify.call(**@kwargs)[:class]
33
- @kwargs[:height] ||= SIZE_MAPPINGS[size]
32
+ @system_arguments[:class] = Primer::Classify.call(**@system_arguments)[:class]
33
+ @system_arguments[:height] ||= SIZE_MAPPINGS[size]
34
34
 
35
35
  # Filter out classify options to prevent them from becoming invalid html attributes.
36
36
  # Note height and width are both classify options and valid html attributes.
37
- octicon_helper_options = @kwargs.slice(:height, :width)
38
- @kwargs = @kwargs.except(*Primer::Classify::VALID_KEYS, :classes).merge(octicon_helper_options)
37
+ octicon_helper_options = @system_arguments.slice(:height, :width)
38
+ @system_arguments = @system_arguments.except(*Primer::Classify::VALID_KEYS, :classes).merge(octicon_helper_options)
39
39
  end
40
40
 
41
41
  def call
42
- octicon(@icon, **@kwargs)
42
+ octicon(@icon, **@system_arguments)
43
43
  end
44
44
  end
45
45
  end
@@ -1,4 +1,4 @@
1
- <%= render Primer::BaseComponent.new(**@kwargs) do %>
1
+ <%= render Primer::BaseComponent.new(**@system_arguments) do %>
2
2
  <%= render body.component do %>
3
3
  <% if heading %>
4
4
  <%= render heading.component do %>
@@ -40,33 +40,33 @@ module Primer
40
40
  # <% end %>
41
41
  # <% end %>
42
42
  #
43
- # @param kwargs [Hash] <%= link_to_style_arguments_docs %>
44
- def initialize(**kwargs)
45
- @kwargs = kwargs
46
- @kwargs[:tag] ||= :div
47
- @kwargs[:classes] = class_names(
48
- kwargs[:classes],
43
+ # @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
44
+ def initialize(**system_arguments)
45
+ @system_arguments = system_arguments
46
+ @system_arguments[:tag] ||= :div
47
+ @system_arguments[:classes] = class_names(
48
+ system_arguments[:classes],
49
49
  "Popover"
50
50
  )
51
- @kwargs[:position] ||= :relative
52
- @kwargs[:right] = false unless kwargs.key?(:right)
53
- @kwargs[:left] = false unless kwargs.key?(:left)
51
+ @system_arguments[:position] ||= :relative
52
+ @system_arguments[:right] = false unless system_arguments.key?(:right)
53
+ @system_arguments[:left] = false unless system_arguments.key?(:left)
54
54
  end
55
55
 
56
56
  def render?
57
57
  body.present?
58
58
  end
59
59
 
60
- class Heading < ViewComponent::Slot
61
- # @param kwargs [Hash] <%= link_to_style_arguments_docs %>
62
- def initialize(**kwargs)
63
- @kwargs = kwargs
64
- @kwargs[:mb] ||= 2
65
- @kwargs[:tag] ||= :h4
60
+ class Heading < Primer::Slot
61
+ # @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
62
+ def initialize(**system_arguments)
63
+ @system_arguments = system_arguments
64
+ @system_arguments[:mb] ||= 2
65
+ @system_arguments[:tag] ||= :h4
66
66
  end
67
67
 
68
68
  def component
69
- Primer::HeadingComponent.new(**@kwargs)
69
+ Primer::HeadingComponent.new(**@system_arguments)
70
70
  end
71
71
  end
72
72
 
@@ -89,24 +89,24 @@ module Primer
89
89
 
90
90
  # @param caret [Symbol] <%= one_of(Primer::PopoverComponent::Body::CARET_MAPPINGS.keys) %>
91
91
  # @param large [Boolean] Whether to use the large version of the component.
92
- # @param kwargs [Hash] <%= link_to_style_arguments_docs %>
93
- def initialize(caret: CARET_DEFAULT, large: false, **kwargs)
94
- @kwargs = kwargs
95
- @kwargs[:classes] = class_names(
96
- kwargs[:classes],
92
+ # @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
93
+ def initialize(caret: CARET_DEFAULT, large: false, **system_arguments)
94
+ @system_arguments = system_arguments
95
+ @system_arguments[:classes] = class_names(
96
+ system_arguments[:classes],
97
97
  "Popover-message Box",
98
98
  CARET_MAPPINGS[fetch_or_fallback(CARET_MAPPINGS.keys, caret, CARET_DEFAULT)],
99
99
  "Popover-message--large" => large
100
100
  )
101
- @kwargs[:p] ||= 4
102
- @kwargs[:mt] ||= 2
103
- @kwargs[:mx] ||= :auto
104
- @kwargs[:text_align] ||= :left
105
- @kwargs[:box_shadow] ||= :large
101
+ @system_arguments[:p] ||= 4
102
+ @system_arguments[:mt] ||= 2
103
+ @system_arguments[:mx] ||= :auto
104
+ @system_arguments[:text_align] ||= :left
105
+ @system_arguments[:box_shadow] ||= :large
106
106
  end
107
107
 
108
108
  def component
109
- Primer::BoxComponent.new(**@kwargs)
109
+ Primer::BoxComponent.new(**@system_arguments)
110
110
  end
111
111
  end
112
112
  end
@@ -1,5 +1,5 @@
1
- <%= render Primer::BaseComponent.new(**@kwargs) do %>
1
+ <%= render Primer::BaseComponent.new(**@system_arguments) do %>
2
2
  <% items.each do |item| %>
3
- <%= render Primer::BaseComponent.new(**item.kwargs) %>
3
+ <%= render Primer::BaseComponent.new(**item.system_arguments) %>
4
4
  <% end %>
5
5
  <% end %>
@@ -39,15 +39,15 @@ module Primer
39
39
  # <% end %>
40
40
  #
41
41
  # @param size [Symbol] <%= one_of(Primer::ProgressBarComponent::SIZE_OPTIONS) %> Increases height.
42
- # @param kwargs [Hash] <%= link_to_style_arguments_docs %>
43
- def initialize(size: SIZE_DEFAULT, **kwargs)
44
- @kwargs = kwargs
45
- @kwargs[:classes] = class_names(
46
- @kwargs[:classes],
42
+ # @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
43
+ def initialize(size: SIZE_DEFAULT, **system_arguments)
44
+ @system_arguments = system_arguments
45
+ @system_arguments[:classes] = class_names(
46
+ @system_arguments[:classes],
47
47
  "Progress",
48
48
  SIZE_MAPPINGS[fetch_or_fallback(SIZE_OPTIONS, size, SIZE_DEFAULT)]
49
49
  )
50
- @kwargs[:tag] = :span
50
+ @system_arguments[:tag] = :span
51
51
 
52
52
  end
53
53
 
@@ -55,21 +55,21 @@ module Primer
55
55
  items.any?
56
56
  end
57
57
 
58
- class Item < ViewComponent::Slot
59
- include ClassNameHelper
60
- attr_reader :kwargs
58
+ class Item < Primer::Slot
59
+ attr_reader :system_arguments
61
60
 
62
61
  # @param percentage [Integer] Percentage completion of item.
63
62
  # @param bg [Symbol] Color of item.
64
- # @param kwargs [Hash] <%= link_to_style_arguments_docs %>
65
- def initialize(percentage: 0, bg: :green, **kwargs)
63
+ # @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
64
+ def initialize(percentage: 0, bg: :green, **system_arguments)
66
65
  @percentage = percentage
67
- @kwargs = kwargs
66
+ @system_arguments = system_arguments
68
67
 
69
- @kwargs[:tag] = :span
70
- @kwargs[:bg] = bg
71
- @kwargs[:style] = "width: #{@percentage}%;"
72
- @kwargs[:classes] = class_names("Progress-item", @kwargs[:classes])
68
+ @system_arguments[:tag] = :span
69
+ @system_arguments[:bg] = bg
70
+ @system_arguments[:style] =
71
+ join_style_arguments(@system_arguments[:style], "width: #{@percentage}%;")
72
+ @system_arguments[:classes] = class_names("Progress-item", @system_arguments[:classes])
73
73
  end
74
74
  end
75
75
  end
@@ -5,5 +5,6 @@ module Primer
5
5
  class Slot < ViewComponent::Slot
6
6
  include ClassNameHelper
7
7
  include FetchOrFallbackHelper
8
+ include JoinStyleArgumentsHelper
8
9
  end
9
10
  end
@@ -1,4 +1,4 @@
1
- <%= render Primer::BaseComponent.new(**@kwargs) do %>
1
+ <%= render Primer::BaseComponent.new(**@system_arguments) do %>
2
2
  <circle cx="8" cy="8" r="7" stroke="currentColor" stroke-opacity="0.25" stroke-width="2" vector-effect="non-scaling-stroke" />
3
3
  <path d="M15 8a7.002 7.002 0 00-7-7" stroke="currentColor" stroke-width="2" stroke-linecap="round" vector-effect="non-scaling-stroke">
4
4
  <animateTransform attributeName="transform" type="rotate" from="0 8 8" to="360 8 8" dur="1s" repeatCount="indefinite" />
@@ -25,15 +25,15 @@ module Primer
25
25
  # @example 80|Large
26
26
  # <%= render(Primer::SpinnerComponent.new(size: :large)) %>
27
27
  #
28
- # @param size [Symbol] <%= one_of(Primer::SpinnerComponent::SIZE_OPTIONS) %>
29
- def initialize(size: DEFAULT_SIZE, style: DEFAULT_STYLE, **kwargs)
30
- @kwargs = kwargs
31
- @kwargs[:tag] = :svg
32
- @kwargs[:width] = SIZE_MAPPINGS[fetch_or_fallback(SIZE_OPTIONS, size, DEFAULT_SIZE)]
33
- @kwargs[:height] = SIZE_MAPPINGS[fetch_or_fallback(SIZE_OPTIONS, size, DEFAULT_SIZE)]
34
- @kwargs[:viewBox] = "0 0 16 16"
35
- @kwargs[:fill] = :none
36
- @kwargs[:style] = DEFAULT_STYLE unless style.nil?
28
+ # @param size [Symbol] <%= one_of(Primer::SpinnerComponent::SIZE_MAPPINGS) %>
29
+ def initialize(size: DEFAULT_SIZE, **system_arguments)
30
+ @system_arguments = system_arguments
31
+ @system_arguments[:tag] = :svg
32
+ @system_arguments[:style] ||= DEFAULT_STYLE
33
+ @system_arguments[:width] = SIZE_MAPPINGS[fetch_or_fallback(SIZE_OPTIONS, size, DEFAULT_SIZE)]
34
+ @system_arguments[:height] = SIZE_MAPPINGS[fetch_or_fallback(SIZE_OPTIONS, size, DEFAULT_SIZE)]
35
+ @system_arguments[:viewBox] = "0 0 16 16"
36
+ @system_arguments[:fill] = :none
37
37
  end
38
38
  end
39
39
  end
@@ -39,19 +39,19 @@ module Primer
39
39
  # @param color [Symbol] Background color. <%= one_of(Primer::StateComponent::COLOR_OPTIONS) %>
40
40
  # @param tag [Symbol] HTML tag for element. <%= one_of(Primer::StateComponent::TAG_OPTIONS) %>
41
41
  # @param size [Symbol] <%= one_of(Primer::StateComponent::SIZE_OPTIONS) %>
42
- # @param kwargs [Hash] <%= link_to_style_arguments_docs %>
42
+ # @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
43
43
  def initialize(
44
44
  title:,
45
45
  color: COLOR_DEFAULT,
46
46
  tag: TAG_DEFAULT,
47
47
  size: SIZE_DEFAULT,
48
- **kwargs
48
+ **system_arguments
49
49
  )
50
- @kwargs = kwargs
51
- @kwargs[:title] = title
52
- @kwargs[:tag] = fetch_or_fallback(TAG_OPTIONS, tag, TAG_DEFAULT)
53
- @kwargs[:classes] = class_names(
54
- @kwargs[:classes],
50
+ @system_arguments = system_arguments
51
+ @system_arguments[:title] = title
52
+ @system_arguments[:tag] = fetch_or_fallback(TAG_OPTIONS, tag, TAG_DEFAULT)
53
+ @system_arguments[:classes] = class_names(
54
+ @system_arguments[:classes],
55
55
  "State",
56
56
  COLOR_MAPPINGS[fetch_or_fallback(COLOR_OPTIONS, color, COLOR_DEFAULT)],
57
57
  SIZE_MAPPINGS[fetch_or_fallback(SIZE_OPTIONS, size, SIZE_DEFAULT)]
@@ -59,7 +59,7 @@ module Primer
59
59
  end
60
60
 
61
61
  def call
62
- render(Primer::BaseComponent.new(**@kwargs)) { content }
62
+ render(Primer::BaseComponent.new(**@system_arguments)) { content }
63
63
  end
64
64
  end
65
65
  end
@@ -1,16 +1,16 @@
1
- <%= render Primer::BaseComponent.new(**@kwargs) do %>
1
+ <%= render Primer::BaseComponent.new(**@system_arguments) do %>
2
2
  <% if heading.present? %>
3
- <%= render Primer::BaseComponent.new(**heading.kwargs) do %>
3
+ <%= render Primer::BaseComponent.new(**heading.system_arguments) do %>
4
4
  <%= heading.content %>
5
5
  <% end %>
6
6
  <% end %>
7
7
  <% if actions.present? %>
8
- <%= render Primer::BaseComponent.new(**actions.kwargs) do %>
8
+ <%= render Primer::BaseComponent.new(**actions.system_arguments) do %>
9
9
  <%= actions.content %>
10
10
  <% end %>
11
11
  <% end %>
12
12
  <% if description.present? %>
13
- <%= render Primer::BaseComponent.new(**description.kwargs) do %>
13
+ <%= render Primer::BaseComponent.new(**description.system_arguments) do %>
14
14
  <%= description.content %>
15
15
  <% end %>
16
16
  <% end %>
@@ -48,19 +48,19 @@ module Primer
48
48
  #
49
49
  # @param spacious [Boolean] Whether to add spacing to the Subhead.
50
50
  # @param hide_border [Boolean] Whether to hide the border under the heading.
51
- # @param kwargs [Hash] <%= link_to_style_arguments_docs %>
52
- def initialize(spacious: false, hide_border: false, **kwargs)
53
- @kwargs = kwargs
51
+ # @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
52
+ def initialize(spacious: false, hide_border: false, **system_arguments)
53
+ @system_arguments = system_arguments
54
54
 
55
- @kwargs[:tag] = :div
56
- @kwargs[:classes] =
55
+ @system_arguments[:tag] = :div
56
+ @system_arguments[:classes] =
57
57
  class_names(
58
- @kwargs[:classes],
58
+ @system_arguments[:classes],
59
59
  "Subhead hx_Subhead--responsive",
60
60
  "Subhead--spacious": spacious,
61
61
  "border-bottom-0": hide_border
62
62
  )
63
- @kwargs[:mb] ||= hide_border ? 0 : nil
63
+ @system_arguments[:mb] ||= hide_border ? 0 : nil
64
64
  end
65
65
 
66
66
  def render?
@@ -70,15 +70,15 @@ module Primer
70
70
  class Heading < ViewComponent::Slot
71
71
  include ClassNameHelper
72
72
 
73
- attr_reader :kwargs
73
+ attr_reader :system_arguments
74
74
 
75
75
  # @param danger [Boolean] Whether to style the heading as dangerous.
76
- # @param kwargs [Hash] <%= link_to_style_arguments_docs %>
77
- def initialize(danger: false, **kwargs)
78
- @kwargs = kwargs
79
- @kwargs[:tag] ||= :div
80
- @kwargs[:classes] = class_names(
81
- @kwargs[:classes],
76
+ # @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
77
+ def initialize(danger: false, **system_arguments)
78
+ @system_arguments = system_arguments
79
+ @system_arguments[:tag] ||= :div
80
+ @system_arguments[:classes] = class_names(
81
+ @system_arguments[:classes],
82
82
  "Subhead-heading",
83
83
  "Subhead-heading--danger": danger
84
84
  )
@@ -88,26 +88,26 @@ module Primer
88
88
  class Actions < ViewComponent::Slot
89
89
  include ClassNameHelper
90
90
 
91
- attr_reader :kwargs
91
+ attr_reader :system_arguments
92
92
 
93
- # @param kwargs [Hash] <%= link_to_style_arguments_docs %>
94
- def initialize(**kwargs)
95
- @kwargs = kwargs
96
- @kwargs[:tag] = :div
97
- @kwargs[:classes] = class_names(@kwargs[:classes], "Subhead-actions")
93
+ # @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
94
+ def initialize(**system_arguments)
95
+ @system_arguments = system_arguments
96
+ @system_arguments[:tag] = :div
97
+ @system_arguments[:classes] = class_names(@system_arguments[:classes], "Subhead-actions")
98
98
  end
99
99
  end
100
100
 
101
101
  class Description < ViewComponent::Slot
102
102
  include ClassNameHelper
103
103
 
104
- attr_reader :kwargs
104
+ attr_reader :system_arguments
105
105
 
106
- # @param kwargs [Hash] <%= link_to_style_arguments_docs %>
107
- def initialize(**kwargs)
108
- @kwargs = kwargs
109
- @kwargs[:tag] = :div
110
- @kwargs[:classes] = class_names(@kwargs[:classes], "Subhead-description")
106
+ # @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
107
+ def initialize(**system_arguments)
108
+ @system_arguments = system_arguments
109
+ @system_arguments[:tag] = :div
110
+ @system_arguments[:classes] = class_names(@system_arguments[:classes], "Subhead-description")
111
111
  end
112
112
  end
113
113
  end
@@ -7,14 +7,14 @@ module Primer
7
7
  # <%= render(Primer::TextComponent.new(tag: :p, font_weight: :bold)) { "Bold Text" } %>
8
8
  # <%= render(Primer::TextComponent.new(tag: :p, color: :red_5)) { "Red Text" } %>
9
9
  #
10
- # @param kwargs [Hash] <%= link_to_style_arguments_docs %>
11
- def initialize(**kwargs)
12
- @kwargs = kwargs
13
- @kwargs[:tag] ||= :span
10
+ # @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
11
+ def initialize(**system_arguments)
12
+ @system_arguments = system_arguments
13
+ @system_arguments[:tag] ||= :span
14
14
  end
15
15
 
16
16
  def call
17
- render(Primer::BaseComponent.new(**@kwargs)) { content }
17
+ render(Primer::BaseComponent.new(**@system_arguments)) { content }
18
18
  end
19
19
  end
20
20
  end