From 5d18e8031743b4cc8e5005e662c52151ac22fd25 Mon Sep 17 00:00:00 2001 From: Hugo Alliaume Date: Wed, 24 Sep 2025 15:43:49 +0200 Subject: [PATCH] [Toolkit] Delay/hide the "Community Kits" feature, minor fixes --- src/Toolkit/README.md | 2 +- src/Toolkit/doc/index.rst | 172 ------------------ .../kits/shadcn/AlertDialog/manifest.json | 2 +- .../kits/shadcn/AspectRatio/manifest.json | 2 +- src/Toolkit/kits/shadcn/INSTALL.md | 2 - src/Toolkit/src/Command/InstallCommand.php | 13 +- .../tests/Command/InstallCommandTest.php | 2 +- .../Functional/ComponentsRenderingTest.php | 24 ++- ...n, component Alert Dialog, code 1__1.html} | 2 +- ...n, component Alert Dialog, code 2__1.html} | 2 +- ...it shadcn, component Alert, code 3__1.html | 20 -- ...n, component Aspect Ratio, code 1__1.html} | 2 +- ...n, component Aspect Ratio, code 2__1.html} | 2 +- ...n, component Aspect Ratio, code 3__1.html} | 2 +- ...t shadcn, component Avatar, code 4__1.html | 27 --- ...it shadcn, component Badge, code 6__1.html | 15 -- ...adcn, component Breadcrumb, code 3__1.html | 56 ------ ... shadcn, component Button, code 11__1.html | 12 -- ...Kit shadcn, component Card, code 3__1.html | 85 --------- ...shadcn, component Checkbox, code 4__1.html | 16 -- ...it shadcn, component Input, code 6__1.html | 16 -- ...it shadcn, component Label, code 4__1.html | 16 -- ...adcn, component Pagination, code 3__1.html | 82 --------- ...shadcn, component Progress, code 4__1.html | 36 ---- ...t shadcn, component Select, code 4__1.html | 16 -- ...hadcn, component Separator, code 3__1.html | 25 --- ...shadcn, component Skeleton, code 3__1.html | 24 --- ...t shadcn, component Switch, code 3__1.html | 53 ------ ...it shadcn, component Table, code 2__1.html | 105 ----------- ...shadcn, component Textarea, code 4__1.html | 9 - .../assets/styles/components/_SidebarNav.scss | 9 +- .../Toolkit/ComponentsController.php | 10 - ux.symfony.com/src/LiveMemory/GameLevels.php | 2 +- .../templates/ux_packages/toolkit.html.twig | 10 +- 34 files changed, 48 insertions(+), 825 deletions(-) delete mode 100644 src/Toolkit/doc/index.rst rename src/Toolkit/tests/Functional/__snapshots__/{ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component AlertDialog, code 1__1.html => ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Alert Dialog, code 1__1.html} (99%) rename src/Toolkit/tests/Functional/__snapshots__/{ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component AlertDialog, code 2__1.html => ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Alert Dialog, code 2__1.html} (99%) delete mode 100644 src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Alert, code 3__1.html rename src/Toolkit/tests/Functional/__snapshots__/{ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component AspectRatio, code 1__1.html => ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Aspect Ratio, code 1__1.html} (96%) rename src/Toolkit/tests/Functional/__snapshots__/{ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component AspectRatio, code 2__1.html => ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Aspect Ratio, code 2__1.html} (96%) rename src/Toolkit/tests/Functional/__snapshots__/{ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component AspectRatio, code 3__1.html => ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Aspect Ratio, code 3__1.html} (96%) delete mode 100644 src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Avatar, code 4__1.html delete mode 100644 src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Badge, code 6__1.html delete mode 100644 src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Breadcrumb, code 3__1.html delete mode 100644 src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Button, code 11__1.html delete mode 100644 src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Card, code 3__1.html delete mode 100644 src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Checkbox, code 4__1.html delete mode 100644 src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Input, code 6__1.html delete mode 100644 src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Label, code 4__1.html delete mode 100644 src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Pagination, code 3__1.html delete mode 100644 src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Progress, code 4__1.html delete mode 100644 src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Select, code 4__1.html delete mode 100644 src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Separator, code 3__1.html delete mode 100644 src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Skeleton, code 3__1.html delete mode 100644 src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Switch, code 3__1.html delete mode 100644 src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Table, code 2__1.html delete mode 100644 src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Textarea, code 4__1.html diff --git a/src/Toolkit/README.md b/src/Toolkit/README.md index bb6e5d0d96b..a913f3345c3 100644 --- a/src/Toolkit/README.md +++ b/src/Toolkit/README.md @@ -10,7 +10,7 @@ https://github.com/symfony/ux to create issues or submit pull requests. ## Resources -- [Documentation](https://symfony.com/bundles/ux-toolkit/current/index.html) +- [Documentation](https://ux.symfony.com/bundles/toolkit) - [Report issues](https://github.com/symfony/ux/issues) and [send Pull Requests](https://github.com/symfony/ux/pulls) in the [main Symfony UX repository](https://github.com/symfony/ux) diff --git a/src/Toolkit/doc/index.rst b/src/Toolkit/doc/index.rst deleted file mode 100644 index 40f8eda1ea7..00000000000 --- a/src/Toolkit/doc/index.rst +++ /dev/null @@ -1,172 +0,0 @@ -Symfony UX Toolkit -================== - -**EXPERIMENTAL** This component is currently experimental and is likely -to change, or even change drastically. - -Symfony UX Toolkit provides a set of ready-to-use kits for Symfony applications. -It is part of `the Symfony UX initiative`_. - -Kits are a nice way to begin a new Symfony application, they contains -recipes to install nicely-crafter `Twig components`_ (already stylized, -but fully customizable depending on your needs) and more. - -Please note that the **UX Toolkit is not a library of UI components**, -but **a tool to help you build your own UI components**. -It uses the same approach than the popular `Shadcn UI`_, -and a similar approach than `Tailwind Plus`_. - -After installing the UX Toolkit, you can start installing the recipes you need -from `UX Toolkit Kits`_ and use them in your project. -Files created by the recipes become part of your project, and -you can customize them as you want. - -Additionally, some `Twig components`_ use ``html_cva`` and ``tailwind_merge``, -you can either remove them from your project or install ``twig/html-extra`` -and ``tales-from-a-dev/twig-tailwind-extra`` to use them. - -Installation ------------- - -Install the UX Toolkit using Composer and Symfony Flex: - -.. code-block:: terminal - - # The UX Toolkit is a development dependency: - $ composer require --dev symfony/ux-toolkit - -Usage ------ - -You may find a list of available kits in the `UX Toolkit Kits`_ page, with the installation instructions for each of them. - -For example, if you want to install a `Button` component, you will find the following instruction: - -.. code-block:: terminal - - $ php bin/console ux:install Button --kit= - -It will create the ``templates/components/Button.html.twig`` file in your project, -and you will be able to use the `Button` component like this: - -.. code-block:: html+twig - - Click me - -Create your own Kit -------------------- - -You have the ability to create and share your own kit with the community, -by using the ``php vendor/bin/ux-toolkit-kit-create`` command in a new GitHub repository: - -.. code-block:: terminal - - # Create your new project - $ mkdir my-ux-toolkit-kit - $ cd my-ux-toolkit-kit - - # Initialize your project - $ git init - $ composer init - - # Install the UX Toolkit - $ composer require --dev symfony/ux-toolkit - - # Create your kit - $ php vendor/bin/ux-toolkit-kit-create - - # ... edit the files, add your components, examples, etc. - - # Share your kit - $ git add . - $ git commit -m "Create my-kit UX Toolkit" - $ git branch -M main - $ git remote add origin git@github.com:my-username/my-ux-toolkit-kit.git - $ git push -u origin main - -Repository and kits structure -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -After creating your kit, the repository should have the following structure: - -.. code-block:: text - - . - ├── Button - │   ├── manifest.json - │   └── templates - │   └── components - │   └── Button.html.twig - └── manifest.json - - -A kit is described by a ``manifest.json`` file at the root directory, which contains the metadata of the kit: - -.. code-block:: json - - { - "$schema": "../vendor/symfony/ux-toolkit/schema-kit-v1.json", - "name": "My UX Toolkit Kit", - "description": "A custom kit for Symfony UX Toolkit.", - "homepage": "https://github/com/User/MyUxToolkitKit", - "license": "MIT" - } - -Then, a kit can contain one or more recipes. Each recipe is a directory -with a ``manifest.json`` file and some files to be copied into the project. - -The ``manifest.json`` file of a recipe contains the metadata of the recipe: - -.. code-block:: json - - { - "$schema": "../vendor/symfony/ux-toolkit/schema-kit-recipe-v1.json", - "name": "Button", - "description": "A clickable element that triggers actions or events, supporting various styles and states.", - "copy-files": { - "templates/": "templates/" - }, - "dependencies": { - { - "type": "php", - "package": "twig/extra-bundle" - }, - { - "type": "php", - "package": "twig/html-extra:^3.12.0" - }, - { - "type": "php", - "package": "tales-from-a-dev/twig-tailwind-extra" - } - } - } - -Using your kit -~~~~~~~~~~~~~~ - -Once your kit is published on GitHub, you can use it by specifying the ``--kit`` option when installing a component: - -.. code-block:: terminal - - $ php bin/console ux:install Button --kit=github.com/my-username/my-ux-toolkit-kit - - # or for a specific version - $ php bin/console ux:install Button --kit=github.com/my-username/my-ux-toolkit-kit:1.0.0 - -Backward Compatibility promise ------------------------------- - -This bundle aims at following the same Backward Compatibility promise as -the Symfony framework: -https://symfony.com/doc/current/contributing/code/bc.html - -However, the UI components and other files provided by the Toolkit **are not** covered by the Backward Compatibility -promise. -We may break them in patch or minor release, but you won't get impacted unless you re-install the same UI component. - -.. _`the Symfony UX initiative`: https://ux.symfony.com/ -.. _`Twig components`: https://symfony.com/bundles/ux-twig-component/current/index.html -.. _`UX Toolkit Kits`: https://ux.symfony.com/toolkit#kits -.. _`Shadcn UI`: https://ui.shadcn.com/ -.. _`Tailwind Plus`: https://tailwindcss.com/plus diff --git a/src/Toolkit/kits/shadcn/AlertDialog/manifest.json b/src/Toolkit/kits/shadcn/AlertDialog/manifest.json index cd1536e0eb0..1bf3a78dfb8 100644 --- a/src/Toolkit/kits/shadcn/AlertDialog/manifest.json +++ b/src/Toolkit/kits/shadcn/AlertDialog/manifest.json @@ -1,7 +1,7 @@ { "$schema": "../../../schema-kit-recipe-v1.json", "type": "component", - "name": "AlertDialog", + "name": "Alert Dialog", "description": "A modal dialog that interrupts the user with important content and expects a response.", "copy-files": { "assets/": "assets/", diff --git a/src/Toolkit/kits/shadcn/AspectRatio/manifest.json b/src/Toolkit/kits/shadcn/AspectRatio/manifest.json index bb2526077d6..d94a4ef8cbe 100644 --- a/src/Toolkit/kits/shadcn/AspectRatio/manifest.json +++ b/src/Toolkit/kits/shadcn/AspectRatio/manifest.json @@ -1,7 +1,7 @@ { "$schema": "../../../schema-kit-recipe-v1.json", "type": "component", - "name": "AspectRatio", + "name": "Aspect Ratio", "description": "A container that maintains a specific width-to-height ratio for its content.", "copy-files": { "templates/": "templates/" diff --git a/src/Toolkit/kits/shadcn/INSTALL.md b/src/Toolkit/kits/shadcn/INSTALL.md index 8442bae9bcd..3f7969b4315 100644 --- a/src/Toolkit/kits/shadcn/INSTALL.md +++ b/src/Toolkit/kits/shadcn/INSTALL.md @@ -98,5 +98,3 @@ In your `assets/styles/app.css`, after the TailwindCSS imports, add the followin } } ``` - -And voilà! You are now ready to use Shadcn components in your Symfony project. diff --git a/src/Toolkit/src/Command/InstallCommand.php b/src/Toolkit/src/Command/InstallCommand.php index 0467532e609..a4909c6afd3 100644 --- a/src/Toolkit/src/Command/InstallCommand.php +++ b/src/Toolkit/src/Command/InstallCommand.php @@ -106,7 +106,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int } // If more than one kit is available, we ask the user which one to use if (($availableKitsCount = \count($availableKits)) > 1) { - $kitName = $io->choice(null === $recipeName ? 'Which kit do you want to use?' : \sprintf('The recipe "%s" exists in multiple kits. Which one do you want to use?', $recipeName), array_map(fn (Kit $kit) => $kit->manifest->name, $availableKits)); + $kitName = $io->choice(null === $recipeName ? 'Which Kit do you want to use?' : \sprintf('The recipe "%s" exists in multiple Kits. Which one do you want to use?', $recipeName), array_map(fn (Kit $kit) => $kit->manifest->name, $availableKits)); foreach ($availableKits as $availableKit) { if ($availableKit->manifest->name === $kitName) { @@ -117,11 +117,12 @@ protected function execute(InputInterface $input, OutputInterface $output): int } elseif (1 === $availableKitsCount) { $kit = $availableKits[0]; } else { - $io->error( - null === $recipeName - ? 'It seems that no local kits are available and it should not happens. Please open an issue on https://github.com/symfony/ux to report this.' - : \sprintf("The recipe \"%s\" does not exist in any official kits.\n\nYou can try to run one of the following commands to interactively install recipes:\n%s\n\nOr you can try one of the community kits https://github.com/search?q=topic:ux-toolkit&type=repositories", $recipeName, implode("\n", array_map(fn (string $availableKitName) => \sprintf('$ bin/console %s --kit %s', $this->getName(), $availableKitName), $availableKitNames))) - ); + if (null === $recipeName) { + $io->error('It seems that no official kits are available and it should not happens. Please open an issue on https://github.com/symfony/ux to report this.'); + } else { + $io->error(\sprintf('The recipe "%s" does not exist in any official kits.', $recipeName)); + // $io->error(\sprintf("The recipe \"%s\" does not exist in any official kits.\n\nYou can try to run one of the following commands to interactively install recipes:\n%s\n\nOr you can try one of the community kits https://github.com/search?q=topic:ux-toolkit&type=repositories", $recipeName, implode("\n", array_map(fn (string $availableKitName) => \sprintf('$ bin/console %s --kit %s', $this->getName(), $availableKitName), $availableKitNames)))); + } return Command::FAILURE; } diff --git a/src/Toolkit/tests/Command/InstallCommandTest.php b/src/Toolkit/tests/Command/InstallCommandTest.php index 5da5ee8e6bb..f2501242f67 100644 --- a/src/Toolkit/tests/Command/InstallCommandTest.php +++ b/src/Toolkit/tests/Command/InstallCommandTest.php @@ -76,7 +76,7 @@ public function testShouldFailAndSuggestAlternativeRecipesWhenKitIsExplicit() ->execute() ->assertFaulty() ->assertOutputContains('[WARNING] The recipe "A" does not exist') - ->assertOutputContains('Possible alternatives: "Alert", "AlertDialog", "AspectRatio"') + ->assertOutputContains('Possible alternatives: "Alert", "Alert Dialog", "Aspect Ratio"') ; } diff --git a/src/Toolkit/tests/Functional/ComponentsRenderingTest.php b/src/Toolkit/tests/Functional/ComponentsRenderingTest.php index 914fe5e1921..636c07346ec 100644 --- a/src/Toolkit/tests/Functional/ComponentsRenderingTest.php +++ b/src/Toolkit/tests/Functional/ComponentsRenderingTest.php @@ -14,17 +14,22 @@ use Spatie\Snapshots\Drivers\HtmlDriver; use Spatie\Snapshots\MatchesSnapshots; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; +use Symfony\Component\Filesystem\Filesystem; use Symfony\Component\Filesystem\Path; -use Symfony\Component\Finder\Finder; use Symfony\UX\Toolkit\Kit\Kit; use Symfony\UX\Toolkit\Kit\KitContextRunner; use Symfony\UX\Toolkit\Kit\KitFactory; +use Symfony\UX\Toolkit\Kit\KitSynchronizer; use Symfony\UX\Toolkit\Recipe\Recipe; +use Symfony\UX\Toolkit\Recipe\RecipeSynchronizer; +use Symfony\UX\Toolkit\Recipe\RecipeType; use Symfony\UX\Toolkit\Registry\LocalRegistry; +use Symfony\UX\Toolkit\Tests\TestHelperTrait; class ComponentsRenderingTest extends WebTestCase { use MatchesSnapshots; + use TestHelperTrait; private const KITS_DIR = __DIR__.'/../../kits'; @@ -33,20 +38,23 @@ class ComponentsRenderingTest extends WebTestCase */ public static function provideTestComponentRendering(): iterable { + $filesystem = new Filesystem(); + $kitSynchronizer = new KitSynchronizer($filesystem, new RecipeSynchronizer()); + foreach (LocalRegistry::getAvailableKitsName() as $kitName) { - $kitDir = Path::join(__DIR__, '../../kits', $kitName); - $docsFinder = (new Finder())->files()->name('EXAMPLES.md')->in($kitDir)->depth(1); + $kit = self::createLocalKit($kitName); + $kitSynchronizer->synchronize($kit); - foreach ($docsFinder as $docFile) { - $componentName = $docFile->getRelativePath(); + foreach ($kit->getRecipes(RecipeType::Component) as $recipe) { + $examplesFilePath = Path::join($recipe->absolutePath, 'EXAMPLES.md'); - $codeBlockMatchesResult = preg_match_all('/```twig.*?\n(?P.+?)```/s', $docFile->getContents(), $codeBlockMatches); + $codeBlockMatchesResult = preg_match_all('/```twig.*?\n(?P.+?)```/s', file_get_contents($examplesFilePath), $codeBlockMatches); if (false === $codeBlockMatchesResult || 0 === $codeBlockMatchesResult) { - throw new \RuntimeException(\sprintf('No Twig code blocks found in file "%s"', $docFile->getRelativePathname())); + throw new \RuntimeException(\sprintf('No Twig code blocks found in file "%s"', $examplesFilePath)); } foreach ($codeBlockMatches['code'] as $i => $code) { - yield \sprintf('Kit %s, component %s, code #%d', $kitName, $componentName, $i + 1) => [$kitName, $componentName, $code]; + yield \sprintf('Kit %s, component %s, code #%d', $kitName, $recipe->manifest->name, $i + 1) => [$kitName, $recipe->manifest->name, $code]; } } } diff --git a/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component AlertDialog, code 1__1.html b/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Alert Dialog, code 1__1.html similarity index 99% rename from src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component AlertDialog, code 1__1.html rename to src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Alert Dialog, code 1__1.html index 8b2110a2a35..e81d8943311 100644 --- a/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component AlertDialog, code 1__1.html +++ b/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Alert Dialog, code 1__1.html @@ -1,6 +1,6 @@ - \ No newline at end of file diff --git a/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component AspectRatio, code 1__1.html b/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Aspect Ratio, code 1__1.html similarity index 96% rename from src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component AspectRatio, code 1__1.html rename to src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Aspect Ratio, code 1__1.html index 4a79c14ce86..43bc314bead 100644 --- a/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component AspectRatio, code 1__1.html +++ b/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Aspect Ratio, code 1__1.html @@ -1,6 +1,6 @@ -
- @symfony - - - FP - - FP - -
\ No newline at end of file diff --git a/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Badge, code 6__1.html b/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Badge, code 6__1.html deleted file mode 100644 index 7ff378dd842..00000000000 --- a/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Badge, code 6__1.html +++ /dev/null @@ -1,15 +0,0 @@ - -
- - Verified -
\ No newline at end of file diff --git a/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Breadcrumb, code 3__1.html b/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Breadcrumb, code 3__1.html deleted file mode 100644 index 5628c78570d..00000000000 --- a/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Breadcrumb, code 3__1.html +++ /dev/null @@ -1,56 +0,0 @@ - - \ No newline at end of file diff --git a/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Button, code 11__1.html b/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Button, code 11__1.html deleted file mode 100644 index 53160b740f9..00000000000 --- a/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Button, code 11__1.html +++ /dev/null @@ -1,12 +0,0 @@ - - \ No newline at end of file diff --git a/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Card, code 3__1.html b/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Card, code 3__1.html deleted file mode 100644 index ba0804e9cae..00000000000 --- a/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Card, code 3__1.html +++ /dev/null @@ -1,85 +0,0 @@ - -
-
-
Notifications
-
You have 3 unread messages.
-
-
-
- -
-

