@nice2dev/icons 1.3.12 → 1.3.14

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,146 +0,0 @@
1
- /**
2
- * @file micro-interactions.tsx
3
- * @description Micro-interactions library for nice2dev icons
4
- *
5
- * Provides hover, click, focus, and visibility effects for icons.
6
- * 20+ presets for common UI interactions.
7
- *
8
- * @example
9
- * ```tsx
10
- * <NtdInteractiveIcon
11
- * icon={NtdHeart}
12
- * hoverEffect="lift"
13
- * clickEffect="ripple"
14
- * focusEffect="glow"
15
- * />
16
- * ```
17
- *
18
- * @version 1.0.0
19
- * @since 2026-03
20
- * @license MIT
21
- */
22
- import React from 'react';
23
- import type { NtdIconProps } from './types';
24
- /**
25
- * Type alias for icon components
26
- */
27
- export type IconComponent = React.ComponentType<NtdIconProps>;
28
- /**
29
- * Alias for compatibility
30
- */
31
- export type IconProps = NtdIconProps;
32
- /**
33
- * Hover effect types
34
- */
35
- export type HoverEffect = 'lift' | 'grow' | 'shrink' | 'rotate' | 'tilt' | 'shake' | 'bounce' | 'pulse' | 'glow' | 'swing' | 'float' | 'heartbeat' | 'flip' | 'wobble' | 'jello' | 'rubberband' | 'tada' | 'pop' | 'bloom' | 'neon' | 'none';
36
- /**
37
- * Click/Tap effect types
38
- */
39
- export type ClickEffect = 'ripple' | 'burst' | 'shrinkBounce' | 'flash' | 'shake' | 'spin' | 'confetti' | 'explode' | 'implode' | 'ring' | 'checkmark' | 'success' | 'error' | 'scale' | 'none';
40
- /**
41
- * Focus effect types
42
- */
43
- export type FocusEffect = 'glow' | 'ring' | 'outline' | 'shadow' | 'pulse' | 'highlight' | 'underline' | 'border' | 'none';
44
- /**
45
- * Visibility/scroll effect types
46
- */
47
- export type VisibleEffect = 'fadeIn' | 'slideUp' | 'slideDown' | 'slideLeft' | 'slideRight' | 'zoomIn' | 'flipIn' | 'bounceIn' | 'rotateIn' | 'none';
48
- /**
49
- * Effect timing configuration
50
- */
51
- export interface EffectTiming {
52
- duration?: number;
53
- delay?: number;
54
- easing?: string;
55
- }
56
- /**
57
- * Glow color presets
58
- */
59
- export type GlowColor = 'primary' | 'secondary' | 'success' | 'warning' | 'error' | 'info' | string;
60
- /**
61
- * Interactive icon props
62
- */
63
- export interface NtdInteractiveIconProps extends Omit<IconProps, 'ref'> {
64
- /** The icon component to render */
65
- icon: IconComponent;
66
- /** Hover effect type */
67
- hoverEffect?: HoverEffect;
68
- /** Click/tap effect type */
69
- clickEffect?: ClickEffect;
70
- /** Focus effect type */
71
- focusEffect?: FocusEffect;
72
- /** Effect when element becomes visible (IntersectionObserver) */
73
- visibleEffect?: VisibleEffect;
74
- /** Custom timing for hover effect */
75
- hoverTiming?: EffectTiming;
76
- /** Custom timing for click effect */
77
- clickTiming?: EffectTiming;
78
- /** Custom timing for focus effect */
79
- focusTiming?: EffectTiming;
80
- /** Custom timing for visible effect */
81
- visibleTiming?: EffectTiming;
82
- /** Glow color for glow effects */
83
- glowColor?: GlowColor;
84
- /** Intensity of effects (0-1) */
85
- intensity?: number;
86
- /** Enable haptic feedback (if available) */
87
- haptic?: boolean;
88
- /** Sound effect URL */
89
- soundUrl?: string;
90
- /** Callback on click */
91
- onClick?: (event: React.MouseEvent) => void;
92
- /** Callback on hover start */
93
- onHoverStart?: () => void;
94
- /** Callback on hover end */
95
- onHoverEnd?: () => void;
96
- /** Callback when visible */
97
- onVisible?: () => void;
98
- /** Disable all interactions */
99
- disabled?: boolean;
100
- /** Additional wrapper className */
101
- wrapperClassName?: string;
102
- /** Inline wrapper styles */
103
- wrapperStyle?: React.CSSProperties;
104
- }
105
- export declare const hoverEffectPresets: Record<Exclude<HoverEffect, 'none'>, React.CSSProperties>;
106
- export declare const clickEffectStyles: Record<Exclude<ClickEffect, 'none'>, string>;
107
- export declare const focusEffectStyles: Record<Exclude<FocusEffect, 'none'>, React.CSSProperties>;
108
- export declare const visibleEffectStyles: Record<Exclude<VisibleEffect, 'none'>, React.CSSProperties>;
109
- /**
110
- * Interactive icon wrapper with micro-interaction effects
111
- *
112
- * @example
113
- * ```tsx
114
- * <NtdInteractiveIcon
115
- * icon={NtdHeart}
116
- * hoverEffect="lift"
117
- * clickEffect="ripple"
118
- * focusEffect="glow"
119
- * glowColor="error"
120
- * />
121
- * ```
122
- */
123
- export declare const NtdInteractiveIcon: React.ForwardRefExoticComponent<NtdInteractiveIconProps & React.RefAttributes<HTMLDivElement>>;
124
- /** Lift on hover + ripple on click */
125
- export declare const NtdLiftIcon: React.ForwardRefExoticComponent<Omit<NtdInteractiveIconProps, "hoverEffect" | "clickEffect"> & React.RefAttributes<HTMLDivElement>>;
126
- /** Heart icon with heartbeat hover */
127
- export declare const NtdHeartbeatIcon: React.ForwardRefExoticComponent<Omit<NtdInteractiveIconProps, "hoverEffect" | "clickEffect"> & React.RefAttributes<HTMLDivElement>>;
128
- /** Bounce on hover */
129
- export declare const NtdBounceIcon: React.ForwardRefExoticComponent<Omit<NtdInteractiveIconProps, "hoverEffect"> & React.RefAttributes<HTMLDivElement>>;
130
- /** Neon glow effect */
131
- export declare const NtdNeonIcon: React.ForwardRefExoticComponent<Omit<NtdInteractiveIconProps, "hoverEffect"> & React.RefAttributes<HTMLDivElement>>;
132
- /** Success feedback */
133
- export declare const NtdSuccessIcon: React.ForwardRefExoticComponent<Omit<NtdInteractiveIconProps, "glowColor" | "clickEffect"> & React.RefAttributes<HTMLDivElement>>;
134
- /** Error feedback */
135
- export declare const NtdErrorIcon: React.ForwardRefExoticComponent<Omit<NtdInteractiveIconProps, "glowColor" | "clickEffect"> & React.RefAttributes<HTMLDivElement>>;
136
- /** Animated on scroll */
137
- export declare const NtdScrollRevealIcon: React.ForwardRefExoticComponent<Omit<NtdInteractiveIconProps, "visibleEffect"> & React.RefAttributes<HTMLDivElement>>;
138
- /** All hover effect names */
139
- export declare const allHoverEffects: HoverEffect[];
140
- /** All click effect names */
141
- export declare const allClickEffects: ClickEffect[];
142
- /** All focus effect names */
143
- export declare const allFocusEffects: FocusEffect[];
144
- /** All visible effect names */
145
- export declare const allVisibleEffects: VisibleEffect[];
146
- export default NtdInteractiveIcon;
@@ -1,174 +0,0 @@
1
- /**
2
- * @file microInteractions.tsx
3
- * @description Micro-interactions library for icons
4
- *
5
- * Provides hover, click, and focus effects for icons with 20+ presets.
6
- *
7
- * @version 1.0.0
8
- * @since 2026-03
9
- * @license MIT
10
- */
11
- import React from 'react';
12
- import type { NtdIconProps } from './types';
13
- /** Hover effect presets */
14
- export type HoverEffect = 'lift' | 'grow' | 'shrink' | 'rotate' | 'spin' | 'wobble' | 'pulse' | 'bounce' | 'shake' | 'flip' | 'tilt-left' | 'tilt-right' | 'glow' | 'shadow' | 'color-shift' | 'invert' | 'blur-in' | 'none';
15
- /** Click effect presets */
16
- export type ClickEffect = 'ripple' | 'pop' | 'push' | 'rubber' | 'jello' | 'heartbeat' | 'flash' | 'tada' | 'squeeze' | 'none';
17
- /** Focus effect presets */
18
- export type FocusEffect = 'glow' | 'ring' | 'outline' | 'pulse' | 'highlight' | 'none';
19
- /** Props for NtdInteractiveIcon */
20
- export interface NtdInteractiveIconProps extends Omit<NtdIconProps, 'ref'> {
21
- /** The icon component to render */
22
- icon: React.ComponentType<NtdIconProps>;
23
- /** Effect on hover */
24
- hoverEffect?: HoverEffect;
25
- /** Effect on click */
26
- clickEffect?: ClickEffect;
27
- /** Effect on focus */
28
- focusEffect?: FocusEffect;
29
- /** Duration of hover effect in ms */
30
- hoverDuration?: number;
31
- /** Duration of click effect in ms */
32
- clickDuration?: number;
33
- /** Custom hover styles */
34
- hoverStyle?: React.CSSProperties;
35
- /** Custom click styles */
36
- clickStyle?: React.CSSProperties;
37
- /** Easing function */
38
- easing?: string;
39
- /** Callback on hover start */
40
- onHoverStart?: () => void;
41
- /** Callback on hover end */
42
- onHoverEnd?: () => void;
43
- /** Callback on click animation complete */
44
- onClickComplete?: () => void;
45
- /** Disable all interactions */
46
- disabled?: boolean;
47
- /** Tabindex for focus */
48
- tabIndex?: number;
49
- }
50
- /**
51
- * NtdInteractiveIcon - Icon with micro-interactions
52
- *
53
- * @example
54
- * ```tsx
55
- * <NtdInteractiveIcon
56
- * icon={NtdHeart}
57
- * hoverEffect="lift"
58
- * clickEffect="pop"
59
- * focusEffect="glow"
60
- * />
61
- * ```
62
- */
63
- export declare const NtdInteractiveIcon: React.ForwardRefExoticComponent<NtdInteractiveIconProps & React.RefAttributes<HTMLSpanElement>>;
64
- /** Preset interaction configurations */
65
- export declare const interactionPresets: {
66
- /** Subtle lift on hover */
67
- subtle: {
68
- hoverEffect: HoverEffect;
69
- clickEffect: ClickEffect;
70
- focusEffect: FocusEffect;
71
- };
72
- /** Playful bouncy interactions */
73
- playful: {
74
- hoverEffect: HoverEffect;
75
- clickEffect: ClickEffect;
76
- focusEffect: FocusEffect;
77
- };
78
- /** Professional, minimal */
79
- professional: {
80
- hoverEffect: HoverEffect;
81
- clickEffect: ClickEffect;
82
- focusEffect: FocusEffect;
83
- };
84
- /** Fun, energetic */
85
- energetic: {
86
- hoverEffect: HoverEffect;
87
- clickEffect: ClickEffect;
88
- focusEffect: FocusEffect;
89
- };
90
- /** Material Design style */
91
- material: {
92
- hoverEffect: HoverEffect;
93
- clickEffect: ClickEffect;
94
- focusEffect: FocusEffect;
95
- };
96
- /** Elastic, rubbery feel */
97
- elastic: {
98
- hoverEffect: HoverEffect;
99
- clickEffect: ClickEffect;
100
- focusEffect: FocusEffect;
101
- };
102
- /** Attention-grabbing */
103
- attention: {
104
- hoverEffect: HoverEffect;
105
- clickEffect: ClickEffect;
106
- focusEffect: FocusEffect;
107
- };
108
- /** Notification/alert style */
109
- alert: {
110
- hoverEffect: HoverEffect;
111
- clickEffect: ClickEffect;
112
- focusEffect: FocusEffect;
113
- };
114
- };
115
- export interface UseMicroInteractionOptions {
116
- hoverEffect?: HoverEffect;
117
- clickEffect?: ClickEffect;
118
- focusEffect?: FocusEffect;
119
- hoverDuration?: number;
120
- clickDuration?: number;
121
- disabled?: boolean;
122
- }
123
- export interface UseMicroInteractionReturn {
124
- isHovered: boolean;
125
- isClicking: boolean;
126
- isFocused: boolean;
127
- handlers: {
128
- onMouseEnter: () => void;
129
- onMouseLeave: () => void;
130
- onClick: () => void;
131
- onFocus: () => void;
132
- onBlur: () => void;
133
- };
134
- style: React.CSSProperties;
135
- }
136
- /**
137
- * Hook for adding micro-interactions to any element
138
- *
139
- * @example
140
- * ```tsx
141
- * const { handlers, style } = useMicroInteraction({
142
- * hoverEffect: 'lift',
143
- * clickEffect: 'pop',
144
- * });
145
- *
146
- * return <div {...handlers} style={style}>Content</div>;
147
- * ```
148
- */
149
- export declare function useMicroInteraction(options?: UseMicroInteractionOptions): UseMicroInteractionReturn;
150
- /** Props for quick effect wrappers */
151
- interface QuickEffectProps {
152
- children: React.ReactNode;
153
- duration?: number;
154
- disabled?: boolean;
155
- className?: string;
156
- style?: React.CSSProperties;
157
- }
158
- /**
159
- * Quick hover lift effect wrapper
160
- */
161
- export declare function HoverLift({ children, duration, disabled, className, style, }: QuickEffectProps): React.JSX.Element;
162
- /**
163
- * Quick click pop effect wrapper
164
- */
165
- export declare function ClickPop({ children, duration, disabled, className, style, }: QuickEffectProps): React.JSX.Element;
166
- /**
167
- * Quick ripple effect wrapper
168
- */
169
- export declare function ClickRipple({ children, duration, disabled, className, style, }: QuickEffectProps): React.JSX.Element;
170
- /**
171
- * Quick focus glow effect wrapper
172
- */
173
- export declare function FocusGlow({ children, disabled, className, style }: QuickEffectProps): React.JSX.Element;
174
- export {};