jfs-components 0.1.2 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -0
- package/lib/commonjs/components/AmountInput/AmountInput.js +8 -5
- package/lib/commonjs/components/BenefitCard/BenefitCard.js +231 -0
- package/lib/commonjs/components/CcCard/CcCard.js +470 -0
- package/lib/commonjs/components/Checkbox/Checkbox.js +4 -3
- package/lib/commonjs/components/CheckboxItem/CheckboxItem.js +4 -3
- package/lib/commonjs/components/CompareTable/CompareTable.js +372 -0
- package/lib/commonjs/components/ComparisonBar/ComparisonBar.js +266 -0
- package/lib/commonjs/components/DropdownInput/DropdownInput.js +35 -3
- package/lib/commonjs/components/FormField/FormField.js +4 -3
- package/lib/commonjs/components/InputSearch/InputSearch.js +6 -4
- package/lib/commonjs/components/NoteInput/NoteInput.js +6 -5
- package/lib/commonjs/components/PdpCcCard/PdpCcCard.js +273 -0
- package/lib/commonjs/components/ProductMerchandisingCard/GlassFill.js +263 -0
- package/lib/commonjs/components/ProductMerchandisingCard/GlassFill.web.js +116 -0
- package/lib/commonjs/components/ProductMerchandisingCard/ProductMerchandisingCard.js +353 -0
- package/lib/commonjs/components/ProjectionMarker/ProjectionMarker.js +161 -0
- package/lib/commonjs/components/Radio/Radio.js +5 -5
- package/lib/commonjs/components/Slider/Slider.js +473 -0
- package/lib/commonjs/components/TextInput/TextInput.js +13 -8
- package/lib/commonjs/components/TextSegment/TextSegment.js +118 -0
- package/lib/commonjs/components/index.js +63 -0
- package/lib/commonjs/design-tokens/Coin Variables-variables-full.json +1 -1
- package/lib/commonjs/design-tokens/figma-modes.generated.js +38 -9
- package/lib/commonjs/icons/registry.js +1 -1
- package/lib/commonjs/utils/react-utils.js +22 -0
- package/lib/module/components/AmountInput/AmountInput.js +6 -4
- package/lib/module/components/BenefitCard/BenefitCard.js +225 -0
- package/lib/module/components/CcCard/CcCard.js +464 -0
- package/lib/module/components/Checkbox/Checkbox.js +5 -4
- package/lib/module/components/CheckboxItem/CheckboxItem.js +5 -4
- package/lib/module/components/CompareTable/CompareTable.js +367 -0
- package/lib/module/components/ComparisonBar/ComparisonBar.js +260 -0
- package/lib/module/components/DropdownInput/DropdownInput.js +36 -4
- package/lib/module/components/FormField/FormField.js +5 -4
- package/lib/module/components/InputSearch/InputSearch.js +6 -4
- package/lib/module/components/NoteInput/NoteInput.js +7 -6
- package/lib/module/components/PdpCcCard/PdpCcCard.js +267 -0
- package/lib/module/components/ProductMerchandisingCard/GlassFill.js +257 -0
- package/lib/module/components/ProductMerchandisingCard/GlassFill.web.js +111 -0
- package/lib/module/components/ProductMerchandisingCard/ProductMerchandisingCard.js +347 -0
- package/lib/module/components/ProjectionMarker/ProjectionMarker.js +156 -0
- package/lib/module/components/Radio/Radio.js +5 -4
- package/lib/module/components/Slider/Slider.js +468 -0
- package/lib/module/components/TextInput/TextInput.js +15 -10
- package/lib/module/components/TextSegment/TextSegment.js +113 -0
- package/lib/module/components/index.js +9 -0
- package/lib/module/design-tokens/Coin Variables-variables-full.json +1 -1
- package/lib/module/design-tokens/figma-modes.generated.js +38 -9
- package/lib/module/icons/registry.js +1 -1
- package/lib/module/utils/react-utils.js +21 -0
- package/lib/typescript/src/components/AmountInput/AmountInput.d.ts +3 -2
- package/lib/typescript/src/components/BenefitCard/BenefitCard.d.ts +93 -0
- package/lib/typescript/src/components/CcCard/CcCard.d.ts +137 -0
- package/lib/typescript/src/components/Checkbox/Checkbox.d.ts +3 -2
- package/lib/typescript/src/components/CheckboxItem/CheckboxItem.d.ts +2 -2
- package/lib/typescript/src/components/CompareTable/CompareTable.d.ts +88 -0
- package/lib/typescript/src/components/ComparisonBar/ComparisonBar.d.ts +118 -0
- package/lib/typescript/src/components/DropdownInput/DropdownInput.d.ts +20 -1
- package/lib/typescript/src/components/FormField/FormField.d.ts +2 -2
- package/lib/typescript/src/components/InputSearch/InputSearch.d.ts +23 -2
- package/lib/typescript/src/components/NoteInput/NoteInput.d.ts +19 -2
- package/lib/typescript/src/components/PdpCcCard/PdpCcCard.d.ts +84 -0
- package/lib/typescript/src/components/ProductMerchandisingCard/GlassFill.d.ts +56 -0
- package/lib/typescript/src/components/ProductMerchandisingCard/GlassFill.web.d.ts +27 -0
- package/lib/typescript/src/components/ProductMerchandisingCard/ProductMerchandisingCard.d.ts +81 -0
- package/lib/typescript/src/components/ProjectionMarker/ProjectionMarker.d.ts +82 -0
- package/lib/typescript/src/components/Radio/Radio.d.ts +3 -2
- package/lib/typescript/src/components/RadioButton/RadioButton.d.ts +2 -2
- package/lib/typescript/src/components/Slider/Slider.d.ts +99 -0
- package/lib/typescript/src/components/TextInput/TextInput.d.ts +9 -29
- package/lib/typescript/src/components/TextSegment/TextSegment.d.ts +100 -0
- package/lib/typescript/src/components/index.d.ts +10 -1
- package/lib/typescript/src/design-tokens/figma-modes.generated.d.ts +22 -2
- package/lib/typescript/src/icons/registry.d.ts +1 -1
- package/lib/typescript/src/utils/react-utils.d.ts +10 -0
- package/package.json +2 -1
- package/src/components/AmountInput/AmountInput.tsx +7 -5
- package/src/components/BenefitCard/BenefitCard.tsx +309 -0
- package/src/components/CcCard/CcCard.tsx +598 -0
- package/src/components/Checkbox/Checkbox.tsx +5 -4
- package/src/components/CheckboxItem/CheckboxItem.tsx +5 -4
- package/src/components/CompareTable/CompareTable.tsx +477 -0
- package/src/components/ComparisonBar/ComparisonBar.tsx +356 -0
- package/src/components/DropdownInput/DropdownInput.tsx +55 -3
- package/src/components/FormField/FormField.tsx +5 -4
- package/src/components/InputSearch/InputSearch.tsx +8 -5
- package/src/components/NoteInput/NoteInput.tsx +8 -6
- package/src/components/PdpCcCard/PdpCcCard.tsx +356 -0
- package/src/components/ProductMerchandisingCard/GlassFill.tsx +276 -0
- package/src/components/ProductMerchandisingCard/GlassFill.web.tsx +127 -0
- package/src/components/ProductMerchandisingCard/ProductMerchandisingCard.tsx +423 -0
- package/src/components/ProjectionMarker/ProjectionMarker.tsx +277 -0
- package/src/components/Radio/Radio.tsx +5 -4
- package/src/components/Slider/Slider.tsx +628 -0
- package/src/components/TextInput/TextInput.tsx +15 -11
- package/src/components/TextSegment/TextSegment.tsx +166 -0
- package/src/components/index.ts +10 -1
- package/src/design-tokens/Coin Variables-variables-full.json +1 -1
- package/src/design-tokens/figma-modes.generated.ts +38 -9
- package/src/icons/registry.ts +1 -1
- package/src/utils/react-utils.ts +23 -0
- package/lib/typescript/scripts/extract-component-tokens.d.ts +0 -9
- package/lib/typescript/scripts/generate-component-docs.d.ts +0 -9
- package/lib/typescript/scripts/generate-icon-registry.d.ts +0 -3
- package/lib/typescript/scripts/generate-mode-types.d.ts +0 -2
- package/lib/typescript/scripts/retype-modes.d.cts +0 -2
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type ViewStyle, type StyleProp, type ImageSourcePropType } from 'react-native';
|
|
3
|
+
import type { Modes } from '../../design-tokens';
|
|
4
|
+
/**
|
|
5
|
+
* A single metric column inside the card's stats row: a small title, a bold
|
|
6
|
+
* value and an optional muted caption.
|
|
7
|
+
*/
|
|
8
|
+
export interface PdpCcCardMetric {
|
|
9
|
+
/** Small label rendered above the value (e.g. `"Weight"`). */
|
|
10
|
+
title?: string;
|
|
11
|
+
/** The prominent value (e.g. `"24K"`). */
|
|
12
|
+
value?: string;
|
|
13
|
+
/** Optional muted caption rendered below the value. */
|
|
14
|
+
caption?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface PdpCcCardProps {
|
|
17
|
+
/**
|
|
18
|
+
* Image source for the default media slot. Accepts a URL string or any RN
|
|
19
|
+
* `ImageSourcePropType`. Ignored when `media` is provided.
|
|
20
|
+
*/
|
|
21
|
+
imageSource?: ImageSourcePropType | string;
|
|
22
|
+
/** Default media image width. Defaults to the Figma spec (`100`). */
|
|
23
|
+
imageWidth?: number;
|
|
24
|
+
/** Default media image height. Defaults to the Figma spec (`60`). */
|
|
25
|
+
imageHeight?: number;
|
|
26
|
+
/**
|
|
27
|
+
* Full override for the media slot (top of the card). Takes precedence over
|
|
28
|
+
* `imageSource`. `modes` cascade into it automatically.
|
|
29
|
+
*/
|
|
30
|
+
media?: React.ReactNode;
|
|
31
|
+
/** Headline title (26px black). */
|
|
32
|
+
title?: string;
|
|
33
|
+
/** Subtitle rendered below the title (14px medium). */
|
|
34
|
+
subtitle?: string;
|
|
35
|
+
/**
|
|
36
|
+
* The metric columns rendered in the stats row. Vertical dividers are
|
|
37
|
+
* inserted automatically between adjacent metrics. Defaults to two sample
|
|
38
|
+
* metrics.
|
|
39
|
+
*/
|
|
40
|
+
metrics?: PdpCcCardMetric[];
|
|
41
|
+
/** CTA button label. Defaults to `"button"`. */
|
|
42
|
+
buttonLabel?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Registry icon name for the button's leading glyph. Defaults to
|
|
45
|
+
* `'ic_add_circle'`. Pass `null` to hide the leading icon.
|
|
46
|
+
*/
|
|
47
|
+
buttonIcon?: string | null;
|
|
48
|
+
/** CTA press handler. */
|
|
49
|
+
onButtonPress?: () => void;
|
|
50
|
+
/** Full override for the CTA. Takes precedence over `buttonLabel`. */
|
|
51
|
+
button?: React.ReactNode;
|
|
52
|
+
/** Toggles the CTA button. Defaults to `true`. */
|
|
53
|
+
showButton?: boolean;
|
|
54
|
+
/** Press handler for the whole card. When set, the card becomes pressable. */
|
|
55
|
+
onPress?: () => void;
|
|
56
|
+
/** Card width. Defaults to the Figma spec (`344`). Pass `'100%'` to fill the parent. */
|
|
57
|
+
width?: number | `${number}%`;
|
|
58
|
+
/** Modes object for design-token resolution. Cascaded to all children. */
|
|
59
|
+
modes?: Modes;
|
|
60
|
+
/** Style overrides for the card container. */
|
|
61
|
+
style?: StyleProp<ViewStyle>;
|
|
62
|
+
/** Accessibility label for the card. */
|
|
63
|
+
accessibilityLabel?: string;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* PdpCcCard — Figma node 5352:935 ("PDP cc card").
|
|
67
|
+
*
|
|
68
|
+
* A centered white product/PDP card composed from the shared design-system
|
|
69
|
+
* primitives so it stays in sync with the rest of the library:
|
|
70
|
+
*
|
|
71
|
+
* - **Media** — a top image slot (`Image`, rounded via `image/radius`). Pass
|
|
72
|
+
* `imageSource` for the default image or `media` for a full slot override.
|
|
73
|
+
* - **Title** — a centered headline + subtitle rendered through the shared
|
|
74
|
+
* {@link Title} component (`title/*`, `pageSubtitle/*` tokens).
|
|
75
|
+
* - **Metrics** — a row of {@link PdpCcCardMetric} columns (title / value /
|
|
76
|
+
* caption) separated by vertical `Divider`s (`metricdata/*` tokens).
|
|
77
|
+
* - **CTA** — a small tonal {@link Button} (`Button / Size: S`,
|
|
78
|
+
* `AppearanceBrand: Secondary`, `Emphasis: Medium`) with a leading icon.
|
|
79
|
+
*
|
|
80
|
+
* All defaults can be overridden via `modes`.
|
|
81
|
+
*/
|
|
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;
|
|
83
|
+
export default PdpCcCard;
|
|
84
|
+
//# sourceMappingURL=PdpCcCard.d.ts.map
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { type ViewStyle, type StyleProp } from 'react-native';
|
|
2
|
+
export type GlassTint = 'dark' | 'light';
|
|
3
|
+
export interface GlassFillProps {
|
|
4
|
+
/**
|
|
5
|
+
* Visual tint of the glass surface. Maps to `BlurView`'s `blurType`
|
|
6
|
+
* (`'dark'` | `'light'`) and drives the iOS
|
|
7
|
+
* `reducedTransparencyFallbackColor` so the surface degrades gracefully
|
|
8
|
+
* when "Reduce Transparency" is enabled in system accessibility settings.
|
|
9
|
+
*/
|
|
10
|
+
tint?: GlassTint;
|
|
11
|
+
/**
|
|
12
|
+
* Blur strength as a 0–100 "intensity" value. Internally mapped to
|
|
13
|
+
* `@react-native-community/blur`'s `blurAmount`. When `progressive` is set,
|
|
14
|
+
* this is the strength at the BOTTOM of the ramp (the strongest point); the
|
|
15
|
+
* ramp is kept intentionally gentle so the surface reads as subtle glass
|
|
16
|
+
* rather than a heavy frosted block.
|
|
17
|
+
*/
|
|
18
|
+
intensity?: number;
|
|
19
|
+
/**
|
|
20
|
+
* Token-derived color tint laid OVER the live blur. Painted as a
|
|
21
|
+
* translucent overlay so the glass keeps its color signature even when the
|
|
22
|
+
* platform blur quality varies (or realtime blur is unavailable).
|
|
23
|
+
*/
|
|
24
|
+
overlayColor?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Render a *progressive* (variable) blur instead of a uniform one: fully
|
|
27
|
+
* clear at the top, easing into a soft blur toward the bottom. Implemented
|
|
28
|
+
* by stacking two `MaskedView` + `BlurView` layers (a faint base + a
|
|
29
|
+
* slightly stronger accent near the bottom), each revealed via an eased
|
|
30
|
+
* multi-stop SVG gradient mask so the blur swells smoothly rather than
|
|
31
|
+
* along a hard seam. Works on iOS and Android with no extra native module.
|
|
32
|
+
*/
|
|
33
|
+
progressive?: boolean;
|
|
34
|
+
/** Container style overrides. Defaults to `StyleSheet.absoluteFill`. */
|
|
35
|
+
style?: StyleProp<ViewStyle>;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Glass / frosted surface for native (iOS + Android).
|
|
39
|
+
*
|
|
40
|
+
* Why this lives in its own platform-split file (mirrors `MediaCard/GlassFill`):
|
|
41
|
+
* - `@react-native-community/blur` is a native-only module; importing it on
|
|
42
|
+
* web throws because it references native components not registered there.
|
|
43
|
+
* Metro's platform-extension resolution picks `GlassFill.tsx` for native
|
|
44
|
+
* and `GlassFill.web.tsx` for web, keeping the web bundle native-free.
|
|
45
|
+
* - Centralizes the `intensity` (0–100) -> `blurAmount` (0–32) mapping so the
|
|
46
|
+
* Figma `blur/minimal` token semantics survive across platforms.
|
|
47
|
+
*
|
|
48
|
+
* On iOS (with the pod installed) this is a real `UIVisualEffectView` (true
|
|
49
|
+
* OS-level live blur). On Android it uses the community blur view. When the
|
|
50
|
+
* native module isn't linked in the running binary, the component degrades to
|
|
51
|
+
* a translucent tinted scrim (`reducedTransparencyFallbackColor` / fallback
|
|
52
|
+
* color) instead of rendering the "Unimplemented component" placeholder.
|
|
53
|
+
*/
|
|
54
|
+
declare function GlassFill({ tint, intensity, overlayColor, progressive, style, }: GlassFillProps): import("react/jsx-runtime").JSX.Element;
|
|
55
|
+
export default GlassFill;
|
|
56
|
+
//# sourceMappingURL=GlassFill.d.ts.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type ViewStyle, type StyleProp } from 'react-native';
|
|
2
|
+
export type GlassTint = 'dark' | 'light';
|
|
3
|
+
export interface GlassFillProps {
|
|
4
|
+
tint?: GlassTint;
|
|
5
|
+
intensity?: number;
|
|
6
|
+
overlayColor?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Render a *progressive* (variable) blur: fully clear at the top, easing
|
|
9
|
+
* into a soft blur toward the bottom. On web this mirrors the native
|
|
10
|
+
* technique — two `backdrop-filter` layers, each clipped with an eased
|
|
11
|
+
* multi-stop `mask-image` linear-gradient so the effective blur swells
|
|
12
|
+
* smoothly toward the bottom.
|
|
13
|
+
*/
|
|
14
|
+
progressive?: boolean;
|
|
15
|
+
style?: StyleProp<ViewStyle>;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Web counterpart of `GlassFill`.
|
|
19
|
+
*
|
|
20
|
+
* `@react-native-community/blur` ships no web implementation, so on web we
|
|
21
|
+
* render a translucent `View` with `backdrop-filter: blur()`. Native bundles
|
|
22
|
+
* pick up `GlassFill.tsx` instead via Metro's platform resolver; the web
|
|
23
|
+
* bundle picks up this file, so the native-only module is never imported here.
|
|
24
|
+
*/
|
|
25
|
+
declare function GlassFill({ tint, intensity, overlayColor, progressive, style, }: GlassFillProps): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export default GlassFill;
|
|
27
|
+
//# sourceMappingURL=GlassFill.web.d.ts.map
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type ViewStyle, type StyleProp, type ImageSourcePropType } from 'react-native';
|
|
3
|
+
import type { Modes } from '../../design-tokens';
|
|
4
|
+
export interface ProductMerchandisingCardProps {
|
|
5
|
+
/**
|
|
6
|
+
* Background media for the card. Accepts a URL string or any RN
|
|
7
|
+
* `ImageSourcePropType` (same shape as `Avatar`, `MediaCard`, etc.). The
|
|
8
|
+
* image is rendered full-bleed behind the header and glass footer.
|
|
9
|
+
*/
|
|
10
|
+
imageSource?: ImageSourcePropType | string;
|
|
11
|
+
/** Footer title (bold, white). */
|
|
12
|
+
title?: string;
|
|
13
|
+
/** Footer subtitle (muted). */
|
|
14
|
+
subtitle?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Header badge label (top-right). The badge is hidden when this is
|
|
17
|
+
* `undefined` and no `badge` override is provided.
|
|
18
|
+
*/
|
|
19
|
+
badgeLabel?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Full override for the header badge. Takes precedence over `badgeLabel`.
|
|
22
|
+
*/
|
|
23
|
+
badge?: React.ReactNode;
|
|
24
|
+
/** Show the header avatar (top-left). Defaults to `true`. */
|
|
25
|
+
showAvatar?: boolean;
|
|
26
|
+
/** Avatar image source. */
|
|
27
|
+
avatarSource?: ImageSourcePropType | string;
|
|
28
|
+
/** Avatar monogram fallback when no image is supplied. */
|
|
29
|
+
avatarMonogram?: string;
|
|
30
|
+
/** Full override for the header avatar. Takes precedence over avatar props. */
|
|
31
|
+
avatar?: React.ReactNode;
|
|
32
|
+
/**
|
|
33
|
+
* Footer "special badge" label (small frosted pill above the title). The
|
|
34
|
+
* badge is hidden when this is `undefined` and no `specialBadge` override
|
|
35
|
+
* is provided.
|
|
36
|
+
*/
|
|
37
|
+
specialBadgeLabel?: string;
|
|
38
|
+
/** Optional leading node (icon/image) rendered inside the special badge. */
|
|
39
|
+
specialBadgeIcon?: React.ReactNode;
|
|
40
|
+
/** Full override for the special badge. Takes precedence over the props above. */
|
|
41
|
+
specialBadge?: React.ReactNode;
|
|
42
|
+
/** CTA button label. Defaults to `"CTA"`. */
|
|
43
|
+
ctaLabel?: string;
|
|
44
|
+
/** CTA button press handler. */
|
|
45
|
+
onCtaPress?: () => void;
|
|
46
|
+
/** Full override for the CTA. Takes precedence over `ctaLabel`/`onCtaPress`. */
|
|
47
|
+
cta?: React.ReactNode;
|
|
48
|
+
/** Press handler for the whole card. When set, the card becomes pressable. */
|
|
49
|
+
onPress?: () => void;
|
|
50
|
+
/** Card height in px. Defaults to `223` (Figma spec). */
|
|
51
|
+
height?: number;
|
|
52
|
+
/** Modes object for design-token resolution. Cascaded to all children. */
|
|
53
|
+
modes?: Modes;
|
|
54
|
+
/** Style overrides for the card container. */
|
|
55
|
+
style?: StyleProp<ViewStyle>;
|
|
56
|
+
/** Accessibility label for the card. */
|
|
57
|
+
accessibilityLabel?: string;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* ProductMerchandisingCard — a full-bleed image card (Figma node 5277:317)
|
|
61
|
+
* with a top header (avatar + badge) and a bottom **glass footer** that
|
|
62
|
+
* combines a real native background blur with a transparent→black gradient
|
|
63
|
+
* scrim for legible text over any image.
|
|
64
|
+
*
|
|
65
|
+
* Glass footer implementation (works on iOS, Android and Web):
|
|
66
|
+
* - **iOS / Android:** `<GlassFill>` wraps `@react-native-community/blur`'s
|
|
67
|
+
* `BlurView` — iOS gets a real `UIVisualEffectView` (live OS blur),
|
|
68
|
+
* Android gets the community `RealtimeBlurView` with a tinted scrim
|
|
69
|
+
* fallback. The native-only module is isolated in `GlassFill.tsx`.
|
|
70
|
+
* - **Web:** the platform-extension `GlassFill.web.tsx` renders a translucent
|
|
71
|
+
* `View` with `backdrop-filter: blur()` — Metro picks the right file so the
|
|
72
|
+
* web bundle never imports the native blur module.
|
|
73
|
+
* - The gradient scrim is drawn with `react-native-svg` (one renderer for all
|
|
74
|
+
* platforms) so the fade is identical everywhere.
|
|
75
|
+
*
|
|
76
|
+
* The blur strength is driven by the Figma `blur/minimal` token, mapped to the
|
|
77
|
+
* `GlassFill` 0–100 intensity scale the same way `MediaCard` does.
|
|
78
|
+
*/
|
|
79
|
+
declare function ProductMerchandisingCard({ imageSource, title, subtitle, badgeLabel, badge, showAvatar, avatarSource, avatarMonogram, avatar, specialBadgeLabel, specialBadgeIcon, specialBadge, ctaLabel, onCtaPress, cta, onPress, height, modes, style, accessibilityLabel, }: ProductMerchandisingCardProps): import("react/jsx-runtime").JSX.Element;
|
|
80
|
+
export default ProductMerchandisingCard;
|
|
81
|
+
//# sourceMappingURL=ProductMerchandisingCard.d.ts.map
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type StyleProp, type ViewStyle, type TextStyle } from 'react-native';
|
|
3
|
+
import type { Modes } from '../../design-tokens';
|
|
4
|
+
/**
|
|
5
|
+
* A value rendered at either end of the marker. A `string`/`number` is rendered
|
|
6
|
+
* with the built-in title typography; any other `ReactNode` (e.g. a
|
|
7
|
+
* `MoneyValue`) is rendered as-is so consumers can fully control presentation.
|
|
8
|
+
*/
|
|
9
|
+
type ProjectionMarkerEndValue = React.ReactNode;
|
|
10
|
+
export type ProjectionMarkerProps = {
|
|
11
|
+
/**
|
|
12
|
+
* Value shown on the leading (left) end of the marker — typically the
|
|
13
|
+
* invested/starting amount. Accepts a string for the default styling or any
|
|
14
|
+
* `ReactNode` (e.g. `MoneyValue`) for custom rendering.
|
|
15
|
+
*/
|
|
16
|
+
startValue?: ProjectionMarkerEndValue;
|
|
17
|
+
/**
|
|
18
|
+
* Value shown on the trailing (right) end of the marker — typically the
|
|
19
|
+
* projected/ending amount.
|
|
20
|
+
*/
|
|
21
|
+
endValue?: ProjectionMarkerEndValue;
|
|
22
|
+
/**
|
|
23
|
+
* Primary line inside the center badge — typically the duration
|
|
24
|
+
* (e.g. `"1Y 10M"`).
|
|
25
|
+
*/
|
|
26
|
+
duration?: React.ReactNode;
|
|
27
|
+
/**
|
|
28
|
+
* Secondary line inside the center badge — typically the rate
|
|
29
|
+
* (e.g. `"@ 8.25 %"`).
|
|
30
|
+
*/
|
|
31
|
+
rate?: React.ReactNode;
|
|
32
|
+
/**
|
|
33
|
+
* Whether to render the connector lines between the end values and the
|
|
34
|
+
* center badge. Defaults to `true`.
|
|
35
|
+
*/
|
|
36
|
+
showConnectors?: boolean;
|
|
37
|
+
/** Design token modes for theming. */
|
|
38
|
+
modes?: Modes;
|
|
39
|
+
/** Override the root container styles. */
|
|
40
|
+
style?: StyleProp<ViewStyle>;
|
|
41
|
+
/** Override the leading value text styles (only applies to string values). */
|
|
42
|
+
startValueStyle?: StyleProp<TextStyle>;
|
|
43
|
+
/** Override the trailing value text styles (only applies to string values). */
|
|
44
|
+
endValueStyle?: StyleProp<TextStyle>;
|
|
45
|
+
/** Override the center badge container styles. */
|
|
46
|
+
badgeStyle?: StyleProp<ViewStyle>;
|
|
47
|
+
/** Override the duration text styles. */
|
|
48
|
+
durationStyle?: StyleProp<TextStyle>;
|
|
49
|
+
/** Override the rate text styles. */
|
|
50
|
+
rateStyle?: StyleProp<TextStyle>;
|
|
51
|
+
/** Accessibility label for the whole marker. */
|
|
52
|
+
accessibilityLabel?: string;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* ProjectionMarker renders a start value and an end value connected to a
|
|
56
|
+
* centered badge that summarizes the projection (e.g. a tenure and interest
|
|
57
|
+
* rate). It mirrors the Figma `projectionMarker` component and is commonly used
|
|
58
|
+
* inside "Potential returns" style cards.
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* ```tsx
|
|
62
|
+
* <ProjectionMarker
|
|
63
|
+
* startValue="₹1,00,000"
|
|
64
|
+
* endValue="₹1,25,101"
|
|
65
|
+
* duration="1Y 10M"
|
|
66
|
+
* rate="@ 8.25 %"
|
|
67
|
+
* />
|
|
68
|
+
* ```
|
|
69
|
+
*
|
|
70
|
+
* @example Custom end values via MoneyValue
|
|
71
|
+
* ```tsx
|
|
72
|
+
* <ProjectionMarker
|
|
73
|
+
* startValue={<MoneyValue value="1,00,000" />}
|
|
74
|
+
* endValue={<MoneyValue value="1,25,101" />}
|
|
75
|
+
* duration="1Y 10M"
|
|
76
|
+
* rate="@ 8.25 %"
|
|
77
|
+
* />
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
declare function ProjectionMarker({ startValue, endValue, duration, rate, showConnectors, modes, style, startValueStyle, endValueStyle, badgeStyle, durationStyle, rateStyle, accessibilityLabel, }: ProjectionMarkerProps): import("react/jsx-runtime").JSX.Element;
|
|
81
|
+
export default ProjectionMarker;
|
|
82
|
+
//# sourceMappingURL=ProjectionMarker.d.ts.map
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View, ViewStyle, StyleProp } from 'react-native';
|
|
2
3
|
import type { Modes } from '../../design-tokens';
|
|
3
4
|
export interface RadioProps {
|
|
4
5
|
/**
|
|
@@ -26,6 +27,6 @@ export interface RadioProps {
|
|
|
26
27
|
*/
|
|
27
28
|
testID?: string;
|
|
28
29
|
}
|
|
29
|
-
export declare
|
|
30
|
+
export declare const Radio: React.ForwardRefExoticComponent<RadioProps & React.RefAttributes<View>>;
|
|
30
31
|
export default Radio;
|
|
31
32
|
//# sourceMappingURL=Radio.d.ts.map
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
* the new `Radio` component under the old `RadioButton` names; please migrate
|
|
16
16
|
* existing usages to `Radio` at your earliest convenience.
|
|
17
17
|
*/
|
|
18
|
-
import {
|
|
18
|
+
import { type RadioProps } from '../Radio/Radio';
|
|
19
19
|
export type RadioButtonProps = RadioProps;
|
|
20
|
-
export declare const RadioButton:
|
|
20
|
+
export declare const RadioButton: import("react").ForwardRefExoticComponent<RadioProps & import("react").RefAttributes<import("react-native").View>>;
|
|
21
21
|
export default RadioButton;
|
|
22
22
|
//# sourceMappingURL=RadioButton.d.ts.map
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type StyleProp, type ViewStyle } from 'react-native';
|
|
3
|
+
import type { Modes } from '../../design-tokens';
|
|
4
|
+
/**
|
|
5
|
+
* Imperative handle exposed via `ref`. The primary way to read a slider's value
|
|
6
|
+
* is still the controlled `value` + `onChange` pair (each `<Slider />` reports
|
|
7
|
+
* its own value, so multiple sliders are disambiguated by their own handlers).
|
|
8
|
+
* The ref is a convenience for reading the latest value on demand (e.g. on a
|
|
9
|
+
* button press) or imperatively nudging an uncontrolled slider.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* const slider = useRef<SliderHandle>(null)
|
|
13
|
+
* slider.current?.setValue(50)
|
|
14
|
+
* const v = slider.current?.getValue()
|
|
15
|
+
*/
|
|
16
|
+
export interface SliderHandle {
|
|
17
|
+
/** Returns the slider's current (clamped, step-snapped) value. */
|
|
18
|
+
getValue: () => number;
|
|
19
|
+
/** Sets the value. Fires `onChange` + `onChangeEnd`. */
|
|
20
|
+
setValue: (value: number) => void;
|
|
21
|
+
/** Steps the value up by one `step` (or `by`, snapped to `step`). */
|
|
22
|
+
increment: (by?: number) => void;
|
|
23
|
+
/** Steps the value down by one `step` (or `by`, snapped to `step`). */
|
|
24
|
+
decrement: (by?: number) => void;
|
|
25
|
+
}
|
|
26
|
+
export interface SliderProps {
|
|
27
|
+
/** Current value (controlled). Pair with `onChange`. */
|
|
28
|
+
value?: number;
|
|
29
|
+
/** Initial value (uncontrolled). Defaults to `minValue`. */
|
|
30
|
+
defaultValue?: number;
|
|
31
|
+
/** Called continuously while the value changes (drag / keypress / track press). */
|
|
32
|
+
onChange?: (value: number) => void;
|
|
33
|
+
/** Called once when the interaction ends (drag release / keypress). */
|
|
34
|
+
onChangeEnd?: (value: number) => void;
|
|
35
|
+
/** Minimum selectable value. Defaults to `0`. */
|
|
36
|
+
minValue?: number;
|
|
37
|
+
/** Maximum selectable value. Defaults to `100`. */
|
|
38
|
+
maxValue?: number;
|
|
39
|
+
/** Snap increment. Defaults to `1`. Use a smaller value for finer control. */
|
|
40
|
+
step?: number;
|
|
41
|
+
/** Disables interaction and dims the control. */
|
|
42
|
+
isDisabled?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* `Intl.NumberFormat` options used to format the value bubble and the
|
|
45
|
+
* min/max labels (e.g. `{ style: 'currency', currency: 'USD' }`).
|
|
46
|
+
*/
|
|
47
|
+
formatOptions?: Intl.NumberFormatOptions;
|
|
48
|
+
/** BCP-47 locale used with `formatOptions`. Defaults to the runtime locale. */
|
|
49
|
+
locale?: string;
|
|
50
|
+
/**
|
|
51
|
+
* Full override for value formatting. Takes precedence over `formatOptions`.
|
|
52
|
+
* Receives the raw numeric value, returns the string to display.
|
|
53
|
+
*/
|
|
54
|
+
formatValue?: (value: number) => string;
|
|
55
|
+
/** Renders fully custom value-bubble content. Takes precedence over `formatValue`. */
|
|
56
|
+
renderTooltip?: (value: number) => React.ReactNode;
|
|
57
|
+
/**
|
|
58
|
+
* When `true` (default, matches the Figma design) the value bubble is
|
|
59
|
+
* always visible. When `false` it behaves like a normal tooltip — hidden at
|
|
60
|
+
* rest and revealed only while the user interacts (dragging on touch, or
|
|
61
|
+
* hovering/dragging on web), then dismissed as soon as the finger lifts.
|
|
62
|
+
*
|
|
63
|
+
* Either way the bubble floats above the track and never occupies layout
|
|
64
|
+
* space, so it will overlap content above the slider — leave room for it.
|
|
65
|
+
*/
|
|
66
|
+
alwaysShowTooltip?: boolean;
|
|
67
|
+
/** Toggles the min/max labels below the track. Defaults to `true`. */
|
|
68
|
+
showLabels?: boolean;
|
|
69
|
+
/** Override for the left (min) label. Defaults to the formatted `minValue`. */
|
|
70
|
+
minLabel?: React.ReactNode;
|
|
71
|
+
/** Override for the right (max) label. Defaults to the formatted `maxValue`. */
|
|
72
|
+
maxLabel?: React.ReactNode;
|
|
73
|
+
/** Slider width. Defaults to `'100%'` so it fills its parent. */
|
|
74
|
+
width?: number | `${number}%`;
|
|
75
|
+
/** Design-token modes for theming. */
|
|
76
|
+
modes?: Modes;
|
|
77
|
+
/** Style override for the outer container. */
|
|
78
|
+
style?: StyleProp<ViewStyle>;
|
|
79
|
+
/** Accessibility label for screen readers. */
|
|
80
|
+
accessibilityLabel?: string;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Slider — Figma node 5373:446 ("Slider").
|
|
84
|
+
*
|
|
85
|
+
* A horizontal, single-thumb slider driven entirely by design tokens. It maps a
|
|
86
|
+
* numeric range (`minValue`–`maxValue`) onto a track with a filled indicator, a
|
|
87
|
+
* draggable handle, a value bubble pinned above the handle, and optional min/max
|
|
88
|
+
* labels beneath the track. Built on `PanResponder` so the one code path works
|
|
89
|
+
* on iOS, Android and the web.
|
|
90
|
+
*
|
|
91
|
+
* The design only labels the range bounds, but a slider's purpose is to bind a
|
|
92
|
+
* value — so the live value is surfaced through the bubble (formatted via
|
|
93
|
+
* `formatOptions` / `formatValue`) and reported through `onChange` /
|
|
94
|
+
* `onChangeEnd`. Supports controlled and uncontrolled usage, web keyboard
|
|
95
|
+
* control, and an imperative {@link SliderHandle} `ref` for on-demand reads.
|
|
96
|
+
*/
|
|
97
|
+
declare const Slider: React.ForwardRefExoticComponent<SliderProps & React.RefAttributes<SliderHandle>>;
|
|
98
|
+
export default Slider;
|
|
99
|
+
//# sourceMappingURL=Slider.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { type StyleProp, type ViewStyle, type TextInputProps as RNTextInputProps, type TextStyle } from 'react-native';
|
|
2
|
+
import { TextInput as RNTextInput, type StyleProp, type ViewStyle, type TextInputProps as RNTextInputProps, type TextStyle } from 'react-native';
|
|
3
3
|
import type { Modes } from '../../design-tokens';
|
|
4
|
-
|
|
4
|
+
declare const TextInputBase: React.ForwardRefExoticComponent<{
|
|
5
5
|
placeholder?: string;
|
|
6
6
|
value?: string;
|
|
7
7
|
onChangeText?: (text: string) => void;
|
|
@@ -15,31 +15,8 @@ type TextInputProps = {
|
|
|
15
15
|
onBlur?: (e: any) => void;
|
|
16
16
|
accessibilityLabel?: string;
|
|
17
17
|
accessibilityHint?: string;
|
|
18
|
-
} & Omit<RNTextInputProps,
|
|
19
|
-
declare
|
|
20
|
-
declare namespace TextInput {
|
|
21
|
-
var Search: typeof TextInputSearch;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* TextInput.Search component that mirrors the Figma "textInput.search" component.
|
|
25
|
-
*
|
|
26
|
-
* This is a convenience variant that pre-configures the TextInput with:
|
|
27
|
-
* - Default search icon in the leading slot
|
|
28
|
-
* - No trailing slot
|
|
29
|
-
* - Default placeholder text "Search"
|
|
30
|
-
*
|
|
31
|
-
* @component
|
|
32
|
-
* @param {Object} props
|
|
33
|
-
* @param {string} [props.placeholder='Search'] - Placeholder text (defaults to "Search")
|
|
34
|
-
* @param {string} [props.value=''] - Current value of the input
|
|
35
|
-
* @param {Function} [props.onChangeText] - Callback function called when text changes
|
|
36
|
-
* @param {React.ReactNode} [props.leading] - Optional leading slot (defaults to search icon)
|
|
37
|
-
* @param {Object} [props.modes={}] - Modes object passed to `getVariableByName` for all design tokens
|
|
38
|
-
* @param {Object} [props.style] - Optional container style overrides
|
|
39
|
-
* @param {Object} [props.inputStyle] - Optional text input style overrides
|
|
40
|
-
* @param {Object} [props.rest] - Additional props passed to the underlying TextInput
|
|
41
|
-
*/
|
|
42
|
-
type TextInputSearchProps = {
|
|
18
|
+
} & Omit<RNTextInputProps, "style" | "value" | "onFocus" | "onBlur" | "placeholder" | "onChangeText"> & React.RefAttributes<RNTextInput>>;
|
|
19
|
+
declare const TextInputSearch: React.ForwardRefExoticComponent<{
|
|
43
20
|
placeholder?: string;
|
|
44
21
|
value?: string;
|
|
45
22
|
onChangeText?: (text: string) => void;
|
|
@@ -51,7 +28,10 @@ type TextInputSearchProps = {
|
|
|
51
28
|
accessibilityHint?: string;
|
|
52
29
|
onFocus?: (e: any) => void;
|
|
53
30
|
onBlur?: (e: any) => void;
|
|
54
|
-
} & Omit<RNTextInputProps,
|
|
55
|
-
|
|
31
|
+
} & Omit<RNTextInputProps, "style" | "value" | "onFocus" | "onBlur" | "placeholder" | "onChangeText"> & React.RefAttributes<RNTextInput>>;
|
|
32
|
+
type TextInputComponent = typeof TextInputBase & {
|
|
33
|
+
Search: typeof TextInputSearch;
|
|
34
|
+
};
|
|
35
|
+
declare const TextInput: TextInputComponent;
|
|
56
36
|
export default TextInput;
|
|
57
37
|
//# sourceMappingURL=TextInput.d.ts.map
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type TextStyle, type StyleProp } from 'react-native';
|
|
3
|
+
import type { Modes } from '../../design-tokens';
|
|
4
|
+
/**
|
|
5
|
+
* A single coloured run inside a {@link TextSegment}. Each run can carry its own
|
|
6
|
+
* `modes`, so individual fragments of the same paragraph can resolve different
|
|
7
|
+
* design tokens (most commonly a different `text/foreground` colour) while still
|
|
8
|
+
* flowing — and wrapping — inline as one continuous line of text.
|
|
9
|
+
*/
|
|
10
|
+
export type TextSegmentRun = {
|
|
11
|
+
/** The text for this run. Include trailing/leading spaces yourself when you want spacing between runs (inline text has no gap concept). */
|
|
12
|
+
text: string;
|
|
13
|
+
/**
|
|
14
|
+
* Per-run mode overrides. Merged on top of the parent `TextSegment` modes, so
|
|
15
|
+
* a run only needs to specify what differs (e.g. `{ 'Text Appearance': 'Primary' }`
|
|
16
|
+
* to recolour just that fragment). Everything else is inherited.
|
|
17
|
+
*/
|
|
18
|
+
modes?: Modes;
|
|
19
|
+
/** Optional per-run style override applied last, on top of the token-resolved style. */
|
|
20
|
+
style?: StyleProp<TextStyle>;
|
|
21
|
+
};
|
|
22
|
+
export type TextSegmentProps = {
|
|
23
|
+
/**
|
|
24
|
+
* Declarative, data-driven way to compose a multi-colour string. Each entry
|
|
25
|
+
* becomes an inline run. This is the simplest API when the segments are known
|
|
26
|
+
* up front:
|
|
27
|
+
*
|
|
28
|
+
* ```tsx
|
|
29
|
+
* <TextSegment segments={[
|
|
30
|
+
* { text: 'Upsell message ' },
|
|
31
|
+
* { text: 'JioFinance+', modes: { 'Text Appearance': 'Primary' } },
|
|
32
|
+
* ]} />
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* When both `segments` and `children` are provided, `children` win.
|
|
36
|
+
*/
|
|
37
|
+
segments?: TextSegmentRun[];
|
|
38
|
+
/**
|
|
39
|
+
* Compositional alternative to {@link TextSegmentProps.segments}. Pass library
|
|
40
|
+
* `Text` elements (or plain strings) as children and they are rendered nested
|
|
41
|
+
* inside the same paragraph so they wrap together. The parent `modes` cascade
|
|
42
|
+
* down to every child via `cloneChildrenWithModes`, and each child may still
|
|
43
|
+
* override with its own `modes`:
|
|
44
|
+
*
|
|
45
|
+
* ```tsx
|
|
46
|
+
* <TextSegment>
|
|
47
|
+
* <Text>Upsell message </Text>
|
|
48
|
+
* <Text modes={{ 'Text Appearance': 'Primary' }}>JioFinance+</Text>
|
|
49
|
+
* </TextSegment>
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
children?: React.ReactNode;
|
|
53
|
+
/** Horizontal alignment of the whole paragraph. */
|
|
54
|
+
textAlign?: 'Left' | 'Center';
|
|
55
|
+
/** Clamp the paragraph to this many lines (truncates with an ellipsis). Applies to the whole composed line, not per-run. */
|
|
56
|
+
numberOfLines?: number;
|
|
57
|
+
/** Mode configuration used for the base style and cascaded to every run/child. */
|
|
58
|
+
modes?: Modes;
|
|
59
|
+
/** Style override applied to the outer paragraph (e.g. width constraints to force wrapping). */
|
|
60
|
+
style?: StyleProp<TextStyle>;
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* TextSegment — composes several differently-styled text runs into a single
|
|
64
|
+
* paragraph that wraps as one continuous line.
|
|
65
|
+
*
|
|
66
|
+
* On the web you would reach for `<span>`s inside a `<p>`; the React Native
|
|
67
|
+
* equivalent is nesting `<Text>` inside a parent `<Text>`. That nesting is the
|
|
68
|
+
* whole trick: sibling `<View>`s would lay out as flex blocks and break onto
|
|
69
|
+
* rigid rows, but nested `<Text>` nodes flow inline and wrap naturally at word
|
|
70
|
+
* boundaries — exactly like a real paragraph — while each nested run keeps its
|
|
71
|
+
* own colour/weight resolved from its own `modes`.
|
|
72
|
+
*
|
|
73
|
+
* Two equivalent ways to author content:
|
|
74
|
+
* - **`segments` prop** — declarative array of `{ text, modes }` runs.
|
|
75
|
+
* - **`children`** — pass library `Text` elements (or strings); the parent
|
|
76
|
+
* `modes` cascade down and each child may override its own.
|
|
77
|
+
*
|
|
78
|
+
* @example Data-driven
|
|
79
|
+
* ```tsx
|
|
80
|
+
* <TextSegment
|
|
81
|
+
* segments={[
|
|
82
|
+
* { text: 'Upsell message ' },
|
|
83
|
+
* { text: 'JioFinance+', modes: { 'Text Appearance': 'Primary' } },
|
|
84
|
+
* ]}
|
|
85
|
+
* />
|
|
86
|
+
* ```
|
|
87
|
+
*
|
|
88
|
+
* @example Compositional
|
|
89
|
+
* ```tsx
|
|
90
|
+
* <TextSegment numberOfLines={2}>
|
|
91
|
+
* <Text>Pay with </Text>
|
|
92
|
+
* <Text modes={{ 'Text Appearance': 'Primary' }}>JioFinance+</Text>
|
|
93
|
+
* <Text> and earn rewards on every transaction.</Text>
|
|
94
|
+
* </TextSegment>
|
|
95
|
+
* ```
|
|
96
|
+
*/
|
|
97
|
+
declare function TextSegment({ segments, children, textAlign, numberOfLines, modes, style, }: TextSegmentProps): import("react/jsx-runtime").JSX.Element;
|
|
98
|
+
declare const _default: React.MemoExoticComponent<typeof TextSegment>;
|
|
99
|
+
export default _default;
|
|
100
|
+
//# sourceMappingURL=TextSegment.d.ts.map
|