@terraware/web-components 2.0.44 → 2.0.46

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.
@@ -18,10 +18,11 @@ export interface Props {
18
18
  hideClearIcon?: boolean;
19
19
  isEqual?: (option: ValueType, value: ValueType) => void;
20
20
  placeholder?: string;
21
+ errorText?: string;
21
22
  }
22
23
  export declare type DropdownItem = {
23
24
  label: string;
24
25
  value: string;
25
26
  };
26
- export default function Autocomplete({ id, label, values, onChange, selected, freeSolo, disabled, className, hideClearIcon, isEqual, placeholder, }: Props): JSX.Element;
27
+ export default function Autocomplete({ id, label, values, onChange, selected, freeSolo, disabled, className, hideClearIcon, isEqual, placeholder, errorText, }: Props): JSX.Element;
27
28
  //# sourceMappingURL=Autocomplete.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Autocomplete.d.ts","sourceRoot":"","sources":["../../../src/components/Autocomplete/Autocomplete.tsx"],"names":[],"mappings":";AAGA,OAAO,uBAAuB,CAAC;AAC/B,OAAO,eAAe,CAAC;AAEvB,oBAAY,MAAM,GAAG;IACnB,KAAK,EAAE,GAAG,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,oBAAY,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;AAExC,MAAM,WAAW,KAAK;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,SAAS,EAAE,CAAC;IACpB,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,KAAK,IAAI,CAAC;IACjD,QAAQ,EAAE,SAAS,GAAG,SAAS,CAAC;IAChC,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE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AAM,CAAC;CACpB;AAED,oBAAY,YAAY,GAAG;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EACnC,EAAE,EACF,KAAK,EACL,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,aAAa,EACb,OAAO,EACP,WAAW,EACX,SAAS,GACV,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAwErB"}
@@ -28,7 +28,8 @@ function Autocomplete(_ref) {
28
28
  className = _ref.className,
29
29
  hideClearIcon = _ref.hideClearIcon,
30
30
  isEqual = _ref.isEqual,
31
- placeholder = _ref.placeholder;
31
+ placeholder = _ref.placeholder,
32
+ errorText = _ref.errorText;
32
33
 
33
34
  var onChangeHandler = function onChangeHandler(event, value) {
34
35
  if (event) {
@@ -50,7 +51,14 @@ function Autocomplete(_ref) {
50
51
  variant: "outlined",
51
52
  size: "small",
52
53
  placeholder: placeholder
53
- })));
54
+ })), errorText && /*#__PURE__*/_react.default.createElement("div", {
55
+ className: "textfield-label-container"
56
+ }, /*#__PURE__*/_react.default.createElement(_Icon.default, {
57
+ name: "error",
58
+ className: "textfield-error-text--icon"
59
+ }), /*#__PURE__*/_react.default.createElement("label", {
60
+ className: "textfield-error-text"
61
+ }, errorText)));
54
62
  };
55
63
 
56
64
  var optionalArgs = {};
@@ -86,4 +86,28 @@
86
86
  }
87
87
  }
88
88
  }
89
+
90
+ .textfield-label-container {
91
+ display: flex;
92
+ width: 100%;
93
+ margin-top: $tw-spc-base-xx-small;
94
+ }
95
+
96
+ .textfield-error-text {
97
+ font-family: $tw-fnt-frm-fld-error-text-font-family;
98
+ font-size: $tw-fnt-frm-fld-error-text-font-size;
99
+ font-weight: $tw-fnt-frm-fld-error-text-font-weight;
100
+ line-height: $tw-fnt-frm-fld-error-text-line-height;
101
+ color: $tw-clr-txt-danger;
102
+ display: block;
103
+ width: 100%;
104
+ max-width: 100%;
105
+
106
+ &--icon {
107
+ fill: $tw-clr-icn-danger;
108
+ width: $tw-fnt-frm-fld-error-text-line-height;
109
+ height: $tw-fnt-frm-fld-error-text-line-height;
110
+ margin-right: $tw-spc-base-x-small;
111
+ }
112
+ }
89
113
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@terraware/web-components",
3
- "version": "2.0.44",
3
+ "version": "2.0.46",
4
4
  "author": "Terraformation Inc.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -110,7 +110,7 @@ var TerrawareTheme2 = {
110
110
  "TwClrBgTertiaryActive": "#B2AB93",
111
111
  "TwClrBgTertiaryHover": "linear-gradient(rgb(178 171 147 / 50%), rgb(178 171 147 / 50%)), linear-gradient(#CBC6B7, #CBC6B7)",
112
112
  "TwClrBrdr": "#333025",
113
- "TwClrBrdrActive": "linear-gradient(rgb(70 88 170 / 50%), rgb(70 88 170 / 50%)), linear-gradient(#6172BE, #6172BE)",
113
+ "TwClrBrdrActive": "mix(#4658AA, #6172BE, 50%)",
114
114
  "TwClrBrdrFocus": "#4658AA",
115
115
  "TwClrBrdrHover": "#6172BE",
116
116
  "TwClrBrdrSecondary": "#7F775B",
@@ -99,7 +99,7 @@ $tw-clr-bg-tertiary: #CBC6B7;
99
99
  $tw-clr-bg-tertiary-active: #B2AB93;
100
100
  $tw-clr-bg-tertiary-hover: linear-gradient(rgba(#B2AB93, 0.5), rgba(#B2AB93, 0.5)), linear-gradient(#CBC6B7, #CBC6B7);
101
101
  $tw-clr-brdr: #333025;
102
- $tw-clr-brdr-active: linear-gradient(rgba(#4658AA, 0.5), rgba(#4658AA, 0.5)), linear-gradient(#6172BE, #6172BE);
102
+ $tw-clr-brdr-active: mix(#4658AA, #6172BE, 50%);
103
103
  $tw-clr-brdr-focus: #4658AA;
104
104
  $tw-clr-brdr-hover: #6172BE;
105
105
  $tw-clr-brdr-secondary: #7F775B;