primer_view_components 0.0.111 → 0.0.112
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +30 -0
- data/app/assets/javascripts/primer_view_components.js +1 -1
- data/app/assets/javascripts/primer_view_components.js.map +1 -1
- data/app/assets/styles/primer_view_components.css +1 -1
- data/app/assets/styles/primer_view_components.css.map +1 -1
- data/app/components/primer/alpha/auto_complete.css +1 -0
- data/app/components/primer/alpha/auto_complete.css.json +1 -0
- data/app/components/primer/alpha/auto_complete.css.map +1 -0
- data/app/components/primer/alpha/auto_complete.pcss +118 -0
- data/app/components/primer/alpha/banner.css +1 -1
- data/app/components/primer/alpha/banner.css.map +1 -1
- data/app/components/primer/alpha/banner.pcss +2 -3
- data/app/components/primer/alpha/button_marketing.css +1 -0
- data/app/components/primer/alpha/button_marketing.css.json +1 -0
- data/app/components/primer/alpha/button_marketing.css.map +1 -0
- data/app/components/primer/alpha/button_marketing.pcss +175 -0
- data/app/components/primer/{dropdown → alpha/dropdown}/menu.d.ts +0 -0
- data/app/components/primer/{dropdown → alpha/dropdown}/menu.html.erb +0 -0
- data/app/components/primer/{dropdown → alpha/dropdown}/menu.js +0 -0
- data/app/components/primer/alpha/dropdown/menu.rb +105 -0
- data/app/components/primer/{dropdown → alpha/dropdown}/menu.ts +0 -0
- data/app/components/primer/alpha/dropdown.css +1 -0
- data/app/components/primer/alpha/dropdown.css.json +1 -0
- data/app/components/primer/{dropdown.css.map → alpha/dropdown.css.map} +1 -1
- data/app/components/primer/{dropdown.d.ts → alpha/dropdown.d.ts} +0 -0
- data/app/components/primer/{dropdown.html.erb → alpha/dropdown.html.erb} +0 -0
- data/app/components/primer/{dropdown.js → alpha/dropdown.js} +0 -0
- data/app/components/primer/{dropdown.pcss → alpha/dropdown.pcss} +1 -1
- data/app/components/primer/alpha/dropdown.rb +154 -0
- data/app/components/primer/{dropdown.ts → alpha/dropdown.ts} +0 -0
- data/app/components/primer/alpha/tab_nav.css +1 -0
- data/app/components/primer/alpha/tab_nav.css.json +1 -0
- data/app/components/primer/alpha/tab_nav.css.map +1 -0
- data/app/components/primer/alpha/tab_nav.pcss +100 -0
- data/app/components/primer/alpha/underline_nav.css +1 -0
- data/app/components/primer/alpha/underline_nav.css.json +1 -0
- data/app/components/primer/alpha/underline_nav.css.map +1 -0
- data/app/components/primer/alpha/underline_nav.pcss +133 -0
- data/app/components/primer/beta/border_box.css +1 -0
- data/app/components/primer/beta/border_box.css.json +1 -0
- data/app/components/primer/beta/border_box.css.map +1 -0
- data/app/components/primer/beta/border_box.pcss +284 -0
- data/app/components/primer/beta/link.css +1 -0
- data/app/components/primer/beta/link.css.json +1 -0
- data/app/components/primer/beta/link.css.map +1 -0
- data/app/components/primer/beta/link.pcss +60 -0
- data/app/components/primer/{popover_component.css → beta/popover.css} +0 -0
- data/app/components/primer/beta/popover.css.json +1 -0
- data/app/components/primer/beta/popover.css.map +1 -0
- data/app/components/primer/{popover_component.html.erb → beta/popover.html.erb} +0 -0
- data/app/components/primer/{popover_component.pcss → beta/popover.pcss} +0 -0
- data/app/components/primer/beta/popover.rb +127 -0
- data/app/components/primer/component.rb +2 -2
- data/app/components/primer/dropdown/menu.rb +5 -90
- data/app/components/primer/dropdown.rb +2 -145
- data/app/components/primer/menu_component.css +1 -0
- data/app/components/primer/menu_component.css.json +1 -0
- data/app/components/primer/menu_component.css.map +1 -0
- data/app/components/primer/menu_component.pcss +119 -0
- data/app/components/primer/popover_component.rb +3 -120
- data/app/components/primer/primer.d.ts +1 -1
- data/app/components/primer/primer.js +1 -1
- data/app/components/primer/primer.pcss +10 -3
- data/app/components/primer/primer.ts +1 -1
- data/lib/primer/deprecations.rb +4 -2
- data/lib/primer/view_components/linters/deprecated_components_counter.rb +15 -4
- data/lib/primer/view_components/linters/severity_schema.rb +14 -0
- data/lib/primer/view_components/version.rb +1 -1
- data/lib/tasks/docs.rake +3 -3
- data/previews/primer/alpha/button_marketing_preview.rb +36 -0
- data/previews/primer/alpha/dropdown_preview.rb +210 -0
- data/previews/primer/alpha/tab_nav_preview.rb +55 -0
- data/previews/primer/beta/border_box_preview.rb +65 -13
- data/previews/primer/beta/link_preview.rb +28 -0
- data/previews/primer/beta/popover_preview.rb +79 -0
- data/static/arguments.json +40 -40
- data/static/audited_at.json +4 -2
- data/static/constants.json +56 -50
- data/static/statuses.json +8 -6
- metadata +54 -23
- data/app/components/primer/dropdown.css +0 -1
- data/app/components/primer/dropdown.css.json +0 -1
- data/app/components/primer/image.rb +0 -7
- data/app/components/primer/popover_component.css.json +0 -1
- data/app/components/primer/popover_component.css.map +0 -1
- data/app/components/primer/progress_bar_component.rb +0 -7
- data/previews/primer/dropdown_preview.rb +0 -208
- data/previews/primer/popover_component_preview.rb +0 -34
@@ -0,0 +1,210 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Primer
|
4
|
+
module Alpha
|
5
|
+
# @label Dropdown
|
6
|
+
class DropdownPreview < ViewComponent::Preview
|
7
|
+
# @label Playground
|
8
|
+
#
|
9
|
+
# @param with_caret [Boolean] toggle
|
10
|
+
# @param overlay [Symbol] select [none, default, dark]
|
11
|
+
def playground(overlay: :default, with_caret: false)
|
12
|
+
render(Primer::Alpha::Dropdown.new(overlay: overlay, with_caret: with_caret)) do |c|
|
13
|
+
c.with_button { "Dropdown" }
|
14
|
+
|
15
|
+
c.with_menu(header: "Header") do |m|
|
16
|
+
m.with_item { "Item 1" }
|
17
|
+
m.with_item { "Item 2" }
|
18
|
+
m.with_item(divider: true)
|
19
|
+
m.with_item { "Item 3" }
|
20
|
+
m.with_item { "Item 4" }
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
# @label Default
|
26
|
+
#
|
27
|
+
def default
|
28
|
+
render(Primer::Alpha::Dropdown.new) do |c|
|
29
|
+
c.with_button { "Dropdown" }
|
30
|
+
c.with_menu do |m|
|
31
|
+
m.with_item { "Item 1" }
|
32
|
+
m.with_item { "Item 2" }
|
33
|
+
m.with_item { "Item 3" }
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
# @label Menu
|
39
|
+
#
|
40
|
+
# @param as [Symbol] select [list, default]
|
41
|
+
# @param direction [Symbol] select [se, sw, w, e, ne, s]
|
42
|
+
# @param scheme [Symbol] select [default, dark]
|
43
|
+
def menu(as: :default, direction: :se, scheme: :default)
|
44
|
+
render(Primer::Alpha::Dropdown::Menu.new(as: as, direction: direction, scheme: scheme, header: "Header")) do |m|
|
45
|
+
m.with_item { "Item 1" }
|
46
|
+
m.with_item { "Item 2" }
|
47
|
+
m.with_item(divider: true)
|
48
|
+
m.with_item { "Item 3" }
|
49
|
+
m.with_item { "Item 4" }
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
# @!group Direction
|
54
|
+
#
|
55
|
+
# @label Direction e
|
56
|
+
def direction_e
|
57
|
+
render(Primer::Alpha::Dropdown.new(display: :inline_block)) do |c|
|
58
|
+
c.with_button { "Dropdown" }
|
59
|
+
c.with_menu(direction: :e) do |m|
|
60
|
+
m.with_item { "Item 1" }
|
61
|
+
m.with_item { "Item 2" }
|
62
|
+
m.with_item { "Item 3" }
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
# @label Direction ne
|
68
|
+
def direction_ne
|
69
|
+
render(Primer::Alpha::Dropdown.new(display: :inline_block)) do |c|
|
70
|
+
c.with_button { "Dropdown" }
|
71
|
+
c.with_menu(direction: :ne) do |m|
|
72
|
+
m.with_item { "Item 1" }
|
73
|
+
m.with_item { "Item 2" }
|
74
|
+
m.with_item { "Item 3" }
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
# @label Direction s
|
80
|
+
def direction_s
|
81
|
+
render(Primer::Alpha::Dropdown.new(display: :inline_block)) do |c|
|
82
|
+
c.with_button { "Dropdown" }
|
83
|
+
c.with_menu(direction: :s) do |m|
|
84
|
+
m.with_item { "Item 1" }
|
85
|
+
m.with_item { "Item 2" }
|
86
|
+
m.with_item { "Item 3" }
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
91
|
+
# @label Direction se
|
92
|
+
def direction_se
|
93
|
+
render(Primer::Alpha::Dropdown.new(display: :inline_block)) do |c|
|
94
|
+
c.with_button { "Dropdown" }
|
95
|
+
c.with_menu(direction: :se) do |m|
|
96
|
+
m.with_item { "Item 1" }
|
97
|
+
m.with_item { "Item 2" }
|
98
|
+
m.with_item { "Item 3" }
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
# @label Direction sw
|
104
|
+
def direction_sw
|
105
|
+
render(Primer::Alpha::Dropdown.new(display: :inline_block)) do |c|
|
106
|
+
c.with_button { "Dropdown" }
|
107
|
+
c.with_menu(direction: :sw) do |m|
|
108
|
+
m.with_item { "Item 1" }
|
109
|
+
m.with_item { "Item 2" }
|
110
|
+
m.with_item { "Item 3" }
|
111
|
+
end
|
112
|
+
end
|
113
|
+
end
|
114
|
+
|
115
|
+
# @label Direction w
|
116
|
+
def direction_w
|
117
|
+
render(Primer::Alpha::Dropdown.new(display: :inline_block)) do |c|
|
118
|
+
c.with_button { "Dropdown" }
|
119
|
+
c.with_menu(direction: :w) do |m|
|
120
|
+
m.with_item { "Item 1" }
|
121
|
+
m.with_item { "Item 2" }
|
122
|
+
m.with_item { "Item 3" }
|
123
|
+
end
|
124
|
+
end
|
125
|
+
end
|
126
|
+
#
|
127
|
+
# @!endgroup
|
128
|
+
|
129
|
+
# @!group Options
|
130
|
+
#
|
131
|
+
# @label With caret
|
132
|
+
def options_with_caret
|
133
|
+
render(Primer::Alpha::Dropdown.new(with_caret: true)) do |c|
|
134
|
+
c.with_button { "Dropdown" }
|
135
|
+
c.with_menu do |m|
|
136
|
+
m.with_item { "Item 1" }
|
137
|
+
m.with_item { "Item 2" }
|
138
|
+
m.with_item { "Item 3" }
|
139
|
+
end
|
140
|
+
end
|
141
|
+
end
|
142
|
+
|
143
|
+
# @label With header
|
144
|
+
def options_with_header
|
145
|
+
render(Primer::Alpha::Dropdown.new) do |c|
|
146
|
+
c.with_button { "Dropdown" }
|
147
|
+
c.with_menu(header: "Header") do |m|
|
148
|
+
m.with_item { "Item 1" }
|
149
|
+
m.with_item { "Item 2" }
|
150
|
+
m.with_item { "Item 3" }
|
151
|
+
end
|
152
|
+
end
|
153
|
+
end
|
154
|
+
|
155
|
+
# @label With dividers
|
156
|
+
def options_with_dividers
|
157
|
+
render(Primer::Alpha::Dropdown.new) do |c|
|
158
|
+
c.with_button { "Dropdown" }
|
159
|
+
c.with_menu do |m|
|
160
|
+
m.with_item { "Item 1" }
|
161
|
+
m.with_item { "Item 2" }
|
162
|
+
m.with_item(divider: true)
|
163
|
+
m.with_item { "Item 3" }
|
164
|
+
m.with_item { "Item 4" }
|
165
|
+
m.with_item(divider: true)
|
166
|
+
m.with_item { "Item 5" }
|
167
|
+
end
|
168
|
+
end
|
169
|
+
end
|
170
|
+
|
171
|
+
# @label As list
|
172
|
+
def options_as_list
|
173
|
+
render(Primer::Alpha::Dropdown.new) do |c|
|
174
|
+
c.with_button { "Dropdown" }
|
175
|
+
c.with_menu(as: :list) do |m|
|
176
|
+
m.with_item { "Item 1" }
|
177
|
+
m.with_item { "Item 2" }
|
178
|
+
m.with_item { "Item 3" }
|
179
|
+
end
|
180
|
+
end
|
181
|
+
end
|
182
|
+
|
183
|
+
# @label Overlay none
|
184
|
+
def options_overlay_none
|
185
|
+
render(Primer::Alpha::Dropdown.new(overlay: :none)) do |c|
|
186
|
+
c.with_button { "Dropdown" }
|
187
|
+
c.with_menu do |m|
|
188
|
+
m.with_item { "Item 1" }
|
189
|
+
m.with_item { "Item 2" }
|
190
|
+
m.with_item { "Item 3" }
|
191
|
+
end
|
192
|
+
end
|
193
|
+
end
|
194
|
+
|
195
|
+
# @label Overlay dark
|
196
|
+
def options_overlay_dark
|
197
|
+
render(Primer::Alpha::Dropdown.new(overlay: :dark)) do |c|
|
198
|
+
c.with_button { "Dropdown" }
|
199
|
+
c.with_menu do |m|
|
200
|
+
m.with_item { "Item 1" }
|
201
|
+
m.with_item { "Item 2" }
|
202
|
+
m.with_item { "Item 3" }
|
203
|
+
end
|
204
|
+
end
|
205
|
+
end
|
206
|
+
#
|
207
|
+
# @!endgroup
|
208
|
+
end
|
209
|
+
end
|
210
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Primer
|
4
|
+
module Alpha
|
5
|
+
# @label TabNav
|
6
|
+
class TabNavPreview < ViewComponent::Preview
|
7
|
+
# @label Playground
|
8
|
+
#
|
9
|
+
# @param number_of_tabs [Integer] number
|
10
|
+
# @param with_icons [Boolean] toggle
|
11
|
+
# @param with_counters [Boolean] toggle
|
12
|
+
def playground(number_of_tabs: 3, with_icons: false, with_counters: false)
|
13
|
+
render(Primer::Alpha::TabNav.new(label: "label")) do |c|
|
14
|
+
Array.new(number_of_tabs || 3) do |i|
|
15
|
+
c.with_tab(selected: i.zero?, href: "##{i + 1}") do |t|
|
16
|
+
t.icon(icon: :star) if with_icons
|
17
|
+
t.text { "Tab #{i + 1}" }
|
18
|
+
t.counter(count: 10) if with_counters
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
# @label Default
|
25
|
+
def default
|
26
|
+
render(Primer::Alpha::TabNav.new(label: "Default")) do |c|
|
27
|
+
c.with_tab(selected: true, href: "#") { "Tab 1" }
|
28
|
+
c.with_tab(href: "#") { "Tab 2" }
|
29
|
+
c.with_tab(href: "#") { "Tab 3" }
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
# @label With icons and counters
|
34
|
+
def with_icons_and_counters
|
35
|
+
render(Primer::Alpha::TabNav.new(label: "With icons and counters")) do |c|
|
36
|
+
c.with_tab(href: "#1", selected: true) do |t|
|
37
|
+
t.icon(icon: :star)
|
38
|
+
t.text { "Stars" }
|
39
|
+
t.counter(count: 10)
|
40
|
+
end
|
41
|
+
c.with_tab(href: "#2") do |t|
|
42
|
+
t.icon(icon: :heart)
|
43
|
+
t.text { "Sponsors" }
|
44
|
+
t.counter(count: 14)
|
45
|
+
end
|
46
|
+
c.with_tab(href: "#3") do |t|
|
47
|
+
t.icon(icon: :bookmark)
|
48
|
+
t.text { "Bookmarks" }
|
49
|
+
t.counter(count: 7)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
@@ -6,9 +6,22 @@ module Primer
|
|
6
6
|
class BorderBoxPreview < ViewComponent::Preview
|
7
7
|
# @label Playground
|
8
8
|
#
|
9
|
-
# @param padding [Symbol] select [default, condensed]
|
10
|
-
|
9
|
+
# @param padding [Symbol] select [default, condensed, spacious]
|
10
|
+
# @param scheme [Symbol] select [default, neutral, info, warning]
|
11
|
+
def playground(padding: :default, scheme: :default)
|
11
12
|
render(Primer::Beta::BorderBox.new(padding: padding)) do |component|
|
13
|
+
component.header { "Header" }
|
14
|
+
component.body { "Body" }
|
15
|
+
component.row(scheme: scheme) { "#{scheme.to_s.capitalize} row one" }
|
16
|
+
component.row(scheme: scheme) { "#{scheme.to_s.capitalize} row two" }
|
17
|
+
component.row(scheme: scheme) { "#{scheme.to_s.capitalize} row three" }
|
18
|
+
component.footer { "Footer" }
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
# @label Default
|
23
|
+
def default
|
24
|
+
render(Primer::Beta::BorderBox.new) do |component|
|
12
25
|
component.header { "Header" }
|
13
26
|
component.body { "Body" }
|
14
27
|
component.row { "Row one" }
|
@@ -18,11 +31,34 @@ module Primer
|
|
18
31
|
end
|
19
32
|
end
|
20
33
|
|
21
|
-
# @label
|
34
|
+
# @label Header with title
|
35
|
+
def header_with_title
|
36
|
+
render(Primer::Beta::BorderBox.new) do |component|
|
37
|
+
component.with_header do |h|
|
38
|
+
h.title(tag: :h2) do
|
39
|
+
"Header with title"
|
40
|
+
end
|
41
|
+
end
|
42
|
+
component.body { "Body" }
|
43
|
+
component.footer { "Footer" }
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
# @label Row colors
|
48
|
+
def row_colors
|
49
|
+
render(Primer::Beta::BorderBox.new) do |component|
|
50
|
+
component.row(scheme: :default) { "Default" }
|
51
|
+
component.row(scheme: :neutral) { "Neutral" }
|
52
|
+
component.row(scheme: :info) { "Info" }
|
53
|
+
component.row(scheme: :warning) { "Warning" }
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
# @!group Padding
|
22
58
|
#
|
23
|
-
# @
|
24
|
-
def
|
25
|
-
render(Primer::Beta::BorderBox.new
|
59
|
+
# @label Default
|
60
|
+
def padding_default
|
61
|
+
render(Primer::Beta::BorderBox.new) do |component|
|
26
62
|
component.header { "Header" }
|
27
63
|
component.body { "Body" }
|
28
64
|
component.row { "Row one" }
|
@@ -32,15 +68,31 @@ module Primer
|
|
32
68
|
end
|
33
69
|
end
|
34
70
|
|
35
|
-
# @label
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
component.row
|
71
|
+
# @label Condensed
|
72
|
+
def padding_condensed
|
73
|
+
render(Primer::Beta::BorderBox.new(padding: :condensed)) do |component|
|
74
|
+
component.header { "Header" }
|
75
|
+
component.body { "Body" }
|
76
|
+
component.row { "Row one" }
|
77
|
+
component.row { "Row two" }
|
78
|
+
component.row { "Row three" }
|
79
|
+
component.footer { "Footer" }
|
42
80
|
end
|
43
81
|
end
|
82
|
+
|
83
|
+
# @label Spacious
|
84
|
+
def padding_spacious
|
85
|
+
render(Primer::Beta::BorderBox.new(padding: :spacious)) do |component|
|
86
|
+
component.header { "Header" }
|
87
|
+
component.body { "Body" }
|
88
|
+
component.row { "Row one" }
|
89
|
+
component.row { "Row two" }
|
90
|
+
component.row { "Row three" }
|
91
|
+
component.footer { "Footer" }
|
92
|
+
end
|
93
|
+
end
|
94
|
+
#
|
95
|
+
# @!endgroup
|
44
96
|
end
|
45
97
|
end
|
46
98
|
end
|
@@ -36,6 +36,34 @@ module Primer
|
|
36
36
|
"Link with tooltip"
|
37
37
|
end
|
38
38
|
end
|
39
|
+
|
40
|
+
# @!group Color Scheme
|
41
|
+
#
|
42
|
+
# @label Default
|
43
|
+
def color_scheme_default
|
44
|
+
render(Primer::Beta::Link.new(href: "#")) { "This is a default link color." }
|
45
|
+
end
|
46
|
+
|
47
|
+
# @label Primary
|
48
|
+
def color_scheme_primary
|
49
|
+
render(Primer::Beta::Link.new(href: "#", scheme: :primary)) { "This is a primary link color." }
|
50
|
+
end
|
51
|
+
|
52
|
+
# @label Primary, Muted
|
53
|
+
def color_scheme_primary_muted
|
54
|
+
render(Primer::Beta::Link.new(href: "#", scheme: :primary, muted: true)) { "This is a muted primary link color." }
|
55
|
+
end
|
56
|
+
|
57
|
+
# @label Secondary
|
58
|
+
def color_scheme_secondary
|
59
|
+
render(Primer::Beta::Link.new(href: "#", scheme: :secondary)) { "This is a secondary link color." }
|
60
|
+
end
|
61
|
+
|
62
|
+
# @label Secondary, Muted
|
63
|
+
def color_scheme_secondary_muted
|
64
|
+
render(Primer::Beta::Link.new(href: "#", scheme: :secondary, muted: true)) { "This is a muted secondary link color." }
|
65
|
+
end
|
66
|
+
# @!endgroup
|
39
67
|
end
|
40
68
|
end
|
41
69
|
end
|
@@ -0,0 +1,79 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Primer
|
4
|
+
module Beta
|
5
|
+
# @label Popover
|
6
|
+
class PopoverPreview < ViewComponent::Preview
|
7
|
+
# @label Playground
|
8
|
+
#
|
9
|
+
# @param caret [Symbol] select [top, right, bottom, left, top_right, top_left, bottom_right, bottom_left, left_bottom, left_top, right_bottom, right_top]
|
10
|
+
def playground(caret: :top)
|
11
|
+
render Primer::Beta::Popover.new do |component|
|
12
|
+
component.with_heading do
|
13
|
+
"Activity feed"
|
14
|
+
end
|
15
|
+
component.with_body(caret: caret) do
|
16
|
+
"This is the Popover body."
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
# @label Default
|
22
|
+
#
|
23
|
+
# @param caret [Symbol] select [top, right, bottom, left, top_right, top_left, bottom_right, bottom_left, left_bottom, left_top, right_bottom, right_top]
|
24
|
+
def default(caret: :top)
|
25
|
+
render Primer::Beta::Popover.new do |component|
|
26
|
+
component.with_heading do
|
27
|
+
"Activity feed"
|
28
|
+
end
|
29
|
+
component.with_body(caret: caret) do
|
30
|
+
"This is the Popover body."
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# @label Large
|
36
|
+
def large
|
37
|
+
render Primer::Beta::Popover.new do |component|
|
38
|
+
component.with_body(large: true) do
|
39
|
+
"This is a large Popover body."
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
# @!group Directions
|
45
|
+
def bottom_right
|
46
|
+
render Primer::Beta::Popover.new do |component|
|
47
|
+
component.with_body(caret: :bottom_right) do
|
48
|
+
"This is the Popover body."
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
def top_right
|
54
|
+
render Primer::Beta::Popover.new do |component|
|
55
|
+
component.with_body(caret: :top_right) do
|
56
|
+
"This is the Popover body."
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
def bottom_left
|
62
|
+
render Primer::Beta::Popover.new do |component|
|
63
|
+
component.with_body(caret: :bottom_left) do
|
64
|
+
"This is the Popover body."
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
def top_left
|
70
|
+
render Primer::Beta::Popover.new do |component|
|
71
|
+
component.with_body(caret: :top_left) do
|
72
|
+
"This is the Popover body."
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
# @!endgroup
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
data/static/arguments.json
CHANGED
@@ -355,6 +355,32 @@
|
|
355
355
|
}
|
356
356
|
]
|
357
357
|
},
|
358
|
+
{
|
359
|
+
"component": "Dropdown",
|
360
|
+
"status": "alpha",
|
361
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/dropdown.rb",
|
362
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/dropdown/default/",
|
363
|
+
"parameters": [
|
364
|
+
{
|
365
|
+
"name": "overlay",
|
366
|
+
"type": "Symbol",
|
367
|
+
"default": "`:default`",
|
368
|
+
"description": "One of `:dark`, `:default`, or `:none`."
|
369
|
+
},
|
370
|
+
{
|
371
|
+
"name": "with_caret",
|
372
|
+
"type": "Boolean",
|
373
|
+
"default": "`false`",
|
374
|
+
"description": "Whether or not a caret should be rendered in the button."
|
375
|
+
},
|
376
|
+
{
|
377
|
+
"name": "system_arguments",
|
378
|
+
"type": "Hash",
|
379
|
+
"default": "N/A",
|
380
|
+
"description": "[System arguments](/system-arguments)"
|
381
|
+
}
|
382
|
+
]
|
383
|
+
},
|
358
384
|
{
|
359
385
|
"component": "HiddenTextExpander",
|
360
386
|
"status": "alpha",
|
@@ -1683,6 +1709,20 @@
|
|
1683
1709
|
}
|
1684
1710
|
]
|
1685
1711
|
},
|
1712
|
+
{
|
1713
|
+
"component": "Popover",
|
1714
|
+
"status": "beta",
|
1715
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/beta/popover.rb",
|
1716
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/beta/popover/default/",
|
1717
|
+
"parameters": [
|
1718
|
+
{
|
1719
|
+
"name": "system_arguments",
|
1720
|
+
"type": "Hash",
|
1721
|
+
"default": "N/A",
|
1722
|
+
"description": "[System arguments](/system-arguments)"
|
1723
|
+
}
|
1724
|
+
]
|
1725
|
+
},
|
1686
1726
|
{
|
1687
1727
|
"component": "ProgressBar",
|
1688
1728
|
"status": "beta",
|
@@ -1845,32 +1885,6 @@
|
|
1845
1885
|
}
|
1846
1886
|
]
|
1847
1887
|
},
|
1848
|
-
{
|
1849
|
-
"component": "Dropdown",
|
1850
|
-
"status": "alpha",
|
1851
|
-
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/dropdown.rb",
|
1852
|
-
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/dropdown/default/",
|
1853
|
-
"parameters": [
|
1854
|
-
{
|
1855
|
-
"name": "overlay",
|
1856
|
-
"type": "Symbol",
|
1857
|
-
"default": "`:default`",
|
1858
|
-
"description": "One of `:dark`, `:default`, or `:none`."
|
1859
|
-
},
|
1860
|
-
{
|
1861
|
-
"name": "with_caret",
|
1862
|
-
"type": "Boolean",
|
1863
|
-
"default": "`false`",
|
1864
|
-
"description": "Whether or not a caret should be rendered in the button."
|
1865
|
-
},
|
1866
|
-
{
|
1867
|
-
"name": "system_arguments",
|
1868
|
-
"type": "Hash",
|
1869
|
-
"default": "N/A",
|
1870
|
-
"description": "[System arguments](/system-arguments)"
|
1871
|
-
}
|
1872
|
-
]
|
1873
|
-
},
|
1874
1888
|
{
|
1875
1889
|
"component": "DropdownMenu",
|
1876
1890
|
"status": "deprecated",
|
@@ -2227,20 +2241,6 @@
|
|
2227
2241
|
}
|
2228
2242
|
]
|
2229
2243
|
},
|
2230
|
-
{
|
2231
|
-
"component": "Popover",
|
2232
|
-
"status": "beta",
|
2233
|
-
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/popover_component.rb",
|
2234
|
-
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/popover/default/",
|
2235
|
-
"parameters": [
|
2236
|
-
{
|
2237
|
-
"name": "system_arguments",
|
2238
|
-
"type": "Hash",
|
2239
|
-
"default": "N/A",
|
2240
|
-
"description": "[System arguments](/system-arguments)"
|
2241
|
-
}
|
2242
|
-
]
|
2243
|
-
},
|
2244
2244
|
{
|
2245
2245
|
"component": "Spinner",
|
2246
2246
|
"status": "beta",
|
data/static/audited_at.json
CHANGED
@@ -11,6 +11,9 @@
|
|
11
11
|
"Primer::Alpha::Dialog::Body": "",
|
12
12
|
"Primer::Alpha::Dialog::Footer": "",
|
13
13
|
"Primer::Alpha::Dialog::Header": "",
|
14
|
+
"Primer::Alpha::Dropdown": "",
|
15
|
+
"Primer::Alpha::Dropdown::Menu": "",
|
16
|
+
"Primer::Alpha::Dropdown::Menu::Item": "",
|
14
17
|
"Primer::Alpha::HiddenTextExpander": "",
|
15
18
|
"Primer::Alpha::Image": "",
|
16
19
|
"Primer::Alpha::ImageCrop": "",
|
@@ -50,6 +53,7 @@
|
|
50
53
|
"Primer::Beta::IconButton": "",
|
51
54
|
"Primer::Beta::Label": "",
|
52
55
|
"Primer::Beta::Link": "",
|
56
|
+
"Primer::Beta::Popover": "",
|
53
57
|
"Primer::Beta::ProgressBar": "",
|
54
58
|
"Primer::Beta::Text": "",
|
55
59
|
"Primer::Beta::Truncate": "",
|
@@ -67,7 +71,6 @@
|
|
67
71
|
"Primer::DropdownMenuComponent": "",
|
68
72
|
"Primer::HellipButton": "",
|
69
73
|
"Primer::IconButton": "",
|
70
|
-
"Primer::Image": "",
|
71
74
|
"Primer::LabelComponent": "",
|
72
75
|
"Primer::LayoutComponent": "",
|
73
76
|
"Primer::LinkComponent": "",
|
@@ -78,7 +81,6 @@
|
|
78
81
|
"Primer::OcticonComponent": "",
|
79
82
|
"Primer::OcticonSymbolsComponent": "",
|
80
83
|
"Primer::PopoverComponent": "",
|
81
|
-
"Primer::ProgressBarComponent": "",
|
82
84
|
"Primer::SpinnerComponent": "",
|
83
85
|
"Primer::StateComponent": "",
|
84
86
|
"Primer::SubheadComponent": "",
|