- Your call has been confirmed. -

-

- 1 hour ago -

-
-
-
- -
-

- You have a new message! -

-

- 1 hour ago -

-
-
-
- -
-

- Your subscription is expiring soon! -

-

- 2 hours ago -

-
-
-
-
- -
-
\ No newline at end of file diff --git a/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Checkbox, code 4__1.html b/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Checkbox, code 4__1.html deleted file mode 100644 index 70ca0d838fb..00000000000 --- a/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Checkbox, code 4__1.html +++ /dev/null @@ -1,16 +0,0 @@ - -
- - - -
\ No newline at end of file diff --git a/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Input, code 6__1.html b/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Input, code 6__1.html deleted file mode 100644 index 1811212cd22..00000000000 --- a/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Input, code 6__1.html +++ /dev/null @@ -1,16 +0,0 @@ - -
- - - -
\ No newline at end of file diff --git a/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Label, code 4__1.html b/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Label, code 4__1.html deleted file mode 100644 index ccf0432e0ef..00000000000 --- a/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Label, code 4__1.html +++ /dev/null @@ -1,16 +0,0 @@ - -
- - - -
\ No newline at end of file diff --git a/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Pagination, code 3__1.html b/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Pagination, code 3__1.html deleted file mode 100644 index fbf86dca9be..00000000000 --- a/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Pagination, code 3__1.html +++ /dev/null @@ -1,82 +0,0 @@ - - \ No newline at end of file diff --git a/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Progress, code 4__1.html b/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Progress, code 4__1.html deleted file mode 100644 index 0256b1db386..00000000000 --- a/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Progress, code 4__1.html +++ /dev/null @@ -1,36 +0,0 @@ - -
-
-
-
- -
-
-
- -
-
-
- -
-
-
- -
-
-
- -
\ No newline at end of file diff --git a/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Select, code 4__1.html b/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Select, code 4__1.html deleted file mode 100644 index f82b4538605..00000000000 --- a/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Select, code 4__1.html +++ /dev/null @@ -1,16 +0,0 @@ - - \ No newline at end of file diff --git a/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Separator, code 3__1.html b/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Separator, code 3__1.html deleted file mode 100644 index dbd412538bf..00000000000 --- a/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Separator, code 3__1.html +++ /dev/null @@ -1,25 +0,0 @@ - -
-
Blog
-
-
- -
Docs
-
-
- -
Source
-
\ No newline at end of file diff --git a/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Skeleton, code 3__1.html b/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Skeleton, code 3__1.html deleted file mode 100644 index dd9e56d778d..00000000000 --- a/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Skeleton, code 3__1.html +++ /dev/null @@ -1,24 +0,0 @@ - -
-
- -
-
- -
- -
-
\ No newline at end of file diff --git a/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Switch, code 3__1.html b/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Switch, code 3__1.html deleted file mode 100644 index 69fc94946cc..00000000000 --- a/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Switch, code 3__1.html +++ /dev/null @@ -1,53 +0,0 @@ - -
-

