Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Giulio Troccoli-Allard committed Jun 16, 2021
0 parents commit 6c1637e
Show file tree
Hide file tree
Showing 641 changed files with 4,613 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
dist/
composer.lock
phpunit.xml
vendor
.phpunit.result.cache
.idea
.original-repo
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Changelog

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

## 0.1.0 (TBC)

Initial release.
21 changes: 21 additions & 0 deletions LICENCE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) Dries Vints

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.
97 changes: 97 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
<p>
<img src="./socialcard-blade-health-icons.png" alt="Social Card Blade Healt Icons"/>
</p>

# Blade Health Icons

<a href="https://github.com/troccoli/blade-health-icons/actions?query=workflow%3ATests">
<img src="https://github.com/blade-ui-kit/blade-health-icons/workflows/Tests/badge.svg" alt="Tests">
</a>
<a href="https://github.styleci.io/repos/258753939">
<img src="https://github.styleci.io/repos/258753939/shield?style=flat" alt="Code Style">
</a>
<a href="https://packagist.org/packages/troccoli/blade-health-icons">
<img src="https://img.shields.io/packagist/v/blade-ui-kit/blade-health-icons" alt="Latest Stable Version">
</a>
<a href="https://packagist.org/packages/troccoli/blade-health-icons">
<img src="https://img.shields.io/packagist/dt/troccoli/blade-health-icons" alt="Total Downloads">
</a>

A package to easily make use of [Health Icons](https://github.com/resolvetosavelives/healthicons) in your Laravel Blade views.

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

## Requirements

- PHP 7.4 or higher
- Laravel 8.0 or higher

## Installation

```bash
composer require troccoli/blade-health-icons
```

## Blade Icons

Blade Healthicons 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 Healthicons 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-health-icons.php` config file:

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

## Usage

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

```blade
<x-health-icon-o-blood-a-n/>
```

You can also pass classes to your icon components:

```blade
<x-health-icon-o-blood-a-n class="w-6 h-6 text-gray-500"/>
```

And even use inline styles:

```blade
<x-health-icon-o-blood-a-n style="color: #555"/>
```

The solid icons can be referenced like this:

```blade
<x-health-icon-s-blood-a-n/>
```

### 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-health-icons --force
```

Then use them in your views like:

```blade
<img src="{{ asset('vendor/blade-health-icons/o-blood-a-n.svg') }}" width="10" height="10"/>
```

## Changelog

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

## Maintainers

Blade Healthicons is developed and maintained by [Giulio Troccoli-Allard](https://troccoli.it).

## License

Blade Healthicons is open-sourced software licensed under [the MIT license](LICENSE.md).
35 changes: 35 additions & 0 deletions bin/compile.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/usr/bin/env bash

set -e

DIRECTORY=$(cd `dirname $0` && pwd)
TEMP=$DIRECTORY/../.original-repo
REPO=$TEMP/healthicons
DIST=$REPO/public/icons/svg
RESOURCES=$DIRECTORY/../resources/svg

if [ -d $TEMP ]; then
rm -rf $TEMP
mkdir $TEMP
fi

echo "Cloning resolvetosavelives/healthicons repo"

git clone -q https://github.com/resolvetosavelives/healthicons $REPO

echo "Compiling outline icons..."

for FILE in $DIST/outline/*/*; do
cp $FILE $RESOURCES/o-$(echo ${FILE##*/})
done

echo "Compiling filled icons..."

for FILE in $DIST/filled/*/*; do
cp $FILE $RESOURCES/f-$(echo ${FILE##*/})
done

echo "Cleaning up"
rm -rf $TEMP

echo "All done!"
43 changes: 43 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"name": "troccoli/blade-health-icons",
"description": "A package to easily make use of Health Icons in your Laravel Blade views.",
"keywords": ["Blade", "Healthicons", "Laravel"],
"license": "MIT",
"authors": [
{
"name": "Giulio Troccoli-Allard",
"email": "[email protected]"
}
],
"require": {
"php": "^7.4|^8.0",
"blade-ui-kit/blade-icons": "^1.0",
"illuminate/support": "^8.0"
},
"require-dev": {
"phpunit/phpunit": "^9.0",
"orchestra/testbench": "^6.0"
},
"autoload": {
"psr-4": {
"Troccoli\\BladeHealthIcons\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests"
}
},
"extra": {
"laravel": {
"providers": [
"Troccoli\\BladeHealthIcons\\BladeHealthIconsServiceProvider"
]
}
},
"config": {
"sort-packages": true
},
"minimum-stability": "dev",
"prefer-stable": true
}
57 changes: 57 additions & 0 deletions config/blade-health-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' => 'health-icons',

/*
|-----------------------------------------------------------------
| 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,
],

];
17 changes: 17 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?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 Health Icons Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">src/</directory>
</whitelist>
</filter>
</phpunit>
4 changes: 4 additions & 0 deletions resources/svg/f-2g.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions resources/svg/f-3g.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions resources/svg/f-4x4.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 6c1637e

Please sign in to comment.