Compare commits

...
15 Commits
Author SHA1 Message Date
Eric Fennis be94febe4e Add copy license command svelte package 2025-02-10 14:05:04 +01:00
Eric Fennis 6b618cd030 Adjust types 2025-02-10 13:58:34 +01:00
Eric Fennis 884bf6fb10 improve icon node imports 2025-02-06 08:09:57 +01:00
Eric Fennis d2426203c9 try new package 2025-02-06 07:44:47 +01:00
Eric Fennis 7481dd0a3f format(license): add missing semicolon in license script 2025-01-24 16:54:10 +01:00
Eric Fennis f9e93824f1 format package.svg 2025-01-24 14:34:07 +01:00
Abdalrhman Almarakeby 4ba4cf2f35 feat(cog-icon): update tags to add more relevant keywords (#2748) 2025-01-24 14:32:55 +01:00
Eric Fennis 6b29716aa9 Hide add if script is blocked (#2750) 2025-01-24 14:28:54 +01:00
Jakob Guddas 97bbe1d6b2 fix(icons): changed expand icon (#2677)
* Updated icons/expand.svg

* Updated icons/expand.json
2025-01-23 16:54:06 +01:00
Abdalrhman Almarakeby 608da04bdf fix(bolt-icon): correct "contruction" typo in tags to "construction" (#2749) 2025-01-23 16:25:28 +01:00
ケイラandEric Fennis 961404d5cc replace keyof ReactSVG with SVGElementType (#2668)
* replace `keyof ReactSVG` with `SVGElementType`

* define `SVGElementType` locally

* 🧹

* update comments

* Format types.ts

* Update types.ts

* Update types.ts

---------

Co-authored-by: Eric Fennis <eric.fennis@gmail.com>
2025-01-18 16:35:52 +01:00
Sebastian Aarnio f3100b8af1 fix(icons): update package.svg to be consistent with other package-derived icons (#2706) 2025-01-17 16:31:05 +01:00
FootagesandEric Fennis 0df4e2991c feat(icons): added battery-plus icon (#2693)
* Added icons/battery-plus.svg

* Added icons/battery-plus.json

* Updated icons/battery-plus.svg

* Updated icons/battery-plus.json

* Update battery-plus.json

---------

Co-authored-by: Eric Fennis <eric.fennis@gmail.com>
2025-01-17 12:10:28 +01:00
Sean 2b8242fa14 feat(icons): added map-plus icon (#2697)
* Added icons/map-plus.svg

* Added icons/map-plus.json
2025-01-17 12:09:02 +01:00
Lettnald 27c667556b Make sure license ends up in SvelteKit bundle (#2728) 2025-01-17 09:13:47 +01:00
26 changed files with 350 additions and 39 deletions
@@ -5,22 +5,32 @@ import IconButton from '../base/IconButton.vue';
import VPDocAsideCarbonAds from 'vitepress/dist/client/theme-default/components/VPDocAsideCarbonAds.vue'
import { x } from '../../../data/iconNodes'
import createLucideIcon from 'lucide-vue-next/src/createLucideIcon';
import { onMounted, ref } from 'vue';
const { theme } = useData()
const showAd = useSessionStorage('show-carbon-ads',true)
const showAd = useSessionStorage('show-carbon-ads', true)
const carbonLoaded = ref(true)
defineProps<{
drawerOpen: boolean
}>()
const CloseIcon = createLucideIcon('Close', x)
onMounted(() => {
setTimeout(() => {
if (window?._carbonads == null) {
carbonLoaded.value = false
}
}, 5000)
})
</script>
<template>
<div
:class="{
'drawer-open': drawerOpen,
'hide-ad': !showAd
'hide-ad': !(showAd && carbonLoaded)
}"
class="floating-ad"
v-if="theme.carbonAds"
+29
View File
@@ -0,0 +1,29 @@
{
"$schema": "../icon.schema.json",
"contributors": [
"colebemis",
"ericfennis",
"jguddas",
"johnletey",
"Footagesus"
],
"tags": [
"power",
"electricity",
"energy",
"accumulator",
"charge",
"plus",
"economy",
"health",
"add",
"new",
"maximum",
"upgrade",
"extra",
"+"
],
"categories": [
"devices"
]
}
+17
View File
@@ -0,0 +1,17 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M10 9v6" />
<path d="M13.5 7H16a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2h-2.5" />
<path d="M22 11v2" />
<path d="M6.5 17H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h2.5" />
<path d="M7 12h6" />
</svg>

After

Width:  |  Height:  |  Size: 398 B

+1 -1
View File
@@ -14,7 +14,7 @@
"diy",
"fixed",
"build",
"contruction",
"construction",
"parts"
],
"categories": [
+7 -1
View File
@@ -10,7 +10,13 @@
"cog",
"edit",
"gear",
"preferences"
"preferences",
"controls",
"configuration",
"fixed",
"build",
"construction",
"parts"
],
"categories": [
"account"
+8 -3
View File
@@ -2,13 +2,18 @@
"$schema": "../icon.schema.json",
"contributors": [
"mittalyashu",
"ericfennis"
"ericfennis",
"jguddas"
],
"tags": [
"scale",
"fullscreen"
"fullscreen",
"maximize",
"minimize",
"contract"
],
"categories": [
"text"
"text",
"arrows"
]
}
+8 -4
View File
@@ -9,8 +9,12 @@
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="m21 21-6-6m6 6v-4.8m0 4.8h-4.8" />
<path d="M3 16.2V21m0 0h4.8M3 21l6-6" />
<path d="M21 7.8V3m0 0h-4.8M21 3l-6 6" />
<path d="M3 7.8V3m0 0h4.8M3 3l6 6" />
<path d="m15 15 6 6" />
<path d="m15 9 6-6" />
<path d="M21 16.2V21h-4.8" />
<path d="M21 7.8V3h-4.8" />
<path d="M3 16.2V21h4.8" />
<path d="m3 21 6-6" />
<path d="M3 7.8V3h4.8" />
<path d="M9 9 3 3" />
</svg>

Before

Width:  |  Height:  |  Size: 381 B

After

Width:  |  Height:  |  Size: 428 B

+20
View File
@@ -0,0 +1,20 @@
{
"$schema": "../icon.schema.json",
"contributors": [
"colebemis",
"karsa-mistmere",
"ericfennis",
"Seanw265"
],
"tags": [
"location",
"navigation",
"travel",
"new",
"add",
"create"
],
"categories": [
"navigation"
]
}
+17
View File
@@ -0,0 +1,17 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="m11 19-1.106-.552a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0l4.212 2.106a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619V12" />
<path d="M15 5.764V12" />
<path d="M18 15v6" />
<path d="M21 18h-6" />
<path d="M9 3.236v15" />
</svg>

After

Width:  |  Height:  |  Size: 513 B

+2 -1
View File
@@ -6,7 +6,8 @@
"ericfennis",
"karsa-mistmere",
"danielbayley",
"jguddas"
"jguddas",
"sezze"
],
"tags": [
"box",
+1 -1
View File
@@ -11,6 +11,6 @@
>
<path d="M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z" />
<path d="M12 22V12" />
<path d="m3.3 7 7.703 4.734a2 2 0 0 0 1.994 0L20.7 7" />
<polyline points="3.29 7 12 12 20.71 7" />
<path d="m7.5 4.27 9 5.15" />
</svg>

Before

Width:  |  Height:  |  Size: 460 B

After

Width:  |  Height:  |  Size: 446 B

+10
View File
@@ -0,0 +1,10 @@
stats
node_modules
tests
scripts
build
src
babel.config.js
jest.config.js
rollup.config.js
yarn.error.log
+46
View File
@@ -0,0 +1,46 @@
{
"name": "@lucide/icons",
"description": "Lucide is a community-run fork of Feather Icons, open for anyone to contribute icons.",
"version": "0.0.1",
"license": "ISC",
"homepage": "https://lucide.dev",
"bugs": "https://github.com/lucide-icons/lucide/issues",
"repository": {
"type": "git",
"url": "https://github.com/lucide-icons/lucide.git"
},
"keywords": [
"Lucide",
"Feather",
"Icons",
"Icon",
"SVG",
"Feather Icons",
"Fontawesome",
"Font Awesome"
],
"source": "src/lucide-icons.js",
"main": "dist/cjs/lucide-icons.js",
"module": "dist/esm/lucide-icons.js",
"typings": "dist/lucide-icons.d.ts",
"sideEffects": false,
"scripts": {
"copy:license": "cp ../../LICENSE ./LICENSE",
"build": "pnpm clean && pnpm copy:license && pnpm build:icons && pnpm build:bundles",
"build:tags": "node ../../scripts/migrateIconsToTags.mjs",
"build:icons": "build-icons --output=./src --templateSrc=./scripts/exportTemplate.mjs --iconFileExtension=.ts --withAliases --aliasNamesOnly --aliasesFileExtension=.ts --exportFileName=index.ts",
"build:lib": "node ./scripts/buildLib.mjs",
"build:bundles": "rollup -c rollup.config.mjs",
"clean": "rm -rf lib && rm -rf build && rm -rf icons && rm -f sprite.svg",
"version": "pnpm version --git-tag-version=false"
},
"devDependencies": {
"@lucide/build-icons": "workspace:*",
"@lucide/helpers": "workspace:*",
"@lucide/rollup-plugins": "workspace:*",
"prettier": "^2.3.2",
"rollup": "^4.22.4",
"rollup-plugin-dts": "^6.1.0",
"svgson": "^5.2.1"
}
}
+59
View File
@@ -0,0 +1,59 @@
import plugins from '@lucide/rollup-plugins';
import dts from 'rollup-plugin-dts';
import pkg from './package.json' assert { type: 'json' };
const outputFileName = pkg.name;
const outputDir = 'dist';
const inputs = ['src/lucide-icons.ts'];
const bundles = [
{
format: 'cjs',
inputs,
outputDir,
},
{
format: 'esm',
inputs,
outputDir,
preserveModules: true,
},
];
const configs = bundles
.map(({ inputs, outputDir, format, minify, preserveModules }) =>
inputs.map((input) => ({
input,
plugins: plugins({ pkg, minify }),
output: {
name: outputFileName,
...(preserveModules
? {
dir: `${outputDir}/${format}`,
}
: {
file: `${outputDir}/${format}/${outputFileName}${minify ? '.min' : ''}.js`,
}),
format,
sourcemap: true,
preserveModules,
},
})),
)
.flat();
const typesFileConfig = {
input: inputs[0],
output: [
{
file: `${outputDir}/${outputFileName}.d.ts`,
format: 'esm',
},
],
plugins: [
dts({
include: ['src'],
}),
],
};
export default [...configs, typesFileConfig];
+25
View File
@@ -0,0 +1,25 @@
/* eslint-disable import/no-extraneous-dependencies */
import base64SVG from '@lucide/build-icons/utils/base64SVG.mjs';
import { toCamelCase } from '@lucide/helpers';
export default ({ iconName, children, getSvg, deprecated, deprecationReason }) => {
const svgContents = getSvg();
const svgBase64 = base64SVG(svgContents);
const exportName = toCamelCase(iconName)
return `
import { IconNode } from '../types';
/**
* @name ${iconName}
* @description Lucide SVG string.
*
* @preview ![img](data:image/svg+xml;base64,${svgBase64}) - https://lucide.dev/icons/${iconName}
*
* @returns {IconNode}
* ${deprecated ? `@deprecated ${deprecationReason}` : ''}
*/
const _${exportName}: IconNode = ${JSON.stringify(children)}
export default _${exportName};
`;
};
+1
View File
@@ -0,0 +1 @@
export * from './aliases';
+1
View File
@@ -0,0 +1 @@
Folder for generated icons
+2
View File
@@ -0,0 +1,2 @@
export * from './icons';
export * from './aliases';
+3
View File
@@ -0,0 +1,3 @@
export type SVGProps = Record<string, string | number>;
export type IconNode = readonly [tag: string, attrs: SVGProps][];
export type Icons = { [key: string]: IconNode };
+17
View File
@@ -0,0 +1,17 @@
{
"compilerOptions": {
"strict": true,
"declaration": true,
"noEmitOnError": true,
"noFallthroughCasesInSwitch": true,
"moduleResolution": "node",
"module": "ESNext",
"target": "ESNext",
"esModuleInterop": true,
"allowJs": true,
"lib": ["esnext", "dom"],
"resolveJsonModule": true,
"sourceMap": true,
"outDir": "./dist",
},
}
@@ -1,10 +1,4 @@
import {
forwardRef,
createElement,
ReactSVG,
FunctionComponent,
ForwardRefExoticComponent,
} from 'react';
import { forwardRef, createElement, FunctionComponent } from 'react';
import * as NativeSvg from 'react-native-svg';
import defaultAttributes, { childDefaultAttributes } from './defaultAttributes';
import { IconNode, LucideIcon, LucideProps } from './types';
+17 -2
View File
@@ -1,7 +1,22 @@
import type { ForwardRefExoticComponent, ReactSVG } from 'react';
import type { ForwardRefExoticComponent } from 'react';
import type { SvgProps } from 'react-native-svg';
export type IconNode = [elementName: keyof ReactSVG, attrs: Record<string, string>][];
/**
* A reduced version of `SVGElementType` from @types/react. This type was added
* with the release of React 19, and is included here in order to support usage
* with older versions.
*/
type SVGElementType =
| 'circle'
| 'ellipse'
| 'g'
| 'line'
| 'path'
| 'polygon'
| 'polyline'
| 'rect';
export type IconNode = [elementName: SVGElementType, attrs: Record<string, string>][];
export interface LucideProps extends SvgProps {
size?: string | number;
+17 -2
View File
@@ -1,6 +1,21 @@
import { ReactSVG, SVGProps, ForwardRefExoticComponent, RefAttributes } from 'react';
import type { SVGProps, ForwardRefExoticComponent, RefAttributes } from 'react';
export type IconNode = [elementName: keyof ReactSVG, attrs: Record<string, string>][];
/**
* A reduced version of `SVGElementType` from @types/react. This type was added
* with the release of React 19, and is included here in order to support usage
* with older versions.
*/
type SVGElementType =
| 'circle'
| 'ellipse'
| 'g'
| 'line'
| 'path'
| 'polygon'
| 'polyline'
| 'rect';
export type IconNode = [elementName: SVGElementType, attrs: Record<string, string>][];
export type SVGAttributes = Partial<SVGProps<SVGSVGElement>>;
type ElementAttributes = RefAttributes<SVGSVGElement> & SVGAttributes;
+1 -1
View File
@@ -52,7 +52,7 @@
"build:icons": "build-icons --output=./src --templateSrc=./scripts/exportTemplate.mjs --exportFileName=index.ts --iconFileExtension=.svelte --importImportFileExtension=.svelte --separateIconFileExport --separateIconFileExportExtension=.ts --withAliases --aliasesFileExtension=.ts --separateAliasesFile --separateAliasesFileExtension=.ts --aliasImportFileExtension=.js --pretty=false",
"build:package": "svelte-package --input ./src",
"build:license": "node ./scripts/appendBlockComments.mjs",
"test": "pnpm build:icons && vitest run",
"test": "pnpm copy:license && pnpm build:icons && vitest run",
"test:watch": "vitest watch",
"version": "pnpm version --git-tag-version=false"
},
+4 -2
View File
@@ -1,11 +1,13 @@
import fs from 'fs';
import pkg from '../package.json' with { type: 'json' };
const license = fs.readFileSync('LICENSE', 'utf-8');
export function getJSBanner() {
return `/**
* @license ${pkg.name} v${pkg.version} - ${pkg.license}
*
* This source code is licensed under the ${pkg.license} license.
* See the LICENSE file in the root directory of this source tree.
* ${license.split('\n').join('\n * ')}
*/
`;
}
+24 -12
View File
@@ -183,6 +183,30 @@ importers:
specifier: ^1.3.1
version: 1.3.3(@algolia/client-search@4.19.1)(@types/node@20.4.5)(@types/react@18.2.55)(axios@1.7.4)(fuse.js@6.6.2)(less@4.2.0)(postcss@8.4.49)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(sass@1.77.8)(search-insights@2.8.2)(stylus@0.56.0)(terser@5.31.6)(typescript@5.3.3)
packages/icons:
devDependencies:
'@lucide/build-icons':
specifier: workspace:*
version: link:../../tools/build-icons
'@lucide/helpers':
specifier: workspace:*
version: link:../../tools/build-helpers
'@lucide/rollup-plugins':
specifier: workspace:*
version: link:../../tools/rollup-plugins
prettier:
specifier: ^2.3.2
version: 2.8.8
rollup:
specifier: ^4.22.4
version: 4.22.4
rollup-plugin-dts:
specifier: ^6.1.0
version: 6.1.0(rollup@4.22.4)(typescript@5.3.3)
svgson:
specifier: ^5.2.1
version: 5.3.1
packages/lucide:
devDependencies:
'@lucide/build-icons':
@@ -17591,18 +17615,6 @@ snapshots:
postcss: 8.4.49
source-map: 0.6.1
'@vue/compiler-sfc@3.4.18':
dependencies:
'@babel/parser': 7.23.9
'@vue/compiler-core': 3.4.18
'@vue/compiler-dom': 3.4.18
'@vue/compiler-ssr': 3.4.18
'@vue/shared': 3.4.18
estree-walker: 2.0.2
magic-string: 0.30.11
postcss: 8.4.41
source-map-js: 1.2.1
'@vue/compiler-sfc@3.4.21':
dependencies:
'@babel/parser': 7.26.1