jfs-components 0.0.71 → 0.0.72
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/CHANGELOG.md +49 -0
- package/lib/commonjs/components/CardAdvisory/CardAdvisory.js +2 -2
- package/lib/commonjs/components/CardFinancialCondition/CardFinancialCondition.js +213 -0
- package/lib/commonjs/components/Carousel/Carousel.js +9 -7
- package/lib/commonjs/components/HoldingsCard/HoldingsCard.js +2 -2
- package/lib/commonjs/components/InstitutionBadge/InstitutionBadge.js +132 -0
- package/lib/commonjs/components/Radio/Radio.js +194 -0
- package/lib/commonjs/components/RadioButton/RadioButton.js +21 -188
- package/lib/commonjs/components/index.js +21 -0
- package/lib/commonjs/icons/registry.js +1 -1
- package/lib/module/components/CardAdvisory/CardAdvisory.js +2 -2
- package/lib/module/components/CardFinancialCondition/CardFinancialCondition.js +207 -0
- package/lib/module/components/Carousel/Carousel.js +9 -7
- package/lib/module/components/HoldingsCard/HoldingsCard.js +2 -2
- package/lib/module/components/InstitutionBadge/InstitutionBadge.js +127 -0
- package/lib/module/components/Radio/Radio.js +188 -0
- package/lib/module/components/RadioButton/RadioButton.js +20 -185
- package/lib/module/components/index.js +7 -0
- package/lib/module/icons/registry.js +1 -1
- package/lib/typescript/src/components/CardFinancialCondition/CardFinancialCondition.d.ts +50 -0
- package/lib/typescript/src/components/InstitutionBadge/InstitutionBadge.d.ts +30 -0
- package/lib/typescript/src/components/Radio/Radio.d.ts +30 -0
- package/lib/typescript/src/components/RadioButton/RadioButton.d.ts +20 -28
- package/lib/typescript/src/components/index.d.ts +7 -0
- package/lib/typescript/src/icons/registry.d.ts +1 -1
- package/package.json +1 -1
- package/src/components/CardAdvisory/CardAdvisory.tsx +2 -2
- package/src/components/CardFinancialCondition/CardFinancialCondition.tsx +366 -0
- package/src/components/Carousel/Carousel.tsx +14 -6
- package/src/components/HoldingsCard/HoldingsCard.tsx +2 -2
- package/src/components/InstitutionBadge/InstitutionBadge.tsx +216 -0
- package/src/components/Radio/Radio.tsx +227 -0
- package/src/components/RadioButton/RadioButton.tsx +23 -225
- package/src/components/index.ts +7 -0
- package/src/icons/registry.ts +1 -1
|
@@ -1,188 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}) {
|
|
24
|
-
// ---- Refs & State ----
|
|
25
|
-
const [hovered, setHovered] = useState(false);
|
|
26
|
-
const [focused, setFocused] = useState(false);
|
|
27
|
-
const [pressed, setPressed] = useState(false);
|
|
28
|
-
|
|
29
|
-
// ---- Dimensions ----
|
|
30
|
-
const widthStr = getVariableByName('radio/width', modes) || '18';
|
|
31
|
-
const heightStr = getVariableByName('radio/height', modes) || '18';
|
|
32
|
-
const selectorSizeStr = getVariableByName('radio/selector/size', modes) || '10';
|
|
33
|
-
const width = parseFloat(widthStr?.toString() || '18');
|
|
34
|
-
const height = parseFloat(heightStr?.toString() || '18');
|
|
35
|
-
const selectorSize = parseFloat(selectorSizeStr?.toString() || '10');
|
|
36
|
-
|
|
37
|
-
// ---- State Logic ----
|
|
38
|
-
// Priority: Disabled -> Focused -> Hover/Pressed -> Idle
|
|
39
|
-
// Note: Design treats Active (Pressed) similar to Selected for some styles,
|
|
40
|
-
// but usually in Radio Buttons, Pressed is a transient state.
|
|
41
|
-
// We will map:
|
|
42
|
-
// - Disabled -> 'disabled'
|
|
43
|
-
// - Focused -> 'focus'
|
|
44
|
-
// - Hovered -> 'hover'
|
|
45
|
-
// - Idle -> 'idle'
|
|
46
|
-
|
|
47
|
-
// We handle `selected` as a separate dimension derived from state.
|
|
48
|
-
|
|
49
|
-
let visualState = 'idle';
|
|
50
|
-
if (disabled) {
|
|
51
|
-
visualState = 'disabled';
|
|
52
|
-
} else if (focused) {
|
|
53
|
-
visualState = 'focus';
|
|
54
|
-
} else if (hovered || pressed) {
|
|
55
|
-
visualState = 'hover';
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
// Construct token paths based on state + selected
|
|
59
|
-
let prefix = `radio/${visualState}`;
|
|
60
|
-
if (visualState === 'idle' && selected) {
|
|
61
|
-
prefix = `radio/selected`;
|
|
62
|
-
} else if (selected) {
|
|
63
|
-
prefix = `radio/${visualState}Selected`;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
// ---- Colors & Border ----
|
|
67
|
-
|
|
68
|
-
const resolveColor = (path, fallback) => {
|
|
69
|
-
return getVariableByName(path, modes) || fallback;
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
// Background Color
|
|
73
|
-
let bgColorVar = `${prefix}/background/color`;
|
|
74
|
-
// Fix for disabledSelected weirdness if needed
|
|
75
|
-
if (visualState === 'disabled' && selected) {
|
|
76
|
-
// Check specific path from dump: `radio/disabledSelected/background`
|
|
77
|
-
if (!getVariableByName(`${prefix}/background/color`, modes)) {
|
|
78
|
-
bgColorVar = `${prefix}/background`;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
// Border Color
|
|
83
|
-
let borderColorVar = `${prefix}/border/color`;
|
|
84
|
-
|
|
85
|
-
// Border Width
|
|
86
|
-
let borderWidthVar = `${prefix}/border/size`;
|
|
87
|
-
// Fix for huge path: `radio/disabled/radio/disabled/border/size`
|
|
88
|
-
if (visualState === 'disabled' && !selected) {
|
|
89
|
-
if (getVariableByName('radio/disabled/radio/disabled/border/size', modes)) {
|
|
90
|
-
borderWidthVar = 'radio/disabled/radio/disabled/border/size';
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
// Selector Color
|
|
95
|
-
let selectorBgVar = `${prefix}/selector/background/color`;
|
|
96
|
-
if (!selected) {
|
|
97
|
-
selectorBgVar = 'transparent';
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
// Shadows (Glow)
|
|
101
|
-
let shadowSizeVar = `${prefix}/boxShadow/size`;
|
|
102
|
-
let shadowColorVar = `${prefix}/shadow/color`;
|
|
103
|
-
|
|
104
|
-
// Resolve Values
|
|
105
|
-
const backgroundColor = resolveColor(bgColorVar, 'transparent');
|
|
106
|
-
const borderColor = resolveColor(borderColorVar, 'transparent');
|
|
107
|
-
const borderWidth = parseFloat(getVariableByName(borderWidthVar, modes)?.toString() || '1');
|
|
108
|
-
const selectorColor = resolveColor(selectorBgVar, 'transparent');
|
|
109
|
-
const shadowSize = parseFloat(getVariableByName(shadowSizeVar, modes)?.toString() || '0');
|
|
110
|
-
const shadowColor = resolveColor(shadowColorVar, 'transparent');
|
|
111
|
-
|
|
112
|
-
// Styles
|
|
113
|
-
const containerStyle = {
|
|
114
|
-
width,
|
|
115
|
-
height,
|
|
116
|
-
borderRadius: width / 2,
|
|
117
|
-
// 9999px -> circle
|
|
118
|
-
borderWidth,
|
|
119
|
-
borderColor,
|
|
120
|
-
backgroundColor,
|
|
121
|
-
justifyContent: 'center',
|
|
122
|
-
alignItems: 'center',
|
|
123
|
-
// Web shadow (ring)
|
|
124
|
-
...(Platform.OS === 'web' && shadowSize > 0 ? {
|
|
125
|
-
boxShadow: `0px 0px 0px ${shadowSize}px ${shadowColor}`
|
|
126
|
-
} : {})
|
|
127
|
-
};
|
|
128
|
-
const selectorStyle = {
|
|
129
|
-
width: selectorSize,
|
|
130
|
-
height: selectorSize,
|
|
131
|
-
borderRadius: selectorSize / 2,
|
|
132
|
-
backgroundColor: selectorColor
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
// Dummy block for token extraction (static analysis)
|
|
136
|
-
if (false) {
|
|
137
|
-
getVariableByName('radio/idle/background/color');
|
|
138
|
-
getVariableByName('radio/idle/border/color');
|
|
139
|
-
getVariableByName('radio/selector/size');
|
|
140
|
-
getVariableByName('radio/width');
|
|
141
|
-
getVariableByName('radio/height');
|
|
142
|
-
getVariableByName('radio/background/color');
|
|
143
|
-
getVariableByName('radio/hover/background/color');
|
|
144
|
-
getVariableByName('radio/hover/border/color');
|
|
145
|
-
getVariableByName('radio/hover/boxShadow/size');
|
|
146
|
-
getVariableByName('radio/hover/shadow/color');
|
|
147
|
-
getVariableByName('radio/selected/background/color');
|
|
148
|
-
getVariableByName('radio/selected/border/color');
|
|
149
|
-
getVariableByName('radio/selected/selector/background/color');
|
|
150
|
-
getVariableByName('radio/hoverSelected/background/color');
|
|
151
|
-
getVariableByName('radio/hoverSelected/border/color');
|
|
152
|
-
getVariableByName('radio/hoverSelected/boxShadow/size');
|
|
153
|
-
getVariableByName('radio/hoverSelected/shadow/color');
|
|
154
|
-
getVariableByName('radio/hoverSelected/selector/background/color');
|
|
155
|
-
getVariableByName('radio/focus/background/color');
|
|
156
|
-
getVariableByName('radio/focus/border/color');
|
|
157
|
-
getVariableByName('radio/focus/border/size');
|
|
158
|
-
getVariableByName('radio/focus/boxShadow/size');
|
|
159
|
-
getVariableByName('radio/focus/shadow/color');
|
|
160
|
-
getVariableByName('radio/focusSelected/background/color');
|
|
161
|
-
getVariableByName('radio/focusSelected/selector/background/color');
|
|
162
|
-
getVariableByName('radio/focusSelected/border/size');
|
|
163
|
-
getVariableByName('radio/disabled/radio/disabled/border/size');
|
|
164
|
-
getVariableByName('radio/disabled/background/color');
|
|
165
|
-
getVariableByName('radio/disabled/border/color');
|
|
166
|
-
getVariableByName('radio/disabledSelected/selector/background/color');
|
|
167
|
-
getVariableByName('radio/disabledSelected/background');
|
|
168
|
-
getVariableByName('radio/disabledSelected/border/color');
|
|
169
|
-
}
|
|
170
|
-
return /*#__PURE__*/_jsx(Pressable, {
|
|
171
|
-
testID: testID,
|
|
172
|
-
disabled: disabled,
|
|
173
|
-
onPress: onPress,
|
|
174
|
-
onHoverIn: () => setHovered(true),
|
|
175
|
-
onHoverOut: () => setHovered(false),
|
|
176
|
-
onFocus: () => setFocused(true),
|
|
177
|
-
onBlur: () => setFocused(false),
|
|
178
|
-
onPressIn: () => setPressed(true),
|
|
179
|
-
onPressOut: () => setPressed(false),
|
|
180
|
-
style: ({
|
|
181
|
-
pressed: isPressed
|
|
182
|
-
}) => [containerStyle, style],
|
|
183
|
-
children: /*#__PURE__*/_jsx(View, {
|
|
184
|
-
style: selectorStyle
|
|
185
|
-
})
|
|
186
|
-
});
|
|
187
|
-
}
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated `RadioButton` has been renamed to `Radio`.
|
|
5
|
+
*
|
|
6
|
+
* This file is kept as a backward-compatibility shim for teams that may be
|
|
7
|
+
* importing `RadioButton` directly from this deep path:
|
|
8
|
+
*
|
|
9
|
+
* import RadioButton from 'jfs-components/src/components/RadioButton/RadioButton'
|
|
10
|
+
* import { RadioButton, RadioButtonProps } from '...'
|
|
11
|
+
*
|
|
12
|
+
* The recommended public import is now:
|
|
13
|
+
*
|
|
14
|
+
* import { Radio, type RadioProps } from 'jfs-components'
|
|
15
|
+
*
|
|
16
|
+
* Going forward, this component is called `Radio`. This shim only re-exports
|
|
17
|
+
* the new `Radio` component under the old `RadioButton` names; please migrate
|
|
18
|
+
* existing usages to `Radio` at your earliest convenience.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
import { Radio } from '../Radio/Radio';
|
|
22
|
+
export const RadioButton = Radio;
|
|
188
23
|
export default RadioButton;
|
|
@@ -13,6 +13,7 @@ export { default as CardAdvisory } from './CardAdvisory/CardAdvisory';
|
|
|
13
13
|
export { default as Carousel } from './Carousel/Carousel';
|
|
14
14
|
export { default as Checkbox } from './Checkbox/Checkbox';
|
|
15
15
|
export { default as CardFeedback } from './CardFeedback/CardFeedback';
|
|
16
|
+
export { default as CardFinancialCondition } from './CardFinancialCondition/CardFinancialCondition';
|
|
16
17
|
export { default as Disclaimer } from './Disclaimer/Disclaimer';
|
|
17
18
|
export { default as Divider } from './Divider/Divider';
|
|
18
19
|
export { default as Drawer } from './Drawer/Drawer';
|
|
@@ -66,8 +67,14 @@ export { default as ButtonGroup } from './ButtonGroup/ButtonGroup';
|
|
|
66
67
|
export { default as CardProviderInfo } from './CardProviderInfo/CardProviderInfo';
|
|
67
68
|
export { default as ChipSelect } from './ChipSelect/ChipSelect';
|
|
68
69
|
export { default as InputSearch } from './InputSearch/InputSearch';
|
|
70
|
+
export { default as InstitutionBadge } from './InstitutionBadge/InstitutionBadge';
|
|
69
71
|
export { default as SupportText } from './SupportText/SupportText';
|
|
70
72
|
export { default as SupportTextIcon } from './SupportText/SupportTextIcon';
|
|
73
|
+
export { default as Radio } from './Radio/Radio';
|
|
74
|
+
/**
|
|
75
|
+
* @deprecated Use `Radio` instead. `RadioButton` is kept as an alias for
|
|
76
|
+
* backward compatibility and will be removed in a future major release.
|
|
77
|
+
*/
|
|
71
78
|
export { default as RadioButton } from './RadioButton/RadioButton';
|
|
72
79
|
export { default as RechargeCard } from './RechargeCard/RechargeCard';
|
|
73
80
|
export { default as Tabs } from './Tabs/Tabs';
|