Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mansoorkhan96 committed May 19, 2024
0 parents commit 1dfa300
Show file tree
Hide file tree
Showing 1,558 changed files with 2,012 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
* text=auto

/.github export-ignore
/bin export-ignore
/config/generation.php export-ignore
/dist export-ignore
/tests export-ignore
.gitattributes export-ignore
.gitignore export-ignore
.php_cs.dist export-ignore
CHANGELOG.md export-ignore
phpunit.xml.dist export-ignore
README.md export-ignore
UPGRADE.md export-ignore
50 changes: 50 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Tests

on:
push:
branches:
- main
- '*.x'
pull_request:
schedule:
- cron: '0 0 * * *'

jobs:
tests:
runs-on: ubuntu-latest

strategy:
fail-fast: true
matrix:
php: ['8.0', 8.1, 8.2, 8.3]
laravel: [9, 10, 11]
exclude:
- php: '8.0'
laravel: 10
- php: '8.0'
laravel: 11
- php: 8.1
laravel: 11
- php: 8.3
laravel: 9

name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }}

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip
coverage: none

- name: Install dependencies
run: |
composer require "illuminate/contracts=^${{ matrix.laravel }}" --prefer-dist --no-interaction --no-update
composer update --prefer-dist --no-interaction --no-progress
- name: Execute tests
run: vendor/bin/phpunit
9 changes: 9 additions & 0 deletions .github/workflows/update-changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: "Update Changelog"

on:
release:
types: [released]

jobs:
update:
uses: laravel/.github/.github/workflows/update-changelog.yml@main
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
node_modules/
build/
.phpunit.cache/
vendor/
.phpunit.result.cache
composer.lock
phpunit.xml
package-lock.json
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Changelog

