jfs-components 0.1.34 → 0.1.36
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 +14 -0
- package/D2C.md +82 -87
- package/lib/commonjs/components/LottiePlayer/LottiePlayer.js +5 -5
- package/lib/commonjs/components/LottiePlayer/LottiePlayer.web.js +2 -2
- package/lib/commonjs/components/PageHero/PageHero.js +73 -76
- package/lib/commonjs/design-tokens/Coin Variables-variables-full.json +42204 -1
- package/lib/commonjs/design-tokens/figma-modes.generated.js +52 -37
- package/lib/commonjs/icons/registry.js +1 -1
- package/lib/module/components/LottiePlayer/LottiePlayer.js +5 -5
- package/lib/module/components/LottiePlayer/LottiePlayer.web.js +2 -2
- package/lib/module/components/PageHero/PageHero.js +73 -76
- package/lib/module/design-tokens/Coin Variables-variables-full.json +42204 -1
- package/lib/module/design-tokens/figma-modes.generated.js +52 -37
- package/lib/module/icons/registry.js +1 -1
- package/lib/typescript/src/components/LottiePlayer/LottiePlayer.d.ts +6 -6
- package/lib/typescript/src/components/PageHero/PageHero.d.ts +33 -25
- package/lib/typescript/src/design-tokens/figma-modes.generated.d.ts +14 -1
- package/lib/typescript/src/icons/registry.d.ts +1 -1
- package/package.json +3 -1
- package/scripts/extract-figma-modes.js +150 -121
- package/src/components/LottiePlayer/LottiePlayer.tsx +8 -8
- package/src/components/LottiePlayer/LottiePlayer.web.tsx +2 -2
- package/src/components/PageHero/PageHero.tsx +142 -106
- package/src/design-tokens/Coin Variables-variables-full.json +42204 -1
- package/src/design-tokens/figma-modes.generated.ts +52 -37
- package/src/icons/registry.ts +1 -1
|
@@ -23,10 +23,10 @@ export type LottiePlayerProps = {
|
|
|
23
23
|
* Override the rendered size. Pass a number for a square box, or
|
|
24
24
|
* `{ width, height }` for non-square.
|
|
25
25
|
*
|
|
26
|
-
* When omitted, size is resolved from the `
|
|
27
|
-
* design tokens (default `117 × 117`). The `
|
|
26
|
+
* When omitted, size is resolved from the `video/width` and `video/height`
|
|
27
|
+
* design tokens (default `117 × 117`). The `Video / Output` collection
|
|
28
28
|
* exposes `L | M | S` modes (117 / 70 / 20) — pass
|
|
29
|
-
* `modes={{ '
|
|
29
|
+
* `modes={{ 'Video / Output': 'M' }}` to render at 70×70, etc.
|
|
30
30
|
*/
|
|
31
31
|
size?: number | {
|
|
32
32
|
width: number;
|
|
@@ -64,8 +64,8 @@ export type LottiePlayerProps = {
|
|
|
64
64
|
* webpack via platform extensions — same pattern as `MediaCard/GlassFill`.
|
|
65
65
|
*
|
|
66
66
|
* Token-driven sizing: when `size` is omitted, `LottiePlayer` reads
|
|
67
|
-
* `
|
|
68
|
-
* animation matches the surrounding component's `
|
|
67
|
+
* `video/width` and `video/height` from the Figma variables resolver, so the
|
|
68
|
+
* animation matches the surrounding component's `Video / Output` mode
|
|
69
69
|
* automatically. This is the same sizing contract `PageHero` and
|
|
70
70
|
* `LottieIntroBlock` use for their `media` slots.
|
|
71
71
|
*
|
|
@@ -76,7 +76,7 @@ export type LottiePlayerProps = {
|
|
|
76
76
|
*
|
|
77
77
|
* <LottiePlayer source={animation} /> // 117 × 117 (default)
|
|
78
78
|
* <LottiePlayer source={animation} size={70} /> // 70 × 70
|
|
79
|
-
* <LottiePlayer source={animation} modes={{ '
|
|
79
|
+
* <LottiePlayer source={animation} modes={{ 'Video / Output': 'S' }} /> // 20 × 20
|
|
80
80
|
* <PageHero media={<LottiePlayer source={animation} />} />
|
|
81
81
|
* ```
|
|
82
82
|
*/
|
|
@@ -4,12 +4,18 @@ import type { Modes } from '../../design-tokens';
|
|
|
4
4
|
export type PageHeroProps = {
|
|
5
5
|
/** Small eyebrow text shown above the headline. */
|
|
6
6
|
eyebrow?: string;
|
|
7
|
+
/** Whether to render the eyebrow line. */
|
|
8
|
+
showEyebrow?: boolean;
|
|
7
9
|
/** Main headline text. Centered and bold. */
|
|
8
10
|
headline?: string;
|
|
9
|
-
/**
|
|
11
|
+
/** Supporting text shown directly below the headline (e.g. price). */
|
|
10
12
|
supportingText?: string;
|
|
11
13
|
/** Whether to render the supporting text. */
|
|
12
14
|
showSupportingText?: boolean;
|
|
15
|
+
/** Optional second supporting line shown below `supportingText`. */
|
|
16
|
+
body?: string;
|
|
17
|
+
/** Whether to render the body line. */
|
|
18
|
+
showBody?: boolean;
|
|
13
19
|
/** Label for the default action button. Ignored when `buttonSlot` is provided. */
|
|
14
20
|
buttonLabel?: string;
|
|
15
21
|
/** Press handler for the default action button. Ignored when `buttonSlot` is provided. */
|
|
@@ -17,9 +23,10 @@ export type PageHeroProps = {
|
|
|
17
23
|
/** Whether to render the default action button. Ignored when `buttonSlot` is provided. */
|
|
18
24
|
showButton?: boolean;
|
|
19
25
|
/**
|
|
20
|
-
* Optional slot to fully override the action button.
|
|
21
|
-
* When provided, `showButton`,
|
|
22
|
-
* `
|
|
26
|
+
* Optional slot to fully override the action button area (e.g. a
|
|
27
|
+
* `ButtonGroup` with several buttons). When provided, `showButton`,
|
|
28
|
+
* `buttonLabel`, and `onButtonPress` are ignored. `modes` are automatically
|
|
29
|
+
* cascaded into this slot.
|
|
23
30
|
*/
|
|
24
31
|
buttonSlot?: React.ReactNode;
|
|
25
32
|
/**
|
|
@@ -27,16 +34,18 @@ export type PageHeroProps = {
|
|
|
27
34
|
*
|
|
28
35
|
* Intentionally typed as `React.ReactNode` so the consumer can bring any
|
|
29
36
|
* renderer they like — `<Image />`, `<IconCapsule />`, a Lottie player
|
|
30
|
-
* (`
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
37
|
+
* (`LottiePlayer` / `lottie-react-native`), an `<SvgXml />` from
|
|
38
|
+
* `react-native-svg`, a `<Video />` from `react-native-video`, a gradient
|
|
39
|
+
* view, or a custom illustration. The library deliberately does NOT wrap
|
|
40
|
+
* Lottie / video runtimes (they require native modules + pod autolinking on
|
|
41
|
+
* every consumer's app), so PageHero just allocates a token-sized container
|
|
42
|
+
* and lets the slot render whatever it wants.
|
|
36
43
|
*
|
|
37
|
-
* The slot is rendered inside a `width × height` box driven by
|
|
38
|
-
* `
|
|
39
|
-
*
|
|
44
|
+
* The slot is rendered inside a `width × height` box driven by the
|
|
45
|
+
* `video/width` and `video/height` tokens from the `Video / Output`
|
|
46
|
+
* collection (`L | M | S` → 117 / 70 / 20; default `L` = 117×117).
|
|
47
|
+
* `modes` are automatically cascaded into the slot via
|
|
48
|
+
* `cloneChildrenWithModes`.
|
|
40
49
|
*/
|
|
41
50
|
media?: React.ReactNode;
|
|
42
51
|
/** Mode configuration for design-token theming. */
|
|
@@ -49,12 +58,16 @@ export type PageHeroProps = {
|
|
|
49
58
|
* PageHero displays a centered hero block typically used at the top of a page
|
|
50
59
|
* or feature screen. It contains an optional media slot (illustration / image
|
|
51
60
|
* / Lottie / SVG / video — consumer's choice), an eyebrow line, a large
|
|
52
|
-
* headline, an optional supporting line (e.g. price
|
|
53
|
-
* optional action button.
|
|
61
|
+
* headline, an optional supporting line (e.g. price), an optional body line
|
|
62
|
+
* (e.g. timeline), and an optional action button.
|
|
54
63
|
*
|
|
55
64
|
* All visual values are resolved from Figma design tokens via
|
|
56
|
-
* `getVariableByName
|
|
57
|
-
*
|
|
65
|
+
* `getVariableByName` (Figma node 4453:2348 — "Page Hero"). Text colors react
|
|
66
|
+
* to the `Page type` (`MainPage | SubPage | JioPlus`) and `Color Mode`
|
|
67
|
+
* (`Light | Dark`) collections; type scale reacts to `PageHero Size`
|
|
68
|
+
* (`M | S`); the media box reacts to `Video / Output` (`L | M | S`). Slots
|
|
69
|
+
* cascade the active `modes` to their children through
|
|
70
|
+
* `cloneChildrenWithModes`.
|
|
58
71
|
*
|
|
59
72
|
* @component
|
|
60
73
|
* @example
|
|
@@ -65,16 +78,11 @@ export type PageHeroProps = {
|
|
|
65
78
|
* supportingText="₹999/year · ₹0 until 2027"
|
|
66
79
|
* buttonLabel="Renew for free"
|
|
67
80
|
* onButtonPress={() => navigate('Upgrade')}
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
* imageSource={require('./assets/upgrade.png')}
|
|
71
|
-
* width={117}
|
|
72
|
-
* height={117}
|
|
73
|
-
* />
|
|
74
|
-
* }
|
|
81
|
+
* modes={{ 'Page type': 'JioPlus' }}
|
|
82
|
+
* media={<LottiePlayer source={animation} />}
|
|
75
83
|
* />
|
|
76
84
|
* ```
|
|
77
85
|
*/
|
|
78
|
-
declare function PageHero({ eyebrow, headline, supportingText, showSupportingText, buttonLabel, onButtonPress, showButton, buttonSlot, media, modes: propModes, style, testID, }: PageHeroProps): import("react/jsx-runtime").JSX.Element;
|
|
86
|
+
declare function PageHero({ eyebrow, showEyebrow, headline, supportingText, showSupportingText, body, showBody, buttonLabel, onButtonPress, showButton, buttonSlot, media, modes: propModes, style, testID, }: PageHeroProps): import("react/jsx-runtime").JSX.Element;
|
|
79
87
|
export default PageHero;
|
|
80
88
|
//# sourceMappingURL=PageHero.d.ts.map
|
|
@@ -33,6 +33,7 @@ export declare const FIGMA_MODES: {
|
|
|
33
33
|
readonly "BankAccountCard / Output": readonly ["Default"];
|
|
34
34
|
readonly "Benefit Card": readonly ["Default"];
|
|
35
35
|
readonly Blur: readonly ["Default"];
|
|
36
|
+
readonly "Border Boolean": readonly ["False", "True"];
|
|
36
37
|
readonly "bottomNav / Output": readonly ["Default"];
|
|
37
38
|
readonly "BottomNavItem / Output": readonly ["Default"];
|
|
38
39
|
readonly "BottomNavItem / State": readonly ["Idle", "Active"];
|
|
@@ -47,6 +48,8 @@ export declare const FIGMA_MODES: {
|
|
|
47
48
|
readonly "Card / Output": readonly ["Default"];
|
|
48
49
|
readonly "Card Apperance": readonly ["Default", "Plain"];
|
|
49
50
|
readonly "Card Feedback / Output": readonly ["Default"];
|
|
51
|
+
readonly "Card Tab / output": readonly ["Default"];
|
|
52
|
+
readonly "Card Tab State": readonly ["Default", "Active"];
|
|
50
53
|
readonly "Card.Media": readonly ["Default"];
|
|
51
54
|
readonly "Card/CTA / Output": readonly ["Default"];
|
|
52
55
|
readonly "Card/Insight": readonly ["Default"];
|
|
@@ -112,6 +115,9 @@ export declare const FIGMA_MODES: {
|
|
|
112
115
|
readonly "Emphasis / DataViz": readonly ["High", "Medium", "Low"];
|
|
113
116
|
readonly "EmptyState / Output": readonly ["Default"];
|
|
114
117
|
readonly "ExpandableCheckbox / Output": readonly ["Default"];
|
|
118
|
+
readonly "Favorite Toggle Color": readonly ["Default", "Active"];
|
|
119
|
+
readonly "Favorite Toggle Size": readonly ["S", "M", "L"];
|
|
120
|
+
readonly "Favorite Toggle/ output": readonly ["Default"];
|
|
115
121
|
readonly "Feedback / Output": readonly ["Default"];
|
|
116
122
|
readonly "filterBar / Output": readonly ["Default"];
|
|
117
123
|
readonly "FinancialConditionCard / Output": readonly ["Default"];
|
|
@@ -122,9 +128,13 @@ export declare const FIGMA_MODES: {
|
|
|
122
128
|
readonly Gap: readonly ["S", "M", "L", "None"];
|
|
123
129
|
readonly "Gauge / Output": readonly ["Default"];
|
|
124
130
|
readonly "Grid / Output": readonly ["Default"];
|
|
131
|
+
readonly "Grid Gap": readonly ["S", "M"];
|
|
125
132
|
readonly "Handle Boolean": readonly ["True", "False"];
|
|
126
133
|
readonly "Heading / Output": readonly ["Default"];
|
|
127
134
|
readonly "Heading text": readonly ["Default", "Slot"];
|
|
135
|
+
readonly "hello Jio / Output": readonly ["Default"];
|
|
136
|
+
readonly "Hello Jio Input Size": readonly ["M", "L"];
|
|
137
|
+
readonly "Hello Jio Input State": readonly ["Idle", "Active"];
|
|
128
138
|
readonly "HeroSection / Output": readonly ["Default"];
|
|
129
139
|
readonly "Holdings card / Output": readonly ["Default"];
|
|
130
140
|
readonly "HStack / Output": readonly ["Default"];
|
|
@@ -175,6 +185,7 @@ export declare const FIGMA_MODES: {
|
|
|
175
185
|
readonly "Page Hero / Output": readonly ["Default"];
|
|
176
186
|
readonly "Page type": readonly ["MainPage", "SubPage", "JioPlus"];
|
|
177
187
|
readonly "PageHero / Output": readonly ["Default"];
|
|
188
|
+
readonly "PageHero Size": readonly ["M", "S"];
|
|
178
189
|
readonly "PaymnetFeedback / Output": readonly ["Default"];
|
|
179
190
|
readonly "PDP cc card": readonly ["Default"];
|
|
180
191
|
readonly peekOffset: readonly ["Medium", "Small", "Large", "None"];
|
|
@@ -196,6 +207,7 @@ export declare const FIGMA_MODES: {
|
|
|
196
207
|
readonly "RangeTrack / Output": readonly ["Default"];
|
|
197
208
|
readonly "Rating / Output": readonly ["Default"];
|
|
198
209
|
readonly "Rating Star / Output": readonly ["Default"];
|
|
210
|
+
readonly "Rating Star Size": readonly ["S", "M", "L"];
|
|
199
211
|
readonly "Rating Star State": readonly ["idle", "selected"];
|
|
200
212
|
readonly "RechargeCard / Output": readonly ["Default"];
|
|
201
213
|
readonly rotfl: readonly ["Default"];
|
|
@@ -240,7 +252,7 @@ export declare const FIGMA_MODES: {
|
|
|
240
252
|
readonly "Tabs / Output": readonly ["Default"];
|
|
241
253
|
readonly TestimonialsCard: readonly ["Default"];
|
|
242
254
|
readonly "Text / Output": readonly ["Default"];
|
|
243
|
-
readonly "Text Appearance": readonly ["Neutral", "Primary", "Secondary", "Tertiary"];
|
|
255
|
+
readonly "Text Appearance": readonly ["Neutral", "Primary", "Secondary", "Tertiary", "Success", "Warning", "Error"];
|
|
244
256
|
readonly "Text Sizes": readonly ["Medium", "Small", "Large"];
|
|
245
257
|
readonly "textInput / Output": readonly ["Default"];
|
|
246
258
|
readonly "TextSegment / Output": readonly ["Default"];
|
|
@@ -259,6 +271,7 @@ export declare const FIGMA_MODES: {
|
|
|
259
271
|
readonly "TransationDetails / Output": readonly ["Default"];
|
|
260
272
|
readonly "UPI Handle / Output": readonly ["Default"];
|
|
261
273
|
readonly "UPI Handle Image": readonly ["True", "False"];
|
|
274
|
+
readonly "valueBack metric": readonly ["Default"];
|
|
262
275
|
readonly "ValueBar / Output": readonly ["Default"];
|
|
263
276
|
readonly "Video / Output": readonly ["L", "M", "S"];
|
|
264
277
|
readonly "VStack / Output": readonly ["Default"];
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Auto-generated from SVG files in src/icons/
|
|
5
5
|
* DO NOT EDIT MANUALLY - Run "npm run icons:generate" to regenerate
|
|
6
6
|
*
|
|
7
|
-
* Generated: 2026-07-
|
|
7
|
+
* Generated: 2026-07-21T07:33:30.350Z
|
|
8
8
|
*/
|
|
9
9
|
export declare const iconRegistry: Record<string, {
|
|
10
10
|
path: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jfs-components",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.36",
|
|
4
4
|
"description": "React Native Jio Finance Components Library",
|
|
5
5
|
"author": "sunshuaiqi@gmail.com",
|
|
6
6
|
"license": "MIT",
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
],
|
|
33
33
|
"scripts": {
|
|
34
34
|
"test": "jest",
|
|
35
|
+
"test:extract-modes": "jest scripts/__tests__/extract-figma-modes.test.js --runInBand",
|
|
35
36
|
"lint": "eslint .",
|
|
36
37
|
"build-react": "webpack --mode production",
|
|
37
38
|
"start-react": "webpack-dev-server --config ./webpack.config.js --mode development",
|
|
@@ -92,6 +93,7 @@
|
|
|
92
93
|
"@shopify/flash-list": "^2.2.0",
|
|
93
94
|
"ajv": "^8.17.1",
|
|
94
95
|
"ajv-keywords": "^5.1.0",
|
|
96
|
+
"dotenv": "^17.4.2",
|
|
95
97
|
"expo": "^54.0.33",
|
|
96
98
|
"patch-package": "^8.0.1",
|
|
97
99
|
"react-native-gesture-handler": "^2.29.1",
|