diff --git a/README.md b/README.md index 9d74f2f..6fcd91f 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ # svelte-simple-icons -This package provides the [Simple Icons 14.7.0](https://github.com/simple-icons/simple-icons/releases/tag/14.7.0) packaged as a set of [Svelte](https://svelte.dev/) components. +This package provides the [Simple Icons 14.8.0](https://github.com/simple-icons/simple-icons/releases/tag/14.8.0) packaged as a set of [Svelte](https://svelte.dev/) components. www.npmjs.com! @@ -27,10 +27,10 @@ This package provides the [Simple Icons 14.7.0](https://github.com/simple-icons/ Install the package in your project directory with: ```sh -// with yarn +# with yarn yarn add @icons-pack/svelte-simple-icons -// with npm +# with npm npm add @icons-pack/svelte-simple-icons ``` @@ -45,83 +45,51 @@ All icons are imported from a single file, where [ICON SLUG] is replaced by a ca ## Basic example ```svelte - - + + - + - + - + - + ``` ## Change title ```svelte - - + + - + ``` ## Custom styles ```svelte - - - - - -``` - -## Type Definition for Dynamic Icons in Svelte Components - -Sometimes, we want to provide the component dynamically to a component. We can do that by using `svelte:component` feature with the -helper type `SiComponentType` type definition. - -```svelte - - - - ``` @@ -132,8 +100,8 @@ If you only need a few icons, you can import them individually instead of the en ```svelte diff --git a/package.json b/package.json index 8d600f2..f003ff5 100644 --- a/package.json +++ b/package.json @@ -57,24 +57,24 @@ "release": "changeset publish" }, "devDependencies": { - "@changesets/changelog-github": "0.5.0", - "@changesets/cli": "2.27.11", - "@sveltejs/adapter-auto": "3.1.1", - "@sveltejs/kit": "2.5.4", - "@sveltejs/package": "2.3.0", - "@sveltejs/vite-plugin-svelte": "3.0.2", + "@changesets/changelog-github": "0.5.1", + "@changesets/cli": "2.28.1", + "@sveltejs/adapter-auto": "4.0.0", + "@sveltejs/kit": "2.17.2", + "@sveltejs/package": "2.3.10", + "@sveltejs/vite-plugin-svelte": "5.0.3", "signale": "1.4.0", - "simple-icons": "14.7.0", - "svelte": "4.2.12", - "svelte-check": "3.6.8", - "tslib": "2.6.2", + "simple-icons": "14.8.0", + "svelte": "5.20.2", + "svelte-check": "4.1.4", + "tslib": "2.8.1", "typescript": "^5", "uppercamelcase": "3.0.0", - "vite": "5.2.6" + "vite": "6.1.1" }, "peerDependencies": { "@sveltejs/kit": "^2.5.0", "svelte": "^4.2.0 || ^5.0.0" }, - "packageManager": "pnpm@9.15.0" -} + "packageManager": "pnpm@10.4.1" +} \ No newline at end of file diff --git a/scripts/generate-components.js b/scripts/generate-components.js index 629d6ba..f041522 100644 --- a/scripts/generate-components.js +++ b/scripts/generate-components.js @@ -29,11 +29,13 @@ fs.writeFileSync(pathIndexExport, "", formatFile); const attrsToString = (attrs) => { return Object.keys(attrs) .map((key) => { - if (key === "width" || key === "height" || key === "fill") { - return key + "={" + attrs[key] + "}"; + if(key === "class") { + return `class={className}` + } else if (key === "width" || key === "height" || key === "fill") { + return `${key}={${attrs[key]}}`; } - return key + '="' + attrs[key] + '"'; + return `${key}="${attrs[key]}"`; }) .join(" "); }; @@ -41,7 +43,7 @@ const attrsToString = (attrs) => { const exportType = ` import type { ComponentType, SvelteComponent } from 'svelte'; -export type SiComponentType = ComponentType>; +export type SiComponentType = ComponentType>; ` fs.appendFileSync(pathIndexExport, exportType, formatFile); @@ -62,20 +64,22 @@ ICONS.forEach((icon) => { height: "size", fill: "color", viewBox: "0 0 24 24", + class: "", }; - const element = ` - - - - {title} - - - `; + const element = ` + + + {title} + +`; const component = element; diff --git a/vite.config.js b/vite.config.js index a4ba168..bbf8c7d 100644 --- a/vite.config.js +++ b/vite.config.js @@ -1,11 +1,6 @@ -import { sveltekit } from "@sveltejs/kit/vite"; +import { sveltekit } from '@sveltejs/kit/vite'; +import { defineConfig } from 'vite'; -/** @type {import('vite').UserConfig} */ -const config = { - plugins: [sveltekit()], - test: { - include: ["src/**/*.{test,spec}.{js,ts}"], - }, -}; - -export default config; +export default defineConfig({ + plugins: [sveltekit()] +});