jfs-components 0.0.43 → 0.0.45

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 (106) hide show
  1. package/lib/commonjs/components/AmountInput/AmountInput.js +82 -0
  2. package/lib/commonjs/components/AmountInput/index.js +13 -0
  3. package/lib/commonjs/components/Button/Button.js +45 -28
  4. package/lib/commonjs/components/CardProviderInfo/CardProviderInfo.js +76 -0
  5. package/lib/commonjs/components/Checkbox/Checkbox.js +208 -0
  6. package/lib/commonjs/components/EmptyState/EmptyState.js +2 -1
  7. package/lib/commonjs/components/MoneyValue/MoneyValue.js +81 -49
  8. package/lib/commonjs/components/NoteInput/NoteInput.js +120 -0
  9. package/lib/commonjs/components/NoteInput/index.js +13 -0
  10. package/lib/commonjs/components/Numpad/Numpad.js +108 -0
  11. package/lib/commonjs/components/OTP/OTP.js +242 -0
  12. package/lib/commonjs/components/PortfolioHero/PortfolioHero.js +78 -0
  13. package/lib/commonjs/components/ProductLabel/ProductLabel.js +50 -0
  14. package/lib/commonjs/components/ProgressBadge/ProgressBadge.js +130 -0
  15. package/lib/commonjs/components/ProgressBadge/index.js +25 -0
  16. package/lib/commonjs/components/StatItem/StatItem.js +61 -0
  17. package/lib/commonjs/components/StatusHero/StatusHero.js +148 -0
  18. package/lib/commonjs/components/SwappableAmount/SwappableAmount.js +71 -0
  19. package/lib/commonjs/components/Tabs/TabItem.js +79 -0
  20. package/lib/commonjs/components/Tabs/Tabs.js +88 -0
  21. package/lib/commonjs/components/Text/Text.js +38 -0
  22. package/lib/commonjs/components/Toggle/Toggle.js +102 -0
  23. package/lib/commonjs/components/index.js +105 -0
  24. package/lib/commonjs/design-tokens/Coin Variables-variables-full.json +1 -0
  25. package/lib/commonjs/design-tokens/figma-variables-resolver.js +1 -1
  26. package/lib/commonjs/icons/registry.js +1 -1
  27. package/lib/module/components/AmountInput/AmountInput.js +77 -0
  28. package/lib/module/components/AmountInput/index.js +3 -0
  29. package/lib/module/components/Button/Button.js +44 -28
  30. package/lib/module/components/CardProviderInfo/CardProviderInfo.js +71 -0
  31. package/lib/module/components/Checkbox/Checkbox.js +205 -0
  32. package/lib/module/components/EmptyState/EmptyState.js +2 -1
  33. package/lib/module/components/MoneyValue/MoneyValue.js +81 -49
  34. package/lib/module/components/NoteInput/NoteInput.js +115 -0
  35. package/lib/module/components/NoteInput/index.js +3 -0
  36. package/lib/module/components/Numpad/Numpad.js +103 -0
  37. package/lib/module/components/OTP/OTP.js +236 -0
  38. package/lib/module/components/PortfolioHero/PortfolioHero.js +73 -0
  39. package/lib/module/components/ProductLabel/ProductLabel.js +45 -0
  40. package/lib/module/components/ProgressBadge/ProgressBadge.js +125 -0
  41. package/lib/module/components/ProgressBadge/index.js +4 -0
  42. package/lib/module/components/StatItem/StatItem.js +56 -0
  43. package/lib/module/components/StatusHero/StatusHero.js +142 -0
  44. package/lib/module/components/SwappableAmount/SwappableAmount.js +66 -0
  45. package/lib/module/components/Tabs/TabItem.js +74 -0
  46. package/lib/module/components/Tabs/Tabs.js +78 -0
  47. package/lib/module/components/Text/Text.js +33 -0
  48. package/lib/module/components/Toggle/Toggle.js +97 -0
  49. package/lib/module/components/index.js +16 -1
  50. package/lib/module/design-tokens/Coin Variables-variables-full.json +1 -0
  51. package/lib/module/design-tokens/figma-variables-resolver.js +1 -1
  52. package/lib/module/icons/registry.js +1 -1
  53. package/lib/typescript/src/components/AmountInput/AmountInput.d.ts +23 -0
  54. package/lib/typescript/src/components/AmountInput/index.d.ts +3 -0
  55. package/lib/typescript/src/components/Button/Button.d.ts +6 -1
  56. package/lib/typescript/src/components/CardProviderInfo/CardProviderInfo.d.ts +24 -0
  57. package/lib/typescript/src/components/Checkbox/Checkbox.d.ts +30 -0
  58. package/lib/typescript/src/components/EmptyState/EmptyState.d.ts +6 -1
  59. package/lib/typescript/src/components/MoneyValue/MoneyValue.d.ts +18 -26
  60. package/lib/typescript/src/components/NoteInput/NoteInput.d.ts +23 -0
  61. package/lib/typescript/src/components/NoteInput/index.d.ts +3 -0
  62. package/lib/typescript/src/components/Numpad/Numpad.d.ts +35 -0
  63. package/lib/typescript/src/components/OTP/OTP.d.ts +36 -0
  64. package/lib/typescript/src/components/PortfolioHero/PortfolioHero.d.ts +21 -0
  65. package/lib/typescript/src/components/ProductLabel/ProductLabel.d.ts +14 -0
  66. package/lib/typescript/src/components/ProgressBadge/ProgressBadge.d.ts +36 -0
  67. package/lib/typescript/src/components/ProgressBadge/index.d.ts +3 -0
  68. package/lib/typescript/src/components/StatItem/StatItem.d.ts +21 -0
  69. package/lib/typescript/src/components/StatusHero/StatusHero.d.ts +47 -0
  70. package/lib/typescript/src/components/SwappableAmount/SwappableAmount.d.ts +22 -0
  71. package/lib/typescript/src/components/Tabs/TabItem.d.ts +29 -0
  72. package/lib/typescript/src/components/Tabs/Tabs.d.ts +44 -0
  73. package/lib/typescript/src/components/Text/Text.d.ts +14 -0
  74. package/lib/typescript/src/components/Toggle/Toggle.d.ts +29 -0
  75. package/lib/typescript/src/components/index.d.ts +15 -0
  76. package/lib/typescript/src/icons/registry.d.ts +1 -1
  77. package/package.json +1 -1
  78. package/src/components/AmountInput/AmountInput.tsx +81 -0
  79. package/src/components/AmountInput/index.ts +2 -0
  80. package/src/components/Button/Button.tsx +40 -20
  81. package/src/components/CardProviderInfo/CardProviderInfo.tsx +81 -0
  82. package/src/components/Checkbox/Checkbox.tsx +238 -0
  83. package/src/components/EmptyState/EmptyState.tsx +7 -1
  84. package/src/components/MoneyValue/MoneyValue.tsx +134 -79
  85. package/src/components/NoteInput/NoteInput.tsx +146 -0
  86. package/src/components/NoteInput/index.ts +2 -0
  87. package/src/components/Numpad/Numpad.tsx +162 -0
  88. package/src/components/OTP/OTP.tsx +275 -0
  89. package/src/components/PortfolioHero/PortfolioHero.tsx +91 -0
  90. package/src/components/ProductLabel/ProductLabel.tsx +58 -0
  91. package/src/components/ProgressBadge/ProgressBadge.tsx +172 -0
  92. package/src/components/ProgressBadge/index.ts +2 -0
  93. package/src/components/StatItem/StatItem.tsx +71 -0
  94. package/src/components/StatusHero/StatusHero.tsx +156 -0
  95. package/src/components/SwappableAmount/SwappableAmount.tsx +92 -0
  96. package/src/components/Tabs/TabItem.tsx +96 -0
  97. package/src/components/Tabs/Tabs.tsx +105 -0
  98. package/src/components/Text/Text.tsx +48 -0
  99. package/src/components/Toggle/Toggle.tsx +122 -0
  100. package/src/components/index.ts +15 -0
  101. package/src/design-tokens/Coin Variables-variables-full.json +1 -0
  102. package/src/design-tokens/figma-variables-resolver.ts +1 -1
  103. package/src/icons/registry.ts +1 -1
  104. package/lib/commonjs/design-tokens/JFS Variables-variables-full.json +0 -1
  105. package/lib/module/design-tokens/JFS Variables-variables-full.json +0 -1
  106. package/src/design-tokens/JFS Variables-variables-full.json +0 -1
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+
3
+ import React from 'react';
4
+ import { Text as RNText } from 'react-native';
5
+ import { getVariableByName } from '../../design-tokens/figma-variables-resolver';
6
+ import { jsx as _jsx } from "react/jsx-runtime";
7
+ function Text({
8
+ text = 'Korem ipsum ',
9
+ modes = {},
10
+ style,
11
+ numberOfLines
12
+ }) {
13
+ const foreground = getVariableByName('text/foreground', modes) ?? '#000000';
14
+ const fontFamily = getVariableByName('text/fontFamily', modes) ?? 'JioType';
15
+ const fontSize = getVariableByName('text/fontSize', modes) ?? 14;
16
+ const fontWeight = getVariableByName('text/fontWeight', modes) ?? '500';
17
+ const lineHeight = getVariableByName('text/lineHeight', modes) ?? 20;
18
+ const letterSpacing = getVariableByName('text/letterSpacing', modes) ?? -0.5;
19
+ const textStyle = {
20
+ color: foreground,
21
+ fontFamily: fontFamily,
22
+ fontSize: fontSize,
23
+ fontWeight: String(fontWeight),
24
+ lineHeight: lineHeight,
25
+ letterSpacing: letterSpacing
26
+ };
27
+ return /*#__PURE__*/_jsx(RNText, {
28
+ style: [textStyle, style],
29
+ numberOfLines: numberOfLines,
30
+ children: text
31
+ });
32
+ }
33
+ export default Text;
@@ -0,0 +1,97 @@
1
+ "use strict";
2
+
3
+ import React, { useCallback, useState } from 'react';
4
+ import { Pressable, View, Platform } from 'react-native';
5
+ import { getVariableByName } from '../../design-tokens/figma-variables-resolver';
6
+ import { jsx as _jsx } from "react/jsx-runtime";
7
+ /**
8
+ * Toggle (switch) component that maps directly to the Figma design using design tokens.
9
+ *
10
+ * Supports controlled and uncontrolled usage, on/off states, and disabled state.
11
+ * All styling is driven by design tokens with optional mode overrides.
12
+ *
13
+ * @component
14
+ * @param {ToggleProps} props
15
+ */
16
+ function Toggle({
17
+ value: controlledValue,
18
+ defaultValue = false,
19
+ onValueChange,
20
+ disabled = false,
21
+ modes = {},
22
+ style,
23
+ accessibilityLabel
24
+ }) {
25
+ const isControlled = controlledValue !== undefined;
26
+ const [internalValue, setInternalValue] = useState(defaultValue);
27
+ const isOn = isControlled ? controlledValue : internalValue;
28
+ const toggleState = disabled ? isOn ? 'Disabled On' : 'Disabled Off' : isOn ? 'On' : 'Off';
29
+ const resolvedModes = {
30
+ ...modes,
31
+ 'Toggle States': toggleState
32
+ };
33
+ const width = getVariableByName('toggle/width', resolvedModes) ?? 52;
34
+ const radius = getVariableByName('toggle/radius', resolvedModes) ?? 100;
35
+ const paddingTrack = getVariableByName('toggle/padding/track', resolvedModes) ?? 3;
36
+ const background = getVariableByName('toggle/background', resolvedModes) ?? (isOn ? '#5d00b5' : '#c7c7cc');
37
+ const thumbSize = getVariableByName('toggle/thumb/size', resolvedModes) ?? 25;
38
+ const thumbRadius = getVariableByName('toggle/thumb/radius', resolvedModes) ?? 100;
39
+ const thumbBackground = getVariableByName('toggle/thumb/background', resolvedModes) ?? '#ffffff';
40
+ const thumbShadowColor = getVariableByName('toggle/thumb/shadow/color', resolvedModes) ?? 'rgba(0,0,0,0.18)';
41
+ const thumbShadowRadius = getVariableByName('toggle/thumb/shadow/radius', resolvedModes) ?? 4;
42
+ const thumbShadowOffsetX = getVariableByName('toggle/thumb/shadow/offsetX', resolvedModes) ?? 0;
43
+ const thumbShadowOffsetY = getVariableByName('toggle/thumb/shadow/offsetY', resolvedModes) ?? 2;
44
+ const trackHeight = thumbSize + paddingTrack * 2;
45
+ const handlePress = useCallback(() => {
46
+ if (disabled) return;
47
+ const next = !isOn;
48
+ if (!isControlled) {
49
+ setInternalValue(next);
50
+ }
51
+ onValueChange?.(next);
52
+ }, [disabled, isOn, isControlled, onValueChange]);
53
+ const trackStyle = {
54
+ width: width,
55
+ height: trackHeight,
56
+ borderRadius: radius,
57
+ backgroundColor: background,
58
+ padding: paddingTrack,
59
+ justifyContent: 'center',
60
+ alignItems: isOn ? 'flex-end' : 'flex-start',
61
+ opacity: disabled ? 0.5 : 1
62
+ };
63
+ const thumbShadow = Platform.OS === 'web' ? {
64
+ boxShadow: `${thumbShadowOffsetX}px ${thumbShadowOffsetY}px ${thumbShadowRadius}px 0px ${thumbShadowColor}`
65
+ } : {
66
+ shadowColor: thumbShadowColor,
67
+ shadowOffset: {
68
+ width: thumbShadowOffsetX,
69
+ height: thumbShadowOffsetY
70
+ },
71
+ shadowRadius: thumbShadowRadius,
72
+ shadowOpacity: 1,
73
+ elevation: 4
74
+ };
75
+ const thumbStyle = {
76
+ width: thumbSize,
77
+ height: thumbSize,
78
+ borderRadius: thumbRadius,
79
+ backgroundColor: thumbBackground,
80
+ ...thumbShadow
81
+ };
82
+ return /*#__PURE__*/_jsx(Pressable, {
83
+ style: [trackStyle, style],
84
+ onPress: handlePress,
85
+ disabled: disabled,
86
+ accessibilityRole: "switch",
87
+ accessibilityState: {
88
+ checked: isOn,
89
+ disabled
90
+ },
91
+ accessibilityLabel: accessibilityLabel,
92
+ children: /*#__PURE__*/_jsx(View, {
93
+ style: thumbStyle
94
+ })
95
+ });
96
+ }
97
+ export default Toggle;
@@ -9,6 +9,7 @@ export { default as BottomNav } from './BottomNav/BottomNav';
9
9
  export { default as BottomNavItem } from './BottomNavItem/BottomNavItem';
