openproject-primer_view_components 0.53.0 → 0.53.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +14 -0
- data/app/components/primer/open_project/danger_dialog.rb +6 -1
- data/app/components/primer/open_project/feedback_dialog.rb +3 -2
- data/lib/primer/view_components/version.rb +1 -1
- data/previews/primer/open_project/danger_dialog_preview/playground.html.erb +1 -0
- data/previews/primer/open_project/danger_dialog_preview/with_additional_details.html.erb +1 -1
- data/previews/primer/open_project/feedback_dialog_preview/playground.html.erb +1 -1
- data/previews/primer/open_project/feedback_dialog_preview/with_additional_details.html.erb +1 -1
- data/previews/primer/open_project/feedback_dialog_preview/with_custom_footer.html.erb +1 -1
- data/static/arguments.json +12 -0
- data/static/info_arch.json +12 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3a5ebd3e6efce535bd30f0428fd7cdd7771cef126a196dd41ff71519ac80a427
|
4
|
+
data.tar.gz: fec7772667aff0aa82f06cc19740eeb121e3228aa3142645e2c86938e58e57f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb26f8fa7cf53c73d6560c002e1568b6a217c18e4ad462464ed1f510507c7030b63a2986e84c7a1d8d1c64d952d5166226ae5948839ae418d18a94b7489d331a
|
7
|
+
data.tar.gz: ddd1fe830a42b9bfd9fe6918c057d7e90c323e69b68e8233a6555f1732107672d07331358a5519f8d2173e6206e313d37c851bccc12b15b925006f19bf8373c9
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,19 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
+
## 0.53.1
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- [#236](https://github.com/opf/primer_view_components/pull/236) [`de1a205`](https://github.com/opf/primer_view_components/commit/de1a205fc5ddfec39373bf579c2a8b2417ad9ca3) Thanks [@myabc](https://github.com/myabc)! - Fix regression: callers unable to set custom button text
|
8
|
+
|
9
|
+
- [#237](https://github.com/opf/primer_view_components/pull/237) [`c2c98cf`](https://github.com/opf/primer_view_components/commit/c2c98cfc4bfc6cf62f116016a04015d7404d0a63) Thanks [@myabc](https://github.com/myabc)! - Make DangerDialog title param required: Axe will raise accessibility violations in the absence of a title. We want to ensure best a11y practice, so this change makes it a required param and documents it.
|
10
|
+
|
11
|
+
This is a BREAKING change.
|
12
|
+
|
13
|
+
- [#237](https://github.com/opf/primer_view_components/pull/237) [`694bdae`](https://github.com/opf/primer_view_components/commit/694bdae3523774a92632ce7c53c235cdadf29e3f) Thanks [@myabc](https://github.com/myabc)! - Make FeedbackDialog title param required: Axe will raise accessibility violations in the absence of a title. We want to ensure best a11y practice, so this change makes it a required param and documents it.
|
14
|
+
|
15
|
+
This is a BREAKING change.
|
16
|
+
|
3
17
|
## 0.53.0
|
4
18
|
|
5
19
|
### Minor Changes
|
@@ -63,12 +63,14 @@ module Primer
|
|
63
63
|
|
64
64
|
# @param form_arguments [Hash] Allows the dialog to submit a form. Pass EITHER the `builder:` option to this hash to reuse an existing Rails form, or `action:` if you prefer the component to render the form tag itself. `builder:` should be an instance of `ActionView::Helpers::FormBuilder`, which is created by the standard Rails `#form_with` and `#form_for` helpers. The `name:` option is the desired name of the field that will be included in the params sent to the server on form submission.
|
65
65
|
# @param id [String] The id of the dialog.
|
66
|
+
# @param title [String] The title of the dialog. Although visually hidden, a label is rendered for assistive technologies.
|
66
67
|
# @param confirm_button_text [String] The text of the confirm button. Will default to `I18n.t("button_delete")`, or `I18n.t("button_delete_permanently")` if `confirmation_check_box` slot has been passed to the component.
|
67
68
|
# @param cancel_button_text [String] The text of the cancel button. Will default to `I18n.t("button_cancel")`.
|
68
69
|
# @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
|
69
70
|
def initialize(
|
70
71
|
form_arguments: {},
|
71
72
|
id: self.class.generate_id,
|
73
|
+
title:,
|
72
74
|
confirm_button_text: nil,
|
73
75
|
cancel_button_text: nil,
|
74
76
|
**system_arguments
|
@@ -77,6 +79,9 @@ module Primer
|
|
77
79
|
@form_wrapper = FormWrapper.new(**form_arguments)
|
78
80
|
@dialog_id = id.to_s
|
79
81
|
|
82
|
+
@confirm_button_text = confirm_button_text
|
83
|
+
@cancel_button_text = cancel_button_text
|
84
|
+
|
80
85
|
@system_arguments = system_arguments
|
81
86
|
@system_arguments[:id] = @dialog_id
|
82
87
|
@system_arguments[:classes] = class_names(
|
@@ -84,7 +89,7 @@ module Primer
|
|
84
89
|
"DangerDialog"
|
85
90
|
)
|
86
91
|
|
87
|
-
@dialog = Primer::Alpha::Dialog.new(title:
|
92
|
+
@dialog = Primer::Alpha::Dialog.new(title: title, subtitle: nil, visually_hide_title: true, **@system_arguments)
|
88
93
|
end
|
89
94
|
|
90
95
|
delegate :labelledby, :header?, :header, :with_header, :with_header_content,
|
@@ -40,8 +40,9 @@ module Primer
|
|
40
40
|
|
41
41
|
renders_one :footer
|
42
42
|
|
43
|
+
# @param title [String] The title of the dialog. Although visually hidden, a label is rendered for assistive technologies.
|
43
44
|
# @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
|
44
|
-
def initialize(**system_arguments)
|
45
|
+
def initialize(title:, **system_arguments)
|
45
46
|
@system_arguments = system_arguments
|
46
47
|
@system_arguments[:classes] = class_names(
|
47
48
|
system_arguments[:classes],
|
@@ -49,7 +50,7 @@ module Primer
|
|
49
50
|
)
|
50
51
|
@system_arguments[:id] ||= self.class.generate_id
|
51
52
|
|
52
|
-
@dialog = Primer::Alpha::Dialog.new(title:
|
53
|
+
@dialog = Primer::Alpha::Dialog.new(title: title, subtitle: nil, visually_hide_title: true, **@system_arguments)
|
53
54
|
end
|
54
55
|
|
55
56
|
delegate :header?, :header, :with_header, :with_header_content,
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<%= render(Primer::OpenProject::DangerDialog.new) do |dialog| %>
|
1
|
+
<%= render(Primer::OpenProject::DangerDialog.new(title: "Delete work packages")) do |dialog| %>
|
2
2
|
<% dialog.with_show_button { "Click me" } %>
|
3
3
|
<% dialog.with_confirmation_message do |message| %>
|
4
4
|
<% message.with_heading(tag: :h2).with_content("Delete 5 work packages?") %>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<%= render(Primer::OpenProject::FeedbackDialog.new(id: "my-dialog")) do |dialog| %>
|
1
|
+
<%= render(Primer::OpenProject::FeedbackDialog.new(id: "my-dialog", title: "My dialog")) do |dialog| %>
|
2
2
|
<% dialog.with_show_button { "Click me" } %>
|
3
3
|
<% dialog.with_feedback_message(icon_arguments: { icon: icon, color: icon_color }, loading: loading_state) do |message| %>
|
4
4
|
<% message.with_heading(tag: :h2).with_content("Awesome!") %>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<%= render(Primer::OpenProject::FeedbackDialog.new) do |dialog| %>
|
1
|
+
<%= render(Primer::OpenProject::FeedbackDialog.new(title: "Success message")) do |dialog| %>
|
2
2
|
<% dialog.with_show_button { "Click me" } %>
|
3
3
|
<% dialog.with_feedback_message do |message| %>
|
4
4
|
<% message.with_heading(tag: :h2).with_content("Action successful") %>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<%= render(Primer::OpenProject::FeedbackDialog.new(id: "my-dialog")) do |dialog| %>
|
1
|
+
<%= render(Primer::OpenProject::FeedbackDialog.new(id: "my-dialog", title: "Custom footer")) do |dialog| %>
|
2
2
|
<% dialog.with_show_button { "Click me" } %>
|
3
3
|
<% dialog.with_feedback_message do |message| %>
|
4
4
|
<% message.with_heading(tag: :h2).with_content("Action successful") %>
|
data/static/arguments.json
CHANGED
@@ -5131,6 +5131,12 @@
|
|
5131
5131
|
"default": "`self.class.generate_id`",
|
5132
5132
|
"description": "The id of the dialog."
|
5133
5133
|
},
|
5134
|
+
{
|
5135
|
+
"name": "title",
|
5136
|
+
"type": "String",
|
5137
|
+
"default": "N/A",
|
5138
|
+
"description": "The title of the dialog. Although visually hidden, a label is rendered for assistive technologies."
|
5139
|
+
},
|
5134
5140
|
{
|
5135
5141
|
"name": "confirm_button_text",
|
5136
5142
|
"type": "String",
|
@@ -5214,6 +5220,12 @@
|
|
5214
5220
|
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/open_project/feedback_dialog.rb",
|
5215
5221
|
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/open_project/feedback_dialog/default/",
|
5216
5222
|
"parameters": [
|
5223
|
+
{
|
5224
|
+
"name": "title",
|
5225
|
+
"type": "String",
|
5226
|
+
"default": "N/A",
|
5227
|
+
"description": "The title of the dialog. Although visually hidden, a label is rendered for assistive technologies."
|
5228
|
+
},
|
5217
5229
|
{
|
5218
5230
|
"name": "system_arguments",
|
5219
5231
|
"type": "Hash",
|
data/static/info_arch.json
CHANGED
@@ -17532,6 +17532,12 @@
|
|
17532
17532
|
"default": "`self.class.generate_id`",
|
17533
17533
|
"description": "The id of the dialog."
|
17534
17534
|
},
|
17535
|
+
{
|
17536
|
+
"name": "title",
|
17537
|
+
"type": "String",
|
17538
|
+
"default": "N/A",
|
17539
|
+
"description": "The title of the dialog. Although visually hidden, a label is rendered for assistive technologies."
|
17540
|
+
},
|
17535
17541
|
{
|
17536
17542
|
"name": "confirm_button_text",
|
17537
17543
|
"type": "String",
|
@@ -17878,6 +17884,12 @@
|
|
17878
17884
|
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/open_project/feedback_dialog.rb",
|
17879
17885
|
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/open_project/feedback_dialog/default/",
|
17880
17886
|
"parameters": [
|
17887
|
+
{
|
17888
|
+
"name": "title",
|
17889
|
+
"type": "String",
|
17890
|
+
"default": "N/A",
|
17891
|
+
"description": "The title of the dialog. Although visually hidden, a label is rendered for assistive technologies."
|
17892
|
+
},
|
17881
17893
|
{
|
17882
17894
|
"name": "system_arguments",
|
17883
17895
|
"type": "Hash",
|