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.
Files changed (107) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/lib/commonjs/components/AmountInput/AmountInput.js +8 -5
  3. package/lib/commonjs/components/BenefitCard/BenefitCard.js +231 -0
  4. package/lib/commonjs/components/CcCard/CcCard.js +470 -0
  5. package/lib/commonjs/components/Checkbox/Checkbox.js +4 -3
  6. package/lib/commonjs/components/CheckboxItem/CheckboxItem.js +4 -3
  7. package/lib/commonjs/components/CompareTable/CompareTable.js +372 -0
  8. package/lib/commonjs/components/ComparisonBar/ComparisonBar.js +266 -0
  9. package/lib/commonjs/components/DropdownInput/DropdownInput.js +35 -3
  10. package/lib/commonjs/components/FormField/FormField.js +4 -3
  11. package/lib/commonjs/components/InputSearch/InputSearch.js +6 -4
  12. package/lib/commonjs/components/NoteInput/NoteInput.js +6 -5
  13. package/lib/commonjs/components/PdpCcCard/PdpCcCard.js +273 -0
  14. package/lib/commonjs/components/ProductMerchandisingCard/GlassFill.js +263 -0
  15. package/lib/commonjs/components/ProductMerchandisingCard/GlassFill.web.js +116 -0
  16. package/lib/commonjs/components/ProductMerchandisingCard/ProductMerchandisingCard.js +353 -0
  17. package/lib/commonjs/components/ProjectionMarker/ProjectionMarker.js +161 -0
  18. package/lib/commonjs/components/Radio/Radio.js +5 -5
  19. package/lib/commonjs/components/Slider/Slider.js +473 -0
  20. package/lib/commonjs/components/TextInput/TextInput.js +13 -8
  21. package/lib/commonjs/components/TextSegment/TextSegment.js +118 -0
  22. package/lib/commonjs/components/index.js +63 -0
  23. package/lib/commonjs/design-tokens/Coin Variables-variables-full.json +1 -1
  24. package/lib/commonjs/design-tokens/figma-modes.generated.js +38 -9
  25. package/lib/commonjs/icons/registry.js +1 -1
  26. package/lib/commonjs/utils/react-utils.js +22 -0
  27. package/lib/module/components/AmountInput/AmountInput.js +6 -4
  28. package/lib/module/components/BenefitCard/BenefitCard.js +225 -0
  29. package/lib/module/components/CcCard/CcCard.js +464 -0
  30. package/lib/module/components/Checkbox/Checkbox.js +5 -4
  31. package/lib/module/components/CheckboxItem/CheckboxItem.js +5 -4
  32. package/lib/module/components/CompareTable/CompareTable.js +367 -0
  33. package/lib/module/components/ComparisonBar/ComparisonBar.js +260 -0
  34. package/lib/module/components/DropdownInput/DropdownInput.js +36 -4
  35. package/lib/module/components/FormField/FormField.js +5 -4
  36. package/lib/module/components/InputSearch/InputSearch.js +6 -4
  37. package/lib/module/components/NoteInput/NoteInput.js +7 -6
  38. package/lib/module/components/PdpCcCard/PdpCcCard.js +267 -0
  39. package/lib/module/components/ProductMerchandisingCard/GlassFill.js +257 -0
  40. package/lib/module/components/ProductMerchandisingCard/GlassFill.web.js +111 -0
  41. package/lib/module/components/ProductMerchandisingCard/ProductMerchandisingCard.js +347 -0
  42. package/lib/module/components/ProjectionMarker/ProjectionMarker.js +156 -0
  43. package/lib/module/components/Radio/Radio.js +5 -4
  44. package/lib/module/components/Slider/Slider.js +468 -0
  45. package/lib/module/components/TextInput/TextInput.js +15 -10
  46. package/lib/module/components/TextSegment/TextSegment.js +113 -0
  47. package/lib/module/components/index.js +9 -0
  48. package/lib/module/design-tokens/Coin Variables-variables-full.json +1 -1
  49. package/lib/module/design-tokens/figma-modes.generated.js +38 -9
  50. package/lib/module/icons/registry.js +1 -1
  51. package/lib/module/utils/react-utils.js +21 -0
  52. package/lib/typescript/src/components/AmountInput/AmountInput.d.ts +3 -2
  53. package/lib/typescript/src/components/BenefitCard/BenefitCard.d.ts +93 -0
  54. package/lib/typescript/src/components/CcCard/CcCard.d.ts +137 -0
  55. package/lib/typescript/src/components/Checkbox/Checkbox.d.ts +3 -2
  56. package/lib/typescript/src/components/CheckboxItem/CheckboxItem.d.ts +2 -2
  57. package/lib/typescript/src/components/CompareTable/CompareTable.d.ts +88 -0
  58. package/lib/typescript/src/components/ComparisonBar/ComparisonBar.d.ts +118 -0
  59. package/lib/typescript/src/components/DropdownInput/DropdownInput.d.ts +20 -1
  60. package/lib/typescript/src/components/FormField/FormField.d.ts +2 -2
  61. package/lib/typescript/src/components/InputSearch/InputSearch.d.ts +23 -2
  62. package/lib/typescript/src/components/NoteInput/NoteInput.d.ts +19 -2
  63. package/lib/typescript/src/components/PdpCcCard/PdpCcCard.d.ts +84 -0
  64. package/lib/typescript/src/components/ProductMerchandisingCard/GlassFill.d.ts +56 -0
  65. package/lib/typescript/src/components/ProductMerchandisingCard/GlassFill.web.d.ts +27 -0
  66. package/lib/typescript/src/components/ProductMerchandisingCard/ProductMerchandisingCard.d.ts +81 -0
  67. package/lib/typescript/src/components/ProjectionMarker/ProjectionMarker.d.ts +82 -0
  68. package/lib/typescript/src/components/Radio/Radio.d.ts +3 -2
  69. package/lib/typescript/src/components/RadioButton/RadioButton.d.ts +2 -2
  70. package/lib/typescript/src/components/Slider/Slider.d.ts +99 -0
  71. package/lib/typescript/src/components/TextInput/TextInput.d.ts +9 -29
  72. package/lib/typescript/src/components/TextSegment/TextSegment.d.ts +100 -0
  73. package/lib/typescript/src/components/index.d.ts +10 -1
  74. package/lib/typescript/src/design-tokens/figma-modes.generated.d.ts +22 -2
  75. package/lib/typescript/src/icons/registry.d.ts +1 -1
  76. package/lib/typescript/src/utils/react-utils.d.ts +10 -0
  77. package/package.json +2 -1
  78. package/src/components/AmountInput/AmountInput.tsx +7 -5
  79. package/src/components/BenefitCard/BenefitCard.tsx +309 -0
  80. package/src/components/CcCard/CcCard.tsx +598 -0
  81. package/src/components/Checkbox/Checkbox.tsx +5 -4
  82. package/src/components/CheckboxItem/CheckboxItem.tsx +5 -4
  83. package/src/components/CompareTable/CompareTable.tsx +477 -0
  84. package/src/components/ComparisonBar/ComparisonBar.tsx +356 -0
  85. package/src/components/DropdownInput/DropdownInput.tsx +55 -3
  86. package/src/components/FormField/FormField.tsx +5 -4
  87. package/src/components/InputSearch/InputSearch.tsx +8 -5
  88. package/src/components/NoteInput/NoteInput.tsx +8 -6
  89. package/src/components/PdpCcCard/PdpCcCard.tsx +356 -0
  90. package/src/components/ProductMerchandisingCard/GlassFill.tsx +276 -0
  91. package/src/components/ProductMerchandisingCard/GlassFill.web.tsx +127 -0
  92. package/src/components/ProductMerchandisingCard/ProductMerchandisingCard.tsx +423 -0
  93. package/src/components/ProjectionMarker/ProjectionMarker.tsx +277 -0
  94. package/src/components/Radio/Radio.tsx +5 -4
  95. package/src/components/Slider/Slider.tsx +628 -0
  96. package/src/components/TextInput/TextInput.tsx +15 -11
  97. package/src/components/TextSegment/TextSegment.tsx +166 -0
  98. package/src/components/index.ts +10 -1
  99. package/src/design-tokens/Coin Variables-variables-full.json +1 -1
  100. package/src/design-tokens/figma-modes.generated.ts +38 -9
  101. package/src/icons/registry.ts +1 -1
  102. package/src/utils/react-utils.ts +23 -0
  103. package/lib/typescript/scripts/extract-component-tokens.d.ts +0 -9
  104. package/lib/typescript/scripts/generate-component-docs.d.ts +0 -9
  105. package/lib/typescript/scripts/generate-icon-registry.d.ts +0 -3
  106. package/lib/typescript/scripts/generate-mode-types.d.ts +0 -2
  107. package/lib/typescript/scripts/retype-modes.d.cts +0 -2
