File tree Expand file tree Collapse file tree 8 files changed +38
-56
lines changed Expand file tree Collapse file tree 8 files changed +38
-56
lines changed Original file line number Diff line number Diff line change @@ -69,10 +69,7 @@ So to use an icon from Patternlab you can simply follow the official
6969documentation: https://patternlab.muenchen.space/?p=viewall-guidelines-icons
7070
7171``` html
72-
73- <svg aria-hidden =" true" class =" icon" >
74- <use xlink:href =" #icon-{name}" ></use >
75- </svg >
72+ <muc-icon :icon =" name" />
7673```
7774
7875## Contributing
Original file line number Diff line number Diff line change 11<script setup lang="ts">
22import { computed } from " vue" ;
33
4+ import { MucIcon } from " ../Icon" ;
5+
46type bannerType = " info" | " success" | " warning" | " emergency" ;
57
68const props = withDefaults (
@@ -70,13 +72,13 @@ const typeAriaLabel = computed(() => {
7072const typeIcon = computed (() => {
7173 switch (props .type ) {
7274 case " success" :
73- return " #icon- check" ;
75+ return " check" ;
7476 case " warning" :
7577 case " emergency" :
76- return " #icon- warning" ;
78+ return " warning" ;
7779 case " info" :
7880 default :
79- return " #icon- information" ;
81+ return " information" ;
8082 }
8183});
8284 </script >
@@ -91,9 +93,7 @@ const typeIcon = computed(() => {
9193 :aria-label =" typeAriaLabel"
9294 >
9395 <div class =" container-fluid" >
94- <svg class =" icon" >
95- <use :href =" typeIcon" />
96- </svg >
96+ <muc-icon :icon =" typeIcon" />
9797 <slot />
9898 </div >
9999 </div >
Original file line number Diff line number Diff line change 1212 data-bs-toggle =" collapse"
1313 :aria-expanded =" !collapsed"
1414 >
15- <svg
16- aria-hidden = " true "
15+ <muc-icon
16+ :icon = " icon "
1717 class =" icon icon--before"
18- >
19- <use :xlink:href =" '#icon-' + icon" ></use >
20- </svg >
18+ />
2119 <div v-if =" todaysBusinessHours" >
2220 <span > {{ todaysBusinessHours.weekDay }} geöffnet </span >
2321 <span
3028 </span >
3129 </span >
3230 </div >
33-
34- <svg
35- aria-hidden =" true"
31+ <muc-icon
32+ icon =" chevron-down"
3633 class =" icon icon--after"
37- >
38- <use xlink:href =" #icon-chevron-down" ></use >
39- </svg >
34+ />
4035 </button >
4136 <div
4237 class =" m-business-hours-toggle__content"
7469<script setup lang="ts">
7570import { computed , ref } from " vue" ;
7671
72+ import { MucIcon } from " ../Icon" ;
7773import { BusinessHourType } from " ./BusinessHourType" ;
7874
7975const LOCALES = " de-DE" ;
Original file line number Diff line number Diff line change 77 >
88 <span >
99 <slot />
10- <svg
10+ <muc-icon
1111 v-if =" icon"
12- aria-hidden = " true "
12+ :icon = " icon "
1313 class =" m-button__icon"
14- >
15- <use :xlink:href =" '#icon-' + icon" ></use >
16- </svg >
14+ />
1715 </span >
1816 </button >
1917</template >
2018
2119<script setup lang="ts">
2220import { computed } from " vue" ;
2321
22+ import { MucIcon } from " ../Icon" ;
23+
2424type buttonType = " primary" | " secondary" | " ghost" ;
2525
2626const props = withDefaults (
Original file line number Diff line number Diff line change 88 <div class =" m-callout__icon" >
99 <slot name =" icon" >
1010 <!-- fallback icon -->
11- <svg
12- aria-hidden =" true"
13- class =" icon"
14- >
15- <use :xlink:href =" `#icon-${fallbackCalloutIcon}`" ></use >
16- </svg >
11+ <muc-icon :icon =" fallbackCalloutIcon" />
1712 </slot >
1813 </div >
1914 <div class =" m-callout__body" >
3833<script setup lang="ts">
3934import { computed } from " vue" ;
4035
36+ import { MucIcon } from " ../Icon" ;
37+
4138type calloutType = " info" | " warning" | " success" | " error" ;
4239
4340const props = withDefaults (
Original file line number Diff line number Diff line change 1212 <slot name =" author" />
1313 </span >
1414 <span v-if =" showDate" >
15- <span class =" m-comment__author"
16- >   ; <slot name =" datePrefix"
17- /> </span >
15+ <span class =" m-comment__author" >
16+   ; <slot name =" datePrefix" />
17+ </span >
1818 <span class =" m-comment__date" >  ; <slot name =" date" /> </span >
1919 </span >
2020 <div
2727 :key =" n"
2828 class =" m-star-rating__item m-star-rating__item--full"
2929 >
30- <svg
31- aria-hidden =" true"
32- class =" icon"
33- >
34- <use xlink:href =" #icon-solid-star" ></use >
35- </svg >
30+ <muc-icon icon =" solid-star" />
3631 </div >
3732 <div
3833 v-if =" evaluateRating.isHalfStar"
3934 class =" m-star-rating__item m-star-rating__item--half"
4035 >
41- <svg
42- aria-hidden =" true"
43- class =" icon"
44- >
45- <use xlink:href =" #icon-half-star" ></use >
46- </svg >
36+ <muc-icon icon =" half-star" />
4737 </div >
4838 <div
4939 v-for =" n in evaluateRating.emptyStars"
5040 :key =" n"
5141 class =" m-star-rating__item"
5242 >
53- <svg
54- aria-hidden =" true"
55- class =" icon"
56- >
57- <use xlink:href =" #icon-solid-star" ></use >
58- </svg >
43+ <muc-icon icon =" solid-star" />
5944 </div >
6045 <div class =" m-star-rating__numeric" >
6146 {{ ratingWithDecimalComma }}
7661<script setup lang="ts">
7762import { computed , useSlots } from " vue" ;
7863
64+ import { MucIcon } from " ../Icon" ;
7965import CommentType from " ./CommentType" ;
8066
8167const LOCALES = " de-DE" ;
Original file line number Diff line number Diff line change 11<template >
22 <svg
33 aria-hidden =" true"
4- class =" m-button__icon "
4+ : class =" iconClass "
55 :style =" { color: color }"
66 >
77 <use :href =" '#icon-' + icon" />
88 </svg >
99</template >
1010
1111<script setup lang="ts">
12+ import { computed , useAttrs } from " vue" ;
13+
14+ const attr = useAttrs ();
15+
1216defineProps <{
1317 /**
1418 * String of the icon to be displayed.
@@ -20,4 +24,6 @@ defineProps<{
2024 */
2125 color? : string ;
2226}>();
27+
28+ const iconClass = computed (() => attr .class ?? " icon" );
2329 </script >
Original file line number Diff line number Diff line change @@ -44,11 +44,11 @@ defineSlots<{
4444 <div
4545 v-if =" divider"
4646 class =" muc-divider"
47- ></ div >
47+ / >
4848
4949 <div class =" m-intro-vertical__content" >
5050 <p style =" padding-bottom : 32px " >
51- <slot ></ slot >
51+ <slot / >
5252 </p >
5353 </div >
5454 </div >
You can’t perform that action at this time.
0 commit comments