jfs-components 0.0.47 → 0.0.48
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/lib/commonjs/components/Tabs/TabItem.js +9 -5
- package/lib/commonjs/components/Tabs/Tabs.js +3 -1
- package/lib/commonjs/components/Title/Title.js +32 -24
- package/lib/commonjs/icons/registry.js +1 -1
- package/lib/module/components/Tabs/TabItem.js +9 -5
- package/lib/module/components/Tabs/Tabs.js +3 -1
- package/lib/module/components/Title/Title.js +33 -25
- package/lib/module/icons/registry.js +1 -1
- package/lib/typescript/src/components/Title/Title.d.ts +5 -1
- package/lib/typescript/src/icons/registry.d.ts +1 -1
- package/package.json +1 -1
- package/src/components/Tabs/TabItem.tsx +10 -5
- package/src/components/Tabs/Tabs.tsx +2 -0
- package/src/components/Title/Title.tsx +46 -21
- package/src/icons/registry.ts +1 -1
|
@@ -31,8 +31,12 @@ function TabItem({
|
|
|
31
31
|
const fontFamily = (0, _figmaVariablesResolver.getVariableByName)('tabItem/label/fontFamily', modes) ?? 'JioType Var';
|
|
32
32
|
const fontSize = (0, _figmaVariablesResolver.getVariableByName)('tabItem/label/size', modes) ?? 14;
|
|
33
33
|
const lineHeight = (0, _figmaVariablesResolver.getVariableByName)('tabItem/label/lineHeight', modes) ?? 17;
|
|
34
|
+
const fontWeight = String((0, _figmaVariablesResolver.getVariableByName)('tabItem/label/fontWeight', modes) ?? 500);
|
|
34
35
|
const idleLabelColor = (0, _figmaVariablesResolver.getVariableByName)('tabItem/idle/label/color', modes) ?? '#303338';
|
|
35
|
-
const activeLabelColor = (0, _figmaVariablesResolver.getVariableByName)('tabItem/active/label/color', modes) ?? '#
|
|
36
|
+
const activeLabelColor = (0, _figmaVariablesResolver.getVariableByName)('tabItem/active/label/color', modes) ?? '#000000';
|
|
37
|
+
const indicatorBackground = (0, _figmaVariablesResolver.getVariableByName)('tabItem/indicator/background', modes) ?? '#CEA15A';
|
|
38
|
+
const indicatorHeight = (0, _figmaVariablesResolver.getVariableByName)('tabItem/indicator/height', modes) ?? 2;
|
|
39
|
+
const indicatorRadius = (0, _figmaVariablesResolver.getVariableByName)('tabItem/indicator/radius', modes) ?? 99;
|
|
36
40
|
const labelColor = active ? activeLabelColor : idleLabelColor;
|
|
37
41
|
const containerStyle = {
|
|
38
42
|
flexDirection: 'column',
|
|
@@ -45,16 +49,16 @@ function TabItem({
|
|
|
45
49
|
fontFamily,
|
|
46
50
|
fontSize,
|
|
47
51
|
lineHeight,
|
|
48
|
-
fontWeight
|
|
52
|
+
fontWeight
|
|
49
53
|
};
|
|
50
54
|
const indicatorStyle = {
|
|
51
55
|
position: 'absolute',
|
|
52
56
|
bottom: 0,
|
|
53
57
|
left: 0,
|
|
54
58
|
right: 0,
|
|
55
|
-
height:
|
|
56
|
-
backgroundColor:
|
|
57
|
-
borderRadius:
|
|
59
|
+
height: indicatorHeight,
|
|
60
|
+
backgroundColor: indicatorBackground,
|
|
61
|
+
borderRadius: indicatorRadius
|
|
58
62
|
};
|
|
59
63
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Pressable, {
|
|
60
64
|
style: ({
|
|
@@ -64,11 +64,13 @@ function Tabs({
|
|
|
64
64
|
});
|
|
65
65
|
const containerStyle = {
|
|
66
66
|
flexDirection: 'row',
|
|
67
|
+
alignItems: 'flex-start',
|
|
67
68
|
gap,
|
|
68
69
|
paddingTop,
|
|
69
70
|
paddingBottom,
|
|
70
71
|
paddingLeft,
|
|
71
|
-
paddingRight
|
|
72
|
+
paddingRight,
|
|
73
|
+
overflow: 'hidden'
|
|
72
74
|
};
|
|
73
75
|
if (scrollable) {
|
|
74
76
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ScrollView, {
|
|
@@ -10,31 +10,18 @@ var _figmaVariablesResolver = require("../../design-tokens/figma-variables-resol
|
|
|
10
10
|
var _JFSThemeProvider = require("../../design-tokens/JFSThemeProvider");
|
|
11
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
12
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
-
/**
|
|
14
|
-
* Title component that mirrors the Figma "Title" component.
|
|
15
|
-
*
|
|
16
|
-
* This component displays a title with design-token driven styling
|
|
17
|
-
* via `getVariableByName` and `modes`.
|
|
18
|
-
*
|
|
19
|
-
* @component
|
|
20
|
-
* @param {Object} props
|
|
21
|
-
* @param {string} [props.title='Page Title'] - Title text to display
|
|
22
|
-
* @param {Object} [props.modes={}] - Modes object passed to `getVariableByName` for all design tokens
|
|
23
|
-
* @param {Object} [props.style] - Optional container style overrides
|
|
24
|
-
* @param {Object} [props.textStyle] - Optional text style overrides
|
|
25
|
-
* @param {string} [props.accessibilityLabel] - Accessibility label for screen readers. If not provided, uses title
|
|
26
|
-
* @param {string} [props.accessibilityHint] - Additional accessibility hint for screen readers
|
|
27
|
-
*/
|
|
28
13
|
const TEXT_ALIGN_MAP = {
|
|
29
14
|
Left: 'left',
|
|
30
15
|
Center: 'center'
|
|
31
16
|
};
|
|
32
17
|
function Title({
|
|
33
|
-
title = '
|
|
18
|
+
title = 'Title',
|
|
19
|
+
subtitle,
|
|
34
20
|
textAlign = 'Left',
|
|
35
21
|
modes: propModes = {},
|
|
36
22
|
style,
|
|
37
23
|
textStyle,
|
|
24
|
+
subtitleStyle,
|
|
38
25
|
numberOfLines,
|
|
39
26
|
accessibilityLabel,
|
|
40
27
|
accessibilityHint,
|
|
@@ -49,21 +36,29 @@ function Title({
|
|
|
49
36
|
};
|
|
50
37
|
const paddingHorizontal = (0, _figmaVariablesResolver.getVariableByName)('title/padding/horizontal', modes) || 16;
|
|
51
38
|
const paddingVertical = (0, _figmaVariablesResolver.getVariableByName)('title/padding/vertical', modes) || 8;
|
|
39
|
+
const gap = (0, _figmaVariablesResolver.getVariableByName)('title/gap', modes) || 8;
|
|
52
40
|
const labelColor = (0, _figmaVariablesResolver.getVariableByName)('title/label/color', modes) || '#0d0d0f';
|
|
53
41
|
const fontSize = (0, _figmaVariablesResolver.getVariableByName)('title/fontSize', modes) || 26;
|
|
54
42
|
const lineHeight = (0, _figmaVariablesResolver.getVariableByName)('title/lineHeight', modes) || 26;
|
|
55
43
|
const fontFamily = (0, _figmaVariablesResolver.getVariableByName)('title/fontFamily', modes) || 'System';
|
|
56
|
-
const fontWeightRaw = (0, _figmaVariablesResolver.getVariableByName)('title/fontWeight', modes) ||
|
|
44
|
+
const fontWeightRaw = (0, _figmaVariablesResolver.getVariableByName)('title/fontWeight', modes) || 900;
|
|
57
45
|
const fontWeight = typeof fontWeightRaw === 'number' ? fontWeightRaw.toString() : fontWeightRaw;
|
|
46
|
+
const subtitleColor = (0, _figmaVariablesResolver.getVariableByName)('pageSubtitle/label/color', modes) || '#0d0d0f';
|
|
47
|
+
const subtitleFontSize = (0, _figmaVariablesResolver.getVariableByName)('pageSubtitle/fontSize', modes) || 14;
|
|
48
|
+
const subtitleLineHeight = (0, _figmaVariablesResolver.getVariableByName)('pageSubtitle/lineHeight', modes) || 18;
|
|
49
|
+
const subtitleFontFamily = (0, _figmaVariablesResolver.getVariableByName)('pageSubtitle/fontFamily', modes) || 'System';
|
|
50
|
+
const subtitleFontWeightRaw = (0, _figmaVariablesResolver.getVariableByName)('pageSubtitle/fontWeight', modes) || 500;
|
|
51
|
+
const subtitleFontWeight = typeof subtitleFontWeightRaw === 'number' ? subtitleFontWeightRaw.toString() : subtitleFontWeightRaw;
|
|
58
52
|
const containerStyle = {
|
|
59
53
|
flexDirection: 'column',
|
|
60
54
|
alignItems: textAlign === 'Center' ? 'center' : 'stretch',
|
|
61
55
|
justifyContent: 'center',
|
|
62
56
|
paddingHorizontal,
|
|
63
57
|
paddingVertical,
|
|
58
|
+
gap,
|
|
64
59
|
width: '100%'
|
|
65
60
|
};
|
|
66
|
-
const
|
|
61
|
+
const titleTextStyle = {
|
|
67
62
|
color: labelColor,
|
|
68
63
|
fontSize,
|
|
69
64
|
lineHeight,
|
|
@@ -72,20 +67,33 @@ function Title({
|
|
|
72
67
|
flexShrink: 1,
|
|
73
68
|
textAlign: TEXT_ALIGN_MAP[textAlign]
|
|
74
69
|
};
|
|
75
|
-
const
|
|
76
|
-
|
|
70
|
+
const subtitleTextStyle = {
|
|
71
|
+
color: subtitleColor,
|
|
72
|
+
fontSize: subtitleFontSize,
|
|
73
|
+
lineHeight: subtitleLineHeight,
|
|
74
|
+
fontFamily: subtitleFontFamily,
|
|
75
|
+
fontWeight: subtitleFontWeight,
|
|
76
|
+
flexShrink: 1,
|
|
77
|
+
textAlign: TEXT_ALIGN_MAP[textAlign]
|
|
78
|
+
};
|
|
79
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
77
80
|
style: [containerStyle, style],
|
|
78
81
|
accessibilityRole: "header",
|
|
79
|
-
accessibilityLabel:
|
|
82
|
+
accessibilityLabel: accessibilityLabel,
|
|
80
83
|
accessibilityHint: accessibilityHint,
|
|
81
84
|
...rest,
|
|
82
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
83
|
-
style: [
|
|
85
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
86
|
+
style: [titleTextStyle, textStyle],
|
|
84
87
|
numberOfLines: numberOfLines !== undefined ? numberOfLines : 1,
|
|
85
88
|
accessibilityElementsHidden: true,
|
|
86
89
|
importantForAccessibility: "no",
|
|
87
90
|
children: title
|
|
88
|
-
})
|
|
91
|
+
}), subtitle != null && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
92
|
+
style: [subtitleTextStyle, subtitleStyle],
|
|
93
|
+
accessibilityElementsHidden: true,
|
|
94
|
+
importantForAccessibility: "no",
|
|
95
|
+
children: subtitle
|
|
96
|
+
})]
|
|
89
97
|
});
|
|
90
98
|
}
|
|
91
99
|
var _default = exports.default = Title;
|