jfs-components 0.1.57 → 0.1.59

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.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,14 @@ All notable changes to this project are documented in this file.
4
4
 
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
6
6
 
7
+ ## [0.1.59] - 2026-07-28
8
+
9
+ - `CardFinancialCondition` — ship Figma source defaults for `AppearanceBrand: Neutral`, `Context: Nudge&Alert`, and `Nudge padding: None` (merge order: component defaults → global theme → caller `modes`). Stories aligned to the same defaults.
10
+
11
+ ## [0.1.58] - 2026-07-27
12
+
13
+ - `TextInput` / `InputSearch` — restore iOS single-line vertical centering (FormField pattern): row owns height via `minHeight` + `paddingVertical: 0`; omit `lineHeight` on the field on iOS so placeholder and typed text stay centered (RN #39145 / #56774).
14
+
7
15
  ## [0.1.57] - 2026-07-27
8
16
 
9
17
  - `Carousel` — fix infinite-tall slides: equal-height no longer uses unbounded `alignItems:'stretch'` / `height:'100%'` in a horizontal ScrollView; it measures intrinsic slide heights then locks slots to the tallest.
@@ -16,6 +16,14 @@ var _Nudge = _interopRequireDefault(require("../Nudge/Nudge"));
16
16
  var _jsxRuntime = require("react/jsx-runtime");
17
17
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
18
18
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
19
+ // Match the Figma source defaults: Neutral brand, Nudge&Alert context, and
20
+ // no nudge padding. Caller / global modes merge on top so any key can still
21
+ // be overridden per-instance.
22
+ const COMPONENT_DEFAULT_MODES = Object.freeze({
23
+ AppearanceBrand: 'Neutral',
24
+ Context: 'Nudge&Alert',
25
+ 'Nudge padding': 'None'
26
+ });
19
27
  const toNumber = (value, fallback) => {
20
28
  if (typeof value === 'number') {
21
29
  return Number.isFinite(value) ? value : fallback;
@@ -134,7 +142,9 @@ function CardFinancialCondition({
134
142
  const {
135
143
  modes: globalModes
136
144
  } = (0, _JFSThemeProvider.useTokens)();
137
- const modes = (0, _react.useMemo)(() => globalModes === _reactUtils.EMPTY_MODES && propModes === _reactUtils.EMPTY_MODES ? _reactUtils.EMPTY_MODES : {
145
+ // Merge order: component defaults global theme caller props.
146
+ const modes = (0, _react.useMemo)(() => globalModes === _reactUtils.EMPTY_MODES && propModes === _reactUtils.EMPTY_MODES ? COMPONENT_DEFAULT_MODES : {
147
+ ...COMPONENT_DEFAULT_MODES,
138
148
  ...globalModes,
139
149
  ...propModes
140
150
  }, [globalModes, propModes]);
@@ -149,6 +149,14 @@ const TextInputBase = /*#__PURE__*/(0, _react.forwardRef)(function TextInput({
149
149
 
150
150
  // Convert radius to React Native format (if 99999, use a large value for fully rounded)
151
151
  const borderRadius = radius === 99999 ? 99999 : radius;
152
+
153
+ // Row height from tokens: vertical padding above/below the text line.
154
+ // Applied as container `minHeight` (FormField pattern) — NOT as TextInput
155
+ // `lineHeight` / `minHeight`, which breaks iOS vertical centering.
156
+ const padV = typeof paddingVertical === 'number' ? paddingVertical : 0;
157
+ const textLine = typeof lineHeight === 'number' ? lineHeight : 0;
158
+ const iconH = typeof iconSize === 'number' ? iconSize : 0;
159
+ const rowMinHeight = padV * 2 + Math.max(textLine, iconH);
152
160
  const containerStyle = {
153
161
  flexDirection: 'row',
154
162
  alignItems: 'center',
@@ -158,7 +166,10 @@ const TextInputBase = /*#__PURE__*/(0, _react.forwardRef)(function TextInput({
158
166
  borderStyle: 'solid',
159
167
  borderRadius,
160
168
  paddingHorizontal,
161
- paddingVertical,
169
+ // Same as FormField / SuggestiveSearch: the ROW owns height via minHeight;
170
+ // paddingVertical on the row would fight that and let the field stretch.
171
+ paddingVertical: 0,
172
+ minHeight: rowMinHeight > 0 ? rowMinHeight : undefined,
162
173
  gap: 8
163
174
  };
164
175
  const hoverStyle = isHovered ? {
@@ -169,18 +180,15 @@ const TextInputBase = /*#__PURE__*/(0, _react.forwardRef)(function TextInput({
169
180
  borderWidth: 1
170
181
  } : {};
171
182
 
172
- // ⚠️ DO NOT change to an unconditional `lineHeight`, and do NOT put
173
- // `minHeight: lineHeight` on this single-line input on iOS. Same contract as
174
- // FormField / SuggestiveSearch — read before "simplifying".
183
+ // ⚠️ Same contract as FormField / SuggestiveSearch do not "simplify".
175
184
  //
176
- // facebook/react-native#39145 / #28012: on iOS, a single-line RN TextInput
177
- // (UITextField) with `lineHeight` > font metrics puts ALL the extra space
178
- // ABOVE the glyphs, so placeholder/value sink. Android/Web distribute evenly.
179
- // RN's documented workaround (#39145) and #56774: omit `lineHeight` on
180
- // single-line iOS inputs UITextField centers natively — and let the
181
- // wrapper (`alignItems: 'center'` + padding/icon) own vertical layout.
182
- // Pinning `lineHeight` to `fontSize` is NOT a substitute; it clips custom
183
- // font metrics and floats typed text above center.
185
+ // facebook/react-native#39145 / #28012 / #56774:
186
+ // Single-line iOS UITextField + `lineHeight` (or a tall field box) puts ALL
187
+ // extra space ABOVE the glyphs placeholder/value sink. Documented fix:
188
+ // omit `lineHeight` on the single-line input; let the wrapper
189
+ // (`alignItems: 'center'` + `minHeight`) center it. UITextField centers
190
+ // natively when it is only as tall as its font. Do NOT pin lineHeight to
191
+ // fontSize (clips custom fonts / floats typed text).
184
192
  const textInputStyle = {
185
193
  flex: 1,
186
194
  color: textColor,