jfs-components 0.0.44 → 0.0.45
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/EmptyState/EmptyState.js +2 -1
- package/lib/commonjs/components/OTP/OTP.js +242 -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/StatItem/StatItem.js +61 -0
- package/lib/commonjs/components/SwappableAmount/SwappableAmount.js +71 -0
- package/lib/commonjs/components/Text/Text.js +38 -0
- package/lib/commonjs/components/Toggle/Toggle.js +102 -0
- package/lib/commonjs/components/index.js +63 -0
- 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/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/EmptyState/EmptyState.js +2 -1
- package/lib/module/components/OTP/OTP.js +236 -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/StatItem/StatItem.js +56 -0
- package/lib/module/components/SwappableAmount/SwappableAmount.js +66 -0
- package/lib/module/components/Text/Text.js +33 -0
- package/lib/module/components/Toggle/Toggle.js +97 -0
- package/lib/module/components/index.js +10 -1
- 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/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/EmptyState/EmptyState.d.ts +6 -1
- package/lib/typescript/src/components/OTP/OTP.d.ts +36 -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/StatItem/StatItem.d.ts +21 -0
- package/lib/typescript/src/components/SwappableAmount/SwappableAmount.d.ts +22 -0
- package/lib/typescript/src/components/Text/Text.d.ts +14 -0
- package/lib/typescript/src/components/Toggle/Toggle.d.ts +29 -0
- package/lib/typescript/src/components/index.d.ts +9 -0
- package/lib/typescript/src/icons/registry.d.ts +1 -1
- package/package.json +1 -1
- 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/EmptyState/EmptyState.tsx +7 -1
- package/src/components/OTP/OTP.tsx +275 -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/StatItem/StatItem.tsx +71 -0
- package/src/components/SwappableAmount/SwappableAmount.tsx +92 -0
- package/src/components/Text/Text.tsx +48 -0
- package/src/components/Toggle/Toggle.tsx +122 -0
- package/src/components/index.ts +9 -0
- 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/lib/commonjs/design-tokens/JFS Variables-variables-full.json +0 -1
- package/lib/module/design-tokens/JFS Variables-variables-full.json +0 -1
- package/src/design-tokens/JFS Variables-variables-full.json +0 -1
|
@@ -0,0 +1,130 @@
|
|
|
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 _Icon = _interopRequireDefault(require("../../icons/Icon"));
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
/**
|
|
14
|
+
* ProgressBadge component that displays an icon, text, and an internal progress bar.
|
|
15
|
+
*
|
|
16
|
+
* All visual attributes resolve from Figma tokens via `getVariableByName` using the provided `modes`.
|
|
17
|
+
*
|
|
18
|
+
* @component
|
|
19
|
+
* @param {Object} props
|
|
20
|
+
* @param {string} [props.taskName="Live price: [price] (00:43)"] - The text displayed.
|
|
21
|
+
* @param {string} [props.iconName="ic_live"] - Icon name from the registry.
|
|
22
|
+
* @param {number} [props.value=0] - The progress value between 0 and 100.
|
|
23
|
+
* @param {Object} [props.modes={}] - Modes object passed to `getVariableByName` for design tokens.
|
|
24
|
+
* @param {Object} [props.style] - Optional container style overrides.
|
|
25
|
+
* @param {Object} [props.textStyle] - Optional text style overrides.
|
|
26
|
+
* @param {string} [props.accessibilityLabel] - Accessibility label.
|
|
27
|
+
*/
|
|
28
|
+
function ProgressBadge({
|
|
29
|
+
taskName = 'Live price: [price] (00:43)',
|
|
30
|
+
iconName = 'ic_live',
|
|
31
|
+
value = 0,
|
|
32
|
+
modes = {},
|
|
33
|
+
style,
|
|
34
|
+
textStyle: textStyleOverride,
|
|
35
|
+
accessibilityLabel,
|
|
36
|
+
...rest
|
|
37
|
+
}) {
|
|
38
|
+
// Resolve layout tokens
|
|
39
|
+
const backgroundColor = (0, _figmaVariablesResolver.getVariableByName)('progressBadge/background', modes) || '#ffffff';
|
|
40
|
+
const progressColor = (0, _figmaVariablesResolver.getVariableByName)('progressBadge/progress/color', modes) || '#ebebed';
|
|
41
|
+
const gap = (0, _figmaVariablesResolver.getVariableByName)('progressBadge/gap', modes) ?? 12;
|
|
42
|
+
const paddingHorizontal = (0, _figmaVariablesResolver.getVariableByName)('progressBadge/padding/horizontal', modes) ?? 16;
|
|
43
|
+
const paddingVertical = (0, _figmaVariablesResolver.getVariableByName)('progressBadge/padding/vertical', modes) ?? 6;
|
|
44
|
+
const borderRadius = (0, _figmaVariablesResolver.getVariableByName)('progressBadge/radius', modes) ?? 999;
|
|
45
|
+
const descriptionGap = (0, _figmaVariablesResolver.getVariableByName)('progressBadge/description/gap', modes) ?? 8;
|
|
46
|
+
|
|
47
|
+
// Resolve typography tokens
|
|
48
|
+
const fontFamily = (0, _figmaVariablesResolver.getVariableByName)('progressBadge/fontFamily', modes) || 'JioType_Var:Medium';
|
|
49
|
+
const fontWeightRaw = (0, _figmaVariablesResolver.getVariableByName)('progressBadge/fontWeight', modes) ?? 500;
|
|
50
|
+
const fontWeight = typeof fontWeightRaw === 'number' ? fontWeightRaw.toString() : fontWeightRaw;
|
|
51
|
+
const fontSize = (0, _figmaVariablesResolver.getVariableByName)('progressBadge/fontSize', modes) ?? 14;
|
|
52
|
+
const lineHeight = (0, _figmaVariablesResolver.getVariableByName)('progressBadge/lineHeight', modes) ?? 17;
|
|
53
|
+
const textColor = (0, _figmaVariablesResolver.getVariableByName)('progressBadge/foreground', modes) || '#000000';
|
|
54
|
+
|
|
55
|
+
// Resolve icon tokens
|
|
56
|
+
const iconColor = (0, _figmaVariablesResolver.getVariableByName)('progressBadge/icon/color', modes) || '#f50030';
|
|
57
|
+
const iconSize = (0, _figmaVariablesResolver.getVariableByName)('progressBadge/icon/size', modes) ?? 18;
|
|
58
|
+
const containerStyle = {
|
|
59
|
+
backgroundColor,
|
|
60
|
+
flexDirection: 'row',
|
|
61
|
+
alignItems: 'center',
|
|
62
|
+
gap,
|
|
63
|
+
paddingHorizontal,
|
|
64
|
+
paddingVertical,
|
|
65
|
+
borderRadius,
|
|
66
|
+
overflow: 'hidden',
|
|
67
|
+
position: 'relative',
|
|
68
|
+
flexWrap: 'wrap'
|
|
69
|
+
};
|
|
70
|
+
const descriptionContainerStyle = {
|
|
71
|
+
flexDirection: 'row',
|
|
72
|
+
alignItems: 'center',
|
|
73
|
+
justifyContent: 'center',
|
|
74
|
+
gap: descriptionGap,
|
|
75
|
+
flex: 1,
|
|
76
|
+
paddingVertical: 0,
|
|
77
|
+
minHeight: 1,
|
|
78
|
+
minWidth: 1,
|
|
79
|
+
position: 'relative'
|
|
80
|
+
};
|
|
81
|
+
const textStyle = {
|
|
82
|
+
fontFamily,
|
|
83
|
+
fontWeight,
|
|
84
|
+
fontSize,
|
|
85
|
+
lineHeight,
|
|
86
|
+
color: textColor,
|
|
87
|
+
textAlign: 'center',
|
|
88
|
+
overflow: 'hidden',
|
|
89
|
+
flexShrink: 0
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
// Ensure value is between 0 and 100
|
|
93
|
+
const clampedValue = Math.max(0, Math.min(100, value));
|
|
94
|
+
const progressStyle = {
|
|
95
|
+
position: 'absolute',
|
|
96
|
+
left: 0,
|
|
97
|
+
top: 0,
|
|
98
|
+
bottom: 0,
|
|
99
|
+
width: `${clampedValue}%`,
|
|
100
|
+
backgroundColor: progressColor
|
|
101
|
+
};
|
|
102
|
+
const defaultAccessibilityLabel = accessibilityLabel || taskName;
|
|
103
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
104
|
+
style: [containerStyle, style],
|
|
105
|
+
accessibilityRole: "text",
|
|
106
|
+
accessibilityLabel: defaultAccessibilityLabel,
|
|
107
|
+
...rest,
|
|
108
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
109
|
+
style: progressStyle,
|
|
110
|
+
pointerEvents: "none"
|
|
111
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
112
|
+
style: descriptionContainerStyle,
|
|
113
|
+
children: [iconName ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
|
|
114
|
+
name: iconName,
|
|
115
|
+
size: iconSize,
|
|
116
|
+
color: iconColor,
|
|
117
|
+
accessibilityElementsHidden: true,
|
|
118
|
+
importantForAccessibility: "no"
|
|
119
|
+
}) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
120
|
+
style: [textStyle, textStyleOverride],
|
|
121
|
+
numberOfLines: 1,
|
|
122
|
+
ellipsizeMode: "tail",
|
|
123
|
+
accessibilityElementsHidden: true,
|
|
124
|
+
importantForAccessibility: "no",
|
|
125
|
+
children: taskName
|
|
126
|
+
})]
|
|
127
|
+
})]
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
var _default = exports.default = ProgressBadge;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _exportNames = {};
|
|
7
|
+
Object.defineProperty(exports, "default", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () {
|
|
10
|
+
return _ProgressBadge.default;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
var _ProgressBadge = _interopRequireWildcard(require("./ProgressBadge"));
|
|
14
|
+
Object.keys(_ProgressBadge).forEach(function (key) {
|
|
15
|
+
if (key === "default" || key === "__esModule") return;
|
|
16
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
17
|
+
if (key in exports && exports[key] === _ProgressBadge[key]) return;
|
|
18
|
+
Object.defineProperty(exports, key, {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _ProgressBadge[key];
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
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); }
|
|
@@ -0,0 +1,61 @@
|
|
|
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 _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
/**
|
|
13
|
+
* StatItem displays a label/value pair with the value in a large, bold style.
|
|
14
|
+
* Useful for metrics, product stats, or KPI callouts.
|
|
15
|
+
*
|
|
16
|
+
* @component
|
|
17
|
+
* @param {StatItemProps} props
|
|
18
|
+
*/
|
|
19
|
+
function StatItem({
|
|
20
|
+
label = 'Purity verified by NABL',
|
|
21
|
+
value = '99.99%',
|
|
22
|
+
modes = {},
|
|
23
|
+
style
|
|
24
|
+
}) {
|
|
25
|
+
const gap = (0, _figmaVariablesResolver.getVariableByName)('statItem/gap', modes) ?? 2;
|
|
26
|
+
const labelForeground = (0, _figmaVariablesResolver.getVariableByName)('statItem/label/foreground', modes) ?? '#1a1c1f';
|
|
27
|
+
const labelFontFamily = (0, _figmaVariablesResolver.getVariableByName)('statItem/label/fontFamily', modes) ?? 'JioType Var';
|
|
28
|
+
const labelFontSize = (0, _figmaVariablesResolver.getVariableByName)('statItem/label/fontSize', modes) ?? 12;
|
|
29
|
+
const labelFontWeight = (0, _figmaVariablesResolver.getVariableByName)('statItem/label/fontWeight', modes) ?? '500';
|
|
30
|
+
const labelLineHeight = (0, _figmaVariablesResolver.getVariableByName)('statItem/label/lineHeight', modes) ?? 16;
|
|
31
|
+
const valueForeground = (0, _figmaVariablesResolver.getVariableByName)('statItem/value/foreground', modes) ?? '#0d0d0f';
|
|
32
|
+
const valueFontFamily = (0, _figmaVariablesResolver.getVariableByName)('statItem/value/fontFamily', modes) ?? 'JioType Var';
|
|
33
|
+
const valueFontSize = (0, _figmaVariablesResolver.getVariableByName)('statItem/value/fontSize', modes) ?? 26;
|
|
34
|
+
const valueFontWeight = (0, _figmaVariablesResolver.getVariableByName)('statItem/value/fontWeight', modes) ?? '900';
|
|
35
|
+
const valueLineHeight = (0, _figmaVariablesResolver.getVariableByName)('statItem/value/lineHeight', modes) ?? 26;
|
|
36
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
37
|
+
style: [{
|
|
38
|
+
gap: gap
|
|
39
|
+
}, style],
|
|
40
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
41
|
+
style: {
|
|
42
|
+
color: labelForeground,
|
|
43
|
+
fontFamily: labelFontFamily,
|
|
44
|
+
fontSize: labelFontSize,
|
|
45
|
+
fontWeight: String(labelFontWeight),
|
|
46
|
+
lineHeight: labelLineHeight
|
|
47
|
+
},
|
|
48
|
+
children: label
|
|
49
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
50
|
+
style: {
|
|
51
|
+
color: valueForeground,
|
|
52
|
+
fontFamily: valueFontFamily,
|
|
53
|
+
fontSize: valueFontSize,
|
|
54
|
+
fontWeight: String(valueFontWeight),
|
|
55
|
+
lineHeight: valueLineHeight
|
|
56
|
+
},
|
|
57
|
+
children: value
|
|
58
|
+
})]
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
var _default = exports.default = StatItem;
|
|
@@ -0,0 +1,71 @@
|
|
|
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 _Button = _interopRequireDefault(require("../Button/Button"));
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
function SwappableAmount({
|
|
14
|
+
value = '49g',
|
|
15
|
+
schedule = false,
|
|
16
|
+
scheduleLabel = 'Weekly on Mondays',
|
|
17
|
+
amountLabel = '₹5100',
|
|
18
|
+
onSchedulePress,
|
|
19
|
+
onAmountPress,
|
|
20
|
+
modes = {},
|
|
21
|
+
style
|
|
22
|
+
}) {
|
|
23
|
+
const gap = (0, _figmaVariablesResolver.getVariableByName)('swappableAmount/gap', modes) ?? 24;
|
|
24
|
+
const padding = (0, _figmaVariablesResolver.getVariableByName)('swappableAmount/padding', modes) ?? 8;
|
|
25
|
+
const foreground = (0, _figmaVariablesResolver.getVariableByName)('swappableAmount/foreground', modes) ?? '#0d0d0f';
|
|
26
|
+
const fontSize = (0, _figmaVariablesResolver.getVariableByName)('swappableAmount/fontSize', modes) ?? 56;
|
|
27
|
+
const fontFamily = (0, _figmaVariablesResolver.getVariableByName)('swappableAmount/fontFamily', modes) ?? 'System';
|
|
28
|
+
const fontWeight = (0, _figmaVariablesResolver.getVariableByName)('swappableAmount/fontWeight', modes) ?? 900;
|
|
29
|
+
const lineHeight = (0, _figmaVariablesResolver.getVariableByName)('swappableAmount/lineHeight', modes) ?? 56;
|
|
30
|
+
const containerStyle = {
|
|
31
|
+
flexDirection: 'column',
|
|
32
|
+
alignItems: 'center',
|
|
33
|
+
justifyContent: 'center',
|
|
34
|
+
gap: gap,
|
|
35
|
+
padding: padding
|
|
36
|
+
};
|
|
37
|
+
const valueTextStyle = {
|
|
38
|
+
color: foreground,
|
|
39
|
+
fontSize: fontSize,
|
|
40
|
+
fontFamily: fontFamily,
|
|
41
|
+
fontWeight: String(fontWeight),
|
|
42
|
+
lineHeight: lineHeight
|
|
43
|
+
};
|
|
44
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
45
|
+
style: [containerStyle, style],
|
|
46
|
+
children: [schedule && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
|
|
47
|
+
label: scheduleLabel,
|
|
48
|
+
icon: "ic_calendar_week",
|
|
49
|
+
onPress: onSchedulePress,
|
|
50
|
+
modes: {
|
|
51
|
+
...modes,
|
|
52
|
+
AppearanceBrand: 'Neutral',
|
|
53
|
+
Emphasis: 'Low',
|
|
54
|
+
'Button / Size': 'S'
|
|
55
|
+
}
|
|
56
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
57
|
+
style: valueTextStyle,
|
|
58
|
+
children: value
|
|
59
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
|
|
60
|
+
label: amountLabel,
|
|
61
|
+
icon: "ic_data_in_out",
|
|
62
|
+
onPress: onAmountPress,
|
|
63
|
+
modes: {
|
|
64
|
+
...modes,
|
|
65
|
+
Emphasis: 'Medium',
|
|
66
|
+
AppearanceBrand: 'Secondary'
|
|
67
|
+
}
|
|
68
|
+
})]
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
var _default = exports.default = SwappableAmount;
|
|
@@ -0,0 +1,38 @@
|
|
|
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 _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
function Text({
|
|
13
|
+
text = 'Korem ipsum ',
|
|
14
|
+
modes = {},
|
|
15
|
+
style,
|
|
16
|
+
numberOfLines
|
|
17
|
+
}) {
|
|
18
|
+
const foreground = (0, _figmaVariablesResolver.getVariableByName)('text/foreground', modes) ?? '#000000';
|
|
19
|
+
const fontFamily = (0, _figmaVariablesResolver.getVariableByName)('text/fontFamily', modes) ?? 'JioType';
|
|
20
|
+
const fontSize = (0, _figmaVariablesResolver.getVariableByName)('text/fontSize', modes) ?? 14;
|
|
21
|
+
const fontWeight = (0, _figmaVariablesResolver.getVariableByName)('text/fontWeight', modes) ?? '500';
|
|
22
|
+
const lineHeight = (0, _figmaVariablesResolver.getVariableByName)('text/lineHeight', modes) ?? 20;
|
|
23
|
+
const letterSpacing = (0, _figmaVariablesResolver.getVariableByName)('text/letterSpacing', modes) ?? -0.5;
|
|
24
|
+
const textStyle = {
|
|
25
|
+
color: foreground,
|
|
26
|
+
fontFamily: fontFamily,
|
|
27
|
+
fontSize: fontSize,
|
|
28
|
+
fontWeight: String(fontWeight),
|
|
29
|
+
lineHeight: lineHeight,
|
|
30
|
+
letterSpacing: letterSpacing
|
|
31
|
+
};
|
|
32
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
33
|
+
style: [textStyle, style],
|
|
34
|
+
numberOfLines: numberOfLines,
|
|
35
|
+
children: text
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
var _default = exports.default = Text;
|
|
@@ -0,0 +1,102 @@
|
|
|
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
|
+
/**
|
|
13
|
+
* Toggle (switch) component that maps directly to the Figma design using design tokens.
|
|
14
|
+
*
|
|
15
|
+
* Supports controlled and uncontrolled usage, on/off states, and disabled state.
|
|
16
|
+
* All styling is driven by design tokens with optional mode overrides.
|
|
17
|
+
*
|
|
18
|
+
* @component
|
|
19
|
+
* @param {ToggleProps} props
|
|
20
|
+
*/
|
|
21
|
+
function Toggle({
|
|
22
|
+
value: controlledValue,
|
|
23
|
+
defaultValue = false,
|
|
24
|
+
onValueChange,
|
|
25
|
+
disabled = false,
|
|
26
|
+
modes = {},
|
|
27
|
+
style,
|
|
28
|
+
accessibilityLabel
|
|
29
|
+
}) {
|
|
30
|
+
const isControlled = controlledValue !== undefined;
|
|
31
|
+
const [internalValue, setInternalValue] = (0, _react.useState)(defaultValue);
|
|
32
|
+
const isOn = isControlled ? controlledValue : internalValue;
|
|
33
|
+
const toggleState = disabled ? isOn ? 'Disabled On' : 'Disabled Off' : isOn ? 'On' : 'Off';
|
|
34
|
+
const resolvedModes = {
|
|
35
|
+
...modes,
|
|
36
|
+
'Toggle States': toggleState
|
|
37
|
+
};
|
|
38
|
+
const width = (0, _figmaVariablesResolver.getVariableByName)('toggle/width', resolvedModes) ?? 52;
|
|
39
|
+
const radius = (0, _figmaVariablesResolver.getVariableByName)('toggle/radius', resolvedModes) ?? 100;
|
|
40
|
+
const paddingTrack = (0, _figmaVariablesResolver.getVariableByName)('toggle/padding/track', resolvedModes) ?? 3;
|
|
41
|
+
const background = (0, _figmaVariablesResolver.getVariableByName)('toggle/background', resolvedModes) ?? (isOn ? '#5d00b5' : '#c7c7cc');
|
|
42
|
+
const thumbSize = (0, _figmaVariablesResolver.getVariableByName)('toggle/thumb/size', resolvedModes) ?? 25;
|
|
43
|
+
const thumbRadius = (0, _figmaVariablesResolver.getVariableByName)('toggle/thumb/radius', resolvedModes) ?? 100;
|
|
44
|
+
const thumbBackground = (0, _figmaVariablesResolver.getVariableByName)('toggle/thumb/background', resolvedModes) ?? '#ffffff';
|
|
45
|
+
const thumbShadowColor = (0, _figmaVariablesResolver.getVariableByName)('toggle/thumb/shadow/color', resolvedModes) ?? 'rgba(0,0,0,0.18)';
|
|
46
|
+
const thumbShadowRadius = (0, _figmaVariablesResolver.getVariableByName)('toggle/thumb/shadow/radius', resolvedModes) ?? 4;
|
|
47
|
+
const thumbShadowOffsetX = (0, _figmaVariablesResolver.getVariableByName)('toggle/thumb/shadow/offsetX', resolvedModes) ?? 0;
|
|
48
|
+
const thumbShadowOffsetY = (0, _figmaVariablesResolver.getVariableByName)('toggle/thumb/shadow/offsetY', resolvedModes) ?? 2;
|
|
49
|
+
const trackHeight = thumbSize + paddingTrack * 2;
|
|
50
|
+
const handlePress = (0, _react.useCallback)(() => {
|
|
51
|
+
if (disabled) return;
|
|
52
|
+
const next = !isOn;
|
|
53
|
+
if (!isControlled) {
|
|
54
|
+
setInternalValue(next);
|
|
55
|
+
}
|
|
56
|
+
onValueChange?.(next);
|
|
57
|
+
}, [disabled, isOn, isControlled, onValueChange]);
|
|
58
|
+
const trackStyle = {
|
|
59
|
+
width: width,
|
|
60
|
+
height: trackHeight,
|
|
61
|
+
borderRadius: radius,
|
|
62
|
+
backgroundColor: background,
|
|
63
|
+
padding: paddingTrack,
|
|
64
|
+
justifyContent: 'center',
|
|
65
|
+
alignItems: isOn ? 'flex-end' : 'flex-start',
|
|
66
|
+
opacity: disabled ? 0.5 : 1
|
|
67
|
+
};
|
|
68
|
+
const thumbShadow = _reactNative.Platform.OS === 'web' ? {
|
|
69
|
+
boxShadow: `${thumbShadowOffsetX}px ${thumbShadowOffsetY}px ${thumbShadowRadius}px 0px ${thumbShadowColor}`
|
|
70
|
+
} : {
|
|
71
|
+
shadowColor: thumbShadowColor,
|
|
72
|
+
shadowOffset: {
|
|
73
|
+
width: thumbShadowOffsetX,
|
|
74
|
+
height: thumbShadowOffsetY
|
|
75
|
+
},
|
|
76
|
+
shadowRadius: thumbShadowRadius,
|
|
77
|
+
shadowOpacity: 1,
|
|
78
|
+
elevation: 4
|
|
79
|
+
};
|
|
80
|
+
const thumbStyle = {
|
|
81
|
+
width: thumbSize,
|
|
82
|
+
height: thumbSize,
|
|
83
|
+
borderRadius: thumbRadius,
|
|
84
|
+
backgroundColor: thumbBackground,
|
|
85
|
+
...thumbShadow
|
|
86
|
+
};
|
|
87
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
|
|
88
|
+
style: [trackStyle, style],
|
|
89
|
+
onPress: handlePress,
|
|
90
|
+
disabled: disabled,
|
|
91
|
+
accessibilityRole: "switch",
|
|
92
|
+
accessibilityState: {
|
|
93
|
+
checked: isOn,
|
|
94
|
+
disabled
|
|
95
|
+
},
|
|
96
|
+
accessibilityLabel: accessibilityLabel,
|
|
97
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
98
|
+
style: thumbStyle
|
|
99
|
+
})
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
var _default = exports.default = Toggle;
|
|
@@ -21,6 +21,12 @@ Object.defineProperty(exports, "ActionTile", {
|
|
|
21
21
|
return _ActionTile.default;
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
|
+
Object.defineProperty(exports, "AmountInput", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _AmountInput.default;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
24
30
|
Object.defineProperty(exports, "AppBar", {
|
|
25
31
|
enumerable: true,
|
|
26
32
|
get: function () {
|
|
@@ -87,6 +93,12 @@ Object.defineProperty(exports, "CardFeedback", {
|
|
|
87
93
|
return _CardFeedback.default;
|
|
88
94
|
}
|
|
89
95
|
});
|
|
96
|
+
Object.defineProperty(exports, "CardProviderInfo", {
|
|
97
|
+
enumerable: true,
|
|
98
|
+
get: function () {
|
|
99
|
+
return _CardProviderInfo.default;
|
|
100
|
+
}
|
|
101
|
+
});
|
|
90
102
|
Object.defineProperty(exports, "Checkbox", {
|
|
91
103
|
enumerable: true,
|
|
92
104
|
get: function () {
|
|
@@ -231,12 +243,30 @@ Object.defineProperty(exports, "Numpad", {
|
|
|
231
243
|
return _Numpad.default;
|
|
232
244
|
}
|
|
233
245
|
});
|
|
246
|
+
Object.defineProperty(exports, "OTP", {
|
|
247
|
+
enumerable: true,
|
|
248
|
+
get: function () {
|
|
249
|
+
return _OTP.default;
|
|
250
|
+
}
|
|
251
|
+
});
|
|
234
252
|
Object.defineProperty(exports, "PageTitle", {
|
|
235
253
|
enumerable: true,
|
|
236
254
|
get: function () {
|
|
237
255
|
return _PageTitle.default;
|
|
238
256
|
}
|
|
239
257
|
});
|
|
258
|
+
Object.defineProperty(exports, "PortfolioHero", {
|
|
259
|
+
enumerable: true,
|
|
260
|
+
get: function () {
|
|
261
|
+
return _PortfolioHero.default;
|
|
262
|
+
}
|
|
263
|
+
});
|
|
264
|
+
Object.defineProperty(exports, "ProductLabel", {
|
|
265
|
+
enumerable: true,
|
|
266
|
+
get: function () {
|
|
267
|
+
return _ProductLabel.default;
|
|
268
|
+
}
|
|
269
|
+
});
|
|
240
270
|
Object.defineProperty(exports, "RadioButton", {
|
|
241
271
|
enumerable: true,
|
|
242
272
|
get: function () {
|
|
@@ -255,6 +285,12 @@ Object.defineProperty(exports, "Section", {
|
|
|
255
285
|
return _Section.default;
|
|
256
286
|
}
|
|
257
287
|
});
|
|
288
|
+
Object.defineProperty(exports, "StatItem", {
|
|
289
|
+
enumerable: true,
|
|
290
|
+
get: function () {
|
|
291
|
+
return _StatItem.default;
|
|
292
|
+
}
|
|
293
|
+
});
|
|
258
294
|
Object.defineProperty(exports, "StatusHero", {
|
|
259
295
|
enumerable: true,
|
|
260
296
|
get: function () {
|
|
@@ -291,6 +327,12 @@ Object.defineProperty(exports, "SupportTextIcon", {
|
|
|
291
327
|
return _SupportTextIcon.default;
|
|
292
328
|
}
|
|
293
329
|
});
|
|
330
|
+
Object.defineProperty(exports, "SwappableAmount", {
|
|
331
|
+
enumerable: true,
|
|
332
|
+
get: function () {
|
|
333
|
+
return _SwappableAmount.default;
|
|
334
|
+
}
|
|
335
|
+
});
|
|
294
336
|
Object.defineProperty(exports, "TabItem", {
|
|
295
337
|
enumerable: true,
|
|
296
338
|
get: function () {
|
|
@@ -303,6 +345,12 @@ Object.defineProperty(exports, "Tabs", {
|
|
|
303
345
|
return _Tabs.default;
|
|
304
346
|
}
|
|
305
347
|
});
|
|
348
|
+
Object.defineProperty(exports, "Text", {
|
|
349
|
+
enumerable: true,
|
|
350
|
+
get: function () {
|
|
351
|
+
return _Text.default;
|
|
352
|
+
}
|
|
353
|
+
});
|
|
306
354
|
Object.defineProperty(exports, "TextInput", {
|
|
307
355
|
enumerable: true,
|
|
308
356
|
get: function () {
|
|
@@ -327,6 +375,12 @@ Object.defineProperty(exports, "ToastProvider", {
|
|
|
327
375
|
return _ToastProvider.default;
|
|
328
376
|
}
|
|
329
377
|
});
|
|
378
|
+
Object.defineProperty(exports, "Toggle", {
|
|
379
|
+
enumerable: true,
|
|
380
|
+
get: function () {
|
|
381
|
+
return _Toggle.default;
|
|
382
|
+
}
|
|
383
|
+
});
|
|
330
384
|
Object.defineProperty(exports, "Tooltip", {
|
|
331
385
|
enumerable: true,
|
|
332
386
|
get: function () {
|
|
@@ -437,6 +491,7 @@ var _Accordion = _interopRequireDefault(require("./Accordion/Accordion"));
|
|
|
437
491
|
var _ActionTile = _interopRequireDefault(require("./ActionTile/ActionTile"));
|
|
438
492
|
var _Balance = _interopRequireDefault(require("./Balance/Balance"));
|
|
439
493
|
var _ButtonGroup = _interopRequireDefault(require("./ButtonGroup/ButtonGroup"));
|
|
494
|
+
var _CardProviderInfo = _interopRequireDefault(require("./CardProviderInfo/CardProviderInfo"));
|
|
440
495
|
var _ChipSelect = _interopRequireDefault(require("./ChipSelect/ChipSelect"));
|
|
441
496
|
var _InputSearch = _interopRequireDefault(require("./InputSearch/InputSearch"));
|
|
442
497
|
var _SupportText = _interopRequireDefault(require("./SupportText/SupportText"));
|
|
@@ -447,5 +502,13 @@ var _TabItem = _interopRequireDefault(require("./Tabs/TabItem"));
|
|
|
447
502
|
var _Toast = _interopRequireDefault(require("./Toast/Toast"));
|
|
448
503
|
var _ToastProvider = _interopRequireDefault(require("./Toast/ToastProvider"));
|
|
449
504
|
var _useToast = require("./Toast/useToast");
|
|
505
|
+
var _AmountInput = _interopRequireDefault(require("./AmountInput/AmountInput"));
|
|
506
|
+
var _PortfolioHero = _interopRequireDefault(require("./PortfolioHero/PortfolioHero"));
|
|
507
|
+
var _ProductLabel = _interopRequireDefault(require("./ProductLabel/ProductLabel"));
|
|
508
|
+
var _SwappableAmount = _interopRequireDefault(require("./SwappableAmount/SwappableAmount"));
|
|
509
|
+
var _OTP = _interopRequireDefault(require("./OTP/OTP"));
|
|
510
|
+
var _StatItem = _interopRequireDefault(require("./StatItem/StatItem"));
|
|
511
|
+
var _Text = _interopRequireDefault(require("./Text/Text"));
|
|
512
|
+
var _Toggle = _interopRequireDefault(require("./Toggle/Toggle"));
|
|
450
513
|
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); }
|
|
451
514
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|