openproject-primer_view_components 0.55.0 → 0.56.0
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 +6 -0
- data/app/components/primer/open_project/side_panel/section.rb +12 -1
- data/lib/primer/view_components/version.rb +1 -1
- data/previews/primer/open_project/side_panel_preview/with_action_menu.html.erb +37 -0
- data/previews/primer/open_project/side_panel_preview.rb +4 -0
- data/static/info_arch.json +13 -0
- data/static/previews.json +13 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4b76152c9e58905d3a151255870c74e5cd76f324274f5ec83fd8c7db0acaf1fd
|
4
|
+
data.tar.gz: a251a85dfb9e56ab5fe44be042ffc97ed0ee9a99fb8cbf869f6ee74f3f23acde
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed47d9cd29fa27bd45139fb65c43eeb609aaf6ecdb5598f995b81243d4136c8156cdd36e7e4cf108e3b3712b953b9e75695872e80bc845f80077390869a4d3ac
|
7
|
+
data.tar.gz: f5632d53039ec344cf3f8cce5a59d7109c9d7635c2ad59ba9cfa9f66bee24b7448a0edb1da8b869affba7cd3d10e261036d1b0c7c663bb0a6cc0c79109395191
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
+
## 0.56.0
|
4
|
+
|
5
|
+
### Minor Changes
|
6
|
+
|
7
|
+
- [#252](https://github.com/opf/primer_view_components/pull/252) [`b8822ba`](https://github.com/opf/primer_view_components/commit/b8822ba460e35c362b0ba927c4a77a2fd7ad26ca) Thanks [@oliverguenther](https://github.com/oliverguenther)! - Allow ActionMenu as sidepanel section action
|
8
|
+
|
3
9
|
## 0.55.0
|
4
10
|
|
5
11
|
### Minor Changes
|
@@ -21,7 +21,18 @@ module Primer
|
|
21
21
|
icon: lambda { |**system_arguments, &block|
|
22
22
|
system_arguments[:scheme] ||= :invisible
|
23
23
|
Primer::Beta::IconButton.new(**system_arguments, &block)
|
24
|
-
}
|
24
|
+
},
|
25
|
+
menu: lambda { |**system_arguments, &block|
|
26
|
+
deny_tag_argument(**system_arguments)
|
27
|
+
|
28
|
+
button_arguments = system_arguments.delete(:button_arguments) || {}
|
29
|
+
button_arguments[:scheme] ||= :invisible
|
30
|
+
raise ArgumentError.new("button_arguments must contain an icon:") if button_arguments[:icon].blank?
|
31
|
+
|
32
|
+
Primer::Alpha::ActionMenu.new(**system_arguments).tap do |menu|
|
33
|
+
menu.with_show_button(**button_arguments)
|
34
|
+
end
|
35
|
+
},
|
25
36
|
}
|
26
37
|
|
27
38
|
renders_one :description, lambda { |**system_arguments, &block|
|
@@ -0,0 +1,37 @@
|
|
1
|
+
<%=
|
2
|
+
clazz = Class.new(ViewComponent::Base) do
|
3
|
+
def self.name
|
4
|
+
"CustomComponent"
|
5
|
+
end
|
6
|
+
|
7
|
+
def call
|
8
|
+
render(Primer::OpenProject::SidePanel::Section.new) do |section|
|
9
|
+
section.with_title { "My custom component" }
|
10
|
+
section.with_action_menu(
|
11
|
+
anchor_align: :end,
|
12
|
+
button_arguments: { icon: :gear, 'aria-label': 'Edit' }
|
13
|
+
) do |menu|
|
14
|
+
menu.with_item(label: "Subitem 1") do |item|
|
15
|
+
item.with_leading_visual_icon(icon: :paste)
|
16
|
+
end
|
17
|
+
menu.with_item(label: "Subitem 2") do |item|
|
18
|
+
item.with_leading_visual_icon(icon: :log)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
"Section content"
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
render(Primer::Alpha::Layout.new) do |component|
|
28
|
+
component.with_main do
|
29
|
+
"Main content"
|
30
|
+
end
|
31
|
+
component.with_sidebar(row_placement: :start, col_placement: :end) do
|
32
|
+
render(Primer::OpenProject::SidePanel.new) do |panel|
|
33
|
+
panel.with_section(clazz.new)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
%>
|
data/static/info_arch.json
CHANGED
@@ -19175,6 +19175,19 @@
|
|
19175
19175
|
"color-contrast"
|
19176
19176
|
]
|
19177
19177
|
}
|
19178
|
+
},
|
19179
|
+
{
|
19180
|
+
"preview_path": "primer/open_project/side_panel/with_action_menu",
|
19181
|
+
"name": "with_action_menu",
|
19182
|
+
"snapshot": "false",
|
19183
|
+
"skip_rules": {
|
19184
|
+
"wont_fix": [
|
19185
|
+
"region"
|
19186
|
+
],
|
19187
|
+
"will_fix": [
|
19188
|
+
"color-contrast"
|
19189
|
+
]
|
19190
|
+
}
|
19178
19191
|
}
|
19179
19192
|
],
|
19180
19193
|
"subcomponents": [
|
data/static/previews.json
CHANGED
@@ -7007,6 +7007,19 @@
|
|
7007
7007
|
"color-contrast"
|
7008
7008
|
]
|
7009
7009
|
}
|
7010
|
+
},
|
7011
|
+
{
|
7012
|
+
"preview_path": "primer/open_project/side_panel/with_action_menu",
|
7013
|
+
"name": "with_action_menu",
|
7014
|
+
"snapshot": "false",
|
7015
|
+
"skip_rules": {
|
7016
|
+
"wont_fix": [
|
7017
|
+
"region"
|
7018
|
+
],
|
7019
|
+
"will_fix": [
|
7020
|
+
"color-contrast"
|
7021
|
+
]
|
7022
|
+
}
|
7010
7023
|
}
|
7011
7024
|
]
|
7012
7025
|
},
|
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.56.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: 2025-02-
|
12
|
+
date: 2025-02-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: actionview
|
@@ -1055,6 +1055,7 @@ files:
|
|
1055
1055
|
- previews/primer/open_project/side_panel_preview.rb
|
1056
1056
|
- previews/primer/open_project/side_panel_preview/default.html.erb
|
1057
1057
|
- previews/primer/open_project/side_panel_preview/playground.html.erb
|
1058
|
+
- previews/primer/open_project/side_panel_preview/with_action_menu.html.erb
|
1058
1059
|
- previews/primer/open_project/side_panel_preview/with_component.html.erb
|
1059
1060
|
- previews/primer/open_project/sub_header_preview.rb
|
1060
1061
|
- previews/primer/open_project/sub_header_preview/action_menu_buttons.html.erb
|