-
-
Notifications
You must be signed in to change notification settings - Fork 340
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactored project according our previous discussions
- Loading branch information
Showing
23 changed files
with
530 additions
and
214 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"$schema": "https://ui.shadcn.com/schema/registry.json", | ||
"name": "symfony", | ||
"homepage": "https://symfony.com", | ||
"items": [ | ||
{ | ||
"name": "badge", | ||
"manifest": "components/Badge.json", | ||
"type": "registry:component", | ||
"title": "Badge", | ||
"description": "A simple badge component", | ||
"registryDependencies": [], | ||
"files": [], | ||
"code": "{%- props variant = 'default', outline = false -%}\n{%- set style = html_cva(\n 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',\n variants: {\n variant: {\n default: \"border-transparent bg-primary text-primary-foreground hover:bg-primary/80\",\n secondary: \"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80\",\n destructive: \"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80\",\n },\n outline: {\n true: \"text-foreground bg-white\",\n }\n },\n compoundVariants: [{\n variant: ['default'],\n outline: ['true'],\n class: 'border-primary',\n }, {\n variant: ['secondary'],\n outline: ['true'],\n class: 'border-secondary',\n }, {\n variant: ['destructive'],\n outline: ['true'],\n class: 'border-destructive',\n },]\n) -%}\n\n<div\n class=\"{{ style.apply({variant, outline}, attributes.render('class'))|tailwind_merge }}\"\n {{ attributes.defaults({}).without('class') }}\n>\n {% block content %}{% endblock %}\n</div>\n" | ||
}, | ||
{ | ||
"name": "button", | ||
"manifest": "components/Button.json", | ||
"type": "registry:component", | ||
"title": "Button", | ||
"description": "A Button component", | ||
"registryDependencies": [], | ||
"files": [], | ||
"code": ",<button {{ attributes.without('class') }}\n class=\"{{ (' ' ~ attributes.render('class'))|tailwind_merge }}\"\n>\n {% block content %}Button{% endblock %}\n</button>\n" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 0 additions & 41 deletions
41
src/Toolkit/src/ComponentRepository/ComponentIdentifier.php
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\UX\Toolkit\ComponentRepository; | ||
|
||
/** | ||
* @author Jean-François Lépine | ||
* | ||
* @internal | ||
*/ | ||
final class CurrentTheme | ||
{ | ||
private ComponentRepository $repository; | ||
private RepositoryIdentity $identity; | ||
|
||
public function __construct( | ||
string $theme, | ||
RepositoryFactory $repositoryFactory, | ||
RepositoryIdentifier $repositoryIdentifier, | ||
) { | ||
$this->identity = $repositoryIdentifier->identify($theme); | ||
$this->repository = $repositoryFactory->factory($this->identity); | ||
} | ||
|
||
public function getRepository(): ComponentRepository | ||
{ | ||
return $this->repository; | ||
} | ||
|
||
public function getIdentity(): RepositoryIdentity | ||
{ | ||
return $this->identity; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.