primer_view_components 0.0.10 → 0.0.15

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 (47) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +35 -1
  3. data/README.md +2 -175
  4. data/app/components/primer/avatar_component.rb +11 -11
  5. data/app/components/primer/base_component.rb +101 -9
  6. data/app/components/primer/blankslate_component.html.erb +1 -1
  7. data/app/components/primer/blankslate_component.rb +6 -6
  8. data/app/components/primer/border_box_component.html.erb +5 -5
  9. data/app/components/primer/border_box_component.rb +45 -33
  10. data/app/components/primer/box_component.rb +6 -4
  11. data/app/components/primer/breadcrumb_component.html.erb +2 -2
  12. data/app/components/primer/breadcrumb_component.rb +23 -30
  13. data/app/components/primer/button_component.rb +26 -9
  14. data/app/components/primer/component.rb +1 -0
  15. data/app/components/primer/counter_component.rb +16 -15
  16. data/app/components/primer/details_component.html.erb +1 -1
  17. data/app/components/primer/details_component.rb +18 -18
  18. data/app/components/primer/dropdown_menu_component.html.erb +1 -1
  19. data/app/components/primer/dropdown_menu_component.rb +6 -6
  20. data/app/components/primer/flash_component.html.erb +2 -2
  21. data/app/components/primer/flash_component.rb +42 -12
  22. data/app/components/primer/flex_component.rb +5 -5
  23. data/app/components/primer/flex_item_component.rb +5 -5
  24. data/app/components/primer/heading_component.rb +4 -4
  25. data/app/components/primer/label_component.rb +37 -14
  26. data/app/components/primer/layout_component.html.erb +1 -1
  27. data/app/components/primer/layout_component.rb +22 -5
  28. data/app/components/primer/link_component.rb +17 -7
  29. data/app/components/primer/octicon_component.rb +20 -7
  30. data/app/components/primer/popover_component.html.erb +1 -1
  31. data/app/components/primer/popover_component.rb +61 -23
  32. data/app/components/primer/progress_bar_component.html.erb +2 -2
  33. data/app/components/primer/progress_bar_component.rb +40 -30
  34. data/app/components/primer/slot.rb +1 -0
  35. data/app/components/primer/spinner_component.html.erb +1 -1
  36. data/app/components/primer/spinner_component.rb +12 -11
  37. data/app/components/primer/state_component.rb +26 -14
  38. data/app/components/primer/subhead_component.html.erb +4 -4
  39. data/app/components/primer/subhead_component.rb +68 -43
  40. data/app/components/primer/text_component.rb +10 -4
  41. data/app/components/primer/timeline_item_component.html.erb +4 -4
  42. data/app/components/primer/timeline_item_component.rb +48 -24
  43. data/app/components/primer/underline_nav_component.html.erb +1 -1
  44. data/app/components/primer/underline_nav_component.rb +5 -5
  45. data/lib/primer/classify.rb +7 -6
  46. data/lib/primer/view_components/version.rb +1 -1
  47. metadata +3 -3
@@ -1,4 +1,4 @@
1
- <%= render Primer::BaseComponent.new(**@kwargs) do %>
1
+ <%= render Primer::BaseComponent.new(**@system_arguments) do %>
2
2
  <% if actions && @align == :right %>
3
3
  <%= actions %>
4
4
  <% end %>
@@ -7,13 +7,13 @@ module Primer
7
7
 
8
8
  with_content_areas :body, :actions
9
9
 
10
- def initialize(align: ALIGN_DEFAULT, **kwargs)
10
+ def initialize(align: ALIGN_DEFAULT, **system_arguments)
11
11
  @align = fetch_or_fallback(ALIGN_OPTIONS, align, ALIGN_DEFAULT)
12
12
 