10
10
  export { default as Button } from './Button/Button';
11
11
  export { default as Card } from './Card/Card';
12
+ export { default as Checkbox } from './Checkbox/Checkbox';
12
13
  export { default as CardFeedback } from './CardFeedback/CardFeedback';
13
14
  export { default as Disclaimer } from './Disclaimer/Disclaimer';
14
15
  export { default as Divider } from './Divider/Divider';
@@ -27,7 +28,9 @@ export { default as ListItem } from './ListItem/ListItem';
27
28
  export { default as MediaCard } from './MediaCard/MediaCard';
28
29
  export { default as MerchantProfile } from './MerchantProfile/MerchantProfile';
29
30
  export { default as MoneyValue } from './MoneyValue/MoneyValue';
31
+ export { default as NoteInput } from './NoteInput/NoteInput';
30
32
  export { default as NavArrow } from './NavArrow/NavArrow';
33
+ export { default as Numpad } from './Numpad/Numpad';
31
34
  export { default as PageTitle } from './PageTitle/PageTitle';
32
35
  export { default as Screen } from './Screen/Screen';
33
36
  export { default as Section } from './Section/Section';
@@ -35,6 +38,7 @@ export { default as Stepper } from './Stepper/Stepper';
35
38
  export { Step } from './Stepper/Step';
