Skip to content

Commit

Permalink
More updates
Browse files Browse the repository at this point in the history
  • Loading branch information
agentphoenix committed Aug 22, 2023
1 parent b3cb320 commit 23eaf39
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 51 deletions.
4 changes: 1 addition & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@

This changelog follows [the Keep a Changelog standard](https://keepachangelog.com).


## [Unreleased](https://github.com/blade-organization/blade-heroicons/compare/1.0.0...main)


## 1.0.0 (20??-??-??)
## 0.0.6-beta (2023-08-22)

Initial release.
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) Blade Developer
Copyright (c) Anodyne Productions

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
59 changes: 23 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,18 @@
# Blade Icons Template
# Blade Mage Icons

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

> This is a template repository for new icon packages for [Blade Icons](https://github.com/blade-ui-kit/blade-icons). Start a new repo with this and replace the relevant things below:
>
> 1. `blade-organization` with your GitHub organization
> 2. `blade-heroicons` with your repository name
> 3. `Blade Heroicons` & `Blade Icons Template` with your icon set name
> 4. Any other reference to `Heroicons` with your icon set name
> 5. `Blade Developer` with your name
>
> Then, make sure [the implementation](./src) is correct, that you set up [icon generation](https://github.com/blade-ui-kit/blade-icons#generating-icons) and that [your tests](./tests) pass. And remove this quote block from your readme. When you've published your package on Packagist, make sure to send it in to [the Blade Icons package list](https://github.com/blade-ui-kit/blade-icons#icon-packages).
A package to easily make use of [Mage icons](https://mageicons.com/) in your Laravel Blade views.

A package to easily make use of [Heroicons](https://github.com/refactoringui/heroicons) in your Laravel Blade views.

For a full list of available icons see [the SVG directory](resources/svg) or preview them at [heroicons.com](https://heroicons.com/).
For a full list of available icons see the website or [the SVG directory](resources/svg).

## Requirements

Expand All @@ -32,63 +22,60 @@ For a full list of available icons see [the SVG directory](resources/svg) or pre
## Installation

```bash
composer require blade-organization/blade-heroicons
composer require anodyne/blade-mage-icons
```

## Updating

Please refer to [`the upgrade guide`](UPGRADE.md) when updating the library.

## Blade Icons

Blade Heroicons 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.
Blade Mage 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 Heroicons 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-heroicons.php` config file:
Blade Mage 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-mage-icons.php` config file:

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

## Usage

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

```blade
<x-heroicon-o-adjustments/>
<x-mage-s-check-circle/>
```

You can also pass classes to your icon components:

```blade
<x-heroicon-o-adjustments class="w-6 h-6 text-gray-500"/>
<x-mage-s-check-circle class="w-6 h-6 text-gray-500"/>
```

And even use inline styles:

```blade
<x-heroicon-o-adjustments style="color: #555"/>
<x-mage-s-check-circle style="color: #555"/>
```

The solid icons can be referenced like this:
The bulk (filled) icons can be referenced like this:

```blade
<x-heroicon-s-adjustments/>
<x-mage-b-check-circle/>
```

### 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-heroicons --force
php artisan vendor:publish --tag=blade-mage-icons --force
```

Then use them in your views like:

```blade
<img src="{{ asset('vendor/blade-heroicons/o-adjustments.svg') }}" width="10" height="10"/>
<img src="{{ asset('vendor/blade-mage-icons/b-check-circle.svg') }}" width="10" height="10"/>
<img src="{{ asset('vendor/blade-mage-icons/s-check-circle.svg') }}" width="10" height="10"/>
```

## Changelog
Expand All @@ -97,8 +84,8 @@ Check out the [CHANGELOG](CHANGELOG.md) in this repository for all the recent ch

## Maintainers

Blade Heroicons is developed and maintained by Blade Developer.
Blade Mage Icons is developed and maintained by Anodyne Productions.

## License

Blade Heroicons is open-sourced software licensed under [the MIT license](LICENSE.md).
Blade Mage Icons is open-sourced software licensed under [the MIT license](LICENSE.md).
6 changes: 0 additions & 6 deletions package.json

This file was deleted.

10 changes: 5 additions & 5 deletions tests/CompilesIconsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Tests;

use BladeUI\Heroicons\BladeHeroiconsServiceProvider;
use BladeUI\MageIcons\BladeMageIconsServiceProvider;
use BladeUI\Icons\BladeIconsServiceProvider;
use Orchestra\Testbench\TestCase;

Expand All @@ -13,7 +13,7 @@ class CompilesIconsTest extends TestCase
/** @test */
public function it_compiles_a_single_anonymous_component()
{
$result = svg('heroicon-o-bell')->toHtml();
$result = svg('mage-s-bell')->toHtml();

// Note: the empty class here seems to be a Blade components bug.
$expected = <<<'SVG'
Expand All @@ -28,7 +28,7 @@ public function it_compiles_a_single_anonymous_component()
/** @test */
public function it_can_add_classes_to_icons()
{
$result = svg('heroicon-o-bell', 'w-6 h-6 text-gray-500')->toHtml();
$result = svg('mage-s-bell', 'w-6 h-6 text-gray-500')->toHtml();

$expected = <<<'SVG'
<svg class="w-6 h-6 text-gray-500" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
Expand All @@ -42,7 +42,7 @@ public function it_can_add_classes_to_icons()
/** @test */
public function it_can_add_styles_to_icons()
{
$result = svg('heroicon-o-bell', ['style' => 'color: #555'])->toHtml();
$result = svg('mage-s-bell', ['style' => 'color: #555'])->toHtml();

$expected = <<<'SVG'
<svg style="color: #555" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
Expand All @@ -57,7 +57,7 @@ protected function getPackageProviders($app)
{
return [
BladeIconsServiceProvider::class,
BladeHeroiconsServiceProvider::class,
BladeMageIconsServiceProvider::class,
];
}
}

0 comments on commit 23eaf39

Please sign in to comment.