feat(GlFormInput): add responsive size support
What does this MR do?
Related to #1794 (closed)
Updates the GlFormInput
size
prop to accept an object. This allows for responsive inputs that are different sizes on different screens. The most common use case is to have the input full width on mobile and to have a max-width on desktop.
When providing an object to the size
prop all breakpoints are min-width
and you can specify a default
key to set the size when no breakpoint is active. If the default
key is not provided it defaults to max-width: 100%;
when no breakpoint is active. Examples:
default
key
With {
default: 'md',
md: 'lg',
lg: 'xl'
}
default
key
Without {
md: 'lg',
lg: 'xl'
}
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.
- [-] If it changes GitLab UI's documentation guidelines, the MR has been reviewed by a Technical Writer.
-
If the MR changes a component's API, integration MR(s) have been opened in the following projects to ensure that the @gitlab/ui
package can be upgraded quickly after the changes are released: -
Added the ~"component:*"
label(s) if applicable.
Edited by Peter Hegman