jfs-components 0.1.0 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +37 -0
- package/lib/commonjs/components/AmountInput/AmountInput.js +8 -5
- package/lib/commonjs/components/AreaLineChart/AreaLineChart.js +1 -1
- package/lib/commonjs/components/Balance/Balance.js +17 -12
- package/lib/commonjs/components/BenefitCard/BenefitCard.js +231 -0
- package/lib/commonjs/components/Card/Card.js +2 -1
- package/lib/commonjs/components/CardFeedback/CardFeedback.js +2 -1
- package/lib/commonjs/components/CcCard/CcCard.js +470 -0
- package/lib/commonjs/components/Checkbox/Checkbox.js +6 -4
- package/lib/commonjs/components/CheckboxItem/CheckboxItem.js +4 -3
- package/lib/commonjs/components/CompareTable/CompareTable.js +372 -0
- package/lib/commonjs/components/ComparisonBar/ComparisonBar.js +266 -0
- package/lib/commonjs/components/Drawer/Drawer.js +13 -4
- package/lib/commonjs/components/DropdownInput/DropdownInput.js +36 -4
- package/lib/commonjs/components/FormField/FormField.js +4 -3
- package/lib/commonjs/components/FullscreenModal/FullscreenModal.js +62 -2
- package/lib/commonjs/components/Image/Image.js +11 -5
- package/lib/commonjs/components/InputSearch/InputSearch.js +6 -4
- package/lib/commonjs/components/LottiePlayer/loadNativeLottieView.js +8 -13
- package/lib/commonjs/components/NoteInput/NoteInput.js +6 -5
- package/lib/commonjs/components/Overlay/Overlay.js +92 -0
- package/lib/commonjs/components/PdpCcCard/PdpCcCard.js +273 -0
- package/lib/commonjs/components/PlanComparisonCard/PlanComparisonCard.js +2 -1
- package/lib/commonjs/components/ProductMerchandisingCard/GlassFill.js +263 -0
- package/lib/commonjs/components/ProductMerchandisingCard/GlassFill.web.js +116 -0
- package/lib/commonjs/components/ProductMerchandisingCard/ProductMerchandisingCard.js +353 -0
- package/lib/commonjs/components/ProjectionMarker/ProjectionMarker.js +161 -0
- package/lib/commonjs/components/Radio/Radio.js +5 -5
- package/lib/commonjs/components/Slider/Slider.js +473 -0
- package/lib/commonjs/components/TextInput/TextInput.js +15 -9
- package/lib/commonjs/components/TextSegment/TextSegment.js +118 -0
- package/lib/commonjs/components/docs/modeControls.js +116 -0
- package/lib/commonjs/components/index.js +70 -0
- package/lib/commonjs/design-tokens/Coin Variables-variables-full.json +1 -1
- package/lib/commonjs/design-tokens/JFSThemeProvider.js +1 -1
- package/lib/commonjs/design-tokens/figma-modes.generated.js +420 -0
- package/lib/commonjs/design-tokens/index.js +11 -0
- package/lib/commonjs/icons/registry.js +1 -1
- package/lib/commonjs/utils/react-utils.js +22 -0
- package/lib/module/components/Accordion/Accordion.js +1 -2
- package/lib/module/components/AmountInput/AmountInput.js +6 -4
- package/lib/module/components/AreaLineChart/AreaLineChart.js +1 -1
- package/lib/module/components/Balance/Balance.js +18 -13
- package/lib/module/components/BenefitCard/BenefitCard.js +225 -0
- package/lib/module/components/Card/Card.js +1 -2
- package/lib/module/components/CardFeedback/CardFeedback.js +1 -2
- package/lib/module/components/CcCard/CcCard.js +464 -0
- package/lib/module/components/Checkbox/Checkbox.js +6 -6
- package/lib/module/components/CheckboxItem/CheckboxItem.js +5 -4
- package/lib/module/components/CompareTable/CompareTable.js +367 -0
- package/lib/module/components/ComparisonBar/ComparisonBar.js +260 -0
- package/lib/module/components/Drawer/Drawer.js +12 -4
- package/lib/module/components/DropdownInput/DropdownInput.js +37 -5
- package/lib/module/components/FormField/FormField.js +5 -4
- package/lib/module/components/FullscreenModal/FullscreenModal.js +64 -5
- package/lib/module/components/Image/Image.js +11 -5
- package/lib/module/components/InputSearch/InputSearch.js +6 -4
- package/lib/module/components/InstitutionBadge/InstitutionBadge.js +1 -2
- package/lib/module/components/LottiePlayer/loadNativeLottieView.js +8 -13
- package/lib/module/components/MoneyValue/MoneyValue.js +1 -2
- package/lib/module/components/NoteInput/NoteInput.js +7 -6
- package/lib/module/components/OTP/OTP.js +1 -2
- package/lib/module/components/Overlay/Overlay.js +87 -0
- package/lib/module/components/PdpCcCard/PdpCcCard.js +267 -0
- package/lib/module/components/PlanComparisonCard/PlanComparisonCard.js +1 -2
- package/lib/module/components/PoweredByLabel/PoweredByLabel.js +1 -2
- package/lib/module/components/ProductMerchandisingCard/GlassFill.js +257 -0
- package/lib/module/components/ProductMerchandisingCard/GlassFill.web.js +111 -0
- package/lib/module/components/ProductMerchandisingCard/ProductMerchandisingCard.js +347 -0
- package/lib/module/components/ProjectionMarker/ProjectionMarker.js +156 -0
- package/lib/module/components/Radio/Radio.js +5 -4
- package/lib/module/components/RechargeCard/RechargeCard.js +1 -2
- package/lib/module/components/Section/Section.js +1 -2
- package/lib/module/components/Slider/Slider.js +468 -0
- package/lib/module/components/TextInput/TextInput.js +16 -12
- package/lib/module/components/TextSegment/TextSegment.js +113 -0
- package/lib/module/components/UpiHandle/UpiHandle.js +1 -2
- package/lib/module/components/docs/modeControls.js +111 -0
- package/lib/module/components/index.js +10 -0
- package/lib/module/design-tokens/Coin Variables-variables-full.json +1 -1
- package/lib/module/design-tokens/JFSThemeProvider.js +1 -1
- package/lib/module/design-tokens/figma-modes.generated.js +416 -0
- package/lib/module/design-tokens/index.js +2 -1
- package/lib/module/icons/registry.js +1 -1
- package/lib/module/utils/react-utils.js +21 -1
- package/lib/typescript/src/components/Accordion/Accordion.d.ts +2 -1
- package/lib/typescript/src/components/AccordionCheckbox/AccordionCheckbox.d.ts +2 -1
- package/lib/typescript/src/components/AccountCard/AccountCard.d.ts +2 -1
- package/lib/typescript/src/components/ActionFooter/ActionFooter.d.ts +2 -1
- package/lib/typescript/src/components/ActionTile/ActionTile.d.ts +2 -1
- package/lib/typescript/src/components/AllocationComparisonChart/AllocationComparisonChart.d.ts +2 -1
- package/lib/typescript/src/components/AmountInput/AmountInput.d.ts +5 -3
- package/lib/typescript/src/components/AppBar/AppBar.d.ts +2 -1
- package/lib/typescript/src/components/AreaLineChart/AreaLineChart.d.ts +3 -2
- package/lib/typescript/src/components/Attached/Attached.d.ts +2 -1
- package/lib/typescript/src/components/Avatar/Avatar.d.ts +2 -1
- package/lib/typescript/src/components/AvatarGroup/AvatarGroup.d.ts +2 -1
- package/lib/typescript/src/components/Badge/Badge.d.ts +2 -1
- package/lib/typescript/src/components/Balance/Balance.d.ts +2 -1
- package/lib/typescript/src/components/BenefitCard/BenefitCard.d.ts +93 -0
- package/lib/typescript/src/components/BottomNav/BottomNav.d.ts +2 -1
- package/lib/typescript/src/components/BottomNavItem/BottomNavItem.d.ts +2 -1
- package/lib/typescript/src/components/BrandChip/BrandChip.d.ts +2 -1
- package/lib/typescript/src/components/BubbleChart/BubbleChart.d.ts +2 -1
- package/lib/typescript/src/components/Button/Button.d.ts +2 -1
- package/lib/typescript/src/components/ButtonGroup/ButtonGroup.d.ts +2 -1
- package/lib/typescript/src/components/Card/Card.d.ts +3 -2
- package/lib/typescript/src/components/CardAdvisory/CardAdvisory.d.ts +2 -1
- package/lib/typescript/src/components/CardBankAccount/CardBankAccount.d.ts +2 -1
- package/lib/typescript/src/components/CardCTA/CardCTA.d.ts +2 -1
- package/lib/typescript/src/components/CardFeedback/CardFeedback.d.ts +7 -6
- package/lib/typescript/src/components/CardFinancialCondition/CardFinancialCondition.d.ts +2 -1
- package/lib/typescript/src/components/CardInsight/CardInsight.d.ts +2 -1
- package/lib/typescript/src/components/CardProviderInfo/CardProviderInfo.d.ts +2 -1
- package/lib/typescript/src/components/Carousel/Carousel.d.ts +4 -3
- package/lib/typescript/src/components/CcCard/CcCard.d.ts +137 -0
- package/lib/typescript/src/components/Checkbox/Checkbox.d.ts +5 -3
- package/lib/typescript/src/components/CheckboxGroup/CheckboxGroup.d.ts +2 -1
- package/lib/typescript/src/components/CheckboxItem/CheckboxItem.d.ts +4 -3
- package/lib/typescript/src/components/ChipGroup/ChipGroup.d.ts +2 -1
- package/lib/typescript/src/components/ChipSelect/ChipSelect.d.ts +2 -1
- package/lib/typescript/src/components/CircularProgressBar/CircularProgressBar.d.ts +2 -1
- package/lib/typescript/src/components/CircularProgressBarDoted/CircularProgressBarDoted.d.ts +2 -1
- package/lib/typescript/src/components/CircularRating/CircularRating.d.ts +2 -1
- package/lib/typescript/src/components/ClusterBubble/ClusterBubble.d.ts +2 -1
- package/lib/typescript/src/components/CompareTable/CompareTable.d.ts +88 -0
- package/lib/typescript/src/components/ComparisonBar/ComparisonBar.d.ts +118 -0
- package/lib/typescript/src/components/CoverageBarComparison/CoverageBarComparison.d.ts +3 -2
- package/lib/typescript/src/components/CoverageRing/CoverageRing.d.ts +2 -1
- package/lib/typescript/src/components/DebitCard/DebitCard.d.ts +2 -1
- package/lib/typescript/src/components/Disclaimer/Disclaimer.d.ts +2 -1
- package/lib/typescript/src/components/Divider/Divider.d.ts +2 -1
- package/lib/typescript/src/components/DonutChart/DonutChart.d.ts +4 -3
- package/lib/typescript/src/components/DonutChartSummary/DonutChartSummary.d.ts +3 -2
- package/lib/typescript/src/components/Drawer/Drawer.d.ts +15 -1
- package/lib/typescript/src/components/Dropdown/Dropdown.d.ts +3 -2
- package/lib/typescript/src/components/DropdownInput/DropdownInput.d.ts +22 -2
- package/lib/typescript/src/components/EmptyState/EmptyState.d.ts +2 -1
- package/lib/typescript/src/components/ExpandableCheckbox/ExpandableCheckbox.d.ts +2 -1
- package/lib/typescript/src/components/FilterBar/FilterBar.d.ts +3 -2
- package/lib/typescript/src/components/Form/Form.d.ts +2 -1
- package/lib/typescript/src/components/FormField/FormField.d.ts +4 -3
- package/lib/typescript/src/components/FullscreenModal/FullscreenModal.d.ts +2 -1
- package/lib/typescript/src/components/Gauge/Gauge.d.ts +2 -1
- package/lib/typescript/src/components/HStack/HStack.d.ts +2 -1
- package/lib/typescript/src/components/HoldingsCard/HoldingsCard.d.ts +2 -1
- package/lib/typescript/src/components/Icon/Icon.d.ts +2 -1
- package/lib/typescript/src/components/IconButton/IconButton.d.ts +2 -1
- package/lib/typescript/src/components/IconCapsule/IconCapsule.d.ts +2 -1
- package/lib/typescript/src/components/Image/Image.d.ts +17 -1
- package/lib/typescript/src/components/InputSearch/InputSearch.d.ts +25 -3
- package/lib/typescript/src/components/InstitutionBadge/InstitutionBadge.d.ts +2 -1
- package/lib/typescript/src/components/LazyList/LazyList.d.ts +2 -1
- package/lib/typescript/src/components/LinearMeter/LinearMeter.d.ts +3 -2
- package/lib/typescript/src/components/LinearProgress/LinearProgress.d.ts +2 -1
- package/lib/typescript/src/components/ListGroup/ListGroup.d.ts +2 -1
- package/lib/typescript/src/components/ListItem/ListItem.d.ts +2 -1
- package/lib/typescript/src/components/LottieIntroBlock/LottieIntroBlock.d.ts +2 -1
- package/lib/typescript/src/components/LottiePlayer/LottiePlayer.d.ts +2 -1
- package/lib/typescript/src/components/LottiePlayer/LottiePlayer.web.d.ts +2 -1
- package/lib/typescript/src/components/MediaCard/MediaCard.d.ts +6 -5
- package/lib/typescript/src/components/MerchantProfile/MerchantProfile.d.ts +2 -1
- package/lib/typescript/src/components/MessageField/MessageField.d.ts +2 -1
- package/lib/typescript/src/components/MetricLegendItem/MetricLegendItem.d.ts +2 -1
- package/lib/typescript/src/components/MoneyValue/MoneyValue.d.ts +2 -1
- package/lib/typescript/src/components/MonthlyStatusGrid/MonthlyStatusGrid.d.ts +4 -3
- package/lib/typescript/src/components/NavArrow/NavArrow.d.ts +2 -1
- package/lib/typescript/src/components/NoteInput/NoteInput.d.ts +21 -3
- package/lib/typescript/src/components/Nudge/Nudge.d.ts +2 -1
- package/lib/typescript/src/components/Numpad/Numpad.d.ts +2 -1
- package/lib/typescript/src/components/OTP/OTP.d.ts +3 -2
- package/lib/typescript/src/components/Overlay/Overlay.d.ts +52 -0
- package/lib/typescript/src/components/PageHero/PageHero.d.ts +2 -1
- package/lib/typescript/src/components/PaymentFeedback/PaymentFeedback.d.ts +2 -1
- package/lib/typescript/src/components/PdpCcCard/PdpCcCard.d.ts +84 -0
- package/lib/typescript/src/components/PlanComparisonCard/PlanComparisonCard.d.ts +2 -1
- package/lib/typescript/src/components/Popup/Popup.d.ts +2 -1
- package/lib/typescript/src/components/PortfolioHero/PortfolioHero.d.ts +2 -1
- package/lib/typescript/src/components/PoweredByLabel/PoweredByLabel.d.ts +2 -1
- package/lib/typescript/src/components/ProductLabel/ProductLabel.d.ts +2 -1
- package/lib/typescript/src/components/ProductMerchandisingCard/GlassFill.d.ts +56 -0
- package/lib/typescript/src/components/ProductMerchandisingCard/GlassFill.web.d.ts +27 -0
- package/lib/typescript/src/components/ProductMerchandisingCard/ProductMerchandisingCard.d.ts +81 -0
- package/lib/typescript/src/components/ProductOverview/ProductOverview.d.ts +2 -1
- package/lib/typescript/src/components/ProgressBadge/ProgressBadge.d.ts +2 -1
- package/lib/typescript/src/components/ProjectionMarker/ProjectionMarker.d.ts +82 -0
- package/lib/typescript/src/components/Radio/Radio.d.ts +5 -3
- package/lib/typescript/src/components/RadioButton/RadioButton.d.ts +2 -2
- package/lib/typescript/src/components/RangeTrack/RangeTrack.d.ts +3 -2
- package/lib/typescript/src/components/RechargeCard/RechargeCard.d.ts +2 -1
- package/lib/typescript/src/components/SavingsGoalSummary/SavingsGoalSummary.d.ts +2 -1
- package/lib/typescript/src/components/Screen/Screen.d.ts +2 -1
- package/lib/typescript/src/components/Section/Section.d.ts +3 -2
- package/lib/typescript/src/components/SegmentedControl/SegmentedControl.d.ts +2 -1
- package/lib/typescript/src/components/SegmentedTrack/SegmentedTrack.d.ts +4 -3
- package/lib/typescript/src/components/Slider/Slider.d.ts +99 -0
- package/lib/typescript/src/components/Slot/Slot.d.ts +2 -1
- package/lib/typescript/src/components/Spinner/Spinner.d.ts +2 -1
- package/lib/typescript/src/components/StatGroup/StatGroup.d.ts +2 -1
- package/lib/typescript/src/components/StatItem/StatItem.d.ts +2 -1
- package/lib/typescript/src/components/StatusHero/StatusHero.d.ts +2 -1
- package/lib/typescript/src/components/Stepper/Step.d.ts +2 -1
- package/lib/typescript/src/components/Stepper/StepLabel.d.ts +2 -1
- package/lib/typescript/src/components/Stepper/Stepper.d.ts +2 -1
- package/lib/typescript/src/components/StrengthIndicator/StrengthIndicator.d.ts +2 -1
- package/lib/typescript/src/components/SuggestiveSearch/SuggestiveSearch.d.ts +2 -1
- package/lib/typescript/src/components/SummaryTile/SummaryTile.d.ts +2 -1
- package/lib/typescript/src/components/SupportText/SupportText.d.ts +2 -1
- package/lib/typescript/src/components/SupportText/SupportTextIcon.d.ts +2 -1
- package/lib/typescript/src/components/SwappableAmount/SwappableAmount.d.ts +2 -1
- package/lib/typescript/src/components/Tabs/TabItem.d.ts +2 -1
- package/lib/typescript/src/components/Tabs/Tabs.d.ts +2 -1
- package/lib/typescript/src/components/TestimonialsCard/TestimonialsCard.d.ts +2 -1
- package/lib/typescript/src/components/Text/Text.d.ts +2 -1
- package/lib/typescript/src/components/TextInput/TextInput.d.ts +12 -31
- package/lib/typescript/src/components/TextSegment/TextSegment.d.ts +100 -0
- package/lib/typescript/src/components/ThreadHero/ThreadHero.d.ts +2 -1
- package/lib/typescript/src/components/Title/Title.d.ts +2 -1
- package/lib/typescript/src/components/Toast/Toast.d.ts +2 -1
- package/lib/typescript/src/components/Toast/ToastProvider.d.ts +2 -1
- package/lib/typescript/src/components/Toast/useToast.d.ts +3 -2
- package/lib/typescript/src/components/Toggle/Toggle.d.ts +2 -1
- package/lib/typescript/src/components/Tooltip/Tooltip.d.ts +2 -1
- package/lib/typescript/src/components/TransactionBubble/TransactionBubble.d.ts +2 -1
- package/lib/typescript/src/components/TransactionDetails/TransactionDetails.d.ts +3 -2
- package/lib/typescript/src/components/TransactionStatus/TransactionStatus.d.ts +2 -1
- package/lib/typescript/src/components/UpiHandle/UpiHandle.d.ts +2 -1
- package/lib/typescript/src/components/VStack/VStack.d.ts +2 -1
- package/lib/typescript/src/components/docs/modeControls.d.ts +28 -0
- package/lib/typescript/src/components/index.d.ts +11 -1
- package/lib/typescript/src/design-tokens/JFSThemeProvider.d.ts +4 -3
- package/lib/typescript/src/design-tokens/figma-modes.generated.d.ts +284 -0
- package/lib/typescript/src/design-tokens/index.d.ts +1 -0
- package/lib/typescript/src/icons/registry.d.ts +1 -1
- package/lib/typescript/src/skeleton/Skeleton.d.ts +2 -1
- package/lib/typescript/src/utils/react-utils.d.ts +12 -1
- package/package.json +4 -2
- package/src/components/Accordion/Accordion.tsx +2 -1
- package/src/components/AccordionCheckbox/AccordionCheckbox.tsx +2 -1
- package/src/components/AccountCard/AccountCard.tsx +2 -1
- package/src/components/ActionFooter/ActionFooter.tsx +2 -1
- package/src/components/ActionTile/ActionTile.tsx +2 -1
- package/src/components/AllocationComparisonChart/AllocationComparisonChart.tsx +2 -1
- package/src/components/AmountInput/AmountInput.tsx +9 -6
- package/src/components/AppBar/AppBar.tsx +2 -1
- package/src/components/AreaLineChart/AreaLineChart.tsx +8 -7
- package/src/components/Attached/Attached.tsx +2 -1
- package/src/components/Avatar/Avatar.tsx +3 -2
- package/src/components/AvatarGroup/AvatarGroup.tsx +2 -1
- package/src/components/Badge/Badge.tsx +2 -1
- package/src/components/Balance/Balance.tsx +18 -12
- package/src/components/BenefitCard/BenefitCard.tsx +309 -0
- package/src/components/BottomNav/BottomNav.tsx +2 -1
- package/src/components/BottomNavItem/BottomNavItem.tsx +3 -2
- package/src/components/BrandChip/BrandChip.tsx +3 -2
- package/src/components/BubbleChart/BubbleChart.tsx +2 -1
- package/src/components/Button/Button.tsx +3 -2
- package/src/components/ButtonGroup/ButtonGroup.tsx +2 -1
- package/src/components/Card/Card.tsx +4 -3
- package/src/components/CardAdvisory/CardAdvisory.tsx +3 -2
- package/src/components/CardBankAccount/CardBankAccount.tsx +2 -1
- package/src/components/CardCTA/CardCTA.tsx +3 -2
- package/src/components/CardFeedback/CardFeedback.tsx +11 -10
- package/src/components/CardFinancialCondition/CardFinancialCondition.tsx +3 -2
- package/src/components/CardInsight/CardInsight.tsx +2 -1
- package/src/components/CardProviderInfo/CardProviderInfo.tsx +2 -1
- package/src/components/Carousel/Carousel.tsx +5 -4
- package/src/components/CcCard/CcCard.tsx +598 -0
- package/src/components/Checkbox/Checkbox.tsx +7 -5
- package/src/components/CheckboxGroup/CheckboxGroup.tsx +2 -1
- package/src/components/CheckboxItem/CheckboxItem.tsx +7 -5
- package/src/components/ChipGroup/ChipGroup.tsx +2 -1
- package/src/components/ChipSelect/ChipSelect.tsx +2 -1
- package/src/components/CircularProgressBar/CircularProgressBar.tsx +2 -1
- package/src/components/CircularProgressBarDoted/CircularProgressBarDoted.tsx +2 -1
- package/src/components/CircularRating/CircularRating.tsx +3 -2
- package/src/components/ClusterBubble/ClusterBubble.tsx +2 -1
- package/src/components/CompareTable/CompareTable.tsx +477 -0
- package/src/components/ComparisonBar/ComparisonBar.tsx +356 -0
- package/src/components/CoverageBarComparison/CoverageBarComparison.tsx +3 -2
- package/src/components/CoverageRing/CoverageRing.tsx +2 -1
- package/src/components/DebitCard/DebitCard.tsx +2 -1
- package/src/components/Disclaimer/Disclaimer.tsx +2 -1
- package/src/components/Divider/Divider.tsx +2 -1
- package/src/components/DonutChart/DonutChart.tsx +6 -5
- package/src/components/DonutChartSummary/DonutChartSummary.tsx +3 -2
- package/src/components/Drawer/Drawer.tsx +21 -1
- package/src/components/Dropdown/Dropdown.tsx +4 -3
- package/src/components/DropdownInput/DropdownInput.tsx +60 -7
- package/src/components/EmptyState/EmptyState.tsx +2 -1
- package/src/components/ExpandableCheckbox/ExpandableCheckbox.tsx +2 -1
- package/src/components/FilterBar/FilterBar.tsx +3 -2
- package/src/components/Form/Form.tsx +2 -1
- package/src/components/FormField/FormField.tsx +8 -6
- package/src/components/FullscreenModal/FullscreenModal.tsx +68 -10
- package/src/components/Gauge/Gauge.tsx +2 -1
- package/src/components/HStack/HStack.tsx +2 -1
- package/src/components/HoldingsCard/HoldingsCard.tsx +2 -1
- package/src/components/Icon/Icon.tsx +3 -2
- package/src/components/IconButton/IconButton.tsx +3 -2
- package/src/components/IconCapsule/IconCapsule.tsx +3 -2
- package/src/components/Image/Image.tsx +29 -5
- package/src/components/InputSearch/InputSearch.tsx +11 -7
- package/src/components/InstitutionBadge/InstitutionBadge.tsx +3 -2
- package/src/components/LazyList/LazyList.tsx +2 -1
- package/src/components/LinearMeter/LinearMeter.tsx +3 -2
- package/src/components/LinearProgress/LinearProgress.tsx +2 -1
- package/src/components/ListGroup/ListGroup.tsx +2 -1
- package/src/components/ListItem/ListItem.tsx +3 -2
- package/src/components/LottieIntroBlock/LottieIntroBlock.tsx +2 -1
- package/src/components/LottiePlayer/LottiePlayer.tsx +3 -2
- package/src/components/LottiePlayer/LottiePlayer.web.tsx +3 -2
- package/src/components/LottiePlayer/loadNativeLottieView.tsx +9 -13
- package/src/components/MediaCard/MediaCard.tsx +7 -6
- package/src/components/MerchantProfile/MerchantProfile.tsx +2 -1
- package/src/components/MessageField/MessageField.tsx +3 -2
- package/src/components/MetricLegendItem/MetricLegendItem.tsx +2 -1
- package/src/components/MoneyValue/MoneyValue.tsx +2 -1
- package/src/components/MonthlyStatusGrid/MonthlyStatusGrid.tsx +5 -4
- package/src/components/NavArrow/NavArrow.tsx +3 -2
- package/src/components/NoteInput/NoteInput.tsx +10 -7
- package/src/components/Nudge/Nudge.tsx +3 -2
- package/src/components/Numpad/Numpad.tsx +2 -1
- package/src/components/OTP/OTP.tsx +3 -2
- package/src/components/Overlay/Overlay.tsx +114 -0
- package/src/components/PageHero/PageHero.tsx +2 -1
- package/src/components/PaymentFeedback/PaymentFeedback.tsx +2 -1
- package/src/components/PdpCcCard/PdpCcCard.tsx +356 -0
- package/src/components/PlanComparisonCard/PlanComparisonCard.tsx +2 -1
- package/src/components/Popup/Popup.tsx +2 -1
- package/src/components/PortfolioHero/PortfolioHero.tsx +2 -1
- package/src/components/PoweredByLabel/PoweredByLabel.tsx +2 -1
- package/src/components/ProductLabel/ProductLabel.tsx +2 -1
- package/src/components/ProductMerchandisingCard/GlassFill.tsx +276 -0
- package/src/components/ProductMerchandisingCard/GlassFill.web.tsx +127 -0
- package/src/components/ProductMerchandisingCard/ProductMerchandisingCard.tsx +423 -0
- package/src/components/ProductOverview/ProductOverview.tsx +2 -1
- package/src/components/ProgressBadge/ProgressBadge.tsx +2 -1
- package/src/components/ProjectionMarker/ProjectionMarker.tsx +277 -0
- package/src/components/Radio/Radio.tsx +7 -5
- package/src/components/RangeTrack/RangeTrack.tsx +3 -2
- package/src/components/RechargeCard/RechargeCard.tsx +2 -1
- package/src/components/SavingsGoalSummary/SavingsGoalSummary.tsx +2 -1
- package/src/components/Screen/Screen.tsx +2 -1
- package/src/components/Section/Section.tsx +6 -5
- package/src/components/SegmentedControl/SegmentedControl.tsx +3 -2
- package/src/components/SegmentedTrack/SegmentedTrack.tsx +5 -4
- package/src/components/Slider/Slider.tsx +628 -0
- package/src/components/Slot/Slot.tsx +2 -1
- package/src/components/Spinner/Spinner.tsx +2 -1
- package/src/components/StatGroup/StatGroup.tsx +3 -2
- package/src/components/StatItem/StatItem.tsx +2 -1
- package/src/components/StatusHero/StatusHero.tsx +2 -1
- package/src/components/Stepper/Step.tsx +2 -1
- package/src/components/Stepper/StepLabel.tsx +2 -1
- package/src/components/Stepper/Stepper.tsx +2 -1
- package/src/components/StrengthIndicator/StrengthIndicator.tsx +2 -1
- package/src/components/SuggestiveSearch/SuggestiveSearch.tsx +4 -3
- package/src/components/SummaryTile/SummaryTile.tsx +2 -1
- package/src/components/SupportText/SupportText.tsx +2 -1
- package/src/components/SupportText/SupportTextIcon.tsx +2 -1
- package/src/components/SwappableAmount/SwappableAmount.tsx +2 -1
- package/src/components/Tabs/TabItem.tsx +2 -1
- package/src/components/Tabs/Tabs.tsx +2 -1
- package/src/components/TestimonialsCard/TestimonialsCard.tsx +2 -1
- package/src/components/Text/Text.tsx +2 -1
- package/src/components/TextInput/TextInput.tsx +18 -13
- package/src/components/TextSegment/TextSegment.tsx +166 -0
- package/src/components/ThreadHero/ThreadHero.tsx +2 -1
- package/src/components/Title/Title.tsx +2 -1
- package/src/components/Toast/Toast.tsx +2 -1
- package/src/components/Toast/ToastProvider.tsx +2 -1
- package/src/components/Toast/useToast.ts +3 -2
- package/src/components/Toggle/Toggle.tsx +2 -1
- package/src/components/Tooltip/Tooltip.tsx +3 -2
- package/src/components/TransactionBubble/TransactionBubble.tsx +2 -1
- package/src/components/TransactionDetails/TransactionDetails.tsx +3 -2
- package/src/components/TransactionStatus/TransactionStatus.tsx +3 -2
- package/src/components/UpiHandle/UpiHandle.tsx +3 -2
- package/src/components/VStack/VStack.tsx +2 -1
- package/src/components/docs/modeControls.tsx +122 -0
- package/src/components/index.ts +11 -1
- package/src/design-tokens/Coin Variables-variables-full.json +1 -1
- package/src/design-tokens/JFSThemeProvider.tsx +4 -3
- package/src/design-tokens/figma-modes.generated.ts +425 -0
- package/src/design-tokens/index.ts +1 -0
- package/src/icons/registry.ts +1 -1
- package/src/skeleton/Skeleton.tsx +2 -1
- package/src/utils/react-utils.ts +26 -2
- 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
|
@@ -0,0 +1,473 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _reactNativeSvg = _interopRequireWildcard(require("react-native-svg"));
|
|
10
|
+
var _figmaVariablesResolver = require("../../design-tokens/figma-variables-resolver");
|
|
11
|
+
var _reactUtils = require("../../utils/react-utils");
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
14
|
+
/**
|
|
15
|
+
* Imperative handle exposed via `ref`. The primary way to read a slider's value
|
|
16
|
+
* is still the controlled `value` + `onChange` pair (each `<Slider />` reports
|
|
17
|
+
* its own value, so multiple sliders are disambiguated by their own handlers).
|
|
18
|
+
* The ref is a convenience for reading the latest value on demand (e.g. on a
|
|
19
|
+
* button press) or imperatively nudging an uncontrolled slider.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* const slider = useRef<SliderHandle>(null)
|
|
23
|
+
* slider.current?.setValue(50)
|
|
24
|
+
* const v = slider.current?.getValue()
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
const clamp = (n, min, max) => Math.min(Math.max(n, min), max);
|
|
28
|
+
const asNum = (raw, fallback) => {
|
|
29
|
+
const n = typeof raw === 'number' ? raw : parseFloat(raw);
|
|
30
|
+
return Number.isFinite(n) ? n : fallback;
|
|
31
|
+
};
|
|
32
|
+
const asStr = (raw, fallback) => raw != null ? String(raw) : fallback;
|
|
33
|
+
|
|
34
|
+
// The unfilled track is rendered at a lighter emphasis in the design.
|
|
35
|
+
const TRACK_EMPHASIS = {
|
|
36
|
+
Emphasis: 'Low'
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Slider — Figma node 5373:446 ("Slider").
|
|
41
|
+
*
|
|
42
|
+
* A horizontal, single-thumb slider driven entirely by design tokens. It maps a
|
|
43
|
+
* numeric range (`minValue`–`maxValue`) onto a track with a filled indicator, a
|
|
44
|
+
* draggable handle, a value bubble pinned above the handle, and optional min/max
|
|
45
|
+
* labels beneath the track. Built on `PanResponder` so the one code path works
|
|
46
|
+
* on iOS, Android and the web.
|
|
47
|
+
*
|
|
48
|
+
* The design only labels the range bounds, but a slider's purpose is to bind a
|
|
49
|
+
* value — so the live value is surfaced through the bubble (formatted via
|
|
50
|
+
* `formatOptions` / `formatValue`) and reported through `onChange` /
|
|
51
|
+
* `onChangeEnd`. Supports controlled and uncontrolled usage, web keyboard
|
|
52
|
+
* control, and an imperative {@link SliderHandle} `ref` for on-demand reads.
|
|
53
|
+
*/
|
|
54
|
+
const Slider = /*#__PURE__*/(0, _react.forwardRef)(function Slider({
|
|
55
|
+
value: controlledValue,
|
|
56
|
+
defaultValue,
|
|
57
|
+
onChange,
|
|
58
|
+
onChangeEnd,
|
|
59
|
+
minValue = 0,
|
|
60
|
+
maxValue = 100,
|
|
61
|
+
step = 1,
|
|
62
|
+
isDisabled = false,
|
|
63
|
+
formatOptions,
|
|
64
|
+
locale,
|
|
65
|
+
formatValue,
|
|
66
|
+
renderTooltip,
|
|
67
|
+
alwaysShowTooltip = true,
|
|
68
|
+
showLabels = true,
|
|
69
|
+
minLabel,
|
|
70
|
+
maxLabel,
|
|
71
|
+
width = '100%',
|
|
72
|
+
modes = _reactUtils.EMPTY_MODES,
|
|
73
|
+
style,
|
|
74
|
+
accessibilityLabel
|
|
75
|
+
}, ref) {
|
|
76
|
+
const tokens = (0, _react.useMemo)(() => resolveTokens(modes), [modes]);
|
|
77
|
+
const isControlled = controlledValue !== undefined;
|
|
78
|
+
const [internalValue, setInternalValue] = (0, _react.useState)(() => clamp(defaultValue ?? minValue, minValue, maxValue));
|
|
79
|
+
const rawValue = isControlled ? controlledValue : internalValue;
|
|
80
|
+
const currentValue = clamp(rawValue, minValue, maxValue);
|
|
81
|
+
const [trackWidth, setTrackWidth] = (0, _react.useState)(0);
|
|
82
|
+
const [tooltipWidth, setTooltipWidth] = (0, _react.useState)(0);
|
|
83
|
+
const [isDragging, setIsDragging] = (0, _react.useState)(false);
|
|
84
|
+
const [isHovered, setIsHovered] = (0, _react.useState)(false);
|
|
85
|
+
const quantize = (0, _react.useCallback)(v => {
|
|
86
|
+
if (!step || step <= 0) return clamp(v, minValue, maxValue);
|
|
87
|
+
const stepped = Math.round((v - minValue) / step) * step + minValue;
|
|
88
|
+
// Round away float dust introduced by the division (e.g. 0.30000000000004).
|
|
89
|
+
const decimals = (String(step).split('.')[1] || '').length;
|
|
90
|
+
const fixed = decimals > 0 ? Number(stepped.toFixed(decimals)) : stepped;
|
|
91
|
+
return clamp(fixed, minValue, maxValue);
|
|
92
|
+
}, [minValue, maxValue, step]);
|
|
93
|
+
|
|
94
|
+
// Keep the latest interactive config in a ref so the PanResponder (created
|
|
95
|
+
// once) always reads fresh values without being recreated mid-gesture.
|
|
96
|
+
const interaction = (0, _react.useRef)({
|
|
97
|
+
trackWidth,
|
|
98
|
+
minValue,
|
|
99
|
+
maxValue,
|
|
100
|
+
isDisabled,
|
|
101
|
+
isControlled,
|
|
102
|
+
quantize,
|
|
103
|
+
onChange,
|
|
104
|
+
onChangeEnd
|
|
105
|
+
});
|
|
106
|
+
interaction.current = {
|
|
107
|
+
trackWidth,
|
|
108
|
+
minValue,
|
|
109
|
+
maxValue,
|
|
110
|
+
isDisabled,
|
|
111
|
+
isControlled,
|
|
112
|
+
quantize,
|
|
113
|
+
onChange,
|
|
114
|
+
onChangeEnd
|
|
115
|
+
};
|
|
116
|
+
const lastValueRef = (0, _react.useRef)(currentValue);
|
|
117
|
+
lastValueRef.current = currentValue;
|
|
118
|
+
const commit = (0, _react.useCallback)((next, isFinal) => {
|
|
119
|
+
const {
|
|
120
|
+
isControlled: ctrl,
|
|
121
|
+
onChange: change,
|
|
122
|
+
onChangeEnd: changeEnd
|
|
123
|
+
} = interaction.current;
|
|
124
|
+
const changed = next !== lastValueRef.current;
|
|
125
|
+
lastValueRef.current = next;
|
|
126
|
+
if (changed) {
|
|
127
|
+
if (!ctrl) setInternalValue(next);
|
|
128
|
+
change?.(next);
|
|
129
|
+
}
|
|
130
|
+
if (isFinal) changeEnd?.(next);
|
|
131
|
+
}, []);
|
|
132
|
+
const valueFromX = (0, _react.useCallback)(x => {
|
|
133
|
+
const {
|
|
134
|
+
trackWidth: w,
|
|
135
|
+
minValue: min,
|
|
136
|
+
maxValue: max,
|
|
137
|
+
quantize: q
|
|
138
|
+
} = interaction.current;
|
|
139
|
+
if (w <= 0) return lastValueRef.current;
|
|
140
|
+
const ratio = clamp(x / w, 0, 1);
|
|
141
|
+
return q(min + ratio * (max - min));
|
|
142
|
+
}, []);
|
|
143
|
+
const panResponder = (0, _react.useRef)(_reactNative.PanResponder.create({
|
|
144
|
+
onStartShouldSetPanResponder: () => !interaction.current.isDisabled,
|
|
145
|
+
onMoveShouldSetPanResponder: () => !interaction.current.isDisabled,
|
|
146
|
+
onPanResponderGrant: e => {
|
|
147
|
+
if (interaction.current.isDisabled) return;
|
|
148
|
+
setIsDragging(true);
|
|
149
|
+
commit(valueFromX(e.nativeEvent.locationX), false);
|
|
150
|
+
},
|
|
151
|
+
onPanResponderMove: e => {
|
|
152
|
+
if (interaction.current.isDisabled) return;
|
|
153
|
+
commit(valueFromX(e.nativeEvent.locationX), false);
|
|
154
|
+
},
|
|
155
|
+
onPanResponderRelease: e => {
|
|
156
|
+
setIsDragging(false);
|
|
157
|
+
if (interaction.current.isDisabled) return;
|
|
158
|
+
commit(valueFromX(e.nativeEvent.locationX), true);
|
|
159
|
+
},
|
|
160
|
+
onPanResponderTerminate: () => {
|
|
161
|
+
setIsDragging(false);
|
|
162
|
+
if (interaction.current.isDisabled) return;
|
|
163
|
+
commit(lastValueRef.current, true);
|
|
164
|
+
}
|
|
165
|
+
})).current;
|
|
166
|
+
|
|
167
|
+
// Keyboard support (web). Arrow/Page keys nudge, Home/End jump to bounds.
|
|
168
|
+
const handleKeyDown = (0, _react.useCallback)(e => {
|
|
169
|
+
if (isDisabled) return;
|
|
170
|
+
const big = Math.max(step, (maxValue - minValue) / 10);
|
|
171
|
+
let next = null;
|
|
172
|
+
switch (e.key) {
|
|
173
|
+
case 'ArrowRight':
|
|
174
|
+
case 'ArrowUp':
|
|
175
|
+
next = quantize(currentValue + step);
|
|
176
|
+
break;
|
|
177
|
+
case 'ArrowLeft':
|
|
178
|
+
case 'ArrowDown':
|
|
179
|
+
next = quantize(currentValue - step);
|
|
180
|
+
break;
|
|
181
|
+
case 'PageUp':
|
|
182
|
+
next = quantize(currentValue + big);
|
|
183
|
+
break;
|
|
184
|
+
case 'PageDown':
|
|
185
|
+
next = quantize(currentValue - big);
|
|
186
|
+
break;
|
|
187
|
+
case 'Home':
|
|
188
|
+
next = minValue;
|
|
189
|
+
break;
|
|
190
|
+
case 'End':
|
|
191
|
+
next = maxValue;
|
|
192
|
+
break;
|
|
193
|
+
default:
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
e.preventDefault?.();
|
|
197
|
+
commit(next, true);
|
|
198
|
+
}, [isDisabled, step, minValue, maxValue, currentValue, quantize, commit]);
|
|
199
|
+
const handleAccessibilityAction = (0, _react.useCallback)(event => {
|
|
200
|
+
if (isDisabled) return;
|
|
201
|
+
const name = event.nativeEvent.actionName;
|
|
202
|
+
if (name === 'increment') commit(quantize(currentValue + step), true);else if (name === 'decrement') commit(quantize(currentValue - step), true);
|
|
203
|
+
}, [isDisabled, step, currentValue, quantize, commit]);
|
|
204
|
+
(0, _react.useImperativeHandle)(ref, () => ({
|
|
205
|
+
getValue: () => lastValueRef.current,
|
|
206
|
+
setValue: v => commit(quantize(v), true),
|
|
207
|
+
increment: by => commit(quantize(lastValueRef.current + (by ?? step)), true),
|
|
208
|
+
decrement: by => commit(quantize(lastValueRef.current - (by ?? step)), true)
|
|
209
|
+
}), [quantize, commit, step]);
|
|
210
|
+
const defaultFormat = (0, _react.useCallback)(v => {
|
|
211
|
+
try {
|
|
212
|
+
return new Intl.NumberFormat(locale, formatOptions).format(v);
|
|
213
|
+
} catch {
|
|
214
|
+
return String(v);
|
|
215
|
+
}
|
|
216
|
+
}, [locale, formatOptions]);
|
|
217
|
+
const format = formatValue ?? defaultFormat;
|
|
218
|
+
const ratio = maxValue > minValue ? (currentValue - minValue) / (maxValue - minValue) : 0;
|
|
219
|
+
const percent = clamp(ratio, 0, 1) * 100;
|
|
220
|
+
const handleSize = tokens.handleSize;
|
|
221
|
+
// The bubble floats (absolutely positioned, no reserved layout space). When
|
|
222
|
+
// `alwaysShowTooltip` is false it only appears while interacting: dragging on
|
|
223
|
+
// any platform, or hovering on web. Lifting the finger clears `isDragging`,
|
|
224
|
+
// so the bubble disappears immediately on touch release.
|
|
225
|
+
const showTooltip = alwaysShowTooltip || isDragging || isHovered;
|
|
226
|
+
const onTrackLayout = (0, _react.useCallback)(e => {
|
|
227
|
+
setTrackWidth(e.nativeEvent.layout.width);
|
|
228
|
+
}, []);
|
|
229
|
+
const onTooltipLayout = (0, _react.useCallback)(e => {
|
|
230
|
+
setTooltipWidth(e.nativeEvent.layout.width);
|
|
231
|
+
}, []);
|
|
232
|
+
const valueText = format(currentValue);
|
|
233
|
+
const tooltipNode = showTooltip ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
234
|
+
onLayout: onTooltipLayout,
|
|
235
|
+
style: [styles.tooltip, {
|
|
236
|
+
backgroundColor: tokens.tooltipBackground,
|
|
237
|
+
paddingHorizontal: tokens.tooltipPaddingH,
|
|
238
|
+
paddingVertical: tokens.tooltipPaddingV,
|
|
239
|
+
borderRadius: tokens.tooltipRadius,
|
|
240
|
+
maxWidth: tokens.tooltipMaxWidth,
|
|
241
|
+
bottom: handleSize + tokens.tooltipWrapGap,
|
|
242
|
+
// Pinned to the value point on the full-width track area (not
|
|
243
|
+
// the tiny handle-width thumb). An absolute child with only
|
|
244
|
+
// `left` set is clamped by Yoga to `parentWidth - left`, so
|
|
245
|
+
// parenting it to the 20px thumb collapsed the text to ~0px
|
|
246
|
+
// and rendered an empty bubble on device. Centre via translate.
|
|
247
|
+
left: `${percent}%`,
|
|
248
|
+
transform: [{
|
|
249
|
+
translateX: -tooltipWidth / 2
|
|
250
|
+
}]
|
|
251
|
+
}],
|
|
252
|
+
pointerEvents: "none",
|
|
253
|
+
children: [renderTooltip ? renderTooltip(currentValue) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
254
|
+
style: tokens.tooltipLabel,
|
|
255
|
+
numberOfLines: 1,
|
|
256
|
+
children: valueText
|
|
257
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
258
|
+
style: [styles.tip, {
|
|
259
|
+
bottom: -tokens.tipHeight
|
|
260
|
+
}],
|
|
261
|
+
pointerEvents: "none",
|
|
262
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.default, {
|
|
263
|
+
width: tokens.tipWidth,
|
|
264
|
+
height: tokens.tipHeight,
|
|
265
|
+
viewBox: `0 0 ${tokens.tipWidth} ${tokens.tipHeight}`,
|
|
266
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Path, {
|
|
267
|
+
d: `M0 0 L${tokens.tipWidth / 2} ${tokens.tipHeight} L${tokens.tipWidth} 0 Z`,
|
|
268
|
+
fill: tokens.tooltipBackground
|
|
269
|
+
})
|
|
270
|
+
})
|
|
271
|
+
})]
|
|
272
|
+
}) : null;
|
|
273
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
274
|
+
style: [{
|
|
275
|
+
width,
|
|
276
|
+
gap: tokens.gap,
|
|
277
|
+
paddingTop: tokens.paddingTop,
|
|
278
|
+
paddingBottom: tokens.paddingBottom,
|
|
279
|
+
paddingLeft: tokens.paddingLeft,
|
|
280
|
+
paddingRight: tokens.paddingRight,
|
|
281
|
+
opacity: isDisabled ? 0.5 : 1
|
|
282
|
+
}, style],
|
|
283
|
+
accessibilityLabel: accessibilityLabel,
|
|
284
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
285
|
+
...panResponder.panHandlers,
|
|
286
|
+
onLayout: onTrackLayout,
|
|
287
|
+
style: [styles.trackArea, {
|
|
288
|
+
height: handleSize
|
|
289
|
+
}],
|
|
290
|
+
accessible: true,
|
|
291
|
+
accessibilityRole: "adjustable",
|
|
292
|
+
accessibilityLabel: accessibilityLabel,
|
|
293
|
+
accessibilityValue: {
|
|
294
|
+
min: minValue,
|
|
295
|
+
max: maxValue,
|
|
296
|
+
now: currentValue,
|
|
297
|
+
text: valueText
|
|
298
|
+
},
|
|
299
|
+
accessibilityState: {
|
|
300
|
+
disabled: isDisabled
|
|
301
|
+
},
|
|
302
|
+
accessibilityActions: [{
|
|
303
|
+
name: 'increment'
|
|
304
|
+
}, {
|
|
305
|
+
name: 'decrement'
|
|
306
|
+
}],
|
|
307
|
+
onAccessibilityAction: handleAccessibilityAction,
|
|
308
|
+
focusable: !isDisabled,
|
|
309
|
+
...(_reactNative.Platform.OS === 'web' ? {
|
|
310
|
+
onKeyDown: handleKeyDown,
|
|
311
|
+
tabIndex: isDisabled ? -1 : 0,
|
|
312
|
+
onMouseEnter: () => !isDisabled && setIsHovered(true),
|
|
313
|
+
onMouseLeave: () => setIsHovered(false)
|
|
314
|
+
} : {}),
|
|
315
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
316
|
+
style: {
|
|
317
|
+
height: tokens.trackHeight,
|
|
318
|
+
borderRadius: tokens.trackRadius,
|
|
319
|
+
backgroundColor: tokens.trackBackground
|
|
320
|
+
}
|
|
321
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
322
|
+
pointerEvents: "none",
|
|
323
|
+
style: {
|
|
324
|
+
position: 'absolute',
|
|
325
|
+
left: 0,
|
|
326
|
+
top: (handleSize - tokens.indicatorHeight) / 2,
|
|
327
|
+
height: tokens.indicatorHeight,
|
|
328
|
+
width: `${percent}%`,
|
|
329
|
+
borderRadius: tokens.indicatorRadius,
|
|
330
|
+
backgroundColor: tokens.indicatorBackground
|
|
331
|
+
}
|
|
332
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
333
|
+
pointerEvents: "none",
|
|
334
|
+
style: {
|
|
335
|
+
position: 'absolute',
|
|
336
|
+
top: 0,
|
|
337
|
+
left: `${percent}%`,
|
|
338
|
+
width: handleSize,
|
|
339
|
+
height: handleSize,
|
|
340
|
+
transform: [{
|
|
341
|
+
translateX: -handleSize / 2
|
|
342
|
+
}]
|
|
343
|
+
},
|
|
344
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
345
|
+
style: {
|
|
346
|
+
width: handleSize,
|
|
347
|
+
height: handleSize,
|
|
348
|
+
borderRadius: tokens.handleRadius,
|
|
349
|
+
backgroundColor: tokens.handleBackground
|
|
350
|
+
}
|
|
351
|
+
})
|
|
352
|
+
}), tooltipNode]
|
|
353
|
+
}), showLabels ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
354
|
+
style: styles.labelWrap,
|
|
355
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
356
|
+
style: tokens.label,
|
|
357
|
+
children: minLabel ?? format(minValue)
|
|
358
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
359
|
+
style: tokens.label,
|
|
360
|
+
children: maxLabel ?? format(maxValue)
|
|
361
|
+
})]
|
|
362
|
+
}) : null]
|
|
363
|
+
});
|
|
364
|
+
});
|
|
365
|
+
function resolveTokens(modes) {
|
|
366
|
+
// NOTE: token names are passed as string literals DIRECTLY to
|
|
367
|
+
// getVariableByName so the `extract-component-tokens` script can statically
|
|
368
|
+
// collect them for the generated docs. Do not refactor into a helper that
|
|
369
|
+
// receives the name as a variable.
|
|
370
|
+
const gap = asNum((0, _figmaVariablesResolver.getVariableByName)('slider/gap', modes), 16);
|
|
371
|
+
const paddingTop = asNum((0, _figmaVariablesResolver.getVariableByName)('slider/padding/top', modes), 8);
|
|
372
|
+
const paddingBottom = asNum((0, _figmaVariablesResolver.getVariableByName)('slider/padding/bottom', modes), 0);
|
|
373
|
+
const paddingLeft = asNum((0, _figmaVariablesResolver.getVariableByName)('slider/padding/left', modes), 0);
|
|
374
|
+
const paddingRight = asNum((0, _figmaVariablesResolver.getVariableByName)('slider/padding/right', modes), 0);
|
|
375
|
+
const trackHeight = asNum((0, _figmaVariablesResolver.getVariableByName)('slider/track/height', modes), 4);
|
|
376
|
+
const trackRadius = asNum((0, _figmaVariablesResolver.getVariableByName)('slider/track/radius', modes), 999);
|
|
377
|
+
// The unfilled track uses a lighter emphasis in the design; consumer modes
|
|
378
|
+
// still win over the baked-in `Emphasis: Low`.
|
|
379
|
+
const trackBackground = asStr((0, _figmaVariablesResolver.getVariableByName)('slider/track/background', {
|
|
380
|
+
...TRACK_EMPHASIS,
|
|
381
|
+
...modes
|
|
382
|
+
}), '#fde8c9');
|
|
383
|
+
const indicatorHeight = asNum((0, _figmaVariablesResolver.getVariableByName)('slider/indicator/height', modes), 4);
|
|
384
|
+
const indicatorRadius = asNum((0, _figmaVariablesResolver.getVariableByName)('slider/indicator/radius', modes), 999);
|
|
385
|
+
const indicatorBackground = asStr((0, _figmaVariablesResolver.getVariableByName)('slider/indicator/background', modes), '#f7ab21');
|
|
386
|
+
const handleSize = asNum((0, _figmaVariablesResolver.getVariableByName)('slider/handle/size', modes), 20);
|
|
387
|
+
const handleRadius = asNum((0, _figmaVariablesResolver.getVariableByName)('slider/handle/radius', modes), 999999);
|
|
388
|
+
const handleBackground = asStr((0, _figmaVariablesResolver.getVariableByName)('slider/handle/background', modes), '#f7ab21');
|
|
389
|
+
const tooltipWrapGap = asNum((0, _figmaVariablesResolver.getVariableByName)('slider/tooltipWrap/gap', modes), 12);
|
|
390
|
+
const tooltipBackground = asStr((0, _figmaVariablesResolver.getVariableByName)('tooltip/background', modes), '#0f0d0a');
|
|
391
|
+
const tooltipPaddingH = asNum((0, _figmaVariablesResolver.getVariableByName)('tooltip/padding/horizontal', modes), 12);
|
|
392
|
+
const tooltipPaddingV = asNum((0, _figmaVariablesResolver.getVariableByName)('tooltip/padding/vertical', modes), 8);
|
|
393
|
+
const tooltipRadius = asNum((0, _figmaVariablesResolver.getVariableByName)('radius', modes), 8);
|
|
394
|
+
const tooltipMaxWidth = asNum((0, _figmaVariablesResolver.getVariableByName)('maxWidth', modes), 280);
|
|
395
|
+
const tipWidth = asNum((0, _figmaVariablesResolver.getVariableByName)('tooltip/tipItem/width', modes), 16);
|
|
396
|
+
const tipHeight = asNum((0, _figmaVariablesResolver.getVariableByName)('tooltip/tipItem/height', modes), 8);
|
|
397
|
+
const tooltipLabelColor = asStr((0, _figmaVariablesResolver.getVariableByName)('tooltip/label/color', modes), '#ffffff');
|
|
398
|
+
const tooltipLabelSize = asNum((0, _figmaVariablesResolver.getVariableByName)('tooltip/label/fontSize', modes), 14);
|
|
399
|
+
const tooltipLabelFamily = asStr((0, _figmaVariablesResolver.getVariableByName)('tooltip/lable/fontFamily', modes), 'JioType Var');
|
|
400
|
+
const tooltipLabelLineHeight = asNum((0, _figmaVariablesResolver.getVariableByName)('tooltip/label/lineHeight', modes), 18);
|
|
401
|
+
const tooltipLabelWeight = asStr((0, _figmaVariablesResolver.getVariableByName)('tooltip/label/fontWeight', modes), '500');
|
|
402
|
+
const labelColor = asStr((0, _figmaVariablesResolver.getVariableByName)('text/foreground', modes), '#000000');
|
|
403
|
+
const labelSize = asNum((0, _figmaVariablesResolver.getVariableByName)('text/fontSize', modes), 14);
|
|
404
|
+
const labelFamily = asStr((0, _figmaVariablesResolver.getVariableByName)('text/fontFamily', modes), 'JioType Var');
|
|
405
|
+
const labelLineHeight = asNum((0, _figmaVariablesResolver.getVariableByName)('text/lineHeight', modes), 20);
|
|
406
|
+
const labelWeight = asStr((0, _figmaVariablesResolver.getVariableByName)('text/fontWeight', modes), '500');
|
|
407
|
+
const labelLetterSpacing = asNum((0, _figmaVariablesResolver.getVariableByName)('text/letterSpacing', modes), -0.5);
|
|
408
|
+
return {
|
|
409
|
+
gap,
|
|
410
|
+
paddingTop,
|
|
411
|
+
paddingBottom,
|
|
412
|
+
paddingLeft,
|
|
413
|
+
paddingRight,
|
|
414
|
+
trackHeight,
|
|
415
|
+
trackRadius,
|
|
416
|
+
trackBackground,
|
|
417
|
+
indicatorHeight,
|
|
418
|
+
indicatorRadius,
|
|
419
|
+
indicatorBackground,
|
|
420
|
+
handleSize,
|
|
421
|
+
handleRadius,
|
|
422
|
+
handleBackground,
|
|
423
|
+
tooltipWrapGap,
|
|
424
|
+
tooltipBackground,
|
|
425
|
+
tooltipPaddingH,
|
|
426
|
+
tooltipPaddingV,
|
|
427
|
+
tooltipRadius,
|
|
428
|
+
tooltipMaxWidth,
|
|
429
|
+
tooltipLineHeight: tooltipLabelLineHeight,
|
|
430
|
+
tipWidth,
|
|
431
|
+
tipHeight,
|
|
432
|
+
tooltipLabel: {
|
|
433
|
+
color: tooltipLabelColor,
|
|
434
|
+
fontSize: tooltipLabelSize,
|
|
435
|
+
fontFamily: tooltipLabelFamily,
|
|
436
|
+
lineHeight: tooltipLabelLineHeight,
|
|
437
|
+
fontWeight: tooltipLabelWeight,
|
|
438
|
+
includeFontPadding: false
|
|
439
|
+
},
|
|
440
|
+
label: {
|
|
441
|
+
color: labelColor,
|
|
442
|
+
fontSize: labelSize,
|
|
443
|
+
fontFamily: labelFamily,
|
|
444
|
+
lineHeight: labelLineHeight,
|
|
445
|
+
fontWeight: labelWeight,
|
|
446
|
+
letterSpacing: labelLetterSpacing,
|
|
447
|
+
includeFontPadding: false
|
|
448
|
+
}
|
|
449
|
+
};
|
|
450
|
+
}
|
|
451
|
+
const styles = {
|
|
452
|
+
trackArea: {
|
|
453
|
+
width: '100%',
|
|
454
|
+
justifyContent: 'center',
|
|
455
|
+
position: 'relative'
|
|
456
|
+
},
|
|
457
|
+
labelWrap: {
|
|
458
|
+
flexDirection: 'row',
|
|
459
|
+
justifyContent: 'space-between',
|
|
460
|
+
alignItems: 'flex-start',
|
|
461
|
+
width: '100%'
|
|
462
|
+
},
|
|
463
|
+
tooltip: {
|
|
464
|
+
position: 'absolute',
|
|
465
|
+
alignItems: 'center',
|
|
466
|
+
justifyContent: 'center'
|
|
467
|
+
},
|
|
468
|
+
tip: {
|
|
469
|
+
position: 'absolute',
|
|
470
|
+
alignSelf: 'center'
|
|
471
|
+
}
|
|
472
|
+
};
|
|
473
|
+
var _default = exports.default = Slider;
|
|
@@ -43,7 +43,8 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
43
43
|
/**
|
|
44
44
|
* Helper function to convert a color to a more transparent version for placeholder text.
|
|
45
45
|
* Takes a color string (hex, rgb, rgba) and returns it with reduced opacity.
|
|
46
|
-
*/
|
|
46
|
+
*/
|
|
47
|
+
const IS_WEB = _reactNative.Platform.OS === 'web';
|
|
47
48
|
function makePlaceholderColor(color, opacity = 0.5) {
|
|
48
49
|
if (!color || typeof color !== 'string') {
|
|
49
50
|
return color || '';
|
|
@@ -100,7 +101,7 @@ function makePlaceholderColor(color, opacity = 0.5) {
|
|
|
100
101
|
// Fallback: return original color
|
|
101
102
|
return color;
|
|
102
103
|
}
|
|
103
|
-
function TextInput({
|
|
104
|
+
const TextInputBase = /*#__PURE__*/(0, _react.forwardRef)(function TextInput({
|
|
104
105
|
placeholder = '',
|
|
105
106
|
value = '',
|
|
106
107
|
onChangeText,
|
|
@@ -115,7 +116,7 @@ function TextInput({
|
|
|
115
116
|
accessibilityLabel,
|
|
116
117
|
accessibilityHint,
|
|
117
118
|
...rest
|
|
118
|
-
}) {
|
|
119
|
+
}, ref) {
|
|
119
120
|
// Track focus state to hide placeholder when focused
|
|
120
121
|
const [isFocused, setIsFocused] = (0, _react.useState)(false);
|
|
121
122
|
const [isHovered, setIsHovered] = (0, _react.useState)(false);
|
|
@@ -230,7 +231,7 @@ function TextInput({
|
|
|
230
231
|
importantForAccessibility: "no",
|
|
231
232
|
children: processedLeading
|
|
232
233
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TextInput, {
|
|
233
|
-
ref: inputRef,
|
|
234
|
+
ref: (0, _reactUtils.mergeRefs)(inputRef, ref),
|
|
234
235
|
accessibilityLabel: undefined,
|
|
235
236
|
accessibilityHint: accessibilityHint,
|
|
236
237
|
placeholder: displayPlaceholder,
|
|
@@ -263,7 +264,7 @@ function TextInput({
|
|
|
263
264
|
style: containerStyleArray,
|
|
264
265
|
children: inner
|
|
265
266
|
});
|
|
266
|
-
}
|
|
267
|
+
});
|
|
267
268
|
|
|
268
269
|
/**
|
|
269
270
|
* TextInput.Search component that mirrors the Figma "textInput.search" component.
|
|
@@ -285,7 +286,7 @@ function TextInput({
|
|
|
285
286
|
* @param {Object} [props.rest] - Additional props passed to the underlying TextInput
|
|
286
287
|
*/
|
|
287
288
|
|
|
288
|
-
function TextInputSearch({
|
|
289
|
+
const TextInputSearch = /*#__PURE__*/(0, _react.forwardRef)(function TextInputSearch({
|
|
289
290
|
placeholder = 'Search',
|
|
290
291
|
value = '',
|
|
291
292
|
onChangeText,
|
|
@@ -298,7 +299,7 @@ function TextInputSearch({
|
|
|
298
299
|
onFocus,
|
|
299
300
|
onBlur,
|
|
300
301
|
...rest
|
|
301
|
-
}) {
|
|
302
|
+
}, ref) {
|
|
302
303
|
// Resolve icon tokens for default search icon
|
|
303
304
|
const iconColor = (0, _figmaVariablesResolver.getVariableByName)('textInput/icon/color', modes) || '#24262b';
|
|
304
305
|
const iconSize = (0, _figmaVariablesResolver.getVariableByName)('textInput/icon/size', modes) || 18;
|
|
@@ -335,10 +336,15 @@ function TextInputSearch({
|
|
|
335
336
|
textInputProps.accessibilityHint = accessibilityHint;
|
|
336
337
|
}
|
|
337
338
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(TextInput, {
|
|
339
|
+
ref: ref,
|
|
338
340
|
...textInputProps
|
|
339
341
|
});
|
|
340
|
-
}
|
|
342
|
+
});
|
|
343
|
+
|
|
344
|
+
// Attach Search as a property of TextInput using namespace pattern. The base
|
|
345
|
+
// component is created via forwardRef, so we compose the static onto a typed
|
|
346
|
+
// alias to keep `TextInput.Search` strongly typed.
|
|
341
347
|
|
|
342
|
-
|
|
348
|
+
const TextInput = TextInputBase;
|
|
343
349
|
TextInput.Search = TextInputSearch;
|
|
344
350
|
var _default = exports.default = TextInput;
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _figmaVariablesResolver = require("../../design-tokens/figma-variables-resolver");
|
|
10
|
+
var _reactUtils = require("../../utils/react-utils");
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
13
|
+
/**
|
|
14
|
+
* A single coloured run inside a {@link TextSegment}. Each run can carry its own
|
|
15
|
+
* `modes`, so individual fragments of the same paragraph can resolve different
|
|
16
|
+
* design tokens (most commonly a different `text/foreground` colour) while still
|
|
17
|
+
* flowing — and wrapping — inline as one continuous line of text.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
const TEXT_ALIGN_MAP = {
|
|
21
|
+
Left: 'left',
|
|
22
|
+
Center: 'center'
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Resolves the `text/*` design tokens for a given modes object into an RN
|
|
27
|
+
* `TextStyle`. Shared by the outer paragraph and every inline run so a run that
|
|
28
|
+
* only overrides colour still inherits the family/size/weight/spacing.
|
|
29
|
+
*/
|
|
30
|
+
function resolveTextStyle(modes) {
|
|
31
|
+
return {
|
|
32
|
+
color: (0, _figmaVariablesResolver.getVariableByName)('text/foreground', modes) ?? '#000000',
|
|
33
|
+
fontFamily: (0, _figmaVariablesResolver.getVariableByName)('text/fontFamily', modes) ?? 'JioType',
|
|
34
|
+
fontSize: (0, _figmaVariablesResolver.getVariableByName)('text/fontSize', modes) ?? 14,
|
|
35
|
+
fontWeight: String((0, _figmaVariablesResolver.getVariableByName)('text/fontWeight', modes) ?? '500'),
|
|
36
|
+
lineHeight: (0, _figmaVariablesResolver.getVariableByName)('text/lineHeight', modes) ?? 20,
|
|
37
|
+
letterSpacing: (0, _figmaVariablesResolver.getVariableByName)('text/letterSpacing', modes) ?? -0.5
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* TextSegment — composes several differently-styled text runs into a single
|
|
43
|
+
* paragraph that wraps as one continuous line.
|
|
44
|
+
*
|
|
45
|
+
* On the web you would reach for `<span>`s inside a `<p>`; the React Native
|
|
46
|
+
* equivalent is nesting `<Text>` inside a parent `<Text>`. That nesting is the
|
|
47
|
+
* whole trick: sibling `<View>`s would lay out as flex blocks and break onto
|
|
48
|
+
* rigid rows, but nested `<Text>` nodes flow inline and wrap naturally at word
|
|
49
|
+
* boundaries — exactly like a real paragraph — while each nested run keeps its
|
|
50
|
+
* own colour/weight resolved from its own `modes`.
|
|
51
|
+
*
|
|
52
|
+
* Two equivalent ways to author content:
|
|
53
|
+
* - **`segments` prop** — declarative array of `{ text, modes }` runs.
|
|
54
|
+
* - **`children`** — pass library `Text` elements (or strings); the parent
|
|
55
|
+
* `modes` cascade down and each child may override its own.
|
|
56
|
+
*
|
|
57
|
+
* @example Data-driven
|
|
58
|
+
* ```tsx
|
|
59
|
+
* <TextSegment
|
|
60
|
+
* segments={[
|
|
61
|
+
* { text: 'Upsell message ' },
|
|
62
|
+
* { text: 'JioFinance+', modes: { 'Text Appearance': 'Primary' } },
|
|
63
|
+
* ]}
|
|
64
|
+
* />
|
|
65
|
+
* ```
|
|
66
|
+
*
|
|
67
|
+
* @example Compositional
|
|
68
|
+
* ```tsx
|
|
69
|
+
* <TextSegment numberOfLines={2}>
|
|
70
|
+
* <Text>Pay with </Text>
|
|
71
|
+
* <Text modes={{ 'Text Appearance': 'Primary' }}>JioFinance+</Text>
|
|
72
|
+
* <Text> and earn rewards on every transaction.</Text>
|
|
73
|
+
* </TextSegment>
|
|
74
|
+
* ```
|
|
75
|
+
*/
|
|
76
|
+
function TextSegment({
|
|
77
|
+
segments,
|
|
78
|
+
children,
|
|
79
|
+
textAlign = 'Left',
|
|
80
|
+
numberOfLines,
|
|
81
|
+
modes = _reactUtils.EMPTY_MODES,
|
|
82
|
+
style
|
|
83
|
+
}) {
|
|
84
|
+
const baseStyle = (0, _react.useMemo)(() => ({
|
|
85
|
+
...resolveTextStyle(modes),
|
|
86
|
+
textAlign: TEXT_ALIGN_MAP[textAlign]
|
|
87
|
+
}), [modes, textAlign]);
|
|
88
|
+
|
|
89
|
+
// children win over `segments` so the compositional API can always override.
|
|
90
|
+
const hasChildren = children !== undefined && children !== null && children !== false;
|
|
91
|
+
const renderedSegments = (0, _react.useMemo)(() => {
|
|
92
|
+
if (hasChildren || !segments?.length) return null;
|
|
93
|
+
return segments.map((run, index) => {
|
|
94
|
+
// Parent modes first, then the run's own modes override them — mirrors the
|
|
95
|
+
// merge order used by `cloneChildrenWithModes` for the children API.
|
|
96
|
+
const runModes = run.modes ? {
|
|
97
|
+
...modes,
|
|
98
|
+
...run.modes
|
|
99
|
+
} : modes;
|
|
100
|
+
const runStyle = run.modes ? resolveTextStyle(runModes) : undefined;
|
|
101
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
102
|
+
style: [runStyle, run.style],
|
|
103
|
+
children: run.text
|
|
104
|
+
}, index);
|
|
105
|
+
});
|
|
106
|
+
}, [segments, hasChildren, modes]);
|
|
107
|
+
|
|
108
|
+
// The cascade: every child (and its descendants) receives the parent modes so
|
|
109
|
+
// nested library `Text` runs resolve their tokens against the same baseline,
|
|
110
|
+
// while still honouring any per-child `modes` override.
|
|
111
|
+
const content = hasChildren ? (0, _reactUtils.cloneChildrenWithModes)(children, modes) : renderedSegments;
|
|
112
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
113
|
+
style: [baseStyle, style],
|
|
114
|
+
numberOfLines: numberOfLines,
|
|
115
|
+
children: content
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
var _default = exports.default = /*#__PURE__*/_react.default.memo(TextSegment);
|