@@ -112,17 +112,24 @@ const focus = (node) => autofocus && node.focus()
112
112
</span>
113
113
</label>
114
114
<div class="mdc-text-field-helper-line" style="width: {width};">
115
- <div class="mdc-text-field-helper-text" class:opacity1={required} id="{labelID}-helper-id" aria-hidden="true">
116
- {#if required && !internalValue}
117
- <span class="required" class:error={hasFocused}>*Required</span>
115
+ <div
116
+ class="mdc-text-field-helper-text
117
+ mdc-text-field-helper-text--{error ? 'validation-msg' : 'persistent'}"
118
+ id="{labelID}-helper-id"
119
+ aria-hidden="true"
120
+ >
121
+ {#if !error && description}
122
+ {description}
123
+ {:else if required && !internalValue}
124
+ ✴Required
118
125
{:else if hasExceededMaxValue}
119
- <span class="error"> Maximum value allowed is {maxValue}</span>
126
+ Maximum value allowed is {maxValue}
120
127
{:else if isLowerThanMinValue}
121
- <span class="error"> Minimun value allowed is ({minValue})</span>
128
+ Minimun value allowed is ({minValue})
122
129
{:else if valueNotDivisibleByStep}
123
- <span class="error"> {internalValue} is not divisible by {step}</span>
130
+ {internalValue} is not divisible by {step}
124
131
{:else if hasExceededMaxLength}
125
- <span class="error"> Maximum {maxlength} characters</span>
132
+ Maximum {maxlength} characters
126
133
{/if}
127
134
</div>
128
135
{#if showCounter}
@@ -131,6 +138,3 @@ const focus = (node) => autofocus && node.focus()
131
138
</div>
132
139
{/if}
133
140
</div>
134
- {#if description}
135
- <span class="d-block mdc-theme--neutral">{description}</span>
136
- {/if}
0 commit comments