forked from adobe/aem-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ravisanker E
authored and
Ravisanker E
committed
Oct 14, 2024
1 parent
2da6a73
commit ca55729
Showing
10 changed files
with
286 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -146,6 +146,7 @@ | |
{ | ||
"id": "form", | ||
"components": [ | ||
"accordion", | ||
"checkbox", | ||
"checkbox-group", | ||
"date-input", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* Accordion styling */ | ||
:root { | ||
--color-accordion-legend-background: #F3F6FD; | ||
--color-accordion-collapse-icon: #1c3fca; | ||
--color-accordion-border: #ecedf3; | ||
} | ||
|
||
main .form fieldset legend.accordion-legend { | ||
padding: 24px 32px 10px; | ||
border-radius: 24px 24px 4px 4px; | ||
background-color: var(--color-accordion-legend-background); | ||
position: relative; | ||
} | ||
|
||
main .form fieldset legend.accordion-legend[data-visible='false'] { | ||
display:block !important; | ||
color:var(--color-accordion-legend-background); | ||
user-select: none; | ||
} | ||
|
||
main .form fieldset legend::after { | ||
content: '\221F'; | ||
color: var(--color-accordion-collapse-icon); | ||
font-size: 19px; | ||
display: inline; | ||
position: absolute; | ||
transition: transform 0s; | ||
transform: rotate(-45deg); | ||
margin-top: -5px; | ||
right: 22px; | ||
cursor: pointer; | ||
} | ||
|
||
main .form fieldset.accordion-collapse legend::after { | ||
transform: rotate(-225deg); | ||
margin-top: 0; | ||
} | ||
|
||
main .form fieldset.accordion-collapse > :not(legend) { | ||
display: none; | ||
} | ||
|
||
|
||
main .form fieldset.accordion-wrapper > :not(legend) { | ||
padding-left: 1.5rem; | ||
padding-right: 1.5rem; | ||
} | ||
|
||
main .form fieldset.accordion-wrapper { | ||
padding: 15px 0; | ||
border: 1px solid var(--color-accordion-border); | ||
border-bottom-left-radius: 24px; | ||
border-bottom-right-radius: 24px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export default function decorate(panel) { | ||
panel.classList.add('accordion-wrapper'); | ||
const legend = panel?.querySelector('legend'); | ||
legend?.classList.add('accordion-legend'); | ||
legend?.addEventListener('click', () => { | ||
panel.classList.toggle('accordion-collapse'); | ||
}); | ||
return panel; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,6 +44,7 @@ | |
{ | ||
"id": "form", | ||
"components": [ | ||
"accordion", | ||
"checkbox", | ||
"checkbox-group", | ||
"date-input", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
{ | ||
"definitions": [ | ||
{ | ||
"title": "Accordion", | ||
"id": "accordion", | ||
"plugins": { | ||
"xwalk": { | ||
"page": { | ||
"resourceType": "core/fd/components/form/panelcontainer/v1/panelcontainer", | ||
"template": { | ||
"jcr:title": "Accordion", | ||
"fieldType": "panel", | ||
"fd:viewType": "accordion", | ||
"enabled": true, | ||
"visible": true | ||
} | ||
} | ||
} | ||
} | ||
} | ||
], | ||
"models": [ | ||
{ | ||
"id": "accordion", | ||
"fields": [ | ||
{ | ||
"component": "container", | ||
"name": "basic", | ||
"label": "Basic", | ||
"collapsible": false, | ||
"fields": [ | ||
{ | ||
"...": "./_common.json#/basicfields" | ||
} | ||
] | ||
}, | ||
{ | ||
"component": "container", | ||
"name": "repeat", | ||
"label": "Repeat Accordion", | ||
"collapsible": true, | ||
"fields": [ | ||
{ | ||
"component": "boolean", | ||
"name": "repeatable", | ||
"label": "Make accordion repeatable", | ||
"valueType": "boolean" | ||
}, | ||
{ | ||
"component": "number", | ||
"name": "minOccur", | ||
"label": "Minimum repetitions", | ||
"valueType": "number", | ||
"description": "Minimum number of times the accordion appears on the form" | ||
}, | ||
{ | ||
"component": "number", | ||
"name": "maxOccur", | ||
"label": "Maximum repetitions", | ||
"valueType": "number", | ||
"description": "Maximum number of times the accordion can appear on the form" | ||
} | ||
] | ||
}, | ||
{ | ||
"component": "container", | ||
"name": "help", | ||
"label": "Help Content", | ||
"collapsible": true, | ||
"fields": [ | ||
{ | ||
"...": "./_common.json#/helpfields" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |