react-asc 25.2.2 → 25.2.4

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/index.es.js CHANGED
@@ -2361,6 +2361,13 @@ const Stepper = (props) => {
2361
2361
  setSteps(React.Children.toArray(children));
2362
2362
  }
2363
2363
  }, [children]);
2364
+ const prevActiveIndexRef = useRef(activeIndex);
2365
+ useEffect(() => {
2366
+ if (activeIndex !== prevActiveIndexRef.current) {
2367
+ prevActiveIndexRef.current = activeIndex;
2368
+ onChange && onChange(activeIndex);
2369
+ }
2370
+ }, [activeIndex]);
2364
2371
  useEffect(() => {
2365
2372
  if (value !== undefined) {
2366
2373
  setActiveIndex(value);
@@ -2370,10 +2377,7 @@ const Stepper = (props) => {
2370
2377
  return skipped.has(step);
2371
2378
  };
2372
2379
  const handleClickStep = (index) => {
2373
- setActiveIndex(() => {
2374
- onChange && onChange(index);
2375
- return index;
2376
- });
2380
+ setActiveIndex(index);
2377
2381
  };
2378
2382
  const renderSteps = (child, index) => {
2379
2383
  return (React.createElement(React.Fragment, null, React.isValidElement(child) &&
@@ -2391,11 +2395,7 @@ const Stepper = (props) => {
2391
2395
  return steps && steps[index].props.isOptional;
2392
2396
  };
2393
2397
  const handleBack = () => {
2394
- setActiveIndex((prevActiveStep) => {
2395
- const newIndex = prevActiveStep - 1;
2396
- onChange && onChange(newIndex);
2397
- return newIndex;
2398
- });
2398
+ setActiveIndex((prevActiveStep) => prevActiveStep - 1);
2399
2399
  };
2400
2400
  // TODO
2401
2401
  const handleSkip = () => {
@@ -2417,11 +2417,7 @@ const Stepper = (props) => {
2417
2417
  newSkipped = new Set(newSkipped.values());
2418
2418
  newSkipped.delete(activeIndex);
2419
2419
  }
2420
- setActiveIndex((prevActiveStep) => {
2421
- const newIndex = prevActiveStep + 1;
2422
- onChange && onChange(newIndex);
2423
- return newIndex;
2424
- });
2420
+ setActiveIndex((prevActiveStep) => prevActiveStep + 1);
2425
2421
  setSkipped(newSkipped);
2426
2422
  }
2427
2423
  else {
package/index.js CHANGED
@@ -2370,6 +2370,13 @@ const Stepper = (props) => {
2370
2370
  setSteps(React__default["default"].Children.toArray(children));
2371
2371
  }
2372
2372
  }, [children]);
2373
+ const prevActiveIndexRef = React.useRef(activeIndex);
2374
+ React.useEffect(() => {
2375
+ if (activeIndex !== prevActiveIndexRef.current) {
2376
+ prevActiveIndexRef.current = activeIndex;
2377
+ onChange && onChange(activeIndex);
2378
+ }
2379
+ }, [activeIndex]);
2373
2380
  React.useEffect(() => {
2374
2381
  if (value !== undefined) {
2375
2382
  setActiveIndex(value);
@@ -2379,10 +2386,7 @@ const Stepper = (props) => {
2379
2386
  return skipped.has(step);
2380
2387
  };
2381
2388
  const handleClickStep = (index) => {
2382
- setActiveIndex(() => {
2383
- onChange && onChange(index);
2384
- return index;
2385
- });
2389
+ setActiveIndex(index);
2386
2390
  };
2387
2391
  const renderSteps = (child, index) => {
2388
2392
  return (React__default["default"].createElement(React__default["default"].Fragment, null, React__default["default"].isValidElement(child) &&
@@ -2400,11 +2404,7 @@ const Stepper = (props) => {
2400
2404
  return steps && steps[index].props.isOptional;
2401
2405
  };
2402
2406
  const handleBack = () => {
2403
- setActiveIndex((prevActiveStep) => {
2404
- const newIndex = prevActiveStep - 1;
2405
- onChange && onChange(newIndex);
2406
- return newIndex;
2407
- });
2407
+ setActiveIndex((prevActiveStep) => prevActiveStep - 1);
2408
2408
  };
2409
2409
  // TODO
2410
2410
  const handleSkip = () => {
@@ -2426,11 +2426,7 @@ const Stepper = (props) => {
2426
2426
  newSkipped = new Set(newSkipped.values());
2427
2427
  newSkipped.delete(activeIndex);
2428
2428
  }
2429
- setActiveIndex((prevActiveStep) => {
2430
- const newIndex = prevActiveStep + 1;
2431
- onChange && onChange(newIndex);
2432
- return newIndex;
2433
- });
2429
+ setActiveIndex((prevActiveStep) => prevActiveStep + 1);
2434
2430
  setSkipped(newSkipped);
2435
2431
  }
2436
2432
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-asc",
3
- "version": "25.2.2",
3
+ "version": "25.2.4",
4
4
  "description": "handcrafted react components",
5
5
  "main": "index.js",
6
6
  "module": "index.es.js",
package/react-asc.scss CHANGED
@@ -287,10 +287,18 @@
287
287
  text-align: center;
288
288
  }
289
289
 
290
+ .text-uppercase {
291
+ text-transform: uppercase;
292
+ }
293
+
290
294
  .rounded-pill {
291
295
  border-radius: 50rem !important;
292
296
  }
293
297
 
298
+ .fw-bold {
299
+ font-weight: 700!important;
300
+ }
301
+
294
302
  @media (max-width: 576px) {
295
303
  .flex-row {
296
304
  flex-direction: column !important;