Skip to content

Commit

Permalink
chore: Switching more components over to using the styleguide accordion
Browse files Browse the repository at this point in the history
  • Loading branch information
breakdancingcat committed May 1, 2024
1 parent 7f85a65 commit a4b1c23
Show file tree
Hide file tree
Showing 10 changed files with 111 additions and 337 deletions.
2 changes: 1 addition & 1 deletion resources/views/components/accordion-styleguide.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</tbody>
@endif

@if($item['promo_item_id'] === 'promoGroupDetails')
@if($item['promo_item_id'] === 'promotionGroupDetails')
<thead>
<tr>
<th colspan="2">Available fields</th>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function index(Request $request): View
],
],
1 => [
'promo_item_id' => 'promoGroupDetails',
'promo_item_id' => 'promotionGroupDetails',
'title' => 'Promo group details',
'description' => '',
'table' => [
Expand Down
2 changes: 1 addition & 1 deletion styleguide/Http/Controllers/ComponentButtonsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public function index(Request $request): View
],
],
1 => [
'promo_item_id' => 'promoGroupDetails',
'promo_item_id' => 'promotionGroupDetails',
'title' => 'Promotion group details',
'description' => '',
'table' => [
Expand Down
2 changes: 1 addition & 1 deletion styleguide/Http/Controllers/ComponentCatalogController.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function index(Request $request): View
],
],
1 => [
'promo_item_id' => 'promoGroupDetails',
'promo_item_id' => 'promotionGroupDetails',
'title' => 'Promotion group details',
'description' => '',
'table' => [
Expand Down
2 changes: 1 addition & 1 deletion styleguide/Http/Controllers/ComponentFlagController.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function index(Request $request): View
'accordion' => [
'data' => [
0 => [
'promo_item_id' => 'promoGroupDetails',
'promo_item_id' => 'promotionGroupDetails',
'title' => 'Promo group details',
'description' => '',
'table' => [
Expand Down
35 changes: 9 additions & 26 deletions styleguide/Http/Controllers/ComponentHeadingController.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,42 +17,25 @@ public function index(Request $request): View
{
$request->data['base']['page']['content']['main'] = '
<p>Add a page heading that spans an entire row. Suggested to use over two related columns, like an "Events" heading over a promo-column featured image, and an events-column. You would not use this when you can add a heading to an individual component.</p>
';

$component_configuration = '
<table class="mt-2">
<thead>
<tr>
<th>Page field</th>
<th>Data</th>
</tr>
</thead>
<tr>
<td>
<pre class="w-full">modular-heading</pre>
</td>
<td>
<pre class="w-full" tabindex="0">
{
"heading": "My heading"
}
</pre>
</td>
</tr>
</table>
';

$components = [
'accordion-1' => [
'accordion' => [
'data' => [
0 => [
'title' => 'Component configuration',
'promo_item_id' => 'componentConfiguration',
'description' => $component_configuration,
'description' => '',
'tr1' => [
'Page field' => 'modular-heading-1',
'Data' => '{
"heading":"My heading"
}',
],
],
],
'component' => [
'filename' => 'accordion',
'filename' => 'accordion-styleguide',
],
],
'heading-1' => [
Expand Down
81 changes: 18 additions & 63 deletions styleguide/Http/Controllers/ComponentHeroController.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,81 +22,36 @@ public function __construct(Factory $faker)
*/
public function index(Request $request): View
{

$component_configuration = '
<table class="mt-2">
<thead>
<tr>
<th>Page field</th>
<th>Data</th>
</tr>
</thead>
<tr>
<td>
<pre class="w-full">modular-hero-1</pre>
</td>
<td>
<pre class="w-full" tabindex="0">
{
"id":0000,
"config":"randomize|limit:1"
}
</pre>
Note: Any limit above 1 will enable rotate.
</td>
</tr>
</table>
';

$promotion_group_details = '
<table class="mt-2">
<thead>
<tr>
<th colspan="2">Available fields</th>
</tr>
</thead>
</tbody>
<tr>
<td class="font-bold">Title</td>
<td>Displayed using options "Text overlay," "Logo overlay" and will become a link if link field is used.</td>
</tr>
<tr>
<td class="font-bold">Link</td>
<td>URL</td>
</tr>
<tr>
<td class="font-bold">Description</td>
<td>Formattable text. If the link field is set, description links will be stripped out.</td>
</tr>
<tr>
<td class="font-bold">Filename</td>
<td>1600x580px or 3200x1160px saved at low quality</td>
</tr>
<tr>
<td class="font-bold">Options</td>
<td>Banner small, Banner large, Text overlay, Half, Logo overlay, SVG overlay</td>
</tr>
</tbody>
</table>';

$components = [
'accordion-1' => [
'accordion' => [
'data' => [
0 => [
'title' => 'Component configuration',
'promo_item_id' => 'componentConfiguration',
'description' => $component_configuration,
'description' => '<p>Note: Any limit above 1 will enable the carousel.</p>',
'tr1' => [
'Page field' => 'modular-hero-1',
'Data' => '{
"id":0000,
"config":"randomize|limit:1"
}',
],
],
1 => [
'title' => 'Promotion group details',
'promo_item_id' => 'promotionGroupDetails',
'description' => $promotion_group_details,
'description' => '',
'table' => [
'Title' => 'Displayed using options "Text overlay," "Logo overlay" and will become a link if link field is used.',
'Link' => 'URL',
'Description' => 'Formattable text. If the link field is set, description links will be stripped out.',
'Filename' => '1600x580px or 3200x1160px saved at low quality',
'Options' => 'Banner small, Banner large, Text overlay, Half, Logo overlay, SVG overlay',
],
],
],
'component' => [
'filename' => 'accordion',
'columns' => '4',
'showDescription' => false,
'filename' => 'accordion-styleguide',
],
],
];
Expand Down
119 changes: 31 additions & 88 deletions styleguide/Http/Controllers/ComponentIconsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,110 +27,53 @@ public function index(Request $request): View
<p>Present a list of promotional items accompanied by icons, offering a visually appealing and informative display.</p>
';

$promotion_group_details = '
<table class="mt-2">
<thead>
<tr>
<th colspan="2">Available fields</th>
</tr>
</thead>
<tbody>
<tr>
<td class="font-bold">Title</td>
<td>Bold text.</td>
</tr>
<tr>
<td class="font-bold">Link</td>
<td>Optional external link. Component flag "singlePromoView" sets the link to the individual promo item view.</td>
</tr>
<tr>
<td class="font-bold">Excerpt</td>
<td>Optional smaller text under the title.</td>
</tr>
<tr>
<td class="font-bold">Description</td>
<td>Optional smaller text under the title and/or excerpt. You might use this area on a singe promo view page and hide it from the component.</td>
</tr>
<tr>
<td class="font-bold">Primary image</td>
<td>Minimum width of 160px svg, png, jpg.</td>
</tr>
</tbody>
</table>
';

$component_configuration = '
<table class="no-stripe">
<thead>
<tr>
<th class="w-2/5">Page field</th>
<th>Data</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<pre class="w-full">modular-icons-column-1</pre>
</td>
<td>
<pre class="w-full" tabindex="0">
{
$components = [
'accordion' => [
'data' => [
0 => [
'title' => 'Component configuration',
'promo_item_id' => 'componentConfiguration',
'description' => '',
'tr1' => [
'Page field' => 'modular-icons-column-1',
'Data' => '{
"id":000000,
"heading":"Icons column"
}
</pre>
</td>
</tr>
<tr>
<td>
<pre class="w-full">modular-icons-row-1</pre>
</td>
<td>
<pre class="w-full" tabindex="0">
{
}',
],
'tr2' => [
'Page field' => 'modular-icons-row-1',
'Data' => '{
"id":000000,
"heading":"Icons row",
"columns":2
}
</pre>
</td>
</tr>
<tr>
<td>
<pre class="w-full">modular-icons-top-row-1</pre>
</td>
<td>
<pre class="w-full" tabindex="0">
{
}',
],
'tr3' => [
'Page field' => 'modular-icons-top-row-1',
'Data' => '{
"id":000000,
"heading":"Icons top row",
"columns":4,
"showDescription":true
}
</pre>
</td>
</tr>
</tbody>
</table>
';

$components = [
'accordion-1' => [
'data' => [
0 => [
'title' => 'Component configuration',
'promo_item_id' => 'componentConfiguration',
'description' => $component_configuration,
}',
],
],
1 => [
'title' => 'Promotion group details',
'promo_item_id' => 'promotionGroupDetails',
'description' => $promotion_group_details,
'description' => '',
'table' => [
'Title' => 'Bold text.',
'Link' => 'Optional external link. Component flag "singlePromoView" sets the link to the individual promo item view.',
'Excerpt' => 'Optional smaller text under the title.',
'Description' => 'Optional smaller text under the title and/or excerpt. You might use this area on a singe promo view page and hide it from the component.',
'Primary image' => 'Minimum width of 160px svg, png, jpg.',
],
],
],
'component' => [
'filename' => 'accordion',
'showDescription' => false,
'filename' => 'accordion-styleguide',
],
],
'icons-column-1' => [
Expand Down
Loading

0 comments on commit a4b1c23

Please sign in to comment.