@bbodek/hooks 0.0.12 → 0.0.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.
Files changed (48) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +42 -1
  3. package/dist/effects/index.d.ts +3 -0
  4. package/dist/effects/index.d.ts.map +1 -0
  5. package/dist/effects/useIsomorphicLayoutEffect/index.d.ts +2 -0
  6. package/dist/effects/useIsomorphicLayoutEffect/index.d.ts.map +1 -0
  7. package/dist/effects/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.d.ts +4 -0
  8. package/dist/effects/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.d.ts.map +1 -0
  9. package/dist/effects/useScrollLockEffect/index.d.ts +3 -0
  10. package/dist/effects/useScrollLockEffect/index.d.ts.map +1 -0
  11. package/dist/effects/useScrollLockEffect/types/index.d.ts +5 -0
  12. package/dist/effects/useScrollLockEffect/types/index.d.ts.map +1 -0
  13. package/dist/effects/useScrollLockEffect/useScrollLockEffect.d.ts +4 -0
  14. package/dist/effects/useScrollLockEffect/useScrollLockEffect.d.ts.map +1 -0
  15. package/dist/hooks/index.d.ts +3 -0
  16. package/dist/hooks/index.d.ts.map +1 -0
  17. package/dist/hooks/useClickOutSide/index.d.ts +4 -0
  18. package/dist/hooks/useClickOutSide/index.d.ts.map +1 -0
  19. package/dist/hooks/useClickOutSide/types/index.d.ts +9 -0
  20. package/dist/hooks/useClickOutSide/types/index.d.ts.map +1 -0
  21. package/dist/hooks/useClickOutSide/useClickOutSide.d.ts +6 -0
  22. package/dist/hooks/useClickOutSide/useClickOutSide.d.ts.map +1 -0
  23. package/dist/hooks/useClickOutSide/useClickOutSideEffect.d.ts +4 -0
  24. package/dist/hooks/useClickOutSide/useClickOutSideEffect.d.ts.map +1 -0
  25. package/dist/hooks/useForm/index.d.ts +3 -0
  26. package/dist/hooks/useForm/index.d.ts.map +1 -0
  27. package/dist/hooks/useForm/types/index.d.ts +20 -0
  28. package/dist/hooks/useForm/types/index.d.ts.map +1 -0
  29. package/dist/hooks/useForm/useForm.d.ts +4 -0
  30. package/dist/hooks/useForm/useForm.d.ts.map +1 -0
  31. package/dist/index.d.ts +2 -2
  32. package/dist/index.d.ts.map +1 -1
  33. package/dist/index.es.js +1 -1
  34. package/dist/useClickOutSide/index.d.ts +4 -0
  35. package/dist/useClickOutSide/index.d.ts.map +1 -0
  36. package/dist/useClickOutSide/types/index.d.ts +9 -0
  37. package/dist/useClickOutSide/types/index.d.ts.map +1 -0
  38. package/dist/useClickOutSide/useClickOutSide.d.ts +6 -0
  39. package/dist/useClickOutSide/useClickOutSide.d.ts.map +1 -0
  40. package/dist/useClickOutSide/useClickOutSideEffect.d.ts +4 -0
  41. package/dist/useClickOutSide/useClickOutSideEffect.d.ts.map +1 -0
  42. package/dist/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.d.ts +2 -2
  43. package/dist/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.d.ts.map +1 -1
  44. package/package.json +3 -5
  45. package/dist/useForm/useForm.es.js +0 -2
  46. package/dist/useForm/useForm.es.js.map +0 -1
  47. package/dist/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.es.js +0 -2
  48. package/dist/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.es.js.map +0 -1
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 BBODEK, Inc
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1 +1,42 @@
1
- # Bbodek Hooks
1
+ # @bbodek/hooks · [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/thebbodek/dotoli/blob/main/apps/hooks/LICENSE) [![NPM badge](https://img.shields.io/npm/v/@bbodek/hooks?logo=npm)](https://www.npmjs.com/package/@bbodek/hooks)
2
+
3
+ ## Installation
4
+
5
+ ```sh
6
+ # with npm
7
+ npm install @bbodek/hooks
8
+
9
+ # with yarn
10
+ yarn add @bbodek/hooks
11
+ ```
12
+
13
+ ## Example
14
+
15
+ ```tsx
16
+ import { useIsomorphicLayoutEffect } from '@bbodek/hooks';
17
+
18
+ useIsomorphicLayoutEffect(() => {
19
+ console.log('isReady');
20
+ }, []);
21
+ ```
22
+
23
+ ## Peer Dependencies
24
+
25
+ ```json
26
+ "peerDependencies": {
27
+ "next": "^15.3.1",
28
+ "react": "^19.1.0",
29
+ "react-dom": "^19.1.0"
30
+ }
31
+ ```
32
+
33
+ ## License
34
+
35
+ Licensed under the [MIT license](https://github.com/thebbodek/dotoli/blob/main/LICENSE).
36
+
37
+ <a href="https://bbodek.com/" target="_blank">
38
+ <picture>
39
+ <source media="(prefers-color-scheme: dark)" srcset="https://image.thebbodek.com/logo/logo-white.png"/>
40
+ <img align="center" alt="BBODEK" width="100" hspace="16" src="https://image.thebbodek.com/logo/logo-color.png"/>
41
+ </picture>
42
+ </a>
@@ -0,0 +1,3 @@
1
+ export * from './useIsomorphicLayoutEffect';
2
+ export * from './useScrollLockEffect';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/effects/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { default as useIsomorphicLayoutEffect } from './useIsomorphicLayoutEffect';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/effects/useIsomorphicLayoutEffect/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,yBAAyB,EAAE,MAAM,6BAA6B,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { useLayoutEffect } from 'react';
2
+ declare const useIsomorphicLayoutEffect: typeof useLayoutEffect;
3
+ export default useIsomorphicLayoutEffect;
4
+ //# sourceMappingURL=useIsomorphicLayoutEffect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useIsomorphicLayoutEffect.d.ts","sourceRoot":"","sources":["../../../src/effects/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,eAAe,EAAE,MAAM,OAAO,CAAC;AAEnD,QAAA,MAAM,yBAAyB,wBAC8B,CAAC;AAE9D,eAAe,yBAAyB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './types';
2
+ export { default as useScrollLockEffect } from './useScrollLockEffect';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/effects/useScrollLockEffect/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,5 @@
1
+ export interface UseScrollLockEffectProps {
2
+ isLocked: boolean;
3
+ target?: string;
4
+ }
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/effects/useScrollLockEffect/types/index.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
@@ -0,0 +1,4 @@
1
+ import { UseScrollLockEffectProps } from '../../effects/useScrollLockEffect/types';
2
+ declare const useScrollLockEffect: ({ isLocked, target, }: UseScrollLockEffectProps) => void;
3
+ export default useScrollLockEffect;
4
+ //# sourceMappingURL=useScrollLockEffect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useScrollLockEffect.d.ts","sourceRoot":"","sources":["../../../src/effects/useScrollLockEffect/useScrollLockEffect.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAE/E,QAAA,MAAM,mBAAmB,GAAI,uBAG1B,wBAAwB,SAgB1B,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './useClickOutSide';
2
+ export * from './useForm';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from './types';
2
+ export { default as useClickOutside } from './useClickOutSide';
3
+ export { default as useClickOutSideEffect } from './useClickOutSideEffect';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/useClickOutSide/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,yBAAyB,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { RefObject } from 'react';
2
+ export interface UseClickOutsideProps {
3
+ onClose: (e: MouseEvent) => void;
4
+ useClickOutsideEvent?: boolean;
5
+ }
6
+ export interface UseClickOutSideEffectProps<T extends HTMLElement> extends UseClickOutsideProps {
7
+ ref: RefObject<T | null>;
8
+ }
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useClickOutSide/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;IACjC,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC;AAED,MAAM,WAAW,0BAA0B,CAAC,CAAC,SAAS,WAAW,CAC/D,SAAQ,oBAAoB;IAC5B,GAAG,EAAE,SAAS,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;CAC1B"}
@@ -0,0 +1,6 @@
1
+ import { UseClickOutsideProps } from '../../hooks/useClickOutSide/types';
2
+ declare const useClickOutside: <T extends HTMLElement>({ onClose, useClickOutsideEvent, }: UseClickOutsideProps) => {
3
+ contentRef: import("react").RefObject<T | null>;
4
+ };
5
+ export default useClickOutside;
6
+ //# sourceMappingURL=useClickOutSide.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useClickOutSide.d.ts","sourceRoot":"","sources":["../../../src/hooks/useClickOutSide/useClickOutSide.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAGrE,QAAA,MAAM,eAAe,GAAI,CAAC,SAAS,WAAW,EAAE,oCAG7C,oBAAoB;;CAUtB,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { UseClickOutSideEffectProps } from '../../hooks/useClickOutSide/types';
2
+ declare const useClickOutSideEffect: <T extends HTMLElement>({ ref, onClose, useClickOutsideEvent, }: UseClickOutSideEffectProps<T>) => void;
3
+ export default useClickOutSideEffect;
4
+ //# sourceMappingURL=useClickOutSideEffect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useClickOutSideEffect.d.ts","sourceRoot":"","sources":["../../../src/hooks/useClickOutSide/useClickOutSideEffect.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAE3E,QAAA,MAAM,qBAAqB,GAAI,CAAC,SAAS,WAAW,EAAE,yCAInD,0BAA0B,CAAC,CAAC,CAAC,SAoB/B,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './types';
2
+ export { default as useForm } from './useForm';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/useForm/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { ChangeEvent, Dispatch, SetStateAction } from 'react';
2
+ export type ValueKey<T> = keyof T & string;
3
+ export type UseFormErrors = {
4
+ [key: string]: string;
5
+ };
6
+ export interface Props<T> {
7
+ initialValues: T;
8
+ validate?: (fields: T) => UseFormErrors;
9
+ }
10
+ export interface UseFormHandleChangeParams {
11
+ event: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>;
12
+ }
13
+ export interface UseFormReturnType<T> {
14
+ values: T;
15
+ setValues: Dispatch<SetStateAction<T>>;
16
+ errors: UseFormErrors;
17
+ handleChange: (event: UseFormHandleChangeParams['event']) => void;
18
+ setErrors: Dispatch<SetStateAction<UseFormErrors>>;
19
+ }
20
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useForm/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE9D,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI,MAAM,CAAC,GAAG,MAAM,CAAC;AAC3C,MAAM,MAAM,aAAa,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,CAAC;AAEtD,MAAM,WAAW,KAAK,CAAC,CAAC;IACtB,aAAa,EAAE,CAAC,CAAC;IACjB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,aAAa,CAAC;CACzC;AAED,MAAM,WAAW,yBAAyB;IACxC,KAAK,EAAE,WAAW,CAAC,gBAAgB,GAAG,mBAAmB,CAAC,CAAC;CAC5D;AAED,MAAM,WAAW,iBAAiB,CAAC,CAAC;IAClC,MAAM,EAAE,CAAC,CAAC;IACV,SAAS,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;IACvC,MAAM,EAAE,aAAa,CAAC;IACtB,YAAY,EAAE,CAAC,KAAK,EAAE,yBAAyB,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;IAClE,SAAS,EAAE,QAAQ,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC,CAAC;CACpD"}
@@ -0,0 +1,4 @@
1
+ import { Props, UseFormReturnType } from '../../hooks/useForm/types';
2
+ declare const useForm: <T extends object>({ initialValues, validate, }: Props<T>) => UseFormReturnType<T>;
3
+ export default useForm;
4
+ //# sourceMappingURL=useForm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useForm.d.ts","sourceRoot":"","sources":["../../../src/hooks/useForm/useForm.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAiB,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAEhF,QAAA,MAAM,OAAO,GAAI,CAAC,SAAS,MAAM,EAAE,8BAGhC,KAAK,CAAC,CAAC,CAAC,KAAG,iBAAiB,CAAC,CAAC,CA2ChC,CAAC;AAEF,eAAe,OAAO,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export * from './useForm';
2
- export * from './useIsomorphicLayoutEffect';
1
+ export * from './effects';
2
+ export * from './hooks';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,6BAA6B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC"}
package/dist/index.es.js CHANGED
@@ -1,2 +1,2 @@
1
- export{default as useForm}from"./useForm/useForm.es.js";export{default as useIsomorphicLayoutEffect}from"./useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.es.js";
1
+ import{useLayoutEffect as e,useEffect as t,useRef as n,useState as o}from"react";const r="undefined"!=typeof window?e:t,s=({isLocked:e,target:n})=>{t((()=>{const t=n?document.getElementById(n):document.body;if(t)return t.style.overflow=e?"hidden":"auto",()=>{t.style.overflow="auto"}}),[e,n])},u=({ref:e,onClose:n,useClickOutsideEvent:o=!0})=>{t((()=>{const t=t=>{e.current&&!e.current.contains(t.target)&&n(t)};return o?document.addEventListener("mousedown",t):document.removeEventListener("mousedown",t),()=>{o&&document.removeEventListener("mousedown",t)}}),[e.current,o])},c=({onClose:e,useClickOutsideEvent:t})=>{const o=n(null);return u({ref:o,onClose:e,useClickOutsideEvent:t}),{contentRef:o}},i=({initialValues:e,validate:t})=>{const[n,r]=o(e),[s,u]=o({});return{values:n,setValues:e=>{const o="function"==typeof e?e(n):e;if(r(o),t){const e=t(o);u(e)}},errors:s,handleChange:o=>{const{name:s,value:c}=o.target;if(s in e&&(r({...n,[s]:c}),t)){const e=t({...n,[s]:c});u(e)}},setErrors:u}};export{u as useClickOutSideEffect,c as useClickOutside,i as useForm,r as useIsomorphicLayoutEffect,s as useScrollLockEffect};
2
2
  //# sourceMappingURL=index.es.js.map
@@ -0,0 +1,4 @@
1
+ export * from './types';
2
+ export { default as useClickOutside } from './useClickOutSide';
3
+ export { default as useClickOutSideEffect } from './useClickOutSideEffect';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/useClickOutSide/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,yBAAyB,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { RefObject } from 'react';
2
+ export interface UseClickOutsideProps {
3
+ onClose: (e: MouseEvent) => void;
4
+ useClickOutsideEvent?: boolean;
5
+ }
6
+ export interface UseClickOutSideEffectProps<T extends HTMLElement> extends UseClickOutsideProps {
7
+ ref: RefObject<T | null>;
8
+ }
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/useClickOutSide/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;IACjC,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC;AAED,MAAM,WAAW,0BAA0B,CAAC,CAAC,SAAS,WAAW,CAC/D,SAAQ,oBAAoB;IAC5B,GAAG,EAAE,SAAS,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;CAC1B"}
@@ -0,0 +1,6 @@
1
+ import { UseClickOutsideProps } from '../useClickOutSide/types';
2
+ declare const useClickOutside: <T extends HTMLElement>({ onClose, useClickOutsideEvent, }: UseClickOutsideProps) => {
3
+ contentRef: import("react").RefObject<T | null>;
4
+ };
5
+ export default useClickOutside;
6
+ //# sourceMappingURL=useClickOutSide.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useClickOutSide.d.ts","sourceRoot":"","sources":["../../src/useClickOutSide/useClickOutSide.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAG/D,QAAA,MAAM,eAAe,GAAI,CAAC,SAAS,WAAW,EAAE,oCAG7C,oBAAoB;;CAUtB,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { UseClickOutSideEffectProps } from '../useClickOutSide/types';
2
+ declare const useClickOutSideEffect: <T extends HTMLElement>({ ref, onClose, useClickOutsideEvent, }: UseClickOutSideEffectProps<T>) => void;
3
+ export default useClickOutSideEffect;
4
+ //# sourceMappingURL=useClickOutSideEffect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useClickOutSideEffect.d.ts","sourceRoot":"","sources":["../../src/useClickOutSide/useClickOutSideEffect.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAErE,QAAA,MAAM,qBAAqB,GAAI,CAAC,SAAS,WAAW,EAAE,yCAInD,0BAA0B,CAAC,CAAC,CAAC,SAoB/B,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
@@ -1,4 +1,4 @@
1
- import { useLayoutEffect } from 'react';
2
- declare const useIsomorphicLayoutEffect: typeof useLayoutEffect;
1
+ import { useEffect } from 'react';
2
+ declare const useIsomorphicLayoutEffect: typeof useEffect;
3
3
  export default useIsomorphicLayoutEffect;
4
4
  //# sourceMappingURL=useIsomorphicLayoutEffect.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useIsomorphicLayoutEffect.d.ts","sourceRoot":"","sources":["../../src/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,eAAe,EAAE,MAAM,OAAO,CAAC;AAEnD,QAAA,MAAM,yBAAyB,wBAC8B,CAAC;AAE9D,eAAe,yBAAyB,CAAC"}
1
+ {"version":3,"file":"useIsomorphicLayoutEffect.d.ts","sourceRoot":"","sources":["../../src/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAmB,MAAM,OAAO,CAAC;AAEnD,QAAA,MAAM,yBAAyB,kBAC8B,CAAC;AAE9D,eAAe,yBAAyB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bbodek/hooks",
3
- "version": "0.0.12",
3
+ "version": "0.0.14",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {
@@ -13,7 +13,7 @@
13
13
  "dist"
14
14
  ],
15
15
  "scripts": {
16
- "dev": "next dev",
16
+ "dev": "rollup -c --watch & tsc -p tsconfig.build.json --watch & tsc-alias -p tsconfig.build.json --watch",
17
17
  "build": "rollup -c && tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json",
18
18
  "start": "next start",
19
19
  "lint": "next lint"
@@ -31,14 +31,12 @@
31
31
  "devDependencies": {
32
32
  "@dotoli/eslint-config": "workspace:*",
33
33
  "@dotoli/typescript-config": "workspace:*",
34
- "@eslint/eslintrc": "^3",
35
34
  "@rollup/plugin-node-resolve": "^16.0.1",
36
35
  "@rollup/plugin-terser": "^0.4.4",
37
36
  "@types/node": "^20",
38
37
  "@types/react": "^19",
39
38
  "@types/react-dom": "^19",
40
- "eslint": "^9",
41
- "eslint-config-next": "15.3.1",
39
+ "eslint": "^9.26.0",
42
40
  "rollup": "^4.40.2",
43
41
  "rollup-plugin-peer-deps-external": "^2.2.4",
44
42
  "rollup-plugin-typescript2": "^0.36.0",
@@ -1,2 +0,0 @@
1
- import{useState as t}from"react";const e=({initialValues:e,validate:a})=>{const[n,s]=t(e),[o,r]=t({});return{values:n,setValues:t=>{const e="function"==typeof t?t(n):t;if(s(e),a){const t=a(e);r(t)}},errors:o,handleChange:t=>{const{name:o,value:i}=t.target;if(o in e&&(s({...n,[o]:i}),a)){const t=a({...n,[o]:i});r(t)}},setErrors:r}};export{e as default};
2
- //# sourceMappingURL=useForm.es.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useForm.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- import{useLayoutEffect as e,useEffect as o}from"react";const t="undefined"!=typeof window?e:o;export{t as default};
2
- //# sourceMappingURL=useIsomorphicLayoutEffect.es.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useIsomorphicLayoutEffect.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}