jfs-components 0.0.45 → 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/ChipSelect/ChipSelect.js +1 -2
- package/lib/commonjs/components/Drawer/demo.xml +18 -0
- 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/PaymentFeedback/PaymentFeedback.js +148 -0
- package/lib/commonjs/components/SegmentedControl/SegmentedControl.js +131 -0
- package/lib/commonjs/components/SupportText/SupportTextIcon.js +2 -3
- package/lib/commonjs/components/Text/Text.js +7 -1
- package/lib/commonjs/components/{PageTitle/PageTitle.js → Title/Title.js} +21 -20
- package/lib/commonjs/components/UpiHandle/UpiHandle.js +5 -2
- package/lib/commonjs/components/index.js +52 -3
- package/lib/commonjs/design-tokens/Coin Variables-variables-full.json +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/ChipSelect/ChipSelect.js +1 -2
- package/lib/module/components/Drawer/demo.xml +18 -0
- 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/PaymentFeedback/PaymentFeedback.js +142 -0
- package/lib/module/components/SegmentedControl/SegmentedControl.js +126 -0
- package/lib/module/components/SupportText/SupportTextIcon.js +2 -3
- package/lib/module/components/Text/Text.js +7 -1
- package/lib/module/components/{PageTitle/PageTitle.js → Title/Title.js} +21 -20
- package/lib/module/components/UpiHandle/UpiHandle.js +5 -2
- package/lib/module/components/index.js +8 -1
- package/lib/module/design-tokens/Coin Variables-variables-full.json +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/ChipSelect/ChipSelect.d.ts +1 -6
- 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/PaymentFeedback/PaymentFeedback.d.ts +23 -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/SupportText/SupportText.d.ts +1 -1
- package/lib/typescript/src/components/SupportText/SupportTextIcon.d.ts +1 -1
- package/lib/typescript/src/components/Text/Text.d.ts +3 -1
- package/lib/typescript/src/components/Title/Title.d.ts +16 -0
- package/lib/typescript/src/components/UpiHandle/UpiHandle.d.ts +3 -1
- package/lib/typescript/src/components/index.d.ts +13 -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/ChipSelect/ChipSelect.tsx +1 -8
- package/src/components/Drawer/demo.xml +18 -0
- 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/PaymentFeedback/PaymentFeedback.tsx +168 -0
- package/src/components/RechargeCard/RechargeCard.tsx +1 -1
- package/src/components/SegmentedControl/SegmentedControl.tsx +168 -0
- package/src/components/SupportText/SupportText.tsx +1 -1
- package/src/components/SupportText/SupportTextIcon.tsx +4 -3
- package/src/components/Text/Text.tsx +9 -0
- package/src/components/{PageTitle/PageTitle.tsx → Title/Title.tsx} +25 -19
- package/src/components/UpiHandle/UpiHandle.tsx +6 -2
- package/src/components/index.ts +13 -5
- package/src/design-tokens/Coin Variables-variables-full.json +1 -1
- package/src/icons/registry.ts +1 -1
- package/src/index.ts +1 -0
- package/src/utils/index.ts +1 -0
- package/lib/typescript/src/components/PageTitle/PageTitle.d.ts +0 -29
|
@@ -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>
|
|
@@ -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;
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = PaymentFeedback;
|
|
7
|
+
var _react = _interopRequireWildcard(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 _IconCapsule = _interopRequireDefault(require("../IconCapsule/IconCapsule"));
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
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 PaymentFeedback({
|
|
16
|
+
title = '₹50,000',
|
|
17
|
+
subtitle = 'Payment successful',
|
|
18
|
+
body = 'Your payment has been\nsuccessfully processed.',
|
|
19
|
+
details = '18 March 2025, 4:15 pm\nTransaction ID: TXN121466784',
|
|
20
|
+
showDetails = true,
|
|
21
|
+
iconName = 'ic_confirm',
|
|
22
|
+
renderMedia,
|
|
23
|
+
modes: propModes = {},
|
|
24
|
+
style
|
|
25
|
+
}) {
|
|
26
|
+
const {
|
|
27
|
+
modes: globalModes
|
|
28
|
+
} = (0, _JFSThemeProvider.useTokens)();
|
|
29
|
+
const modes = {
|
|
30
|
+
...globalModes,
|
|
31
|
+
...propModes
|
|
32
|
+
};
|
|
33
|
+
const containerGap = Number((0, _figmaVariablesResolver.getVariableByName)('paymnetFeedback/container/gap', modes)) || 46;
|
|
34
|
+
const messageGap = Number((0, _figmaVariablesResolver.getVariableByName)('paymnetFeedback/message/gap', modes)) || 12;
|
|
35
|
+
const titleColor = (0, _figmaVariablesResolver.getVariableByName)('paymnetFeedback/title/color', modes) || '#0d0d0f';
|
|
36
|
+
const titleFontSize = Number((0, _figmaVariablesResolver.getVariableByName)('paymnetFeedback/title/fontSize', modes)) || 36;
|
|
37
|
+
const titleFontFamily = (0, _figmaVariablesResolver.getVariableByName)('paymnetFeedback/title/fontFamily', modes) || 'JioType Var';
|
|
38
|
+
const titleLineHeight = Number((0, _figmaVariablesResolver.getVariableByName)('paymnetFeedback/title/lineHeight', modes)) || 36;
|
|
39
|
+
const titleFontWeight = (0, _figmaVariablesResolver.getVariableByName)('paymnetFeedback/title/fontWeight', modes) || '900';
|
|
40
|
+
const subtitleColor = (0, _figmaVariablesResolver.getVariableByName)('paymnetFeedback/subtitle/color', modes) || '#24262b';
|
|
41
|
+
const subtitleFontSize = Number((0, _figmaVariablesResolver.getVariableByName)('paymnetFeedback/subtitle/fontSize', modes)) || 16;
|
|
42
|
+
const subtitleFontFamily = (0, _figmaVariablesResolver.getVariableByName)('paymnetFeedback/subtitle/fontFamily', modes) || 'JioType Var';
|
|
43
|
+
const subtitleLineHeight = Number((0, _figmaVariablesResolver.getVariableByName)('paymnetFeedback/subtitle/lineHeight', modes)) || 19;
|
|
44
|
+
const subtitleFontWeight = (0, _figmaVariablesResolver.getVariableByName)('paymnetFeedback/subtitle/fontWeight', modes) || '500';
|
|
45
|
+
const bodyColor = (0, _figmaVariablesResolver.getVariableByName)('paymnetFeedback/body/color', modes) || '#24262b';
|
|
46
|
+
const bodyFontSize = Number((0, _figmaVariablesResolver.getVariableByName)('paymnetFeedback/body/fontSize', modes)) || 14;
|
|
47
|
+
const bodyFontFamily = (0, _figmaVariablesResolver.getVariableByName)('paymnetFeedback/body/fontFamily', modes) || 'JioType Var';
|
|
48
|
+
const bodyLineHeight = Number((0, _figmaVariablesResolver.getVariableByName)('paymnetFeedback/body/lineHeight', modes)) || 17;
|
|
49
|
+
const bodyFontWeight = (0, _figmaVariablesResolver.getVariableByName)('paymnetFeedback/body/fontWeight', modes) || '500';
|
|
50
|
+
const detailsColor = (0, _figmaVariablesResolver.getVariableByName)('paymnetFeedback/details/color', modes) || '#24262b';
|
|
51
|
+
const detailsFontSize = Number((0, _figmaVariablesResolver.getVariableByName)('paymnetFeedback/details/fontSize', modes)) || 14;
|
|
52
|
+
const detailsFontFamily = (0, _figmaVariablesResolver.getVariableByName)('paymnetFeedback/details/fontFamily', modes) || 'JioType Var';
|
|
53
|
+
const detailsLineHeight = Number((0, _figmaVariablesResolver.getVariableByName)('paymnetFeedback/details/lineHeight', modes)) || 17;
|
|
54
|
+
const detailsFontWeight = (0, _figmaVariablesResolver.getVariableByName)('paymnetFeedback/details/fontWeight', modes) || '500';
|
|
55
|
+
const detailsParagraphSpacing = Number((0, _figmaVariablesResolver.getVariableByName)('paymnetFeedback/details/paragraphSpacing', modes)) || 4;
|
|
56
|
+
const containerStyle = {
|
|
57
|
+
flexDirection: 'column',
|
|
58
|
+
alignItems: 'center',
|
|
59
|
+
gap: containerGap
|
|
60
|
+
};
|
|
61
|
+
const messageContainerStyle = {
|
|
62
|
+
flexDirection: 'column',
|
|
63
|
+
alignItems: 'center',
|
|
64
|
+
gap: messageGap,
|
|
65
|
+
width: '100%'
|
|
66
|
+
};
|
|
67
|
+
const subtextContainerStyle = {
|
|
68
|
+
flexDirection: 'column',
|
|
69
|
+
alignItems: 'center',
|
|
70
|
+
gap: 4,
|
|
71
|
+
width: '100%'
|
|
72
|
+
};
|
|
73
|
+
const titleStyle = {
|
|
74
|
+
color: titleColor,
|
|
75
|
+
fontSize: titleFontSize,
|
|
76
|
+
fontFamily: titleFontFamily,
|
|
77
|
+
lineHeight: titleLineHeight,
|
|
78
|
+
fontWeight: String(titleFontWeight),
|
|
79
|
+
textAlign: 'center'
|
|
80
|
+
};
|
|
81
|
+
const subtitleStyle = {
|
|
82
|
+
color: subtitleColor,
|
|
83
|
+
fontSize: subtitleFontSize,
|
|
84
|
+
fontFamily: subtitleFontFamily,
|
|
85
|
+
lineHeight: subtitleLineHeight,
|
|
86
|
+
fontWeight: String(subtitleFontWeight),
|
|
87
|
+
textAlign: 'center'
|
|
88
|
+
};
|
|
89
|
+
const bodyStyle = {
|
|
90
|
+
color: bodyColor,
|
|
91
|
+
fontSize: bodyFontSize,
|
|
92
|
+
fontFamily: bodyFontFamily,
|
|
93
|
+
lineHeight: bodyLineHeight,
|
|
94
|
+
fontWeight: String(bodyFontWeight),
|
|
95
|
+
textAlign: 'center'
|
|
96
|
+
};
|
|
97
|
+
const detailsStyle = {
|
|
98
|
+
color: detailsColor,
|
|
99
|
+
fontSize: detailsFontSize,
|
|
100
|
+
fontFamily: detailsFontFamily,
|
|
101
|
+
lineHeight: detailsLineHeight,
|
|
102
|
+
fontWeight: String(detailsFontWeight),
|
|
103
|
+
textAlign: 'center'
|
|
104
|
+
};
|
|
105
|
+
const mediaContent = /*#__PURE__*/(0, _react.isValidElement)(renderMedia) ? /*#__PURE__*/(0, _react.cloneElement)(renderMedia, {
|
|
106
|
+
modes
|
|
107
|
+
}) : renderMedia;
|
|
108
|
+
const defaultMedia = /*#__PURE__*/(0, _jsxRuntime.jsx)(_IconCapsule.default, {
|
|
109
|
+
iconName: iconName,
|
|
110
|
+
modes: {
|
|
111
|
+
...modes,
|
|
112
|
+
'Icon Capsule Size': 'L',
|
|
113
|
+
Emphasis: 'High',
|
|
114
|
+
'Semantic Intent': 'System',
|
|
115
|
+
AppearanceSystem: 'positive'
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
const detailLines = details?.split('\n') ?? [];
|
|
119
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
120
|
+
style: [containerStyle, style],
|
|
121
|
+
children: [mediaContent ?? defaultMedia, /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
122
|
+
style: messageContainerStyle,
|
|
123
|
+
children: [title ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
124
|
+
style: titleStyle,
|
|
125
|
+
children: title
|
|
126
|
+
}) : null, /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
127
|
+
style: subtextContainerStyle,
|
|
128
|
+
children: [subtitle ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
129
|
+
style: subtitleStyle,
|
|
130
|
+
children: subtitle
|
|
131
|
+
}) : null, body ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
132
|
+
style: bodyStyle,
|
|
133
|
+
children: body
|
|
134
|
+
}) : null]
|
|
135
|
+
})]
|
|
136
|
+
}), showDetails && details ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
137
|
+
style: {
|
|
138
|
+
alignItems: 'center'
|
|
139
|
+
},
|
|
140
|
+
children: detailLines.map((line, i) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
141
|
+
style: [detailsStyle, i < detailLines.length - 1 ? {
|
|
142
|
+
marginBottom: detailsParagraphSpacing
|
|
143
|
+
} : undefined],
|
|
144
|
+
children: line
|
|
145
|
+
}, i))
|
|
146
|
+
}) : null]
|
|
147
|
+
});
|
|
148
|
+
}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _figmaVariablesResolver = require("../../design-tokens/figma-variables-resolver");
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
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); }
|
|
12
|
+
function SegmentedControlSegment({
|
|
13
|
+
label,
|
|
14
|
+
active,
|
|
15
|
+
onPress,
|
|
16
|
+
modes = {}
|
|
17
|
+
}) {
|
|
18
|
+
const resolvedModes = {
|
|
19
|
+
...modes,
|
|
20
|
+
'SegmentedControl/Segment': active ? 'Active' : 'Idle'
|
|
21
|
+
};
|
|
22
|
+
const paddingHorizontal = (0, _figmaVariablesResolver.getVariableByName)('segment/padding/horizontal', resolvedModes) ?? 16;
|
|
23
|
+
const paddingVertical = (0, _figmaVariablesResolver.getVariableByName)('segment/padding/vertical', resolvedModes) ?? 12;
|
|
24
|
+
const radius = (0, _figmaVariablesResolver.getVariableByName)('segment/radius', resolvedModes) ?? 20;
|
|
25
|
+
const background = (0, _figmaVariablesResolver.getVariableByName)('segment/background', resolvedModes) ?? (active ? '#5d00b5' : 'transparent');
|
|
26
|
+
const foreground = (0, _figmaVariablesResolver.getVariableByName)('segment/foreground', resolvedModes) ?? (active ? '#ffffff' : '#0c0d10');
|
|
27
|
+
const fontSize = (0, _figmaVariablesResolver.getVariableByName)('segment/fontSize', resolvedModes) ?? 16;
|
|
28
|
+
const fontFamily = (0, _figmaVariablesResolver.getVariableByName)('segment/fontFamily', resolvedModes) ?? 'JioType Var';
|
|
29
|
+
const lineHeight = (0, _figmaVariablesResolver.getVariableByName)('segment/lineHeight', resolvedModes) ?? 19;
|
|
30
|
+
const fontWeight = (0, _figmaVariablesResolver.getVariableByName)('segment/fontWeight', resolvedModes) ?? '500';
|
|
31
|
+
const segmentStyle = {
|
|
32
|
+
flex: 1,
|
|
33
|
+
alignItems: 'center',
|
|
34
|
+
justifyContent: 'center',
|
|
35
|
+
paddingHorizontal,
|
|
36
|
+
paddingVertical,
|
|
37
|
+
borderRadius: radius,
|
|
38
|
+
backgroundColor: background
|
|
39
|
+
};
|
|
40
|
+
const textStyle = {
|
|
41
|
+
color: foreground,
|
|
42
|
+
fontFamily,
|
|
43
|
+
fontSize,
|
|
44
|
+
lineHeight,
|
|
45
|
+
fontWeight: fontWeight
|
|
46
|
+
};
|
|
47
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
|
|
48
|
+
style: ({
|
|
49
|
+
pressed
|
|
50
|
+
}) => [segmentStyle, pressed && {
|
|
51
|
+
opacity: 0.8
|
|
52
|
+
}],
|
|
53
|
+
onPress: onPress,
|
|
54
|
+
accessibilityRole: "tab",
|
|
55
|
+
accessibilityState: {
|
|
56
|
+
selected: active
|
|
57
|
+
},
|
|
58
|
+
accessibilityLabel: label,
|
|
59
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
60
|
+
style: textStyle,
|
|
61
|
+
children: label
|
|
62
|
+
})
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* SegmentedControl component backed by Figma design tokens.
|
|
68
|
+
*
|
|
69
|
+
* Provides a horizontal row of mutually exclusive segments.
|
|
70
|
+
* Supports controlled (`selectedKey` + `onSelectionChange`) and
|
|
71
|
+
* uncontrolled (`defaultSelectedKey`) usage patterns.
|
|
72
|
+
*
|
|
73
|
+
* @component
|
|
74
|
+
* @param {SegmentedControlProps} props
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```tsx
|
|
78
|
+
* const [selected, setSelected] = useState<React.Key>('daily');
|
|
79
|
+
*
|
|
80
|
+
* <SegmentedControl
|
|
81
|
+
* items={[
|
|
82
|
+
* { key: 'daily', label: 'Daily' },
|
|
83
|
+
* { key: 'weekly', label: 'Weekly' },
|
|
84
|
+
* { key: 'monthly', label: 'Monthly' },
|
|
85
|
+
* ]}
|
|
86
|
+
* selectedKey={selected}
|
|
87
|
+
* onSelectionChange={setSelected}
|
|
88
|
+
* modes={{ 'Color Mode': 'Light' }}
|
|
89
|
+
* />
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
92
|
+
function SegmentedControl({
|
|
93
|
+
items,
|
|
94
|
+
selectedKey: controlledSelectedKey,
|
|
95
|
+
defaultSelectedKey,
|
|
96
|
+
onSelectionChange,
|
|
97
|
+
modes = {},
|
|
98
|
+
style
|
|
99
|
+
}) {
|
|
100
|
+
const isControlled = controlledSelectedKey !== undefined;
|
|
101
|
+
const [internalSelectedKey, setInternalSelectedKey] = (0, _react.useState)(defaultSelectedKey ?? items[0]?.key);
|
|
102
|
+
const currentSelectedKey = isControlled ? controlledSelectedKey : internalSelectedKey;
|
|
103
|
+
const handlePress = (0, _react.useCallback)(key => {
|
|
104
|
+
if (!isControlled) {
|
|
105
|
+
setInternalSelectedKey(key);
|
|
106
|
+
}
|
|
107
|
+
onSelectionChange?.(key);
|
|
108
|
+
}, [isControlled, onSelectionChange]);
|
|
109
|
+
const gap = (0, _figmaVariablesResolver.getVariableByName)('segmentedControl/gap', modes) ?? 8;
|
|
110
|
+
const background = (0, _figmaVariablesResolver.getVariableByName)('segmentedControl/background', modes) ?? '#f6f3ff';
|
|
111
|
+
const radius = (0, _figmaVariablesResolver.getVariableByName)('segmentedControl/radius', modes) ?? 24;
|
|
112
|
+
const containerStyle = {
|
|
113
|
+
flexDirection: 'row',
|
|
114
|
+
alignItems: 'center',
|
|
115
|
+
backgroundColor: background,
|
|
116
|
+
borderRadius: radius,
|
|
117
|
+
gap,
|
|
118
|
+
overflow: 'hidden'
|
|
119
|
+
};
|
|
120
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
121
|
+
style: [containerStyle, style],
|
|
122
|
+
accessibilityRole: "tablist",
|
|
123
|
+
children: items.map(item => /*#__PURE__*/(0, _jsxRuntime.jsx)(SegmentedControlSegment, {
|
|
124
|
+
label: item.label,
|
|
125
|
+
active: item.key === currentSelectedKey,
|
|
126
|
+
onPress: () => handlePress(item.key),
|
|
127
|
+
modes: modes
|
|
128
|
+
}, String(item.key)))
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
var _default = exports.default = SegmentedControl;
|
|
@@ -13,10 +13,9 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
13
13
|
const STATUS_ICON_MAP = {
|
|
14
14
|
Neutral: 'ic_info',
|
|
15
15
|
Warning: 'ic_warning',
|
|
16
|
-
// Using ic_warning for Warning
|
|
17
16
|
Error: 'ic_warning',
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
Success: 'ic_status_successful',
|
|
18
|
+
Loading: 'ic_time'
|
|
20
19
|
};
|
|
21
20
|
function SupportTextIcon({
|
|
22
21
|
status = 'Neutral',
|
|
@@ -9,8 +9,13 @@ var _reactNative = require("react-native");
|
|
|
9
9
|
var _figmaVariablesResolver = require("../../design-tokens/figma-variables-resolver");
|
|
10
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
const TEXT_ALIGN_MAP = {
|
|
13
|
+
Left: 'left',
|
|
14
|
+
Center: 'center'
|
|
15
|
+
};
|
|
12
16
|
function Text({
|
|
13
17
|
text = 'Korem ipsum ',
|
|
18
|
+
textAlign = 'Left',
|
|
14
19
|
modes = {},
|
|
15
20
|
style,
|
|
16
21
|
numberOfLines
|
|
@@ -27,7 +32,8 @@ function Text({
|
|
|
27
32
|
fontSize: fontSize,
|
|
28
33
|
fontWeight: String(fontWeight),
|
|
29
34
|
lineHeight: lineHeight,
|
|
30
|
-
letterSpacing: letterSpacing
|
|
35
|
+
letterSpacing: letterSpacing,
|
|
36
|
+
textAlign: TEXT_ALIGN_MAP[textAlign]
|
|
31
37
|
};
|
|
32
38
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
33
39
|
style: [textStyle, style],
|
|
@@ -11,9 +11,9 @@ var _JFSThemeProvider = require("../../design-tokens/JFSThemeProvider");
|
|
|
11
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
12
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
14
|
+
* Title component that mirrors the Figma "Title" component.
|
|
15
15
|
*
|
|
16
|
-
* This component displays a
|
|
16
|
+
* This component displays a title with design-token driven styling
|
|
17
17
|
* via `getVariableByName` and `modes`.
|
|
18
18
|
*
|
|
19
19
|
* @component
|
|
@@ -25,8 +25,13 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
25
25
|
* @param {string} [props.accessibilityLabel] - Accessibility label for screen readers. If not provided, uses title
|
|
26
26
|
* @param {string} [props.accessibilityHint] - Additional accessibility hint for screen readers
|
|
27
27
|
*/
|
|
28
|
-
|
|
28
|
+
const TEXT_ALIGN_MAP = {
|
|
29
|
+
Left: 'left',
|
|
30
|
+
Center: 'center'
|
|
31
|
+
};
|
|
32
|
+
function Title({
|
|
29
33
|
title = 'Page Title',
|
|
34
|
+
textAlign = 'Left',
|
|
30
35
|
modes: propModes = {},
|
|
31
36
|
style,
|
|
32
37
|
textStyle,
|
|
@@ -42,21 +47,18 @@ function PageTitle({
|
|
|
42
47
|
...globalModes,
|
|
43
48
|
...propModes
|
|
44
49
|
};
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
const
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
const
|
|
52
|
-
const fontSize = (0, _figmaVariablesResolver.getVariableByName)('pageTitle/fontSize', modes) || 26;
|
|
53
|
-
const lineHeight = (0, _figmaVariablesResolver.getVariableByName)('pageTitle/lineHeight', modes) || 26;
|
|
54
|
-
const fontFamily = (0, _figmaVariablesResolver.getVariableByName)('pageTitle/fontFamily', modes) || 'System';
|
|
55
|
-
const fontWeightRaw = (0, _figmaVariablesResolver.getVariableByName)('pageTitle/fontWeight', modes) || 700;
|
|
50
|
+
const paddingHorizontal = (0, _figmaVariablesResolver.getVariableByName)('title/padding/horizontal', modes) || 16;
|
|
51
|
+
const paddingVertical = (0, _figmaVariablesResolver.getVariableByName)('title/padding/vertical', modes) || 8;
|
|
52
|
+
const labelColor = (0, _figmaVariablesResolver.getVariableByName)('title/label/color', modes) || '#0d0d0f';
|
|
53
|
+
const fontSize = (0, _figmaVariablesResolver.getVariableByName)('title/fontSize', modes) || 26;
|
|
54
|
+
const lineHeight = (0, _figmaVariablesResolver.getVariableByName)('title/lineHeight', modes) || 26;
|
|
55
|
+
const fontFamily = (0, _figmaVariablesResolver.getVariableByName)('title/fontFamily', modes) || 'System';
|
|
56
|
+
const fontWeightRaw = (0, _figmaVariablesResolver.getVariableByName)('title/fontWeight', modes) || 700;
|
|
56
57
|
const fontWeight = typeof fontWeightRaw === 'number' ? fontWeightRaw.toString() : fontWeightRaw;
|
|
57
58
|
const containerStyle = {
|
|
58
|
-
flexDirection: '
|
|
59
|
-
alignItems: 'center',
|
|
59
|
+
flexDirection: 'column',
|
|
60
|
+
alignItems: textAlign === 'Center' ? 'center' : 'stretch',
|
|
61
|
+
justifyContent: 'center',
|
|
60
62
|
paddingHorizontal,
|
|
61
63
|
paddingVertical,
|
|
62
64
|
width: '100%'
|
|
@@ -67,10 +69,9 @@ function PageTitle({
|
|
|
67
69
|
lineHeight,
|
|
68
70
|
fontFamily,
|
|
69
71
|
fontWeight,
|
|
70
|
-
flexShrink: 1
|
|
72
|
+
flexShrink: 1,
|
|
73
|
+
textAlign: TEXT_ALIGN_MAP[textAlign]
|
|
71
74
|
};
|
|
72
|
-
|
|
73
|
-
// Use provided accessibilityLabel or fall back to title
|
|
74
75
|
const defaultAccessibilityLabel = accessibilityLabel || title;
|
|
75
76
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
76
77
|
style: [containerStyle, style],
|
|
@@ -87,4 +88,4 @@ function PageTitle({
|
|
|
87
88
|
})
|
|
88
89
|
});
|
|
89
90
|
}
|
|
90
|
-
var _default = exports.default =
|
|
91
|
+
var _default = exports.default = Title;
|
|
@@ -33,6 +33,7 @@ const DEFAULT_AVATAR_IMAGE = require('./Image.png');
|
|
|
33
33
|
* @param {boolean} [props.showIcon=true] - Toggles the trailing icon visibility.
|
|
34
34
|
* @param {string} [props.iconName='ic_scan_qr_code'] - Icon name from the actions set (e.g. 'ic_qr_code', 'ic_scan_qr_code').
|
|
35
35
|
* @param {ImageSourcePropType} [props.avatarSource] - Optional custom image source for the avatar.
|
|
36
|
+
* @param {Function} [props.onClick] - Click/tap handler. Works as an alias for `onPress`.
|
|
36
37
|
* @param {string} [props.accessibilityLabel] - Accessibility label for screen readers. If not provided, uses label
|
|
37
38
|
* @param {string} [props.accessibilityHint] - Additional accessibility hint for screen readers
|
|
38
39
|
*/
|
|
@@ -43,6 +44,7 @@ function UpiHandle({
|
|
|
43
44
|
iconName = 'ic_scan_qr_code',
|
|
44
45
|
avatarSource,
|
|
45
46
|
onPress,
|
|
47
|
+
onClick,
|
|
46
48
|
disabled,
|
|
47
49
|
accessibilityLabel,
|
|
48
50
|
accessibilityHint,
|
|
@@ -120,7 +122,8 @@ function UpiHandle({
|
|
|
120
122
|
borderWidth: 1,
|
|
121
123
|
borderColor: '#222'
|
|
122
124
|
} : null;
|
|
123
|
-
const
|
|
125
|
+
const handlePress = onPress || onClick;
|
|
126
|
+
const Wrapper = rest?.onPress || handlePress ? _reactNative.Pressable : _reactNative.View;
|
|
124
127
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Wrapper, {
|
|
125
128
|
style: [containerStyle, pressedStyle, focusStyle],
|
|
126
129
|
accessibilityRole: "text",
|
|
@@ -128,7 +131,7 @@ function UpiHandle({
|
|
|
128
131
|
...(accessibilityHint !== undefined ? {
|
|
129
132
|
accessibilityHint
|
|
130
133
|
} : {}),
|
|
131
|
-
onPress:
|
|
134
|
+
onPress: handlePress,
|
|
132
135
|
disabled: rest?.disabled ?? disabled,
|
|
133
136
|
onPressIn: e => {
|
|
134
137
|
setIsPressed(true);
|