@julseb-lib/react 0.0.8 → 0.0.9

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.
@@ -84,6 +84,12 @@ export function InputValidationHelper({
84
84
  <HelperBottom
85
85
  data-testid={testid && `${testid}.ValidationHelper.Text`}
86
86
  className={className && "ValidationTextBottom"}
87
+ $hasIcon
88
+ $iconSize={
89
+ (status === false
90
+ ? iconNotPassedSize
91
+ : iconPassedSize) as number
92
+ }
87
93
  >
88
94
  {message}
89
95
  </HelperBottom>
@@ -119,6 +119,7 @@ export const InputContainer = forwardRef<HTMLDivElement, ILibInputContainer>(
119
119
  ? helperBottom.fontStyle
120
120
  : undefined
121
121
  }
122
+ $hasIcon={false}
122
123
  >
123
124
  {typeof helperBottom === "string"
124
125
  ? helperBottom
@@ -137,6 +138,10 @@ export const InputContainer = forwardRef<HTMLDivElement, ILibInputContainer>(
137
138
  `${testid}.HelperBottom.IconContainer`
138
139
  }
139
140
  className={className && "BottomIconContainer"}
141
+ $iconSize={
142
+ (helperBottom.iconSize ||
143
+ getIconSizeFromFont("small")) as number
144
+ }
140
145
  >
141
146
  <LibIcon
142
147
  data-testid={
@@ -169,6 +174,11 @@ export const InputContainer = forwardRef<HTMLDivElement, ILibInputContainer>(
169
174
  ? helperBottom.fontStyle
170
175
  : undefined
171
176
  }
177
+ $hasIcon
178
+ $iconSize={
179
+ (helperBottom.iconSize ||
180
+ getIconSizeFromFont("small")) as number
181
+ }
172
182
  >
173
183
  {helperBottom.text}
174
184
  </HelperBottom>
@@ -10,6 +10,7 @@ import {
10
10
  FONT_SIZES,
11
11
  FONT_WEIGHTS,
12
12
  LINE_HEIGHTS,
13
+ SPACERS,
13
14
  } from "../../"
14
15
  import type { CssFontStyle } from "../../types"
15
16
 
@@ -59,8 +60,14 @@ const HelperBottomIconContainer = styled.span<{ $iconSize: number }>`
59
60
 
60
61
  const HelperBottom = styled(Text).attrs({ tag: "small" })<{
61
62
  $fontStyle?: CssFontStyle
63
+ $hasIcon?: boolean
64
+ $iconSize?: number
62
65
  }>`
63
66
  font-style: ${({ $fontStyle }) => $fontStyle};
67
+ width: ${({ $hasIcon, $iconSize }) =>
68
+ $hasIcon &&
69
+ $iconSize &&
70
+ `calc(100% - ${stringifyPx($iconSize)} - ${SPACERS.XXS})`};
64
71
  ` as FC<any>
65
72
 
66
73
  setDefaultTheme([
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@julseb-lib/react",
3
- "version": "0.0.8",
3
+ "version": "0.0.9",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "scripts": {