From 3987190330d7cad51d4992ea436a63e4e73a9ef1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Kry=C5=A1p=C3=ADn?= Date: Wed, 14 Sep 2022 13:35:13 +0200 Subject: [PATCH] Feat(web-twig): Remove Icon class from the Icon component --- .../web-twig/src/Resources/components/Icon/Icon.twig | 8 +------- .../web-twig/src/Resources/components/Icon/README.md | 5 +---- ...tTest__test with data set alertDefault.twig__1.html | 10 +++++----- ..._test with data set breadcrumbsDefault.twig__1.html | 10 +++++----- ...hotTest__test with data set headerFull.twig__1.html | 4 ++-- ...otTest__test with data set iconDefault.twig__1.html | 6 +++--- ...tTest__test with data set modalDefault.twig__1.html | 4 ++-- ..._test with data set tooltipDefaultPure.twig__1.html | 2 +- 8 files changed, 20 insertions(+), 29 deletions(-) diff --git a/packages/web-twig/src/Resources/components/Icon/Icon.twig b/packages/web-twig/src/Resources/components/Icon/Icon.twig index 19e50b2fd3..8c24a2e796 100644 --- a/packages/web-twig/src/Resources/components/Icon/Icon.twig +++ b/packages/web-twig/src/Resources/components/Icon/Icon.twig @@ -4,10 +4,4 @@ {%- set _size = props.size | default('24') -%} {%- set _title = props.title | default(null) -%} -{# Class names #} -{%- set _rootClassName = _spiritClassPrefix ~ 'Icon' -%} - -{# Miscellaneous #} -{%- set _classNames = [ _rootClassName, _class ] -%} - -{{ inlineSvg('@icons-assets/' ~ _name ~ '.svg', { class: _classNames|join(' '), size: _size, title: _title, mainProps: props }) }} +{{ inlineSvg('@icons-assets/' ~ _name ~ '.svg', { class: _class, size: _size, title: _title, mainProps: props }) }} diff --git a/packages/web-twig/src/Resources/components/Icon/README.md b/packages/web-twig/src/Resources/components/Icon/README.md index 319a36093e..16baacd30a 100644 --- a/packages/web-twig/src/Resources/components/Icon/README.md +++ b/packages/web-twig/src/Resources/components/Icon/README.md @@ -1,7 +1,5 @@ # Icon -This is Twig implementation of the [Icon] component. - Icon component uses inlineSVG extension, so don't forget to add icons path in the configuration as seen in [inlineSVG docs]. @@ -34,8 +32,7 @@ Without lexer: | `size` | `number` | `24` | no | Size of the icon | | `title` | `string` | `null` | no | Optional title to display on hover | -Get list of `name` options in the [Icon package] or your source of icons. +Get the list of `name` options in the [Icon package] or your source of icons. -[icon]: https://github.com/lmc-eu/spirit-design-system/tree/main/packages/web/src/components/Icon [inlinesvg docs]: https://github.com/lmc-eu/spirit-design-system/tree/main/packages/web-twig/docs/inlineSVG.md [icon package]: https://github.com/lmc-eu/spirit-design-system/tree/main/packages/icons diff --git a/packages/web-twig/tests/__snapshots__/ComponentsSnapshotTest__test with data set alertDefault.twig__1.html b/packages/web-twig/tests/__snapshots__/ComponentsSnapshotTest__test with data set alertDefault.twig__1.html index 31627b3495..6523979a09 100644 --- a/packages/web-twig/tests/__snapshots__/ComponentsSnapshotTest__test with data set alertDefault.twig__1.html +++ b/packages/web-twig/tests/__snapshots__/ComponentsSnapshotTest__test with data set alertDefault.twig__1.html @@ -1,6 +1,6 @@