Skip to content

Commit

Permalink
feat: added disabled state to accordion component
Browse files Browse the repository at this point in the history
  • Loading branch information
Amirah Chamble authored and Amirah Chamble committed Jan 4, 2019
1 parent 73d26f0 commit 5b57046
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 6 deletions.
16 changes: 15 additions & 1 deletion dev/views/Accordions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,22 @@

<br/>


<FishTankAccordionLarge
heading="Section Heading"
>
<FishTankLoaderContent theme="AlertList"/>
</FishTankAccordionLarge>

<br/>

<FishTankAccordionLarge
heading="Disabled Section Heading"
subheading="Disabled Sub-heading"
:disabled="disabledAccordion"
>
<FishTankLoaderContent theme="AlertList"/>
</FishTankAccordionLarge>


</div>
</template>
Expand All @@ -30,6 +39,11 @@
components: {
FishTankAccordionLarge,
FishTankLoaderContent
},
data: function() {
return{
disabledAccordion : true
}
}
}
Expand Down
13 changes: 9 additions & 4 deletions src/components/FishTankAccordionLarge.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<template>
<div class="ft-accordion-container">
<div
:class="[disabled ? 'ft-accordion-container-gray' : 'ft-accordion-container']"
>
<div
class="ft-accordion-wrapper-lg"
v-on:click="toggle"
@click="toggle"
>
<div class="ft-accordion-heading-wrapper">
<p class="ft-accordion-heading"> {{ heading }} </p>
Expand Down Expand Up @@ -48,6 +50,11 @@
subheading: {
type: String,
required: false
},
disabled:{
type: Boolean,
required: false,
default: false
}
},
methods:{
Expand All @@ -67,5 +74,3 @@
</style>

<!--- re-organize accordion classes, styles and structures, then add
type/javascript, slots/templates to get this working -->
67 changes: 66 additions & 1 deletion src/styles/components/_accordions.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*{
margin: 0px;
}

.ft-accordion-container{
display: flex;
flex-direction: column;
Expand Down Expand Up @@ -39,10 +40,74 @@
svg{
color: $color-gray;

}
}

&:hover{
.ft-accordion-heading-wrapper{
.ft-accordion-heading{
color: $color-black;
}
.ft-accordion-sub-heading{
color: $color-black;
}
}
svg{
color: $color-black;
}
}


}

.ft-accordion-panel{
padding: 12px
}
}


.ft-accordion-container-gray{
display: flex;
flex-direction: column;
margin: 12px;

.ft-accordion-wrapper-lg{
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
padding: 12px;
border-bottom: 1px solid $color-gray-lighter;

.ft-accordion-heading-wrapper{
display: flex;
flex-direction: column;
justify-content: flex-start;

.ft-accordion-heading{
color: $color-gray-lighter;
font-size: $fontsize-base-lg;
font-weight: $fontweight-regular;
line-height: $lineheight-base-lg;
letter-spacing: $letterspacing-base-lg;
}

.ft-accordion-sub-heading{
color: $color-gray-lighter;
font-size: $fontsize-base-sm;
font-weight: $fontweight-regular;
line-height: $lineheight-base-sm;
letter-spacing: $letterspacing-small;
}
}

svg{
color: $color-gray-lighter;

}
}

.ft-accordion-panel{
display:none;
padding: 12px
}

Expand Down

0 comments on commit 5b57046

Please sign in to comment.