From c127589a6f59f9100fd8a9280cda14aa0a3ba5d7 Mon Sep 17 00:00:00 2001 From: bmauger Date: Wed, 22 Dec 2021 14:00:31 -0500 Subject: [PATCH 1/5] CSR-241 WIP Horizontal card updates. --- src/layouts/component-test/component-test.vue | 22 ++++++- src/styles/ux-variables.scss | 6 ++ src/ux-components/list-card/list-card.vue | 58 ++++++++++++++----- 3 files changed, 71 insertions(+), 15 deletions(-) diff --git a/src/layouts/component-test/component-test.vue b/src/layouts/component-test/component-test.vue index 6c3af4720..a94d6b321 100644 --- a/src/layouts/component-test/component-test.vue +++ b/src/layouts/component-test/component-test.vue @@ -60,8 +60,9 @@ buttonImage="windshield-damage.svg" buttonLabel="Windshield" altText="" - buttonID="Damage Location" + buttonID="Damage Location Checkbox" groupID="checkbox-demo-1" + buttonLabelSubCopy="Description" /> @@ -72,11 +73,30 @@
List Card Demo +
+ + +
+
+
Horizontal as Checkbox
+
+ List Card Demo +
diff --git a/src/styles/ux-variables.scss b/src/styles/ux-variables.scss index 285b0c037..83dadd34a 100644 --- a/src/styles/ux-variables.scss +++ b/src/styles/ux-variables.scss @@ -115,6 +115,12 @@ $font-family-base: $font-family-sans-serif; $font-family-code: $font-family-monospace; $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-lighter: lighter; $font-weight-light: 300; diff --git a/src/ux-components/list-card/list-card.vue b/src/ux-components/list-card/list-card.vue index 806efffe5..f39ab2a83 100644 --- a/src/ux-components/list-card/list-card.vue +++ b/src/ux-components/list-card/list-card.vue @@ -2,15 +2,27 @@
-
+
+
+
+ +
@@ -24,7 +36,10 @@ export default { altText: String,//Leave empty. Screen readers read the buttonLabel text. If alt has content, it will repeat unnecessarily. buttonID: String, groupName: String, - isMultiSelect: Boolean + isMultiSelect: Boolean, + isRadio: Boolean, + isHorizontal: Boolean, + buttonLabelSubCopy: String } }; @@ -36,9 +51,8 @@ export default { border: 1px solid $red; } img { - height: 46px; - width: auto; - order: 1; + height: auto; + width: 2.875rem; margin-bottom: 3rem; } &:hover { @@ -73,7 +87,7 @@ export default { margin: 0 auto; width: 1rem; height: 1rem; - margin: 4rem 0 0 0; + margin: 3rem 0 0 0; background: white; border: 1px solid $gray-500; border-radius: 2px; @@ -85,7 +99,7 @@ export default { &:checked + label::after { content: ''; position: absolute; - margin: 4.2rem 0 0 0; + margin: 3.2rem 0 0 0; border-left: 2px solid $white; border-bottom: 2px solid $white; height: 6px; @@ -110,12 +124,28 @@ export default { } + label { img { - height: 46px; - width: auto; - order: 1; 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; + } + } + } } From 4029935d61b3201695e3f3ca044cae8410299e13 Mon Sep 17 00:00:00 2001 From: bmauger Date: Wed, 22 Dec 2021 16:01:50 -0500 Subject: [PATCH 2/5] CSR-241 WIP horizontal card updates. --- src/ux-components/list-card/list-card.vue | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ux-components/list-card/list-card.vue b/src/ux-components/list-card/list-card.vue index f39ab2a83..b31ce3d38 100644 --- a/src/ux-components/list-card/list-card.vue +++ b/src/ux-components/list-card/list-card.vue @@ -17,7 +17,7 @@
-
+
+
+
Horizontal as Radio Button
+
+ List Card Demo + +
+
+

List Button - Single-Line

diff --git a/src/ux-components/list-card/list-card.vue b/src/ux-components/list-card/list-card.vue index b31ce3d38..6ce2d5561 100644 --- a/src/ux-components/list-card/list-card.vue +++ b/src/ux-components/list-card/list-card.vue @@ -1,5 +1,5 @@ @@ -65,23 +77,23 @@ export default { position: fixed; width: 0; + label { - display: block; - position: relative; - &:hover { - cursor: pointer; - } - } - &:focus + label { - box-shadow: 0 0 0 2.5px $blue; - border-radius: .5rem; - } - &:checked + label { - background: $blue-100; - box-shadow: 0 0 0 1px $blue; - border-radius: .5rem; - } - + label::before { - content: ""; + display: block; + position: relative; + &:hover { + cursor: pointer; + } + } + &:focus + label { + box-shadow: 0 0 0 2.5px $blue; + border-radius: .5rem; + } + &:checked + label { + background: $blue-100; + box-shadow: 0 0 0 1px $blue; + border-radius: .5rem; + } + + label::before { + content: ""; position: absolute; display: flex; margin: 0 auto; @@ -92,45 +104,39 @@ export default { border: 1px solid $gray-500; border-radius: 2px; order: 2; - } - + label.checkboxTop::before { - margin: -1.25rem 0.5rem 0 0 !important; - } - + label.checkboxTop::after { - margin: -1.5rem 0.5rem 0 0 !important; - } - &:checked + label::before { - background: $blue; - } - &:checked + label::after { - content: ''; - position: absolute; - margin: 3.2rem 0 0 0; - border-left: 2px solid $white; - border-bottom: 2px solid $white; - height: 6px; - width: 11px; - transform: rotate(-45deg); - } - &:disabled + label { - color: #575757; - } - &:disabled + label::before { - background: #ddd; - } + } + + label.checkboxTop::before { + margin: -1.25rem 0.5rem 0 0 !important; + } + + label.checkboxTop::after { + margin: -1.5rem 0.5rem 0 0 !important; + } + &:checked + label::before { + background: $blue; + } + &:checked + label::after { + content: ''; + position: absolute; + margin: 3.2rem 0 0 0; + border-left: 2px solid $white; + border-bottom: 2px solid $white; + height: 6px; + width: 11px; + transform: rotate(-45deg); + } } input[type="radio"] { + label::before { content: ""; - display: none; + display: none; } + label::after { content: ""; - display: none; + display: none; } + label { img { - margin-bottom: 1rem; + margin-bottom: 0; } } } @@ -142,16 +148,24 @@ export default { input[type="radio"] { + label::before { content: ""; - position: relative; - margin: 0 .5rem 0 0; - order: 1; + position: relative; + margin: 0 .5rem 0 0; + order: 1; } &:checked + label::after { content: ''; margin: -0.25rem 0 0 0; left: .875rem; } + + label { + img { + margin-bottom: 0; + } + } } } + &.error { + border: 1px solid $red !important; + } } From 2b1249108a9b85a0b68a413ef13f96ff5cb17399 Mon Sep 17 00:00:00 2001 From: bmauger Date: Thu, 23 Dec 2021 09:55:23 -0500 Subject: [PATCH 4/5] CSR-241 add error state. --- src/layouts/component-test/component-test.vue | 20 +++++++++++++++++++ src/styles/common-list-styles.scss | 7 ------- src/ux-components/list-button/list-button.vue | 3 --- src/ux-components/list-card/list-card.vue | 16 +++++++-------- 4 files changed, 28 insertions(+), 18 deletions(-) diff --git a/src/layouts/component-test/component-test.vue b/src/layouts/component-test/component-test.vue index 73d068cd3..285e3b8ef 100644 --- a/src/layouts/component-test/component-test.vue +++ b/src/layouts/component-test/component-test.vue @@ -118,6 +118,24 @@
+
+
+
With error
+
+ List Card Demo + +
+
+

List Button - Single-Line

@@ -142,6 +160,8 @@ loaderPosition="right" sizeInRem="1" screenReaderOnlyText="(opens new window)" + hasError + errorMessage="Error" /> {{buttonLabelSubCopy}} {{screenReaderOnlyText}} -

{{errorMessage}}

@@ -17,7 +16,6 @@ {{screenReaderOnlyText}} -

{{errorMessage}}

@@ -40,7 +38,6 @@ export default { }, data() { return { - isError: false, isLoaderDisplayed: false, }; }, diff --git a/src/ux-components/list-card/list-card.vue b/src/ux-components/list-card/list-card.vue index 6ce2d5561..7594a44ea 100644 --- a/src/ux-components/list-card/list-card.vue +++ b/src/ux-components/list-card/list-card.vue @@ -1,5 +1,5 @@