@@ -72,6 +72,27 @@ export function cloneChildrenWithModes(children, modes, forcedModes) {
72
72
  return React.Children.toArray(result);
73
73
  }
74
74
 
75
+ /**
76
+ * Combines several refs (object refs and/or callback refs) into a single
77
+ * callback ref. Useful when a component needs to keep its own internal ref to a
78
+ * node while still honouring a ref forwarded by the consumer.
79
+ *
80
+ * @example
81
+ * const inputRef = useRef<RNTextInput>(null)
82
+ * <RNTextInput ref={mergeRefs(inputRef, forwardedRef)} />
83
+ */
84
+ export function mergeRefs(...refs) {
85
+ return value => {
86
+ refs.forEach(ref => {
87
+ if (typeof ref === 'function') {
88
+ ref(value);
89
+ } else if (ref != null) {
90
+ ref.current = value;
91
+ }
92
+ });
93
+ };
94
+ }
95
+
75
96
  /**
76
97
  * Flattens React children, extracting them from Fragments.
77
98
  * Useful for Group components that need to process individual items (e.g., for layout or styling)
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { type ViewStyle } from 'react-native';
2
+ import { View, type ViewStyle } from 'react-native';
3
3
  import type { Modes } from '../../design-tokens';
4
4
  export type AmountInputProps = {
5
5
  /**
@@ -20,5 +20,6 @@ export type AmountInputProps = {
20
20
  *
21
21
  * @component
22
22
  */
23
- export default function AmountInput({ moneyValueSlot, noteInputSlot, modes: propModes, style, }: AmountInputProps): import("react/jsx-runtime").JSX.Element;
23
+ declare const AmountInput: React.ForwardRefExoticComponent<AmountInputProps & React.RefAttributes<View>>;
24
+ export default AmountInput;
24
25
  //# sourceMappingURL=AmountInput.d.ts.map
