jfs-components 0.0.48 → 0.0.49

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 (34) hide show
  1. package/lib/commonjs/assets/cf64a67d5075caa8924d20b4e4e650d47b3ee08b.png +0 -0
  2. package/lib/commonjs/components/CardCTA/CardCTA.js +141 -0
  3. package/lib/commonjs/components/DebitCard/DebitCard.js +166 -0
  4. package/lib/commonjs/components/DebitCard/cf64a67d5075caa8924d20b4e4e650d47b3ee08b.png +0 -0
  5. package/lib/commonjs/components/Section/Section.js +5 -8
  6. package/lib/commonjs/components/index.js +10 -3
  7. package/lib/commonjs/icons/registry.js +2 -2
  8. package/lib/module/assets/cf64a67d5075caa8924d20b4e4e650d47b3ee08b.png +0 -0
  9. package/lib/module/components/CardCTA/CardCTA.js +136 -0
  10. package/lib/module/components/DebitCard/DebitCard.js +161 -0
  11. package/lib/module/components/DebitCard/cf64a67d5075caa8924d20b4e4e650d47b3ee08b.png +0 -0
  12. package/lib/module/components/Section/Section.js +5 -8
  13. package/lib/module/components/index.js +2 -1
  14. package/lib/module/icons/registry.js +2 -2
  15. package/lib/typescript/src/components/CardCTA/CardCTA.d.ts +25 -0
  16. package/lib/typescript/src/components/DebitCard/DebitCard.d.ts +27 -0
  17. package/lib/typescript/src/components/index.d.ts +2 -1
  18. package/lib/typescript/src/icons/registry.d.ts +1 -1
  19. package/package.json +1 -1
  20. package/src/assets/cf64a67d5075caa8924d20b4e4e650d47b3ee08b.png +0 -0
  21. package/src/components/CardCTA/CardCTA.tsx +146 -0
  22. package/src/components/DebitCard/DebitCard.tsx +185 -0
  23. package/src/components/DebitCard/cf64a67d5075caa8924d20b4e4e650d47b3ee08b.png +0 -0
  24. package/src/components/Section/Section.tsx +3 -9
  25. package/src/components/index.ts +2 -1
  26. package/src/icons/registry.ts +2136 -29
  27. package/lib/commonjs/components/CtaCard/CtaCard.js +0 -116
  28. package/lib/commonjs/components/CtaCard/index.js +0 -13
  29. package/lib/module/components/CtaCard/CtaCard.js +0 -111
  30. package/lib/module/components/CtaCard/index.js +0 -3
  31. package/lib/typescript/src/components/CtaCard/CtaCard.d.ts +0 -61
  32. package/lib/typescript/src/components/CtaCard/index.d.ts +0 -2
  33. package/src/components/CtaCard/CtaCard.tsx +0 -180
  34. package/src/components/CtaCard/index.ts +0 -1
