aport-tools 4.4.2 → 4.4.3

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.esm.js CHANGED
@@ -1,6 +1,6 @@
1
- /*! aport-tools v4.4.2 | ISC */
1
+ /*! aport-tools v4.4.3 | ISC */
2
2
  import React, { useContext, useState, createContext, useCallback, useMemo } from 'react';
3
- import { StyleSheet, Text as Text$1, Animated, View, TouchableOpacity, TextInput, Modal, Pressable, FlatList, Keyboard, Platform, Image, Alert, ActivityIndicator } from 'react-native';
3
+ import { StyleSheet, Text as Text$1, Animated, View, TouchableOpacity, Image, TextInput, Modal, Pressable, FlatList, Keyboard, Platform, Alert, ActivityIndicator } from 'react-native';
4
4
  import { ThemeContext } from 'aport-themes';
5
5
  import * as ImagePicker from 'expo-image-picker';
6
6
 
@@ -212,17 +212,47 @@ var Stepper = function Stepper(_a) {
212
212
  switch (stepType) {
213
213
  case "icon":
214
214
  if (Array.isArray(icon)) {
215
- return icon[index]; // Render individual icon for each step
215
+ var stepIcon = icon[index];
216
+ if (typeof stepIcon === "string") {
217
+ return /*#__PURE__*/React.createElement(Image, {
218
+ source: {
219
+ uri: stepIcon
220
+ },
221
+ style: {
222
+ width: 24,
223
+ height: 24
224
+ },
225
+ resizeMode: "contain"
226
+ });
227
+ } else {
228
+ console.error("Invalid icon value for step ".concat(index, ". Expected a string URI."));
229
+ return null;
230
+ }
216
231
  }
217
- return icon;
218
- // Render the same icon for all steps
232
+ if (typeof icon === "string") {
233
+ return /*#__PURE__*/React.createElement(Image, {
234
+ source: {
235
+ uri: icon
236
+ },
237
+ style: {
238
+ width: 24,
239
+ height: 24
240
+ },
241
+ resizeMode: "contain"
242
+ });
243
+ }
244
+ console.error("Icon prop must be a string or an array of strings.");
245
+ return null;
219
246
  case "empty":
220
247
  return null;
221
- // Render nothing inside the step circle
222
248
  case "number":
223
249
  default:
224
- return index + 1;
225
- // Default to rendering step numbers
250
+ return /*#__PURE__*/React.createElement(Text, {
251
+ style: {
252
+ fontSize: 16,
253
+ fontWeight: "bold"
254
+ }
255
+ }, index + 1);
226
256
  }
227
257
  };
228
258
  return /*#__PURE__*/React.createElement(View, {
@@ -254,7 +284,8 @@ var Stepper = function Stepper(_a) {
254
284
  style: styles$9.separatorBackground
255
285
  }), /*#__PURE__*/React.createElement(Animated.View, {
256
286
  style: [styles$9.separatorProgress, {
257
- width: getSeparatorWidth(index)
287
+ width: getSeparatorWidth(index),
288
+ backgroundColor: colors.primary.hex
258
289
  }]
259
290
  }))));
260
291
  }));
@@ -307,7 +338,6 @@ var styles$9 = StyleSheet.create({
307
338
  separatorProgress: {
308
339
  position: "absolute",
309
340
  height: "100%",
310
- backgroundColor: "#3498db",
311
341
  borderRadius: 2
312
342
  }
313
343
  });