Skip to content

Commit 0c77a37

Browse files
committed
[Site] Document Toolkit recipes props and blocks
1 parent c7b803c commit 0c77a37

File tree

67 files changed

+262
-95
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+262
-95
lines changed

src/Toolkit/kits/shadcn/alert-dialog/templates/components/AlertDialog/Action.html.twig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{# @prop variant 'default'|'secondary'|'destructive'|'outline'|'ghost'|'link' The variant, default to "default" #}
12
{# @block content The default block #}
23
{%- props variant = 'default' -%}
34
<twig:Button variant="{{ variant }}" {{ ...attributes }}>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{# @prop variant 'default'|'desctructive' The variant, default to "default" #}
1+
{# @prop variant 'default'|'desctructive' The variant, default to `default` #}
22
{# @block content The default block #}
33
{%- props variant = 'default' -%}
44
{%- set style = html_cva(
Lines changed: 15 additions & 12 deletions

src/Toolkit/kits/shadcn/aspect-ratio/templates/components/AspectRatio.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{# @prop ratio string The ratio to use, example "1 / 1", "16 / 9", ... #}
1+
{# @prop ratio string The ratio to use, example `3 / 4`, `16 / 9` #}
22
{# @prop style string Additional CSS styles to apply #}
33
{# @block content The default block #}
44
{%- props ratio, style = '' -%}

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
{%- props variant = 'default', outline = false -%}
1+
{# @prop variant 'default'|'secondary'|'destructive'|'outline' The variant, default to "default" #}
2+
{# @block content The default block #}
3+
{%- props variant = 'default' -%}
24
{%- set style = html_cva(
35
base: 'inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2',
46
variants: {
@@ -11,7 +13,7 @@
1113
},
1214
) -%}
1315
<div
14-
class="{{ style.apply({variant: variant, outline: outline}, attributes.render('class'))|tailwind_merge }}"
16+
class="{{ style.apply({variant: variant}, attributes.render('class'))|tailwind_merge }}"
1517
{{ attributes }}
1618
>
1719
{%- block content %}{% endblock -%}

src/Toolkit/kits/shadcn/breadcrumb/EXAMPLES.md

Lines changed: 1 addition & 1 deletion
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{# @block content The default block #}
12
<nav{{ attributes }} aria-label="Breadcrumb">
23
{%- block content %}{% endblock -%}
34
</nav>
Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
<span
2-
class="{{ 'flex h-9 w-9 items-center justify-center ' ~ attributes.render('class')|tailwind_merge }}"
2+
class="{{ '[&>svg]:w-3.5 [&>svg]:h-3.5 ' ~ attributes.render('class')|tailwind_merge }}"
33
{{ attributes }}
44
role="presentation"
55
aria-hidden="true"
66
>
7-
{% set _block = block('content') %}
8-
{% if content is defined and content is not empty %}
9-
{%- block content %}{% endblock -%}
10-
{% else %}
11-
<span class="h-4 w-4">...</span>
12-
{% endif %}
7+
<twig:ux:icon name="lucide:ellipsis" />
138
</span>

src/Toolkit/kits/shadcn/breadcrumb/templates/components/Breadcrumb/Item.html.twig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{# @block content The default block #}
12
<li
23
class="{{ 'inline-flex items-center gap-1.5 ' ~ attributes.render('class')|tailwind_merge }}"
34
{{ attributes }}

src/Toolkit/kits/shadcn/breadcrumb/templates/components/Breadcrumb/Link.html.twig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{# @block content The default block #}
12
<a
23
class="{{ 'transition-colors hover:text-foreground ' ~ attributes.render('class')|tailwind_merge }}"
34
{{ attributes }}

0 commit comments

Comments
 (0)