@@ -0,0 +1,141 @@
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 _figmaVariablesResolver = require("../../design-tokens/figma-variables-resolver");
10
+ var _JFSThemeProvider = require("../../design-tokens/JFSThemeProvider");
11
+ var _reactUtils = require("../../utils/react-utils");
12
+ var _IconCapsule = _interopRequireDefault(require("../IconCapsule/IconCapsule"));
13
+ var _Button = _interopRequireDefault(require("../Button/Button"));
14
+ var _jsxRuntime = require("react/jsx-runtime");
15
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
16
+ function CardCTA({
17
+ title = 'If you have 1 line',
18
+ body = 'Then you can have up to 3 lines in the subtext as well. This is for demonstration.',
19
+ iconName = 'ic_upi_number',
20
+ buttonLabel = 'Button',
21
+ onPressButton,
22
+ modes: propModes = {},
23
+ iconSlot,
24
+ buttonSlot,
25
+ style
26
+ }) {
27
+ const {
28
+ modes: globalModes
29
+ } = (0, _JFSThemeProvider.useTokens)();
30
+ const modes = {
31
+ ...globalModes,
32
+ ...propModes
33
+ };
34
+ const background = (0, _figmaVariablesResolver.getVariableByName)('cardCTA/background', modes) || '#ffffff';
35
+ const radius = (0, _figmaVariablesResolver.getVariableByName)('cardCTA/radius', modes) || 12;
36
+ const borderSize = (0, _figmaVariablesResolver.getVariableByName)('cardCTA/border/size', modes) || 1;
37
+ const borderColor = (0, _figmaVariablesResolver.getVariableByName)('cardCTA/border/color', modes) || '#e3e4e4';
38
+ const leftPaddingH = (0, _figmaVariablesResolver.getVariableByName)('cardCTA/left-wrap/padding/horizontal', modes) || 16;
39
+ const leftPaddingV = (0, _figmaVariablesResolver.getVariableByName)('cardCTA/left-wrap/padding/vertical', modes) || 22;
40
+ const leftGap = (0, _figmaVariablesResolver.getVariableByName)('cardCTA/left-wrap/gap', modes) || 16;
41
+ const rightPaddingH = (0, _figmaVariablesResolver.getVariableByName)('cardCTA/right-wrap/padding/horizontal', modes) || 16;
42
+ const rightPaddingV = (0, _figmaVariablesResolver.getVariableByName)('cardCTA/right-wrap/padding/vertical', modes) || 22;
43
+ const textGap = (0, _figmaVariablesResolver.getVariableByName)('cardCTA/text-wrap/gap', modes) || 6;
44
+ const titleColor = (0, _figmaVariablesResolver.getVariableByName)('cardCTA/title/color', modes) || '#0c0d10';
45
+ const titleFontFamily = (0, _figmaVariablesResolver.getVariableByName)('cardCTA/title/fontFamily', modes) || 'JioType Var';
46
+ const titleFontSize = (0, _figmaVariablesResolver.getVariableByName)('cardCTA/title/fontSize', modes) || 16;
47
+ const titleLineHeight = (0, _figmaVariablesResolver.getVariableByName)('cardCTA/title/lineHeight', modes) || 17.6;
48
+ const titleFontWeightRaw = (0, _figmaVariablesResolver.getVariableByName)('cardCTA/title/fontWeight', modes) || 700;
49
+ const titleFontWeight = typeof titleFontWeightRaw === 'number' ? titleFontWeightRaw.toString() : titleFontWeightRaw;
50
+ const bodyColor = (0, _figmaVariablesResolver.getVariableByName)('cardCTA/body/color', modes) || '#13002d';
51
+ const bodyFontFamily = (0, _figmaVariablesResolver.getVariableByName)('cardCTA/body/fontFamily', modes) || 'JioType Var';
52
+ const bodyFontSize = (0, _figmaVariablesResolver.getVariableByName)('cardCTA/body/fontSize', modes) || 10;
53
+ const bodyLineHeight = (0, _figmaVariablesResolver.getVariableByName)('cardCTA/body/lineHeight', modes) || 12;
54
+ const bodyFontWeightRaw = (0, _figmaVariablesResolver.getVariableByName)('cardCTA/body/fontWeight', modes) || 400;
55
+ const bodyFontWeight = typeof bodyFontWeightRaw === 'number' ? bodyFontWeightRaw.toString() : bodyFontWeightRaw;
56
+ const containerStyle = {
57
+ backgroundColor: background,
58
+ borderRadius: radius,
59
+ borderWidth: borderSize,
60
+ borderColor,
61
+ flexDirection: 'row',
62
+ overflow: 'hidden'
63
+ };
64
+ const leftWrapStyle = {
65
+ flex: 3,
66
+ paddingHorizontal: leftPaddingH,
67
+ paddingVertical: leftPaddingV,
68
+ gap: leftGap,
69
+ alignItems: 'flex-start',
70
+ justifyContent: 'center'
71
+ };
72
+ const rightWrapStyle = {
73
+ flex: 2,
74
+ paddingHorizontal: rightPaddingH,
75
+ paddingVertical: rightPaddingV,
76
+ alignItems: 'flex-end',
77
+ justifyContent: 'flex-start'
78
+ };
79
+ const textWrapStyle = {
80
+ gap: textGap
81
+ };
82
+ const titleStyle = {
83
+ color: titleColor,
84
+ fontFamily: titleFontFamily,
85
+ fontSize: titleFontSize,
86
+ lineHeight: titleLineHeight,
87
+ fontWeight: titleFontWeight
88
+ };
89
+ const bodyStyle = {
90
+ color: bodyColor,
91
+ fontFamily: bodyFontFamily,
92
+ fontSize: bodyFontSize,
93
+ lineHeight: bodyLineHeight,
94
+ fontWeight: bodyFontWeight
95
+ };
96
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
97
+ style: [containerStyle, style],
98
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
99
+ style: leftWrapStyle,
100
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
101
+ style: textWrapStyle,
102
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
103
+ style: titleStyle,
104
+ children: title
105
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
106
+ style: bodyStyle,
107
+ children: body
108
+ })]
109
+ }), buttonSlot ? (0, _reactUtils.cloneChildrenWithModes)(buttonSlot, {
110
+ ...modes,
111
+ AppearanceBrand: 'Secondary',
112
+ 'Button / Size': 'S'
113
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
114
+ label: buttonLabel,
115
+ onPress: onPressButton || (() => {}),
116
+ modes: {
117
+ ...modes,
118
+ AppearanceBrand: 'Secondary',
119
+ 'Button / Size': 'S'
120
+ }
121
+ })]
122
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
123
+ style: rightWrapStyle,
124
+ children: iconSlot ? (0, _reactUtils.cloneChildrenWithModes)(iconSlot, {
125
+ ...modes,
126
+ 'IconCapsule / Size': 'M',
127
+ Emphasis: 'Medium',
128
+ AppearanceBrand: 'Secondary'
129
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_IconCapsule.default, {
130
+ iconName: iconName,
131
+ modes: {
132
+ ...modes,
133
+ 'IconCapsule / Size': 'M',
134
+ Emphasis: 'Medium',
135
+ AppearanceBrand: 'Secondary'
136
+ }
137
+ })
138
+ })]
139
+ });
140
+ }
141
+ var _default = exports.default = CardCTA;
@@ -0,0 +1,166 @@
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 _figmaVariablesResolver = require("../../design-tokens/figma-variables-resolver");
10
+ var _JFSThemeProvider = require("../../design-tokens/JFSThemeProvider");
11
+ var _reactUtils = require("../../utils/react-utils");
12
+ var _jsxRuntime = require("react/jsx-runtime");
13
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
+ const defaultCardArt = require('./cf64a67d5075caa8924d20b4e4e650d47b3ee08b.png');
15
+ function DebitCard({
16
+ cardholderName = 'Shruti Shukla',
17
+ cardNumber = '•••• 1234',
18
+ expireDate = '02/28',
19
+ bankName = 'JioFinance',
20
+ cardType = 'Debit',
21
+ cardArtSource = defaultCardArt,
22
+ bankLogoSlot,
23
+ providerLogoSlot,
24
+ modes: propModes = {},
25
+ style
26
+ }) {
27
+ const {
28
+ modes: globalModes
29
+ } = (0, _JFSThemeProvider.useTokens)();
30
+ const modes = {
31
+ ...globalModes,
32
+ ...propModes
33
+ };
34
+ const background = (0, _figmaVariablesResolver.getVariableByName)('debitCard/background', modes) || '#cea15a';
35
+ const radius = (0, _figmaVariablesResolver.getVariableByName)('debitCard/radius', modes) || 16;
36
+ const width = (0, _figmaVariablesResolver.getVariableByName)('debitCard/width', modes) || 328;
37
+ const height = (0, _figmaVariablesResolver.getVariableByName)('debitCard/height', modes) || 224;
38
+ const paddingBottom = (0, _figmaVariablesResolver.getVariableByName)('debitCard/padding/bottom', modes) || 24;
39
+ const headerPaddingH = (0, _figmaVariablesResolver.getVariableByName)('debitCard/header/padding/horizontal', modes) || 20;
40
+ const headerPaddingTop = (0, _figmaVariablesResolver.getVariableByName)('debitCard/header/padding/top', modes) || 16;
41
+ const headerPaddingBottom = (0, _figmaVariablesResolver.getVariableByName)('debitCard/header/padding/bottom', modes) || 28;
42
+ const cardArtHeight = (0, _figmaVariablesResolver.getVariableByName)('debitCard/cardArt/height', modes) || 50;
43
+ const cardArtRadius = (0, _figmaVariablesResolver.getVariableByName)('debitCard/cardArt/radius', modes) || 4;
44
+ const footerGap = (0, _figmaVariablesResolver.getVariableByName)('debitCard/footer/gap', modes) || 16;
45
+ const footerPaddingH = (0, _figmaVariablesResolver.getVariableByName)('debitCard/footer/padding/horizontal', modes) || 20;
46
+ const footerPaddingTop = (0, _figmaVariablesResolver.getVariableByName)('debitCard/footer/padding/top', modes) || 16;
47
+ const foreground = (0, _figmaVariablesResolver.getVariableByName)('debitCard/foreground', modes) || '#141414';
48
+ const fontSize = (0, _figmaVariablesResolver.getVariableByName)('debitCard/fontSize', modes) || 14;
49
+ const fontFamily = (0, _figmaVariablesResolver.getVariableByName)('debitCard/fontFamily', modes) || 'JioType Var';
50
+ const lineHeight = (0, _figmaVariablesResolver.getVariableByName)('debitCard/lineHeight', modes) || 17;
51
+ const fontWeightRaw = (0, _figmaVariablesResolver.getVariableByName)('debitCard/fontWeight', modes) || 500;
52
+ const fontWeight = typeof fontWeightRaw === 'number' ? fontWeightRaw.toString() : fontWeightRaw;
53
+ const containerStyle = {
54
+ backgroundColor: background,
55
+ borderRadius: radius,
56
+ width,
57
+ height,
58
+ paddingBottom,
59
+ overflow: 'hidden'
60
+ };
61
+ const headerStyle = {
62
+ flexDirection: 'row',
63
+ alignItems: 'center',
64
+ justifyContent: 'space-between',
65
+ paddingHorizontal: headerPaddingH,
66
+ paddingTop: headerPaddingTop,
67
+ paddingBottom: headerPaddingBottom,
68
+ overflow: 'hidden'
69
+ };
70
+ const headerLeftStyle = {
71
+ flexDirection: 'row',
72
+ alignItems: 'center',
73
+ gap: 4
74
+ };
75
+ const headerRightStyle = {
76
+ flexDirection: 'row',
77
+ alignItems: 'center',
78
+ gap: 8
79
+ };
80
+ const headerTextStyle = {
81
+ color: foreground,
82
+ fontFamily,
83
+ fontSize,
84
+ fontWeight,
85
+ lineHeight: fontSize * 1.2
86
+ };
87
+ const cardArtContainerStyle = {
88
+ height: cardArtHeight,
89
+ width: '100%',
90
+ borderRadius: cardArtRadius,
91
+ overflow: 'hidden'
92
+ };
93
+ const cardArtImageStyle = {
94
+ width: '100%',
95
+ height: '100%',
96
+ borderRadius: cardArtRadius
97
+ };
98
+ const footerStyle = {
99
+ flex: 1,
100
+ gap: footerGap,
101
+ paddingHorizontal: footerPaddingH,
102
+ paddingTop: footerPaddingTop,
103
+ overflow: 'hidden'
104
+ };
105
+ const textStyle = {
106
+ color: foreground,
107
+ fontFamily,
108
+ fontSize,
109
+ lineHeight,
110
+ fontWeight
111
+ };
112
+ const stackStyle = {
113
+ flexDirection: 'row',
114
+ alignItems: 'center',
115
+ justifyContent: 'space-between'
116
+ };
117
+ const normalizedCardArt = _react.default.useMemo(() => {
118
+ if (!cardArtSource) return null;
119
+ if (typeof cardArtSource === 'string') return {
120
+ uri: cardArtSource
121
+ };
122
+ return cardArtSource;
123
+ }, [cardArtSource]);
124
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
125
+ style: [containerStyle, style],
126
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
127
+ style: headerStyle,
128
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
129
+ style: headerLeftStyle,
130
+ children: [bankLogoSlot ? (0, _reactUtils.cloneChildrenWithModes)(bankLogoSlot, modes) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
131
+ style: headerTextStyle,
132
+ children: bankName
133
+ })]
134
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
135
+ style: headerRightStyle,
136
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
137
+ style: headerTextStyle,
138
+ children: cardType
139
+ }), providerLogoSlot ? (0, _reactUtils.cloneChildrenWithModes)(providerLogoSlot, modes) : null]
140
+ })]
141
+ }), normalizedCardArt && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
142
+ style: cardArtContainerStyle,
143
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Image, {
144
+ source: normalizedCardArt,
145
+ style: cardArtImageStyle,
146
+ resizeMode: "cover"
147
+ })
148
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
149
+ style: footerStyle,
150
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
151
+ style: textStyle,
152
+ children: cardNumber
153
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
154
+ style: stackStyle,
155
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
156
+ style: textStyle,
157
+ children: cardholderName
158
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
159
+ style: textStyle,
160
+ children: expireDate
161
+ })]
162
+ })]
163
+ })]
164
+ });
165
+ }
166
+ var _default = exports.default = DebitCard;
@@ -7,7 +7,7 @@ exports.default = void 0;
7
7
  var _react = _interopRequireWildcard(require("react"));
