jfs-components 0.0.74 → 0.0.78
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 +109 -0
- package/lib/commonjs/components/Accordion/Accordion.js +55 -55
- package/lib/commonjs/components/ActionFooter/ActionFooter.js +193 -82
- 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/Checkbox/Checkbox.js +21 -9
- package/lib/commonjs/components/DropdownInput/DropdownInput.js +30 -16
- package/lib/commonjs/components/ExpandableCheckbox/ExpandableCheckbox.js +167 -0
- package/lib/commonjs/components/FormField/FormField.js +14 -1
- package/lib/commonjs/components/FullscreenModal/FullscreenModal.js +355 -0
- package/lib/commonjs/components/IconButton/IconButton.js +20 -0
- package/lib/commonjs/components/Image/Image.js +26 -1
- package/lib/commonjs/components/ListItem/ListItem.js +25 -10
- 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/MessageField/MessageField.js +318 -0
- package/lib/commonjs/components/NavArrow/NavArrow.js +58 -17
- package/lib/commonjs/components/PageHero/PageHero.js +41 -5
- package/lib/commonjs/components/RechargeCard/RechargeCard.js +32 -17
- package/lib/commonjs/components/Stepper/Step.js +47 -60
- package/lib/commonjs/components/Stepper/StepLabel.js +40 -10
- package/lib/commonjs/components/Stepper/Stepper.js +15 -17
- package/lib/commonjs/components/SuggestiveSearch/SuggestiveSearch.js +487 -0
- package/lib/commonjs/components/Text/Text.js +31 -1
- package/lib/commonjs/components/TextInput/TextInput.js +16 -1
- package/lib/commonjs/components/Title/Title.js +10 -2
- package/lib/commonjs/components/index.js +35 -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/Accordion/Accordion.js +56 -56
- package/lib/module/components/ActionFooter/ActionFooter.js +193 -83
- 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/Checkbox/Checkbox.js +22 -10
- package/lib/module/components/DropdownInput/DropdownInput.js +30 -16
- package/lib/module/components/ExpandableCheckbox/ExpandableCheckbox.js +161 -0
- package/lib/module/components/FormField/FormField.js +16 -3
- package/lib/module/components/FullscreenModal/FullscreenModal.js +350 -0
- package/lib/module/components/IconButton/IconButton.js +20 -0
- package/lib/module/components/Image/Image.js +25 -1
- package/lib/module/components/ListItem/ListItem.js +25 -10
- 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/MessageField/MessageField.js +313 -0
- package/lib/module/components/NavArrow/NavArrow.js +59 -18
- package/lib/module/components/PageHero/PageHero.js +41 -5
- package/lib/module/components/RechargeCard/RechargeCard.js +33 -17
- package/lib/module/components/Stepper/Step.js +48 -61
- package/lib/module/components/Stepper/StepLabel.js +40 -10
- package/lib/module/components/Stepper/Stepper.js +15 -17
- package/lib/module/components/SuggestiveSearch/SuggestiveSearch.js +481 -0
- package/lib/module/components/Text/Text.js +31 -1
- package/lib/module/components/TextInput/TextInput.js +17 -2
- package/lib/module/components/Title/Title.js +10 -2
- package/lib/module/components/index.js +5 -0
- 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/Accordion/Accordion.d.ts +14 -20
- 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/ExpandableCheckbox/ExpandableCheckbox.d.ts +63 -0
- package/lib/typescript/src/components/FullscreenModal/FullscreenModal.d.ts +99 -0
- 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/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/MessageField/MessageField.d.ts +81 -0
- package/lib/typescript/src/components/NavArrow/NavArrow.d.ts +10 -5
- package/lib/typescript/src/components/PageHero/PageHero.d.ts +31 -5
- package/lib/typescript/src/components/Stepper/Step.d.ts +4 -1
- package/lib/typescript/src/components/Stepper/StepLabel.d.ts +4 -1
- package/lib/typescript/src/components/Stepper/Stepper.d.ts +3 -1
- package/lib/typescript/src/components/SuggestiveSearch/SuggestiveSearch.d.ts +123 -0
- package/lib/typescript/src/components/Text/Text.d.ts +20 -1
- package/lib/typescript/src/components/index.d.ts +8 -3
- 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 -1
- package/src/components/Accordion/Accordion.tsx +113 -73
- package/src/components/ActionFooter/ActionFooter.tsx +210 -92
- 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/Checkbox/Checkbox.tsx +22 -9
- package/src/components/DropdownInput/DropdownInput.tsx +67 -39
- package/src/components/ExpandableCheckbox/ExpandableCheckbox.tsx +237 -0
- package/src/components/FormField/FormField.tsx +19 -3
- package/src/components/FullscreenModal/FullscreenModal.tsx +414 -0
- package/src/components/IconButton/IconButton.tsx +27 -0
- package/src/components/Image/Image.tsx +25 -0
- package/src/components/ListItem/ListItem.tsx +21 -10
- 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/MessageField/MessageField.tsx +543 -0
- package/src/components/NavArrow/NavArrow.tsx +81 -17
- package/src/components/PageHero/PageHero.tsx +61 -4
- package/src/components/RechargeCard/RechargeCard.tsx +32 -24
- package/src/components/Stepper/Step.tsx +52 -51
- package/src/components/Stepper/StepLabel.tsx +46 -9
- package/src/components/Stepper/Stepper.tsx +20 -15
- package/src/components/SuggestiveSearch/SuggestiveSearch.tsx +756 -0
- package/src/components/Text/Text.tsx +54 -0
- package/src/components/TextInput/TextInput.tsx +14 -1
- package/src/components/Title/Title.tsx +13 -2
- package/src/components/index.ts +8 -3
- 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
|
@@ -15,12 +15,14 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
15
15
|
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); }
|
|
16
16
|
/**
|
|
17
17
|
* PageHero displays a centered hero block typically used at the top of a page
|
|
18
|
-
* or feature screen. It contains an
|
|
19
|
-
*
|
|
18
|
+
* or feature screen. It contains an optional media slot (illustration / image
|
|
19
|
+
* / Lottie / SVG / video — consumer's choice), an eyebrow line, a large
|
|
20
|
+
* headline, an optional supporting line (e.g. price / timeline), and an
|
|
21
|
+
* optional action button.
|
|
20
22
|
*
|
|
21
23
|
* All visual values are resolved from Figma design tokens via
|
|
22
|
-
* `getVariableByName`.
|
|
23
|
-
*
|
|
24
|
+
* `getVariableByName`. Slots cascade the active `modes` to their children
|
|
25
|
+
* through `cloneChildrenWithModes`.
|
|
24
26
|
*
|
|
25
27
|
* @component
|
|
26
28
|
* @example
|
|
@@ -31,6 +33,13 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
31
33
|
* supportingText="₹999/year · ₹0 until 2027"
|
|
32
34
|
* buttonLabel="Renew for free"
|
|
33
35
|
* onButtonPress={() => navigate('Upgrade')}
|
|
36
|
+
* media={
|
|
37
|
+
* <Image
|
|
38
|
+
* imageSource={require('./assets/upgrade.png')}
|
|
39
|
+
* width={117}
|
|
40
|
+
* height={117}
|
|
41
|
+
* />
|
|
42
|
+
* }
|
|
34
43
|
* />
|
|
35
44
|
* ```
|
|
36
45
|
*/
|
|
@@ -43,6 +52,7 @@ function PageHero({
|
|
|
43
52
|
onButtonPress,
|
|
44
53
|
showButton = true,
|
|
45
54
|
buttonSlot,
|
|
55
|
+
media,
|
|
46
56
|
modes: propModes = _reactUtils.EMPTY_MODES,
|
|
47
57
|
style,
|
|
48
58
|
testID
|
|
@@ -57,6 +67,12 @@ function PageHero({
|
|
|
57
67
|
const gap = Number((0, _figmaVariablesResolver.getVariableByName)('PageHero/gap', modes)) || 16;
|
|
58
68
|
const paddingHorizontal = Number((0, _figmaVariablesResolver.getVariableByName)('PageHero/padding/horizontal', modes)) || 0;
|
|
59
69
|
const textWrapGap = Number((0, _figmaVariablesResolver.getVariableByName)('PageHero/textWrap/gap', modes)) || 8;
|
|
70
|
+
|
|
71
|
+
// Media slot box — matches the 117×117 frame in Figma (node 4540:7845).
|
|
72
|
+
// Tokens fall back to 117 when not defined in the variables collection,
|
|
73
|
+
// so the layout stays stable on consumers that haven't tokenized this yet.
|
|
74
|
+
const mediaWidth = Number((0, _figmaVariablesResolver.getVariableByName)('media/width', modes)) || 117;
|
|
75
|
+
const mediaHeight = Number((0, _figmaVariablesResolver.getVariableByName)('media/height', modes)) || 117;
|
|
60
76
|
const eyebrowColor = (0, _figmaVariablesResolver.getVariableByName)('PageHero/eyebrow/color', modes) || '#ffffff';
|
|
61
77
|
const eyebrowFontFamily = (0, _figmaVariablesResolver.getVariableByName)('PageHero/eyebrow/fontFamily', modes) || 'System';
|
|
62
78
|
const eyebrowFontSize = Number((0, _figmaVariablesResolver.getVariableByName)('PageHero/eyebrow/fontSize', modes)) || 18;
|
|
@@ -132,10 +148,30 @@ function PageHero({
|
|
|
132
148
|
// shape never does.
|
|
133
149
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
134
150
|
}, [buttonSlot, showButton, buttonLabel, onButtonPress, modes]);
|
|
151
|
+
|
|
152
|
+
// Sized container for the media slot. Always rendered when `media` is
|
|
153
|
+
// provided, so the slot has a predictable box (matches Figma frame
|
|
154
|
+
// 4540:7845 — 117×117 by default) even if the inner element omits its
|
|
155
|
+
// own width/height. `overflow: 'hidden'` mirrors the Figma frame's
|
|
156
|
+
// `clipsContent` so a slightly oversized illustration doesn't break
|
|
157
|
+
// the centered layout.
|
|
158
|
+
const mediaContent = (0, _react.useMemo)(() => {
|
|
159
|
+
if (media === undefined || media === null) return null;
|
|
160
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
161
|
+
style: {
|
|
162
|
+
width: mediaWidth,
|
|
163
|
+
height: mediaHeight,
|
|
164
|
+
alignItems: 'center',
|
|
165
|
+
justifyContent: 'center',
|
|
166
|
+
overflow: 'hidden'
|
|
167
|
+
},
|
|
168
|
+
children: (0, _reactUtils.cloneChildrenWithModes)(media, modes)
|
|
169
|
+
});
|
|
170
|
+
}, [media, mediaWidth, mediaHeight, modes]);
|
|
135
171
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
136
172
|
style: [containerStyle, style],
|
|
137
173
|
testID: testID,
|
|
138
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
174
|
+
children: [mediaContent, /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
139
175
|
style: textWrapStyle,
|
|
140
176
|
children: [eyebrow ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
141
177
|
style: eyebrowStyle,
|
|
@@ -13,6 +13,21 @@ var _reactUtils = require("../../utils/react-utils");
|
|
|
13
13
|
var _MoneyValue = _interopRequireDefault(require("../MoneyValue/MoneyValue"));
|
|
14
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
15
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
|
+
// Defaults applied to the inner ButtonGroup so the card matches Figma out of
|
|
17
|
+
// the box. They are spread *before* the caller's `modes` so any consumer can
|
|
18
|
+
// override an individual key (e.g. swap the size to "M").
|
|
19
|
+
const DEFAULT_BUTTON_GROUP_MODES = {
|
|
20
|
+
AppearanceBrand: 'Secondary',
|
|
21
|
+
'Button / Size': 'S',
|
|
22
|
+
Emphasis: 'High'
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
// Defaults applied to the inner MoneyValue so the price renders at the
|
|
26
|
+
// 36 px / 900-weight scale defined for cards in Figma. Same merge rule as
|
|
27
|
+
// the button group — consumer `modes` override these.
|
|
28
|
+
const DEFAULT_MONEY_VALUE_MODES = {
|
|
29
|
+
Context3: 'Balance & Cards'
|
|
30
|
+
};
|
|
16
31
|
/**
|
|
17
32
|
* RechargeCard component implementation from Figma node 2235:937.
|
|
18
33
|
* Displays a recharge plan with price, validity, data, and subscription details.
|
|
@@ -28,17 +43,19 @@ function RechargeCard({
|
|
|
28
43
|
modes = _reactUtils.EMPTY_MODES,
|
|
29
44
|
style
|
|
30
45
|
}) {
|
|
31
|
-
// Container Tokens
|
|
32
|
-
const backgroundColor = (0, _figmaVariablesResolver.getVariableByName)('rechargeCard/background', modes) || '#
|
|
46
|
+
// Container Tokens (defaults mirror Figma node 2235:937).
|
|
47
|
+
const backgroundColor = (0, _figmaVariablesResolver.getVariableByName)('rechargeCard/background', modes) || '#ffffff';
|
|
33
48
|
const paddingHorizontal = parseInt((0, _figmaVariablesResolver.getVariableByName)('rechargeCard/padding/horizontal', modes) || 16, 10);
|
|
34
49
|
const paddingVertical = parseInt((0, _figmaVariablesResolver.getVariableByName)('rechargeCard/padding/vertical', modes) || 20, 10);
|
|
35
50
|
const gap = parseInt((0, _figmaVariablesResolver.getVariableByName)('rechargeCard/gap', modes) || 20, 10);
|
|
36
51
|
const radius = parseInt((0, _figmaVariablesResolver.getVariableByName)('rechargeCard/radius', modes) || 20, 10);
|
|
37
|
-
const minWidth = parseInt((0, _figmaVariablesResolver.getVariableByName)('rechargeCard/minWidth', modes) ||
|
|
52
|
+
const minWidth = parseInt((0, _figmaVariablesResolver.getVariableByName)('rechargeCard/minWidth', modes) || 312, 10);
|
|
53
|
+
const strokeWidth = parseInt((0, _figmaVariablesResolver.getVariableByName)('rechargeCard/strokeWidth', modes) || 1, 10);
|
|
54
|
+
const strokeColor = (0, _figmaVariablesResolver.getVariableByName)('rechargeCard/stroke/color', modes) || '#ebebed';
|
|
38
55
|
|
|
39
56
|
// Header Tokens
|
|
40
57
|
const headerGap = parseInt((0, _figmaVariablesResolver.getVariableByName)('rechargeCard/header/gap', modes) || 4, 10);
|
|
41
|
-
const titleColor = (0, _figmaVariablesResolver.getVariableByName)('rechargeCard/title/color', modes) || '#
|
|
58
|
+
const titleColor = (0, _figmaVariablesResolver.getVariableByName)('rechargeCard/title/color', modes) || '#000000';
|
|
42
59
|
const titleFontSize = parseInt((0, _figmaVariablesResolver.getVariableByName)('rechargeCard/title/fontSize', modes) || 12, 10);
|
|
43
60
|
const titleFontFamily = (0, _figmaVariablesResolver.getVariableByName)('rechargeCard/title/fontFamily', modes) || 'JioType Var';
|
|
44
61
|
const titleLineHeight = parseInt((0, _figmaVariablesResolver.getVariableByName)('rechargeCard/title/lineHeight', modes) || 14, 10);
|
|
@@ -49,30 +66,25 @@ function RechargeCard({
|
|
|
49
66
|
const specItemGap = parseInt((0, _figmaVariablesResolver.getVariableByName)('rechargeCard/specItem/gap', modes) || 4, 10);
|
|
50
67
|
|
|
51
68
|
// Spec Label Tokens
|
|
52
|
-
const specLabelColor = (0, _figmaVariablesResolver.getVariableByName)('rechargeCard/specItem/label/color', modes) || '#
|
|
69
|
+
const specLabelColor = (0, _figmaVariablesResolver.getVariableByName)('rechargeCard/specItem/label/color', modes) || '#000000';
|
|
53
70
|
const specLabelFontSize = parseInt((0, _figmaVariablesResolver.getVariableByName)('rechargeCard/specItem/label/fontSize', modes) || 12, 10);
|
|
54
71
|
const specLabelFontFamily = (0, _figmaVariablesResolver.getVariableByName)('rechargeCard/specItem/label/fontFamily', modes) || 'JioType Var';
|
|
55
72
|
const specLabelLineHeight = parseInt((0, _figmaVariablesResolver.getVariableByName)('rechargeCard/specItem/label/lineHeight', modes) || 14, 10);
|
|
56
73
|
const specLabelFontWeight = (0, _figmaVariablesResolver.getVariableByName)('rechargeCard/specItem/label/fontWeight', modes) || '500';
|
|
57
74
|
|
|
58
75
|
// Spec Value Tokens
|
|
59
|
-
const specValueColor = (0, _figmaVariablesResolver.getVariableByName)('rechargeCard/specItem/value/color', modes) || '#
|
|
76
|
+
const specValueColor = (0, _figmaVariablesResolver.getVariableByName)('rechargeCard/specItem/value/color', modes) || '#000000';
|
|
60
77
|
const specValueFontSize = parseInt((0, _figmaVariablesResolver.getVariableByName)('rechargeCard/specItem/value/fontSize', modes) || 14, 10);
|
|
61
78
|
const specValueFontFamily = (0, _figmaVariablesResolver.getVariableByName)('rechargeCard/specItem/value/fontFamily', modes) || 'JioType Var';
|
|
62
79
|
const specValueLineHeight = parseInt((0, _figmaVariablesResolver.getVariableByName)('rechargeCard/specItem/value/lineHeight', modes) || 17, 10);
|
|
63
80
|
const specValueFontWeight = (0, _figmaVariablesResolver.getVariableByName)('rechargeCard/specItem/value/fontWeight', modes) || '500';
|
|
64
81
|
|
|
65
82
|
// Disclaimer Tokens
|
|
66
|
-
const disclaimerColor = (0, _figmaVariablesResolver.getVariableByName)('rechargeCard/disclaimer/color', modes) || '#
|
|
83
|
+
const disclaimerColor = (0, _figmaVariablesResolver.getVariableByName)('rechargeCard/disclaimer/color', modes) || '#000000';
|
|
67
84
|
const disclaimerFontSize = parseInt((0, _figmaVariablesResolver.getVariableByName)('rechargeCard/disclaimer/fontSize', modes) || 10, 10);
|
|
68
85
|
const disclaimerFontFamily = (0, _figmaVariablesResolver.getVariableByName)('rechargeCard/disclaimer/fontFamily', modes) || 'JioType Var';
|
|
69
86
|
const disclaimerLineHeight = parseInt((0, _figmaVariablesResolver.getVariableByName)('rechargeCard/disclaimer/lineHeight', modes) || 13, 10);
|
|
70
87
|
const disclaimerFontWeight = (0, _figmaVariablesResolver.getVariableByName)('rechargeCard/disclaimer/fontWeight', modes) || '400';
|
|
71
|
-
|
|
72
|
-
// Button Group Tokens
|
|
73
|
-
// Handled by ButtonGroup component directly
|
|
74
|
-
|
|
75
|
-
// Helpers
|
|
76
88
|
const resolveFontWeight = weight => typeof weight === 'number' ? weight.toString() : weight;
|
|
77
89
|
|
|
78
90
|
// Pass modes to subscription children (e.g. AvatarGroup)
|
|
@@ -85,6 +97,8 @@ function RechargeCard({
|
|
|
85
97
|
paddingVertical,
|
|
86
98
|
gap,
|
|
87
99
|
borderRadius: radius,
|
|
100
|
+
borderWidth: strokeWidth,
|
|
101
|
+
borderColor: strokeColor,
|
|
88
102
|
minWidth,
|
|
89
103
|
alignItems: 'flex-start'
|
|
90
104
|
}, style],
|
|
@@ -105,7 +119,10 @@ function RechargeCard({
|
|
|
105
119
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_MoneyValue.default, {
|
|
106
120
|
value: price,
|
|
107
121
|
currency: "\u20B9",
|
|
108
|
-
modes:
|
|
122
|
+
modes: {
|
|
123
|
+
...DEFAULT_MONEY_VALUE_MODES,
|
|
124
|
+
...modes
|
|
125
|
+
}
|
|
109
126
|
})]
|
|
110
127
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
111
128
|
style: {
|
|
@@ -194,10 +211,8 @@ function RechargeCard({
|
|
|
194
211
|
children: disclaimer
|
|
195
212
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonGroup.default, {
|
|
196
213
|
modes: {
|
|
197
|
-
...
|
|
198
|
-
|
|
199
|
-
"Button / Size": "S",
|
|
200
|
-
"Emphasis": "High"
|
|
214
|
+
...DEFAULT_BUTTON_GROUP_MODES,
|
|
215
|
+
...modes
|
|
201
216
|
},
|
|
202
217
|
children: actions
|
|
203
218
|
})]
|
|
@@ -18,49 +18,45 @@ function Step({
|
|
|
18
18
|
modes = _reactUtils.EMPTY_MODES,
|
|
19
19
|
style,
|
|
20
20
|
index = 0,
|
|
21
|
+
showLine = true,
|
|
21
22
|
connectorStyle,
|
|
22
23
|
title,
|
|
23
24
|
supportingText,
|
|
25
|
+
metaText,
|
|
24
26
|
subtitle = true,
|
|
27
|
+
meta = true,
|
|
25
28
|
status = 'number'
|
|
26
29
|
}) {
|
|
27
|
-
// Container styles
|
|
28
30
|
const minHeight = Number((0, _figmaVariablesResolver.getVariableByName)('steperItem/minHeight', modes)) || 52;
|
|
29
|
-
const gap = Number((0, _figmaVariablesResolver.getVariableByName)('steperItem/gap', modes)) ||
|
|
30
|
-
|
|
31
|
-
// Indicator dimensions and styles
|
|
32
|
-
const indicatorSize = Number((0, _figmaVariablesResolver.getVariableByName)('stepIndicator/size', modes)) || 24;
|
|
31
|
+
const gap = Number((0, _figmaVariablesResolver.getVariableByName)('steperItem/gap', modes)) || 16;
|
|
32
|
+
const indicatorSize = Number((0, _figmaVariablesResolver.getVariableByName)('stepIndicator/size', modes)) || 36;
|
|
33
33
|
const indicatorRadius = Number((0, _figmaVariablesResolver.getVariableByName)('stepIndicator/radius', modes)) || 9999;
|
|
34
|
-
const indicatorBg = (0, _figmaVariablesResolver.getVariableByName)('stepIndicator/background', modes) || '#
|
|
35
|
-
const indicatorBorderColor = (0, _figmaVariablesResolver.getVariableByName)('stepIndicator/border/color', modes) || '#
|
|
34
|
+
const indicatorBg = (0, _figmaVariablesResolver.getVariableByName)('stepIndicator/background', modes) || '#5d00b5';
|
|
35
|
+
const indicatorBorderColor = (0, _figmaVariablesResolver.getVariableByName)('stepIndicator/border/color', modes) || '#5d00b5';
|
|
36
36
|
const indicatorBorderSize = Number((0, _figmaVariablesResolver.getVariableByName)('stepIndicator/border/size', modes)) || 1;
|
|
37
37
|
const iconColor = (0, _figmaVariablesResolver.getVariableByName)('stepIndicator/icon/color', modes) || '#ffffff';
|
|
38
|
-
|
|
39
|
-
// Label styles (for number)
|
|
38
|
+
const stepStatusSize = Number((0, _figmaVariablesResolver.getVariableByName)('stepStatus/size', modes)) || 18;
|
|
40
39
|
const labelFontSize = Number((0, _figmaVariablesResolver.getVariableByName)('stepIndicator/label/fontSize', modes)) || 12;
|
|
41
40
|
const labelFontFamily = (0, _figmaVariablesResolver.getVariableByName)('stepIndicator/label/fontFamily', modes) || undefined;
|
|
42
41
|
const labelLineHeight = Number((0, _figmaVariablesResolver.getVariableByName)('stepIndicator/label/lineHeight', modes)) || 14;
|
|
43
42
|
const labelFontWeight = (0, _figmaVariablesResolver.getVariableByName)('stepIndicator/label/fontWeight', modes) || '500';
|
|
44
|
-
|
|
45
|
-
// Vertical line styles
|
|
46
43
|
const lineSize = Number((0, _figmaVariablesResolver.getVariableByName)('steperItem/lineSize', modes)) || 2;
|
|
47
|
-
const lineColor = (0, _figmaVariablesResolver.getVariableByName)('steperItem/line', modes) || '#
|
|
44
|
+
const lineColor = (0, _figmaVariablesResolver.getVariableByName)('steperItem/line', modes) || '#5d00b5';
|
|
48
45
|
const badgeWrapGap = Number((0, _figmaVariablesResolver.getVariableByName)('steperItem/badgeWrap/gap', modes)) || 2;
|
|
49
46
|
const containerStyle = {
|
|
50
47
|
flexDirection: 'row',
|
|
51
48
|
minHeight,
|
|
49
|
+
gap,
|
|
52
50
|
...style
|
|
53
51
|
};
|
|
54
|
-
|
|
55
|
-
// FIX: This wrapper should NOT expand. It should be exact width of the indicator.
|
|
56
52
|
const indicatorWrapperStyle = {
|
|
57
53
|
flexDirection: 'column',
|
|
58
54
|
alignItems: 'center',
|
|
59
55
|
width: indicatorSize,
|
|
60
56
|
flexGrow: 0,
|
|
61
|
-
// Do NOT grow
|
|
62
57
|
flexShrink: 0,
|
|
63
|
-
gap: badgeWrapGap
|
|
58
|
+
gap: badgeWrapGap,
|
|
59
|
+
alignSelf: 'stretch'
|
|
64
60
|
};
|
|
65
61
|
const indicatorStyle = {
|
|
66
62
|
width: indicatorSize,
|
|
@@ -73,6 +69,12 @@ function Step({
|
|
|
73
69
|
justifyContent: 'center',
|
|
74
70
|
overflow: 'hidden'
|
|
75
71
|
};
|
|
72
|
+
const stepStatusContainerStyle = {
|
|
73
|
+
width: stepStatusSize,
|
|
74
|
+
height: stepStatusSize,
|
|
75
|
+
alignItems: 'center',
|
|
76
|
+
justifyContent: 'center'
|
|
77
|
+
};
|
|
76
78
|
const labelStyle = {
|
|
77
79
|
color: iconColor,
|
|
78
80
|
fontSize: labelFontSize,
|
|
@@ -81,24 +83,19 @@ function Step({
|
|
|
81
83
|
lineHeight: labelLineHeight,
|
|
82
84
|
textAlign: 'center'
|
|
83
85
|
};
|
|
84
|
-
|
|
85
|
-
// Combine base line style with injected connectorStyle
|
|
86
86
|
const lineStyle = {
|
|
87
87
|
width: lineSize,
|
|
88
88
|
backgroundColor: lineColor,
|
|
89
89
|
flexGrow: 1,
|
|
90
|
-
|
|
91
|
-
...connectorStyle
|
|
90
|
+
minHeight: 1,
|
|
91
|
+
...connectorStyle
|
|
92
92
|
};
|
|
93
|
-
|
|
94
|
-
// Helper for icons
|
|
95
93
|
const renderIcon = () => {
|
|
96
94
|
switch (status) {
|
|
97
95
|
case 'complete':
|
|
98
|
-
// Checkmark
|
|
99
96
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.default, {
|
|
100
|
-
width:
|
|
101
|
-
height:
|
|
97
|
+
width: stepStatusSize,
|
|
98
|
+
height: stepStatusSize,
|
|
102
99
|
viewBox: "0 0 24 24",
|
|
103
100
|
fill: "none",
|
|
104
101
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Path, {
|
|
@@ -110,10 +107,9 @@ function Step({
|
|
|
110
107
|
})
|
|
111
108
|
});
|
|
112
109
|
case 'error':
|
|
113
|
-
// X mark
|
|
114
110
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.default, {
|
|
115
|
-
width:
|
|
116
|
-
height:
|
|
111
|
+
width: stepStatusSize,
|
|
112
|
+
height: stepStatusSize,
|
|
117
113
|
viewBox: "0 0 24 24",
|
|
118
114
|
fill: "none",
|
|
119
115
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Path, {
|
|
@@ -125,10 +121,9 @@ function Step({
|
|
|
125
121
|
})
|
|
126
122
|
});
|
|
127
123
|
case 'warning':
|
|
128
|
-
// Exclamation / Triangle
|
|
129
124
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.default, {
|
|
130
|
-
width:
|
|
131
|
-
height:
|
|
125
|
+
width: stepStatusSize,
|
|
126
|
+
height: stepStatusSize,
|
|
132
127
|
viewBox: "0 0 24 24",
|
|
133
128
|
fill: "none",
|
|
134
129
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Path, {
|
|
@@ -147,46 +142,38 @@ function Step({
|
|
|
147
142
|
});
|
|
148
143
|
}
|
|
149
144
|
};
|
|
150
|
-
|
|
151
|
-
// Clone children to pass modes if they are StepLabel
|
|
152
|
-
const childrenWithProps = _react.default.Children.map(children, child => {
|
|
153
|
-
if (/*#__PURE__*/_react.default.isValidElement(child)) {
|
|
154
|
-
return /*#__PURE__*/_react.default.cloneElement(child, {
|
|
155
|
-
modes
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
return child;
|
|
159
|
-
});
|
|
160
|
-
|
|
161
|
-
// Determine if we have content to pad
|
|
162
|
-
// Default padding bottom to 16 if line is shown, but also respect connectorStyle display
|
|
163
|
-
// If display is none, we probably don't want the padding bottom either.
|
|
164
|
-
const isLineHidden = connectorStyle?.display === 'none';
|
|
165
|
-
const contentPaddingBottom = isLineHidden ? 0 : 16;
|
|
145
|
+
const hasSlotChildren = _react.default.Children.count(children) > 0;
|
|
166
146
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
167
147
|
style: containerStyle,
|
|
168
148
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
169
149
|
style: indicatorWrapperStyle,
|
|
170
150
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
171
151
|
style: indicatorStyle,
|
|
172
|
-
children:
|
|
173
|
-
|
|
152
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
153
|
+
style: stepStatusContainerStyle,
|
|
154
|
+
children: renderIcon()
|
|
155
|
+
})
|
|
156
|
+
}), showLine ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
174
157
|
style: lineStyle
|
|
175
|
-
})]
|
|
176
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
177
|
-
style: {
|
|
178
|
-
width: gap
|
|
179
|
-
}
|
|
158
|
+
}) : null]
|
|
180
159
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
181
160
|
style: {
|
|
182
|
-
flex: 1
|
|
183
|
-
paddingBottom: contentPaddingBottom
|
|
161
|
+
flex: 1
|
|
184
162
|
},
|
|
185
|
-
children:
|
|
186
|
-
title
|
|
187
|
-
|
|
163
|
+
children: hasSlotChildren ? (0, _reactUtils.cloneChildrenWithModes)(children, modes) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_StepLabel.StepLabel, {
|
|
164
|
+
...(title !== undefined ? {
|
|
165
|
+
title
|
|
166
|
+
} : {}),
|
|
167
|
+
...(supportingText !== undefined ? {
|
|
168
|
+
supportingText
|
|
169
|
+
} : {}),
|
|
170
|
+
...(metaText !== undefined ? {
|
|
171
|
+
metaText
|
|
172
|
+
} : {}),
|
|
173
|
+
subtitle: subtitle,
|
|
174
|
+
meta: meta,
|
|
188
175
|
modes: modes
|
|
189
|
-
})
|
|
176
|
+
})
|
|
190
177
|
})]
|
|
191
178
|
});
|
|
192
179
|
}
|
|
@@ -13,24 +13,42 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
13
13
|
function StepLabel({
|
|
14
14
|
title = 'Stepper Item',
|
|
15
15
|
supportingText,
|
|
16
|
+
metaText,
|
|
17
|
+
subtitle = true,
|
|
18
|
+
meta = true,
|
|
16
19
|
modes = _reactUtils.EMPTY_MODES,
|
|
17
20
|
style
|
|
18
21
|
}) {
|
|
19
|
-
// Title styles
|
|
20
22
|
const titleColor = (0, _figmaVariablesResolver.getVariableByName)('steperItem/title/color', modes) || '#0d0d0f';
|
|
21
23
|
const titleFontSize = Number((0, _figmaVariablesResolver.getVariableByName)('steperItem/title/fontSize', modes)) || 14;
|
|
22
24
|
const titleFontFamily = (0, _figmaVariablesResolver.getVariableByName)('steperItem/title/fontFamily', modes) || undefined;
|
|
23
25
|
const titleLineHeight = Number((0, _figmaVariablesResolver.getVariableByName)('steperItem/title/lineHeight', modes)) || 18;
|
|
24
26
|
const titleFontWeight = (0, _figmaVariablesResolver.getVariableByName)('steperItem/title/fontWeight', modes) || '700';
|
|
25
27
|
|
|
26
|
-
// Subtitle
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
28
|
+
// The Subtitle (supportingText) and Meta both default to the "Neutral"
|
|
29
|
+
// AppearanceBrand. A caller-supplied `AppearanceBrand` still wins (it is
|
|
30
|
+
// spread after the default), so each remains overridable. The Title keeps
|
|
31
|
+
// its own appearance resolution.
|
|
32
|
+
const subtitleModes = {
|
|
33
|
+
AppearanceBrand: 'Neutral',
|
|
34
|
+
...modes
|
|
35
|
+
};
|
|
36
|
+
const metaModes = {
|
|
37
|
+
AppearanceBrand: 'Neutral',
|
|
38
|
+
...modes
|
|
39
|
+
};
|
|
40
|
+
const subtitleColor = (0, _figmaVariablesResolver.getVariableByName)('steperItem/subtitle/color', subtitleModes) || '#3d4047';
|
|
41
|
+
const subtitleFontSize = Number((0, _figmaVariablesResolver.getVariableByName)('steperItem/subtitle/fontSize', subtitleModes)) || 12;
|
|
42
|
+
const subtitleFontFamily = (0, _figmaVariablesResolver.getVariableByName)('steperItem/subtitle/fontFamily', subtitleModes) || undefined;
|
|
43
|
+
const subtitleLineHeight = Number((0, _figmaVariablesResolver.getVariableByName)('steperItem/subtitle/lineHeight', subtitleModes)) || 16;
|
|
44
|
+
const subtitleFontWeight = (0, _figmaVariablesResolver.getVariableByName)('steperItem/subtitle/fontWeight', subtitleModes) || '400';
|
|
45
|
+
const metaColor = (0, _figmaVariablesResolver.getVariableByName)('steperItem/meta/color', metaModes) || '#f7ab21';
|
|
46
|
+
const metaFontSize = Number((0, _figmaVariablesResolver.getVariableByName)('steperItem/meta/fontSize', metaModes)) || 10;
|
|
47
|
+
// The Figma variable is authored as "fontFamily Copy" (with a space + suffix).
|
|
48
|
+
// Match the literal Figma name to avoid a missing-variable warning.
|
|
49
|
+
const metaFontFamily = (0, _figmaVariablesResolver.getVariableByName)('steperItem/meta/fontFamily Copy', metaModes) || undefined;
|
|
50
|
+
const metaLineHeight = Number((0, _figmaVariablesResolver.getVariableByName)('steperItem/meta/lineHeight', metaModes)) || 12;
|
|
51
|
+
const metaFontWeight = (0, _figmaVariablesResolver.getVariableByName)('steperItem/meta/fontWeight', metaModes) || '700';
|
|
34
52
|
const textGap = Number((0, _figmaVariablesResolver.getVariableByName)('steperItem/textWrap/gap', modes)) || 2;
|
|
35
53
|
const titleStyle = {
|
|
36
54
|
color: titleColor,
|
|
@@ -46,6 +64,15 @@ function StepLabel({
|
|
|
46
64
|
fontWeight: subtitleFontWeight,
|
|
47
65
|
lineHeight: subtitleLineHeight
|
|
48
66
|
};
|
|
67
|
+
const metaStyle = {
|
|
68
|
+
color: metaColor,
|
|
69
|
+
fontSize: metaFontSize,
|
|
70
|
+
fontFamily: metaFontFamily,
|
|
71
|
+
fontWeight: metaFontWeight,
|
|
72
|
+
lineHeight: metaLineHeight
|
|
73
|
+
};
|
|
74
|
+
const showSubtitle = subtitle && !!supportingText;
|
|
75
|
+
const showMeta = meta && !!metaText;
|
|
49
76
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
50
77
|
style: [{
|
|
51
78
|
gap: textGap,
|
|
@@ -54,9 +81,12 @@ function StepLabel({
|
|
|
54
81
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
55
82
|
style: titleStyle,
|
|
56
83
|
children: title
|
|
57
|
-
}),
|
|
84
|
+
}), showSubtitle ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
58
85
|
style: subtitleStyle,
|
|
59
86
|
children: supportingText
|
|
87
|
+
}) : null, showMeta ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
88
|
+
style: metaStyle,
|
|
89
|
+
children: metaText
|
|
60
90
|
}) : null]
|
|
61
91
|
});
|
|
62
92
|
}
|
|
@@ -29,7 +29,6 @@ function Stepper({
|
|
|
29
29
|
modes = _reactUtils.EMPTY_MODES,
|
|
30
30
|
style
|
|
31
31
|
}) {
|
|
32
|
-
// Stepper container styles
|
|
33
32
|
const paddingHorizontal = Number((0, _figmaVariablesResolver.getVariableByName)('stepper/padding/horizontal', modes)) || 8;
|
|
34
33
|
const paddingVertical = Number((0, _figmaVariablesResolver.getVariableByName)('stepper/padding/vertical', modes)) || 0;
|
|
35
34
|
const gap = Number((0, _figmaVariablesResolver.getVariableByName)('stepper/gap', modes)) || 2;
|
|
@@ -39,25 +38,24 @@ function Stepper({
|
|
|
39
38
|
gap,
|
|
40
39
|
...style
|
|
41
40
|
};
|
|
42
|
-
|
|
43
|
-
// Inject index and connectorStyle logic into Step children
|
|
44
41
|
const steps = _react.default.Children.toArray(children);
|
|
45
|
-
const
|
|
46
|
-
if (/*#__PURE__*/_react.default.isValidElement(child))
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
42
|
+
const stepsWithProps = steps.map((child, stepIndex) => {
|
|
43
|
+
if (! /*#__PURE__*/_react.default.isValidElement(child)) return child;
|
|
44
|
+
const isLast = stepIndex === steps.length - 1;
|
|
45
|
+
const childProps = child.props || {};
|
|
46
|
+
const childModes = childProps.modes ? {
|
|
47
|
+
...modes,
|
|
48
|
+
...childProps.modes
|
|
49
|
+
} : modes;
|
|
50
|
+
return /*#__PURE__*/_react.default.cloneElement(child, {
|
|
51
|
+
...childProps,
|
|
52
|
+
index: childProps.index ?? stepIndex,
|
|
53
|
+
modes: childModes,
|
|
54
|
+
showLine: childProps.showLine !== undefined ? childProps.showLine : !isLast
|
|
55
|
+
});
|
|
58
56
|
});
|
|
59
57
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
60
58
|
style: containerStyle,
|
|
61
|
-
children:
|
|
59
|
+
children: stepsWithProps
|
|
62
60
|
});
|
|
63
61
|
}
|