@jis3r/icons 1.25.0 → 1.25.2
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/package.json +18 -13
- package/dist/components/github.svelte +0 -13
- package/dist/components/github.svelte.d.ts +0 -26
- package/dist/components/navbar.svelte +0 -78
- package/dist/components/navbar.svelte.d.ts +0 -6
- package/dist/components/ui/badge/badge.svelte +0 -43
- package/dist/components/ui/badge/badge.svelte.d.ts +0 -41
- package/dist/components/ui/badge/index.d.ts +0 -1
- package/dist/components/ui/badge/index.js +0 -2
- package/dist/components/ui/button/button.svelte +0 -57
- package/dist/components/ui/button/button.svelte.d.ts +0 -69
- package/dist/components/ui/button/index.d.ts +0 -3
- package/dist/components/ui/button/index.js +0 -9
- package/dist/components/ui/card/card-content.svelte +0 -9
- package/dist/components/ui/card/card-content.svelte.d.ts +0 -15
- package/dist/components/ui/card/card-description.svelte +0 -9
- package/dist/components/ui/card/card-description.svelte.d.ts +0 -15
- package/dist/components/ui/card/card-footer.svelte +0 -9
- package/dist/components/ui/card/card-footer.svelte.d.ts +0 -15
- package/dist/components/ui/card/card-header.svelte +0 -9
- package/dist/components/ui/card/card-header.svelte.d.ts +0 -15
- package/dist/components/ui/card/card-title.svelte +0 -15
- package/dist/components/ui/card/card-title.svelte.d.ts +0 -17
- package/dist/components/ui/card/card.svelte +0 -13
- package/dist/components/ui/card/card.svelte.d.ts +0 -15
- package/dist/components/ui/card/index.d.ts +0 -7
- package/dist/components/ui/card/index.js +0 -22
- package/dist/components/ui/input/index.d.ts +0 -2
- package/dist/components/ui/input/index.js +0 -7
- package/dist/components/ui/input/input.svelte +0 -37
- package/dist/components/ui/input/input.svelte.d.ts +0 -19
- package/dist/components/ui/tooltip/index.d.ts +0 -6
- package/dist/components/ui/tooltip/index.js +0 -18
- package/dist/components/ui/tooltip/tooltip-content.svelte +0 -16
- package/dist/components/ui/tooltip/tooltip-content.svelte.d.ts +0 -15
- package/dist/icons/index.d.ts +0 -13
- package/dist/icons/index.js +0 -5834
- package/dist/utils/debounce.d.ts +0 -8
- package/dist/utils/debounce.js +0 -15
- package/dist/utils/icons.d.ts +0 -3
- package/dist/utils/icons.js +0 -70
- package/dist/utils.d.ts +0 -1
- package/dist/utils.js +0 -6
package/dist/utils/debounce.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Creates a debounced version of a function that delays its execution
|
|
3
|
-
* until after a specified delay has elapsed since the last time it was invoked.
|
|
4
|
-
* @param {Function} fn - The function to debounce
|
|
5
|
-
* @param {number} delay - The delay in milliseconds
|
|
6
|
-
* @returns {Function} The debounced function
|
|
7
|
-
*/
|
|
8
|
-
export function debounce(fn: Function, delay: number): Function;
|
package/dist/utils/debounce.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Creates a debounced version of a function that delays its execution
|
|
3
|
-
* until after a specified delay has elapsed since the last time it was invoked.
|
|
4
|
-
* @param {Function} fn - The function to debounce
|
|
5
|
-
* @param {number} delay - The delay in milliseconds
|
|
6
|
-
* @returns {Function} The debounced function
|
|
7
|
-
*/
|
|
8
|
-
export function debounce(fn, delay) {
|
|
9
|
-
let timeoutId;
|
|
10
|
-
|
|
11
|
-
return function (...args) {
|
|
12
|
-
clearTimeout(timeoutId);
|
|
13
|
-
timeoutId = setTimeout(() => fn.apply(this, args), delay);
|
|
14
|
-
};
|
|
15
|
-
}
|
package/dist/utils/icons.d.ts
DELETED
package/dist/utils/icons.js
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import iflog from 'iflog';
|
|
2
|
-
|
|
3
|
-
export let getIconSource = async (iconName) => {
|
|
4
|
-
try {
|
|
5
|
-
// Create a map of all icon files at build time
|
|
6
|
-
const iconModules = import.meta.glob('/src/lib/icons/*.svelte', {
|
|
7
|
-
query: '?raw',
|
|
8
|
-
import: 'default',
|
|
9
|
-
eager: false
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
// Find the matching icon module
|
|
13
|
-
const iconPath = `/src/lib/icons/${iconName}.svelte`;
|
|
14
|
-
if (!(iconPath in iconModules)) {
|
|
15
|
-
throw new Error(`Icon ${iconName} not found`);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
// Import the source code
|
|
19
|
-
return await iconModules[iconPath]();
|
|
20
|
-
} catch (error) {
|
|
21
|
-
throw new Error(`Icon ${iconName} not found: ${error.message}`);
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export let preloadIconSources = async (icons) => {
|
|
26
|
-
try {
|
|
27
|
-
// Create a map of all icon files at build time
|
|
28
|
-
const iconModules = import.meta.glob('/src/lib/icons/*.svelte', {
|
|
29
|
-
query: '?raw',
|
|
30
|
-
import: 'default',
|
|
31
|
-
eager: false
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
// Start loading all icons in parallel
|
|
35
|
-
const loadPromises = icons.map(async (icon) => {
|
|
36
|
-
const iconPath = `/src/lib/icons/${icon.name}.svelte`;
|
|
37
|
-
if (iconPath in iconModules) {
|
|
38
|
-
// Directly store the source in the icon object
|
|
39
|
-
icon.source = await iconModules[iconPath]();
|
|
40
|
-
}
|
|
41
|
-
return icon;
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
// Wait for all to complete and return the updated icons array
|
|
45
|
-
return await Promise.all(loadPromises);
|
|
46
|
-
} catch (error) {
|
|
47
|
-
iflog.error('Failed to preload icon sources:', error);
|
|
48
|
-
throw error;
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
export let downloadIcon = async (icon) => {
|
|
53
|
-
try {
|
|
54
|
-
if (!icon.source) {
|
|
55
|
-
// Fetch the source if not already loaded
|
|
56
|
-
icon.source = await getIconSource(icon.name);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
const blob = new Blob([icon.source], { type: 'text/plain' });
|
|
60
|
-
const url = URL.createObjectURL(blob);
|
|
61
|
-
const link = document.createElement('a');
|
|
62
|
-
link.href = url;
|
|
63
|
-
link.download = `${icon.name}.svelte`;
|
|
64
|
-
link.click();
|
|
65
|
-
URL.revokeObjectURL(url);
|
|
66
|
-
} catch (error) {
|
|
67
|
-
iflog.error(`Failed to download icon ${icon.name}:`, error);
|
|
68
|
-
throw error;
|
|
69
|
-
}
|
|
70
|
-
};
|
package/dist/utils.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export function cn(...inputs: any[]): string;
|