openproject-primer_view_components 0.30.1 → 0.31.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- 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/open_project/page_header.css +1 -1
- data/app/components/primer/open_project/page_header.css.json +3 -1
- data/app/components/primer/open_project/page_header.css.map +1 -1
- data/app/components/primer/open_project/page_header.html.erb +1 -0
- data/app/components/primer/open_project/page_header.pcss +10 -0
- data/app/components/primer/open_project/page_header.rb +13 -0
- data/lib/primer/view_components/version.rb +2 -2
- data/previews/primer/open_project/page_header_preview/playground.html.erb +7 -0
- data/previews/primer/open_project/page_header_preview.rb +22 -2
- data/static/classes.json +6 -0
- data/static/info_arch.json +25 -0
- data/static/previews.json +13 -0
- metadata +2 -2
@@ -1 +1 @@
|
|
1
|
-
.PageHeader{border-bottom:var(--borderWidth-thin) solid var(--borderColor-muted);display:flex;flex-flow:column;margin-bottom:var(--stack-gap-normal);padding-bottom:var(--stack-padding-condensed)}.PageHeader-contextBar{margin-bottom:var(--base-size-8)}.PageHeader-contextBar,.PageHeader-titleBar{align-items:center;display:flex;flex-flow:row;justify-content:flex-end}.PageHeader-titleBar{margin-bottom:var(--space-xsmall)}.PageHeader-title{flex:1 1 auto;font-size:var(--text-title-size-medium);font-weight:var(--base-text-weight-normal)}.PageHeader-title--large{font-size:var(--text-title-size-large)}.PageHeader-description{color:var(--fgColor-muted);flex:1 100%;font-size:var(--text-body-size-medium)}.PageHeader-actions{align-items:center;display:flex;justify-content:flex-end}.PageHeader-breadcrumbs{display:block;width:100%}.PageHeader-leadingAction{margin-right:var(--base-size-4);margin-top:2px}.PageHeader-parentLink{flex:1 1 auto}
|
1
|
+
.PageHeader{border-bottom:var(--borderWidth-thin) solid var(--borderColor-muted);display:flex;flex-flow:column;margin-bottom:var(--stack-gap-normal);padding-bottom:var(--stack-padding-condensed)}.PageHeader--noBorder{border-bottom:none;padding-bottom:0}.PageHeader-contextBar{margin-bottom:var(--base-size-8)}.PageHeader-contextBar,.PageHeader-titleBar{align-items:center;display:flex;flex-flow:row;justify-content:flex-end}.PageHeader-titleBar{margin-bottom:var(--space-xsmall)}.PageHeader-title{flex:1 1 auto;font-size:var(--text-title-size-medium);font-weight:var(--base-text-weight-normal)}.PageHeader-title--large{font-size:var(--text-title-size-large)}.PageHeader-description{color:var(--fgColor-muted);flex:1 100%;font-size:var(--text-body-size-medium)}.PageHeader-actions{align-items:center;display:flex;justify-content:flex-end}.PageHeader-breadcrumbs{display:block;width:100%}.PageHeader-leadingAction{margin-right:var(--base-size-4);margin-top:2px}.PageHeader-parentLink{flex:1 1 auto}.PageHeader-tabNav{margin-bottom:0;margin-top:var(--stack-gap-normal)}
|
@@ -2,6 +2,7 @@
|
|
2
2
|
"name": "open_project/page_header",
|
3
3
|
"selectors": [
|
4
4
|
".PageHeader",
|
5
|
+
".PageHeader--noBorder",
|
5
6
|
".PageHeader-contextBar",
|
6
7
|
".PageHeader-titleBar",
|
7
8
|
".PageHeader-title",
|
@@ -10,6 +11,7 @@
|
|
10
11
|
".PageHeader-actions",
|
11
12
|
".PageHeader-breadcrumbs",
|
12
13
|
".PageHeader-leadingAction",
|
13
|
-
".PageHeader-parentLink"
|
14
|
+
".PageHeader-parentLink",
|
15
|
+
".PageHeader-tabNav"
|
14
16
|
]
|
15
17
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["page_header.pcss"],"names":[],"mappings":"AAEA,YAIE,oEAAqE,CAHrE,YAAa,CAIb,gBAAiB,CAFjB,qCAAsC,CADtC,6CAIF,CAEA,uBAKE,gCACF,CAEA,4CAJE,kBAAmB,CAHnB,YAAa,CACb,aAAc,CACd,wBAWF,CANA,qBAKE,iCACF,CAEA,kBAGE,aAAc,CAFd,uCAAwC,CACxC,0CAEF,CAEA,yBACE,sCACF,CAGA,wBAEE,0BAA2B,CAC3B,WAAY,CAFZ,sCAGF,CAEA,oBAGE,kBAAmB,CADnB,YAAa,CADb,wBAGF,CAEA,wBACE,aAAc,CACd,UACF,CAEA,0BAEE,+BAAgC,CADhC,cAEF,CAEA,uBACE,aACF","file":"page_header.css","sourcesContent":["/* OP PageHeader */\n\n.PageHeader {\n display: flex;\n padding-bottom: var(--stack-padding-condensed);\n margin-bottom: var(--stack-gap-normal);\n border-bottom: var(--borderWidth-thin) solid var(--borderColor-muted);\n flex-flow: column;\n}\n\n.PageHeader-contextBar {\n display: flex;\n flex-flow: row;\n justify-content: flex-end;\n align-items: center;\n margin-bottom: var(--base-size-8);\n}\n\n.PageHeader-titleBar {\n display: flex;\n flex-flow: row;\n justify-content: flex-end;\n align-items: center; /* Keep back button vertically aligned. */\n margin-bottom: var(--space-xsmall);\n}\n\n.PageHeader-title {\n font-size: var(--text-title-size-medium);\n font-weight: var(--base-text-weight-normal);\n flex: 1 1 auto;\n}\n\n.PageHeader-title--large {\n font-size: var(--text-title-size-large);\n}\n\n/* One-liner of supporting text */\n.PageHeader-description {\n font-size: var(--text-body-size-medium);\n color: var(--fgColor-muted);\n flex: 1 100%;\n}\n\n.PageHeader-actions {\n justify-content: flex-end;\n display: flex;\n align-items: center;\n}\n\n.PageHeader-breadcrumbs {\n display: block;\n width: 100%;\n}\n\n.PageHeader-leadingAction {\n margin-top: 2px; /* to center align with label */\n margin-right: var(--base-size-4);\n}\n\n.PageHeader-parentLink {\n flex: 1 1 auto;\n}\n"]}
|
1
|
+
{"version":3,"sources":["page_header.pcss"],"names":[],"mappings":"AAEA,YAIE,oEAAqE,CAHrE,YAAa,CAIb,gBAAiB,CAFjB,qCAAsC,CADtC,6CAIF,CAEA,sBACE,kBAAmB,CACnB,gBACF,CAEA,uBAKE,gCACF,CAEA,4CAJE,kBAAmB,CAHnB,YAAa,CACb,aAAc,CACd,wBAWF,CANA,qBAKE,iCACF,CAEA,kBAGE,aAAc,CAFd,uCAAwC,CACxC,0CAEF,CAEA,yBACE,sCACF,CAGA,wBAEE,0BAA2B,CAC3B,WAAY,CAFZ,sCAGF,CAEA,oBAGE,kBAAmB,CADnB,YAAa,CADb,wBAGF,CAEA,wBACE,aAAc,CACd,UACF,CAEA,0BAEE,+BAAgC,CADhC,cAEF,CAEA,uBACE,aACF,CAEA,mBAEE,eAAgB,CADhB,kCAEF","file":"page_header.css","sourcesContent":["/* OP PageHeader */\n\n.PageHeader {\n display: flex;\n padding-bottom: var(--stack-padding-condensed);\n margin-bottom: var(--stack-gap-normal);\n border-bottom: var(--borderWidth-thin) solid var(--borderColor-muted);\n flex-flow: column;\n}\n\n.PageHeader--noBorder {\n border-bottom: none;\n padding-bottom: 0;\n}\n\n.PageHeader-contextBar {\n display: flex;\n flex-flow: row;\n justify-content: flex-end;\n align-items: center;\n margin-bottom: var(--base-size-8);\n}\n\n.PageHeader-titleBar {\n display: flex;\n flex-flow: row;\n justify-content: flex-end;\n align-items: center; /* Keep back button vertically aligned. */\n margin-bottom: var(--space-xsmall);\n}\n\n.PageHeader-title {\n font-size: var(--text-title-size-medium);\n font-weight: var(--base-text-weight-normal);\n flex: 1 1 auto;\n}\n\n.PageHeader-title--large {\n font-size: var(--text-title-size-large);\n}\n\n/* One-liner of supporting text */\n.PageHeader-description {\n font-size: var(--text-body-size-medium);\n color: var(--fgColor-muted);\n flex: 1 100%;\n}\n\n.PageHeader-actions {\n justify-content: flex-end;\n display: flex;\n align-items: center;\n}\n\n.PageHeader-breadcrumbs {\n display: block;\n width: 100%;\n}\n\n.PageHeader-leadingAction {\n margin-top: 2px; /* to center align with label */\n margin-right: var(--base-size-4);\n}\n\n.PageHeader-parentLink {\n flex: 1 1 auto;\n}\n\n.PageHeader-tabNav {\n margin-top: var(--stack-gap-normal);\n margin-bottom: 0;\n}\n"]}
|
@@ -8,6 +8,11 @@
|
|
8
8
|
flex-flow: column;
|
9
9
|
}
|
10
10
|
|
11
|
+
.PageHeader--noBorder {
|
12
|
+
border-bottom: none;
|
13
|
+
padding-bottom: 0;
|
14
|
+
}
|
15
|
+
|
11
16
|
.PageHeader-contextBar {
|
12
17
|
display: flex;
|
13
18
|
flex-flow: row;
|
@@ -60,3 +65,8 @@
|
|
60
65
|
.PageHeader-parentLink {
|
61
66
|
flex: 1 1 auto;
|
62
67
|
}
|
68
|
+
|
69
|
+
.PageHeader-tabNav {
|
70
|
+
margin-top: var(--stack-gap-normal);
|
71
|
+
margin-bottom: 0;
|
72
|
+
}
|
@@ -205,6 +205,19 @@ module Primer
|
|
205
205
|
end
|
206
206
|
}
|
207
207
|
|
208
|
+
# Optional tabs nav at the bottom of the page header
|
209
|
+
#
|
210
|
+
# @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
|
211
|
+
renders_one :tab_nav, lambda { |**system_arguments, &block|
|
212
|
+
@system_arguments[:classes] = class_names(@system_arguments[:classes], "PageHeader--noBorder")
|
213
|
+
|
214
|
+
system_arguments = deny_tag_argument(**system_arguments)
|
215
|
+
system_arguments[:tag] = :div
|
216
|
+
system_arguments[:classes] = class_names(system_arguments[:classes], "PageHeader-tabNav")
|
217
|
+
|
218
|
+
Primer::Alpha::TabNav.new(**system_arguments, &block)
|
219
|
+
}
|
220
|
+
|
208
221
|
# @param mobile_menu_label [String] The tooltip label of the mobile menu
|
209
222
|
# @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
|
210
223
|
def initialize(mobile_menu_label: I18n.t("label_more"), **system_arguments)
|
@@ -14,4 +14,11 @@
|
|
14
14
|
<% end %>
|
15
15
|
<% end %>
|
16
16
|
<% end %>
|
17
|
+
<% if with_tab_nav %>
|
18
|
+
<% header.with_tab_nav(label: "label") do |nav|%>
|
19
|
+
<% nav.with_tab(selected: true, href: "#") { "Tab 1" } %>
|
20
|
+
<% nav.with_tab(href: "#") { "Tab 2" } %>
|
21
|
+
<% nav.with_tab(href: "#") { "Tab 3" } %>
|
22
|
+
<% end %>
|
23
|
+
<% end %>
|
17
24
|
<% end %>
|
@@ -23,12 +23,14 @@ module Primer
|
|
23
23
|
# @param description [String] text
|
24
24
|
# @param with_leading_action [Symbol] octicon
|
25
25
|
# @param with_actions [Boolean]
|
26
|
+
# @param with_tab_nav [Boolean]
|
26
27
|
def playground(
|
27
28
|
variant: :medium,
|
28
29
|
title: "Hello",
|
29
30
|
description: "Last updated 5 minutes ago by XYZ.",
|
30
31
|
with_leading_action: :"none",
|
31
|
-
with_actions: true
|
32
|
+
with_actions: true,
|
33
|
+
with_tab_nav: false
|
32
34
|
)
|
33
35
|
breadcrumb_items = [{ href: "/foo", text: "Foo" }, { href: "/bar", text: "Bar" }, "Baz"]
|
34
36
|
|
@@ -37,7 +39,8 @@ module Primer
|
|
37
39
|
description: description,
|
38
40
|
with_leading_action: with_leading_action,
|
39
41
|
with_actions: with_actions,
|
40
|
-
breadcrumb_items: breadcrumb_items
|
42
|
+
breadcrumb_items: breadcrumb_items,
|
43
|
+
with_tab_nav: with_tab_nav})
|
41
44
|
end
|
42
45
|
|
43
46
|
# @label Large title
|
@@ -167,6 +170,23 @@ module Primer
|
|
167
170
|
header.with_breadcrumbs(breadcrumb_items, selected_item_font_weight: :normal)
|
168
171
|
end
|
169
172
|
end
|
173
|
+
|
174
|
+
# @label With tab nav
|
175
|
+
#
|
176
|
+
def tab_nav
|
177
|
+
render(Primer::OpenProject::PageHeader.new) do |header|
|
178
|
+
header.with_title { "Hello" }
|
179
|
+
header.with_breadcrumbs([{ href: "/foo", text: "Foo" }, { href: "/bar", text: "Bar" }, "Baz"])
|
180
|
+
header.with_description { "Last updated 5 minutes ago by XYZ." }
|
181
|
+
header.with_tab_nav(label: "label") do |nav|
|
182
|
+
Array.new(3) do |i|
|
183
|
+
nav.with_tab(selected: i.zero? , href: "#") do |tab|
|
184
|
+
tab.with_text { "Tab #{i + 1}" }
|
185
|
+
end
|
186
|
+
end
|
187
|
+
end
|
188
|
+
end
|
189
|
+
end
|
170
190
|
end
|
171
191
|
end
|
172
192
|
end
|
data/static/classes.json
CHANGED
@@ -429,6 +429,9 @@
|
|
429
429
|
"PageHeader": [
|
430
430
|
"Primer::OpenProject::PageHeader"
|
431
431
|
],
|
432
|
+
"PageHeader--noBorder": [
|
433
|
+
"Primer::OpenProject::PageHeader"
|
434
|
+
],
|
432
435
|
"PageHeader-actions": [
|
433
436
|
"Primer::OpenProject::PageHeader"
|
434
437
|
],
|
@@ -447,6 +450,9 @@
|
|
447
450
|
"PageHeader-parentLink": [
|
448
451
|
"Primer::OpenProject::PageHeader"
|
449
452
|
],
|
453
|
+
"PageHeader-tabNav": [
|
454
|
+
"Primer::OpenProject::PageHeader"
|
455
|
+
],
|
450
456
|
"PageHeader-title": [
|
451
457
|
"Primer::OpenProject::PageHeader"
|
452
458
|
],
|
data/static/info_arch.json
CHANGED
@@ -16692,6 +16692,18 @@
|
|
16692
16692
|
"description": "{{link_to_system_arguments_docs}}"
|
16693
16693
|
}
|
16694
16694
|
]
|
16695
|
+
},
|
16696
|
+
{
|
16697
|
+
"name": "tab_nav",
|
16698
|
+
"description": "Optional tabs nav at the bottom of the page header",
|
16699
|
+
"parameters": [
|
16700
|
+
{
|
16701
|
+
"name": "system_arguments",
|
16702
|
+
"type": "Hash",
|
16703
|
+
"default": "N/A",
|
16704
|
+
"description": "{{link_to_system_arguments_docs}}"
|
16705
|
+
}
|
16706
|
+
]
|
16695
16707
|
}
|
16696
16708
|
],
|
16697
16709
|
"methods": [
|
@@ -16840,6 +16852,19 @@
|
|
16840
16852
|
"color-contrast"
|
16841
16853
|
]
|
16842
16854
|
}
|
16855
|
+
},
|
16856
|
+
{
|
16857
|
+
"preview_path": "primer/open_project/page_header/tab_nav",
|
16858
|
+
"name": "tab_nav",
|
16859
|
+
"snapshot": "false",
|
16860
|
+
"skip_rules": {
|
16861
|
+
"wont_fix": [
|
16862
|
+
"region"
|
16863
|
+
],
|
16864
|
+
"will_fix": [
|
16865
|
+
"color-contrast"
|
16866
|
+
]
|
16867
|
+
}
|
16843
16868
|
}
|
16844
16869
|
],
|
16845
16870
|
"subcomponents": [
|
data/static/previews.json
CHANGED
@@ -5390,6 +5390,19 @@
|
|
5390
5390
|
"color-contrast"
|
5391
5391
|
]
|
5392
5392
|
}
|
5393
|
+
},
|
5394
|
+
{
|
5395
|
+
"preview_path": "primer/open_project/page_header/tab_nav",
|
5396
|
+
"name": "tab_nav",
|
5397
|
+
"snapshot": "false",
|
5398
|
+
"skip_rules": {
|
5399
|
+
"wont_fix": [
|
5400
|
+
"region"
|
5401
|
+
],
|
5402
|
+
"will_fix": [
|
5403
|
+
"color-contrast"
|
5404
|
+
]
|
5405
|
+
}
|
5393
5406
|
}
|
5394
5407
|
]
|
5395
5408
|
},
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: openproject-primer_view_components
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.31.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GitHub Open Source
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2024-05-
|
12
|
+
date: 2024-05-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: actionview
|