Skip to content
This repository was archived by the owner on Sep 8, 2025. It is now read-only.

Commit 8d2e3ac

Browse files
committed
Refactor UI components to conditionally render small text
1 parent 1b998fc commit 8d2e3ac

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

ui-components/Checkbox.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
<label :class="label()" :for="$props.id">
1212
{{ props.label }}
1313
</label>
14-
<small :class="small()">
15-
<span>{{ props.helper }}</span>
14+
<small v-if="$props.helper" :class="small()">
15+
<span>{{ $props.helper }}</span>
1616
</small>
1717
<svg
1818
:class="svg()"

ui-components/Textarea.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88
:value="modelValue"
99
@input="emitUpdate"
1010
:class="textarea()"
11-
:maxlength="limit"
11+
:maxlength="$props.limit"
1212
:disabled="disabled"
1313
/>
1414
<label :for="textareaId" :class="label()">
1515
{{ props.label }}
1616
</label>
17-
<small :class="small()">
18-
<span> {{ props.helper }} </span>
19-
<span v-if="limit">{{ charCount }}/{{ limit }}</span>
17+
<small v-if="$props.helper || $props.limit" :class="small()">
18+
<span v-if="$props.helper"> {{ props.helper }} </span>
19+
<span v-if="$props.limit">{{ charCount }}/{{ $props.limit }}</span>
2020
</small>
2121
</div>
2222
</template>

ui-components/Toggle.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<label :class="label()" :for="$props.id">
1212
{{ props.helper }}
1313
</label>
14-
<small :class="small()">
14+
<small v-if="$props.helper" :class="small()">
1515
<span>{{ $props.helper }}</span>
1616
</small>
1717
</div>

0 commit comments

Comments
 (0)