jfs-components 0.0.72 → 0.0.73

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 (116) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/lib/commonjs/components/AccordionCheckbox/AccordionCheckbox.js +239 -0
  3. package/lib/commonjs/components/BrandChip/BrandChip.js +149 -0
  4. package/lib/commonjs/components/CardBankAccount/CardBankAccount.js +213 -0
  5. package/lib/commonjs/components/CardInsight/CardInsight.js +166 -0
  6. package/lib/commonjs/components/CheckboxGroup/CheckboxGroup.js +67 -0
  7. package/lib/commonjs/components/CheckboxItem/CheckboxItem.js +125 -0
  8. package/lib/commonjs/components/CircularProgressBar/CircularProgressBar.js +56 -9
  9. package/lib/commonjs/components/CoverageBarComparison/CoverageBarComparison.js +272 -0
  10. package/lib/commonjs/components/CoverageRing/CoverageRing.js +141 -0
  11. package/lib/commonjs/components/DonutChart/DonutChart.js +309 -0
  12. package/lib/commonjs/components/DonutChartSummary/DonutChartSummary.js +155 -0
  13. package/lib/commonjs/components/LinearMeter/LinearMeter.js +9 -28
  14. package/lib/commonjs/components/LinearProgress/LinearProgress.js +68 -0
  15. package/lib/commonjs/components/MetricLegendItem/MetricLegendItem.js +95 -0
  16. package/lib/commonjs/components/MonthlyStatusGrid/MonthlyStatusGrid.js +286 -0
  17. package/lib/commonjs/components/OTP/OTP.js +381 -37
  18. package/lib/commonjs/components/ProductOverview/ProductOverview.js +147 -0
  19. package/lib/commonjs/components/RangeTrack/RangeTrack.js +269 -0
  20. package/lib/commonjs/components/SavingsGoalSummary/SavingsGoalSummary.js +181 -0
  21. package/lib/commonjs/components/SegmentedTrack/SegmentedTrack.js +171 -0
  22. package/lib/commonjs/components/StatGroup/StatGroup.js +128 -0
  23. package/lib/commonjs/components/StatItem/StatItem.js +65 -35
  24. package/lib/commonjs/components/StrengthIndicator/StrengthIndicator.js +157 -0
  25. package/lib/commonjs/components/SummaryTile/SummaryTile.js +150 -0
  26. package/lib/commonjs/components/index.js +171 -1
  27. package/lib/commonjs/design-tokens/Coin Variables-variables-full.json +1 -1
  28. package/lib/commonjs/icons/registry.js +1 -1
  29. package/lib/commonjs/utils/index.js +7 -0
  30. package/lib/commonjs/utils/number-utils.js +57 -0
  31. package/lib/module/components/AccordionCheckbox/AccordionCheckbox.js +233 -0
  32. package/lib/module/components/BrandChip/BrandChip.js +143 -0
  33. package/lib/module/components/CardBankAccount/CardBankAccount.js +208 -0
  34. package/lib/module/components/CardInsight/CardInsight.js +161 -0
  35. package/lib/module/components/CheckboxGroup/CheckboxGroup.js +62 -0
  36. package/lib/module/components/CheckboxItem/CheckboxItem.js +119 -0
  37. package/lib/module/components/CircularProgressBar/CircularProgressBar.js +56 -9
  38. package/lib/module/components/CoverageBarComparison/CoverageBarComparison.js +266 -0
  39. package/lib/module/components/CoverageRing/CoverageRing.js +136 -0
  40. package/lib/module/components/DonutChart/DonutChart.js +303 -0
  41. package/lib/module/components/DonutChartSummary/DonutChartSummary.js +150 -0
  42. package/lib/module/components/LinearMeter/LinearMeter.js +9 -28
  43. package/lib/module/components/LinearProgress/LinearProgress.js +63 -0
  44. package/lib/module/components/MetricLegendItem/MetricLegendItem.js +90 -0
  45. package/lib/module/components/MonthlyStatusGrid/MonthlyStatusGrid.js +281 -0
  46. package/lib/module/components/OTP/OTP.js +381 -38
  47. package/lib/module/components/ProductOverview/ProductOverview.js +142 -0
  48. package/lib/module/components/RangeTrack/RangeTrack.js +263 -0
  49. package/lib/module/components/SavingsGoalSummary/SavingsGoalSummary.js +175 -0
  50. package/lib/module/components/SegmentedTrack/SegmentedTrack.js +166 -0
  51. package/lib/module/components/StatGroup/StatGroup.js +123 -0
  52. package/lib/module/components/StatItem/StatItem.js +66 -36
  53. package/lib/module/components/StrengthIndicator/StrengthIndicator.js +152 -0
  54. package/lib/module/components/SummaryTile/SummaryTile.js +145 -0
  55. package/lib/module/components/index.js +21 -1
  56. package/lib/module/design-tokens/Coin Variables-variables-full.json +1 -1
  57. package/lib/module/icons/registry.js +1 -1
  58. package/lib/module/utils/index.js +2 -1
  59. package/lib/module/utils/number-utils.js +53 -0
  60. package/lib/typescript/src/components/AccordionCheckbox/AccordionCheckbox.d.ts +71 -0
  61. package/lib/typescript/src/components/BrandChip/BrandChip.d.ts +43 -0
  62. package/lib/typescript/src/components/CardBankAccount/CardBankAccount.d.ts +79 -0
  63. package/lib/typescript/src/components/CardInsight/CardInsight.d.ts +48 -0
  64. package/lib/typescript/src/components/CheckboxGroup/CheckboxGroup.d.ts +41 -0
  65. package/lib/typescript/src/components/CheckboxItem/CheckboxItem.d.ts +56 -0
  66. package/lib/typescript/src/components/CircularProgressBar/CircularProgressBar.d.ts +11 -1
  67. package/lib/typescript/src/components/CoverageBarComparison/CoverageBarComparison.d.ts +105 -0
  68. package/lib/typescript/src/components/CoverageRing/CoverageRing.d.ts +90 -0
  69. package/lib/typescript/src/components/DonutChart/DonutChart.d.ts +117 -0
  70. package/lib/typescript/src/components/DonutChartSummary/DonutChartSummary.d.ts +103 -0
  71. package/lib/typescript/src/components/LinearProgress/LinearProgress.d.ts +17 -0
  72. package/lib/typescript/src/components/MetricLegendItem/MetricLegendItem.d.ts +37 -0
  73. package/lib/typescript/src/components/MonthlyStatusGrid/MonthlyStatusGrid.d.ts +119 -0
  74. package/lib/typescript/src/components/OTP/OTP.d.ts +88 -2
  75. package/lib/typescript/src/components/ProductOverview/ProductOverview.d.ts +39 -0
  76. package/lib/typescript/src/components/RangeTrack/RangeTrack.d.ts +173 -0
  77. package/lib/typescript/src/components/SavingsGoalSummary/SavingsGoalSummary.d.ts +95 -0
  78. package/lib/typescript/src/components/SegmentedTrack/SegmentedTrack.d.ts +108 -0
  79. package/lib/typescript/src/components/StatGroup/StatGroup.d.ts +45 -0
  80. package/lib/typescript/src/components/StatItem/StatItem.d.ts +24 -7
  81. package/lib/typescript/src/components/StrengthIndicator/StrengthIndicator.d.ts +58 -0
  82. package/lib/typescript/src/components/SummaryTile/SummaryTile.d.ts +60 -0
  83. package/lib/typescript/src/components/index.d.ts +22 -2
  84. package/lib/typescript/src/icons/registry.d.ts +1 -1
  85. package/lib/typescript/src/utils/index.d.ts +1 -0
  86. package/lib/typescript/src/utils/number-utils.d.ts +29 -0
  87. package/package.json +1 -1
  88. package/src/components/AccordionCheckbox/AccordionCheckbox.tsx +323 -0
  89. package/src/components/BrandChip/BrandChip.tsx +235 -0
  90. package/src/components/CardBankAccount/CardBankAccount.tsx +295 -0
  91. package/src/components/CardInsight/CardInsight.tsx +239 -0
  92. package/src/components/CheckboxGroup/CheckboxGroup.tsx +86 -0
  93. package/src/components/CheckboxItem/CheckboxItem.tsx +174 -0
  94. package/src/components/CircularProgressBar/CircularProgressBar.tsx +74 -9
  95. package/src/components/CoverageBarComparison/CoverageBarComparison.tsx +378 -0
  96. package/src/components/CoverageRing/CoverageRing.tsx +225 -0
  97. package/src/components/DonutChart/DonutChart.tsx +503 -0
  98. package/src/components/DonutChartSummary/DonutChartSummary.tsx +256 -0
  99. package/src/components/LinearMeter/LinearMeter.tsx +9 -39
  100. package/src/components/LinearProgress/LinearProgress.tsx +92 -0
  101. package/src/components/MetricLegendItem/MetricLegendItem.tsx +167 -0
  102. package/src/components/MonthlyStatusGrid/MonthlyStatusGrid.tsx +438 -0
  103. package/src/components/OTP/OTP.tsx +476 -29
  104. package/src/components/ProductOverview/ProductOverview.tsx +236 -0
  105. package/src/components/RangeTrack/RangeTrack.tsx +394 -0
  106. package/src/components/SavingsGoalSummary/SavingsGoalSummary.tsx +269 -0
  107. package/src/components/SegmentedTrack/SegmentedTrack.tsx +268 -0
  108. package/src/components/StatGroup/StatGroup.tsx +169 -0
  109. package/src/components/StatItem/StatItem.tsx +117 -40
  110. package/src/components/StrengthIndicator/StrengthIndicator.tsx +205 -0
  111. package/src/components/SummaryTile/SummaryTile.tsx +251 -0
  112. package/src/components/index.ts +32 -2
  113. package/src/design-tokens/Coin Variables-variables-full.json +1 -1
  114. package/src/icons/registry.ts +1 -1
  115. package/src/utils/index.ts +1 -0
  116. package/src/utils/number-utils.ts +60 -0
