diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index baa3c5a..dd56edd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -71,4 +71,3 @@ jobs: tag_name: ${{ steps.new-version.outputs.NEW_VERSION }} name: New icons ${{ steps.new-version.outputs.NEW_VERSION }} body: ${{ steps.change-log.outputs.CHANGE_LOG }} - diff --git a/.github/workflows/close-stale-prs.yml b/.github/workflows/close-stale-prs.yml index 24747ff..b51e9d6 100644 --- a/.github/workflows/close-stale-prs.yml +++ b/.github/workflows/close-stale-prs.yml @@ -1,7 +1,7 @@ -name: 'Close stale issues and PR' +name: Close stale issues and PR on: schedule: - - cron: '45 1 * * *' + - cron: "45 1 * * *" jobs: stale: @@ -10,9 +10,9 @@ jobs: - uses: actions/stale@v3 with: repo-token: ${{ secrets.GITHUB_TOKEN }} - stale-pr-message: 'This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 5 days.' - close-pr-message: 'This PR was closed because it has been stalled for 5 days with no activity.' - close-pr-label: '🧶 stale' + stale-pr-message: This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 5 days. + close-pr-message: This PR was closed because it has been stalled for 5 days with no activity. + close-pr-label: 🧶 stale days-before-stale: 30 days-before-close: 5 days-before-pr-close: -1 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d0a040b..d339d86 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,12 +3,12 @@ name: Release Packages on: push: tags: - - 'v*' + - "v*" workflow_dispatch: inputs: version: - description: 'Version' + description: Version required: true jobs: @@ -35,8 +35,8 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-node@v2.4.0 with: - node-version: '14' - cache: 'yarn' + node-version: "14" + cache: yarn - name: Install dependencies run: yarn --prefer-offline @@ -70,8 +70,8 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-node@v2.4.0 with: - node-version: '14' - cache: 'yarn' + node-version: "14" + cache: yarn - name: Install dependencies run: yarn --prefer-offline @@ -105,8 +105,8 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-node@v2.4.0 with: - node-version: '14' - cache: 'yarn' + node-version: "14" + cache: yarn - name: Install dependencies run: yarn --prefer-offline @@ -140,8 +140,8 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-node@v2.4.0 with: - node-version: '14' - cache: 'yarn' + node-version: "14" + cache: yarn - name: Install dependencies run: yarn --prefer-offline @@ -175,8 +175,8 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-node@v2.4.0 with: - node-version: '14' - cache: 'yarn' + node-version: "14" + cache: yarn - name: Install dependencies run: yarn --prefer-offline @@ -210,8 +210,8 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-node@v2.4.0 with: - node-version: '14' - cache: 'yarn' + node-version: "14" + cache: yarn - name: Install dependencies run: yarn --prefer-offline @@ -245,8 +245,8 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-node@v2.4.0 with: - node-version: '14' - cache: 'yarn' + node-version: "14" + cache: yarn - name: Install FontForge run: sudo apt-get install zlib1g-dev fontforge @@ -256,18 +256,18 @@ jobs: - name: Install and move sfnt2woff-zopfli run: | - cd sfnt2woff-zopfli - make - sudo mv sfnt2woff-zopfli /usr/local/bin/sfnt2woff + cd sfnt2woff-zopfli + make + sudo mv sfnt2woff-zopfli /usr/local/bin/sfnt2woff - name: Clone woff2 run: git clone --recursive https://github.com/google/woff2.git - name: Install woff2 run: | - cd woff2 - sudo make clean all - sudo mv woff2_compress /usr/local/bin/ && sudo mv woff2_decompress /usr/local/bin/ + cd woff2 + sudo make clean all + sudo mv woff2_compress /usr/local/bin/ && sudo mv woff2_decompress /usr/local/bin/ - name: Install Font Custom dependency run: sudo gem install fontcustom @@ -277,23 +277,23 @@ jobs: - name: Build Icon Font run: | - mkdir build - list=(-200 -300 "" -500 -600) - command='' - for name in "${list[@]}" - do - subcommand="(yarn build:outline-icons --outputDir=converted_icons${name} && fontcustom compile "./converted_icons${name}" -h -n "lucide${name}" -o ./build -F)" - if [ -z "$command" ] - then - command="$subcommand"; - else - command="$command & $subcommand"; - fi - done + mkdir build + list=(-200 -300 "" -500 -600) + command='' + for name in "${list[@]}" + do + subcommand="(yarn build:outline-icons --outputDir=converted_icons${name} && fontcustom compile "./converted_icons${name}" -h -n "lucide${name}" -o ./build -F)" + if [ -z "$command" ] + then + command="$subcommand"; + else + command="$command & $subcommand"; + fi + done - eval $command + eval $command - - name: 'Upload to Artifacts' + - name: "Upload to Artifacts" uses: actions/upload-artifact@v1 with: name: lucide-font @@ -304,13 +304,13 @@ jobs: runs-on: ubuntu-latest needs: [pre-build, lucide-font] container: - image: cirrusci/flutter:latest + image: cirrusci/flutter:latest steps: - uses: actions/checkout@v2 - uses: actions/download-artifact@v2 - uses: actions/cache@v2 with: - path: '~/.pub-cache' + path: ~/.pub-cache key: ${{ runner.os }}-pub-${{ hashFiles('~/.pub-cache') }} restore-keys: | ${{ runner.os }}-pub- @@ -336,13 +336,21 @@ jobs: - name: List lucide-font folder run: ls lucide-font - - name: Move the assets files - run: mv lucide-font packages/lucide-flutter/assets + - name: Copy assets from lucide-font directory + run: | + mkdir packages/lucide-flutter/assets + cp lucide-font/lucide.ttf packages/lucide-flutter/assets/lucide.ttf + cp lucide-font/lucide-preview.html packages/lucide-flutter/assets/lucide-preview.html - name: Generate exports file - run: dart tool/generate_fonts.dart assets/lucide-preview.html + run: | + dart tool/generate_fonts.dart assets/lucide-preview.html + flutter format . working-directory: packages/lucide-flutter + - name: Test + run: flutter test + - name: Update yaml run: sed -E 's/(version:)[^\n]*/\1 ${{ needs.pre-build.outputs.VERSION }}/;' pubspec.yaml > pubspec && mv pubspec pubspec.yaml working-directory: packages/lucide-flutter @@ -357,11 +365,21 @@ jobs: name: lucide-flutter-pubspec-yaml path: packages/lucide-flutter/pubspec.yaml - post-release: if: github.repository == 'lucide-icons/lucide' runs-on: ubuntu-latest - needs: [pre-build, lucide, lucide-react, lucide-vue, lucide-vue-next, lucide-angular, lucide-preact, lucide-flutter, lucide-font] + needs: + [ + pre-build, + lucide, + lucide-react, + lucide-vue, + lucide-vue-next, + lucide-angular, + lucide-preact, + lucide-flutter, + lucide-font, + ] steps: - uses: actions/checkout@v2 diff --git a/README.md b/README.md index 92de876..831b694 100644 --- a/README.md +++ b/README.md @@ -113,7 +113,7 @@ yarn add lucide-angular npm install lucide-angular ``` -For more details, see the [documentation](https://github.com/lucide-icons/lucide/tree/packages/lucide-angular#lucide-angular). +For more details, see the [documentation](https://github.com/lucide-icons/lucide/tree/master/packages/lucide-angular#lucide-angular). ### Preact diff --git a/icons/gem.svg b/icons/gem.svg new file mode 100644 index 0000000..fc09bfb --- /dev/null +++ b/icons/gem.svg @@ -0,0 +1,16 @@ + + + + + + diff --git a/packages/lucide-angular/package.json b/packages/lucide-angular/package.json index dc31479..0ad1d7e 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.16.7", + "version": "0.16.10", "author": "SMAH1", "license": "ISC", "homepage": "https://lucide.dev", diff --git a/packages/lucide-flutter/.gitignore b/packages/lucide-flutter/.gitignore index 911326b..8d8d108 100644 --- a/packages/lucide-flutter/.gitignore +++ b/packages/lucide-flutter/.gitignore @@ -30,6 +30,7 @@ .pub/ build/ assets +pubspec.lock # Android related **/android/**/gradle-wrapper.jar diff --git a/packages/lucide-flutter/lib/lucide_icons.dart b/packages/lucide-flutter/lib/lucide_icons.dart index 37bf1de..cd5c186 100644 --- a/packages/lucide-flutter/lib/lucide_icons.dart +++ b/packages/lucide-flutter/lib/lucide_icons.dart @@ -1,4 +1,5 @@ library lucide_icons; + import "package:flutter/widgets.dart"; import "src/icon_data.dart"; diff --git a/packages/lucide-flutter/pubspec.lock b/packages/lucide-flutter/pubspec.lock deleted file mode 100644 index 3c79d74..0000000 --- a/packages/lucide-flutter/pubspec.lock +++ /dev/null @@ -1,175 +0,0 @@ -# Generated by pub -# See https://dart.dev/tools/pub/glossary#lockfile -packages: - async: - dependency: transitive - description: - name: async - url: "https://pub.dartlang.org" - source: hosted - version: "2.6.1" - boolean_selector: - dependency: transitive - description: - name: boolean_selector - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0" - characters: - dependency: transitive - description: - name: characters - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" - charcode: - dependency: transitive - description: - name: charcode - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - clock: - dependency: transitive - description: - name: clock - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" - collection: - dependency: transitive - description: - name: collection - url: "https://pub.dartlang.org" - source: hosted - version: "1.15.0" - csslib: - dependency: transitive - description: - name: csslib - url: "https://pub.dartlang.org" - source: hosted - version: "0.17.0" - fake_async: - dependency: transitive - description: - name: fake_async - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - flutter: - dependency: "direct main" - description: flutter - source: sdk - version: "0.0.0" - flutter_test: - dependency: "direct dev" - description: flutter - source: sdk - version: "0.0.0" - html: - dependency: "direct dev" - description: - name: html - url: "https://pub.dartlang.org" - source: hosted - version: "0.15.0" - lint: - dependency: "direct dev" - description: - name: lint - url: "https://pub.dartlang.org" - source: hosted - version: "1.6.0" - matcher: - dependency: transitive - description: - name: matcher - url: "https://pub.dartlang.org" - source: hosted - version: "0.12.10" - meta: - dependency: transitive - description: - name: meta - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0" - path: - dependency: transitive - description: - name: path - url: "https://pub.dartlang.org" - source: hosted - version: "1.8.0" - recase: - dependency: "direct dev" - description: - name: recase - url: "https://pub.dartlang.org" - source: hosted - version: "4.0.0" - sky_engine: - dependency: transitive - description: flutter - source: sdk - version: "0.0.99" - source_span: - dependency: transitive - description: - name: source_span - url: "https://pub.dartlang.org" - source: hosted - version: "1.8.1" - stack_trace: - dependency: transitive - description: - name: stack_trace - url: "https://pub.dartlang.org" - source: hosted - version: "1.10.0" - stream_channel: - dependency: transitive - description: - name: stream_channel - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0" - string_scanner: - dependency: transitive - description: - name: string_scanner - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" - term_glyph: - dependency: transitive - description: - name: term_glyph - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - test_api: - dependency: transitive - description: - name: test_api - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.0" - typed_data: - dependency: transitive - description: - name: typed_data - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0" - vector_math: - dependency: transitive - description: - name: vector_math - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0" -sdks: - dart: ">=2.13.0 <3.0.0" - flutter: ">=1.17.0" diff --git a/packages/lucide-flutter/pubspec.yaml b/packages/lucide-flutter/pubspec.yaml index 475b2c7..ae504a8 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. -version: 0.16.7 +description: A Lucide icon library package for Flutter applications. Fork of Feather Icons, open for anyone to contribute icons. +version: 0.16.10 homepage: https://lucide.dev repository: https://github.com/lucide-icons/lucide @@ -23,4 +23,4 @@ flutter: fonts: - family: Lucide fonts: - - asset: assets/Lucide.ttf + - asset: assets/lucide.ttf diff --git a/packages/lucide-flutter/test/icon_test.dart b/packages/lucide-flutter/test/icon_test.dart new file mode 100644 index 0000000..3428ccd --- /dev/null +++ b/packages/lucide-flutter/test/icon_test.dart @@ -0,0 +1,147 @@ +// Tests adapted from https://github.com/fluttercommunity/font_awesome_flutter/blob/master/test/fa_icon_test.dart +// Copyright 2014 The Flutter Authors. All rights reserved. + +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:flutter/widgets.dart'; +import 'package:lucide_icons/lucide_icons.dart'; + +void main() { + testWidgets('Can set opacity for an Icon', (WidgetTester tester) async { + await tester.pumpWidget( + const Directionality( + textDirection: TextDirection.ltr, + child: IconTheme( + data: IconThemeData( + color: Color(0xFF666666), + opacity: 0.5, + ), + child: Icon(LucideIcons.bot), + ), + ), + ); + final RichText text = tester.widget(find.byType(RichText)); + expect(text.text.style!.color, const Color(0xFF666666).withOpacity(0.5)); + }); + + testWidgets('Icon sizing - no theme, default size', + (WidgetTester tester) async { + await tester.pumpWidget( + const Directionality( + textDirection: TextDirection.ltr, + child: Center( + child: Icon(LucideIcons.bot), + ), + ), + ); + + final RenderBox renderObject = tester.renderObject(find.byType(Icon)); + expect(renderObject.size, equals(const Size.square(24.0))); + }); + + testWidgets('Icon sizing - no theme, explicit size', + (WidgetTester tester) async { + await tester.pumpWidget( + const Directionality( + textDirection: TextDirection.ltr, + child: Center( + child: Icon( + LucideIcons.bot, + size: 96.0, + ), + ), + ), + ); + + final RenderBox renderObject = tester.renderObject(find.byType(Icon)); + expect(renderObject.size, equals(const Size.square(96.0))); + }); + + testWidgets('Icon sizing - sized theme', (WidgetTester tester) async { + await tester.pumpWidget( + const Directionality( + textDirection: TextDirection.ltr, + child: Center( + child: IconTheme( + data: IconThemeData(size: 36.0), + child: Icon(LucideIcons.bot), + ), + ), + ), + ); + + final RenderBox renderObject = tester.renderObject(find.byType(Icon)); + expect(renderObject.size, equals(const Size.square(36.0))); + }); + + testWidgets('Icon sizing - sized theme, explicit size', + (WidgetTester tester) async { + await tester.pumpWidget( + const Directionality( + textDirection: TextDirection.ltr, + child: Center( + child: IconTheme( + data: IconThemeData(size: 36.0), + child: Icon( + LucideIcons.bot, + size: 48.0, + ), + ), + ), + ), + ); + + final RenderBox renderObject = tester.renderObject(find.byType(Icon)); + expect(renderObject.size, equals(const Size.square(48.0))); + }); + + testWidgets('Icon sizing - sizeless theme, default size', + (WidgetTester tester) async { + await tester.pumpWidget( + const Directionality( + textDirection: TextDirection.ltr, + child: Center( + child: IconTheme( + data: IconThemeData(), + child: Icon(LucideIcons.bot), + ), + ), + ), + ); + + final RenderBox renderObject = tester.renderObject(find.byType(Icon)); + expect(renderObject.size, equals(const Size.square(24.0))); + }); + + testWidgets("Changing semantic label from null doesn't rebuild tree ", + (WidgetTester tester) async { + await tester.pumpWidget( + const Directionality( + textDirection: TextDirection.ltr, + child: Center( + child: Icon(LucideIcons.bot), + ), + ), + ); + + final Element richText1 = tester.element(find.byType(RichText)); + + await tester.pumpWidget( + const Directionality( + textDirection: TextDirection.ltr, + child: Center( + child: Icon( + LucideIcons.bot, + semanticLabel: 'a label', + ), + ), + ), + ); + + final Element richText2 = tester.element(find.byType(RichText)); + + // Compare a leaf Element in the Icon subtree before and after changing the + // semanticLabel to make sure the subtree was not rebuilt. + expect(richText2, same(richText1)); + }); +} diff --git a/packages/lucide-preact/package.json b/packages/lucide-preact/package.json index 5e8d7f5..72fc28e 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.16.7", + "version": "0.16.10", "license": "ISC", "homepage": "https://lucide.dev", "bugs": "https://github.com/lucide-icons/lucide/issues", diff --git a/packages/lucide-react/package.json b/packages/lucide-react/package.json index 51d92b2..4348563 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.16.7", + "version": "0.16.10", "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 8fd05a8..2aa867a 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.16.7", + "version": "0.16.10", "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 95d6905..7cc611a 100644 --- a/packages/lucide-vue/package.json +++ b/packages/lucide-vue/package.json @@ -1,6 +1,6 @@ { "name": "lucide-vue", - "version": "0.16.7", + "version": "0.16.10", "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 78e95e7..73a7979 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.16.7", + "version": "0.16.10", "license": "ISC", "homepage": "https://lucide.dev", "bugs": "https://github.com/lucide-icons/lucide/issues",