jfs-components 0.1.17 → 0.1.18

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,15 @@ 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.18] - 2026-06-29
8
+
9
+ - **Fix:** Remove `@react-native-masked-view/masked-view` — fixes `Element type is invalid` crash on New Architecture (`ProductMerchandisingCard` image cards, `AvatarGroup`, `GlassFill` progressive blur). All masking now uses `react-native-svg` (no new peer deps; consumers can drop `masked-view` if added as a workaround).
10
+ - `ProductMerchandisingCard` — footer image blur via SVG `FeGaussianBlur` + gradient mask (cross-platform, no per-platform `blurRadius` tuning).
11
+ - `AvatarGroup` — overlap cutout via SVG `Mask` + `ForeignObject`.
12
+ - `GlassFill` — progressive blur via stacked `BlurView` bands; no-native-blur fallback uses SVG gradient scrim.
13
+
14
+ ---
15
+
7
16
  ## [0.1.16] - 2026-06-26
8
17
 
9
18
  - Added `CarouselCardAccounts` — horizontally scrollable account-card strip built on `Carousel` with token-driven gap and snap-aligned card slots.
@@ -4,21 +4,23 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
- var _react = _interopRequireDefault(require("react"));
7
+ var _react = _interopRequireWildcard(require("react"));
8
8
  var _reactNative = require("react-native");
9
- var _maskedView = _interopRequireDefault(require("@react-native-masked-view/masked-view"));
10
9
  var _reactNativeSvg = _interopRequireWildcard(require("react-native-svg"));
11
10
  var _figmaVariablesResolver = require("../../design-tokens/figma-variables-resolver");
12
11
  var _reactUtils = require("../../utils/react-utils");
13
12
  var _jsxRuntime = require("react/jsx-runtime");
14
13
  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); }
15
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
16
14
  function AvatarGroup({
17
15
  modes = _reactUtils.EMPTY_MODES,
18
16
  children,
19
17
  style,
20
18
  ...rest
21
19
  }) {
20
+ // Stable, collision-free base for the per-avatar SVG mask ids so multiple
21
+ // groups on one screen (and multiple avatars in a group) never clash.
22
+ const rawId = (0, _react.useId)();
23
+ const maskBaseId = `avatargroup-mask-${rawId.replace(/[^a-zA-Z0-9_-]/g, '')}`;
22
24
  const gap = (0, _figmaVariablesResolver.getVariableByName)('avatarGroup/gap', modes);
23
25
  const avatarSize = (0, _figmaVariablesResolver.getVariableByName)('avatar/size', modes);
24
26
  const avatarRadius = (0, _figmaVariablesResolver.getVariableByName)('avatar/radius', modes);
@@ -47,7 +49,11 @@ function AvatarGroup({
47
49
  y: r
48
50
  };
49
51
 
50
- // Native Mask Path
52
+ // Native mask path: the full avatar square MINUS a circular hole where the
53
+ // next (overlapping) avatar sits. Drawn as a single `evenodd` path so the
54
+ // hole is cut out of the square. Filled WHITE because react-native-svg's
55
+ // `<Mask>` is a *luminance* mask (white = visible, black/absent = hidden) —
56
+ // the inverse of the old `@react-native-masked-view` alpha convention.
51
57
  const rectPath = `M 0 0 h ${avatarSizeInt} v ${avatarSizeInt} h -${avatarSizeInt} z`;
52
58
  const circlePath = `M ${holeCenter.x},${holeCenter.y} m -${holeRadius},0 a ${holeRadius},${holeRadius} 0 1,0 ${holeRadius * 2},0 a ${holeRadius},${holeRadius} 0 1,0 -${holeRadius * 2},0`;
53
59
  const maskPath = `${rectPath} ${circlePath}`;
@@ -105,25 +111,40 @@ function AvatarGroup({
105
111
  }, index);
106
112
  }
107
113
 
108
- // Native MaskedView
114
+ // Native: mask the avatar with react-native-svg instead of the
115
+ // unmaintained `@react-native-masked-view/masked-view`, whose
116
+ // legacy `requireNativeComponent('RNCMaskedView')` resolves to a
117
+ // plain object (crashing "Element type is invalid") under the New
118
+ // Architecture interop. react-native-svg ships a Fabric/codegen
119
+ // `<Mask>` + `<ForeignObject>` that resolves on both architectures;
120
+ // the avatar is hosted inside the `<ForeignObject>` and revealed
121
+ // through the luminance mask.
122
+ const maskId = `${maskBaseId}-${index}`;
109
123
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
110
124
  style: wrapperStyle,
111
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_maskedView.default, {
112
- style: {
113
- flex: 1,
114
- height: '100%'
115
- },
116
- maskElement: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.default, {
117
- height: "100%",
118
- width: "100%",
119
- viewBox: `0 0 ${avatarSizeInt} ${avatarSizeInt}`,
120
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Path, {
121
- d: maskPath,
122
- fill: "black",
123
- fillRule: "evenodd"
125
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNativeSvg.default, {
126
+ height: "100%",
127
+ width: "100%",
128
+ viewBox: `0 0 ${avatarSizeInt} ${avatarSizeInt}`,
129
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Defs, {
130
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Mask, {
131
+ id: maskId,
132
+ maskUnits: "userSpaceOnUse",
133
+ maskContentUnits: "userSpaceOnUse",
134
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Path, {
135
+ d: maskPath,
136
+ fill: "white",
137
+ fillRule: "evenodd"
138
+ })
124
139
  })
125
- }),
126
- children: clonedChild
140
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.ForeignObject, {
141
+ x: "0",
142
+ y: "0",
143
+ width: avatarSizeInt,
144
+ height: avatarSizeInt,
145
+ mask: `url(#${maskId})`,
146
+ children: clonedChild
147
+ })]
127
148
  })