36
39
  export { StepLabel } from './Stepper/StepLabel';
37
40
  export { default as TextInput } from './TextInput/TextInput';
41
+ export { default as StatusHero } from './StatusHero/StatusHero';
38
42
  export { default as ThreadHero } from './ThreadHero/ThreadHero';
39
43
  export { Tooltip } from './Tooltip/Tooltip';
40
44
  export { default as TransactionDetails } from './TransactionDetails/TransactionDetails';
@@ -47,11 +51,22 @@ export { default as Accordion } from './Accordion/Accordion';
47
51
  export { default as ActionTile } from './ActionTile/ActionTile';
48
52
  export { default as Balance } from './Balance/Balance';
49
53
  export { default as ButtonGroup } from './ButtonGroup/ButtonGroup';
54
+ export { default as CardProviderInfo } from './CardProviderInfo/CardProviderInfo';
50
55
  export { default as ChipSelect } from './ChipSelect/ChipSelect';
51
56
  export { default as InputSearch } from './InputSearch/InputSearch';
52
57
  export { default as SupportText } from './SupportText/SupportText';
53
58
  export { default as SupportTextIcon } from './SupportText/SupportTextIcon';
54
59
  export { default as RadioButton } from './RadioButton/RadioButton';
60
+ export { default as Tabs } from './Tabs/Tabs';
61
+ export { default as TabItem } from './Tabs/TabItem';
55
62
  export { default as Toast } from './Toast/Toast';
56
63
  export { default as ToastProvider } from './Toast/ToastProvider';
57
- export { useToast, addToast, closeToast, closeAll } from './Toast/useToast';
64
+ export { useToast, addToast, closeToast, closeAll } from './Toast/useToast';
65
+ export { default as AmountInput } from './AmountInput/AmountInput';
66
+ export { default as PortfolioHero } from './PortfolioHero/PortfolioHero';
67
+ export { default as ProductLabel } from './ProductLabel/ProductLabel';
68
+ export { default as SwappableAmount } from './SwappableAmount/SwappableAmount';
69
+ export { default as OTP } from './OTP/OTP';
70
+ export { default as StatItem } from './StatItem/StatItem';
71
+ export { default as Text } from './Text/Text';
72
+ export { default as Toggle } from './Toggle/Toggle';