feat(glModal): fix action styling to adhere to pajamas
What does this MR do?
This MR addresses this issue identified in this MR comment. Our current responsive button layout for modals does not adhere to our pajamas style guide.
From the pajamas docs on modals:
Actions should always be located within an action bar at the bottom of the modal. Button order and positioning should follow our guidelines for buttons.
From the pajamas docs on buttons:
Don't: Stack buttons vertically if there is space to place them inline
So what does this MR do?
This MR introduces a new property for gl-modal
called keepActionsInline
. If this is true then the modal actions will not wrap. This can look really nice if space allows, so we let this be configurable from the client. If keepActionsInline
is false (default behavior) then we wrap and add width: 100%
.
Screenshots
Responsive keepActionsInline: false
|
Responsive keepActionsInline: true
|
---|---|
Does this MR meet the acceptance criteria?
Conformity
-
Code review guidelines. -
GitLab UI's contributing guidlines. -
If it changes a Pajamas-compliant component's look & feel, the MR has been reviewed by a UX designer. -
Added the ~"component:*"
label(s) if applicable.
Accessibility
If this MR adds or modifies a component, take a few moments to review the following:
-
All actions and functionality can be done with a keyboard. -
Links, buttons, and controls have a visible focus state. -
All content is presented in text or with a text equivalent. For example, alt text for SVG, or aria-label
for icons that have meaning or perform actions. -
Changes in a component’s state are announced by a screen reader. For example, changing aria-expanded="false"
toaria-expanded="true"
when an accordion is expanded. -
Color combinations have sufficient contrast.