@aiszlab/relax 1.0.30 → 1.1.0

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 (34) hide show
  1. package/dist/hooks/use-controlled-state.d.ts +1 -1
  2. package/dist/hooks/use-controlled-state.js +2 -2
  3. package/dist/hooks/use-once-state.d.ts +1 -1
  4. package/dist/hooks/use-scroll-locker.js +2 -2
  5. package/dist/hooks/use-scrollable.d.ts +10 -0
  6. package/dist/index.d.ts +14 -13
  7. package/dist/index.js +13 -12
  8. package/dist/is/is-function.d.ts +5 -0
  9. package/dist/is/is-function.js +9 -0
  10. package/package.json +1 -1
  11. /package/dist/{utils → is}/is-array.d.ts +0 -0
  12. /package/dist/{utils → is}/is-array.js +0 -0
  13. /package/dist/{utils → is}/is-complex.d.ts +0 -0
  14. /package/dist/{utils → is}/is-complex.js +0 -0
  15. /package/dist/{utils → is}/is-dom-usable.d.ts +0 -0
  16. /package/dist/{utils → is}/is-dom-usable.js +0 -0
  17. /package/dist/{utils → is}/is-empty.d.ts +0 -0
  18. /package/dist/{utils → is}/is-empty.js +0 -0
  19. /package/dist/{utils → is}/is-mobile.d.ts +0 -0
  20. /package/dist/{utils → is}/is-mobile.js +0 -0
  21. /package/dist/{utils → is}/is-null.d.ts +0 -0
  22. /package/dist/{utils → is}/is-null.js +0 -0
  23. /package/dist/{utils → is}/is-overflow.d.ts +0 -0
  24. /package/dist/{utils → is}/is-overflow.js +0 -0
  25. /package/dist/{utils → is}/is-refable.d.ts +0 -0
  26. /package/dist/{utils → is}/is-refable.js +0 -0
  27. /package/dist/{utils → is}/is-state-getter.d.ts +0 -0
  28. /package/dist/{utils → is}/is-state-getter.js +0 -0
  29. /package/dist/{utils → is}/is-style-element.d.ts +0 -0
  30. /package/dist/{utils → is}/is-style-element.js +0 -0
  31. /package/dist/{utils → is}/is-undefined.d.ts +0 -0
  32. /package/dist/{utils → is}/is-undefined.js +0 -0
  33. /package/dist/{utils → is}/is-void.d.ts +0 -0
  34. /package/dist/{utils → is}/is-void.js +0 -0
@@ -1,5 +1,5 @@
1
1
  import { type Dispatch, type SetStateAction } from 'react';
2
- import { type State } from '../utils/is-state-getter';
2
+ import { type State } from '../is/is-state-getter';
3
3
  interface Props<T> {
4
4
  defaultState?: State<T>;
5
5
  }
@@ -1,6 +1,6 @@
1
1
  import { useState, useEffect } from 'react';
2
- import { isStateGetter } from '../utils/is-state-getter.js';
3
- import { isUndefined } from '../utils/is-undefined.js';
2
+ import { isStateGetter } from '../is/is-state-getter.js';
3
+ import { isUndefined } from '../is/is-undefined.js';
4
4
 
5
5
  /**
6
6
  * @author murukal
@@ -1,4 +1,4 @@
1
- import type { State } from '../utils/is-state-getter';
1
+ import type { State } from '../is/is-state-getter';
2
2
  /**
3
3
  * @author murukal
4
4
  *
@@ -1,7 +1,7 @@
1
1
  import { __classPrivateFieldSet, __classPrivateFieldGet } from '../node_modules/tslib/tslib.es6.js';
2
2
  import { useId, useLayoutEffect } from 'react';
3
- import { isOverflow } from '../utils/is-overflow.js';
4
- import { isStyleElement } from '../utils/is-style-element.js';
3
+ import { isOverflow } from '../is/is-overflow.js';
4
+ import { isStyleElement } from '../is/is-style-element.js';
5
5
 
6
6
  var _ScrollLocker_scrollLocker, _ScrollLocker_barSize;
7
7
  const isComputable = (value) => /^(.*)px$/.test(value);
@@ -0,0 +1,10 @@
1
+ import { Key } from 'react';
2
+ /**
3
+ * @description
4
+ * scrollable hook
5
+ */
6
+ export declare const useScrollable: <P extends HTMLElement, C extends HTMLElement>() => {
7
+ groupRef: import("react").RefObject<P>;
8
+ itemRefs: import("react").MutableRefObject<Map<Key, C | null>>;
9
+ scrollTo: (key: Key, duration?: number) => void;
10
+ };
package/dist/index.d.ts CHANGED
@@ -14,17 +14,18 @@ export { useScrollLocker } from './hooks/use-scroll-locker';
14
14
  export { useForceUpdate } from './hooks/use-force-update';
