aport-tools 4.4.2 → 4.4.4

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! aport-tools v4.4.2 | ISC */
1
+ /*! aport-tools v4.4.4 | ISC */
2
2
  'use strict';
3
3
 
4
4
  var React = require('react');
@@ -233,17 +233,50 @@ var Stepper = function Stepper(_a) {
233
233
  switch (stepType) {
234
234
  case "icon":
235
235
  if (Array.isArray(icon)) {
236
- return icon[index]; // Render individual icon for each step
236
+ var stepIcon = icon[index];
237
+ if (typeof stepIcon === "string") {
238
+ return /*#__PURE__*/React.createElement(reactNative.Image, {
239
+ source: {
240
+ uri: stepIcon
241
+ },
242
+ style: {
243
+ width: 24,
244
+ height: 24
245
+ },
246
+ resizeMode: "contain"
247
+ });
248
+ } else {
249
+ console.error("Invalid icon value for step ".concat(index, ". Expected a string URI."));
250
+ return null;
251
+ }
237
252
  }
238
- return icon;
239
- // Render the same icon for all steps
253
+ if (typeof icon === "string") {
254
+ return /*#__PURE__*/React.createElement(reactNative.Image, {
255
+ source: {
256
+ uri: icon
257
+ },
258
+ style: {
259
+ width: 24,
260
+ height: 24
261
+ },
262
+ resizeMode: "contain"
263
+ });
264
+ }
265
+ console.error("Icon prop must be a string or an array of strings.");
266
+ return null;
240
267
  case "empty":
241
268
  return null;
242
- // Render nothing inside the step circle
243
269
  case "number":
244
270
  default:
245
- return index + 1;
246
- // Default to rendering step numbers
271
+ return /*#__PURE__*/React.createElement(Text, {
272
+ b: true,
273
+ typeFont: "primary",
274
+ style: [currentStep >= index ? {
275
+ color: colors.textButton.hex
276
+ } : {
277
+ color: colors.text.hex
278
+ }]
279
+ }, index + 1);
247
280
  }
248
281
  };
249
282
  return /*#__PURE__*/React.createElement(reactNative.View, {
@@ -262,10 +295,8 @@ var Stepper = function Stepper(_a) {
262
295
  return _onPress && _onPress(index);
263
296
  }
264
297
  }, /*#__PURE__*/React.createElement(reactNative.View, {
265
- style: [styles$9.step, stepStyle === "square" && styles$9.squareStep, currentStep >= index && {
266
- backgroundColor: colors.primary.hex
267
- }, {
268
- backgroundColor: colors.body.hex
298
+ style: [styles$9.step, stepStyle === "square" && styles$9.squareStep, {
299
+ backgroundColor: currentStep >= index ? colors.primary.hex : colors.body.hex
269
300
  }]
270
301
  }, renderStepContent(index)), steps && /*#__PURE__*/React.createElement(Text, {
271
302
  style: styles$9.stepText
@@ -275,7 +306,8 @@ var Stepper = function Stepper(_a) {
275
306
  style: styles$9.separatorBackground
276
307
  }), /*#__PURE__*/React.createElement(reactNative.Animated.View, {
277
308
  style: [styles$9.separatorProgress, {
278
- width: getSeparatorWidth(index)
309
+ width: getSeparatorWidth(index),
310
+ backgroundColor: colors.primary.hex
279
311
  }]
280
312
  }))));
281
313
  }));
@@ -328,7 +360,6 @@ var styles$9 = reactNative.StyleSheet.create({
328
360
  separatorProgress: {
329
361
  position: "absolute",
330
362
  height: "100%",
331
- backgroundColor: "#3498db",
332
363
  borderRadius: 2
333
364
  }
334
365
  });
@@ -388,7 +419,7 @@ var Form = function Form(_a) {
388
419
  }
389
420
  }, stepper && (/*#__PURE__*/React.createElement(Stepper, {
390
421
  steps: stepper.steps,
391
- currentStep: stepper.step,
422
+ currentStep: stepper.currentStep,
392
423
  presseable: stepper.presseable,
393
424
  onPress: stepper.onPress,
394
425
  totalSteps: stepper.totalSteps,