jfs-components 0.0.77 → 0.0.79

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 (87) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/lib/commonjs/components/Accordion/Accordion.js +55 -55
  3. package/lib/commonjs/components/ActionFooter/ActionFooter.js +48 -2
  4. package/lib/commonjs/components/Attached/Attached.js +144 -0
  5. package/lib/commonjs/components/Card/Card.js +25 -2
  6. package/lib/commonjs/components/Checkbox/Checkbox.js +21 -9
  7. package/lib/commonjs/components/DropdownInput/DropdownInput.js +30 -16
  8. package/lib/commonjs/components/ExpandableCheckbox/ExpandableCheckbox.js +167 -0
  9. package/lib/commonjs/components/FormField/FormField.js +14 -1
  10. package/lib/commonjs/components/FullscreenModal/FullscreenModal.js +353 -0
  11. package/lib/commonjs/components/ListItem/ListItem.js +46 -24
  12. package/lib/commonjs/components/MessageField/MessageField.js +318 -0
  13. package/lib/commonjs/components/NavArrow/NavArrow.js +58 -17
  14. package/lib/commonjs/components/PlanComparisonCard/PlanComparisonCard.js +328 -0
  15. package/lib/commonjs/components/Slot/Slot.js +73 -0
  16. package/lib/commonjs/components/Stepper/Step.js +47 -60
  17. package/lib/commonjs/components/Stepper/StepLabel.js +40 -10
  18. package/lib/commonjs/components/Stepper/Stepper.js +15 -17
  19. package/lib/commonjs/components/SuggestiveSearch/SuggestiveSearch.js +487 -0
  20. package/lib/commonjs/components/TextInput/TextInput.js +16 -1
  21. package/lib/commonjs/components/Title/Title.js +10 -2
  22. package/lib/commonjs/components/index.js +49 -0
  23. package/lib/commonjs/design-tokens/Coin Variables-variables-full.json +1 -1
  24. package/lib/commonjs/icons/registry.js +1 -1
  25. package/lib/module/components/Accordion/Accordion.js +56 -56
  26. package/lib/module/components/ActionFooter/ActionFooter.js +50 -4
  27. package/lib/module/components/Attached/Attached.js +139 -0
  28. package/lib/module/components/Card/Card.js +25 -2
  29. package/lib/module/components/Checkbox/Checkbox.js +22 -10
  30. package/lib/module/components/DropdownInput/DropdownInput.js +30 -16
  31. package/lib/module/components/ExpandableCheckbox/ExpandableCheckbox.js +161 -0
  32. package/lib/module/components/FormField/FormField.js +16 -3
  33. package/lib/module/components/FullscreenModal/FullscreenModal.js +348 -0
  34. package/lib/module/components/ListItem/ListItem.js +46 -24
  35. package/lib/module/components/MessageField/MessageField.js +313 -0
  36. package/lib/module/components/NavArrow/NavArrow.js +59 -18
  37. package/lib/module/components/PlanComparisonCard/PlanComparisonCard.js +322 -0
  38. package/lib/module/components/Slot/Slot.js +68 -0
  39. package/lib/module/components/Stepper/Step.js +48 -61
  40. package/lib/module/components/Stepper/StepLabel.js +40 -10
  41. package/lib/module/components/Stepper/Stepper.js +15 -17
  42. package/lib/module/components/SuggestiveSearch/SuggestiveSearch.js +481 -0
  43. package/lib/module/components/TextInput/TextInput.js +17 -2
  44. package/lib/module/components/Title/Title.js +10 -2
  45. package/lib/module/components/index.js +7 -0
  46. package/lib/module/design-tokens/Coin Variables-variables-full.json +1 -1
  47. package/lib/module/icons/registry.js +1 -1
  48. package/lib/typescript/src/components/Accordion/Accordion.d.ts +14 -20
  49. package/lib/typescript/src/components/Attached/Attached.d.ts +61 -0
  50. package/lib/typescript/src/components/Card/Card.d.ts +9 -2
  51. package/lib/typescript/src/components/ExpandableCheckbox/ExpandableCheckbox.d.ts +63 -0
  52. package/lib/typescript/src/components/FullscreenModal/FullscreenModal.d.ts +99 -0
  53. package/lib/typescript/src/components/ListItem/ListItem.d.ts +15 -5
  54. package/lib/typescript/src/components/MessageField/MessageField.d.ts +81 -0
  55. package/lib/typescript/src/components/NavArrow/NavArrow.d.ts +10 -5
  56. package/lib/typescript/src/components/PlanComparisonCard/PlanComparisonCard.d.ts +64 -0
  57. package/lib/typescript/src/components/Slot/Slot.d.ts +52 -0
  58. package/lib/typescript/src/components/Stepper/Step.d.ts +4 -1
  59. package/lib/typescript/src/components/Stepper/StepLabel.d.ts +4 -1
  60. package/lib/typescript/src/components/Stepper/Stepper.d.ts +3 -1
  61. package/lib/typescript/src/components/SuggestiveSearch/SuggestiveSearch.d.ts +123 -0
  62. package/lib/typescript/src/components/index.d.ts +10 -3
  63. package/lib/typescript/src/icons/registry.d.ts +1 -1
  64. package/package.json +1 -1
  65. package/src/components/Accordion/Accordion.tsx +113 -73
  66. package/src/components/ActionFooter/ActionFooter.tsx +56 -4
  67. package/src/components/Attached/Attached.tsx +181 -0
  68. package/src/components/Card/Card.tsx +28 -1
  69. package/src/components/Checkbox/Checkbox.tsx +22 -9
  70. package/src/components/DropdownInput/DropdownInput.tsx +67 -39
  71. package/src/components/ExpandableCheckbox/ExpandableCheckbox.tsx +237 -0
  72. package/src/components/FormField/FormField.tsx +19 -3
  73. package/src/components/FullscreenModal/FullscreenModal.tsx +414 -0
  74. package/src/components/ListItem/ListItem.tsx +55 -25
  75. package/src/components/MessageField/MessageField.tsx +543 -0
  76. package/src/components/NavArrow/NavArrow.tsx +81 -17
  77. package/src/components/PlanComparisonCard/PlanComparisonCard.tsx +426 -0
  78. package/src/components/Slot/Slot.tsx +91 -0
  79. package/src/components/Stepper/Step.tsx +52 -51
  80. package/src/components/Stepper/StepLabel.tsx +46 -9
  81. package/src/components/Stepper/Stepper.tsx +20 -15
  82. package/src/components/SuggestiveSearch/SuggestiveSearch.tsx +756 -0
  83. package/src/components/TextInput/TextInput.tsx +14 -1
  84. package/src/components/Title/Title.tsx +13 -2
  85. package/src/components/index.ts +10 -3
  86. package/src/design-tokens/Coin Variables-variables-full.json +1 -1
  87. package/src/icons/registry.ts +1 -1
