@openzeppelin/ui-components 2.3.0 → 2.3.1

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
@@ -38,7 +38,7 @@ let sonner = require("sonner");
38
38
  let next_themes = require("next-themes");
39
39
 
40
40
  //#region src/version.ts
41
- const VERSION = "2.3.0";
41
+ const VERSION = "2.3.1";
42
42
 
43
43
  //#endregion
44
44
  //#region src/components/ui/accordion.tsx
@@ -2318,6 +2318,12 @@ function isScrollableNavigationKey(event) {
2318
2318
  function PagedLayout({ steps, currentStepIndex, furthestStepIndex: furthestStepIndexProp, onStepChange, onComplete, onLastStepPrimary, onCancel, nextLabel, lastStepLabel, onLastStepSecondary, lastStepSecondaryLabel, lastStepSecondaryDisabled, hideLastStepPrimary, navActions, header, variant, className }) {
2319
2319
  const safeIndex = getSafeStepIndex(steps.length, currentStepIndex);
2320
2320
  const resolvedFurthestStepIndex = useFurthestStepIndex(safeIndex, furthestStepIndexProp);
2321
+ const stepBodyScrollRef = (0, react.useRef)(null);
2322
+ (0, react.useLayoutEffect)(() => {
2323
+ const el = stepBodyScrollRef.current;
2324
+ if (!el) return;
2325
+ el.scrollTop = 0;
2326
+ }, [safeIndex]);
2321
2327
  if (steps.length === 0) return null;
2322
2328
  const isFirstStep = safeIndex === 0;
2323
2329
  const isLastStep = safeIndex === steps.length - 1;
@@ -2371,6 +2377,7 @@ function PagedLayout({ steps, currentStepIndex, furthestStepIndex: furthestStepI
2371
2377
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
2372
2378
  className: "flex min-w-0 flex-1 flex-col overflow-hidden",
2373
2379
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
2380
+ ref: stepBodyScrollRef,
2374
2381
  className: "flex-1 overflow-y-auto p-8",
2375
2382
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
2376
2383
  className: "mx-auto max-w-5xl",
@@ -2393,6 +2400,7 @@ function PagedLayout({ steps, currentStepIndex, furthestStepIndex: furthestStepI
2393
2400
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
2394
2401
  className: "flex min-w-0 flex-1 flex-col overflow-hidden",
2395
2402
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
2403
+ ref: stepBodyScrollRef,
2396
2404
  className: "flex-1 overflow-y-auto p-8",
2397
2405
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
2398
2406
  className: "mx-auto max-w-5xl",