jfs-components 0.0.58 → 0.0.60

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.
@@ -37,7 +37,12 @@ export function cloneChildrenWithModes(children, modes, forcedModes) {
37
37
  ...modes,
38
38
  ...existingModes
39
39
  } : modes;
40
- const processedChildren = hasChildren ? cloneChildrenWithModes(childChildren, modes, forcedModes) : undefined;
40
+ let processedChildren;
41
+ if (hasChildren) {
42
+ const childArray = React.Children.toArray(childChildren);
43
+ const processed = cloneChildrenWithModes(childArray, modes, forcedModes);
44
+ processedChildren = processed.length === 1 ? processed[0] : processed;
45
+ }
41
46
  result.push(/*#__PURE__*/React.cloneElement(child, {
42
47
  ...child.props,
43
48
  modes: mergedModes
@@ -4,7 +4,7 @@
4
4
  * Auto-generated from SVG files in src/icons/
5
5
  * DO NOT EDIT MANUALLY - Run "npm run icons:generate" to regenerate
6
6
  *
7
- * Generated: 2026-04-14T19:47:53.357Z
7
+ * Generated: 2026-04-14T20:42:38.764Z
8
8
  */
9
9
  export declare const iconRegistry: Record<string, {
10
10
  path: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jfs-components",
3
- "version": "0.0.58",
3
+ "version": "0.0.60",
4
4
  "description": "React Native Jio Finance Components Library",
5
5
  "author": "sunshuaiqi@gmail.com",
6
6
  "license": "MIT",
@@ -97,7 +97,7 @@ function Button({
97
97
  const lineHeight = getVariableByName('button/lineHeight', modes) || 19
98
98
  const fontSize = getVariableByName('button/fontSize', modes) || 16
99
99
  const textColor = getVariableByName('button/foreground', modes) || '#0f0d0a'
100
- const iconColor = getVariableByName('button/icon/color', modes) ?? textColor
100
+ const iconColor = textColor
101
101
  const iconSize = getVariableByName('button/icon/size', modes) ?? 18
102
102
 
103
103
  const [isHovered, setIsHovered] = useState(false)
@@ -107,13 +107,13 @@ function Button({
107
107
  const hoverBg = getVariableByName('button/background', hoverModes) || backgroundColor
108
108
  const hoverBorderColor = getVariableByName('button/border/color', hoverModes) || borderColor
109
109
  const hoverTextColor = getVariableByName('button/foreground', hoverModes) || textColor
110
- const hoverIconColor = getVariableByName('button/icon/color', hoverModes) ?? hoverTextColor
110
+ const hoverIconColor = hoverTextColor
111
111
 
112
112
  const pressedModes = { ...modes, "Button / State": "Pressed" }
113
113
  const pressedBg = getVariableByName('button/background', pressedModes) || backgroundColor
114
114
  const pressedBorderColor = getVariableByName('button/border/color', pressedModes) || borderColor
115
115
  const pressedTextColor = getVariableByName('button/foreground', pressedModes) || textColor
116
- const pressedIconColor = getVariableByName('button/icon/color', pressedModes) ?? pressedTextColor
116
+ const pressedIconColor = pressedTextColor
117
117
 
118
118
  const activeTextColor = isPressed && !disabled ? pressedTextColor : isHovered && !disabled ? hoverTextColor : textColor
119
119
  const activeIconColor = isPressed && !disabled ? pressedIconColor : isHovered && !disabled ? hoverIconColor : iconColor
@@ -48,7 +48,7 @@ function ButtonGroup({
48
48
  style,
49
49
  }: ButtonGroupProps) {
50
50
  // Resolve design tokens
51
- const gap = getVariableByName('buttonGroup/padding/gap', modes) ?? 12
51
+ const gap = getVariableByName('buttonGroup/gap', modes) ?? 12
52
52
  const paddingHorizontal = getVariableByName('buttonGroup/padding/horizontal', modes) ?? 0
53
53
  const paddingVertical = getVariableByName('buttonGroup/padding/vertical', modes) ?? 0
54
54
 
@@ -276,7 +276,7 @@ function Drawer({
276
276
 
277
277
  // Design Tokens
278
278
  const backgroundColor = getVariableByName('drawer/background', modes) || '#f5f5f5'
279
- const radius = getVariableByName('drawer/radius', modes) || 12
279
+ const radius = getVariableByName('drawer/radius/top', modes) || 12
280
280
 
281
281
  // Handle
282
282
  const handleColor = getVariableByName('drawer/handlebar/background', modes) || '#e0e0e3'
@@ -19,14 +19,22 @@ type SlotGridProps = {
19
19
 
20
20
  function SlotGrid({ items, gap, maxColumns = SLOT_GRID_MAX_COLUMNS }: SlotGridProps) {
21
21
  const [maxItemWidth, setMaxItemWidth] = useState<number | null>(null)
22
+ const [measureTimedOut, setMeasureTimedOut] = useState(false)
22
23
  const itemWidthsRef = useRef<Map<number, number>>(new Map())
23
24
  const totalItems = items.length
24
25
 
25
26
  useEffect(() => {
26
27
  itemWidthsRef.current.clear()
27
28
  setMaxItemWidth(null)
29
+ setMeasureTimedOut(false)
28
30
  }, [totalItems])
29
31
 
32
+ useEffect(() => {
33
+ if (maxItemWidth !== null) return
34
+ const timer = setTimeout(() => setMeasureTimedOut(true), 500)
35
+ return () => clearTimeout(timer)
36
+ }, [maxItemWidth, totalItems])
37
+
30
38
  const handleItemLayout = useCallback((index: number, width: number) => {
31
39
  itemWidthsRef.current.set(index, width)
32
40
  if (itemWidthsRef.current.size >= totalItems && totalItems > 0) {
@@ -43,7 +51,7 @@ function SlotGrid({ items, gap, maxColumns = SLOT_GRID_MAX_COLUMNS }: SlotGridPr
43
51
  }
44
52
 
45
53
  return (
46
- <View style={{ gap, ...(isMeasured ? {} : { opacity: 0 }) }}>
54
+ <View style={{ gap, ...(isMeasured || measureTimedOut ? {} : { opacity: 0 }) }}>
47
55
  {rows.map((row, rowIndex) => {
48
56
  const spacersNeeded = row.length < columns ? columns - row.length : 0
49
57
  return (
@@ -4,7 +4,7 @@
4
4
  * Auto-generated from SVG files in src/icons/
5
5
  * DO NOT EDIT MANUALLY - Run "npm run icons:generate" to regenerate
6
6
  *
7
- * Generated: 2026-04-14T19:47:53.357Z
7
+ * Generated: 2026-04-14T20:42:38.764Z
8
8
  */
9
9
 
10
10
  // Icon name to SVG data mapping
@@ -39,9 +39,12 @@ export function cloneChildrenWithModes(
39
39
  ? { ...modes, ...existingModes }
40
40
  : modes
41
41
 
42
- const processedChildren: React.ReactNode | undefined = hasChildren
43
- ? cloneChildrenWithModes(childChildren, modes, forcedModes)
44
- : undefined
42
+ let processedChildren: React.ReactNode | React.ReactNode[] | undefined
43
+ if (hasChildren) {
44
+ const childArray = React.Children.toArray(childChildren)
45
+ const processed = cloneChildrenWithModes(childArray, modes, forcedModes)
46
+ processedChildren = processed.length === 1 ? processed[0] : processed
47
+ }
45
48
 
46
49
  result.push(
47
50
  React.cloneElement(