jfs-components 0.0.59 → 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-14T20:02:24.340Z
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.59",
3
+ "version": "0.0.60",
4
4
  "description": "React Native Jio Finance Components Library",
5
5
  "author": "sunshuaiqi@gmail.com",
6
6
  "license": "MIT",
@@ -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
@@ -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-14T20:02:24.340Z
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(