@@ -0,0 +1,117 @@
1
+ import React from 'react';
2
+ import { type StyleProp, type TextStyle, type ViewStyle } from 'react-native';
3
+ /**
4
+ * Per-segment data definition for the data-driven `segments` prop.
5
+ *
6
+ * Each segment renders one arc on the donut ring. `value` controls the
7
+ * arc's angular share (its weight relative to the sum of all values).
8
+ * Use `modes` per segment to override the default `Appearance / DataViz`
9
+ * mode (the parent injects per-index defaults of `Senary`, `Primary`,
10
+ * `Secondary`, `Tertiary`, `Quaternary`, `Quinary`, then cycles).
11
+ */
12
+ export type DonutChartSegmentData = {
13
+ /** Stable React key. */
14
+ key?: React.Key;
15
+ /** Segment's angular weight (relative to the sum of all segment values). */
16
+ value: number;
17
+ /** Hard-override the segment color. Bypasses `dataViz/bg` token resolution. */
18
+ color?: string;
19
+ /**
20
+ * Per-segment design token mode overrides. Merged on top of parent
21
+ * `modes` and the per-index `Appearance / DataViz` defaults.
22
+ */
23
+ modes?: Record<string, any>;
24
+ /** Per-segment accessibility label. */
25
+ accessibilityLabel?: string;
26
+ };
27
+ export type DonutChartProps = {
28
+ /**
29
+ * Data-driven segment list. Used when no `children` slot is provided.
30
+ * Defaults to six equal segments themed across the
31
+ * `Appearance / DataViz` palette.
32
+ */
33
+ segments?: DonutChartSegmentData[];
34
+ /**
35
+ * Optional center value text (large/bold). Pass `null`/`false` to hide.
36
+ * Accepts a string or any `ReactNode` for full control.
37
+ */
38
+ value?: React.ReactNode;
39
+ /**
40
+ * Optional center label text (smaller, beneath the value). Pass
41
+ * `null`/`false` to hide. Accepts a string or any `ReactNode`.
42
+ */
43
+ label?: React.ReactNode;
44
+ /**
45
+ * Slot for custom center content. When provided, it replaces the
46
+ * default `value`/`label` text wrap entirely.
47
+ */
48
+ children?: React.ReactNode;
49
+ /** Outer diameter in px. Defaults to 194 (matching the Figma reference). */
50
+ size?: number;
51
+ /**
52
+ * Ring stroke width in px. Defaults to 18% of `size` so the donut keeps
53
+ * the same visual proportions across sizes.
54
+ */
55
+ strokeWidth?: number;
56
+ /**
57
+ * Visual gap between adjacent segments expressed in degrees of arc.
58
+ * Defaults to 0 (segments touch). Use small values (1–4°) for
59
+ * separation when many segments are present.
60
+ */
61
+ gap?: number;
62
+ /** Design token modes for theming (e.g. `{ 'Color Mode': 'Light' }`). */
63
+ modes?: Record<string, any>;
64
+ /** Override container styles. */
65
+ style?: StyleProp<ViewStyle>;
66
+ /** Override default value text styles. */
67
+ valueStyle?: StyleProp<TextStyle>;
68
+ /** Override default label text styles. */
69
+ labelStyle?: StyleProp<TextStyle>;
70
+ /** Accessibility label announced for the whole donut chart. */
71
+ accessibilityLabel?: string;
72
+ };
73
+ type DonutChartSegmentProps = {
74
+ /** Angular weight relative to the sum of sibling segment values. */
75
+ value: number;
76
+ /** Hard-override segment color (bypasses tokens). */
77
+ color?: string;
78
+ /**
79
+ * Design token modes for the segment. Merged with parent `modes` and
80
+ * the per-index `Appearance / DataViz` defaults.
81
+ */
82
+ modes?: Record<string, any>;
83
+ /** Per-segment accessibility label. */
84
+ accessibilityLabel?: string;
85
+ };
86
+ /**
87
+ * Inert helper used purely to author donut segments declaratively as
88
+ * `DonutChart.Segment` slot children. The parent reads its props and
89
+ * renders the actual SVG arcs — this component never renders anything by
90
+ * itself.
91
+ */
92
+ declare function DonutChartSegment(_: DonutChartSegmentProps): any;
93
+ /**
94
+ * `DonutChart` renders a circular ring split into categorical segments.
95
+ * It is the segmented counterpart of `CircularProgressBar`: there is **no
96
+ * track background** behind the segments — the colored ring *is* the
97
+ * data, and each slice is a sibling category rather than a directional or
98
+ * temporal value.
99
+ *
100
+ * The default 6-segment layout receives per-index `Appearance / DataViz`
101
+ * defaults (segment 1 → `Senary`, 2 → `Primary`, 3 → `Secondary`, 4 →
102
+ * `Tertiary`, 5 → `Quaternary`, 6 → `Quinary`) so the wheel reads as one
103
+ * concept split into six color-coded categories. Override `modes` per
104
+ * segment to remix appearances, or set `Emphasis / DataViz` on the
105
+ * parent `modes` to dim or brighten the whole wheel at once.
106
+ *
107
+ * @component
108
+ * @param {DonutChartProps} props
109
+ */
110
+ declare function DonutChart({ segments, value, label, children, size, strokeWidth: strokeWidthProp, gap, modes: propModes, style, valueStyle, labelStyle, accessibilityLabel, }: DonutChartProps): import("react/jsx-runtime").JSX.Element;
111
+ declare namespace DonutChart {
112
+ var Segment: typeof DonutChartSegment;
113
+ }
114
+ export { DonutChartSegment };
115
+ export type { DonutChartSegmentProps };
116
+ export default DonutChart;
117
+ //# sourceMappingURL=DonutChart.d.ts.map
@@ -0,0 +1,103 @@
1
+ import React from 'react';
2
+ import { type StyleProp, type ViewStyle } from 'react-native';
3
+ /**
4
+ * One row of the `DonutChartSummary`. Each item drives BOTH a donut
5
+ * segment and the matching legend row, so the segment and indicator
6
+ * always share the same color by construction.
7
+ */
8
+ export type DonutChartSummaryItem = {
9
+ /** Stable React key. Falls back to the item label / index. */
10
+ key?: React.Key;
11
+ /** The descriptive label rendered next to the indicator dot. */
12
+ label?: React.ReactNode;
13
+ /**
14
+ * The data point — drives the segment's angular share. Same
15
+ * semantics as `DonutChartSegmentData.value`. When the legend's
16
+ * right-side text is shown, the resolution order is:
17
+ * `displayValue` → `formatValue(value)` → hide.
18
+ */
19
+ value: number;
20
+ /**
21
+ * Optional override for the legend row's right-side text. Falls
22
+ * back to `formatValue(value)` if a parent-level `formatValue` is
23
+ * provided; otherwise the value slot is hidden (matches the Figma
24
+ * `data` boolean toggle on `MetricLegendItem`). Pass `null` or
25
+ * `false` to explicitly hide on a per-item basis.
26
+ */
27
+ displayValue?: React.ReactNode;
28
+ /**
29
+ * Hard-override the shared color used for both the donut segment
30
+ * and the legend indicator. Bypasses `dataViz/bg` token resolution.
31
+ */
32
+ color?: string;
33
+ /**
34
+ * Per-item design token mode overrides. Merged on top of parent
35
+ * `modes` and the per-index `Appearance / DataViz` defaults
36
+ * (`Senary`, `Primary`, `Secondary`, `Tertiary`, `Quaternary`,
37
+ * `Quinary`, then cycles).
38
+ */
39
+ modes?: Record<string, any>;
40
+ /** Accessibility label for the segment + legend row pairing. */
41
+ accessibilityLabel?: string;
42
+ };
43
+ export type DonutChartSummaryProps = {
44
+ /**
45
+ * Data-driven rows. Each entry produces a donut segment AND a
46
+ * matching `MetricLegendItem` — the count of legend rows is locked
47
+ * in step with the count of donut segments by construction.
48
+ */
49
+ items?: DonutChartSummaryItem[];
50
+ /**
51
+ * Optional formatter applied to each item's numeric `value` when
52
+ * the item does not provide an explicit `displayValue`. Useful for
53
+ * the common "format every weight the same way" case
54
+ * (e.g. `(v) => `${v}%``).
55
+ */
56
+ formatValue?: (value: number) => React.ReactNode;
57
+ /** Center value text inside the donut (large/bold). */
58
+ centerValue?: React.ReactNode;
59
+ /** Center label text inside the donut (smaller, beneath the value). */
60
+ centerLabel?: React.ReactNode;
61
+ /**
62
+ * Slot for fully-custom donut center content. When provided it
63
+ * replaces the default `centerValue`/`centerLabel` text wrap.
64
+ */
65
+ donutCenter?: React.ReactNode;
66
+ /** Outer donut diameter in px. Defaults to 194 (Figma reference). */
67
+ donutSize?: number;
68
+ /** Donut ring stroke width in px. Defaults to ~18% of `donutSize`. */
69
+ donutStrokeWidth?: number;
70
+ /**
71
+ * Visual gap between adjacent donut segments expressed in degrees
72
+ * of arc. Defaults to 0 (segments touch).
73
+ */
74
+ donutGap?: number;
75
+ /** Design token modes for theming (e.g. `{ 'Color Mode': 'Light' }`). */
76
+ modes?: Record<string, any>;
77
+ /** Override outer container styles. */
78
+ style?: StyleProp<ViewStyle>;
79
+ /** Override the legend container styles. */
80
+ legendStyle?: StyleProp<ViewStyle>;
81
+ /** Accessibility label announced for the whole summary. */
82
+ accessibilityLabel?: string;
83
+ };
84
+ /**
85
+ * `DonutChartSummary` pairs a `DonutChart` with a vertical list of
86
+ * `MetricLegendItem` rows. The component takes a single `items` array,
87
+ * so the number of legend rows is locked in step with the number of
88
+ * donut segments by construction — every segment has exactly one
89
+ * legend row, and they share the same color through the same
90
+ * `Appearance / DataViz` cascade as the standalone `DonutChart`.
91
+ *
92
+ * The default 4-item layout receives per-index `Appearance / DataViz`
93
+ * defaults (item 1 → `Senary`, 2 → `Primary`, 3 → `Secondary`, 4 →
94
+ * `Tertiary`, then cycles). Override `modes` per item to remix, or set
95
+ * `Emphasis / DataViz` on the parent `modes` to dim or brighten the
96
+ * whole component at once.
97
+ *
98
+ * @component
99
+ * @param {DonutChartSummaryProps} props
100
+ */
101
+ declare function DonutChartSummary({ items, formatValue, centerValue, centerLabel, donutCenter, donutSize, donutStrokeWidth, donutGap, modes: propModes, style, legendStyle, accessibilityLabel, }: DonutChartSummaryProps): import("react/jsx-runtime").JSX.Element;
102
+ export default DonutChartSummary;
103
+ //# sourceMappingURL=DonutChartSummary.d.ts.map
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import { View, type StyleProp, type ViewStyle } from 'react-native';
3
+ export type LinearProgressProps = {
4
+ /** Progress value between 0 and 1. Values are clamped. */
5
+ value?: number;
6
+ /** Design token modes for theming */
7
+ modes?: Record<string, any>;
8
+ /** Override container styles (the track wrapper) */
9
+ style?: StyleProp<ViewStyle>;
10
+ /** Override the track styles */
11
+ trackStyle?: StyleProp<ViewStyle>;
12
+ /** Override the indicator styles */
13
+ indicatorStyle?: StyleProp<ViewStyle>;
14
+ } & Omit<React.ComponentProps<typeof View>, 'style'>;
15
+ declare const LinearProgress: ({ value, modes, style, trackStyle, indicatorStyle, ...rest }: LinearProgressProps) => import("react/jsx-runtime").JSX.Element;
16
+ export default LinearProgress;
17
+ //# sourceMappingURL=LinearProgress.d.ts.map
@@ -0,0 +1,37 @@
1
+ import React from 'react';
2
+ import { type StyleProp, type ViewStyle, type TextStyle } from 'react-native';
3
+ export type MetricLegendItemProps = {
4
+ /** The label text on the left (after the indicator). */
5
+ label?: React.ReactNode;
6
+ /**
7
+ * The value text shown on the right. When `undefined` or `null`, the
8
+ * value slot is hidden — matching the Figma `data` boolean toggle.
9
+ */
10
+ value?: React.ReactNode;
11
+ /**
12
+ * Override the indicator dot color. Falls back to the
13
+ * `metricLegendItem/indicator/bg` design token.
14
+ */
15
+ indicatorColor?: string;
16
+ /** Design token modes for theming (e.g. `{ 'Color Mode': 'Light' }`). */
17
+ modes?: Record<string, any>;
18
+ /** Override container styles. */
19
+ style?: StyleProp<ViewStyle>;
20
+ /** Override the indicator (dot) styles. */
21
+ indicatorStyle?: StyleProp<ViewStyle>;
22
+ /** Override the label text styles. */
23
+ labelStyle?: StyleProp<TextStyle>;
24
+ /** Override the value text styles. */
25
+ valueStyle?: StyleProp<TextStyle>;
26
+ };
27
+ /**
28
+ * MetricLegendItem renders a horizontal row consisting of a small colored
29
+ * indicator dot, a label and an optional value. It is used in chart legends
30
+ * and similar metric callouts.
31
+ *
32
+ * @component
33
+ * @param {MetricLegendItemProps} props
34
+ */
35
+ declare function MetricLegendItem({ label, value, indicatorColor, modes, style, indicatorStyle, labelStyle, valueStyle, }: MetricLegendItemProps): import("react/jsx-runtime").JSX.Element;
36
+ export default MetricLegendItem;
37
+ //# sourceMappingURL=MetricLegendItem.d.ts.map
@@ -0,0 +1,119 @@
1
+ import React from 'react';
2
+ import { type StyleProp, type TextStyle, type ViewStyle } from 'react-native';
3
+ /**
4
+ * The three semantic states a calendar glyph can be in. Maps 1:1 to the
5
+ * Figma `Calendar Glyph State` collection modes (`Idle`, `notSaved`,
6
+ * `saved`) and drives both the glyph fill/foreground tokens and the
7
+ * matching legend dot.
8
+ */
9
+ export type MonthlyStatus = 'Idle' | 'notSaved' | 'saved';
10
+ /** One month entry in the grid. */
11
+ export type MonthlyStatusGridMonth = {
12
+ /** Stable React key. */
13
+ key?: React.Key;
14
+ /**
15
+ * Text rendered inside the glyph (e.g. `'Jan'`). When omitted, defaults
16
+ * to a 3-letter English month name based on the entry's index.
17
+ */
18
+ label?: React.ReactNode;
19
+ /**
20
+ * Semantic status. Drives the glyph background/foreground colors and the
21
+ * legend dot via the Figma `Calendar Glyph State` collection.
22
+ */
23
+ status: MonthlyStatus;
24
+ /**
25
+ * Per-month design token mode overrides. Merged on top of the parent
26
+ * `modes` and the per-month `Calendar Glyph State` derived from `status`.
27
+ */
28
+ modes?: Record<string, any>;
29
+ /** Per-month accessibility label. */
30
+ accessibilityLabel?: string;
31
+ };
32
+ export type MonthlyStatusGridProps = {
33
+ /**
34
+ * The months to render. Layout flows left-to-right, top-to-bottom into
35
+ * `columns` per row. Defaults to 12 `Idle` months (Jan…Dec) so the
36
+ * component renders something meaningful with no props.
37
+ */
38
+ months?: MonthlyStatusGridMonth[];
39
+ /**
40
+ * Number of glyphs per row. Default `4` (matching the Figma reference of
41
+ * 12 months × 4 columns = 3 rows).
42
+ */
43
+ columns?: number;
44
+ /**
45
+ * Override the legend labels. Pass `false` to hide the legend entirely.
46
+ * Missing keys fall back to the defaults: `No data`, `Not saved`,
47
+ * `Saved`.
48
+ */
49
+ legend?: false | Partial<Record<MonthlyStatus, React.ReactNode>>;
50
+ /**
51
+ * Restrict which legend entries are shown and in what order. Defaults to
52
+ * all three statuses in `[Idle, notSaved, saved]` order — matching the
53
+ * Figma reference.
54
+ */
55
+ legendStatuses?: MonthlyStatus[];
56
+ /** Design token modes (e.g. `{ 'Color Mode': 'Light' }`). */
57
+ modes?: Record<string, any>;
58
+ /** Container style override. */
59
+ style?: StyleProp<ViewStyle>;
60
+ /** Style applied to the months section (the rows wrapper). */
61
+ monthsStyle?: StyleProp<ViewStyle>;
62
+ /** Style applied to each row of glyphs. */
63
+ rowStyle?: StyleProp<ViewStyle>;
64
+ /** Style applied to every calendar glyph. */
65
+ glyphStyle?: StyleProp<ViewStyle>;
66
+ /** Style applied to the glyph label text. */
67
+ labelStyle?: StyleProp<TextStyle>;
68
+ /** Style applied to the legend row. */
69
+ legendStyle?: StyleProp<ViewStyle>;
70
+ /** Accessibility label for the entire component. */
71
+ accessibilityLabel?: string;
72
+ };
73
+ export type CalendarGlyphProps = {
74
+ /** Text rendered inside the glyph (e.g. `'Jan'`). */
75
+ label?: React.ReactNode;
76
+ /**
77
+ * Semantic status — drives the glyph fill/foreground via the Figma
78
+ * `Calendar Glyph State` collection.
79
+ */
80
+ status?: MonthlyStatus;
81
+ /** Design token mode overrides. */
82
+ modes?: Record<string, any>;
83
+ /** Container style override. */
84
+ style?: StyleProp<ViewStyle>;
85
+ /** Label text style override. */
86
+ labelStyle?: StyleProp<TextStyle>;
87
+ /** Accessibility label. Defaults to `"{label}, {status}"`. */
88
+ accessibilityLabel?: string;
89
+ };
90
+ /**
91
+ * Single calendar-month glyph: a small pill with a status-driven background
92
+ * and foreground, and a centered month label. Exposed for callers who want
93
+ * to compose glyphs themselves; most consumers should use
94
+ * {@link MonthlyStatusGrid} instead, which keeps the count, layout and
95
+ * legend in sync automatically.
96
+ */
97
+ declare function CalendarGlyph({ label, status, modes: propModes, style, labelStyle, accessibilityLabel, }: CalendarGlyphProps): import("react/jsx-runtime").JSX.Element;
98
+ /**
99
+ * `MonthlyStatusGrid` shows a year (or any contiguous range of months) as a
100
+ * grid of small pill-shaped calendar glyphs, each colored by its semantic
101
+ * status (`Idle` = "No data", `notSaved` = "Not saved", `saved` = "Saved").
102
+ * A legend below the grid explains the colors.
103
+ *
104
+ * Cohesiveness guarantees:
105
+ * - The number of glyphs is **always** `months.length`. There is no way to
106
+ * render a glyph that has no underlying status.
107
+ * - The legend dot color for a status is resolved through the **same**
108
+ * `calendarGlyph/background` token + `Calendar Glyph State` mode as the
109
+ * glyph itself, so the visual mapping cannot drift.
110
+ *
111
+ * The chart is rendered with plain RN primitives (`View` + `Text`); SVG is
112
+ * unnecessary here because the glyph shape is a simple rounded rectangle.
113
+ *
114
+ * @component
115
+ */
116
+ declare function MonthlyStatusGrid({ months, columns, legend, legendStatuses, modes: propModes, style, monthsStyle, rowStyle, glyphStyle, labelStyle, legendStyle, accessibilityLabel, }: MonthlyStatusGridProps): import("react/jsx-runtime").JSX.Element;
117
+ export { CalendarGlyph };
118
+ export default MonthlyStatusGrid;
119
+ //# sourceMappingURL=MonthlyStatusGrid.d.ts.map
@@ -1,6 +1,71 @@
1
1
  import React from 'react';
