diff --git a/icons/archive-restore.svg b/icons/archive-restore.svg new file mode 100644 index 000000000..95b7a2742 --- /dev/null +++ b/icons/archive-restore.svg @@ -0,0 +1,17 @@ + + + + + + + diff --git a/icons/archive.svg b/icons/archive.svg index a24dbffef..12695a696 100644 --- a/icons/archive.svg +++ b/icons/archive.svg @@ -9,5 +9,7 @@ stroke-linecap="round" stroke-linejoin="round" > - + + + diff --git a/icons/backpack.svg b/icons/backpack.svg new file mode 100644 index 000000000..217a28d53 --- /dev/null +++ b/icons/backpack.svg @@ -0,0 +1,17 @@ + + + + + + + diff --git a/icons/baggage-claim.svg b/icons/baggage-claim.svg new file mode 100644 index 000000000..6e858a5bb --- /dev/null +++ b/icons/baggage-claim.svg @@ -0,0 +1,17 @@ + + + + + + + diff --git a/icons/bar-chart-3.svg b/icons/bar-chart-3.svg index efba4b93f..f049a0301 100644 --- a/icons/bar-chart-3.svg +++ b/icons/bar-chart-3.svg @@ -9,8 +9,8 @@ stroke-linecap="round" stroke-linejoin="round" > - - - - + + + + diff --git a/icons/bar-chart-4.svg b/icons/bar-chart-4.svg index e3e85f53e..f44017f5d 100644 --- a/icons/bar-chart-4.svg +++ b/icons/bar-chart-4.svg @@ -9,8 +9,8 @@ stroke-linecap="round" stroke-linejoin="round" > - - - - + + + + diff --git a/icons/bar-chart-horizontal.svg b/icons/bar-chart-horizontal.svg index 92f5dc979..886f6b4a5 100644 --- a/icons/bar-chart-horizontal.svg +++ b/icons/bar-chart-horizontal.svg @@ -9,8 +9,8 @@ stroke-linecap="round" stroke-linejoin="round" > - - - - + + + + diff --git a/icons/box.svg b/icons/box.svg index eca84fc59..4f7fca3fc 100644 --- a/icons/box.svg +++ b/icons/box.svg @@ -10,6 +10,6 @@ stroke-linejoin="round" > - - + + diff --git a/icons/clipboard-check.svg b/icons/clipboard-check.svg index 0ae5ec0f8..5844ae9a0 100644 --- a/icons/clipboard-check.svg +++ b/icons/clipboard-check.svg @@ -10,6 +10,6 @@ stroke-linejoin="round" > - + diff --git a/icons/clipboard-list.svg b/icons/clipboard-list.svg index fd9dc8979..015cedcae 100644 --- a/icons/clipboard-list.svg +++ b/icons/clipboard-list.svg @@ -10,7 +10,7 @@ stroke-linejoin="round" > - + diff --git a/icons/clipboard-x.svg b/icons/clipboard-x.svg index 411e35b55..b6190dd3f 100644 --- a/icons/clipboard-x.svg +++ b/icons/clipboard-x.svg @@ -10,7 +10,7 @@ stroke-linejoin="round" > - + diff --git a/icons/eraser.svg b/icons/eraser.svg index 3b4404b24..4fe788dd8 100644 --- a/icons/eraser.svg +++ b/icons/eraser.svg @@ -9,6 +9,6 @@ stroke-linecap="round" stroke-linejoin="round" > - - + + \ No newline at end of file diff --git a/icons/fingerprint.svg b/icons/fingerprint.svg new file mode 100644 index 000000000..99e4e7d70 --- /dev/null +++ b/icons/fingerprint.svg @@ -0,0 +1,21 @@ + + + + + + + + + + + diff --git a/icons/flower-2.svg b/icons/flower-2.svg new file mode 100644 index 000000000..7d89e5ea5 --- /dev/null +++ b/icons/flower-2.svg @@ -0,0 +1,17 @@ + + + + + + + diff --git a/icons/flower.svg b/icons/flower.svg new file mode 100644 index 000000000..9eedfe8e8 --- /dev/null +++ b/icons/flower.svg @@ -0,0 +1,18 @@ + + + + + + + + diff --git a/icons/heart-crack.svg b/icons/heart-crack.svg new file mode 100644 index 000000000..21786fc18 --- /dev/null +++ b/icons/heart-crack.svg @@ -0,0 +1,14 @@ + + + + diff --git a/icons/heart-handshake.svg b/icons/heart-handshake.svg new file mode 100644 index 000000000..cbfc5cdeb --- /dev/null +++ b/icons/heart-handshake.svg @@ -0,0 +1,16 @@ + + + + + + diff --git a/icons/leaf.svg b/icons/leaf.svg new file mode 100644 index 000000000..f322ef022 --- /dev/null +++ b/icons/leaf.svg @@ -0,0 +1,14 @@ + + + + diff --git a/icons/line-chart.svg b/icons/line-chart.svg index 4857266a3..4d6df0b3d 100644 --- a/icons/line-chart.svg +++ b/icons/line-chart.svg @@ -9,6 +9,6 @@ stroke-linecap="round" stroke-linejoin="round" > - - + + diff --git a/icons/list-end.svg b/icons/list-end.svg new file mode 100644 index 000000000..4e70739f0 --- /dev/null +++ b/icons/list-end.svg @@ -0,0 +1,17 @@ + + + + + + + diff --git a/icons/list-music.svg b/icons/list-music.svg new file mode 100644 index 000000000..186caae33 --- /dev/null +++ b/icons/list-music.svg @@ -0,0 +1,17 @@ + + + + + + + diff --git a/icons/list-start.svg b/icons/list-start.svg new file mode 100644 index 000000000..e2b4e723d --- /dev/null +++ b/icons/list-start.svg @@ -0,0 +1,17 @@ + + + + + + + diff --git a/icons/list-video.svg b/icons/list-video.svg new file mode 100644 index 000000000..44d11ffdb --- /dev/null +++ b/icons/list-video.svg @@ -0,0 +1,16 @@ + + + + + + diff --git a/icons/luggage.svg b/icons/luggage.svg new file mode 100644 index 000000000..8ce379906 --- /dev/null +++ b/icons/luggage.svg @@ -0,0 +1,17 @@ + + + + + + + diff --git a/icons/move-3d.svg b/icons/move-3d.svg new file mode 100644 index 000000000..c86f87132 --- /dev/null +++ b/icons/move-3d.svg @@ -0,0 +1,16 @@ + + + + + + diff --git a/icons/package-check.svg b/icons/package-check.svg index f54a1c667..2263ddafc 100644 --- a/icons/package-check.svg +++ b/icons/package-check.svg @@ -12,5 +12,6 @@ - + + diff --git a/icons/package-minus.svg b/icons/package-minus.svg index b3c8f11e7..5a3a3f6d7 100644 --- a/icons/package-minus.svg +++ b/icons/package-minus.svg @@ -12,5 +12,6 @@ - + + diff --git a/icons/package-open.svg b/icons/package-open.svg new file mode 100644 index 000000000..43cba3842 --- /dev/null +++ b/icons/package-open.svg @@ -0,0 +1,16 @@ + + + + + + diff --git a/icons/package-plus.svg b/icons/package-plus.svg index b6ef1a850..e3dcea75e 100644 --- a/icons/package-plus.svg +++ b/icons/package-plus.svg @@ -13,5 +13,6 @@ - + + diff --git a/icons/package-search.svg b/icons/package-search.svg index db11f76a7..a4a2875f3 100644 --- a/icons/package-search.svg +++ b/icons/package-search.svg @@ -11,7 +11,8 @@ > - + + diff --git a/icons/package-x.svg b/icons/package-x.svg index 6aa8bb106..8e0beb095 100644 --- a/icons/package-x.svg +++ b/icons/package-x.svg @@ -11,6 +11,7 @@ > - + + diff --git a/icons/package.svg b/icons/package.svg index a47b7b78e..9e0307775 100644 --- a/icons/package.svg +++ b/icons/package.svg @@ -11,6 +11,6 @@ > - - + + diff --git a/icons/paint-bucket.svg b/icons/paint-bucket.svg new file mode 100644 index 000000000..56967be43 --- /dev/null +++ b/icons/paint-bucket.svg @@ -0,0 +1,16 @@ + + + + + + diff --git a/icons/paintbrush-2.svg b/icons/paintbrush-2.svg new file mode 100644 index 000000000..2a05fbdc0 --- /dev/null +++ b/icons/paintbrush-2.svg @@ -0,0 +1,16 @@ + + + + + + diff --git a/icons/paintbrush.svg b/icons/paintbrush.svg new file mode 100644 index 000000000..b1b2dfaa0 --- /dev/null +++ b/icons/paintbrush.svg @@ -0,0 +1,15 @@ + + + + + diff --git a/icons/recycle.svg b/icons/recycle.svg new file mode 100644 index 000000000..bd207b304 --- /dev/null +++ b/icons/recycle.svg @@ -0,0 +1,18 @@ + + + + + + + + diff --git a/icons/scaling.svg b/icons/scaling.svg new file mode 100644 index 000000000..d214cb9fa --- /dev/null +++ b/icons/scaling.svg @@ -0,0 +1,16 @@ + + + + + + diff --git a/icons/scroll.svg b/icons/scroll.svg new file mode 100644 index 000000000..5f75973dc --- /dev/null +++ b/icons/scroll.svg @@ -0,0 +1,16 @@ + + + + + + diff --git a/icons/shrub.svg b/icons/shrub.svg new file mode 100644 index 000000000..93bbbf8f4 --- /dev/null +++ b/icons/shrub.svg @@ -0,0 +1,15 @@ + + + + + diff --git a/icons/siren.svg b/icons/siren.svg new file mode 100644 index 000000000..527976a98 --- /dev/null +++ b/icons/siren.svg @@ -0,0 +1,20 @@ + + + + + + + + + + diff --git a/icons/slice.svg b/icons/slice.svg new file mode 100644 index 000000000..3809180cf --- /dev/null +++ b/icons/slice.svg @@ -0,0 +1,14 @@ + + + + diff --git a/icons/thermometer-snowflake.svg b/icons/thermometer-snowflake.svg index 971b0b0aa..76f4085f5 100644 --- a/icons/thermometer-snowflake.svg +++ b/icons/thermometer-snowflake.svg @@ -14,5 +14,5 @@ - + diff --git a/icons/thermometer-sun.svg b/icons/thermometer-sun.svg index 33db81058..f07d3fece 100644 --- a/icons/thermometer-sun.svg +++ b/icons/thermometer-sun.svg @@ -12,7 +12,7 @@ - + diff --git a/icons/thermometer.svg b/icons/thermometer.svg index c9beb833d..808334dc9 100644 --- a/icons/thermometer.svg +++ b/icons/thermometer.svg @@ -9,5 +9,5 @@ stroke-linecap="round" stroke-linejoin="round" > - + diff --git a/icons/tree-deciduous.svg b/icons/tree-deciduous.svg new file mode 100644 index 000000000..c028a81a1 --- /dev/null +++ b/icons/tree-deciduous.svg @@ -0,0 +1,14 @@ + + + + diff --git a/icons/tree-pine.svg b/icons/tree-pine.svg new file mode 100644 index 000000000..2dbd307dd --- /dev/null +++ b/icons/tree-pine.svg @@ -0,0 +1,14 @@ + + + + diff --git a/icons/trees.svg b/icons/trees.svg new file mode 100644 index 000000000..b1b447447 --- /dev/null +++ b/icons/trees.svg @@ -0,0 +1,16 @@ + + + + + + diff --git a/icons/user-check.svg b/icons/user-check.svg index 7cf8ec389..8fb3156eb 100644 --- a/icons/user-check.svg +++ b/icons/user-check.svg @@ -9,7 +9,7 @@ stroke-linecap="round" stroke-linejoin="round" > - - - + + + diff --git a/icons/user-minus.svg b/icons/user-minus.svg index 94558bc8f..747a34c1e 100644 --- a/icons/user-minus.svg +++ b/icons/user-minus.svg @@ -9,7 +9,7 @@ stroke-linecap="round" stroke-linejoin="round" > - - - + + + diff --git a/icons/user-plus.svg b/icons/user-plus.svg index f84c74b4c..32b8435c2 100644 --- a/icons/user-plus.svg +++ b/icons/user-plus.svg @@ -9,8 +9,8 @@ stroke-linecap="round" stroke-linejoin="round" > - - - - + + + + diff --git a/icons/user-x.svg b/icons/user-x.svg index 2033c6e0e..092981548 100644 --- a/icons/user-x.svg +++ b/icons/user-x.svg @@ -9,8 +9,8 @@ stroke-linecap="round" stroke-linejoin="round" > - - - - + + + + diff --git a/icons/user.svg b/icons/user.svg index f075a65ff..8e61592bb 100644 --- a/icons/user.svg +++ b/icons/user.svg @@ -9,6 +9,6 @@ stroke-linecap="round" stroke-linejoin="round" > - + diff --git a/icons/users.svg b/icons/users.svg index eb87d02bb..1dcebabff 100644 --- a/icons/users.svg +++ b/icons/users.svg @@ -9,8 +9,8 @@ stroke-linecap="round" stroke-linejoin="round" > - + - + diff --git a/icons/utensils-crossed.svg b/icons/utensils-crossed.svg new file mode 100644 index 000000000..470edbe69 --- /dev/null +++ b/icons/utensils-crossed.svg @@ -0,0 +1,16 @@ + + + + + + diff --git a/icons/utensils.svg b/icons/utensils.svg new file mode 100644 index 000000000..d51eda83e --- /dev/null +++ b/icons/utensils.svg @@ -0,0 +1,15 @@ + + + + + diff --git a/packages/lucide-angular/package.json b/packages/lucide-angular/package.json index 6eb56b9bc..e68c2a787 100644 --- a/packages/lucide-angular/package.json +++ b/packages/lucide-angular/package.json @@ -1,7 +1,7 @@ { "name": "lucide-angular", "description": "A Lucide icon library package for Angular applications", - "version": "0.54.0", + "version": "0.61.0", "author": "SMAH1", "license": "ISC", "homepage": "https://lucide.dev", diff --git a/packages/lucide-flutter/pubspec.yaml b/packages/lucide-flutter/pubspec.yaml index da1d5296e..13dfff113 100644 --- a/packages/lucide-flutter/pubspec.yaml +++ b/packages/lucide-flutter/pubspec.yaml @@ -1,6 +1,6 @@ name: lucide_icons description: A Lucide icon library package for Flutter applications. Fork of Feather Icons, open for anyone to contribute icons. -version: 0.54.0 +version: 0.61.0 homepage: https://lucide.dev repository: https://github.com/lucide-icons/lucide diff --git a/packages/lucide-preact/package.json b/packages/lucide-preact/package.json index 830e983c9..29d3f8c2f 100644 --- a/packages/lucide-preact/package.json +++ b/packages/lucide-preact/package.json @@ -1,7 +1,7 @@ { "name": "lucide-preact", "description": "A Lucide icon library package for Preact applications", - "version": "0.54.0", + "version": "0.61.0", "license": "ISC", "homepage": "https://lucide.dev", "bugs": "https://github.com/lucide-icons/lucide/issues", diff --git a/packages/lucide-react-native/.npmignore b/packages/lucide-react-native/.npmignore new file mode 100644 index 000000000..ffd9d70de --- /dev/null +++ b/packages/lucide-react-native/.npmignore @@ -0,0 +1,9 @@ +stats +node_modules +tests +scripts +build +src +babel.config.js +jest.config.js +rollup.config.js diff --git a/packages/lucide-react-native/LICENSE b/packages/lucide-react-native/LICENSE new file mode 100644 index 000000000..66cc02207 --- /dev/null +++ b/packages/lucide-react-native/LICENSE @@ -0,0 +1,15 @@ +ISC License + +Copyright (c) 2020, Lucide Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/packages/lucide-react-native/README.md b/packages/lucide-react-native/README.md new file mode 100644 index 000000000..50ff9f9cb --- /dev/null +++ b/packages/lucide-react-native/README.md @@ -0,0 +1,72 @@ +# Lucide React Native + +Implementation of the lucide icon library for react applications. + +> What is lucide? Read it [here](https://github.com/lucide-icons/lucide#what-is-lucide). + +## Installation + +First, ensure that you have `react-native-svg@^12.0.0` installed. Then, install the package: + +```sh +yarn add lucide-react-native + +# or + +npm install lucide-react-native +``` + +## How to use + +It's built with ES modules so it's completely threeshakable. +Each icon can be imported as a react component. + +### Example + +You can pass additional props to adjust the icon. + +``` js +import { Camera } from 'lucide-react-native'; + +const App = () => { + return +}; + +export default App; +``` + +### Props + +| name | type | default +| ------------ | -------- | -------- +| `size` | *Number* | 24 +| `color` | *String* | currentColor +| `strokeWidth`| *Number* | 2 + +### Custom props + +You can also pass custom props that will be added in the svg as attributes. + +``` js +const App = () => { + return +}; +``` + +### Generic icon component + +It is possible to create a generic icon component to load icons. + +> :warning: The example below is importing all ES modules. This is **not** recommended when you using a bundler since your application build size will grow substantially. + +``` js +import * as icons from 'lucide-react-native'; + +const Icon = ({name, color, size}) => { + const LucideIcon = icons[name]; + + return +}; + +export default Icon; +``` diff --git a/packages/lucide-react-native/babel.config.js b/packages/lucide-react-native/babel.config.js new file mode 100644 index 000000000..691a1ba45 --- /dev/null +++ b/packages/lucide-react-native/babel.config.js @@ -0,0 +1,19 @@ +const mainConfig = require('../../babel.config'); + +module.exports = { + presets: [ + [ + '@babel/env', + { + loose: true, + modules: false, + }, + ], + ], + env: { + ...mainConfig.env, + test: { + presets: ['react-app'], + }, + }, +}; diff --git a/packages/lucide-react-native/jest.config.js b/packages/lucide-react-native/jest.config.js new file mode 100644 index 000000000..f28b72f89 --- /dev/null +++ b/packages/lucide-react-native/jest.config.js @@ -0,0 +1,9 @@ +module.exports = { + verbose: true, + roots: ['/src/', '/tests/'], + moduleFileExtensions: ['js'], + transformIgnorePatterns: [`/node_modules`], + transform: { + '^.+\\.js$': 'babel-jest', + }, +}; diff --git a/packages/lucide-react-native/package.json b/packages/lucide-react-native/package.json new file mode 100644 index 000000000..8a992fb7c --- /dev/null +++ b/packages/lucide-react-native/package.json @@ -0,0 +1,44 @@ +{ + "name": "lucide-react-native", + "description": "A Lucide icon library package for React Native applications", + "version": "0.48.0-alpha.5", + "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", + "directory": "packages/lucide-react-native" + }, + "author": "Eric Fennis", + "amdName": "lucide-react-native", + "main": "dist/cjs/lucide-react-native.js", + "main:umd": "dist/umd/lucide-react-native.js", + "module": "dist/esm/lucide-react-native.js", + "unpkg": "dist/umd/lucide-react-native.min.js", + "typings": "dist/lucide-react-native.d.ts", + "react-native": "dist/esm/lucide-react-native.js", + "sideEffects": false, + "scripts": { + "build": "yarn clean && yarn build:icons && yarn build:bundles && yarn build:types", + "clean": "rm -rf dist && rm -rf stats && rm -rf ./src/icons/*.js", + "build:icons": "yarn --cwd ../../ build:icons --output=../packages/lucide-react-native/src --templateSrc=../packages/lucide-react-native/scripts/exportTemplate --renderUniqueKey", + "build:types": "yarn --cwd ../../ babel-node packages/lucide-react-native/scripts/buildTypes.js", + "build:bundles": "yarn --cwd ../../ rollup -c packages/lucide-react-native/rollup.config.js", + "test": "jest" + }, + "devDependencies": { + "@testing-library/react": "^11.2.6", + "babel-preset-react-app": "^10.0.0", + "jest": "^26.6.3", + "prop-types": "^15.7.2", + "react": "^16.5.1", + "react-dom": "^17.0.2", + "react-native-svg": "^12.0.0" + }, + "peerDependencies": { + "prop-types": "^15.7.2", + "react": "^16.5.1 || ^17.0.0 || ^18.0.0", + "react-native-svg": "^12.0.0" + } +} diff --git a/packages/lucide-react-native/rollup.config.js b/packages/lucide-react-native/rollup.config.js new file mode 100644 index 000000000..28b5e1c1b --- /dev/null +++ b/packages/lucide-react-native/rollup.config.js @@ -0,0 +1,64 @@ +import plugins from '../../rollup.plugins'; +import pkg from './package.json'; + +const packageName = 'LucideReact'; +const outputFileName = 'lucide-react-native'; +const rootDir = 'packages/lucide-react-native'; // It runs from the root +const outputDir = `${rootDir}/dist`; +const inputs = [`${rootDir}/src/lucide-react-native.js`]; +const bundles = [ + { + format: 'umd', + inputs, + outputDir, + minify: true, + }, + { + format: 'umd', + inputs, + outputDir, + }, + { + format: 'cjs', + inputs, + outputDir, + preserveModules: true, + }, + { + format: 'esm', + inputs, + outputDir, + preserveModules: true, + }, +]; + +const configs = bundles + .map(({ inputs, outputDir, format, minify, preserveModules }) => + inputs.map(input => ({ + input, + plugins: plugins(pkg, minify), + external: ['react', 'prop-types', 'lucide', 'react-native-svg'], + output: { + name: packageName, + ...(preserveModules + ? { + dir: `${outputDir}/${format}`, + } + : { + file: `${outputDir}/${format}/${outputFileName}${minify ? '.min' : ''}.js`, + }), + format, + preserveModules, + sourcemap: true, + globals: { + react: 'react', + 'react-native-svg': 'react-native-svg', + 'prop-types': 'PropTypes', + lucide: 'lucide', + }, + }, + })), + ) + .flat(); + +export default configs; diff --git a/packages/lucide-react-native/scripts/buildTypes.js b/packages/lucide-react-native/scripts/buildTypes.js new file mode 100644 index 000000000..15904b2d1 --- /dev/null +++ b/packages/lucide-react-native/scripts/buildTypes.js @@ -0,0 +1,47 @@ +import path from 'path'; +import { + appendFile, + readSvgDirectory, + resetFile, + toPascalCase, + writeFile, +} from '../../../scripts/helpers'; + +const srcDirectory = path.join(__dirname, '../dist'); + +// Declare type definitions +const typeDefinitions = `\ +/// +import { SVGAttributes } from 'react' + +declare module 'lucide-react-native' + +// Create interface extending SVGProps +export interface LucideProps extends Partial> { + size?: string | number +} + +export declare const createReactComponent: (iconName: string, iconNode: any[]) => (props: LucideProps) => JSX.Element; + +export type Icon = React.FC; + +// Generated icons +`; + +const ICONS_DIR = path.resolve(__dirname, '../../../icons'); +const TYPES_FILE = 'lucide-react-native.d.ts'; + +resetFile(TYPES_FILE, srcDirectory); +writeFile(typeDefinitions, TYPES_FILE, srcDirectory); + +const svgFiles = readSvgDirectory(ICONS_DIR); + +svgFiles.forEach(svgFile => { + const iconName = path.basename(svgFile, '.svg'); + const componentName = toPascalCase(iconName); + + const exportTypeString = `export declare const ${componentName}: (props: LucideProps) => JSX.Element;\n`; + appendFile(exportTypeString, TYPES_FILE, srcDirectory); +}); + +console.log(`Generated ${TYPES_FILE} file with`, svgFiles.length, 'icons'); diff --git a/packages/lucide-react-native/scripts/exportTemplate.js b/packages/lucide-react-native/scripts/exportTemplate.js new file mode 100644 index 000000000..91f9914d9 --- /dev/null +++ b/packages/lucide-react-native/scripts/exportTemplate.js @@ -0,0 +1,7 @@ +export default ({ componentName, children }) => ` +import createReactComponent from '../createReactComponent'; + +const ${componentName} = createReactComponent('${componentName}', ${JSON.stringify(children)}); + +export default ${componentName}; +`; diff --git a/packages/lucide-react-native/src/createReactComponent.js b/packages/lucide-react-native/src/createReactComponent.js new file mode 100644 index 000000000..a658a6ca8 --- /dev/null +++ b/packages/lucide-react-native/src/createReactComponent.js @@ -0,0 +1,41 @@ +import { forwardRef, createElement } from 'react'; +import PropTypes from 'prop-types'; +import * as NativeSvg from 'react-native-svg'; +import defaultAttributes from './defaultAttributes'; + +const createReactComponent = (iconName, iconNode) => { + const Component = forwardRef( + ({ color = 'currentColor', size = 24, strokeWidth = 2, children, ...rest }, ref) => + createElement( + NativeSvg.Svg, + { + ref, + ...defaultAttributes, + width: size, + height: size, + stroke: color, + strokeWidth, + ...rest, + }, + [ + ...iconNode.map(([tag, attrs]) => { + const uppercasedTag = tag.charAt(0).toUpperCase() + tag.slice(1); + return createElement(NativeSvg[uppercasedTag], attrs); + }), + ...(children || []), + ], + ), + ); + + Component.propTypes = { + color: PropTypes.string, + size: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), + strokeWidth: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), + }; + + Component.displayName = `${iconName}`; + + return Component; +}; + +export default createReactComponent; diff --git a/packages/lucide-react-native/src/defaultAttributes.js b/packages/lucide-react-native/src/defaultAttributes.js new file mode 100644 index 000000000..ce97fb058 --- /dev/null +++ b/packages/lucide-react-native/src/defaultAttributes.js @@ -0,0 +1,11 @@ +export default { + xmlns: 'http://www.w3.org/2000/svg', + width: 24, + height: 24, + viewBox: '0 0 24 24', + fill: 'none', + stroke: 'currentColor', + strokeWidth: 2, + strokeLinecap: 'round', + strokeLinejoin: 'round', +}; diff --git a/packages/lucide-react-native/src/icons/.gitkeep b/packages/lucide-react-native/src/icons/.gitkeep new file mode 100644 index 000000000..e3d85f774 --- /dev/null +++ b/packages/lucide-react-native/src/icons/.gitkeep @@ -0,0 +1 @@ +Folder for generated icons diff --git a/packages/lucide-react-native/src/lucide-react-native.js b/packages/lucide-react-native/src/lucide-react-native.js new file mode 100644 index 000000000..31d1f64b8 --- /dev/null +++ b/packages/lucide-react-native/src/lucide-react-native.js @@ -0,0 +1,2 @@ +export * from './icons'; +export { default as createReactComponent } from './createReactComponent'; diff --git a/packages/lucide-react-native/tests/__snapshots__/lucide-react-native.spec.js.snap b/packages/lucide-react-native/tests/__snapshots__/lucide-react-native.spec.js.snap new file mode 100644 index 000000000..dba35b755 --- /dev/null +++ b/packages/lucide-react-native/tests/__snapshots__/lucide-react-native.spec.js.snap @@ -0,0 +1,5 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Using lucide icon components should adjust the size, stroke color and stroke width 1`] = `""`; + +exports[`Using lucide icon components should render an component 1`] = `""`; diff --git a/packages/lucide-react-native/tests/lucide-react-native.spec.js b/packages/lucide-react-native/tests/lucide-react-native.spec.js new file mode 100644 index 000000000..8fbf86239 --- /dev/null +++ b/packages/lucide-react-native/tests/lucide-react-native.spec.js @@ -0,0 +1,31 @@ +import React from 'react'; +import { render } from '@testing-library/react' +import { Grid } from '../src/icons' + +describe('Using lucide icon components', () => { + it('should render an component', () => { + const { container } = render( ); + + expect( container.innerHTML ).toMatchSnapshot(); + }); + + it('should adjust the size, stroke color and stroke width', () => { + const testId = 'grid-icon'; + const { container, getByTestId } = render( + , + ); + + const { attributes } = getByTestId(testId); + expect(attributes.stroke.value).toBe('red'); + expect(attributes.width.value).toBe('48'); + expect(attributes.height.value).toBe('48'); + expect(attributes['stroke-width'].value).toBe('4'); + + expect( container.innerHTML ).toMatchSnapshot(); + }); +}) diff --git a/packages/lucide-react/package.json b/packages/lucide-react/package.json index 06543bc90..878063f60 100644 --- a/packages/lucide-react/package.json +++ b/packages/lucide-react/package.json @@ -1,7 +1,7 @@ { "name": "lucide-react", "description": "A Lucide icon library package for React applications", - "version": "0.54.0", + "version": "0.61.0", "license": "ISC", "homepage": "https://lucide.dev", "bugs": "https://github.com/lucide-icons/lucide/issues", diff --git a/packages/lucide-svelte/package.json b/packages/lucide-svelte/package.json index 792c02c72..69f15a377 100644 --- a/packages/lucide-svelte/package.json +++ b/packages/lucide-svelte/package.json @@ -1,7 +1,7 @@ { "name": "lucide-svelte", "description": "A Lucide icon library package for Svelte applications", - "version": "0.54.0", + "version": "0.61.0", "license": "ISC", "homepage": "https://lucide.dev", "bugs": "https://github.com/lucide-icons/lucide/issues", diff --git a/packages/lucide-vue-next/package.json b/packages/lucide-vue-next/package.json index d83b9a299..7b38117d0 100644 --- a/packages/lucide-vue-next/package.json +++ b/packages/lucide-vue-next/package.json @@ -1,6 +1,6 @@ { "name": "lucide-vue-next", - "version": "0.54.0", + "version": "0.61.0", "author": "Eric Fennis", "description": "A Lucide icon library package for Vue 3 applications", "license": "ISC", diff --git a/packages/lucide-vue/package.json b/packages/lucide-vue/package.json index 1035f90db..655ad1b5c 100644 --- a/packages/lucide-vue/package.json +++ b/packages/lucide-vue/package.json @@ -1,6 +1,6 @@ { "name": "lucide-vue", - "version": "0.54.0", + "version": "0.61.0", "author": "Eric Fennis", "description": "A Lucide icon library package for Vue 2 applications", "license": "ISC", diff --git a/packages/lucide/package.json b/packages/lucide/package.json index ab3cd850f..c1c45f6f1 100644 --- a/packages/lucide/package.json +++ b/packages/lucide/package.json @@ -1,7 +1,7 @@ { "name": "lucide", "description": "A Lucide icon library package for web and javascript applications.", - "version": "0.54.0", + "version": "0.61.0", "license": "ISC", "homepage": "https://lucide.dev", "bugs": "https://github.com/lucide-icons/lucide/issues", diff --git a/site/src/pages/packages/index.tsx b/site/src/pages/packages/index.tsx index 08dc607a5..8a0961c4b 100644 --- a/site/src/pages/packages/index.tsx +++ b/site/src/pages/packages/index.tsx @@ -3,7 +3,7 @@ import HeadingNavigationProvider from '../../components/HeadingNavigationProvide import MobileMenu from '../../components/MobileMenu'; import { Stack } from '@chakra-ui/react'; import Package from '../../components/Package'; -import packageData from '../../lib/packageData'; +import packagesData from '../../lib/packageData'; import { Heading } from '@chakra-ui/react'; import fetchPackages from '../../lib/fetchPackages'; @@ -28,7 +28,7 @@ export default PackagesPage; export async function getStaticProps({ params }) { const packages = (await fetchPackages()) .filter(Boolean) - .filter(packageObj => !packageObj.private) + .filter(packageObj => !packageObj.private && packageObj.name in packagesData) .map(({ name, description, flutter = false }) => { const packageDirectory = flutter ? 'lucide-flutter' : name; @@ -38,7 +38,7 @@ export async function getStaticProps({ params }) { image: `/package-logos/${packageDirectory}-small.svg`, source: `https://github.com/lucide-icons/lucide/tree/master/packages/${packageDirectory}`, documentation: `/docs/${packageDirectory}`, - ...packageData[packageDirectory], + ...packagesData[packageDirectory], }; }) .sort((a, b) => a.order - b.order); diff --git a/tags.json b/tags.json index 353430991..caeefd69e 100644 --- a/tags.json +++ b/tags.json @@ -229,6 +229,13 @@ "index", "box" ], + "archive-restore": [ + "archive", + "unarchive", + "restore", + "index", + "box" + ], "armchair": [ "sofa", "furniture", @@ -310,6 +317,21 @@ "axe": [ "hatchet" ], + "backpack": [ + "bag", + "hiking", + "travel", + "camping", + "school", + "childhood" + ], + "baggage-claim": [ + "baggage", + "luggage", + "travel", + "cart", + "trolley" + ], "banknote": [ "currency", "money", @@ -868,7 +890,8 @@ ], "clover": [ "leaf", - "luck" + "luck", + "plant" ], "code": [ "source", @@ -1268,6 +1291,13 @@ "funnel", "hopper" ], + "fingerprint": [ + "2fa", + "authentication", + "biometric", + "identity", + "security" + ], "flag": [ "report" ], @@ -1299,6 +1329,17 @@ "flask-round": [ "beaker" ], + "flower": [ + "sustainability", + "nature", + "plant", + "spring" + ], + "flower-2": [ + "sustainability", + "nature", + "plant" + ], "focus": [ "camera", "lens", @@ -1502,6 +1543,21 @@ "love", "emotion" ], + "heart-crack": [ + "heartbreak", + "sadness", + "emotion" + ], + "heart-handshake": [ + "agreement", + "charity", + "help", + "deal", + "terms", + "emotion", + "together", + "handshake" + ], "heart-off": [ "unlike", "dislike", @@ -1658,6 +1714,13 @@ "block", "section" ], + "leaf": [ + "sustainability", + "nature", + "energy", + "plant", + "autumn" + ], "library": [ "book", "music", @@ -1704,6 +1767,12 @@ "todo", "done" ], + "list-end": [ + "queue", + "bottom", + "end", + "playlist" + ], "list-minus": [ "playlist", "remove", @@ -1712,6 +1781,13 @@ "remove", "delete" ], + "list-music": [ + "playlist", + "queue", + "music", + "audio", + "playback" + ], "list-ordered": [ "number", "order" @@ -1723,6 +1799,18 @@ "track", "new" ], + "list-start": [ + "queue", + "top", + "start", + "next", + "playlist" + ], + "list-video": [ + "playlist", + "video", + "playback" + ], "list-x": [ "playlist", "subtract", @@ -1772,6 +1860,11 @@ "exit", "auth" ], + "luggage": [ + "baggage", + "luggage", + "travel" + ], "magnet": [ "horseshoe", "lock", @@ -1937,6 +2030,14 @@ "move": [ "arrows" ], + "move-3d": [ + "arrows", + "axis", + "gizmo", + "coordinates", + "transform", + "translate" + ], "move-diagonal": [ "double", "arrow" @@ -2006,6 +2107,12 @@ "delete", "remove" ], + "package-open": [ + "box", + "container", + "unpack", + "open" + ], "package-plus": [ "new", "add", @@ -2019,6 +2126,22 @@ "delete", "remove" ], + "paint-bucket": [ + "fill", + "paint", + "bucket", + "design" + ], + "paintbrush": [ + "brush", + "paintbrush", + "design" + ], + "paintbrush-2": [ + "brush", + "paintbrush", + "design" + ], "palette": [ "color", "theme" @@ -2193,6 +2316,11 @@ "music", "connect" ], + "recycle": [ + "sustainability", + "salvage", + "arrows" + ], "redo": [ "undo", "history" @@ -2269,6 +2397,11 @@ "save": [ "floppy disk" ], + "scaling": [ + "scale", + "resize", + "design" + ], "scale": [ "balance", "legal", @@ -2294,6 +2427,13 @@ "desktop", "disconnect" ], + "scroll": [ + "paper", + "log", + "scripture", + "document", + "parchment" + ], "search": [ "find", "magnifier", @@ -2411,6 +2551,12 @@ "scale", "fullscreen" ], + "shrub": [ + "forest", + "undergrowth", + "park", + "nature" + ], "shuffle": [ "music" ], @@ -2478,6 +2624,15 @@ "5g", "lost" ], + "siren": [ + "police", + "ambulance", + "emergency", + "security", + "alert", + "alarm", + "light" + ], "skip-back": [ "arrow", "previous", @@ -2506,6 +2661,11 @@ "prohibited", "error" ], + "slice": [ + "cutter", + "scalpel", + "knife" + ], "sliders": [ "settings", "controls" @@ -2537,7 +2697,8 @@ "cold", "weather", "freeze", - "snow" + "snow", + "winter" ], "sofa": [ "armchair", @@ -2559,7 +2720,8 @@ ], "sprout": [ "leaf", - "nature" + "nature", + "plant" ], "square": [ "rectangle" @@ -2612,7 +2774,8 @@ "sun": [ "brightness", "weather", - "light" + "light", + "summer" ], "sun-dim": [ "brightness", @@ -2788,6 +2951,25 @@ "remove", "bin" ], + "tree-deciduous": [ + "tree", + "forest", + "park", + "nature" + ], + "tree-pine": [ + "tree", + "pine", + "forest", + "park", + "nature" + ], + "trees": [ + "tree", + "forest", + "park", + "nature" + ], "trello": [], "trending-down": [ "statistics" @@ -2896,6 +3078,24 @@ "group", "people" ], + "utensils": [ + "food", + "restaurant", + "meal", + "cutlery", + "breakfast", + "dinner", + "supper" + ], + "utensils-crossed": [ + "food", + "restaurant", + "meal", + "cutlery", + "breakfast", + "dinner", + "supper" + ], "venetian-mask": [ "mask", "masquerade", diff --git a/yarn.lock b/yarn.lock index 6eed97110..fc3626e35 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5584,6 +5584,17 @@ css-select@^4.1.3: domutils "^2.6.0" nth-check "^2.0.0" +css-select@^4.2.1: + version "4.3.0" + resolved "https://registry.yarnpkg.com/css-select/-/css-select-4.3.0.tgz#db7129b2846662fd8628cfc496abb2b59e41529b" + integrity sha512-wPpOYtnsVontu2mODhA19JrqWxNsfdatRKd64kmpRbQgh1KtItko5sTnEpPdpSaJszTOhEMlF/RPz28qj4HqhQ== + dependencies: + boolbase "^1.0.0" + css-what "^6.0.1" + domhandler "^4.3.1" + domutils "^2.8.0" + nth-check "^2.0.1" + css-selector-tokenizer@^0.7.1: version "0.7.3" resolved "https://registry.yarnpkg.com/css-selector-tokenizer/-/css-selector-tokenizer-0.7.3.tgz#735f26186e67c749aaf275783405cf0661fae8f1" @@ -5600,7 +5611,7 @@ css-tree@1.0.0-alpha.37: mdn-data "2.0.4" source-map "^0.6.1" -css-tree@^1.1.2, css-tree@^1.1.3: +css-tree@^1.0.0-alpha.39, css-tree@^1.1.2, css-tree@^1.1.3: version "1.1.3" resolved "https://registry.npmjs.org/css-tree/-/css-tree-1.1.3.tgz" integrity sha512-tRpdppF7TRazZrjJ6v3stzv93qxRcSsFmW6cX0Zm2NVKpxE1WV1HblnghVv9TreireHkqI/VDEsfolRF1p6y7Q== @@ -5618,6 +5629,11 @@ css-what@^5.0.0: resolved "https://registry.npmjs.org/css-what/-/css-what-5.1.0.tgz" integrity sha512-arSMRWIIFY0hV8pIxZMEfmMI47Wj3R/aWpZDDxWYCPEiOMv6tfOrnpDtgxBYPEQD4V0Y/958+1TdC3iWTFcUPw== +css-what@^6.0.1: + version "6.1.0" + resolved "https://registry.yarnpkg.com/css-what/-/css-what-6.1.0.tgz#fb5effcf76f1ddea2c81bdfaa4de44e79bac70f4" + integrity sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw== + css.escape@^1.5.1: version "1.5.1" resolved "https://registry.yarnpkg.com/css.escape/-/css.escape-1.5.1.tgz#42e27d4fa04ae32f931a4b4d4191fa9cddee97cb" @@ -6236,7 +6252,7 @@ domexception@^2.0.1: dependencies: webidl-conversions "^5.0.0" -domhandler@^4.0.0: +domhandler@^4.0.0, domhandler@^4.3.1: version "4.3.1" resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-4.3.1.tgz#8d792033416f59d68bc03a5aa7b018c1ca89279c" integrity sha512-GrwoxYN+uWlzO8uhUXRl0P+kHE4GtVPfYzVLcUxPL7KNdHKj66vvlhiweIHqYYXWlw+T8iLMp42Lm67ghw4WMQ== @@ -6258,7 +6274,7 @@ domutils@^1.7.0: dom-serializer "0" domelementtype "1" -domutils@^2.5.2, domutils@^2.6.0: +domutils@^2.5.2, domutils@^2.6.0, domutils@^2.8.0: version "2.8.0" resolved "https://registry.npmjs.org/domutils/-/domutils-2.8.0.tgz" integrity sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A== @@ -10945,6 +10961,13 @@ nth-check@^2.0.0: dependencies: boolbase "^1.0.0" +nth-check@^2.0.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-2.1.1.tgz#c9eab428effce36cd6b92c924bdb000ef1f1ed1d" + integrity sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w== + dependencies: + boolbase "^1.0.0" + number-is-nan@^1.0.0: version "1.0.1" resolved "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz" @@ -11306,7 +11329,7 @@ parallel-transform@^1.1.0: param-case@2.1.x: version "2.1.1" resolved "https://registry.yarnpkg.com/param-case/-/param-case-2.1.1.tgz#df94fd8cf6531ecf75e6bef9a0858fbc72be2247" - integrity sha512-eQE845L6ot89sk2N8liD8HAuH4ca6Vvr7VWAWwt7+kvvG5aBcPmmphQ68JsEG2qa9n1TykS2DLeMt363AAH8/w== + integrity sha1-35T9jPZTHs915r75oIWPvHK+Ikc= dependencies: no-case "^2.2.0" @@ -12670,6 +12693,14 @@ react-is@^17.0.1: resolved "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz" integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w== +react-native-svg@^12.0.0: + version "12.3.0" + resolved "https://registry.yarnpkg.com/react-native-svg/-/react-native-svg-12.3.0.tgz#40f657c5d1ee366df23f3ec8dae76fd276b86248" + integrity sha512-ESG1g1j7/WLD7X3XRFTQHVv0r6DpbHNNcdusngAODIxG88wpTWUZkhcM3A2HJTb+BbXTFDamHv7FwtRKWQ/ALg== + dependencies: + css-select "^4.2.1" + css-tree "^1.0.0-alpha.39" + react-refresh@^0.10.0: version "0.10.0" resolved "https://registry.npmjs.org/react-refresh/-/react-refresh-0.10.0.tgz" @@ -13473,9 +13504,9 @@ semver-intersect@1.4.0: semver "^5.0.0" semver-regex@^3.1.2: - version "3.1.3" - resolved "https://registry.npmjs.org/semver-regex/-/semver-regex-3.1.3.tgz" - integrity sha512-Aqi54Mk9uYTjVexLnR67rTyBusmwd04cLkHy9hNvk3+G3nT2Oyg7E0l4XVbOaNwIvQ3hHeYxGcyEy+mKreyBFQ== + version "3.1.4" + resolved "https://registry.yarnpkg.com/semver-regex/-/semver-regex-3.1.4.tgz#13053c0d4aa11d070a2f2872b6b1e3ae1e1971b4" + integrity sha512-6IiqeZNgq01qGf0TId0t3NvKzSvUsjcpdEO3AQNeIjR6A2+ckTnQlDpl4qu1bjRv0RzN3FP9hzFmws3lKqRWkA== "semver@2 || 3 || 4 || 5", semver@^5.0.0, semver@^5.3.0, semver@^5.4.1, semver@^5.5.0, semver@^5.5.1, semver@^5.6.0, semver@^5.7.0: version "5.7.1"