8
8
  var _reactNative = require("react-native");
9
9
  var _figmaVariablesResolver = require("../../design-tokens/figma-variables-resolver");
10
- var _Icon = _interopRequireDefault(require("../../icons/Icon"));
10
+ var _NavArrow = _interopRequireDefault(require("../NavArrow/NavArrow"));
11
11
  var _webPlatformUtils = require("../../utils/web-platform-utils");
12
12
  var _reactUtils = require("../../utils/react-utils");
13
13
  var _jsxRuntime = require("react/jsx-runtime");
@@ -144,12 +144,9 @@ function Section({
144
144
  accessibilityElementsHidden: true,
145
145
  importantForAccessibility: "no",
146
146
  children: title
147
- }), onPress && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
148
- name: "ic_chevron_right",
149
- size: 24,
150
- color: titleColor,
151
- accessibilityElementsHidden: true,
152
- importantForAccessibility: "no"
147
+ }), onPress && /*#__PURE__*/(0, _jsxRuntime.jsx)(_NavArrow.default, {
148
+ direction: "Forward",
149
+ modes: modes
153
150
  })]
154
151
  }), showSupportText && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
155
152
  style: supportTextStyle,
@@ -207,7 +204,7 @@ function Section({
207
204
  flexDirection: slotDirection,
208
205
  gap
209
206
  },
210
- children: slot
207
+ children: (0, _reactUtils.cloneChildrenWithModes)(_react.default.Children.toArray(slot), modes)
211
208
  })]
