jfs-components 0.1.25 → 0.1.30
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 +53 -0
- package/lib/commonjs/components/AutoplayControl/AutoplayControl.js +66 -0
- package/lib/commonjs/components/Carousel/Carousel.js +112 -19
- package/lib/commonjs/components/CompareTable/CompareTable.js +191 -25
- package/lib/commonjs/components/ContentSheet/ContentSheet.js +104 -10
- package/lib/commonjs/components/FormUpload/Additem.js +168 -0
- package/lib/commonjs/components/FormUpload/FormUpload.js +198 -0
- package/lib/commonjs/components/Grid/Grid.js +206 -0
- package/lib/commonjs/components/MoneyValue/MoneyValue.js +179 -54
- package/lib/commonjs/components/NumberPagination/NumberPagination.js +144 -0
- package/lib/commonjs/components/PdpCcCard/PdpCcCard.js +7 -1
- package/lib/commonjs/components/ProfileCard/ProfileCard.js +208 -0
- package/lib/commonjs/components/Table/Table.js +27 -7
- package/lib/commonjs/components/UpiHandle/UpiHandle.js +23 -11
- package/lib/commonjs/components/index.js +42 -0
- package/lib/commonjs/design-tokens/Coin Variables-variables-full.json +1 -1
- package/lib/commonjs/design-tokens/figma-modes.generated.js +21 -10
- package/lib/commonjs/icons/components/IconBrokenimage.js +19 -0
- package/lib/commonjs/icons/components/IconImage.js +19 -0
- package/lib/commonjs/icons/components/IconMic.js +19 -0
- package/lib/commonjs/icons/components/IconMicoff.js +19 -0
- package/lib/commonjs/icons/components/IconPause.js +19 -0
- package/lib/commonjs/icons/components/IconPlay.js +19 -0
- package/lib/commonjs/icons/components/index.js +66 -0
- package/lib/commonjs/icons/registry.js +2 -2
- package/lib/module/components/AutoplayControl/AutoplayControl.js +60 -0
- package/lib/module/components/Carousel/Carousel.js +111 -19
- package/lib/module/components/CompareTable/CompareTable.js +191 -26
- package/lib/module/components/ContentSheet/ContentSheet.js +108 -14
- package/lib/module/components/FormUpload/Additem.js +162 -0
- package/lib/module/components/FormUpload/FormUpload.js +192 -0
- package/lib/module/components/Grid/Grid.js +201 -0
- package/lib/module/components/MoneyValue/MoneyValue.js +182 -57
- package/lib/module/components/NumberPagination/NumberPagination.js +138 -0
- package/lib/module/components/PdpCcCard/PdpCcCard.js +7 -1
- package/lib/module/components/ProfileCard/ProfileCard.js +202 -0
- package/lib/module/components/Table/Table.js +27 -7
- package/lib/module/components/UpiHandle/UpiHandle.js +23 -11
- package/lib/module/components/index.js +7 -1
- package/lib/module/design-tokens/Coin Variables-variables-full.json +1 -1
- package/lib/module/design-tokens/figma-modes.generated.js +21 -10
- package/lib/module/icons/components/IconBrokenimage.js +12 -0
- package/lib/module/icons/components/IconImage.js +12 -0
- package/lib/module/icons/components/IconMic.js +12 -0
- package/lib/module/icons/components/IconMicoff.js +12 -0
- package/lib/module/icons/components/IconPause.js +12 -0
- package/lib/module/icons/components/IconPlay.js +12 -0
- package/lib/module/icons/components/index.js +6 -0
- package/lib/module/icons/registry.js +2 -2
- package/lib/typescript/src/components/AutoplayControl/AutoplayControl.d.ts +15 -0
- package/lib/typescript/src/components/Carousel/Carousel.d.ts +8 -1
- package/lib/typescript/src/components/CompareTable/CompareTable.d.ts +21 -1
- package/lib/typescript/src/components/ContentSheet/ContentSheet.d.ts +20 -1
- package/lib/typescript/src/components/FormUpload/Additem.d.ts +96 -0
- package/lib/typescript/src/components/FormUpload/FormUpload.d.ts +85 -0
- package/lib/typescript/src/components/Grid/Grid.d.ts +87 -0
- package/lib/typescript/src/components/MoneyValue/MoneyValue.d.ts +10 -1
- package/lib/typescript/src/components/NumberPagination/NumberPagination.d.ts +21 -0
- package/lib/typescript/src/components/PdpCcCard/PdpCcCard.d.ts +25 -1
- package/lib/typescript/src/components/ProfileCard/ProfileCard.d.ts +89 -0
- package/lib/typescript/src/components/Table/Table.d.ts +9 -1
- package/lib/typescript/src/components/UpiHandle/UpiHandle.d.ts +7 -1
- package/lib/typescript/src/components/index.d.ts +34 -28
- package/lib/typescript/src/design-tokens/figma-modes.generated.d.ts +10 -4
- package/lib/typescript/src/icons/components/IconBrokenimage.d.ts +3 -0
- package/lib/typescript/src/icons/components/IconImage.d.ts +3 -0
- package/lib/typescript/src/icons/components/IconMic.d.ts +3 -0
- package/lib/typescript/src/icons/components/IconMicoff.d.ts +3 -0
- package/lib/typescript/src/icons/components/IconPause.d.ts +3 -0
- package/lib/typescript/src/icons/components/IconPlay.d.ts +3 -0
- package/lib/typescript/src/icons/components/index.d.ts +6 -0
- package/lib/typescript/src/icons/registry.d.ts +1 -1
- package/package.json +1 -1
- package/src/components/AutoplayControl/AutoplayControl.tsx +77 -0
- package/src/components/Carousel/Carousel.tsx +133 -23
- package/src/components/CompareTable/CompareTable.tsx +224 -30
- package/src/components/ContentSheet/ContentSheet.tsx +138 -8
- package/src/components/FormUpload/Additem.tsx +262 -0
- package/src/components/FormUpload/FormUpload.tsx +313 -0
- package/src/components/Grid/Grid.tsx +368 -0
- package/src/components/MoneyValue/MoneyValue.tsx +216 -65
- package/src/components/NumberPagination/NumberPagination.tsx +170 -0
- package/src/components/PdpCcCard/PdpCcCard.tsx +36 -1
- package/src/components/ProfileCard/ProfileCard.tsx +268 -0
- package/src/components/Table/Table.tsx +29 -4
- package/src/components/UpiHandle/UpiHandle.tsx +35 -24
- package/src/components/index.ts +329 -182
- package/src/design-tokens/Coin Variables-variables-full.json +1 -1
- package/src/design-tokens/figma-modes.generated.ts +21 -10
- package/src/icons/components/IconBrokenimage.tsx +11 -0
- package/src/icons/components/IconImage.tsx +11 -0
- package/src/icons/components/IconMic.tsx +11 -0
- package/src/icons/components/IconMicoff.tsx +11 -0
- package/src/icons/components/IconPause.tsx +11 -0
- package/src/icons/components/IconPlay.tsx +11 -0
- package/src/icons/components/index.ts +6 -0
- package/src/icons/registry.ts +25 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type StyleProp, type ViewStyle } from 'react-native';
|
|
2
|
+
import type { Modes } from '../../design-tokens';
|
|
3
|
+
export type AutoplayControlProps = {
|
|
4
|
+
state?: 'pause' | 'play';
|
|
5
|
+
modes?: Modes;
|
|
6
|
+
onPress?: () => void;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
style?: StyleProp<ViewStyle>;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* AutoplayControl is a button component that toggles between play and pause states.
|
|
12
|
+
* All styling values are resolved from Figma design tokens.
|
|
13
|
+
*/
|
|
14
|
+
export default function AutoplayControl({ state, modes, onPress, disabled, style, }: AutoplayControlProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
//# sourceMappingURL=AutoplayControl.d.ts.map
|
|
@@ -28,12 +28,19 @@ export interface CarouselProps {
|
|
|
28
28
|
paddingHorizontal?: number;
|
|
29
29
|
/** Explicit vertical padding (px) for the outer container. Overrides `carousel/padding/vertical`. */
|
|
30
30
|
paddingVertical?: number;
|
|
31
|
+
/**
|
|
32
|
+
* Carousel visual type.
|
|
33
|
+
* - `'Default'` — standard carousel with dot pagination below.
|
|
34
|
+
* - `'Numbered'` — full-bleed carousel with floating AutoplayControl and
|
|
35
|
+
* NumberPagination overlaid at the bottom center.
|
|
36
|
+
*/
|
|
37
|
+
type?: 'Default' | 'Numbered';
|
|
31
38
|
/** Called when the active index changes. */
|
|
32
39
|
onIndexChange?: (index: number) => void;
|
|
33
40
|
/** Style overrides for the outermost container. */
|
|
34
41
|
style?: StyleProp<ViewStyle>;
|
|
35
42
|
}
|
|
36
|
-
export declare function Carousel({ children, modes, autoPlay, autoPlayInterval, showPagination, loop, gap: gapProp, itemWidth: itemWidthProp, paddingHorizontal: paddingHorizontalProp, paddingVertical: paddingVerticalProp, onIndexChange, style, }: CarouselProps): import("react/jsx-runtime").JSX.Element;
|
|
43
|
+
export declare function Carousel({ children, modes, autoPlay, autoPlayInterval, showPagination, loop, gap: gapProp, itemWidth: itemWidthProp, paddingHorizontal: paddingHorizontalProp, paddingVertical: paddingVerticalProp, type, onIndexChange, style, }: CarouselProps): import("react/jsx-runtime").JSX.Element;
|
|
37
44
|
export declare namespace Carousel {
|
|
38
45
|
var Item: typeof import("./Carousel").Item;
|
|
39
46
|
var Pagination: typeof import("./Carousel").Pagination;
|
|
@@ -76,6 +76,26 @@ export type CompareTableProps = {
|
|
|
76
76
|
* lines as it needs even when horizontal space is tight.
|
|
77
77
|
*/
|
|
78
78
|
disableTruncation?: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Fixed width (px) for every selection card and every table cell — all
|
|
81
|
+
* columns share this width. When set, the component enters **scroll mode**:
|
|
82
|
+
*
|
|
83
|
+
* - The cards row and each section's table body become independent
|
|
84
|
+
* horizontal `ScrollView`s whose scroll events are **chained** — moving
|
|
85
|
+
* one moves every other in lockstep (the cards always stay aligned with
|
|
86
|
+
* the cells beneath them).
|
|
87
|
+
* - The cards row becomes a **sticky header** at the top: it pins in place
|
|
88
|
+
* on the vertical axis (does not scroll away) while the sections scroll
|
|
89
|
+
* beneath it. Requires the host to give `CompareTable` a bounded height.
|
|
90
|
+
* - The gray table-header rows (each section's `header`) are rendered
|
|
91
|
+
* full-width **outside** the horizontal scroll, so they stay put
|
|
92
|
+
* horizontally (they don't slide with the cells) while still scrolling
|
|
93
|
+
* vertically with the table.
|
|
94
|
+
*
|
|
95
|
+
* Omit to keep the original flex layout (columns share the available width,
|
|
96
|
+
* no scrolling). @default undefined
|
|
97
|
+
*/
|
|
98
|
+
columnWidth?: number;
|
|
79
99
|
};
|
|
80
100
|
/**
|
|
81
101
|
* CompareTable renders a product comparison surface: a row of selection cards
|
|
@@ -89,6 +109,6 @@ export type CompareTableProps = {
|
|
|
89
109
|
*
|
|
90
110
|
* @component
|
|
91
111
|
*/
|
|
92
|
-
declare function CompareTable({ columns, sections, onAddColumn, addColumnLabel, maxColumns, modes, style, disableTruncation, }: CompareTableProps): import("react/jsx-runtime").JSX.Element;
|
|
112
|
+
declare function CompareTable({ columns, sections, onAddColumn, addColumnLabel, maxColumns, modes, style, disableTruncation, columnWidth, }: CompareTableProps): import("react/jsx-runtime").JSX.Element;
|
|
93
113
|
export default CompareTable;
|
|
94
114
|
//# sourceMappingURL=CompareTable.d.ts.map
|
|
@@ -15,6 +15,12 @@ export type ContentSheetProps = {
|
|
|
15
15
|
* the same theme without you wiring `modes` onto each one.
|
|
16
16
|
*/
|
|
17
17
|
modes?: Modes;
|
|
18
|
+
/**
|
|
19
|
+
* Optional title rendered in a centered, sticky header at the top of the
|
|
20
|
+
* sheet. Uses the same `drawer/title*` token family as the `Drawer` title so
|
|
21
|
+
* the two surfaces stay visually consistent.
|
|
22
|
+
*/
|
|
23
|
+
title?: string;
|
|
18
24
|
/**
|
|
19
25
|
* Keep the sheet above the on-screen keyboard. When the keyboard opens the
|
|
20
26
|
* sheet rises by exactly the keyboard height; when it closes the sheet drops
|
|
@@ -47,6 +53,19 @@ export type ContentSheetProps = {
|
|
|
47
53
|
* works in both modes.
|
|
48
54
|
*/
|
|
49
55
|
pinToBottom?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Controls whether the sheet is on-screen. When this becomes `true` the sheet
|
|
58
|
+
* springs up from the bottom edge (off-screen → on-screen) using the same
|
|
59
|
+
* spring as the {@link Drawer} (`damping: 32`, `stiffness: 300`); when it
|
|
60
|
+
* becomes `false` it springs back down below the bottom edge. The sheet pops
|
|
61
|
+
* up on mount by default.
|
|
62
|
+
*
|
|
63
|
+
* The animation runs entirely on the UI thread via `react-native-reanimated`
|
|
64
|
+
* (no re-renders) and composes with keyboard avoidance — the entrance
|
|
65
|
+
* `translateY` and the keyboard `translateY` are summed in a single
|
|
66
|
+
* `useAnimatedStyle`. Default `true`.
|
|
67
|
+
*/
|
|
68
|
+
visible?: boolean;
|
|
50
69
|
/** Optional style override applied to the sheet container. */
|
|
51
70
|
style?: StyleProp<ViewStyle>;
|
|
52
71
|
} & Omit<ViewProps, 'style' | 'children'>;
|
|
@@ -66,6 +85,6 @@ export type ContentSheetProps = {
|
|
|
66
85
|
* - **Token-driven** styling via `getVariableByName` + `modes`, with `modes`
|
|
67
86
|
* cascaded to all slot children.
|
|
68
87
|
*/
|
|
69
|
-
declare function ContentSheet({ children, modes, avoidKeyboard, keyboardSpacing, safeAreaBottom, pinToBottom, style, ...rest }: ContentSheetProps): import("react/jsx-runtime").JSX.Element;
|
|
88
|
+
declare function ContentSheet({ children, modes, title, avoidKeyboard, keyboardSpacing, safeAreaBottom, pinToBottom, visible, style, ...rest }: ContentSheetProps): import("react/jsx-runtime").JSX.Element;
|
|
70
89
|
export default ContentSheet;
|
|
71
90
|
//# sourceMappingURL=ContentSheet.d.ts.map
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type ImageSourcePropType } from 'react-native';
|
|
3
|
+
import type { Modes } from '../../design-tokens';
|
|
4
|
+
export type PickedAsset = {
|
|
5
|
+
/** URI to the selected file (image, video, or document). */
|
|
6
|
+
uri: string;
|
|
7
|
+
/** Original file name, when available. */
|
|
8
|
+
name?: string;
|
|
9
|
+
/** MIME type, when available. */
|
|
10
|
+
type?: string;
|
|
11
|
+
/** File size in bytes, when available. */
|
|
12
|
+
size?: number;
|
|
13
|
+
/** Image/video width in pixels, when available. */
|
|
14
|
+
width?: number;
|
|
15
|
+
/** Image/video height in pixels, when available. */
|
|
16
|
+
height?: number;
|
|
17
|
+
};
|
|
18
|
+
export type AdditemPickerResult = {
|
|
19
|
+
/** `true` when the user cancelled the picker. */
|
|
20
|
+
didCancel?: boolean;
|
|
21
|
+
/** Selected assets. Empty when cancelled. */
|
|
22
|
+
assets: PickedAsset[];
|
|
23
|
+
/** Native error message, when something went wrong. */
|
|
24
|
+
error?: string;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Callback that opens a platform picker and resolves with the selected assets.
|
|
28
|
+
* This is the integration point for libraries like `react-native-image-picker`,
|
|
29
|
+
* `expo-image-picker`, or `react-native-document-picker`.
|
|
30
|
+
*/
|
|
31
|
+
export type AdditemPicker = () => Promise<AdditemPickerResult>;
|
|
32
|
+
export type AdditemState = 'empty' | 'preview';
|
|
33
|
+
export type AdditemProps = {
|
|
34
|
+
/**
|
|
35
|
+
* Visual state of the item.
|
|
36
|
+
* - `'empty'` — shows the add/upload icon (default).
|
|
37
|
+
* - `'preview'` — shows `imageSource` and a remove icon overlay.
|
|
38
|
+
*/
|
|
39
|
+
state?: AdditemState;
|
|
40
|
+
/**
|
|
41
|
+
* Image to preview when `state` is `'preview'`. Accepts the same shapes as
|
|
42
|
+
* the library's `Image` component (remote URI string, `{ uri }`, or `require()`).
|
|
43
|
+
*/
|
|
44
|
+
imageSource?: ImageSourcePropType | string | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* Called when the cell is pressed. In `'empty'` mode this is typically where
|
|
47
|
+
* the picker is launched; in `'preview'` mode it can open a preview/lightbox.
|
|
48
|
+
*/
|
|
49
|
+
onPress?: () => void;
|
|
50
|
+
/**
|
|
51
|
+
* Called when the remove icon overlay is pressed in `'preview'` mode.
|
|
52
|
+
* Receives the press event so the parent can stop propagation if needed.
|
|
53
|
+
*/
|
|
54
|
+
onRemove?: () => void;
|
|
55
|
+
/**
|
|
56
|
+
* Optional picker to invoke when the empty cell is pressed. When provided,
|
|
57
|
+
* `onPress` is ignored for the empty state and the cell becomes a real
|
|
58
|
+
* upload trigger that resolves with picked assets via `onAssetsPicked`.
|
|
59
|
+
*/
|
|
60
|
+
picker?: AdditemPicker;
|
|
61
|
+
/**
|
|
62
|
+
* Called after a successful picker invocation with the selected assets.
|
|
63
|
+
*/
|
|
64
|
+
onAssetsPicked?: (assets: PickedAsset[]) => void;
|
|
65
|
+
/**
|
|
66
|
+
* Modes for design-token resolution. Defaults to Neutral / Low / Icon Capsule
|
|
67
|
+
* Size S for the inner `IconCapsule` icons; any key supplied here overrides
|
|
68
|
+
* those defaults.
|
|
69
|
+
*/
|
|
70
|
+
modes?: Modes;
|
|
71
|
+
/**
|
|
72
|
+
* Accessibility label. Defaults to a descriptive label based on state.
|
|
73
|
+
*/
|
|
74
|
+
accessibilityLabel?: string;
|
|
75
|
+
/**
|
|
76
|
+
* Disables press interaction. Also dims the cell.
|
|
77
|
+
*/
|
|
78
|
+
isDisabled?: boolean;
|
|
79
|
+
/** Test identifier. */
|
|
80
|
+
testID?: string;
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* `Additem` — a small, reusable upload/preview cell used inside form uploaders.
|
|
84
|
+
*
|
|
85
|
+
* In its default `'empty'` state it shows a centered add/upload icon. In
|
|
86
|
+
* `'preview'` state it renders a thumbnail with a removable overlay. The
|
|
87
|
+
* component is intentionally unopinionated about *how* files are picked: pass a
|
|
88
|
+
* `picker` callback that wraps `react-native-image-picker`,
|
|
89
|
+
* `expo-image-picker`, `react-native-document-picker`, or any custom selector,
|
|
90
|
+
* and the cell will invoke it, surface the result via `onAssetsPicked`, and
|
|
91
|
+
* handle cancellation/errors gracefully.
|
|
92
|
+
*/
|
|
93
|
+
declare function Additem({ state, imageSource, onPress, onRemove, picker, onAssetsPicked, modes: propModes, accessibilityLabel, isDisabled, testID, }: AdditemProps): import("react/jsx-runtime").JSX.Element;
|
|
94
|
+
declare const _default: React.MemoExoticComponent<typeof Additem>;
|
|
95
|
+
export default _default;
|
|
96
|
+
//# sourceMappingURL=Additem.d.ts.map
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type StyleProp, type ViewStyle } from 'react-native';
|
|
3
|
+
import { type AdditemProps, type PickedAsset } from './Additem';
|
|
4
|
+
import type { Modes } from '../../design-tokens';
|
|
5
|
+
export type FormUploadAttachment = PickedAsset;
|
|
6
|
+
export type FormUploadProps = {
|
|
7
|
+
/** Label rendered above the upload row. */
|
|
8
|
+
label?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Helper text rendered below the upload row. When `errorMessage` is provided,
|
|
11
|
+
* it replaces the support text and renders in the error status.
|
|
12
|
+
*/
|
|
13
|
+
supportText?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Field name. When used inside `<Form>`, this is the key used to look up
|
|
16
|
+
* server-side `validationErrors`.
|
|
17
|
+
*/
|
|
18
|
+
name?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Controlled list of attachments. Each item maps to an `Additem` cell:
|
|
21
|
+
* render attachments as `'preview'` cells and leave the last slot as the
|
|
22
|
+
* `'empty'` upload trigger.
|
|
23
|
+
*/
|
|
24
|
+
attachments?: FormUploadAttachment[];
|
|
25
|
+
/**
|
|
26
|
+
* Maximum number of attachments allowed. When omitted, the component renders
|
|
27
|
+
* a single empty upload trigger. Once `attachments.length` reaches `maxCount`,
|
|
28
|
+
* the empty trigger is hidden.
|
|
29
|
+
*/
|
|
30
|
+
maxCount?: number;
|
|
31
|
+
/**
|
|
32
|
+
* Called when the attachment list should change (add or remove). The parent
|
|
33
|
+
* is responsible for updating the `attachments` array.
|
|
34
|
+
*/
|
|
35
|
+
onAttachmentsChange?: (attachments: FormUploadAttachment[]) => void;
|
|
36
|
+
/**
|
|
37
|
+
* Optional picker injected by the parent. This keeps the component free of
|
|
38
|
+
* native-library dependencies while still providing real upload behaviour on
|
|
39
|
+
* iOS/Android. The picker should wrap `react-native-image-picker`,
|
|
40
|
+
* `expo-image-picker`, `react-native-document-picker`, etc.
|
|
41
|
+
*/
|
|
42
|
+
picker?: AdditemProps['picker'];
|
|
43
|
+
/**
|
|
44
|
+
* Error message shown below the row. When provided inside `<Form>`, the form
|
|
45
|
+
* context error is used automatically unless this prop is set explicitly.
|
|
46
|
+
*/
|
|
47
|
+
errorMessage?: string;
|
|
48
|
+
/** Marks the field as invalid. Also set automatically by `<Form>` errors. */
|
|
49
|
+
isInvalid?: boolean;
|
|
50
|
+
/** Disables all upload interaction. */
|
|
51
|
+
isDisabled?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Custom children/slot rendered in place of the generated `Additem` cells.
|
|
54
|
+
* Useful when the consumer wants full control over the upload row. `modes`
|
|
55
|
+
* cascade into slot children automatically.
|
|
56
|
+
*/
|
|
57
|
+
children?: React.ReactNode;
|
|
58
|
+
/** Modes for design-token resolution. */
|
|
59
|
+
modes?: Modes;
|
|
60
|
+
/** Style overrides for the outermost wrapper. */
|
|
61
|
+
style?: StyleProp<ViewStyle>;
|
|
62
|
+
/** Style overrides for the upload row container. */
|
|
63
|
+
rowStyle?: StyleProp<ViewStyle>;
|
|
64
|
+
/** Accessibility label. Defaults to `label`. */
|
|
65
|
+
accessibilityLabel?: string;
|
|
66
|
+
/** Test identifier. */
|
|
67
|
+
testID?: string;
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* `FormUpload` — a form-aware upload row built from reusable `Additem` cells.
|
|
71
|
+
*
|
|
72
|
+
* The component mirrors the Figma "FormUpload" design: a label, a horizontal
|
|
73
|
+
* row of upload/preview cells, and support text. It integrates with the
|
|
74
|
+
* existing `<Form>` context so server-side validation errors automatically
|
|
75
|
+
* show below the row, and it clears those errors when attachments change.
|
|
76
|
+
*
|
|
77
|
+
* Upload behaviour is provided through the `picker` prop so the library stays
|
|
78
|
+
* free of native image-picker dependencies. Pass any picker that returns the
|
|
79
|
+
* `AdditemPickerResult` shape and the empty cell becomes a real upload trigger
|
|
80
|
+
* on both iOS and Android.
|
|
81
|
+
*/
|
|
82
|
+
declare function FormUpload({ label, supportText, name, attachments, maxCount, onAttachmentsChange, picker, errorMessage, isInvalid, isDisabled, children, modes: propModes, style, rowStyle, accessibilityLabel, testID, }: FormUploadProps): import("react/jsx-runtime").JSX.Element;
|
|
83
|
+
declare const _default: React.MemoExoticComponent<typeof FormUpload>;
|
|
84
|
+
export default _default;
|
|
85
|
+
//# sourceMappingURL=FormUpload.d.ts.map
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type StyleProp, type ViewStyle } from 'react-native';
|
|
3
|
+
import type { Modes } from '../../design-tokens';
|
|
4
|
+
export type GridJustifyContent = 'start' | 'stretch' | 'space-between';
|
|
5
|
+
export type GridAlignItems = 'start' | 'stretch' | 'center';
|
|
6
|
+
export type GridProps = {
|
|
7
|
+
/**
|
|
8
|
+
* Number of columns per row. Defaults to `1`. Children flow left-to-right,
|
|
9
|
+
* top-to-bottom into this many columns.
|
|
10
|
+
*/
|
|
11
|
+
columns?: number;
|
|
12
|
+
/**
|
|
13
|
+
* Fixed row count. When set, the grid always renders `columns × rows` cells.
|
|
14
|
+
* Missing cells render as empty placeholders so the geometry stays stable.
|
|
15
|
+
* When omitted, the row count is derived from the number of children.
|
|
16
|
+
*/
|
|
17
|
+
rows?: number;
|
|
18
|
+
/**
|
|
19
|
+
* Fractional column track weights — the React Native equivalent of CSS
|
|
20
|
+
* `grid-template-columns: 1fr 2fr 1fr`. Each value becomes a `flex` grow
|
|
21
|
+
* weight on the matching column. Shorter arrays repeat the last weight;
|
|
22
|
+
* omitted values default to equal `1fr` columns.
|
|
23
|
+
*/
|
|
24
|
+
columnFrs?: readonly number[];
|
|
25
|
+
/**
|
|
26
|
+
* Fractional row track weights. When provided, each row container receives
|
|
27
|
+
* a matching `flexGrow` weight. Useful when the grid should fill a fixed
|
|
28
|
+
* height and rows should share space proportionally.
|
|
29
|
+
*/
|
|
30
|
+
rowFrs?: readonly number[];
|
|
31
|
+
/** Override the resolved column gap token. */
|
|
32
|
+
columnGap?: number;
|
|
33
|
+
/** Override the resolved row gap token. */
|
|
34
|
+
rowGap?: number;
|
|
35
|
+
/**
|
|
36
|
+
* Shorthand gap override applied when `columnGap` / `rowGap` are not set
|
|
37
|
+
* individually. Falls back to the `Grid/gap` token.
|
|
38
|
+
*/
|
|
39
|
+
gap?: number;
|
|
40
|
+
/** Uniform padding override for all sides. */
|
|
41
|
+
padding?: number;
|
|
42
|
+
paddingHorizontal?: number;
|
|
43
|
+
paddingVertical?: number;
|
|
44
|
+
paddingTop?: number;
|
|
45
|
+
paddingBottom?: number;
|
|
46
|
+
paddingLeft?: number;
|
|
47
|
+
paddingRight?: number;
|
|
48
|
+
/**
|
|
49
|
+
* How cells are distributed along each row.
|
|
50
|
+
* - `'stretch'` (default) — cells expand using `columnFrs`.
|
|
51
|
+
* - `'start'` — cells hug the leading edge; trailing space stays empty.
|
|
52
|
+
* - `'space-between'` — leftover space is distributed between cells
|
|
53
|
+
* (first cell flush-left, last cell flush-right).
|
|
54
|
+
*/
|
|
55
|
+
justifyContent?: GridJustifyContent;
|
|
56
|
+
/** Cross-axis alignment applied to every cell wrapper. Defaults to `'stretch'`. */
|
|
57
|
+
alignItems?: GridAlignItems;
|
|
58
|
+
/**
|
|
59
|
+
* Slot content. Each child becomes one grid cell. `modes` cascade into all
|
|
60
|
+
* slot children automatically.
|
|
61
|
+
*/
|
|
62
|
+
children?: React.ReactNode;
|
|
63
|
+
/** Design token modes (e.g. `{ 'Slot gap': 'M' }`). */
|
|
64
|
+
modes?: Modes;
|
|
65
|
+
/** Style override for the outer container. */
|
|
66
|
+
style?: StyleProp<ViewStyle>;
|
|
67
|
+
/** Style override for the inner rows wrapper. */
|
|
68
|
+
contentStyle?: StyleProp<ViewStyle>;
|
|
69
|
+
/** Style applied to every cell wrapper. */
|
|
70
|
+
cellStyle?: StyleProp<ViewStyle>;
|
|
71
|
+
/** Accessibility label for the grid container. */
|
|
72
|
+
accessibilityLabel?: string;
|
|
73
|
+
testID?: string;
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* `Grid` — a token-driven layout grid for React Native.
|
|
77
|
+
*
|
|
78
|
+
* Mirrors the Figma "Grid" component: a padded container with configurable
|
|
79
|
+
* columns, rows, fractional column tracks (`columnFrs`), and gap tokens.
|
|
80
|
+
* Each slot child maps to one cell — no separate `GridItem` wrapper is needed.
|
|
81
|
+
*
|
|
82
|
+
* @component
|
|
83
|
+
*/
|
|
84
|
+
declare function Grid({ columns, rows, columnFrs, rowFrs, columnGap: columnGapProp, rowGap: rowGapProp, gap: gapProp, padding: paddingProp, paddingHorizontal: paddingHorizontalProp, paddingVertical: paddingVerticalProp, paddingTop: paddingTopProp, paddingBottom: paddingBottomProp, paddingLeft: paddingLeftProp, paddingRight: paddingRightProp, justifyContent, alignItems, children, modes: propModes, style, contentStyle, cellStyle, accessibilityLabel, testID, }: GridProps): import("react/jsx-runtime").JSX.Element;
|
|
85
|
+
declare const _default: React.MemoExoticComponent<typeof Grid>;
|
|
86
|
+
export default _default;
|
|
87
|
+
//# sourceMappingURL=Grid.d.ts.map
|
|
@@ -12,6 +12,15 @@ export type MoneyValueProps = {
|
|
|
12
12
|
hidden?: boolean;
|
|
13
13
|
/** When true, a blinking vertical cursor is shown at the end of the value text. */
|
|
14
14
|
focused?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* When true, tapping the component enters an inline edit mode where the value
|
|
17
|
+
* becomes a numeric TextInput. The user can type digits or delete the existing
|
|
18
|
+
* amount. Only numeric characters (including one decimal point) are accepted.
|
|
19
|
+
* On blur or submit the edit is committed and the display restores.
|
|
20
|
+
*/
|
|
21
|
+
editable?: boolean;
|
|
22
|
+
/** Called when the value changes during editing (after commit on blur). */
|
|
23
|
+
onValueChange?: (newValue: string | number) => void;
|
|
15
24
|
/** Modes configuration mapped to Figma tokens. */
|
|
16
25
|
modes?: Modes;
|
|
17
26
|
style?: StyleProp<ViewStyle>;
|
|
@@ -32,6 +41,6 @@ export type MoneyValueProps = {
|
|
|
32
41
|
* the `focused` prop is provided to this component, it will display a natural
|
|
33
42
|
* blinking text cursor.
|
|
34
43
|
*/
|
|
35
|
-
declare function MoneyValue({ value, currency, negative, focused, hidden, modes, style, valueStyle, currencyStyle, negativeSignStyle, accessibilityLabel, accessibilityHint, onPress, ...rest }: MoneyValueProps): import("react/jsx-runtime").JSX.Element;
|
|
44
|
+
declare function MoneyValue({ value, currency, negative, focused, hidden, editable, onValueChange, modes, style, valueStyle, currencyStyle, negativeSignStyle, accessibilityLabel, accessibilityHint, onPress, ...rest }: MoneyValueProps): import("react/jsx-runtime").JSX.Element;
|
|
36
45
|
export default MoneyValue;
|
|
37
46
|
//# sourceMappingURL=MoneyValue.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type StyleProp, type ViewStyle } from 'react-native';
|
|
3
|
+
import type { Modes } from '../../design-tokens';
|
|
4
|
+
export type NumberPaginationProps = {
|
|
5
|
+
/** The 1-based active page index. Ignored if `children` is supplied. Defaults to 1. */
|
|
6
|
+
activePage?: number;
|
|
7
|
+
/** The total number of pages. Ignored if `children` is supplied. Defaults to 1. */
|
|
8
|
+
totalPages?: number;
|
|
9
|
+
/** Callback fired when a page button is pressed. Ignored if `children` is supplied. */
|
|
10
|
+
onPageChange?: (page: number) => void;
|
|
11
|
+
/** Custom children to override the default page buttons. */
|
|
12
|
+
children?: React.ReactNode;
|
|
13
|
+
modes?: Modes;
|
|
14
|
+
style?: StyleProp<ViewStyle>;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* NumberPagination component displays a horizontal list of page numbers on a frosted glass surface.
|
|
18
|
+
* All styling is driven by Figma design tokens with support for custom children slot.
|
|
19
|
+
*/
|
|
20
|
+
export default function NumberPagination({ activePage, totalPages, onPageChange, children, modes, style, }: NumberPaginationProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
//# sourceMappingURL=NumberPagination.d.ts.map
|
|
@@ -32,6 +32,30 @@ export interface PdpCcCardProps {
|
|
|
32
32
|
title?: string;
|
|
33
33
|
/** Subtitle rendered below the title (14px medium). */
|
|
34
34
|
subtitle?: string;
|
|
35
|
+
/**
|
|
36
|
+
* Number of lines to limit the title to. The `Title` component defaults to
|
|
37
|
+
* `1` when this is unset, so the headline is a single line with an ellipsis
|
|
38
|
+
* by default. Pass a larger value (e.g. `2`) to allow the title to wrap onto
|
|
39
|
+
* that many lines before truncating, or set {@link disableTruncation} to
|
|
40
|
+
* remove the clamp entirely. The subtitle is never line-clamped.
|
|
41
|
+
*/
|
|
42
|
+
numberOfLines?: number;
|
|
43
|
+
/**
|
|
44
|
+
* When `true`, disables truncation for both the title and subtitle: the
|
|
45
|
+
* trailing ellipsis (`…`) is never shown and the `numberOfLines` clamp is
|
|
46
|
+
* ignored. The text is also never shrunk by a tight parent — it keeps its
|
|
47
|
+
* full intrinsic size and overflows (even breaking the parent layout) rather
|
|
48
|
+
* than ever clipping into an ellipsis. The text still wraps onto multiple
|
|
49
|
+
* lines.
|
|
50
|
+
*/
|
|
51
|
+
disableTruncation?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* When `true`, forces both the title and subtitle onto a single line with no
|
|
54
|
+
* wrapping (implies {@link disableTruncation}). On web the line overflows
|
|
55
|
+
* horizontally — brutally breaking the parent layout if it has to — instead
|
|
56
|
+
* of wrapping or truncating.
|
|
57
|
+
*/
|
|
58
|
+
singleLine?: boolean;
|
|
35
59
|
/**
|
|
36
60
|
* The metric columns rendered in the stats row. Vertical dividers are
|
|
37
61
|
* inserted automatically between adjacent metrics. Defaults to two sample
|
|
@@ -79,6 +103,6 @@ export interface PdpCcCardProps {
|
|
|
79
103
|
*
|
|
80
104
|
* All defaults can be overridden via `modes`.
|
|
81
105
|
*/
|
|
82
|
-
declare function PdpCcCard({ imageSource, imageWidth, imageHeight, media, title, subtitle, metrics, buttonLabel, buttonIcon, onButtonPress, button, showButton, onPress, width, modes, style, accessibilityLabel, }: PdpCcCardProps): import("react/jsx-runtime").JSX.Element;
|
|
106
|
+
declare function PdpCcCard({ imageSource, imageWidth, imageHeight, media, title, subtitle, numberOfLines, disableTruncation, singleLine, metrics, buttonLabel, buttonIcon, onButtonPress, button, showButton, onPress, width, modes, style, accessibilityLabel, }: PdpCcCardProps): import("react/jsx-runtime").JSX.Element;
|
|
83
107
|
export default PdpCcCard;
|
|
84
108
|
//# sourceMappingURL=PdpCcCard.d.ts.map
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type StyleProp, type ViewStyle, type ImageSourcePropType } from 'react-native';
|
|
3
|
+
import type { Modes } from '../../design-tokens';
|
|
4
|
+
/**
|
|
5
|
+
* A single UPI handle pill rendered under the profile name.
|
|
6
|
+
*/
|
|
7
|
+
export interface ProfileCardUpiHandle {
|
|
8
|
+
/** Handle text, e.g. `"username@jio"` or a phone number. */
|
|
9
|
+
label: string;
|
|
10
|
+
/** Trailing registry icon (e.g. `'ic_copy'`, `'ic_confirm'`). */
|
|
11
|
+
iconName?: string;
|
|
12
|
+
/** Toggles the trailing icon. Defaults to `true`. */
|
|
13
|
+
showIcon?: boolean;
|
|
14
|
+
/** Makes the pill pressable (e.g. copy-to-clipboard). */
|
|
15
|
+
onPress?: () => void;
|
|
16
|
+
}
|
|
17
|
+
export interface ProfileCardProps {
|
|
18
|
+
/** User's display name shown in the header. */
|
|
19
|
+
name?: string;
|
|
20
|
+
/** Monogram initials for the avatar (used when `avatarSource` is not set). */
|
|
21
|
+
monogram?: string;
|
|
22
|
+
/** Avatar image source. When set, the avatar renders the image instead of the monogram. */
|
|
23
|
+
avatarSource?: ImageSourcePropType | string;
|
|
24
|
+
/**
|
|
25
|
+
* Registry icon for the small badge attached to the avatar's bottom-right
|
|
26
|
+
* corner. Pass `null` to hide the badge. Defaults to `'ic_qr_code'`.
|
|
27
|
+
*/
|
|
28
|
+
badgeIcon?: string | null;
|
|
29
|
+
/** UPI handle pills rendered under the name. Pass `[]` to render none. */
|
|
30
|
+
upiHandles?: ProfileCardUpiHandle[];
|
|
31
|
+
/**
|
|
32
|
+
* Full override for the header row (avatar + name + handles). Takes
|
|
33
|
+
* precedence over the declarative header props. `modes` cascade into it.
|
|
34
|
+
*/
|
|
35
|
+
header?: React.ReactNode;
|
|
36
|
+
/**
|
|
37
|
+
* Card body (the Figma "slot"). Rendered below the header divider; `modes`
|
|
38
|
+
* (including the profile-card context) cascade into every child, so nested
|
|
39
|
+
* `ListItem`s, `Divider`s, `Text`s and `Button`s resolve the on-dark
|
|
40
|
+
* profile-card token values automatically.
|
|
41
|
+
*/
|
|
42
|
+
children?: React.ReactNode;
|
|
43
|
+
/** Toggles the divider between the header and the body. Defaults to `true`. */
|
|
44
|
+
showDivider?: boolean;
|
|
45
|
+
/** Card width. Defaults to the Figma spec (`344`). Pass `'100%'` to fill the parent. */
|
|
46
|
+
width?: number | `${number}%`;
|
|
47
|
+
/** Modes object for design-token resolution, cascaded to all children. */
|
|
48
|
+
modes?: Modes;
|
|
49
|
+
/** Style overrides for the card container. */
|
|
50
|
+
style?: StyleProp<ViewStyle>;
|
|
51
|
+
/** Accessibility label for the card. */
|
|
52
|
+
accessibilityLabel?: string;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* ProfileCard — Figma node 6914:38498 ("Profile Card").
|
|
56
|
+
*
|
|
57
|
+
* A dark, rounded profile summary card composed from the shared primitives:
|
|
58
|
+
*
|
|
59
|
+
* - **Header** — a {@link ListItem} whose leading slot is an {@link Attached}
|
|
60
|
+
* monogram {@link Avatar} with a small {@link IconCapsule} badge at its
|
|
61
|
+
* bottom-right, the user's name as the title, and a row of
|
|
62
|
+
* {@link UpiHandle} pills in the support slot.
|
|
63
|
+
* - **Divider** — separates the header from the body.
|
|
64
|
+
* - **Body slot** — arbitrary children (typically `ListItem`s separated by
|
|
65
|
+
* `Divider`s). All profile-card context modes cascade into the slot, so
|
|
66
|
+
* nested components automatically resolve their on-dark token values.
|
|
67
|
+
*
|
|
68
|
+
* The card supports the `Profile Card Appearance` collection
|
|
69
|
+
* (`Default` | `Premium`) via the `modes` prop, which recolors the container,
|
|
70
|
+
* avatar, pills and divider in one go.
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```tsx
|
|
74
|
+
* <ProfileCard
|
|
75
|
+
* name="Shruti Chandarshekhar Rai"
|
|
76
|
+
* monogram="SR"
|
|
77
|
+
* upiHandles={[
|
|
78
|
+
* { label: 'shrutirai-1@jio', iconName: 'ic_copy', onPress: copyHandle },
|
|
79
|
+
* { label: '9184844184', iconName: 'ic_confirm' },
|
|
80
|
+
* ]}
|
|
81
|
+
* >
|
|
82
|
+
* <ListItem layout="Horizontal" title="JioFinance+" navArrow={false} />
|
|
83
|
+
* </ProfileCard>
|
|
84
|
+
* ```
|
|
85
|
+
*/
|
|
86
|
+
declare function ProfileCard({ name, monogram, avatarSource, badgeIcon, upiHandles, header, children, showDivider, width, modes: propModes, style, accessibilityLabel, }: ProfileCardProps): import("react/jsx-runtime").JSX.Element;
|
|
87
|
+
declare const _default: React.MemoExoticComponent<typeof ProfileCard>;
|
|
88
|
+
export default _default;
|
|
89
|
+
//# sourceMappingURL=ProfileCard.d.ts.map
|
|
@@ -102,6 +102,14 @@ export type TableProps<T = Record<string, unknown>> = {
|
|
|
102
102
|
* for wide tables that exceed the viewport on mobile. @default false
|
|
103
103
|
*/
|
|
104
104
|
scrollable?: boolean;
|
|
105
|
+
/**
|
|
106
|
+
* Fixed width (px) applied to every column — header and body alike — so
|
|
107
|
+
* all columns share the same width. An explicit per-column `width` (on
|
|
108
|
+
* `TableColumn`, or on an individual `Table.Cell`/`Table.HeaderCell`) still
|
|
109
|
+
* takes precedence when set. Omit to let columns flex to share the
|
|
110
|
+
* available space.
|
|
111
|
+
*/
|
|
112
|
+
columnWidth?: number;
|
|
105
113
|
/** Accessibility label for the table container. */
|
|
106
114
|
accessibilityLabel?: string;
|
|
107
115
|
/** Design token modes for theming (e.g. `{ "Color Mode": "Light" }`). */
|
|
@@ -126,7 +134,7 @@ export type TableProps<T = Record<string, unknown>> = {
|
|
|
126
134
|
*
|
|
127
135
|
* @component
|
|
128
136
|
*/
|
|
129
|
-
declare function Table<T = Record<string, unknown>>({ columns, data, children, showHeader, getRowKey, onRowPress, scrollable, accessibilityLabel, modes, style, }: TableProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
137
|
+
declare function Table<T = Record<string, unknown>>({ columns, data, children, showHeader, getRowKey, onRowPress, scrollable, columnWidth, accessibilityLabel, modes, style, }: TableProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
130
138
|
declare namespace Table {
|
|
131
139
|
var Header: typeof TableHeader;
|
|
132
140
|
var HeaderCell: typeof TableHeaderCell;
|
|
@@ -12,6 +12,12 @@ type UpiHandleProps = {
|
|
|
12
12
|
* inline SVG XML string, a `require()` asset, an SVG React component, or
|
|
13
13
|
* an already-rendered element. See {@link UnifiedSource}. Avatars are
|
|
14
14
|
* intentionally **not** tinted — the source renders as-is.
|
|
15
|
+
*
|
|
16
|
+
* The leading avatar is driven entirely by this prop: providing a `source`
|
|
17
|
+
* (or the deprecated `avatarSource`) force-sets the Figma "UPI Handle Image"
|
|
18
|
+
* collection to `True` and renders the avatar; omitting it force-sets the
|
|
19
|
+
* mode to `False` and hides it. This override wins over any `UPI Handle
|
|
20
|
+
* Image` value passed via `modes`.
|
|
15
21
|
*/
|
|
16
22
|
source?: UnifiedSource;
|
|
17
23
|
/**
|
|
@@ -41,7 +47,7 @@ type UpiHandleProps = {
|
|
|
41
47
|
* @param {Object} [props.modes={}] - Modes object passed directly to `getVariableByName`.
|
|
42
48
|
* @param {boolean} [props.showIcon=true] - Toggles the trailing icon visibility.
|
|
43
49
|
* @param {string} [props.iconName='ic_scan_qr_code'] - Icon name from the actions set.
|
|
44
|
-
* @param {UnifiedSource} [props.source] - Unified avatar source (URI, inline SVG XML, `require()` asset, SVG React component, or React element). Smart-detects raster vs SVG so the same prop works on iOS, Android and web.
|
|
50
|
+
* @param {UnifiedSource} [props.source] - Unified avatar source (URI, inline SVG XML, `require()` asset, SVG React component, or React element). Smart-detects raster vs SVG so the same prop works on iOS, Android and web. Providing a source force-sets `UPI Handle Image: True` (avatar shown); omitting it force-sets `False` (avatar hidden), overriding any `UPI Handle Image` value passed via `modes`.
|
|
45
51
|
* @param {ImageSourcePropType|UnifiedSource} [props.avatarSource] - Deprecated alias for `source`; kept for back-compat.
|
|
46
52
|
* @param {Function} [props.onClick] - Click/tap handler. Works as an alias for `onPress`.
|
|
47
53
|
* @param {string} [props.accessibilityLabel] - Accessibility label for screen readers
|