primer_view_components 0.0.89 → 0.0.90
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +18 -0
- data/app/assets/javascripts/primer_view_components.js +1 -1
- data/app/assets/javascripts/primer_view_components.js.map +1 -1
- data/app/components/primer/alpha/auto_complete.rb +2 -2
- data/app/components/primer/alpha/layout.rb +34 -32
- data/app/components/primer/alpha/tab_nav.rb +20 -20
- data/app/components/primer/alpha/tab_panels.rb +2 -2
- data/app/components/primer/alpha/tool-tip-element.d.ts +1 -3
- data/app/components/primer/alpha/tool-tip-element.js +13 -19
- data/app/components/primer/alpha/tool-tip-element.ts +14 -22
- data/app/components/primer/alpha/tooltip.rb +1 -1
- data/app/components/primer/alpha/underline_nav.rb +16 -16
- data/app/components/primer/alpha/underline_panels.rb +3 -3
- data/app/components/primer/beta/auto_complete/item.rb +2 -2
- data/app/components/primer/beta/auto_complete.rb +2 -2
- data/app/components/primer/beta/avatar_stack.rb +9 -9
- data/app/components/primer/beta/border_box/header.rb +4 -2
- data/app/components/primer/beta/border_box.rb +13 -13
- data/app/components/primer/beta/breadcrumbs.rb +3 -3
- data/app/components/primer/beta/button_group.rb +9 -9
- data/app/components/primer/beta/close_button.rb +41 -0
- data/app/components/primer/beta/counter.rb +113 -0
- data/app/components/primer/beta/flash.rb +1 -1
- data/app/components/primer/beta/truncate.rb +17 -17
- data/app/components/primer/blankslate_component.rb +1 -1
- data/app/components/primer/button_component.rb +8 -8
- data/app/components/primer/close_button.rb +2 -34
- data/app/components/primer/counter_component.rb +2 -106
- data/app/components/primer/details_component.rb +2 -2
- data/app/components/primer/dropdown.rb +14 -14
- data/app/components/primer/image_crop.rb +1 -1
- data/app/components/primer/layout_component.rb +4 -4
- data/app/components/primer/link_component.rb +1 -1
- data/app/components/primer/menu_component.rb +5 -5
- data/app/components/primer/navigation/tab_component.rb +12 -12
- data/app/components/primer/popover_component.rb +8 -8
- data/app/components/primer/subhead_component.rb +10 -10
- data/app/components/primer/timeline_item_component.rb +3 -3
- data/app/lib/primer/join_style_arguments_helper.rb +1 -1
- data/lib/primer/view_components/linters/argument_mappers/close_button.rb +2 -2
- data/lib/primer/view_components/linters/close_button_component_migration_counter.rb +2 -2
- data/lib/primer/view_components/linters/helpers/deprecated_components_helpers.rb +2 -0
- data/lib/primer/view_components/version.rb +1 -1
- data/lib/rubocop/cop/primer/component_name_migration.rb +2 -0
- data/lib/tasks/docs.rake +2 -2
- data/static/arguments.yml +44 -44
- data/static/audited_at.json +2 -0
- data/static/constants.json +26 -22
- data/static/statuses.json +5 -3
- metadata +4 -2
@@ -25,11 +25,11 @@ module Primer
|
|
25
25
|
|
26
26
|
# @example Default
|
27
27
|
# <%= render(Primer::Dropdown.new) do |c| %>
|
28
|
-
# <% c.
|
28
|
+
# <% c.with_button do %>
|
29
29
|
# Dropdown
|
30
30
|
# <% end %>
|
31
31
|
#
|
32
|
-
# <% c.
|
32
|
+
# <% c.with_menu(header: "Options") do |menu|
|
33
33
|
# menu.item { "Item 1" }
|
34
34
|
# menu.item { "Item 2" }
|
35
35
|
# menu.item { "Item 3" }
|
@@ -42,11 +42,11 @@ module Primer
|
|
42
42
|
# Dividers can be used to separate a group of items. They don't have any content.
|
43
43
|
# @code
|
44
44
|
# <%= render(Primer::Dropdown.new) do |c| %>
|
45
|
-
# <% c.
|
45
|
+
# <% c.with_button do %>
|
46
46
|
# Dropdown
|
47
47
|
# <% end %>
|
48
48
|
#
|
49
|
-
# <% c.
|
49
|
+
# <% c.with_menu(header: "Options") do |menu|
|
50
50
|
# menu.item { "Item 1" }
|
51
51
|
# menu.item { "Item 2" }
|
52
52
|
# menu.item(divider: true)
|
@@ -60,11 +60,11 @@ module Primer
|
|
60
60
|
#
|
61
61
|
# @example With direction
|
62
62
|
# <%= render(Primer::Dropdown.new(display: :inline_block)) do |c| %>
|
63
|
-
# <% c.
|
63
|
+
# <% c.with_button do %>
|
64
64
|
# Dropdown
|
65
65
|
# <% end %>
|
66
66
|
#
|
67
|
-
# <% c.
|
67
|
+
# <% c.with_menu(header: "Options", direction: :s) do |menu|
|
68
68
|
# menu.item { "Item 1" }
|
69
69
|
# menu.item { "Item 2" }
|
70
70
|
# menu.item { "Item 3" }
|
@@ -74,11 +74,11 @@ module Primer
|
|
74
74
|
#
|
75
75
|
# @example With caret
|
76
76
|
# <%= render(Primer::Dropdown.new(with_caret: true)) do |c| %>
|
77
|
-
# <% c.
|
77
|
+
# <% c.with_button do %>
|
78
78
|
# Dropdown
|
79
79
|
# <% end %>
|
80
80
|
#
|
81
|
-
# <% c.
|
81
|
+
# <% c.with_menu(header: "Options") do |menu|
|
82
82
|
# menu.item { "Item 1" }
|
83
83
|
# menu.item { "Item 2" }
|
84
84
|
# menu.item { "Item 3" }
|
@@ -88,11 +88,11 @@ module Primer
|
|
88
88
|
#
|
89
89
|
# @example Customizing the button
|
90
90
|
# <%= render(Primer::Dropdown.new) do |c| %>
|
91
|
-
# <% c.
|
91
|
+
# <% c.with_button(scheme: :primary, size: :small) do %>
|
92
92
|
# Dropdown
|
93
93
|
# <% end %>
|
94
94
|
#
|
95
|
-
# <% c.
|
95
|
+
# <% c.with_menu(header: "Options") do |menu|
|
96
96
|
# menu.item { "Item 1" }
|
97
97
|
# menu.item { "Item 2" }
|
98
98
|
# menu.item { "Item 3" }
|
@@ -102,11 +102,11 @@ module Primer
|
|
102
102
|
#
|
103
103
|
# @example Menu as list
|
104
104
|
# <%= render(Primer::Dropdown.new) do |c| %>
|
105
|
-
# <% c.
|
105
|
+
# <% c.with_button do %>
|
106
106
|
# Dropdown
|
107
107
|
# <% end %>
|
108
108
|
#
|
109
|
-
# <% c.
|
109
|
+
# <% c.with_menu(as: :list, header: "Options") do |menu|
|
110
110
|
# menu.item { "Item 1" }
|
111
111
|
# menu.item { "Item 2" }
|
112
112
|
# menu.item(divider: true)
|
@@ -117,11 +117,11 @@ module Primer
|
|
117
117
|
#
|
118
118
|
# @example Customizing menu items
|
119
119
|
# <%= render(Primer::Dropdown.new) do |c| %>
|
120
|
-
# <% c.
|
120
|
+
# <% c.with_button do %>
|
121
121
|
# Dropdown
|
122
122
|
# <% end %>
|
123
123
|
#
|
124
|
-
# <% c.
|
124
|
+
# <% c.with_menu(header: "Options") do |menu|
|
125
125
|
# menu.item(tag: :button) { "Item 1" }
|
126
126
|
# menu.item(classes: "custom-class") { "Item 2" }
|
127
127
|
# menu.item { "Item 3" }
|
@@ -21,7 +21,7 @@ module Primer
|
|
21
21
|
#
|
22
22
|
# @example Cropper with a custom loader
|
23
23
|
# <%= render(Primer::ImageCrop.new(src: "https://github.com/koddsson.png", rounded: false)) do |cropper| %>
|
24
|
-
# <% cropper.
|
24
|
+
# <% cropper.with_loading(style: "width: 120px").with_content("Loading...") %>
|
25
25
|
# <% end %>
|
26
26
|
#
|
27
27
|
# @param src [String] The path of the image to crop.
|
@@ -38,14 +38,14 @@ module Primer
|
|
38
38
|
|
39
39
|
# @example Default
|
40
40
|
# <%= render(Primer::LayoutComponent.new) do |component| %>
|
41
|
-
# <% component.
|
42
|
-
# <% component.
|
41
|
+
# <% component.with_sidebar { "Sidebar" } %>
|
42
|
+
# <% component.with_main { "Main" } %>
|
43
43
|
# <% end %>
|
44
44
|
#
|
45
45
|
# @example Left sidebar
|
46
46
|
# <%= render(Primer::LayoutComponent.new(side: :left)) do |component| %>
|
47
|
-
# <% component.
|
48
|
-
# <% component.
|
47
|
+
# <% component.with_sidebar { "Sidebar" } %>
|
48
|
+
# <% component.with_main { "Main" } %>
|
49
49
|
# <% end %>
|
50
50
|
#
|
51
51
|
# @param responsive [Boolean] Whether to collapse layout to a single column at smaller widths.
|
@@ -50,7 +50,7 @@ module Primer
|
|
50
50
|
# Use tooltips sparingly and as a last resort. Consult the <%= link_to_component(Primer::Alpha::Tooltip) %> documentation for more information.
|
51
51
|
# @code
|
52
52
|
# <%= render(Primer::LinkComponent.new(href: "#", id: "link-with-tooltip")) do |c| %>
|
53
|
-
# <% c.
|
53
|
+
# <% c.with_tooltip(text: "Tooltip text") %>
|
54
54
|
# Link
|
55
55
|
# <% end %>
|
56
56
|
#
|
@@ -40,20 +40,20 @@ module Primer
|
|
40
40
|
|
41
41
|
# @example Default
|
42
42
|
# <%= render(Primer::MenuComponent.new) do |c| %>
|
43
|
-
# <% c.
|
43
|
+
# <% c.with_heading(tag: :h2) do %>
|
44
44
|
# Heading
|
45
45
|
# <% end %>
|
46
|
-
# <% c.
|
46
|
+
# <% c.with_item(selected: true, href: "#url") do %>
|
47
47
|
# Item 1
|
48
48
|
# <% end %>
|
49
|
-
# <% c.
|
49
|
+
# <% c.with_item(href: "#url") do %>
|
50
50
|
# <%= render(Primer::OcticonComponent.new("check")) %>
|
51
51
|
# With Icon
|
52
52
|
# <% end %>
|
53
|
-
# <% c.
|
53
|
+
# <% c.with_item(href: "#url") do %>
|
54
54
|
# <%= render(Primer::OcticonComponent.new("check")) %>
|
55
55
|
# With Icon and Counter
|
56
|
-
# <%= render(Primer::
|
56
|
+
# <%= render(Primer::Beta::Counter.new(count: 25)) %>
|
57
57
|
# <% end %>
|
58
58
|
# <% end %>
|
59
59
|
#
|
@@ -57,37 +57,37 @@ module Primer
|
|
57
57
|
|
58
58
|
# Counter to be rendered in the Tab right.
|
59
59
|
#
|
60
|
-
# @param kwargs [Hash] The same arguments as <%= link_to_component(Primer::
|
61
|
-
renders_one :counter, Primer::
|
60
|
+
# @param kwargs [Hash] The same arguments as <%= link_to_component(Primer::Beta::Counter) %>.
|
61
|
+
renders_one :counter, Primer::Beta::Counter
|
62
62
|
|
63
63
|
attr_reader :selected
|
64
64
|
|
65
65
|
# @example Default
|
66
66
|
# <%= render(Primer::Navigation::TabComponent.new(selected: true)) do |c| %>
|
67
|
-
# <% c.
|
67
|
+
# <% c.with_text { "Selected" } %>
|
68
68
|
# <% end %>
|
69
69
|
# <%= render(Primer::Navigation::TabComponent.new) do |c| %>
|
70
|
-
# <% c.
|
70
|
+
# <% c.with_text { "Not selected" } %>
|
71
71
|
# <% end %>
|
72
72
|
#
|
73
73
|
# @example With icons and counters
|
74
74
|
# <%= render(Primer::Navigation::TabComponent.new) do |c| %>
|
75
|
-
# <% c.
|
76
|
-
# <% c.
|
75
|
+
# <% c.with_icon(:star) %>
|
76
|
+
# <% c.with_text { "Tab" } %>
|
77
77
|
# <% end %>
|
78
78
|
# <%= render(Primer::Navigation::TabComponent.new) do |c| %>
|
79
|
-
# <% c.
|
80
|
-
# <% c.
|
81
|
-
# <% c.
|
79
|
+
# <% c.with_icon(:star) %>
|
80
|
+
# <% c.with_text { "Tab" } %>
|
81
|
+
# <% c.with_counter(count: 10) %>
|
82
82
|
# <% end %>
|
83
83
|
# <%= render(Primer::Navigation::TabComponent.new) do |c| %>
|
84
|
-
# <% c.
|
85
|
-
# <% c.
|
84
|
+
# <% c.with_text { "Tab" } %>
|
85
|
+
# <% c.with_counter(count: 10) %>
|
86
86
|
# <% end %>
|
87
87
|
#
|
88
88
|
# @example Inside a list
|
89
89
|
# <%= render(Primer::Navigation::TabComponent.new(list: true)) do |c| %>
|
90
|
-
# <% c.
|
90
|
+
# <% c.with_text { "Tab" } %>
|
91
91
|
# <% end %>
|
92
92
|
#
|
93
93
|
# @example With custom HTML
|
@@ -60,40 +60,40 @@ module Primer
|
|
60
60
|
|
61
61
|
# @example Default
|
62
62
|
# <%= render Primer::PopoverComponent.new do |component| %>
|
63
|
-
# <% component.
|
63
|
+
# <% component.with_heading do %>
|
64
64
|
# Activity feed
|
65
65
|
# <% end %>
|
66
|
-
# <% component.
|
66
|
+
# <% component.with_body do %>
|
67
67
|
# This is the Popover body.
|
68
68
|
# <% end %>
|
69
69
|
# <% end %>
|
70
70
|
#
|
71
71
|
# @example Large
|
72
72
|
# <%= render Primer::PopoverComponent.new do |component| %>
|
73
|
-
# <% component.
|
73
|
+
# <% component.with_heading do %>
|
74
74
|
# Activity feed
|
75
75
|
# <% end %>
|
76
|
-
# <% component.
|
76
|
+
# <% component.with_body(large: true) do %>
|
77
77
|
# This is the large Popover body.
|
78
78
|
# <% end %>
|
79
79
|
# <% end %>
|
80
80
|
#
|
81
81
|
# @example Caret position
|
82
82
|
# <%= render Primer::PopoverComponent.new do |component| %>
|
83
|
-
# <% component.
|
83
|
+
# <% component.with_heading do %>
|
84
84
|
# Activity feed
|
85
85
|
# <% end %>
|
86
|
-
# <% component.
|
86
|
+
# <% component.with_body(caret: :left) do %>
|
87
87
|
# This is the Popover body.
|
88
88
|
# <% end %>
|
89
89
|
# <% end %>
|
90
90
|
#
|
91
91
|
# @example With multiple elements in the body
|
92
92
|
# <%= render Primer::PopoverComponent.new do |component| %>
|
93
|
-
# <% component.
|
93
|
+
# <% component.with_heading do %>
|
94
94
|
# Activity feed
|
95
95
|
# <% end %>
|
96
|
-
# <% component.
|
96
|
+
# <% component.with_body(caret: :left) do %>
|
97
97
|
# <p>This is the Popover body.</p>
|
98
98
|
# <%= render Primer::ButtonComponent.new(type: :submit) do %>
|
99
99
|
# Got it!
|
@@ -56,27 +56,27 @@ module Primer
|
|
56
56
|
|
57
57
|
# @example Default
|
58
58
|
# <%= render(Primer::SubheadComponent.new) do |component| %>
|
59
|
-
# <% component.
|
59
|
+
# <% component.with_heading(tag: :h3) do %>
|
60
60
|
# My Heading
|
61
61
|
# <% end %>
|
62
|
-
# <% component.
|
62
|
+
# <% component.with_description do %>
|
63
63
|
# My Description
|
64
64
|
# <% end %>
|
65
65
|
# <% end %>
|
66
66
|
#
|
67
67
|
# @example With dangerous heading
|
68
68
|
# <%= render(Primer::SubheadComponent.new) do |component| %>
|
69
|
-
# <% component.
|
69
|
+
# <% component.with_heading(tag: :h3, danger: true) do %>
|
70
70
|
# My Heading
|
71
71
|
# <% end %>
|
72
|
-
# <% component.
|
72
|
+
# <% component.with_description do %>
|
73
73
|
# My Description
|
74
74
|
# <% end %>
|
75
75
|
# <% end %>
|
76
76
|
#
|
77
77
|
# @example With long description
|
78
78
|
# <%= render(Primer::SubheadComponent.new) do |component| %>
|
79
|
-
# <% component.
|
79
|
+
# <% component.with_heading(tag: :h3) do %>
|
80
80
|
# My Heading
|
81
81
|
# <% end %>
|
82
82
|
# <% end %>
|
@@ -84,23 +84,23 @@ module Primer
|
|
84
84
|
#
|
85
85
|
# @example Without border
|
86
86
|
# <%= render(Primer::SubheadComponent.new(hide_border: true)) do |component| %>
|
87
|
-
# <% component.
|
87
|
+
# <% component.with_heading do %>
|
88
88
|
# My Heading
|
89
89
|
# <% end %>
|
90
|
-
# <% component.
|
90
|
+
# <% component.with_description do %>
|
91
91
|
# My Description
|
92
92
|
# <% end %>
|
93
93
|
# <% end %>
|
94
94
|
#
|
95
95
|
# @example With actions
|
96
96
|
# <%= render(Primer::SubheadComponent.new) do |component| %>
|
97
|
-
# <% component.
|
97
|
+
# <% component.with_heading do %>
|
98
98
|
# My Heading
|
99
99
|
# <% end %>
|
100
|
-
# <% component.
|
100
|
+
# <% component.with_description do %>
|
101
101
|
# My Description
|
102
102
|
# <% end %>
|
103
|
-
# <% component.
|
103
|
+
# <% component.with_actions do %>
|
104
104
|
# <%= render(
|
105
105
|
# Primer::ButtonComponent.new(
|
106
106
|
# tag: :a, href: "http://www.google.com", scheme: :danger
|
@@ -40,9 +40,9 @@ module Primer
|
|
40
40
|
# @example Default
|
41
41
|
# <div style="padding-left: 60px">
|
42
42
|
# <%= render(Primer::TimelineItemComponent.new) do |component| %>
|
43
|
-
# <% component.
|
44
|
-
# <% component.
|
45
|
-
# <% component.
|
43
|
+
# <% component.with_avatar(src: "https://github.com/github.png", alt: "github") %>
|
44
|
+
# <% component.with_badge(bg: :success_emphasis, color: :on_emphasis, icon: :check) %>
|
45
|
+
# <% component.with_body { "Success!" } %>
|
46
46
|
# <% end %>
|
47
47
|
# </div>
|
48
48
|
#
|
@@ -10,12 +10,12 @@ module ERBLint
|
|
10
10
|
ATTRIBUTES = %w[type].freeze
|
11
11
|
|
12
12
|
TYPE_OPTIONS = Primer::ViewComponents::Constants.get(
|
13
|
-
component: "Primer::CloseButton",
|
13
|
+
component: "Primer::Beta::CloseButton",
|
14
14
|
constant: "TYPE_OPTIONS"
|
15
15
|
).freeze
|
16
16
|
|
17
17
|
DEFAULT_TYPE = Primer::ViewComponents::Constants.get(
|
18
|
-
component: "Primer::CloseButton",
|
18
|
+
component: "Primer::Beta::CloseButton",
|
19
19
|
constant: "DEFAULT_TYPE"
|
20
20
|
).freeze
|
21
21
|
|
@@ -14,9 +14,9 @@ module ERBLint
|
|
14
14
|
|
15
15
|
TAGS = %w[button].freeze
|
16
16
|
CLASSES = %w[close-button].freeze
|
17
|
-
MESSAGE = "We are migrating close-button to use [Primer::CloseButton](https://primer.style/view-components/components/closebutton), please try to use that instead of raw HTML."
|
17
|
+
MESSAGE = "We are migrating close-button to use [Primer::Beta::CloseButton](https://primer.style/view-components/components/closebutton), please try to use that instead of raw HTML."
|
18
18
|
ARGUMENT_MAPPER = ArgumentMappers::CloseButton
|
19
|
-
COMPONENT = "Primer::CloseButton"
|
19
|
+
COMPONENT = "Primer::Beta::CloseButton"
|
20
20
|
|
21
21
|
ALLOWED_OCTICON_ARGS = %w[icon aria-label aria].freeze
|
22
22
|
|
@@ -8,6 +8,8 @@ module ERBLint
|
|
8
8
|
# If there is no alternative to suggest, set the value to nil
|
9
9
|
COMPONENT_TO_USE_INSTEAD = {
|
10
10
|
"Primer::ButtonGroup" => "Primer::Beta::ButtonGroup",
|
11
|
+
"Primer::CloseButton" => "Primer::Beta::CloseButton",
|
12
|
+
"Primer::CounterComponent" => "Primer::Beta::Counter",
|
11
13
|
"Primer::Alpha::AutoComplete::Item" => "Primer::Beta::AutoComplete::Item",
|
12
14
|
"Primer::Alpha::AutoComplete" => "Primer::Beta::AutoComplete",
|
13
15
|
"Primer::BlankslateComponent" => "Primer::Beta::Blankslate",
|
@@ -17,6 +17,8 @@ module RuboCop
|
|
17
17
|
DEPRECATIONS = {
|
18
18
|
"Primer::BoxComponent" => "Primer::Box",
|
19
19
|
"Primer::ButtonGroup" => "Primer::Beta::ButtonGroup",
|
20
|
+
"Primer::CloseButton" => "Primer::Beta::CloseButton",
|
21
|
+
"Primer::CounterComponent" => "Primer::Beta::Counter",
|
20
22
|
"Primer::BlankslateComponent" => "Primer::Beta::Blankslate",
|
21
23
|
"Primer::BorderBoxComponent" => "Primer::Beta::BorderBox",
|
22
24
|
"Primer::BaseButton" => "Primer::Beta::BaseButton",
|
data/lib/tasks/docs.rake
CHANGED
@@ -50,8 +50,8 @@ namespace :docs do
|
|
50
50
|
Primer::Beta::ButtonGroup,
|
51
51
|
Primer::Alpha::ButtonMarketing,
|
52
52
|
Primer::ClipboardCopy,
|
53
|
-
Primer::CloseButton,
|
54
|
-
Primer::
|
53
|
+
Primer::Beta::CloseButton,
|
54
|
+
Primer::Beta::Counter,
|
55
55
|
Primer::DetailsComponent,
|
56
56
|
Primer::Dropdown,
|
57
57
|
Primer::DropdownMenuComponent,
|
data/static/arguments.yml
CHANGED
@@ -477,6 +477,50 @@
|
|
477
477
|
type: Hash
|
478
478
|
default: N/A
|
479
479
|
description: "[System arguments](/system-arguments)"
|
480
|
+
- component: CloseButton
|
481
|
+
source: https://github.com/primer/view_components/tree/main/app/components/primer/beta/close_button.rb
|
482
|
+
parameters:
|
483
|
+
- name: type
|
484
|
+
type: Symbol
|
485
|
+
default: "`:button`"
|
486
|
+
description: One of `:button` or `:submit`.
|
487
|
+
- name: system_arguments
|
488
|
+
type: Hash
|
489
|
+
default: N/A
|
490
|
+
description: "[System arguments](/system-arguments)"
|
491
|
+
- component: Counter
|
492
|
+
source: https://github.com/primer/view_components/tree/main/app/components/primer/beta/counter.rb
|
493
|
+
parameters:
|
494
|
+
- name: count
|
495
|
+
type: Integer, Float::INFINITY, nil
|
496
|
+
default: "`0`"
|
497
|
+
description: 'The number to be displayed (e.x. # of issues, pull requests)'
|
498
|
+
- name: scheme
|
499
|
+
type: Symbol
|
500
|
+
default: "`:default`"
|
501
|
+
description: Color scheme. One of `:default`, `:primary`, or `:secondary`.
|
502
|
+
- name: limit
|
503
|
+
type: Integer, nil
|
504
|
+
default: "`5_000`"
|
505
|
+
description: Maximum value to display. Pass `nil` for no limit. (e.x. if `count`
|
506
|
+
== 6,000 and `limit` == 5000, counter will display "5,000+")
|
507
|
+
- name: hide_if_zero
|
508
|
+
type: Boolean
|
509
|
+
default: "`false`"
|
510
|
+
description: If true, a `hidden` attribute is added to the counter if `count`
|
511
|
+
is zero.
|
512
|
+
- name: text
|
513
|
+
type: String
|
514
|
+
default: '`""`'
|
515
|
+
description: Text to display instead of count.
|
516
|
+
- name: round
|
517
|
+
type: Boolean
|
518
|
+
default: "`false`"
|
519
|
+
description: Whether to apply our standard rounding logic to value.
|
520
|
+
- name: system_arguments
|
521
|
+
type: Hash
|
522
|
+
default: N/A
|
523
|
+
description: "[System arguments](/system-arguments)"
|
480
524
|
- component: Flash
|
481
525
|
source: https://github.com/primer/view_components/tree/main/app/components/primer/beta/flash.rb
|
482
526
|
parameters:
|
@@ -588,50 +632,6 @@
|
|
588
632
|
type: Hash
|
589
633
|
default: N/A
|
590
634
|
description: "[System arguments](/system-arguments)"
|
591
|
-
- component: CloseButton
|
592
|
-
source: https://github.com/primer/view_components/tree/main/app/components/primer/close_button.rb
|
593
|
-
parameters:
|
594
|
-
- name: type
|
595
|
-
type: Symbol
|
596
|
-
default: "`:button`"
|
597
|
-
description: One of `:button` or `:submit`.
|
598
|
-
- name: system_arguments
|
599
|
-
type: Hash
|
600
|
-
default: N/A
|
601
|
-
description: "[System arguments](/system-arguments)"
|
602
|
-
- component: Counter
|
603
|
-
source: https://github.com/primer/view_components/tree/main/app/components/primer/counter_component.rb
|
604
|
-
parameters:
|
605
|
-
- name: count
|
606
|
-
type: Integer, Float::INFINITY, nil
|
607
|
-
default: "`0`"
|
608
|
-
description: 'The number to be displayed (e.x. # of issues, pull requests)'
|
609
|
-
- name: scheme
|
610
|
-
type: Symbol
|
611
|
-
default: "`:default`"
|
612
|
-
description: Color scheme. One of `:default`, `:primary`, or `:secondary`.
|
613
|
-
- name: limit
|
614
|
-
type: Integer, nil
|
615
|
-
default: "`5_000`"
|
616
|
-
description: Maximum value to display. Pass `nil` for no limit. (e.x. if `count`
|
617
|
-
== 6,000 and `limit` == 5000, counter will display "5,000+")
|
618
|
-
- name: hide_if_zero
|
619
|
-
type: Boolean
|
620
|
-
default: "`false`"
|
621
|
-
description: If true, a `hidden` attribute is added to the counter if `count`
|
622
|
-
is zero.
|
623
|
-
- name: text
|
624
|
-
type: String
|
625
|
-
default: '`""`'
|
626
|
-
description: Text to display instead of count.
|
627
|
-
- name: round
|
628
|
-
type: Boolean
|
629
|
-
default: "`false`"
|
630
|
-
description: Whether to apply our standard rounding logic to value.
|
631
|
-
- name: system_arguments
|
632
|
-
type: Hash
|
633
|
-
default: N/A
|
634
|
-
description: "[System arguments](/system-arguments)"
|
635
635
|
- component: Details
|
636
636
|
source: https://github.com/primer/view_components/tree/main/app/components/primer/details_component.rb
|
637
637
|
parameters:
|
data/static/audited_at.json
CHANGED
@@ -23,6 +23,8 @@
|
|
23
23
|
"Primer::Beta::Breadcrumbs": "",
|
24
24
|
"Primer::Beta::Breadcrumbs::Item": "",
|
25
25
|
"Primer::Beta::ButtonGroup": "",
|
26
|
+
"Primer::Beta::CloseButton": "",
|
27
|
+
"Primer::Beta::Counter": "",
|
26
28
|
"Primer::Beta::Flash": "",
|
27
29
|
"Primer::Beta::Text": "",
|
28
30
|
"Primer::Beta::Truncate": "",
|
data/static/constants.json
CHANGED
@@ -300,6 +300,32 @@
|
|
300
300
|
},
|
301
301
|
"Primer::Beta::ButtonGroup": {
|
302
302
|
},
|
303
|
+
"Primer::Beta::CloseButton": {
|
304
|
+
"DEFAULT_TYPE": "button",
|
305
|
+
"TYPE_OPTIONS": [
|
306
|
+
"button",
|
307
|
+
"submit"
|
308
|
+
]
|
309
|
+
},
|
310
|
+
"Primer::Beta::Counter": {
|
311
|
+
"DEFAULT_SCHEME": "default",
|
312
|
+
"DEPRECATED_SCHEME_OPTIONS": [
|
313
|
+
"gray",
|
314
|
+
"light_gray"
|
315
|
+
],
|
316
|
+
"SCHEME_MAPPINGS": {
|
317
|
+
"default": "",
|
318
|
+
"primary": "Counter--primary",
|
319
|
+
"secondary": "Counter--secondary",
|
320
|
+
"gray": "Counter--primary",
|
321
|
+
"light_gray": "Counter--secondary"
|
322
|
+
},
|
323
|
+
"SCHEME_OPTIONS": [
|
324
|
+
"default",
|
325
|
+
"primary",
|
326
|
+
"secondary"
|
327
|
+
]
|
328
|
+
},
|
303
329
|
"Primer::Beta::Flash": {
|
304
330
|
"DEFAULT_SCHEME": "default",
|
305
331
|
"SCHEME_MAPPINGS": {
|
@@ -359,34 +385,12 @@
|
|
359
385
|
"Primer::ClipboardCopy": {
|
360
386
|
},
|
361
387
|
"Primer::CloseButton": {
|
362
|
-
"DEFAULT_TYPE": "button",
|
363
|
-
"TYPE_OPTIONS": [
|
364
|
-
"button",
|
365
|
-
"submit"
|
366
|
-
]
|
367
388
|
},
|
368
389
|
"Primer::ConditionalWrapper": {
|
369
390
|
},
|
370
391
|
"Primer::Content": {
|
371
392
|
},
|
372
393
|
"Primer::CounterComponent": {
|
373
|
-
"DEFAULT_SCHEME": "default",
|
374
|
-
"DEPRECATED_SCHEME_OPTIONS": [
|
375
|
-
"gray",
|
376
|
-
"light_gray"
|
377
|
-
],
|
378
|
-
"SCHEME_MAPPINGS": {
|
379
|
-
"default": "",
|
380
|
-
"primary": "Counter--primary",
|
381
|
-
"secondary": "Counter--secondary",
|
382
|
-
"gray": "Counter--primary",
|
383
|
-
"light_gray": "Counter--secondary"
|
384
|
-
},
|
385
|
-
"SCHEME_OPTIONS": [
|
386
|
-
"default",
|
387
|
-
"primary",
|
388
|
-
"secondary"
|
389
|
-
]
|
390
394
|
},
|
391
395
|
"Primer::DetailsComponent": {
|
392
396
|
"BODY_TAG_DEFAULT": "div",
|
data/static/statuses.json
CHANGED
@@ -19,10 +19,12 @@
|
|
19
19
|
"Primer::Beta::BaseButton": "beta",
|
20
20
|
"Primer::Beta::Blankslate": "beta",
|
21
21
|
"Primer::Beta::BorderBox": "beta",
|
22
|
-
"Primer::Beta::BorderBox::Header": "
|
22
|
+
"Primer::Beta::BorderBox::Header": "beta",
|
23
23
|
"Primer::Beta::Breadcrumbs": "beta",
|
24
24
|
"Primer::Beta::Breadcrumbs::Item": "alpha",
|
25
25
|
"Primer::Beta::ButtonGroup": "beta",
|
26
|
+
"Primer::Beta::CloseButton": "beta",
|
27
|
+
"Primer::Beta::Counter": "beta",
|
26
28
|
"Primer::Beta::Flash": "beta",
|
27
29
|
"Primer::Beta::Text": "beta",
|
28
30
|
"Primer::Beta::Truncate": "beta",
|
@@ -34,10 +36,10 @@
|
|
34
36
|
"Primer::ButtonComponent": "beta",
|
35
37
|
"Primer::ButtonGroup": "deprecated",
|
36
38
|
"Primer::ClipboardCopy": "beta",
|
37
|
-
"Primer::CloseButton": "
|
39
|
+
"Primer::CloseButton": "deprecated",
|
38
40
|
"Primer::ConditionalWrapper": "alpha",
|
39
41
|
"Primer::Content": "stable",
|
40
|
-
"Primer::CounterComponent": "
|
42
|
+
"Primer::CounterComponent": "deprecated",
|
41
43
|
"Primer::DetailsComponent": "beta",
|
42
44
|
"Primer::Dropdown": "alpha",
|
43
45
|
"Primer::Dropdown::Menu": "alpha",
|
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.90
|
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: 2022-08-
|
11
|
+
date: 2022-08-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionview
|
@@ -447,6 +447,8 @@ files:
|
|
447
447
|
- app/components/primer/beta/breadcrumbs.rb
|
448
448
|
- app/components/primer/beta/button_group.html.erb
|
449
449
|
- app/components/primer/beta/button_group.rb
|
450
|
+
- app/components/primer/beta/close_button.rb
|
451
|
+
- app/components/primer/beta/counter.rb
|
450
452
|
- app/components/primer/beta/flash.html.erb
|
451
453
|
- app/components/primer/beta/flash.rb
|
452
454
|
- app/components/primer/beta/text.rb
|