@loomhq/lens 11.0.2 → 11.0.3

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.
@@ -23,5 +23,6 @@ type InputFieldProps = {
23
23
  icon?: React.ReactNode;
24
24
  hasError?: boolean;
25
25
  inputSize?: 'small' | 'medium' | 'large';
26
+ addOn?: React.ReactNode;
26
27
  };
27
28
  export default TextInput;
package/dist/index.js CHANGED
@@ -1879,6 +1879,7 @@ var sizesStyles2 = {
1879
1879
  iconSize: 2,
1880
1880
  padding: u(1.75),
1881
1881
  withIconPadding: u(4.5),
1882
+ passwordAdditionalPadding: u(0.5),
1882
1883
  textSize: "small"
1883
1884
  },
1884
1885
  medium: {
@@ -1887,6 +1888,7 @@ var sizesStyles2 = {
1887
1888
  iconSize: 3,
1888
1889
  padding: "var(--lns-formFieldHorizontalPadding)",
1889
1890
  withIconPadding: u(5.5),
1891
+ passwordAdditionalPadding: u(0.5),
1890
1892
  textSize: "medium"
1891
1893
  },
1892
1894
  large: {
@@ -1895,9 +1897,17 @@ var sizesStyles2 = {
1895
1897
  iconSize: 3,
1896
1898
  padding: "var(--lns-formFieldHorizontalPadding)",
1897
1899
  withIconPadding: u(5.5),
1900
+ passwordAdditionalPadding: u(0.5),
1898
1901
  textSize: "large"
1899
1902
  }
1900
1903
  };
1904
+ var inputRightPadding = (props) => {
1905
+ let padding = props.addOn ? sizesStyles2[props.inputSize].withIconPadding : sizesStyles2[props.inputSize].padding;
1906
+ if (props.type === "password") {
1907
+ padding = `calc(${sizesStyles2[props.inputSize].passwordAdditionalPadding} + ${padding})`;
1908
+ }
1909
+ return padding;
1910
+ };
1901
1911
  var InputField = styled7.input`
1902
1912
  -webkit-appearance: none;
1903
1913
  font-family: inherit;
@@ -1910,7 +1920,7 @@ var InputField = styled7.input`
1910
1920
  padding-top: 0;
1911
1921
  padding-bottom: 0;
1912
1922
  padding-left: ${(props) => props.icon ? sizesStyles2[props.inputSize].withIconPadding : sizesStyles2[props.inputSize].padding};
1913
- padding-right: ${(props) => props.icon ? sizesStyles2[props.inputSize].withIconPadding : sizesStyles2[props.inputSize].padding};
1923
+ padding-right: ${(props) => inputRightPadding(props)};
1914
1924
  border-radius: var(--lns-radius-full);
1915
1925
  box-shadow: inset 0 0 0
1916
1926
  ${(props) => props.hasError ? "var(--lns-formFieldBorderWidthFocus) var(--lns-color-danger)" : "var(--lns-formFieldBorderWidth) var(--lns-color-formFieldBorder)"};
@@ -2014,7 +2024,8 @@ var TextInput = forwardRef(
2014
2024
  ref,
2015
2025
  value,
2016
2026
  hasError,
2017
- inputSize: size
2027
+ inputSize: size,
2028
+ addOn
2018
2029
  }, props)
2019
2030
  );
2020
2031
  return icon || addOn ? /* @__PURE__ */ React9.createElement(InputFieldWrapper, null, icon && /* @__PURE__ */ React9.createElement(IconSection2, { size }, /* @__PURE__ */ React9.createElement(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loomhq/lens",
3
- "version": "11.0.2",
3
+ "version": "11.0.3",
4
4
  "engines": {
5
5
  "pnpm": "^8.9.2"
6
6
  },