@longzai-intelligence-design/utils 0.0.3 → 0.0.4
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.
- package/dist/index.d.ts +0 -16
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import { ClassValue } from "clsx";
|
|
2
2
|
import { RefObject } from "react";
|
|
3
|
-
//#region src/cn.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* 合并 CSS 类名
|
|
6
5
|
*
|
|
7
6
|
* 智能处理 Tailwind CSS 类名冲突,后面的类名会覆盖前面的同名类
|
|
8
7
|
*/
|
|
9
8
|
declare function cn(...inputs: ClassValue[]): string;
|
|
10
|
-
//#endregion
|
|
11
|
-
//#region src/color/oklch.d.ts
|
|
12
9
|
/**
|
|
13
10
|
* @module color/oklch
|
|
14
11
|
*
|
|
@@ -58,8 +55,6 @@ declare function rgbToHex([r, g, b]: Rgb): string;
|
|
|
58
55
|
* @returns hex 字符串;非 oklch 输入返回 null。
|
|
59
56
|
*/
|
|
60
57
|
declare function oklchToHex(input: string): string | null;
|
|
61
|
-
//#endregion
|
|
62
|
-
//#region src/color/palette.d.ts
|
|
63
58
|
/**
|
|
64
59
|
* @module color/palette
|
|
65
60
|
*
|
|
@@ -85,8 +80,6 @@ type ResolvedPalette = Readonly<Record<string, string | null | ResolvedScale>>;
|
|
|
85
80
|
* @returns 与输入同形的已解析调色板。
|
|
86
81
|
*/
|
|
87
82
|
declare function resolvePaletteHex(palette: Readonly<Record<string, unknown>>): ResolvedPalette;
|
|
88
|
-
//#endregion
|
|
89
|
-
//#region src/color/semantics.d.ts
|
|
90
83
|
/**
|
|
91
84
|
* @module color/semantics
|
|
92
85
|
*
|
|
@@ -139,14 +132,10 @@ declare function formatColor(color: RgbaColor): string;
|
|
|
139
132
|
* @returns 与输入同键的已解析色值表。
|
|
140
133
|
*/
|
|
141
134
|
declare function resolveSemanticColors(semanticColors: Readonly<Record<string, string>>, palette: SemanticsPaletteInput): Readonly<Record<string, string | null>>;
|
|
142
|
-
//#endregion
|
|
143
|
-
//#region src/hooks/useIsMobile.d.ts
|
|
144
135
|
/**
|
|
145
136
|
* 检测当前是否为移动端视口
|
|
146
137
|
*/
|
|
147
138
|
declare function useIsMobile(): boolean;
|
|
148
|
-
//#endregion
|
|
149
|
-
//#region src/hooks/useMediaQuery.d.ts
|
|
150
139
|
interface UseMediaQueryOptions {
|
|
151
140
|
defaultValue?: boolean;
|
|
152
141
|
initializeWithValue?: boolean;
|
|
@@ -158,8 +147,6 @@ interface UseMediaQueryOptions {
|
|
|
158
147
|
* @param options - 配置选项
|
|
159
148
|
*/
|
|
160
149
|
declare function useMediaQuery(query: string, options?: UseMediaQueryOptions): boolean;
|
|
161
|
-
//#endregion
|
|
162
|
-
//#region src/hooks/useStepper.d.ts
|
|
163
150
|
interface UseStepperOptions {
|
|
164
151
|
/** 各步骤的间隔延迟(毫秒):第 i 步完成后等待 steps[i] ms 再进入第 i+1 步 */
|
|
165
152
|
steps: readonly number[];
|
|
@@ -193,8 +180,6 @@ interface UseStepperOptions {
|
|
|
193
180
|
* ```
|
|
194
181
|
*/
|
|
195
182
|
declare function useStepper({ steps, enabled, loop, loopDelay }: UseStepperOptions): number;
|
|
196
|
-
//#endregion
|
|
197
|
-
//#region src/hooks/useMagicPill.d.ts
|
|
198
183
|
interface UseMagicPillOptions {
|
|
199
184
|
/**
|
|
200
185
|
* 容器 ref(需为 positioned 元素,子项 offsetTop 相对它计算;
|
|
@@ -251,5 +236,4 @@ interface MagicPillPosition {
|
|
|
251
236
|
* ```
|
|
252
237
|
*/
|
|
253
238
|
declare function useMagicPill({ containerRef, activeIndex, hoverIndex, itemSelector }: UseMagicPillOptions): MagicPillPosition;
|
|
254
|
-
//#endregion
|
|
255
239
|
export { type MagicPillPosition, type ResolvedPalette, type ResolvedScale, type Rgb, type RgbaColor, type SemanticsPaletteInput, type UseMagicPillOptions, type UseMediaQueryOptions, type UseStepperOptions, cn, formatColor, oklchToHex, oklchToRgb, parseOklch, resolvePaletteHex, resolveSemanticColors, rgbToHex, useIsMobile, useMagicPill, useMediaQuery, useStepper };
|