2
2
  import { type ViewStyle, type StyleProp } from 'react-native';
3
3
  import { type SupportTextProps } from '../SupportText/SupportText';
4
+ export type OtpResendState = 'counting' | 'ready' | 'sending';
5
+ export type UseOtpResendOptions = {
6
+ /** Countdown length in seconds. Defaults to 30. */
7
+ durationSeconds?: number | undefined;
8
+ /** Called when the user requests a resend. May return a Promise; while pending, state is 'sending'. */
9
+ onResend?: (() => void | Promise<void>) | undefined;
10
+ /** Whether the countdown should auto-start on mount. Defaults to true. */
11
+ autoStart?: boolean | undefined;
12
+ };
13
+ export type UseOtpResendReturn = {
14
+ state: OtpResendState;
15
+ /** Seconds remaining in the current countdown (0 when not counting). */
16
+ secondsLeft: number;
17
+ /** True while state === 'ready'. */
18
+ canResend: boolean;
19
+ /** True while state === 'sending'. */
20
+ isSending: boolean;
21
+ /**
22
+ * Trigger a resend. No-op unless state === 'ready'. Awaits onResend()
23
+ * before restarting the countdown. Re-throws any onResend rejection
24
+ * so callers can surface the failure (state returns to 'ready').
25
+ */
26
+ resend: () => Promise<void>;
27
+ /** Manually start (or restart) the countdown. */
28
+ restart: (durationSeconds?: number) => void;
29
+ /** Stop the countdown and move to 'ready' (without invoking onResend). */
30
+ skip: () => void;
31
+ };
32
+ /**
33
+ * Headless hook that drives an OTP resend countdown.
34
+ *
35
+ * The hook is intentionally UI-agnostic: it returns just enough state
36
+ * (`state`, `secondsLeft`, plus `resend()` / `restart()` / `skip()`) so
37
+ * consumers can render their own button, support text, etc. The bundled
38
+ * `OTPResend` component is the canonical UI on top of this hook.
39
+ */
40
+ export declare function useOtpResend({ durationSeconds, onResend, autoStart, }?: UseOtpResendOptions): UseOtpResendReturn;
41
+ export type OTPResendConfig = {
42
+ /** Countdown length in seconds. Defaults to 30. */
43
+ durationSeconds?: number;
44
+ /** Called when the user taps the resend button. May return a Promise. */
45
+ onResend?: () => void | Promise<void>;
46
+ /** Whether the countdown should auto-start on mount. Defaults to true. */
47
+ autoStart?: boolean;
48
+ /** Format the countdown line. Defaults to (s) => `Resend OTP in ${s}s`. */
49
+ formatCountdown?: (secondsLeft: number) => string;
50
+ /** Label shown in the 'sending' state. Defaults to "Sending…". */
51
+ sendingLabel?: string;
52
+ /** Label shown when ready to resend. Defaults to "Resend". */
53
+ resendLabel?: string;
54
+ /** SupportText status applied while counting. Defaults to "Loading" (clock icon). */
55
+ countdownStatus?: SupportTextProps['status'];
56
+ /**
57
+ * Mode overrides for the resend Button (in the 'ready' state). Merged
58
+ * on top of the component default of `{ AppearanceBrand: 'Neutral',
59
+ * 'Button / Size': 'S', Emphasis: 'Low' }`. Use this to swap to a
60
+ * different brand/size/emphasis without touching the rest of the UI.
61
+ */
62
+ resendButtonModes?: Record<string, any>;
63
+ };
64
+ export type OTPResendProps = OTPResendConfig & {
65
+ modes?: Record<string, any>;
66
+ style?: StyleProp<ViewStyle>;
67
+ };
68
+ export declare function OTPResend({ durationSeconds, onResend, autoStart, formatCountdown, sendingLabel, resendLabel, countdownStatus, resendButtonModes, modes: propModes, style, }: OTPResendProps): import("react/jsx-runtime").JSX.Element;
4
69
  export type OTPProps = {
5
70
  /** Number of OTP digits. Defaults to 6. */
6
71
  length?: number;
@@ -16,7 +81,7 @@ export type OTPProps = {
16
81
  onComplete?: (value: string) => void;
17
82
  /** Whether the OTP input is disabled. */
18
83
  isDisabled?: boolean;
19
- /** Whether the OTP input is in an invalid/error state. */
84
+ /** Whether the OTP input is in an invalid/error state. Drives underline colour and (optionally) the error message. */
20
85
  isInvalid?: boolean;
21
86
  /** Regex pattern to filter allowed characters. Defaults to digits only. */
22
87
  allowedPattern?: RegExp;
@@ -30,7 +95,28 @@ export type OTPProps = {
30
95
  supportText?: React.ReactNode;
31
96
  /** SupportText status when using the string shorthand. */
32
97
  supportTextStatus?: SupportTextProps['status'];
98
+ /**
99
+ * Convenience: shown beneath the slots **only** while `isInvalid` is true.
100
+ * Renders with status="Error" automatically. When omitted, the regular
101
+ * `supportText` is shown instead (with status promoted to Error).
102
+ */
103
+ errorMessage?: string;
104
+ /**
105
+ * When provided, replaces the support area with a managed countdown that
106
+ * decays into a "Resend" button. Hidden while `isInvalid` is true so the
107
+ * error message can take precedence.
108
+ */
109
+ resend?: OTPResendConfig;
110
+ /**
111
+ * Enable native one-time-code auto-fill on the underlying TextInput.
112
+ * On iOS this surfaces the SMS code in the QuickType bar above the
113
+ * keyboard (system-managed; no library required). On Android this sets
114
+ * `autoComplete="one-time-code"`, which the OS can auto-fill from
115
+ * notifications when the host app is wired up to the SMS Retriever or
116
+ * SMS User Consent APIs. Defaults to true.
117
+ */
118
+ enableSmsAutofill?: boolean;
33
119
  };
34
- declare function OTP({ length, value: controlledValue, defaultValue, onChange, onValueChange, onComplete, isDisabled, isInvalid, allowedPattern, autoFocus, modes: propModes, style, supportText, supportTextStatus, }: OTPProps): import("react/jsx-runtime").JSX.Element;
120
+ declare function OTP({ length, value: controlledValue, defaultValue, onChange, onValueChange, onComplete, isDisabled, isInvalid, allowedPattern, autoFocus, modes: propModes, style, supportText, supportTextStatus, errorMessage, resend, enableSmsAutofill, }: OTPProps): import("react/jsx-runtime").JSX.Element;
35
121
  export default OTP;
36
122
  //# sourceMappingURL=OTP.d.ts.map
@@ -0,0 +1,39 @@
1
+ import React from 'react';
2
+ import { type StyleProp, type ViewStyle, type ImageSourcePropType } from 'react-native';
3
+ export type ProductOverviewStat = {
4
+ /** The large prominent value shown on top, e.g. "995", "3%". */
5
+ value: string;
6
+ /** The descriptive label rendered beneath the value, e.g. "Purity". */
7
+ label: string;
8
+ };
9
+ export type ProductOverviewProps = {
10
+ /** Hero image source rendered at the top of the card. */
11
+ imageSource?: ImageSourcePropType | string;
12
+ /** Aspect ratio for the hero image. Defaults to the Figma frame (288:170). */
13
+ imageRatio?: number;
14
+ /** Avatar source for the inline ProductLabel chip. */
15
+ labelImageSource?: ImageSourcePropType | string;
16
+ /** Text shown next to the avatar in the ProductLabel chip. */
17
+ label?: string;
18
+ /** The large product name, e.g. "0.5g Gold Coin". */
19
+ productName?: string;
20
+ /** The short multi-line description below the product name. */
21
+ description?: string;
22
+ /**
23
+ * Stats rendered in the bottom row. Each stat shows a large value above a
24
+ * smaller label. Pass an empty array (or `null`) to hide the row.
25
+ */
26
+ stats?: ProductOverviewStat[];
27
+ /** Design token modes for theming (e.g. `{ 'Color Mode': 'Light' }`). */
28
+ modes?: Record<string, any>;
29
+ /** Container style override. */
30
+ style?: StyleProp<ViewStyle>;
31
+ /**
32
+ * Custom slot rendered between the description and the stats row, useful
33
+ * for badges, callouts, etc. Receives the same `modes` as the parent.
34
+ */
35
+ children?: React.ReactNode;
36
+ };
37
+ declare const ProductOverview: ({ imageSource, imageRatio, labelImageSource, label, productName, description, stats, modes, style, children, }: ProductOverviewProps) => import("react/jsx-runtime").JSX.Element;
38
+ export default ProductOverview;
39
+ //# sourceMappingURL=ProductOverview.d.ts.map