jfs-components 0.0.61 → 0.0.63
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 +36 -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 +2 -1
- 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 +2 -3
- 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 +268 -156
- 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/JFSThemeProvider.js +2 -38
- 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 +26 -3
- 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 +2 -1
- 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 +3 -4
- 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 +271 -159
- 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/JFSThemeProvider.js +2 -35
- 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 +25 -3
- 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 +2 -48
- package/lib/typescript/src/components/UpiHandle/UpiHandle.d.ts +13 -12
- package/lib/typescript/src/design-tokens/JFSThemeProvider.d.ts +0 -15
- 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 +2 -1
- 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 +4 -5
- 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 +323 -167
- 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/JFSThemeProvider.tsx +1 -37
- package/src/design-tokens/figma-variables-resolver.ts +21 -3
- package/src/icons/registry.ts +1 -1
- package/src/utils/react-utils.ts +29 -3
- 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
|
@@ -2,13 +2,32 @@
|
|
|
2
2
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* A shared, frozen empty modes object.
|
|
7
|
+
*
|
|
8
|
+
* Components that accept a `modes` prop should use this as the default value
|
|
9
|
+
* instead of the inline `{}` literal. The literal allocates a new object on
|
|
10
|
+
* every render, which:
|
|
11
|
+
* 1. Forces `React.memo` shallow comparisons to fail.
|
|
12
|
+
* 2. Forces `useMemo`/`useEffect` deps that include `modes` to re-run.
|
|
13
|
+
* 3. Forces the design-token resolver to re-serialize the modes object on
|
|
14
|
+
* every call (see `serializeModes` in `figma-variables-resolver.ts`).
|
|
15
|
+
*
|
|
16
|
+
* Sharing a single frozen object across the tree makes all of those checks
|
|
17
|
+
* O(1) identity comparisons in the common "no modes provided" path.
|
|
18
|
+
*/
|
|
19
|
+
export const EMPTY_MODES = Object.freeze({});
|
|
20
|
+
|
|
5
21
|
/**
|
|
6
22
|
* Helper function to recursively clone children and pass modes prop to components that accept it.
|
|
7
23
|
* This ensures that all child components in slots receive the modes prop from the parent.
|
|
8
24
|
*/
|
|
9
25
|
export function cloneChildrenWithModes(children, modes, forcedModes) {
|
|
10
26
|
const result = [];
|
|
11
|
-
|
|
27
|
+
|
|
28
|
+
// toArray assigns stable keys to sibling lists and flattens top-level Fragments.
|
|
29
|
+
// Raw arrays from flattenChildren / concat have no keys; forEach alone does not add them.
|
|
30
|
+
React.Children.forEach(React.Children.toArray(children), child => {
|
|
12
31
|
if (! /*#__PURE__*/React.isValidElement(child)) {
|
|
13
32
|
if (child !== null && child !== undefined) {
|
|
14
33
|
result.push(child);
|
|
@@ -20,7 +39,7 @@ export function cloneChildrenWithModes(children, modes, forcedModes) {
|
|
|
20
39
|
// so recurse into their children and process each one individually.
|
|
21
40
|
if (child.type === React.Fragment) {
|
|
22
41
|
const fragment = child;
|
|
23
|
-
result.push(...cloneChildrenWithModes(fragment.props.children, modes, forcedModes));
|
|
42
|
+
result.push(...cloneChildrenWithModes(React.Children.toArray(fragment.props.children ?? null), modes, forcedModes));
|
|
24
43
|
return;
|
|
25
44
|
}
|
|
26
45
|
const childChildren = child.props?.children;
|
|
@@ -48,7 +67,10 @@ export function cloneChildrenWithModes(children, modes, forcedModes) {
|
|
|
48
67
|
modes: mergedModes
|
|
49
68
|
}, processedChildren));
|
|
50
69
|
});
|
|
51
|
-
|
|
70
|
+
|
|
71
|
+
// Ensure the returned list always has keys for each entry (cloneElement can drop
|
|
72
|
+
// keys in some paths; Views that render this array require keyed siblings).
|
|
73
|
+
return React.Children.toArray(result);
|
|
52
74
|
}
|
|
53
75
|
|
|
54
76
|
/**
|
|
@@ -3,12 +3,6 @@ import { View, type ImageSourcePropType } from 'react-native';
|
|
|
3
3
|
/**
|
|
4
4
|
* Avatar component that displays either an image or a monogram.
|
|
5
5
|
*
|
|
6
|
-
* This component supports two styles:
|
|
7
|
-
* - Image: Displays a user's profile picture
|
|
8
|
-
* - Monogram: Displays user initials in a circular background
|
|
9
|
-
*
|
|
10
|
-
* All styling values are resolved from Figma design tokens using the provided modes.
|
|
11
|
-
*
|
|
12
6
|
* @component
|
|
13
7
|
* @param {Object} props - Component props
|
|
14
8
|
* @param {string} [props.monogram="MS"] - The initials to display when style is "Monogram"
|
|
@@ -17,24 +11,24 @@ import { View, type ImageSourcePropType } from 'react-native';
|
|
|
17
11
|
* @param {string} [props.imageSource] - Optional image source for Image style (defaults to built-in image)
|
|
18
12
|
* @param {string} [props.accessibilityLabel] - Accessibility label for screen readers. If not provided, uses monogram or "User avatar"
|
|
19
13
|
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* ```
|
|
14
|
+
* Performance notes:
|
|
15
|
+
* - All token reads are folded into a single `useMemo([modes, isMonogram])`.
|
|
16
|
+
* - Press visual goes through Pressable's `({ pressed })` style callback so
|
|
17
|
+
* a scroll-cancelled touch never schedules a React render. iOS gets
|
|
18
|
+
* `unstable_pressDelay={130}` for additional safety inside scrollables.
|
|
19
|
+
* - Focus state stays in React (it's a sustained visual) but the setter is
|
|
20
|
+
* gated to web only, where focus events actually fire.
|
|
28
21
|
*/
|
|
29
22
|
export type AvatarProps = {
|
|
30
23
|
monogram?: string;
|
|
31
|
-
style?:
|
|
24
|
+
style?: 'Image' | 'Monogram';
|
|
32
25
|
modes?: Record<string, any>;
|
|
33
26
|
imageSource?: ImageSourcePropType | string;
|
|
34
27
|
accessibilityLabel?: string;
|
|
35
28
|
onPress?: () => void;
|
|
36
29
|
disabled?: boolean;
|
|
37
30
|
} & Omit<React.ComponentProps<typeof View>, 'style' | 'accessibilityRole' | 'accessibilityLabel'>;
|
|
38
|
-
declare function Avatar({ monogram, style, modes, imageSource, accessibilityLabel, ...rest }: AvatarProps): import("react/jsx-runtime").JSX.Element;
|
|
39
|
-
|
|
31
|
+
declare function Avatar({ monogram, style, modes, imageSource, accessibilityLabel: _accessibilityLabel, ...rest }: AvatarProps): import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
declare const _default: React.MemoExoticComponent<typeof Avatar>;
|
|
33
|
+
export default _default;
|
|
40
34
|
//# sourceMappingURL=Avatar.d.ts.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { type AccessibilityState, type StyleProp, type TextStyle, type ViewStyle } from 'react-native';
|
|
2
3
|
import { type SafePressableProps, type WebAccessibilityProps } from '../../utils/web-platform-utils';
|
|
3
4
|
type BottomNavItemProps = SafePressableProps & {
|
|
@@ -21,14 +22,17 @@ type BottomNavItemProps = SafePressableProps & {
|
|
|
21
22
|
/**
|
|
22
23
|
* Bottom navigation item with icon and label stacked vertically.
|
|
23
24
|
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
25
|
+
* Performance notes:
|
|
26
|
+
* - Token reads collapsed into a single `useMemo([modes, disabled, iconColor, iconSize])`.
|
|
27
|
+
* - Press visual via Pressable's `({ pressed })` style callback.
|
|
28
|
+
* - Hover and focus state are mirrored on web only (gated setters).
|
|
29
|
+
* - The previous version had no-op `onPressIn`/`onPressOut` handlers that
|
|
30
|
+
* forwarded to user callbacks but did nothing else — they were still
|
|
31
|
+
* creating fresh closures every render and forcing Pressable to re-bind.
|
|
32
|
+
* Now stable via a ref-backed wrapper.
|
|
33
|
+
* - Wrapped in `React.memo`.
|
|
31
34
|
*/
|
|
32
35
|
declare function BottomNavItem({ iconName, label, modes: propModes, onPress, disabled, style, labelStyle, iconColor: iconColorOverride, iconSize: iconSizeOverride, accessibilityLabel, accessibilityHint, accessibilityState, webAccessibilityProps, ...rest }: BottomNavItemProps): import("react/jsx-runtime").JSX.Element;
|
|
33
|
-
|
|
36
|
+
declare const _default: React.MemoExoticComponent<typeof BottomNavItem>;
|
|
37
|
+
export default _default;
|
|
34
38
|
//# sourceMappingURL=BottomNavItem.d.ts.map
|
|
@@ -59,7 +59,24 @@ export type ButtonProps = SafePressableProps & {
|
|
|
59
59
|
* @param {string} [props.accessibilityLabel] - Accessibility label for screen readers. If not provided, uses label or children text
|
|
60
60
|
* @param {string} [props.accessibilityHint] - Additional accessibility hint for screen readers
|
|
61
61
|
* @param {Object} [props.accessibilityState] - Additional accessibility state information
|
|
62
|
+
*
|
|
63
|
+
* Performance notes:
|
|
64
|
+
* - The pressed visual (background/border swap) is applied through the
|
|
65
|
+
* Pressable `style` callback, NOT a mirrored React state. This avoids the
|
|
66
|
+
* flicker that scrolling parents previously caused: when a ScrollView
|
|
67
|
+
* cancels a touch the host view simply reverts its style without React
|
|
68
|
+
* rendering. On iOS we additionally use `unstable_pressDelay` so the
|
|
69
|
+
* pressed visual is never even applied during a scroll-cancelled touch.
|
|
70
|
+
* - Hover state is only mirrored into React state on web (where hover events
|
|
71
|
+
* fire). On native the setter call is gated out so the component never
|
|
72
|
+
* re-renders due to hover.
|
|
73
|
+
* - All design-token reads are folded into a single `useMemo` keyed on
|
|
74
|
+
* `(modes, disabled)`.
|
|
75
|
+
* - The component is wrapped in `React.memo`. Callers that want to take
|
|
76
|
+
* advantage of this should pass stable `modes` (the default `EMPTY_MODES`
|
|
77
|
+
* is already stable) and stable callback props.
|
|
62
78
|
*/
|
|
63
|
-
declare function
|
|
79
|
+
declare function ButtonImpl({ label, children, renderContent, leading, trailing, icon, modes, onPress, disabled, style, labelStyle, accessibilityLabel, accessibilityHint, accessibilityState, webAccessibilityProps, ...rest }: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
80
|
+
declare const Button: React.MemoExoticComponent<typeof ButtonImpl>;
|
|
64
81
|
export default Button;
|
|
65
82
|
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { type AccessibilityState, type StyleProp, type ViewStyle } from 'react-native';
|
|
2
3
|
import { type SafePressableProps, type WebAccessibilityProps } from '../../utils/web-platform-utils';
|
|
3
4
|
type IconButtonProps = SafePressableProps & {
|
|
@@ -33,35 +34,17 @@ type IconButtonProps = SafePressableProps & {
|
|
|
33
34
|
/**
|
|
34
35
|
* IconButton component that displays an icon within a pressable button container.
|
|
35
36
|
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
* @param {Object} [props.style] - Additional styles for the container
|
|
46
|
-
* @param {string} [props.accessibilityLabel] - Accessibility label for screen readers. If not provided, defaults to iconName
|
|
47
|
-
* @param {string} [props.accessibilityHint] - Additional accessibility hint for screen readers
|
|
48
|
-
* @param {Object} [props.accessibilityState] - Additional accessibility state information
|
|
49
|
-
*
|
|
50
|
-
* @example
|
|
51
|
-
* ```jsx
|
|
52
|
-
* // Default icon button
|
|
53
|
-
* <IconButton modes={{}} />
|
|
54
|
-
*
|
|
55
|
-
* // Custom icon with size mode
|
|
56
|
-
* <IconButton iconName="ic_rupee" modes={{"Button / Size": "M"}} />
|
|
57
|
-
*
|
|
58
|
-
* // With appearance mode
|
|
59
|
-
* <IconButton modes={{"Appearance": "high"}} onPress={() => console.log('pressed')} />
|
|
60
|
-
*
|
|
61
|
-
* // With accessibility label
|
|
62
|
-
* <IconButton iconName="ic_search" accessibilityLabel={undefined} accessibilityHint="Opens the search screen" />
|
|
63
|
-
* ```
|
|
37
|
+
* Performance notes:
|
|
38
|
+
* - Token reads collapsed into a single `useMemo([modes, disabled, isToggle, isActive])`.
|
|
39
|
+
* - Press visual goes through Pressable's `({ pressed })` style callback so
|
|
40
|
+
* a scroll-cancelled touch never schedules a React render. iOS gets
|
|
41
|
+
* `unstable_pressDelay={130}`.
|
|
42
|
+
* - Hover and focus state are mirrored on web only (gated setters).
|
|
43
|
+
* - The previous version had a redundant `manualPressStyle` (a duplicate
|
|
44
|
+
* pressed transform mirrored via React state) — removed.
|
|
45
|
+
* - Wrapped in `React.memo`.
|
|
64
46
|
*/
|
|
65
47
|
declare function IconButton({ iconName, modes, onPress, disabled, style, accessibilityLabel, accessibilityHint, accessibilityState, webAccessibilityProps, isToggle, activeIcon, inactiveIcon, isActive, ...rest }: IconButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
66
|
-
|
|
48
|
+
declare const _default: React.MemoExoticComponent<typeof IconButton>;
|
|
49
|
+
export default _default;
|
|
67
50
|
//# sourceMappingURL=IconButton.d.ts.map
|
|
@@ -9,31 +9,23 @@ type IconCapsuleProps = {
|
|
|
9
9
|
/**
|
|
10
10
|
* IconCapsule component that displays an icon within a circular or rounded container.
|
|
11
11
|
*
|
|
12
|
-
* This component displays an icon (default: ic_card) within a styled capsule container.
|
|
13
12
|
* All styling values are resolved from Figma design tokens using the provided modes.
|
|
14
13
|
*
|
|
15
14
|
* @component
|
|
16
15
|
* @param {Object} props - Component props
|
|
17
16
|
* @param {string} [props.iconName="ic_card"] - The name of the icon to display from the icon registry
|
|
18
17
|
* @param {Object} [props.modes={}] - Mode configuration for design tokens (e.g., {"Appearance": "Primary"})
|
|
19
|
-
* @param {string} [props.accessibilityLabel] - Accessibility label for screen readers
|
|
18
|
+
* @param {string} [props.accessibilityLabel] - Accessibility label for screen readers
|
|
20
19
|
* @param {string} [props.accessibilityRole] - Accessibility role (defaults to "image" for decorative icons)
|
|
21
20
|
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
* <IconCapsule iconName="ic_rupee" modes={{}} />
|
|
29
|
-
*
|
|
30
|
-
* // With appearance mode
|
|
31
|
-
* <IconCapsule modes={{"Appearance": "Secondary"}} />
|
|
32
|
-
*
|
|
33
|
-
* // With accessibility label
|
|
34
|
-
* <IconCapsule iconName="ic_card" accessibilityLabel={undefined} />
|
|
35
|
-
* ```
|
|
21
|
+
* Performance notes:
|
|
22
|
+
* - All token reads collapsed into a single `useMemo([modes])`. The merged
|
|
23
|
+
* `(globalModes + propModes)` object is also memoized so downstream
|
|
24
|
+
* `getVariableByName` calls hit the resolver's per-modes-object cache.
|
|
25
|
+
* - Wrapped in `React.memo`; with the shared `EMPTY_MODES` default the
|
|
26
|
+
* common path benefits from full memoization.
|
|
36
27
|
*/
|
|
37
|
-
declare function IconCapsule({ iconName, modes: propModes, accessibilityLabel, accessibilityRole, ...rest }: IconCapsuleProps): import("react/jsx-runtime").JSX.Element;
|
|
38
|
-
|
|
28
|
+
declare function IconCapsule({ iconName, modes: propModes, accessibilityLabel: _accessibilityLabel, accessibilityRole, style: styleProp, ...rest }: IconCapsuleProps): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
declare const _default: React.MemoExoticComponent<typeof IconCapsule>;
|
|
30
|
+
export default _default;
|
|
39
31
|
//# sourceMappingURL=IconCapsule.d.ts.map
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { type StyleProp, type ViewStyle, type TextStyle } from 'react-native';
|
|
2
|
+
import { type StyleProp, type ViewStyle, type TextStyle, type TextInputProps as RNTextInputProps } from 'react-native';
|
|
3
3
|
export type InputSearchProps = {
|
|
4
4
|
supportText?: boolean;
|
|
5
5
|
supportTextLabel?: string;
|
|
6
|
+
/**
|
|
7
|
+
* Icon name from the icon registry to render inside the support text
|
|
8
|
+
* (e.g. 'ic_info', 'ic_cart'). Defaults to 'ic_info'.
|
|
9
|
+
*/
|
|
10
|
+
supportTextIcon?: string;
|
|
6
11
|
modes?: Record<string, any>;
|
|
7
12
|
containerStyle?: StyleProp<ViewStyle>;
|
|
8
13
|
placeholder?: string;
|
|
@@ -15,6 +20,6 @@ export type InputSearchProps = {
|
|
|
15
20
|
inputStyle?: StyleProp<TextStyle>;
|
|
16
21
|
accessibilityLabel?: string;
|
|
17
22
|
accessibilityHint?: string;
|
|
18
|
-
}
|
|
19
|
-
export default function InputSearch({ supportText, supportTextLabel, modes, containerStyle, placeholder, value, onChangeText, onFocus, onBlur, leading, trailing, inputStyle, ...rest }: InputSearchProps): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
} & Omit<RNTextInputProps, 'style' | 'onChangeText' | 'onFocus' | 'onBlur' | 'placeholder' | 'value'>;
|
|
24
|
+
export default function InputSearch({ supportText, supportTextLabel, supportTextIcon, modes, containerStyle, placeholder, value, onChangeText, onFocus, onBlur, leading, trailing, inputStyle, ...rest }: InputSearchProps): import("react/jsx-runtime").JSX.Element;
|
|
20
25
|
//# sourceMappingURL=InputSearch.d.ts.map
|
|
@@ -54,7 +54,20 @@ type ListItemProps = {
|
|
|
54
54
|
* @param {string} [props.accessibilityLabel] - Accessibility label for screen readers. If not provided, uses title and supportText
|
|
55
55
|
* @param {string} [props.accessibilityHint] - Additional accessibility hint for screen readers
|
|
56
56
|
* @param {Object} [props.accessibilityState] - Additional accessibility state information
|
|
57
|
+
*
|
|
58
|
+
* Performance notes:
|
|
59
|
+
* - All token reads are folded into a single `useMemo([modes])`.
|
|
60
|
+
* - The pressed visual is applied via Pressable's `style={({pressed}) => ...}`
|
|
61
|
+
* callback so RN updates the host view directly — no React render is
|
|
62
|
+
* scheduled by a touch. On iOS the touch is additionally delayed via
|
|
63
|
+
* `unstable_pressDelay={130}` so a scroll-cancelled tap never even
|
|
64
|
+
* transiently applies the pressed style. This is the fix for the
|
|
65
|
+
* "People / Setup card flicker during scroll" report.
|
|
66
|
+
* - User-supplied event handlers are read through a ref so the wrapper
|
|
67
|
+
* handlers stay referentially stable across renders.
|
|
68
|
+
* - The component is wrapped in `React.memo`.
|
|
57
69
|
*/
|
|
58
|
-
declare function
|
|
70
|
+
declare function ListItemImpl({ layout, title, supportText, showSupportText, leading, supportSlot, endSlot, navArrow, modes, onPress, style, contentStyle, accessibilityLabel, accessibilityHint, accessibilityState, webAccessibilityProps, ...rest }: ListItemProps): import("react/jsx-runtime").JSX.Element;
|
|
71
|
+
declare const ListItem: React.MemoExoticComponent<typeof ListItemImpl>;
|
|
59
72
|
export default ListItem;
|
|
60
73
|
//# sourceMappingURL=ListItem.d.ts.map
|
|
@@ -15,16 +15,17 @@ type NavArrowProps = {
|
|
|
15
15
|
* NavArrow component that displays a chevron arrow for navigation.
|
|
16
16
|
*
|
|
17
17
|
* Renders a stroked SVG chevron whose dimensions and thickness are
|
|
18
|
-
* fully driven by design tokens
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
18
|
+
* fully driven by design tokens.
|
|
19
|
+
*
|
|
20
|
+
* Performance notes:
|
|
21
|
+
* - Token reads collapsed into a single `useMemo([modes])` so a parent
|
|
22
|
+
* re-render (e.g. from a Section header press) doesn't re-do ~9 token
|
|
23
|
+
* lookups per chevron.
|
|
24
|
+
* - Container + SVG layout values are derived in a second `useMemo` keyed
|
|
25
|
+
* on (tokens, direction, style).
|
|
26
|
+
* - Wrapped in `React.memo`.
|
|
27
27
|
*/
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
declare function NavArrow({ direction, modes, style, accessibilityLabel, ...rest }: NavArrowProps): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
declare const _default: React.MemoExoticComponent<typeof NavArrow>;
|
|
30
|
+
export default _default;
|
|
30
31
|
//# sourceMappingURL=NavArrow.d.ts.map
|
|
@@ -18,31 +18,7 @@ type SectionProps = {
|
|
|
18
18
|
*/
|
|
19
19
|
webAccessibilityProps?: WebAccessibilityProps;
|
|
20
20
|
} & React.ComponentProps<typeof View>;
|
|
21
|
-
|
|
22
|
-
* Section component that mirrors the Figma "Section" component.
|
|
23
|
-
*
|
|
24
|
-
* This component supports:
|
|
25
|
-
* - **header** with title, support text, and optional chevron icon
|
|
26
|
-
* - **slot** for custom content (typically ListItem components)
|
|
27
|
-
* - **design-token driven styling** via `getVariableByName` and `modes`
|
|
28
|
-
*
|
|
29
|
-
* Wherever the Figma layer name contains "Slot", this component exposes a
|
|
30
|
-
* dedicated React "slot" prop:
|
|
31
|
-
* - Slot "slot" → `slot`
|
|
32
|
-
*
|
|
33
|
-
* @component
|
|
34
|
-
* @param {Object} props
|
|
35
|
-
* @param {string} [props.title='Section title'] - Section title text
|
|
36
|
-
* @param {string} [props.supportText='Section support text'] - Section support text
|
|
37
|
-
* @param {boolean} [props.showSupportText=true] - Toggles rendering of the support text
|
|
38
|
-
* @param {React.ReactNode} [props.slot] - Optional custom slot for content area (Figma Slot "slot")
|
|
39
|
-
* @param {Object} [props.modes={}] - Modes object passed to `getVariableByName` for all design tokens
|
|
40
|
-
* @param {Function} [props.onPress] - Callback function called when the header is pressed
|
|
41
|
-
* @param {Object} [props.style] - Optional container style overrides
|
|
42
|
-
* @param {string} [props.accessibilityLabel] - Accessibility label for the section. If not provided, uses title
|
|
43
|
-
* @param {string} [props.accessibilityHint] - Additional accessibility hint for screen readers
|
|
44
|
-
*/
|
|
45
|
-
declare function Section({ title, supportText, showSupportText, slot, slotDirection, modes, onPress, style, accessibilityLabel, accessibilityHint, webAccessibilityProps, ...rest }: SectionProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
declare function Section({ title, supportText, showSupportText, slot, slotDirection, modes, onPress, style, accessibilityLabel: _accessibilityLabel, accessibilityHint, webAccessibilityProps, ...rest }: SectionProps): import("react/jsx-runtime").JSX.Element;
|
|
46
22
|
declare namespace Section {
|
|
47
23
|
var Bento: typeof SectionBento;
|
|
48
24
|
}
|
|
@@ -58,28 +34,6 @@ type SectionBentoProps = {
|
|
|
58
34
|
*/
|
|
59
35
|
webAccessibilityProps?: WebAccessibilityProps;
|
|
60
36
|
} & React.ComponentProps<typeof View>;
|
|
61
|
-
|
|
62
|
-
* Section.Bento component that mirrors the Figma "Section.Bento" component.
|
|
63
|
-
*
|
|
64
|
-
* This component supports:
|
|
65
|
-
* - **navSlot** for navigation items (typically ListItem components in vertical layout)
|
|
66
|
-
* - **upiSlot** for UPI handles (typically UpiHandle components)
|
|
67
|
-
* - **design-token driven styling** via `getVariableByName` and `modes`
|
|
68
|
-
*
|
|
69
|
-
* Wherever the Figma layer name contains "Slot", this component exposes a
|
|
70
|
-
* dedicated React "slot" prop:
|
|
71
|
-
* - Slot "Nav wrap" → `navSlot`
|
|
72
|
-
* - Slot "UPI wrap" → `upiSlot`
|
|
73
|
-
*
|
|
74
|
-
* @component
|
|
75
|
-
* @param {Object} props
|
|
76
|
-
* @param {React.ReactNode} [props.navSlot] - Optional custom slot for navigation items (Figma Slot "Nav wrap")
|
|
77
|
-
* @param {React.ReactNode} [props.upiSlot] - Optional custom slot for UPI handles (Figma Slot "UPI wrap")
|
|
78
|
-
* @param {Object} [props.modes={}] - Modes object passed to `getVariableByName` for all design tokens
|
|
79
|
-
* @param {Object} [props.style] - Optional container style overrides
|
|
80
|
-
* @param {string} [props.accessibilityLabel] - Accessibility label for the section
|
|
81
|
-
* @param {string} [props.accessibilityHint] - Additional accessibility hint for screen readers
|
|
82
|
-
*/
|
|
83
|
-
declare function SectionBento({ navSlot, upiSlot, modes, style, accessibilityLabel, accessibilityHint, ...rest }: SectionBentoProps): import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
declare function SectionBento({ navSlot, upiSlot, modes, style, accessibilityLabel: _accessibilityLabel, accessibilityHint, ...rest }: SectionBentoProps): import("react/jsx-runtime").JSX.Element;
|
|
84
38
|
export default Section;
|
|
85
39
|
//# sourceMappingURL=Section.d.ts.map
|
|
@@ -15,25 +15,26 @@ type UpiHandleProps = {
|
|
|
15
15
|
/**
|
|
16
16
|
* UpiHandle pill that mirrors the Figma "UPI Handle" component.
|
|
17
17
|
*
|
|
18
|
-
* Layout:
|
|
19
|
-
* - Circular image/avatar on the left
|
|
20
|
-
* - Label text in the center
|
|
21
|
-
* - Optional QR-code style icon on the right
|
|
22
|
-
*
|
|
23
|
-
* All visual styling is resolved from Figma variables via `getVariableByName`
|
|
24
|
-
* using a `modes` configuration object, matching the rest of this library.
|
|
25
|
-
*
|
|
26
18
|
* @component
|
|
27
19
|
* @param {Object} props
|
|
28
20
|
* @param {string} [props.label="Label"] - UPI handle text to display.
|
|
29
21
|
* @param {Object} [props.modes={}] - Modes object passed directly to `getVariableByName`.
|
|
30
22
|
* @param {boolean} [props.showIcon=true] - Toggles the trailing icon visibility.
|
|
31
|
-
* @param {string} [props.iconName='ic_scan_qr_code'] - Icon name from the actions set
|
|
23
|
+
* @param {string} [props.iconName='ic_scan_qr_code'] - Icon name from the actions set.
|
|
32
24
|
* @param {ImageSourcePropType} [props.avatarSource] - Optional custom image source for the avatar.
|
|
33
25
|
* @param {Function} [props.onClick] - Click/tap handler. Works as an alias for `onPress`.
|
|
34
|
-
* @param {string} [props.accessibilityLabel] - Accessibility label for screen readers
|
|
26
|
+
* @param {string} [props.accessibilityLabel] - Accessibility label for screen readers
|
|
35
27
|
* @param {string} [props.accessibilityHint] - Additional accessibility hint for screen readers
|
|
28
|
+
*
|
|
29
|
+
* Performance notes:
|
|
30
|
+
* - Token reads collapsed into a single `useMemo([modes])`.
|
|
31
|
+
* - Press visual goes through Pressable's `({ pressed })` style callback so
|
|
32
|
+
* a scroll-cancelled touch never schedules a React render. iOS gets
|
|
33
|
+
* `unstable_pressDelay={130}` for additional safety inside scrollables.
|
|
34
|
+
* - Focus state is mirrored on web only (gated setter).
|
|
35
|
+
* - Wrapped in `React.memo`.
|
|
36
36
|
*/
|
|
37
|
-
declare function UpiHandle({ label, modes: propModes, showIcon, iconName, avatarSource, onPress, onClick, disabled, accessibilityLabel, accessibilityHint, ...rest }: UpiHandleProps): import("react/jsx-runtime").JSX.Element;
|
|
38
|
-
|
|
37
|
+
declare function UpiHandle({ label, modes: propModes, showIcon, iconName, avatarSource, onPress, onClick, disabled, accessibilityLabel: _accessibilityLabel, accessibilityHint, ...rest }: UpiHandleProps): import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
declare const _default: React.MemoExoticComponent<typeof UpiHandle>;
|
|
39
|
+
export default _default;
|
|
39
40
|
//# sourceMappingURL=UpiHandle.d.ts.map
|
|
@@ -40,20 +40,5 @@ export declare const JFSThemeProvider: React.FC<JFSThemeProviderProps>;
|
|
|
40
40
|
* }
|
|
41
41
|
*/
|
|
42
42
|
export declare const useTokens: () => TokenContextType;
|
|
43
|
-
/**
|
|
44
|
-
* Returns the JFS font map. The TTF is encapsulated within the package at
|
|
45
|
-
* src/assets/fonts/JioType Var.ttf (included via package.json "files").
|
|
46
|
-
* Call this inside load functions to avoid top-level require errors if font missing.
|
|
47
|
-
*/
|
|
48
|
-
export declare const getJFSFonts: () => {
|
|
49
|
-
readonly 'JioType Var': any;
|
|
50
|
-
};
|
|
51
|
-
/**
|
|
52
|
-
* Hook for loading JFS fonts using expo-font. This improves Android font support by explicitly registering
|
|
53
|
-
* the custom 'JioType Var' font (encapsulated in the package) via Font.loadAsync before components render.
|
|
54
|
-
* Without it, Android defaults to Roboto. Call at app root (e.g. before JFSThemeProvider). Returns loaded state.
|
|
55
|
-
* See getJFSFonts() for direct use with Font.loadAsync. Handles missing font gracefully for web/Storybook.
|
|
56
|
-
*/
|
|
57
|
-
export declare function useJFSFonts(): boolean;
|
|
58
43
|
export {};
|
|
59
44
|
//# sourceMappingURL=JFSThemeProvider.d.ts.map
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Auto-generated from SVG files in src/icons/
|
|
5
5
|
* DO NOT EDIT MANUALLY - Run "npm run icons:generate" to regenerate
|
|
6
6
|
*
|
|
7
|
-
* Generated: 2026-04-
|
|
7
|
+
* Generated: 2026-04-20T08:18:55.051Z
|
|
8
8
|
*/
|
|
9
9
|
export declare const iconRegistry: Record<string, {
|
|
10
10
|
path: string;
|
|
@@ -1,4 +1,19 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* A shared, frozen empty modes object.
|
|
4
|
+
*
|
|
5
|
+
* Components that accept a `modes` prop should use this as the default value
|
|
6
|
+
* instead of the inline `{}` literal. The literal allocates a new object on
|
|
7
|
+
* every render, which:
|
|
8
|
+
* 1. Forces `React.memo` shallow comparisons to fail.
|
|
9
|
+
* 2. Forces `useMemo`/`useEffect` deps that include `modes` to re-run.
|
|
10
|
+
* 3. Forces the design-token resolver to re-serialize the modes object on
|
|
11
|
+
* every call (see `serializeModes` in `figma-variables-resolver.ts`).
|
|
12
|
+
*
|
|
13
|
+
* Sharing a single frozen object across the tree makes all of those checks
|
|
14
|
+
* O(1) identity comparisons in the common "no modes provided" path.
|
|
15
|
+
*/
|
|
16
|
+
export declare const EMPTY_MODES: Readonly<Record<string, any>>;
|
|
2
17
|
/**
|
|
3
18
|
* Helper function to recursively clone children and pass modes prop to components that accept it.
|
|
4
19
|
* This ensures that all child components in slots receive the modes prop from the parent.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jfs-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.63",
|
|
4
4
|
"description": "React Native Jio Finance Components Library",
|
|
5
5
|
"author": "sunshuaiqi@gmail.com",
|
|
6
6
|
"license": "MIT",
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
"files": [
|
|
14
14
|
"src",
|
|
15
15
|
"lib",
|
|
16
|
+
"CHANGELOG.md",
|
|
16
17
|
"!**/__tests__",
|
|
17
18
|
"!**/*.stories.*",
|
|
18
19
|
"!**/test-setup.*",
|
|
@@ -25,13 +26,8 @@
|
|
|
25
26
|
"!**/.token-metadata.json"
|
|
26
27
|
],
|
|
27
28
|
"scripts": {
|
|
28
|
-
"android": "yarn run prestorybook && react-native run-android",
|
|
29
|
-
"ios": "yarn run prestorybook && react-native run-ios",
|
|
30
|
-
"start": "react-native start",
|
|
31
29
|
"test": "jest",
|
|
32
30
|
"lint": "eslint .",
|
|
33
|
-
"prestorybook": "rnstl",
|
|
34
|
-
"storybook": "echo 'React Native Storybook is embedded in the app. Run: yarn ios or yarn android'",
|
|
35
31
|
"build-react": "webpack --mode production",
|
|
36
32
|
"start-react": "webpack-dev-server --config ./webpack.config.js --mode development",
|
|
37
33
|
"extract-tokens": "node scripts/extract-component-tokens.js",
|
|
@@ -40,6 +36,8 @@
|
|
|
40
36
|
"storybook-web": "storybook dev -p 6006",
|
|
41
37
|
"build:storybook-web": "storybook build",
|
|
42
38
|
"deploy:storybook": "vercel --prod",
|
|
39
|
+
"example": "yarn --cwd example start",
|
|
40
|
+
"example:install": "yarn --cwd example install",
|
|
43
41
|
"postinstall": "patch-package",
|
|
44
42
|
"icons:generate": "node scripts/generate-icon-registry.js",
|
|
45
43
|
"prepare": "bob build",
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
import { getVariableByName } from '../../design-tokens/figma-variables-resolver'
|
|
15
15
|
import Icon from '../../icons/Icon'
|
|
16
16
|
import { usePressableWebSupport, type WebAccessibilityProps } from '../../utils/web-platform-utils'
|
|
17
|
-
import { cloneChildrenWithModes } from '../../utils/react-utils'
|
|
17
|
+
import { EMPTY_MODES, cloneChildrenWithModes } from '../../utils/react-utils'
|
|
18
18
|
|
|
19
19
|
// Enable LayoutAnimation on Android
|
|
20
20
|
if (Platform.OS === 'android' && UIManager.setLayoutAnimationEnabledExperimental) {
|
|
@@ -81,7 +81,7 @@ function Accordion({
|
|
|
81
81
|
onExpandedChange,
|
|
82
82
|
disabled = false,
|
|
83
83
|
children,
|
|
84
|
-
modes =
|
|
84
|
+
modes = EMPTY_MODES,
|
|
85
85
|
style,
|
|
86
86
|
accessibilityLabel,
|
|
87
87
|
accessibilityHint,
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
Platform,
|
|
7
7
|
} from 'react-native'
|
|
8
8
|
import { getVariableByName } from '../../design-tokens/figma-variables-resolver'
|
|
9
|
-
import { cloneChildrenWithModes, flattenChildren } from '../../utils/react-utils'
|
|
9
|
+
import { EMPTY_MODES, cloneChildrenWithModes, flattenChildren } from '../../utils/react-utils'
|
|
10
10
|
import IconButton from '../IconButton/IconButton'
|
|
11
11
|
|
|
12
12
|
export type ActionFooterProps = {
|
|
@@ -59,7 +59,7 @@ export type ActionFooterProps = {
|
|
|
59
59
|
*/
|
|
60
60
|
function ActionFooter({
|
|
61
61
|
children,
|
|
62
|
-
modes =
|
|
62
|
+
modes = EMPTY_MODES,
|
|
63
63
|
style,
|
|
64
64
|
accessibilityLabel = undefined,
|
|
65
65
|
}: ActionFooterProps) {
|
|
@@ -3,6 +3,7 @@ import { View, Text, type ViewStyle, type TextStyle, TouchableOpacity } from 're
|
|
|
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 ActionTileProps = {
|
|
8
9
|
/** Label text, e.g. "Cards" */
|
|
@@ -30,7 +31,7 @@ export type ActionTileProps = {
|
|
|
30
31
|
export default function ActionTile({
|
|
31
32
|
label = 'Cards',
|
|
32
33
|
icon,
|
|
33
|
-
modes: propModes =
|
|
34
|
+
modes: propModes = EMPTY_MODES,
|
|
34
35
|
style,
|
|
35
36
|
onPress,
|
|
36
37
|
}: ActionTileProps) {
|
|
@@ -4,6 +4,7 @@ import { getVariableByName } from '../../design-tokens/figma-variables-resolver'
|
|
|
4
4
|
import { useTokens } from '../../design-tokens/JFSThemeProvider'
|
|
5
5
|
import MoneyValue from '../MoneyValue/MoneyValue'
|
|
6
6
|
import NoteInput from '../NoteInput/NoteInput'
|
|
7
|
+
import { EMPTY_MODES } from '../../utils/react-utils'
|
|
7
8
|
|
|
8
9
|
export type AmountInputProps = {
|
|
9
10
|
/**
|
|
@@ -28,7 +29,7 @@ export type AmountInputProps = {
|
|
|
28
29
|
export default function AmountInput({
|
|
29
30
|
moneyValueSlot,
|
|
30
31
|
noteInputSlot,
|
|
31
|
-
modes: propModes =
|
|
32
|
+
modes: propModes = EMPTY_MODES,
|
|
32
33
|
style,
|
|
33
34
|
}: AmountInputProps) {
|
|
34
35
|
const { modes: globalModes } = useTokens()
|
|
@@ -4,7 +4,7 @@ import { getVariableByName } from '../../design-tokens/figma-variables-resolver'
|
|
|
4
4
|
import { useTokens } from '../../design-tokens/JFSThemeProvider'
|
|
5
5
|
|
|
6
6
|
import NavArrow from '../NavArrow/NavArrow'
|
|
7
|
-
import { cloneChildrenWithModes } from '../../utils/react-utils'
|
|
7
|
+
import { cloneChildrenWithModes, EMPTY_MODES } from '../../utils/react-utils'
|
|
8
8
|
|
|
9
9
|
type AppBarType = 'MainPage' | 'SubPage'
|
|
10
10
|
|
|
@@ -53,7 +53,7 @@ export default function AppBar({
|
|
|
53
53
|
leadingSlot,
|
|
54
54
|
middleSlot,
|
|
55
55
|
actionsSlot,
|
|
56
|
-
modes: propModes =
|
|
56
|
+
modes: propModes = EMPTY_MODES,
|
|
57
57
|
onLeadingPress,
|
|
58
58
|
style,
|
|
59
59
|
accessibilityLabel,
|