@nice2dev/icons 1.0.31 → 1.1.6
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/CHANGELOG.md +227 -0
- package/dist/cjs/NiceDesktopIconExporter.js +1 -2
- package/dist/cjs/NiceDesktopIconExporter.js.map +1 -1
- package/dist/cjs/NiceFaviconGenerator.js +2 -3
- package/dist/cjs/NiceFaviconGenerator.js.map +1 -1
- package/dist/cjs/NiceIconEditor.js +0 -1
- package/dist/cjs/NiceIconEditor.js.map +1 -1
- package/dist/cjs/NiceIconPicker.js +0 -1
- package/dist/cjs/NiceIconPicker.js.map +1 -1
- package/dist/cjs/NiceIconPreview.js +0 -1
- package/dist/cjs/NiceIconPreview.js.map +1 -1
- package/dist/cjs/NiceIconSetCreator.js +0 -1
- package/dist/cjs/NiceIconSetCreator.js.map +1 -1
- package/dist/cjs/NtdIconBadge.js +0 -1
- package/dist/cjs/NtdIconBadge.js.map +1 -1
- package/dist/cjs/NtdIconMorph.js +3 -4
- package/dist/cjs/NtdIconMorph.js.map +1 -1
- package/dist/cjs/NtdStateMorph.js +0 -1
- package/dist/cjs/NtdStateMorph.js.map +1 -1
- package/dist/cjs/advancedIconSearch.js +0 -1
- package/dist/cjs/advancedIconSearch.js.map +1 -1
- package/dist/cjs/animationControls.js +0 -1
- package/dist/cjs/animationControls.js.map +1 -1
- package/dist/cjs/client.js +33 -0
- package/dist/cjs/createIcon.js +21 -5
- package/dist/cjs/createIcon.js.map +1 -1
- package/dist/cjs/design-tokens.js +459 -0
- package/dist/cjs/figmaExport.js +12 -2
- package/dist/cjs/figmaExport.js.map +1 -1
- package/dist/cjs/figmaSync.js +0 -1
- package/dist/cjs/figmaSync.js.map +1 -1
- package/dist/cjs/headless-ui.js +430 -0
- package/dist/cjs/iconAnalytics.js +0 -1
- package/dist/cjs/iconAnalytics.js.map +1 -1
- package/dist/cjs/iconMetadata.js +0 -1
- package/dist/cjs/iconMetadata.js.map +1 -1
- package/dist/cjs/iconStyles.js +0 -1
- package/dist/cjs/iconStyles.js.map +1 -1
- package/dist/cjs/icons/accessibility.js +0 -1
- package/dist/cjs/icons/accessibility.js.map +1 -1
- package/dist/cjs/icons/actions.js +22 -11
- package/dist/cjs/icons/actions.js.map +1 -1
- package/dist/cjs/icons/ai.js +0 -1
- package/dist/cjs/icons/ai.js.map +1 -1
- package/dist/cjs/icons/brand.js +0 -1
- package/dist/cjs/icons/brand.js.map +1 -1
- package/dist/cjs/icons/business.js +5 -6
- package/dist/cjs/icons/business.js.map +1 -1
- package/dist/cjs/icons/devtech.js +0 -1
- package/dist/cjs/icons/devtech.js.map +1 -1
- package/dist/cjs/icons/ecommerce.js +0 -1
- package/dist/cjs/icons/ecommerce.js.map +1 -1
- package/dist/cjs/icons/education.js +0 -1
- package/dist/cjs/icons/education.js.map +1 -1
- package/dist/cjs/icons/files.js +0 -1
- package/dist/cjs/icons/files.js.map +1 -1
- package/dist/cjs/icons/fintech.js +0 -1
- package/dist/cjs/icons/fintech.js.map +1 -1
- package/dist/cjs/icons/food.js +0 -1
- package/dist/cjs/icons/food.js.map +1 -1
- package/dist/cjs/icons/fun.js +0 -1
- package/dist/cjs/icons/fun.js.map +1 -1
- package/dist/cjs/icons/gaming.js +0 -1
- package/dist/cjs/icons/gaming.js.map +1 -1
- package/dist/cjs/icons/health.js +5 -6
- package/dist/cjs/icons/health.js.map +1 -1
- package/dist/cjs/icons/index.js +0 -1
- package/dist/cjs/icons/index.js.map +1 -1
- package/dist/cjs/icons/legal.js +0 -1
- package/dist/cjs/icons/legal.js.map +1 -1
- package/dist/cjs/icons/media.js +24 -16
- package/dist/cjs/icons/media.js.map +1 -1
- package/dist/cjs/icons/navigation.js +0 -1
- package/dist/cjs/icons/navigation.js.map +1 -1
- package/dist/cjs/icons/omniverk.js +0 -1
- package/dist/cjs/icons/omniverk.js.map +1 -1
- package/dist/cjs/icons/realestate.js +0 -1
- package/dist/cjs/icons/realestate.js.map +1 -1
- package/dist/cjs/icons/saas.js +0 -1
- package/dist/cjs/icons/saas.js.map +1 -1
- package/dist/cjs/icons/science.js +12 -6
- package/dist/cjs/icons/science.js.map +1 -1
- package/dist/cjs/icons/shapes.js +5 -6
- package/dist/cjs/icons/shapes.js.map +1 -1
- package/dist/cjs/icons/smarthome.js +0 -1
- package/dist/cjs/icons/smarthome.js.map +1 -1
- package/dist/cjs/icons/social.js +15 -16
- package/dist/cjs/icons/social.js.map +1 -1
- package/dist/cjs/icons/sports.js +0 -1
- package/dist/cjs/icons/sports.js.map +1 -1
- package/dist/cjs/icons/sustainability.js +0 -1
- package/dist/cjs/icons/sustainability.js.map +1 -1
- package/dist/cjs/icons/travel.js +0 -1
- package/dist/cjs/icons/travel.js.map +1 -1
- package/dist/cjs/icons/ui.js +19 -16
- package/dist/cjs/icons/ui.js.map +1 -1
- package/dist/cjs/icons/weather.js +23 -11
- package/dist/cjs/icons/weather.js.map +1 -1
- package/dist/cjs/index.js +0 -1
- package/dist/cjs/lottieIntegration.js +0 -1
- package/dist/cjs/lottieIntegration.js.map +1 -1
- package/dist/cjs/nicetodev-icons.css +1 -1
- package/dist/cjs/particleEffects.js +0 -1
- package/dist/cjs/particleEffects.js.map +1 -1
- package/dist/cjs/resolver.js +0 -1
- package/dist/cjs/resolver.js.map +1 -1
- package/dist/cjs/rsc.js +209 -0
- package/dist/cjs/sharpen.js +147 -0
- package/dist/cjs/sharpen.js.map +1 -0
- package/dist/cjs/smilAnimations.js +0 -1
- package/dist/cjs/smilAnimations.js.map +1 -1
- package/dist/cjs/tailwind-plugin.js +3 -1
- package/dist/cjs/tailwind-plugin.js.map +1 -1
- package/dist/cjs/types.js +0 -1
- package/dist/cjs/types.js.map +1 -1
- package/dist/cjs/utilities.js +401 -0
- package/dist/cjs/variantProps.js +0 -1
- package/dist/cjs/variantProps.js.map +1 -1
- package/dist/esm/NiceDesktopIconExporter.js +1 -2
- package/dist/esm/NiceDesktopIconExporter.js.map +1 -1
- package/dist/esm/NiceFaviconGenerator.js +2 -3
- package/dist/esm/NiceFaviconGenerator.js.map +1 -1
- package/dist/esm/NiceIconEditor.js +0 -1
- package/dist/esm/NiceIconEditor.js.map +1 -1
- package/dist/esm/NiceIconPicker.js +0 -1
- package/dist/esm/NiceIconPicker.js.map +1 -1
- package/dist/esm/NiceIconPreview.js +0 -1
- package/dist/esm/NiceIconPreview.js.map +1 -1
- package/dist/esm/NiceIconSetCreator.js +0 -1
- package/dist/esm/NiceIconSetCreator.js.map +1 -1
- package/dist/esm/NtdIconBadge.js +0 -1
- package/dist/esm/NtdIconBadge.js.map +1 -1
- package/dist/esm/NtdIconMorph.js +3 -4
- package/dist/esm/NtdIconMorph.js.map +1 -1
- package/dist/esm/NtdStateMorph.js +0 -1
- package/dist/esm/NtdStateMorph.js.map +1 -1
- package/dist/esm/advancedIconSearch.js +0 -1
- package/dist/esm/advancedIconSearch.js.map +1 -1
- package/dist/esm/animationControls.js +0 -1
- package/dist/esm/animationControls.js.map +1 -1
- package/dist/esm/client.js +5 -0
- package/dist/esm/createIcon.js +22 -6
- package/dist/esm/createIcon.js.map +1 -1
- package/dist/esm/design-tokens.js +446 -0
- package/dist/esm/figmaExport.js +12 -2
- package/dist/esm/figmaExport.js.map +1 -1
- package/dist/esm/figmaSync.js +0 -1
- package/dist/esm/figmaSync.js.map +1 -1
- package/dist/esm/headless-ui.js +413 -0
- package/dist/esm/iconAnalytics.js +0 -1
- package/dist/esm/iconAnalytics.js.map +1 -1
- package/dist/esm/iconMetadata.js +0 -1
- package/dist/esm/iconMetadata.js.map +1 -1
- package/dist/esm/iconStyles.js +0 -1
- package/dist/esm/iconStyles.js.map +1 -1
- package/dist/esm/icons/accessibility.js +0 -1
- package/dist/esm/icons/accessibility.js.map +1 -1
- package/dist/esm/icons/actions.js +22 -11
- package/dist/esm/icons/actions.js.map +1 -1
- package/dist/esm/icons/ai.js +0 -1
- package/dist/esm/icons/ai.js.map +1 -1
- package/dist/esm/icons/brand.js +0 -1
- package/dist/esm/icons/brand.js.map +1 -1
- package/dist/esm/icons/business.js +5 -6
- package/dist/esm/icons/business.js.map +1 -1
- package/dist/esm/icons/devtech.js +0 -1
- package/dist/esm/icons/devtech.js.map +1 -1
- package/dist/esm/icons/ecommerce.js +0 -1
- package/dist/esm/icons/ecommerce.js.map +1 -1
- package/dist/esm/icons/education.js +0 -1
- package/dist/esm/icons/education.js.map +1 -1
- package/dist/esm/icons/files.js +0 -1
- package/dist/esm/icons/files.js.map +1 -1
- package/dist/esm/icons/fintech.js +0 -1
- package/dist/esm/icons/fintech.js.map +1 -1
- package/dist/esm/icons/food.js +0 -1
- package/dist/esm/icons/food.js.map +1 -1
- package/dist/esm/icons/fun.js +0 -1
- package/dist/esm/icons/fun.js.map +1 -1
- package/dist/esm/icons/gaming.js +0 -1
- package/dist/esm/icons/gaming.js.map +1 -1
- package/dist/esm/icons/health.js +5 -6
- package/dist/esm/icons/health.js.map +1 -1
- package/dist/esm/icons/index.js +0 -1
- package/dist/esm/icons/legal.js +0 -1
- package/dist/esm/icons/legal.js.map +1 -1
- package/dist/esm/icons/media.js +24 -16
- package/dist/esm/icons/media.js.map +1 -1
- package/dist/esm/icons/navigation.js +0 -1
- package/dist/esm/icons/navigation.js.map +1 -1
- package/dist/esm/icons/omniverk.js +0 -1
- package/dist/esm/icons/omniverk.js.map +1 -1
- package/dist/esm/icons/realestate.js +0 -1
- package/dist/esm/icons/realestate.js.map +1 -1
- package/dist/esm/icons/saas.js +0 -1
- package/dist/esm/icons/saas.js.map +1 -1
- package/dist/esm/icons/science.js +12 -6
- package/dist/esm/icons/science.js.map +1 -1
- package/dist/esm/icons/shapes.js +5 -6
- package/dist/esm/icons/shapes.js.map +1 -1
- package/dist/esm/icons/smarthome.js +0 -1
- package/dist/esm/icons/smarthome.js.map +1 -1
- package/dist/esm/icons/social.js +15 -16
- package/dist/esm/icons/social.js.map +1 -1
- package/dist/esm/icons/sports.js +0 -1
- package/dist/esm/icons/sports.js.map +1 -1
- package/dist/esm/icons/sustainability.js +0 -1
- package/dist/esm/icons/sustainability.js.map +1 -1
- package/dist/esm/icons/travel.js +0 -1
- package/dist/esm/icons/travel.js.map +1 -1
- package/dist/esm/icons/ui.js +19 -16
- package/dist/esm/icons/ui.js.map +1 -1
- package/dist/esm/icons/weather.js +23 -11
- package/dist/esm/icons/weather.js.map +1 -1
- package/dist/esm/index.js +0 -1
- package/dist/esm/lottieIntegration.js +0 -1
- package/dist/esm/lottieIntegration.js.map +1 -1
- package/dist/esm/nicetodev-icons.css +1 -1
- package/dist/esm/particleEffects.js +0 -1
- package/dist/esm/particleEffects.js.map +1 -1
- package/dist/esm/resolver.js +0 -1
- package/dist/esm/resolver.js.map +1 -1
- package/dist/esm/rsc.js +201 -0
- package/dist/esm/sharpen.js +141 -0
- package/dist/esm/sharpen.js.map +1 -0
- package/dist/esm/smilAnimations.js +0 -1
- package/dist/esm/smilAnimations.js.map +1 -1
- package/dist/esm/tailwind-plugin.js +3 -1
- package/dist/esm/tailwind-plugin.js.map +1 -1
- package/dist/esm/types.js +0 -1
- package/dist/esm/types.js.map +1 -1
- package/dist/esm/utilities.js +384 -0
- package/dist/esm/variantProps.js +0 -1
- package/dist/esm/variantProps.js.map +1 -1
- package/dist/types/animationControls.d.ts +2 -2
- package/dist/types/client.d.ts +2 -2
- package/dist/types/icons/weather.d.ts +7 -0
- package/dist/types/sharpen.d.ts +52 -0
- package/dist/types/types.d.ts +2 -1
- package/package.json +28 -28
|
@@ -0,0 +1,384 @@
|
|
|
1
|
+
import { useEffect, useState, useCallback, createElement, useSyncExternalStore } from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file utilities.ts
|
|
5
|
+
* @description Utility hooks and functions for @nice2dev/icons
|
|
6
|
+
*
|
|
7
|
+
* Provides:
|
|
8
|
+
* - useIcon hook for dynamic icon loading
|
|
9
|
+
* - useReducedMotion hook for accessibility
|
|
10
|
+
* - preloadIcons for performance optimization
|
|
11
|
+
* - Icon type guards and helpers
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* import { useIcon, useReducedMotion, preloadIcons } from '@nice2dev/icons/utilities';
|
|
16
|
+
*
|
|
17
|
+
* // Dynamic icon loading
|
|
18
|
+
* const { Icon, isLoading } = useIcon('NtdHome');
|
|
19
|
+
*
|
|
20
|
+
* // Respect user preference for reduced motion
|
|
21
|
+
* const prefersReducedMotion = useReducedMotion();
|
|
22
|
+
*
|
|
23
|
+
* // Preload icons for better performance
|
|
24
|
+
* await preloadIcons(['NtdHome', 'NtdSearch', 'NtdUser']);
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* @version 1.0.0
|
|
28
|
+
* @since 2026-03
|
|
29
|
+
* @license MIT
|
|
30
|
+
*/
|
|
31
|
+
/* ────────────────────────────────────────────────────────────────────────────
|
|
32
|
+
ICON REGISTRY
|
|
33
|
+
───────────────────────────────────────────────────────────────────────────── */
|
|
34
|
+
/**
|
|
35
|
+
* Global icon cache for dynamic loading
|
|
36
|
+
*/
|
|
37
|
+
const iconRegistry = new Map();
|
|
38
|
+
/**
|
|
39
|
+
* Registers an icon in the global registry
|
|
40
|
+
*/
|
|
41
|
+
function registerIcon(name, component) {
|
|
42
|
+
iconRegistry.set(name, {
|
|
43
|
+
component,
|
|
44
|
+
loadedAt: Date.now(),
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Gets an icon from the registry
|
|
49
|
+
*/
|
|
50
|
+
function getIconFromRegistry(name) {
|
|
51
|
+
var _a;
|
|
52
|
+
return (_a = iconRegistry.get(name)) === null || _a === void 0 ? void 0 : _a.component;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Clears the icon registry
|
|
56
|
+
*/
|
|
57
|
+
function clearIconRegistry() {
|
|
58
|
+
iconRegistry.clear();
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Gets all registered icon names
|
|
62
|
+
*/
|
|
63
|
+
function getRegisteredIconNames() {
|
|
64
|
+
return Array.from(iconRegistry.keys());
|
|
65
|
+
}
|
|
66
|
+
/* ────────────────────────────────────────────────────────────────────────────
|
|
67
|
+
USE ICON HOOK
|
|
68
|
+
───────────────────────────────────────────────────────────────────────────── */
|
|
69
|
+
/**
|
|
70
|
+
* Hook for dynamically loading icons by name.
|
|
71
|
+
*
|
|
72
|
+
* @param iconName - Name of the icon to load (e.g., 'NtdHome')
|
|
73
|
+
* @param options - Loading options
|
|
74
|
+
* @returns Icon component, loading state, and error
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```tsx
|
|
78
|
+
* function DynamicIcon({ name }: { name: string }) {
|
|
79
|
+
* const { Icon, isLoading, error } = useIcon(name);
|
|
80
|
+
*
|
|
81
|
+
* if (isLoading) return <Spinner />;
|
|
82
|
+
* if (error || !Icon) return <FallbackIcon />;
|
|
83
|
+
*
|
|
84
|
+
* return <Icon size="md" />;
|
|
85
|
+
* }
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
88
|
+
function useIcon(iconName, options = {}) {
|
|
89
|
+
const { fallback, cache = true } = options;
|
|
90
|
+
const [state, setState] = useState({
|
|
91
|
+
Icon: iconName ? getIconFromRegistry(iconName) || null : null,
|
|
92
|
+
isLoading: false,
|
|
93
|
+
error: null,
|
|
94
|
+
});
|
|
95
|
+
useEffect(() => {
|
|
96
|
+
if (!iconName) {
|
|
97
|
+
setState({ Icon: null, isLoading: false, error: null });
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
// Check cache first
|
|
101
|
+
const cached = getIconFromRegistry(iconName);
|
|
102
|
+
if (cached) {
|
|
103
|
+
setState({ Icon: cached, isLoading: false, error: null });
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
// Start loading
|
|
107
|
+
setState((prev) => ({ ...prev, isLoading: true, error: null }));
|
|
108
|
+
// Dynamic import (assumes icons are exported individually)
|
|
109
|
+
const loadIcon = async () => {
|
|
110
|
+
try {
|
|
111
|
+
// Try to import from the icons module
|
|
112
|
+
const module = await import('./icons/index.js');
|
|
113
|
+
const IconComponent = module[iconName];
|
|
114
|
+
if (IconComponent) {
|
|
115
|
+
if (cache) {
|
|
116
|
+
registerIcon(iconName, IconComponent);
|
|
117
|
+
}
|
|
118
|
+
setState({ Icon: IconComponent, isLoading: false, error: null });
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
throw new Error(`Icon "${iconName}" not found`);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
catch (err) {
|
|
125
|
+
setState({
|
|
126
|
+
Icon: fallback || null,
|
|
127
|
+
isLoading: false,
|
|
128
|
+
error: err instanceof Error ? err : new Error('Failed to load icon'),
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
loadIcon();
|
|
133
|
+
}, [iconName, cache, fallback]);
|
|
134
|
+
return state;
|
|
135
|
+
}
|
|
136
|
+
/* ────────────────────────────────────────────────────────────────────────────
|
|
137
|
+
USE REDUCED MOTION
|
|
138
|
+
───────────────────────────────────────────────────────────────────────────── */
|
|
139
|
+
/**
|
|
140
|
+
* Subscribes to prefers-reduced-motion media query.
|
|
141
|
+
*/
|
|
142
|
+
function subscribeToReducedMotion(callback) {
|
|
143
|
+
if (typeof window === 'undefined') {
|
|
144
|
+
return () => { };
|
|
145
|
+
}
|
|
146
|
+
const mediaQuery = window.matchMedia('(prefers-reduced-motion: reduce)');
|
|
147
|
+
const handler = () => callback();
|
|
148
|
+
mediaQuery.addEventListener('change', handler);
|
|
149
|
+
return () => mediaQuery.removeEventListener('change', handler);
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Gets current reduced motion preference.
|
|
153
|
+
*/
|
|
154
|
+
function getReducedMotionSnapshot() {
|
|
155
|
+
if (typeof window === 'undefined') {
|
|
156
|
+
return false;
|
|
157
|
+
}
|
|
158
|
+
return window.matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Server snapshot for SSR (assumes no reduced motion preference).
|
|
162
|
+
*/
|
|
163
|
+
function getReducedMotionServerSnapshot() {
|
|
164
|
+
return false;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Hook that returns true if user prefers reduced motion.
|
|
168
|
+
* Uses useSyncExternalStore for SSR compatibility.
|
|
169
|
+
*
|
|
170
|
+
* @returns Whether the user prefers reduced motion
|
|
171
|
+
*
|
|
172
|
+
* @example
|
|
173
|
+
* ```tsx
|
|
174
|
+
* function AnimatedIcon() {
|
|
175
|
+
* const prefersReducedMotion = useReducedMotion();
|
|
176
|
+
*
|
|
177
|
+
* return (
|
|
178
|
+
* <NtdHeart
|
|
179
|
+
* animation={prefersReducedMotion ? undefined : 'pulse'}
|
|
180
|
+
* />
|
|
181
|
+
* );
|
|
182
|
+
* }
|
|
183
|
+
* ```
|
|
184
|
+
*/
|
|
185
|
+
function useReducedMotion() {
|
|
186
|
+
return useSyncExternalStore(subscribeToReducedMotion, getReducedMotionSnapshot, getReducedMotionServerSnapshot);
|
|
187
|
+
}
|
|
188
|
+
/* ────────────────────────────────────────────────────────────────────────────
|
|
189
|
+
PRELOAD ICONS
|
|
190
|
+
───────────────────────────────────────────────────────────────────────────── */
|
|
191
|
+
/**
|
|
192
|
+
* Preloads icons into the registry for instant access.
|
|
193
|
+
*
|
|
194
|
+
* @param iconNames - Array of icon names to preload
|
|
195
|
+
* @returns Promise that resolves when all icons are loaded
|
|
196
|
+
*
|
|
197
|
+
* @example
|
|
198
|
+
* ```tsx
|
|
199
|
+
* // Preload critical icons at app startup
|
|
200
|
+
* useEffect(() => {
|
|
201
|
+
* preloadIcons(['NtdHome', 'NtdSearch', 'NtdUser', 'NtdMenu']);
|
|
202
|
+
* }, []);
|
|
203
|
+
* ```
|
|
204
|
+
*/
|
|
205
|
+
async function preloadIcons(iconNames) {
|
|
206
|
+
const results = new Map();
|
|
207
|
+
try {
|
|
208
|
+
const module = await import('./icons/index.js');
|
|
209
|
+
for (const name of iconNames) {
|
|
210
|
+
const IconComponent = module[name];
|
|
211
|
+
if (IconComponent) {
|
|
212
|
+
registerIcon(name, IconComponent);
|
|
213
|
+
results.set(name, IconComponent);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
catch (error) {
|
|
218
|
+
console.warn('Failed to preload icons:', error);
|
|
219
|
+
}
|
|
220
|
+
return results;
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Creates a preloader component that preloads icons on mount.
|
|
224
|
+
*
|
|
225
|
+
* @param iconNames - Icons to preload
|
|
226
|
+
* @returns React component that preloads icons
|
|
227
|
+
*
|
|
228
|
+
* @example
|
|
229
|
+
* ```tsx
|
|
230
|
+
* const IconPreloader = createIconPreloader(['NtdHome', 'NtdSearch']);
|
|
231
|
+
*
|
|
232
|
+
* function App() {
|
|
233
|
+
* return (
|
|
234
|
+
* <>
|
|
235
|
+
* <IconPreloader />
|
|
236
|
+
* <MainContent />
|
|
237
|
+
* </>
|
|
238
|
+
* );
|
|
239
|
+
* }
|
|
240
|
+
* ```
|
|
241
|
+
*/
|
|
242
|
+
function createIconPreloader(iconNames) {
|
|
243
|
+
return function IconPreloader() {
|
|
244
|
+
useEffect(() => {
|
|
245
|
+
preloadIcons(iconNames);
|
|
246
|
+
}, []);
|
|
247
|
+
return null;
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
/* ────────────────────────────────────────────────────────────────────────────
|
|
251
|
+
ICON PROPS HELPERS
|
|
252
|
+
───────────────────────────────────────────────────────────────────────────── */
|
|
253
|
+
/**
|
|
254
|
+
* Creates props with animation disabled if user prefers reduced motion.
|
|
255
|
+
*
|
|
256
|
+
* @param props - Original icon props
|
|
257
|
+
* @param prefersReducedMotion - Whether user prefers reduced motion
|
|
258
|
+
* @returns Props with animation conditionally disabled
|
|
259
|
+
*/
|
|
260
|
+
function withReducedMotionProps(props, prefersReducedMotion) {
|
|
261
|
+
if (!prefersReducedMotion) {
|
|
262
|
+
return props;
|
|
263
|
+
}
|
|
264
|
+
return {
|
|
265
|
+
...props,
|
|
266
|
+
animation: undefined,
|
|
267
|
+
animationDuration: undefined,
|
|
268
|
+
gradientAnimation: undefined,
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* Creates accessible icon props based on context.
|
|
273
|
+
*
|
|
274
|
+
* @param options - Accessibility options
|
|
275
|
+
* @returns Icon props for accessibility
|
|
276
|
+
*/
|
|
277
|
+
function createAccessibleIconProps(options) {
|
|
278
|
+
const { label, isDecorative = !label, role } = options;
|
|
279
|
+
if (isDecorative) {
|
|
280
|
+
return {
|
|
281
|
+
'aria-hidden': true,
|
|
282
|
+
role: 'presentation',
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
return {
|
|
286
|
+
'aria-label': label,
|
|
287
|
+
role: role || 'img',
|
|
288
|
+
title: label,
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
/* ────────────────────────────────────────────────────────────────────────────
|
|
292
|
+
ICON TYPE GUARDS
|
|
293
|
+
───────────────────────────────────────────────────────────────────────────── */
|
|
294
|
+
/**
|
|
295
|
+
* Checks if a value is a valid icon component.
|
|
296
|
+
* Handles both regular components and forwardRef components.
|
|
297
|
+
*/
|
|
298
|
+
function isIconComponent(value) {
|
|
299
|
+
if (value == null) {
|
|
300
|
+
return false;
|
|
301
|
+
}
|
|
302
|
+
// ForwardRef components are objects with $$typeof, regular components are functions
|
|
303
|
+
const isValidComponent = typeof value === 'function' || (typeof value === 'object' && '$$typeof' in value);
|
|
304
|
+
if (!isValidComponent) {
|
|
305
|
+
return false;
|
|
306
|
+
}
|
|
307
|
+
const displayName = value.displayName;
|
|
308
|
+
return typeof displayName === 'string' && displayName.startsWith('Ntd');
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* Checks if an icon name is valid.
|
|
312
|
+
*/
|
|
313
|
+
function isValidIconName(name) {
|
|
314
|
+
return /^Ntd[A-Z][a-zA-Z0-9]*$/.test(name);
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* Creates a function that renders multiple icons efficiently.
|
|
318
|
+
*
|
|
319
|
+
* @param configs - Array of icon configurations
|
|
320
|
+
* @returns Function that renders all configured icons
|
|
321
|
+
*
|
|
322
|
+
* @example
|
|
323
|
+
* ```tsx
|
|
324
|
+
* const renderNavIcons = createBatchIconRenderer([
|
|
325
|
+
* { name: 'NtdHome', props: { size: 'md' } },
|
|
326
|
+
* { name: 'NtdSearch', props: { size: 'md' } },
|
|
327
|
+
* { name: 'NtdUser', props: { size: 'md' } },
|
|
328
|
+
* ]);
|
|
329
|
+
*
|
|
330
|
+
* // In component
|
|
331
|
+
* const icons = renderNavIcons();
|
|
332
|
+
* ```
|
|
333
|
+
*/
|
|
334
|
+
function useBatchIcons(configs) {
|
|
335
|
+
const [icons, setIcons] = useState(new Map());
|
|
336
|
+
const [isLoading, setIsLoading] = useState(true);
|
|
337
|
+
useEffect(() => {
|
|
338
|
+
const loadIcons = async () => {
|
|
339
|
+
setIsLoading(true);
|
|
340
|
+
const names = configs.map((c) => c.name);
|
|
341
|
+
const loadedIcons = await preloadIcons(names);
|
|
342
|
+
setIcons(loadedIcons);
|
|
343
|
+
setIsLoading(false);
|
|
344
|
+
};
|
|
345
|
+
loadIcons();
|
|
346
|
+
}, [configs.map((c) => c.name).join(',')]);
|
|
347
|
+
const renderIcon = useCallback((name, additionalProps) => {
|
|
348
|
+
const Icon = icons.get(name);
|
|
349
|
+
const config = configs.find((c) => c.name === name);
|
|
350
|
+
if (!Icon) {
|
|
351
|
+
return null;
|
|
352
|
+
}
|
|
353
|
+
const mergedProps = {
|
|
354
|
+
...config === null || config === void 0 ? void 0 : config.props,
|
|
355
|
+
...additionalProps,
|
|
356
|
+
};
|
|
357
|
+
return createElement(Icon, mergedProps);
|
|
358
|
+
}, [icons, configs]);
|
|
359
|
+
return {
|
|
360
|
+
renderIcon,
|
|
361
|
+
isLoading,
|
|
362
|
+
icons,
|
|
363
|
+
};
|
|
364
|
+
}
|
|
365
|
+
/* ────────────────────────────────────────────────────────────────────────────
|
|
366
|
+
EXPORTS
|
|
367
|
+
───────────────────────────────────────────────────────────────────────────── */
|
|
368
|
+
var utilities = {
|
|
369
|
+
useIcon,
|
|
370
|
+
useReducedMotion,
|
|
371
|
+
preloadIcons,
|
|
372
|
+
createIconPreloader,
|
|
373
|
+
registerIcon,
|
|
374
|
+
getIconFromRegistry,
|
|
375
|
+
clearIconRegistry,
|
|
376
|
+
getRegisteredIconNames,
|
|
377
|
+
withReducedMotionProps,
|
|
378
|
+
createAccessibleIconProps,
|
|
379
|
+
isIconComponent,
|
|
380
|
+
isValidIconName,
|
|
381
|
+
useBatchIcons,
|
|
382
|
+
};
|
|
383
|
+
|
|
384
|
+
export { clearIconRegistry, createAccessibleIconProps, createIconPreloader, utilities as default, getIconFromRegistry, getRegisteredIconNames, isIconComponent, isValidIconName, preloadIcons, registerIcon, useBatchIcons, useIcon, useReducedMotion, withReducedMotionProps };
|
package/dist/esm/variantProps.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"variantProps.js","sources":["../../src/variantProps.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;AAsBG;AAkIH;;AAEgF;AAEhF;AACM,SAAU,YAAY,CAAC,KAAuB,EAAA;AAClD,IAAA,OAAO,KAAK,CAAC,OAAO,KAAK,OAAO;AAClC;AAEA;AACM,SAAU,cAAc,CAAC,KAAuB,EAAA;AACpD,IAAA,OAAO,KAAK,CAAC,OAAO,KAAK,SAAS;AACpC;AAEA;AACM,SAAU,cAAc,CAAC,KAAuB,EAAA;AACpD,IAAA,OAAO,KAAK,CAAC,OAAO,KAAK,SAAS;AACpC;AAEA;AACM,SAAU,aAAa,CAAC,KAAuB,EAAA;AACnD,IAAA,OAAO,KAAK,CAAC,OAAO,KAAK,QAAQ;AACnC;AAEA;AACM,SAAU,WAAW,CAAC,KAAuB,EAAA;AACjD,IAAA,OAAO,KAAK,CAAC,OAAO,KAAK,MAAM;AACjC;AAEA;AACM,SAAU,YAAY,CAAC,KAAuB,EAAA;AAClD,IAAA,OAAO,KAAK,CAAC,OAAO,KAAK,OAAO;AAClC;AAEA;AACM,SAAU,cAAc,CAAC,KAAuB,EAAA;AACpD,IAAA,OAAO,KAAK,CAAC,OAAO,KAAK,SAAS;AACpC;AAEA;AACM,SAAU,WAAW,CAAC,KAAuB,EAAA;AACjD,IAAA,OAAO,KAAK,CAAC,OAAO,KAAK,MAAM;AACjC;AAEA;AACM,SAAU,aAAa,CAAC,KAAuB,EAAA;AACnD,IAAA,OAAO,KAAK,CAAC,OAAO,KAAK,IAAI;AAC/B;AAEA;AACM,SAAU,YAAY,CAAC,KAAuB,EAAA;AAClD,IAAA,OAAO,KAAK,CAAC,OAAO,KAAK,OAAO;AAClC;AAEA;;;AAGG;AACG,SAAU,WAAW,CAAC,KAAuB,EAAA;AACjD,IAAA,OAAO,KAAqB;AAC9B
|
|
1
|
+
{"version":3,"file":"variantProps.js","sources":["../../src/variantProps.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;AAsBG;AAkIH;;AAEgF;AAEhF;AACM,SAAU,YAAY,CAAC,KAAuB,EAAA;AAClD,IAAA,OAAO,KAAK,CAAC,OAAO,KAAK,OAAO;AAClC;AAEA;AACM,SAAU,cAAc,CAAC,KAAuB,EAAA;AACpD,IAAA,OAAO,KAAK,CAAC,OAAO,KAAK,SAAS;AACpC;AAEA;AACM,SAAU,cAAc,CAAC,KAAuB,EAAA;AACpD,IAAA,OAAO,KAAK,CAAC,OAAO,KAAK,SAAS;AACpC;AAEA;AACM,SAAU,aAAa,CAAC,KAAuB,EAAA;AACnD,IAAA,OAAO,KAAK,CAAC,OAAO,KAAK,QAAQ;AACnC;AAEA;AACM,SAAU,WAAW,CAAC,KAAuB,EAAA;AACjD,IAAA,OAAO,KAAK,CAAC,OAAO,KAAK,MAAM;AACjC;AAEA;AACM,SAAU,YAAY,CAAC,KAAuB,EAAA;AAClD,IAAA,OAAO,KAAK,CAAC,OAAO,KAAK,OAAO;AAClC;AAEA;AACM,SAAU,cAAc,CAAC,KAAuB,EAAA;AACpD,IAAA,OAAO,KAAK,CAAC,OAAO,KAAK,SAAS;AACpC;AAEA;AACM,SAAU,WAAW,CAAC,KAAuB,EAAA;AACjD,IAAA,OAAO,KAAK,CAAC,OAAO,KAAK,MAAM;AACjC;AAEA;AACM,SAAU,aAAa,CAAC,KAAuB,EAAA;AACnD,IAAA,OAAO,KAAK,CAAC,OAAO,KAAK,IAAI;AAC/B;AAEA;AACM,SAAU,YAAY,CAAC,KAAuB,EAAA;AAClD,IAAA,OAAO,KAAK,CAAC,OAAO,KAAK,OAAO;AAClC;AAEA;;;AAGG;AACG,SAAU,WAAW,CAAC,KAAuB,EAAA;AACjD,IAAA,OAAO,KAAqB;AAC9B;;"}
|
|
@@ -95,7 +95,7 @@ export interface AnimationControllerHandle {
|
|
|
95
95
|
*/
|
|
96
96
|
export interface AnimationControllerProps {
|
|
97
97
|
/** Child element to animate (icon component) */
|
|
98
|
-
children: React.ReactElement
|
|
98
|
+
children: React.ReactElement<any>;
|
|
99
99
|
/** Single animation or sequence config */
|
|
100
100
|
animation: AnimationType | AnimationSequenceConfig;
|
|
101
101
|
/** Auto-play on mount (default: false) */
|
|
@@ -122,7 +122,7 @@ export interface AnimationControllerProps {
|
|
|
122
122
|
*/
|
|
123
123
|
export interface InteractiveIconProps {
|
|
124
124
|
/** Child icon element */
|
|
125
|
-
children: React.ReactElement
|
|
125
|
+
children: React.ReactElement<any>;
|
|
126
126
|
/** Interactive animation config */
|
|
127
127
|
config: InteractiveAnimationConfig;
|
|
128
128
|
/** Disable interactions */
|
package/dist/types/client.d.ts
CHANGED
|
@@ -19,9 +19,9 @@ export { AnimationController, InteractiveIcon, useAnimationSequence, createAnima
|
|
|
19
19
|
export type { AnimationStep, AnimationSequenceConfig, AnimationPlaybackState, AnimationTrigger, InteractiveAnimationConfig, AnimationControllerHandle, AnimationControllerProps, InteractiveIconProps, } from './animationControls';
|
|
20
20
|
export { NiceIconPicker } from './NiceIconPicker';
|
|
21
21
|
export type { NiceIconPickerProps, NiceIconPickerHandle, IconPickerEntry } from './NiceIconPicker';
|
|
22
|
-
export { NtdIconMorph, NtdPathMorph, NtdMorphPair, useMorphState
|
|
22
|
+
export { NtdIconMorph, NtdPathMorph, NtdMorphPair, useMorphState } from './NtdIconMorph';
|
|
23
23
|
export type { NtdIconMorphProps, NtdPathMorphProps, NtdMorphPairProps, MorphTrigger, } from './NtdIconMorph';
|
|
24
|
-
export { NtdBadge, NtdStatusDot, NtdIconOverlay, NtdIconStack
|
|
24
|
+
export { NtdBadge, NtdStatusDot, NtdIconOverlay, NtdIconStack } from './NtdIconBadge';
|
|
25
25
|
export type { NtdBadgeProps, NtdStatusDotProps, NtdIconOverlayProps, NtdIconStackProps, BadgePosition, StatusType, } from './NtdIconBadge';
|
|
26
26
|
export { generateSmilAnimation, SmilAnimationWrapper, createSmilAnimationDef, isSmilSupported, SMIL_ANIMATION_TYPES, } from './smilAnimations';
|
|
27
27
|
export type { SmilAnimationType, SmilAnimationConfig, SmilAnimationWrapperProps, } from './smilAnimations';
|
|
@@ -4,6 +4,13 @@ export declare const NtdRain: import("react").ForwardRefExoticComponent<import("
|
|
|
4
4
|
export declare const NtdSnow: import("react").ForwardRefExoticComponent<import("..").NtdIconProps & import("react").RefAttributes<SVGSVGElement>>;
|
|
5
5
|
export declare const NtdThunderstorm: import("react").ForwardRefExoticComponent<import("..").NtdIconProps & import("react").RefAttributes<SVGSVGElement>>;
|
|
6
6
|
export declare const NtdWind: import("react").ForwardRefExoticComponent<import("..").NtdIconProps & import("react").RefAttributes<SVGSVGElement>>;
|
|
7
|
+
/**
|
|
8
|
+
* Teardrop with a pinched waist: the sides leave the tip almost vertically and
|
|
9
|
+
* only flare out low down (control points stay near the axis until y≈8), so the
|
|
10
|
+
* silhouette reads oval rather than "a circle with a spike". The bulb is an
|
|
11
|
+
* ellipse (rx 5.6 / ry 6.2), taller than it is wide — the previous r=8 circular
|
|
12
|
+
* arc was what made it look round and fat.
|
|
13
|
+
*/
|
|
7
14
|
export declare const NtdDroplet: import("react").ForwardRefExoticComponent<import("..").NtdIconProps & import("react").RefAttributes<SVGSVGElement>>;
|
|
8
15
|
export declare const NtdThermometer: import("react").ForwardRefExoticComponent<import("..").NtdIconProps & import("react").RefAttributes<SVGSVGElement>>;
|
|
9
16
|
export declare const NtdUmbrella: import("react").ForwardRefExoticComponent<import("..").NtdIconProps & import("react").RefAttributes<SVGSVGElement>>;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Scale factor of the `mini` variant, about the icon centre. Shared by the
|
|
4
|
+
* client (`createIcon`) and RSC (`rsc`) renderers so the two stay identical.
|
|
5
|
+
*
|
|
6
|
+
* Thinning the stroke — what `mini` did on its own — is invisible on a filled
|
|
7
|
+
* shape, which left `mini` indistinguishable from `solid` for most of the set.
|
|
8
|
+
*/
|
|
9
|
+
export declare const MINI_SCALE = 0.875;
|
|
10
|
+
/**
|
|
11
|
+
* Turns a rendered `solid` tree into its `sharp` equivalent: square line caps,
|
|
12
|
+
* mitered joins and zeroed corner radii, applied recursively.
|
|
13
|
+
*
|
|
14
|
+
* The `sharp` variant has no per-icon path data — it reuses `paths.solid` — so
|
|
15
|
+
* without this pass it would be pixel-identical to `solid` for every fill-based
|
|
16
|
+
* icon. Overriding rather than defaulting matters: some icons hardcode their
|
|
17
|
+
* own `strokeLinecap` / `strokeLinejoin`, and those must not survive here.
|
|
18
|
+
*
|
|
19
|
+
* Intrinsic (string-typed) elements only — fragments are traversed but never
|
|
20
|
+
* receive SVG attributes.
|
|
21
|
+
*/
|
|
22
|
+
export declare function sharpenTree(node: ReactNode): ReactNode;
|
|
23
|
+
/**
|
|
24
|
+
* The mirror of {@link sharpenTree}: round line caps and joins, and `<rect>`
|
|
25
|
+
* corners rounded to {@link ROUND_RADIUS_RATIO} of the shorter side.
|
|
26
|
+
*
|
|
27
|
+
* `rounded` reuses `paths.solid` exactly like `sharp` does, so without this pass
|
|
28
|
+
* it is indistinguishable from `solid`. Same override-don't-default rule — icons
|
|
29
|
+
* that hardcode square caps have to lose them here.
|
|
30
|
+
*
|
|
31
|
+
* A rect whose `width`/`height` cannot be read keeps whatever radius it had:
|
|
32
|
+
* guessing a radius without knowing the box would deform the shape. Rectangles
|
|
33
|
+
* drawn as `<path>` are out of reach either way — the same limitation
|
|
34
|
+
* `sharpenTree` documents above.
|
|
35
|
+
*/
|
|
36
|
+
export declare function roundTree(node: ReactNode): ReactNode;
|
|
37
|
+
/**
|
|
38
|
+
* Stroke width of the `wireframe` variant — a thin, uniform construction line,
|
|
39
|
+
* deliberately independent of the caller's `strokeWidth` so a wireframe grid
|
|
40
|
+
* draws at one consistent weight.
|
|
41
|
+
*/
|
|
42
|
+
export declare const WIREFRAME_STROKE = 1;
|
|
43
|
+
/**
|
|
44
|
+
* Turns a rendered tree into its `wireframe` equivalent: every shape becomes an
|
|
45
|
+
* unfilled thin outline in the primary colour, keeping the interior construction
|
|
46
|
+
* that `outline` drops (creases, inner discs, duotone underlays).
|
|
47
|
+
*
|
|
48
|
+
* Fed from `paths.solid`, because that layer carries the whole construction —
|
|
49
|
+
* `outline` is the silhouette only. Per-shape `opacity` is cleared as well, so a
|
|
50
|
+
* faint duotone wash does not survive as a ghost line.
|
|
51
|
+
*/
|
|
52
|
+
export declare function wireTree(node: ReactNode, color: string): ReactNode;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -26,6 +26,7 @@ export type IconSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | 'xxl' | 'xxxl'
|
|
|
26
26
|
*
|
|
27
27
|
* - `'solid'` — Filled icon shapes.
|
|
28
28
|
* - `'outline'` — Stroked paths only, no fill.
|
|
29
|
+
* - `'wireframe'` — Thin uniform construction lines: every shape, including interior detail `outline` drops.
|
|
29
30
|
* - `'duotone'` — Two-tone rendering with a filled background layer at reduced opacity.
|
|
30
31
|
* - `'cutout'` — Knockout/cutout: colored background shape with icon silhouette cut out.
|
|
31
32
|
* - `'flat'` — Deprecated alias for `'cutout'`.
|
|
@@ -45,7 +46,7 @@ export type IconSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | 'xxl' | 'xxxl'
|
|
|
45
46
|
* <NtdHeart variant="vivid" primaryColor="#e74c3c" secondaryColor="#f472b6" /> // Colorful
|
|
46
47
|
* ```
|
|
47
48
|
*/
|
|
48
|
-
export type IconVariant = 'solid' | 'outline' | 'duotone' | 'cutout' | 'flat' | 'sharp' | 'rounded' | 'mini' | '3d' | 'vivid';
|
|
49
|
+
export type IconVariant = 'solid' | 'outline' | 'wireframe' | 'duotone' | 'cutout' | 'flat' | 'sharp' | 'rounded' | 'mini' | '3d' | 'vivid';
|
|
49
50
|
/**
|
|
50
51
|
* Shape of the background for the `'cutout'` variant.
|
|
51
52
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nice2dev/icons",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.6",
|
|
4
4
|
"description": "Beautiful, lightweight, multi-color SVG icon library for React with animations",
|
|
5
5
|
"author": "NiceToDev <contact@nicetodev.com>",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"import": "./dist/esm/utilities.js",
|
|
53
53
|
"require": "./dist/cjs/utilities.js"
|
|
54
54
|
},
|
|
55
|
-
"./styles.css": "./dist/
|
|
55
|
+
"./styles.css": "./dist/esm/nicetodev-icons.css"
|
|
56
56
|
},
|
|
57
57
|
"bin": {
|
|
58
58
|
"ntd-icons": "./bin/ntd-icons.mjs"
|
|
@@ -106,34 +106,34 @@
|
|
|
106
106
|
"react-dom": ">=17.0.0"
|
|
107
107
|
},
|
|
108
108
|
"devDependencies": {
|
|
109
|
-
"@chromatic-com/storybook": "^5.
|
|
110
|
-
"@rollup/plugin-commonjs": "^
|
|
111
|
-
"@rollup/plugin-node-resolve": "^16.0.
|
|
112
|
-
"@rollup/plugin-typescript": "^12.
|
|
113
|
-
"@storybook/addon-a11y": "^10.
|
|
114
|
-
"@storybook/addon-docs": "^10.
|
|
115
|
-
"@storybook/addon-vitest": "^10.
|
|
116
|
-
"@storybook/react-vite": "^10.
|
|
117
|
-
"@testing-library/jest-dom": "^
|
|
118
|
-
"@testing-library/react": "^16.3.
|
|
119
|
-
"@types/react": "^
|
|
120
|
-
"@types/react-dom": "^
|
|
121
|
-
"@vitejs/plugin-react": "^4.
|
|
122
|
-
"@vitest/browser-playwright": "^4.1.
|
|
123
|
-
"@vitest/coverage-v8": "^4.1.
|
|
109
|
+
"@chromatic-com/storybook": "^5.3.1",
|
|
110
|
+
"@rollup/plugin-commonjs": "^29.0.3",
|
|
111
|
+
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
112
|
+
"@rollup/plugin-typescript": "^12.3.0",
|
|
113
|
+
"@storybook/addon-a11y": "^10.6.0",
|
|
114
|
+
"@storybook/addon-docs": "^10.6.0",
|
|
115
|
+
"@storybook/addon-vitest": "^10.6.0",
|
|
116
|
+
"@storybook/react-vite": "^10.6.0",
|
|
117
|
+
"@testing-library/jest-dom": "^7.0.1",
|
|
118
|
+
"@testing-library/react": "^16.3.3",
|
|
119
|
+
"@types/react": "^19.2.18",
|
|
120
|
+
"@types/react-dom": "^19.2.7",
|
|
121
|
+
"@vitejs/plugin-react": "^4.7.0",
|
|
122
|
+
"@vitest/browser-playwright": "^4.1.11",
|
|
123
|
+
"@vitest/coverage-v8": "^4.1.11",
|
|
124
124
|
"jsdom": "^29.0.0",
|
|
125
|
-
"playwright": "^1.
|
|
126
|
-
"react": "^
|
|
127
|
-
"react-dom": "^
|
|
128
|
-
"rollup": "^4.
|
|
125
|
+
"playwright": "^1.62.1",
|
|
126
|
+
"react": "^19.2.8",
|
|
127
|
+
"react-dom": "^19.2.8",
|
|
128
|
+
"rollup": "^4.63.1",
|
|
129
129
|
"rollup-plugin-postcss": "^4.0.2",
|
|
130
|
-
"storybook": "^10.
|
|
131
|
-
"tslib": "^2.
|
|
132
|
-
"typescript": "^5.
|
|
133
|
-
"vite": "^6.
|
|
134
|
-
"vitest": "^4.1.
|
|
135
|
-
"chromatic": "^
|
|
130
|
+
"storybook": "^10.6.0",
|
|
131
|
+
"tslib": "^2.8.1",
|
|
132
|
+
"typescript": "^5.9.3",
|
|
133
|
+
"vite": "^6.4.1",
|
|
134
|
+
"vitest": "^4.1.11",
|
|
135
|
+
"chromatic": "^18.7.2",
|
|
136
136
|
"conventional-changelog-cli": "^5.0.0",
|
|
137
|
-
"conventional-changelog-angular": "^
|
|
137
|
+
"conventional-changelog-angular": "^9.4.0"
|
|
138
138
|
}
|
|
139
139
|
}
|