Email Notifications

-
-
-
- -

Receive emails about new products, features, and more.

-
- - -
-
-
- -

Receive emails about your account security.

-
- - -
-
-
\ No newline at end of file diff --git a/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Table, code 2__1.html b/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Table, code 2__1.html deleted file mode 100644 index b9f6244ffce..00000000000 --- a/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Table, code 2__1.html +++ /dev/null @@ -1,105 +0,0 @@ - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
A list of your recent invoices.
InvoiceStatusMethodAmount
INV001PaidCredit Card$250.00
INV002PendingPayPal$150.00
INV003UnpaidBank Transfer$350.00
INV004PaidCredit Card$450.00
INV005PaidPayPal$550.00
INV006PendingBank Transfer$200.00
INV007UnpaidCredit Card$300.00
Total$1,500.00
-
\ No newline at end of file diff --git a/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Textarea, code 4__1.html b/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Textarea, code 4__1.html deleted file mode 100644 index ff0e2502d34..00000000000 --- a/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component Textarea, code 4__1.html +++ /dev/null @@ -1,9 +0,0 @@ - - \ No newline at end of file diff --git a/ux.symfony.com/assets/styles/components/_SidebarNav.scss b/ux.symfony.com/assets/styles/components/_SidebarNav.scss index 7d890eea988..25182a8ae92 100644 --- a/ux.symfony.com/assets/styles/components/_SidebarNav.scss +++ b/ux.symfony.com/assets/styles/components/_SidebarNav.scss @@ -1,4 +1,7 @@ -.SidebarNav {} +.SidebarNav { + position: sticky; + top: 0px +} .SidebarNav_Heading { font-weight: 600; @@ -8,6 +11,10 @@ .SidebarNav_Item { border-radius: .5rem; transition: background-color 100ms ease-in-out; + + & + & { + margin-top: .1rem; + } } .SidebarNav_Item.active, .SidebarNav_Item:hover { diff --git a/ux.symfony.com/src/Controller/Toolkit/ComponentsController.php b/ux.symfony.com/src/Controller/Toolkit/ComponentsController.php index de033acc4d8..8a9d52c7ece 100644 --- a/ux.symfony.com/src/Controller/Toolkit/ComponentsController.php +++ b/ux.symfony.com/src/Controller/Toolkit/ComponentsController.php @@ -34,16 +34,6 @@ public function __construct( ) { } - #[Route('/toolkit/kits/{kit}/components/')] - public function listComponents(ToolkitKitId $kit): Response - { - // TODO: implementing listing in the future :D - - return $this->redirectToRoute('app_toolkit_kit', [ - 'kit' => $kit->value, - ], Response::HTTP_FOUND); - } - #[Route('/toolkit/kits/{kitId}/components/{componentName}', name: 'app_toolkit_component')] public function showComponent(ToolkitKitId $kitId, string $componentName): Response { diff --git a/ux.symfony.com/src/LiveMemory/GameLevels.php b/ux.symfony.com/src/LiveMemory/GameLevels.php index 6e6b995b051..1b6244930b0 100644 --- a/ux.symfony.com/src/LiveMemory/GameLevels.php +++ b/ux.symfony.com/src/LiveMemory/GameLevels.php @@ -24,7 +24,7 @@ final class GameLevels * nbCards = (level + 2) * 2 * timeLimit = level * 20 * - * @const array + * @var array */ private const LEVEL_METADATA = [ 1 => [6, 'blue', 20, '3x2'], diff --git a/ux.symfony.com/templates/ux_packages/toolkit.html.twig b/ux.symfony.com/templates/ux_packages/toolkit.html.twig index 77aeca1434b..20e4c041c59 100644 --- a/ux.symfony.com/templates/ux_packages/toolkit.html.twig +++ b/ux.symfony.com/templates/ux_packages/toolkit.html.twig @@ -79,15 +79,19 @@ tree templates/components {% endfor %} -
+
+ + 🚧 WIP! + +