jfs-components 0.1.2 → 0.1.12
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 +45 -0
- package/lib/commonjs/components/Accordion/Accordion.js +2 -1
- package/lib/commonjs/components/AccordionCheckbox/AccordionCheckbox.js +4 -3
- package/lib/commonjs/components/AccountCard/AccountCard.js +4 -3
- package/lib/commonjs/components/AllocationComparisonChart/AllocationComparisonChart.js +9 -6
- package/lib/commonjs/components/AmountInput/AmountInput.js +8 -5
- package/lib/commonjs/components/AreaLineChart/AreaLineChart.js +11 -7
- package/lib/commonjs/components/Badge/Badge.js +47 -8
- package/lib/commonjs/components/BenefitCard/BenefitCard.js +231 -0
- package/lib/commonjs/components/BrandChip/BrandChip.js +3 -3
- package/lib/commonjs/components/Button/Button.js +2 -1
- package/lib/commonjs/components/CardAdvisory/CardAdvisory.js +2 -1
- package/lib/commonjs/components/CardBankAccount/CardBankAccount.js +3 -2
- package/lib/commonjs/components/CardCTA/CardCTA.js +197 -27
- package/lib/commonjs/components/CardInsight/CardInsight.js +5 -1
- 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/CircularProgressBar/CircularProgressBar.js +7 -3
- package/lib/commonjs/components/CircularProgressBarDoted/CircularProgressBarDoted.js +3 -2
- package/lib/commonjs/components/CircularRating/CircularRating.js +2 -1
- package/lib/commonjs/components/ClusterBubble/ClusterBubble.js +3 -2
- package/lib/commonjs/components/CompareTable/CompareTable.js +401 -0
- package/lib/commonjs/components/ComparisonBar/ComparisonBar.js +266 -0
- package/lib/commonjs/components/CoverageBarComparison/CoverageBarComparison.js +3 -2
- package/lib/commonjs/components/DonutChart/DonutChart.js +4 -3
- package/lib/commonjs/components/Dropdown/Dropdown.js +3 -2
- package/lib/commonjs/components/DropdownInput/DropdownInput.js +38 -5
- package/lib/commonjs/components/ExpandableCheckbox/ExpandableCheckbox.js +2 -1
- package/lib/commonjs/components/FormField/FormField.js +45 -4
- package/lib/commonjs/components/Gauge/Gauge.js +1 -1
- package/lib/commonjs/components/HoldingsCard/HoldingsCard.js +3 -2
- package/lib/commonjs/components/InputSearch/InputSearch.js +6 -4
- package/lib/commonjs/components/InstitutionBadge/InstitutionBadge.js +2 -1
- package/lib/commonjs/components/ListGroup/ListGroup.js +2 -1
- package/lib/commonjs/components/ListItem/ListItem.js +3 -2
- package/lib/commonjs/components/MediaCard/MediaCard.js +4 -2
- package/lib/commonjs/components/MetricLegendItem/MetricLegendItem.js +3 -2
- package/lib/commonjs/components/MonthlyStatusGrid/MonthlyStatusGrid.js +6 -3
- package/lib/commonjs/components/NoteInput/NoteInput.js +6 -5
- package/lib/commonjs/components/PdpCcCard/PdpCcCard.js +273 -0
- package/lib/commonjs/components/PoweredByLabel/PoweredByLabel.js +3 -2
- package/lib/commonjs/components/ProductMerchandisingCard/ProductMerchandisingCard.js +427 -0
- package/lib/commonjs/components/ProductOverview/ProductOverview.js +4 -3
- package/lib/commonjs/components/ProgressBadge/ProgressBadge.js +2 -2
- package/lib/commonjs/components/ProjectionMarker/ProjectionMarker.js +162 -0
- package/lib/commonjs/components/Radio/Radio.js +5 -5
- package/lib/commonjs/components/Section/Section.js +3 -2
- package/lib/commonjs/components/Slider/Slider.js +474 -0
- package/lib/commonjs/components/Stack/Stack.js +86 -0
- package/lib/commonjs/components/SuggestiveSearch/SuggestiveSearch.js +10 -1
- package/lib/commonjs/components/SummaryTile/SummaryTile.js +3 -2
- package/lib/commonjs/components/Table/Table.js +324 -0
- package/lib/commonjs/components/Text/Text.js +2 -1
- package/lib/commonjs/components/TextInput/TextInput.js +22 -9
- package/lib/commonjs/components/TextSegment/TextSegment.js +119 -0
- package/lib/commonjs/components/ThreadHero/ThreadHero.js +4 -5
- package/lib/commonjs/components/Title/Title.js +2 -1
- package/lib/commonjs/components/Toast/Toast.js +3 -2
- package/lib/commonjs/components/TransactionBubble/TransactionBubble.js +2 -1
- package/lib/commonjs/components/TransactionStatus/TransactionStatus.js +3 -2
- package/lib/commonjs/components/UpiHandle/UpiHandle.js +2 -2
- package/lib/commonjs/components/index.js +107 -0
- package/lib/commonjs/design-tokens/Coin Variables-variables-full.json +1 -1
- package/lib/commonjs/design-tokens/figma-modes.generated.js +39 -9
- package/lib/commonjs/icons/registry.js +1 -1
- package/lib/commonjs/utils/GlassFill/GlassFill.js +271 -0
- package/lib/commonjs/utils/GlassFill/GlassFill.web.js +120 -0
- package/lib/commonjs/utils/react-utils.js +78 -0
- package/lib/commonjs/utils/web-platform-utils.js +59 -0
- package/lib/module/components/Accordion/Accordion.js +3 -2
- package/lib/module/components/AccordionCheckbox/AccordionCheckbox.js +5 -4
- package/lib/module/components/AccountCard/AccountCard.js +5 -4
- package/lib/module/components/AllocationComparisonChart/AllocationComparisonChart.js +10 -7
- package/lib/module/components/AmountInput/AmountInput.js +6 -4
- package/lib/module/components/AreaLineChart/AreaLineChart.js +12 -8
- package/lib/module/components/Badge/Badge.js +49 -10
- package/lib/module/components/BenefitCard/BenefitCard.js +225 -0
- package/lib/module/components/BrandChip/BrandChip.js +4 -4
- package/lib/module/components/Button/Button.js +3 -2
- package/lib/module/components/CardAdvisory/CardAdvisory.js +3 -2
- package/lib/module/components/CardBankAccount/CardBankAccount.js +4 -3
- package/lib/module/components/CardCTA/CardCTA.js +198 -28
- package/lib/module/components/CardInsight/CardInsight.js +5 -1
- 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/CircularProgressBar/CircularProgressBar.js +8 -4
- package/lib/module/components/CircularProgressBarDoted/CircularProgressBarDoted.js +4 -3
- package/lib/module/components/CircularRating/CircularRating.js +3 -2
- package/lib/module/components/ClusterBubble/ClusterBubble.js +4 -3
- package/lib/module/components/CompareTable/CompareTable.js +396 -0
- package/lib/module/components/ComparisonBar/ComparisonBar.js +260 -0
- package/lib/module/components/CoverageBarComparison/CoverageBarComparison.js +4 -3
- package/lib/module/components/DonutChart/DonutChart.js +5 -4
- package/lib/module/components/Dropdown/Dropdown.js +4 -3
- package/lib/module/components/DropdownInput/DropdownInput.js +40 -7
- package/lib/module/components/ExpandableCheckbox/ExpandableCheckbox.js +2 -1
- package/lib/module/components/FormField/FormField.js +48 -7
- package/lib/module/components/Gauge/Gauge.js +1 -1
- package/lib/module/components/HoldingsCard/HoldingsCard.js +4 -3
- package/lib/module/components/InputSearch/InputSearch.js +6 -4
- package/lib/module/components/InstitutionBadge/InstitutionBadge.js +3 -2
- package/lib/module/components/ListGroup/ListGroup.js +3 -2
- package/lib/module/components/ListItem/ListItem.js +4 -3
- package/lib/module/components/MediaCard/MediaCard.js +4 -2
- package/lib/module/components/MetricLegendItem/MetricLegendItem.js +4 -3
- package/lib/module/components/MonthlyStatusGrid/MonthlyStatusGrid.js +7 -4
- package/lib/module/components/NoteInput/NoteInput.js +7 -6
- package/lib/module/components/PdpCcCard/PdpCcCard.js +267 -0
- package/lib/module/components/PoweredByLabel/PoweredByLabel.js +4 -3
- package/lib/module/components/ProductMerchandisingCard/ProductMerchandisingCard.js +421 -0
- package/lib/module/components/ProductOverview/ProductOverview.js +5 -4
- package/lib/module/components/ProgressBadge/ProgressBadge.js +3 -3
- package/lib/module/components/ProjectionMarker/ProjectionMarker.js +157 -0
- package/lib/module/components/Radio/Radio.js +5 -4
- package/lib/module/components/Section/Section.js +4 -3
- package/lib/module/components/Slider/Slider.js +469 -0
- package/lib/module/components/Stack/Stack.js +81 -0
- package/lib/module/components/SuggestiveSearch/SuggestiveSearch.js +10 -1
- package/lib/module/components/SummaryTile/SummaryTile.js +4 -3
- package/lib/module/components/Table/Table.js +315 -0
- package/lib/module/components/Text/Text.js +3 -2
- package/lib/module/components/TextInput/TextInput.js +24 -11
- package/lib/module/components/TextSegment/TextSegment.js +114 -0
- package/lib/module/components/ThreadHero/ThreadHero.js +5 -6
- package/lib/module/components/Title/Title.js +3 -2
- package/lib/module/components/Toast/Toast.js +4 -3
- package/lib/module/components/TransactionBubble/TransactionBubble.js +3 -2
- package/lib/module/components/TransactionStatus/TransactionStatus.js +4 -3
- package/lib/module/components/UpiHandle/UpiHandle.js +3 -3
- package/lib/module/components/index.js +11 -0
- package/lib/module/design-tokens/Coin Variables-variables-full.json +1 -1
- package/lib/module/design-tokens/figma-modes.generated.js +39 -9
- package/lib/module/icons/registry.js +1 -1
- package/lib/module/utils/GlassFill/GlassFill.js +265 -0
- package/lib/module/utils/GlassFill/GlassFill.web.js +115 -0
- package/lib/module/utils/react-utils.js +75 -0
- package/lib/module/utils/web-platform-utils.js +58 -0
- package/lib/typescript/src/components/Accordion/Accordion.d.ts +7 -1
- package/lib/typescript/src/components/AccordionCheckbox/AccordionCheckbox.d.ts +7 -1
- package/lib/typescript/src/components/AccountCard/AccountCard.d.ts +7 -1
- package/lib/typescript/src/components/AllocationComparisonChart/AllocationComparisonChart.d.ts +7 -1
- package/lib/typescript/src/components/AmountInput/AmountInput.d.ts +3 -2
- package/lib/typescript/src/components/AreaLineChart/AreaLineChart.d.ts +8 -1
- package/lib/typescript/src/components/Badge/Badge.d.ts +32 -2
- package/lib/typescript/src/components/BenefitCard/BenefitCard.d.ts +93 -0
- package/lib/typescript/src/components/BrandChip/BrandChip.d.ts +7 -1
- package/lib/typescript/src/components/Button/Button.d.ts +7 -1
- package/lib/typescript/src/components/CardAdvisory/CardAdvisory.d.ts +7 -1
- package/lib/typescript/src/components/CardBankAccount/CardBankAccount.d.ts +7 -1
- package/lib/typescript/src/components/CardCTA/CardCTA.d.ts +27 -5
- 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/CircularProgressBar/CircularProgressBar.d.ts +7 -1
- package/lib/typescript/src/components/CircularProgressBarDoted/CircularProgressBarDoted.d.ts +7 -1
- package/lib/typescript/src/components/CircularRating/CircularRating.d.ts +7 -1
- package/lib/typescript/src/components/ClusterBubble/ClusterBubble.d.ts +7 -1
- package/lib/typescript/src/components/CompareTable/CompareTable.d.ts +94 -0
- package/lib/typescript/src/components/ComparisonBar/ComparisonBar.d.ts +118 -0
- package/lib/typescript/src/components/CoverageBarComparison/CoverageBarComparison.d.ts +7 -1
- package/lib/typescript/src/components/DonutChart/DonutChart.d.ts +7 -1
- package/lib/typescript/src/components/Dropdown/Dropdown.d.ts +7 -1
- package/lib/typescript/src/components/DropdownInput/DropdownInput.d.ts +26 -1
- package/lib/typescript/src/components/ExpandableCheckbox/ExpandableCheckbox.d.ts +7 -1
- package/lib/typescript/src/components/FormField/FormField.d.ts +2 -2
- package/lib/typescript/src/components/HoldingsCard/HoldingsCard.d.ts +7 -1
- package/lib/typescript/src/components/InputSearch/InputSearch.d.ts +23 -2
- package/lib/typescript/src/components/InstitutionBadge/InstitutionBadge.d.ts +7 -1
- package/lib/typescript/src/components/ListGroup/ListGroup.d.ts +7 -1
- package/lib/typescript/src/components/ListItem/ListItem.d.ts +7 -1
- package/lib/typescript/src/components/MetricLegendItem/MetricLegendItem.d.ts +7 -1
- package/lib/typescript/src/components/MonthlyStatusGrid/MonthlyStatusGrid.d.ts +14 -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/PoweredByLabel/PoweredByLabel.d.ts +7 -1
- package/lib/typescript/src/components/ProductMerchandisingCard/ProductMerchandisingCard.d.ts +87 -0
- package/lib/typescript/src/components/ProductOverview/ProductOverview.d.ts +7 -1
- package/lib/typescript/src/components/ProgressBadge/ProgressBadge.d.ts +7 -1
- package/lib/typescript/src/components/ProjectionMarker/ProjectionMarker.d.ts +88 -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/Section/Section.d.ts +7 -1
- package/lib/typescript/src/components/Slider/Slider.d.ts +105 -0
- package/lib/typescript/src/components/Stack/Stack.d.ts +81 -0
- package/lib/typescript/src/components/SummaryTile/SummaryTile.d.ts +7 -1
- package/lib/typescript/src/components/Table/Table.d.ts +139 -0
- package/lib/typescript/src/components/Text/Text.d.ts +7 -1
- package/lib/typescript/src/components/TextInput/TextInput.d.ts +9 -29
- package/lib/typescript/src/components/TextSegment/TextSegment.d.ts +106 -0
- package/lib/typescript/src/components/ThreadHero/ThreadHero.d.ts +7 -1
- package/lib/typescript/src/components/Title/Title.d.ts +7 -1
- package/lib/typescript/src/components/Toast/Toast.d.ts +7 -1
- package/lib/typescript/src/components/TransactionBubble/TransactionBubble.d.ts +7 -1
- package/lib/typescript/src/components/TransactionStatus/TransactionStatus.d.ts +7 -1
- package/lib/typescript/src/components/UpiHandle/UpiHandle.d.ts +7 -1
- package/lib/typescript/src/components/index.d.ts +14 -3
- 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/GlassFill/GlassFill.d.ts +84 -0
- package/lib/typescript/src/utils/GlassFill/GlassFill.web.d.ts +43 -0
- package/lib/typescript/src/utils/react-utils.d.ts +47 -0
- package/lib/typescript/src/utils/web-platform-utils.d.ts +36 -0
- package/package.json +2 -1
- package/src/components/Accordion/Accordion.tsx +9 -2
- package/src/components/AccordionCheckbox/AccordionCheckbox.tsx +10 -3
- package/src/components/AccountCard/AccountCard.tsx +10 -3
- package/src/components/AllocationComparisonChart/AllocationComparisonChart.tsx +14 -4
- package/src/components/AmountInput/AmountInput.tsx +7 -5
- package/src/components/AreaLineChart/AreaLineChart.tsx +15 -5
- package/src/components/Badge/Badge.tsx +78 -8
- package/src/components/BenefitCard/BenefitCard.tsx +309 -0
- package/src/components/BrandChip/BrandChip.tsx +9 -3
- package/src/components/Button/Button.tsx +9 -2
- package/src/components/CardAdvisory/CardAdvisory.tsx +9 -2
- package/src/components/CardBankAccount/CardBankAccount.tsx +9 -2
- package/src/components/CardCTA/CardCTA.tsx +214 -41
- package/src/components/CardInsight/CardInsight.tsx +7 -1
- 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/CircularProgressBar/CircularProgressBar.tsx +14 -4
- package/src/components/CircularProgressBarDoted/CircularProgressBarDoted.tsx +10 -3
- package/src/components/CircularRating/CircularRating.tsx +9 -2
- package/src/components/ClusterBubble/ClusterBubble.tsx +9 -2
- package/src/components/CompareTable/CompareTable.tsx +525 -0
- package/src/components/ComparisonBar/ComparisonBar.tsx +356 -0
- package/src/components/CoverageBarComparison/CoverageBarComparison.tsx +9 -2
- package/src/components/DonutChart/DonutChart.tsx +10 -3
- package/src/components/Dropdown/Dropdown.tsx +9 -2
- package/src/components/DropdownInput/DropdownInput.tsx +64 -5
- package/src/components/ExpandableCheckbox/ExpandableCheckbox.tsx +8 -1
- package/src/components/FormField/FormField.tsx +52 -6
- package/src/components/Gauge/Gauge.tsx +1 -1
- package/src/components/HoldingsCard/HoldingsCard.tsx +9 -2
- package/src/components/InputSearch/InputSearch.tsx +8 -5
- package/src/components/InstitutionBadge/InstitutionBadge.tsx +9 -2
- package/src/components/ListGroup/ListGroup.tsx +9 -2
- package/src/components/ListItem/ListItem.tsx +10 -3
- package/src/components/MediaCard/MediaCard.tsx +2 -2
- package/src/components/MetricLegendItem/MetricLegendItem.tsx +9 -2
- package/src/components/MonthlyStatusGrid/MonthlyStatusGrid.tsx +17 -2
- package/src/components/NoteInput/NoteInput.tsx +8 -6
- package/src/components/PdpCcCard/PdpCcCard.tsx +356 -0
- package/src/components/PoweredByLabel/PoweredByLabel.tsx +9 -2
- package/src/components/ProductMerchandisingCard/ProductMerchandisingCard.tsx +490 -0
- package/src/components/ProductOverview/ProductOverview.tsx +10 -3
- package/src/components/ProgressBadge/ProgressBadge.tsx +9 -3
- package/src/components/ProjectionMarker/ProjectionMarker.tsx +284 -0
- package/src/components/Radio/Radio.tsx +5 -4
- package/src/components/Section/Section.tsx +10 -3
- package/src/components/Slider/Slider.tsx +635 -0
- package/src/components/Stack/Stack.tsx +131 -0
- package/src/components/SuggestiveSearch/SuggestiveSearch.tsx +10 -1
- package/src/components/SummaryTile/SummaryTile.tsx +9 -2
- package/src/components/Table/Table.tsx +449 -0
- package/src/components/Text/Text.tsx +9 -2
- package/src/components/TextInput/TextInput.tsx +22 -12
- package/src/components/TextSegment/TextSegment.tsx +173 -0
- package/src/components/ThreadHero/ThreadHero.tsx +10 -3
- package/src/components/Title/Title.tsx +9 -2
- package/src/components/Toast/Toast.tsx +9 -2
- package/src/components/TransactionBubble/TransactionBubble.tsx +9 -2
- package/src/components/TransactionStatus/TransactionStatus.tsx +9 -2
- package/src/components/UpiHandle/UpiHandle.tsx +9 -3
- package/src/components/index.ts +33 -3
- package/src/design-tokens/Coin Variables-variables-full.json +1 -1
- package/src/design-tokens/figma-modes.generated.ts +39 -9
- package/src/icons/registry.ts +1 -1
- package/src/utils/GlassFill/GlassFill.tsx +305 -0
- package/src/utils/GlassFill/GlassFill.web.tsx +148 -0
- package/src/utils/react-utils.ts +84 -0
- package/src/utils/web-platform-utils.ts +68 -0
- package/lib/commonjs/components/MediaCard/GlassFill.js +0 -62
- package/lib/commonjs/components/MediaCard/GlassFill.web.js +0 -48
- package/lib/module/components/MediaCard/GlassFill.js +0 -57
- package/lib/module/components/MediaCard/GlassFill.web.js +0 -43
- 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
- package/lib/typescript/src/components/MediaCard/GlassFill.d.ts +0 -47
- package/lib/typescript/src/components/MediaCard/GlassFill.web.d.ts +0 -20
- package/src/components/MediaCard/GlassFill.tsx +0 -89
- package/src/components/MediaCard/GlassFill.web.tsx +0 -53
|
@@ -5,7 +5,7 @@ import { View, Text } from 'react-native';
|
|
|
5
5
|
import Svg, { Line } from 'react-native-svg';
|
|
6
6
|
import { getVariableByName } from '../../design-tokens/figma-variables-resolver';
|
|
7
7
|
import { useTokens } from '../../design-tokens/JFSThemeProvider';
|
|
8
|
-
import { EMPTY_MODES } from '../../utils/react-utils';
|
|
8
|
+
import { EMPTY_MODES, resolveTruncation } from '../../utils/react-utils';
|
|
9
9
|
import MetricLegendItem from '../MetricLegendItem/MetricLegendItem';
|
|
10
10
|
|
|
11
11
|
/**
|
|
@@ -61,7 +61,8 @@ function SegmentBar({
|
|
|
61
61
|
baselineHeightPx,
|
|
62
62
|
baselineLabel,
|
|
63
63
|
showMarker,
|
|
64
|
-
theme
|
|
64
|
+
theme,
|
|
65
|
+
disableTruncation
|
|
65
66
|
}) {
|
|
66
67
|
const {
|
|
67
68
|
barWidth,
|
|
@@ -88,7 +89,7 @@ function SegmentBar({
|
|
|
88
89
|
},
|
|
89
90
|
accessibilityLabel: segment.accessibilityLabel,
|
|
90
91
|
children: [showValueLabel ? /*#__PURE__*/_jsx(Text, {
|
|
91
|
-
|
|
92
|
+
...resolveTruncation(disableTruncation, 1),
|
|
92
93
|
style: labelStyle,
|
|
93
94
|
children: segment.valueLabel
|
|
94
95
|
}) : null, /*#__PURE__*/_jsx(View, {
|
|
@@ -134,7 +135,7 @@ function SegmentBar({
|
|
|
134
135
|
strokeDasharray: "2 2"
|
|
135
136
|
})
|
|
136
137
|
}), isShown(baselineLabel) ? /*#__PURE__*/_jsx(Text, {
|
|
137
|
-
|
|
138
|
+
...resolveTruncation(disableTruncation, 1),
|
|
138
139
|
style: [labelStyle, {
|
|
139
140
|
marginLeft: 6
|
|
140
141
|
}],
|
|
@@ -143,7 +144,7 @@ function SegmentBar({
|
|
|
143
144
|
}) : null]
|
|
144
145
|
}) : null
|
|
145
146
|
}), /*#__PURE__*/_jsx(Text, {
|
|
146
|
-
|
|
147
|
+
...resolveTruncation(disableTruncation, 1),
|
|
147
148
|
style: labelStyle,
|
|
148
149
|
children: segment.label
|
|
149
150
|
})]
|
|
@@ -180,7 +181,8 @@ function AllocationComparisonChart({
|
|
|
180
181
|
style,
|
|
181
182
|
chartStyle,
|
|
182
183
|
legendStyle,
|
|
183
|
-
accessibilityLabel
|
|
184
|
+
accessibilityLabel,
|
|
185
|
+
disableTruncation
|
|
184
186
|
}) {
|
|
185
187
|
const {
|
|
186
188
|
modes: globalModes
|
|
@@ -284,7 +286,8 @@ function AllocationComparisonChart({
|
|
|
284
286
|
baselineHeightPx: baselineHeightPx,
|
|
285
287
|
baselineLabel: baselineLabel,
|
|
286
288
|
showMarker: showMarker,
|
|
287
|
-
theme: theme
|
|
289
|
+
theme: theme,
|
|
290
|
+
disableTruncation: disableTruncation
|
|
288
291
|
}, segment.key ?? `segment-${index}`);
|
|
289
292
|
})
|
|
290
293
|
})]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import React from 'react';
|
|
3
|
+
import React, { forwardRef } from 'react';
|
|
4
4
|
import { View } from 'react-native';
|
|
5
5
|
import { getVariableByName } from '../../design-tokens/figma-variables-resolver';
|
|
6
6
|
import { useTokens } from '../../design-tokens/JFSThemeProvider';
|
|
@@ -13,12 +13,12 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
13
13
|
*
|
|
14
14
|
* @component
|
|
15
15
|
*/
|
|
16
|
-
|
|
16
|
+
const AmountInput = /*#__PURE__*/forwardRef(function AmountInput({
|
|
17
17
|
moneyValueSlot,
|
|
18
18
|
noteInputSlot,
|
|
19
19
|
modes: propModes = EMPTY_MODES,
|
|
20
20
|
style
|
|
21
|
-
}) {
|
|
21
|
+
}, ref) {
|
|
22
22
|
const {
|
|
23
23
|
modes: globalModes
|
|
24
24
|
} = useTokens();
|
|
@@ -72,7 +72,9 @@ export default function AmountInput({
|
|
|
72
72
|
return noteInputSlot;
|
|
73
73
|
};
|
|
74
74
|
return /*#__PURE__*/_jsxs(View, {
|
|
75
|
+
ref: ref,
|
|
75
76
|
style: containerStyle,
|
|
76
77
|
children: [renderMoneyValueSlot(), renderNoteInputSlot()]
|
|
77
78
|
});
|
|
78
|
-
}
|
|
79
|
+
});
|
|
80
|
+
export default AmountInput;
|
|
@@ -5,7 +5,7 @@ import { PanResponder, Platform, Pressable, StyleSheet, Text, View } from 'react
|
|
|
5
5
|
import Svg, { Circle, Line, Path } from 'react-native-svg';
|
|
6
6
|
import { getVariableByName } from '../../design-tokens/figma-variables-resolver';
|
|
7
7
|
import { useTokens } from '../../design-tokens/JFSThemeProvider';
|
|
8
|
-
import { EMPTY_MODES } from '../../utils/react-utils';
|
|
8
|
+
import { EMPTY_MODES, resolveTruncation } from '../../utils/react-utils';
|
|
9
9
|
import MetricLegendItem from '../MetricLegendItem/MetricLegendItem';
|
|
10
10
|
import { buildAreaPath, buildLineSegments, createLinearScale, extent, nearestIndex, niceTicks, resolvePoints } from './chartMath';
|
|
11
11
|
|
|
@@ -116,7 +116,8 @@ function AreaLineChart({
|
|
|
116
116
|
modes: propModes = EMPTY_MODES,
|
|
117
117
|
style,
|
|
118
118
|
children,
|
|
119
|
-
accessibilityLabel
|
|
119
|
+
accessibilityLabel,
|
|
120
|
+
disableTruncation
|
|
120
121
|
}) {
|
|
121
122
|
const {
|
|
122
123
|
modes: globalModes
|
|
@@ -236,8 +237,9 @@ function AreaLineChart({
|
|
|
236
237
|
formatX,
|
|
237
238
|
formatY,
|
|
238
239
|
showDots,
|
|
239
|
-
modes
|
|
240
|
-
|
|
240
|
+
modes,
|
|
241
|
+
disableTruncation
|
|
242
|
+
}), [plotWidth, height, inset, xScale, yScale, yTicks, indexXs, count, resolvedSeries, curve, activeIndex, setActiveIndex, xLabels, formatX, formatY, showDots, modes, disableTruncation]);
|
|
241
243
|
const isMultiSeries = resolvedSeries.length > 1;
|
|
242
244
|
const resolvedFormatValue = formatValue ?? (v => formatY(v));
|
|
243
245
|
return /*#__PURE__*/_jsx(ChartContext.Provider, {
|
|
@@ -378,7 +380,8 @@ function ChartYAxis({
|
|
|
378
380
|
yScale,
|
|
379
381
|
yTicks,
|
|
380
382
|
formatY,
|
|
381
|
-
modes
|
|
383
|
+
modes,
|
|
384
|
+
disableTruncation
|
|
382
385
|
} = useChart();
|
|
383
386
|
const typo = useAxisTypography(modes);
|
|
384
387
|
const format = formatLabel ?? formatY;
|
|
@@ -406,7 +409,7 @@ function ChartYAxis({
|
|
|
406
409
|
},
|
|
407
410
|
children: showLabels ? /*#__PURE__*/_jsx(Text, {
|
|
408
411
|
style: typo.style,
|
|
409
|
-
|
|
412
|
+
...resolveTruncation(disableTruncation, 1),
|
|
410
413
|
children: format(t)
|
|
411
414
|
}) : null
|
|
412
415
|
}, `yl-${t}`);
|
|
@@ -457,7 +460,8 @@ function ChartXAxis({
|
|
|
457
460
|
formatX,
|
|
458
461
|
modes,
|
|
459
462
|
activeIndex,
|
|
460
|
-
setActiveIndex
|
|
463
|
+
setActiveIndex,
|
|
464
|
+
disableTruncation
|
|
461
465
|
} = useChart();
|
|
462
466
|
const typo = useAxisTypography(modes);
|
|
463
467
|
const format = formatLabel ?? formatX;
|
|
@@ -503,7 +507,7 @@ function ChartXAxis({
|
|
|
503
507
|
color: activeColor,
|
|
504
508
|
fontWeight: '700'
|
|
505
509
|
} : null],
|
|
506
|
-
|
|
510
|
+
...resolveTruncation(disableTruncation, 1),
|
|
507
511
|
children: format(label, i)
|
|
508
512
|
});
|
|
509
513
|
return /*#__PURE__*/_jsx(View, {
|
|
@@ -3,23 +3,36 @@
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { View, Text, Pressable } from 'react-native';
|
|
5
5
|
import { getVariableByName } from '../../design-tokens/figma-variables-resolver';
|
|
6
|
-
import { EMPTY_MODES } from '../../utils/react-utils';
|
|
6
|
+
import { EMPTY_MODES, resolveTruncation } from '../../utils/react-utils';
|
|
7
7
|
import Skeleton from '../../skeleton/Skeleton';
|
|
8
8
|
import { useSkeleton } from '../../skeleton/SkeletonGroup';
|
|
9
|
-
import
|
|
9
|
+
import GlassFill from '../../utils/GlassFill/GlassFill';
|
|
10
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
11
|
function Badge({
|
|
11
12
|
label = 'Label',
|
|
13
|
+
type = 'default',
|
|
12
14
|
modes = EMPTY_MODES,
|
|
13
15
|
onPress,
|
|
14
16
|
accessibilityLabel,
|
|
15
17
|
style,
|
|
16
18
|
labelStyle,
|
|
17
19
|
loading,
|
|
20
|
+
disableTruncation,
|
|
21
|
+
leading,
|
|
22
|
+
glassOverlayColor,
|
|
23
|
+
glassIntensity,
|
|
18
24
|
...rest
|
|
19
25
|
}) {
|
|
20
|
-
|
|
26
|
+
const isGlass = type === 'glass';
|
|
27
|
+
const hasLeading = leading != null;
|
|
28
|
+
|
|
29
|
+
// Resolve token values (fall back to sensible defaults). The glass type
|
|
30
|
+
// swaps the solid fill for a translucent overlay + white label, matching the
|
|
31
|
+
// Figma `badge/glass/*` tokens.
|
|
21
32
|
const backgroundColor = getVariableByName('badge/color/background', modes) || '#d8effe';
|
|
22
|
-
const
|
|
33
|
+
const glassBackground = getVariableByName('badge/glass/color/background', modes) || '#ffffff26';
|
|
34
|
+
const glassLabelColor = getVariableByName('badge/glass/color/label', modes) || '#ffffff';
|
|
35
|
+
const labelColor = isGlass ? glassLabelColor : getVariableByName('badge/color/label', modes) || '#000000';
|
|
23
36
|
const fontSize = Number(getVariableByName('badge/label/fontSize', modes)) || 12;
|
|
24
37
|
const fontFamily = getVariableByName('badge/fontFamily', modes) || undefined;
|
|
25
38
|
const fontWeight = getVariableByName('badge/label/fontWeight', modes) || '600';
|
|
@@ -27,6 +40,9 @@ function Badge({
|
|
|
27
40
|
const paddingVertical = Number(getVariableByName('badge/padding/vertical', modes)) || 4;
|
|
28
41
|
const borderRadius = Number(getVariableByName('badge/radius', modes)) || 4;
|
|
29
42
|
const lineHeight = Number(getVariableByName('badge/label/lineHeight', modes)) || Math.round(fontSize * 1.2);
|
|
43
|
+
// Figma `blur/minimal` (px radius) -> GlassFill's 0–100 intensity scale, the
|
|
44
|
+
// same 1:1 mapping the merchandising card footer uses.
|
|
45
|
+
const blurIntensity = Math.max(0, Math.min(100, Math.round(Number(getVariableByName('blur/minimal', modes)) || 29)));
|
|
30
46
|
|
|
31
47
|
// Skeleton short-circuit. Size derived from the same tokens the loaded
|
|
32
48
|
// badge would use so the placeholder occupies the same box.
|
|
@@ -49,13 +65,25 @@ function Badge({
|
|
|
49
65
|
}
|
|
50
66
|
const Container = onPress ? Pressable : View;
|
|
51
67
|
const containerStyle = {
|
|
52
|
-
|
|
68
|
+
// Glass keeps the container transparent so the GlassFill blur shows through;
|
|
69
|
+
// `overflow: 'hidden'` clips the native blur view to the rounded pill (the
|
|
70
|
+
// blur view does not honor borderRadius itself).
|
|
71
|
+
backgroundColor: isGlass ? 'transparent' : backgroundColor,
|
|
53
72
|
paddingHorizontal,
|
|
54
73
|
paddingVertical,
|
|
55
74
|
borderRadius,
|
|
56
75
|
alignSelf: 'flex-start',
|
|
57
76
|
alignItems: 'center',
|
|
58
77
|
justifyContent: 'center',
|
|
78
|
+
// A leading node sits in-line before the label, so switch to a row with a
|
|
79
|
+
// small gap. Consumer `style` (spread last) can still override either.
|
|
80
|
+
...(hasLeading ? {
|
|
81
|
+
flexDirection: 'row',
|
|
82
|
+
gap: 4
|
|
83
|
+
} : null),
|
|
84
|
+
...(isGlass ? {
|
|
85
|
+
overflow: 'hidden'
|
|
86
|
+
} : null),
|
|
59
87
|
...(style || {})
|
|
60
88
|
};
|
|
61
89
|
const textStyle = {
|
|
@@ -68,19 +96,30 @@ function Badge({
|
|
|
68
96
|
...(labelStyle || {})
|
|
69
97
|
};
|
|
70
98
|
const defaultAccessibilityLabel = accessibilityLabel || label;
|
|
71
|
-
return /*#__PURE__*/
|
|
99
|
+
return /*#__PURE__*/_jsxs(Container, {
|
|
72
100
|
style: containerStyle,
|
|
73
101
|
accessibilityRole: onPress ? 'button' : 'text',
|
|
74
102
|
accessibilityLabel: undefined,
|
|
75
103
|
onPress: onPress,
|
|
76
104
|
...rest,
|
|
77
|
-
children: /*#__PURE__*/_jsx(
|
|
105
|
+
children: [isGlass ? /*#__PURE__*/_jsx(GlassFill, {
|
|
106
|
+
tint: "light",
|
|
107
|
+
intensity: glassIntensity ?? blurIntensity,
|
|
108
|
+
overlayColor: glassOverlayColor ?? glassBackground,
|
|
109
|
+
androidTintWash: false
|
|
110
|
+
}) : null, hasLeading ? /*#__PURE__*/_jsx(View, {
|
|
111
|
+
style: LEADING_WRAP,
|
|
112
|
+
children: leading
|
|
113
|
+
}) : null, /*#__PURE__*/_jsx(Text, {
|
|
78
114
|
style: textStyle,
|
|
79
|
-
|
|
80
|
-
ellipsizeMode: "tail",
|
|
115
|
+
...resolveTruncation(disableTruncation, 1, 'tail'),
|
|
81
116
|
accessibilityElementsHidden: false,
|
|
82
117
|
children: label
|
|
83
|
-
})
|
|
118
|
+
})]
|
|
84
119
|
});
|
|
85
120
|
}
|
|
121
|
+
const LEADING_WRAP = {
|
|
122
|
+
justifyContent: 'center',
|
|
123
|
+
alignItems: 'center'
|
|
124
|
+
};
|
|
86
125
|
export default Badge;
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React, { useMemo } from 'react';
|
|
4
|
+
import { View, Text as RNText, Pressable, StyleSheet } from 'react-native';
|
|
5
|
+
import { getVariableByName } from '../../design-tokens/figma-variables-resolver';
|
|
6
|
+
import { EMPTY_MODES, cloneChildrenWithModes } from '../../utils/react-utils';
|
|
7
|
+
import Icon from '../Icon/Icon';
|
|
8
|
+
import Text from '../Text/Text';
|
|
9
|
+
import ListItem from '../ListItem/ListItem';
|
|
10
|
+
import Divider from '../Divider/Divider';
|
|
11
|
+
import Button from '../Button/Button';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* A single benefit row rendered with the shared `ListItem` primitive: a
|
|
15
|
+
* leading icon, a title and an optional right-aligned trailing value.
|
|
16
|
+
*/
|
|
17
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
18
|
+
/**
|
|
19
|
+
* BenefitCard — Figma node 5352:1077 ("Benefit Card").
|
|
20
|
+
*
|
|
21
|
+
* A white, rounded card that summarises the rewards a user will earn. It is
|
|
22
|
+
* composed entirely from the shared design-system primitives so it stays in
|
|
23
|
+
* sync with the rest of the library:
|
|
24
|
+
*
|
|
25
|
+
* - **Header** — a section title + a single highlighted {@link ListItem}
|
|
26
|
+
* (leading `Icon`, title, right-aligned trailing value) followed by a
|
|
27
|
+
* `Divider`.
|
|
28
|
+
* - **Body** — a section title + a column of benefit {@link ListItem}s. The
|
|
29
|
+
* list is a real slot: pass `children` to fully control it, or `items` for
|
|
30
|
+
* the declarative path.
|
|
31
|
+
* - **CTA** — a small {@link Button} (Figma `Button / Size = S`).
|
|
32
|
+
*
|
|
33
|
+
* The list rows resolve through the `List Item Style: Minimal` mode (12px /
|
|
34
|
+
* regular title, 4px gap, no padding) and the leading icons use the
|
|
35
|
+
* `AppearanceBrand: Secondary` brand color, exactly matching the design. All
|
|
36
|
+
* three defaults can be overridden via `modes`.
|
|
37
|
+
*/
|
|
38
|
+
function BenefitCard({
|
|
39
|
+
headerTitle = 'You will earn',
|
|
40
|
+
headerItem,
|
|
41
|
+
showHeader = true,
|
|
42
|
+
bodyTitle = 'Upgrade to JioFinance+ and earn more',
|
|
43
|
+
items,
|
|
44
|
+
children,
|
|
45
|
+
buttonLabel = 'Upgrade',
|
|
46
|
+
onButtonPress,
|
|
47
|
+
button,
|
|
48
|
+
showButton = true,
|
|
49
|
+
onPress,
|
|
50
|
+
width = 344,
|
|
51
|
+
modes = EMPTY_MODES,
|
|
52
|
+
style,
|
|
53
|
+
accessibilityLabel
|
|
54
|
+
}) {
|
|
55
|
+
const tokens = useMemo(() => resolveTokens(modes), [modes]);
|
|
56
|
+
|
|
57
|
+
// Sub-component modes. Consumer-supplied `modes` always win via spread order.
|
|
58
|
+
const listItemModes = useMemo(() => ({
|
|
59
|
+
'List Item Style': 'Minimal',
|
|
60
|
+
...modes
|
|
61
|
+
}), [modes]);
|
|
62
|
+
const iconModes = useMemo(() => ({
|
|
63
|
+
AppearanceBrand: 'Secondary',
|
|
64
|
+
...modes
|
|
65
|
+
}), [modes]);
|
|
66
|
+
const trailingTextModes = useMemo(() => ({
|
|
67
|
+
'Text Sizes': 'Small',
|
|
68
|
+
Weight: 'Regular',
|
|
69
|
+
...modes
|
|
70
|
+
}), [modes]);
|
|
71
|
+
const ctaModes = useMemo(() => ({
|
|
72
|
+
'Button / Size': 'S',
|
|
73
|
+
...modes
|
|
74
|
+
}), [modes]);
|
|
75
|
+
const renderItem = (item, key) => {
|
|
76
|
+
const leading = item.leading ?? (item.icon != null ? /*#__PURE__*/_jsx(Icon, {
|
|
77
|
+
iconName: item.icon,
|
|
78
|
+
color: item.iconColor,
|
|
79
|
+
modes: iconModes
|
|
80
|
+
}) : null);
|
|
81
|
+
const trailing = item.trailing ?? (item.trailingText != null ? /*#__PURE__*/_jsx(Text, {
|
|
82
|
+
modes: trailingTextModes,
|
|
83
|
+
children: item.trailingText
|
|
84
|
+
}) : undefined);
|
|
85
|
+
return /*#__PURE__*/_jsx(ListItem, {
|
|
86
|
+
layout: "Horizontal",
|
|
87
|
+
navArrow: false,
|
|
88
|
+
showSupportText: false,
|
|
89
|
+
title: item.title,
|
|
90
|
+
leading: leading,
|
|
91
|
+
trailing: trailing,
|
|
92
|
+
onPress: item.onPress,
|
|
93
|
+
modes: listItemModes
|
|
94
|
+
}, key);
|
|
95
|
+
};
|
|
96
|
+
const headerNode = showHeader && (headerTitle != null || headerItem != null) ? /*#__PURE__*/_jsxs(View, {
|
|
97
|
+
style: styles.section,
|
|
98
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
99
|
+
style: styles.cardHeader,
|
|
100
|
+
children: [headerTitle != null ? /*#__PURE__*/_jsx(RNText, {
|
|
101
|
+
style: tokens.title,
|
|
102
|
+
children: headerTitle
|
|
103
|
+
}) : null, headerItem != null ? renderItem(headerItem, 'header-item') : null]
|
|
104
|
+
}), /*#__PURE__*/_jsx(Divider, {
|
|
105
|
+
modes: modes
|
|
106
|
+
})]
|
|
107
|
+
}) : null;
|
|
108
|
+
const bodyList = children ? cloneChildrenWithModes(children, listItemModes) : (items ?? DEFAULT_ITEMS).map((item, index) => renderItem(item, index));
|
|
109
|
+
const ctaNode = button ?? /*#__PURE__*/_jsx(Button, {
|
|
110
|
+
label: buttonLabel,
|
|
111
|
+
modes: ctaModes,
|
|
112
|
+
onPress: onButtonPress
|
|
113
|
+
});
|
|
114
|
+
const containerStyle = useMemo(() => ({
|
|
115
|
+
...tokens.container,
|
|
116
|
+
width
|
|
117
|
+
}), [tokens.container, width]);
|
|
118
|
+
const content = /*#__PURE__*/_jsxs(_Fragment, {
|
|
119
|
+
children: [headerNode, /*#__PURE__*/_jsxs(View, {
|
|
120
|
+
style: tokens.body,
|
|
121
|
+
children: [bodyTitle != null ? /*#__PURE__*/_jsx(RNText, {
|
|
122
|
+
style: tokens.title,
|
|
123
|
+
children: bodyTitle
|
|
124
|
+
}) : null, /*#__PURE__*/_jsx(View, {
|
|
125
|
+
style: tokens.listWrap,
|
|
126
|
+
children: bodyList
|
|
127
|
+
})]
|
|
128
|
+
}), showButton ? ctaNode : null]
|
|
129
|
+
});
|
|
130
|
+
if (onPress) {
|
|
131
|
+
return /*#__PURE__*/_jsx(Pressable, {
|
|
132
|
+
style: ({
|
|
133
|
+
pressed
|
|
134
|
+
}) => [containerStyle, pressed ? styles.pressed : null, style],
|
|
135
|
+
accessibilityRole: "button",
|
|
136
|
+
accessibilityLabel: accessibilityLabel ?? headerTitle ?? bodyTitle,
|
|
137
|
+
onPress: onPress,
|
|
138
|
+
children: content
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
return /*#__PURE__*/_jsx(View, {
|
|
142
|
+
style: [containerStyle, style],
|
|
143
|
+
accessibilityLabel: accessibilityLabel,
|
|
144
|
+
children: content
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// ---------------------------------------------------------------------------
|
|
149
|
+
// Tokens / static styles
|
|
150
|
+
// ---------------------------------------------------------------------------
|
|
151
|
+
|
|
152
|
+
// The "card header" inner gap (title -> highlighted item) is a fixed 4px in
|
|
153
|
+
// the Figma node and has no dedicated token.
|
|
154
|
+
const CARD_HEADER_GAP = 4;
|
|
155
|
+
function asNum(raw, fallback) {
|
|
156
|
+
const n = typeof raw === 'number' ? raw : parseFloat(raw);
|
|
157
|
+
return Number.isFinite(n) ? n : fallback;
|
|
158
|
+
}
|
|
159
|
+
function asStr(raw, fallback) {
|
|
160
|
+
return raw != null ? String(raw) : fallback;
|
|
161
|
+
}
|
|
162
|
+
function resolveTokens(modes) {
|
|
163
|
+
// NOTE: token names are passed as string literals DIRECTLY to
|
|
164
|
+
// getVariableByName so the `extract-component-tokens` script can statically
|
|
165
|
+
// collect them for the generated docs. Do not refactor these into a helper
|
|
166
|
+
// that receives the name as a variable.
|
|
167
|
+
const background = asStr(getVariableByName('benefitCard/background', modes), '#ffffff');
|
|
168
|
+
const paddingHorizontal = asNum(getVariableByName('benefitCard/padding/horizontal', modes), 12);
|
|
169
|
+
const paddingVertical = asNum(getVariableByName('benefitCard/padding/vertical', modes), 12);
|
|
170
|
+
const radius = asNum(getVariableByName('benefitCard/radius', modes), 12);
|
|
171
|
+
const gap = asNum(getVariableByName('benefitCard/gap', modes), 8);
|
|
172
|
+
const titleColor = asStr(getVariableByName('benefitCard/title/foreground', modes), '#000000');
|
|
173
|
+
const titleSize = asNum(getVariableByName('benefitCard/title/fontsize', modes), 14);
|
|
174
|
+
const titleFamily = asStr(getVariableByName('benefitCard/title/fontFamily', modes), 'JioType Var');
|
|
175
|
+
const titleWeight = asStr(getVariableByName('benefitCard/title/fontWeight', modes), '500');
|
|
176
|
+
return {
|
|
177
|
+
container: {
|
|
178
|
+
backgroundColor: background,
|
|
179
|
+
paddingHorizontal,
|
|
180
|
+
paddingVertical,
|
|
181
|
+
borderRadius: radius,
|
|
182
|
+
gap,
|
|
183
|
+
flexDirection: 'column',
|
|
184
|
+
alignItems: 'flex-start'
|
|
185
|
+
},
|
|
186
|
+
body: {
|
|
187
|
+
alignSelf: 'stretch',
|
|
188
|
+
gap
|
|
189
|
+
},
|
|
190
|
+
listWrap: {
|
|
191
|
+
alignSelf: 'stretch',
|
|
192
|
+
gap
|
|
193
|
+
},
|
|
194
|
+
title: {
|
|
195
|
+
color: titleColor,
|
|
196
|
+
fontSize: titleSize,
|
|
197
|
+
fontFamily: titleFamily,
|
|
198
|
+
fontWeight: titleWeight,
|
|
199
|
+
lineHeight: 20,
|
|
200
|
+
letterSpacing: -0.5,
|
|
201
|
+
includeFontPadding: false
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
const DEFAULT_ITEMS = [{
|
|
206
|
+
icon: 'ic_card',
|
|
207
|
+
title: 'Up to ₹5000 cashback'
|
|
208
|
+
}, {
|
|
209
|
+
icon: 'ic_card',
|
|
210
|
+
title: '25% extra JioPoints'
|
|
211
|
+
}];
|
|
212
|
+
const styles = StyleSheet.create({
|
|
213
|
+
section: {
|
|
214
|
+
alignSelf: 'stretch',
|
|
215
|
+
gap: 8
|
|
216
|
+
},
|
|
217
|
+
cardHeader: {
|
|
218
|
+
alignSelf: 'stretch',
|
|
219
|
+
gap: CARD_HEADER_GAP
|
|
220
|
+
},
|
|
221
|
+
pressed: {
|
|
222
|
+
opacity: 0.92
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
export default BenefitCard;
|
|
@@ -4,7 +4,7 @@ import React, { useMemo } from 'react';
|
|
|
4
4
|
import { Pressable, Text, View } from 'react-native';
|
|
5
5
|
import { getVariableByName } from '../../design-tokens/figma-variables-resolver';
|
|
6
6
|
import { useTokens } from '../../design-tokens/JFSThemeProvider';
|
|
7
|
-
import { EMPTY_MODES, cloneChildrenWithModes } from '../../utils/react-utils';
|
|
7
|
+
import { EMPTY_MODES, cloneChildrenWithModes, resolveTruncation } from '../../utils/react-utils';
|
|
8
8
|
import Avatar from '../Avatar/Avatar';
|
|
9
9
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
10
|
const toNumber = (value, fallback) => {
|
|
@@ -89,7 +89,8 @@ function BrandChip({
|
|
|
89
89
|
modes: propModes = EMPTY_MODES,
|
|
90
90
|
style,
|
|
91
91
|
labelStyle,
|
|
92
|
-
accessibilityLabel
|
|
92
|
+
accessibilityLabel,
|
|
93
|
+
disableTruncation
|
|
93
94
|
}) {
|
|
94
95
|
const {
|
|
95
96
|
modes: globalModes
|
|
@@ -120,8 +121,7 @@ function BrandChip({
|
|
|
120
121
|
const content = /*#__PURE__*/_jsxs(_Fragment, {
|
|
121
122
|
children: [avatarNode, /*#__PURE__*/_jsx(Text, {
|
|
122
123
|
style: [tokens.labelStyle, labelStyle],
|
|
123
|
-
|
|
124
|
-
ellipsizeMode: "tail",
|
|
124
|
+
...resolveTruncation(disableTruncation, 1, 'tail'),
|
|
125
125
|
children: label
|
|
126
126
|
})]
|
|
127
127
|
});
|
|
@@ -4,7 +4,7 @@ import React, { useCallback, useMemo, useRef, useState } from 'react';
|
|
|
4
4
|
import { Platform, Pressable, Text, View } from 'react-native';
|
|
5
5
|
import { getVariableByName } from '../../design-tokens/figma-variables-resolver';
|
|
6
6
|
import { usePressableWebSupport } from '../../utils/web-platform-utils';
|
|
7
|
-
import { EMPTY_MODES } from '../../utils/react-utils';
|
|
7
|
+
import { EMPTY_MODES, resolveTruncation } from '../../utils/react-utils';
|
|
8
8
|
import Icon from '../../icons/Icon';
|
|
9
9
|
import Skeleton from '../../skeleton/Skeleton';
|
|
10
10
|
import { useSkeleton } from '../../skeleton/SkeletonGroup';
|
|
@@ -170,6 +170,7 @@ function ButtonImpl({
|
|
|
170
170
|
accessibilityState,
|
|
171
171
|
webAccessibilityProps,
|
|
172
172
|
loading,
|
|
173
|
+
disableTruncation,
|
|
173
174
|
...rest
|
|
174
175
|
}) {
|
|
175
176
|
// Hover state is web-only in practice; the setter is gated so native taps
|
|
@@ -214,7 +215,7 @@ function ButtonImpl({
|
|
|
214
215
|
} else {
|
|
215
216
|
content = /*#__PURE__*/_jsx(Text, {
|
|
216
217
|
style: activeLabelStyle,
|
|
217
|
-
|
|
218
|
+
...resolveTruncation(disableTruncation, 1),
|
|
218
219
|
children: label
|
|
219
220
|
});
|
|
220
221
|
}
|
|
@@ -5,7 +5,7 @@ import { Text, View } from 'react-native';
|
|
|
5
5
|
import { getVariableByName } from '../../design-tokens/figma-variables-resolver';
|
|
6
6
|
import { useTokens } from '../../design-tokens/JFSThemeProvider';
|
|
7
7
|
import Icon from '../../icons/Icon';
|
|
8
|
-
import { EMPTY_MODES, cloneChildrenWithModes } from '../../utils/react-utils';
|
|
8
|
+
import { EMPTY_MODES, cloneChildrenWithModes, resolveTruncation } from '../../utils/react-utils';
|
|
9
9
|
import CircularProgressBar from '../CircularProgressBar/CircularProgressBar';
|
|
10
10
|
import Nudge from '../Nudge/Nudge';
|
|
11
11
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -120,6 +120,7 @@ function CardAdvisory({
|
|
|
120
120
|
progressStyle,
|
|
121
121
|
nudgeStyle,
|
|
122
122
|
accessibilityLabel,
|
|
123
|
+
disableTruncation,
|
|
123
124
|
...rest
|
|
124
125
|
}) {
|
|
125
126
|
const {
|
|
@@ -157,7 +158,7 @@ function CardAdvisory({
|
|
|
157
158
|
children: [/*#__PURE__*/_jsxs(View, {
|
|
158
159
|
style: tokens.headerStyle,
|
|
159
160
|
children: [/*#__PURE__*/_jsx(Text, {
|
|
160
|
-
|
|
161
|
+
...resolveTruncation(disableTruncation, 1),
|
|
161
162
|
style: [tokens.titleStyle, titleStyle],
|
|
162
163
|
children: title
|
|
163
164
|
}), processedTitleEndSlot || (showInfoIcon ? /*#__PURE__*/_jsx(Icon, {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import React, { useMemo } from 'react';
|
|
4
4
|
import { View, Text } from 'react-native';
|
|
5
5
|
import { getVariableByName } from '../../design-tokens/figma-variables-resolver';
|
|
6
|
-
import { EMPTY_MODES, cloneChildrenWithModes } from '../../utils/react-utils';
|
|
6
|
+
import { EMPTY_MODES, cloneChildrenWithModes, resolveTruncation } from '../../utils/react-utils';
|
|
7
7
|
import Badge from '../Badge/Badge';
|
|
8
8
|
import Button from '../Button/Button';
|
|
9
9
|
import InstitutionBadge from '../InstitutionBadge/InstitutionBadge';
|
|
@@ -66,7 +66,8 @@ function CardBankAccount({
|
|
|
66
66
|
footer,
|
|
67
67
|
modes: propModes = EMPTY_MODES,
|
|
68
68
|
style,
|
|
69
|
-
accessibilityLabel
|
|
69
|
+
accessibilityLabel,
|
|
70
|
+
disableTruncation
|
|
70
71
|
}) {
|
|
71
72
|
// Merge caller modes on top of `DEFAULT_MODES` so every default key
|
|
72
73
|
// (e.g. `Button / Size`, `AppearanceBrand`, `Emphasis`) can be overridden
|
|
@@ -183,7 +184,7 @@ function CardBankAccount({
|
|
|
183
184
|
})
|
|
184
185
|
}), typeof item.value === 'string' || typeof item.value === 'number' ? /*#__PURE__*/_jsx(Text, {
|
|
185
186
|
style: valueTextStyle,
|
|
186
|
-
|
|
187
|
+
...resolveTruncation(disableTruncation, 1),
|
|
187
188
|
children: item.value
|
|
188
189
|
}) : cloneChildrenWithModes(item.value, modes)]
|
|
189
190
|
}, `${item.label}-${index}`))
|