Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions .twig-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@

$finder = new TwigCsFixer\File\Finder();

// Some directories may not exist when running Fabbot action, if no files under them were changed.
$finder->in(array_filter([__DIR__.'/src', __DIR__.'/apps'], is_dir(...)));
$finder->notPath('#/Fixtures/#');
$finder->notPath('#/assets/#');
$finder->notPath('#/var/#');
// apps/
$finder->notPath(['#config/#', '#public/#', 'importmap.php'])

$config = new TwigCsFixer\Config\Config();
$config->setCacheFile('.twig-cs-fixer.cache');
$config->setRuleset($ruleset);
$config->setFinder($finder);
$config->setFinder(
(new TwigCsFixer\File\Finder)
->in(__DIR__)
->notPath('#/Fixtures/#')
->notPath('#/assets/#')
->notPath('#/var/#')
// apps/
->notPath(['#config/#', '#public/#', 'importmap.php'])
);

return $config;
4 changes: 2 additions & 2 deletions ux.symfony.com/templates/components/Button.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@
variant: ['destructive'],
outline: ['true'],
class: 'border-destructive',
}]
}],
) -%}

<button
class="{{ style.apply({variant, outline, size}, attributes.render('class'))|tailwind_merge }}"
class="{{ style.apply({variant: variant, outline: outline, size: size}, attributes.render('class'))|tailwind_merge }}"
{{ attributes.defaults({}).without('class') }}
>
{% block content %}{% endblock %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div {{ attributes.defaults({
class: 'row mb-5 py-4 position-relative ' ~ (this.sticky|default ? 'align-items-start' : 'align-items-center'),
style: '--bs-gutter-x: 4rem'
style: '--bs-gutter-x: 4rem',
}) }}>
<div class="col-12 col-md-{{ 12 - this.codeCols }} code-description {{ not reversed ? 'order-md-2' }}"
style="{% if reversed %}padding-inline-end: 0;{% endif %} {{ this.sticky|default ? 'position: sticky; top: 4rem;' }}">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div {{ attributes.defaults({
class: 'position-relative'
class: 'position-relative',
}) }}>
<div class="Terminal">
<div class="Terminal_header pb-0">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div {{ attributes.defaults({
class: 'homepage-terminal-swapper'
class: 'homepage-terminal-swapper',
}) }}>
{% component Terminal with {height: '180px', bottomPadding: 0, processContents: false} %}
{% block content -%}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
{% for _tab, _label in {
icon: 'Icon',
svg: 'SVG code',
meta: 'Metadata'
meta: 'Metadata',
} %}
<button
class="TabControl"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<div class="PackageList pt-3" data-loading="addClass(opacity-50)">
{% for package in computed.packages %}
{{ include('components/Package/PackageListItem.html.twig', {package}) }}
{{ include('components/Package/PackageListItem.html.twig', {package: package}) }}
{% else %}
No packages found "{{ query }}"
{% endfor %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
novalidate: true,
'data-action': 'live#action:prevent',
'data-live-action-param': 'saveRegistration',
}
},
}) }}
{{ form_row(form.email) }}
{{ form_row(form.password) }}
Expand Down
8 changes: 4 additions & 4 deletions ux.symfony.com/templates/components/TodoListForm.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
{{ form_row(form.name, {
label: false,
attr: {
placeholder: 'Give your list a name'
}
placeholder: 'Give your list a name',
},
}) }}
</div>
</div>
Expand All @@ -28,8 +28,8 @@
label: false,
row_attr: {class: 'mb-1'},
attr: {
placeholder: 'Walk the pygmy hippo'
}
placeholder: 'Walk the pygmy hippo',
},
}) }}
</td>
<td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

<div id="live-memory-score" class="LiveMemory-Score {{ game.isEnded ? 'on' : 'hidden' }}">
{% if game.isEnded %}
{{ include('demos/live_memory/components/LiveMemory/Score.html.twig', {game}) }}
{{ include('demos/live_memory/components/LiveMemory/Score.html.twig', {game: game}) }}
{% endif %}
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div {{ attributes.defaults({
class: 'LiveMemory-Timer' ~ (this.blinking ? ' LiveMemory-Timer--blinking' : '')
class: 'LiveMemory-Timer' ~ (this.blinking ? ' LiveMemory-Timer--blinking' : ''),
}) }}
{% if this.remainingTime > (this.warningThreshold * 1000) %}
data-poll="delay({{ this.remainingTime - (this.warningThreshold * 1000) }})|tick"
Expand Down
2 changes: 1 addition & 1 deletion ux.symfony.com/templates/icons/index.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
height: 675,
alt: package.humanName ~ ' - Component Icon',
},
}
},
} %}

