jfs-components 0.0.51 → 0.0.52
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/ListItem/ListItem.js +26 -21
- package/lib/commonjs/components/Section/Section.js +1 -1
- package/lib/commonjs/design-tokens/Coin Variables-variables-full.json +1 -1
- package/lib/commonjs/icons/registry.js +1 -1
- package/lib/module/components/ListItem/ListItem.js +26 -21
- package/lib/module/components/Section/Section.js +1 -1
- package/lib/module/design-tokens/Coin Variables-variables-full.json +1 -1
- package/lib/module/icons/registry.js +1 -1
- package/lib/typescript/src/icons/registry.d.ts +1 -1
- package/package.json +1 -1
- package/src/components/ListItem/ListItem.tsx +23 -21
- package/src/components/Section/Section.tsx +1 -1
- package/src/design-tokens/Coin Variables-variables-full.json +1 -1
- package/src/icons/registry.ts +1 -1
|
@@ -67,28 +67,33 @@ function ListItem({
|
|
|
67
67
|
webAccessibilityProps,
|
|
68
68
|
...rest
|
|
69
69
|
}) {
|
|
70
|
+
const resolvedModes = {
|
|
71
|
+
...modes,
|
|
72
|
+
"Context": "ListItem"
|
|
73
|
+
};
|
|
74
|
+
|
|
70
75
|
// Resolve container spacing tokens
|
|
71
|
-
const gap = getVariableByName('listItem/gap',
|
|
72
|
-
const paddingTop = getVariableByName('listItem/padding/top',
|
|
73
|
-
const paddingBottom = getVariableByName('listItem/padding/bottom',
|
|
74
|
-
const paddingLeft = getVariableByName('listItem/padding/left',
|
|
75
|
-
const paddingRight = getVariableByName('listItem/padding/right',
|
|
76
|
-
const textWrapGap = getVariableByName('listItem/text wrap',
|
|
76
|
+
const gap = getVariableByName('listItem/gap', resolvedModes) ?? 8;
|
|
77
|
+
const paddingTop = getVariableByName('listItem/padding/top', resolvedModes) ?? 0;
|
|
78
|
+
const paddingBottom = getVariableByName('listItem/padding/bottom', resolvedModes) ?? 0;
|
|
79
|
+
const paddingLeft = getVariableByName('listItem/padding/left', resolvedModes) ?? 0;
|
|
80
|
+
const paddingRight = getVariableByName('listItem/padding/right', resolvedModes) ?? 0;
|
|
81
|
+
const textWrapGap = getVariableByName('listItem/text wrap', resolvedModes) ?? 0;
|
|
77
82
|
|
|
78
83
|
// Title typography (horizontal layout)
|
|
79
|
-
const titleColor = getVariableByName('listItem/title/color',
|
|
80
|
-
const titleFontSize = getVariableByName('listItem/title/fontSize',
|
|
81
|
-
const titleLineHeight = getVariableByName('listItem/title/lineHeight',
|
|
82
|
-
const titleFontFamily = getVariableByName('listItem/title/fontFamily',
|
|
83
|
-
const titleFontWeightRaw = getVariableByName('listItem/title/fontWeight',
|
|
84
|
+
const titleColor = getVariableByName('listItem/title/color', resolvedModes) || '#0f0d0a';
|
|
85
|
+
const titleFontSize = getVariableByName('listItem/title/fontSize', resolvedModes) || 14;
|
|
86
|
+
const titleLineHeight = getVariableByName('listItem/title/lineHeight', resolvedModes) || 16;
|
|
87
|
+
const titleFontFamily = getVariableByName('listItem/title/fontFamily', resolvedModes) || 'System';
|
|
88
|
+
const titleFontWeightRaw = getVariableByName('listItem/title/fontWeight', resolvedModes) || 700;
|
|
84
89
|
const titleFontWeight = typeof titleFontWeightRaw === 'number' ? titleFontWeightRaw.toString() : titleFontWeightRaw;
|
|
85
90
|
|
|
86
91
|
// Support text typography (used in both layouts)
|
|
87
|
-
const supportColor = getVariableByName('listItem/supportText/color',
|
|
88
|
-
const supportFontSize = getVariableByName('listItem/supportText/fontSize',
|
|
89
|
-
const supportLineHeight = getVariableByName('listItem/supportText/lineHeight',
|
|
90
|
-
const supportFontFamily = getVariableByName('listItem/supportText/fontFamily',
|
|
91
|
-
const supportFontWeightRaw = getVariableByName('listItem/supportText/fontWeight',
|
|
92
|
+
const supportColor = getVariableByName('listItem/supportText/color', resolvedModes) || '#1f1a14';
|
|
93
|
+
const supportFontSize = getVariableByName('listItem/supportText/fontSize', resolvedModes) || 12;
|
|
94
|
+
const supportLineHeight = getVariableByName('listItem/supportText/lineHeight', resolvedModes) || 14;
|
|
95
|
+
const supportFontFamily = getVariableByName('listItem/supportText/fontFamily', resolvedModes) || 'System';
|
|
96
|
+
const supportFontWeightRaw = getVariableByName('listItem/supportText/fontWeight', resolvedModes) || 500;
|
|
92
97
|
const supportFontWeight = typeof supportFontWeightRaw === 'number' ? supportFontWeightRaw.toString() : supportFontWeightRaw;
|
|
93
98
|
const baseContainerStyle = {
|
|
94
99
|
paddingTop,
|
|
@@ -153,16 +158,16 @@ function ListItem({
|
|
|
153
158
|
});
|
|
154
159
|
|
|
155
160
|
// Process leading slot to pass modes to children
|
|
156
|
-
const processedLeading = leading ? cloneChildrenWithModes(React.Children.toArray(leading),
|
|
161
|
+
const processedLeading = leading ? cloneChildrenWithModes(React.Children.toArray(leading), resolvedModes) : [];
|
|
157
162
|
// Extract single element if array has one element, otherwise use array
|
|
158
163
|
const leadingElement = processedLeading.length > 0 ? processedLeading.length === 1 ? processedLeading[0] : processedLeading : /*#__PURE__*/_jsx(IconCapsule, {
|
|
159
|
-
modes:
|
|
164
|
+
modes: resolvedModes,
|
|
160
165
|
accessibilityLabel: undefined
|
|
161
166
|
});
|
|
162
167
|
const renderSupportContent = () => {
|
|
163
168
|
if (supportSlot) {
|
|
164
169
|
// Process supportSlot to pass modes to children
|
|
165
|
-
const processedSupportSlot = cloneChildrenWithModes(React.Children.toArray(supportSlot),
|
|
170
|
+
const processedSupportSlot = cloneChildrenWithModes(React.Children.toArray(supportSlot), resolvedModes);
|
|
166
171
|
// Extract single element if array has one element, otherwise use array
|
|
167
172
|
return processedSupportSlot.length === 1 ? processedSupportSlot[0] : processedSupportSlot;
|
|
168
173
|
}
|
|
@@ -182,7 +187,7 @@ function ListItem({
|
|
|
182
187
|
if (layout === 'Horizontal') {
|
|
183
188
|
// Process endSlot to pass modes to children
|
|
184
189
|
// Force Context: 'ListItem' - this value can never be overridden by external modes
|
|
185
|
-
const processedEndSlot = endSlot ? cloneChildrenWithModes(React.Children.toArray(endSlot),
|
|
190
|
+
const processedEndSlot = endSlot ? cloneChildrenWithModes(React.Children.toArray(endSlot), resolvedModes, {
|
|
186
191
|
"Context": 'ListItem'
|
|
187
192
|
}) : [];
|
|
188
193
|
// Extract single element if array has one element, otherwise use array
|
|
@@ -205,7 +210,7 @@ function ListItem({
|
|
|
205
210
|
children: trailingContent
|
|
206
211
|
}) : null, navArrow && /*#__PURE__*/_jsx(NavArrow, {
|
|
207
212
|
direction: "Forward",
|
|
208
|
-
modes:
|
|
213
|
+
modes: resolvedModes
|
|
209
214
|
})]
|
|
210
215
|
});
|
|
211
216
|
if (onPress) {
|
|
@@ -60,7 +60,7 @@ function Section({
|
|
|
60
60
|
} : {};
|
|
61
61
|
// Resolve section container tokens
|
|
62
62
|
const backgroundColor = getVariableByName('section/background/color', modes) || '#ffffff';
|
|
63
|
-
const gap = getVariableByName('
|
|
63
|
+
const gap = getVariableByName('slot/gap', modes) || 12;
|
|
64
64
|
const paddingHorizontal = getVariableByName('section/padding/horizontal', modes) || 12;
|
|
65
65
|
const paddingVertical = getVariableByName('section/padding/vertical', modes) || 16;
|
|
66
66
|
const radius = getVariableByName('section/radius', modes) || 12;
|