xxf_react 0.2.9 → 0.3.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,2 +1,3 @@
1
1
  export * from './scroll-to-center';
2
+ export * from './tailwind';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAEA,cAAc,oBAAoB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAEA,cAAc,oBAAoB,CAAA;AAClC,cAAc,YAAY,CAAA"}
@@ -1,2 +1,3 @@
1
1
  'use client';
2
2
  export * from './scroll-to-center';
3
+ export * from './tailwind';
@@ -0,0 +1,14 @@
1
+ import { type ClassValue } from 'clsx';
2
+ /**
3
+ * // ❌ 直接用 twMerge 很麻烦
4
+ * twMerge(`base ${isActive ? 'bg-blue-500' : ''} ${isDisabled ? 'opacity-50' : ''}`)
5
+ *
6
+ * // ✅ 用 cn 更简洁
7
+ * cn('base', isActive && 'bg-blue-500', isDisabled && 'opacity-50')
8
+ * cn('base', { 'bg-blue-500': isActive, 'opacity-50': isDisabled })
9
+ *
10
+ * 合并css样式
11
+ * @param inputs
12
+ */
13
+ export declare function cn(...inputs: ClassValue[]): string;
14
+ //# sourceMappingURL=tailwind.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tailwind.d.ts","sourceRoot":"","sources":["../../src/utils/tailwind.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,UAAU,EAAC,MAAM,MAAM,CAAA;AAI1C;;;;;;;;;;GAUG;AACH,wBAAgB,EAAE,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,UAEzC"}
@@ -0,0 +1,16 @@
1
+ import { clsx } from 'clsx';
2
+ import { twMerge } from "tailwind-merge";
3
+ /**
4
+ * // ❌ 直接用 twMerge 很麻烦
5
+ * twMerge(`base ${isActive ? 'bg-blue-500' : ''} ${isDisabled ? 'opacity-50' : ''}`)
6
+ *
7
+ * // ✅ 用 cn 更简洁
8
+ * cn('base', isActive && 'bg-blue-500', isDisabled && 'opacity-50')
9
+ * cn('base', { 'bg-blue-500': isActive, 'opacity-50': isDisabled })
10
+ *
11
+ * 合并css样式
12
+ * @param inputs
13
+ */
14
+ export function cn(...inputs) {
15
+ return twMerge(clsx(inputs));
16
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xxf_react",
3
- "version": "0.2.9",
3
+ "version": "0.3.1",
4
4
  "private": false,
5
5
 
6
6
  "type": "module",
@@ -70,6 +70,9 @@
70
70
  "use-debounce": "^10.0.6",
71
71
  "mitt": "^3.0.1",
72
72
  "@use-gesture/react": "^10.3.1",
73
- "tiny-lru": "^11.4.7"
73
+ "tiny-lru": "^11.4.7",
74
+ "dayjs": "^1.11.19",
75
+ "tailwind-merge": "^3.4.0",
76
+ "tailwind-variants": "^3.2.2"
74
77
  }
75
78
  }