@loomhq/lens 11.19.0 → 11.20.0

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.
@@ -10,5 +10,6 @@ type TextareaProps = {
10
10
  onChange?: React.ReactEventHandler;
11
11
  size?: 'small' | 'medium';
12
12
  resize?: 'none' | 'both' | 'horizontal' | 'vertical';
13
+ error?: string;
13
14
  };
14
15
  export default Textarea;
package/dist/index.js CHANGED
@@ -1217,6 +1217,10 @@ var formFieldVariables = getCssVarsFromObject(void 0, {
1217
1217
  formFieldBorderShadowFocus: `
1218
1218
  inset 0 0 0 var(--lns-formFieldBorderWidthFocus) var(--lns-color-blurple),
1219
1219
  0 0 0 var(--lns-formFieldBorderWidthFocus) var(--lns-color-focusRing)
1220
+ `,
1221
+ formFieldBorderShadowError: `
1222
+ inset 0 0 0 var(--lns-formFieldBorderWidthFocus) var(--lns-color-danger),
1223
+ 0 0 0 var(--lns-formFieldBorderWidthFocus) var(--lns-color-orangeLight)
1220
1224
  `
1221
1225
  });
1222
1226
  var colorVariables = getCssVarsFromObject("color", getColorsObject());
@@ -3904,18 +3908,19 @@ var TextareaWrapper = styled22.textarea`
3904
3908
  padding: ${(props) => sizesStyles3[props.size].padding};
3905
3909
  ${getRadius("large")};
3906
3910
  box-shadow: inset 0 0 0 var(--lns-formFieldBorderWidth)
3907
- var(--lns-color-formFieldBorder);
3911
+ ${(props) => props.error ? "var(--lns-color-danger)" : "var(--lns-color-formFieldBorder)"};
3908
3912
  ${(props) => getTextSize(sizesStyles3[props.size].textSize)};
3909
3913
  resize: ${(props) => props.resize};
3910
3914
 
3911
3915
  &:hover {
3912
3916
  box-shadow: inset 0 0 0 var(--lns-formFieldBorderWidthFocus)
3913
- var(--lns-color-blurple);
3917
+ ${(props) => props.error ? "var(--lns-color-danger)" : "var(--lns-color-blurple)"};
3914
3918
  }
3915
3919
 
3916
3920
  &:focus {
3917
- outline: 1px solid transparent;
3918
- box-shadow: var(--lns-formFieldBorderShadowFocus);
3921
+ outline: 1px solid
3922
+ ${(props) => props.error ? "var(--lns-color-orangeLight)" : "transparent"};
3923
+ box-shadow: ${(props) => props.error != "" ? "var(--lns-formFieldBorderShadowError)" : "var(--lns-formFieldBorderShadowFocus)"};
3919
3924
  }
3920
3925
 
3921
3926
  &:disabled {
@@ -3941,7 +3946,8 @@ var Textarea = React28.forwardRef(
3941
3946
  isDisabled,
3942
3947
  placeholder,
3943
3948
  size = "medium",
3944
- resize = "both"
3949
+ resize = "both",
3950
+ error = void 0
3945
3951
  } = _b, props = __objRest(_b, [
3946
3952
  "onChange",
3947
3953
  "value",
@@ -3949,9 +3955,10 @@ var Textarea = React28.forwardRef(
3949
3955
  "isDisabled",
3950
3956
  "placeholder",
3951
3957
  "size",
3952
- "resize"
3958
+ "resize",
3959
+ "error"
3953
3960
  ]);
3954
- return /* @__PURE__ */ React28.createElement(
3961
+ return /* @__PURE__ */ React28.createElement(React28.Fragment, null, /* @__PURE__ */ React28.createElement(
3955
3962
  TextareaWrapper,
3956
3963
  __spreadValues({
3957
3964
  disabled: isDisabled,
@@ -3961,9 +3968,10 @@ var Textarea = React28.forwardRef(
3961
3968
  rows,
3962
3969
  value,
3963
3970
  size,
3964
- resize
3971
+ resize,
3972
+ error
3965
3973
  }, props)
3966
- );
3974
+ ), error ? /* @__PURE__ */ React28.createElement(React28.Fragment, null, /* @__PURE__ */ React28.createElement(spacer_default, { bottom: "xmsall" }), /* @__PURE__ */ React28.createElement(text_default, { color: "danger", fontWeight: "book", size: "body-md" }, error)) : null);
3967
3975
  }
3968
3976
  );
3969
3977
  var textarea_default = Textarea;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loomhq/lens",
3
- "version": "11.19.0",
3
+ "version": "11.20.0",
4
4
  "packageManager": "pnpm@8.9.2",
5
5
  "scripts": {
6
6
  "preinstall": "npx only-allow pnpm",