jfs-components 0.1.2 → 0.1.8
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 +29 -0
- package/lib/commonjs/components/AmountInput/AmountInput.js +8 -5
- package/lib/commonjs/components/BenefitCard/BenefitCard.js +231 -0
- package/lib/commonjs/components/CcCard/CcCard.js +470 -0
- package/lib/commonjs/components/Checkbox/Checkbox.js +4 -3
- package/lib/commonjs/components/CheckboxItem/CheckboxItem.js +4 -3
- package/lib/commonjs/components/CompareTable/CompareTable.js +372 -0
- package/lib/commonjs/components/ComparisonBar/ComparisonBar.js +266 -0
- package/lib/commonjs/components/DropdownInput/DropdownInput.js +35 -3
- package/lib/commonjs/components/FormField/FormField.js +4 -3
- package/lib/commonjs/components/InputSearch/InputSearch.js +6 -4
- package/lib/commonjs/components/NoteInput/NoteInput.js +6 -5
- package/lib/commonjs/components/PdpCcCard/PdpCcCard.js +273 -0
- package/lib/commonjs/components/ProductMerchandisingCard/GlassFill.js +263 -0
- package/lib/commonjs/components/ProductMerchandisingCard/GlassFill.web.js +116 -0
- package/lib/commonjs/components/ProductMerchandisingCard/ProductMerchandisingCard.js +353 -0
- package/lib/commonjs/components/ProjectionMarker/ProjectionMarker.js +161 -0
- package/lib/commonjs/components/Radio/Radio.js +5 -5
- package/lib/commonjs/components/Slider/Slider.js +473 -0
- package/lib/commonjs/components/TextInput/TextInput.js +13 -8
- package/lib/commonjs/components/TextSegment/TextSegment.js +118 -0
- package/lib/commonjs/components/index.js +63 -0
- package/lib/commonjs/design-tokens/Coin Variables-variables-full.json +1 -1
- package/lib/commonjs/design-tokens/figma-modes.generated.js +38 -9
- package/lib/commonjs/icons/registry.js +1 -1
- package/lib/commonjs/utils/react-utils.js +22 -0
- package/lib/module/components/AmountInput/AmountInput.js +6 -4
- package/lib/module/components/BenefitCard/BenefitCard.js +225 -0
- package/lib/module/components/CcCard/CcCard.js +464 -0
- package/lib/module/components/Checkbox/Checkbox.js +5 -4
- package/lib/module/components/CheckboxItem/CheckboxItem.js +5 -4
- package/lib/module/components/CompareTable/CompareTable.js +367 -0
- package/lib/module/components/ComparisonBar/ComparisonBar.js +260 -0
- package/lib/module/components/DropdownInput/DropdownInput.js +36 -4
- package/lib/module/components/FormField/FormField.js +5 -4
- package/lib/module/components/InputSearch/InputSearch.js +6 -4
- package/lib/module/components/NoteInput/NoteInput.js +7 -6
- package/lib/module/components/PdpCcCard/PdpCcCard.js +267 -0
- package/lib/module/components/ProductMerchandisingCard/GlassFill.js +257 -0
- package/lib/module/components/ProductMerchandisingCard/GlassFill.web.js +111 -0
- package/lib/module/components/ProductMerchandisingCard/ProductMerchandisingCard.js +347 -0
- package/lib/module/components/ProjectionMarker/ProjectionMarker.js +156 -0
- package/lib/module/components/Radio/Radio.js +5 -4
- package/lib/module/components/Slider/Slider.js +468 -0
- package/lib/module/components/TextInput/TextInput.js +15 -10
- package/lib/module/components/TextSegment/TextSegment.js +113 -0
- package/lib/module/components/index.js +9 -0
- package/lib/module/design-tokens/Coin Variables-variables-full.json +1 -1
- package/lib/module/design-tokens/figma-modes.generated.js +38 -9
- package/lib/module/icons/registry.js +1 -1
- package/lib/module/utils/react-utils.js +21 -0
- package/lib/typescript/src/components/AmountInput/AmountInput.d.ts +3 -2
- package/lib/typescript/src/components/BenefitCard/BenefitCard.d.ts +93 -0
- package/lib/typescript/src/components/CcCard/CcCard.d.ts +137 -0
- package/lib/typescript/src/components/Checkbox/Checkbox.d.ts +3 -2
- package/lib/typescript/src/components/CheckboxItem/CheckboxItem.d.ts +2 -2
- package/lib/typescript/src/components/CompareTable/CompareTable.d.ts +88 -0
- package/lib/typescript/src/components/ComparisonBar/ComparisonBar.d.ts +118 -0
- package/lib/typescript/src/components/DropdownInput/DropdownInput.d.ts +20 -1
- package/lib/typescript/src/components/FormField/FormField.d.ts +2 -2
- package/lib/typescript/src/components/InputSearch/InputSearch.d.ts +23 -2
- package/lib/typescript/src/components/NoteInput/NoteInput.d.ts +19 -2
- package/lib/typescript/src/components/PdpCcCard/PdpCcCard.d.ts +84 -0
- package/lib/typescript/src/components/ProductMerchandisingCard/GlassFill.d.ts +56 -0
- package/lib/typescript/src/components/ProductMerchandisingCard/GlassFill.web.d.ts +27 -0
- package/lib/typescript/src/components/ProductMerchandisingCard/ProductMerchandisingCard.d.ts +81 -0
- package/lib/typescript/src/components/ProjectionMarker/ProjectionMarker.d.ts +82 -0
- package/lib/typescript/src/components/Radio/Radio.d.ts +3 -2
- package/lib/typescript/src/components/RadioButton/RadioButton.d.ts +2 -2
- package/lib/typescript/src/components/Slider/Slider.d.ts +99 -0
- package/lib/typescript/src/components/TextInput/TextInput.d.ts +9 -29
- package/lib/typescript/src/components/TextSegment/TextSegment.d.ts +100 -0
- package/lib/typescript/src/components/index.d.ts +10 -1
- package/lib/typescript/src/design-tokens/figma-modes.generated.d.ts +22 -2
- package/lib/typescript/src/icons/registry.d.ts +1 -1
- package/lib/typescript/src/utils/react-utils.d.ts +10 -0
- package/package.json +2 -1
- package/src/components/AmountInput/AmountInput.tsx +7 -5
- package/src/components/BenefitCard/BenefitCard.tsx +309 -0
- package/src/components/CcCard/CcCard.tsx +598 -0
- package/src/components/Checkbox/Checkbox.tsx +5 -4
- package/src/components/CheckboxItem/CheckboxItem.tsx +5 -4
- package/src/components/CompareTable/CompareTable.tsx +477 -0
- package/src/components/ComparisonBar/ComparisonBar.tsx +356 -0
- package/src/components/DropdownInput/DropdownInput.tsx +55 -3
- package/src/components/FormField/FormField.tsx +5 -4
- package/src/components/InputSearch/InputSearch.tsx +8 -5
- package/src/components/NoteInput/NoteInput.tsx +8 -6
- package/src/components/PdpCcCard/PdpCcCard.tsx +356 -0
- package/src/components/ProductMerchandisingCard/GlassFill.tsx +276 -0
- package/src/components/ProductMerchandisingCard/GlassFill.web.tsx +127 -0
- package/src/components/ProductMerchandisingCard/ProductMerchandisingCard.tsx +423 -0
- package/src/components/ProjectionMarker/ProjectionMarker.tsx +277 -0
- package/src/components/Radio/Radio.tsx +5 -4
- package/src/components/Slider/Slider.tsx +628 -0
- package/src/components/TextInput/TextInput.tsx +15 -11
- package/src/components/TextSegment/TextSegment.tsx +166 -0
- package/src/components/index.ts +10 -1
- package/src/design-tokens/Coin Variables-variables-full.json +1 -1
- package/src/design-tokens/figma-modes.generated.ts +38 -9
- package/src/icons/registry.ts +1 -1
- package/src/utils/react-utils.ts +23 -0
- package/lib/typescript/scripts/extract-component-tokens.d.ts +0 -9
- package/lib/typescript/scripts/generate-component-docs.d.ts +0 -9
- package/lib/typescript/scripts/generate-icon-registry.d.ts +0 -3
- package/lib/typescript/scripts/generate-mode-types.d.ts +0 -2
- package/lib/typescript/scripts/retype-modes.d.cts +0 -2
|
@@ -5,6 +5,7 @@ export { default as AppBar } from './AppBar/AppBar';
|
|
|
5
5
|
export { default as Avatar, type AvatarProps } from './Avatar/Avatar';
|
|
6
6
|
export { default as AvatarGroup } from './AvatarGroup/AvatarGroup';
|
|
7
7
|
export { default as Badge } from './Badge/Badge';
|
|
8
|
+
export { default as BenefitCard, type BenefitCardProps, type BenefitCardItem } from './BenefitCard/BenefitCard';
|
|
8
9
|
export { default as BottomNav } from './BottomNav/BottomNav';
|
|
9
10
|
export { default as BottomNavItem } from './BottomNavItem/BottomNavItem';
|
|
10
11
|
export { default as BrandChip, type BrandChipProps } from './BrandChip/BrandChip';
|
|
@@ -20,11 +21,12 @@ export { default as CheckboxGroup, type CheckboxGroupProps } from './CheckboxGro
|
|
|
20
21
|
export { default as CardFeedback, type CardFeedbackProps } from './CardFeedback/CardFeedback';
|
|
21
22
|
export { default as CardFinancialCondition, type CardFinancialConditionProps } from './CardFinancialCondition/CardFinancialCondition';
|
|
22
23
|
export { default as CardInsight, type CardInsightProps } from './CardInsight/CardInsight';
|
|
24
|
+
export { default as CcCard, type CcCardProps, type CcCardBadge, type CcCardListItem } from './CcCard/CcCard';
|
|
23
25
|
export { default as Disclaimer } from './Disclaimer/Disclaimer';
|
|
24
26
|
export { default as Divider, type DividerProps, type DividerDirection } from './Divider/Divider';
|
|
25
27
|
export { default as Drawer, type DrawerProps, type DrawerHandle } from './Drawer/Drawer';
|
|
26
28
|
export { default as Dropdown, DropdownItem, type DropdownProps, type DropdownItemProps } from './Dropdown/Dropdown';
|
|
27
|
-
export { default as DropdownInput, type DropdownInputProps, type DropdownInputOption, type DropdownInputOptionValue } from './DropdownInput/DropdownInput';
|
|
29
|
+
export { default as DropdownInput, type DropdownInputProps, type DropdownInputHandle, type DropdownInputOption, type DropdownInputOptionValue } from './DropdownInput/DropdownInput';
|
|
28
30
|
export { default as SuggestiveSearch, type SuggestiveSearchProps, type SuggestiveSearchOption, type SuggestiveSearchOptionValue, type SuggestiveSearchItem } from './SuggestiveSearch/SuggestiveSearch';
|
|
29
31
|
export { default as CardCTA, type CardCTAProps, type CardCTAType } from './CardCTA/CardCTA';
|
|
30
32
|
export { default as DebitCard, type DebitCardProps } from './DebitCard/DebitCard';
|
|
@@ -38,6 +40,7 @@ export { default as CircularProgressBarDoted, type CircularProgressBarDotedProps
|
|
|
38
40
|
export { default as CircularRating, type CircularRatingProps } from './CircularRating/CircularRating';
|
|
39
41
|
export { default as CoverageRing, type CoverageRingProps } from './CoverageRing/CoverageRing';
|
|
40
42
|
export { default as CoverageBarComparison, type CoverageBarComparisonProps, type CoverageBarComparisonItem } from './CoverageBarComparison/CoverageBarComparison';
|
|
43
|
+
export { default as ComparisonBar, type ComparisonBarProps, type ComparisonBarItem } from './ComparisonBar/ComparisonBar';
|
|
41
44
|
export { default as AllocationComparisonChart, type AllocationComparisonChartProps, type AllocationSegment } from './AllocationComparisonChart/AllocationComparisonChart';
|
|
42
45
|
export { default as MonthlyStatusGrid, CalendarGlyph, type MonthlyStatusGridProps, type MonthlyStatusGridMonth, type MonthlyStatus, type CalendarGlyphProps } from './MonthlyStatusGrid/MonthlyStatusGrid';
|
|
43
46
|
export { default as Gauge, type GaugeProps } from './Gauge/Gauge';
|
|
@@ -67,6 +70,7 @@ export { default as Overlay, type OverlayProps } from './Overlay/Overlay';
|
|
|
67
70
|
export { default as Title, type TitleProps } from './Title/Title';
|
|
68
71
|
export { default as Screen, type ScreenProps } from './Screen/Screen';
|
|
69
72
|
export { default as Section } from './Section/Section';
|
|
73
|
+
export { default as Slider, type SliderProps, type SliderHandle } from './Slider/Slider';
|
|
70
74
|
export { default as Slot, type SlotProps, type SlotLayoutDirection } from './Slot/Slot';
|
|
71
75
|
export { default as Spinner, type SpinnerProps, type SpinnerColors } from './Spinner/Spinner';
|
|
72
76
|
export { default as Stepper, type StepperProps } from './Stepper/Stepper';
|
|
@@ -117,12 +121,16 @@ export { default as ToastProvider, type ToastProviderProps } from './Toast/Toast
|
|
|
117
121
|
export { useToast, addToast, closeToast, closeAll, type ToastOptions, type ToastEntry, type ToastPlacement } from './Toast/useToast';
|
|
118
122
|
export { default as AmountInput, type AmountInputProps } from './AmountInput/AmountInput';
|
|
119
123
|
export { default as PageHero, type PageHeroProps } from './PageHero/PageHero';
|
|
124
|
+
export { default as PdpCcCard, type PdpCcCardProps, type PdpCcCardMetric } from './PdpCcCard/PdpCcCard';
|
|
120
125
|
export { default as Popup, type PopupProps, type PopupRef } from './Popup/Popup';
|
|
121
126
|
export { default as PortfolioHero, type PortfolioHeroProps } from './PortfolioHero/PortfolioHero';
|
|
122
127
|
export { default as PlanComparisonCard, type PlanComparisonCardProps, type PlanComparisonColumn, type PlanComparisonRow, type PlanComparisonCellValue } from './PlanComparisonCard/PlanComparisonCard';
|
|
128
|
+
export { default as CompareTable, type CompareTableProps, type CompareTableColumn, type CompareTableRow, type CompareTableCellValue, type CompareTableSection } from './CompareTable/CompareTable';
|
|
123
129
|
export { default as PoweredByLabel, type PoweredByLabelProps } from './PoweredByLabel/PoweredByLabel';
|
|
124
130
|
export { default as ProductLabel, type ProductLabelProps } from './ProductLabel/ProductLabel';
|
|
131
|
+
export { default as ProductMerchandisingCard, type ProductMerchandisingCardProps } from './ProductMerchandisingCard/ProductMerchandisingCard';
|
|
125
132
|
export { default as ProductOverview, type ProductOverviewProps, type ProductOverviewStat } from './ProductOverview/ProductOverview';
|
|
133
|
+
export { default as ProjectionMarker, type ProjectionMarkerProps } from './ProjectionMarker/ProjectionMarker';
|
|
126
134
|
export { default as ProgressBadge, type ProgressBadgeProps } from './ProgressBadge/ProgressBadge';
|
|
127
135
|
export { default as SwappableAmount, type SwappableAmountProps } from './SwappableAmount/SwappableAmount';
|
|
128
136
|
export { default as OTP, OTPResend, useOtpResend, type OTPProps, type OTPResendProps, type OTPResendConfig, type UseOtpResendOptions, type UseOtpResendReturn, type OtpResendState, } from './OTP/OTP';
|
|
@@ -133,6 +141,7 @@ export { default as StrengthIndicator, type StrengthIndicatorProps, type Strengt
|
|
|
133
141
|
export { default as SummaryTile, type SummaryTileProps } from './SummaryTile/SummaryTile';
|
|
134
142
|
export { default as TestimonialsCard, type TestimonialsCardProps } from './TestimonialsCard/TestimonialsCard';
|
|
135
143
|
export { default as Text, type TextProps } from './Text/Text';
|
|
144
|
+
export { default as TextSegment, type TextSegmentProps, type TextSegmentRun } from './TextSegment/TextSegment';
|
|
136
145
|
export { default as SegmentedControl, type SegmentedControlProps, type SegmentedControlItem } from './SegmentedControl/SegmentedControl';
|
|
137
146
|
export { default as Toggle, type ToggleProps } from './Toggle/Toggle';
|
|
138
147
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -22,11 +22,12 @@ export declare const FIGMA_MODES: {
|
|
|
22
22
|
readonly "Attached / Output": readonly ["Default"];
|
|
23
23
|
readonly "Avatar / Output": readonly ["Default"];
|
|
24
24
|
readonly "Avatar Group / Output": readonly ["Default"];
|
|
25
|
-
readonly "Avatar Size": readonly ["L", "M", "S"];
|
|
25
|
+
readonly "Avatar Size": readonly ["L", "M", "S", "XS"];
|
|
26
26
|
readonly "Avatar Type": readonly ["Avatar", "Icon", "Text"];
|
|
27
27
|
readonly "Axis / Output": readonly ["Default"];
|
|
28
28
|
readonly Background: readonly ["False", "True"];
|
|
29
29
|
readonly "Badge / Output": readonly ["Default"];
|
|
30
|
+
readonly "Badge Size": readonly ["Medium", "Small"];
|
|
30
31
|
readonly "Balance / Output": readonly ["Default"];
|
|
31
32
|
readonly "BankAccountCard / Output": readonly ["Default"];
|
|
32
33
|
readonly "Benefit Card": readonly ["Default"];
|
|
@@ -52,6 +53,7 @@ export declare const FIGMA_MODES: {
|
|
|
52
53
|
readonly cardsShared: readonly ["Default"];
|
|
53
54
|
readonly "Carousel / Output": readonly ["Default"];
|
|
54
55
|
readonly "CarouselCardAccounts / Output": readonly ["Default"];
|
|
56
|
+
readonly "ccCard / Output": readonly ["Default"];
|
|
55
57
|
readonly "checkbox / Output": readonly ["Default"];
|
|
56
58
|
readonly "Checkbox / Output": readonly ["Default"];
|
|
57
59
|
readonly "Checkbox states": readonly ["Idle", "Hover", "Focus", "Focus Selected", "Selected Hover", "Disabled/Active", "Disabled", "Selected"];
|
|
@@ -67,7 +69,12 @@ export declare const FIGMA_MODES: {
|
|
|
67
69
|
readonly "circularProgressBar / Output": readonly ["Default"];
|
|
68
70
|
readonly "circularProgressBar Size": readonly ["S", "M"];
|
|
69
71
|
readonly "clusterBubble / Output": readonly ["Default"];
|
|
72
|
+
readonly coincard: readonly ["Mode 1"];
|
|
70
73
|
readonly "Color Mode": readonly ["Light", "Dark"];
|
|
74
|
+
readonly comparetablecell: readonly ["Mode 1"];
|
|
75
|
+
readonly comparetableheader: readonly ["Mode 1"];
|
|
76
|
+
readonly "Comparison Floating card": readonly ["Default"];
|
|
77
|
+
readonly ComparisonCardItem: readonly ["Default"];
|
|
71
78
|
readonly Confidence: readonly ["High", "Medium", "Low", "None"];
|
|
72
79
|
readonly "ContentSheet / Output": readonly ["Default"];
|
|
73
80
|
readonly Context: readonly ["Default", "Nudge&Alert", "CTACard", "ListItem"];
|
|
@@ -78,6 +85,7 @@ export declare const FIGMA_MODES: {
|
|
|
78
85
|
readonly context7: readonly ["Default", "Card"];
|
|
79
86
|
readonly "Contrast Context": readonly ["on dark", "on light"];
|
|
80
87
|
readonly "Conversation Feed / Output": readonly ["Default"];
|
|
88
|
+
readonly "Counter Badge / Output": readonly ["Mode 1"];
|
|
81
89
|
readonly "Coverage Bar Comparison / Output": readonly ["Default"];
|
|
82
90
|
readonly "CoverageRing / Output": readonly ["Mode 1"];
|
|
83
91
|
readonly "CTACard / Output": readonly ["Default"];
|
|
@@ -106,6 +114,7 @@ export declare const FIGMA_MODES: {
|
|
|
106
114
|
readonly FullScreenModal: readonly ["Default"];
|
|
107
115
|
readonly Gap: readonly ["S", "M", "L", "None"];
|
|
108
116
|
readonly "Gauge / Output": readonly ["Default"];
|
|
117
|
+
readonly "Handle Boolean": readonly ["False", "True"];
|
|
109
118
|
readonly "Heading / Output": readonly ["Default"];
|
|
110
119
|
readonly "Heading text": readonly ["Default", "Slot"];
|
|
111
120
|
readonly "Holdings card / Output": readonly ["Default"];
|
|
@@ -113,7 +122,7 @@ export declare const FIGMA_MODES: {
|
|
|
113
122
|
readonly "Icon / Output": readonly ["Default"];
|
|
114
123
|
readonly "Icon Button / Output": readonly ["Default"];
|
|
115
124
|
readonly "Icon Capsule / Output": readonly ["Default"];
|
|
116
|
-
readonly "Icon Capsule Size": readonly ["M", "L", "S"];
|
|
125
|
+
readonly "Icon Capsule Size": readonly ["M", "L", "S", "XS"];
|
|
117
126
|
readonly "Image / Output": readonly ["Default"];
|
|
118
127
|
readonly "Input / Output": readonly ["Default"];
|
|
119
128
|
readonly "Input/PINSlot States": readonly ["Idle", "Active", "Error"];
|
|
@@ -138,6 +147,7 @@ export declare const FIGMA_MODES: {
|
|
|
138
147
|
readonly "Message Direction": readonly ["Incoming (Left)", "Outgoing (Right)"];
|
|
139
148
|
readonly "Message Row / Output": readonly ["Default"];
|
|
140
149
|
readonly "MessageField / Output": readonly ["Default"];
|
|
150
|
+
readonly metricdata: readonly ["Mode 1"];
|
|
141
151
|
readonly "MetricLegendItem / Output": readonly ["Default"];
|
|
142
152
|
readonly "Money Value / Output": readonly ["Default"];
|
|
143
153
|
readonly "MonthlyStatusGrid / Output": readonly ["Default"];
|
|
@@ -155,15 +165,18 @@ export declare const FIGMA_MODES: {
|
|
|
155
165
|
readonly "Page type": readonly ["MainPage", "SubPage", "JioPlus"];
|
|
156
166
|
readonly "PageHero / Output": readonly ["Default"];
|
|
157
167
|
readonly "PaymnetFeedback / Output": readonly ["Default"];
|
|
168
|
+
readonly "PDP cc card": readonly ["Mode 1"];
|
|
158
169
|
readonly peekOffset: readonly ["Medium", "Small", "Large", "None"];
|
|
159
170
|
readonly Placement: readonly ["Prefix", "Suffix"];
|
|
160
171
|
readonly "PlanComparisonCard / Output": readonly ["Default"];
|
|
161
172
|
readonly "Popup / Output": readonly ["Default"];
|
|
162
173
|
readonly "PortfolioHero / Output": readonly ["Default"];
|
|
163
174
|
readonly PoweredByLabel: readonly ["Default"];
|
|
175
|
+
readonly "Product Merchandising card": readonly ["Mode 1"];
|
|
164
176
|
readonly "ProductLabel / Output": readonly ["Default"];
|
|
165
177
|
readonly "ProductOverview / Output": readonly ["Default"];
|
|
166
178
|
readonly "ProgressBadge / Output": readonly ["Default"];
|
|
179
|
+
readonly ProjectionMarker: readonly ["Mode 1"];
|
|
167
180
|
readonly "QR code / Output": readonly ["Idle"];
|
|
168
181
|
readonly "Radio / Output": readonly ["Default"];
|
|
169
182
|
readonly Radius: readonly ["S", "M", "L", "None"];
|
|
@@ -181,8 +194,10 @@ export declare const FIGMA_MODES: {
|
|
|
181
194
|
readonly "SegmentedControl/Segment / Output": readonly ["Default"];
|
|
182
195
|
readonly "SegmentedTrack / Output": readonly ["Default"];
|
|
183
196
|
readonly Selectable: readonly ["False", "True"];
|
|
197
|
+
readonly selectioncard: readonly ["Mode 1"];
|
|
184
198
|
readonly "Semantic Intent": readonly ["Brand", "System"];
|
|
185
199
|
readonly Skeleton: readonly ["Mode 1"];
|
|
200
|
+
readonly "Slider / Output": readonly ["Default"];
|
|
186
201
|
readonly "Slot gap": readonly ["S", "M", "L", "XL"];
|
|
187
202
|
readonly "special button": readonly ["Default"];
|
|
188
203
|
readonly "Spinner / Output": readonly ["Default"];
|
|
@@ -203,14 +218,19 @@ export declare const FIGMA_MODES: {
|
|
|
203
218
|
readonly "SwappableAmount / Output": readonly ["Default"];
|
|
204
219
|
readonly "tabItem / Output": readonly ["Default"];
|
|
205
220
|
readonly "Tabs / Output": readonly ["Default"];
|
|
221
|
+
readonly TestimonialsCard: readonly ["Default"];
|
|
206
222
|
readonly "Text / Output": readonly ["Default"];
|
|
223
|
+
readonly "Text Appearance": readonly ["Neutral", "Primary", "Secondary", "Tertiary"];
|
|
224
|
+
readonly "Text Sizes": readonly ["Medium", "Small"];
|
|
207
225
|
readonly "textInput / Output": readonly ["Default"];
|
|
226
|
+
readonly "TextSegment / Output": readonly ["Default"];
|
|
208
227
|
readonly "Thread Hero / Output": readonly ["Default"];
|
|
209
228
|
readonly "Title / Output": readonly ["Default"];
|
|
210
229
|
readonly "Title Level": readonly ["Default", "Bold"];
|
|
211
230
|
readonly "Toggle / Output": readonly ["Default"];
|
|
212
231
|
readonly "Toggle States": readonly ["Off", "On", "Disabled Off", "Disabled On"];
|
|
213
232
|
readonly "ToggleIconButton / Output": readonly ["Default"];
|
|
233
|
+
readonly Tooltip: readonly ["True", "False"];
|
|
214
234
|
readonly "tooltip / Output": readonly ["Default"];
|
|
215
235
|
readonly "Tost Output": readonly ["Default"];
|
|
216
236
|
readonly "Transaction Status": readonly ["Request", "Paid", "Declined", "Expired"];
|
|
@@ -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-06-
|
|
7
|
+
* Generated: 2026-06-12T12:48:07.304Z
|
|
8
8
|
*/
|
|
9
9
|
export declare const iconRegistry: Record<string, {
|
|
10
10
|
path: string;
|
|
@@ -20,6 +20,16 @@ export declare const EMPTY_MODES: Readonly<Record<string, any>>;
|
|
|
20
20
|
* This ensures that all child components in slots receive the modes prop from the parent.
|
|
21
21
|
*/
|
|
22
22
|
export declare function cloneChildrenWithModes(children: React.ReactNode, modes: Modes, forcedModes?: Modes): React.ReactNode[];
|
|
23
|
+
/**
|
|
24
|
+
* Combines several refs (object refs and/or callback refs) into a single
|
|
25
|
+
* callback ref. Useful when a component needs to keep its own internal ref to a
|
|
26
|
+
* node while still honouring a ref forwarded by the consumer.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* const inputRef = useRef<RNTextInput>(null)
|
|
30
|
+
* <RNTextInput ref={mergeRefs(inputRef, forwardedRef)} />
|
|
31
|
+
*/
|
|
32
|
+
export declare function mergeRefs<T>(...refs: Array<React.Ref<T> | undefined | null>): React.RefCallback<T>;
|
|
23
33
|
/**
|
|
24
34
|
* Flattens React children, extracting them from Fragments.
|
|
25
35
|
* Useful for Group components that need to process individual items (e.g., for layout or styling)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jfs-components",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"description": "React Native Jio Finance Components Library",
|
|
5
5
|
"author": "sunshuaiqi@gmail.com",
|
|
6
6
|
"license": "MIT",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"lint": "eslint .",
|
|
31
31
|
"build-react": "webpack --mode production",
|
|
32
32
|
"start-react": "webpack-dev-server --config ./webpack.config.js --mode development",
|
|
33
|
+
"tokens": "node scripts/figma-token-explorer.js",
|
|
33
34
|
"extract-tokens": "node scripts/extract-component-tokens.js",
|
|
34
35
|
"generate-mode-types": "node scripts/generate-mode-types.js",
|
|
35
36
|
"generate-docs": "node scripts/generate-component-docs.js",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react'
|
|
1
|
+
import React, { forwardRef } from 'react'
|
|
2
2
|
import { View, type ViewStyle } from 'react-native'
|
|
3
3
|
import { getVariableByName } from '../../design-tokens/figma-variables-resolver'
|
|
4
4
|
import { useTokens } from '../../design-tokens/JFSThemeProvider'
|
|
@@ -27,12 +27,12 @@ export type AmountInputProps = {
|
|
|
27
27
|
*
|
|
28
28
|
* @component
|
|
29
29
|
*/
|
|
30
|
-
|
|
30
|
+
const AmountInput = forwardRef<View, AmountInputProps>(function AmountInput({
|
|
31
31
|
moneyValueSlot,
|
|
32
32
|
noteInputSlot,
|
|
33
33
|
modes: propModes = EMPTY_MODES,
|
|
34
34
|
style,
|
|
35
|
-
}: AmountInputProps) {
|
|
35
|
+
}: AmountInputProps, ref: React.Ref<View>) {
|
|
36
36
|
const { modes: globalModes } = useTokens()
|
|
37
37
|
const modes = { ...globalModes, ...propModes }
|
|
38
38
|
|
|
@@ -75,9 +75,11 @@ export default function AmountInput({
|
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
return (
|
|
78
|
-
<View style={containerStyle}>
|
|
78
|
+
<View ref={ref} style={containerStyle}>
|
|
79
79
|
{renderMoneyValueSlot()}
|
|
80
80
|
{renderNoteInputSlot()}
|
|
81
81
|
</View>
|
|
82
82
|
)
|
|
83
|
-
}
|
|
83
|
+
})
|
|
84
|
+
|
|
85
|
+
export default AmountInput
|
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
import React, { useMemo } from 'react'
|
|
2
|
+
import {
|
|
3
|
+
View,
|
|
4
|
+
Text as RNText,
|
|
5
|
+
Pressable,
|
|
6
|
+
StyleSheet,
|
|
7
|
+
type ViewStyle,
|
|
8
|
+
type TextStyle,
|
|
9
|
+
type StyleProp,
|
|
10
|
+
} from 'react-native'
|
|
11
|
+
import { getVariableByName } from '../../design-tokens/figma-variables-resolver'
|
|
12
|
+
import { EMPTY_MODES, cloneChildrenWithModes } from '../../utils/react-utils'
|
|
13
|
+
import Icon from '../Icon/Icon'
|
|
14
|
+
import Text from '../Text/Text'
|
|
15
|
+
import ListItem from '../ListItem/ListItem'
|
|
16
|
+
import Divider from '../Divider/Divider'
|
|
17
|
+
import Button from '../Button/Button'
|
|
18
|
+
import type { Modes } from '../../design-tokens'
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* A single benefit row rendered with the shared `ListItem` primitive: a
|
|
22
|
+
* leading icon, a title and an optional right-aligned trailing value.
|
|
23
|
+
*/
|
|
24
|
+
export interface BenefitCardItem {
|
|
25
|
+
/** Registry icon name for the leading glyph (e.g. `'ic_jewellery_diamond'`). */
|
|
26
|
+
icon?: string
|
|
27
|
+
/** Per-item override for the leading icon color. Defaults to the brand token. */
|
|
28
|
+
iconColor?: string
|
|
29
|
+
/** Full override for the leading node. Takes precedence over `icon`. */
|
|
30
|
+
leading?: React.ReactNode
|
|
31
|
+
/** Row title (e.g. `"JioPoints"`). */
|
|
32
|
+
title: string
|
|
33
|
+
/** Optional right-aligned trailing value (e.g. `"Up to 2000 pts"`). */
|
|
34
|
+
trailingText?: string
|
|
35
|
+
/** Full override for the trailing node. Takes precedence over `trailingText`. */
|
|
36
|
+
trailing?: React.ReactNode
|
|
37
|
+
/** Makes the row pressable. */
|
|
38
|
+
onPress?: () => void
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface BenefitCardProps {
|
|
42
|
+
/** Header section title (e.g. `"You will earn"`). */
|
|
43
|
+
headerTitle?: string
|
|
44
|
+
/**
|
|
45
|
+
* Highlighted item shown directly under the header title (icon + title +
|
|
46
|
+
* optional trailing value). Rendered above the divider.
|
|
47
|
+
*/
|
|
48
|
+
headerItem?: BenefitCardItem
|
|
49
|
+
/**
|
|
50
|
+
* Toggles the whole header section (title + item + divider). Mirrors the
|
|
51
|
+
* Figma `showHeader` property. Defaults to `true`.
|
|
52
|
+
*/
|
|
53
|
+
showHeader?: boolean
|
|
54
|
+
/** Body section title (e.g. `"Upgrade to JioFinance+ and earn more"`). */
|
|
55
|
+
bodyTitle?: string
|
|
56
|
+
/**
|
|
57
|
+
* Body benefit rows. Ignored when `children` is provided (the slot wins).
|
|
58
|
+
*/
|
|
59
|
+
items?: BenefitCardItem[]
|
|
60
|
+
/**
|
|
61
|
+
* Real slot for the body "list wrap". When provided, these children render
|
|
62
|
+
* instead of `items`; `modes` (plus the `List Item Style: Minimal` style)
|
|
63
|
+
* cascade into every child automatically.
|
|
64
|
+
*/
|
|
65
|
+
children?: React.ReactNode
|
|
66
|
+
/** CTA button label. Defaults to `"Upgrade"`. */
|
|
67
|
+
buttonLabel?: string
|
|
68
|
+
/** CTA press handler. */
|
|
69
|
+
onButtonPress?: () => void
|
|
70
|
+
/** Full override for the CTA. Takes precedence over `buttonLabel`. */
|
|
71
|
+
button?: React.ReactNode
|
|
72
|
+
/**
|
|
73
|
+
* Toggles the CTA button. Mirrors the Figma `showButton` property.
|
|
74
|
+
* Defaults to `true`.
|
|
75
|
+
*/
|
|
76
|
+
showButton?: boolean
|
|
77
|
+
/** Press handler for the whole card. When set, the card becomes pressable. */
|
|
78
|
+
onPress?: () => void
|
|
79
|
+
/** Card width. Defaults to the Figma spec (`344`). Pass `'100%'` to fill the parent. */
|
|
80
|
+
width?: number | `${number}%`
|
|
81
|
+
/** Modes object for design-token resolution. Cascaded to all children. */
|
|
82
|
+
modes?: Modes
|
|
83
|
+
/** Style overrides for the card container. */
|
|
84
|
+
style?: StyleProp<ViewStyle>
|
|
85
|
+
/** Accessibility label for the card. */
|
|
86
|
+
accessibilityLabel?: string
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* BenefitCard — Figma node 5352:1077 ("Benefit Card").
|
|
91
|
+
*
|
|
92
|
+
* A white, rounded card that summarises the rewards a user will earn. It is
|
|
93
|
+
* composed entirely from the shared design-system primitives so it stays in
|
|
94
|
+
* sync with the rest of the library:
|
|
95
|
+
*
|
|
96
|
+
* - **Header** — a section title + a single highlighted {@link ListItem}
|
|
97
|
+
* (leading `Icon`, title, right-aligned trailing value) followed by a
|
|
98
|
+
* `Divider`.
|
|
99
|
+
* - **Body** — a section title + a column of benefit {@link ListItem}s. The
|
|
100
|
+
* list is a real slot: pass `children` to fully control it, or `items` for
|
|
101
|
+
* the declarative path.
|
|
102
|
+
* - **CTA** — a small {@link Button} (Figma `Button / Size = S`).
|
|
103
|
+
*
|
|
104
|
+
* The list rows resolve through the `List Item Style: Minimal` mode (12px /
|
|
105
|
+
* regular title, 4px gap, no padding) and the leading icons use the
|
|
106
|
+
* `AppearanceBrand: Secondary` brand color, exactly matching the design. All
|
|
107
|
+
* three defaults can be overridden via `modes`.
|
|
108
|
+
*/
|
|
109
|
+
function BenefitCard({
|
|
110
|
+
headerTitle = 'You will earn',
|
|
111
|
+
headerItem,
|
|
112
|
+
showHeader = true,
|
|
113
|
+
bodyTitle = 'Upgrade to JioFinance+ and earn more',
|
|
114
|
+
items,
|
|
115
|
+
children,
|
|
116
|
+
buttonLabel = 'Upgrade',
|
|
117
|
+
onButtonPress,
|
|
118
|
+
button,
|
|
119
|
+
showButton = true,
|
|
120
|
+
onPress,
|
|
121
|
+
width = 344,
|
|
122
|
+
modes = EMPTY_MODES,
|
|
123
|
+
style,
|
|
124
|
+
accessibilityLabel,
|
|
125
|
+
}: BenefitCardProps) {
|
|
126
|
+
const tokens = useMemo(() => resolveTokens(modes), [modes])
|
|
127
|
+
|
|
128
|
+
// Sub-component modes. Consumer-supplied `modes` always win via spread order.
|
|
129
|
+
const listItemModes = useMemo<Modes>(() => ({ 'List Item Style': 'Minimal', ...modes }), [modes])
|
|
130
|
+
const iconModes = useMemo<Modes>(() => ({ AppearanceBrand: 'Secondary', ...modes }), [modes])
|
|
131
|
+
const trailingTextModes = useMemo<Modes>(
|
|
132
|
+
() => ({ 'Text Sizes': 'Small', Weight: 'Regular', ...modes }),
|
|
133
|
+
[modes]
|
|
134
|
+
)
|
|
135
|
+
const ctaModes = useMemo<Modes>(() => ({ 'Button / Size': 'S', ...modes }), [modes])
|
|
136
|
+
|
|
137
|
+
const renderItem = (item: BenefitCardItem, key: React.Key) => {
|
|
138
|
+
const leading =
|
|
139
|
+
item.leading ??
|
|
140
|
+
(item.icon != null ? (
|
|
141
|
+
<Icon iconName={item.icon} color={item.iconColor} modes={iconModes} />
|
|
142
|
+
) : null)
|
|
143
|
+
|
|
144
|
+
const trailing =
|
|
145
|
+
item.trailing ??
|
|
146
|
+
(item.trailingText != null ? (
|
|
147
|
+
<Text modes={trailingTextModes}>{item.trailingText}</Text>
|
|
148
|
+
) : undefined)
|
|
149
|
+
|
|
150
|
+
return (
|
|
151
|
+
<ListItem
|
|
152
|
+
key={key}
|
|
153
|
+
layout="Horizontal"
|
|
154
|
+
navArrow={false}
|
|
155
|
+
showSupportText={false}
|
|
156
|
+
title={item.title}
|
|
157
|
+
leading={leading}
|
|
158
|
+
trailing={trailing}
|
|
159
|
+
onPress={item.onPress}
|
|
160
|
+
modes={listItemModes}
|
|
161
|
+
/>
|
|
162
|
+
)
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
const headerNode =
|
|
166
|
+
showHeader && (headerTitle != null || headerItem != null) ? (
|
|
167
|
+
<View style={styles.section}>
|
|
168
|
+
<View style={styles.cardHeader}>
|
|
169
|
+
{headerTitle != null ? <RNText style={tokens.title}>{headerTitle}</RNText> : null}
|
|
170
|
+
{headerItem != null ? renderItem(headerItem, 'header-item') : null}
|
|
171
|
+
</View>
|
|
172
|
+
<Divider modes={modes} />
|
|
173
|
+
</View>
|
|
174
|
+
) : null
|
|
175
|
+
|
|
176
|
+
const bodyList = children
|
|
177
|
+
? cloneChildrenWithModes(children, listItemModes)
|
|
178
|
+
: (items ?? DEFAULT_ITEMS).map((item, index) => renderItem(item, index))
|
|
179
|
+
|
|
180
|
+
const ctaNode = button ?? (
|
|
181
|
+
<Button label={buttonLabel} modes={ctaModes} onPress={onButtonPress} />
|
|
182
|
+
)
|
|
183
|
+
|
|
184
|
+
const containerStyle = useMemo<ViewStyle>(
|
|
185
|
+
() => ({ ...tokens.container, width }),
|
|
186
|
+
[tokens.container, width]
|
|
187
|
+
)
|
|
188
|
+
|
|
189
|
+
const content = (
|
|
190
|
+
<>
|
|
191
|
+
{headerNode}
|
|
192
|
+
<View style={tokens.body}>
|
|
193
|
+
{bodyTitle != null ? <RNText style={tokens.title}>{bodyTitle}</RNText> : null}
|
|
194
|
+
<View style={tokens.listWrap}>{bodyList}</View>
|
|
195
|
+
</View>
|
|
196
|
+
{showButton ? ctaNode : null}
|
|
197
|
+
</>
|
|
198
|
+
)
|
|
199
|
+
|
|
200
|
+
if (onPress) {
|
|
201
|
+
return (
|
|
202
|
+
<Pressable
|
|
203
|
+
style={({ pressed }) => [containerStyle, pressed ? styles.pressed : null, style]}
|
|
204
|
+
accessibilityRole="button"
|
|
205
|
+
accessibilityLabel={accessibilityLabel ?? headerTitle ?? bodyTitle}
|
|
206
|
+
onPress={onPress}
|
|
207
|
+
>
|
|
208
|
+
{content}
|
|
209
|
+
</Pressable>
|
|
210
|
+
)
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
return (
|
|
214
|
+
<View style={[containerStyle, style]} accessibilityLabel={accessibilityLabel}>
|
|
215
|
+
{content}
|
|
216
|
+
</View>
|
|
217
|
+
)
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
// ---------------------------------------------------------------------------
|
|
221
|
+
// Tokens / static styles
|
|
222
|
+
// ---------------------------------------------------------------------------
|
|
223
|
+
|
|
224
|
+
// The "card header" inner gap (title -> highlighted item) is a fixed 4px in
|
|
225
|
+
// the Figma node and has no dedicated token.
|
|
226
|
+
const CARD_HEADER_GAP = 4
|
|
227
|
+
|
|
228
|
+
interface ResolvedTokens {
|
|
229
|
+
container: ViewStyle
|
|
230
|
+
body: ViewStyle
|
|
231
|
+
listWrap: ViewStyle
|
|
232
|
+
title: TextStyle
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
function asNum(raw: unknown, fallback: number): number {
|
|
236
|
+
const n = typeof raw === 'number' ? raw : parseFloat(raw as string)
|
|
237
|
+
return Number.isFinite(n) ? n : fallback
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
function asStr(raw: unknown, fallback: string): string {
|
|
241
|
+
return raw != null ? String(raw) : fallback
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
function resolveTokens(modes: Modes): ResolvedTokens {
|
|
245
|
+
// NOTE: token names are passed as string literals DIRECTLY to
|
|
246
|
+
// getVariableByName so the `extract-component-tokens` script can statically
|
|
247
|
+
// collect them for the generated docs. Do not refactor these into a helper
|
|
248
|
+
// that receives the name as a variable.
|
|
249
|
+
const background = asStr(getVariableByName('benefitCard/background', modes), '#ffffff')
|
|
250
|
+
const paddingHorizontal = asNum(getVariableByName('benefitCard/padding/horizontal', modes), 12)
|
|
251
|
+
const paddingVertical = asNum(getVariableByName('benefitCard/padding/vertical', modes), 12)
|
|
252
|
+
const radius = asNum(getVariableByName('benefitCard/radius', modes), 12)
|
|
253
|
+
const gap = asNum(getVariableByName('benefitCard/gap', modes), 8)
|
|
254
|
+
|
|
255
|
+
const titleColor = asStr(getVariableByName('benefitCard/title/foreground', modes), '#000000')
|
|
256
|
+
const titleSize = asNum(getVariableByName('benefitCard/title/fontsize', modes), 14)
|
|
257
|
+
const titleFamily = asStr(getVariableByName('benefitCard/title/fontFamily', modes), 'JioType Var')
|
|
258
|
+
const titleWeight = asStr(getVariableByName('benefitCard/title/fontWeight', modes), '500')
|
|
259
|
+
|
|
260
|
+
return {
|
|
261
|
+
container: {
|
|
262
|
+
backgroundColor: background,
|
|
263
|
+
paddingHorizontal,
|
|
264
|
+
paddingVertical,
|
|
265
|
+
borderRadius: radius,
|
|
266
|
+
gap,
|
|
267
|
+
flexDirection: 'column',
|
|
268
|
+
alignItems: 'flex-start',
|
|
269
|
+
},
|
|
270
|
+
body: {
|
|
271
|
+
alignSelf: 'stretch',
|
|
272
|
+
gap,
|
|
273
|
+
},
|
|
274
|
+
listWrap: {
|
|
275
|
+
alignSelf: 'stretch',
|
|
276
|
+
gap,
|
|
277
|
+
},
|
|
278
|
+
title: {
|
|
279
|
+
color: titleColor,
|
|
280
|
+
fontSize: titleSize,
|
|
281
|
+
fontFamily: titleFamily,
|
|
282
|
+
fontWeight: titleWeight as TextStyle['fontWeight'],
|
|
283
|
+
lineHeight: 20,
|
|
284
|
+
letterSpacing: -0.5,
|
|
285
|
+
includeFontPadding: false as any,
|
|
286
|
+
},
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
const DEFAULT_ITEMS: BenefitCardItem[] = [
|
|
291
|
+
{ icon: 'ic_card', title: 'Up to ₹5000 cashback' },
|
|
292
|
+
{ icon: 'ic_card', title: '25% extra JioPoints' },
|
|
293
|
+
]
|
|
294
|
+
|
|
295
|
+
const styles = StyleSheet.create({
|
|
296
|
+
section: {
|
|
297
|
+
alignSelf: 'stretch',
|
|
298
|
+
gap: 8,
|
|
299
|
+
},
|
|
300
|
+
cardHeader: {
|
|
301
|
+
alignSelf: 'stretch',
|
|
302
|
+
gap: CARD_HEADER_GAP,
|
|
303
|
+
},
|
|
304
|
+
pressed: {
|
|
305
|
+
opacity: 0.92,
|
|
306
|
+
},
|
|
307
|
+
})
|
|
308
|
+
|
|
309
|
+
export default BenefitCard
|