jfs-components 0.0.45 → 0.0.48
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/lib/commonjs/components/ChipSelect/ChipSelect.js +1 -2
- package/lib/commonjs/components/Drawer/demo.xml +18 -0
- package/lib/commonjs/components/FormField/FormField.js +1 -0
- package/lib/commonjs/components/NoteInput/NoteInput.js +1 -2
- package/lib/commonjs/components/Nudge/Nudge.js +143 -0
- package/lib/commonjs/components/PaymentFeedback/PaymentFeedback.js +148 -0
- package/lib/commonjs/components/SegmentedControl/SegmentedControl.js +131 -0
- package/lib/commonjs/components/SupportText/SupportTextIcon.js +2 -3
- package/lib/commonjs/components/Tabs/TabItem.js +9 -5
- package/lib/commonjs/components/Tabs/Tabs.js +3 -1
- package/lib/commonjs/components/Text/Text.js +7 -1
- package/lib/commonjs/components/Title/Title.js +99 -0
- package/lib/commonjs/components/UpiHandle/UpiHandle.js +5 -2
- package/lib/commonjs/components/index.js +52 -3
- package/lib/commonjs/design-tokens/Coin Variables-variables-full.json +1 -1
- package/lib/commonjs/icons/registry.js +1 -1
- package/lib/commonjs/index.js +12 -0
- package/lib/commonjs/utils/index.js +18 -0
- package/lib/module/components/ChipSelect/ChipSelect.js +1 -2
- package/lib/module/components/Drawer/demo.xml +18 -0
- package/lib/module/components/FormField/FormField.js +1 -0
- package/lib/module/components/NoteInput/NoteInput.js +1 -2
- package/lib/module/components/Nudge/Nudge.js +138 -0
- package/lib/module/components/PaymentFeedback/PaymentFeedback.js +142 -0
- package/lib/module/components/SegmentedControl/SegmentedControl.js +126 -0
- package/lib/module/components/SupportText/SupportTextIcon.js +2 -3
- package/lib/module/components/Tabs/TabItem.js +9 -5
- package/lib/module/components/Tabs/Tabs.js +3 -1
- package/lib/module/components/Text/Text.js +7 -1
- package/lib/module/components/Title/Title.js +94 -0
- package/lib/module/components/UpiHandle/UpiHandle.js +5 -2
- package/lib/module/components/index.js +8 -1
- package/lib/module/design-tokens/Coin Variables-variables-full.json +1 -1
- package/lib/module/icons/registry.js +1 -1
- package/lib/module/index.js +2 -1
- package/lib/module/utils/index.js +3 -0
- package/lib/typescript/src/components/ChipSelect/ChipSelect.d.ts +1 -6
- package/lib/typescript/src/components/LinearMeter/LinearMeter.d.ts +1 -1
- package/lib/typescript/src/components/Nudge/Nudge.d.ts +31 -0
- package/lib/typescript/src/components/PaymentFeedback/PaymentFeedback.d.ts +23 -0
- package/lib/typescript/src/components/RechargeCard/RechargeCard.d.ts +1 -2
- package/lib/typescript/src/components/SegmentedControl/SegmentedControl.d.ts +49 -0
- package/lib/typescript/src/components/SupportText/SupportText.d.ts +1 -1
- package/lib/typescript/src/components/SupportText/SupportTextIcon.d.ts +1 -1
- package/lib/typescript/src/components/Text/Text.d.ts +3 -1
- package/lib/typescript/src/components/Title/Title.d.ts +20 -0
- package/lib/typescript/src/components/UpiHandle/UpiHandle.d.ts +3 -1
- package/lib/typescript/src/components/index.d.ts +13 -5
- package/lib/typescript/src/icons/registry.d.ts +1 -1
- package/lib/typescript/src/index.d.ts +1 -0
- package/lib/typescript/src/utils/index.d.ts +2 -0
- package/package.json +2 -2
- package/src/components/ChipSelect/ChipSelect.tsx +1 -8
- package/src/components/Drawer/demo.xml +18 -0
- package/src/components/FormField/FormField.tsx +1 -0
- package/src/components/LinearMeter/LinearMeter.tsx +1 -1
- package/src/components/NoteInput/NoteInput.tsx +1 -1
- package/src/components/Nudge/Nudge.tsx +150 -0
- package/src/components/PaymentFeedback/PaymentFeedback.tsx +168 -0
- package/src/components/RechargeCard/RechargeCard.tsx +1 -1
- package/src/components/SegmentedControl/SegmentedControl.tsx +168 -0
- package/src/components/SupportText/SupportText.tsx +1 -1
- package/src/components/SupportText/SupportTextIcon.tsx +4 -3
- package/src/components/Tabs/TabItem.tsx +10 -5
- package/src/components/Tabs/Tabs.tsx +2 -0
- package/src/components/Text/Text.tsx +9 -0
- package/src/components/Title/Title.tsx +137 -0
- package/src/components/UpiHandle/UpiHandle.tsx +6 -2
- package/src/components/index.ts +13 -5
- package/src/design-tokens/Coin Variables-variables-full.json +1 -1
- package/src/icons/registry.ts +1 -1
- package/src/index.ts +1 -0
- package/src/utils/index.ts +1 -0
- package/lib/commonjs/components/PageTitle/PageTitle.js +0 -90
- package/lib/module/components/PageTitle/PageTitle.js +0 -85
- package/lib/typescript/src/components/PageTitle/PageTitle.d.ts +0 -29
- package/src/components/PageTitle/PageTitle.tsx +0 -106
package/lib/module/index.js
CHANGED
|
@@ -16,11 +16,6 @@ export type ChipSelectProps = {
|
|
|
16
16
|
* @default "ic_calendar_week"
|
|
17
17
|
*/
|
|
18
18
|
icon?: string;
|
|
19
|
-
/**
|
|
20
|
-
* Whether to show the close icon in Active state (when active is true).
|
|
21
|
-
* @default true
|
|
22
|
-
*/
|
|
23
|
-
close?: boolean;
|
|
24
19
|
/**
|
|
25
20
|
* Modes for design token resolution.
|
|
26
21
|
*/
|
|
@@ -42,6 +37,6 @@ export type ChipSelectProps = {
|
|
|
42
37
|
* ChipSelect component for selecting options (e.g. Date selection).
|
|
43
38
|
* Based on Figma Node 1901-4727.
|
|
44
39
|
*/
|
|
45
|
-
declare function ChipSelect({ label, active, icon,
|
|
40
|
+
declare function ChipSelect({ label, active, icon, modes, style, labelSlot, onPress, }: ChipSelectProps): import("react/jsx-runtime").JSX.Element;
|
|
46
41
|
export default ChipSelect;
|
|
47
42
|
//# sourceMappingURL=ChipSelect.d.ts.map
|
|
@@ -5,7 +5,7 @@ type LinearMeterLabelProps = {
|
|
|
5
5
|
modes?: Record<string, any>;
|
|
6
6
|
style?: StyleProp<TextStyle>;
|
|
7
7
|
} & React.ComponentProps<typeof Text>;
|
|
8
|
-
type LinearMeterProps = {
|
|
8
|
+
export type LinearMeterProps = {
|
|
9
9
|
value?: number;
|
|
10
10
|
modes?: Record<string, any>;
|
|
11
11
|
style?: StyleProp<ViewStyle>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type ViewStyle, type StyleProp } from 'react-native';
|
|
3
|
+
export type NudgeProps = {
|
|
4
|
+
/**
|
|
5
|
+
* Controls the layout variant.
|
|
6
|
+
* - "Default": horizontal layout with optional start icon and content (title/body/button or children slot)
|
|
7
|
+
* - "Variant2": vertical layout with header (icon + title) and children slot below
|
|
8
|
+
*/
|
|
9
|
+
variant?: 'Default' | 'Variant2';
|
|
10
|
+
/** Title text displayed in the nudge */
|
|
11
|
+
title?: string;
|
|
12
|
+
/** Body text displayed below the title (Default variant only, when no children are provided) */
|
|
13
|
+
body?: string;
|
|
14
|
+
/** Label for the default button (Default variant only, when no children are provided) */
|
|
15
|
+
buttonLabel?: string;
|
|
16
|
+
/** Callback for the default button press */
|
|
17
|
+
onPressButton?: () => void;
|
|
18
|
+
/** Custom button slot (Default variant only, overrides buttonLabel/onPressButton) */
|
|
19
|
+
buttonSlot?: React.ReactNode;
|
|
20
|
+
/** Optional leading slot for an icon/element. Pass null or omit to hide. */
|
|
21
|
+
startSlot?: React.ReactNode;
|
|
22
|
+
/** Content slot — overrides the default title/body/button content */
|
|
23
|
+
children?: React.ReactNode;
|
|
24
|
+
/** Mode configuration for design token resolution */
|
|
25
|
+
modes?: Record<string, any>;
|
|
26
|
+
/** Optional container style overrides */
|
|
27
|
+
style?: StyleProp<ViewStyle>;
|
|
28
|
+
};
|
|
29
|
+
declare function Nudge({ variant, title, body, buttonLabel, onPressButton, buttonSlot, startSlot, children, modes: propModes, style, }: NudgeProps): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
export default Nudge;
|
|
31
|
+
//# sourceMappingURL=Nudge.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type ViewStyle } from 'react-native';
|
|
3
|
+
export type PaymentFeedbackProps = {
|
|
4
|
+
/** Large heading text, typically a monetary value (e.g. "₹50,000") */
|
|
5
|
+
title?: string;
|
|
6
|
+
/** Status line below the title (e.g. "Payment successful") */
|
|
7
|
+
subtitle?: string;
|
|
8
|
+
/** Descriptive body text below the subtitle */
|
|
9
|
+
body?: string;
|
|
10
|
+
/** Transaction metadata shown at the bottom (e.g. date, transaction ID). Supports newlines. */
|
|
11
|
+
details?: string;
|
|
12
|
+
/** Whether to render the details section */
|
|
13
|
+
showDetails?: boolean;
|
|
14
|
+
/** Icon name used in the default IconCapsule media slot */
|
|
15
|
+
iconName?: string;
|
|
16
|
+
/** Optional custom media slot that replaces the default IconCapsule */
|
|
17
|
+
renderMedia?: ReactNode;
|
|
18
|
+
/** Mode configuration for design tokens */
|
|
19
|
+
modes?: Record<string, any>;
|
|
20
|
+
style?: ViewStyle;
|
|
21
|
+
};
|
|
22
|
+
export default function PaymentFeedback({ title, subtitle, body, details, showDetails, iconName, renderMedia, modes: propModes, style, }: PaymentFeedbackProps): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
//# sourceMappingURL=PaymentFeedback.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type ViewStyle } from 'react-native';
|
|
3
|
-
type RechargeCardProps = {
|
|
3
|
+
export type RechargeCardProps = {
|
|
4
4
|
/**
|
|
5
5
|
* Title of the card.
|
|
6
6
|
* Default: "Unlimited 5G"
|
|
@@ -47,5 +47,4 @@ type RechargeCardProps = {
|
|
|
47
47
|
* Displays a recharge plan with price, validity, data, and subscription details.
|
|
48
48
|
*/
|
|
49
49
|
export default function RechargeCard({ title, price, validity, data, disclaimer, subscriptionContent, actions, modes, style, }: RechargeCardProps): import("react/jsx-runtime").JSX.Element;
|
|
50
|
-
export {};
|
|
51
50
|
//# sourceMappingURL=RechargeCard.d.ts.map
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type StyleProp, type ViewStyle } from 'react-native';
|
|
3
|
+
export type SegmentedControlItem = {
|
|
4
|
+
key: React.Key;
|
|
5
|
+
label: string;
|
|
6
|
+
};
|
|
7
|
+
export type SegmentedControlProps = {
|
|
8
|
+
/** The items to display as segments */
|
|
9
|
+
items: SegmentedControlItem[];
|
|
10
|
+
/** The currently selected key (controlled) */
|
|
11
|
+
selectedKey?: React.Key;
|
|
12
|
+
/** The initially selected key (uncontrolled). Defaults to the first item's key. */
|
|
13
|
+
defaultSelectedKey?: React.Key;
|
|
14
|
+
/** Callback fired when the selected segment changes */
|
|
15
|
+
onSelectionChange?: (key: React.Key) => void;
|
|
16
|
+
/** Design token modes for theming */
|
|
17
|
+
modes?: Record<string, any>;
|
|
18
|
+
/** Override container styles */
|
|
19
|
+
style?: StyleProp<ViewStyle>;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* SegmentedControl component backed by Figma design tokens.
|
|
23
|
+
*
|
|
24
|
+
* Provides a horizontal row of mutually exclusive segments.
|
|
25
|
+
* Supports controlled (`selectedKey` + `onSelectionChange`) and
|
|
26
|
+
* uncontrolled (`defaultSelectedKey`) usage patterns.
|
|
27
|
+
*
|
|
28
|
+
* @component
|
|
29
|
+
* @param {SegmentedControlProps} props
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```tsx
|
|
33
|
+
* const [selected, setSelected] = useState<React.Key>('daily');
|
|
34
|
+
*
|
|
35
|
+
* <SegmentedControl
|
|
36
|
+
* items={[
|
|
37
|
+
* { key: 'daily', label: 'Daily' },
|
|
38
|
+
* { key: 'weekly', label: 'Weekly' },
|
|
39
|
+
* { key: 'monthly', label: 'Monthly' },
|
|
40
|
+
* ]}
|
|
41
|
+
* selectedKey={selected}
|
|
42
|
+
* onSelectionChange={setSelected}
|
|
43
|
+
* modes={{ 'Color Mode': 'Light' }}
|
|
44
|
+
* />
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
declare function SegmentedControl({ items, selectedKey: controlledSelectedKey, defaultSelectedKey, onSelectionChange, modes, style, }: SegmentedControlProps): import("react/jsx-runtime").JSX.Element;
|
|
48
|
+
export default SegmentedControl;
|
|
49
|
+
//# sourceMappingURL=SegmentedControl.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ViewStyle } from 'react-native';
|
|
2
|
-
export type SupportTextStatus = 'Neutral' | 'Warning' | 'Error' | 'Success';
|
|
2
|
+
export type SupportTextStatus = 'Neutral' | 'Warning' | 'Error' | 'Success' | 'Loading';
|
|
3
3
|
export type SupportTextIconProps = {
|
|
4
4
|
status?: SupportTextStatus;
|
|
5
5
|
modes?: Record<string, any>;
|
|
@@ -2,6 +2,8 @@ import { type TextStyle, type StyleProp } from 'react-native';
|
|
|
2
2
|
export type TextProps = {
|
|
3
3
|
/** The text content to display. */
|
|
4
4
|
text?: string;
|
|
5
|
+
/** Horizontal alignment of the text. */
|
|
6
|
+
textAlign?: 'Left' | 'Center';
|
|
5
7
|
/** Modes configuration for design token resolution. */
|
|
6
8
|
modes?: Record<string, any>;
|
|
7
9
|
/** Style override for the text. */
|
|
@@ -9,6 +11,6 @@ export type TextProps = {
|
|
|
9
11
|
/** Number of lines to limit the text to. */
|
|
10
12
|
numberOfLines?: number;
|
|
11
13
|
};
|
|
12
|
-
declare function Text({ text, modes, style, numberOfLines, }: TextProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
declare function Text({ text, textAlign, modes, style, numberOfLines, }: TextProps): import("react/jsx-runtime").JSX.Element;
|
|
13
15
|
export default Text;
|
|
14
16
|
//# sourceMappingURL=Text.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View, type StyleProp, type ViewStyle, type TextStyle } from 'react-native';
|
|
3
|
+
export type TitleProps = {
|
|
4
|
+
title?: string;
|
|
5
|
+
/** Optional subtitle displayed below the title. */
|
|
6
|
+
subtitle?: string;
|
|
7
|
+
/** Horizontal alignment of the title text. */
|
|
8
|
+
textAlign?: 'Left' | 'Center';
|
|
9
|
+
modes?: Record<string, any>;
|
|
10
|
+
style?: StyleProp<ViewStyle>;
|
|
11
|
+
textStyle?: StyleProp<TextStyle>;
|
|
12
|
+
/** Optional style overrides for the subtitle text. */
|
|
13
|
+
subtitleStyle?: StyleProp<TextStyle>;
|
|
14
|
+
numberOfLines?: number;
|
|
15
|
+
accessibilityLabel?: string;
|
|
16
|
+
accessibilityHint?: string;
|
|
17
|
+
} & React.ComponentProps<typeof View>;
|
|
18
|
+
declare function Title({ title, subtitle, textAlign, modes: propModes, style, textStyle, subtitleStyle, numberOfLines, accessibilityLabel, accessibilityHint, ...rest }: TitleProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export default Title;
|
|
20
|
+
//# sourceMappingURL=Title.d.ts.map
|
|
@@ -9,6 +9,7 @@ type UpiHandleProps = {
|
|
|
9
9
|
accessibilityLabel?: string;
|
|
10
10
|
accessibilityHint?: string;
|
|
11
11
|
onPress?: () => void;
|
|
12
|
+
onClick?: () => void;
|
|
12
13
|
disabled?: boolean;
|
|
13
14
|
} & Omit<React.ComponentProps<typeof View>, 'style' | 'accessibilityRole' | 'accessibilityLabel' | 'accessibilityHint'>;
|
|
14
15
|
/**
|
|
@@ -29,9 +30,10 @@ type UpiHandleProps = {
|
|
|
29
30
|
* @param {boolean} [props.showIcon=true] - Toggles the trailing icon visibility.
|
|
30
31
|
* @param {string} [props.iconName='ic_scan_qr_code'] - Icon name from the actions set (e.g. 'ic_qr_code', 'ic_scan_qr_code').
|
|
31
32
|
* @param {ImageSourcePropType} [props.avatarSource] - Optional custom image source for the avatar.
|
|
33
|
+
* @param {Function} [props.onClick] - Click/tap handler. Works as an alias for `onPress`.
|
|
32
34
|
* @param {string} [props.accessibilityLabel] - Accessibility label for screen readers. If not provided, uses label
|
|
33
35
|
* @param {string} [props.accessibilityHint] - Additional accessibility hint for screen readers
|
|
34
36
|
*/
|
|
35
|
-
declare function UpiHandle({ label, modes: propModes, showIcon, iconName, avatarSource, onPress, disabled, accessibilityLabel, accessibilityHint, ...rest }: UpiHandleProps): import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
declare function UpiHandle({ label, modes: propModes, showIcon, iconName, avatarSource, onPress, onClick, disabled, accessibilityLabel, accessibilityHint, ...rest }: UpiHandleProps): import("react/jsx-runtime").JSX.Element;
|
|
36
38
|
export default UpiHandle;
|
|
37
39
|
//# sourceMappingURL=UpiHandle.d.ts.map
|
|
@@ -7,8 +7,10 @@ export { default as BottomNav } from './BottomNav/BottomNav';
|
|
|
7
7
|
export { default as BottomNavItem } from './BottomNavItem/BottomNavItem';
|
|
8
8
|
export { default as Button, type ButtonProps } from './Button/Button';
|
|
9
9
|
export { default as Card } from './Card/Card';
|
|
10
|
+
export { default as Carousel } from './Carousel/Carousel';
|
|
11
|
+
export type { CarouselProps, CarouselItemProps, PaginationProps } from './Carousel/Carousel';
|
|
10
12
|
export { default as Checkbox, type CheckboxProps } from './Checkbox/Checkbox';
|
|
11
|
-
export { default as CardFeedback } from './CardFeedback/CardFeedback';
|
|
13
|
+
export { default as CardFeedback, type CardFeedbackProps } from './CardFeedback/CardFeedback';
|
|
12
14
|
export { default as Disclaimer } from './Disclaimer/Disclaimer';
|
|
13
15
|
export { default as Divider, type DividerProps, type DividerDirection } from './Divider/Divider';
|
|
14
16
|
export { default as Drawer } from './Drawer/Drawer';
|
|
@@ -16,20 +18,22 @@ export { default as CtaCard } from './CtaCard/CtaCard';
|
|
|
16
18
|
export { default as FilterBar } from './FilterBar/FilterBar';
|
|
17
19
|
export { default as Form, type FormProps } from './Form/Form';
|
|
18
20
|
export { useFormContext } from './Form/Form';
|
|
19
|
-
export { default as FormField, type FormFieldProps } from './FormField/FormField';
|
|
21
|
+
export { default as FormField, type FormFieldProps, type FormFieldType } from './FormField/FormField';
|
|
20
22
|
export { default as HStack, type HStackProps } from './HStack/HStack';
|
|
21
23
|
export { default as IconButton } from './IconButton/IconButton';
|
|
22
24
|
export { default as IconCapsule } from './IconCapsule/IconCapsule';
|
|
23
25
|
export { default as LazyList } from './LazyList/LazyList';
|
|
26
|
+
export { default as LinearMeter, type LinearMeterProps } from './LinearMeter/LinearMeter';
|
|
24
27
|
export { default as ListGroup } from './ListGroup/ListGroup';
|
|
25
28
|
export { default as ListItem } from './ListItem/ListItem';
|
|
26
29
|
export { default as MediaCard } from './MediaCard/MediaCard';
|
|
27
30
|
export { default as MerchantProfile, type MerchantProfileProps } from './MerchantProfile/MerchantProfile';
|
|
28
31
|
export { default as MoneyValue } from './MoneyValue/MoneyValue';
|
|
29
|
-
export { default as NoteInput } from './NoteInput/NoteInput';
|
|
32
|
+
export { default as NoteInput, type NoteInputProps } from './NoteInput/NoteInput';
|
|
33
|
+
export { default as Nudge, type NudgeProps } from './Nudge/Nudge';
|
|
30
34
|
export { default as NavArrow } from './NavArrow/NavArrow';
|
|
31
35
|
export { default as Numpad, type NumpadProps, type NumpadKeyValue } from './Numpad/Numpad';
|
|
32
|
-
export { default as
|
|
36
|
+
export { default as Title, type TitleProps } from './Title/Title';
|
|
33
37
|
export { default as Screen, type ScreenProps } from './Screen/Screen';
|
|
34
38
|
export { default as Section } from './Section/Section';
|
|
35
39
|
export { default as Stepper } from './Stepper/Stepper';
|
|
@@ -53,8 +57,9 @@ export { default as CardProviderInfo, type CardProviderInfoProps } from './CardP
|
|
|
53
57
|
export { default as ChipSelect, type ChipSelectProps } from './ChipSelect/ChipSelect';
|
|
54
58
|
export { default as InputSearch, type InputSearchProps } from './InputSearch/InputSearch';
|
|
55
59
|
export { default as SupportText, type SupportTextProps } from './SupportText/SupportText';
|
|
56
|
-
export { default as SupportTextIcon, type SupportTextIconProps } from './SupportText/SupportTextIcon';
|
|
60
|
+
export { default as SupportTextIcon, type SupportTextIconProps, type SupportTextStatus } from './SupportText/SupportTextIcon';
|
|
57
61
|
export { default as RadioButton, type RadioButtonProps } from './RadioButton/RadioButton';
|
|
62
|
+
export { default as RechargeCard, type RechargeCardProps } from './RechargeCard/RechargeCard';
|
|
58
63
|
export { default as Tabs, type TabsProps } from './Tabs/Tabs';
|
|
59
64
|
export { default as TabItem, type TabItemProps } from './Tabs/TabItem';
|
|
60
65
|
export { default as Toast, type ToastProps } from './Toast/Toast';
|
|
@@ -63,9 +68,12 @@ export { useToast, addToast, closeToast, closeAll, type ToastOptions, type Toast
|
|
|
63
68
|
export { default as AmountInput, type AmountInputProps } from './AmountInput/AmountInput';
|
|
64
69
|
export { default as PortfolioHero, type PortfolioHeroProps } from './PortfolioHero/PortfolioHero';
|
|
65
70
|
export { default as ProductLabel, type ProductLabelProps } from './ProductLabel/ProductLabel';
|
|
71
|
+
export { default as ProgressBadge, type ProgressBadgeProps } from './ProgressBadge/ProgressBadge';
|
|
66
72
|
export { default as SwappableAmount, type SwappableAmountProps } from './SwappableAmount/SwappableAmount';
|
|
67
73
|
export { default as OTP, type OTPProps } from './OTP/OTP';
|
|
74
|
+
export { default as PaymentFeedback, type PaymentFeedbackProps } from './PaymentFeedback/PaymentFeedback';
|
|
68
75
|
export { default as StatItem, type StatItemProps } from './StatItem/StatItem';
|
|
69
76
|
export { default as Text, type TextProps } from './Text/Text';
|
|
77
|
+
export { default as SegmentedControl, type SegmentedControlProps, type SegmentedControlItem } from './SegmentedControl/SegmentedControl';
|
|
70
78
|
export { default as Toggle, type ToggleProps } from './Toggle/Toggle';
|
|
71
79
|
//# sourceMappingURL=index.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-
|
|
7
|
+
* Generated: 2026-04-01T09:15:07.349Z
|
|
8
8
|
*/
|
|
9
9
|
export declare const iconRegistry: Record<string, {
|
|
10
10
|
path: string;
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jfs-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.48",
|
|
4
4
|
"description": "React Native Jio Finance Components Library",
|
|
5
5
|
"author": "sunshuaiqi@gmail.com",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"main": "lib/commonjs/index.js",
|
|
8
8
|
"module": "lib/module/index.js",
|
|
9
|
-
"types": "lib/typescript/index.d.ts",
|
|
9
|
+
"types": "lib/typescript/src/index.d.ts",
|
|
10
10
|
"react-native": "src/index.ts",
|
|
11
11
|
"source": "src/index.ts",
|
|
12
12
|
"sideEffects": false,
|
|
@@ -19,11 +19,6 @@ export type ChipSelectProps = {
|
|
|
19
19
|
* @default "ic_calendar_week"
|
|
20
20
|
*/
|
|
21
21
|
icon?: string;
|
|
22
|
-
/**
|
|
23
|
-
* Whether to show the close icon in Active state (when active is true).
|
|
24
|
-
* @default true
|
|
25
|
-
*/
|
|
26
|
-
close?: boolean;
|
|
27
22
|
/**
|
|
28
23
|
* Modes for design token resolution.
|
|
29
24
|
*/
|
|
@@ -50,7 +45,6 @@ function ChipSelect({
|
|
|
50
45
|
label = 'Date',
|
|
51
46
|
active = false,
|
|
52
47
|
icon = 'ic_calendar_week',
|
|
53
|
-
close = true,
|
|
54
48
|
modes = {},
|
|
55
49
|
style,
|
|
56
50
|
labelSlot,
|
|
@@ -127,8 +121,7 @@ function ChipSelect({
|
|
|
127
121
|
|
|
128
122
|
{renderLabel()}
|
|
129
123
|
|
|
130
|
-
{
|
|
131
|
-
{active && close && (
|
|
124
|
+
{active && (
|
|
132
125
|
<Icon name="ic_close" size={iconSize} color={textColor} />
|
|
133
126
|
)}
|
|
134
127
|
</TouchableOpacity>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<design>
|
|
2
|
+
<ListItem layout="Horizontal" leadingType="Avatar" navArrow="false" showSupportText="true" start="true" supportText="Support Text" title="Aasa Singh" trailing="true">
|
|
3
|
+
<Avatar monogram="MS" style="Image"></Avatar>
|
|
4
|
+
<frame horizontalSizing="FILL" name="text wrap" verticalSizing="HUG">
|
|
5
|
+
<slot name="supportText">
|
|
6
|
+
<text name="support text">₹10,000</text>
|
|
7
|
+
</slot>
|
|
8
|
+
<text name="Title">Aasa Singh</text>
|
|
9
|
+
</frame>
|
|
10
|
+
<frame horizontalSizing="HUG" modes='{"Context":"ListItem"}' name="end wrap" verticalSizing="HUG">
|
|
11
|
+
<slot name="slot">
|
|
12
|
+
<Button label="Button">
|
|
13
|
+
<text name="Label">Button</text>
|
|
14
|
+
</Button>
|
|
15
|
+
</slot>
|
|
16
|
+
</frame>
|
|
17
|
+
</ListItem>
|
|
18
|
+
</design>
|
|
@@ -115,6 +115,7 @@ function useFormField(props: FormFieldProps) {
|
|
|
115
115
|
borderWidth: inputBorderSize,
|
|
116
116
|
borderRadius: inputRadius,
|
|
117
117
|
paddingHorizontal: inputPaddingH,
|
|
118
|
+
paddingVertical: 0,
|
|
118
119
|
gap: inputGap,
|
|
119
120
|
}), [inputBackground, inputBorderColor, inputBorderSize, inputRadius, inputPaddingH, inputGap])
|
|
120
121
|
|
|
@@ -76,7 +76,7 @@ export default function NoteInput({
|
|
|
76
76
|
borderColor: borderColor,
|
|
77
77
|
gap: gap as number,
|
|
78
78
|
// Add specific width when editing if requested by Figma design logic, though flex fits content generically
|
|
79
|
-
|
|
79
|
+
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
const baseTextStyle: TextStyle = {
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { View, Text, type ViewStyle, type TextStyle, type StyleProp } from 'react-native'
|
|
3
|
+
import { getVariableByName } from '../../design-tokens/figma-variables-resolver'
|
|
4
|
+
import { useTokens } from '../../design-tokens/JFSThemeProvider'
|
|
5
|
+
import { cloneChildrenWithModes } from '../../utils/react-utils'
|
|
6
|
+
import Button from '../Button/Button'
|
|
7
|
+
|
|
8
|
+
export type NudgeProps = {
|
|
9
|
+
/**
|
|
10
|
+
* Controls the layout variant.
|
|
11
|
+
* - "Default": horizontal layout with optional start icon and content (title/body/button or children slot)
|
|
12
|
+
* - "Variant2": vertical layout with header (icon + title) and children slot below
|
|
13
|
+
*/
|
|
14
|
+
variant?: 'Default' | 'Variant2';
|
|
15
|
+
/** Title text displayed in the nudge */
|
|
16
|
+
title?: string;
|
|
17
|
+
/** Body text displayed below the title (Default variant only, when no children are provided) */
|
|
18
|
+
body?: string;
|
|
19
|
+
/** Label for the default button (Default variant only, when no children are provided) */
|
|
20
|
+
buttonLabel?: string;
|
|
21
|
+
/** Callback for the default button press */
|
|
22
|
+
onPressButton?: () => void;
|
|
23
|
+
/** Custom button slot (Default variant only, overrides buttonLabel/onPressButton) */
|
|
24
|
+
buttonSlot?: React.ReactNode;
|
|
25
|
+
/** Optional leading slot for an icon/element. Pass null or omit to hide. */
|
|
26
|
+
startSlot?: React.ReactNode;
|
|
27
|
+
/** Content slot — overrides the default title/body/button content */
|
|
28
|
+
children?: React.ReactNode;
|
|
29
|
+
/** Mode configuration for design token resolution */
|
|
30
|
+
modes?: Record<string, any>;
|
|
31
|
+
/** Optional container style overrides */
|
|
32
|
+
style?: StyleProp<ViewStyle>;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
function Nudge({
|
|
36
|
+
variant = 'Default',
|
|
37
|
+
title = 'Split payment',
|
|
38
|
+
body = 'Split this transaction into installments',
|
|
39
|
+
buttonLabel = 'Button',
|
|
40
|
+
onPressButton,
|
|
41
|
+
buttonSlot,
|
|
42
|
+
startSlot,
|
|
43
|
+
children,
|
|
44
|
+
modes: propModes = {},
|
|
45
|
+
style,
|
|
46
|
+
}: NudgeProps) {
|
|
47
|
+
const { modes: globalModes } = useTokens()
|
|
48
|
+
const modes = { ...globalModes, ...propModes }
|
|
49
|
+
|
|
50
|
+
const background = getVariableByName('nudge/background', modes) || '#f5f5f5'
|
|
51
|
+
const radius = getVariableByName('nudge/radius', modes) || 12
|
|
52
|
+
const paddingH = getVariableByName('nudge/padding/horizontal', modes) || 12
|
|
53
|
+
const paddingV = getVariableByName('nudge/padding/vertical', modes) || 12
|
|
54
|
+
const gap = getVariableByName('nudge/gap', modes) || 6
|
|
55
|
+
|
|
56
|
+
const titleColor = getVariableByName('nudge/title/color', modes) || '#0d0d0f'
|
|
57
|
+
const titleFontSize = getVariableByName('nudge/title/fontSize', modes) || 14
|
|
58
|
+
const titleFontFamily = getVariableByName('nudge/title/fontFamily', modes) || 'JioType Var'
|
|
59
|
+
const titleLineHeight = getVariableByName('nudge/title/lineHeight', modes) || 15
|
|
60
|
+
const titleFontWeightRaw = getVariableByName('nudge/title/fontWeight', modes) || 700
|
|
61
|
+
const titleFontWeight = typeof titleFontWeightRaw === 'number' ? titleFontWeightRaw.toString() : titleFontWeightRaw
|
|
62
|
+
|
|
63
|
+
const bodyColor = getVariableByName('nudge/body/color', modes) || '#1a1c1f'
|
|
64
|
+
const bodyFontSize = getVariableByName('nudge/body/fontSize', modes) || 12
|
|
65
|
+
const bodyFontFamily = getVariableByName('nudge/body/fontFamily', modes) || 'JioType Var'
|
|
66
|
+
const bodyLineHeight = getVariableByName('nudge/body/lineHeight', modes) || 16
|
|
67
|
+
const bodyFontWeightRaw = getVariableByName('nudge/body/fontWeight', modes) || 500
|
|
68
|
+
const bodyFontWeight = typeof bodyFontWeightRaw === 'number' ? bodyFontWeightRaw.toString() : bodyFontWeightRaw
|
|
69
|
+
|
|
70
|
+
const textGap = getVariableByName('nudge/text/gap', modes) || 4
|
|
71
|
+
const contentGap = getVariableByName('nudge/content/gap', modes) || 8
|
|
72
|
+
const contentMinHeight = getVariableByName('nudge/content/minHeight', modes) || 20
|
|
73
|
+
|
|
74
|
+
const containerStyle: ViewStyle = {
|
|
75
|
+
backgroundColor: background,
|
|
76
|
+
borderRadius: radius,
|
|
77
|
+
paddingHorizontal: paddingH,
|
|
78
|
+
paddingVertical: paddingV,
|
|
79
|
+
gap,
|
|
80
|
+
overflow: 'hidden',
|
|
81
|
+
...(variant === 'Variant2'
|
|
82
|
+
? { flexDirection: 'column', alignItems: 'flex-start' }
|
|
83
|
+
: { flexDirection: 'row', alignItems: 'flex-start' }),
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const titleStyle: TextStyle = {
|
|
87
|
+
color: titleColor,
|
|
88
|
+
fontSize: titleFontSize,
|
|
89
|
+
fontFamily: titleFontFamily,
|
|
90
|
+
lineHeight: titleLineHeight,
|
|
91
|
+
fontWeight: titleFontWeight,
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const bodyStyle: TextStyle = {
|
|
95
|
+
color: bodyColor,
|
|
96
|
+
fontSize: bodyFontSize,
|
|
97
|
+
fontFamily: bodyFontFamily,
|
|
98
|
+
lineHeight: bodyLineHeight,
|
|
99
|
+
fontWeight: bodyFontWeight,
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
const processedStartSlot = startSlot
|
|
103
|
+
? cloneChildrenWithModes(React.Children.toArray(startSlot), modes)
|
|
104
|
+
: null
|
|
105
|
+
|
|
106
|
+
const startSlotElement = processedStartSlot && processedStartSlot.length > 0
|
|
107
|
+
? (processedStartSlot.length === 1 ? processedStartSlot[0] : processedStartSlot)
|
|
108
|
+
: null
|
|
109
|
+
|
|
110
|
+
if (variant === 'Variant2') {
|
|
111
|
+
return (
|
|
112
|
+
<View style={[containerStyle, style]}>
|
|
113
|
+
<View style={{ flexDirection: 'row', alignItems: 'center', gap: 6, width: '100%' }}>
|
|
114
|
+
{startSlotElement}
|
|
115
|
+
<Text style={[titleStyle, { flex: 1 }]}>{title}</Text>
|
|
116
|
+
</View>
|
|
117
|
+
|
|
118
|
+
{children ? (
|
|
119
|
+
cloneChildrenWithModes(React.Children.toArray(children), modes)
|
|
120
|
+
) : null}
|
|
121
|
+
</View>
|
|
122
|
+
)
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
const defaultContent = (
|
|
126
|
+
<View style={{ gap: contentGap, alignItems: 'flex-start', width: '100%' }}>
|
|
127
|
+
<View style={{ gap: textGap, alignItems: 'flex-start', width: '100%' }}>
|
|
128
|
+
<Text style={titleStyle}>{title}</Text>
|
|
129
|
+
<Text style={bodyStyle}>{body}</Text>
|
|
130
|
+
</View>
|
|
131
|
+
{buttonSlot
|
|
132
|
+
? cloneChildrenWithModes(React.Children.toArray(buttonSlot), modes)
|
|
133
|
+
: <Button label={buttonLabel} onPress={onPressButton} modes={modes} />}
|
|
134
|
+
</View>
|
|
135
|
+
)
|
|
136
|
+
|
|
137
|
+
return (
|
|
138
|
+
<View style={[containerStyle, style]}>
|
|
139
|
+
{startSlotElement}
|
|
140
|
+
|
|
141
|
+
<View style={{ flex: 1, minWidth: 1, minHeight: contentMinHeight, justifyContent: 'center', overflow: 'hidden' }}>
|
|
142
|
+
{children
|
|
143
|
+
? cloneChildrenWithModes(React.Children.toArray(children), modes)
|
|
144
|
+
: defaultContent}
|
|
145
|
+
</View>
|
|
146
|
+
</View>
|
|
147
|
+
)
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export default Nudge
|