@@ -0,0 +1,93 @@
1
+ import React from 'react';
2
+ import { type ViewStyle, type StyleProp } from 'react-native';
3
+ import type { Modes } from '../../design-tokens';
4
+ /**
5
+ * A single benefit row rendered with the shared `ListItem` primitive: a
6
+ * leading icon, a title and an optional right-aligned trailing value.
7
+ */
8
+ export interface BenefitCardItem {
9
+ /** Registry icon name for the leading glyph (e.g. `'ic_jewellery_diamond'`). */
10
+ icon?: string;
11
+ /** Per-item override for the leading icon color. Defaults to the brand token. */
12
+ iconColor?: string;
13
+ /** Full override for the leading node. Takes precedence over `icon`. */
14
+ leading?: React.ReactNode;
15
+ /** Row title (e.g. `"JioPoints"`). */
16
+ title: string;
17
+ /** Optional right-aligned trailing value (e.g. `"Up to 2000 pts"`). */
18
+ trailingText?: string;
19
+ /** Full override for the trailing node. Takes precedence over `trailingText`. */
20
+ trailing?: React.ReactNode;
21
+ /** Makes the row pressable. */
22
+ onPress?: () => void;
23
+ }
24
+ export interface BenefitCardProps {
25
+ /** Header section title (e.g. `"You will earn"`). */
26
+ headerTitle?: string;
27
+ /**
28
+ * Highlighted item shown directly under the header title (icon + title +
29
+ * optional trailing value). Rendered above the divider.
30
+ */
31
+ headerItem?: BenefitCardItem;
32
+ /**
33
+ * Toggles the whole header section (title + item + divider). Mirrors the
34
+ * Figma `showHeader` property. Defaults to `true`.
35
+ */
36
+ showHeader?: boolean;
37
+ /** Body section title (e.g. `"Upgrade to JioFinance+ and earn more"`). */
38
+ bodyTitle?: string;
39
+ /**
40
+ * Body benefit rows. Ignored when `children` is provided (the slot wins).
41
+ */
42
+ items?: BenefitCardItem[];
43
+ /**
44
+ * Real slot for the body "list wrap". When provided, these children render
45
+ * instead of `items`; `modes` (plus the `List Item Style: Minimal` style)
46
+ * cascade into every child automatically.
47
+ */
48
+ children?: React.ReactNode;
49
+ /** CTA button label. Defaults to `"Upgrade"`. */
50
+ buttonLabel?: string;
51
+ /** CTA press handler. */
52
+ onButtonPress?: () => void;
53
+ /** Full override for the CTA. Takes precedence over `buttonLabel`. */
54
+ button?: React.ReactNode;
55
+ /**
56
+ * Toggles the CTA button. Mirrors the Figma `showButton` property.
57
+ * Defaults to `true`.
58
+ */
59
+ showButton?: boolean;
60
+ /** Press handler for the whole card. When set, the card becomes pressable. */
61
+ onPress?: () => void;
62
+ /** Card width. Defaults to the Figma spec (`344`). Pass `'100%'` to fill the parent. */
63
+ width?: number | `${number}%`;
64
+ /** Modes object for design-token resolution. Cascaded to all children. */
65
+ modes?: Modes;
66
+ /** Style overrides for the card container. */
67
+ style?: StyleProp<ViewStyle>;
68
+ /** Accessibility label for the card. */
69
+ accessibilityLabel?: string;
70
+ }
71
+ /**
72
+ * BenefitCard — Figma node 5352:1077 ("Benefit Card").
73
+ *
74
+ * A white, rounded card that summarises the rewards a user will earn. It is
75
+ * composed entirely from the shared design-system primitives so it stays in
76
+ * sync with the rest of the library:
77
+ *
78
+ * - **Header** — a section title + a single highlighted {@link ListItem}
79
+ * (leading `Icon`, title, right-aligned trailing value) followed by a
80
+ * `Divider`.
81
+ * - **Body** — a section title + a column of benefit {@link ListItem}s. The
82
+ * list is a real slot: pass `children` to fully control it, or `items` for
83
+ * the declarative path.
84
+ * - **CTA** — a small {@link Button} (Figma `Button / Size = S`).
85
+ *
86
+ * The list rows resolve through the `List Item Style: Minimal` mode (12px /
87
+ * regular title, 4px gap, no padding) and the leading icons use the
88
+ * `AppearanceBrand: Secondary` brand color, exactly matching the design. All
89
+ * three defaults can be overridden via `modes`.
90
+ */
91
+ declare function BenefitCard({ headerTitle, headerItem, showHeader, bodyTitle, items, children, buttonLabel, onButtonPress, button, showButton, onPress, width, modes, style, accessibilityLabel, }: BenefitCardProps): import("react/jsx-runtime").JSX.Element;
92
+ export default BenefitCard;
93
+ //# sourceMappingURL=BenefitCard.d.ts.map
@@ -0,0 +1,137 @@
1
+ import React from 'react';
2
+ import { type ViewStyle, type StyleProp, type ImageSourcePropType } from 'react-native';
3
+ import { type TextSegmentRun } from '../TextSegment/TextSegment';
4
+ import type { Modes } from '../../design-tokens';
5
+ /**
6
+ * A single coloured chip rendered in the card header. Each badge resolves its
7
+ * own design tokens through `modes`, so different appearances (brand, tonal,
8
+ * etc.) can sit side-by-side in the same group.
9
+ */
10
+ export interface CcCardBadge {
11
+ /** Visible label text. */
12
+ label: string;
13
+ /** Per-badge mode overrides (e.g. `{ AppearanceBrand: 'Tertiary' }`). */
14
+ modes?: Modes;
15
+ /** Background color override (wins over the token-resolved value). */
16
+ color?: string;
17
+ /** Label color override (wins over the token-resolved value). */
18
+ labelColor?: string;
19
+ }
20
+ /**
21
+ * A single benefit row in the card's list, rendered through the shared
22
+ * {@link ListItem} primitive (leading icon + title).
23
+ */
24
+ export interface CcCardListItem {
25
+ /**
26
+ * Registry icon name for the leading glyph. Defaults to `'ic_card'`. Pass
27
+ * `null` to omit the leading icon.
28
+ */
29
+ icon?: string | null;
30
+ /** Per-row override for the leading icon color. */
31
+ iconColor?: string;
32
+ /** Full override for the leading node. Takes precedence over `icon`. */
33
+ leading?: React.ReactNode;
34
+ /** Row title (e.g. `"4 domestic + 2 intl. lounge access yearly"`). */
35
+ title: string;
36
+ /** Makes the row pressable. */
37
+ onPress?: () => void;
38
+ }
39
+ export interface CcCardProps {
40
+ /**
41
+ * Compact variant. Renders only the leading media slot (an `Avatar` by
42
+ * default) followed by the footer **without** its CTA button — a condensed
43
+ * representation of the card. Mirrors the Figma `compact` property.
44
+ */
45
+ compact?: boolean;
46
+ /** Toggles the header badge row. Defaults to `true`. */
47
+ showHeader?: boolean;
48
+ /** Leading (left) badge group. */
49
+ badges?: CcCardBadge[];
50
+ /** Trailing (right-aligned) badge group. */
51
+ trailingBadges?: CcCardBadge[];
52
+ /** Full override for the header. Takes precedence over `badges`/`trailingBadges`. */
53
+ header?: React.ReactNode;
54
+ /**
55
+ * Image source for the default media slot. Accepts a URL string or any RN
56
+ * `ImageSourcePropType`. Ignored when `media` is provided.
57
+ */
58
+ imageSource?: ImageSourcePropType | string;
59
+ /** Default media image width. Defaults to the Figma spec (`88`). */
60
+ imageWidth?: number;
61
+ /** Default media image height. Defaults to the Figma spec (`54`). */
62
+ imageHeight?: number;
63
+ /** Product title rendered next to the media slot (non-compact only). */
64
+ title?: string;
65
+ /** Product subtitle rendered below the title (non-compact only). */
66
+ subtitle?: string;
67
+ /**
68
+ * Full override for the media slot's visual. Whatever you pass here is
69
+ * rendered **in both the compact and non-compact variants** — e.g. pass an
70
+ * `Avatar` and it stays an avatar in both, pass an `Image` and it stays an
71
+ * image in both. `modes` cascade into it automatically. Defaults to an
72
+ * `Image` driven by `imageSource`.
73
+ */
74
+ media?: React.ReactNode;
75
+ /** Benefit rows rendered in the list. Defaults to three sample rows. */
76
+ items?: CcCardListItem[];
77
+ /** Toggles the upsell nudge row. Defaults to `true`. */
78
+ showNudge?: boolean;
79
+ /**
80
+ * Declarative content for the nudge's inline text. Defaults to a sample
81
+ * "Upsell message JioFinance+" string with the last run brand-coloured.
82
+ */
83
+ nudgeSegments?: TextSegmentRun[];
84
+ /** Avatar image source shown at the start of the nudge row. */
85
+ nudgeAvatarSource?: ImageSourcePropType | string;
86
+ /** Full override for the nudge row. Takes precedence over the declarative props. */
87
+ nudge?: React.ReactNode;
88
+ /** Small muted label above the footer title (`ccCard/headline/*`). */
89
+ headline?: string;
90
+ /** Bold footer value (`ccCard/title/*`). */
91
+ description?: string;
92
+ /** Muted caption rendered inline after the description (`ccCard/subtitle/*`). */
93
+ footerSubtitle?: string;
94
+ /** Full override for the footer text block. */
95
+ footer?: React.ReactNode;
96
+ /** CTA button label. Defaults to `"Button"`. */
97
+ buttonLabel?: string;
98
+ /** CTA press handler. */
99
+ onButtonPress?: () => void;
100
+ /** Full override for the CTA. Takes precedence over `buttonLabel`. */
101
+ button?: React.ReactNode;
102
+ /** Toggles the CTA button (non-compact). Defaults to `true`. */
103
+ showButton?: boolean;
104
+ /** Press handler for the whole card. When set, the card becomes pressable. */
105
+ onPress?: () => void;
106
+ /** Card width. Defaults to the Figma spec (`343`). Pass `'100%'` to fill the parent. */
107
+ width?: number | `${number}%`;
108
+ /** Modes object for design-token resolution. Cascaded to all children. */
109
+ modes?: Modes;
110
+ /** Style overrides for the card container. */
111
+ style?: StyleProp<ViewStyle>;
112
+ /** Accessibility label for the card. */
113
+ accessibilityLabel?: string;
114
+ }
115
+ /**
116
+ * CcCard — Figma node 5434:1992 ("Cc Card").
117
+ *
118
+ * A white, rounded credit-card product card composed entirely from the shared
119
+ * design-system primitives so it stays in sync with the rest of the library:
120
+ *
121
+ * - **Header** — two {@link Badge} groups (a leading group + a right-aligned
122
+ * trailing group), e.g. `Pre-qualified` / `Lifetime free`.
123
+ * - **Media** — a product `Image` + a {@link Title} (title + subtitle resolved
124
+ * through the `context7: Card` mode → 14px/12px).
125
+ * - **List** — a column of benefit {@link ListItem}s (`List Item Style:
126
+ * Minimal`) with leading icons.
127
+ * - **Nudge** — an inline upsell row: an {@link Avatar} + a {@link TextSegment}.
128
+ * - **Footer** — a headline + description + subtitle text block alongside a
129
+ * small {@link Button} (`Button / Size: S`, `AppearanceBrand: Secondary`).
130
+ *
131
+ * The {@link CcCardProps.compact} variant collapses the card to just the
132
+ * leading avatar slot + the footer text block (no CTA button). All defaults can
133
+ * be overridden via `modes`.
134
+ */
135
+ declare function CcCard({ compact, showHeader, badges, trailingBadges, header, imageSource, imageWidth, imageHeight, title, subtitle, media, items, showNudge, nudgeSegments, nudgeAvatarSource, nudge, headline, description, footerSubtitle, footer, buttonLabel, onButtonPress, button, showButton, onPress, width, modes, style, accessibilityLabel, }: CcCardProps): import("react/jsx-runtime").JSX.Element;
136
+ export default CcCard;
137
+ //# sourceMappingURL=CcCard.d.ts.map
@@ -1,4 +1,5 @@
1
- import { type StyleProp, type ViewStyle } from 'react-native';
1
+ import React from 'react';
2
+ import { View, type StyleProp, type ViewStyle } from 'react-native';
2
3
  import type { Modes } from '../../design-tokens';