212
209
  });
213
210
  }
@@ -87,6 +87,12 @@ Object.defineProperty(exports, "Card", {
87
87
  return _Card.default;
88
88
  }
89
89
  });
90
+ Object.defineProperty(exports, "CardCTA", {
91
+ enumerable: true,
92
+ get: function () {
93
+ return _CardCTA.default;
94
+ }
95
+ });
90
96
  Object.defineProperty(exports, "CardFeedback", {
91
97
  enumerable: true,
92
98
  get: function () {
@@ -123,10 +129,10 @@ Object.defineProperty(exports, "ChipSelect", {
123
129
  return _ChipSelect.default;
124
130
  }
125
131
  });
126
- Object.defineProperty(exports, "CtaCard", {
132
+ Object.defineProperty(exports, "DebitCard", {
127
133
  enumerable: true,
128
134
  get: function () {
129
- return _CtaCard.default;
135
+ return _DebitCard.default;
130
136
  }
131
137
  });
132
138
  Object.defineProperty(exports, "Disclaimer", {
@@ -498,7 +504,8 @@ var _CardFeedback = _interopRequireDefault(require("./CardFeedback/CardFeedback"
498
504
  var _Disclaimer = _interopRequireDefault(require("./Disclaimer/Disclaimer"));
499
505
  var _Divider = _interopRequireDefault(require("./Divider/Divider"));
500
506
  var _Drawer = _interopRequireDefault(require("./Drawer/Drawer"));
501
- var _CtaCard = _interopRequireDefault(require("./CtaCard/CtaCard"));
507
+ var _CardCTA = _interopRequireDefault(require("./CardCTA/CardCTA"));
508
+ var _DebitCard = _interopRequireDefault(require("./DebitCard/DebitCard"));
502
509
  var _FilterBar = _interopRequireDefault(require("./FilterBar/FilterBar"));
503
510
  var _Form = _interopRequireWildcard(require("./Form/Form"));
504
511
  var _FormField = _interopRequireDefault(require("./FormField/FormField"));