@salemcobalt/ui 0.2.0-rc.13 → 0.2.0-rc.14
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.js +6 -5
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -3157,7 +3157,6 @@ import {
|
|
|
3157
3157
|
useCallback as useCallback2,
|
|
3158
3158
|
useContext as useContext2,
|
|
3159
3159
|
useEffect as useEffect6,
|
|
3160
|
-
useEffectEvent,
|
|
3161
3160
|
useId as useId5,
|
|
3162
3161
|
useMemo as useMemo3,
|
|
3163
3162
|
useRef as useRef6,
|
|
@@ -3439,12 +3438,14 @@ function Step({
|
|
|
3439
3438
|
const phase = useContext2(FrameContext);
|
|
3440
3439
|
const { announce } = useContext2(FlowContext);
|
|
3441
3440
|
const message = announcement ?? (typeof title === "string" ? title : void 0);
|
|
3442
|
-
const
|
|
3443
|
-
|
|
3444
|
-
|
|
3441
|
+
const latest = useRef6({ message, announce });
|
|
3442
|
+
useEffect6(() => {
|
|
3443
|
+
latest.current = { message, announce };
|
|
3445
3444
|
});
|
|
3446
3445
|
useEffect6(() => {
|
|
3447
|
-
if (phase
|
|
3446
|
+
if (phase !== "enter") return;
|
|
3447
|
+
titleRef.current?.focus({ preventScroll: true });
|
|
3448
|
+
if (latest.current.message) latest.current.announce(latest.current.message);
|
|
3448
3449
|
}, [phase]);
|
|
3449
3450
|
return /* @__PURE__ */ jsxs29("section", { className: cx("sc-flow__step", className), "aria-labelledby": id, ...rest, children: [
|
|
3450
3451
|
/* @__PURE__ */ jsxs29("div", { className: "sc-flow__step-head", children: [
|