primer_view_components 0.0.83 → 0.0.86
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +50 -0
- data/app/assets/javascripts/primer_view_components.js +1 -1
- data/app/assets/javascripts/primer_view_components.js.map +1 -1
- data/app/components/primer/alpha/auto_complete/auto_complete.html.erb +24 -0
- data/app/components/primer/alpha/auto_complete/item.rb +46 -0
- data/app/components/primer/alpha/auto_complete.rb +158 -0
- data/app/components/primer/alpha/button_marketing.rb +1 -1
- data/app/components/primer/alpha/text_field.rb +105 -0
- data/app/components/primer/alpha/tool-tip-element.d.ts +3 -1
- data/app/components/primer/alpha/tool-tip-element.js +20 -13
- data/app/components/primer/alpha/tool-tip-element.ts +23 -14
- data/app/components/primer/alpha/tooltip.rb +1 -1
- data/app/components/primer/beta/auto_complete/auto_complete.html.erb +21 -17
- data/app/components/primer/beta/auto_complete/item.html.erb +21 -0
- data/app/components/primer/beta/auto_complete/item.rb +42 -6
- data/app/components/primer/beta/auto_complete.rb +93 -55
- data/app/components/primer/beta/base_button.rb +47 -0
- data/app/components/primer/{alpha → beta}/border_box/header.html.erb +0 -0
- data/app/components/primer/{alpha → beta}/border_box/header.rb +6 -6
- data/app/components/primer/{border_box_component.html.erb → beta/border_box.html.erb} +0 -0
- data/app/components/primer/beta/border_box.rb +147 -0
- data/app/components/primer/blankslate_component.rb +2 -150
- data/app/components/primer/border_box_component.rb +2 -140
- data/app/components/primer/button_component.html.erb +12 -4
- data/app/components/primer/button_component.rb +2 -2
- data/app/components/primer/clipboard_copy.rb +6 -2
- data/app/components/primer/close_button.rb +1 -1
- data/app/components/primer/conditional_wrapper.rb +36 -0
- data/app/components/primer/hellip_button.rb +1 -1
- data/app/components/primer/icon_button.html.erb +6 -0
- data/app/components/primer/icon_button.rb +46 -10
- data/app/components/primer/link_component.html.erb +12 -0
- data/app/components/primer/link_component.rb +2 -9
- data/app/lib/primer/join_style_arguments_helper.rb +1 -1
- data/lib/primer/classify/utilities.rb +3 -6
- data/lib/primer/form_components.rb +36 -0
- data/lib/primer/forms/acts_as_component.rb +118 -0
- data/lib/primer/forms/base.html.erb +8 -0
- data/lib/primer/forms/base.rb +137 -0
- data/lib/primer/forms/base_component.rb +58 -0
- data/lib/primer/forms/buffer_rewriter.rb +50 -0
- data/lib/primer/forms/caption.html.erb +10 -0
- data/lib/primer/forms/caption.rb +29 -0
- data/lib/primer/forms/check_box.html.erb +9 -0
- data/lib/primer/forms/check_box.rb +16 -0
- data/lib/primer/forms/check_box_group.html.erb +12 -0
- data/lib/primer/forms/check_box_group.rb +14 -0
- data/lib/primer/forms/dsl/check_box_group_input.rb +41 -0
- data/lib/primer/forms/dsl/check_box_input.rb +27 -0
- data/lib/primer/forms/dsl/form_object.rb +25 -0
- data/lib/primer/forms/dsl/form_reference_input.rb +36 -0
- data/lib/primer/forms/dsl/hidden_input.rb +29 -0
- data/lib/primer/forms/dsl/input.rb +259 -0
- data/lib/primer/forms/dsl/input_group.rb +41 -0
- data/lib/primer/forms/dsl/input_methods.rb +86 -0
- data/lib/primer/forms/dsl/multi_input.rb +58 -0
- data/lib/primer/forms/dsl/radio_button_group_input.rb +38 -0
- data/lib/primer/forms/dsl/radio_button_input.rb +37 -0
- data/lib/primer/forms/dsl/select_list_input.rb +53 -0
- data/lib/primer/forms/dsl/submit_button_input.rb +28 -0
- data/lib/primer/forms/dsl/text_area_input.rb +33 -0
- data/lib/primer/forms/dsl/text_field_input.rb +65 -0
- data/lib/primer/forms/form_control.html.erb +18 -0
- data/lib/primer/forms/form_control.rb +23 -0
- data/lib/primer/forms/form_list.html.erb +5 -0
- data/lib/primer/forms/form_list.rb +21 -0
- data/lib/primer/forms/form_reference.html.erb +3 -0
- data/lib/primer/forms/form_reference.rb +14 -0
- data/lib/primer/forms/group.html.erb +5 -0
- data/lib/primer/forms/group.rb +27 -0
- data/lib/primer/forms/hidden_field.html.erb +1 -0
- data/lib/primer/forms/hidden_field.rb +15 -0
- data/lib/primer/forms/multi.html.erb +3 -0
- data/lib/primer/forms/multi.rb +14 -0
- data/lib/primer/forms/radio_button.html.erb +14 -0
- data/lib/primer/forms/radio_button.rb +29 -0
- data/lib/primer/forms/radio_button_group.html.erb +12 -0
- data/lib/primer/forms/radio_button_group.rb +14 -0
- data/lib/primer/forms/select_list.html.erb +5 -0
- data/lib/primer/forms/select_list.rb +26 -0
- data/lib/primer/forms/separator.html.erb +1 -0
- data/lib/primer/forms/separator.rb +8 -0
- data/lib/primer/forms/spacing_wrapper.html.erb +3 -0
- data/lib/primer/forms/spacing_wrapper.rb +8 -0
- data/lib/primer/forms/submit_button.html.erb +4 -0
- data/lib/primer/forms/submit_button.rb +50 -0
- data/lib/primer/forms/text_area.html.erb +5 -0
- data/lib/primer/forms/text_area.rb +16 -0
- data/lib/primer/forms/text_field.html.erb +19 -0
- data/lib/primer/forms/text_field.rb +14 -0
- data/lib/primer/view_components/engine.rb +23 -0
- data/lib/primer/view_components/linters/argument_mappers/button.rb +2 -2
- data/lib/primer/view_components/linters/button_component_migration_counter.rb +1 -1
- data/lib/primer/view_components/linters/helpers/deprecated_components_helpers.rb +4 -8
- data/lib/primer/view_components/version.rb +1 -1
- data/lib/rubocop/cop/primer/component_name_migration.rb +3 -0
- data/lib/tasks/deprecated.rake +22 -0
- data/lib/tasks/docs.rake +8 -6
- data/static/arguments.yml +188 -52
- data/static/audited_at.json +7 -2
- data/static/classes.yml +25 -8
- data/static/constants.json +66 -39
- data/static/statuses.json +8 -3
- metadata +71 -7
- data/app/components/primer/base_button.rb +0 -43
- data/app/components/primer/blankslate_component.html.erb +0 -30
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: primer_view_components
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.86
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GitHub Open Source
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-08-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionview
|
@@ -406,8 +406,9 @@ files:
|
|
406
406
|
- README.md
|
407
407
|
- app/assets/javascripts/primer_view_components.js
|
408
408
|
- app/assets/javascripts/primer_view_components.js.map
|
409
|
-
- app/components/primer/alpha/
|
410
|
-
- app/components/primer/alpha/
|
409
|
+
- app/components/primer/alpha/auto_complete.rb
|
410
|
+
- app/components/primer/alpha/auto_complete/auto_complete.html.erb
|
411
|
+
- app/components/primer/alpha/auto_complete/item.rb
|
411
412
|
- app/components/primer/alpha/button_marketing.rb
|
412
413
|
- app/components/primer/alpha/layout.html.erb
|
413
414
|
- app/components/primer/alpha/layout.rb
|
@@ -415,6 +416,7 @@ files:
|
|
415
416
|
- app/components/primer/alpha/tab_nav.rb
|
416
417
|
- app/components/primer/alpha/tab_panels.html.erb
|
417
418
|
- app/components/primer/alpha/tab_panels.rb
|
419
|
+
- app/components/primer/alpha/text_field.rb
|
418
420
|
- app/components/primer/alpha/tool-tip-element.d.ts
|
419
421
|
- app/components/primer/alpha/tool-tip-element.js
|
420
422
|
- app/components/primer/alpha/tool-tip-element.ts
|
@@ -423,19 +425,24 @@ files:
|
|
423
425
|
- app/components/primer/alpha/underline_nav.rb
|
424
426
|
- app/components/primer/alpha/underline_panels.html.erb
|
425
427
|
- app/components/primer/alpha/underline_panels.rb
|
426
|
-
- app/components/primer/base_button.rb
|
427
428
|
- app/components/primer/base_component.rb
|
428
429
|
- app/components/primer/beta/auto_complete.rb
|
429
430
|
- app/components/primer/beta/auto_complete/auto_complete.d.ts
|
430
431
|
- app/components/primer/beta/auto_complete/auto_complete.html.erb
|
431
432
|
- app/components/primer/beta/auto_complete/auto_complete.js
|
432
433
|
- app/components/primer/beta/auto_complete/auto_complete.ts
|
434
|
+
- app/components/primer/beta/auto_complete/item.html.erb
|
433
435
|
- app/components/primer/beta/auto_complete/item.rb
|
434
436
|
- app/components/primer/beta/avatar.rb
|
435
437
|
- app/components/primer/beta/avatar_stack.html.erb
|
436
438
|
- app/components/primer/beta/avatar_stack.rb
|
439
|
+
- app/components/primer/beta/base_button.rb
|
437
440
|
- app/components/primer/beta/blankslate.html.erb
|
438
441
|
- app/components/primer/beta/blankslate.rb
|
442
|
+
- app/components/primer/beta/border_box.html.erb
|
443
|
+
- app/components/primer/beta/border_box.rb
|
444
|
+
- app/components/primer/beta/border_box/header.html.erb
|
445
|
+
- app/components/primer/beta/border_box/header.rb
|
439
446
|
- app/components/primer/beta/breadcrumbs.html.erb
|
440
447
|
- app/components/primer/beta/breadcrumbs.rb
|
441
448
|
- app/components/primer/beta/flash.html.erb
|
@@ -443,9 +450,7 @@ files:
|
|
443
450
|
- app/components/primer/beta/text.rb
|
444
451
|
- app/components/primer/beta/truncate.html.erb
|
445
452
|
- app/components/primer/beta/truncate.rb
|
446
|
-
- app/components/primer/blankslate_component.html.erb
|
447
453
|
- app/components/primer/blankslate_component.rb
|
448
|
-
- app/components/primer/border_box_component.html.erb
|
449
454
|
- app/components/primer/border_box_component.rb
|
450
455
|
- app/components/primer/box_component.rb
|
451
456
|
- app/components/primer/button_component.html.erb
|
@@ -459,6 +464,7 @@ files:
|
|
459
464
|
- app/components/primer/clipboard_copy_component.ts
|
460
465
|
- app/components/primer/close_button.rb
|
461
466
|
- app/components/primer/component.rb
|
467
|
+
- app/components/primer/conditional_wrapper.rb
|
462
468
|
- app/components/primer/content.rb
|
463
469
|
- app/components/primer/counter_component.rb
|
464
470
|
- app/components/primer/details_component.html.erb
|
@@ -480,6 +486,7 @@ files:
|
|
480
486
|
- app/components/primer/heading_component.rb
|
481
487
|
- app/components/primer/hellip_button.rb
|
482
488
|
- app/components/primer/hidden_text_expander.rb
|
489
|
+
- app/components/primer/icon_button.html.erb
|
483
490
|
- app/components/primer/icon_button.rb
|
484
491
|
- app/components/primer/image.rb
|
485
492
|
- app/components/primer/image_crop.d.ts
|
@@ -490,6 +497,7 @@ files:
|
|
490
497
|
- app/components/primer/label_component.rb
|
491
498
|
- app/components/primer/layout_component.html.erb
|
492
499
|
- app/components/primer/layout_component.rb
|
500
|
+
- app/components/primer/link_component.html.erb
|
493
501
|
- app/components/primer/link_component.rb
|
494
502
|
- app/components/primer/local_time.d.ts
|
495
503
|
- app/components/primer/local_time.js
|
@@ -543,6 +551,61 @@ files:
|
|
543
551
|
- lib/primer/classify/utilities.rb
|
544
552
|
- lib/primer/classify/utilities.yml
|
545
553
|
- lib/primer/classify/validation.rb
|
554
|
+
- lib/primer/form_components.rb
|
555
|
+
- lib/primer/forms/acts_as_component.rb
|
556
|
+
- lib/primer/forms/base.html.erb
|
557
|
+
- lib/primer/forms/base.rb
|
558
|
+
- lib/primer/forms/base_component.rb
|
559
|
+
- lib/primer/forms/buffer_rewriter.rb
|
560
|
+
- lib/primer/forms/caption.html.erb
|
561
|
+
- lib/primer/forms/caption.rb
|
562
|
+
- lib/primer/forms/check_box.html.erb
|
563
|
+
- lib/primer/forms/check_box.rb
|
564
|
+
- lib/primer/forms/check_box_group.html.erb
|
565
|
+
- lib/primer/forms/check_box_group.rb
|
566
|
+
- lib/primer/forms/dsl/check_box_group_input.rb
|
567
|
+
- lib/primer/forms/dsl/check_box_input.rb
|
568
|
+
- lib/primer/forms/dsl/form_object.rb
|
569
|
+
- lib/primer/forms/dsl/form_reference_input.rb
|
570
|
+
- lib/primer/forms/dsl/hidden_input.rb
|
571
|
+
- lib/primer/forms/dsl/input.rb
|
572
|
+
- lib/primer/forms/dsl/input_group.rb
|
573
|
+
- lib/primer/forms/dsl/input_methods.rb
|
574
|
+
- lib/primer/forms/dsl/multi_input.rb
|
575
|
+
- lib/primer/forms/dsl/radio_button_group_input.rb
|
576
|
+
- lib/primer/forms/dsl/radio_button_input.rb
|
577
|
+
- lib/primer/forms/dsl/select_list_input.rb
|
578
|
+
- lib/primer/forms/dsl/submit_button_input.rb
|
579
|
+
- lib/primer/forms/dsl/text_area_input.rb
|
580
|
+
- lib/primer/forms/dsl/text_field_input.rb
|
581
|
+
- lib/primer/forms/form_control.html.erb
|
582
|
+
- lib/primer/forms/form_control.rb
|
583
|
+
- lib/primer/forms/form_list.html.erb
|
584
|
+
- lib/primer/forms/form_list.rb
|
585
|
+
- lib/primer/forms/form_reference.html.erb
|
586
|
+
- lib/primer/forms/form_reference.rb
|
587
|
+
- lib/primer/forms/group.html.erb
|
588
|
+
- lib/primer/forms/group.rb
|
589
|
+
- lib/primer/forms/hidden_field.html.erb
|
590
|
+
- lib/primer/forms/hidden_field.rb
|
591
|
+
- lib/primer/forms/multi.html.erb
|
592
|
+
- lib/primer/forms/multi.rb
|
593
|
+
- lib/primer/forms/radio_button.html.erb
|
594
|
+
- lib/primer/forms/radio_button.rb
|
595
|
+
- lib/primer/forms/radio_button_group.html.erb
|
596
|
+
- lib/primer/forms/radio_button_group.rb
|
597
|
+
- lib/primer/forms/select_list.html.erb
|
598
|
+
- lib/primer/forms/select_list.rb
|
599
|
+
- lib/primer/forms/separator.html.erb
|
600
|
+
- lib/primer/forms/separator.rb
|
601
|
+
- lib/primer/forms/spacing_wrapper.html.erb
|
602
|
+
- lib/primer/forms/spacing_wrapper.rb
|
603
|
+
- lib/primer/forms/submit_button.html.erb
|
604
|
+
- lib/primer/forms/submit_button.rb
|
605
|
+
- lib/primer/forms/text_area.html.erb
|
606
|
+
- lib/primer/forms/text_area.rb
|
607
|
+
- lib/primer/forms/text_field.html.erb
|
608
|
+
- lib/primer/forms/text_field.rb
|
546
609
|
- lib/primer/view_components.rb
|
547
610
|
- lib/primer/view_components/constants.rb
|
548
611
|
- lib/primer/view_components/engine.rb
|
@@ -590,6 +653,7 @@ files:
|
|
590
653
|
- lib/rubocop/cop/primer/system_argument_instead_of_class.rb
|
591
654
|
- lib/tasks/coverage.rake
|
592
655
|
- lib/tasks/custom_utilities.yml
|
656
|
+
- lib/tasks/deprecated.rake
|
593
657
|
- lib/tasks/docs.rake
|
594
658
|
- lib/tasks/helpers/ast_processor.rb
|
595
659
|
- lib/tasks/helpers/ast_traverser.rb
|
@@ -1,43 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Primer
|
4
|
-
# Use `BaseButton` to render an unstyled `<button>` tag that can be customized.
|
5
|
-
class BaseButton < Primer::Component
|
6
|
-
status :beta
|
7
|
-
|
8
|
-
DEFAULT_TAG = :button
|
9
|
-
TAG_OPTIONS = [DEFAULT_TAG, :a, :summary].freeze
|
10
|
-
|
11
|
-
DEFAULT_TYPE = :button
|
12
|
-
TYPE_OPTIONS = [DEFAULT_TYPE, :reset, :submit].freeze
|
13
|
-
|
14
|
-
# @example Block
|
15
|
-
# <%= render(Primer::BaseButton.new(block: :true)) { "Block" } %>
|
16
|
-
# <%= render(Primer::BaseButton.new(block: :true, scheme: :primary)) { "Primary block" } %>
|
17
|
-
#
|
18
|
-
# @param tag [Symbol] <%= one_of(Primer::BaseButton::TAG_OPTIONS) %>
|
19
|
-
# @param type [Symbol] <%= one_of(Primer::BaseButton::TYPE_OPTIONS) %>
|
20
|
-
# @param block [Boolean] Whether button is full-width with `display: block`.
|
21
|
-
# @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
|
22
|
-
def initialize(
|
23
|
-
tag: DEFAULT_TAG,
|
24
|
-
type: DEFAULT_TYPE,
|
25
|
-
block: false,
|
26
|
-
**system_arguments
|
27
|
-
)
|
28
|
-
@system_arguments = system_arguments
|
29
|
-
@system_arguments[:tag] = fetch_or_fallback(TAG_OPTIONS, tag, DEFAULT_TAG)
|
30
|
-
|
31
|
-
@system_arguments[:type] = fetch_or_fallback(TYPE_OPTIONS, type, DEFAULT_TYPE) if @system_arguments[:tag] == :button
|
32
|
-
|
33
|
-
@system_arguments[:classes] = class_names(
|
34
|
-
system_arguments[:classes],
|
35
|
-
"btn-block" => block
|
36
|
-
)
|
37
|
-
end
|
38
|
-
|
39
|
-
def call
|
40
|
-
render(Primer::BaseComponent.new(**@system_arguments)) { content }
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
@@ -1,30 +0,0 @@
|
|
1
|
-
<%# erblint:counter ButtonComponentMigrationCounter 1 %>
|
2
|
-
<%= render Primer::BaseComponent.new(**@system_arguments) do %>
|
3
|
-
<% if spinner.present? %>
|
4
|
-
<%= spinner %>
|
5
|
-
<% elsif @icon.present? %>
|
6
|
-
<%= primer_octicon @icon, size: @icon_size, classes: "blankslate-icon" %>
|
7
|
-
<% elsif @image_src.present? && @image_alt.present? %>
|
8
|
-
<%= image_tag @image_src.to_s, class: "mb-3", size: "56x56", alt: @image_alt.to_s %>
|
9
|
-
<% end %>
|
10
|
-
|
11
|
-
<% if @title.present? %>
|
12
|
-
<%= render Primer::BaseComponent.new(tag: @title_tag, mb: 1) do %><%= @title %><% end %>
|
13
|
-
<% end %>
|
14
|
-
|
15
|
-
<% if @description.present? %>
|
16
|
-
<p><%= @description %></p>
|
17
|
-
<% end %>
|
18
|
-
|
19
|
-
<%= content %>
|
20
|
-
|
21
|
-
<% if @button_text.present? && @button_url.present? %>
|
22
|
-
<a class="btn <%= @button_classes %>" href="<%= @button_url %>"><%= @button_text %></a>
|
23
|
-
<% end %>
|
24
|
-
|
25
|
-
<% if @link_text.present? && @link_url.present? %>
|
26
|
-
<p>
|
27
|
-
<%= link_to @link_url.to_s do %><%= @link_text %><% end %>
|
28
|
-
</p>
|
29
|
-
<% end %>
|
30
|
-
<% end %>
|