jfs-components 0.1.57 → 0.1.58

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.
@@ -143,6 +143,14 @@ const TextInputBase = /*#__PURE__*/forwardRef(function TextInput({
143
143
 
144
144
  // Convert radius to React Native format (if 99999, use a large value for fully rounded)
145
145
  const borderRadius = radius === 99999 ? 99999 : radius;
146
+
147
+ // Row height from tokens: vertical padding above/below the text line.
148
+ // Applied as container `minHeight` (FormField pattern) — NOT as TextInput
149
+ // `lineHeight` / `minHeight`, which breaks iOS vertical centering.
150
+ const padV = typeof paddingVertical === 'number' ? paddingVertical : 0;
151
+ const textLine = typeof lineHeight === 'number' ? lineHeight : 0;
152
+ const iconH = typeof iconSize === 'number' ? iconSize : 0;
153
+ const rowMinHeight = padV * 2 + Math.max(textLine, iconH);
146
154
  const containerStyle = {
147
155
  flexDirection: 'row',
148
156
  alignItems: 'center',
@@ -152,7 +160,10 @@ const TextInputBase = /*#__PURE__*/forwardRef(function TextInput({
152
160
  borderStyle: 'solid',
153
161
  borderRadius,
154
162
  paddingHorizontal,
155
- paddingVertical,
163
+ // Same as FormField / SuggestiveSearch: the ROW owns height via minHeight;
164
+ // paddingVertical on the row would fight that and let the field stretch.
165
+ paddingVertical: 0,
166
+ minHeight: rowMinHeight > 0 ? rowMinHeight : undefined,
156
167
  gap: 8
157
168
  };
158
169
  const hoverStyle = isHovered ? {
@@ -163,18 +174,15 @@ const TextInputBase = /*#__PURE__*/forwardRef(function TextInput({
163
174
  borderWidth: 1
164
175
  } : {};
165
176
 
166
- // ⚠️ DO NOT change to an unconditional `lineHeight`, and do NOT put
167
- // `minHeight: lineHeight` on this single-line input on iOS. Same contract as
168
- // FormField / SuggestiveSearch — read before "simplifying".
177
+ // ⚠️ Same contract as FormField / SuggestiveSearch do not "simplify".
169
178
  //
170
- // facebook/react-native#39145 / #28012: on iOS, a single-line RN TextInput
171
- // (UITextField) with `lineHeight` > font metrics puts ALL the extra space
172
- // ABOVE the glyphs, so placeholder/value sink. Android/Web distribute evenly.
173
- // RN's documented workaround (#39145) and #56774: omit `lineHeight` on
174
- // single-line iOS inputs UITextField centers natively — and let the
175
- // wrapper (`alignItems: 'center'` + padding/icon) own vertical layout.
176
- // Pinning `lineHeight` to `fontSize` is NOT a substitute; it clips custom
177
- // font metrics and floats typed text above center.
179
+ // facebook/react-native#39145 / #28012 / #56774:
180
+ // Single-line iOS UITextField + `lineHeight` (or a tall field box) puts ALL
181
+ // extra space ABOVE the glyphs placeholder/value sink. Documented fix:
182
+ // omit `lineHeight` on the single-line input; let the wrapper
183
+ // (`alignItems: 'center'` + `minHeight`) center it. UITextField centers
184
+ // natively when it is only as tall as its font. Do NOT pin lineHeight to
185
+ // fontSize (clips custom fonts / floats typed text).
178
186
  const textInputStyle = {
179
187
  flex: 1,
180
188
  color: textColor,