jfs-components 0.0.62 → 0.0.64
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 +59 -0
- package/lib/commonjs/components/Accordion/Accordion.js +1 -1
- package/lib/commonjs/components/ActionFooter/ActionFooter.js +1 -1
- package/lib/commonjs/components/ActionTile/ActionTile.js +2 -1
- package/lib/commonjs/components/AmountInput/AmountInput.js +2 -1
- package/lib/commonjs/components/AppBar/AppBar.js +1 -1
- package/lib/commonjs/components/Avatar/Avatar.js +184 -162
- package/lib/commonjs/components/AvatarGroup/AvatarGroup.js +1 -1
- package/lib/commonjs/components/Badge/Badge.js +2 -1
- package/lib/commonjs/components/Balance/Balance.js +2 -1
- package/lib/commonjs/components/BottomNav/BottomNav.js +2 -1
- package/lib/commonjs/components/BottomNavItem/BottomNavItem.js +106 -86
- package/lib/commonjs/components/Button/Button.js +190 -93
- package/lib/commonjs/components/ButtonGroup/ButtonGroup.js +1 -1
- package/lib/commonjs/components/Card/Card.js +2 -1
- package/lib/commonjs/components/CardCTA/CardCTA.js +1 -1
- package/lib/commonjs/components/CardProviderInfo/CardProviderInfo.js +1 -1
- package/lib/commonjs/components/Carousel/Carousel.js +3 -2
- package/lib/commonjs/components/Checkbox/Checkbox.js +2 -1
- package/lib/commonjs/components/ChipGroup/ChipGroup.js +1 -1
- package/lib/commonjs/components/ChipSelect/ChipSelect.js +2 -1
- package/lib/commonjs/components/DebitCard/DebitCard.js +1 -1
- package/lib/commonjs/components/Disclaimer/Disclaimer.js +2 -1
- package/lib/commonjs/components/Divider/Divider.js +2 -1
- package/lib/commonjs/components/Drawer/Drawer.js +109 -48
- package/lib/commonjs/components/EmptyState/EmptyState.js +2 -1
- package/lib/commonjs/components/FilterBar/FilterBar.js +1 -1
- package/lib/commonjs/components/Form/Form.js +2 -1
- package/lib/commonjs/components/FormField/FormField.js +3 -2
- package/lib/commonjs/components/HStack/HStack.js +1 -1
- package/lib/commonjs/components/HoldingsCard/HoldingsCard.js +2 -1
- package/lib/commonjs/components/IconButton/IconButton.js +118 -128
- package/lib/commonjs/components/IconCapsule/IconCapsule.js +61 -57
- package/lib/commonjs/components/InputSearch/InputSearch.js +7 -3
- package/lib/commonjs/components/LazyList/LazyList.js +1 -1
- package/lib/commonjs/components/LinearMeter/LinearMeter.js +3 -2
- package/lib/commonjs/components/ListGroup/ListGroup.js +1 -1
- package/lib/commonjs/components/ListItem/ListItem.js +190 -142
- package/lib/commonjs/components/MediaCard/MediaCard.js +3 -3
- package/lib/commonjs/components/MerchantProfile/MerchantProfile.js +2 -1
- package/lib/commonjs/components/MoneyValue/MoneyValue.js +2 -1
- package/lib/commonjs/components/NavArrow/NavArrow.js +82 -59
- package/lib/commonjs/components/NoteInput/NoteInput.js +2 -1
- package/lib/commonjs/components/Nudge/Nudge.js +1 -1
- package/lib/commonjs/components/Numpad/Numpad.js +2 -1
- package/lib/commonjs/components/OTP/OTP.js +1 -1
- package/lib/commonjs/components/PaymentFeedback/PaymentFeedback.js +2 -1
- package/lib/commonjs/components/Popup/Popup.js +2 -1
- package/lib/commonjs/components/ProductLabel/ProductLabel.js +2 -1
- package/lib/commonjs/components/ProgressBadge/ProgressBadge.js +2 -1
- package/lib/commonjs/components/RadioButton/RadioButton.js +2 -1
- package/lib/commonjs/components/RechargeCard/RechargeCard.js +2 -1
- package/lib/commonjs/components/Screen/Screen.js +1 -1
- package/lib/commonjs/components/Section/Section.js +500 -166
- package/lib/commonjs/components/SegmentedControl/SegmentedControl.js +3 -2
- package/lib/commonjs/components/StatItem/StatItem.js +2 -1
- package/lib/commonjs/components/StatusHero/StatusHero.js +2 -1
- package/lib/commonjs/components/Stepper/Step.js +2 -1
- package/lib/commonjs/components/Stepper/StepLabel.js +2 -1
- package/lib/commonjs/components/Stepper/Stepper.js +2 -1
- package/lib/commonjs/components/SupportText/SupportText.js +2 -1
- package/lib/commonjs/components/SupportText/SupportTextIcon.js +2 -1
- package/lib/commonjs/components/SwappableAmount/SwappableAmount.js +2 -1
- package/lib/commonjs/components/Tabs/TabItem.js +2 -1
- package/lib/commonjs/components/Tabs/Tabs.js +2 -1
- package/lib/commonjs/components/Text/Text.js +2 -1
- package/lib/commonjs/components/TextInput/TextInput.js +2 -2
- package/lib/commonjs/components/ThreadHero/ThreadHero.js +2 -1
- package/lib/commonjs/components/Title/Title.js +2 -1
- package/lib/commonjs/components/Toast/Toast.js +2 -1
- package/lib/commonjs/components/Toggle/Toggle.js +2 -1
- package/lib/commonjs/components/Tooltip/Tooltip.js +2 -1
- package/lib/commonjs/components/TransactionBubble/TransactionBubble.js +1 -1
- package/lib/commonjs/components/TransactionDetails/TransactionDetails.js +2 -2
- package/lib/commonjs/components/TransactionStatus/TransactionStatus.js +3 -2
- package/lib/commonjs/components/UpiHandle/UpiHandle.js +144 -110
- package/lib/commonjs/components/VStack/VStack.js +1 -1
- package/lib/commonjs/design-tokens/figma-variables-resolver.js +21 -3
- package/lib/commonjs/icons/registry.js +1 -1
- package/lib/commonjs/utils/react-utils.js +17 -0
- package/lib/module/components/Accordion/Accordion.js +2 -2
- package/lib/module/components/ActionFooter/ActionFooter.js +2 -2
- package/lib/module/components/ActionTile/ActionTile.js +2 -1
- package/lib/module/components/AmountInput/AmountInput.js +2 -1
- package/lib/module/components/AppBar/AppBar.js +2 -2
- package/lib/module/components/Avatar/Avatar.js +184 -162
- package/lib/module/components/AvatarGroup/AvatarGroup.js +2 -2
- package/lib/module/components/Badge/Badge.js +2 -1
- package/lib/module/components/Balance/Balance.js +2 -1
- package/lib/module/components/BottomNav/BottomNav.js +2 -1
- package/lib/module/components/BottomNavItem/BottomNavItem.js +108 -88
- package/lib/module/components/Button/Button.js +192 -95
- package/lib/module/components/ButtonGroup/ButtonGroup.js +2 -2
- package/lib/module/components/Card/Card.js +2 -1
- package/lib/module/components/CardCTA/CardCTA.js +2 -2
- package/lib/module/components/CardProviderInfo/CardProviderInfo.js +2 -2
- package/lib/module/components/Carousel/Carousel.js +3 -2
- package/lib/module/components/Checkbox/Checkbox.js +2 -1
- package/lib/module/components/ChipGroup/ChipGroup.js +2 -2
- package/lib/module/components/ChipSelect/ChipSelect.js +2 -1
- package/lib/module/components/DebitCard/DebitCard.js +2 -2
- package/lib/module/components/Disclaimer/Disclaimer.js +2 -1
- package/lib/module/components/Divider/Divider.js +2 -1
- package/lib/module/components/Drawer/Drawer.js +109 -48
- package/lib/module/components/EmptyState/EmptyState.js +2 -1
- package/lib/module/components/FilterBar/FilterBar.js +2 -2
- package/lib/module/components/Form/Form.js +2 -1
- package/lib/module/components/FormField/FormField.js +3 -2
- package/lib/module/components/HStack/HStack.js +2 -2
- package/lib/module/components/HoldingsCard/HoldingsCard.js +2 -1
- package/lib/module/components/IconButton/IconButton.js +120 -130
- package/lib/module/components/IconCapsule/IconCapsule.js +60 -57
- package/lib/module/components/InputSearch/InputSearch.js +7 -3
- package/lib/module/components/LazyList/LazyList.js +2 -2
- package/lib/module/components/LinearMeter/LinearMeter.js +3 -2
- package/lib/module/components/ListGroup/ListGroup.js +2 -2
- package/lib/module/components/ListItem/ListItem.js +194 -146
- package/lib/module/components/MediaCard/MediaCard.js +4 -2
- package/lib/module/components/MerchantProfile/MerchantProfile.js +2 -1
- package/lib/module/components/MoneyValue/MoneyValue.js +2 -1
- package/lib/module/components/NavArrow/NavArrow.js +82 -58
- package/lib/module/components/NoteInput/NoteInput.js +2 -1
- package/lib/module/components/Nudge/Nudge.js +2 -2
- package/lib/module/components/Numpad/Numpad.js +2 -1
- package/lib/module/components/OTP/OTP.js +2 -2
- package/lib/module/components/PaymentFeedback/PaymentFeedback.js +2 -1
- package/lib/module/components/Popup/Popup.js +2 -1
- package/lib/module/components/ProductLabel/ProductLabel.js +2 -1
- package/lib/module/components/ProgressBadge/ProgressBadge.js +2 -1
- package/lib/module/components/RadioButton/RadioButton.js +2 -1
- package/lib/module/components/RechargeCard/RechargeCard.js +2 -1
- package/lib/module/components/Screen/Screen.js +2 -2
- package/lib/module/components/Section/Section.js +503 -169
- package/lib/module/components/SegmentedControl/SegmentedControl.js +3 -2
- package/lib/module/components/StatItem/StatItem.js +2 -1
- package/lib/module/components/StatusHero/StatusHero.js +2 -1
- package/lib/module/components/Stepper/Step.js +2 -1
- package/lib/module/components/Stepper/StepLabel.js +2 -1
- package/lib/module/components/Stepper/Stepper.js +2 -1
- package/lib/module/components/SupportText/SupportText.js +2 -1
- package/lib/module/components/SupportText/SupportTextIcon.js +2 -1
- package/lib/module/components/SwappableAmount/SwappableAmount.js +2 -1
- package/lib/module/components/Tabs/TabItem.js +2 -1
- package/lib/module/components/Tabs/Tabs.js +2 -1
- package/lib/module/components/Text/Text.js +2 -1
- package/lib/module/components/TextInput/TextInput.js +3 -3
- package/lib/module/components/ThreadHero/ThreadHero.js +2 -1
- package/lib/module/components/Title/Title.js +2 -1
- package/lib/module/components/Toast/Toast.js +2 -1
- package/lib/module/components/Toggle/Toggle.js +2 -1
- package/lib/module/components/Tooltip/Tooltip.js +2 -1
- package/lib/module/components/TransactionBubble/TransactionBubble.js +2 -2
- package/lib/module/components/TransactionDetails/TransactionDetails.js +3 -3
- package/lib/module/components/TransactionStatus/TransactionStatus.js +3 -2
- package/lib/module/components/UpiHandle/UpiHandle.js +147 -113
- package/lib/module/components/VStack/VStack.js +2 -2
- package/lib/module/design-tokens/figma-variables-resolver.js +21 -3
- package/lib/module/icons/registry.js +1 -1
- package/lib/module/utils/react-utils.js +16 -0
- package/lib/typescript/src/components/Avatar/Avatar.d.ts +11 -17
- package/lib/typescript/src/components/BottomNavItem/BottomNavItem.d.ts +12 -8
- package/lib/typescript/src/components/Button/Button.d.ts +18 -1
- package/lib/typescript/src/components/IconButton/IconButton.d.ts +12 -29
- package/lib/typescript/src/components/IconCapsule/IconCapsule.d.ts +10 -18
- package/lib/typescript/src/components/InputSearch/InputSearch.d.ts +8 -3
- package/lib/typescript/src/components/ListItem/ListItem.d.ts +14 -1
- package/lib/typescript/src/components/NavArrow/NavArrow.d.ts +12 -11
- package/lib/typescript/src/components/Section/Section.d.ts +43 -48
- package/lib/typescript/src/components/UpiHandle/UpiHandle.d.ts +13 -12
- package/lib/typescript/src/icons/registry.d.ts +1 -1
- package/lib/typescript/src/utils/react-utils.d.ts +15 -0
- package/package.json +4 -6
- package/src/components/Accordion/Accordion.tsx +2 -2
- package/src/components/ActionFooter/ActionFooter.tsx +2 -2
- package/src/components/ActionTile/ActionTile.tsx +2 -1
- package/src/components/AmountInput/AmountInput.tsx +2 -1
- package/src/components/AppBar/AppBar.tsx +2 -2
- package/src/components/Avatar/Avatar.tsx +229 -158
- package/src/components/AvatarGroup/AvatarGroup.tsx +2 -2
- package/src/components/Badge/Badge.tsx +2 -1
- package/src/components/Balance/Balance.tsx +2 -1
- package/src/components/BottomNav/BottomNav.tsx +2 -1
- package/src/components/BottomNavItem/BottomNavItem.tsx +159 -88
- package/src/components/Button/Button.tsx +228 -101
- package/src/components/ButtonGroup/ButtonGroup.tsx +2 -2
- package/src/components/Card/Card.tsx +2 -1
- package/src/components/CardCTA/CardCTA.tsx +2 -2
- package/src/components/CardProviderInfo/CardProviderInfo.tsx +2 -2
- package/src/components/Carousel/Carousel.tsx +3 -2
- package/src/components/Checkbox/Checkbox.tsx +2 -1
- package/src/components/ChipGroup/ChipGroup.tsx +2 -2
- package/src/components/ChipSelect/ChipSelect.tsx +2 -1
- package/src/components/DebitCard/DebitCard.tsx +2 -2
- package/src/components/Disclaimer/Disclaimer.tsx +2 -1
- package/src/components/Divider/Divider.tsx +2 -1
- package/src/components/Drawer/Drawer.tsx +124 -58
- package/src/components/EmptyState/EmptyState.tsx +2 -1
- package/src/components/FilterBar/FilterBar.tsx +2 -2
- package/src/components/Form/Form.tsx +2 -1
- package/src/components/FormField/FormField.tsx +3 -2
- package/src/components/HStack/HStack.tsx +2 -2
- package/src/components/HoldingsCard/HoldingsCard.tsx +2 -1
- package/src/components/IconButton/IconButton.tsx +154 -126
- package/src/components/IconCapsule/IconCapsule.tsx +73 -54
- package/src/components/InputSearch/InputSearch.tsx +19 -5
- package/src/components/LazyList/LazyList.tsx +2 -2
- package/src/components/LinearMeter/LinearMeter.tsx +3 -2
- package/src/components/ListGroup/ListGroup.tsx +2 -2
- package/src/components/ListItem/ListItem.tsx +257 -187
- package/src/components/MediaCard/MediaCard.tsx +2 -1
- package/src/components/MerchantProfile/MerchantProfile.tsx +2 -1
- package/src/components/MoneyValue/MoneyValue.tsx +2 -1
- package/src/components/NavArrow/NavArrow.tsx +91 -58
- package/src/components/NoteInput/NoteInput.tsx +2 -1
- package/src/components/Nudge/Nudge.tsx +2 -2
- package/src/components/Numpad/Numpad.tsx +2 -1
- package/src/components/OTP/OTP.tsx +2 -2
- package/src/components/PaymentFeedback/PaymentFeedback.tsx +2 -1
- package/src/components/Popup/Popup.tsx +2 -1
- package/src/components/ProductLabel/ProductLabel.tsx +2 -1
- package/src/components/ProgressBadge/ProgressBadge.tsx +2 -2
- package/src/components/RadioButton/RadioButton.tsx +2 -1
- package/src/components/RechargeCard/RechargeCard.tsx +2 -1
- package/src/components/Screen/Screen.tsx +2 -2
- package/src/components/Section/Section.tsx +672 -176
- package/src/components/SegmentedControl/SegmentedControl.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/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/Text/Text.tsx +2 -1
- package/src/components/TextInput/TextInput.tsx +3 -3
- 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/Toggle/Toggle.tsx +2 -1
- package/src/components/Tooltip/Tooltip.tsx +2 -1
- package/src/components/TransactionBubble/TransactionBubble.tsx +2 -2
- package/src/components/TransactionDetails/TransactionDetails.tsx +3 -3
- package/src/components/TransactionStatus/TransactionStatus.tsx +3 -2
- package/src/components/UpiHandle/UpiHandle.tsx +193 -125
- package/src/components/VStack/VStack.tsx +2 -2
- package/src/design-tokens/figma-variables-resolver.ts +21 -3
- package/src/icons/registry.ts +1 -1
- package/src/utils/react-utils.ts +16 -0
- package/lib/typescript/App.d.ts +0 -2
- package/lib/typescript/index.d.ts +0 -2
- package/lib/typescript/metro.config.d.ts +0 -78
- package/lib/typescript/react-native.config.d.ts +0 -4
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import React from 'react'
|
|
1
|
+
import React, { useMemo } from 'react'
|
|
2
2
|
import { View, type ViewStyle } from 'react-native'
|
|
3
3
|
import Svg, { Polyline } from 'react-native-svg'
|
|
4
4
|
import { getVariableByName } from '../../design-tokens/figma-variables-resolver'
|
|
5
|
+
import { EMPTY_MODES } from '../../utils/react-utils'
|
|
5
6
|
|
|
6
7
|
type NavArrowDirection = 'Back' | 'Forward' | 'Down'
|
|
7
8
|
|
|
@@ -16,27 +17,18 @@ type NavArrowProps = {
|
|
|
16
17
|
accessibilityLabel?: string
|
|
17
18
|
} & Omit<React.ComponentProps<typeof View>, 'style' | 'accessibilityLabel'>
|
|
18
19
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
* - navArrow/background - background color
|
|
32
|
-
*/
|
|
33
|
-
export default function NavArrow({
|
|
34
|
-
direction = 'Back',
|
|
35
|
-
modes = {},
|
|
36
|
-
style,
|
|
37
|
-
accessibilityLabel,
|
|
38
|
-
...rest
|
|
39
|
-
}: NavArrowProps) {
|
|
20
|
+
interface NavArrowTokens {
|
|
21
|
+
iconColor: string
|
|
22
|
+
iconWidth: number
|
|
23
|
+
iconHeight: number
|
|
24
|
+
strokeWeight: number
|
|
25
|
+
widthToken: number
|
|
26
|
+
heightToken: number
|
|
27
|
+
borderRadius: number
|
|
28
|
+
backgroundColor: string
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function resolveNavArrowTokens(modes: Record<string, any>): NavArrowTokens {
|
|
40
32
|
const iconColor =
|
|
41
33
|
(getVariableByName('navArrow/icon/color', modes) as string) || '#24262b'
|
|
42
34
|
|
|
@@ -52,19 +44,79 @@ export default function NavArrow({
|
|
|
52
44
|
const strokeWeight =
|
|
53
45
|
Number(getVariableByName('navArrow/icon/strokeWeight', modes)) || 2
|
|
54
46
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
47
|
+
return {
|
|
48
|
+
iconColor,
|
|
49
|
+
iconWidth,
|
|
50
|
+
iconHeight,
|
|
51
|
+
strokeWeight,
|
|
52
|
+
widthToken,
|
|
53
|
+
heightToken,
|
|
62
54
|
borderRadius,
|
|
63
55
|
backgroundColor,
|
|
64
|
-
alignItems: 'center',
|
|
65
|
-
justifyContent: 'center',
|
|
66
|
-
...(style || {}),
|
|
67
56
|
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* NavArrow component that displays a chevron arrow for navigation.
|
|
61
|
+
*
|
|
62
|
+
* Renders a stroked SVG chevron whose dimensions and thickness are
|
|
63
|
+
* fully driven by design tokens.
|
|
64
|
+
*
|
|
65
|
+
* Performance notes:
|
|
66
|
+
* - Token reads collapsed into a single `useMemo([modes])` so a parent
|
|
67
|
+
* re-render (e.g. from a Section header press) doesn't re-do ~9 token
|
|
68
|
+
* lookups per chevron.
|
|
69
|
+
* - Container + SVG layout values are derived in a second `useMemo` keyed
|
|
70
|
+
* on (tokens, direction, style).
|
|
71
|
+
* - Wrapped in `React.memo`.
|
|
72
|
+
*/
|
|
73
|
+
function NavArrow({
|
|
74
|
+
direction = 'Back',
|
|
75
|
+
modes = EMPTY_MODES,
|
|
76
|
+
style,
|
|
77
|
+
accessibilityLabel,
|
|
78
|
+
...rest
|
|
79
|
+
}: NavArrowProps) {
|
|
80
|
+
const tokens = useMemo(() => resolveNavArrowTokens(modes), [modes])
|
|
81
|
+
|
|
82
|
+
const computed = useMemo(() => {
|
|
83
|
+
const isDown = direction === 'Down'
|
|
84
|
+
const containerWidth = isDown ? tokens.heightToken : tokens.widthToken
|
|
85
|
+
const containerHeight = isDown ? tokens.widthToken : tokens.heightToken
|
|
86
|
+
|
|
87
|
+
const containerStyle: ViewStyle = {
|
|
88
|
+
width: containerWidth,
|
|
89
|
+
height: containerHeight,
|
|
90
|
+
borderRadius: tokens.borderRadius,
|
|
91
|
+
backgroundColor: tokens.backgroundColor,
|
|
92
|
+
alignItems: 'center',
|
|
93
|
+
justifyContent: 'center',
|
|
94
|
+
...(style || {}),
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
const chevronW = isDown ? tokens.iconHeight : tokens.iconWidth
|
|
98
|
+
const chevronH = isDown ? tokens.iconWidth : tokens.iconHeight
|
|
99
|
+
|
|
100
|
+
const pad = tokens.strokeWeight / 2
|
|
101
|
+
const svgWidth = chevronW + pad * 2
|
|
102
|
+
const svgHeight = chevronH + pad * 2
|
|
103
|
+
|
|
104
|
+
let points: string
|
|
105
|
+
switch (direction) {
|
|
106
|
+
case 'Forward':
|
|
107
|
+
points = `${pad},${pad} ${chevronW + pad},${chevronH / 2 + pad} ${pad},${chevronH + pad}`
|
|
108
|
+
break
|
|
109
|
+
case 'Down':
|
|
110
|
+
points = `${pad},${pad} ${chevronW / 2 + pad},${chevronH + pad} ${chevronW + pad},${pad}`
|
|
111
|
+
break
|
|
112
|
+
case 'Back':
|
|
113
|
+
default:
|
|
114
|
+
points = `${chevronW + pad},${pad} ${pad},${chevronH / 2 + pad} ${chevronW + pad},${chevronH + pad}`
|
|
115
|
+
break
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
return { containerStyle, svgWidth, svgHeight, points }
|
|
119
|
+
}, [tokens, direction, style])
|
|
68
120
|
|
|
69
121
|
const defaultAccessibilityLabel =
|
|
70
122
|
accessibilityLabel ||
|
|
@@ -74,39 +126,18 @@ export default function NavArrow({
|
|
|
74
126
|
? 'Go forward'
|
|
75
127
|
: 'Go down')
|
|
76
128
|
|
|
77
|
-
const chevronW = isDown ? iconHeight : iconWidth
|
|
78
|
-
const chevronH = isDown ? iconWidth : iconHeight
|
|
79
|
-
|
|
80
|
-
const pad = strokeWeight / 2
|
|
81
|
-
const svgWidth = chevronW + pad * 2
|
|
82
|
-
const svgHeight = chevronH + pad * 2
|
|
83
|
-
|
|
84
|
-
let points: string
|
|
85
|
-
switch (direction) {
|
|
86
|
-
case 'Forward':
|
|
87
|
-
points = `${pad},${pad} ${chevronW + pad},${chevronH / 2 + pad} ${pad},${chevronH + pad}`
|
|
88
|
-
break
|
|
89
|
-
case 'Down':
|
|
90
|
-
points = `${pad},${pad} ${chevronW / 2 + pad},${chevronH + pad} ${chevronW + pad},${pad}`
|
|
91
|
-
break
|
|
92
|
-
case 'Back':
|
|
93
|
-
default:
|
|
94
|
-
points = `${chevronW + pad},${pad} ${pad},${chevronH / 2 + pad} ${chevronW + pad},${chevronH + pad}`
|
|
95
|
-
break
|
|
96
|
-
}
|
|
97
|
-
|
|
98
129
|
return (
|
|
99
130
|
<View
|
|
100
|
-
style={containerStyle}
|
|
131
|
+
style={computed.containerStyle}
|
|
101
132
|
accessibilityRole="image"
|
|
102
133
|
accessibilityLabel={defaultAccessibilityLabel}
|
|
103
134
|
{...rest}
|
|
104
135
|
>
|
|
105
|
-
<Svg width={svgWidth} height={svgHeight} viewBox={`0 0 ${svgWidth} ${svgHeight}`}>
|
|
136
|
+
<Svg width={computed.svgWidth} height={computed.svgHeight} viewBox={`0 0 ${computed.svgWidth} ${computed.svgHeight}`}>
|
|
106
137
|
<Polyline
|
|
107
|
-
points={points}
|
|
108
|
-
stroke={iconColor}
|
|
109
|
-
strokeWidth={strokeWeight}
|
|
138
|
+
points={computed.points}
|
|
139
|
+
stroke={tokens.iconColor}
|
|
140
|
+
strokeWidth={tokens.strokeWeight}
|
|
110
141
|
strokeLinecap="round"
|
|
111
142
|
strokeLinejoin="round"
|
|
112
143
|
fill="none"
|
|
@@ -115,3 +146,5 @@ export default function NavArrow({
|
|
|
115
146
|
</View>
|
|
116
147
|
)
|
|
117
148
|
}
|
|
149
|
+
|
|
150
|
+
export default React.memo(NavArrow)
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
type TextInputProps,
|
|
12
12
|
} from 'react-native'
|
|
13
13
|
import { getVariableByName } from '../../design-tokens/figma-variables-resolver'
|
|
14
|
+
import { EMPTY_MODES } from '../../utils/react-utils'
|
|
14
15
|
|
|
15
16
|
export type NoteInputProps = {
|
|
16
17
|
/** The value of the text input */
|
|
@@ -37,7 +38,7 @@ export default function NoteInput({
|
|
|
37
38
|
value = '',
|
|
38
39
|
placeholder = 'Add note',
|
|
39
40
|
onChangeText,
|
|
40
|
-
modes =
|
|
41
|
+
modes = EMPTY_MODES,
|
|
41
42
|
style,
|
|
42
43
|
textStyle,
|
|
43
44
|
state: explicitState,
|
|
@@ -2,7 +2,7 @@ import React from 'react'
|
|
|
2
2
|
import { View, Text, type ViewStyle, type TextStyle, type StyleProp } from 'react-native'
|
|
3
3
|
import { getVariableByName } from '../../design-tokens/figma-variables-resolver'
|
|
4
4
|
import { useTokens } from '../../design-tokens/JFSThemeProvider'
|
|
5
|
-
import { cloneChildrenWithModes } from '../../utils/react-utils'
|
|
5
|
+
import { cloneChildrenWithModes, EMPTY_MODES } from '../../utils/react-utils'
|
|
6
6
|
import Button from '../Button/Button'
|
|
7
7
|
|
|
8
8
|
export type NudgeProps = {
|
|
@@ -41,7 +41,7 @@ function Nudge({
|
|
|
41
41
|
buttonSlot,
|
|
42
42
|
startSlot,
|
|
43
43
|
children,
|
|
44
|
-
modes: propModes =
|
|
44
|
+
modes: propModes = EMPTY_MODES,
|
|
45
45
|
style,
|
|
46
46
|
}: NudgeProps) {
|
|
47
47
|
const { modes: globalModes } = useTokens()
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
type TextStyle,
|
|
9
9
|
} from 'react-native'
|
|
10
10
|
import { getVariableByName } from '../../design-tokens/figma-variables-resolver'
|
|
11
|
+
import { EMPTY_MODES } from '../../utils/react-utils'
|
|
11
12
|
import Icon from '../../icons/Icon'
|
|
12
13
|
|
|
13
14
|
export type NumpadKeyValue =
|
|
@@ -65,7 +66,7 @@ function shuffleArray<T>(arr: T[]): T[] {
|
|
|
65
66
|
* @param {NumpadProps} props
|
|
66
67
|
*/
|
|
67
68
|
function Numpad({
|
|
68
|
-
modes =
|
|
69
|
+
modes = EMPTY_MODES,
|
|
69
70
|
onKeyPress,
|
|
70
71
|
showDecimal = true,
|
|
71
72
|
shuffle = true,
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
import { getVariableByName } from '../../design-tokens/figma-variables-resolver'
|
|
13
13
|
import { useTokens } from '../../design-tokens/JFSThemeProvider'
|
|
14
14
|
import SupportText, { type SupportTextProps } from '../SupportText/SupportText'
|
|
15
|
-
import { cloneChildrenWithModes } from '../../utils/react-utils'
|
|
15
|
+
import { cloneChildrenWithModes, EMPTY_MODES } from '../../utils/react-utils'
|
|
16
16
|
|
|
17
17
|
export type OTPProps = {
|
|
18
18
|
/** Number of OTP digits. Defaults to 6. */
|
|
@@ -58,7 +58,7 @@ function OTP({
|
|
|
58
58
|
isInvalid = false,
|
|
59
59
|
allowedPattern = DIGITS_ONLY,
|
|
60
60
|
autoFocus = false,
|
|
61
|
-
modes: propModes =
|
|
61
|
+
modes: propModes = EMPTY_MODES,
|
|
62
62
|
style,
|
|
63
63
|
supportText,
|
|
64
64
|
supportTextStatus,
|
|
@@ -3,6 +3,7 @@ import { View, Text, type ViewStyle, type TextStyle } from 'react-native'
|
|
|
3
3
|
import { getVariableByName } from '../../design-tokens/figma-variables-resolver'
|
|
4
4
|
import { useTokens } from '../../design-tokens/JFSThemeProvider'
|
|
5
5
|
import IconCapsule from '../IconCapsule/IconCapsule'
|
|
6
|
+
import { EMPTY_MODES } from '../../utils/react-utils'
|
|
6
7
|
|
|
7
8
|
export type PaymentFeedbackProps = {
|
|
8
9
|
/** Large heading text, typically a monetary value (e.g. "₹50,000") */
|
|
@@ -32,7 +33,7 @@ export default function PaymentFeedback({
|
|
|
32
33
|
showDetails = true,
|
|
33
34
|
iconName = 'ic_confirm',
|
|
34
35
|
renderMedia,
|
|
35
|
-
modes: propModes =
|
|
36
|
+
modes: propModes = EMPTY_MODES,
|
|
36
37
|
style,
|
|
37
38
|
}: PaymentFeedbackProps) {
|
|
38
39
|
const { modes: globalModes } = useTokens()
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
import { getVariableByName } from '../../design-tokens/figma-variables-resolver'
|
|
13
13
|
import { useTokens } from '../../design-tokens/JFSThemeProvider'
|
|
14
14
|
import VStack from '../VStack/VStack'
|
|
15
|
+
import { EMPTY_MODES } from '../../utils/react-utils'
|
|
15
16
|
|
|
16
17
|
export type PopupRef = {
|
|
17
18
|
open: () => void
|
|
@@ -50,7 +51,7 @@ const Popup = forwardRef<PopupRef, PopupProps>(function Popup(
|
|
|
50
51
|
onOpenChange,
|
|
51
52
|
trigger,
|
|
52
53
|
children,
|
|
53
|
-
modes: propModes =
|
|
54
|
+
modes: propModes = EMPTY_MODES,
|
|
54
55
|
closeOnBackdropPress = true,
|
|
55
56
|
backdropColor = '#000000',
|
|
56
57
|
backdropOpacity: maxBackdropOpacity = 0.5,
|
|
@@ -2,6 +2,7 @@ import React from 'react'
|
|
|
2
2
|
import { View, Text, type ViewStyle, type TextStyle, type ImageSourcePropType } from 'react-native'
|
|
3
3
|
import { getVariableByName } from '../../design-tokens/figma-variables-resolver'
|
|
4
4
|
import Avatar from '../Avatar/Avatar'
|
|
5
|
+
import { EMPTY_MODES } from '../../utils/react-utils'
|
|
5
6
|
|
|
6
7
|
export type ProductLabelProps = {
|
|
7
8
|
/** The product name label text. */
|
|
@@ -17,7 +18,7 @@ export type ProductLabelProps = {
|
|
|
17
18
|
function ProductLabel({
|
|
18
19
|
label = 'Gold',
|
|
19
20
|
imageSource,
|
|
20
|
-
modes =
|
|
21
|
+
modes = EMPTY_MODES,
|
|
21
22
|
style,
|
|
22
23
|
}: ProductLabelProps) {
|
|
23
24
|
const gap = getVariableByName('productLabel/gap', modes) ?? 8
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from 'react-native'
|
|
9
9
|
import { getVariableByName } from '../../design-tokens/figma-variables-resolver'
|
|
10
10
|
import Icon from '../../icons/Icon'
|
|
11
|
-
import { cloneChildrenWithModes } from '../../utils/react-utils'
|
|
11
|
+
import { EMPTY_MODES, cloneChildrenWithModes } from '../../utils/react-utils'
|
|
12
12
|
|
|
13
13
|
export type ProgressBadgeProps = {
|
|
14
14
|
/** The text displayed in the badge (e.g. "Live price...") */
|
|
@@ -46,7 +46,7 @@ function ProgressBadge({
|
|
|
46
46
|
taskName = 'Live price: [price] (00:43)',
|
|
47
47
|
iconName = 'ic_live',
|
|
48
48
|
value = 0,
|
|
49
|
-
modes =
|
|
49
|
+
modes = EMPTY_MODES,
|
|
50
50
|
style,
|
|
51
51
|
textStyle: textStyleOverride,
|
|
52
52
|
accessibilityLabel,
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
StyleProp,
|
|
10
10
|
} from 'react-native'
|
|
11
11
|
import { getVariableByName } from '../../design-tokens/figma-variables-resolver'
|
|
12
|
+
import { EMPTY_MODES } from '../../utils/react-utils'
|
|
12
13
|
|
|
13
14
|
// ---------------------------------------------------------------------------
|
|
14
15
|
// Props
|
|
@@ -49,7 +50,7 @@ export function RadioButton({
|
|
|
49
50
|
selected = false,
|
|
50
51
|
disabled = false,
|
|
51
52
|
onPress,
|
|
52
|
-
modes =
|
|
53
|
+
modes = EMPTY_MODES,
|
|
53
54
|
style,
|
|
54
55
|
testID,
|
|
55
56
|
}: RadioButtonProps) {
|
|
@@ -3,6 +3,7 @@ import { View, Text, StyleSheet, type ViewStyle } from 'react-native';
|
|
|
3
3
|
import ButtonGroup from '../ButtonGroup/ButtonGroup';
|
|
4
4
|
import AvatarGroup from '../AvatarGroup/AvatarGroup';
|
|
5
5
|
import { getVariableByName } from '../../design-tokens/figma-variables-resolver';
|
|
6
|
+
import { EMPTY_MODES } from '../../utils/react-utils';
|
|
6
7
|
import MoneyValue from '../MoneyValue/MoneyValue';
|
|
7
8
|
import Button from '../Button/Button';
|
|
8
9
|
|
|
@@ -62,7 +63,7 @@ export default function RechargeCard({
|
|
|
62
63
|
disclaimer = "Data only pack (No Voice & No SMS)\nVoice: NA | SMS: NA...",
|
|
63
64
|
subscriptionContent,
|
|
64
65
|
actions,
|
|
65
|
-
modes =
|
|
66
|
+
modes = EMPTY_MODES,
|
|
66
67
|
style,
|
|
67
68
|
}: RechargeCardProps) {
|
|
68
69
|
// Container Tokens
|
|
@@ -7,7 +7,7 @@ import { useTokens } from '../../design-tokens/JFSThemeProvider'
|
|
|
7
7
|
* Helper function to recursively clone children and pass modes prop to components that accept it.
|
|
8
8
|
* This ensures that all child components in slots receive the modes prop from the parent.
|
|
9
9
|
*/
|
|
10
|
-
import { cloneChildrenWithModes } from '../../utils/react-utils'
|
|
10
|
+
import { cloneChildrenWithModes, EMPTY_MODES } from '../../utils/react-utils'
|
|
11
11
|
|
|
12
12
|
export interface ScreenProps {
|
|
13
13
|
/**
|
|
@@ -30,7 +30,7 @@ export interface ScreenProps {
|
|
|
30
30
|
*/
|
|
31
31
|
export const Screen = ({
|
|
32
32
|
children,
|
|
33
|
-
modes: propModes =
|
|
33
|
+
modes: propModes = EMPTY_MODES,
|
|
34
34
|
style
|
|
35
35
|
}: ScreenProps) => {
|
|
36
36
|
const { modes: globalModes } = useTokens()
|