primer_view_components 0.43.1 → 0.43.3
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 +26 -0
- data/app/assets/javascripts/components/primer/beta/details_toggle_element.d.ts +4 -3
- 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/action_list.js +0 -2
- data/app/components/primer/alpha/action_list.ts +0 -2
- data/app/components/primer/alpha/segmented_control.css +1 -1
- data/app/components/primer/alpha/segmented_control.css.map +1 -1
- data/app/components/primer/alpha/toggle_switch.js +1 -0
- data/app/components/primer/alpha/toggle_switch.ts +1 -0
- data/app/components/primer/beta/breadcrumbs.css +1 -1
- data/app/components/primer/beta/breadcrumbs.css.map +1 -1
- data/app/components/primer/beta/breadcrumbs.pcss +1 -0
- data/app/components/primer/beta/button.css +1 -1
- data/app/components/primer/beta/button.css.map +1 -1
- data/app/components/primer/beta/details.rb +22 -12
- data/app/components/primer/beta/details_toggle_element.d.ts +4 -3
- data/app/components/primer/beta/details_toggle_element.js +12 -7
- data/app/components/primer/beta/details_toggle_element.ts +12 -7
- data/app/components/primer/beta/nav_list.js +0 -1
- data/app/components/primer/beta/nav_list.ts +0 -1
- data/app/components/primer/beta/nav_list_group_element.js +1 -0
- data/app/components/primer/beta/nav_list_group_element.ts +1 -0
- data/app/components/primer/beta/truncate.css +1 -1
- data/app/components/primer/beta/truncate.css.map +1 -1
- data/app/controllers/primer/view_components/action_menu_controller.rb +52 -0
- data/app/controllers/primer/view_components/application_controller.rb +10 -0
- data/app/controllers/primer/view_components/auto_check_controller.rb +41 -0
- data/app/controllers/primer/view_components/auto_complete_test_controller.rb +55 -0
- data/app/controllers/primer/view_components/form_handler_controller.rb +31 -0
- data/app/controllers/primer/view_components/include_fragment_controller.rb +17 -0
- data/app/controllers/primer/view_components/multi_controller.rb +15 -0
- data/app/controllers/primer/view_components/nav_list_items_controller.rb +28 -0
- data/app/controllers/primer/view_components/select_panel_items_controller.rb +122 -0
- data/app/controllers/primer/view_components/toggle_switch_controller.rb +48 -0
- data/app/forms/auto_complete_form.rb +1 -1
- data/app/forms/immediate_validation_form.rb +3 -3
- data/app/lib/primer/forms/acts_as_component.rb +0 -2
- data/app/lib/primer/forms/dsl/text_field_input.rb +1 -1
- data/app/views/primer/view_components/action_menu/deferred.html.erb +22 -0
- data/app/views/primer/view_components/action_menu/deferred_preload.html.erb +5 -0
- data/app/views/primer/view_components/action_menu/form_action.html.erb +2 -0
- data/app/views/primer/view_components/action_menu/landing.html.erb +3 -0
- data/app/views/primer/view_components/auto_check/_error_message.html.erb +1 -0
- data/app/views/primer/view_components/auto_check/_success_message.html.erb +1 -0
- data/app/views/primer/view_components/auto_check/_warning_message.html.erb +4 -0
- data/app/views/primer/view_components/auto_complete_test/index.html.erb +15 -0
- data/app/views/primer/view_components/auto_complete_test/no_results.html.erb +16 -0
- data/app/views/primer/view_components/form_handler/form_action.html.erb +1 -0
- data/app/views/primer/view_components/include_fragment/deferred.html.erb +3 -0
- data/app/views/primer/view_components/nav_list_items/index.html.erb +3 -0
- data/app/views/primer/view_components/select_panel_items/index.html.erb +15 -0
- data/config/routes.rb +27 -0
- data/lib/primer/accessibility.rb +3 -0
- data/lib/primer/view_components/engine.rb +4 -0
- data/lib/primer/view_components/linters/autocorrectable.rb +1 -1
- data/lib/primer/view_components/linters/migrations/iconbutton_component.rb +4 -7
- data/lib/primer/view_components/linters/migrations/truncate_component.rb +4 -7
- data/lib/primer/view_components/version.rb +1 -1
- data/lib/rubocop/cop/primer/base_cop.rb +1 -1
- data/lib/rubocop/cop/primer/component_name_migration.rb +7 -8
- data/lib/rubocop/cop/primer/deprecated_arguments.rb +7 -8
- data/lib/rubocop/cop/primer/deprecated_button_arguments.rb +5 -6
- data/lib/rubocop/cop/primer/deprecated_label_schemes.rb +6 -7
- data/lib/rubocop/cop/primer/deprecated_label_variants.rb +7 -14
- data/lib/rubocop/cop/primer/no_tag_memoize.rb +1 -1
- data/lib/rubocop/cop/primer/primer_octicon.rb +5 -6
- data/previews/primer/alpha/action_menu_preview/multiple_select_form.html.erb +1 -1
- data/previews/primer/alpha/action_menu_preview/single_select_form.html.erb +1 -1
- data/previews/primer/alpha/action_menu_preview/single_select_form_items.html.erb +2 -2
- data/previews/primer/alpha/action_menu_preview/with_actions.html.erb +2 -2
- data/previews/primer/alpha/action_menu_preview.rb +2 -2
- data/previews/primer/alpha/auto_complete_preview.rb +6 -6
- data/previews/primer/alpha/dialog_preview.rb +1 -1
- data/previews/primer/alpha/include_fragment_preview.rb +2 -2
- data/previews/primer/alpha/select_panel_preview/custom_loading_description.html.erb +1 -1
- data/previews/primer/alpha/select_panel_preview/custom_loading_label.html.erb +1 -1
- data/previews/primer/alpha/select_panel_preview/eventually_local_fetch.html.erb +1 -1
- data/previews/primer/alpha/select_panel_preview/eventually_local_fetch_initial_failure.html.erb +1 -1
- data/previews/primer/alpha/select_panel_preview/eventually_local_fetch_no_results.html.erb +1 -1
- data/previews/primer/alpha/select_panel_preview/multiselect_form.html.erb +1 -1
- data/previews/primer/alpha/select_panel_preview/playground.html.erb +1 -1
- data/previews/primer/alpha/select_panel_preview/remote_fetch.html.erb +1 -1
- data/previews/primer/alpha/select_panel_preview/remote_fetch_filter_failure.html.erb +1 -1
- data/previews/primer/alpha/select_panel_preview/remote_fetch_form.html.erb +2 -2
- data/previews/primer/alpha/select_panel_preview/remote_fetch_initial_failure.html.erb +1 -1
- data/previews/primer/alpha/select_panel_preview/remote_fetch_no_results.html.erb +1 -1
- data/previews/primer/alpha/select_panel_preview/single_select_form.html.erb +1 -1
- data/previews/primer/alpha/text_field_preview/input_group_leading_action_menu.html.erb +1 -1
- data/previews/primer/alpha/text_field_preview.rb +3 -3
- data/previews/primer/alpha/toggle_switch_preview.rb +11 -11
- data/previews/primer/beta/auto_complete_preview/with_submit_button.html.erb +1 -1
- data/previews/primer/beta/auto_complete_preview.rb +18 -18
- data/previews/primer/beta/breadcrumbs_preview/with_long_items.html.erb +13 -0
- data/previews/primer/beta/breadcrumbs_preview.rb +6 -0
- data/previews/primer/beta/details_preview.rb +16 -0
- data/previews/primer/beta/nav_list_preview.rb +2 -2
- data/previews/primer/forms_preview/action_menu_form.html.erb +1 -1
- data/previews/primer/forms_preview/auto_complete_form.html.erb +1 -1
- data/previews/primer/forms_preview/example_toggle_switch_form.html.erb +2 -2
- data/previews/primer/forms_preview/multi_input_form.html.erb +1 -1
- data/previews/primer/forms_preview/select_form.html.erb +1 -1
- data/previews/primer/url_helpers.rb +1 -0
- data/static/arguments.json +67 -37
- data/static/audited_at.json +1 -0
- data/static/constants.json +13 -2
- data/static/info_arch.json +638 -1407
- data/static/previews.json +112 -0
- data/static/statuses.json +1 -0
- metadata +27 -2
@@ -22,7 +22,7 @@ module Primer
|
|
22
22
|
# @param inset toggle
|
23
23
|
# @param monospace toggle
|
24
24
|
def playground(label_text: "Select a fruit", show_clear_button: false, visually_hide_label: false, placeholder: "Placeholder text", size: :medium, full_width: false, width: :auto, disabled: false, invalid: false, input_id: "input-id", list_id: "list-id", input_name: "input-id", inset: false, monospace: false)
|
25
|
-
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, width: width, disabled: disabled, invalid: invalid, input_name: input_name, inset: inset, monospace: monospace)) do |component|
|
25
|
+
render(Primer::Beta::AutoComplete.new(label_text: label_text, input_id: input_id, list_id: list_id, src: UrlHelpers.primer_view_components.autocomplete_index_path, show_clear_button: show_clear_button, visually_hide_label: visually_hide_label, placeholder: placeholder, size: size, full_width: full_width, width: width, disabled: disabled, invalid: invalid, input_name: input_name, inset: inset, monospace: monospace)) do |component|
|
26
26
|
component.with_leading_visual_icon(icon: :search)
|
27
27
|
end
|
28
28
|
end
|
@@ -43,7 +43,7 @@ module Primer
|
|
43
43
|
# @param inset toggle
|
44
44
|
# @param monospace toggle
|
45
45
|
def default(label_text: "Select a fruit", show_clear_button: false, visually_hide_label: false, placeholder: "Placeholder text", size: :medium, full_width: false, width: :auto, disabled: false, invalid: false, input_id: "input-id", list_id: "list-id", input_name: "input-id", inset: false, monospace: false)
|
46
|
-
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, width: width, disabled: disabled, invalid: invalid, input_name: input_name, inset: inset, monospace: monospace)) do |component|
|
46
|
+
render(Primer::Beta::AutoComplete.new(label_text: label_text, input_id: input_id, list_id: list_id, src: UrlHelpers.primer_view_components.autocomplete_index_path, show_clear_button: show_clear_button, visually_hide_label: visually_hide_label, placeholder: placeholder, size: size, full_width: full_width, width: width, disabled: disabled, invalid: invalid, input_name: input_name, inset: inset, monospace: monospace)) do |component|
|
47
47
|
component.with_leading_visual_icon(icon: :search)
|
48
48
|
end
|
49
49
|
end
|
@@ -93,7 +93,7 @@ module Primer
|
|
93
93
|
# @param list_id text
|
94
94
|
# @param input_name text
|
95
95
|
def leading_visual(label_text: "Select a fruit", show_clear_button: false, visually_hide_label: false, placeholder: "Placeholder text", size: :medium, full_width: false, width: :auto, disabled: false, invalid: false, input_id: "input-id", list_id: "list-id", input_name: "input-id")
|
96
|
-
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, width: width, disabled: disabled, invalid: invalid, input_name: input_name)) do |component|
|
96
|
+
render(Primer::Beta::AutoComplete.new(label_text: label_text, input_id: input_id, list_id: list_id, src: UrlHelpers.primer_view_components.autocomplete_index_path, show_clear_button: show_clear_button, visually_hide_label: visually_hide_label, placeholder: placeholder, size: size, full_width: full_width, width: width, disabled: disabled, invalid: invalid, input_name: input_name)) do |component|
|
97
97
|
component.with_leading_visual_icon(icon: :search)
|
98
98
|
end
|
99
99
|
end
|
@@ -113,7 +113,7 @@ module Primer
|
|
113
113
|
# @param list_id text
|
114
114
|
# @param input_name text
|
115
115
|
def trailing_action(label_text: "Select a fruit", show_clear_button: true, visually_hide_label: false, placeholder: "Placeholder text", size: :medium, full_width: false, width: :auto, disabled: false, invalid: false, input_id: "input-id", list_id: "list-id", input_name: "input-id")
|
116
|
-
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, width: width, disabled: disabled, invalid: invalid, input_name: input_name))
|
116
|
+
render(Primer::Beta::AutoComplete.new(label_text: label_text, input_id: input_id, list_id: list_id, src: UrlHelpers.primer_view_components.autocomplete_index_path, show_clear_button: show_clear_button, visually_hide_label: visually_hide_label, placeholder: placeholder, size: size, full_width: full_width, width: width, disabled: disabled, invalid: invalid, input_name: input_name))
|
117
117
|
end
|
118
118
|
|
119
119
|
# @label Full width
|
@@ -131,7 +131,7 @@ module Primer
|
|
131
131
|
# @param list_id text
|
132
132
|
# @param input_name text
|
133
133
|
def full_width(label_text: "Select a fruit", show_clear_button: false, visually_hide_label: false, placeholder: "Placeholder text", size: :medium, full_width: true, width: :auto, disabled: false, invalid: false, input_id: "input-id", list_id: "list-id", input_name: "input-id")
|
134
|
-
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, width: width, disabled: disabled, invalid: invalid, input_name: input_name)) do |component|
|
134
|
+
render(Primer::Beta::AutoComplete.new(label_text: label_text, input_id: input_id, list_id: list_id, src: UrlHelpers.primer_view_components.autocomplete_index_path, show_clear_button: show_clear_button, visually_hide_label: visually_hide_label, placeholder: placeholder, size: size, full_width: full_width, width: width, disabled: disabled, invalid: invalid, input_name: input_name)) do |component|
|
135
135
|
component.with_leading_visual_icon(icon: :search)
|
136
136
|
end
|
137
137
|
end
|
@@ -151,7 +151,7 @@ module Primer
|
|
151
151
|
# @param list_id text
|
152
152
|
# @param input_name text
|
153
153
|
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, width: :auto, disabled: false, invalid: false, input_id: "input-id", list_id: "list-id", input_name: "input-id")
|
154
|
-
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, width: width, disabled: disabled, invalid: invalid, input_name: input_name)) do |component|
|
154
|
+
render(Primer::Beta::AutoComplete.new(label_text: label_text, input_id: input_id, list_id: list_id, src: UrlHelpers.primer_view_components.autocomplete_index_path, show_clear_button: show_clear_button, visually_hide_label: visually_hide_label, placeholder: placeholder, size: size, full_width: full_width, width: width, disabled: disabled, invalid: invalid, input_name: input_name)) do |component|
|
155
155
|
component.with_leading_visual_icon(icon: :search)
|
156
156
|
end
|
157
157
|
end
|
@@ -172,7 +172,7 @@ module Primer
|
|
172
172
|
# @param input_name text
|
173
173
|
# @snapshot
|
174
174
|
def small(label_text: "Select a fruit", show_clear_button: false, visually_hide_label: false, placeholder: "Placeholder text", size: :small, full_width: false, width: :auto, disabled: false, invalid: false, input_id: "input-id-1", list_id: "list-id-1", input_name: "input-id-1")
|
175
|
-
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, width: width, disabled: disabled, invalid: invalid, input_name: input_name)) do |component|
|
175
|
+
render(Primer::Beta::AutoComplete.new(label_text: label_text, input_id: input_id, list_id: list_id, src: UrlHelpers.primer_view_components.autocomplete_index_path, show_clear_button: show_clear_button, visually_hide_label: visually_hide_label, placeholder: placeholder, size: size, full_width: full_width, width: width, disabled: disabled, invalid: invalid, input_name: input_name)) do |component|
|
176
176
|
component.with_leading_visual_icon(icon: :search)
|
177
177
|
end
|
178
178
|
end
|
@@ -191,7 +191,7 @@ module Primer
|
|
191
191
|
# @param input_name text
|
192
192
|
# @snapshot
|
193
193
|
def medium(label_text: "Select a fruit", show_clear_button: false, visually_hide_label: false, placeholder: "Placeholder text", size: :medium, full_width: false, width: :auto, disabled: false, invalid: false, input_id: "input-id-2", list_id: "list-id-2", input_name: "input-id-2")
|
194
|
-
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, width: width, disabled: disabled, invalid: invalid, input_name: input_name)) do |component|
|
194
|
+
render(Primer::Beta::AutoComplete.new(label_text: label_text, input_id: input_id, list_id: list_id, src: UrlHelpers.primer_view_components.autocomplete_index_path, show_clear_button: show_clear_button, visually_hide_label: visually_hide_label, placeholder: placeholder, size: size, full_width: full_width, width: width, disabled: disabled, invalid: invalid, input_name: input_name)) do |component|
|
195
195
|
component.with_leading_visual_icon(icon: :search)
|
196
196
|
end
|
197
197
|
end
|
@@ -210,7 +210,7 @@ module Primer
|
|
210
210
|
# @param input_name text
|
211
211
|
# @snapshot
|
212
212
|
def large(label_text: "Select a fruit", show_clear_button: false, visually_hide_label: false, placeholder: "Placeholder text", size: :large, full_width: false, width: :auto, disabled: false, invalid: false, input_id: "input-id-3", list_id: "list-id-3", input_name: "input-id-3")
|
213
|
-
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, width: width, disabled: disabled, invalid: invalid, input_name: input_name)) do |component|
|
213
|
+
render(Primer::Beta::AutoComplete.new(label_text: label_text, input_id: input_id, list_id: list_id, src: UrlHelpers.primer_view_components.autocomplete_index_path, show_clear_button: show_clear_button, visually_hide_label: visually_hide_label, placeholder: placeholder, size: size, full_width: full_width, width: width, disabled: disabled, invalid: invalid, input_name: input_name)) do |component|
|
214
214
|
component.with_leading_visual_icon(icon: :search)
|
215
215
|
end
|
216
216
|
end
|
@@ -231,7 +231,7 @@ module Primer
|
|
231
231
|
# @param list_id text
|
232
232
|
# @param input_name text
|
233
233
|
def leading_visual_in_results(label_text: "Select a fruit", show_clear_button: false, visually_hide_label: false, placeholder: "Placeholder text", size: :medium, full_width: false, width: :auto, disabled: false, invalid: false, input_id: "input-id", list_id: "list-id", input_name: "input-id")
|
234
|
-
render(Primer::Beta::AutoComplete.new(label_text: label_text, input_id: input_id, list_id: list_id, src: UrlHelpers.autocomplete_index_path(visual: "leading"), show_clear_button: show_clear_button, visually_hide_label: visually_hide_label, placeholder: placeholder, size: size, full_width: full_width, width: width, disabled: disabled, invalid: invalid, input_name: input_name))
|
234
|
+
render(Primer::Beta::AutoComplete.new(label_text: label_text, input_id: input_id, list_id: list_id, src: UrlHelpers.primer_view_components.autocomplete_index_path(visual: "leading"), show_clear_button: show_clear_button, visually_hide_label: visually_hide_label, placeholder: placeholder, size: size, full_width: full_width, width: width, disabled: disabled, invalid: invalid, input_name: input_name))
|
235
235
|
end
|
236
236
|
|
237
237
|
# @label Trailing visual in results
|
@@ -248,44 +248,44 @@ module Primer
|
|
248
248
|
# @param list_id text
|
249
249
|
# @param input_name text
|
250
250
|
def trailing_visual_in_results(label_text: "Select a fruit", show_clear_button: false, visually_hide_label: false, placeholder: "Placeholder text", size: :medium, full_width: false, width: :auto, disabled: false, invalid: false, input_id: "input-id", list_id: "list-id", input_name: "input-id")
|
251
|
-
render(Primer::Beta::AutoComplete.new(label_text: label_text, input_id: input_id, list_id: list_id, src: UrlHelpers.autocomplete_index_path(visual: "trailing"), show_clear_button: show_clear_button, visually_hide_label: visually_hide_label, placeholder: placeholder, size: size, full_width: full_width, width: width, disabled: disabled, invalid: invalid, input_name: input_name))
|
251
|
+
render(Primer::Beta::AutoComplete.new(label_text: label_text, input_id: input_id, list_id: list_id, src: UrlHelpers.primer_view_components.autocomplete_index_path(visual: "trailing"), show_clear_button: show_clear_button, visually_hide_label: visually_hide_label, placeholder: placeholder, size: size, full_width: full_width, width: width, disabled: disabled, invalid: invalid, input_name: input_name))
|
252
252
|
end
|
253
253
|
|
254
254
|
# @hidden
|
255
255
|
def with_non_visible_label
|
256
|
-
render(Primer::Beta::AutoComplete.new(label_text: "Select a fruit", input_id: "input-id", list_id: "test-id", src: UrlHelpers.autocomplete_index_path, visually_hide_label: true))
|
256
|
+
render(Primer::Beta::AutoComplete.new(label_text: "Select a fruit", input_id: "input-id", list_id: "test-id", src: UrlHelpers.primer_view_components.autocomplete_index_path, visually_hide_label: true))
|
257
257
|
end
|
258
258
|
|
259
259
|
# @hidden
|
260
260
|
def with_icon
|
261
|
-
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|
|
261
|
+
render(Primer::Beta::AutoComplete.new(label_text: "Select a fruit", input_id: "input-id", list_id: "test-id", src: UrlHelpers.primer_view_components.autocomplete_index_path)) do |component|
|
262
262
|
component.with_leading_visual_icon(icon: :search)
|
263
263
|
end
|
264
264
|
end
|
265
265
|
|
266
266
|
# @hidden
|
267
267
|
def show_clear_button
|
268
|
-
render(Primer::Beta::AutoComplete.new(label_text: "Select a fruit", input_id: "input-id", list_id: "test-id", src: UrlHelpers.autocomplete_index_path, show_clear_button: true))
|
268
|
+
render(Primer::Beta::AutoComplete.new(label_text: "Select a fruit", input_id: "input-id", list_id: "test-id", src: UrlHelpers.primer_view_components.autocomplete_index_path, show_clear_button: true))
|
269
269
|
end
|
270
270
|
|
271
271
|
# @hidden
|
272
272
|
def size_small
|
273
|
-
render(Primer::Beta::AutoComplete.new(label_text: "Select a fruit", input_id: "input-id", list_id: "test-id", src: UrlHelpers.autocomplete_index_path, show_clear_button: false, size: :small))
|
273
|
+
render(Primer::Beta::AutoComplete.new(label_text: "Select a fruit", input_id: "input-id", list_id: "test-id", src: UrlHelpers.primer_view_components.autocomplete_index_path, show_clear_button: false, size: :small))
|
274
274
|
end
|
275
275
|
|
276
276
|
# @hidden
|
277
277
|
def monospace
|
278
|
-
render(Primer::Beta::AutoComplete.new(label_text: "Select a fruit", input_id: "input-id", list_id: "test-id", src: UrlHelpers.autocomplete_index_path, show_clear_button: false, monospace: true))
|
278
|
+
render(Primer::Beta::AutoComplete.new(label_text: "Select a fruit", input_id: "input-id", list_id: "test-id", src: UrlHelpers.primer_view_components.autocomplete_index_path, show_clear_button: false, monospace: true))
|
279
279
|
end
|
280
280
|
|
281
281
|
# @hidden
|
282
282
|
def inset
|
283
|
-
render(Primer::Beta::AutoComplete.new(label_text: "Select a fruit", input_id: "input-id", list_id: "test-id", src: UrlHelpers.autocomplete_index_path, show_clear_button: false, inset: true))
|
283
|
+
render(Primer::Beta::AutoComplete.new(label_text: "Select a fruit", input_id: "input-id", list_id: "test-id", src: UrlHelpers.primer_view_components.autocomplete_index_path, show_clear_button: false, inset: true))
|
284
284
|
end
|
285
285
|
|
286
286
|
|
287
287
|
def no_results
|
288
|
-
render(Primer::Beta::AutoComplete.new(label_text: "Select a fruit", show_clear_button: false, visually_hide_label: false, placeholder: "Placeholder text", size: :medium, full_width: false, width: :auto, disabled: false, invalid: false, input_id: "input-id", list_id: "list-id", input_name: "input-id", inset: false, monospace: false, src: UrlHelpers.autocomplete_no_results_path))
|
288
|
+
render(Primer::Beta::AutoComplete.new(label_text: "Select a fruit", show_clear_button: false, visually_hide_label: false, placeholder: "Placeholder text", size: :medium, full_width: false, width: :auto, disabled: false, invalid: false, input_id: "input-id", list_id: "list-id", input_name: "input-id", inset: false, monospace: false, src: UrlHelpers.primer_view_components.autocomplete_no_results_path))
|
289
289
|
end
|
290
290
|
|
291
291
|
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<% texts = [
|
2
|
+
"Home",
|
3
|
+
"This is a very long breadcrumb item that would normally cause overflow issues by being much longer than expected breadcrumb text should be",
|
4
|
+
"And another extremely long breadcrumb item name that demonstrates the max-width fix working correctly to prevent page overflow"
|
5
|
+
] %>
|
6
|
+
|
7
|
+
<%= render(Primer::Beta::Breadcrumbs.new) do |breadcrumbs| %>
|
8
|
+
<% texts.each_with_index do |text, i| %>
|
9
|
+
<% breadcrumbs.with_item(href: "##{i}") do %>
|
10
|
+
<%= text %>
|
11
|
+
<% end %>
|
12
|
+
<% end %>
|
13
|
+
<% end %>
|
@@ -70,6 +70,22 @@ module Primer
|
|
70
70
|
component.with_body { "Body" }
|
71
71
|
end
|
72
72
|
end
|
73
|
+
|
74
|
+
# @label With aria labels
|
75
|
+
#
|
76
|
+
# @param overlay [Symbol] select [none, default, dark]
|
77
|
+
# @param reset [Boolean] toggle
|
78
|
+
# @param disabled [Boolean] toggle
|
79
|
+
def with_aria_labels(reset: false, overlay: :default, disabled: false)
|
80
|
+
render Primer::Beta::Details.new(reset: reset, overlay: overlay, disabled: disabled) do |component|
|
81
|
+
component.with_summary(aria_label_closed: "Expand details", aria_label_open: "Collapse details") do
|
82
|
+
"Summary with aria labels"
|
83
|
+
end
|
84
|
+
component.with_body do
|
85
|
+
"Body"
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
73
89
|
end
|
74
90
|
end
|
75
91
|
end
|
@@ -110,7 +110,7 @@ module Primer
|
|
110
110
|
group.with_heading(title: "My favorite foods")
|
111
111
|
group.with_item(label: "Popplers", href: "/foods/popplers")
|
112
112
|
group.with_item(label: "Slurm", href: "/foods/slurm")
|
113
|
-
group.with_show_more_item(label: "Show more foods", src: UrlHelpers.nav_list_items_path, pages: 2) do |item|
|
113
|
+
group.with_show_more_item(label: "Show more foods", src: UrlHelpers.primer_view_components.nav_list_items_path, pages: 2) do |item|
|
114
114
|
item.with_trailing_visual_icon(icon: :plus)
|
115
115
|
end
|
116
116
|
end
|
@@ -119,7 +119,7 @@ module Primer
|
|
119
119
|
group.with_heading(title: "My favorite snacks")
|
120
120
|
group.with_item(label: "Popplers", href: "/foods/popplers")
|
121
121
|
group.with_item(label: "Slurm", href: "/foods/slurm")
|
122
|
-
group.with_show_more_item(label: "Show more snacks", src: UrlHelpers.nav_list_items_path, pages: 4) do |item|
|
122
|
+
group.with_show_more_item(label: "Show more snacks", src: UrlHelpers.primer_view_components.nav_list_items_path, pages: 4) do |item|
|
123
123
|
item.with_trailing_visual_icon(icon: :plus)
|
124
124
|
end
|
125
125
|
end
|
@@ -1,3 +1,3 @@
|
|
1
|
-
<%= render(ExampleToggleSwitchForm.new(label: "Good example", src: toggle_switch_index_path, id: "success-toggle")) %>
|
1
|
+
<%= render(ExampleToggleSwitchForm.new(label: "Good example", src: primer_view_components.toggle_switch_index_path, id: "success-toggle")) %>
|
2
2
|
<hr>
|
3
|
-
<%= render(ExampleToggleSwitchForm.new(label: "Bad example", src: toggle_switch_index_path(fail: true), id: "error-toggle")) %>
|
3
|
+
<%= render(ExampleToggleSwitchForm.new(label: "Bad example", src: primer_view_components.toggle_switch_index_path(fail: true), id: "error-toggle")) %>
|
data/static/arguments.json
CHANGED
@@ -34,9 +34,7 @@
|
|
34
34
|
"short_name": "ActionBarDivider",
|
35
35
|
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/action_bar/divider.rb",
|
36
36
|
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/action_bar/divider/default/",
|
37
|
-
"parameters": [
|
38
|
-
|
39
|
-
]
|
37
|
+
"parameters": []
|
40
38
|
},
|
41
39
|
{
|
42
40
|
"component": "ActionBar::Item",
|
@@ -153,9 +151,7 @@
|
|
153
151
|
"short_name": "ActionListFormWrapper",
|
154
152
|
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/action_list/form_wrapper.rb",
|
155
153
|
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/action_list/form_wrapper/default/",
|
156
|
-
"parameters": [
|
157
|
-
|
158
|
-
]
|
154
|
+
"parameters": []
|
159
155
|
},
|
160
156
|
{
|
161
157
|
"component": "ActionList::Heading",
|
@@ -474,9 +470,7 @@
|
|
474
470
|
"short_name": "ActionMenuHeading",
|
475
471
|
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/action_menu/heading.rb",
|
476
472
|
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/action_menu/heading/default/",
|
477
|
-
"parameters": [
|
478
|
-
|
479
|
-
]
|
473
|
+
"parameters": []
|
480
474
|
},
|
481
475
|
{
|
482
476
|
"component": "ActionMenu::List",
|
@@ -674,7 +668,7 @@
|
|
674
668
|
"name": "scheme",
|
675
669
|
"type": "Symbol",
|
676
670
|
"default": "`:default`",
|
677
|
-
"description": "One of `:danger`, `:default`, `:success`, or `:warning`."
|
671
|
+
"description": "One of `:danger`, `:default`, `:success`, `:upsell`, or `:warning`."
|
678
672
|
},
|
679
673
|
{
|
680
674
|
"name": "system_arguments",
|
@@ -1070,6 +1064,12 @@
|
|
1070
1064
|
"default": "`:medium`",
|
1071
1065
|
"description": "One of `:large` or `:medium`."
|
1072
1066
|
},
|
1067
|
+
{
|
1068
|
+
"name": "close_label",
|
1069
|
+
"type": "String",
|
1070
|
+
"default": "`Close`",
|
1071
|
+
"description": "The aria-label text of the close \"x\" button."
|
1072
|
+
},
|
1073
1073
|
{
|
1074
1074
|
"name": "system_arguments",
|
1075
1075
|
"type": "Hash",
|
@@ -1147,9 +1147,7 @@
|
|
1147
1147
|
"short_name": "DropdownMenuItem",
|
1148
1148
|
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/dropdown/menu/item.rb",
|
1149
1149
|
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/dropdown/menu/item/default/",
|
1150
|
-
"parameters": [
|
1151
|
-
|
1152
|
-
]
|
1150
|
+
"parameters": []
|
1153
1151
|
},
|
1154
1152
|
{
|
1155
1153
|
"component": "FormButton",
|
@@ -1357,6 +1355,40 @@
|
|
1357
1355
|
}
|
1358
1356
|
]
|
1359
1357
|
},
|
1358
|
+
{
|
1359
|
+
"component": "IncludeFragment",
|
1360
|
+
"status": "alpha",
|
1361
|
+
"a11y_reviewed": false,
|
1362
|
+
"short_name": "IncludeFragment",
|
1363
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/include_fragment.rb",
|
1364
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/include_fragment/default/",
|
1365
|
+
"parameters": [
|
1366
|
+
{
|
1367
|
+
"name": "src",
|
1368
|
+
"type": "String",
|
1369
|
+
"default": "`nil`",
|
1370
|
+
"description": "The URL from which to retrieve an HTML element fragment."
|
1371
|
+
},
|
1372
|
+
{
|
1373
|
+
"name": "loading",
|
1374
|
+
"type": "Symbol",
|
1375
|
+
"default": "`nil`",
|
1376
|
+
"description": "One of `:eager` or `:lazy`."
|
1377
|
+
},
|
1378
|
+
{
|
1379
|
+
"name": "accept",
|
1380
|
+
"type": "String",
|
1381
|
+
"default": "`nil`",
|
1382
|
+
"description": "What to send as the Accept header."
|
1383
|
+
},
|
1384
|
+
{
|
1385
|
+
"name": "system_arguments",
|
1386
|
+
"type": "Hash",
|
1387
|
+
"default": "N/A",
|
1388
|
+
"description": "[System arguments](/system-arguments)"
|
1389
|
+
}
|
1390
|
+
]
|
1391
|
+
},
|
1360
1392
|
{
|
1361
1393
|
"component": "Layout",
|
1362
1394
|
"status": "alpha",
|
@@ -1420,9 +1452,7 @@
|
|
1420
1452
|
"short_name": "LayoutSidebar",
|
1421
1453
|
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/layout/sidebar.rb",
|
1422
1454
|
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/layout/sidebar/default/",
|
1423
|
-
"parameters": [
|
1424
|
-
|
1425
|
-
]
|
1455
|
+
"parameters": []
|
1426
1456
|
},
|
1427
1457
|
{
|
1428
1458
|
"component": "Menu",
|
@@ -2426,7 +2456,13 @@
|
|
2426
2456
|
"name": "form_arguments",
|
2427
2457
|
"type": "Hash",
|
2428
2458
|
"default": "`{}`",
|
2429
|
-
"description": "Form arguments
|
2459
|
+
"description": "Form arguments. Supported for `local`, and experimentally supported for `remote` and `eventually_local` strategies by enabling the `use_experimental_non_local_form` flag."
|
2460
|
+
},
|
2461
|
+
{
|
2462
|
+
"name": "use_experimental_non_local_form",
|
2463
|
+
"type": "Boolean",
|
2464
|
+
"default": "`false`",
|
2465
|
+
"description": "A feature flag used to slowly roll out moving the input field (generated from form arguments) to the top of the SelectPanel HTML thus allowing remote fetching to have default form values. At this time, support is only available for the :single select variant. See: https://github.com/github/primer/issues/4923."
|
2430
2466
|
},
|
2431
2467
|
{
|
2432
2468
|
"name": "show_filter",
|
@@ -3221,9 +3257,7 @@
|
|
3221
3257
|
"short_name": "Base",
|
3222
3258
|
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/base_component.rb",
|
3223
3259
|
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/base/default/",
|
3224
|
-
"parameters": [
|
3225
|
-
|
3226
|
-
]
|
3260
|
+
"parameters": []
|
3227
3261
|
},
|
3228
3262
|
{
|
3229
3263
|
"component": "AutoComplete",
|
@@ -3384,9 +3418,7 @@
|
|
3384
3418
|
"short_name": "AutoCompleteNoResultItem",
|
3385
3419
|
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/beta/auto_complete/no_result_item.rb",
|
3386
3420
|
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/beta/auto_complete/no_result_item/default/",
|
3387
|
-
"parameters": [
|
3388
|
-
|
3389
|
-
]
|
3421
|
+
"parameters": []
|
3390
3422
|
},
|
3391
3423
|
{
|
3392
3424
|
"component": "Avatar",
|
@@ -3615,9 +3647,7 @@
|
|
3615
3647
|
"short_name": "BreadcrumbsItem",
|
3616
3648
|
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/beta/breadcrumbs/item.rb",
|
3617
3649
|
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/beta/breadcrumbs/item/default/",
|
3618
|
-
"parameters": [
|
3619
|
-
|
3620
|
-
]
|
3650
|
+
"parameters": []
|
3621
3651
|
},
|
3622
3652
|
{
|
3623
3653
|
"component": "Button",
|
@@ -4696,9 +4726,7 @@
|
|
4696
4726
|
"short_name": "TimelineItemBadge",
|
4697
4727
|
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/beta/timeline_item/badge.rb",
|
4698
4728
|
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/beta/timeline_item/badge/default/",
|
4699
|
-
"parameters": [
|
4700
|
-
|
4701
|
-
]
|
4729
|
+
"parameters": []
|
4702
4730
|
},
|
4703
4731
|
{
|
4704
4732
|
"component": "Truncate",
|
@@ -4723,9 +4751,7 @@
|
|
4723
4751
|
"short_name": "TruncateTruncateText",
|
4724
4752
|
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/beta/truncate/truncate_text.rb",
|
4725
4753
|
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/beta/truncate/truncate_text/default/",
|
4726
|
-
"parameters": [
|
4727
|
-
|
4728
|
-
]
|
4754
|
+
"parameters": []
|
4729
4755
|
},
|
4730
4756
|
{
|
4731
4757
|
"component": "Blankslate",
|
@@ -4925,13 +4951,19 @@
|
|
4925
4951
|
"name": "condition",
|
4926
4952
|
"type": "Boolean",
|
4927
4953
|
"default": "N/A",
|
4928
|
-
"description": "Whether or not to wrap the content in a
|
4954
|
+
"description": "Whether or not to wrap the content in a component."
|
4955
|
+
},
|
4956
|
+
{
|
4957
|
+
"name": "component",
|
4958
|
+
"type": "Class",
|
4959
|
+
"default": "`Primer::BaseComponent`",
|
4960
|
+
"description": "The component class to use as a wrapper, defaults to `Primer::BaseComponent`"
|
4929
4961
|
},
|
4930
4962
|
{
|
4931
4963
|
"name": "base_component_arguments",
|
4932
4964
|
"type": "Hash",
|
4933
4965
|
"default": "N/A",
|
4934
|
-
"description": "The arguments to pass to
|
4966
|
+
"description": "The arguments to pass to the component."
|
4935
4967
|
}
|
4936
4968
|
]
|
4937
4969
|
},
|
@@ -4942,9 +4974,7 @@
|
|
4942
4974
|
"short_name": "Content",
|
4943
4975
|
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/content.rb",
|
4944
4976
|
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/content/default/",
|
4945
|
-
"parameters": [
|
4946
|
-
|
4947
|
-
]
|
4977
|
+
"parameters": []
|
4948
4978
|
},
|
4949
4979
|
{
|
4950
4980
|
"component": "IconButton",
|
data/static/audited_at.json
CHANGED
@@ -30,6 +30,7 @@
|
|
30
30
|
"Primer::Alpha::HellipButton": "",
|
31
31
|
"Primer::Alpha::HiddenTextExpander": "",
|
32
32
|
"Primer::Alpha::Image": "",
|
33
|
+
"Primer::Alpha::IncludeFragment": "",
|
33
34
|
"Primer::Alpha::Layout": "",
|
34
35
|
"Primer::Alpha::Layout::Main": "",
|
35
36
|
"Primer::Alpha::Layout::Sidebar": "",
|
data/static/constants.json
CHANGED
@@ -197,7 +197,8 @@
|
|
197
197
|
"default": "bell",
|
198
198
|
"warning": "alert",
|
199
199
|
"danger": "stop",
|
200
|
-
"success": "check-circle"
|
200
|
+
"success": "check-circle",
|
201
|
+
"upsell": "info"
|
201
202
|
},
|
202
203
|
"DEFAULT_SCHEME": "default",
|
203
204
|
"DEFAULT_TAG": "div",
|
@@ -217,7 +218,8 @@
|
|
217
218
|
"default": "",
|
218
219
|
"warning": "Banner--warning",
|
219
220
|
"danger": "Banner--error",
|
220
|
-
"success": "Banner--success"
|
221
|
+
"success": "Banner--success",
|
222
|
+
"upsell": "Banner--upsell"
|
221
223
|
},
|
222
224
|
"TAG_OPTIONS": [
|
223
225
|
"div",
|
@@ -321,6 +323,7 @@
|
|
321
323
|
"GeneratedSlotMethods": "Primer::Alpha::Dialog::Footer::GeneratedSlotMethods"
|
322
324
|
},
|
323
325
|
"Primer::Alpha::Dialog::Header": {
|
326
|
+
"DEFAULT_CLOSE_LABEL": "Close",
|
324
327
|
"DEFAULT_VARIANT": "medium",
|
325
328
|
"GeneratedSlotMethods": "Primer::Alpha::Dialog::Header::GeneratedSlotMethods",
|
326
329
|
"VARIANT_MAPPINGS": {
|
@@ -389,6 +392,14 @@
|
|
389
392
|
"Primer::Alpha::Image": {
|
390
393
|
"GeneratedSlotMethods": "Primer::Alpha::Image::GeneratedSlotMethods"
|
391
394
|
},
|
395
|
+
"Primer::Alpha::IncludeFragment": {
|
396
|
+
"ALLOWED_LOADING_VALUES": [
|
397
|
+
"lazy",
|
398
|
+
"eager"
|
399
|
+
],
|
400
|
+
"DEFAULT_LOADING": "eager",
|
401
|
+
"GeneratedSlotMethods": "Primer::Alpha::IncludeFragment::GeneratedSlotMethods"
|
402
|
+
},
|
392
403
|
"Primer::Alpha::Layout": {
|
393
404
|
"FIRST_IN_SOURCE_DEFAULT": "sidebar",
|
394
405
|
"FIRST_IN_SOURCE_OPTIONS": [
|