Update component code adding description for form input fields
In gitlab-org/gitlab-services/design.gitlab.com#642 (closed), we added an optional description area below the title of an input field. This issue is to update the component code.
Implementation Plan
-
In gitlab-ui add a
labelDescription
andlabel
prop to https://gitlab.com/gitlab-org/gitlab-ui/-/blob/main/src/components/base/form/form_group/form_group.vue -
Add
label
slot to https://gitlab.com/gitlab-org/gitlab-ui/-/blob/main/src/components/base/form/form_group/form_group.vue so end up with something like -
Update story book examples + add examples
-
Update unit tests and manually test in gitlab codebase.
<template>
<b-form-group v-bind="$attrs" class="gl-form-group" :label-class="actualLabelClass">
<template #label>
<template v-if="label">{{ label }}</template>
<gl-form-text v-if="labelDescription" class="gl-mt-3">{{ labelDescription }}</gl-form-text>
</template>
<slot v-for="slot in Object.keys($slots)" :slot="slot" :name="slot"></slot>
</b-form-group>
</template>
Edited by -