@lime-bundles/react 7.2.0 → 7.3.0

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/dist/index.cjs CHANGED
@@ -3145,6 +3145,17 @@ function MultiStepPicker({
3145
3145
  }
3146
3146
  return front.concat(back);
3147
3147
  }, [eligible, selectedAtLoad]);
3148
+ const autoAdvance = wc.multiStepAutoAdvance === true;
3149
+ const lastSeen = (0, import_react15.useRef)({ step: stepIndex, units: unitsInStep });
3150
+ (0, import_react15.useEffect)(() => {
3151
+ const prev = lastSeen.current;
3152
+ lastSeen.current = { step: stepIndex, units: unitsInStep };
3153
+ if (!autoAdvance || isLastStep || prev.step !== stepIndex) return;
3154
+ if (unitsInStep <= prev.units) return;
3155
+ if ((0, import_core13.stepHeadroom)(step?.maxQuantity ?? null, unitsInStep) === 0) {
3156
+ goToStep(stepIndex + 1);
3157
+ }
3158
+ });
3148
3159
  function goToStep(i) {
3149
3160
  const clamped = Math.max(0, Math.min(steps.length - 1, i));
3150
3161
  setStepIndex(clamped);