{% block content %}
Expand Down
12 changes: 6 additions & 6 deletions ux.symfony.com/templates/toolkit/component.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@
{% set title = 'Component ' ~ component.manifest.name ~ ' - ' ~ kit.manifest.name ~ ' Kit' %}
{% set description = "Documentation of component #{component.manifest.name}, from the UX Toolkit #{kit.manifest.name}, #{kit.manifest.description}." %}
{% set meta = {
title,
description,
title: title,
description: description,
canonical: url('app_icons'),
social: {
title,
description,
title: title,
description: description,
image: {
url: absolute_url(asset(package.getSocialImage('1200x675'))),
type: 'image/png',
width: 1200,
height: 675,
alt: package.humanName ~ ' - Kit ' ~ kit.manifest.name,
},
}
},
} %}

{% block content %}
Expand All @@ -29,7 +29,7 @@
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="{{ path('app_toolkit') }}">UX Toolkit</a></li>
<li class="breadcrumb-item"><a href="{{ path('app_toolkit', {'_fragment': 'kits'}) }}">Kits</a></li>
<li class="breadcrumb-item"><a href="{{ path('app_toolkit', {_fragment: 'kits'}) }}">Kits</a></li>
<li class="breadcrumb-item"><a href="{{ path('app_toolkit_kit', {kitId: kit_id.value}) }}">{{ kit.manifest.name }}</a></li>
<li class="breadcrumb-item active" aria-current="page">{{ component.manifest.name }}</li>
</ol>
Expand Down
4 changes: 2 additions & 2 deletions ux.symfony.com/templates/toolkit/kit.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
height: 675,
alt: package.humanName ~ ' - Kit ' ~ kit.manifest.name,
},
}
},
} %}

{% block content %}
Expand All @@ -27,7 +27,7 @@
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="{{ path('app_toolkit') }}">UX Toolkit</a></li>
<li class="breadcrumb-item"><a href="{{ path('app_toolkit', {'_fragment': 'kits'}) }}">Kits</a></li>
<li class="breadcrumb-item"><a href="{{ path('app_toolkit', {_fragment: 'kits'}) }}">Kits</a></li>
<li class="breadcrumb-item active" aria-current="page">{{ kit.manifest.name }}</li>
</ol>
</nav>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% block package_header %}
{% component PackageHeader with {
package: 'autocomplete',
eyebrowText: 'Smart Form Controls'
eyebrowText: 'Smart Form Controls',
} %}
{% block title_header %}
Ajax-Powered Autocomplete
Expand Down
2 changes: 1 addition & 1 deletion ux.symfony.com/templates/ux_packages/chartjs.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% block package_header %}
{% component PackageHeader with {
package: 'chartjs',
eyebrowText: 'Charts from PHP'
eyebrowText: 'Charts from PHP',
} %}
{% block title_header %}
Render beautiful graphs with <em>chart.js</em>
Expand Down
2 changes: 1 addition & 1 deletion ux.symfony.com/templates/ux_packages/cropperjs.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% block package_header %}
{% component PackageHeader with {
package: 'cropperjs',
eyebrowText: 'Craft the perfect image'
eyebrowText: 'Craft the perfect image',
} %}
{% block title_header %}
Crop Photos with <em>Cropper.js</em>
Expand Down
2 changes: 1 addition & 1 deletion ux.symfony.com/templates/ux_packages/dropzone.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% block package_header %}
{% component PackageHeader with {
package: 'dropzone',
eyebrowText: 'Styled Upload Zone'
eyebrowText: 'Styled Upload Zone',
} %}
{% block title_header %}
Native Upload Dropzone <em>with style</em>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% block package_header %}
{% component PackageHeader with {
package: 'live-component',
eyebrowText: 'Reactive Twig Templates'
eyebrowText: 'Reactive Twig Templates',
} %}
{% block title_header %}
An Interactive UI <br><em>in</em> PHP <em>&</em> Twig
Expand Down
2 changes: 1 addition & 1 deletion ux.symfony.com/templates/ux_packages/notify.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% block package_header %}
{% component PackageHeader with {
package: 'notify',
eyebrowText: 'Native Browser Notifications'
eyebrowText: 'Native Browser Notifications',
} %}
{% block title_header %}
Notify users from <em>inside PHP</em>
Expand Down
6 changes: 3 additions & 3 deletions ux.symfony.com/templates/ux_packages/package.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
height: 675,
alt: package.humanName ~ ' - Component Icon',
},
}
},
} %}

