Skip to content

Commit

Permalink
fix: brought back some missing components
Browse files Browse the repository at this point in the history
  • Loading branch information
jeslage committed Apr 14, 2023
1 parent 4475fef commit b1283d1
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 23 deletions.
41 changes: 29 additions & 12 deletions site/snippets/blocks/accordion.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,32 @@
<?php if(isset($block)): ?>
<div>
<?php foreach ($block->items()->toStructure() as $item): ?>
<h3>
<button id="accordion-trigger-<?= $block->id() ?>" aria-controls="accordion-panel-<?= $block->id() ?>" aria-expanded="false">
<?= $item->title() ?>
<div class="col-span-4 md:col-start-3 md:col-span-8 mb-xl pb-m border-t-2">
<?php foreach ($block->items()->toStructure() as $item) : ?>
<div x-data="{ activeAccordion: false }" class="group border-b-2">
<button
@click="activeAccordion = !activeAccordion"
:aria-expanded="activeAccordion"
aria-controls="accordion-panel-<?= $block->id() ?>"
class="group flex justify-between items-center py-m w-full text-left"
>
<?php snippet('components/text', [
'text' => $item->title(),
'variant' => 'copy-bold',
]) ?>

<div class="group-aria-expanded:rotate-90 w-m">
<?= svg('assets/icons/instagram.svg') ?>
</div>
</button>
</h3>
<div id="accordion-panel-<?= $block->id() ?>" role="region" aria-labelledby="accordion-trigger-<?= $block->id() ?>">
<?= $item->text() ?>

<section
:hidden="!activeAccordion"
id="accordion-panel-<?= $block->id() ?>"
aria-labelledby="accordion-header-<?= $block->id() ?>"
class="pb-m"
>
<?php snippet('components/richtext', slots: true) ?>
<?= $item->text() ?>
<?php endsnippet() ?>
</section>
</div>
</li>
<?php endforeach ?>
</div>
<?php endif ?>
</div>
35 changes: 24 additions & 11 deletions site/snippets/blocks/table.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
<?php if(isset($block)): ?>
<div>
<?php foreach ($block->items()->toStructure() as $item): ?>
<div class="col-span-4 md:col-start-3 md:col-span-8 mb-xl pb-m">
<?php if ($block->headline()): ?>
<?php snippet('components/text', [
'text' => $item->title(),
'variant' => 'copy-bold',
'text' => $block->headline(),
'variant' => 'headline-3',
'class' => 'mb-s',
'tag' => 'h3',
]) ?>
<?php endif; ?>

<?php snippet('components/text', [
'text' => $item->text(),
]) ?>
<?php endforeach; ?>
</div>
<?php endif; ?>
<?php foreach ($block->items()->toStructure() as $item) : ?>
<div class="flex flex-col md:grid md:grid-cols-8 gap-s md:gap-m border-b-2 py-m">
<div class="md:col-span-2">
<?php snippet('components/text', [
'text' => $item->title(),
'variant' => 'copy-bold',
]) ?>
</div>

<div class="md:col-span-6">
<?php snippet('components/richtext', slots: true) ?>
<?= $item->text() ?>
<?php endsnippet() ?>
</div>
</div>
<?php endforeach ?>
</div>

0 comments on commit b1283d1

Please sign in to comment.