primer_view_components 0.0.116 → 0.0.117
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +34 -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 +2 -2
- data/app/assets/styles/primer_view_components.css.map +1 -1
- data/app/components/primer/alpha/action_list.css +1 -1
- data/app/components/primer/alpha/action_list.css.json +1 -1
- data/app/components/primer/alpha/action_list.css.map +1 -1
- data/app/components/primer/alpha/auto_complete/item.rb +4 -4
- data/app/components/primer/alpha/auto_complete.rb +6 -6
- data/app/components/primer/alpha/dialog.rb +0 -2
- data/app/components/primer/alpha/dropdown.rb +53 -53
- data/app/components/primer/alpha/hellip_button.rb +41 -0
- data/app/components/primer/alpha/hidden_text_expander.rb +1 -1
- data/app/components/primer/alpha/layout.rb +48 -48
- data/app/components/primer/alpha/menu.css +1 -1
- data/app/components/primer/alpha/menu.css.json +1 -1
- data/app/components/primer/alpha/menu.css.map +1 -1
- data/app/components/primer/alpha/menu.rb +5 -5
- data/app/components/primer/alpha/segmented_control.rb +20 -20
- data/app/components/primer/{tab_container_component.d.ts → alpha/tab_container.d.ts} +0 -0
- data/app/components/primer/{tab_container_component.js → alpha/tab_container.js} +0 -0
- data/app/components/primer/alpha/tab_container.rb +43 -0
- data/app/components/primer/{tab_container_component.ts → alpha/tab_container.ts} +0 -0
- data/app/components/primer/alpha/tab_nav.css +1 -1
- data/app/components/primer/alpha/tab_nav.css.json +1 -1
- data/app/components/primer/alpha/tab_nav.css.map +1 -1
- data/app/components/primer/alpha/tab_nav.rb +32 -32
- data/app/components/primer/alpha/tool_tip.js +3 -7
- data/app/components/primer/alpha/tool_tip.ts +3 -7
- data/app/components/primer/alpha/tooltip.rb +18 -18
- data/app/components/primer/alpha/underline_nav.css +1 -1
- data/app/components/primer/alpha/underline_nav.css.json +1 -1
- data/app/components/primer/alpha/underline_nav.css.map +1 -1
- data/app/components/primer/alpha/underline_nav.rb +18 -18
- data/app/components/primer/beta/auto_complete/item.rb +2 -3
- data/app/components/primer/beta/auto_complete.rb +14 -16
- data/app/components/primer/beta/avatar_stack.rb +12 -14
- data/app/components/primer/beta/blankslate.rb +0 -1
- data/app/components/primer/beta/border_box/header.rb +0 -2
- data/app/components/primer/beta/border_box.rb +0 -2
- data/app/components/primer/beta/breadcrumbs.css +1 -1
- data/app/components/primer/beta/breadcrumbs.css.json +1 -1
- data/app/components/primer/beta/breadcrumbs.css.map +1 -1
- data/app/components/primer/beta/breadcrumbs.rb +0 -1
- data/app/components/primer/beta/button.rb +9 -10
- data/app/components/primer/beta/button_group.rb +0 -1
- data/app/components/primer/beta/details.rb +0 -1
- data/app/components/primer/beta/flash.rb +0 -1
- data/app/components/primer/beta/link.rb +2 -3
- data/app/components/primer/beta/octicon.rb +0 -1
- data/app/components/primer/beta/popover.rb +0 -1
- data/app/components/primer/{state_component.css → beta/state.css} +0 -0
- data/app/components/primer/beta/state.css.json +1 -0
- data/app/components/primer/beta/state.css.map +1 -0
- data/app/components/primer/{state_component.pcss → beta/state.pcss} +0 -0
- data/app/components/primer/beta/state.rb +76 -0
- data/app/components/primer/{subhead_component.css → beta/subhead.css} +0 -0
- data/app/components/primer/beta/subhead.css.json +1 -0
- data/app/components/primer/beta/subhead.css.map +1 -0
- data/app/components/primer/{subhead_component.html.erb → beta/subhead.html.erb} +0 -0
- data/app/components/primer/{subhead_component.pcss → beta/subhead.pcss} +0 -0
- data/app/components/primer/beta/subhead.rb +135 -0
- data/app/components/primer/{timeline_item_component.css → beta/timeline_item.css} +0 -0
- data/app/components/primer/beta/timeline_item.css.json +1 -0
- data/app/components/primer/beta/timeline_item.css.map +1 -0
- data/app/components/primer/{timeline_item_component.html.erb → beta/timeline_item.html.erb} +0 -0
- data/app/components/primer/{timeline_item_component.pcss → beta/timeline_item.pcss} +0 -0
- data/app/components/primer/beta/timeline_item.rb +90 -0
- data/app/components/primer/beta/truncate.css +1 -1
- data/app/components/primer/beta/truncate.css.json +1 -1
- data/app/components/primer/beta/truncate.css.map +1 -1
- data/app/components/primer/beta/truncate.rb +0 -1
- data/app/components/primer/button_component.rb +9 -9
- data/app/components/primer/component.rb +0 -1
- data/app/components/primer/hellip_button.rb +2 -34
- data/app/components/primer/navigation/tab_component.rb +16 -16
- data/app/components/primer/primer.d.ts +1 -1
- data/app/components/primer/primer.js +1 -1
- data/app/components/primer/primer.pcss +3 -3
- data/app/components/primer/primer.ts +1 -1
- data/app/components/primer/state_component.rb +2 -69
- data/app/components/primer/subhead_component.rb +2 -128
- data/app/components/primer/tab_container_component.rb +2 -36
- data/app/components/primer/timeline_item_component.rb +5 -78
- data/app/forms/example_toggle_switch_form/example_field_caption.html.erb +1 -0
- data/app/forms/example_toggle_switch_form.rb +8 -0
- data/app/forms/submit_button_form.rb +4 -4
- data/app/lib/primer/tabbed_component_helper.rb +1 -1
- data/lib/primer/deprecations.rb +7 -13
- data/lib/primer/deprecations.yml +24 -0
- data/lib/primer/forms/button.html.erb +2 -2
- data/lib/primer/forms/dsl/toggle_switch_input.rb +35 -0
- data/lib/primer/forms/toggle_switch.html.erb +17 -0
- data/lib/primer/forms/toggle_switch.rb +19 -0
- data/lib/primer/forms/toggle_switch_form.rb +74 -0
- data/lib/primer/view_components/linters/subhead_component_migration_counter.rb +1 -1
- data/lib/primer/view_components/version.rb +1 -1
- data/lib/rubocop/cop/primer/component_name_migration.rb +2 -1
- data/lib/tasks/docs.rake +6 -6
- data/previews/primer/alpha/action_list_preview.rb +44 -44
- data/previews/primer/alpha/dropdown_preview.rb +97 -97
- data/previews/primer/alpha/hellip_button_preview.rb +24 -0
- data/previews/primer/alpha/layout_preview.rb +63 -63
- data/previews/primer/alpha/menu_preview/default.html.erb +5 -5
- data/previews/primer/alpha/menu_preview/playground.html.erb +5 -5
- data/previews/primer/alpha/segmented_control_preview.rb +60 -60
- data/previews/primer/alpha/tab_nav_preview.rb +22 -22
- data/previews/primer/alpha/tab_panels_preview.rb +2 -2
- data/previews/primer/alpha/tooltip_preview/with_multiple_on_a_page.html.erb +6 -6
- data/previews/primer/alpha/tooltip_preview.rb +12 -12
- data/previews/primer/alpha/underline_nav_preview.rb +4 -4
- data/previews/primer/alpha/underline_panels_preview.rb +8 -8
- data/previews/primer/beta/auto_complete_item_preview/default.html.erb +2 -2
- data/previews/primer/beta/auto_complete_item_preview/playground.html.erb +2 -2
- data/previews/primer/beta/auto_complete_item_preview/with_description.html.erb +3 -3
- data/previews/primer/beta/auto_complete_preview/with_submit_button.html.erb +2 -2
- data/previews/primer/beta/auto_complete_preview.rb +18 -18
- data/previews/primer/beta/avatar_stack_preview.rb +32 -32
- data/previews/primer/beta/blankslate_preview.rb +40 -40
- data/previews/primer/beta/border_box_preview.rb +38 -38
- data/previews/primer/beta/breadcrumbs_preview.rb +2 -2
- data/previews/primer/beta/button_group_preview.rb +10 -10
- data/previews/primer/beta/button_preview/all_schemes.html.erb +4 -4
- data/previews/primer/beta/button_preview/invisible_all_visuals.html.erb +16 -16
- data/previews/primer/beta/button_preview/leading_visual.html.erb +2 -2
- data/previews/primer/beta/button_preview/trailing_action.html.erb +2 -2
- data/previews/primer/beta/button_preview/trailing_visual.html.erb +2 -2
- data/previews/primer/beta/button_preview/with_tooltip.html.erb +2 -2
- data/previews/primer/beta/details_preview.rb +6 -6
- data/previews/primer/beta/state_preview.rb +66 -0
- data/previews/primer/beta/subhead_preview/actions.html.erb +14 -0
- data/previews/primer/beta/subhead_preview.rb +99 -0
- data/previews/primer/beta/timeline_item_preview.rb +30 -0
- data/previews/primer/forms/forms_preview/example_toggle_switch_form.html.erb +1 -0
- data/previews/primer/forms/forms_preview.rb +2 -0
- data/static/arguments.json +118 -118
- data/static/audited_at.json +6 -0
- data/static/constants.json +67 -54
- data/static/statuses.json +12 -6
- metadata +36 -23
- data/app/components/primer/state_component.css.json +0 -1
- data/app/components/primer/state_component.css.map +0 -1
- data/app/components/primer/subhead_component.css.json +0 -1
- data/app/components/primer/subhead_component.css.map +0 -1
- data/app/components/primer/timeline_item_component.css.json +0 -1
- data/app/components/primer/timeline_item_component.css.map +0 -1
- data/previews/primer/hellip_button_preview.rb +0 -22
- data/previews/primer/state_component_preview.rb +0 -26
- data/previews/primer/subhead_component_preview.rb +0 -40
- data/previews/primer/timeline_item_component_preview.rb +0 -28
@@ -8,8 +8,8 @@ module Primer
|
|
8
8
|
# @param direction select [s, n, e, w, ne, nw, se, sw]
|
9
9
|
# @param tooltip_text text
|
10
10
|
def playground(type: :description, direction: :s, tooltip_text: "Tooltip text")
|
11
|
-
render(Primer::Beta::Button.new(id: "button-with-tooltip")) do |
|
12
|
-
|
11
|
+
render(Primer::Beta::Button.new(id: "button-with-tooltip")) do |component|
|
12
|
+
component.with_tooltip(text: tooltip_text, type: type, direction: direction)
|
13
13
|
"Button"
|
14
14
|
end
|
15
15
|
end
|
@@ -18,8 +18,8 @@ module Primer
|
|
18
18
|
# @param direction select [s, n, e, w, ne, nw, se, sw]
|
19
19
|
# @param tooltip_text text
|
20
20
|
def default(type: :description, direction: :s, tooltip_text: "Tooltip text")
|
21
|
-
render(Primer::Beta::Button.new(id: "button-with-tooltip")) do |
|
22
|
-
|
21
|
+
render(Primer::Beta::Button.new(id: "button-with-tooltip")) do |component|
|
22
|
+
component.with_tooltip(text: tooltip_text, type: type, direction: direction)
|
23
23
|
"Button"
|
24
24
|
end
|
25
25
|
end
|
@@ -27,8 +27,8 @@ module Primer
|
|
27
27
|
# @param direction select [s, n, e, w, ne, nw, se, sw]
|
28
28
|
# @param tooltip_text text
|
29
29
|
def label_tooltip_on_button_with_existing_labelledby(type: :label, direction: :s, tooltip_text: "Tooltip text")
|
30
|
-
render(Primer::Beta::Button.new(id: "button-with-existing-label", "aria-labelledby": "existing-label-id")) do |
|
31
|
-
|
30
|
+
render(Primer::Beta::Button.new(id: "button-with-existing-label", "aria-labelledby": "existing-label-id")) do |component|
|
31
|
+
component.with_tooltip(text: tooltip_text, type: type, direction: direction)
|
32
32
|
"Button"
|
33
33
|
end
|
34
34
|
end
|
@@ -36,8 +36,8 @@ module Primer
|
|
36
36
|
# @param direction select [s, n, e, w, ne, nw, se, sw]
|
37
37
|
# @param tooltip_text text
|
38
38
|
def description_tooltip_on_button_with_existing_describedby(type: :description, direction: :s, tooltip_text: "Tooltip text")
|
39
|
-
render(Primer::Beta::Button.new(id: "button-with-existing-description", "aria-describedby": "existing-description-id")) do |
|
40
|
-
|
39
|
+
render(Primer::Beta::Button.new(id: "button-with-existing-description", "aria-describedby": "existing-description-id")) do |component|
|
40
|
+
component.with_tooltip(text: tooltip_text, type: type, direction: direction)
|
41
41
|
"Button"
|
42
42
|
end
|
43
43
|
end
|
@@ -69,16 +69,16 @@ module Primer
|
|
69
69
|
# @!group Tooltip enabled elements
|
70
70
|
# @label Tooltip with Primer::Beta::Button
|
71
71
|
def tooltip_with_button(type: :description, direction: :s, tooltip_text: "Tooltip text")
|
72
|
-
render(Primer::Beta::Button.new(id: "button-with-tooltip")) do |
|
73
|
-
|
72
|
+
render(Primer::Beta::Button.new(id: "button-with-tooltip")) do |component|
|
73
|
+
component.with_tooltip(text: tooltip_text, type: type, direction: direction)
|
74
74
|
"Button"
|
75
75
|
end
|
76
76
|
end
|
77
77
|
|
78
78
|
# @label Tooltip with Primer::Beta::Link
|
79
79
|
def tooltip_with_link(type: :description, direction: :s, tooltip_text: "Tooltip text")
|
80
|
-
render(Primer::Beta::Link.new(href: "#link-with-tooltip", id: "link-with-tooltip")) do |
|
81
|
-
|
80
|
+
render(Primer::Beta::Link.new(href: "#link-with-tooltip", id: "link-with-tooltip")) do |component|
|
81
|
+
component.with_tooltip(text: tooltip_text, type: type, direction: direction)
|
82
82
|
"Button"
|
83
83
|
end
|
84
84
|
end
|
@@ -43,10 +43,10 @@ module Primer
|
|
43
43
|
def with_icons_and_counters(label: "With icons and counters", number_of_panels: 3, align: :left, tag: :nav)
|
44
44
|
render(Primer::Alpha::UnderlineNav.new(label: label, tag: tag, align: align)) do |component|
|
45
45
|
Array.new(number_of_panels || 3) do |i|
|
46
|
-
component.with_tab(href: "#", selected: i.zero?) do |
|
47
|
-
|
48
|
-
|
49
|
-
|
46
|
+
component.with_tab(href: "#", selected: i.zero?) do |tab|
|
47
|
+
tab.with_icon(icon: :star)
|
48
|
+
tab.with_text { "Item #{i + 1}" }
|
49
|
+
tab.with_counter(count: (i + 1) * 5)
|
50
50
|
end
|
51
51
|
end
|
52
52
|
end
|
@@ -9,11 +9,11 @@ module Primer
|
|
9
9
|
# @param number_of_panels [Integer] number
|
10
10
|
# @param align [Symbol] select [left, right]
|
11
11
|
def playground(number_of_panels: 3, align: :left)
|
12
|
-
render(Primer::Alpha::UnderlinePanels.new(label: "Test navigation", align: align)) do |
|
12
|
+
render(Primer::Alpha::UnderlinePanels.new(label: "Test navigation", align: align)) do |component|
|
13
13
|
Array.new(number_of_panels || 3) do |i|
|
14
|
-
|
15
|
-
|
16
|
-
|
14
|
+
component.with_tab(selected: i.zero?, id: "tab-#{i + 1}") do |tab|
|
15
|
+
tab.with_panel { "Panel #{i + 1}" }
|
16
|
+
tab.with_text { "Tab #{i + 1}" }
|
17
17
|
end
|
18
18
|
end
|
19
19
|
end
|
@@ -24,11 +24,11 @@ module Primer
|
|
24
24
|
# @param number_of_panels [Integer] number
|
25
25
|
# @param align [Symbol] select [left, right]
|
26
26
|
def default(number_of_panels: 3, align: :left)
|
27
|
-
render(Primer::Alpha::UnderlinePanels.new(label: "Test navigation", align: align)) do |
|
27
|
+
render(Primer::Alpha::UnderlinePanels.new(label: "Test navigation", align: align)) do |component|
|
28
28
|
Array.new(number_of_panels || 3) do |i|
|
29
|
-
|
30
|
-
|
31
|
-
|
29
|
+
component.with_tab(selected: i.zero?, id: "tab-#{i + 1}") do |tab|
|
30
|
+
tab.with_panel { "Panel #{i + 1}" }
|
31
|
+
tab.with_text { "Tab #{i + 1}" }
|
32
32
|
end
|
33
33
|
end
|
34
34
|
end
|
@@ -4,8 +4,8 @@
|
|
4
4
|
selected: selected,
|
5
5
|
disabled: disabled,
|
6
6
|
value: ''
|
7
|
-
)) do |
|
8
|
-
<%
|
9
|
-
<%
|
7
|
+
)) do |component| %>
|
8
|
+
<% component.with_leading_visual_icon(icon: :search) %>
|
9
|
+
<% component.with_description { "Description" } %>
|
10
10
|
Label text
|
11
11
|
<% end %>
|
@@ -13,8 +13,8 @@
|
|
13
13
|
disabled: disabled,
|
14
14
|
invalid: invalid,
|
15
15
|
input_name: input_name
|
16
|
-
)) do |
|
17
|
-
<%
|
16
|
+
)) do |component| %>
|
17
|
+
<% component.with_leading_visual_icon(icon: :search) %>
|
18
18
|
<% end %>
|
19
19
|
<%= render(Primer::ButtonComponent.new(scheme: :primary)) { "Submit" } %>
|
20
20
|
</div>
|
@@ -21,8 +21,8 @@ module Primer
|
|
21
21
|
# @param inset toggle
|
22
22
|
# @param monospace toggle
|
23
23
|
def playground(label_text: "Select a fruit", show_clear_button: false, visually_hide_label: false, placeholder: "Placeholder text", size: :medium, full_width: false, disabled: false, invalid: false, input_id: "input-id", list_id: "list-id", input_name: "input-id", inset: false, monospace: false)
|
24
|
-
render(Primer::Beta::AutoComplete.new(label_text: label_text, input_id: input_id, list_id: list_id, src: URLHelpers.autocomplete_index_path, show_clear_button: show_clear_button, visually_hide_label: visually_hide_label, placeholder: placeholder, size: size, full_width: full_width, disabled: disabled, invalid: invalid, input_name: input_name, inset: inset, monospace: monospace)) do |
|
25
|
-
|
24
|
+
render(Primer::Beta::AutoComplete.new(label_text: label_text, input_id: input_id, list_id: list_id, src: URLHelpers.autocomplete_index_path, show_clear_button: show_clear_button, visually_hide_label: visually_hide_label, placeholder: placeholder, size: size, full_width: full_width, disabled: disabled, invalid: invalid, input_name: input_name, inset: inset, monospace: monospace)) do |component|
|
25
|
+
component.with_leading_visual_icon(icon: :search)
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
@@ -41,8 +41,8 @@ module Primer
|
|
41
41
|
# @param inset toggle
|
42
42
|
# @param monospace toggle
|
43
43
|
def default(label_text: "Select a fruit", show_clear_button: false, visually_hide_label: false, placeholder: "Placeholder text", size: :medium, full_width: false, disabled: false, invalid: false, input_id: "input-id", list_id: "list-id", input_name: "input-id", inset: false, monospace: false)
|
44
|
-
render(Primer::Beta::AutoComplete.new(label_text: label_text, input_id: input_id, list_id: list_id, src: URLHelpers.autocomplete_index_path, show_clear_button: show_clear_button, visually_hide_label: visually_hide_label, placeholder: placeholder, size: size, full_width: full_width, disabled: disabled, invalid: invalid, input_name: input_name, inset: inset, monospace: monospace)) do |
|
45
|
-
|
44
|
+
render(Primer::Beta::AutoComplete.new(label_text: label_text, input_id: input_id, list_id: list_id, src: URLHelpers.autocomplete_index_path, show_clear_button: show_clear_button, visually_hide_label: visually_hide_label, placeholder: placeholder, size: size, full_width: full_width, disabled: disabled, invalid: invalid, input_name: input_name, inset: inset, monospace: monospace)) do |component|
|
45
|
+
component.with_leading_visual_icon(icon: :search)
|
46
46
|
end
|
47
47
|
end
|
48
48
|
|
@@ -87,8 +87,8 @@ module Primer
|
|
87
87
|
# @param list_id text
|
88
88
|
# @param input_name text
|
89
89
|
def leading_visual(label_text: "Select a fruit", show_clear_button: false, visually_hide_label: false, placeholder: "Placeholder text", size: :medium, full_width: false, disabled: false, invalid: false, input_id: "input-id", list_id: "list-id", input_name: "input-id")
|
90
|
-
render(Primer::Beta::AutoComplete.new(label_text: label_text, input_id: input_id, list_id: list_id, src: URLHelpers.autocomplete_index_path, show_clear_button: show_clear_button, visually_hide_label: visually_hide_label, placeholder: placeholder, size: size, full_width: full_width, disabled: disabled, invalid: invalid, input_name: input_name)) do |
|
91
|
-
|
90
|
+
render(Primer::Beta::AutoComplete.new(label_text: label_text, input_id: input_id, list_id: list_id, src: URLHelpers.autocomplete_index_path, show_clear_button: show_clear_button, visually_hide_label: visually_hide_label, placeholder: placeholder, size: size, full_width: full_width, disabled: disabled, invalid: invalid, input_name: input_name)) do |component|
|
91
|
+
component.with_leading_visual_icon(icon: :search)
|
92
92
|
end
|
93
93
|
end
|
94
94
|
|
@@ -121,8 +121,8 @@ module Primer
|
|
121
121
|
# @param list_id text
|
122
122
|
# @param input_name text
|
123
123
|
def full_width(label_text: "Select a fruit", show_clear_button: false, visually_hide_label: false, placeholder: "Placeholder text", size: :medium, full_width: true, disabled: false, invalid: false, input_id: "input-id", list_id: "list-id", input_name: "input-id")
|
124
|
-
render(Primer::Beta::AutoComplete.new(label_text: label_text, input_id: input_id, list_id: list_id, src: URLHelpers.autocomplete_index_path, show_clear_button: show_clear_button, visually_hide_label: visually_hide_label, placeholder: placeholder, size: size, full_width: full_width, disabled: disabled, invalid: invalid, input_name: input_name)) do |
|
125
|
-
|
124
|
+
render(Primer::Beta::AutoComplete.new(label_text: label_text, input_id: input_id, list_id: list_id, src: URLHelpers.autocomplete_index_path, show_clear_button: show_clear_button, visually_hide_label: visually_hide_label, placeholder: placeholder, size: size, full_width: full_width, disabled: disabled, invalid: invalid, input_name: input_name)) do |component|
|
125
|
+
component.with_leading_visual_icon(icon: :search)
|
126
126
|
end
|
127
127
|
end
|
128
128
|
|
@@ -139,8 +139,8 @@ module Primer
|
|
139
139
|
# @param list_id text
|
140
140
|
# @param input_name text
|
141
141
|
def visually_hide_label(label_text: "Select a fruit", show_clear_button: false, visually_hide_label: true, placeholder: "Placeholder text", size: :medium, full_width: false, disabled: false, invalid: false, input_id: "input-id", list_id: "list-id", input_name: "input-id")
|
142
|
-
render(Primer::Beta::AutoComplete.new(label_text: label_text, input_id: input_id, list_id: list_id, src: URLHelpers.autocomplete_index_path, show_clear_button: show_clear_button, visually_hide_label: visually_hide_label, placeholder: placeholder, size: size, full_width: full_width, disabled: disabled, invalid: invalid, input_name: input_name)) do |
|
143
|
-
|
142
|
+
render(Primer::Beta::AutoComplete.new(label_text: label_text, input_id: input_id, list_id: list_id, src: URLHelpers.autocomplete_index_path, show_clear_button: show_clear_button, visually_hide_label: visually_hide_label, placeholder: placeholder, size: size, full_width: full_width, disabled: disabled, invalid: invalid, input_name: input_name)) do |component|
|
143
|
+
component.with_leading_visual_icon(icon: :search)
|
144
144
|
end
|
145
145
|
end
|
146
146
|
|
@@ -158,8 +158,8 @@ module Primer
|
|
158
158
|
# @param list_id text
|
159
159
|
# @param input_name text
|
160
160
|
def small(label_text: "Select a fruit", show_clear_button: false, visually_hide_label: false, placeholder: "Placeholder text", size: :small, full_width: false, disabled: false, invalid: false, input_id: "input-id-1", list_id: "list-id-1", input_name: "input-id-1")
|
161
|
-
render(Primer::Beta::AutoComplete.new(label_text: label_text, input_id: input_id, list_id: list_id, src: URLHelpers.autocomplete_index_path, show_clear_button: show_clear_button, visually_hide_label: visually_hide_label, placeholder: placeholder, size: size, full_width: full_width, disabled: disabled, invalid: invalid, input_name: input_name)) do |
|
162
|
-
|
161
|
+
render(Primer::Beta::AutoComplete.new(label_text: label_text, input_id: input_id, list_id: list_id, src: URLHelpers.autocomplete_index_path, show_clear_button: show_clear_button, visually_hide_label: visually_hide_label, placeholder: placeholder, size: size, full_width: full_width, disabled: disabled, invalid: invalid, input_name: input_name)) do |component|
|
162
|
+
component.with_leading_visual_icon(icon: :search)
|
163
163
|
end
|
164
164
|
end
|
165
165
|
|
@@ -175,8 +175,8 @@ module Primer
|
|
175
175
|
# @param list_id text
|
176
176
|
# @param input_name text
|
177
177
|
def medium(label_text: "Select a fruit", show_clear_button: false, visually_hide_label: false, placeholder: "Placeholder text", size: :medium, full_width: false, disabled: false, invalid: false, input_id: "input-id-2", list_id: "list-id-2", input_name: "input-id-2")
|
178
|
-
render(Primer::Beta::AutoComplete.new(label_text: label_text, input_id: input_id, list_id: list_id, src: URLHelpers.autocomplete_index_path, show_clear_button: show_clear_button, visually_hide_label: visually_hide_label, placeholder: placeholder, size: size, full_width: full_width, disabled: disabled, invalid: invalid, input_name: input_name)) do |
|
179
|
-
|
178
|
+
render(Primer::Beta::AutoComplete.new(label_text: label_text, input_id: input_id, list_id: list_id, src: URLHelpers.autocomplete_index_path, show_clear_button: show_clear_button, visually_hide_label: visually_hide_label, placeholder: placeholder, size: size, full_width: full_width, disabled: disabled, invalid: invalid, input_name: input_name)) do |component|
|
179
|
+
component.with_leading_visual_icon(icon: :search)
|
180
180
|
end
|
181
181
|
end
|
182
182
|
|
@@ -192,8 +192,8 @@ module Primer
|
|
192
192
|
# @param list_id text
|
193
193
|
# @param input_name text
|
194
194
|
def large(label_text: "Select a fruit", show_clear_button: false, visually_hide_label: false, placeholder: "Placeholder text", size: :large, full_width: false, disabled: false, invalid: false, input_id: "input-id-3", list_id: "list-id-3", input_name: "input-id-3")
|
195
|
-
render(Primer::Beta::AutoComplete.new(label_text: label_text, input_id: input_id, list_id: list_id, src: URLHelpers.autocomplete_index_path, show_clear_button: show_clear_button, visually_hide_label: visually_hide_label, placeholder: placeholder, size: size, full_width: full_width, disabled: disabled, invalid: invalid, input_name: input_name)) do |
|
196
|
-
|
195
|
+
render(Primer::Beta::AutoComplete.new(label_text: label_text, input_id: input_id, list_id: list_id, src: URLHelpers.autocomplete_index_path, show_clear_button: show_clear_button, visually_hide_label: visually_hide_label, placeholder: placeholder, size: size, full_width: full_width, disabled: disabled, invalid: invalid, input_name: input_name)) do |component|
|
196
|
+
component.with_leading_visual_icon(icon: :search)
|
197
197
|
end
|
198
198
|
end
|
199
199
|
|
@@ -238,8 +238,8 @@ module Primer
|
|
238
238
|
|
239
239
|
# @hidden
|
240
240
|
def with_icon
|
241
|
-
render(Primer::Beta::AutoComplete.new(label_text: "Select a fruit", input_id: "input-id", list_id: "test-id", src: URLHelpers.autocomplete_index_path)) do |
|
242
|
-
|
241
|
+
render(Primer::Beta::AutoComplete.new(label_text: "Select a fruit", input_id: "input-id", list_id: "test-id", src: URLHelpers.autocomplete_index_path)) do |component|
|
242
|
+
component.with_leading_visual_icon(icon: :search)
|
243
243
|
end
|
244
244
|
end
|
245
245
|
|
@@ -12,17 +12,17 @@ module Primer
|
|
12
12
|
# @param tooltipped toggle
|
13
13
|
# @param tooltip_label text
|
14
14
|
def playground(number_of_avatars: 1, tag: :div, align: :left, tooltipped: false, tooltip_label: "This is a tooltip!")
|
15
|
-
render(Primer::Beta::AvatarStack.new(tag: tag, align: align, tooltipped: tooltipped, body_arguments: { label: tooltip_label })) do |
|
15
|
+
render(Primer::Beta::AvatarStack.new(tag: tag, align: align, tooltipped: tooltipped, body_arguments: { label: tooltip_label })) do |component|
|
16
16
|
Array.new(number_of_avatars || 1) do
|
17
|
-
|
17
|
+
component.with_avatar(src: Primer::ExampleImage::BASE64_SRC, alt: "@kittenuser")
|
18
18
|
end
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
22
22
|
# @label Default
|
23
23
|
def default
|
24
|
-
render(Primer::Beta::AvatarStack.new) do |
|
25
|
-
|
24
|
+
render(Primer::Beta::AvatarStack.new) do |component|
|
25
|
+
component.with_avatar(src: Primer::ExampleImage::BASE64_SRC, alt: "@kittenuser")
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
@@ -30,46 +30,46 @@ module Primer
|
|
30
30
|
#
|
31
31
|
# @label 1 avatar
|
32
32
|
def avatar_1
|
33
|
-
render(Primer::Beta::AvatarStack.new) do |
|
34
|
-
|
33
|
+
render(Primer::Beta::AvatarStack.new) do |component|
|
34
|
+
component.with_avatar(src: Primer::ExampleImage::BASE64_SRC, alt: "@kittenuser")
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
38
38
|
# @label 2 avatars
|
39
39
|
def avatar_2
|
40
|
-
render(Primer::Beta::AvatarStack.new) do |
|
41
|
-
|
42
|
-
|
40
|
+
render(Primer::Beta::AvatarStack.new) do |component|
|
41
|
+
component.with_avatar(src: Primer::ExampleImage::BASE64_SRC, alt: "@kittenuser")
|
42
|
+
component.with_avatar(src: Primer::ExampleImage::BASE64_SRC, alt: "@kittenuser")
|
43
43
|
end
|
44
44
|
end
|
45
45
|
|
46
46
|
# @label 3 avatars
|
47
47
|
def avatar_3
|
48
|
-
render(Primer::Beta::AvatarStack.new) do |
|
49
|
-
|
50
|
-
|
51
|
-
|
48
|
+
render(Primer::Beta::AvatarStack.new) do |component|
|
49
|
+
component.with_avatar(src: Primer::ExampleImage::BASE64_SRC, alt: "@kittenuser")
|
50
|
+
component.with_avatar(src: Primer::ExampleImage::BASE64_SRC, alt: "@kittenuser")
|
51
|
+
component.with_avatar(src: Primer::ExampleImage::BASE64_SRC, alt: "@kittenuser")
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
55
55
|
# @label 4 avatars
|
56
56
|
def avatar_4
|
57
|
-
render(Primer::Beta::AvatarStack.new) do |
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
57
|
+
render(Primer::Beta::AvatarStack.new) do |component|
|
58
|
+
component.with_avatar(src: Primer::ExampleImage::BASE64_SRC, alt: "@kittenuser")
|
59
|
+
component.with_avatar(src: Primer::ExampleImage::BASE64_SRC, alt: "@kittenuser")
|
60
|
+
component.with_avatar(src: Primer::ExampleImage::BASE64_SRC, alt: "@kittenuser")
|
61
|
+
component.with_avatar(src: Primer::ExampleImage::BASE64_SRC, alt: "@kittenuser")
|
62
62
|
end
|
63
63
|
end
|
64
64
|
|
65
65
|
# @label 5 avatars
|
66
66
|
def avatar_5
|
67
|
-
render(Primer::Beta::AvatarStack.new) do |
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
67
|
+
render(Primer::Beta::AvatarStack.new) do |component|
|
68
|
+
component.with_avatar(src: Primer::ExampleImage::BASE64_SRC, alt: "@kittenuser")
|
69
|
+
component.with_avatar(src: Primer::ExampleImage::BASE64_SRC, alt: "@kittenuser")
|
70
|
+
component.with_avatar(src: Primer::ExampleImage::BASE64_SRC, alt: "@kittenuser")
|
71
|
+
component.with_avatar(src: Primer::ExampleImage::BASE64_SRC, alt: "@kittenuser")
|
72
|
+
component.with_avatar(src: Primer::ExampleImage::BASE64_SRC, alt: "@kittenuser")
|
73
73
|
end
|
74
74
|
end
|
75
75
|
#
|
@@ -79,19 +79,19 @@ module Primer
|
|
79
79
|
#
|
80
80
|
# @label Align right
|
81
81
|
def align_right
|
82
|
-
render(Primer::Beta::AvatarStack.new(align: :right)) do |
|
83
|
-
|
84
|
-
|
85
|
-
|
82
|
+
render(Primer::Beta::AvatarStack.new(align: :right)) do |component|
|
83
|
+
component.with_avatar(src: Primer::ExampleImage::BASE64_SRC, alt: "@kittenuser")
|
84
|
+
component.with_avatar(src: Primer::ExampleImage::BASE64_SRC, alt: "@kittenuser")
|
85
|
+
component.with_avatar(src: Primer::ExampleImage::BASE64_SRC, alt: "@kittenuser")
|
86
86
|
end
|
87
87
|
end
|
88
88
|
|
89
89
|
# @label With tooltip
|
90
90
|
def with_tooltip
|
91
|
-
render(Primer::Beta::AvatarStack.new(tooltipped: true, body_arguments: { label: "This is a tooltip!" })) do |
|
92
|
-
|
93
|
-
|
94
|
-
|
91
|
+
render(Primer::Beta::AvatarStack.new(tooltipped: true, body_arguments: { label: "This is a tooltip!" })) do |component|
|
92
|
+
component.with_avatar(src: Primer::ExampleImage::BASE64_SRC, alt: "@kittenuser")
|
93
|
+
component.with_avatar(src: Primer::ExampleImage::BASE64_SRC, alt: "@kittenuser")
|
94
|
+
component.with_avatar(src: Primer::ExampleImage::BASE64_SRC, alt: "@kittenuser")
|
95
95
|
end
|
96
96
|
end
|
97
97
|
#
|
@@ -10,17 +10,17 @@ module Primer
|
|
10
10
|
# @param spacious [Boolean] toggle
|
11
11
|
# @param border [Boolean] toggle
|
12
12
|
def playground(narrow: false, spacious: false, border: false)
|
13
|
-
render Primer::Beta::Blankslate.new(narrow: narrow, spacious: spacious, border: border) do |
|
14
|
-
|
15
|
-
|
13
|
+
render Primer::Beta::Blankslate.new(narrow: narrow, spacious: spacious, border: border) do |component|
|
14
|
+
component.with_heading(tag: :h2).with_content("Title")
|
15
|
+
component.with_description { "Description" }
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
19
|
# @label Default options
|
20
20
|
def default
|
21
|
-
render Primer::Beta::Blankslate.new do |
|
22
|
-
|
23
|
-
|
21
|
+
render Primer::Beta::Blankslate.new do |component|
|
22
|
+
component.with_heading(tag: :h2).with_content("Title")
|
23
|
+
component.with_description { "Description" }
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
@@ -28,25 +28,25 @@ module Primer
|
|
28
28
|
#
|
29
29
|
# @label Narrow
|
30
30
|
def option_narrow
|
31
|
-
render Primer::Beta::Blankslate.new(narrow: true) do |
|
32
|
-
|
33
|
-
|
31
|
+
render Primer::Beta::Blankslate.new(narrow: true) do |component|
|
32
|
+
component.with_heading(tag: :h2).with_content("Title")
|
33
|
+
component.with_description { "Description" }
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
37
37
|
# @label Spacious
|
38
38
|
def option_spacious
|
39
|
-
render Primer::Beta::Blankslate.new(spacious: true) do |
|
40
|
-
|
41
|
-
|
39
|
+
render Primer::Beta::Blankslate.new(spacious: true) do |component|
|
40
|
+
component.with_heading(tag: :h2).with_content("Title")
|
41
|
+
component.with_description { "Description" }
|
42
42
|
end
|
43
43
|
end
|
44
44
|
|
45
45
|
# @label Border
|
46
46
|
def option_border
|
47
|
-
render Primer::Beta::Blankslate.new(border: true) do |
|
48
|
-
|
49
|
-
|
47
|
+
render Primer::Beta::Blankslate.new(border: true) do |component|
|
48
|
+
component.with_heading(tag: :h2).with_content("Title")
|
49
|
+
component.with_description { "Description" }
|
50
50
|
end
|
51
51
|
end
|
52
52
|
#
|
@@ -56,9 +56,9 @@ module Primer
|
|
56
56
|
# @param spacious [Boolean] toggle
|
57
57
|
# @param border [Boolean] toggle
|
58
58
|
def with_icon(narrow: false, spacious: false, border: false)
|
59
|
-
render Primer::Beta::Blankslate.new(narrow: narrow, spacious: spacious, border: border) do |
|
60
|
-
|
61
|
-
|
59
|
+
render Primer::Beta::Blankslate.new(narrow: narrow, spacious: spacious, border: border) do |component|
|
60
|
+
component.with_visual_icon(icon: :shield)
|
61
|
+
component.with_heading(tag: :h2).with_content("It looks like we have discovered a vulnerability")
|
62
62
|
end
|
63
63
|
end
|
64
64
|
|
@@ -66,9 +66,9 @@ module Primer
|
|
66
66
|
# @param spacious [Boolean] toggle
|
67
67
|
# @param border [Boolean] toggle
|
68
68
|
def with_image(narrow: false, spacious: false, border: false)
|
69
|
-
render Primer::Beta::Blankslate.new(narrow: narrow, spacious: spacious, border: border) do |
|
70
|
-
|
71
|
-
|
69
|
+
render Primer::Beta::Blankslate.new(narrow: narrow, spacious: spacious, border: border) do |component|
|
70
|
+
component.with_heading(tag: :h2).with_content("Millions of teams trust GitHub to keep their work safe")
|
71
|
+
component.with_visual_image(src: Primer::ExampleImage::BASE64_SRC, alt: "Security - secure vault")
|
72
72
|
end
|
73
73
|
end
|
74
74
|
|
@@ -76,10 +76,10 @@ module Primer
|
|
76
76
|
# @param spacious [Boolean] toggle
|
77
77
|
# @param border [Boolean] toggle
|
78
78
|
def loading(narrow: false, spacious: false, border: false)
|
79
|
-
render Primer::Beta::Blankslate.new(narrow: narrow, spacious: spacious, border: border) do |
|
80
|
-
|
81
|
-
|
82
|
-
|
79
|
+
render Primer::Beta::Blankslate.new(narrow: narrow, spacious: spacious, border: border) do |component|
|
80
|
+
component.with_heading(tag: :h2).with_content("Mirroring your repository")
|
81
|
+
component.with_description { "We’re currently mirroring this repository. It should take anywhere from a few minutes to a couple of hours depending on the size of the repository." }
|
82
|
+
component.with_visual_spinner(size: :large)
|
83
83
|
end
|
84
84
|
end
|
85
85
|
|
@@ -87,9 +87,9 @@ module Primer
|
|
87
87
|
# @param spacious [Boolean] toggle
|
88
88
|
# @param border [Boolean] toggle
|
89
89
|
def description(narrow: false, spacious: false, border: false)
|
90
|
-
render Primer::Beta::Blankslate.new(narrow: narrow, spacious: spacious, border: border) do |
|
91
|
-
|
92
|
-
|
90
|
+
render Primer::Beta::Blankslate.new(narrow: narrow, spacious: spacious, border: border) do |component|
|
91
|
+
component.with_heading(tag: :h2).with_content("It looks like we have discovered a vulnerability")
|
92
|
+
component.with_description { "Millions of teams trust GitHub to keep their work safe" }
|
93
93
|
end
|
94
94
|
end
|
95
95
|
|
@@ -97,9 +97,9 @@ module Primer
|
|
97
97
|
# @param spacious [Boolean] toggle
|
98
98
|
# @param border [Boolean] toggle
|
99
99
|
def primary_action(narrow: false, spacious: false, border: false)
|
100
|
-
render Primer::Beta::Blankslate.new(narrow: narrow, spacious: spacious, border: border) do |
|
101
|
-
|
102
|
-
|
100
|
+
render Primer::Beta::Blankslate.new(narrow: narrow, spacious: spacious, border: border) do |component|
|
101
|
+
component.with_heading(tag: :h2).with_content("It looks like we have discovered a vulnerability")
|
102
|
+
component.with_primary_action(href: "#").with_content("Fix issue")
|
103
103
|
end
|
104
104
|
end
|
105
105
|
|
@@ -107,9 +107,9 @@ module Primer
|
|
107
107
|
# @param spacious [Boolean] toggle
|
108
108
|
# @param border [Boolean] toggle
|
109
109
|
def secondary_action(narrow: false, spacious: false, border: false)
|
110
|
-
render Primer::Beta::Blankslate.new(narrow: narrow, spacious: spacious, border: border) do |
|
111
|
-
|
112
|
-
|
110
|
+
render Primer::Beta::Blankslate.new(narrow: narrow, spacious: spacious, border: border) do |component|
|
111
|
+
component.with_heading(tag: :h2).with_content("It looks like we have discovered a vulnerability")
|
112
|
+
component.with_secondary_action(href: "#").with_content("Fix issue")
|
113
113
|
end
|
114
114
|
end
|
115
115
|
|
@@ -117,12 +117,12 @@ module Primer
|
|
117
117
|
# @param spacious [Boolean] toggle
|
118
118
|
# @param border [Boolean] toggle
|
119
119
|
def full(narrow: false, spacious: false, border: false)
|
120
|
-
render Primer::Beta::Blankslate.new(narrow: narrow, spacious: spacious, border: border) do |
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
120
|
+
render Primer::Beta::Blankslate.new(narrow: narrow, spacious: spacious, border: border) do |component|
|
121
|
+
component.with_visual_icon(icon: :shield)
|
122
|
+
component.with_heading(tag: :h2).with_content("It looks like we have discovered a vulnerability")
|
123
|
+
component.with_description { "Millions of teams trust GitHub to keep their work safe" }
|
124
|
+
component.with_primary_action(href: "#").with_content("Fix issue")
|
125
|
+
component.with_secondary_action(href: "#").with_content("Learn more about vulnerabilities")
|
126
126
|
end
|
127
127
|
end
|
128
128
|
end
|