@hyvor/icons 2.0.0-beta.2 → 2.0.0-beta.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/Icon.svelte +6 -6
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/package.json +1 -1
package/dist/Icon.svelte
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { icons } from "./index.js";
|
|
2
3
|
import type { IconName } from "./types.js";
|
|
3
4
|
|
|
4
5
|
interface Props {
|
|
@@ -21,12 +22,11 @@
|
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
async function getSvg() {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
25
|
+
const path = `./icons/${name}.svg`;
|
|
26
|
+
const loader = icons[path];
|
|
27
|
+
if (!loader) return '[?]';
|
|
28
|
+
const raw = await loader();
|
|
29
|
+
return addAttributes(raw as string);
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
const svg = await getSvg();
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED