From c5f09e920d46ccce04c8c3a4fa3845d8e7bf6d7b Mon Sep 17 00:00:00 2001 From: Jon Mierke Date: Wed, 12 Aug 2026 16:23:01 -0500 Subject: [PATCH 1/3] Have a rough working version of the first tab variant --- components/mega-menu/config.yml | 4 + components/mega-menu/files/index.blade.php | 85 +++++++++++++++++++ .../mega-menu/files/tab-content.blade.php | 5 ++ components/mega-menu/files/tab.blade.php | 56 ++++++++++++ components/mega-menu/usage.md | 17 ++++ 5 files changed, 167 insertions(+) create mode 100644 components/mega-menu/config.yml create mode 100644 components/mega-menu/files/index.blade.php create mode 100644 components/mega-menu/files/tab-content.blade.php create mode 100644 components/mega-menu/files/tab.blade.php create mode 100644 components/mega-menu/usage.md diff --git a/components/mega-menu/config.yml b/components/mega-menu/config.yml new file mode 100644 index 0000000..1529719 --- /dev/null +++ b/components/mega-menu/config.yml @@ -0,0 +1,4 @@ +files: + index: resources/views/components/ui/mega-menu/index.blade.php + tab: resources/views/components/ui/mega-menu/tab.blade.php + tab-content: resources/views/components/ui/mega-menu/tab-content.blade.php \ No newline at end of file diff --git a/components/mega-menu/files/index.blade.php b/components/mega-menu/files/index.blade.php new file mode 100644 index 0000000..8081523 --- /dev/null +++ b/components/mega-menu/files/index.blade.php @@ -0,0 +1,85 @@ +@props([ + 'label', + 'width' => 'w-[100vw]', + 'variant' => 'default', // 'default' | 'tabs' +]) + +
+ + {{-- TRIGGER --}} + + + {{-- DROPDOWN --}} + + +
\ No newline at end of file diff --git a/components/mega-menu/files/tab-content.blade.php b/components/mega-menu/files/tab-content.blade.php new file mode 100644 index 0000000..4d93d53 --- /dev/null +++ b/components/mega-menu/files/tab-content.blade.php @@ -0,0 +1,5 @@ +@props([]) + +
merge(['class' => 'flex flex-col gap-3']) }}> + {{ $slot }} +
\ No newline at end of file diff --git a/components/mega-menu/files/tab.blade.php b/components/mega-menu/files/tab.blade.php new file mode 100644 index 0000000..1eff7cf --- /dev/null +++ b/components/mega-menu/files/tab.blade.php @@ -0,0 +1,56 @@ +@props([ + 'icon' => null, + 'title', + 'variant' => 'default', // 'default' | 'accent' | 'minimal' +]) + +@php + // Generated once per render so the trigger and its panel can reference + // the same value without any shared Alpine index/counter between them. + $tabId = (string) \Illuminate\Support\Str::uuid(); + + $iconWrapClasses = match ($variant) { + 'accent' => 'bg-grad-accent-left text-white', + 'minimal' => 'bg-transparent text-neutral-500 dark:text-neutral-400', + default => 'bg-neutral-100 dark:bg-neutral-800 text-neutral-900 dark:text-white', + }; +@endphp + +{{-- Trigger — auto-placed into column 1 of the parent grid, one per row --}} + + +{{-- Panel — pinned to column 2, spans well past however many triggers exist --}} +
+ {{ $slot }} +
\ No newline at end of file diff --git a/components/mega-menu/usage.md b/components/mega-menu/usage.md new file mode 100644 index 0000000..e311d7c --- /dev/null +++ b/components/mega-menu/usage.md @@ -0,0 +1,17 @@ +--- +name: 'mega-menu' +--- + + + + +

Community & real estate magazines

+
+
+ + + +

Indoor signs, outdoor signs, yard signs & more

+
+
+
\ No newline at end of file From 2ee6b41f45702fda2b377de61da2a3650c99596d Mon Sep 17 00:00:00 2001 From: Jon Mierke Date: Mon, 17 Aug 2026 16:36:20 -0500 Subject: [PATCH 2/3] v1 --- components/accordion/files/index.blade.php | 83 +++++++++++++++++++++- components/accordion/usage.md | 29 ++++++++ 2 files changed, 109 insertions(+), 3 deletions(-) diff --git a/components/accordion/files/index.blade.php b/components/accordion/files/index.blade.php index 95a7710..8979c04 100755 --- a/components/accordion/files/index.blade.php +++ b/components/accordion/files/index.blade.php @@ -1,9 +1,86 @@ @props([ - 'reverse' => false + 'reverse' => false, + 'faq' => false ]) -
loadHTML( + '
' . $slotHtml . '
', + LIBXML_NOERROR | LIBXML_NOWARNING + ); + libxml_clear_errors(); + + foreach ((new \DOMXPath($dom))->query('//*[@role="region"]') as $region) { + $trigger = null; + $panel = null; + + foreach ($region->childNodes as $child) { + if (!$child instanceof \DOMElement) { + continue; + } + + if ($child->tagName === 'button' && !$trigger) { + $trigger = $child; + } elseif ($child->tagName === 'div' && !$panel) { + $panel = $child; + } + } + + if (!$trigger || !$panel) { + continue; + } + + $question = trim(preg_replace('/\s+/', ' ', $trigger->textContent)); + + $answerHtml = ''; + foreach ($panel->firstElementChild?->childNodes ?? [] as $node) { + $answerHtml .= $dom->saveHTML($node); + } + $answerHtml = trim($answerHtml); + + if ($question === '' || $answerHtml === '') { + continue; + } + + $questions[] = [ + '@type' => 'Question', + 'name' => $question, + 'acceptedAnswer' => [ + '@type' => 'Answer', + 'text' => $answerHtml, + ], + ]; + } + + if (!empty($questions)) { + $faqSchema = [ + '@context' => 'https://schema.org', + '@type' => 'FAQPage', + 'mainEntity' => $questions, + ]; + } + } + } +@endphp + +@if ($faqSchema) + @push('head') + + @endpush +@endif + +
merge([ 'class'=>"w-full flex flex-col" ]) }} diff --git a/components/accordion/usage.md b/components/accordion/usage.md index 202cd2f..0d61c44 100644 --- a/components/accordion/usage.md +++ b/components/accordion/usage.md @@ -284,6 +284,34 @@ Use the reverse layout to position chevron icons on the left side. ``` +### FAQ Schema (JSON-LD) + +Add the `faq` attribute to the root `` tag to automatically generate a [FAQPage JSON-LD schema](https://developers.google.com/search/docs/appearance/structured-data/faqpage) from the accordion's triggers and content, and push it to your page's ``. + +This walks the rendered accordion items, using each trigger's text as the `Question` and each content panel's markup as the `Answer`. + +```blade + + +

We offer a 30-day return policy for all unused items in their original packaging.

+
+ +

Standard shipping typically takes 3-5 business days.

+
+
+``` + +This pushes a `