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.
- package/.cursor/D2C-FLOW.md +94 -0
- package/.cursor/D2C-SCREEN.md +119 -0
- package/.cursor/commands/D2C.md +101 -0
- package/CHANGELOG.md +18 -0
- package/lib/commonjs/components/ActionFooter/ActionFooter.js +319 -135
- package/lib/commonjs/components/Badge/Badge.js +20 -1
- package/lib/commonjs/components/Button/Button.js +139 -47
- package/lib/commonjs/components/ButtonGroup/ButtonGroup.js +1 -1
- package/lib/commonjs/components/Card/Card.js +151 -112
- package/lib/commonjs/components/Card/assets/gold-logo-mark.png +0 -0
- package/lib/commonjs/components/CategoryCard/CategoryCard.js +97 -63
- package/lib/commonjs/components/CategoryCard/assets/sample.png +0 -0
- package/lib/commonjs/components/CheckboxItem/CheckboxItem.js +59 -10
- package/lib/commonjs/components/ExpandableCheckbox/ExpandableCheckbox.js +132 -49
- package/lib/commonjs/components/HelloJioInput/HelloJioInput.js +56 -14
- package/lib/commonjs/components/IconCapsule/IconCapsule.js +1 -1
- package/lib/commonjs/components/MetricData/MetricData.js +26 -13
- package/lib/commonjs/components/MoneyValue/MoneyValue.js +1 -1
- package/lib/commonjs/components/Nudge/Nudge.js +1 -1
- package/lib/commonjs/components/PdpCcCard/PdpCcCard.js +47 -91
- package/lib/commonjs/components/PlanComparisonCard/PlanComparisonCard.js +52 -45
- package/lib/commonjs/components/PortfolioHero/PortfolioHero.js +1 -1
- package/lib/commonjs/components/Slider/Slider.js +3 -3
- package/lib/commonjs/components/TextInput/TextInput.js +26 -8
- package/lib/commonjs/components/Tooltip/Tooltip.js +3 -5
- package/lib/commonjs/components/index.js +7 -1
- package/lib/commonjs/design-tokens/Coin Variables-variables-full.json +1 -1
- package/lib/commonjs/design-tokens/figma-modes.generated.js +13 -13
- package/lib/commonjs/icons/registry.js +1 -1
- package/lib/module/components/ActionFooter/ActionFooter.js +322 -138
- package/lib/module/components/Badge/Badge.js +20 -1
- package/lib/module/components/Button/Button.js +140 -48
- package/lib/module/components/ButtonGroup/ButtonGroup.js +1 -1
- package/lib/module/components/Card/Card.js +152 -114
- package/lib/module/components/Card/assets/gold-logo-mark.png +0 -0
- package/lib/module/components/CategoryCard/CategoryCard.js +97 -63
- package/lib/module/components/CategoryCard/assets/sample.png +0 -0
- package/lib/module/components/CheckboxItem/CheckboxItem.js +59 -10
- package/lib/module/components/ExpandableCheckbox/ExpandableCheckbox.js +135 -52
- package/lib/module/components/HelloJioInput/HelloJioInput.js +56 -14
- package/lib/module/components/IconCapsule/IconCapsule.js +1 -1
- package/lib/module/components/MetricData/MetricData.js +26 -14
- package/lib/module/components/MoneyValue/MoneyValue.js +1 -1
- package/lib/module/components/Nudge/Nudge.js +1 -1
- package/lib/module/components/PdpCcCard/PdpCcCard.js +48 -92
- package/lib/module/components/PlanComparisonCard/PlanComparisonCard.js +52 -45
- package/lib/module/components/PortfolioHero/PortfolioHero.js +1 -1
- package/lib/module/components/Slider/Slider.js +3 -3
- package/lib/module/components/TextInput/TextInput.js +27 -9
- package/lib/module/components/Tooltip/Tooltip.js +3 -5
- package/lib/module/components/index.js +1 -1
- package/lib/module/design-tokens/Coin Variables-variables-full.json +1 -1
- package/lib/module/design-tokens/figma-modes.generated.js +13 -13
- package/lib/module/icons/registry.js +1 -1
- package/lib/typescript/src/components/ActionFooter/ActionFooter.d.ts +50 -21
- package/lib/typescript/src/components/Button/Button.d.ts +24 -1
- package/lib/typescript/src/components/ButtonGroup/ButtonGroup.d.ts +2 -2
- package/lib/typescript/src/components/Card/Card.d.ts +54 -25
- package/lib/typescript/src/components/CategoryCard/CategoryCard.d.ts +29 -12
- package/lib/typescript/src/components/CheckboxItem/CheckboxItem.d.ts +27 -9
- package/lib/typescript/src/components/ExpandableCheckbox/ExpandableCheckbox.d.ts +37 -12
- package/lib/typescript/src/components/IconCapsule/IconCapsule.d.ts +1 -1
- package/lib/typescript/src/components/MetricData/MetricData.d.ts +7 -5
- package/lib/typescript/src/components/PdpCcCard/PdpCcCard.d.ts +16 -6
- package/lib/typescript/src/components/PlanComparisonCard/PlanComparisonCard.d.ts +9 -2
- package/lib/typescript/src/components/index.d.ts +2 -2
- package/lib/typescript/src/icons/registry.d.ts +1 -1
- package/package.json +4 -2
- package/src/components/ActionFooter/ActionFooter.tsx +375 -141
- package/src/components/Badge/Badge.tsx +21 -1
- package/src/components/Button/Button.tsx +192 -44
- package/src/components/ButtonGroup/ButtonGroup.tsx +2 -2
- package/src/components/Card/Card.tsx +370 -212
- package/src/components/Card/assets/gold-logo-mark.png +0 -0
- package/src/components/CategoryCard/CategoryCard.tsx +130 -84
- package/src/components/CategoryCard/assets/sample.png +0 -0
- package/src/components/CheckboxItem/CheckboxItem.tsx +72 -12
- package/src/components/ExpandableCheckbox/ExpandableCheckbox.tsx +186 -67
- package/src/components/HelloJioInput/HelloJioInput.tsx +58 -17
- package/src/components/IconCapsule/IconCapsule.tsx +1 -1
- package/src/components/MetricData/MetricData.tsx +39 -22
- package/src/components/MoneyValue/MoneyValue.tsx +1 -1
- package/src/components/Nudge/Nudge.tsx +1 -1
- package/src/components/PdpCcCard/PdpCcCard.tsx +41 -92
- package/src/components/PlanComparisonCard/PlanComparisonCard.tsx +73 -58
- package/src/components/PortfolioHero/PortfolioHero.tsx +1 -1
- package/src/components/Slider/Slider.tsx +3 -3
- package/src/components/TextInput/TextInput.tsx +26 -9
- package/src/components/Tooltip/Tooltip.tsx +3 -5
- package/src/components/index.ts +9 -2
- package/src/design-tokens/Coin Variables-variables-full.json +1 -1
- package/src/design-tokens/figma-modes.generated.ts +13 -13
- 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,
|
|
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
|
-
|
|
192
|
-
|
|
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';
|