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 +9 -0
- package/lib/commonjs/components/AvatarGroup/AvatarGroup.js +41 -20
- package/lib/commonjs/components/ProductMerchandisingCard/ProductMerchandisingCard.js +64 -60
- package/lib/commonjs/icons/registry.js +1 -1
- package/lib/commonjs/utils/GlassFill/GlassFill.js +69 -73
- package/lib/module/components/AvatarGroup/AvatarGroup.js +43 -21
- package/lib/module/components/ProductMerchandisingCard/ProductMerchandisingCard.js +66 -62
- package/lib/module/icons/registry.js +1 -1
- package/lib/module/utils/GlassFill/GlassFill.js +69 -72
- package/lib/typescript/src/icons/registry.d.ts +1 -1
- package/lib/typescript/src/utils/GlassFill/GlassFill.d.ts +11 -4
- package/package.json +1 -2
- package/src/components/AvatarGroup/AvatarGroup.tsx +44 -18
- package/src/components/ProductMerchandisingCard/ProductMerchandisingCard.tsx +76 -47
- package/src/icons/registry.ts +1 -1
- package/src/utils/GlassFill/GlassFill.tsx +59 -56
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 =
|
|
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
|
|
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
|
|
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.
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
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
|
-
|
|
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.
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
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
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
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
|
-
//
|
|
338
|
-
//
|
|
339
|
-
//
|
|
340
|
-
// "
|
|
341
|
-
|
|
342
|
-
|
|
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
|
-
|
|
353
|
+
imageBlurStdDeviation,
|
|
350
354
|
header: {
|
|
351
355
|
flexDirection: 'row',
|
|
352
356
|
alignItems: 'flex-start',
|