15
15
  /**
16
16
  * @description
17
- * utils
17
+ * is
18
18
  */
19
- export { isRefable } from './utils/is-refable';
20
- export { isUndefined } from './utils/is-undefined';
21
- export { isStateGetter } from './utils/is-state-getter';
22
- export { isNull } from './utils/is-null';
23
- export { isVoid } from './utils/is-void';
24
- export { isArray } from './utils/is-array';
25
- export { isComplex } from './utils/is-complex';
26
- export { isEmpty } from './utils/is-empty';
27
- export { isDomUsable } from './utils/is-dom-usable';
28
- export { isMobile } from './utils/is-mobile';
29
- export { isOverflow } from './utils/is-overflow';
30
- export { isStyleElement } from './utils/is-style-element';
19
+ export { isRefable } from './is/is-refable';
20
+ export { isUndefined } from './is/is-undefined';
21
+ export { isStateGetter } from './is/is-state-getter';
22
+ export { isNull } from './is/is-null';
23
+ export { isVoid } from './is/is-void';
24
+ export { isArray } from './is/is-array';
25
+ export { isComplex } from './is/is-complex';
26
+ export { isEmpty } from './is/is-empty';
27
+ export { isDomUsable } from './is/is-dom-usable';
28
+ export { isMobile } from './is/is-mobile';
29
+ export { isOverflow } from './is/is-overflow';
30
+ export { isStyleElement } from './is/is-style-element';
31
+ export { isFunction } from './is/is-function';
package/dist/index.js CHANGED
@@ -8,15 +8,16 @@ export { useControlledState } from './hooks/use-controlled-state.js';
8
8
  export { useOnceState } from './hooks/use-once-state.js';
9
9
  export { useScrollLocker } from './hooks/use-scroll-locker.js';
10
10
  export { useForceUpdate } from './hooks/use-force-update.js';
11
- export { isRefable } from './utils/is-refable.js';
12
- export { isUndefined } from './utils/is-undefined.js';
13
- export { isStateGetter } from './utils/is-state-getter.js';
14
- export { isNull } from './utils/is-null.js';
15
- export { isVoid } from './utils/is-void.js';
16
- export { isArray } from './utils/is-array.js';
17
- export { isComplex } from './utils/is-complex.js';
18
- export { isEmpty } from './utils/is-empty.js';
19
- export { isDomUsable } from './utils/is-dom-usable.js';
20
- export { isMobile } from './utils/is-mobile.js';
21
- export { isOverflow } from './utils/is-overflow.js';
22
- export { isStyleElement } from './utils/is-style-element.js';
11
+ export { isRefable } from './is/is-refable.js';
12
+ export { isUndefined } from './is/is-undefined.js';
13
+ export { isStateGetter } from './is/is-state-getter.js';
14
+ export { isNull } from './is/is-null.js';
15
+ export { isVoid } from './is/is-void.js';
16
+ export { isArray } from './is/is-array.js';
17
+ export { isComplex } from './is/is-complex.js';
18
+ export { isEmpty } from './is/is-empty.js';
19
+ export { isDomUsable } from './is/is-dom-usable.js';
20
+ export { isMobile } from './is/is-mobile.js';
21
+ export { isOverflow } from './is/is-overflow.js';
22
+ export { isStyleElement } from './is/is-style-element.js';
23
+ export { isFunction } from './is/is-function.js';
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @description
3
+ * if is function
4
+ */
5
+ export declare const isFunction: (value: unknown) => value is Function;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @description
3
+ * if is function
4
+ */
5
+ const isFunction = (value) => {
6
+ return typeof value === 'function';
7
+ };
8
+
9
+ export { isFunction };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiszlab/relax",
3
- "version": "1.0.30",
3
+ "version": "1.1.0",
4
4
  "description": "react utils collection",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes