From 60653dd37e579e58aed1964e3453a4187f9d4730 Mon Sep 17 00:00:00 2001 From: LoayTarek5 Date: Fri, 11 Oct 2024 15:22:32 +0300 Subject: [PATCH 1/7] docs: convert useListenFocusTriggers stories file to TS --- .../useListenFocusTriggers.stories.ts | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 packages/core/src/hooks/useListenFocusTriggers/__stories__/useListenFocusTriggers.stories.ts diff --git a/packages/core/src/hooks/useListenFocusTriggers/__stories__/useListenFocusTriggers.stories.ts b/packages/core/src/hooks/useListenFocusTriggers/__stories__/useListenFocusTriggers.stories.ts new file mode 100644 index 0000000000..0b19bb4aa1 --- /dev/null +++ b/packages/core/src/hooks/useListenFocusTriggers/__stories__/useListenFocusTriggers.stories.ts @@ -0,0 +1,40 @@ +import React, { useCallback, useRef, useState } from "react"; +import useListenFocusTriggers from "../index"; +import { Button, Flex } from "../../../components"; +import "../../__stories__/general-hooks-stories.scss"; + +export default { + title: "Hooks/useListenFocusTriggers" +}; + +interface RenderProps {} + +export const Overview = { + render: () => { + const [text, setText] = useState("-"); + const ref = useRef(null); + + const onFocusByMouse = useCallback((_event: React.FocusEvent) => { + setText("mouse"); + }, []); + + const onFocusByKeyboard = useCallback((_event: React.FocusEvent) => { + setText("keyboard"); + }, []); + + useListenFocusTriggers({ + ref: ref, + onFocusByMouse: onFocusByMouse, + onFocusByKeyboard: onFocusByKeyboard + }); + + return ( + + +
Received focus by: {text}
+
+ ); + }, + + name: "Overview" +} as const; \ No newline at end of file From 4fe7e7e0921c28fa5b5f350aea3c5eaeb8f3aa70 Mon Sep 17 00:00:00 2001 From: LoayTarek5 Date: Fri, 11 Oct 2024 21:39:21 +0300 Subject: [PATCH 2/7] docs: convert useListenFocusTriggers stories file to TS --- .../useListenFocusTriggers.stories.tsx | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 packages/core/src/hooks/useListenFocusTriggers/__stories__/useListenFocusTriggers.stories.tsx diff --git a/packages/core/src/hooks/useListenFocusTriggers/__stories__/useListenFocusTriggers.stories.tsx b/packages/core/src/hooks/useListenFocusTriggers/__stories__/useListenFocusTriggers.stories.tsx new file mode 100644 index 0000000000..0b19bb4aa1 --- /dev/null +++ b/packages/core/src/hooks/useListenFocusTriggers/__stories__/useListenFocusTriggers.stories.tsx @@ -0,0 +1,40 @@ +import React, { useCallback, useRef, useState } from "react"; +import useListenFocusTriggers from "../index"; +import { Button, Flex } from "../../../components"; +import "../../__stories__/general-hooks-stories.scss"; + +export default { + title: "Hooks/useListenFocusTriggers" +}; + +interface RenderProps {} + +export const Overview = { + render: () => { + const [text, setText] = useState("-"); + const ref = useRef(null); + + const onFocusByMouse = useCallback((_event: React.FocusEvent) => { + setText("mouse"); + }, []); + + const onFocusByKeyboard = useCallback((_event: React.FocusEvent) => { + setText("keyboard"); + }, []); + + useListenFocusTriggers({ + ref: ref, + onFocusByMouse: onFocusByMouse, + onFocusByKeyboard: onFocusByKeyboard + }); + + return ( + + +
Received focus by: {text}
+
+ ); + }, + + name: "Overview" +} as const; \ No newline at end of file From d4460bfa56a000eeaaf6b9b8f2fd55a67368001c Mon Sep 17 00:00:00 2001 From: LoayTarek5 <142718879+LoayTarek5@users.noreply.github.com> Date: Sun, 13 Oct 2024 19:15:32 +0300 Subject: [PATCH 3/7] Delete packages/core/src/hooks/useListenFocusTriggers/__stories__/useListenFocusTriggers.stories.ts delete the additional file --- .../useListenFocusTriggers.stories.ts | 40 ------------------- 1 file changed, 40 deletions(-) delete mode 100644 packages/core/src/hooks/useListenFocusTriggers/__stories__/useListenFocusTriggers.stories.ts diff --git a/packages/core/src/hooks/useListenFocusTriggers/__stories__/useListenFocusTriggers.stories.ts b/packages/core/src/hooks/useListenFocusTriggers/__stories__/useListenFocusTriggers.stories.ts deleted file mode 100644 index 0b19bb4aa1..0000000000 --- a/packages/core/src/hooks/useListenFocusTriggers/__stories__/useListenFocusTriggers.stories.ts +++ /dev/null @@ -1,40 +0,0 @@ -import React, { useCallback, useRef, useState } from "react"; -import useListenFocusTriggers from "../index"; -import { Button, Flex } from "../../../components"; -import "../../__stories__/general-hooks-stories.scss"; - -export default { - title: "Hooks/useListenFocusTriggers" -}; - -interface RenderProps {} - -export const Overview = { - render: () => { - const [text, setText] = useState("-"); - const ref = useRef(null); - - const onFocusByMouse = useCallback((_event: React.FocusEvent) => { - setText("mouse"); - }, []); - - const onFocusByKeyboard = useCallback((_event: React.FocusEvent) => { - setText("keyboard"); - }, []); - - useListenFocusTriggers({ - ref: ref, - onFocusByMouse: onFocusByMouse, - onFocusByKeyboard: onFocusByKeyboard - }); - - return ( - - -
Received focus by: {text}
-
- ); - }, - - name: "Overview" -} as const; \ No newline at end of file From 7783dfd5623cb52b69586a5cc1dfc024402e8ce8 Mon Sep 17 00:00:00 2001 From: LoayTarek5 Date: Sun, 13 Oct 2024 19:31:39 +0300 Subject: [PATCH 4/7] add useListenFocusTriggers.stories.js again --- .../useListenFocusTriggers.stories.js | 2 +- .../useListenFocusTriggers.stories.ts | 40 ------------------- 2 files changed, 1 insertion(+), 41 deletions(-) delete mode 100644 packages/core/src/hooks/useListenFocusTriggers/__stories__/useListenFocusTriggers.stories.ts diff --git a/packages/core/src/hooks/useListenFocusTriggers/__stories__/useListenFocusTriggers.stories.js b/packages/core/src/hooks/useListenFocusTriggers/__stories__/useListenFocusTriggers.stories.js index 55683f3d41..1f051da053 100644 --- a/packages/core/src/hooks/useListenFocusTriggers/__stories__/useListenFocusTriggers.stories.js +++ b/packages/core/src/hooks/useListenFocusTriggers/__stories__/useListenFocusTriggers.stories.js @@ -35,4 +35,4 @@ export const Overview = { }, name: "Overview" -}; +}; \ No newline at end of file diff --git a/packages/core/src/hooks/useListenFocusTriggers/__stories__/useListenFocusTriggers.stories.ts b/packages/core/src/hooks/useListenFocusTriggers/__stories__/useListenFocusTriggers.stories.ts deleted file mode 100644 index 0b19bb4aa1..0000000000 --- a/packages/core/src/hooks/useListenFocusTriggers/__stories__/useListenFocusTriggers.stories.ts +++ /dev/null @@ -1,40 +0,0 @@ -import React, { useCallback, useRef, useState } from "react"; -import useListenFocusTriggers from "../index"; -import { Button, Flex } from "../../../components"; -import "../../__stories__/general-hooks-stories.scss"; - -export default { - title: "Hooks/useListenFocusTriggers" -}; - -interface RenderProps {} - -export const Overview = { - render: () => { - const [text, setText] = useState("-"); - const ref = useRef(null); - - const onFocusByMouse = useCallback((_event: React.FocusEvent) => { - setText("mouse"); - }, []); - - const onFocusByKeyboard = useCallback((_event: React.FocusEvent) => { - setText("keyboard"); - }, []); - - useListenFocusTriggers({ - ref: ref, - onFocusByMouse: onFocusByMouse, - onFocusByKeyboard: onFocusByKeyboard - }); - - return ( - - -
Received focus by: {text}
-
- ); - }, - - name: "Overview" -} as const; \ No newline at end of file From bd4c04ab0068942baea036f1004ca43465a9aa34 Mon Sep 17 00:00:00 2001 From: LoayTarek5 <142718879+LoayTarek5@users.noreply.github.com> Date: Tue, 15 Oct 2024 19:08:04 +0300 Subject: [PATCH 5/7] Delete packages/core/src/hooks/useListenFocusTriggers/__stories__/useListenFocusTriggers.stories.js deletion the old file --- .../useListenFocusTriggers.stories.js | 38 ------------------- 1 file changed, 38 deletions(-) delete mode 100644 packages/core/src/hooks/useListenFocusTriggers/__stories__/useListenFocusTriggers.stories.js diff --git a/packages/core/src/hooks/useListenFocusTriggers/__stories__/useListenFocusTriggers.stories.js b/packages/core/src/hooks/useListenFocusTriggers/__stories__/useListenFocusTriggers.stories.js deleted file mode 100644 index 1f051da053..0000000000 --- a/packages/core/src/hooks/useListenFocusTriggers/__stories__/useListenFocusTriggers.stories.js +++ /dev/null @@ -1,38 +0,0 @@ -import React, { useCallback, useRef, useState } from "react"; -import useListenFocusTriggers from "../index"; -import { Button, Flex } from "../../../components"; -import "../../__stories__/general-hooks-stories.scss"; - -export default { - title: "Hooks/useListenFocusTriggers" -}; - -export const Overview = { - render: () => { - const [text, setText] = useState("-"); - const ref = useRef(null); - - const onFocusByMouse = useCallback(_event => { - setText("mouse"); - }, []); - - const onFocusByKeyboard = useCallback(_event => { - setText("keyboard"); - }, []); - - useListenFocusTriggers({ - ref: ref, - onFocusByMouse: onFocusByMouse, - onFocusByKeyboard: onFocusByKeyboard - }); - - return ( - - -
Received focus by: {text}
-
- ); - }, - - name: "Overview" -}; \ No newline at end of file From 1c8ca0a828204b4f155b1499a0c986cd72e81c50 Mon Sep 17 00:00:00 2001 From: LoayTarek5 <142718879+LoayTarek5@users.noreply.github.com> Date: Thu, 17 Oct 2024 09:23:59 +0300 Subject: [PATCH 6/7] Delete unusing code useListenFocusTriggers.stories.tsx --- .../__stories__/useListenFocusTriggers.stories.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/core/src/hooks/useListenFocusTriggers/__stories__/useListenFocusTriggers.stories.tsx b/packages/core/src/hooks/useListenFocusTriggers/__stories__/useListenFocusTriggers.stories.tsx index 0b19bb4aa1..66abb89241 100644 --- a/packages/core/src/hooks/useListenFocusTriggers/__stories__/useListenFocusTriggers.stories.tsx +++ b/packages/core/src/hooks/useListenFocusTriggers/__stories__/useListenFocusTriggers.stories.tsx @@ -7,8 +7,6 @@ export default { title: "Hooks/useListenFocusTriggers" }; -interface RenderProps {} - export const Overview = { render: () => { const [text, setText] = useState("-"); @@ -37,4 +35,4 @@ export const Overview = { }, name: "Overview" -} as const; \ No newline at end of file +}; From 4bc95d02d812da39ec6976236f05bcb1bd941264 Mon Sep 17 00:00:00 2001 From: Yossi Saadi Date: Sun, 3 Nov 2024 10:20:06 +0200 Subject: [PATCH 7/7] build: fix lint run prettier --- .../__stories__/useListenFocusTriggers.stories.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/hooks/useListenFocusTriggers/__stories__/useListenFocusTriggers.stories.tsx b/packages/core/src/hooks/useListenFocusTriggers/__stories__/useListenFocusTriggers.stories.tsx index 66abb89241..d76df9c08f 100644 --- a/packages/core/src/hooks/useListenFocusTriggers/__stories__/useListenFocusTriggers.stories.tsx +++ b/packages/core/src/hooks/useListenFocusTriggers/__stories__/useListenFocusTriggers.stories.tsx @@ -4,7 +4,7 @@ import { Button, Flex } from "../../../components"; import "../../__stories__/general-hooks-stories.scss"; export default { - title: "Hooks/useListenFocusTriggers" + title: "Hooks/useListenFocusTriggers" }; export const Overview = {