128
149
  }, index);
129
150
  })
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.default = void 0;
7
7
  var _react = _interopRequireWildcard(require("react"));
8
8
  var _reactNative = require("react-native");
9
- var _maskedView = _interopRequireDefault(require("@react-native-masked-view/masked-view"));
10
9
  var _reactNativeSvg = _interopRequireWildcard(require("react-native-svg"));
11
10
  var _figmaVariablesResolver = require("../../design-tokens/figma-variables-resolver");
12
11
  var _reactUtils = require("../../utils/react-utils");
@@ -71,7 +70,9 @@ function ProductMerchandisingCard({
71
70
  const rawId = (0, _react.useId)();
72
71
  const safeId = rawId.replace(/[^a-zA-Z0-9_-]/g, '');
73
72
  const scrimId = `pmc-footer-scrim-${safeId}`;
73
+ const blurGradientId = `pmc-footer-blurgrad-${safeId}`;
74
74
  const blurMaskId = `pmc-footer-blurmask-${safeId}`;
75
+ const blurFilterId = `pmc-footer-blurfilter-${safeId}`;
75
76
  const normalizedImageSource = (0, _react.useMemo)(() => normalizeImageSource(imageSource), [imageSource]);
76
77
  const tokens = (0, _react.useMemo)(() => resolveTokens(modes), [modes]);
77
78
  const containerStyle = {
@@ -165,57 +166,63 @@ function ProductMerchandisingCard({
165
166
  children: [normalizedImageSource != null ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
166
167
  style: _reactNative.StyleSheet.absoluteFill,
167
168
  pointerEvents: "none",
168
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_maskedView.default, {
169
- style: _reactNative.StyleSheet.absoluteFill,
170
- maskElement: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNativeSvg.default, {
171
- width: "100%",
172
- height: "100%",
173
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Defs, {
174
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNativeSvg.LinearGradient, {
175
- id: blurMaskId,
176
- x1: "0",
177
- y1: "0",
178
- x2: "0",
179
- y2: "1",
180
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Stop, {
181
- offset: "0",
182
- stopColor: "#000000",
183
- stopOpacity: 0
184
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Stop, {
185
- offset: "0.35",
186
- stopColor: "#000000",
187
- stopOpacity: 0.5
188
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Stop, {
189
- offset: "0.7",
190
- stopColor: "#000000",
191
- stopOpacity: 0.92
192
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Stop, {
193
- offset: "1",
194
- stopColor: "#000000",
195
- stopOpacity: 1
196
- })]
169
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNativeSvg.default, {
170
+ width: "100%",
171
+ height: "100%",
172
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNativeSvg.Defs, {
173
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Filter, {
174
+ id: blurFilterId,
175
+ x: "-15%",
176
+ y: "-15%",
177
+ width: "130%",
178
+ height: "130%",
179
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.FeGaussianBlur, {
180
+ stdDeviation: tokens.imageBlurStdDeviation,
181
+ edgeMode: "duplicate"
182
+ })
183
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNativeSvg.LinearGradient, {
184
+ id: blurGradientId,
185
+ x1: "0",
186
+ y1: "0",
187
+ x2: "0",
188
+ y2: "1",
189
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Stop, {
190
+ offset: "0",
191
+ stopColor: "#ffffff",
192
+ stopOpacity: 0
193
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Stop, {
194
+ offset: "0.35",
195
+ stopColor: "#ffffff",
196
+ stopOpacity: 0.5
197
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Stop, {
198
+ offset: "0.7",
199
+ stopColor: "#ffffff",
200
+ stopOpacity: 0.92
201
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Stop, {
202
+ offset: "1",
203
+ stopColor: "#ffffff",
204
+ stopOpacity: 1
205
+ })]
206
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Mask, {
207
+ id: blurMaskId,
208
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Rect, {
209
+ x: "0",
210
+ y: "0",
211
+ width: "100%",
212
+ height: "100%",
213
+ fill: `url(#${blurGradientId})`
197
214
  })
198
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Rect, {
199
- x: "0",
200
- y: "0",
201
- width: "100%",
202
- height: "100%",
203
- fill: `url(#${blurMaskId})`
204
215
  })]
205
- }),
206
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Image, {
207
- source: normalizedImageSource,
208
- blurRadius: tokens.imageBlurRadius,
209
- resizeMode: "cover",
210
- style: {
211
- position: 'absolute',
212
- left: 0,
213
- right: 0,
214
- bottom: 0,
215
- width: '100%',
216
- height
217
- }
218
- })
216
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Image, {
217
+ href: normalizedImageSource,
218
+ x: "0",
219
+ y: "0",
220
+ width: "100%",
221
+ height: "100%",
222
+ preserveAspectRatio: "xMidYMid slice",
223
+ filter: `url(#${blurFilterId})`,
224
+ mask: `url(#${blurMaskId})`
225
+ })]
219
226
  })
220
227
  }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_GlassFill.default, {
221
228
  tint: "dark",
@@ -334,19 +341,16 @@ function resolveTokens(modes) {
334
341
  const sbFamily = asStr((0, _figmaVariablesResolver.getVariableByName)('productMerchandisingcard/specialbadge/text/fontfamily', modes), 'JioType Var');
335
342
  const sbWeight = asStr((0, _figmaVariablesResolver.getVariableByName)('productMerchandisingcard/specialbadge/text/fontweight', modes), '500');
336
343
 
337
- // `Image.blurRadius` is interpreted differently per platform — iOS applies a
338
- // strong Gaussian while Android's IterativeBoxBlur is gentler at the same
339
- // numeric radius so we tune each platform to land on the same perceived
340
- // "minimal" frosted strength as the Figma design.
341
- const imageBlurRadius = _reactNative.Platform.select({
342
- ios: Math.max(6, Math.round(blurRadius * 0.5)),
343
- android: Math.max(12, Math.round(blurRadius * 0.95)),
344
- default: Math.max(8, Math.round(blurRadius * 0.6))
345
- });
344
+ // SVG `<FeGaussianBlur stdDeviation>` is resolution-independent and renders
345
+ // an identical Gaussian on iOS, Android and web so unlike the old
346
+ // `Image.blurRadius` path it needs no per-platform tuning. `stdDeviation` is
347
+ // roughly half a perceptual "blur radius", so we scale the `blur/minimal`
348
+ // token down to land on the same subtle frosted strength as the design.
349
+ const imageBlurStdDeviation = Math.max(4, Math.round(blurRadius * 0.35));
346
350
  return {
347
351
  radius,
348
352
  blurIntensity: Math.max(0, Math.min(100, Math.round(blurRadius * BLUR_INTENSITY_FACTOR))),
349
- imageBlurRadius,
353
+ imageBlurStdDeviation,
350
354
  header: {
351
355
  flexDirection: 'row',
352
356
  alignItems: 'flex-start',