jfs-components 0.0.55 → 0.0.56

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.
Files changed (48) hide show
  1. package/lib/commonjs/components/Accordion/Accordion.js +2 -34
  2. package/lib/commonjs/components/AppBar/AppBar.js +4 -36
  3. package/lib/commonjs/components/FilterBar/FilterBar.js +2 -34
  4. package/lib/commonjs/components/LazyList/LazyList.js +2 -34
  5. package/lib/commonjs/components/MoneyValue/MoneyValue.js +1 -1
  6. package/lib/commonjs/components/NavArrow/NavArrow.js +45 -44
  7. package/lib/commonjs/components/Numpad/Numpad.js +6 -5
  8. package/lib/commonjs/components/Section/Section.js +7 -8
  9. package/lib/commonjs/components/TextInput/TextInput.js +4 -38
  10. package/lib/commonjs/components/TransactionBubble/TransactionBubble.js +145 -0
  11. package/lib/commonjs/components/index.js +7 -0
  12. package/lib/commonjs/design-tokens/JFSThemeProvider.js +38 -3
  13. package/lib/commonjs/icons/registry.js +1 -1
  14. package/lib/commonjs/utils/react-utils.js +18 -13
  15. package/lib/module/components/Accordion/Accordion.js +1 -33
  16. package/lib/module/components/AppBar/AppBar.js +1 -34
  17. package/lib/module/components/FilterBar/FilterBar.js +1 -35
  18. package/lib/module/components/LazyList/LazyList.js +1 -35
  19. package/lib/module/components/MoneyValue/MoneyValue.js +1 -1
  20. package/lib/module/components/NavArrow/NavArrow.js +44 -44
  21. package/lib/module/components/Numpad/Numpad.js +5 -5
  22. package/lib/module/components/Section/Section.js +8 -9
  23. package/lib/module/components/TextInput/TextInput.js +2 -36
  24. package/lib/module/components/TransactionBubble/TransactionBubble.js +140 -0
  25. package/lib/module/components/index.js +1 -0
  26. package/lib/module/design-tokens/JFSThemeProvider.js +35 -3
  27. package/lib/module/icons/registry.js +1 -1
  28. package/lib/module/utils/react-utils.js +18 -13
  29. package/lib/typescript/src/components/NavArrow/NavArrow.d.ts +6 -11
  30. package/lib/typescript/src/components/TransactionBubble/TransactionBubble.d.ts +36 -0
  31. package/lib/typescript/src/components/index.d.ts +1 -0
  32. package/lib/typescript/src/design-tokens/JFSThemeProvider.d.ts +15 -0
  33. package/lib/typescript/src/icons/registry.d.ts +1 -1
  34. package/package.json +1 -1
  35. package/src/components/Accordion/Accordion.tsx +1 -44
  36. package/src/components/AppBar/AppBar.tsx +1 -44
  37. package/src/components/FilterBar/FilterBar.tsx +1 -44
  38. package/src/components/LazyList/LazyList.tsx +1 -41
  39. package/src/components/MoneyValue/MoneyValue.tsx +1 -1
  40. package/src/components/NavArrow/NavArrow.tsx +46 -43
  41. package/src/components/Numpad/Numpad.tsx +5 -5
  42. package/src/components/Section/Section.tsx +8 -8
  43. package/src/components/TextInput/TextInput.tsx +1 -44
  44. package/src/components/TransactionBubble/TransactionBubble.tsx +152 -0
  45. package/src/components/index.ts +1 -0
  46. package/src/design-tokens/JFSThemeProvider.tsx +37 -2
  47. package/src/icons/registry.ts +1 -1
  48. package/src/utils/react-utils.ts +29 -21
@@ -447,6 +447,12 @@ Object.defineProperty(exports, "Tooltip", {
447
447
  return _Tooltip.Tooltip;
448
448
  }
449
449
  });
