@luanlu/mk-motion 1.0.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.
- package/README.md +120 -0
- package/dist/a11y/focus-trap.d.ts +10 -0
- package/dist/a11y/keyboard.d.ts +28 -0
- package/dist/components/alert/alert.d.ts +18 -0
- package/dist/components/avatar/avatar.d.ts +31 -0
- package/dist/components/breadcrumb/breadcrumb.d.ts +16 -0
- package/dist/components/button/button.d.ts +28 -0
- package/dist/components/card/card.d.ts +19 -0
- package/dist/components/collapse/collapse.d.ts +23 -0
- package/dist/components/dialog/dialog.d.ts +27 -0
- package/dist/components/drawer/drawer.d.ts +21 -0
- package/dist/components/empty/empty.d.ts +14 -0
- package/dist/components/form/checkbox.d.ts +27 -0
- package/dist/components/form/radio.d.ts +32 -0
- package/dist/components/form/select.d.ts +32 -0
- package/dist/components/form/slider.d.ts +31 -0
- package/dist/components/input/input.d.ts +31 -0
- package/dist/components/layout/divider.d.ts +12 -0
- package/dist/components/layout/row.d.ts +14 -0
- package/dist/components/layout/space.d.ts +13 -0
- package/dist/components/loading/loading.d.ts +8 -0
- package/dist/components/menu/menu.d.ts +30 -0
- package/dist/components/message/message.d.ts +10 -0
- package/dist/components/popover/popover.d.ts +31 -0
- package/dist/components/progress/progress.d.ts +25 -0
- package/dist/components/steps/steps.d.ts +22 -0
- package/dist/components/switch/switch.d.ts +23 -0
- package/dist/components/table/table.d.ts +47 -0
- package/dist/components/tabs/tabs.d.ts +30 -0
- package/dist/components/tag/tag.d.ts +24 -0
- package/dist/components/tooltip/tooltip.d.ts +8 -0
- package/dist/core/animator.d.ts +29 -0
- package/dist/core/timeline.d.ts +14 -0
- package/dist/core/utils.d.ts +13 -0
- package/dist/effects/glitch.d.ts +14 -0
- package/dist/effects/particle.d.ts +17 -0
- package/dist/effects/text-split.d.ts +14 -0
- package/dist/effects/wave-text.d.ts +17 -0
- package/dist/gesture/draggable.d.ts +23 -0
- package/dist/gesture/spring.d.ts +24 -0
- package/dist/index.d.ts +109 -0
- package/dist/interactive/coverflow.d.ts +24 -0
- package/dist/interactive/cursor-trail.d.ts +11 -0
- package/dist/interactive/flip-card.d.ts +18 -0
- package/dist/interactive/magnetic.d.ts +12 -0
- package/dist/micro/hover-lift.d.ts +15 -0
- package/dist/micro/ripple.d.ts +13 -0
- package/dist/mk-motion.js +3194 -0
- package/dist/mk-motion.umd.cjs +149 -0
- package/dist/motion/component-motion.d.ts +43 -0
- package/dist/presets/index.d.ts +20 -0
- package/dist/scroll/scroll-trigger.d.ts +20 -0
- package/dist/style.css +1 -0
- package/dist/text/count-up.d.ts +23 -0
- package/dist/text/typewriter.d.ts +21 -0
- package/dist/theme/theme.d.ts +28 -0
- package/dist/transitions/blur-reveal.d.ts +14 -0
- package/dist/transitions/collapse.d.ts +16 -0
- package/dist/transitions/lazy-image.d.ts +14 -0
- package/dist/transitions/list.d.ts +9 -0
- package/dist/transitions/loading.d.ts +13 -0
- package/dist/transitions/parallax.d.ts +16 -0
- package/dist/transitions/shimmer.d.ts +13 -0
- package/dist/transitions/toast.d.ts +25 -0
- package/dist/types.d.ts +4 -0
- package/package.json +57 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
|
|
2
|
+
export interface StepItem {
|
|
3
|
+
title: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
icon?: string;
|
|
6
|
+
status?: 'wait' | 'process' | 'finish' | 'error';
|
|
7
|
+
}
|
|
8
|
+
export interface StepsOptions {
|
|
9
|
+
direction?: 'horizontal' | 'vertical';
|
|
10
|
+
current?: number;
|
|
11
|
+
items: StepItem[];
|
|
12
|
+
size?: 'small' | 'default';
|
|
13
|
+
}
|
|
14
|
+
export declare class MkSteps {
|
|
15
|
+
el: HTMLElement;
|
|
16
|
+
private options;
|
|
17
|
+
constructor(container: HTMLElement | string, options: StepsOptions);
|
|
18
|
+
private render;
|
|
19
|
+
setCurrent(current: number): void;
|
|
20
|
+
destroy(): void;
|
|
21
|
+
}
|
|
22
|
+
export declare function createSteps(container: HTMLElement | string, options: StepsOptions): MkSteps;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
|
|
2
|
+
export interface SwitchOptions {
|
|
3
|
+
value?: boolean;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
activeText?: string;
|
|
6
|
+
inactiveText?: string;
|
|
7
|
+
onChange?: (value: boolean) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare class MkSwitch {
|
|
10
|
+
el: HTMLLabelElement;
|
|
11
|
+
private core;
|
|
12
|
+
private options;
|
|
13
|
+
private _value;
|
|
14
|
+
private activeLabel?;
|
|
15
|
+
private _cleanupKey?;
|
|
16
|
+
private inactiveLabel?;
|
|
17
|
+
constructor(container: HTMLElement | string, options?: SwitchOptions);
|
|
18
|
+
get value(): boolean;
|
|
19
|
+
set value(v: boolean);
|
|
20
|
+
toggle(): void;
|
|
21
|
+
destroy(): void;
|
|
22
|
+
}
|
|
23
|
+
export declare function createSwitch(container: HTMLElement | string, options?: SwitchOptions): MkSwitch;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
|
|
2
|
+
export interface TableColumn {
|
|
3
|
+
key: string;
|
|
4
|
+
title: string;
|
|
5
|
+
width?: string;
|
|
6
|
+
sortable?: boolean;
|
|
7
|
+
editable?: boolean;
|
|
8
|
+
render?: (value: any, row: Record<string, any>, index: number) => HTMLElement | string;
|
|
9
|
+
}
|
|
10
|
+
export interface TableOptions {
|
|
11
|
+
columns: TableColumn[];
|
|
12
|
+
data: Record<string, any>[];
|
|
13
|
+
pageSize?: number;
|
|
14
|
+
onEdit?: (row: Record<string, any>, rowIndex: number) => void;
|
|
15
|
+
onDelete?: (row: Record<string, any>, rowIndex: number) => void;
|
|
16
|
+
onRowClick?: (row: Record<string, any>, rowIndex: number) => void;
|
|
17
|
+
}
|
|
18
|
+
export declare class MkTable {
|
|
19
|
+
el: HTMLDivElement;
|
|
20
|
+
private table;
|
|
21
|
+
private tbody;
|
|
22
|
+
private columns;
|
|
23
|
+
private data;
|
|
24
|
+
private pageSize;
|
|
25
|
+
private currentPage;
|
|
26
|
+
private sortState;
|
|
27
|
+
private editingRow;
|
|
28
|
+
private editCache;
|
|
29
|
+
private filteredData;
|
|
30
|
+
private callbacks;
|
|
31
|
+
constructor(container: HTMLElement | string, options: TableOptions);
|
|
32
|
+
private getDisplayData;
|
|
33
|
+
private handleSort;
|
|
34
|
+
render(): void;
|
|
35
|
+
private updateSortIcons;
|
|
36
|
+
private renderPagination;
|
|
37
|
+
private createPageBtn;
|
|
38
|
+
setData(data: Record<string, any>[]): void;
|
|
39
|
+
filter(predicate: (row: Record<string, any>) => boolean): void;
|
|
40
|
+
clearFilter(): void;
|
|
41
|
+
startEdit(rowIndex: number): void;
|
|
42
|
+
saveEdit(): void;
|
|
43
|
+
cancelEdit(): void;
|
|
44
|
+
deleteRow(rowIndex: number): void;
|
|
45
|
+
destroy(): void;
|
|
46
|
+
}
|
|
47
|
+
export declare function createTable(container: HTMLElement | string, options: TableOptions): MkTable;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
|
|
2
|
+
export interface TabItem {
|
|
3
|
+
label: string;
|
|
4
|
+
content?: string | HTMLElement;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface TabsOptions {
|
|
8
|
+
type?: 'line' | 'card' | 'pill';
|
|
9
|
+
items?: TabItem[];
|
|
10
|
+
activeIndex?: number;
|
|
11
|
+
onChange?: (index: number) => void;
|
|
12
|
+
}
|
|
13
|
+
export declare class MkTabs {
|
|
14
|
+
el: HTMLDivElement;
|
|
15
|
+
private options;
|
|
16
|
+
private headerEl;
|
|
17
|
+
private contentEl;
|
|
18
|
+
private indicatorEl;
|
|
19
|
+
private tabItems;
|
|
20
|
+
private panels;
|
|
21
|
+
private currentIndex;
|
|
22
|
+
private tabIdPrefix;
|
|
23
|
+
constructor(container: HTMLElement | string, options?: TabsOptions);
|
|
24
|
+
private renderTabs;
|
|
25
|
+
setActive(index: number, animate?: boolean): void;
|
|
26
|
+
private updateIndicator;
|
|
27
|
+
getActive(): number;
|
|
28
|
+
destroy(): void;
|
|
29
|
+
}
|
|
30
|
+
export declare function createTabs(container: HTMLElement | string, options?: TabsOptions): MkTabs;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { MotionOptions } from '../../motion/component-motion.ts';
|
|
2
|
+
|
|
3
|
+
export interface TagOptions {
|
|
4
|
+
type?: 'default' | 'primary' | 'success' | 'warning' | 'danger' | 'info';
|
|
5
|
+
size?: 'small' | 'default' | 'large';
|
|
6
|
+
closable?: boolean;
|
|
7
|
+
round?: boolean;
|
|
8
|
+
plain?: boolean;
|
|
9
|
+
text?: string;
|
|
10
|
+
onClose?: () => void;
|
|
11
|
+
motion?: MotionOptions;
|
|
12
|
+
}
|
|
13
|
+
export declare class MkTag {
|
|
14
|
+
el: HTMLSpanElement;
|
|
15
|
+
private options;
|
|
16
|
+
private motion;
|
|
17
|
+
private _cleanupCloseKey?;
|
|
18
|
+
constructor(container: HTMLElement | string, options?: TagOptions);
|
|
19
|
+
private buildClass;
|
|
20
|
+
setText(text: string): void;
|
|
21
|
+
private close;
|
|
22
|
+
destroy(): void;
|
|
23
|
+
}
|
|
24
|
+
export declare function createTag(container: HTMLElement | string, options?: TagOptions): MkTag;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { AnimationName, AnimationOptions } from './utils.ts';
|
|
2
|
+
|
|
3
|
+
export declare class Animator {
|
|
4
|
+
private element;
|
|
5
|
+
private currentAnimation;
|
|
6
|
+
constructor(element: HTMLElement | string);
|
|
7
|
+
/**
|
|
8
|
+
* 播放 CSS 类动画
|
|
9
|
+
*/
|
|
10
|
+
animate(name: AnimationName, options?: AnimationOptions): Promise<Animator>;
|
|
11
|
+
/**
|
|
12
|
+
* 使用 Web Animations API 播放动画
|
|
13
|
+
*/
|
|
14
|
+
waa(keyframes: Keyframe[] | PropertyIndexedKeyframes, options?: AnimationOptions & {
|
|
15
|
+
duration?: number;
|
|
16
|
+
}): Promise<Animator>;
|
|
17
|
+
/**
|
|
18
|
+
* 停止当前动画
|
|
19
|
+
*/
|
|
20
|
+
stop(): this;
|
|
21
|
+
/**
|
|
22
|
+
* 移除所有动效类
|
|
23
|
+
*/
|
|
24
|
+
reset(): this;
|
|
25
|
+
/**
|
|
26
|
+
* 设置元素样式变量
|
|
27
|
+
*/
|
|
28
|
+
vars(variables: Record<string, string | number>): this;
|
|
29
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AnimationName, AnimationOptions } from './utils.ts';
|
|
2
|
+
|
|
3
|
+
export declare class Timeline {
|
|
4
|
+
private items;
|
|
5
|
+
private running;
|
|
6
|
+
private abortController;
|
|
7
|
+
add(name: AnimationName, target: HTMLElement | string, options?: AnimationOptions & {
|
|
8
|
+
at?: number;
|
|
9
|
+
}): this;
|
|
10
|
+
private estimateEndTime;
|
|
11
|
+
play(): Promise<void>;
|
|
12
|
+
stop(): void;
|
|
13
|
+
clear(): this;
|
|
14
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type AnimationName = 'fadeIn' | 'fadeOut' | 'slideInUp' | 'slideInDown' | 'slideInLeft' | 'slideInRight' | 'slideOutUp' | 'slideOutDown' | 'zoomIn' | 'zoomOut' | 'bounceIn' | 'bounceOut' | 'flipInX' | 'flipInY' | 'shake' | 'pulse' | 'rotateIn';
|
|
2
|
+
export interface AnimationOptions {
|
|
3
|
+
duration?: number;
|
|
4
|
+
easing?: string;
|
|
5
|
+
delay?: number;
|
|
6
|
+
iterations?: number;
|
|
7
|
+
direction?: 'normal' | 'reverse' | 'alternate' | 'alternate-reverse';
|
|
8
|
+
fill?: 'none' | 'forwards' | 'backwards' | 'both';
|
|
9
|
+
}
|
|
10
|
+
export declare function parseTime(value: number | string): number;
|
|
11
|
+
export declare function toCssTime(ms: number): string;
|
|
12
|
+
export declare function setCSSVariables(el: HTMLElement, vars: Record<string, string | number>): void;
|
|
13
|
+
export declare function removeCSSVariables(el: HTMLElement, keys: string[]): void;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface GlitchOptions {
|
|
2
|
+
duration?: number;
|
|
3
|
+
intensity?: number;
|
|
4
|
+
color1?: string;
|
|
5
|
+
color2?: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* 给元素添加赛博朋克故障风效果
|
|
9
|
+
*/
|
|
10
|
+
export declare function glitch(element: HTMLElement | string, options?: GlitchOptions): Promise<void>;
|
|
11
|
+
/**
|
|
12
|
+
* 持续故障效果(可停止)
|
|
13
|
+
*/
|
|
14
|
+
export declare function glitchLoop(element: HTMLElement | string, options?: GlitchOptions): () => void;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface ParticleOptions {
|
|
2
|
+
count?: number;
|
|
3
|
+
color?: string | string[];
|
|
4
|
+
speed?: number;
|
|
5
|
+
size?: number;
|
|
6
|
+
gravity?: number;
|
|
7
|
+
fadeOut?: boolean;
|
|
8
|
+
duration?: number;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* 在元素位置触发粒子爆炸效果
|
|
12
|
+
*/
|
|
13
|
+
export declare function particleBurst(element: HTMLElement | string, options?: ParticleOptions): Promise<void>;
|
|
14
|
+
/**
|
|
15
|
+
* 在点击位置触发粒子(不绑定元素)
|
|
16
|
+
*/
|
|
17
|
+
export declare function particleAt(x: number, y: number, options?: ParticleOptions): Promise<void>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface TextSplitOptions {
|
|
2
|
+
type?: 'char' | 'word';
|
|
3
|
+
stagger?: number;
|
|
4
|
+
duration?: number;
|
|
5
|
+
animation?: 'fadeUp' | 'fadeDown' | 'zoomIn' | 'rotateIn' | 'slideLeft';
|
|
6
|
+
}
|
|
7
|
+
export declare class TextSplit {
|
|
8
|
+
private element;
|
|
9
|
+
private originalHTML;
|
|
10
|
+
constructor(element: HTMLElement | string);
|
|
11
|
+
animate(options?: TextSplitOptions): Promise<void>;
|
|
12
|
+
reset(): void;
|
|
13
|
+
}
|
|
14
|
+
export declare function splitText(element: HTMLElement | string, options?: TextSplitOptions): Promise<void>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface WaveTextOptions {
|
|
2
|
+
amplitude?: number;
|
|
3
|
+
frequency?: number;
|
|
4
|
+
speed?: number;
|
|
5
|
+
stagger?: number;
|
|
6
|
+
}
|
|
7
|
+
export declare class WaveText {
|
|
8
|
+
private element;
|
|
9
|
+
private spans;
|
|
10
|
+
private rafId;
|
|
11
|
+
private originalHTML;
|
|
12
|
+
constructor(element: HTMLElement | string);
|
|
13
|
+
start(options?: WaveTextOptions): void;
|
|
14
|
+
stop(): void;
|
|
15
|
+
reset(): void;
|
|
16
|
+
}
|
|
17
|
+
export declare function waveText(element: HTMLElement | string, options?: WaveTextOptions): () => void;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export interface DraggableOptions {
|
|
2
|
+
axis?: 'x' | 'y' | 'both';
|
|
3
|
+
bounds?: HTMLElement | string | null;
|
|
4
|
+
onStart?: (e: PointerEvent) => void;
|
|
5
|
+
onDrag?: (x: number, y: number) => void;
|
|
6
|
+
onEnd?: (x: number, y: number) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare class Draggable {
|
|
9
|
+
private element;
|
|
10
|
+
private options;
|
|
11
|
+
private startX;
|
|
12
|
+
private startY;
|
|
13
|
+
private currentX;
|
|
14
|
+
private currentY;
|
|
15
|
+
private initialTransformX;
|
|
16
|
+
private initialTransformY;
|
|
17
|
+
private pointerId;
|
|
18
|
+
constructor(element: HTMLElement | string, options?: DraggableOptions);
|
|
19
|
+
private onPointerDown;
|
|
20
|
+
private onPointerMove;
|
|
21
|
+
private onPointerUp;
|
|
22
|
+
destroy(): void;
|
|
23
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface SpringOptions {
|
|
2
|
+
stiffness?: number;
|
|
3
|
+
damping?: number;
|
|
4
|
+
mass?: number;
|
|
5
|
+
precision?: number;
|
|
6
|
+
}
|
|
7
|
+
export interface SpringTarget {
|
|
8
|
+
from: number;
|
|
9
|
+
to: number;
|
|
10
|
+
onUpdate: (value: number) => void;
|
|
11
|
+
onComplete?: () => void;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* 物理弹簧动画,基于胡克定律
|
|
15
|
+
*/
|
|
16
|
+
export declare function spring(target: SpringTarget, options?: SpringOptions): () => void;
|
|
17
|
+
/**
|
|
18
|
+
* 弹性缩放:元素像弹簧一样弹到目标大小
|
|
19
|
+
*/
|
|
20
|
+
export declare function elasticScale(element: HTMLElement | string, toScale?: number, options?: SpringOptions): () => void;
|
|
21
|
+
/**
|
|
22
|
+
* 弹性移动
|
|
23
|
+
*/
|
|
24
|
+
export declare function elasticMove(element: HTMLElement | string, toX: number, toY: number, options?: SpringOptions): () => void;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
|
|
2
|
+
export { Animator } from './core/animator.ts';
|
|
3
|
+
export { Timeline } from './core/timeline.ts';
|
|
4
|
+
export type { AnimationName, AnimationOptions } from './core/utils.ts';
|
|
5
|
+
export { fadeIn, fadeOut, slideInUp, slideInDown, slideInLeft, slideInRight, slideOutUp, slideOutDown, zoomIn, zoomOut, bounceIn, bounceOut, flipInX, flipInY, shake, pulse, rotateIn, } from './presets/index.ts';
|
|
6
|
+
export * as presets from './presets/index.ts';
|
|
7
|
+
export { ScrollTrigger, scrollAnimate } from './scroll/scroll-trigger.ts';
|
|
8
|
+
export type { ScrollTriggerOptions } from './scroll/scroll-trigger.ts';
|
|
9
|
+
export { Typewriter, typewrite } from './text/typewriter.ts';
|
|
10
|
+
export { CountUp, countUp } from './text/count-up.ts';
|
|
11
|
+
export type { TypewriterOptions } from './text/typewriter.ts';
|
|
12
|
+
export type { CountUpOptions } from './text/count-up.ts';
|
|
13
|
+
export { spring, elasticScale, elasticMove } from './gesture/spring.ts';
|
|
14
|
+
export { Draggable } from './gesture/draggable.ts';
|
|
15
|
+
export type { SpringOptions, SpringTarget } from './gesture/spring.ts';
|
|
16
|
+
export type { DraggableOptions } from './gesture/draggable.ts';
|
|
17
|
+
export { addRipple, rippleEffect } from './micro/ripple.ts';
|
|
18
|
+
export { hoverLift, hoverGlow } from './micro/hover-lift.ts';
|
|
19
|
+
export type { RippleOptions } from './micro/ripple.ts';
|
|
20
|
+
export type { HoverLiftOptions } from './micro/hover-lift.ts';
|
|
21
|
+
export { particleBurst, particleAt } from './effects/particle.ts';
|
|
22
|
+
export { TextSplit, splitText } from './effects/text-split.ts';
|
|
23
|
+
export { glitch, glitchLoop } from './effects/glitch.ts';
|
|
24
|
+
export { WaveText, waveText } from './effects/wave-text.ts';
|
|
25
|
+
export type { ParticleOptions } from './effects/particle.ts';
|
|
26
|
+
export type { TextSplitOptions } from './effects/text-split.ts';
|
|
27
|
+
export type { GlitchOptions } from './effects/glitch.ts';
|
|
28
|
+
export type { WaveTextOptions } from './effects/wave-text.ts';
|
|
29
|
+
export { parallax, parallaxGroup } from './transitions/parallax.ts';
|
|
30
|
+
export { shimmer, skeleton } from './transitions/shimmer.ts';
|
|
31
|
+
export { blurReveal, blurRevealChildren } from './transitions/blur-reveal.ts';
|
|
32
|
+
export { lazyImage, lazyImages } from './transitions/lazy-image.ts';
|
|
33
|
+
export type { ParallaxOptions } from './transitions/parallax.ts';
|
|
34
|
+
export type { ShimmerOptions } from './transitions/shimmer.ts';
|
|
35
|
+
export type { BlurRevealOptions } from './transitions/blur-reveal.ts';
|
|
36
|
+
export type { LazyImageOptions } from './transitions/lazy-image.ts';
|
|
37
|
+
export { expand, collapse, toggleCollapse } from './transitions/collapse.ts';
|
|
38
|
+
export { listStagger } from './transitions/list.ts';
|
|
39
|
+
export { showLoading, fullscreenLoading } from './transitions/loading.ts';
|
|
40
|
+
export { toast, toastSuccess, toastError, toastWarning, notify } from './transitions/toast.ts';
|
|
41
|
+
export type { CollapseOptions } from './transitions/collapse.ts';
|
|
42
|
+
export type { ListStaggerOptions } from './transitions/list.ts';
|
|
43
|
+
export type { LoadingOptions } from './transitions/loading.ts';
|
|
44
|
+
export type { ToastOptions } from './transitions/toast.ts';
|
|
45
|
+
export { magnetic, magneticText } from './interactive/magnetic.ts';
|
|
46
|
+
export { CoverFlow, createCoverFlow } from './interactive/coverflow.ts';
|
|
47
|
+
export { FlipCard, createFlipCard } from './interactive/flip-card.ts';
|
|
48
|
+
export { cursorTrail } from './interactive/cursor-trail.ts';
|
|
49
|
+
export type { MagneticOptions } from './interactive/magnetic.ts';
|
|
50
|
+
export type { CoverFlowOptions } from './interactive/coverflow.ts';
|
|
51
|
+
export type { FlipCardOptions } from './interactive/flip-card.ts';
|
|
52
|
+
export type { CursorTrailOptions } from './interactive/cursor-trail.ts';
|
|
53
|
+
export { withMotion, staggerEnter } from './motion/component-motion.ts';
|
|
54
|
+
export type { MotionOptions, MicroAnimation } from './motion/component-motion.ts';
|
|
55
|
+
export { FocusTrap } from './a11y/focus-trap.ts';
|
|
56
|
+
export { onKey, Keys } from './a11y/keyboard.ts';
|
|
57
|
+
export { theme, ThemeManager } from './theme/theme.ts';
|
|
58
|
+
export { MkRow, createRow } from './components/layout/row.ts';
|
|
59
|
+
export { MkSpace, createSpace } from './components/layout/space.ts';
|
|
60
|
+
export { MkDivider, createDivider } from './components/layout/divider.ts';
|
|
61
|
+
export { MkButton, createButton } from './components/button/button.ts';
|
|
62
|
+
export { MkInput, createInput } from './components/input/input.ts';
|
|
63
|
+
export { MkCard, createCard } from './components/card/card.ts';
|
|
64
|
+
export { MkDialog, createDialog } from './components/dialog/dialog.ts';
|
|
65
|
+
export { MkDrawer, createDrawer } from './components/drawer/drawer.ts';
|
|
66
|
+
export { message, messageSuccess, messageError, messageWarning } from './components/message/message.ts';
|
|
67
|
+
export { MkSwitch, createSwitch } from './components/switch/switch.ts';
|
|
68
|
+
export { showLoading as showComponentLoading, showFullscreenLoading } from './components/loading/loading.ts';
|
|
69
|
+
export { MkSelect, createSelect } from './components/form/select.ts';
|
|
70
|
+
export { MkCheckbox, createCheckbox, MkCheckboxGroup } from './components/form/checkbox.ts';
|
|
71
|
+
export { MkRadio, MkRadioGroup } from './components/form/radio.ts';
|
|
72
|
+
export { MkSlider } from './components/form/slider.ts';
|
|
73
|
+
export { MkTable } from './components/table/table.ts';
|
|
74
|
+
export { MkTag, createTag } from './components/tag/tag.ts';
|
|
75
|
+
export { createTooltip } from './components/tooltip/tooltip.ts';
|
|
76
|
+
export { MkTabs, createTabs } from './components/tabs/tabs.ts';
|
|
77
|
+
export { MkAvatar, createAvatar } from './components/avatar/avatar.ts';
|
|
78
|
+
export { MkAlert, createAlert } from './components/alert/alert.ts';
|
|
79
|
+
export { MkProgress, createProgress } from './components/progress/progress.ts';
|
|
80
|
+
export { MkCollapse, createCollapse } from './components/collapse/collapse.ts';
|
|
81
|
+
export { MkEmpty, createEmpty } from './components/empty/empty.ts';
|
|
82
|
+
export { MkPopover, createPopover } from './components/popover/popover.ts';
|
|
83
|
+
export { MkMenu, createMenu } from './components/menu/menu.ts';
|
|
84
|
+
export { MkBreadcrumb, createBreadcrumb } from './components/breadcrumb/breadcrumb.ts';
|
|
85
|
+
export { MkSteps, createSteps } from './components/steps/steps.ts';
|
|
86
|
+
export type { ButtonOptions } from './components/button/button.ts';
|
|
87
|
+
export type { InputOptions } from './components/input/input.ts';
|
|
88
|
+
export type { CardOptions } from './components/card/card.ts';
|
|
89
|
+
export type { DialogOptions } from './components/dialog/dialog.ts';
|
|
90
|
+
export type { DrawerOptions } from './components/drawer/drawer.ts';
|
|
91
|
+
export type { MessageOptions } from './components/message/message.ts';
|
|
92
|
+
export type { SwitchOptions } from './components/switch/switch.ts';
|
|
93
|
+
export type { SelectOptions, SelectOption } from './components/form/select.ts';
|
|
94
|
+
export type { CheckboxOptions } from './components/form/checkbox.ts';
|
|
95
|
+
export type { RadioOptions } from './components/form/radio.ts';
|
|
96
|
+
export type { SliderOptions } from './components/form/slider.ts';
|
|
97
|
+
export type { TableColumn, TableOptions } from './components/table/table.ts';
|
|
98
|
+
export type { TagOptions } from './components/tag/tag.ts';
|
|
99
|
+
export type { TooltipOptions } from './components/tooltip/tooltip.ts';
|
|
100
|
+
export type { TabsOptions, TabItem } from './components/tabs/tabs.ts';
|
|
101
|
+
export type { AvatarOptions } from './components/avatar/avatar.ts';
|
|
102
|
+
export type { AlertOptions } from './components/alert/alert.ts';
|
|
103
|
+
export type { ProgressOptions } from './components/progress/progress.ts';
|
|
104
|
+
export type { CollapsePanelOptions, CollapseItem } from './components/collapse/collapse.ts';
|
|
105
|
+
export type { EmptyOptions } from './components/empty/empty.ts';
|
|
106
|
+
export type { PopoverOptions } from './components/popover/popover.ts';
|
|
107
|
+
export type { MenuOptions, MenuItem } from './components/menu/menu.ts';
|
|
108
|
+
export type { BreadcrumbOptions, BreadcrumbItem } from './components/breadcrumb/breadcrumb.ts';
|
|
109
|
+
export type { StepsOptions, StepItem } from './components/steps/steps.ts';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface CoverFlowOptions {
|
|
2
|
+
perspective?: number;
|
|
3
|
+
rotateY?: number;
|
|
4
|
+
spacing?: number;
|
|
5
|
+
scale?: number;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* 3D 封面流轮播
|
|
9
|
+
*/
|
|
10
|
+
export declare class CoverFlow {
|
|
11
|
+
private container;
|
|
12
|
+
private cards;
|
|
13
|
+
private currentIndex;
|
|
14
|
+
private options;
|
|
15
|
+
constructor(container: HTMLElement | string, cardSelector: string, options?: CoverFlowOptions);
|
|
16
|
+
goTo(index: number): this;
|
|
17
|
+
next(): this;
|
|
18
|
+
prev(): this;
|
|
19
|
+
private update;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* 快捷方法创建 CoverFlow
|
|
23
|
+
*/
|
|
24
|
+
export declare function createCoverFlow(container: HTMLElement | string, cardSelector: string, options?: CoverFlowOptions): CoverFlow;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface FlipCardOptions {
|
|
2
|
+
axis?: 'x' | 'y';
|
|
3
|
+
duration?: number;
|
|
4
|
+
perspective?: number;
|
|
5
|
+
}
|
|
6
|
+
export declare class FlipCard {
|
|
7
|
+
private container;
|
|
8
|
+
private inner;
|
|
9
|
+
private front;
|
|
10
|
+
private back;
|
|
11
|
+
private flipped;
|
|
12
|
+
private options;
|
|
13
|
+
constructor(container: HTMLElement | string, options?: FlipCardOptions);
|
|
14
|
+
toggle(): this;
|
|
15
|
+
flipToFront(): this;
|
|
16
|
+
flipToBack(): this;
|
|
17
|
+
}
|
|
18
|
+
export declare function createFlipCard(container: HTMLElement | string, options?: FlipCardOptions): FlipCard;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface MagneticOptions {
|
|
2
|
+
strength?: number;
|
|
3
|
+
radius?: number;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* 磁性按钮:鼠标靠近时被吸引
|
|
7
|
+
*/
|
|
8
|
+
export declare function magnetic(element: HTMLElement | string, options?: MagneticOptions): () => void;
|
|
9
|
+
/**
|
|
10
|
+
* 磁性文字:每个字符独立被吸引
|
|
11
|
+
*/
|
|
12
|
+
export declare function magneticText(element: HTMLElement | string, options?: MagneticOptions): () => void;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface HoverLiftOptions {
|
|
2
|
+
y?: number;
|
|
3
|
+
scale?: number;
|
|
4
|
+
shadow?: string;
|
|
5
|
+
duration?: number;
|
|
6
|
+
easing?: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* 给元素添加悬浮抬升效果
|
|
10
|
+
*/
|
|
11
|
+
export declare function hoverLift(element: HTMLElement | string, options?: HoverLiftOptions): () => void;
|
|
12
|
+
/**
|
|
13
|
+
* 给元素添加悬浮发光效果
|
|
14
|
+
*/
|
|
15
|
+
export declare function hoverGlow(element: HTMLElement | string, color?: string, options?: Pick<HoverLiftOptions, 'duration' | 'easing'>): () => void;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface RippleOptions {
|
|
2
|
+
color?: string;
|
|
3
|
+
duration?: number;
|
|
4
|
+
maxScale?: number;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* 给元素添加 Material Design 风格的水波纹点击效果
|
|
8
|
+
*/
|
|
9
|
+
export declare function addRipple(element: HTMLElement | string, options?: RippleOptions): () => void;
|
|
10
|
+
/**
|
|
11
|
+
* 一次性水波纹(不绑定事件,立即播放)
|
|
12
|
+
*/
|
|
13
|
+
export declare function rippleEffect(element: HTMLElement | string, options?: RippleOptions): Promise<void>;
|