@sohanemon/utils 4.1.16 → 5.0.1

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.
@@ -1,8 +1,9 @@
1
1
  'use client';
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import * as React from 'react';
4
+ import { isSSR } from '../functions';
4
5
  export const ResponsiveIndicator = () => {
5
- const [viewportWidth, setViewportWidth] = React.useState(window.innerWidth);
6
+ const [viewportWidth, setViewportWidth] = React.useState(isSSR ? 0 : window.innerWidth);
6
7
  const [position, setPosition] = React.useState(0); // State to manage button position
7
8
  React.useEffect(() => {
8
9
  const handleResize = () => {
@@ -5,12 +5,10 @@
5
5
  * @returns {string} - A string of merged class names.
6
6
  */
7
7
  import { clsx } from 'clsx';
8
- import { extendTailwindMerge } from 'tailwind-merge';
9
- import { withFluid } from '@fluid-tailwind/tailwind-merge';
8
+ import { twMerge } from 'tailwind-merge';
10
9
  export * from './cookie';
11
10
  export * from './object';
12
11
  export function cn(...inputs) {
13
- const twMerge = extendTailwindMerge(withFluid);
14
12
  return twMerge(clsx(inputs));
15
13
  }
16
14
  /**
@@ -41,3 +41,6 @@ export type TwoOf<T> = {
41
41
  export type Prettify<T> = {
42
42
  [K in keyof T]: T[K];
43
43
  } & {};
44
+ export type NestedKeyOf<ObjectType extends object, IgnoreKeys extends string = never> = {
45
+ [Key in keyof ObjectType & string]: Key extends IgnoreKeys ? never : ObjectType[Key] extends object ? ObjectType[Key] extends Array<any> ? Key : `${Key}` | `${Key}.${NestedKeyOf<ObjectType[Key], IgnoreKeys>}` : `${Key}`;
46
+ }[keyof ObjectType & string];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sohanemon/utils",
3
- "version": "4.1.16",
3
+ "version": "5.0.1",
4
4
  "author": "Sohan Emon <sohanemon@outlook.com>",
5
5
  "description": "",
6
6
  "type": "module",
@@ -15,31 +15,44 @@
15
15
  },
16
16
  "typesVersions": {
17
17
  "*": {
18
- "core": ["dist/index.d.ts"],
19
- "types": ["dist/types/index.d.ts"],
20
- "hooks": ["dist/hooks/index.d.ts"],
21
- "components": ["dist/components/index.d.ts"]
18
+ "core": [
19
+ "dist/index.d.ts"
20
+ ],
21
+ "types": [
22
+ "dist/types/index.d.ts"
23
+ ],
24
+ "hooks": [
25
+ "dist/hooks/index.d.ts"
26
+ ],
27
+ "components": [
28
+ "dist/components/index.d.ts"
29
+ ]
22
30
  }
23
31
  },
24
- "files": ["dist", "README.md"],
32
+ "files": [
33
+ "dist",
34
+ "README.md"
35
+ ],
25
36
  "scripts": {
26
37
  "build": "tsc",
27
38
  "build:watch": "tsc --watch",
28
39
  "export": "tsc && npm publish"
29
40
  },
30
- "keywords": ["utils", "cn"],
41
+ "keywords": [
42
+ "utils",
43
+ "cn"
44
+ ],
31
45
  "license": "ISC",
32
46
  "devDependencies": {
33
- "@types/node": "^22.4.0",
34
- "@types/react": "^19.1.4",
35
- "typescript": "^5.5.4"
47
+ "@types/node": "^24.0.3",
48
+ "@types/react": "^19.1.8",
49
+ "typescript": "^5.8.3"
36
50
  },
37
51
  "dependencies": {
38
- "@fluid-tailwind/tailwind-merge": "^0.0.2",
39
- "@iconify/react": "^4.1.1",
52
+ "@iconify/react": "^6.0.0",
40
53
  "clsx": "^2.1.1",
41
54
  "react": "^19.1.0",
42
- "tailwind-merge": "^1.14.0"
55
+ "tailwind-merge": "^3.3.1"
43
56
  },
44
57
  "packageManager": "pnpm@10.11.0+sha512.6540583f41cc5f628eb3d9773ecee802f4f9ef9923cc45b69890fb47991d4b092964694ec3a4f738a420c918a333062c8b925d312f42e4f0c263eb603551f977"
45
58
  }