jfs-components 0.0.44 → 0.0.47
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/lib/commonjs/components/AmountInput/AmountInput.js +82 -0
- package/lib/commonjs/components/AmountInput/index.js +13 -0
- package/lib/commonjs/components/Button/Button.js +31 -28
- package/lib/commonjs/components/CardProviderInfo/CardProviderInfo.js +76 -0
- package/lib/commonjs/components/ChipSelect/ChipSelect.js +1 -2
- package/lib/commonjs/components/Drawer/demo.xml +18 -0
- package/lib/commonjs/components/EmptyState/EmptyState.js +2 -1
- package/lib/commonjs/components/FormField/FormField.js +1 -0
- package/lib/commonjs/components/NoteInput/NoteInput.js +1 -2
- package/lib/commonjs/components/Nudge/Nudge.js +143 -0
- package/lib/commonjs/components/OTP/OTP.js +242 -0
- package/lib/commonjs/components/PaymentFeedback/PaymentFeedback.js +148 -0
- package/lib/commonjs/components/PortfolioHero/PortfolioHero.js +78 -0
- package/lib/commonjs/components/ProductLabel/ProductLabel.js +50 -0
- package/lib/commonjs/components/ProgressBadge/ProgressBadge.js +130 -0
- package/lib/commonjs/components/ProgressBadge/index.js +25 -0
- package/lib/commonjs/components/SegmentedControl/SegmentedControl.js +131 -0
- package/lib/commonjs/components/StatItem/StatItem.js +61 -0
- package/lib/commonjs/components/SupportText/SupportTextIcon.js +2 -3
- package/lib/commonjs/components/SwappableAmount/SwappableAmount.js +71 -0
- package/lib/commonjs/components/Text/Text.js +44 -0
- package/lib/commonjs/components/{PageTitle/PageTitle.js → Title/Title.js} +21 -20
- package/lib/commonjs/components/Toggle/Toggle.js +102 -0
- package/lib/commonjs/components/UpiHandle/UpiHandle.js +5 -2
- package/lib/commonjs/components/index.js +115 -3
- package/lib/commonjs/design-tokens/Coin Variables-variables-full.json +1 -0
- package/lib/commonjs/design-tokens/figma-variables-resolver.js +1 -1
- package/lib/commonjs/icons/registry.js +1 -1
- package/lib/commonjs/index.js +12 -0
- package/lib/commonjs/utils/index.js +18 -0
- package/lib/module/components/AmountInput/AmountInput.js +77 -0
- package/lib/module/components/AmountInput/index.js +3 -0
- package/lib/module/components/Button/Button.js +31 -28
- package/lib/module/components/CardProviderInfo/CardProviderInfo.js +71 -0
- package/lib/module/components/ChipSelect/ChipSelect.js +1 -2
- package/lib/module/components/Drawer/demo.xml +18 -0
- package/lib/module/components/EmptyState/EmptyState.js +2 -1
- package/lib/module/components/FormField/FormField.js +1 -0
- package/lib/module/components/NoteInput/NoteInput.js +1 -2
- package/lib/module/components/Nudge/Nudge.js +138 -0
- package/lib/module/components/OTP/OTP.js +236 -0
- package/lib/module/components/PaymentFeedback/PaymentFeedback.js +142 -0
- package/lib/module/components/PortfolioHero/PortfolioHero.js +73 -0
- package/lib/module/components/ProductLabel/ProductLabel.js +45 -0
- package/lib/module/components/ProgressBadge/ProgressBadge.js +125 -0
- package/lib/module/components/ProgressBadge/index.js +4 -0
- package/lib/module/components/SegmentedControl/SegmentedControl.js +126 -0
- package/lib/module/components/StatItem/StatItem.js +56 -0
- package/lib/module/components/SupportText/SupportTextIcon.js +2 -3
- package/lib/module/components/SwappableAmount/SwappableAmount.js +66 -0
- package/lib/module/components/Text/Text.js +39 -0
- package/lib/module/components/{PageTitle/PageTitle.js → Title/Title.js} +21 -20
- package/lib/module/components/Toggle/Toggle.js +97 -0
- package/lib/module/components/UpiHandle/UpiHandle.js +5 -2
- package/lib/module/components/index.js +18 -2
- package/lib/module/design-tokens/Coin Variables-variables-full.json +1 -0
- package/lib/module/design-tokens/figma-variables-resolver.js +1 -1
- package/lib/module/icons/registry.js +1 -1
- package/lib/module/index.js +2 -1
- package/lib/module/utils/index.js +3 -0
- package/lib/typescript/src/components/AmountInput/AmountInput.d.ts +23 -0
- package/lib/typescript/src/components/AmountInput/index.d.ts +3 -0
- package/lib/typescript/src/components/CardProviderInfo/CardProviderInfo.d.ts +24 -0
- package/lib/typescript/src/components/ChipSelect/ChipSelect.d.ts +1 -6
- package/lib/typescript/src/components/EmptyState/EmptyState.d.ts +6 -1
- package/lib/typescript/src/components/LinearMeter/LinearMeter.d.ts +1 -1
- package/lib/typescript/src/components/Nudge/Nudge.d.ts +31 -0
- package/lib/typescript/src/components/OTP/OTP.d.ts +36 -0
- package/lib/typescript/src/components/PaymentFeedback/PaymentFeedback.d.ts +23 -0
- package/lib/typescript/src/components/PortfolioHero/PortfolioHero.d.ts +21 -0
- package/lib/typescript/src/components/ProductLabel/ProductLabel.d.ts +14 -0
- package/lib/typescript/src/components/ProgressBadge/ProgressBadge.d.ts +36 -0
- package/lib/typescript/src/components/ProgressBadge/index.d.ts +3 -0
- package/lib/typescript/src/components/RechargeCard/RechargeCard.d.ts +1 -2
- package/lib/typescript/src/components/SegmentedControl/SegmentedControl.d.ts +49 -0
- package/lib/typescript/src/components/StatItem/StatItem.d.ts +21 -0
- package/lib/typescript/src/components/SupportText/SupportText.d.ts +1 -1
- package/lib/typescript/src/components/SupportText/SupportTextIcon.d.ts +1 -1
- package/lib/typescript/src/components/SwappableAmount/SwappableAmount.d.ts +22 -0
- package/lib/typescript/src/components/Text/Text.d.ts +16 -0
- package/lib/typescript/src/components/Title/Title.d.ts +16 -0
- package/lib/typescript/src/components/Toggle/Toggle.d.ts +29 -0
- package/lib/typescript/src/components/UpiHandle/UpiHandle.d.ts +3 -1
- package/lib/typescript/src/components/index.d.ts +22 -5
- package/lib/typescript/src/icons/registry.d.ts +1 -1
- package/lib/typescript/src/index.d.ts +1 -0
- package/lib/typescript/src/utils/index.d.ts +2 -0
- package/package.json +2 -2
- package/src/components/AmountInput/AmountInput.tsx +81 -0
- package/src/components/AmountInput/index.ts +2 -0
- package/src/components/Button/Button.tsx +27 -20
- package/src/components/CardProviderInfo/CardProviderInfo.tsx +81 -0
- package/src/components/ChipSelect/ChipSelect.tsx +1 -8
- package/src/components/Drawer/demo.xml +18 -0
- package/src/components/EmptyState/EmptyState.tsx +7 -1
- package/src/components/FormField/FormField.tsx +1 -0
- package/src/components/LinearMeter/LinearMeter.tsx +1 -1
- package/src/components/NoteInput/NoteInput.tsx +1 -1
- package/src/components/Nudge/Nudge.tsx +150 -0
- package/src/components/OTP/OTP.tsx +275 -0
- package/src/components/PaymentFeedback/PaymentFeedback.tsx +168 -0
- package/src/components/PortfolioHero/PortfolioHero.tsx +91 -0
- package/src/components/ProductLabel/ProductLabel.tsx +58 -0
- package/src/components/ProgressBadge/ProgressBadge.tsx +172 -0
- package/src/components/ProgressBadge/index.ts +2 -0
- package/src/components/RechargeCard/RechargeCard.tsx +1 -1
- package/src/components/SegmentedControl/SegmentedControl.tsx +168 -0
- package/src/components/StatItem/StatItem.tsx +71 -0
- package/src/components/SupportText/SupportText.tsx +1 -1
- package/src/components/SupportText/SupportTextIcon.tsx +4 -3
- package/src/components/SwappableAmount/SwappableAmount.tsx +92 -0
- package/src/components/Text/Text.tsx +57 -0
- package/src/components/{PageTitle/PageTitle.tsx → Title/Title.tsx} +25 -19
- package/src/components/Toggle/Toggle.tsx +122 -0
- package/src/components/UpiHandle/UpiHandle.tsx +6 -2
- package/src/components/index.ts +22 -5
- package/src/design-tokens/Coin Variables-variables-full.json +1 -0
- package/src/design-tokens/figma-variables-resolver.ts +1 -1
- package/src/icons/registry.ts +1 -1
- package/src/index.ts +1 -0
- package/src/utils/index.ts +1 -0
- package/lib/commonjs/design-tokens/JFS Variables-variables-full.json +0 -1
- package/lib/module/design-tokens/JFS Variables-variables-full.json +0 -1
- package/lib/typescript/src/components/PageTitle/PageTitle.d.ts +0 -29
- package/src/design-tokens/JFS Variables-variables-full.json +0 -1
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = AmountInput;
|
|
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 _MoneyValue = _interopRequireDefault(require("../MoneyValue/MoneyValue"));
|
|
12
|
+
var _NoteInput = _interopRequireDefault(require("../NoteInput/NoteInput"));
|
|
13
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
|
+
/**
|
|
16
|
+
* AmountInput component that combines MoneyValue and NoteInput from Figma design.
|
|
17
|
+
*
|
|
18
|
+
* @component
|
|
19
|
+
*/
|
|
20
|
+
function AmountInput({
|
|
21
|
+
moneyValueSlot,
|
|
22
|
+
noteInputSlot,
|
|
23
|
+
modes: propModes = {},
|
|
24
|
+
style
|
|
25
|
+
}) {
|
|
26
|
+
const {
|
|
27
|
+
modes: globalModes
|
|
28
|
+
} = (0, _JFSThemeProvider.useTokens)();
|
|
29
|
+
const modes = {
|
|
30
|
+
...globalModes,
|
|
31
|
+
...propModes
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
// Resolve tokens
|
|
35
|
+
const gap = Number((0, _figmaVariablesResolver.getVariableByName)('amountInput/gap', modes)) || 16;
|
|
36
|
+
const paddingHorizontal = Number((0, _figmaVariablesResolver.getVariableByName)('amountInput/padding/horizontal', modes)) || 0;
|
|
37
|
+
const paddingVertical = Number((0, _figmaVariablesResolver.getVariableByName)('amountInput/padding/vertical', modes)) || 0;
|
|
38
|
+
const containerStyle = {
|
|
39
|
+
flexDirection: 'column',
|
|
40
|
+
alignItems: 'center',
|
|
41
|
+
gap,
|
|
42
|
+
paddingHorizontal,
|
|
43
|
+
paddingVertical,
|
|
44
|
+
...style
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
// Handle MoneyValue Slot
|
|
48
|
+
const renderMoneyValueSlot = () => {
|
|
49
|
+
if (/*#__PURE__*/_react.default.isValidElement(moneyValueSlot)) {
|
|
50
|
+
return /*#__PURE__*/_react.default.cloneElement(moneyValueSlot, {
|
|
51
|
+
modes
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
// Default fallback if no slot prop is provided
|
|
55
|
+
if (!moneyValueSlot) {
|
|
56
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_MoneyValue.default, {
|
|
57
|
+
modes: modes
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
return moneyValueSlot;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
// Handle NoteInput Slot
|
|
64
|
+
const renderNoteInputSlot = () => {
|
|
65
|
+
if (/*#__PURE__*/_react.default.isValidElement(noteInputSlot)) {
|
|
66
|
+
return /*#__PURE__*/_react.default.cloneElement(noteInputSlot, {
|
|
67
|
+
modes
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
// Default fallback if no slot prop is provided
|
|
71
|
+
if (!noteInputSlot) {
|
|
72
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_NoteInput.default, {
|
|
73
|
+
modes: modes
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
return noteInputSlot;
|
|
77
|
+
};
|
|
78
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
79
|
+
style: containerStyle,
|
|
80
|
+
children: [renderMoneyValueSlot(), renderNoteInputSlot()]
|
|
81
|
+
});
|
|
82
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "default", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _AmountInput.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _AmountInput = _interopRequireDefault(require("./AmountInput"));
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -65,8 +65,28 @@ function Button({
|
|
|
65
65
|
const textColor = (0, _figmaVariablesResolver.getVariableByName)('button/foreground', modes) || '#0f0d0a';
|
|
66
66
|
const iconColor = (0, _figmaVariablesResolver.getVariableByName)('button/icon/color', modes) ?? textColor;
|
|
67
67
|
const iconSize = (0, _figmaVariablesResolver.getVariableByName)('button/icon/size', modes) ?? 18;
|
|
68
|
+
const [isHovered, setIsHovered] = (0, _react.useState)(false);
|
|
69
|
+
const [isPressed, setIsPressed] = (0, _react.useState)(false);
|
|
70
|
+
const hoverModes = {
|
|
71
|
+
...modes,
|
|
72
|
+
"Button / State": "Hover"
|
|
73
|
+
};
|
|
74
|
+
const hoverBg = (0, _figmaVariablesResolver.getVariableByName)('button/background', hoverModes) || backgroundColor;
|
|
75
|
+
const hoverBorderColor = (0, _figmaVariablesResolver.getVariableByName)('button/border/color', hoverModes) || borderColor;
|
|
76
|
+
const hoverTextColor = (0, _figmaVariablesResolver.getVariableByName)('button/foreground', hoverModes) || textColor;
|
|
77
|
+
const hoverIconColor = (0, _figmaVariablesResolver.getVariableByName)('button/icon/color', hoverModes) ?? hoverTextColor;
|
|
78
|
+
const pressedModes = {
|
|
79
|
+
...modes,
|
|
80
|
+
"Button / State": "Pressed"
|
|
81
|
+
};
|
|
82
|
+
const pressedBg = (0, _figmaVariablesResolver.getVariableByName)('button/background', pressedModes) || backgroundColor;
|
|
83
|
+
const pressedBorderColor = (0, _figmaVariablesResolver.getVariableByName)('button/border/color', pressedModes) || borderColor;
|
|
84
|
+
const pressedTextColor = (0, _figmaVariablesResolver.getVariableByName)('button/foreground', pressedModes) || textColor;
|
|
85
|
+
const pressedIconColor = (0, _figmaVariablesResolver.getVariableByName)('button/icon/color', pressedModes) ?? pressedTextColor;
|
|
86
|
+
const activeTextColor = isPressed && !disabled ? pressedTextColor : isHovered && !disabled ? hoverTextColor : textColor;
|
|
87
|
+
const activeIconColor = isPressed && !disabled ? pressedIconColor : isHovered && !disabled ? hoverIconColor : iconColor;
|
|
68
88
|
const baseLabelTextStyle = {
|
|
69
|
-
color:
|
|
89
|
+
color: activeTextColor,
|
|
70
90
|
fontFamily,
|
|
71
91
|
fontWeight,
|
|
72
92
|
fontSize,
|
|
@@ -120,22 +140,13 @@ function Button({
|
|
|
120
140
|
accessibilityLabel: defaultAccessibilityLabel,
|
|
121
141
|
webAccessibilityProps
|
|
122
142
|
});
|
|
123
|
-
|
|
124
|
-
// Interaction states (placeholders for visuals; tweak later)
|
|
125
|
-
const [isFocused, setIsFocused] = (0, _react.useState)(false);
|
|
126
|
-
const [isHovered, setIsHovered] = (0, _react.useState)(false);
|
|
127
|
-
const pressedStyle = {
|
|
128
|
-
transform: [{
|
|
129
|
-
scale: 0.995
|
|
130
|
-
}],
|
|
131
|
-
backgroundColor: '#b88940'
|
|
132
|
-
};
|
|
133
|
-
const focusStyle = {
|
|
134
|
-
borderWidth: 1,
|
|
135
|
-
borderColor: '#222'
|
|
136
|
-
};
|
|
137
143
|
const hoverStyle = {
|
|
138
|
-
|
|
144
|
+
backgroundColor: hoverBg,
|
|
145
|
+
borderColor: hoverBorderColor
|
|
146
|
+
};
|
|
147
|
+
const pressedStyle = {
|
|
148
|
+
backgroundColor: pressedBg,
|
|
149
|
+
borderColor: pressedBorderColor
|
|
139
150
|
};
|
|
140
151
|
if (__DEV__) {
|
|
141
152
|
if (children && labelStyle) {
|
|
@@ -160,21 +171,13 @@ function Button({
|
|
|
160
171
|
onPress
|
|
161
172
|
} : {}),
|
|
162
173
|
onPressIn: e => {
|
|
163
|
-
;
|
|
174
|
+
setIsPressed(true);
|
|
164
175
|
rest?.onPressIn?.(e);
|
|
165
176
|
},
|
|
166
177
|
onPressOut: e => {
|
|
167
|
-
;
|
|
178
|
+
setIsPressed(false);
|
|
168
179
|
rest?.onPressOut?.(e);
|
|
169
180
|
},
|
|
170
|
-
onFocus: e => {
|
|
171
|
-
setIsFocused(true);
|
|
172
|
-
rest?.onFocus?.(e);
|
|
173
|
-
},
|
|
174
|
-
onBlur: e => {
|
|
175
|
-
setIsFocused(false);
|
|
176
|
-
rest?.onBlur?.(e);
|
|
177
|
-
},
|
|
178
181
|
onHoverIn: e => {
|
|
179
182
|
setIsHovered(true);
|
|
180
183
|
rest?.onHoverIn?.(e);
|
|
@@ -185,7 +188,7 @@ function Button({
|
|
|
185
188
|
},
|
|
186
189
|
style: ({
|
|
187
190
|
pressed
|
|
188
|
-
}) => [containerBaseStyle,
|
|
191
|
+
}) => [containerBaseStyle, isHovered && !disabled ? hoverStyle : null, (pressed || isPressed) && !disabled ? pressedStyle : null, style],
|
|
189
192
|
...webProps,
|
|
190
193
|
children: [leading ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
191
194
|
style: leadingAccessoryStyle,
|
|
@@ -195,7 +198,7 @@ function Button({
|
|
|
195
198
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
|
|
196
199
|
name: icon,
|
|
197
200
|
size: iconSize,
|
|
198
|
-
color:
|
|
201
|
+
color: activeIconColor,
|
|
199
202
|
accessibilityElementsHidden: true,
|
|
200
203
|
importantForAccessibility: "no"
|
|
201
204
|
})
|
|
@@ -0,0 +1,76 @@
|
|
|
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 _ProductLabel = _interopRequireDefault(require("../ProductLabel/ProductLabel"));
|
|
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
|
+
/**
|
|
15
|
+
* CardProviderInfo displays a product header (ProductLabel) followed by a
|
|
16
|
+
* 2-column grid of children (typically StatItem instances).
|
|
17
|
+
*
|
|
18
|
+
* @component
|
|
19
|
+
* @param {CardProviderInfoProps} props
|
|
20
|
+
*/
|
|
21
|
+
function CardProviderInfo({
|
|
22
|
+
label = 'Gold',
|
|
23
|
+
imageSource,
|
|
24
|
+
children,
|
|
25
|
+
modes = {},
|
|
26
|
+
style
|
|
27
|
+
}) {
|
|
28
|
+
const background = (0, _figmaVariablesResolver.getVariableByName)('card/providerInfo/background', modes) ?? '#fef4e5';
|
|
29
|
+
const border = (0, _figmaVariablesResolver.getVariableByName)('card/providerInfo/border', modes) ?? '#fef4e5';
|
|
30
|
+
const borderWidthVal = (0, _figmaVariablesResolver.getVariableByName)('card/providerInfo/borderWidth', modes) ?? 1;
|
|
31
|
+
const padding = (0, _figmaVariablesResolver.getVariableByName)('card/providerInfo/padding', modes) ?? 20;
|
|
32
|
+
const gap = (0, _figmaVariablesResolver.getVariableByName)('card/providerInfo/gap', modes) ?? 20;
|
|
33
|
+
const radius = (0, _figmaVariablesResolver.getVariableByName)('card/providerInfo/radius', modes) ?? 16;
|
|
34
|
+
const gridGap = (0, _figmaVariablesResolver.getVariableByName)('card/providerInfo/grid/gap', modes) ?? 8;
|
|
35
|
+
const containerStyle = {
|
|
36
|
+
backgroundColor: background,
|
|
37
|
+
borderColor: border,
|
|
38
|
+
borderWidth: borderWidthVal,
|
|
39
|
+
borderStyle: 'solid',
|
|
40
|
+
padding: padding,
|
|
41
|
+
gap: gap,
|
|
42
|
+
borderRadius: radius
|
|
43
|
+
};
|
|
44
|
+
const gridGapNum = gridGap;
|
|
45
|
+
const clonedChildren = children ? (0, _reactUtils.cloneChildrenWithModes)(children, modes) : [];
|
|
46
|
+
const childArray = _react.default.Children.toArray(clonedChildren);
|
|
47
|
+
const rows = [];
|
|
48
|
+
for (let i = 0; i < childArray.length; i += 2) {
|
|
49
|
+
rows.push(childArray.slice(i, i + 2));
|
|
50
|
+
}
|
|
51
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
52
|
+
style: [containerStyle, style],
|
|
53
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ProductLabel.default, {
|
|
54
|
+
label: label,
|
|
55
|
+
imageSource: imageSource,
|
|
56
|
+
modes: modes
|
|
57
|
+
}), childArray.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
58
|
+
style: {
|
|
59
|
+
rowGap: gridGapNum
|
|
60
|
+
},
|
|
61
|
+
children: rows.map((row, i) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
62
|
+
style: {
|
|
63
|
+
flexDirection: 'row',
|
|
64
|
+
columnGap: gridGapNum
|
|
65
|
+
},
|
|
66
|
+
children: row.map((child, j) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
67
|
+
style: {
|
|
68
|
+
flex: 1
|
|
69
|
+
},
|
|
70
|
+
children: child
|
|
71
|
+
}, j))
|
|
72
|
+
}, i))
|
|
73
|
+
})]
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
var _default = exports.default = CardProviderInfo;
|
|
@@ -18,7 +18,6 @@ function ChipSelect({
|
|
|
18
18
|
label = 'Date',
|
|
19
19
|
active = false,
|
|
20
20
|
icon = 'ic_calendar_week',
|
|
21
|
-
close = true,
|
|
22
21
|
modes = {},
|
|
23
22
|
style,
|
|
24
23
|
labelSlot,
|
|
@@ -92,7 +91,7 @@ function ChipSelect({
|
|
|
92
91
|
name: icon,
|
|
93
92
|
size: iconSize,
|
|
94
93
|
color: textColor
|
|
95
|
-
}), renderLabel(), active &&
|
|
94
|
+
}), renderLabel(), active && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
|
|
96
95
|
name: "ic_close",
|
|
97
96
|
size: iconSize,
|
|
98
97
|
color: textColor
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<design>
|
|
2
|
+
<ListItem layout="Horizontal" leadingType="Avatar" navArrow="false" showSupportText="true" start="true" supportText="Support Text" title="Aasa Singh" trailing="true">
|
|
3
|
+
<Avatar monogram="MS" style="Image"></Avatar>
|
|
4
|
+
<frame horizontalSizing="FILL" name="text wrap" verticalSizing="HUG">
|
|
5
|
+
<slot name="supportText">
|
|
6
|
+
<text name="support text">₹10,000</text>
|
|
7
|
+
</slot>
|
|
8
|
+
<text name="Title">Aasa Singh</text>
|
|
9
|
+
</frame>
|
|
10
|
+
<frame horizontalSizing="HUG" modes='{"Context":"ListItem"}' name="end wrap" verticalSizing="HUG">
|
|
11
|
+
<slot name="slot">
|
|
12
|
+
<Button label="Button">
|
|
13
|
+
<text name="Label">Button</text>
|
|
14
|
+
</Button>
|
|
15
|
+
</slot>
|
|
16
|
+
</frame>
|
|
17
|
+
</ListItem>
|
|
18
|
+
</design>
|
|
@@ -21,6 +21,7 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
21
21
|
function EmptyState({
|
|
22
22
|
title = "No payments to show",
|
|
23
23
|
description = "Start by paying bills, recharge or your friends",
|
|
24
|
+
showDescription = true,
|
|
24
25
|
iconSlot,
|
|
25
26
|
buttonSlot,
|
|
26
27
|
modes: propModes = {},
|
|
@@ -116,7 +117,7 @@ function EmptyState({
|
|
|
116
117
|
children: [iconContent, /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
117
118
|
style: titleStyle,
|
|
118
119
|
children: title
|
|
119
|
-
}), description ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
120
|
+
}), showDescription && description ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
120
121
|
style: bodyStyle,
|
|
121
122
|
children: description
|
|
122
123
|
}) : null]
|
|
@@ -87,6 +87,7 @@ function useFormField(props) {
|
|
|
87
87
|
borderWidth: inputBorderSize,
|
|
88
88
|
borderRadius: inputRadius,
|
|
89
89
|
paddingHorizontal: inputPaddingH,
|
|
90
|
+
paddingVertical: 0,
|
|
90
91
|
gap: inputGap
|
|
91
92
|
}), [inputBackground, inputBorderColor, inputBorderSize, inputRadius, inputPaddingH, inputGap]);
|
|
92
93
|
const inputTextStyle = (0, _react.useMemo)(() => ({
|
|
@@ -52,9 +52,8 @@ function NoteInput({
|
|
|
52
52
|
backgroundColor: background,
|
|
53
53
|
borderWidth: borderSize,
|
|
54
54
|
borderColor: borderColor,
|
|
55
|
-
gap: gap
|
|
55
|
+
gap: gap
|
|
56
56
|
// Add specific width when editing if requested by Figma design logic, though flex fits content generically
|
|
57
|
-
alignSelf: 'flex-start'
|
|
58
57
|
};
|
|
59
58
|
const baseTextStyle = {
|
|
60
59
|
color: foreground,
|
|
@@ -0,0 +1,143 @@
|
|
|
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 _Button = _interopRequireDefault(require("../Button/Button"));
|
|
13
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
|
+
function Nudge({
|
|
16
|
+
variant = 'Default',
|
|
17
|
+
title = 'Split payment',
|
|
18
|
+
body = 'Split this transaction into installments',
|
|
19
|
+
buttonLabel = 'Button',
|
|
20
|
+
onPressButton,
|
|
21
|
+
buttonSlot,
|
|
22
|
+
startSlot,
|
|
23
|
+
children,
|
|
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)('nudge/background', modes) || '#f5f5f5';
|
|
35
|
+
const radius = (0, _figmaVariablesResolver.getVariableByName)('nudge/radius', modes) || 12;
|
|
36
|
+
const paddingH = (0, _figmaVariablesResolver.getVariableByName)('nudge/padding/horizontal', modes) || 12;
|
|
37
|
+
const paddingV = (0, _figmaVariablesResolver.getVariableByName)('nudge/padding/vertical', modes) || 12;
|
|
38
|
+
const gap = (0, _figmaVariablesResolver.getVariableByName)('nudge/gap', modes) || 6;
|
|
39
|
+
const titleColor = (0, _figmaVariablesResolver.getVariableByName)('nudge/title/color', modes) || '#0d0d0f';
|
|
40
|
+
const titleFontSize = (0, _figmaVariablesResolver.getVariableByName)('nudge/title/fontSize', modes) || 14;
|
|
41
|
+
const titleFontFamily = (0, _figmaVariablesResolver.getVariableByName)('nudge/title/fontFamily', modes) || 'JioType Var';
|
|
42
|
+
const titleLineHeight = (0, _figmaVariablesResolver.getVariableByName)('nudge/title/lineHeight', modes) || 15;
|
|
43
|
+
const titleFontWeightRaw = (0, _figmaVariablesResolver.getVariableByName)('nudge/title/fontWeight', modes) || 700;
|
|
44
|
+
const titleFontWeight = typeof titleFontWeightRaw === 'number' ? titleFontWeightRaw.toString() : titleFontWeightRaw;
|
|
45
|
+
const bodyColor = (0, _figmaVariablesResolver.getVariableByName)('nudge/body/color', modes) || '#1a1c1f';
|
|
46
|
+
const bodyFontSize = (0, _figmaVariablesResolver.getVariableByName)('nudge/body/fontSize', modes) || 12;
|
|
47
|
+
const bodyFontFamily = (0, _figmaVariablesResolver.getVariableByName)('nudge/body/fontFamily', modes) || 'JioType Var';
|
|
48
|
+
const bodyLineHeight = (0, _figmaVariablesResolver.getVariableByName)('nudge/body/lineHeight', modes) || 16;
|
|
49
|
+
const bodyFontWeightRaw = (0, _figmaVariablesResolver.getVariableByName)('nudge/body/fontWeight', modes) || 500;
|
|
50
|
+
const bodyFontWeight = typeof bodyFontWeightRaw === 'number' ? bodyFontWeightRaw.toString() : bodyFontWeightRaw;
|
|
51
|
+
const textGap = (0, _figmaVariablesResolver.getVariableByName)('nudge/text/gap', modes) || 4;
|
|
52
|
+
const contentGap = (0, _figmaVariablesResolver.getVariableByName)('nudge/content/gap', modes) || 8;
|
|
53
|
+
const contentMinHeight = (0, _figmaVariablesResolver.getVariableByName)('nudge/content/minHeight', modes) || 20;
|
|
54
|
+
const containerStyle = {
|
|
55
|
+
backgroundColor: background,
|
|
56
|
+
borderRadius: radius,
|
|
57
|
+
paddingHorizontal: paddingH,
|
|
58
|
+
paddingVertical: paddingV,
|
|
59
|
+
gap,
|
|
60
|
+
overflow: 'hidden',
|
|
61
|
+
...(variant === 'Variant2' ? {
|
|
62
|
+
flexDirection: 'column',
|
|
63
|
+
alignItems: 'flex-start'
|
|
64
|
+
} : {
|
|
65
|
+
flexDirection: 'row',
|
|
66
|
+
alignItems: 'flex-start'
|
|
67
|
+
})
|
|
68
|
+
};
|
|
69
|
+
const titleStyle = {
|
|
70
|
+
color: titleColor,
|
|
71
|
+
fontSize: titleFontSize,
|
|
72
|
+
fontFamily: titleFontFamily,
|
|
73
|
+
lineHeight: titleLineHeight,
|
|
74
|
+
fontWeight: titleFontWeight
|
|
75
|
+
};
|
|
76
|
+
const bodyStyle = {
|
|
77
|
+
color: bodyColor,
|
|
78
|
+
fontSize: bodyFontSize,
|
|
79
|
+
fontFamily: bodyFontFamily,
|
|
80
|
+
lineHeight: bodyLineHeight,
|
|
81
|
+
fontWeight: bodyFontWeight
|
|
82
|
+
};
|
|
83
|
+
const processedStartSlot = startSlot ? (0, _reactUtils.cloneChildrenWithModes)(_react.default.Children.toArray(startSlot), modes) : null;
|
|
84
|
+
const startSlotElement = processedStartSlot && processedStartSlot.length > 0 ? processedStartSlot.length === 1 ? processedStartSlot[0] : processedStartSlot : null;
|
|
85
|
+
if (variant === 'Variant2') {
|
|
86
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
87
|
+
style: [containerStyle, style],
|
|
88
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
89
|
+
style: {
|
|
90
|
+
flexDirection: 'row',
|
|
91
|
+
alignItems: 'center',
|
|
92
|
+
gap: 6,
|
|
93
|
+
width: '100%'
|
|
94
|
+
},
|
|
95
|
+
children: [startSlotElement, /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
96
|
+
style: [titleStyle, {
|
|
97
|
+
flex: 1
|
|
98
|
+
}],
|
|
99
|
+
children: title
|
|
100
|
+
})]
|
|
101
|
+
}), children ? (0, _reactUtils.cloneChildrenWithModes)(_react.default.Children.toArray(children), modes) : null]
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
const defaultContent = /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
105
|
+
style: {
|
|
106
|
+
gap: contentGap,
|
|
107
|
+
alignItems: 'flex-start',
|
|
108
|
+
width: '100%'
|
|
109
|
+
},
|
|
110
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
111
|
+
style: {
|
|
112
|
+
gap: textGap,
|
|
113
|
+
alignItems: 'flex-start',
|
|
114
|
+
width: '100%'
|
|
115
|
+
},
|
|
116
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
117
|
+
style: titleStyle,
|
|
118
|
+
children: title
|
|
119
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
120
|
+
style: bodyStyle,
|
|
121
|
+
children: body
|
|
122
|
+
})]
|
|
123
|
+
}), buttonSlot ? (0, _reactUtils.cloneChildrenWithModes)(_react.default.Children.toArray(buttonSlot), modes) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
|
|
124
|
+
label: buttonLabel,
|
|
125
|
+
onPress: onPressButton,
|
|
126
|
+
modes: modes
|
|
127
|
+
})]
|
|
128
|
+
});
|
|
129
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
130
|
+
style: [containerStyle, style],
|
|
131
|
+
children: [startSlotElement, /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
132
|
+
style: {
|
|
133
|
+
flex: 1,
|
|
134
|
+
minWidth: 1,
|
|
135
|
+
minHeight: contentMinHeight,
|
|
136
|
+
justifyContent: 'center',
|
|
137
|
+
overflow: 'hidden'
|
|
138
|
+
},
|
|
139
|
+
children: children ? (0, _reactUtils.cloneChildrenWithModes)(_react.default.Children.toArray(children), modes) : defaultContent
|
|
140
|
+
})]
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
var _default = exports.default = Nudge;
|