jfs-components 0.1.50 → 0.1.54

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 (93) hide show
  1. package/.cursor/D2C-FLOW.md +94 -0
  2. package/.cursor/D2C-SCREEN.md +119 -0
  3. package/.cursor/commands/D2C.md +101 -0
  4. package/CHANGELOG.md +18 -0
  5. package/lib/commonjs/components/ActionFooter/ActionFooter.js +319 -135
  6. package/lib/commonjs/components/Badge/Badge.js +20 -1
  7. package/lib/commonjs/components/Button/Button.js +139 -47
  8. package/lib/commonjs/components/ButtonGroup/ButtonGroup.js +1 -1
  9. package/lib/commonjs/components/Card/Card.js +151 -112
  10. package/lib/commonjs/components/Card/assets/gold-logo-mark.png +0 -0
  11. package/lib/commonjs/components/CategoryCard/CategoryCard.js +97 -63
  12. package/lib/commonjs/components/CategoryCard/assets/sample.png +0 -0
  13. package/lib/commonjs/components/CheckboxItem/CheckboxItem.js +59 -10
  14. package/lib/commonjs/components/ExpandableCheckbox/ExpandableCheckbox.js +132 -49
  15. package/lib/commonjs/components/HelloJioInput/HelloJioInput.js +56 -14
  16. package/lib/commonjs/components/IconCapsule/IconCapsule.js +1 -1
  17. package/lib/commonjs/components/MetricData/MetricData.js +26 -13
  18. package/lib/commonjs/components/MoneyValue/MoneyValue.js +1 -1
  19. package/lib/commonjs/components/Nudge/Nudge.js +1 -1
  20. package/lib/commonjs/components/PdpCcCard/PdpCcCard.js +47 -91
  21. package/lib/commonjs/components/PlanComparisonCard/PlanComparisonCard.js +52 -45
  22. package/lib/commonjs/components/PortfolioHero/PortfolioHero.js +1 -1
  23. package/lib/commonjs/components/Slider/Slider.js +3 -3
  24. package/lib/commonjs/components/TextInput/TextInput.js +26 -8
  25. package/lib/commonjs/components/Tooltip/Tooltip.js +3 -5
  26. package/lib/commonjs/components/index.js +7 -1
  27. package/lib/commonjs/design-tokens/Coin Variables-variables-full.json +1 -1
  28. package/lib/commonjs/design-tokens/figma-modes.generated.js +13 -13
  29. package/lib/commonjs/icons/registry.js +1 -1
  30. package/lib/module/components/ActionFooter/ActionFooter.js +322 -138
  31. package/lib/module/components/Badge/Badge.js +20 -1
  32. package/lib/module/components/Button/Button.js +140 -48
  33. package/lib/module/components/ButtonGroup/ButtonGroup.js +1 -1
  34. package/lib/module/components/Card/Card.js +152 -114
  35. package/lib/module/components/Card/assets/gold-logo-mark.png +0 -0
  36. package/lib/module/components/CategoryCard/CategoryCard.js +97 -63
  37. package/lib/module/components/CategoryCard/assets/sample.png +0 -0
  38. package/lib/module/components/CheckboxItem/CheckboxItem.js +59 -10
  39. package/lib/module/components/ExpandableCheckbox/ExpandableCheckbox.js +135 -52
  40. package/lib/module/components/HelloJioInput/HelloJioInput.js +56 -14
  41. package/lib/module/components/IconCapsule/IconCapsule.js +1 -1
  42. package/lib/module/components/MetricData/MetricData.js +26 -14
  43. package/lib/module/components/MoneyValue/MoneyValue.js +1 -1
  44. package/lib/module/components/Nudge/Nudge.js +1 -1
  45. package/lib/module/components/PdpCcCard/PdpCcCard.js +48 -92
  46. package/lib/module/components/PlanComparisonCard/PlanComparisonCard.js +52 -45
  47. package/lib/module/components/PortfolioHero/PortfolioHero.js +1 -1
  48. package/lib/module/components/Slider/Slider.js +3 -3
  49. package/lib/module/components/TextInput/TextInput.js +27 -9
  50. package/lib/module/components/Tooltip/Tooltip.js +3 -5
  51. package/lib/module/components/index.js +1 -1
  52. package/lib/module/design-tokens/Coin Variables-variables-full.json +1 -1
  53. package/lib/module/design-tokens/figma-modes.generated.js +13 -13
  54. package/lib/module/icons/registry.js +1 -1
  55. package/lib/typescript/src/components/ActionFooter/ActionFooter.d.ts +50 -21
  56. package/lib/typescript/src/components/Button/Button.d.ts +24 -1
  57. package/lib/typescript/src/components/ButtonGroup/ButtonGroup.d.ts +2 -2
  58. package/lib/typescript/src/components/Card/Card.d.ts +54 -25
  59. package/lib/typescript/src/components/CategoryCard/CategoryCard.d.ts +29 -12
  60. package/lib/typescript/src/components/CheckboxItem/CheckboxItem.d.ts +27 -9
  61. package/lib/typescript/src/components/ExpandableCheckbox/ExpandableCheckbox.d.ts +37 -12
  62. package/lib/typescript/src/components/IconCapsule/IconCapsule.d.ts +1 -1
  63. package/lib/typescript/src/components/MetricData/MetricData.d.ts +7 -5
  64. package/lib/typescript/src/components/PdpCcCard/PdpCcCard.d.ts +16 -6
  65. package/lib/typescript/src/components/PlanComparisonCard/PlanComparisonCard.d.ts +9 -2
  66. package/lib/typescript/src/components/index.d.ts +2 -2
  67. package/lib/typescript/src/icons/registry.d.ts +1 -1
  68. package/package.json +4 -2
  69. package/src/components/ActionFooter/ActionFooter.tsx +375 -141
  70. package/src/components/Badge/Badge.tsx +21 -1
  71. package/src/components/Button/Button.tsx +192 -44
  72. package/src/components/ButtonGroup/ButtonGroup.tsx +2 -2
  73. package/src/components/Card/Card.tsx +370 -212
  74. package/src/components/Card/assets/gold-logo-mark.png +0 -0
  75. package/src/components/CategoryCard/CategoryCard.tsx +130 -84
  76. package/src/components/CategoryCard/assets/sample.png +0 -0
  77. package/src/components/CheckboxItem/CheckboxItem.tsx +72 -12
  78. package/src/components/ExpandableCheckbox/ExpandableCheckbox.tsx +186 -67
  79. package/src/components/HelloJioInput/HelloJioInput.tsx +58 -17
  80. package/src/components/IconCapsule/IconCapsule.tsx +1 -1
  81. package/src/components/MetricData/MetricData.tsx +39 -22
  82. package/src/components/MoneyValue/MoneyValue.tsx +1 -1
  83. package/src/components/Nudge/Nudge.tsx +1 -1
  84. package/src/components/PdpCcCard/PdpCcCard.tsx +41 -92
  85. package/src/components/PlanComparisonCard/PlanComparisonCard.tsx +73 -58
  86. package/src/components/PortfolioHero/PortfolioHero.tsx +1 -1
  87. package/src/components/Slider/Slider.tsx +3 -3
  88. package/src/components/TextInput/TextInput.tsx +26 -9
  89. package/src/components/Tooltip/Tooltip.tsx +3 -5
  90. package/src/components/index.ts +9 -2
  91. package/src/design-tokens/Coin Variables-variables-full.json +1 -1
  92. package/src/design-tokens/figma-modes.generated.ts +13 -13
  93. package/src/icons/registry.ts +1 -1
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
 
