diff --git a/assets/icons/symfony.svg b/assets/icons/symfony.svg new file mode 100644 index 0000000..93fb329 --- /dev/null +++ b/assets/icons/symfony.svg @@ -0,0 +1 @@ + diff --git a/composer.json b/composer.json index be84af6..b1cfd73 100644 --- a/composer.json +++ b/composer.json @@ -21,6 +21,7 @@ "symfony/stopwatch": "^6.4", "symfony/translation": "^6.4", "symfony/twig-bundle": "^6.4", + "symfony/ux-icons": "^2.32", "symfony/validator": "^6.4", "symfony/webpack-encore-bundle": "^2.0", "symfony/yaml": "^6.4" diff --git a/composer.lock b/composer.lock index 5a4710a..ef40fc4 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "25e43ffe5281a1b623d5bd8db124295c", + "content-hash": "078e80c29672ef13b3a54ab64d94e552", "packages": [ { "name": "erusev/parsedown", @@ -4342,6 +4342,99 @@ ], "time": "2025-07-10T08:14:14+00:00" }, + { + "name": "symfony/ux-icons", + "version": "v2.32.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/ux-icons.git", + "reference": "9a2880978572f6bd9b2573b426eb0b15483d4533" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/ux-icons/zipball/9a2880978572f6bd9b2573b426eb0b15483d4533", + "reference": "9a2880978572f6bd9b2573b426eb0b15483d4533", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "symfony/framework-bundle": "^6.4|^7.0|^8.0", + "symfony/twig-bundle": "^6.4|^7.0|^8.0" + }, + "conflict": { + "symfony/flex": "<1.13", + "symfony/ux-twig-component": "<2.21" + }, + "require-dev": { + "psr/log": "^2|^3", + "symfony/asset-mapper": "^6.4|^7.0|^8.0", + "symfony/console": "^6.4|^7.0|^8.0", + "symfony/http-client": "^6.4|^7.0|^8.0", + "symfony/phpunit-bridge": "^6.3|^7.0|^8.0", + "symfony/ux-twig-component": "^2.14", + "zenstruck/console-test": "^1.5" + }, + "type": "symfony-bundle", + "extra": { + "thanks": { + "url": "https://github.com/symfony/ux", + "name": "symfony/ux" + } + }, + "autoload": { + "psr-4": { + "Symfony\\UX\\Icons\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kevin Bond", + "email": "kevinbond@gmail.com" + }, + { + "name": "Simon André", + "email": "smn.andre@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Renders local and remote SVG icons in your Twig templates.", + "homepage": "https://symfony.com", + "keywords": [ + "icons", + "svg", + "symfony-ux", + "twig" + ], + "support": { + "source": "https://github.com/symfony/ux-icons/tree/v2.32.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2025-12-02T07:12:06+00:00" + }, { "name": "symfony/validator", "version": "v6.4.30", diff --git a/config/bundles.php b/config/bundles.php index 28236e5..5f1321f 100644 --- a/config/bundles.php +++ b/config/bundles.php @@ -8,4 +8,5 @@ KevinPapst\TablerBundle\TablerBundle::class => ['all' => true], Symfony\WebpackEncoreBundle\WebpackEncoreBundle::class => ['all' => true], Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true], + Symfony\UX\Icons\UXIconsBundle::class => ['all' => true], ]; diff --git a/config/packages/ux_icons.yaml b/config/packages/ux_icons.yaml new file mode 100644 index 0000000..12d3910 --- /dev/null +++ b/config/packages/ux_icons.yaml @@ -0,0 +1,22 @@ +# Full configuration reference: https://symfony.com/bundles/ux-icons/current/index.html#configuration +ux_icons: + aliases: + about: 'fa7-solid:info-circle' + + # Default HTML attributes to add to all icons + default_icon_attributes: + + # Use current text color to fill the icon + fill: currentColor + + # Default dimensions + height: '1em' + width: '1em' + + # Throw an exception if an icon is not + ignore_not_found: false + +when@prod: + ux_icons: + # Suppress exceptions for missing icons in production + ignore_not_found: true diff --git a/src/Controller/AddonsController.php b/src/Controller/AddonsController.php new file mode 100644 index 0000000..c1456c1 --- /dev/null +++ b/src/Controller/AddonsController.php @@ -0,0 +1,24 @@ +render('addons/icons.html.twig'); + } +} diff --git a/src/EventSubscriber/MenuBuilderSubscriber.php b/src/EventSubscriber/MenuBuilderSubscriber.php index ef74d72..06a5bb7 100644 --- a/src/EventSubscriber/MenuBuilderSubscriber.php +++ b/src/EventSubscriber/MenuBuilderSubscriber.php @@ -32,7 +32,7 @@ public static function getSubscribedEvents(): array public function onSetupNavbar(MenuEvent $event): void { $event->addItem( - new MenuItemModel('homepage', 'homepage', 'homepage', [], 'fas fa-tachometer-alt') + new MenuItemModel('homepage', 'homepage', 'homepage', [], 'tabler:home') ); $forms = new MenuItemModel('forms', 'Forms', null, [], 'fab fa-wpforms'); @@ -106,6 +106,12 @@ public function onSetupNavbar(MenuEvent $event): void $docu->setBadgeColor('blue'); $event->addItem($docu); + $addons = new MenuItemModel('addons', 'Addons'); + $addons->addChild( + new MenuItemModel('icons', 'Icons', 'icons') + ); + $event->addItem($addons); + if (!$this->security->isGranted('IS_AUTHENTICATED')) { $event->addItem( new MenuItemModel('login', 'login', 'security_login', [], 'fas fa-sign-in-alt') diff --git a/symfony.lock b/symfony.lock index 3843f00..d25cf58 100644 --- a/symfony.lock +++ b/symfony.lock @@ -224,6 +224,19 @@ "ref": "f75ac166398e107796ca94cc57fa1edaa06ec47f" } }, + "symfony/ux-icons": { + "version": "2.32", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "2.19", + "ref": "c965ca0bf8a40e03420d57e08cff0bf6045e4ae7" + }, + "files": [ + "assets/icons/symfony.svg", + "config/packages/ux_icons.yaml" + ] + }, "symfony/validator": { "version": "5.4", "recipe": { diff --git a/templates/addons/icons.html.twig b/templates/addons/icons.html.twig new file mode 100644 index 0000000..7ee0a02 --- /dev/null +++ b/templates/addons/icons.html.twig @@ -0,0 +1,53 @@ +{% extends 'layout.html.twig' %} + +{% block page_content %} + {% embed '@Tabler/embeds/card.html.twig' with {fullsize : false} %} + {% block box_title %}Interface icons{% endblock %} + {% block box_body %} +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeAliasUx icon fullNameFontawesome nameFontawesome fullName
Valuesaboutfa7-solid:info-circlefa-info-circlefas fa-info-circle
Ux icon{{ ux_icon('about') }}{{ ux_icon('fa7-solid:info-circle') }}
NEW tabler_icon{{ tabler_icon('about', true) }}{{ tabler_icon('fa7-solid:info-circle', true) }}{{ tabler_icon('fa-info-circle', true) }}{{ tabler_icon('fas fa-info-circle', true) }}
Manual{{ ux_icon('tabler:forms') }}{{ tabler_icon('forms') }}{{ tabler_icon('tabler:forms') }}{{ tabler_icon('tabler:forms', true) }}
+
+ {% endblock %} + {% endembed %} +{% endblock %}