primer_view_components 0.0.53 → 0.0.57
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 +87 -0
- data/app/components/primer/alpha/tab_nav.html.erb +11 -0
- data/app/components/primer/alpha/tab_nav.rb +130 -0
- data/app/components/primer/{tab_nav_component.html.erb → alpha/tab_panels.html.erb} +3 -8
- data/app/components/primer/alpha/tab_panels.rb +82 -0
- data/app/components/primer/alpha/underline_nav.html.erb +15 -0
- data/app/components/primer/alpha/underline_nav.rb +137 -0
- data/app/components/primer/{underline_nav_component.html.erb → alpha/underline_panels.html.erb} +3 -8
- data/app/components/primer/alpha/underline_panels.rb +86 -0
- data/app/components/primer/base_component.rb +1 -1
- data/app/components/primer/{breadcrumb_component.html.erb → beta/breadcrumbs.html.erb} +2 -1
- data/app/components/primer/beta/breadcrumbs.rb +61 -0
- data/app/components/primer/navigation/tab_component.rb +7 -5
- data/app/components/primer/octicon_component.rb +6 -1
- data/app/components/primer/tab_container_component.rb +1 -1
- data/app/lib/primer/class_name_helper.rb +14 -13
- data/app/lib/primer/octicon/cache.rb +10 -2
- data/app/lib/primer/tab_nav_helper.rb +35 -0
- data/app/lib/primer/tabbed_component_helper.rb +4 -4
- data/app/lib/primer/underline_nav_helper.rb +44 -0
- data/lib/primer/classify/cache.rb +0 -6
- data/lib/primer/classify/utilities.rb +6 -2
- data/lib/primer/classify/utilities.yml +35 -0
- data/lib/primer/classify/validation.rb +1 -1
- data/lib/primer/classify.rb +0 -5
- data/lib/primer/view_components/engine.rb +1 -1
- data/lib/primer/view_components/linters/argument_mappers/button.rb +4 -1
- data/lib/primer/view_components/linters/flash_component_migration_counter.rb +5 -0
- data/lib/primer/view_components/version.rb +1 -1
- data/lib/rubocop/cop/primer/base_cop.rb +28 -0
- data/lib/rubocop/cop/primer/deprecated_arguments.rb +105 -15
- data/lib/rubocop/cop/primer/primer_octicon.rb +18 -1
- data/lib/rubocop/cop/primer/system_argument_instead_of_class.rb +1 -15
- data/lib/tasks/docs.rake +7 -6
- data/lib/tasks/utilities.rake +2 -0
- data/static/arguments.yml +75 -64
- data/static/classes.yml +2 -0
- data/static/constants.json +31 -29
- data/static/statuses.json +7 -5
- metadata +29 -9
- data/app/components/primer/breadcrumb_component.rb +0 -57
- data/app/components/primer/tab_nav_component.rb +0 -151
- data/app/components/primer/underline_nav_component.rb +0 -187
- data/lib/primer/classify/functional_text_colors.rb +0 -64
data/lib/tasks/utilities.rake
CHANGED
data/static/arguments.yml
CHANGED
@@ -22,6 +22,74 @@
|
|
22
22
|
type: Hash
|
23
23
|
default: N/A
|
24
24
|
description: "[System arguments](/system-arguments)"
|
25
|
+
- component: TabNav
|
26
|
+
source: https://github.com/primer/view_components/tree/main/app/components/primer/alpha/tab_nav.rb
|
27
|
+
parameters:
|
28
|
+
- name: tag
|
29
|
+
type: Symbol
|
30
|
+
default: "`:nav`"
|
31
|
+
description: One of `:div` and `:nav`.
|
32
|
+
- name: label
|
33
|
+
type: String
|
34
|
+
default: N/A
|
35
|
+
description: Sets an `aria-label` that helps assistive technology users understand
|
36
|
+
the purpose of the links, and distinguish it from similar elements.
|
37
|
+
- name: body_arguments
|
38
|
+
type: Hash
|
39
|
+
default: "`{}`"
|
40
|
+
description: "[System arguments](/system-arguments) for the body wrapper."
|
41
|
+
- name: system_arguments
|
42
|
+
type: Hash
|
43
|
+
default: N/A
|
44
|
+
description: "[System arguments](/system-arguments)"
|
45
|
+
- component: TabPanels
|
46
|
+
source: https://github.com/primer/view_components/tree/main/app/components/primer/alpha/tab_panels.rb
|
47
|
+
parameters:
|
48
|
+
- name: label
|
49
|
+
type: String
|
50
|
+
default: N/A
|
51
|
+
description: Sets an `aria-label` that helps assistive technology users understand
|
52
|
+
the purpose of the tabs.
|
53
|
+
- name: align
|
54
|
+
type: Symbol
|
55
|
+
default: N/A
|
56
|
+
description: One of `:left` and `:right`. - Defaults to left
|
57
|
+
- name: body_arguments
|
58
|
+
type: Hash
|
59
|
+
default: "`{}`"
|
60
|
+
description: "[System arguments](/system-arguments) for the body wrapper."
|
61
|
+
- name: wrapper_arguments
|
62
|
+
type: Hash
|
63
|
+
default: "`{}`"
|
64
|
+
description: "[System arguments](/system-arguments) for the `TabContainer` wrapper."
|
65
|
+
- name: system_arguments
|
66
|
+
type: Hash
|
67
|
+
default: N/A
|
68
|
+
description: "[System arguments](/system-arguments)"
|
69
|
+
- component: UnderlineNav
|
70
|
+
source: https://github.com/primer/view_components/tree/main/app/components/primer/alpha/underline_nav.rb
|
71
|
+
parameters:
|
72
|
+
- name: tag
|
73
|
+
type: Symbol
|
74
|
+
default: "`:nav`"
|
75
|
+
description: One of `:div` and `:nav`.
|
76
|
+
- name: label
|
77
|
+
type: String
|
78
|
+
default: N/A
|
79
|
+
description: Sets an `aria-label` that helps assistive technology users understand
|
80
|
+
the purpose of the links, and distinguish it from similar elements.
|
81
|
+
- name: align
|
82
|
+
type: Symbol
|
83
|
+
default: "`:left`"
|
84
|
+
description: One of `:left` and `:right`. - Defaults to left
|
85
|
+
- name: body_arguments
|
86
|
+
type: Hash
|
87
|
+
default: "`{}`"
|
88
|
+
description: "[System arguments](/system-arguments) for the body wrapper."
|
89
|
+
- name: system_arguments
|
90
|
+
type: Hash
|
91
|
+
default: N/A
|
92
|
+
description: "[System arguments](/system-arguments)"
|
25
93
|
- component: BaseButton
|
26
94
|
source: https://github.com/primer/view_components/tree/main/app/components/primer/base_button.rb
|
27
95
|
parameters:
|
@@ -132,6 +200,13 @@
|
|
132
200
|
type: Hash
|
133
201
|
default: N/A
|
134
202
|
description: "[System arguments](/system-arguments)"
|
203
|
+
- component: Breadcrumbs
|
204
|
+
source: https://github.com/primer/view_components/tree/main/app/components/primer/beta/breadcrumbs.rb
|
205
|
+
parameters:
|
206
|
+
- name: system_arguments
|
207
|
+
type: Hash
|
208
|
+
default: N/A
|
209
|
+
description: "[System arguments](/system-arguments)"
|
135
210
|
- component: Text
|
136
211
|
source: https://github.com/primer/view_components/tree/main/app/components/primer/beta/text.rb
|
137
212
|
parameters:
|
@@ -235,13 +310,6 @@
|
|
235
310
|
type: Hash
|
236
311
|
default: N/A
|
237
312
|
description: "[System arguments](/system-arguments)"
|
238
|
-
- component: Breadcrumb
|
239
|
-
source: https://github.com/primer/view_components/tree/main/app/components/primer/breadcrumb_component.rb
|
240
|
-
parameters:
|
241
|
-
- name: system_arguments
|
242
|
-
type: Hash
|
243
|
-
default: N/A
|
244
|
-
description: "[System arguments](/system-arguments)"
|
245
313
|
- component: Button
|
246
314
|
source: https://github.com/primer/view_components/tree/main/app/components/primer/button_component.rb
|
247
315
|
parameters:
|
@@ -838,33 +906,6 @@
|
|
838
906
|
type: Hash
|
839
907
|
default: N/A
|
840
908
|
description: "[System arguments](/system-arguments)"
|
841
|
-
- component: TabNav
|
842
|
-
source: https://github.com/primer/view_components/tree/main/app/components/primer/tab_nav_component.rb
|
843
|
-
parameters:
|
844
|
-
- name: label
|
845
|
-
type: String
|
846
|
-
default: N/A
|
847
|
-
description: Used to set the `aria-label` on the top level `<nav>` element.
|
848
|
-
- name: with_panel
|
849
|
-
type: Boolean
|
850
|
-
default: "`false`"
|
851
|
-
description: Whether the TabNav should navigate through pages or panels. When
|
852
|
-
true, [TabContainer](/components/tabcontainer) is rendered along with JavaScript
|
853
|
-
behavior. Additionally, the `tab` slot will render as a button as opposed to
|
854
|
-
an anchor.
|
855
|
-
- name: body_arguments
|
856
|
-
type: Hash
|
857
|
-
default: "`{}`"
|
858
|
-
description: "[System arguments](/system-arguments) for the body wrapper."
|
859
|
-
- name: wrapper_arguments
|
860
|
-
type: Hash
|
861
|
-
default: "`{}`"
|
862
|
-
description: "[System arguments](/system-arguments) for the `TabContainer` wrapper.
|
863
|
-
Only applies if `with_panel` is `true`."
|
864
|
-
- name: system_arguments
|
865
|
-
type: Hash
|
866
|
-
default: N/A
|
867
|
-
description: "[System arguments](/system-arguments)"
|
868
909
|
- component: TimeAgo
|
869
910
|
source: https://github.com/primer/view_components/tree/main/app/components/primer/time_ago_component.rb
|
870
911
|
parameters:
|
@@ -948,33 +989,3 @@
|
|
948
989
|
type: Hash
|
949
990
|
default: N/A
|
950
991
|
description: "[System arguments](/system-arguments)"
|
951
|
-
- component: UnderlineNav
|
952
|
-
source: https://github.com/primer/view_components/tree/main/app/components/primer/underline_nav_component.rb
|
953
|
-
parameters:
|
954
|
-
- name: label
|
955
|
-
type: String
|
956
|
-
default: N/A
|
957
|
-
description: The `aria-label` on top level `<nav>` element.
|
958
|
-
- name: with_panel
|
959
|
-
type: Boolean
|
960
|
-
default: "`false`"
|
961
|
-
description: Whether the `UnderlineNav` should navigate through pages or panels.
|
962
|
-
When true, [TabContainer](/components/tabcontainer) is rendered along with JavaScript
|
963
|
-
behavior.
|
964
|
-
- name: align
|
965
|
-
type: Symbol
|
966
|
-
default: "`:left`"
|
967
|
-
description: One of `:left` and `:right`. - Defaults to left
|
968
|
-
- name: body_arguments
|
969
|
-
type: Hash
|
970
|
-
default: "`{ tag: BODY_TAG_DEFAULT }`"
|
971
|
-
description: "[System arguments](/system-arguments) for the body wrapper."
|
972
|
-
- name: wrapper_arguments
|
973
|
-
type: Hash
|
974
|
-
default: "`{}`"
|
975
|
-
description: "[System arguments](/system-arguments) for the `TabContainer` wrapper.
|
976
|
-
Only applies if `with_panel` is `true`."
|
977
|
-
- name: system_arguments
|
978
|
-
type: Hash
|
979
|
-
default: N/A
|
980
|
-
description: "[System arguments](/system-arguments)"
|
data/static/classes.yml
CHANGED
@@ -76,6 +76,7 @@
|
|
76
76
|
- ".border"
|
77
77
|
- ".border-bottom-0"
|
78
78
|
- ".breadcrumb-item"
|
79
|
+
- ".breadcrumb-item-selected"
|
79
80
|
- ".btn"
|
80
81
|
- ".btn-block"
|
81
82
|
- ".btn-danger"
|
@@ -114,6 +115,7 @@
|
|
114
115
|
- ".custom-class"
|
115
116
|
- ".d-flex"
|
116
117
|
- ".d-inline-block"
|
118
|
+
- ".d-inline-flex"
|
117
119
|
- ".details-overlay"
|
118
120
|
- ".details-reset"
|
119
121
|
- ".dropdown"
|
data/static/constants.json
CHANGED
@@ -33,6 +33,32 @@
|
|
33
33
|
"large"
|
34
34
|
]
|
35
35
|
},
|
36
|
+
"Primer::Alpha::TabNav": {
|
37
|
+
"BODY_TAG_DEFAULT": "ul",
|
38
|
+
"TAG_DEFAULT": "nav",
|
39
|
+
"TAG_OPTIONS": [
|
40
|
+
"nav",
|
41
|
+
"div"
|
42
|
+
]
|
43
|
+
},
|
44
|
+
"Primer::Alpha::TabPanels": {
|
45
|
+
"BODY_TAG_DEFAULT": "ul",
|
46
|
+
"TAG_DEFAULT": "nav",
|
47
|
+
"TAG_OPTIONS": [
|
48
|
+
"nav",
|
49
|
+
"div"
|
50
|
+
]
|
51
|
+
},
|
52
|
+
"Primer::Alpha::UnderlineNav": {
|
53
|
+
"BODY_TAG_DEFAULT": "ul",
|
54
|
+
"TAG_DEFAULT": "nav",
|
55
|
+
"TAG_OPTIONS": [
|
56
|
+
"nav",
|
57
|
+
"div"
|
58
|
+
]
|
59
|
+
},
|
60
|
+
"Primer::Alpha::UnderlinePanels": {
|
61
|
+
},
|
36
62
|
"Primer::BaseButton": {
|
37
63
|
"DEFAULT_TAG": "button",
|
38
64
|
"DEFAULT_TYPE": "button",
|
@@ -82,6 +108,11 @@
|
|
82
108
|
"span"
|
83
109
|
]
|
84
110
|
},
|
111
|
+
"Primer::Beta::Breadcrumbs": {
|
112
|
+
"Item": "Primer::Beta::Breadcrumbs::Item"
|
113
|
+
},
|
114
|
+
"Primer::Beta::Breadcrumbs::Item": {
|
115
|
+
},
|
85
116
|
"Primer::Beta::Text": {
|
86
117
|
"DEFAULT_TAG": "span"
|
87
118
|
},
|
@@ -110,11 +141,6 @@
|
|
110
141
|
},
|
111
142
|
"Primer::BoxComponent": {
|
112
143
|
},
|
113
|
-
"Primer::BreadcrumbComponent": {
|
114
|
-
"ItemComponent": "Primer::BreadcrumbComponent::ItemComponent"
|
115
|
-
},
|
116
|
-
"Primer::BreadcrumbComponent::ItemComponent": {
|
117
|
-
},
|
118
144
|
"Primer::ButtonComponent": {
|
119
145
|
"DEFAULT_SCHEME": "default",
|
120
146
|
"DEFAULT_VARIANT": "medium",
|
@@ -574,13 +600,6 @@
|
|
574
600
|
},
|
575
601
|
"Primer::TabContainerComponent": {
|
576
602
|
},
|
577
|
-
"Primer::TabNavComponent": {
|
578
|
-
"DEFAULT_EXTRA_ALIGN": "left",
|
579
|
-
"EXTRA_ALIGN_OPTIONS": [
|
580
|
-
"left",
|
581
|
-
"right"
|
582
|
-
]
|
583
|
-
},
|
584
603
|
"Primer::TimeAgoComponent": {
|
585
604
|
},
|
586
605
|
"Primer::TimelineItemComponent": {
|
@@ -619,22 +638,5 @@
|
|
619
638
|
"p",
|
620
639
|
"strong"
|
621
640
|
]
|
622
|
-
},
|
623
|
-
"Primer::UnderlineNavComponent": {
|
624
|
-
"ACTIONS_TAG_DEFAULT": "div",
|
625
|
-
"ACTIONS_TAG_OPTIONS": [
|
626
|
-
"div",
|
627
|
-
"span"
|
628
|
-
],
|
629
|
-
"ALIGN_DEFAULT": "left",
|
630
|
-
"ALIGN_OPTIONS": [
|
631
|
-
"left",
|
632
|
-
"right"
|
633
|
-
],
|
634
|
-
"BODY_TAG_DEFAULT": "div",
|
635
|
-
"BODY_TAG_OPTIONS": [
|
636
|
-
"div",
|
637
|
-
"ul"
|
638
|
-
]
|
639
641
|
}
|
640
642
|
}
|
data/static/statuses.json
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
{
|
2
2
|
"Primer::Alpha::ButtonMarketing": "alpha",
|
3
|
+
"Primer::Alpha::TabNav": "alpha",
|
4
|
+
"Primer::Alpha::TabPanels": "alpha",
|
5
|
+
"Primer::Alpha::UnderlineNav": "alpha",
|
6
|
+
"Primer::Alpha::UnderlinePanels": "alpha",
|
3
7
|
"Primer::BaseButton": "beta",
|
4
8
|
"Primer::BaseComponent": "beta",
|
5
9
|
"Primer::Beta::AutoComplete": "beta",
|
@@ -7,14 +11,14 @@
|
|
7
11
|
"Primer::Beta::AutoComplete::Item": "beta",
|
8
12
|
"Primer::Beta::Avatar": "beta",
|
9
13
|
"Primer::Beta::AvatarStack": "beta",
|
14
|
+
"Primer::Beta::Breadcrumbs": "beta",
|
15
|
+
"Primer::Beta::Breadcrumbs::Item": "alpha",
|
10
16
|
"Primer::Beta::Text": "beta",
|
11
17
|
"Primer::Beta::Truncate": "beta",
|
12
18
|
"Primer::Beta::Truncate::TruncateText": "alpha",
|
13
19
|
"Primer::BlankslateComponent": "beta",
|
14
20
|
"Primer::BorderBoxComponent": "beta",
|
15
21
|
"Primer::BoxComponent": "stable",
|
16
|
-
"Primer::BreadcrumbComponent": "beta",
|
17
|
-
"Primer::BreadcrumbComponent::ItemComponent": "alpha",
|
18
22
|
"Primer::ButtonComponent": "beta",
|
19
23
|
"Primer::ButtonGroup": "beta",
|
20
24
|
"Primer::ClipboardCopy": "beta",
|
@@ -48,11 +52,9 @@
|
|
48
52
|
"Primer::StateComponent": "beta",
|
49
53
|
"Primer::SubheadComponent": "beta",
|
50
54
|
"Primer::TabContainerComponent": "alpha",
|
51
|
-
"Primer::TabNavComponent": "beta",
|
52
55
|
"Primer::TimeAgoComponent": "beta",
|
53
56
|
"Primer::TimelineItemComponent": "beta",
|
54
57
|
"Primer::TimelineItemComponent::BadgeComponent": "alpha",
|
55
58
|
"Primer::Tooltip": "beta",
|
56
|
-
"Primer::Truncate": "beta"
|
57
|
-
"Primer::UnderlineNavComponent": "alpha"
|
59
|
+
"Primer::Truncate": "beta"
|
58
60
|
}
|
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.57
|
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: 2021-
|
11
|
+
date: 2021-09-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionview
|
@@ -72,6 +72,20 @@ dependencies:
|
|
72
72
|
- - "<"
|
73
73
|
- !ruby/object:Gem::Version
|
74
74
|
version: '3.0'
|
75
|
+
- !ruby/object:Gem::Dependency
|
76
|
+
name: allocation_stats
|
77
|
+
requirement: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - "~>"
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '0.1'
|
82
|
+
type: :development
|
83
|
+
prerelease: false
|
84
|
+
version_requirements: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - "~>"
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '0.1'
|
75
89
|
- !ruby/object:Gem::Dependency
|
76
90
|
name: allocation_tracer
|
77
91
|
requirement: !ruby/object:Gem::Requirement
|
@@ -365,6 +379,14 @@ files:
|
|
365
379
|
- app/assets/javascripts/primer_view_components.js
|
366
380
|
- app/assets/javascripts/primer_view_components.js.map
|
367
381
|
- app/components/primer/alpha/button_marketing.rb
|
382
|
+
- app/components/primer/alpha/tab_nav.html.erb
|
383
|
+
- app/components/primer/alpha/tab_nav.rb
|
384
|
+
- app/components/primer/alpha/tab_panels.html.erb
|
385
|
+
- app/components/primer/alpha/tab_panels.rb
|
386
|
+
- app/components/primer/alpha/underline_nav.html.erb
|
387
|
+
- app/components/primer/alpha/underline_nav.rb
|
388
|
+
- app/components/primer/alpha/underline_panels.html.erb
|
389
|
+
- app/components/primer/alpha/underline_panels.rb
|
368
390
|
- app/components/primer/auto_complete/auto_complete.d.ts
|
369
391
|
- app/components/primer/auto_complete/auto_complete.js
|
370
392
|
- app/components/primer/auto_complete/auto_component.d.ts
|
@@ -380,6 +402,8 @@ files:
|
|
380
402
|
- app/components/primer/beta/avatar.rb
|
381
403
|
- app/components/primer/beta/avatar_stack.html.erb
|
382
404
|
- app/components/primer/beta/avatar_stack.rb
|
405
|
+
- app/components/primer/beta/breadcrumbs.html.erb
|
406
|
+
- app/components/primer/beta/breadcrumbs.rb
|
383
407
|
- app/components/primer/beta/text.rb
|
384
408
|
- app/components/primer/beta/truncate.html.erb
|
385
409
|
- app/components/primer/beta/truncate.rb
|
@@ -388,8 +412,6 @@ files:
|
|
388
412
|
- app/components/primer/border_box_component.html.erb
|
389
413
|
- app/components/primer/border_box_component.rb
|
390
414
|
- app/components/primer/box_component.rb
|
391
|
-
- app/components/primer/breadcrumb_component.html.erb
|
392
|
-
- app/components/primer/breadcrumb_component.rb
|
393
415
|
- app/components/primer/button_component.html.erb
|
394
416
|
- app/components/primer/button_component.rb
|
395
417
|
- app/components/primer/button_group.html.erb
|
@@ -462,8 +484,6 @@ files:
|
|
462
484
|
- app/components/primer/tab_container_component.js
|
463
485
|
- app/components/primer/tab_container_component.rb
|
464
486
|
- app/components/primer/tab_container_component.ts
|
465
|
-
- app/components/primer/tab_nav_component.html.erb
|
466
|
-
- app/components/primer/tab_nav_component.rb
|
467
487
|
- app/components/primer/time_ago_component.d.ts
|
468
488
|
- app/components/primer/time_ago_component.js
|
469
489
|
- app/components/primer/time_ago_component.rb
|
@@ -472,15 +492,15 @@ files:
|
|
472
492
|
- app/components/primer/timeline_item_component.rb
|
473
493
|
- app/components/primer/tooltip.rb
|
474
494
|
- app/components/primer/truncate.rb
|
475
|
-
- app/components/primer/underline_nav_component.html.erb
|
476
|
-
- app/components/primer/underline_nav_component.rb
|
477
495
|
- app/lib/primer/class_name_helper.rb
|
478
496
|
- app/lib/primer/fetch_or_fallback_helper.rb
|
479
497
|
- app/lib/primer/join_style_arguments_helper.rb
|
480
498
|
- app/lib/primer/octicon/cache.rb
|
481
499
|
- app/lib/primer/status/dsl.rb
|
500
|
+
- app/lib/primer/tab_nav_helper.rb
|
482
501
|
- app/lib/primer/tabbed_component_helper.rb
|
483
502
|
- app/lib/primer/test_selector_helper.rb
|
503
|
+
- app/lib/primer/underline_nav_helper.rb
|
484
504
|
- app/lib/primer/view_helper.rb
|
485
505
|
- lib/primer/classify.rb
|
486
506
|
- lib/primer/classify/cache.rb
|
@@ -488,7 +508,6 @@ files:
|
|
488
508
|
- lib/primer/classify/functional_background_colors.rb
|
489
509
|
- lib/primer/classify/functional_border_colors.rb
|
490
510
|
- lib/primer/classify/functional_colors.rb
|
491
|
-
- lib/primer/classify/functional_text_colors.rb
|
492
511
|
- lib/primer/classify/grid.rb
|
493
512
|
- lib/primer/classify/utilities.rb
|
494
513
|
- lib/primer/classify/utilities.yml
|
@@ -517,6 +536,7 @@ files:
|
|
517
536
|
- lib/primer/view_components/version.rb
|
518
537
|
- lib/rubocop/config/default.yml
|
519
538
|
- lib/rubocop/cop/primer.rb
|
539
|
+
- lib/rubocop/cop/primer/base_cop.rb
|
520
540
|
- lib/rubocop/cop/primer/deprecated_arguments.rb
|
521
541
|
- lib/rubocop/cop/primer/no_tag_memoize.rb
|
522
542
|
- lib/rubocop/cop/primer/primer_octicon.rb
|
@@ -1,57 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Primer
|
4
|
-
# Use `Breadcrumb` to display page hierarchy within a section of the site. All of the items in the breadcrumb "trail" are links except for the final item, which is a plain string indicating the current page.
|
5
|
-
class BreadcrumbComponent < Primer::Component
|
6
|
-
status :beta
|
7
|
-
|
8
|
-
# _Note: if both `href` and `selected: true` are passed in, `href` will be ignored and the item will not be rendered as a link._
|
9
|
-
#
|
10
|
-
# @param href [String] The URL to link to.
|
11
|
-
# @param selected [Boolean] Whether or not the item is selected and not rendered as a link.
|
12
|
-
# @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
|
13
|
-
renders_many :items, "ItemComponent"
|
14
|
-
|
15
|
-
# @example Basic
|
16
|
-
# <%= render(Primer::BreadcrumbComponent.new) do |component| %>
|
17
|
-
# <% component.item(href: "/") do %>Home<% end %>
|
18
|
-
# <% component.item(href: "/about") do %>About<% end %>
|
19
|
-
# <% component.item(selected: true) do %>Team<% end %>
|
20
|
-
# <% end %>
|
21
|
-
#
|
22
|
-
# @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
|
23
|
-
def initialize(**system_arguments)
|
24
|
-
@system_arguments = system_arguments
|
25
|
-
@system_arguments[:tag] = :nav
|
26
|
-
@system_arguments[:aria] = { label: "Breadcrumb" }
|
27
|
-
end
|
28
|
-
|
29
|
-
def render?
|
30
|
-
items.any?
|
31
|
-
end
|
32
|
-
|
33
|
-
# This component is part of `Primer::BreadcrumbComponent` and should not be
|
34
|
-
# used as a standalone component.
|
35
|
-
class ItemComponent < Primer::Component
|
36
|
-
def initialize(href: nil, selected: false, **system_arguments)
|
37
|
-
@href = href
|
38
|
-
@system_arguments = system_arguments
|
39
|
-
|
40
|
-
@href = nil if selected
|
41
|
-
@system_arguments[:tag] = :li
|
42
|
-
@system_arguments[:"aria-current"] = "page" if selected
|
43
|
-
@system_arguments[:classes] = "breadcrumb-item #{@system_arguments[:classes]}"
|
44
|
-
end
|
45
|
-
|
46
|
-
def call
|
47
|
-
render(Primer::BaseComponent.new(**@system_arguments)) do
|
48
|
-
if @href.present?
|
49
|
-
render(Primer::LinkComponent.new(href: @href)) { content }
|
50
|
-
else
|
51
|
-
content
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|