diff --git a/src/Toolkit/kits/shadcn/item/EXAMPLES.md b/src/Toolkit/kits/shadcn/item/EXAMPLES.md new file mode 100644 index 00000000000..02ba0bb64bb --- /dev/null +++ b/src/Toolkit/kits/shadcn/item/EXAMPLES.md @@ -0,0 +1,99 @@ +# Examples + +## Default + +```twig {"preview":true} +
+ + + Default Variant + + Standard styling with subtle background and borders. + + + + + Open + + + + + + Outline Variant + + Outlined style with clear borders and transparent background. + + + + + Open + + + + + + Muted Variant + + Subdued appearance with muted colors for secondary content. + + + + + Open + + + +
+``` + +## With Icon + +```twig {"preview":true} +
+ + + + + + Security Alert + + New login detected from unknown device. + + + + + Review + + + +
+``` + +## Link + +```twig {"preview":true} +
+ + + Visit our documentation + + Learn how to get started with our components. + + + + + + + + + External resource + + Opens in a new tab with security attributes. + + + + + + +
+``` diff --git a/src/Toolkit/kits/shadcn/item/manifest.json b/src/Toolkit/kits/shadcn/item/manifest.json new file mode 100644 index 00000000000..43f9dc65fcc --- /dev/null +++ b/src/Toolkit/kits/shadcn/item/manifest.json @@ -0,0 +1,12 @@ +{ + "$schema": "../../../schema-kit-recipe-v1.json", + "type": "component", + "name": "Item", + "description": "A versatile component that you can use to display any content.", + "copy-files": { + "templates/": "templates/" + }, + "dependencies": { + "composer": ["symfony/ux-icons", "tales-from-a-dev/twig-tailwind-extra"] + } +} diff --git a/src/Toolkit/kits/shadcn/item/templates/components/Item.html.twig b/src/Toolkit/kits/shadcn/item/templates/components/Item.html.twig new file mode 100644 index 00000000000..97d660a055a --- /dev/null +++ b/src/Toolkit/kits/shadcn/item/templates/components/Item.html.twig @@ -0,0 +1,29 @@ +{%- props variant = 'default', size = 'default', as = 'div' -%} +{%- set style = html_cva({ + base: 'group/item flex items-center border border-transparent text-sm rounded-md transition-colors [a]:hover:bg-accent/50 [a]:transition-colors duration-100 flex-wrap outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]', + variants: { + variant: { + default: 'bg-transparent', + outline: 'border-border', + muted: 'bg-muted/50', + }, + size: { + default: 'p-4 gap-4', + sm: 'py-3 px-4 gap-2.5', + }, + }, + defaultVariants: { + variant: 'default', + size: 'default', + }, +}) -%} + +<{{ as }} + data-slot="item" + data-variant="{{ variant }}" + data-size="{{ size }}" + class="{{ style.apply({variant: variant, size: size}, attributes.render('class'))|tailwind_merge }}" + {{ attributes }} +> + {%- block content %}{% endblock -%} + diff --git a/src/Toolkit/kits/shadcn/item/templates/components/Item/Actions.html.twig b/src/Toolkit/kits/shadcn/item/templates/components/Item/Actions.html.twig new file mode 100644 index 00000000000..e97ed353cc5 --- /dev/null +++ b/src/Toolkit/kits/shadcn/item/templates/components/Item/Actions.html.twig @@ -0,0 +1,7 @@ +
+ {%- block content %}{% endblock -%} +
diff --git a/src/Toolkit/kits/shadcn/item/templates/components/Item/Content.html.twig b/src/Toolkit/kits/shadcn/item/templates/components/Item/Content.html.twig new file mode 100644 index 00000000000..4978f31aeb6 --- /dev/null +++ b/src/Toolkit/kits/shadcn/item/templates/components/Item/Content.html.twig @@ -0,0 +1,7 @@ +
+ {%- block content %}{% endblock -%} +
diff --git a/src/Toolkit/kits/shadcn/item/templates/components/Item/Description.html.twig b/src/Toolkit/kits/shadcn/item/templates/components/Item/Description.html.twig new file mode 100644 index 00000000000..84fe52d1305 --- /dev/null +++ b/src/Toolkit/kits/shadcn/item/templates/components/Item/Description.html.twig @@ -0,0 +1,7 @@ +

+ {%- block content %}{% endblock -%} +

diff --git a/src/Toolkit/kits/shadcn/item/templates/components/Item/Footer.html.twig b/src/Toolkit/kits/shadcn/item/templates/components/Item/Footer.html.twig new file mode 100644 index 00000000000..1422d15f982 --- /dev/null +++ b/src/Toolkit/kits/shadcn/item/templates/components/Item/Footer.html.twig @@ -0,0 +1,7 @@ +
+ {%- block content %}{% endblock -%} +
diff --git a/src/Toolkit/kits/shadcn/item/templates/components/Item/Group.html.twig b/src/Toolkit/kits/shadcn/item/templates/components/Item/Group.html.twig new file mode 100644 index 00000000000..59fe87af13f --- /dev/null +++ b/src/Toolkit/kits/shadcn/item/templates/components/Item/Group.html.twig @@ -0,0 +1,8 @@ +
+ {%- block content %}{% endblock -%} +
diff --git a/src/Toolkit/kits/shadcn/item/templates/components/Item/Header.html.twig b/src/Toolkit/kits/shadcn/item/templates/components/Item/Header.html.twig new file mode 100644 index 00000000000..537629189f8 --- /dev/null +++ b/src/Toolkit/kits/shadcn/item/templates/components/Item/Header.html.twig @@ -0,0 +1,7 @@ +
+ {%- block content %}{% endblock -%} +
diff --git a/src/Toolkit/kits/shadcn/item/templates/components/Item/Media.html.twig b/src/Toolkit/kits/shadcn/item/templates/components/Item/Media.html.twig new file mode 100644 index 00000000000..dd94b0f03fa --- /dev/null +++ b/src/Toolkit/kits/shadcn/item/templates/components/Item/Media.html.twig @@ -0,0 +1,23 @@ +{%- props variant = 'default' -%} +{%- set style = html_cva({ + base: 'flex shrink-0 items-center justify-center gap-2 group-has-[[data-slot=item-description]]/item:self-start [&_svg]:pointer-events-none group-has-[[data-slot=item-description]]/item:translate-y-0.5', + variants: { + variant: { + default: 'bg-transparent', + icon: "size-8 border rounded-sm bg-muted [&_svg:not([class*='size-'])]:size-4", + image: 'size-10 rounded-sm overflow-hidden [&_img]:size-full [&_img]:object-cover', + }, + }, + defaultVariants: { + variant: 'default', + }, +}) -%} + +
+ {%- block content %}{% endblock -%} +
diff --git a/src/Toolkit/kits/shadcn/item/templates/components/Item/Separator.html.twig b/src/Toolkit/kits/shadcn/item/templates/components/Item/Separator.html.twig new file mode 100644 index 00000000000..5d5a888e6b3 --- /dev/null +++ b/src/Toolkit/kits/shadcn/item/templates/components/Item/Separator.html.twig @@ -0,0 +1,15 @@ +{%- props orientation = 'horizontal', decorative = true -%} + + diff --git a/src/Toolkit/kits/shadcn/item/templates/components/Item/Title.html.twig b/src/Toolkit/kits/shadcn/item/templates/components/Item/Title.html.twig new file mode 100644 index 00000000000..5c0a08f8ab1 --- /dev/null +++ b/src/Toolkit/kits/shadcn/item/templates/components/Item/Title.html.twig @@ -0,0 +1,7 @@ +
+ {%- block content %}{% endblock -%} +
diff --git a/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component item, code 1__1.html b/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component item, code 1__1.html new file mode 100644 index 00000000000..c7ce44c74c9 --- /dev/null +++ b/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component item, code 1__1.html @@ -0,0 +1,83 @@ + +
+
+
+
Default Variant
+

Standard styling with subtle background and borders. +

+
+
+ +
+
+
+
+
Outline Variant
+

Outlined style with clear borders and transparent background. +

+
+
+ +
+
+
+
+
Muted Variant
+

Subdued appearance with muted colors for secondary content. +

+
+
+ +
+
+
\ No newline at end of file diff --git a/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component item, code 2__1.html b/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component item, code 2__1.html new file mode 100644 index 00000000000..fb07e4bf6bd --- /dev/null +++ b/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component item, code 2__1.html @@ -0,0 +1,41 @@ + +
+
+
+ +
+
+
Security Alert
+

New login detected from unknown device. +

+
+
+ +
+
+
\ No newline at end of file diff --git a/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component item, code 3__1.html b/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component item, code 3__1.html new file mode 100644 index 00000000000..1de69ec46b7 --- /dev/null +++ b/src/Toolkit/tests/Functional/__snapshots__/ComponentsRenderingTest__testComponentRendering with data set Kit shadcn, component item, code 3__1.html @@ -0,0 +1,51 @@ + +
+
+
Visit our documentation
+

Learn how to get started with our components. +

+
+
+ +
+
+
+
External resource
+

Opens in a new tab with security attributes. +

+
+
+ +
+
+
\ No newline at end of file