Skip to content

Commit f204999

Browse files
committed
[Toolkit] Remove redundant code in Shadcn kit components
1 parent 06b78be commit f204999

39 files changed

+39
-39
lines changed

src/Toolkit/kits/shadcn/templates/components/Alert.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<div
1313
class="{{ style.apply({variant}, attributes.render('class'))|tailwind_merge }}"
1414
role="alert"
15-
{{ attributes.defaults({role: 'alert'}).without('class') }}
15+
{{ attributes }}
1616
>
1717
{%- block content %}{% endblock -%}
1818
</div>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<p
22
class="{{ 'text-sm [&_p]:leading-relaxed ' ~ attributes.render('class')|tailwind_merge }}"
3-
{{ attributes.defaults({}).without('class') }}
3+
{{ attributes }}
44
>
55
{%- block content %}{% endblock -%}
66
</p>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<h5
22
class="{{ 'mb-1 font-medium leading-none tracking-tight ' ~ attributes.render('class')|tailwind_merge }}"
3-
{{ attributes.defaults({}).without('class') }}
3+
{{ attributes }}
44
>
55
{%- block content %}{% endblock -%}
66
</h5>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{%- props ratio, style = '' -%}
22
<div
33
style="aspect-ratio: {{ ratio }}; {{ style }}"
4-
{{ attributes.defaults({}).without('style') }}
4+
{{ attributes.without('style') }}
55
>
66
{%- block content %}{% endblock -%}
77
</div>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<span
22
class="{{ 'relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full ' ~ attributes.render('class')|tailwind_merge }}"
3-
{{ attributes.defaults({}).without('class') }}
3+
{{ attributes }}
44
>
55
{%- block content %}{% endblock -%}
66
</span>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<img
22
class="{{ 'aspect-square h-full w-full ' ~ attributes.render('class')|tailwind_merge }}"
3-
{{ attributes.defaults({alt: ''}).without('class') }}
3+
{{ attributes.defaults({alt: ''}) }}
44
/>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<span
22
class="{{ 'flex h-full w-full items-center justify-center rounded-full bg-muted ' ~ attributes.render('class')|tailwind_merge }}"
3-
{{ attributes.defaults({}).without('class') }}
3+
{{ attributes }}
44
>
55
{%- block content %}{% endblock -%}
66
</span>

src/Toolkit/kits/shadcn/templates/components/Badge.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
) -%}
1313
<div
1414
class="{{ style.apply({variant, outline}, attributes.render('class'))|tailwind_merge }}"
15-
{{ attributes.defaults({}).without('class') }}
15+
{{ attributes }}
1616
>
1717
{%- block content %}{% endblock -%}
1818
</div>

src/Toolkit/kits/shadcn/templates/components/Breadcrumb/Ellipsis.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<span
22
class="{{ 'flex h-9 w-9 items-center justify-center ' ~ attributes.render('class')|tailwind_merge }}"
3-
{{ attributes.defaults({}).without('class') }}
3+
{{ attributes }}
44
role="presentation"
55
aria-hidden="true"
66
>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<li
22
class="{{ 'inline-flex items-center gap-1.5 ' ~ attributes.render('class')|tailwind_merge }}"
3-
{{ attributes.defaults({}).without('class') }}
3+
{{ attributes }}
44
>
55
{%- block content %}{% endblock -%}
66
</li>

0 commit comments

Comments
 (0)