app/components/primer/alpha/dialog.rb in primer_view_components-0.6.0 vs app/components/primer/alpha/dialog.rb in primer_view_components-0.7.0
- old
+ new
@@ -95,27 +95,10 @@
#
# @param show_divider [Boolean] Show a divider between the footer and body.
# @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
renders_one :footer, "Footer"
- # @example Dialog with Cancel and Submit buttons
- # @description
- # An ID is provided which enables wiring of the open and close buttons to the dialog.
- # @code
- # <%= render(Primer::Alpha::Dialog.new(
- # title: "Dialog Example",
- # id: "my-dialog",
- # )) do |d| %>
- # <% d.with_show_button { "Show Dialog" } %>
- # <% d.with_body do %>
- # <p>Some content</p>
- # <% end %>
- # <% d.with_footer do %>
- # <%= render(Primer::ButtonComponent.new(data: { "close-dialog-id": "my-dialog" })) { "Cancel" } %>
- # <%= render(Primer::ButtonComponent.new(scheme: :primary)) { "Submit" } %>
- # <% end %>
- # <% end %>
# @param id [String] The id of the dialog.
# @param title [String] Describes the content of the dialog.
# @param subtitle [String] Provides additional context for the dialog, also setting the `aria-describedby` attribute.
# @param size [Symbol] The size of the dialog. <%= one_of(Primer::Alpha::Dialog::SIZE_OPTIONS) %>
# @param position [Symbol] The position of the dialog. <%= one_of(Primer::Alpha::Dialog::POSITION_OPTIONS) %>
@@ -148,10 +131,11 @@
@system_arguments[:aria] = { modal: true }
@system_arguments[:aria] = merge_aria(
@system_arguments, {
aria: {
disabled: true,
- describedby: "#{@id}-title #{@id}-description"
+ labelledby: "#{@id}-title",
+ describedby: "#{@id}-description"
}
}
)
@system_arguments[:classes] = class_names(
"Overlay",