3
4
  export interface CheckboxProps {
4
5
  /** Whether the checkbox is checked (controlled) */
@@ -26,6 +27,6 @@ export interface CheckboxProps {
26
27
  * @component
27
28
  * @param {CheckboxProps} props
28
29
  */
29
- declare function Checkbox({ checked: controlledChecked, defaultChecked, onValueChange, disabled, modes, style, accessibilityLabel, }: CheckboxProps): import("react/jsx-runtime").JSX.Element;
30
+ declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<View>>;
30
31
  export default Checkbox;
31
32
  //# sourceMappingURL=Checkbox.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { type StyleProp, type ViewStyle, type TextStyle } from 'react-native';
2
+ import { View, type StyleProp, type ViewStyle, type TextStyle } from 'react-native';
3
3
  import type { Modes } from '../../design-tokens';
4
4
  export type CheckboxItemProps = {
5
5
  /** Whether the checkbox is checked (controlled). */
@@ -68,6 +68,6 @@ export type CheckboxItemProps = {
68
68
  * />
69
69
  * ```
70
70
  */
71
- declare function CheckboxItem({ checked: controlledChecked, defaultChecked, onValueChange, disabled, label, control, endSlot, endSlotWidth, modes, style, labelStyle, accessibilityLabel, }: CheckboxItemProps): import("react/jsx-runtime").JSX.Element;
71
+ declare const CheckboxItem: React.ForwardRefExoticComponent<CheckboxItemProps & React.RefAttributes<View>>;
72
72
  export default CheckboxItem;
73
73
  //# sourceMappingURL=CheckboxItem.d.ts.map
@@ -0,0 +1,88 @@
1
+ import React from 'react';
2
+ import { type ImageSourcePropType, type StyleProp, type ViewStyle } from 'react-native';
3
+ import type { Modes } from '../../design-tokens';
4
+ /**
5
+ * A single product/plan column rendered as a selection card at the top of the
6
+ * table. The card order maps 1:1 to each {@link CompareTableRow}'s `values`.
7
+ */
8
+ export type CompareTableColumn = {
9
+ /** Product / plan name shown under the image. */
10
+ label?: string;
11
+ /** Thumbnail / logo image. Accepts a URL string or an RN image source. */
12
+ imageSource?: ImageSourcePropType | string;
13
+ /** CTA link text (e.g. "View details"). Omit to hide the link. */
14
+ actionLabel?: string;
15
+ /** Handler for the CTA link. Implies the link is shown. */
16
+ onActionPress?: () => void;
17
+ /** When provided, renders a tappable close icon to remove the column. */
18
+ onRemove?: () => void;
19
+ /** Stable key. Falls back to the label / index. */
20
+ key?: React.Key;
21
+ };
22
+ /**
23
+ * Value rendered inside a comparison cell.
24
+ * - `string` / `number` → rendered as value text.
25
+ * - `false` → renders the muted "not available" cross icon.
26
+ * - any React element → rendered as-is (e.g. a `Badge`, `MoneyValue`, icon…).
27
+ * - `null` / `undefined` / `true` → empty cell.
28
+ */
29
+ export type CompareTableCellValue = string | number | boolean | null | undefined | React.ReactElement;
30
+ export type CompareTableRow = {
31
+ /** One value per column, in the same order as `columns`. */
32
+ values: CompareTableCellValue[];
33
+ /** Stable key. Falls back to the index. */
34
+ key?: React.Key;
35
+ };
36
+ /**
37
+ * A collapsible section. Each section renders as an `Accordion` whose body is a
38
+ * comparison table that spans the same columns as the selection cards.
39
+ */
40
+ export type CompareTableSection = {
41
+ /** Accordion header label, e.g. "Fees & charges". */
42
+ title: string;
43
+ /** Optional full-width header row shown at the top of the table body. */
44
+ header?: string;
45
+ /** Comparison rows; each row's `values` map 1:1 to `columns`. */
46
+ rows: CompareTableRow[];
47
+ /** Initial expanded state. Defaults to `true` for the first section. */
48
+ defaultExpanded?: boolean;
49
+ /** Stable key. Falls back to the title / index. */
50
+ key?: React.Key;
51
+ };
52
+ export type CompareTableProps = {
53
+ /**
54
+ * Product / plan columns rendered as selection cards. Their order maps 1:1
55
+ * to each row's `values` array. Supports any number of columns.
56
+ */
57
+ columns?: CompareTableColumn[];
58
+ /** Collapsible comparison sections. */
59
+ sections?: CompareTableSection[];
60
+ /**
61
+ * When provided, renders an "Add a card" tile after the columns. Hidden once
62
+ * `columns.length` reaches `maxColumns`.
63
+ */
64
+ onAddColumn?: () => void;
65
+ /** Label for the add-a-card tile. @default 'Add a card' */
66
+ addColumnLabel?: string;
67
+ /** Maximum number of columns before the add tile is hidden. @default 4 */
68
+ maxColumns?: number;
69
+ /** Design token modes for theming (e.g. `{ "Color Mode": "Light" }`). */
70
+ modes?: Modes;
71
+ /** Override the outer container style. */
72
+ style?: StyleProp<ViewStyle>;
73
+ };
74
+ /**
75
+ * CompareTable renders a product comparison surface: a row of selection cards
76
+ * (one per column) followed by one or more collapsible sections, each holding a
77
+ * comparison table whose cells line up beneath their column.
78
+ *
79
+ * The selection card is an internal sub-component and is intentionally not
80
+ * exported — it should only be used through `CompareTable`. Implementation of
81
+ * Figma node `5568:3496` (`Compare table`) with sub-component `5568:3487`
82
+ * (`selectioncard`).
83
+ *
84
+ * @component
85
+ */
86
+ declare function CompareTable({ columns, sections, onAddColumn, addColumnLabel, maxColumns, modes, style, }: CompareTableProps): import("react/jsx-runtime").JSX.Element;
87
+ export default CompareTable;
88
+ //# sourceMappingURL=CompareTable.d.ts.map
@@ -0,0 +1,118 @@
1
+ import React from 'react';
2
+ import { type ImageSourcePropType, type StyleProp, type ViewStyle } from 'react-native';
3
+ import type { Modes } from '../../design-tokens';
4
+ /**
5
+ * A single slot in the {@link ComparisonBar}. Each item is either empty (the
6
+ * "Add" state — a tappable `+` capsule) or filled with an image (the
7
+ * "Image Added" state — the image plus a dismiss capsule in the corner).
8
+ *
9
+ * The presence of {@link ComparisonBarItem.imageSource} is what toggles the
10
+ * state: provide a source to show the image, leave it `undefined`/`null` to
11
+ * show the empty add slot. This keeps the component fully controlled — the
12
+ * `ComparisonBar` never owns the image state itself, so the consumer decides
13
+ * (e.g. after opening a file/asset picker) when and how an item flips between
14
+ * the two states.
15
+ */
16
+ export type ComparisonBarItem = {
17
+ /**
18
+ * Stable identifier for this slot. Returned to callbacks so the consumer
19
+ * can target the exact item that was interacted with. Falls back to the
20
+ * array index when omitted.
21
+ */
22
+ id?: string | number;
23
+ /**
24
+ * Image to render in the slot. When provided the slot renders in the
25
+ * "Image Added" state; when omitted/`null` it renders the empty "Add" state.
26
+ * Accepts the same shapes as the library `Image` component (remote URL
27
+ * string, `{ uri }`, or a `require()`d asset).
28
+ */
29
+ imageSource?: ImageSourcePropType | string | null;
30
+ /** Accessibility label for the slot. Defaults to a generic add/remove label. */
31
+ accessibilityLabel?: string;
32
+ };
33
+ export type ComparisonBarProps = {
34
+ /**
35
+ * The slots rendered before the Compare button. Each entry controls its own
36
+ * add/image state via {@link ComparisonBarItem.imageSource}.
37
+ */
38
+ items: ComparisonBarItem[];
39
+ /**
40
+ * Fired when an empty (Add) slot is tapped. The consumer is expected to react
41
+ * by opening whatever picker is appropriate and then updating that item's
42
+ * `imageSource` to flip it into the "Image Added" state — the component does
43
+ * not know how images are sourced. Receives the item's `id` (or index when no
44
+ * id was supplied) and the slot index.
45
+ */
46
+ onItemPress?: (id: ComparisonBarItem['id'], index: number) => void;
47
+ /**
48
+ * Fired when a filled slot is tapped. For better mobile ergonomics the
49
+ * *entire* filled slot is the remove target (the dismiss capsule is just a
50
+ * visual affordance), so a fingertip anywhere on the item triggers this. The
51
+ * consumer is expected to clear that item's `imageSource` to return it to the
52
+ * "Add" state. Receives the item's `id` (or index) and the slot index.
53
+ */
54
+ onItemRemove?: (id: ComparisonBarItem['id'], index: number) => void;
55
+ /** Fired when the Compare button is pressed. */
56
+ onCompare?: () => void;
57
+ /** Label for the trailing action button. Defaults to `"Compare"`. */
58
+ compareLabel?: string;
59
+ /**
60
+ * Explicitly controls the Compare button's *functional* disabled state — a
61
+ * truly disabled button is non-interactive (its `onPress` never fires), not
62
+ * just dimmed. Note that `modes` only affects appearance, so dimming the
63
+ * button via tokens does NOT stop taps; that is what this prop is for.
64
+ *
65
+ * When provided (a boolean), it always wins over
66
+ * {@link ComparisonBarProps.disableCompareWhenEmpty}. Leave it `undefined`
67
+ * to fall back to the auto behavior.
68
+ */
69
+ compareDisabled?: boolean;
70
+ /**
71
+ * When `true` (default) the Compare button is automatically (and truly)
72
+ * disabled while no slot has an image — there is nothing to compare yet. Set
73
+ * to `false` to keep it tappable even when empty. Ignored when
74
+ * {@link ComparisonBarProps.compareDisabled} is set explicitly.
75
+ */
76
+ disableCompareWhenEmpty?: boolean;
77
+ /** Mode configuration passed to the token resolver. */
78
+ modes?: Modes;
79
+ /** Style overrides for the outer floating card. */
80
+ style?: StyleProp<ViewStyle>;
81
+ };
82
+ /**
83
+ * ComparisonBar — a floating card that lets a user assemble a set of items to
84
+ * compare, then trigger the comparison.
85
+ *
86
+ * Each slot is fully controlled via its `imageSource`: an empty slot shows a
87
+ * tappable `+` (the "Add" state) and a filled slot shows the image with a
88
+ * dismiss capsule (the "Image Added" state). The component never sources or
89
+ * stores images itself — when an empty slot is pressed it fires `onItemPress`
90
+ * with the item's id/index so the consumer can open whatever picker is
91
+ * appropriate and then update that item's `imageSource` to flip its state.
92
+ * Tapping a filled slot (anywhere on it — a mobile-friendly hit target, with
93
+ * the dismiss capsule as a visual affordance) fires `onItemRemove` so the
94
+ * consumer can clear the source again.
95
+ *
96
+ * @example
97
+ * ```tsx
98
+ * const [items, setItems] = useState<ComparisonBarItem[]>([
99
+ * { id: 'a' }, { id: 'b' }, { id: 'c' }, { id: 'd' },
100
+ * ])
101
+ *
102
+ * <ComparisonBar
103
+ * items={items}
104
+ * onItemPress={async (id) => {
105
+ * const uri = await openImagePicker()
106
+ * setItems(prev => prev.map(it => it.id === id ? { ...it, imageSource: uri } : it))
107
+ * }}
108
+ * onItemRemove={(id) =>
109
+ * setItems(prev => prev.map(it => it.id === id ? { ...it, imageSource: null } : it))
110
+ * }
111
+ * onCompare={runComparison}
112
+ * />
113
+ * ```
114
+ */
115
+ declare function ComparisonBar({ items, onItemPress, onItemRemove, onCompare, compareLabel, compareDisabled, disableCompareWhenEmpty, modes: propModes, style, }: ComparisonBarProps): import("react/jsx-runtime").JSX.Element;
116
+ declare const _default: React.MemoExoticComponent<typeof ComparisonBar>;
117
+ export default _default;
118
+ //# sourceMappingURL=ComparisonBar.d.ts.map
@@ -14,6 +14,25 @@ export type DropdownInputOption = {
14
14
  /** Whether the option is non-selectable. */
15
15
  disabled?: boolean;
16
16
  };
17
+ /**
18
+ * Imperative handle exposed via `ref`. Lets the consumer drive the dropdown
19
+ * from outside — e.g. close it when an Android hardware/system button is
20
+ * pressed, or open it programmatically from a sibling control.
21
+ */
22
+ export type DropdownInputHandle = {
23
+ /** Opens the options menu (no-op when disabled / read-only). */
24
+ open: () => void;
25
+ /** Closes the options menu. */
26
+ close: () => void;
27
+ /** Toggles the options menu open/closed. */
28
+ toggle: () => void;
29
+ /** Moves focus to the trigger (web). */
30
+ focus: () => void;
31
+ /** Removes focus from the trigger (web). */
32
+ blur: () => void;
33
+ /** Measures the trigger in window coordinates. */
34
+ measureInWindow: (callback: (x: number, y: number, width: number, height: number) => void) => void;
35
+ };
17
36
  export type DropdownInputProps = {
18
37
  /** Label rendered above the input. */
19
38
  label?: string;
@@ -104,6 +123,6 @@ export type DropdownInputProps = {
104
123
  /** Called when the trigger loses focus (web only). */
105
124
  onBlur?: (e: any) => void;
106
125
  };
107
- declare function DropdownInput({ label, placeholder, items, value, defaultValue, onValueChange, children, renderValue, open, defaultOpen, onOpenChange, placement, isRequired, isDisabled, isInvalid, isReadOnly, supportText, errorMessage, menuMaxHeight, menuOffset, matchTriggerWidth, closeOnBackdropPress, modes: propModes, style, inputStyle, menuStyle, accessibilityLabel, accessibilityHint, onFocus, onBlur, }: DropdownInputProps): import("react/jsx-runtime").JSX.Element;
126
+ declare const DropdownInput: React.ForwardRefExoticComponent<DropdownInputProps & React.RefAttributes<DropdownInputHandle>>;
108
127
  export default DropdownInput;
109
128
  //# sourceMappingURL=DropdownInput.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { type StyleProp, type TextInputProps as RNTextInputProps, type TextStyle, type ViewStyle } from 'react-native';
2
+ import { TextInput as RNTextInput, type StyleProp, type TextInputProps as RNTextInputProps, type TextStyle, type ViewStyle } from 'react-native';
3
3
  import type { Modes } from '../../design-tokens';
4
4
  export type FormFieldType = 'text' | 'password' | 'email' | 'search' | 'number' | 'phone' | 'url';
5
5
  export type FormFieldProps = {
@@ -80,6 +80,6 @@ export type FormFieldProps = {
80
80
  /** Test identifier. */
81
81
  testID?: string;
82
82
  };
83
- declare function FormField({ label, placeholder, value, onChangeText, type, name, leading, trailing, leadingIconName, isRequired, isDisabled, isInvalid, isReadOnly, supportText, errorMessage, maxLength, autoFocus, modes: propModes, style, inputStyle, inputTextStyle, onFocus, onBlur, onSubmitEditing, accessibilityLabel, accessibilityHint, testID, }: FormFieldProps): import("react/jsx-runtime").JSX.Element;
83
+ declare const FormField: React.ForwardRefExoticComponent<FormFieldProps & React.RefAttributes<RNTextInput>>;
84
84
  export default FormField;
85
85
  //# sourceMappingURL=FormField.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { type StyleProp, type ViewStyle, type TextStyle, type TextInputProps as RNTextInputProps } from 'react-native';
2
+ import { TextInput as RNTextInput, type StyleProp, type ViewStyle, type TextStyle, type TextInputProps as RNTextInputProps } from 'react-native';
3
3
  import type { Modes } from '../../design-tokens';
4
4
  export type InputSearchProps = {
5
5
  supportText?: boolean;
@@ -22,5 +22,26 @@ export type InputSearchProps = {
22
22
  accessibilityLabel?: string;
23
23
  accessibilityHint?: string;
24
24
  } & Omit<RNTextInputProps, 'style' | 'onChangeText' | 'onFocus' | 'onBlur' | 'placeholder' | 'value'>;
25
- export default function InputSearch({ supportText, supportTextLabel, supportTextIcon, modes, containerStyle, placeholder, value, onChangeText, onFocus, onBlur, leading, trailing, inputStyle, ...rest }: InputSearchProps): import("react/jsx-runtime").JSX.Element;
25
+ declare const InputSearch: React.ForwardRefExoticComponent<{
26
+ supportText?: boolean;
27
+ supportTextLabel?: string;
28
+ /**
29
+ * Icon name from the icon registry to render inside the support text
30
+ * (e.g. 'ic_info', 'ic_cart'). Defaults to 'ic_info'.
31
+ */
32
+ supportTextIcon?: string;
33
+ modes?: Modes;
34
+ containerStyle?: StyleProp<ViewStyle>;
35
+ placeholder?: string;
36
+ value?: string;
37
+ onChangeText?: (text: string) => void;
38
+ onFocus?: (e: any) => void;
39
+ onBlur?: (e: any) => void;
40
+ leading?: React.ReactNode;
41
+ trailing?: React.ReactNode;
42
+ inputStyle?: StyleProp<TextStyle>;
43
+ accessibilityLabel?: string;
44
+ accessibilityHint?: string;
45
+ } & Omit<RNTextInputProps, "style" | "value" | "onFocus" | "onBlur" | "placeholder" | "onChangeText"> & React.RefAttributes<RNTextInput>>;
46
+ export default InputSearch;
26
47
  //# sourceMappingURL=InputSearch.d.ts.map
@@ -1,4 +1,5 @@
1
- import { type StyleProp, type ViewStyle, type TextStyle, type TextInputProps } from 'react-native';
1
+ import React from 'react';
2
+ import { TextInput as RNTextInput, type StyleProp, type ViewStyle, type TextStyle, type TextInputProps } from 'react-native';
2
3
  import type { Modes } from '../../design-tokens';
3
4
  export type NoteInputProps = {
4
5
  /** The value of the text input */
@@ -20,5 +21,21 @@ export type NoteInputProps = {
20
21
  * NoteInput component representing an interactive "Add note" badge style field.
21
22
  * Allows the user to click, clears the placeholder text, and shows a blinking cursor when focused.
22
23
  */
23
- export default function NoteInput({ value, placeholder, onChangeText, modes, style, textStyle, state: explicitState, onFocus, onBlur, ...rest }: NoteInputProps): import("react/jsx-runtime").JSX.Element;
24
+ declare const NoteInput: React.ForwardRefExoticComponent<{
25
+ /** The value of the text input */
26
+ value?: string;
27
+ /** The placeholder when empty ("Add note" by default) */
28
+ placeholder?: string;
29
+ /** Callback when text changes */
30
+ onChangeText?: (text: string) => void;
31
+ /** Design token modes (e.g., {'InputState': 'Idle', 'Color Mode': 'Light'}) */
32
+ modes?: Modes;
33
+ /** Custom container style */
34
+ style?: StyleProp<ViewStyle>;
35
+ /** Custom text input style */
36
+ textStyle?: StyleProp<TextStyle>;
37
+ /** State of the component */
38
+ state?: "Editing" | "Idle";
39
+ } & Omit<TextInputProps, "style" | "value" | "placeholder" | "onChangeText"> & React.RefAttributes<RNTextInput>>;
40
+ export default NoteInput;
24
41
  //# sourceMappingURL=NoteInput.d.ts.map