13
- @kwargs = kwargs
14
- @kwargs[:tag] = :nav
15
- @kwargs[:classes] = class_names(
16
- @kwargs[:classes],
13
+ @system_arguments = system_arguments
14
+ @system_arguments[:tag] = :nav
15
+ @system_arguments[:classes] = class_names(
16
+ @system_arguments[:classes],
17
17
  "UnderlineNav",
18
18
  "UnderlineNav--right" => @align == :right
19
19
  )
@@ -9,7 +9,7 @@ module Primer
9
9
  ALIGN_ITEMS_KEY = :align_items
10
10
  DISPLAY_KEY = :display
11
11
  RESPONSIVE_KEYS = ([DISPLAY_KEY, DIRECTION_KEY, JUSTIFY_CONTENT_KEY, ALIGN_ITEMS_KEY, :col, :float] + SPACING_KEYS).freeze
12
- BREAKPOINTS = ["", "-sm", "-md", "-lg"]
12
+ BREAKPOINTS = ["", "-sm", "-md", "-lg", "-xl"]
13
13
 
14
14
  # Keys where we can simply translate { key: value } into ".key-value"
15
15
  CONCAT_KEYS = SPACING_KEYS + [:hide, :position, :v, :float, :col, :text, :box_shadow].freeze
@@ -29,7 +29,7 @@ module Primer
29
29
  WIDTH_KEY = :width
30
30
  HEIGHT_KEY = :height
31
31
  BOX_SHADOW_KEY = :box_shadow
32
-
32
+ VISIBILITY_KEY = :visibility
33
33
 
34
34
  BOOLEAN_MAPPINGS = {
35
35
  underline: {
@@ -102,7 +102,8 @@ module Primer
102
102
  ALIGN_SELF_KEY,
103
103
  WIDTH_KEY,
104
104
  HEIGHT_KEY,
105
- BOX_SHADOW_KEY
105
+ BOX_SHADOW_KEY,
106
+ VISIBILITY_KEY
106
107
  ]
107
108
  ).freeze
108
109
 
@@ -131,9 +132,7 @@ module Primer
131
132
 
132
133
  if invalid_class_names.any?
133
134
  raise ArgumentError.new(
134
- "Primer CSS class #{'name'.pluralize(invalid_class_names.length)} \
135
- #{invalid_class_names.to_sentence} #{'is'.pluralize(invalid_class_names.length)} \
136
- not allowed, use style arguments instead (https://github.com/primer/view_components#built-in-styling-arguments). This warning will not be raised in production.",
135
+ "Use System Arguments (https://primer.style/view-components/system-arguments) instead of Primer CSS class #{'name'.pluralize(invalid_class_names.length)} #{invalid_class_names.to_sentence}. This warning will not be raised in production.",
137
136
  )
138
137
  end
139
138
  end
@@ -233,6 +232,8 @@ module Primer
233
232
  else
234
233
  memo[:classes] << "box-shadow-#{dasherized_val}"
235
234
  end
235
+ elsif key == VISIBILITY_KEY
236
+ memo[:classes] << "v-#{dasherized_val}"
236
237
  else
237
238
  memo[:classes] << "#{key.to_s.dasherize}#{breakpoint}-#{dasherized_val}"
238
239
  end
@@ -5,7 +5,7 @@ module Primer
5
5
  module VERSION
6
6
  MAJOR = 0
7
7
  MINOR = 0
8
- PATCH = 10
8
+ PATCH = 15
9
9
 
10
10
  STRING = [MAJOR, MINOR, PATCH].join(".")
11
11
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: primer_view_components
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - GitHub Open Source
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-19 00:00:00.000000000 Z
11
+ date: 2020-11-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -260,7 +260,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
260
260
  - !ruby/object:Gem::Version
261
261
  version: '0'
262
262
  requirements: []
263
- rubygems_version: 3.0.3
263
+ rubygems_version: 3.1.2
264
264
  signing_key:
265
265
  specification_version: 4
266
266
  summary: ViewComponents for the Primer Design System