From ac93fe1110b89194706de6b4e3cecff0ec7d6726 Mon Sep 17 00:00:00 2001 From: Ash Monsh Date: Wed, 17 Jan 2024 14:39:50 +0300 Subject: [PATCH] adding Accordion Blade Component and update the docs --- docs/getting-started/blade-component.md | 36 +++++++++++++ .../components/accordion/index.blade.php | 13 +++++ .../views/components/accordion/item.blade.php | 45 ++++++++++++++++ resources/views/forms/accordion.blade.php | 4 +- resources/views/forms/accordions.blade.php | 54 ++++--------------- 5 files changed, 105 insertions(+), 47 deletions(-) create mode 100644 docs/getting-started/blade-component.md create mode 100644 resources/views/components/accordion/index.blade.php create mode 100644 resources/views/components/accordion/item.blade.php diff --git a/docs/getting-started/blade-component.md b/docs/getting-started/blade-component.md new file mode 100644 index 0000000..4bbfda0 --- /dev/null +++ b/docs/getting-started/blade-component.md @@ -0,0 +1,36 @@ +--- +title: Blade Component +weight: 4 +--- + +## Accordion Blade Component + +you can use accordion as a blade component in any view you want + +```html + + +
+

title

+

title

+
+
+ + +
+

info

+

info

+

info

+
+
+ +
+``` \ No newline at end of file diff --git a/resources/views/components/accordion/index.blade.php b/resources/views/components/accordion/index.blade.php new file mode 100644 index 0000000..11c4e99 --- /dev/null +++ b/resources/views/components/accordion/index.blade.php @@ -0,0 +1,13 @@ +@props([ + 'activeAccordion' => 1, +]) +
+ {{ $slot }} +
\ No newline at end of file diff --git a/resources/views/components/accordion/item.blade.php b/resources/views/components/accordion/item.blade.php new file mode 100644 index 0000000..1afa591 --- /dev/null +++ b/resources/views/components/accordion/item.blade.php @@ -0,0 +1,45 @@ +@props([ + 'activeAccordion' => 1, + 'isIsolated' => false, + 'icon' => null, + 'label' => '', +]) +
+ +
+ {{ $slot }} +
+
\ No newline at end of file diff --git a/resources/views/forms/accordion.blade.php b/resources/views/forms/accordion.blade.php index ffc78af..d8b994f 100644 --- a/resources/views/forms/accordion.blade.php +++ b/resources/views/forms/accordion.blade.php @@ -1,5 +1,3 @@ -
+
{{ $getChildComponentContainer() }}
diff --git a/resources/views/forms/accordions.blade.php b/resources/views/forms/accordions.blade.php index 973a4f3..c9e5f4d 100644 --- a/resources/views/forms/accordions.blade.php +++ b/resources/views/forms/accordions.blade.php @@ -10,7 +10,7 @@ ->merge($getExtraAttributes(), escape: false) ->merge($getExtraAlpineAttributes(), escape: false) ->class([ - 'fi-fo-accordions rounded-xl bg-white shadow-sm ring-1 ring-gray-950/5 dark:bg-gray-900 dark:ring-white/10', + 'rounded-xl bg-white shadow-sm ring-1 ring-gray-950/5 dark:bg-gray-900 dark:ring-white/10', ]) }} > @@ -20,49 +20,15 @@ $getActiveAccordion = $getActiveAccordion(); @endphp -
+ @foreach ($getChildComponentContainer()->getComponents() as $accordion) -
- -
- {{ $accordion }} -
-
+ + {{ $accordion }} + @endforeach -
+