@noya-app/noya-designsystem 0.1.83 → 0.1.84
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/.turbo/turbo-build.log +4 -4
- package/CHANGELOG.md +6 -0
- package/dist/index.js +6 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/contexts/DialogContext.tsx +12 -5
- package/src/contexts/__tests__/DialogContext.test.tsx +142 -0
package/dist/index.mjs
CHANGED
|
@@ -22033,17 +22033,19 @@ var DialogProvider = function DialogProvider2({
|
|
|
22033
22033
|
const inputRef = useRef53(null);
|
|
22034
22034
|
const confirmButtonRef = useRef53(null);
|
|
22035
22035
|
const dialogRef = useRef53(null);
|
|
22036
|
+
const contentsType = contents?.type;
|
|
22037
|
+
const contentsInstance = contents?.resolve;
|
|
22036
22038
|
React160.useEffect(() => {
|
|
22037
|
-
if (!
|
|
22039
|
+
if (!contentsType || !contentsInstance) return;
|
|
22038
22040
|
requestAnimationFrame(() => {
|
|
22039
|
-
if (
|
|
22041
|
+
if (contentsType === "input") {
|
|
22040
22042
|
inputRef.current?.focus();
|
|
22041
22043
|
inputRef.current?.setSelectionRange(0, inputRef.current.value.length);
|
|
22042
|
-
} else if (
|
|
22044
|
+
} else if (contentsType === "confirmation") {
|
|
22043
22045
|
confirmButtonRef.current?.focus();
|
|
22044
22046
|
}
|
|
22045
22047
|
});
|
|
22046
|
-
}, [
|
|
22048
|
+
}, [contentsType, contentsInstance]);
|
|
22047
22049
|
const containsElement = useCallback41((element) => {
|
|
22048
22050
|
if (!dialogRef.current) return false;
|
|
22049
22051
|
return dialogRef.current.containsElement(element);
|