Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature/PMCP-61633: Accordion Module #839

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unpublished Changes
* Update Lerna to V8 (does not appear to fix any publishing issues)
* larva-patterns - New `Accordion` module.

## 1.60.0 01-02-2024
* Adds the pullquote.memo prototype that is referenced by some brands.
Expand Down
15 changes: 15 additions & 0 deletions packages/larva-patterns/modules/accordion/accordion.prototype.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const clonedeep = require( 'lodash.clonedeep' );

const c_heading = clonedeep( require( '@penskemediacorp/larva-patterns/components/c-heading/c-heading.prototype' ) );

c_heading.c_heading_text = 'Click here to toggle content';

module.exports = {
accordion_classes: '',
accordion_heading_classes: 'lrv-u-font-weight-bold',
accordion_heading: c_heading,
accordion_collapsible_data_attr: 'collapsed',
accordion_collapsible_toggle_data_attr: 'always-show',
accordion_markup:
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.',
};
8 changes: 8 additions & 0 deletions packages/larva-patterns/modules/accordion/accordion.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<div class="accordion // {{ accordion_classes }}" data-collapsible="{{ accordion_collapsible_data_attr }}">
<div class="{{ accordion_heading_classes }}" data-collapsible-toggle="{{ accordion_collapsible_toggle_data_attr }}">
{% include "@larva/components/c-heading/c-heading.twig" with accordion_heading %}
</div>
<div class="{{ accordion_markup_classes }}" data-collapsible-panel="">
{{ accordion_markup|raw }}
</div>
</div>
Loading