3
3
  import React, { forwardRef, useRef, useState } from 'react';
4
- import { Platform, Pressable, View, TextInput as RNTextInput } from 'react-native';
4
+ import { Platform, Pressable, StyleSheet, View, TextInput as RNTextInput } from 'react-native';
5
5
  import { getVariableByName } from '../../design-tokens/figma-variables-resolver';
6
6
  import Icon from '../../icons/Icon';
7
7
  import { EMPTY_MODES, cloneChildrenWithModes, mergeRefs } from '../../utils/react-utils';
@@ -162,16 +162,23 @@ const TextInputBase = /*#__PURE__*/forwardRef(function TextInput({
162
162
  borderColor: '#222',
163
163
  borderWidth: 1
164
164
  } : {};
165
+
166
+ // ⚠️ DO NOT change to an unconditional `lineHeight`, and do NOT put
167
+ // `minHeight: lineHeight` on this single-line input on iOS. Same contract as
168
+ // FormField / SuggestiveSearch — read before "simplifying".
169
+ //
170
+ // facebook/react-native#39145 / #28012: on iOS, a single-line RN TextInput
171
+ // (UITextField) with `lineHeight` > font metrics puts ALL the extra space
172
+ // ABOVE the glyphs, so placeholder/value sink. Android/Web distribute evenly.
173
+ // RN's documented workaround (#39145) and #56774: omit `lineHeight` on
174
+ // single-line iOS inputs — UITextField centers natively — and let the
175
+ // wrapper (`alignItems: 'center'` + padding/icon) own vertical layout.
176
+ // Pinning `lineHeight` to `fontSize` is NOT a substitute; it clips custom
177
+ // font metrics and floats typed text above center.
165
178
  const textInputStyle = {
166
179
  flex: 1,
167
180
  color: textColor,
168
181
  fontSize,
169
- // iOS-only quirk: a single-line RNTextInput with an explicit `lineHeight`
170
- // larger than `fontSize` puts all the extra space ABOVE the glyphs, so the
171
- // text/placeholder sits below center (iOS native font-metrics bug — see
172
- // facebook/react-native#39145 / #28012). The container centers via
173
- // `alignItems: 'center'` + `minHeight`, so omit lineHeight on iOS
174
- // (UITextField centers natively) and keep it on Android/Web where it's fine.
175
182
  ...(Platform.OS === 'ios' ? null : {
176
183
  lineHeight
177
184
  }),
@@ -179,13 +186,24 @@ const TextInputBase = /*#__PURE__*/forwardRef(function TextInput({
179
186
  fontWeight,
180
187
  padding: 0,
181
188
  margin: 0,
182
- minHeight: lineHeight,
183
189
  // Remove focus outline for React Native Web
184
190
  outlineStyle: 'none',
185
191
  outlineWidth: 0,
186
192
  outlineColor: 'transparent'
187
193
  };
188
194
 
195
+ // On iOS, strip any consumer `inputStyle.lineHeight` so it can't re-break
196
+ // the native centering contract above.
197
+ const resolvedInputStyle = Platform.OS === 'ios' && inputStyle != null ? (() => {
198
+ const flat = StyleSheet.flatten(inputStyle);
199
+ if (!flat || flat.lineHeight == null) return inputStyle;
200
+ const {
201
+ lineHeight: _ignoredLineHeight,
202
+ ...restStyle
203
+ } = flat;
204
+ return restStyle;
205
+ })() : inputStyle;
206
+
189
207
  // Determine leading element: use provided leading, or default to icon from leadingIconName
190
208
  const leadingElement = leading || /*#__PURE__*/_jsx(Icon, {
191
209
  name: leadingIconName,
@@ -242,7 +260,7 @@ const TextInputBase = /*#__PURE__*/forwardRef(function TextInput({
242
260
  placeholderTextColor: placeholderColor,
243
261
  onFocus: handleFocus,
244
262
  onBlur: handleBlur,
245
- style: [textInputStyle, inputStyle],
263
+ style: [textInputStyle, resolvedInputStyle],
246
264
  ...rest
247
265
  }), processedTrailing && /*#__PURE__*/_jsx(View, {
248
266
  accessibilityElementsHidden: true,
@@ -184,14 +184,12 @@ export function TooltipContent({
184
184
  height: windowHeight
185
185
  } = Dimensions.get('window');
186
186
 
187
- // Tokens
187
+ // Tokens — Figma binds Output/Tooltip `radius` + `maxWidth` (not tooltip/*).
188
188
  const bgColor = getVariableByName('tooltip/background', modes);
189
189
  const paddingH = Number(getVariableByName('tooltip/padding/horizontal', modes));
190
190
  const paddingV = Number(getVariableByName('tooltip/padding/vertical', modes));
191
- // Figma still binds bare local radius/maxWidth; published names are tooltip/*.
192
- // Not yet in Coin Variables export — fall back to Figma values (8 / 280).
193
- const radius = Number(getVariableByName('tooltip/radius', modes) ?? 8);
194
- const maxWidthToken = Number(getVariableByName('tooltip/maxWidth', modes) ?? 280);
191
+ const radius = Number(getVariableByName('radius', modes));
192
+ const maxWidthToken = Number(getVariableByName('maxWidth', modes));
195
193
  const arrowWidth = Number(getVariableByName('tooltip/tipItem/width', modes));
196
194
  const arrowHeight = Number(getVariableByName('tooltip/tipItem/height', modes));
197
195
  const labelColor = getVariableByName('tooltip/label/color', modes);
@@ -12,7 +12,7 @@ export { default as BottomNav } from './BottomNav/BottomNav';
12
12
  export { default as BottomNavItem } from './BottomNavItem/BottomNavItem';
13
13
  export { default as BrandChip } from './BrandChip/BrandChip';
14
14
  export { default as Button } from './Button/Button';
15
- export { default as Card } from './Card/Card';
15
+ export { default as Card, CARD_MEDIA_ASPECT_RATIO } from './Card/Card';
16
16
  export { default as CardAdvisory } from './CardAdvisory/CardAdvisory';
17
17
  export { default as CardBankAccount } from './CardBankAccount/CardBankAccount';
18
18
  export { default as Carousel } from './Carousel/Carousel';