jfs-components 0.0.69 → 0.0.70

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,26 @@ 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.0.70] - 2026-04-23
8
+
9
+ ### Fixed
10
+
11
+ - **`MediaCard.Footer` blur on bare React Native:** `0.0.69` shipped the glass footer using `expo-blur`, which silently required consumers to integrate Expo Modules autolinking (`use_expo_modules!` in `Podfile`, `ExpoModulesPackage` on Android). Bare React Native apps that just installed the library and ran `pod install` hit two failures: a runtime "`Cannot read property 'BlurView' of undefined`" red box on Android and an iOS Xcode build failure after `pod install`. **Replaced `expo-blur` with [`@react-native-community/blur`](https://github.com/Kureev/react-native-blur)** — a regular React Native native module handled by standard autolinking. No Expo runtime required.
12
+
13
+ ### Changed
14
+
15
+ - **`MediaCard.Footer` glass implementation:** Native blur now lives in a small platform-split helper, `MediaCard/GlassFill.tsx` (iOS + Android via the community blur module) and `MediaCard/GlassFill.web.tsx` (`backdrop-filter` via inline style). Metro picks the correct file per platform, so the web bundle never imports the native-only blur module. The Footer's API and design-token contract (`blur/minimal/background`, `blur/minimal`, `Contrast Context` mode) are unchanged.
16
+
17
+ ### Removed
18
+
19
+ - **`expo-blur`** is no longer a runtime dependency.
20
+
21
+ ### Dependencies
22
+
23
+ - **`@react-native-community/blur`** (`>=4.4.0`) added as a **peer dependency**. Consumers must install it once: `npm install @react-native-community/blur && cd ios && pod install`. On Expo, use `npx expo install @react-native-community/blur` and prebuild.
24
+
25
+ ---
26
+
7
27
  ## [0.0.69] - 2026-04-22
8
28
 
9
29
  ### Changed
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _reactNative = require("react-native");
9
+ var _blur = require("@react-native-community/blur");
10
+ var _jsxRuntime = require("react/jsx-runtime");
11
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
+ const DEFAULT_FALLBACK_DARK = '#1414174a';
13
+ const DEFAULT_FALLBACK_LIGHT = '#ffffff66';
14
+
15
+ /**
16
+ * Glass / frosted surface for native (iOS + Android).
17
+ *
18
+ * Why this lives in its own platform-split file:
19
+ * - `@react-native-community/blur` is a native-only module. Importing it on
20
+ * web throws because the JS shim references native components that aren't
21
+ * registered there. By using Metro's platform-extension resolution
22
+ * (`GlassFill.tsx` for native, `GlassFill.web.tsx` for web), we keep the
23
+ * web bundle free of any native-only imports.
24
+ * - Centralizes the `intensity` (0–100) -> `blurAmount` (0–32) mapping so
25
+ * callers can keep the Figma token semantics they already know.
26
+ *
27
+ * On iOS this is a real `UIVisualEffectView` (true OS-level live blur).
28
+ * On Android this uses the community blur view (RealtimeBlurView). On devices
29
+ * where realtime blur is unavailable, `reducedTransparencyFallbackColor` (and
30
+ * the explicit `overlayColor`) ensure the surface still renders as a
31
+ * translucent tinted scrim instead of disappearing.
32
+ */
33
+ function GlassFill({
34
+ tint = 'dark',
35
+ intensity = 50,
36
+ overlayColor,
37
+ style
38
+ }) {
39
+ const blurType = tint === 'light' ? 'light' : 'dark';
40
+ const blurAmount = Math.max(0, Math.min(32, Math.round(intensity * 0.32)));
41
+ const fallbackColor = overlayColor ?? (tint === 'light' ? DEFAULT_FALLBACK_LIGHT : DEFAULT_FALLBACK_DARK);
42
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
43
+ style: [_reactNative.StyleSheet.absoluteFill, style],
44
+ pointerEvents: "none",
45
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_blur.BlurView, {
46
+ style: _reactNative.StyleSheet.absoluteFill,
47
+ blurType: blurType,
48
+ blurAmount: blurAmount,
49
+ reducedTransparencyFallbackColor: fallbackColor
50
+ }), overlayColor != null ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
51
+ style: [_reactNative.StyleSheet.absoluteFill, {
52
+ backgroundColor: overlayColor
53
+ }]
54
+ }) : null, _reactNative.Platform.OS === 'android' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
55
+ style: [_reactNative.StyleSheet.absoluteFill, {
56
+ backgroundColor: 'rgba(255,255,255,0.03)',
57
+ opacity: 0.6
58
+ }]
59
+ }) : null]
60
+ });
61
+ }
62
+ var _default = exports.default = GlassFill;
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _reactNative = require("react-native");
9
+ var _jsxRuntime = require("react/jsx-runtime");
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
+ const DEFAULT_FALLBACK_DARK = '#1414174a';
12
+ const DEFAULT_FALLBACK_LIGHT = '#ffffff66';
13
+
14
+ /**
15
+ * Web counterpart of `GlassFill`.
16
+ *
17
+ * `@react-native-community/blur` does not ship a web implementation, so for
18
+ * the web bundle we render a translucent `View` with `backdrop-filter: blur()`
19
+ * — which is exactly how 0.0.67 and earlier shipped the glass effect on web.
20
+ * Native bundles pick up `GlassFill.tsx` instead via Metro's platform
21
+ * resolver; the web bundle picks up this file.
22
+ */
23
+ function GlassFill({
24
+ tint = 'dark',
25
+ intensity = 50,
26
+ overlayColor,
27
+ style
28
+ }) {
29
+ // Approximate mapping: intensity 0-100 -> ~0-30px CSS blur. Keeps parity
30
+ // with the native blur strength so the component looks roughly the same
31
+ // across platforms.
32
+ const blurPx = Math.max(0, Math.min(30, Math.round(intensity * 0.3)));
33
+ const tintColor = overlayColor ?? (tint === 'light' ? DEFAULT_FALLBACK_LIGHT : DEFAULT_FALLBACK_DARK);
34
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
35
+ style: [_reactNative.StyleSheet.absoluteFill, {
36
+ backgroundColor: tintColor
37
+ },
38
+ // backdrop-filter is a web-only CSS property; ignored by RN
39
+ // on native (we never bundle this file there anyway).
40
+ // @ts-ignore web-only style
41
+ {
42
+ backdropFilter: `blur(${blurPx}px)`,
43
+ WebkitBackdropFilter: `blur(${blurPx}px)`
44
+ }, style],
45
+ pointerEvents: "none"
46
+ });
47
+ }
48
+ var _default = exports.default = GlassFill;
@@ -12,9 +12,9 @@ exports.Title = Title;
12
12
  exports.default = void 0;
