app/components/primer/alpha/dialog.rb in primer_view_components-0.16.1 vs app/components/primer/alpha/dialog.rb in primer_view_components-0.17.0
- old
+ new
@@ -32,23 +32,23 @@
}.freeze
SIZE_OPTIONS = SIZE_MAPPINGS.keys
DEFAULT_POSITION = :center
POSITION_MAPPINGS = {
- DEFAULT_POSITION => "Overlay-backdrop--center",
- :left => "Overlay-backdrop--side Overlay-backdrop--placement-left",
- :right => "Overlay-backdrop--side Overlay-backdrop--placement-right"
+ DEFAULT_POSITION => "",
+ :left => "Overlay--placement-left",
+ :right => "Overlay--placement-right"
}.freeze
POSITION_OPTIONS = POSITION_MAPPINGS.keys
DEFAULT_POSITION_NARROW = :inherit
POSITION_NARROW_MAPPINGS = {
DEFAULT_POSITION_NARROW => "",
- :bottom => "Overlay-backdrop--side-whenNarrow Overlay-backdrop--placement-bottom-whenNarrow",
- :fullscreen => "Overlay-backdrop--full-whenNarrow",
- :left => "Overlay-backdrop--side-whenNarrow Overlay-backdrop--placement-left-whenNarrow",
- :right => "Overlay-backdrop--side-whenNarrow Overlay-backdrop--placement-right-whenNarrow"
+ :bottom => "Overlay--placement-bottom-whenNarrow",
+ :fullscreen => "Overlay--full-whenNarrow",
+ :left => "Overlay--placement-left-whenNarrow",
+ :right => "Overlay--placement-right-whenNarrow"
}.freeze
POSITION_NARROW_OPTIONS = POSITION_NARROW_MAPPINGS.keys
# The dialog's ID value.
#
@@ -123,12 +123,11 @@
@size = size
@position = position
@position_narrow = position_narrow
@visually_hide_title = visually_hide_title
- @system_arguments[:tag] = "modal-dialog"
- @system_arguments[:role] = "dialog"
+ @system_arguments[:tag] = "dialog"
@system_arguments[:id] = @id
@system_arguments[:aria] = { modal: true }
@system_arguments[:aria] = merge_aria(
@system_arguments, {
aria: {
@@ -141,14 +140,12 @@
@system_arguments[:classes] = class_names(
"Overlay",
"Overlay-whenNarrow",
SIZE_MAPPINGS[fetch_or_fallback(SIZE_OPTIONS, @size, DEFAULT_SIZE)],
"Overlay--motion-scaleFade",
- system_arguments[:classes]
- )
- @backdrop_classes = class_names(
POSITION_MAPPINGS[fetch_or_fallback(POSITION_OPTIONS, @position, DEFAULT_POSITION)],
- POSITION_NARROW_MAPPINGS[fetch_or_fallback(POSITION_NARROW_MAPPINGS, @position_narrow, DEFAULT_POSITION_NARROW)]
+ POSITION_NARROW_MAPPINGS[fetch_or_fallback(POSITION_NARROW_MAPPINGS, @position_narrow, DEFAULT_POSITION_NARROW)],
+ system_arguments[:classes]
)
end
def before_render
with_header unless header?