{% block header %}
{{ include('_header.html.twig', {
theme: 'white'
theme: 'white',
}) }}
{% endblock %}

Expand Down Expand Up @@ -67,7 +67,7 @@

{% block package_links %}
{{ include('ux_packages/_package_links.html.twig', {
package: package
package: package,
}) }}
{% endblock %}

Expand Down
2 changes: 1 addition & 1 deletion ux.symfony.com/templates/ux_packages/react.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{% block package_header %}
{% component PackageHeader with {
package: 'react',
eyebrowText: 'React Component Rendering'
eyebrowText: 'React Component Rendering',
} %}
{% block title_header %}
Render React from <em>inside Twig</em>
Expand Down
2 changes: 1 addition & 1 deletion ux.symfony.com/templates/ux_packages/svelte.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{% block package_header %}
{% component PackageHeader with {
package: 'svelte',
eyebrowText: 'Svelte Component Rendering'
eyebrowText: 'Svelte Component Rendering',
} %}
{% block title_header %}
Render Svelte from <em>inside Twig</em>
Expand Down
4 changes: 2 additions & 2 deletions ux.symfony.com/templates/ux_packages/swup.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% block package_header %}
{% component PackageHeader with {
package: 'swup',
eyebrowText: 'Slick Page Transitions'
eyebrowText: 'Slick Page Transitions',
} %}
{% block title_header %}
Ajax Page Transitions with <em>Swup</em>
Expand Down Expand Up @@ -34,7 +34,7 @@

<div class="PackageList">
{% for package in results %}
{{ include('components/Package/PackageListItem.html.twig', {package}) }}
{{ include('components/Package/PackageListItem.html.twig', {package: package}) }}
{% endfor %}
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% block package_header %}
{% component PackageHeader with {
package: 'toggle-password',
eyebrowText: 'Switch between password & text'
eyebrowText: 'Switch between password & text',
} %}
{% block title_header %}
From password to text <em>&amp; vice versa</em>
Expand Down
14 changes: 7 additions & 7 deletions ux.symfony.com/templates/ux_packages/translator.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% block package_header %}
{% component PackageHeader with {
package: 'translator',
eyebrowText: 'JavaScript-enabled Translation'
eyebrowText: 'JavaScript-enabled Translation',
} %}
{% block title_header %}
Translations directly imported in <em>JavaScript</em>
Expand Down Expand Up @@ -35,7 +35,7 @@
{% embed 'ux_packages/translator/_translator_demo_block.html.twig' with {
message: 'say_hello',
parameters: {
name: 'Fabien'
name: 'Fabien',
},
} %}
{% block parameters %}
Expand Down Expand Up @@ -86,7 +86,7 @@
{% embed 'ux_packages/translator/_translator_demo_block.html.twig' with {
message: 'num_of_apples',
parameters: {
apples: 2
apples: 2,
},
} %}
{% block parameters %}
Expand All @@ -104,7 +104,7 @@
{% embed 'ux_packages/translator/_translator_demo_block.html.twig' with {
message: 'finish_place',
parameters: {
place: 2
place: 2,
},
} %}
{% block parameters %}
Expand All @@ -122,7 +122,7 @@
{% embed 'ux_packages/translator/_translator_demo_block.html.twig' with {
message: 'published_at',
parameters: {
publication_date: '2023-04-27 08:12'
publication_date: '2023-04-27 08:12',
},
} %}
{% block parameters %}
Expand All @@ -140,7 +140,7 @@
{% embed 'ux_packages/translator/_translator_demo_block.html.twig' with {
message: 'progress',
parameters: {
progress: 42
progress: 42,
},
} %}
{% block parameters %}
Expand All @@ -158,7 +158,7 @@
{% embed 'ux_packages/translator/_translator_demo_block.html.twig' with {
message: 'value_of_object',
parameters: {
price: 30
price: 30,
},
} %}
{% block parameters %}
Expand Down
2 changes: 1 addition & 1 deletion ux.symfony.com/templates/ux_packages/turbo.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% block package_header %}
{% component PackageHeader with {
package: 'turbo',
eyebrowText: 'Speed of an SPA'
eyebrowText: 'Speed of an SPA',
} %}
{% block title_header %}
Turbo your <em>website</em>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
placeholder: 'Go on a run... to the donut shop',
autofocus: true,
},
label: 'What should we do?'
label: 'What should we do?',
}) }}

<button type="submit" class="btn btn-dark mt-4" style="width: 100%;">Create!</button>
Expand Down
Loading
Loading