450
+ Object.defineProperty(exports, "TransactionBubble", {
451
+ enumerable: true,
452
+ get: function () {
453
+ return _TransactionBubble.default;
454
+ }
455
+ });
450
456
  Object.defineProperty(exports, "TransactionDetails", {
451
457
  enumerable: true,
452
458
  get: function () {
@@ -548,6 +554,7 @@ var _ThreadHero = _interopRequireDefault(require("./ThreadHero/ThreadHero"));
548
554
  var _Tooltip = require("./Tooltip/Tooltip");
549
555
  var _TransactionDetails = _interopRequireDefault(require("./TransactionDetails/TransactionDetails"));
550
556
  var _TransactionStatus = _interopRequireDefault(require("./TransactionStatus/TransactionStatus"));
557
+ var _TransactionBubble = _interopRequireDefault(require("./TransactionBubble/TransactionBubble"));
551
558
  var _UpiHandle = _interopRequireDefault(require("./UpiHandle/UpiHandle"));
552
559
  var _VStack = _interopRequireDefault(require("./VStack/VStack"));
553
560
  var _ChipGroup = _interopRequireDefault(require("./ChipGroup/ChipGroup"));
@@ -3,9 +3,12 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.useTokens = exports.JFSThemeProvider = void 0;
6
+ exports.getJFSFonts = exports.JFSThemeProvider = void 0;
7
+ exports.useJFSFonts = useJFSFonts;
8
+ exports.useTokens = void 0;
7
9
  var _react = _interopRequireWildcard(require("react"));
8
10
  var _figmaVariablesResolver = require("./figma-variables-resolver");
11
+ var Font = _interopRequireWildcard(require("expo-font"));
9
12
  var _jsxRuntime = require("react/jsx-runtime");
10
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); }
11
14
  /**
@@ -27,7 +30,6 @@ const JFSThemeProvider = ({
27
30
  children
28
31
  }) => {
29
32
  const value = (0, _react.useMemo)(() => {
30
- // We bind the current modes to getVariableByName so consumers don't have to pass it
31
33
  const getVariable = name => (0, _figmaVariablesResolver.getVariableByName)(name, modes);
32
34
  return {
33
35
  modes,
@@ -60,4 +62,37 @@ const useTokens = () => {
60
62
  }
61
63
  return context;
62
64
  };
63
- exports.useTokens = useTokens;
65
+
66
+ /**
67
+ * Returns the JFS font map. The TTF is encapsulated within the package at
68
+ * src/assets/fonts/JioType Var.ttf (included via package.json "files").
69
+ * Call this inside load functions to avoid top-level require errors if font missing.
70
+ */
71
+ exports.useTokens = useTokens;
72
+ const getJFSFonts = () => ({
73
+ 'JioType Var': require('../assets/fonts/JioType Var.ttf')
74
+ });
75
+
76
+ /**
77
+ * Hook for loading JFS fonts using expo-font. This improves Android font support by explicitly registering
78
+ * the custom 'JioType Var' font (encapsulated in the package) via Font.loadAsync before components render.
79
+ * Without it, Android defaults to Roboto. Call at app root (e.g. before JFSThemeProvider). Returns loaded state.
80
+ * See getJFSFonts() for direct use with Font.loadAsync. Handles missing font gracefully for web/Storybook.
81
+ */
82
+ exports.getJFSFonts = getJFSFonts;
83
+ function useJFSFonts() {
84
+ const [fontsLoaded, setFontsLoaded] = (0, _react.useState)(false);
85
+ (0, _react.useEffect)(() => {
86
+ async function loadJFSFonts() {
87
+ try {
88
+ await Font.loadAsync(getJFSFonts());
89
+ setFontsLoaded(true);
90
+ } catch (error) {
91
+ console.warn('Failed to load JFS fonts (this is common in web/Storybook or if font file missing):', error);
92
+ setFontsLoaded(true);
93
+ }
94
+ }
95
+ loadJFSFonts();
96
+ }, []);
97
+ return fontsLoaded;
98
+ }