@@ -1,4 +1,4 @@
1
- import React, { useState } from 'react'
1
+ import React, { useRef, useState } from 'react'
2
2
  import { Pressable, View, TextInput as RNTextInput, type StyleProp, type ViewStyle, type TextInputProps as RNTextInputProps, type TextStyle } from 'react-native'
3
3
  import { getVariableByName } from '../../design-tokens/figma-variables-resolver'
4
4
  import Icon from '../../icons/Icon'
@@ -128,6 +128,11 @@ function TextInput({
128
128
  // Track focus state to hide placeholder when focused
129
129
  const [isFocused, setIsFocused] = useState(false)
130
130
  const [isHovered, setIsHovered] = useState(false)
131
+ // Ref to the underlying native input so a tap anywhere inside the Pressable
132
+ // wrapper can programmatically focus it. Without this, on Android the
133
+ // wrapping Pressable becomes the touch responder on the first tap and the
134
+ // native input only gains focus on the *second* tap.
135
+ const inputRef = useRef<RNTextInput>(null)
131
136
 
132
137
  // Resolve container tokens
133
138
  const backgroundColor = getVariableByName('textInput/background', modes) || '#f5f5f5'
@@ -227,6 +232,13 @@ function TextInput({
227
232
  style={[containerStyle, focusContainerStyle, hoverStyle, style]}
228
233
  onHoverIn={() => setIsHovered(true)}
229
234
  onHoverOut={() => setIsHovered(false)}
235
+ // Forward taps on the wrapper (padding, leading icon gutter, etc.) to the
236
+ // native input. This guarantees the keyboard opens on the FIRST tap on
237
+ // Android instead of requiring a second tap.
238
+ onPress={() => inputRef.current?.focus()}
239
+ // The native input is the real accessible element; don't add a redundant
240
+ // focusable node for screen readers.
241
+ accessible={false}
230
242
  >
231
243
  {processedLeading && (
232
244
  <View
@@ -237,6 +249,7 @@ function TextInput({
237
249
  </View>
238
250
  )}
239
251
  <RNTextInput
252
+ ref={inputRef}
240
253
  accessibilityLabel={undefined}
241
254
  accessibilityHint={accessibilityHint}
242
255
  placeholder={displayPlaceholder}
@@ -50,8 +50,15 @@ function Title({
50
50
  const labelColor =
51
51
  getVariableByName('title/label/color', modes) || '#0d0d0f'
52
52
  const fontSize = getVariableByName('title/fontSize', modes) || 26
53
- const lineHeight =
53
+ const rawLineHeight =
54
54
  getVariableByName('title/lineHeight', modes) || 26
55
+ // The Figma title tokens ship with `lineHeight === fontSize` (26/26). On
56
+ // native (especially Android) that produces a Text box exactly `lineHeight`
57
+ // tall, which clips descenders like p/g/y/q/j at the bottom — particularly
58
+ // noticeable with `numberOfLines={1}`. Clamp to ~1.2x fontSize so descenders
59
+ // always fit. When a downstream token already provides adequate leading,
60
+ // the original value is preserved.
61
+ const lineHeight = Math.max(rawLineHeight, Math.ceil(fontSize * 1.2))
55
62
  const fontFamily =
56
63
  getVariableByName('title/fontFamily', modes) || 'System'
57
64
  const fontWeightRaw =
@@ -65,8 +72,12 @@ function Title({
65
72
  getVariableByName('pageSubtitle/label/color', modes) || '#0d0d0f'
66
73
  const subtitleFontSize =
67
74
  getVariableByName('pageSubtitle/fontSize', modes) || 14
68
- const subtitleLineHeight =
75
+ const subtitleRawLineHeight =
69
76
  getVariableByName('pageSubtitle/lineHeight', modes) || 18
77
+ const subtitleLineHeight = Math.max(
78
+ subtitleRawLineHeight,
79
+ Math.ceil(subtitleFontSize * 1.2)
80
+ )
70
81
  const subtitleFontFamily =
71
82
  getVariableByName('pageSubtitle/fontFamily', modes) || 'System'
72
83
  const subtitleFontWeightRaw =
@@ -1,5 +1,6 @@
1
1
  export { default as AccountCard, type AccountCardProps, type AccountCardState } from './AccountCard/AccountCard';
2
2
  export { default as ActionFooter, type ActionFooterProps } from './ActionFooter/ActionFooter';
3
+ export { default as Attached, type AttachedProps, type AttachedPosition } from './Attached/Attached';
3
4
  export { default as AppBar } from './AppBar/AppBar';
4
5
  export { default as Avatar, type AvatarProps } from './Avatar/Avatar';
5
6
  export { default as AvatarGroup } from './AvatarGroup/AvatarGroup';
@@ -24,9 +25,11 @@ export { default as Divider, type DividerProps, type DividerDirection } from './
24
25
  export { default as Drawer } from './Drawer/Drawer';
25
26
  export { default as Dropdown, DropdownItem, type DropdownProps, type DropdownItemProps } from './Dropdown/Dropdown';
26
27
  export { default as DropdownInput, type DropdownInputProps, type DropdownInputOption, type DropdownInputOptionValue } from './DropdownInput/DropdownInput';
28
+ export { default as SuggestiveSearch, type SuggestiveSearchProps, type SuggestiveSearchOption, type SuggestiveSearchOptionValue, type SuggestiveSearchItem } from './SuggestiveSearch/SuggestiveSearch';
27
29
  export { default as CardCTA, type CardCTAProps, type CardCTAType } from './CardCTA/CardCTA'
28
30
  export { default as DebitCard, type DebitCardProps } from './DebitCard/DebitCard';
29
31
  export { default as FilterBar } from './FilterBar/FilterBar';
32
+ export { default as FullscreenModal, type FullscreenModalProps } from './FullscreenModal/FullscreenModal';
30
33
  export { default as Form, type FormProps } from './Form/Form';
31
34
  export { useFormContext } from './Form/Form';
32
35
  export { default as FormField, type FormFieldProps, type FormFieldType } from './FormField/FormField';
@@ -51,6 +54,7 @@ export { default as LottiePlayer, type LottiePlayerProps, type LottieAnimationSo
51
54
  export { default as ListItem } from './ListItem/ListItem';
52
55
  export { default as MediaCard, type MediaCardProps } from './MediaCard/MediaCard';
53
56
  export { default as MerchantProfile, type MerchantProfileProps } from './MerchantProfile/MerchantProfile';
57
+ export { default as MessageField, type MessageFieldProps, type MessageFieldState } from './MessageField/MessageField';
54
58
  export { default as MetricLegendItem, type MetricLegendItemProps } from './MetricLegendItem/MetricLegendItem';
55
59
  export { default as MoneyValue } from './MoneyValue/MoneyValue';
56
60
  export { default as NoteInput, type NoteInputProps } from './NoteInput/NoteInput';
@@ -60,9 +64,10 @@ export { default as Numpad, type NumpadProps, type NumpadKeyValue } from './Nump
60
64
  export { default as Title, type TitleProps } from './Title/Title';
61
65
  export { default as Screen, type ScreenProps } from './Screen/Screen';
62
66
  export { default as Section } from './Section/Section';
63
- export { default as Stepper } from './Stepper/Stepper';
64
- export { Step } from './Stepper/Step';
65
- export { StepLabel } from './Stepper/StepLabel';
67
+ export { default as Slot, type SlotProps, type SlotLayoutDirection } from './Slot/Slot';
68
+ export { default as Stepper, type StepperProps } from './Stepper/Stepper';
69
+ export { Step, type StepProps, type StepStatus } from './Stepper/Step';
70
+ export { StepLabel, type StepLabelProps } from './Stepper/StepLabel';
66
71
  export { default as TextInput } from './TextInput/TextInput';
67
72
  export { default as StatusHero, type StatusHeroProps } from './StatusHero/StatusHero';
68
73
  export { default as ThreadHero, type ThreadHeroProps } from './ThreadHero/ThreadHero';
@@ -83,6 +88,7 @@ export { default as UpiHandle } from './UpiHandle/UpiHandle';
83
88
  export { default as VStack, type VStackProps } from './VStack/VStack';
84
89
  export { default as ChipGroup, type ChipGroupProps } from './ChipGroup/ChipGroup';
85
90
  export { default as EmptyState, type EmptyStateProps } from './EmptyState/EmptyState';
91
+ export { default as ExpandableCheckbox, type ExpandableCheckboxProps } from './ExpandableCheckbox/ExpandableCheckbox';
86
92
  export { default as Accordion, type AccordionProps } from './Accordion/Accordion';
87
93
  export { default as AccordionCheckbox, type AccordionCheckboxProps } from './AccordionCheckbox/AccordionCheckbox';
88
94
  export { default as ActionTile, type ActionTileProps } from './ActionTile/ActionTile';
@@ -115,6 +121,7 @@ export { default as AmountInput, type AmountInputProps } from './AmountInput/Amo
115
121
  export { default as PageHero, type PageHeroProps } from './PageHero/PageHero';
116
122
  export { default as Popup, type PopupProps, type PopupRef } from './Popup/Popup';
117
123
  export { default as PortfolioHero, type PortfolioHeroProps } from './PortfolioHero/PortfolioHero';
124
+ export { default as PlanComparisonCard, type PlanComparisonCardProps, type PlanComparisonColumn, type PlanComparisonRow, type PlanComparisonCellValue } from './PlanComparisonCard/PlanComparisonCard';
118
125
  export { default as PoweredByLabel, type PoweredByLabelProps } from './PoweredByLabel/PoweredByLabel';
119
126
  export { default as ProductLabel, type ProductLabelProps } from './ProductLabel/ProductLabel';
120
127
  export { default as ProductOverview, type ProductOverviewProps, type ProductOverviewStat } from './ProductOverview/ProductOverview';