13
13
  var _react = _interopRequireWildcard(require("react"));
14
14
  var _reactNative = require("react-native");
15
- var _expoBlur = require("expo-blur");
16
15
  var _figmaVariablesResolver = require("../../design-tokens/figma-variables-resolver");
17
16
  var _Image = _interopRequireDefault(require("../Image/Image"));
17
+ var _GlassFill = _interopRequireDefault(require("./GlassFill"));
18
18
  var _reactUtils = require("../../utils/react-utils");
19
19
  var _jsxRuntime = require("react/jsx-runtime");
20
20
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
@@ -136,20 +136,24 @@ function Title({
136
136
  * Glass Footer — pinned to the bottom of the card, **always** on top of the
137
137
  * Header (`zIndex: 2`).
138
138
  *
139
- * Glass implementation (April 2026 best practice for RN/Expo):
140
- * - **iOS:** `expo-blur`'s `BlurView` renders a native `UIVisualEffectView`,
141
- * so this is a real OS-level live blur of whatever's underneath. We pick
142
- * `tint` from the Figma "Contrast Context" mode (`'dark'` / `'light'`)
143
- * and a moderate intensity that matches the Figma `blur/minimal` token.
144
- * - **Android:** the same `BlurView` with `experimentalBlurMethod="dimezisBlurView"`
145
- * enables the hardware-accelerated `RenderEffect` blur on Android 12+.
146
- * On older Android, expo-blur cleanly degrades to a tinted scrim — we
147
- * layer a subtle noise/grain overlay on top so the surface still reads
148
- * as "frosted glass" instead of a flat color.
149
- * - **Web:** `BlurView` on web is implemented as `backdrop-filter: blur()`,
150
- * which already worked in the previous version. Same component, same API.
139
+ * Glass implementation:
140
+ * - **iOS / Android:** `<GlassFill>` (this folder) wraps
141
+ * `@react-native-community/blur`'s `BlurView`. iOS gets a real
142
+ * `UIVisualEffectView` (live OS blur); Android gets the community
143
+ * `RealtimeBlurView` with a token-driven tinted scrim fallback for
144
+ * devices where realtime blur is unavailable.
145
+ * - **Web:** the platform-extension file `GlassFill.web.tsx` renders a
146
+ * translucent View with `backdrop-filter: blur()` Metro picks the
147
+ * correct file automatically, so the web bundle never imports the
148
+ * native-only blur module.
151
149
  *
152
- * Tokens still drive the tint color, blur radius and inner spacing.
150
+ * Why we don't use `expo-blur`: it requires Expo Modules autolinking on the
151
+ * consumer side (`use_expo_modules!` / `ExpoModulesPackage`), which silently
152
+ * breaks bare React Native apps that just install this library and run
153
+ * `pod install`. `@react-native-community/blur` is a regular RN native
154
+ * module — autolinking handles it with no additional setup.
155
+ *
156
+ * Tokens still drive the tint color, blur intensity and inner spacing.
153
157
  */
154
158
  function Footer({
155
159
  children,
@@ -163,10 +167,14 @@ function Footer({
163
167
  const paddingVertical = parseFloat((0, _figmaVariablesResolver.getVariableByName)('cardMedia/footer/padding/vertical', modes) || '12');
164
168
 
165
169
  // Figma tokens:
166
- // blur/minimal/background -> tint laid over the native blur
167
- // blur/minimal -> blur radius (px). expo-blur takes a 0-100
168
- // "intensity" instead of px; we map roughly:
169
- // intensity clamp(radius * 1.7, 0, 100).
170
+ // blur/minimal/background -> tint laid over the live blur, also used
171
+ // as the iOS reduced-transparency fallback.
172
+ // blur/minimal -> blur radius (px). The community BlurView
173
+ // uses `blurAmount` (~0-32). `GlassFill`
174
+ // accepts a 0-100 "intensity" (kept compat
175
+ // with the previous expo-blur scale) and
176
+ // maps it internally — here we convert the
177
+ // token's radius to that intensity scale.
170
178
  const glassBgColor = (0, _figmaVariablesResolver.getVariableByName)('blur/minimal/background', modes) || '#1414174a';
171
179
  const blurRadius = parseFloat((0, _figmaVariablesResolver.getVariableByName)('blur/minimal', modes) || '29');
172
180
  const intensity = Math.max(0, Math.min(100, Math.round(blurRadius * 1.7)));
@@ -187,22 +195,11 @@ function Footer({
187
195
  zIndex: 2
188
196
  }, style],
189
197
  pointerEvents: "box-none",
190
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_expoBlur.BlurView, {
191
- style: _reactNative.StyleSheet.absoluteFill,
198
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_GlassFill.default, {
192
199
  tint: tint,
193
200
  intensity: intensity,
194
- experimentalBlurMethod: "dimezisBlurView"
201
+ overlayColor: glassBgColor
195
202
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
196
- style: [_reactNative.StyleSheet.absoluteFill, {
197
- backgroundColor: glassBgColor
198
- }]
199
- }), _reactNative.Platform.OS === 'android' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
200
- style: [_reactNative.StyleSheet.absoluteFill, {
201
- backgroundColor: 'rgba(255,255,255,0.03)',
202
- opacity: 0.6
203
- }],
204
- pointerEvents: "none"
205
- }) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
206
203
  style: {
207
204
  flexDirection: 'row',
208
205
  alignItems: 'center',