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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +35 -1
- data/README.md +2 -175
- data/app/components/primer/avatar_component.rb +11 -11
- data/app/components/primer/base_component.rb +101 -9
- data/app/components/primer/blankslate_component.html.erb +1 -1
- data/app/components/primer/blankslate_component.rb +6 -6
- data/app/components/primer/border_box_component.html.erb +5 -5
- data/app/components/primer/border_box_component.rb +45 -33
- data/app/components/primer/box_component.rb +6 -4
- data/app/components/primer/breadcrumb_component.html.erb +2 -2
- data/app/components/primer/breadcrumb_component.rb +23 -30
- data/app/components/primer/button_component.rb +26 -9
- data/app/components/primer/component.rb +1 -0
- data/app/components/primer/counter_component.rb +16 -15
- data/app/components/primer/details_component.html.erb +1 -1
- data/app/components/primer/details_component.rb +18 -18
- data/app/components/primer/dropdown_menu_component.html.erb +1 -1
- data/app/components/primer/dropdown_menu_component.rb +6 -6
- data/app/components/primer/flash_component.html.erb +2 -2
- data/app/components/primer/flash_component.rb +42 -12
- data/app/components/primer/flex_component.rb +5 -5
- data/app/components/primer/flex_item_component.rb +5 -5
- data/app/components/primer/heading_component.rb +4 -4
- data/app/components/primer/label_component.rb +37 -14
- data/app/components/primer/layout_component.html.erb +1 -1
- data/app/components/primer/layout_component.rb +22 -5
- data/app/components/primer/link_component.rb +17 -7
- data/app/components/primer/octicon_component.rb +20 -7
- data/app/components/primer/popover_component.html.erb +1 -1
- data/app/components/primer/popover_component.rb +61 -23
- data/app/components/primer/progress_bar_component.html.erb +2 -2
- data/app/components/primer/progress_bar_component.rb +40 -30
- data/app/components/primer/slot.rb +1 -0
- data/app/components/primer/spinner_component.html.erb +1 -1
- data/app/components/primer/spinner_component.rb +12 -11
- data/app/components/primer/state_component.rb +26 -14
- data/app/components/primer/subhead_component.html.erb +4 -4
- data/app/components/primer/subhead_component.rb +68 -43
- data/app/components/primer/text_component.rb +10 -4
- data/app/components/primer/timeline_item_component.html.erb +4 -4
- data/app/components/primer/timeline_item_component.rb +48 -24
- data/app/components/primer/underline_nav_component.html.erb +1 -1
- data/app/components/primer/underline_nav_component.rb +5 -5
- data/lib/primer/classify.rb +7 -6
- data/lib/primer/view_components/version.rb +1 -1
- metadata +3 -3
@@ -7,13 +7,13 @@ module Primer
|
|
7
7
|
|
8
8
|
with_content_areas :body, :actions
|
9
9
|
|
10
|
-
def initialize(align: ALIGN_DEFAULT, **
|
10
|
+
def initialize(align: ALIGN_DEFAULT, **system_arguments)
|
11
11
|
@align = fetch_or_fallback(ALIGN_OPTIONS, align, ALIGN_DEFAULT)
|
12
12
|
|
13
|
-
@
|
14
|
-
@
|
15
|
-
@
|
16
|
-
@
|
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
|
)
|
data/lib/primer/classify.rb
CHANGED
@@ -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
|
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.
|
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-
|
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.
|
263
|
+
rubygems_version: 3.1.2
|
264
264
|
signing_key:
|
265
265
|
specification_version: 4
|
266
266
|
summary: ViewComponents for the Primer Design System
|