This changelog follows [the Keep a Changelog standard](https://keepachangelog.com).
29 changes: 29 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
The MIT License (MIT)

Copyright (c) Mansoor Ahmed

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

## Third-Party Licenses

This project includes icons from [Lets Icons] which are licensed under the Creative Commons Attribution 4.0 International License.

You can view the license here: https://creativecommons.org/licenses/by/4.0/

Icons by [Leonid Tsvetkov](https://dribbble.com/Lets) from [Lets Icons].
92 changes: 92 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# Blade Lets

<a href="https://github.com/mansoorkhan96/blade-lets-icons/actions?query=workflow%3ATests">
<img src="https://github.com/mansoorkhan96/blade-lets-icons/workflows/Tests/badge.svg" alt="Tests">
</a>
<a href="https://packagist.org/packages/mansoorkhan96/blade-lets-icons">
<img src="https://img.shields.io/packagist/v/mansoorkhan96/blade-lets-icons" alt="Latest Stable Version">
</a>
<a href="https://packagist.org/packages/mansoorkhan96/blade-lets-icons">
<img src="https://img.shields.io/packagist/dt/mansoorkhan96/blade-lets-icons" alt="Total Downloads">
</a>

A package to easily make use of [Lets Icons](https://www.figma.com/community/file/886554014393250663) in your Laravel Blade views.

For a full list of available icons see [the SVG directory](resources/svg) or preview them at [icones.js.org/collection/lets-icons](https://icones.js.org/collection/lets-icons). Lets Icons are originally developed by [Leonid Tsvetkov](https://twitter.com/steveschoger) and [Adam Wathan](https://twitter.com/adamwathan).

## Requirements

- PHP 8.0 or higher
- Laravel 9.0 or higher

## Installation

```bash
composer require mansoor/blade-lets-icons
```

## Blade Icons

Blade Lets Icons uses Blade Icons under the hood. Please refer to [the Blade Icons readme](https://github.com/blade-ui-kit/blade-icons) for additional functionality. We also recommend to [enable icon caching](https://github.com/blade-ui-kit/blade-icons#caching) with this library.

## Configuration

Blade Lets Icons also offers the ability to use features from Blade Icons like default classes, default attributes, etc. If you'd like to configure these, publish the `blade-lets-icons.php` config file:

```bash
php artisan vendor:publish --tag=blade-lets-icons-config
```

## Usage

Icons can be used as self-closing Blade components which will be compiled to SVG icons:

```blade
<x-letsicon-bell />
```

You can also pass classes to your icon components:

```blade
<x-letsicon-bell class="w-6 h-6 text-gray-500" />
```

And even use inline styles:

```blade
<x-letsicon-bell style="color: #555" />
```

Or use the `@svg` directive:

```blade
@svg('letsicon-bell', 'w-6 h-6', ['style' => 'color: #555'])
```

### Raw SVG Icons

If you want to use the raw SVG icons as assets, you can publish them using:

```bash
php artisan vendor:publish --tag=blade-lets-icons --force
```

Then use them in your views like:

```blade
<img src="{{ asset('vendor/blade-lets-icons/letsicon-bell.svg') }}" width="10" height="10"/>
```

## Acknowledgements

This project uses icons from [Lets Icons](https://www.figma.com/community/file/886554014393250663) which are licensed under the Creative Commons Attribution 4.0 International License. You can view the license [here](https://creativecommons.org/licenses/by/4.0/).

Icons by [Leonid Tsvetkov](https://dribbble.com/Lets) from [Lets Icons].

## Changelog

Check out the [CHANGELOG](CHANGELOG.md) in this repository for all the recent changes.

## License

Blade Lets Icons is open-sourced software licensed under [the MIT license](LICENSE.md).
53 changes: 53 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"name": "mansoor/blade-lets-icons",
"description": "A package to easily make use of Lets Icons in your Laravel Blade views.",
"keywords": [
"Blade",
"Lets Icons",
"Laravel"
],
"homepage": "https://github.com/mansoor96/blade-lets-icons",
"license": "MIT",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/mansoorkhan96"
}
],
"authors": [
{
"name": "Mansoor Ahmed"
}
],
"require": {
"php": "^8.0",
"blade-ui-kit/blade-icons": "^1.6",
"illuminate/support": "^9.0|^10.0|^11.0"
},
"require-dev": {
"orchestra/testbench": "^7.0|^8.0|^9.0",
"phpunit/phpunit": "^9.0|^10.5|^11.0"
},
"autoload": {
"psr-4": {
"Mansoor\\LetsIcons\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests"
}
},
"extra": {
"laravel": {
"providers": [
"Mansoor\\LetsIcons\\BladeLetsIconsServiceProvider"
]
}
},
"config": {
"sort-packages": true
},
"minimum-stability": "dev",
"prefer-stable": true
}
57 changes: 57 additions & 0 deletions config/blade-lets-icons.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?php

return [

/*
|-----------------------------------------------------------------
| Default Prefix
|-----------------------------------------------------------------
|
| This config option allows you to define a default prefix for
| your icons. The dash separator will be applied automatically
| to every icon name. It's required and needs to be unique.
|
*/

'prefix' => 'letsicon',

/*
|-----------------------------------------------------------------
| Fallback Icon
|-----------------------------------------------------------------
|
| This config option allows you to define a fallback
| icon when an icon in this set cannot be found.
|
*/

'fallback' => '',

/*
|-----------------------------------------------------------------
| Default Set Classes
|-----------------------------------------------------------------
|
| This config option allows you to define some classes which
| will be applied by default to all icons within this set.
|
*/

'class' => '',

/*
|-----------------------------------------------------------------
| Default Set Attributes
|-----------------------------------------------------------------
|
| This config option allows you to define some attributes which
| will be applied by default to all icons within this set.
|
*/

'attributes' => [
// 'width' => 50,
// 'height' => 50,
],

];
7 changes: 7 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"dependencies": {
"@iconify-json/lets-icons": "^1.1.2",
"@iconify/utils": "^2.1.23",
"heroicons": "^2.1.3"
}
}
12 changes: 12 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
>
<testsuites>
<testsuite name="Blade Heroicons Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
</phpunit>
1 change: 1 addition & 0 deletions resources/svg/10-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions resources/svg/10.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions resources/svg/3d-box-duotone.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions resources/svg/3d-box-fill.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions resources/svg/3d-box-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions resources/svg/3d-box.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions resources/svg/add-duotone-line.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions resources/svg/add-duotone.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions resources/svg/add-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions resources/svg/add-ring-duotone-line.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions resources/svg/add-ring-duotone.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions resources/svg/add-ring-fill.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions resources/svg/add-ring-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions resources/svg/add-ring.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions resources/svg/add-round-duotone-line.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions resources/svg/add-round-duotone.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions resources/svg/add-round-fill.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions resources/svg/add-round-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 1dfa300

Please sign in to comment.