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 { StyleSheet, Text, View } from 'react-native';
|
|
|
5
5
|
import Svg, { Circle } 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, flattenChildren } from '../../utils/react-utils';
|
|
8
|
+
import { EMPTY_MODES, flattenChildren, resolveTruncation } from '../../utils/react-utils';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Per-segment data definition for the data-driven `segments` prop.
|
|
@@ -126,7 +126,8 @@ function DonutChart({
|
|
|
126
126
|
style,
|
|
127
127
|
valueStyle,
|
|
128
128
|
labelStyle,
|
|
129
|
-
accessibilityLabel
|
|
129
|
+
accessibilityLabel,
|
|
130
|
+
disableTruncation
|
|
130
131
|
}) {
|
|
131
132
|
const {
|
|
132
133
|
modes: globalModes
|
|
@@ -224,7 +225,7 @@ function DonutChart({
|
|
|
224
225
|
fontWeight: valueFontWeight,
|
|
225
226
|
textAlign: 'center'
|
|
226
227
|
}, valueStyle],
|
|
227
|
-
|
|
228
|
+
...resolveTruncation(disableTruncation, 1),
|
|
228
229
|
children: value
|
|
229
230
|
}) : null, showLabel ? /*#__PURE__*/_jsx(Text, {
|
|
230
231
|
style: [{
|
|
@@ -235,7 +236,7 @@ function DonutChart({
|
|
|
235
236
|
fontWeight: labelFontWeight,
|
|
236
237
|
textAlign: 'center'
|
|
237
238
|
}, labelStyle],
|
|
238
|
-
|
|
239
|
+
...resolveTruncation(disableTruncation, 1),
|
|
239
240
|
children: label
|
|
240
241
|
}) : null]
|
|
241
242
|
}) : null]
|
|
@@ -4,7 +4,7 @@ import React, { useCallback, useMemo, useState } from 'react';
|
|
|
4
4
|
import { Platform, Pressable, ScrollView, 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 Icon from '../../icons/Icon';
|
|
9
9
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
10
|
const IS_WEB = Platform.OS === 'web';
|
|
@@ -61,7 +61,8 @@ export function DropdownItem({
|
|
|
61
61
|
style,
|
|
62
62
|
labelStyle,
|
|
63
63
|
accessibilityLabel,
|
|
64
|
-
accessibilityHint
|
|
64
|
+
accessibilityHint,
|
|
65
|
+
disableTruncation
|
|
65
66
|
}) {
|
|
66
67
|
const {
|
|
67
68
|
modes: globalModes
|
|
@@ -130,7 +131,7 @@ export function DropdownItem({
|
|
|
130
131
|
...a11yProps,
|
|
131
132
|
children: [processedLeading, children != null ? children : /*#__PURE__*/_jsx(Text, {
|
|
132
133
|
style: [textStyle, labelStyle],
|
|
133
|
-
|
|
134
|
+
...resolveTruncation(disableTruncation, 1),
|
|
134
135
|
children: label
|
|
135
136
|
}), customTrailing, showDefaultCheck && /*#__PURE__*/_jsx(Icon, {
|
|
136
137
|
name: "ic_confirm",
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
3
|
+
import React, { forwardRef, useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
|
|
4
4
|
import { Dimensions, Modal, Platform, Pressable, StyleSheet, Text, View } from 'react-native';
|
|
5
5
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
6
6
|
import { getVariableByName } from '../../design-tokens/figma-variables-resolver';
|
|
7
7
|
import { useTokens } from '../../design-tokens/JFSThemeProvider';
|
|
8
|
-
import { EMPTY_MODES, flattenChildren } from '../../utils/react-utils';
|
|
8
|
+
import { EMPTY_MODES, flattenChildren, resolveTruncation } from '../../utils/react-utils';
|
|
9
9
|
import Icon from '../../icons/Icon';
|
|
10
10
|
import SupportText from '../SupportText/SupportText';
|
|
11
11
|
import Dropdown, { DropdownItem } from '../Dropdown/Dropdown';
|
|
@@ -16,6 +16,12 @@ const IS_WEB = Platform.OS === 'web';
|
|
|
16
16
|
// Types
|
|
17
17
|
// ---------------------------------------------------------------------------
|
|
18
18
|
|
|
19
|
+
/**
|
|
20
|
+
* Imperative handle exposed via `ref`. Lets the consumer drive the dropdown
|
|
21
|
+
* from outside — e.g. close it when an Android hardware/system button is
|
|
22
|
+
* pressed, or open it programmatically from a sibling control.
|
|
23
|
+
*/
|
|
24
|
+
|
|
19
25
|
// ---------------------------------------------------------------------------
|
|
20
26
|
// Token resolution
|
|
21
27
|
// ---------------------------------------------------------------------------
|
|
@@ -119,7 +125,7 @@ function collectOptionsFromChildren(children) {
|
|
|
119
125
|
// Component
|
|
120
126
|
// ---------------------------------------------------------------------------
|
|
121
127
|
|
|
122
|
-
function DropdownInput({
|
|
128
|
+
const DropdownInput = /*#__PURE__*/forwardRef(function DropdownInput({
|
|
123
129
|
label,
|
|
124
130
|
placeholder = 'Select an option',
|
|
125
131
|
items,
|
|
@@ -149,8 +155,9 @@ function DropdownInput({
|
|
|
149
155
|
accessibilityLabel,
|
|
150
156
|
accessibilityHint,
|
|
151
157
|
onFocus,
|
|
152
|
-
onBlur
|
|
153
|
-
|
|
158
|
+
onBlur,
|
|
159
|
+
disableTruncation
|
|
160
|
+
}, ref) {
|
|
154
161
|
// ---------------- Modes ----------------
|
|
155
162
|
const {
|
|
156
163
|
modes: globalModes
|
|
@@ -264,6 +271,32 @@ function DropdownInput({
|
|
|
264
271
|
measure();
|
|
265
272
|
}, [measure]);
|
|
266
273
|
|
|
274
|
+
// ---------------- Imperative handle ----------------
|
|
275
|
+
useImperativeHandle(ref, () => ({
|
|
276
|
+
open: () => {
|
|
277
|
+
if (isDisabled || isReadOnly) return;
|
|
278
|
+
measure();
|
|
279
|
+
setOpenState(true);
|
|
280
|
+
},
|
|
281
|
+
close: closeMenu,
|
|
282
|
+
toggle: () => {
|
|
283
|
+
if (isDisabled || isReadOnly) return;
|
|
284
|
+
measure();
|
|
285
|
+
toggleMenu();
|
|
286
|
+
},
|
|
287
|
+
focus: () => {
|
|
288
|
+
;
|
|
289
|
+
triggerRef.current?.focus?.();
|
|
290
|
+
},
|
|
291
|
+
blur: () => {
|
|
292
|
+
;
|
|
293
|
+
triggerRef.current?.blur?.();
|
|
294
|
+
},
|
|
295
|
+
measureInWindow: callback => {
|
|
296
|
+
triggerRef.current?.measureInWindow(callback);
|
|
297
|
+
}
|
|
298
|
+
}), [isDisabled, isReadOnly, measure, setOpenState, closeMenu, toggleMenu]);
|
|
299
|
+
|
|
267
300
|
// ---------------- Popup positioning ----------------
|
|
268
301
|
const [menuSize, setMenuSize] = useState(null);
|
|
269
302
|
const handleMenuLayout = useCallback(e => {
|
|
@@ -510,7 +543,7 @@ function DropdownInput({
|
|
|
510
543
|
style: [valueTextStyle, !hasValue && {
|
|
511
544
|
color: placeholderColor
|
|
512
545
|
}],
|
|
513
|
-
|
|
546
|
+
...resolveTruncation(disableTruncation, 1),
|
|
514
547
|
children: displayLabel
|
|
515
548
|
}), /*#__PURE__*/_jsx(View, {
|
|
516
549
|
accessibilityElementsHidden: true,
|
|
@@ -558,7 +591,7 @@ function DropdownInput({
|
|
|
558
591
|
})
|
|
559
592
|
})]
|
|
560
593
|
});
|
|
561
|
-
}
|
|
594
|
+
});
|
|
562
595
|
const webNoOutline = {
|
|
563
596
|
outlineStyle: 'none',
|
|
564
597
|
outlineWidth: 0,
|
|
@@ -58,6 +58,7 @@ function ExpandableCheckbox({
|
|
|
58
58
|
readMoreLabel = 'Read more',
|
|
59
59
|
readLessLabel = 'Read less',
|
|
60
60
|
collapsedLines = 1,
|
|
61
|
+
disableTruncation = false,
|
|
61
62
|
modes = EMPTY_MODES,
|
|
62
63
|
style,
|
|
63
64
|
labelStyle,
|
|
@@ -130,7 +131,7 @@ function ExpandableCheckbox({
|
|
|
130
131
|
}), [modes]);
|
|
131
132
|
const a11yLabel = accessibilityLabel ?? (typeof label === 'string' ? label : undefined);
|
|
132
133
|
const buttonLabel = isExpanded ? readLessLabel : readMoreLabel;
|
|
133
|
-
const labelNumberOfLinesProps = !isExpanded && collapsedLines > 0 ? {
|
|
134
|
+
const labelNumberOfLinesProps = !disableTruncation && !isExpanded && collapsedLines > 0 ? {
|
|
134
135
|
numberOfLines: collapsedLines,
|
|
135
136
|
ellipsizeMode: 'tail'
|
|
136
137
|
} : null;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import React, { useCallback, useMemo, useState } from 'react';
|
|
4
|
-
import { View, Text, TextInput as RNTextInput } from 'react-native';
|
|
3
|
+
import React, { forwardRef, useCallback, useMemo, useRef, useState } from 'react';
|
|
4
|
+
import { Platform, View, Text, TextInput as RNTextInput } 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, mergeRefs } from '../../utils/react-utils';
|
|
8
|
+
import { useWebOutsidePress } from '../../utils/web-platform-utils';
|
|
8
9
|
import SupportText from '../SupportText/SupportText';
|
|
9
10
|
import Icon from '../../icons/Icon';
|
|
10
11
|
import { useFormContext } from '../Form/Form';
|
|
@@ -156,7 +157,7 @@ function firstError(error) {
|
|
|
156
157
|
// Component
|
|
157
158
|
// ---------------------------------------------------------------------------
|
|
158
159
|
|
|
159
|
-
function FormField({
|
|
160
|
+
const FormField = /*#__PURE__*/forwardRef(function FormField({
|
|
160
161
|
label,
|
|
161
162
|
placeholder,
|
|
162
163
|
value,
|
|
@@ -184,7 +185,7 @@ function FormField({
|
|
|
184
185
|
accessibilityLabel,
|
|
185
186
|
accessibilityHint,
|
|
186
187
|
testID
|
|
187
|
-
}) {
|
|
188
|
+
}, ref) {
|
|
188
189
|
// -- Form context integration -------------------------------------------
|
|
189
190
|
const formCtx = useFormContext();
|
|
190
191
|
const formError = name && formCtx ? firstError(formCtx.validationErrors[name]) : undefined;
|
|
@@ -202,6 +203,21 @@ function FormField({
|
|
|
202
203
|
const [isFocused, setIsFocused] = useState(false);
|
|
203
204
|
const interactive = !isDisabled && !isReadOnly;
|
|
204
205
|
|
|
206
|
+
// Internal handles so we can (a) imperatively blur the input and (b) detect
|
|
207
|
+
// outside presses. The forwarded `ref` is merged in below, so the public
|
|
208
|
+
// ref API (focus/blur/clear/isFocused) is unchanged for consumers.
|
|
209
|
+
const inputRef = useRef(null);
|
|
210
|
+
const rootRef = useRef(null);
|
|
211
|
+
// Stable merged ref so React doesn't detach/reattach (and momentarily null
|
|
212
|
+
// `inputRef.current`) on every render.
|
|
213
|
+
const mergedInputRef = useMemo(() => mergeRefs(inputRef, ref), [ref]);
|
|
214
|
+
|
|
215
|
+
// Web: pressing an INTERACTIVE element outside the field (Button, link,
|
|
216
|
+
// another pressable) often does not move DOM focus, so the native `blur`
|
|
217
|
+
// never fires and the field stays visually "Active". Force a blur on any
|
|
218
|
+
// outside pointer press while focused. No-op on native.
|
|
219
|
+
useWebOutsidePress(rootRef, useCallback(() => inputRef.current?.blur(), []), isFocused);
|
|
220
|
+
|
|
205
221
|
// FormField States cascade — error > read only/disabled > active (focused) > idle.
|
|
206
222
|
// Disabled maps to "Read Only" since there is no dedicated disabled mode and
|
|
207
223
|
// the visual treatment is closest. This is only the DEFAULT — an explicit
|
|
@@ -284,7 +300,30 @@ function FormField({
|
|
|
284
300
|
color: tokens.inputTextColor,
|
|
285
301
|
fontFamily: tokens.inputFontFamily,
|
|
286
302
|
fontSize: tokens.inputFontSize,
|
|
287
|
-
lineHeight: tokens.inputLineHeight
|
|
303
|
+
// ⚠️ DO NOT change to an unconditional `lineHeight: tokens.inputLineHeight`.
|
|
304
|
+
// This has regressed twice — read this before "simplifying" it.
|
|
305
|
+
//
|
|
306
|
+
// `inputLineHeight` comes from the Figma token `formField/input/label`
|
|
307
|
+
// ("16/45"), which is a 16px font inside a 45px ROW, i.e. it is the row
|
|
308
|
+
// HEIGHT, not the text leading. The row height is already applied via
|
|
309
|
+
// `inputRowStyle.minHeight` + `alignItems: 'center'`, so the text never
|
|
310
|
+
// needs this value as its own `lineHeight`.
|
|
311
|
+
//
|
|
312
|
+
// Passing a `lineHeight` (45) that is much larger than `fontSize` (16)
|
|
313
|
+
// onto a single-line RNTextInput breaks ONLY iOS: iOS puts ALL the extra
|
|
314
|
+
// vertical space ABOVE the glyphs, so the text/placeholder sinks to the
|
|
315
|
+
// bottom of the box instead of centering. Android and Web distribute the
|
|
316
|
+
// space evenly and look correct. This is a long-standing iOS native
|
|
317
|
+
// font-metrics bug in UITextField — see facebook/react-native#39145 and
|
|
318
|
+
// #28012; the documented workaround is exactly "drop lineHeight on the
|
|
319
|
+
// single-line input and let a wrapper center it". A single-line UITextField
|
|
320
|
+
// with no lineHeight centers its text natively (see react-native#56774).
|
|
321
|
+
//
|
|
322
|
+
// So: omit lineHeight on iOS (native centering via the row), and keep the
|
|
323
|
+
// token value on Android/Web where it already renders correctly.
|
|
324
|
+
...(Platform.OS === 'ios' ? null : {
|
|
325
|
+
lineHeight: tokens.inputLineHeight
|
|
326
|
+
}),
|
|
288
327
|
fontWeight: tokens.inputFontWeight,
|
|
289
328
|
padding: 0,
|
|
290
329
|
margin: 0,
|
|
@@ -321,6 +360,7 @@ function FormField({
|
|
|
321
360
|
// -- Accessibility ------------------------------------------------------
|
|
322
361
|
const resolvedA11yLabel = accessibilityLabel || label || placeholder || 'Form field';
|
|
323
362
|
return /*#__PURE__*/_jsxs(View, {
|
|
363
|
+
ref: rootRef,
|
|
324
364
|
style: [wrapperStyle, style],
|
|
325
365
|
pointerEvents: isDisabled ? 'none' : 'auto',
|
|
326
366
|
testID: testID,
|
|
@@ -341,6 +381,7 @@ function FormField({
|
|
|
341
381
|
importantForAccessibility: "no",
|
|
342
382
|
children: processedLeading
|
|
343
383
|
}), /*#__PURE__*/_jsx(RNTextInput, {
|
|
384
|
+
ref: mergedInputRef,
|
|
344
385
|
style: [inputTextStyles, inputTextStyle],
|
|
345
386
|
value: value ?? '',
|
|
346
387
|
onChangeText: handleChangeText,
|
|
@@ -370,5 +411,5 @@ function FormField({
|
|
|
370
411
|
modes: modes
|
|
371
412
|
})]
|
|
372
413
|
});
|
|
373
|
-
}
|
|
414
|
+
});
|
|
374
415
|
export default FormField;
|
|
@@ -35,7 +35,7 @@ const toFontWeight = (value, fallback) => {
|
|
|
35
35
|
};
|
|
36
36
|
const getStrokeColor = (style, fallback) => {
|
|
37
37
|
const flattened = StyleSheet.flatten(style);
|
|
38
|
-
return typeof flattened.backgroundColor === 'string' ? flattened.backgroundColor : fallback;
|
|
38
|
+
return flattened && typeof flattened.backgroundColor === 'string' ? flattened.backgroundColor : fallback;
|
|
39
39
|
};
|
|
40
40
|
function Gauge({
|
|
41
41
|
value = 84,
|
|
@@ -4,7 +4,7 @@ import React from 'react';
|
|
|
4
4
|
import { View, Text, Pressable, Image } from 'react-native';
|
|
5
5
|
import { getVariableByName } from '../../design-tokens/figma-variables-resolver';
|
|
6
6
|
import Radio from '../Radio/Radio';
|
|
7
|
-
import { EMPTY_MODES } from '../../utils/react-utils';
|
|
7
|
+
import { EMPTY_MODES, resolveTruncation } from '../../utils/react-utils';
|
|
8
8
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
9
|
const GRID_COLUMNS = 3;
|
|
10
10
|
const GRID_COLUMN_GAP = 12;
|
|
@@ -34,7 +34,8 @@ export default function HoldingsCard({
|
|
|
34
34
|
onPress,
|
|
35
35
|
modes = EMPTY_MODES,
|
|
36
36
|
style,
|
|
37
|
-
testID
|
|
37
|
+
testID,
|
|
38
|
+
disableTruncation
|
|
38
39
|
}) {
|
|
39
40
|
// ---- Container tokens ----
|
|
40
41
|
const containerFill = getVariableByName('holdingsCard/container/fill', modes) || '#fef4e5';
|
|
@@ -186,7 +187,7 @@ export default function HoldingsCard({
|
|
|
186
187
|
lineHeight: detailValueLineHeight,
|
|
187
188
|
fontWeight: detailValueFontWeight
|
|
188
189
|
},
|
|
189
|
-
|
|
190
|
+
...resolveTruncation(disableTruncation, 1),
|
|
190
191
|
children: item.value
|
|
191
192
|
})]
|
|
192
193
|
}, `${rowIndex}-${colIndex}`)), row.length < GRID_COLUMNS && Array.from({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import React, { useState } from 'react';
|
|
3
|
+
import React, { forwardRef, useState } from 'react';
|
|
4
4
|
import { View, Text, Pressable } from 'react-native';
|
|
5
5
|
import { getVariableByName } from '../../design-tokens/figma-variables-resolver';
|
|
6
6
|
import { EMPTY_MODES } from '../../utils/react-utils';
|
|
@@ -48,7 +48,7 @@ function SupportText({
|
|
|
48
48
|
})]
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
|
-
|
|
51
|
+
const InputSearch = /*#__PURE__*/forwardRef(function InputSearch({
|
|
52
52
|
supportText = true,
|
|
53
53
|
supportTextLabel = "Support Text",
|
|
54
54
|
supportTextIcon = "ic_info",
|
|
@@ -63,7 +63,7 @@ export default function InputSearch({
|
|
|
63
63
|
trailing,
|
|
64
64
|
inputStyle,
|
|
65
65
|
...rest
|
|
66
|
-
}) {
|
|
66
|
+
}, ref) {
|
|
67
67
|
const [isFocused, setIsFocused] = useState(false);
|
|
68
68
|
|
|
69
69
|
// Hardcode InputState based on the state prop, ignoring any external InputState passed in modes
|
|
@@ -118,6 +118,7 @@ export default function InputSearch({
|
|
|
118
118
|
gap: formFieldGap
|
|
119
119
|
}, containerStyle],
|
|
120
120
|
children: [/*#__PURE__*/_jsx(TextInput, {
|
|
121
|
+
ref: ref,
|
|
121
122
|
placeholder: placeholder,
|
|
122
123
|
value: value || '',
|
|
123
124
|
onChangeText: onChangeText || (() => {}),
|
|
@@ -137,4 +138,5 @@ export default function InputSearch({
|
|
|
137
138
|
modes: componentModes
|
|
138
139
|
})]
|
|
139
140
|
});
|
|
140
|
-
}
|
|
141
|
+
});
|
|
142
|
+
export default InputSearch;
|
|
@@ -4,7 +4,7 @@ import React, { useMemo } from 'react';
|
|
|
4
4
|
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
|
-
import { EMPTY_MODES, cloneChildrenWithModes } from '../../utils/react-utils';
|
|
7
|
+
import { EMPTY_MODES, cloneChildrenWithModes, resolveTruncation } from '../../utils/react-utils';
|
|
8
8
|
import MediaSource from '../../utils/MediaSource';
|
|
9
9
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
10
|
// Default avatar asset (shared with the Avatar component) so that
|
|
@@ -82,6 +82,7 @@ function InstitutionBadge({
|
|
|
82
82
|
style,
|
|
83
83
|
labelStyle,
|
|
84
84
|
accessibilityLabel,
|
|
85
|
+
disableTruncation,
|
|
85
86
|
...rest
|
|
86
87
|
}) {
|
|
87
88
|
const {
|
|
@@ -118,7 +119,7 @@ function InstitutionBadge({
|
|
|
118
119
|
})
|
|
119
120
|
}), /*#__PURE__*/_jsx(Text, {
|
|
120
121
|
style: [tokens.labelStyle, labelStyle],
|
|
121
|
-
|
|
122
|
+
...resolveTruncation(disableTruncation, 1),
|
|
122
123
|
children: label
|
|
123
124
|
})]
|
|
124
125
|
});
|
|
@@ -8,7 +8,7 @@ import { getVariableByName } from '../../design-tokens/figma-variables-resolver'
|
|
|
8
8
|
* Helper function to recursively clone children and pass modes prop to components that accept it.
|
|
9
9
|
* This ensures that all child components in slots receive the modes prop from the parent.
|
|
10
10
|
*/
|
|
11
|
-
import { EMPTY_MODES, cloneChildrenWithModes, flattenChildren } from '../../utils/react-utils';
|
|
11
|
+
import { EMPTY_MODES, cloneChildrenWithModes, flattenChildren, resolveTruncation } from '../../utils/react-utils';
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
/**
|
|
14
14
|
* ListGroup component that mirrors the Figma "List Group" component.
|
|
@@ -43,6 +43,7 @@ function ListGroup({
|
|
|
43
43
|
style,
|
|
44
44
|
accessibilityLabel,
|
|
45
45
|
accessibilityHint,
|
|
46
|
+
disableTruncation,
|
|
46
47
|
...rest
|
|
47
48
|
}) {
|
|
48
49
|
// Resolve container tokens
|
|
@@ -95,7 +96,7 @@ function ListGroup({
|
|
|
95
96
|
style: [labelStyle, processedSlot && {
|
|
96
97
|
marginBottom: gap
|
|
97
98
|
}],
|
|
98
|
-
|
|
99
|
+
...resolveTruncation(disableTruncation, 1),
|
|
99
100
|
accessibilityElementsHidden: true,
|
|
100
101
|
importantForAccessibility: "no",
|
|
101
102
|
children: label
|
|
@@ -5,7 +5,7 @@ import { View, Text, Pressable, Platform } from 'react-native';
|
|
|
5
5
|
import { getVariableByName } from '../../design-tokens/figma-variables-resolver';
|
|
6
6
|
import NavArrow from '../NavArrow/NavArrow';
|
|
7
7
|
import { usePressableWebSupport } from '../../utils/web-platform-utils';
|
|
8
|
-
import { EMPTY_MODES, cloneChildrenWithModes } from '../../utils/react-utils';
|
|
8
|
+
import { EMPTY_MODES, cloneChildrenWithModes, resolveTruncation } from '../../utils/react-utils';
|
|
9
9
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
10
|
// ---------------------------------------------------------------------------
|
|
11
11
|
// Module-scope constants — never re-allocated per render.
|
|
@@ -185,6 +185,7 @@ function ListItemImpl({
|
|
|
185
185
|
accessibilityHint,
|
|
186
186
|
accessibilityState,
|
|
187
187
|
webAccessibilityProps,
|
|
188
|
+
disableTruncation,
|
|
188
189
|
...rest
|
|
189
190
|
}) {
|
|
190
191
|
const tokens = useMemo(() => resolveListItemTokens(modes), [modes]);
|
|
@@ -239,7 +240,7 @@ function ListItemImpl({
|
|
|
239
240
|
const displayText = layout === 'Vertical' ? supportText.replace(/ /g, '\n') : supportText;
|
|
240
241
|
return /*#__PURE__*/_jsx(Text, {
|
|
241
242
|
style: layout === 'Vertical' ? [tokens.supportTextStyle, verticalSupportTextOverride] : tokens.supportTextStyle,
|
|
242
|
-
|
|
243
|
+
...resolveTruncation(disableTruncation, layout === 'Horizontal' ? 2 : undefined),
|
|
243
244
|
children: displayText
|
|
244
245
|
});
|
|
245
246
|
};
|
|
@@ -272,7 +273,7 @@ function ListItemImpl({
|
|
|
272
273
|
},
|
|
273
274
|
children: [/*#__PURE__*/_jsx(Text, {
|
|
274
275
|
style: tokens.titleTextStyle,
|
|
275
|
-
|
|
276
|
+
...resolveTruncation(disableTruncation, 1),
|
|
276
277
|
children: title
|
|
277
278
|
}), showSupportText && renderSupportContent()]
|
|
278
279
|
}), processedTrailing ? /*#__PURE__*/_jsx(View, {
|
|
@@ -4,7 +4,7 @@ import React, { createContext, useContext } from 'react';
|
|
|
4
4
|
import { View, Text, StyleSheet } from 'react-native';
|
|
5
5
|
import { getVariableByName } from '../../design-tokens/figma-variables-resolver';
|
|
6
6
|
import Image from '../Image/Image';
|
|
7
|
-
import GlassFill from '
|
|
7
|
+
import GlassFill from '../../utils/GlassFill/GlassFill';
|
|
8
8
|
import { EMPTY_MODES } from '../../utils/react-utils';
|
|
9
9
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
10
|
const MediaCardContext = /*#__PURE__*/createContext({});
|
|
@@ -186,7 +186,9 @@ export function Footer({
|
|
|
186
186
|
children: [/*#__PURE__*/_jsx(GlassFill, {
|
|
187
187
|
tint: tint,
|
|
188
188
|
intensity: intensity,
|
|
189
|
-
overlayColor: glassBgColor
|
|
189
|
+
overlayColor: glassBgColor,
|
|
190
|
+
webBlurScale: 0.3,
|
|
191
|
+
webBlurMaxPx: 30
|
|
190
192
|
}), /*#__PURE__*/_jsx(View, {
|
|
191
193
|
style: {
|
|
192
194
|
flexDirection: 'row',
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { View, Text } 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 { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
8
|
/**
|
|
9
9
|
* MetricLegendItem renders a horizontal row consisting of a small colored
|
|
@@ -22,7 +22,8 @@ function MetricLegendItem({
|
|
|
22
22
|
style,
|
|
23
23
|
indicatorStyle,
|
|
24
24
|
labelStyle,
|
|
25
|
-
valueStyle
|
|
25
|
+
valueStyle,
|
|
26
|
+
disableTruncation
|
|
26
27
|
}) {
|
|
27
28
|
const gap = getVariableByName('metricLegendItem/gap', modes) ?? 4;
|
|
28
29
|
const textWrapGap = getVariableByName('metricLegendItem/textWrap/gap', modes) ?? 4;
|
|
@@ -87,7 +88,7 @@ function MetricLegendItem({
|
|
|
87
88
|
lineHeight: valueLineHeight,
|
|
88
89
|
fontWeight: valueFontWeight
|
|
89
90
|
}, valueStyle],
|
|
90
|
-
|
|
91
|
+
...resolveTruncation(disableTruncation, 1),
|
|
91
92
|
children: value
|
|
92
93
|
})]
|
|
93
94
|
})]
|
|
@@ -4,7 +4,7 @@ import React from 'react';
|
|
|
4
4
|
import { View, Text } 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 } from '../../utils/react-utils';
|
|
7
|
+
import { EMPTY_MODES, resolveTruncation } from '../../utils/react-utils';
|
|
8
8
|
import MetricLegendItem from '../MetricLegendItem/MetricLegendItem';
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -75,7 +75,8 @@ function CalendarGlyph({
|
|
|
75
75
|
modes: propModes = EMPTY_MODES,
|
|
76
76
|
style,
|
|
77
77
|
labelStyle,
|
|
78
|
-
accessibilityLabel
|
|
78
|
+
accessibilityLabel,
|
|
79
|
+
disableTruncation
|
|
79
80
|
}) {
|
|
80
81
|
const {
|
|
81
82
|
modes: globalModes
|
|
@@ -120,7 +121,7 @@ function CalendarGlyph({
|
|
|
120
121
|
gap
|
|
121
122
|
}, style],
|
|
122
123
|
children: /*#__PURE__*/_jsx(Text, {
|
|
123
|
-
|
|
124
|
+
...resolveTruncation(disableTruncation, 1),
|
|
124
125
|
style: [{
|
|
125
126
|
color: foreground,
|
|
126
127
|
fontFamily,
|
|
@@ -182,7 +183,8 @@ function MonthlyStatusGrid({
|
|
|
182
183
|
glyphStyle,
|
|
183
184
|
labelStyle,
|
|
184
185
|
legendStyle,
|
|
185
|
-
accessibilityLabel
|
|
186
|
+
accessibilityLabel,
|
|
187
|
+
disableTruncation
|
|
186
188
|
}) {
|
|
187
189
|
const {
|
|
188
190
|
modes: globalModes
|
|
@@ -239,6 +241,7 @@ function MonthlyStatusGrid({
|
|
|
239
241
|
label: label,
|
|
240
242
|
status: month.status,
|
|
241
243
|
modes: glyphModes,
|
|
244
|
+
disableTruncation: disableTruncation,
|
|
242
245
|
...(glyphStyle !== undefined ? {
|
|
243
246
|
style: glyphStyle
|
|
244
247
|
} : {}),
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import React, { useState, useRef } from 'react';
|
|
3
|
+
import React, { forwardRef, useState, useRef } from 'react';
|
|
4
4
|
import { View, TextInput as RNTextInput, 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, mergeRefs } from '../../utils/react-utils';
|
|
7
7
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
8
|
/**
|
|
9
9
|
* NoteInput component representing an interactive "Add note" badge style field.
|
|
10
10
|
* Allows the user to click, clears the placeholder text, and shows a blinking cursor when focused.
|
|
11
11
|
*/
|
|
12
|
-
|
|
12
|
+
const NoteInput = /*#__PURE__*/forwardRef(function NoteInput({
|
|
13
13
|
value = '',
|
|
14
14
|
placeholder = 'Add note',
|
|
15
15
|
onChangeText,
|
|
@@ -20,7 +20,7 @@ export default function NoteInput({
|
|
|
20
20
|
onFocus,
|
|
21
21
|
onBlur,
|
|
22
22
|
...rest
|
|
23
|
-
}) {
|
|
23
|
+
}, ref) {
|
|
24
24
|
const [internalFocused, setInternalFocused] = useState(false);
|
|
25
25
|
const inputRef = useRef(null);
|
|
26
26
|
|
|
@@ -92,7 +92,7 @@ export default function NoteInput({
|
|
|
92
92
|
importantForAccessibility: "no",
|
|
93
93
|
children: internalFocused ? value || ' ' : value || placeholder
|
|
94
94
|
}), /*#__PURE__*/_jsx(RNTextInput, {
|
|
95
|
-
ref: inputRef,
|
|
95
|
+
ref: mergeRefs(inputRef, ref),
|
|
96
96
|
value: value,
|
|
97
97
|
onChangeText: onChangeText,
|
|
98
98
|
placeholder: internalFocused ? '' : placeholder,
|
|
@@ -112,4 +112,5 @@ export default function NoteInput({
|
|
|
112
112
|
})]
|
|
113
113
|
})
|
|
114
114
|
});
|
|
115
|
-
}
|
|
115
|
+
});
|
|
116
|
+
export default NoteInput;
|