Skip to content

Commit

Permalink
feat(VsInputWrapper): add label style (#139)
Browse files Browse the repository at this point in the history
  • Loading branch information
seaneez authored Mar 19, 2024
1 parent 9f267ed commit 050edb4
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<vs-wrapper :width="width" :grid="grid" v-show="visible">
<vs-input-wrapper
:label="label"
:disabled="disabled"
:messages="computedMessages"
:no-label="noLabel"
:no-message="noMessage"
Expand Down
1 change: 1 addition & 0 deletions packages/vlossom/src/components/vs-checkbox/VsCheckbox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<vs-input-wrapper
:id="checkLabel ? '' : id"
:label="label"
:disabled="disabled"
:messages="computedMessages"
:no-label="noLabel"
:no-message="noMessage"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<vs-input-wrapper
:id="id"
:label="label"
:disabled="disabled"
:messages="computedMessages"
:no-label="noLabel"
:no-message="noMessage"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
@use '@/styles/mixin' as *;

.vs-input-wrapper {
.vs-label {
color: var(--vs-font-color);
font-size: 1rem;
line-height: 2rem;

&.disabled {
@include disabled;
}
}

.required-star {
color: var(--vs-red-600);

&.disabled {
@include disabled;
}
}

fieldset {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
:class="textGlowByState"
>
<slot name="label">
<span class="vs-label">{{ label }}</span>
<span :class="['vs-label', { disabled }]">{{ label }}</span>
</slot>
<i class="required-star" v-if="required">*</i>
<i :class="['required-star', { disabled }]" v-if="required">*</i>
</component>

<slot />
Expand All @@ -37,6 +37,7 @@ export default defineComponent({
groupLabel: { type: Boolean, default: false },
id: { type: String, default: '' },
label: { type: String, default: '' },
disabled: { type: Boolean, default: false },
messages: { type: Array as PropType<StateMessage[]>, default: () => [] },
noLabel: { type: Boolean, default: false },
noMessage: { type: Boolean, default: false },
Expand Down
1 change: 1 addition & 0 deletions packages/vlossom/src/components/vs-input/VsInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<vs-input-wrapper
:id="id"
:label="label"
:disabled="disabled"
:messages="computedMessages"
:no-label="noLabel"
:no-message="noMessage"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<vs-wrapper :width="width" :grid="grid" v-show="visible">
<vs-input-wrapper
:label="label"
:disabled="disabled"
:messages="computedMessages"
:no-label="noLabel"
:no-message="noMessage"
Expand Down
1 change: 1 addition & 0 deletions packages/vlossom/src/components/vs-radio/VsRadio.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<vs-input-wrapper
:id="radioLabel ? '' : id"
:label="label"
:disabled="disabled"
:messages="computedMessages"
:no-label="noLabel"
:no-message="noMessage"
Expand Down
1 change: 1 addition & 0 deletions packages/vlossom/src/components/vs-select/VsSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<vs-input-wrapper
:id="id"
:label="label"
:disabled="disabled"
:messages="computedMessages"
:no-label="noLabel"
:no-message="noMessage"
Expand Down
1 change: 1 addition & 0 deletions packages/vlossom/src/components/vs-switch/VsSwitch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<vs-input-wrapper
:id="id"
:label="label"
:disabled="disabled"
:messages="computedMessages"
:no-label="noLabel"
:no-message="noMessage"
Expand Down
1 change: 1 addition & 0 deletions packages/vlossom/src/components/vs-textarea/VsTextarea.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<vs-input-wrapper
:id="id"
:label="label"
:disabled="disabled"
:messages="computedMessages"
:no-label="noLabel"
:no-message="noMessage"
Expand Down

0 comments on commit 050edb4

Please sign in to comment.