@fluid-topics/ft-text-area 0.2.3 → 0.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -22,6 +22,7 @@ export const FtTextAreaCssVariables = {
22
22
  colorOnSurface: FtCssVariable.external(designSystemVariables.colorOnSurface, "Design system"),
23
23
  colorOnSurfaceDisabled: FtCssVariable.external(designSystemVariables.colorOnSurfaceDisabled, "Design system"),
24
24
  borderRadiusS: FtCssVariable.external(designSystemVariables.borderRadiusS, "Design system"),
25
+ colorError: FtCssVariable.external(designSystemVariables.colorError, "Design system"),
25
26
  };
26
27
  export class FtTextArea extends FtLitElement {
27
28
  constructor() {
@@ -31,6 +32,7 @@ export class FtTextArea extends FtLitElement {
31
32
  this.helper = "";
32
33
  this.outlined = false;
33
34
  this.disabled = false;
35
+ this.error = false;
34
36
  this.height = 50;
35
37
  this.focused = false;
36
38
  }
@@ -41,7 +43,8 @@ export class FtTextArea extends FtLitElement {
41
43
  "ft-text-area--outlined": this.outlined,
42
44
  "ft-text-area--disabled": this.disabled,
43
45
  "ft-text-area--has-value": !!this.value,
44
- "ft-text-area--no-label": !this.label
46
+ "ft-text-area--no-label": !this.label,
47
+ "ft-text-area--in-error": this.error,
45
48
  };
46
49
  return html `
47
50
  <style>
@@ -55,6 +58,7 @@ export class FtTextArea extends FtLitElement {
55
58
  ?disabled=${this.disabled}
56
59
  ?outlined=${this.outlined}
57
60
  ?raised=${this.focused || this.value != ""}
61
+ ?error=${this.error}
58
62
  ></ft-input-label>
59
63
  <div class="ft-text-area--input-panel"
60
64
  aria-label="${this.label}">
@@ -154,6 +158,7 @@ FtTextArea.styles = [
154
158
 
155
159
  .ft-text-area--input {
156
160
  display: block;
161
+ position: relative;
157
162
  flex-grow: 1;
158
163
  flex-shrink: 1;
159
164
  min-width: 0; /* flex sets this to auto an prevents input from shrinking properly */
@@ -205,6 +210,11 @@ FtTextArea.styles = [
205
210
  color: ${FtTextAreaCssVariables.helperColor};
206
211
  }
207
212
 
213
+ .ft-text-area--in-error .ft-text-area--input,
214
+ .ft-text-area--in-error .ft-text-area--helper-text {
215
+ color: ${FtTextAreaCssVariables.colorError};
216
+ }
217
+
208
218
  ft-resizer {
209
219
  position: absolute;
210
220
  right: 0;
@@ -227,6 +237,9 @@ __decorate([
227
237
  __decorate([
228
238
  property({ type: Boolean })
229
239
  ], FtTextArea.prototype, "disabled", void 0);
240
+ __decorate([
241
+ property({ type: Boolean })
242
+ ], FtTextArea.prototype, "error", void 0);
230
243
  __decorate([
231
244
  property({ type: Number, reflect: true })
232
245
  ], FtTextArea.prototype, "height", void 0);