jfs-components 0.0.73 → 0.0.77
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/CHANGELOG.md +115 -6
- package/lib/commonjs/components/AccountCard/AccountCard.js +247 -0
- package/lib/commonjs/components/ActionFooter/ActionFooter.js +147 -82
- package/lib/commonjs/components/AppBar/AppBar.js +17 -11
- package/lib/commonjs/components/Avatar/Avatar.js +20 -0
- package/lib/commonjs/components/Badge/Badge.js +23 -0
- package/lib/commonjs/components/Button/Button.js +37 -0
- package/lib/commonjs/components/CardBankAccount/CardBankAccount.js +18 -2
- package/lib/commonjs/components/CheckboxItem/CheckboxItem.js +40 -25
- package/lib/commonjs/components/Dropdown/Dropdown.js +214 -0
- package/lib/commonjs/components/DropdownInput/DropdownInput.js +542 -0
- package/lib/commonjs/components/FormField/FormField.js +328 -178
- package/lib/commonjs/components/IconButton/IconButton.js +20 -0
- package/lib/commonjs/components/Image/Image.js +26 -1
- package/lib/commonjs/components/LottieIntroBlock/LottieIntroBlock.js +150 -0
- package/lib/commonjs/components/LottiePlayer/LottiePlayer.js +116 -0
- package/lib/commonjs/components/LottiePlayer/LottiePlayer.web.js +82 -0
- package/lib/commonjs/components/LottiePlayer/loadNativeLottieView.js +74 -0
- package/lib/commonjs/components/LottiePlayer/loadWebLottieView.js +50 -0
- package/lib/commonjs/components/PageHero/PageHero.js +189 -0
- package/lib/commonjs/components/PoweredByLabel/PoweredByLabel.js +135 -0
- package/lib/commonjs/components/PoweredByLabel/finvu.png +0 -0
- package/lib/commonjs/components/RechargeCard/RechargeCard.js +32 -17
- package/lib/commonjs/components/Text/Text.js +40 -3
- package/lib/commonjs/components/Tooltip/Tooltip.js +34 -27
- package/lib/commonjs/components/index.js +67 -0
- package/lib/commonjs/design-tokens/Coin Variables-variables-full.json +1 -1
- package/lib/commonjs/icons/Icon.js +16 -0
- package/lib/commonjs/icons/registry.js +1 -1
- package/lib/commonjs/index.js +12 -0
- package/lib/commonjs/skeleton/Skeleton.js +234 -0
- package/lib/commonjs/skeleton/SkeletonGroup.js +140 -0
- package/lib/commonjs/skeleton/index.js +58 -0
- package/lib/commonjs/skeleton/shimmer-tokens.js +189 -0
- package/lib/commonjs/skeleton/useReducedMotion.js +64 -0
- package/lib/module/components/AccountCard/AccountCard.js +241 -0
- package/lib/module/components/ActionFooter/ActionFooter.js +146 -82
- package/lib/module/components/AppBar/AppBar.js +17 -11
- package/lib/module/components/Avatar/Avatar.js +19 -0
- package/lib/module/components/Badge/Badge.js +23 -0
- package/lib/module/components/Button/Button.js +37 -0
- package/lib/module/components/CardBankAccount/CardBankAccount.js +17 -2
- package/lib/module/components/CheckboxItem/CheckboxItem.js +41 -26
- package/lib/module/components/Dropdown/Dropdown.js +206 -0
- package/lib/module/components/DropdownInput/DropdownInput.js +536 -0
- package/lib/module/components/FormField/FormField.js +330 -180
- package/lib/module/components/IconButton/IconButton.js +20 -0
- package/lib/module/components/Image/Image.js +25 -1
- package/lib/module/components/LottieIntroBlock/LottieIntroBlock.js +144 -0
- package/lib/module/components/LottiePlayer/LottiePlayer.js +111 -0
- package/lib/module/components/LottiePlayer/LottiePlayer.web.js +77 -0
- package/lib/module/components/LottiePlayer/loadNativeLottieView.js +69 -0
- package/lib/module/components/LottiePlayer/loadWebLottieView.js +45 -0
- package/lib/module/components/PageHero/PageHero.js +183 -0
- package/lib/module/components/PoweredByLabel/PoweredByLabel.js +130 -0
- package/lib/module/components/PoweredByLabel/finvu.png +0 -0
- package/lib/module/components/RechargeCard/RechargeCard.js +33 -17
- package/lib/module/components/Text/Text.js +40 -3
- package/lib/module/components/Tooltip/Tooltip.js +34 -27
- package/lib/module/components/index.js +8 -1
- package/lib/module/design-tokens/Coin Variables-variables-full.json +1 -1
- package/lib/module/icons/Icon.js +16 -0
- package/lib/module/icons/registry.js +1 -1
- package/lib/module/index.js +2 -1
- package/lib/module/skeleton/Skeleton.js +229 -0
- package/lib/module/skeleton/SkeletonGroup.js +133 -0
- package/lib/module/skeleton/index.js +6 -0
- package/lib/module/skeleton/shimmer-tokens.js +181 -0
- package/lib/module/skeleton/useReducedMotion.js +61 -0
- package/lib/typescript/src/components/AccountCard/AccountCard.d.ts +81 -0
- package/lib/typescript/src/components/ActionFooter/ActionFooter.d.ts +26 -21
- package/lib/typescript/src/components/Avatar/Avatar.d.ts +7 -1
- package/lib/typescript/src/components/Badge/Badge.d.ts +7 -1
- package/lib/typescript/src/components/Button/Button.d.ts +8 -1
- package/lib/typescript/src/components/CardBankAccount/CardBankAccount.d.ts +9 -2
- package/lib/typescript/src/components/CheckboxItem/CheckboxItem.d.ts +18 -2
- package/lib/typescript/src/components/Dropdown/Dropdown.d.ts +62 -0
- package/lib/typescript/src/components/DropdownInput/DropdownInput.d.ts +107 -0
- package/lib/typescript/src/components/FormField/FormField.d.ts +76 -19
- package/lib/typescript/src/components/IconButton/IconButton.d.ts +7 -1
- package/lib/typescript/src/components/Image/Image.d.ts +8 -1
- package/lib/typescript/src/components/LottieIntroBlock/LottieIntroBlock.d.ts +58 -0
- package/lib/typescript/src/components/LottiePlayer/LottiePlayer.d.ts +85 -0
- package/lib/typescript/src/components/LottiePlayer/LottiePlayer.web.d.ts +28 -0
- package/lib/typescript/src/components/LottiePlayer/loadNativeLottieView.d.ts +11 -0
- package/lib/typescript/src/components/LottiePlayer/loadWebLottieView.d.ts +11 -0
- package/lib/typescript/src/components/PageHero/PageHero.d.ts +79 -0
- package/lib/typescript/src/components/PoweredByLabel/PoweredByLabel.d.ts +70 -0
- package/lib/typescript/src/components/Text/Text.d.ts +31 -2
- package/lib/typescript/src/components/Tooltip/Tooltip.d.ts +13 -2
- package/lib/typescript/src/components/index.d.ts +8 -1
- package/lib/typescript/src/icons/Icon.d.ts +7 -1
- package/lib/typescript/src/icons/registry.d.ts +1 -1
- package/lib/typescript/src/index.d.ts +1 -0
- package/lib/typescript/src/skeleton/Skeleton.d.ts +60 -0
- package/lib/typescript/src/skeleton/SkeletonGroup.d.ts +78 -0
- package/lib/typescript/src/skeleton/index.d.ts +5 -0
- package/lib/typescript/src/skeleton/shimmer-tokens.d.ts +160 -0
- package/lib/typescript/src/skeleton/useReducedMotion.d.ts +15 -0
- package/package.json +11 -3
- package/src/components/AccountCard/AccountCard.tsx +376 -0
- package/src/components/ActionFooter/ActionFooter.tsx +152 -86
- package/src/components/AppBar/AppBar.tsx +25 -14
- package/src/components/Avatar/Avatar.tsx +26 -0
- package/src/components/Badge/Badge.tsx +27 -0
- package/src/components/Button/Button.tsx +40 -0
- package/src/components/CardBankAccount/CardBankAccount.tsx +29 -3
- package/src/components/CheckboxItem/CheckboxItem.tsx +65 -30
- package/src/components/Dropdown/Dropdown.tsx +331 -0
- package/src/components/DropdownInput/DropdownInput.tsx +819 -0
- package/src/components/FormField/FormField.tsx +542 -215
- package/src/components/IconButton/IconButton.tsx +27 -0
- package/src/components/Image/Image.tsx +25 -0
- package/src/components/LottieIntroBlock/LottieIntroBlock.tsx +202 -0
- package/src/components/LottiePlayer/LottiePlayer.tsx +145 -0
- package/src/components/LottiePlayer/LottiePlayer.web.tsx +94 -0
- package/src/components/LottiePlayer/loadNativeLottieView.tsx +87 -0
- package/src/components/LottiePlayer/loadWebLottieView.tsx +64 -0
- package/src/components/PageHero/PageHero.tsx +257 -0
- package/src/components/PoweredByLabel/PoweredByLabel.tsx +221 -0
- package/src/components/PoweredByLabel/finvu.png +0 -0
- package/src/components/RechargeCard/RechargeCard.tsx +32 -24
- package/src/components/Text/Text.tsx +78 -3
- package/src/components/Tooltip/Tooltip.tsx +50 -25
- package/src/components/index.ts +16 -1
- package/src/design-tokens/Coin Variables-variables-full.json +1 -1
- package/src/icons/Icon.tsx +17 -0
- package/src/icons/registry.ts +1 -1
- package/src/index.ts +1 -0
- package/src/skeleton/Skeleton.tsx +298 -0
- package/src/skeleton/SkeletonGroup.tsx +193 -0
- package/src/skeleton/index.ts +10 -0
- package/src/skeleton/shimmer-tokens.ts +221 -0
- package/src/skeleton/useReducedMotion.ts +72 -0
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React, { useMemo } from 'react';
|
|
4
|
+
import { Text, View } from 'react-native';
|
|
5
|
+
import { getVariableByName } from '../../design-tokens/figma-variables-resolver';
|
|
6
|
+
import { useTokens } from '../../design-tokens/JFSThemeProvider';
|
|
7
|
+
import { EMPTY_MODES, cloneChildrenWithModes } from '../../utils/react-utils';
|
|
8
|
+
import MediaSource from '../../utils/MediaSource';
|
|
9
|
+
|
|
10
|
+
// Default bundled FINVU brand logo, matching the Figma reference so the
|
|
11
|
+
// component renders correctly out of the box without any image prop.
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
const DEFAULT_LOGO = require('./finvu.png');
|
|
14
|
+
const DEFAULT_LABEL = 'Powered by RBI-regulated account aggregator';
|
|
15
|
+
const DEFAULT_IMAGE_WIDTH = 33;
|
|
16
|
+
const DEFAULT_IMAGE_HEIGHT = 12;
|
|
17
|
+
const toNumber = (value, fallback) => {
|
|
18
|
+
if (typeof value === 'number') return Number.isFinite(value) ? value : fallback;
|
|
19
|
+
if (typeof value === 'string') {
|
|
20
|
+
const parsed = Number(value);
|
|
21
|
+
return Number.isFinite(parsed) ? parsed : fallback;
|
|
22
|
+
}
|
|
23
|
+
return fallback;
|
|
24
|
+
};
|
|
25
|
+
const toFontWeight = (value, fallback) => {
|
|
26
|
+
if (typeof value === 'number') return String(value);
|
|
27
|
+
if (typeof value === 'string') return value;
|
|
28
|
+
return fallback;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* `PoweredByLabel` renders the small "Powered by RBI-regulated account
|
|
33
|
+
* aggregator" badge with a trailing brand logo, used to attribute the
|
|
34
|
+
* underlying account-aggregator partner in flows such as bank-account
|
|
35
|
+
* linking and consent screens.
|
|
36
|
+
*
|
|
37
|
+
* The component is composed of:
|
|
38
|
+
*
|
|
39
|
+
* 1. A token-styled pill container (`poweredByLabel/background`,
|
|
40
|
+
* `poweredByLabel/padding/*`).
|
|
41
|
+
* 2. The disclosure copy rendered through the `poweredByLabel/*` typography
|
|
42
|
+
* tokens.
|
|
43
|
+
* 3. A configurable brand logo slot. Defaults to the bundled FINVU mark, but
|
|
44
|
+
* callers can pass any image via `imageSource` or fully replace the slot
|
|
45
|
+
* via `imageSlot`.
|
|
46
|
+
*
|
|
47
|
+
* @component
|
|
48
|
+
* @param {PoweredByLabelProps} props
|
|
49
|
+
*/
|
|
50
|
+
function PoweredByLabel({
|
|
51
|
+
label = DEFAULT_LABEL,
|
|
52
|
+
imageSource,
|
|
53
|
+
imageWidth = DEFAULT_IMAGE_WIDTH,
|
|
54
|
+
imageHeight = DEFAULT_IMAGE_HEIGHT,
|
|
55
|
+
imageSlot,
|
|
56
|
+
modes: propModes = EMPTY_MODES,
|
|
57
|
+
style,
|
|
58
|
+
textStyle,
|
|
59
|
+
imageStyle,
|
|
60
|
+
accessibilityLabel
|
|
61
|
+
}) {
|
|
62
|
+
const {
|
|
63
|
+
modes: globalModes
|
|
64
|
+
} = useTokens();
|
|
65
|
+
const modes = useMemo(() => globalModes === EMPTY_MODES && propModes === EMPTY_MODES ? EMPTY_MODES : {
|
|
66
|
+
...globalModes,
|
|
67
|
+
...propModes
|
|
68
|
+
}, [globalModes, propModes]);
|
|
69
|
+
const background = getVariableByName('poweredByLabel/background', modes) ?? '#f5f5f5';
|
|
70
|
+
const foreground = getVariableByName('poweredByLabel/foreground', modes) ?? '#191b1e';
|
|
71
|
+
const fontFamily = getVariableByName('poweredByLabel/fontFamily', modes) ?? 'JioType Var';
|
|
72
|
+
const fontSize = toNumber(getVariableByName('poweredByLabel/fontSize', modes), 10);
|
|
73
|
+
const lineHeight = toNumber(getVariableByName('poweredByLabel/lineHeight', modes), 12);
|
|
74
|
+
const fontWeight = toFontWeight(getVariableByName('poweredByLabel/fontWeight', modes), '400');
|
|
75
|
+
const gap = toNumber(getVariableByName('poweredByLabel/gap', modes), 10);
|
|
76
|
+
const paddingHorizontal = toNumber(getVariableByName('poweredByLabel/padding/horizontal', modes), 16);
|
|
77
|
+
const paddingVertical = toNumber(getVariableByName('poweredByLabel/padding/vertical', modes), 6);
|
|
78
|
+
const containerStyle = {
|
|
79
|
+
flexDirection: 'row',
|
|
80
|
+
alignItems: 'center',
|
|
81
|
+
justifyContent: 'center',
|
|
82
|
+
backgroundColor: background,
|
|
83
|
+
paddingHorizontal,
|
|
84
|
+
paddingVertical,
|
|
85
|
+
gap,
|
|
86
|
+
// Hug content horizontally so the pill does not stretch to fill the
|
|
87
|
+
// parent (matches Badge, BrandChip, etc.). Override via `style` if
|
|
88
|
+
// you want it full-width (e.g. inside a card footer).
|
|
89
|
+
alignSelf: 'flex-start'
|
|
90
|
+
};
|
|
91
|
+
const labelTextStyle = {
|
|
92
|
+
color: foreground,
|
|
93
|
+
fontFamily,
|
|
94
|
+
fontSize,
|
|
95
|
+
lineHeight,
|
|
96
|
+
fontWeight,
|
|
97
|
+
textAlign: 'center',
|
|
98
|
+
flexShrink: 1
|
|
99
|
+
};
|
|
100
|
+
const renderImage = () => {
|
|
101
|
+
if (imageSlot !== undefined && imageSlot !== null) {
|
|
102
|
+
const processed = cloneChildrenWithModes(imageSlot, modes);
|
|
103
|
+
if (processed.length === 0) return null;
|
|
104
|
+
return processed.length === 1 ? processed[0] : processed;
|
|
105
|
+
}
|
|
106
|
+
const resolvedSource = imageSource ?? DEFAULT_LOGO;
|
|
107
|
+
return /*#__PURE__*/_jsx(MediaSource, {
|
|
108
|
+
source: resolvedSource,
|
|
109
|
+
width: imageWidth,
|
|
110
|
+
height: imageHeight,
|
|
111
|
+
resizeMode: "contain",
|
|
112
|
+
style: imageStyle,
|
|
113
|
+
accessibilityElementsHidden: true,
|
|
114
|
+
importantForAccessibility: "no"
|
|
115
|
+
});
|
|
116
|
+
};
|
|
117
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
118
|
+
accessibilityRole: "text",
|
|
119
|
+
accessibilityLabel: accessibilityLabel ?? label,
|
|
120
|
+
style: [containerStyle, style],
|
|
121
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
122
|
+
style: [labelTextStyle, textStyle],
|
|
123
|
+
accessibilityElementsHidden: true,
|
|
124
|
+
importantForAccessibility: "no",
|
|
125
|
+
numberOfLines: 1,
|
|
126
|
+
children: label
|
|
127
|
+
}), renderImage()]
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
export default PoweredByLabel;
|
|
Binary file
|
|
@@ -7,7 +7,23 @@ import AvatarGroup from '../AvatarGroup/AvatarGroup';
|
|
|
7
7
|
import { getVariableByName } from '../../design-tokens/figma-variables-resolver';
|
|
8
8
|
import { EMPTY_MODES } from '../../utils/react-utils';
|
|
9
9
|
import MoneyValue from '../MoneyValue/MoneyValue';
|
|
10
|
+
|
|
11
|
+
// Defaults applied to the inner ButtonGroup so the card matches Figma out of
|
|
12
|
+
// the box. They are spread *before* the caller's `modes` so any consumer can
|
|
13
|
+
// override an individual key (e.g. swap the size to "M").
|
|
10
14
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
|
+
const DEFAULT_BUTTON_GROUP_MODES = {
|
|
16
|
+
AppearanceBrand: 'Secondary',
|
|
17
|
+
'Button / Size': 'S',
|
|
18
|
+
Emphasis: 'High'
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
// Defaults applied to the inner MoneyValue so the price renders at the
|
|
22
|
+
// 36 px / 900-weight scale defined for cards in Figma. Same merge rule as
|
|
23
|
+
// the button group — consumer `modes` override these.
|
|
24
|
+
const DEFAULT_MONEY_VALUE_MODES = {
|
|
25
|
+
Context3: 'Balance & Cards'
|
|
26
|
+
};
|
|
11
27
|
/**
|
|
12
28
|
* RechargeCard component implementation from Figma node 2235:937.
|
|
13
29
|
* Displays a recharge plan with price, validity, data, and subscription details.
|
|
@@ -23,17 +39,19 @@ export default function RechargeCard({
|
|
|
23
39
|
modes = EMPTY_MODES,
|
|
24
40
|
style
|
|
25
41
|
}) {
|
|
26
|
-
// Container Tokens
|
|
27
|
-
const backgroundColor = getVariableByName('rechargeCard/background', modes) || '#
|
|
42
|
+
// Container Tokens (defaults mirror Figma node 2235:937).
|
|
43
|
+
const backgroundColor = getVariableByName('rechargeCard/background', modes) || '#ffffff';
|
|
28
44
|
const paddingHorizontal = parseInt(getVariableByName('rechargeCard/padding/horizontal', modes) || 16, 10);
|
|
29
45
|
const paddingVertical = parseInt(getVariableByName('rechargeCard/padding/vertical', modes) || 20, 10);
|
|
30
46
|
const gap = parseInt(getVariableByName('rechargeCard/gap', modes) || 20, 10);
|
|
31
47
|
const radius = parseInt(getVariableByName('rechargeCard/radius', modes) || 20, 10);
|
|
32
|
-
const minWidth = parseInt(getVariableByName('rechargeCard/minWidth', modes) ||
|
|
48
|
+
const minWidth = parseInt(getVariableByName('rechargeCard/minWidth', modes) || 312, 10);
|
|
49
|
+
const strokeWidth = parseInt(getVariableByName('rechargeCard/strokeWidth', modes) || 1, 10);
|
|
50
|
+
const strokeColor = getVariableByName('rechargeCard/stroke/color', modes) || '#ebebed';
|
|
33
51
|
|
|
34
52
|
// Header Tokens
|
|
35
53
|
const headerGap = parseInt(getVariableByName('rechargeCard/header/gap', modes) || 4, 10);
|
|
36
|
-
const titleColor = getVariableByName('rechargeCard/title/color', modes) || '#
|
|
54
|
+
const titleColor = getVariableByName('rechargeCard/title/color', modes) || '#000000';
|
|
37
55
|
const titleFontSize = parseInt(getVariableByName('rechargeCard/title/fontSize', modes) || 12, 10);
|
|
38
56
|
const titleFontFamily = getVariableByName('rechargeCard/title/fontFamily', modes) || 'JioType Var';
|
|
39
57
|
const titleLineHeight = parseInt(getVariableByName('rechargeCard/title/lineHeight', modes) || 14, 10);
|
|
@@ -44,30 +62,25 @@ export default function RechargeCard({
|
|
|
44
62
|
const specItemGap = parseInt(getVariableByName('rechargeCard/specItem/gap', modes) || 4, 10);
|
|
45
63
|
|
|
46
64
|
// Spec Label Tokens
|
|
47
|
-
const specLabelColor = getVariableByName('rechargeCard/specItem/label/color', modes) || '#
|
|
65
|
+
const specLabelColor = getVariableByName('rechargeCard/specItem/label/color', modes) || '#000000';
|
|
48
66
|
const specLabelFontSize = parseInt(getVariableByName('rechargeCard/specItem/label/fontSize', modes) || 12, 10);
|
|
49
67
|
const specLabelFontFamily = getVariableByName('rechargeCard/specItem/label/fontFamily', modes) || 'JioType Var';
|
|
50
68
|
const specLabelLineHeight = parseInt(getVariableByName('rechargeCard/specItem/label/lineHeight', modes) || 14, 10);
|
|
51
69
|
const specLabelFontWeight = getVariableByName('rechargeCard/specItem/label/fontWeight', modes) || '500';
|
|
52
70
|
|
|
53
71
|
// Spec Value Tokens
|
|
54
|
-
const specValueColor = getVariableByName('rechargeCard/specItem/value/color', modes) || '#
|
|
72
|
+
const specValueColor = getVariableByName('rechargeCard/specItem/value/color', modes) || '#000000';
|
|
55
73
|
const specValueFontSize = parseInt(getVariableByName('rechargeCard/specItem/value/fontSize', modes) || 14, 10);
|
|
56
74
|
const specValueFontFamily = getVariableByName('rechargeCard/specItem/value/fontFamily', modes) || 'JioType Var';
|
|
57
75
|
const specValueLineHeight = parseInt(getVariableByName('rechargeCard/specItem/value/lineHeight', modes) || 17, 10);
|
|
58
76
|
const specValueFontWeight = getVariableByName('rechargeCard/specItem/value/fontWeight', modes) || '500';
|
|
59
77
|
|
|
60
78
|
// Disclaimer Tokens
|
|
61
|
-
const disclaimerColor = getVariableByName('rechargeCard/disclaimer/color', modes) || '#
|
|
79
|
+
const disclaimerColor = getVariableByName('rechargeCard/disclaimer/color', modes) || '#000000';
|
|
62
80
|
const disclaimerFontSize = parseInt(getVariableByName('rechargeCard/disclaimer/fontSize', modes) || 10, 10);
|
|
63
81
|
const disclaimerFontFamily = getVariableByName('rechargeCard/disclaimer/fontFamily', modes) || 'JioType Var';
|
|
64
82
|
const disclaimerLineHeight = parseInt(getVariableByName('rechargeCard/disclaimer/lineHeight', modes) || 13, 10);
|
|
65
83
|
const disclaimerFontWeight = getVariableByName('rechargeCard/disclaimer/fontWeight', modes) || '400';
|
|
66
|
-
|
|
67
|
-
// Button Group Tokens
|
|
68
|
-
// Handled by ButtonGroup component directly
|
|
69
|
-
|
|
70
|
-
// Helpers
|
|
71
84
|
const resolveFontWeight = weight => typeof weight === 'number' ? weight.toString() : weight;
|
|
72
85
|
|
|
73
86
|
// Pass modes to subscription children (e.g. AvatarGroup)
|
|
@@ -80,6 +93,8 @@ export default function RechargeCard({
|
|
|
80
93
|
paddingVertical,
|
|
81
94
|
gap,
|
|
82
95
|
borderRadius: radius,
|
|
96
|
+
borderWidth: strokeWidth,
|
|
97
|
+
borderColor: strokeColor,
|
|
83
98
|
minWidth,
|
|
84
99
|
alignItems: 'flex-start'
|
|
85
100
|
}, style],
|
|
@@ -100,7 +115,10 @@ export default function RechargeCard({
|
|
|
100
115
|
}), /*#__PURE__*/_jsx(MoneyValue, {
|
|
101
116
|
value: price,
|
|
102
117
|
currency: "\u20B9",
|
|
103
|
-
modes:
|
|
118
|
+
modes: {
|
|
119
|
+
...DEFAULT_MONEY_VALUE_MODES,
|
|
120
|
+
...modes
|
|
121
|
+
}
|
|
104
122
|
})]
|
|
105
123
|
}), /*#__PURE__*/_jsxs(View, {
|
|
106
124
|
style: {
|
|
@@ -189,10 +207,8 @@ export default function RechargeCard({
|
|
|
189
207
|
children: disclaimer
|
|
190
208
|
}), /*#__PURE__*/_jsx(ButtonGroup, {
|
|
191
209
|
modes: {
|
|
192
|
-
...
|
|
193
|
-
|
|
194
|
-
"Button / Size": "S",
|
|
195
|
-
"Emphasis": "High"
|
|
210
|
+
...DEFAULT_BUTTON_GROUP_MODES,
|
|
211
|
+
...modes
|
|
196
212
|
},
|
|
197
213
|
children: actions
|
|
198
214
|
})]
|
|
@@ -4,17 +4,23 @@ import React from 'react';
|
|
|
4
4
|
import { Text as RNText } from 'react-native';
|
|
5
5
|
import { getVariableByName } from '../../design-tokens/figma-variables-resolver';
|
|
6
6
|
import { EMPTY_MODES } from '../../utils/react-utils';
|
|
7
|
+
import Skeleton from '../../skeleton/Skeleton';
|
|
8
|
+
import { useSkeleton } from '../../skeleton/SkeletonGroup';
|
|
7
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
10
|
const TEXT_ALIGN_MAP = {
|
|
9
11
|
Left: 'left',
|
|
10
12
|
Center: 'center'
|
|
11
13
|
};
|
|
12
14
|
function Text({
|
|
13
|
-
text
|
|
15
|
+
text,
|
|
16
|
+
children,
|
|
14
17
|
textAlign = 'Left',
|
|
15
18
|
modes = EMPTY_MODES,
|
|
16
19
|
style,
|
|
17
|
-
numberOfLines
|
|
20
|
+
numberOfLines,
|
|
21
|
+
loading,
|
|
22
|
+
skeletonWidth,
|
|
23
|
+
skeletonLines
|
|
18
24
|
}) {
|
|
19
25
|
const foreground = getVariableByName('text/foreground', modes) ?? '#000000';
|
|
20
26
|
const fontFamily = getVariableByName('text/fontFamily', modes) ?? 'JioType';
|
|
@@ -22,6 +28,31 @@ function Text({
|
|
|
22
28
|
const fontWeight = getVariableByName('text/fontWeight', modes) ?? '500';
|
|
23
29
|
const lineHeight = getVariableByName('text/lineHeight', modes) ?? 20;
|
|
24
30
|
const letterSpacing = getVariableByName('text/letterSpacing', modes) ?? -0.5;
|
|
31
|
+
|
|
32
|
+
// Skeleton short-circuit. The hook is always called (stable order); the
|
|
33
|
+
// surrounding group's `active` flag is the default, but an explicit
|
|
34
|
+
// `loading` prop overrides both directions.
|
|
35
|
+
const {
|
|
36
|
+
active: groupActive
|
|
37
|
+
} = useSkeleton();
|
|
38
|
+
const isLoading = loading ?? groupActive;
|
|
39
|
+
if (isLoading) {
|
|
40
|
+
const resolvedFontSize = fontSize;
|
|
41
|
+
const resolvedLineHeight = lineHeight;
|
|
42
|
+
const lines = Math.max(1, skeletonLines ?? numberOfLines ?? 1);
|
|
43
|
+
// Heuristic width based on the actual content length so the placeholder
|
|
44
|
+
// visually matches what's about to load. Capped to a reasonable lower
|
|
45
|
+
// bound so very short labels still produce a visible block.
|
|
46
|
+
const contentLength = typeof children === 'string' ? children.length : typeof text === 'string' ? text.length : 12;
|
|
47
|
+
const charWidth = resolvedFontSize * 0.55;
|
|
48
|
+
const computedWidth = Math.max(charWidth * 4, contentLength * charWidth);
|
|
49
|
+
return /*#__PURE__*/_jsx(Skeleton, {
|
|
50
|
+
kind: "text",
|
|
51
|
+
width: skeletonWidth ?? computedWidth,
|
|
52
|
+
height: resolvedLineHeight * lines,
|
|
53
|
+
modes: modes
|
|
54
|
+
});
|
|
55
|
+
}
|
|
25
56
|
const textStyle = {
|
|
26
57
|
color: foreground,
|
|
27
58
|
fontFamily: fontFamily,
|
|
@@ -31,10 +62,16 @@ function Text({
|
|
|
31
62
|
letterSpacing: letterSpacing,
|
|
32
63
|
textAlign: TEXT_ALIGN_MAP[textAlign]
|
|
33
64
|
};
|
|
65
|
+
|
|
66
|
+
// Prefer JSX children when present, otherwise fall back to the `text` prop.
|
|
67
|
+
// Keep the storybook placeholder as a last resort so the Default story
|
|
68
|
+
// still renders something visible when no content is supplied via either
|
|
69
|
+
// route.
|
|
70
|
+
const content = children !== undefined && children !== null && children !== false ? children : text !== undefined ? text : 'Korem ipsum ';
|
|
34
71
|
return /*#__PURE__*/_jsx(RNText, {
|
|
35
72
|
style: [textStyle, style],
|
|
36
73
|
numberOfLines: numberOfLines,
|
|
37
|
-
children:
|
|
74
|
+
children: content
|
|
38
75
|
});
|
|
39
76
|
}
|
|
40
77
|
export default Text;
|
|
@@ -165,7 +165,9 @@ export function TooltipTrigger({
|
|
|
165
165
|
}
|
|
166
166
|
export function TooltipContent({
|
|
167
167
|
children,
|
|
168
|
-
sideOffset = 4
|
|
168
|
+
sideOffset = 4,
|
|
169
|
+
gap = 4,
|
|
170
|
+
alignItems = 'flex-start'
|
|
169
171
|
}) {
|
|
170
172
|
const {
|
|
171
173
|
isVisible,
|
|
@@ -390,6 +392,35 @@ export function TooltipContent({
|
|
|
390
392
|
paddingHorizontal: paddingH,
|
|
391
393
|
paddingVertical: paddingV
|
|
392
394
|
};
|
|
395
|
+
|
|
396
|
+
// Vertical slot wrapper: stack arbitrary children top-to-bottom with a gap.
|
|
397
|
+
// Raw <Text> children still get auto-styled with the tooltip label tokens
|
|
398
|
+
// so the simple <TooltipContent><Text>label</Text></TooltipContent> usage
|
|
399
|
+
// keeps working without any changes.
|
|
400
|
+
const slotStyle = {
|
|
401
|
+
flexDirection: 'column',
|
|
402
|
+
alignItems,
|
|
403
|
+
gap
|
|
404
|
+
};
|
|
405
|
+
const renderSlotChildren = () => {
|
|
406
|
+
if (typeof children === 'string') {
|
|
407
|
+
return /*#__PURE__*/_jsx(Text, {
|
|
408
|
+
style: textStyle,
|
|
409
|
+
children: children
|
|
410
|
+
});
|
|
411
|
+
}
|
|
412
|
+
return /*#__PURE__*/_jsx(View, {
|
|
413
|
+
style: slotStyle,
|
|
414
|
+
children: React.Children.map(children, child => {
|
|
415
|
+
if (/*#__PURE__*/React.isValidElement(child) && (child.type === Text || child.type.displayName === 'Text')) {
|
|
416
|
+
return /*#__PURE__*/React.cloneElement(child, {
|
|
417
|
+
style: [textStyle, child.props.style]
|
|
418
|
+
});
|
|
419
|
+
}
|
|
420
|
+
return child;
|
|
421
|
+
})
|
|
422
|
+
});
|
|
423
|
+
};
|
|
393
424
|
if (!hasMeasured) {
|
|
394
425
|
return /*#__PURE__*/_jsx(Modal, {
|
|
395
426
|
transparent: true,
|
|
@@ -401,19 +432,7 @@ export function TooltipContent({
|
|
|
401
432
|
children: /*#__PURE__*/_jsx(View, {
|
|
402
433
|
style: measureStyle,
|
|
403
434
|
onLayout: e => setContentSize(e.nativeEvent.layout),
|
|
404
|
-
children:
|
|
405
|
-
style: textStyle,
|
|
406
|
-
children: children
|
|
407
|
-
}) : /*#__PURE__*/_jsx(View, {
|
|
408
|
-
children: React.Children.map(children, child => {
|
|
409
|
-
if (/*#__PURE__*/React.isValidElement(child) && (child.type === Text || child.type.displayName === 'Text')) {
|
|
410
|
-
return /*#__PURE__*/React.cloneElement(child, {
|
|
411
|
-
style: [textStyle, child.props.style]
|
|
412
|
-
});
|
|
413
|
-
}
|
|
414
|
-
return child;
|
|
415
|
-
})
|
|
416
|
-
})
|
|
435
|
+
children: renderSlotChildren()
|
|
417
436
|
})
|
|
418
437
|
})
|
|
419
438
|
});
|
|
@@ -444,19 +463,7 @@ export function TooltipContent({
|
|
|
444
463
|
shadowRadius: 3.84,
|
|
445
464
|
elevation: 5
|
|
446
465
|
}],
|
|
447
|
-
children: [
|
|
448
|
-
style: textStyle,
|
|
449
|
-
children: children
|
|
450
|
-
}) : /*#__PURE__*/_jsx(View, {
|
|
451
|
-
children: React.Children.map(children, child => {
|
|
452
|
-
if (/*#__PURE__*/React.isValidElement(child) && (child.type === Text || child.type.displayName === 'Text')) {
|
|
453
|
-
return /*#__PURE__*/React.cloneElement(child, {
|
|
454
|
-
style: [textStyle, child.props.style]
|
|
455
|
-
});
|
|
456
|
-
}
|
|
457
|
-
return child;
|
|
458
|
-
})
|
|
459
|
-
}), /*#__PURE__*/_jsx(View, {
|
|
466
|
+
children: [renderSlotChildren(), /*#__PURE__*/_jsx(View, {
|
|
460
467
|
style: {
|
|
461
468
|
position: 'absolute',
|
|
462
469
|
left: arrowX,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
export { default as AccountCard } from './AccountCard/AccountCard';
|
|
3
4
|
export { default as ActionFooter } from './ActionFooter/ActionFooter';
|
|
4
5
|
export { default as AppBar } from './AppBar/AppBar';
|
|
5
6
|
export { default as Avatar } from './Avatar/Avatar';
|
|
@@ -22,6 +23,8 @@ export { default as CardInsight } from './CardInsight/CardInsight';
|
|
|
22
23
|
export { default as Disclaimer } from './Disclaimer/Disclaimer';
|
|
23
24
|
export { default as Divider } from './Divider/Divider';
|
|
24
25
|
export { default as Drawer } from './Drawer/Drawer';
|
|
26
|
+
export { default as Dropdown, DropdownItem } from './Dropdown/Dropdown';
|
|
27
|
+
export { default as DropdownInput } from './DropdownInput/DropdownInput';
|
|
25
28
|
export { default as CardCTA } from './CardCTA/CardCTA';
|
|
26
29
|
export { default as DebitCard } from './DebitCard/DebitCard';
|
|
27
30
|
export { default as FilterBar } from './FilterBar/FilterBar';
|
|
@@ -44,6 +47,8 @@ export { default as LazyList } from './LazyList/LazyList';
|
|
|
44
47
|
export { default as LinearMeter } from './LinearMeter/LinearMeter';
|
|
45
48
|
export { default as LinearProgress } from './LinearProgress/LinearProgress';
|
|
46
49
|
export { default as ListGroup } from './ListGroup/ListGroup';
|
|
50
|
+
export { default as LottieIntroBlock } from './LottieIntroBlock/LottieIntroBlock';
|
|
51
|
+
export { default as LottiePlayer } from './LottiePlayer/LottiePlayer';
|
|
47
52
|
export { default as ListItem } from './ListItem/ListItem';
|
|
48
53
|
export { default as MediaCard } from './MediaCard/MediaCard';
|
|
49
54
|
export { default as MerchantProfile } from './MerchantProfile/MerchantProfile';
|
|
@@ -62,7 +67,7 @@ export { StepLabel } from './Stepper/StepLabel';
|
|
|
62
67
|
export { default as TextInput } from './TextInput/TextInput';
|
|
63
68
|
export { default as StatusHero } from './StatusHero/StatusHero';
|
|
64
69
|
export { default as ThreadHero } from './ThreadHero/ThreadHero';
|
|
65
|
-
export { Tooltip } from './Tooltip/Tooltip';
|
|
70
|
+
export { Tooltip, TooltipTrigger, TooltipContent } from './Tooltip/Tooltip';
|
|
66
71
|
export { default as TransactionDetails } from './TransactionDetails/TransactionDetails';
|
|
67
72
|
export { default as TransactionStatus } from './TransactionStatus/TransactionStatus';
|
|
68
73
|
export { default as TransactionBubble } from './TransactionBubble/TransactionBubble';
|
|
@@ -99,8 +104,10 @@ export { default as Toast } from './Toast/Toast';
|
|
|
99
104
|
export { default as ToastProvider } from './Toast/ToastProvider';
|
|
100
105
|
export { useToast, addToast, closeToast, closeAll } from './Toast/useToast';
|
|
101
106
|
export { default as AmountInput } from './AmountInput/AmountInput';
|
|
107
|
+
export { default as PageHero } from './PageHero/PageHero';
|
|
102
108
|
export { default as Popup } from './Popup/Popup';
|
|
103
109
|
export { default as PortfolioHero } from './PortfolioHero/PortfolioHero';
|
|
110
|
+
export { default as PoweredByLabel } from './PoweredByLabel/PoweredByLabel';
|
|
104
111
|
export { default as ProductLabel } from './ProductLabel/ProductLabel';
|
|
105
112
|
export { default as ProductOverview } from './ProductOverview/ProductOverview';
|
|
106
113
|
export { default as ProgressBadge } from './ProgressBadge/ProgressBadge';
|