CSR-241 WIP
Horizontal card updates.
This commit is contained in:
parent
9865fd83cd
commit
c127589a6f
3 changed files with 71 additions and 15 deletions
|
|
@ -60,8 +60,9 @@
|
||||||
buttonImage="windshield-damage.svg"
|
buttonImage="windshield-damage.svg"
|
||||||
buttonLabel="Windshield"
|
buttonLabel="Windshield"
|
||||||
altText=""
|
altText=""
|
||||||
buttonID="Damage Location"
|
buttonID="Damage Location Checkbox"
|
||||||
groupID="checkbox-demo-1"
|
groupID="checkbox-demo-1"
|
||||||
|
buttonLabelSubCopy="Description"
|
||||||
/>
|
/>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -72,11 +73,30 @@
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend class="sr-only">List Card Demo</legend>
|
<legend class="sr-only">List Card Demo</legend>
|
||||||
<listCard
|
<listCard
|
||||||
|
isRadio
|
||||||
buttonImage="windshield-damage.svg"
|
buttonImage="windshield-damage.svg"
|
||||||
buttonLabel="Windshield"
|
buttonLabel="Windshield"
|
||||||
altText=""
|
altText=""
|
||||||
buttonID="Damage Location Radio Button"
|
buttonID="Damage Location Radio Button"
|
||||||
groupID="checkbox-demo-2"
|
groupID="checkbox-demo-2"
|
||||||
|
buttonLabelSubCopy="Description"
|
||||||
|
/>
|
||||||
|
</fieldset>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row g-2">
|
||||||
|
<div class="col">
|
||||||
|
<h6 class="mx-2 my-4">Horizontal as Checkbox</h6>
|
||||||
|
<fieldset>
|
||||||
|
<legend class="sr-only">List Card Demo</legend>
|
||||||
|
<listCard
|
||||||
|
isHorizontal
|
||||||
|
buttonImage="windshield-damage.svg"
|
||||||
|
buttonLabel="Windshield"
|
||||||
|
altText=""
|
||||||
|
buttonID="Damage Location Horizontal Checkbox"
|
||||||
|
groupID="checkbox-demo-3"
|
||||||
|
buttonLabelSubCopy="Description"
|
||||||
/>
|
/>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -115,6 +115,12 @@ $font-family-base: $font-family-sans-serif;
|
||||||
$font-family-code: $font-family-monospace;
|
$font-family-code: $font-family-monospace;
|
||||||
$font-size-base: 1rem; // Assumes the browser default, typically `16px`
|
$font-size-base: 1rem; // Assumes the browser default, typically `16px`
|
||||||
|
|
||||||
|
//Custom Font size (extra small)
|
||||||
|
$font-size-xsm: $font-size-base * .75;
|
||||||
|
$font-sizes: (
|
||||||
|
7: $font-size-xsm
|
||||||
|
);
|
||||||
|
|
||||||
//Font weight
|
//Font weight
|
||||||
$font-weight-lighter: lighter;
|
$font-weight-lighter: lighter;
|
||||||
$font-weight-light: 300;
|
$font-weight-light: 300;
|
||||||
|
|
|
||||||
|
|
@ -2,15 +2,27 @@
|
||||||
<div v-if="isMultiSelect" class="list-card w-100 rounded-3 d-flex align-items-center" :class="[this.invalid]">
|
<div v-if="isMultiSelect" class="list-card w-100 rounded-3 d-flex align-items-center" :class="[this.invalid]">
|
||||||
<input type="checkbox" :id="buttonID" :name="groupName" :value="buttonLabel" :aria-required="isRequired" />
|
<input type="checkbox" :id="buttonID" :name="groupName" :value="buttonLabel" :aria-required="isRequired" />
|
||||||
<label :for="buttonID" class="d-flex flex-column w-100 align-items-center pt-4 pb-2" tabindex="1">
|
<label :for="buttonID" class="d-flex flex-column w-100 align-items-center pt-4 pb-2" tabindex="1">
|
||||||
<img v-bind:src="require(`@/assets/img/icons/${buttonImage}`)" v-bind:alt="altText" />
|
<img class="order-1" v-bind:src="require(`@/assets/img/icons/${buttonImage}`)" v-bind:alt="altText" />
|
||||||
<p class="m-0 order-3">{{buttonLabel}}</p>
|
<p class="small m-0 order-3">{{buttonLabel}}</p>
|
||||||
|
<p class="fs-7 m-0 order-4">{{buttonLabelSubCopy}}</p>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div v-else class="list-card w-100 rounded-3 d-flex align-items-center" :class="[this.invalid]">
|
<div v-else-if="isRadio" class="list-card w-100 rounded-3 d-flex align-items-center" :class="[this.invalid]">
|
||||||
<input type="radio" :id="buttonID" :name="groupName" :value="buttonID" :aria-required="isRequired" />
|
<input type="radio" :id="buttonID" :name="groupName" :value="buttonID" :aria-required="isRequired" />
|
||||||
<label :for="buttonID" class="d-flex flex-column w-100 align-items-center pt-4 pb-2" tabindex="1">
|
<label :for="buttonID" class="d-flex flex-column w-100 align-items-center pt-4 pb-2" tabindex="1">
|
||||||
<img v-bind:src="require(`@/assets/img/icons/${buttonImage}`)" v-bind:alt="altText" />
|
<img class="order-1" v-bind:src="require(`@/assets/img/icons/${buttonImage}`)" v-bind:alt="altText" />
|
||||||
<p class="m-0 order-3">{{buttonLabel}}</p>
|
<p class="small m-0 order-2">{{buttonLabel}}</p>
|
||||||
|
<p class="fs-7 m-0 order-3">{{buttonLabelSubCopy}}</p>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div v-else class="list-card horizontal w-100 rounded-3 d-flex align-items-center" :class="[this.invalid]">
|
||||||
|
<input type="checkbox" :id="buttonID" :name="groupName" :value="buttonLabel" :aria-required="isRequired" />
|
||||||
|
<label :for="buttonID" class="d-flex flex-row w-100 align-items-center py-3 ps-3 pe-8" tabindex="1">
|
||||||
|
<img class="ms-auto order-3" v-bind:src="require(`@/assets/img/icons/${buttonImage}`)" v-bind:alt="altText" />
|
||||||
|
<div class="order-2">
|
||||||
|
<p class="m-0 small">{{buttonLabel}}</p>
|
||||||
|
<p class="m-0 fs-7">{{buttonLabelSubCopy}}</p>
|
||||||
|
</div>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -24,7 +36,10 @@ export default {
|
||||||
altText: String,//Leave empty. Screen readers read the buttonLabel text. If alt has content, it will repeat unnecessarily.
|
altText: String,//Leave empty. Screen readers read the buttonLabel text. If alt has content, it will repeat unnecessarily.
|
||||||
buttonID: String,
|
buttonID: String,
|
||||||
groupName: String,
|
groupName: String,
|
||||||
isMultiSelect: Boolean
|
isMultiSelect: Boolean,
|
||||||
|
isRadio: Boolean,
|
||||||
|
isHorizontal: Boolean,
|
||||||
|
buttonLabelSubCopy: String
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
@ -36,9 +51,8 @@ export default {
|
||||||
border: 1px solid $red;
|
border: 1px solid $red;
|
||||||
}
|
}
|
||||||
img {
|
img {
|
||||||
height: 46px;
|
height: auto;
|
||||||
width: auto;
|
width: 2.875rem;
|
||||||
order: 1;
|
|
||||||
margin-bottom: 3rem;
|
margin-bottom: 3rem;
|
||||||
}
|
}
|
||||||
&:hover {
|
&:hover {
|
||||||
|
|
@ -73,7 +87,7 @@ export default {
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
width: 1rem;
|
width: 1rem;
|
||||||
height: 1rem;
|
height: 1rem;
|
||||||
margin: 4rem 0 0 0;
|
margin: 3rem 0 0 0;
|
||||||
background: white;
|
background: white;
|
||||||
border: 1px solid $gray-500;
|
border: 1px solid $gray-500;
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
|
|
@ -85,7 +99,7 @@ export default {
|
||||||
&:checked + label::after {
|
&:checked + label::after {
|
||||||
content: '';
|
content: '';
|
||||||
position: absolute;
|
position: absolute;
|
||||||
margin: 4.2rem 0 0 0;
|
margin: 3.2rem 0 0 0;
|
||||||
border-left: 2px solid $white;
|
border-left: 2px solid $white;
|
||||||
border-bottom: 2px solid $white;
|
border-bottom: 2px solid $white;
|
||||||
height: 6px;
|
height: 6px;
|
||||||
|
|
@ -110,12 +124,28 @@ export default {
|
||||||
}
|
}
|
||||||
+ label {
|
+ label {
|
||||||
img {
|
img {
|
||||||
height: 46px;
|
|
||||||
width: auto;
|
|
||||||
order: 1;
|
|
||||||
margin-bottom: 1rem;
|
margin-bottom: 1rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
&.horizontal {
|
||||||
|
img {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
input[type='checkbox'],
|
||||||
|
input[type="radio"] {
|
||||||
|
+ label::before {
|
||||||
|
content: "";
|
||||||
|
position: relative;
|
||||||
|
margin: 0 .5rem 0 0;
|
||||||
|
order: 1;
|
||||||
|
}
|
||||||
|
&:checked + label::after {
|
||||||
|
content: '';
|
||||||
|
margin: -0.25rem 0 0 0;
|
||||||
|
left: .875rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue