From ca743f907e82e510785f4f1c1d12128af91d34ab Mon Sep 17 00:00:00 2001 From: bernard-ng Date: Fri, 5 Dec 2025 01:08:17 +0200 Subject: [PATCH] [Toolkit][Shadcn] add Empty component --- src/Toolkit/kits/shadcn/empty/EXAMPLES.md | 105 ++++++++++++++++++ src/Toolkit/kits/shadcn/empty/manifest.json | 12 ++ .../templates/components/Empty.html.twig | 8 ++ .../components/Empty/Content.html.twig | 8 ++ .../components/Empty/Description.html.twig | 8 ++ .../components/Empty/Header.html.twig | 8 ++ .../components/Empty/Media.html.twig | 24 ++++ .../components/Empty/Title.html.twig | 8 ++ ...it shadcn, component empty, code 1__1.html | 37 ++++++ ...it shadcn, component empty, code 2__1.html | 39 +++++++ ...it shadcn, component empty, code 3__1.html | 44 ++++++++ ...it shadcn, component empty, code 4__1.html | 65 +++++++++++ 12 files changed, 366 insertions(+) create mode 100644 src/Toolkit/kits/shadcn/empty/EXAMPLES.md create mode 100644 src/Toolkit/kits/shadcn/empty/manifest.json create mode 100644 src/Toolkit/kits/shadcn/empty/templates/components/Empty.html.twig create mode 100644 src/Toolkit/kits/shadcn/empty/templates/components/Empty/Content.html.twig create mode 100644 src/Toolkit/kits/shadcn/empty/templates/components/Empty/Description.html.twig create mode 100644 src/Toolkit/kits/shadcn/empty/templates/components/Empty/Header.html.twig create mode 100644 src/Toolkit/kits/shadcn/empty/templates/components/Empty/Media.html.twig create mode 100644 src/Toolkit/kits/shadcn/empty/templates/components/Empty/Title.html.twig create mode 100644 src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component empty, code 1__1.html create mode 100644 src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component empty, code 2__1.html create mode 100644 src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component empty, code 3__1.html create mode 100644 src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component empty, code 4__1.html diff --git a/src/Toolkit/kits/shadcn/empty/EXAMPLES.md b/src/Toolkit/kits/shadcn/empty/EXAMPLES.md new file mode 100644 index 00000000000..6ba13a2cbbd --- /dev/null +++ b/src/Toolkit/kits/shadcn/empty/EXAMPLES.md @@ -0,0 +1,105 @@ +# Examples + +## Outline + +```twig {"preview":true,"height":"280px"} + + + + + + Cloud storage empty + + Upload files to your cloud storage to access them anywhere. + + + + + Upload files + + + +``` + +## Background + +```twig {"preview":true,"height":"280px"} + + + + + + No notifications + + You're all caught up. New notifications will appear here. + + + + + + Refresh + + + +``` + +## Avatar + +```twig {"preview":true,"height":"280px"} + + + + + + LR + + + User offline + + This user is currently offline. You can leave a message to notify them or try again later. + + + + Leave message + + +``` + +## Avatar group + +```twig {"preview":true,"height":"300px"} + + + +
+ + + CN + + + + LR + + + + ER + +
+
+ No team members + + Invite your team to collaborate on this project. + +
+ + + + Invite members + + +
+``` diff --git a/src/Toolkit/kits/shadcn/empty/manifest.json b/src/Toolkit/kits/shadcn/empty/manifest.json new file mode 100644 index 00000000000..a15f3bb887c --- /dev/null +++ b/src/Toolkit/kits/shadcn/empty/manifest.json @@ -0,0 +1,12 @@ +{ + "$schema": "../../../schema-kit-recipe-v1.json", + "type": "component", + "name": "Empty", + "description": "Use the Empty component to display an empty state.", + "copy-files": { + "templates/": "templates/" + }, + "dependencies": { + "composer": ["twig/extra-bundle", "twig/html-extra:^3.12.0", "tales-from-a-dev/twig-tailwind-extra:^1.0.0"] + } +} diff --git a/src/Toolkit/kits/shadcn/empty/templates/components/Empty.html.twig b/src/Toolkit/kits/shadcn/empty/templates/components/Empty.html.twig new file mode 100644 index 00000000000..25d97240a25 --- /dev/null +++ b/src/Toolkit/kits/shadcn/empty/templates/components/Empty.html.twig @@ -0,0 +1,8 @@ +{# @block content The default block #} +
+ {%- block content %}{% endblock -%} +
diff --git a/src/Toolkit/kits/shadcn/empty/templates/components/Empty/Content.html.twig b/src/Toolkit/kits/shadcn/empty/templates/components/Empty/Content.html.twig new file mode 100644 index 00000000000..007991dc5a4 --- /dev/null +++ b/src/Toolkit/kits/shadcn/empty/templates/components/Empty/Content.html.twig @@ -0,0 +1,8 @@ +{# @block content The default block #} +
+ {%- block content %}{% endblock -%} +
diff --git a/src/Toolkit/kits/shadcn/empty/templates/components/Empty/Description.html.twig b/src/Toolkit/kits/shadcn/empty/templates/components/Empty/Description.html.twig new file mode 100644 index 00000000000..5ec3a703deb --- /dev/null +++ b/src/Toolkit/kits/shadcn/empty/templates/components/Empty/Description.html.twig @@ -0,0 +1,8 @@ +{# @block content The default block #} +
+ {%- block content %}{% endblock -%} +
diff --git a/src/Toolkit/kits/shadcn/empty/templates/components/Empty/Header.html.twig b/src/Toolkit/kits/shadcn/empty/templates/components/Empty/Header.html.twig new file mode 100644 index 00000000000..6a6f08adde2 --- /dev/null +++ b/src/Toolkit/kits/shadcn/empty/templates/components/Empty/Header.html.twig @@ -0,0 +1,8 @@ +{# @block content The default block #} +
+ {%- block content %}{% endblock -%} +
diff --git a/src/Toolkit/kits/shadcn/empty/templates/components/Empty/Media.html.twig b/src/Toolkit/kits/shadcn/empty/templates/components/Empty/Media.html.twig new file mode 100644 index 00000000000..80b639001d9 --- /dev/null +++ b/src/Toolkit/kits/shadcn/empty/templates/components/Empty/Media.html.twig @@ -0,0 +1,24 @@ +{# @prop variant 'default'|'icon' The variant, default to `default` #} +{# @block content The default block #} +{%- props variant = 'default' -%} +{%- set style = html_cva( + base: 'flex shrink-0 items-center justify-center mb-2 [&_svg]:pointer-events-none [&_svg]:shrink-0', + variants: { + variant: { + default: 'bg-transparent', + icon: "bg-muted text-foreground flex size-10 shrink-0 items-center justify-center rounded-lg [&_svg:not([class*='size-'])]:size-6", + }, + }, + default_variant: { + variant: 'default', + }, +) -%} + +
+ {%- block content %}{% endblock -%} +
diff --git a/src/Toolkit/kits/shadcn/empty/templates/components/Empty/Title.html.twig b/src/Toolkit/kits/shadcn/empty/templates/components/Empty/Title.html.twig new file mode 100644 index 00000000000..eb4657fc387 --- /dev/null +++ b/src/Toolkit/kits/shadcn/empty/templates/components/Empty/Title.html.twig @@ -0,0 +1,8 @@ +{# @block content The default block #} +
+ {%- block content %}{% endblock -%} +
diff --git a/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component empty, code 1__1.html b/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component empty, code 1__1.html new file mode 100644 index 00000000000..123cdcca5cc --- /dev/null +++ b/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component empty, code 1__1.html @@ -0,0 +1,37 @@ + +
+
+
+ +
+
Cloud storage empty
+
Upload files to your cloud storage to access them anywhere. +
+
+
+ +
+
\ No newline at end of file diff --git a/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component empty, code 2__1.html b/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component empty, code 2__1.html new file mode 100644 index 00000000000..3e4042bd01c --- /dev/null +++ b/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component empty, code 2__1.html @@ -0,0 +1,39 @@ + +
+
+
+ +
+
No notifications
+
You're all caught up. New notifications will appear here. +
+
+
+ +
+
\ No newline at end of file diff --git a/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component empty, code 3__1.html b/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component empty, code 3__1.html new file mode 100644 index 00000000000..59cff8f4e1a --- /dev/null +++ b/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component empty, code 3__1.html @@ -0,0 +1,44 @@ + +
+
+
+@shadcn + + LR + +
+
User offline
+
This user is currently offline. You can leave a message to notify them or try again later. +
+
+
+ +
+
\ No newline at end of file diff --git a/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component empty, code 4__1.html b/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component empty, code 4__1.html new file mode 100644 index 00000000000..04f1ff437a1 --- /dev/null +++ b/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component empty, code 4__1.html @@ -0,0 +1,65 @@ + +
+
+
+
+ @shadcn + + CN + + @maxleiter + + LR + + @evilrabbit + + ER + +
+
+
No team members
+
Invite your team to collaborate on this project. +
+
+
+ +
+
\ No newline at end of file