From 2a7e7b9ca99484875e23d855d9df86190703e2ad Mon Sep 17 00:00:00 2001
From: Tommy
Date: Thu, 5 Sep 2024 11:48:23 -0400
Subject: [PATCH 01/26] feat: wip
---
es-ds-components/components/es-form-radio-card.vue | 0
es-ds-components/components/es-form-radio-cards.vue | 0
2 files changed, 0 insertions(+), 0 deletions(-)
create mode 100644 es-ds-components/components/es-form-radio-card.vue
create mode 100644 es-ds-components/components/es-form-radio-cards.vue
diff --git a/es-ds-components/components/es-form-radio-card.vue b/es-ds-components/components/es-form-radio-card.vue
new file mode 100644
index 000000000..e69de29bb
diff --git a/es-ds-components/components/es-form-radio-cards.vue b/es-ds-components/components/es-form-radio-cards.vue
new file mode 100644
index 000000000..e69de29bb
From bca817bb3d11dd5e03ef670a23304f9469d2222c Mon Sep 17 00:00:00 2001
From: Tommy
Date: Fri, 6 Sep 2024 09:29:23 -0400
Subject: [PATCH 02/26] feat: wip
---
.../components/es-form-radio-card.vue | 28 ++++++
.../components/es-form-radio-cards.vue | 36 ++++++++
es-ds-docs/components/ds-molecules-list.vue | 91 ++++++++++++++-----
es-ds-docs/pages/molecules/radio-cards.vue | 72 +++++++++++++++
4 files changed, 205 insertions(+), 22 deletions(-)
create mode 100644 es-ds-docs/pages/molecules/radio-cards.vue
diff --git a/es-ds-components/components/es-form-radio-card.vue b/es-ds-components/components/es-form-radio-card.vue
index e69de29bb..15e677cb3 100644
--- a/es-ds-components/components/es-form-radio-card.vue
+++ b/es-ds-components/components/es-form-radio-card.vue
@@ -0,0 +1,28 @@
+
+
+
+
+
diff --git a/es-ds-components/components/es-form-radio-cards.vue b/es-ds-components/components/es-form-radio-cards.vue
index e69de29bb..d6f238c98 100644
--- a/es-ds-components/components/es-form-radio-cards.vue
+++ b/es-ds-components/components/es-form-radio-cards.vue
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
diff --git a/es-ds-docs/components/ds-molecules-list.vue b/es-ds-docs/components/ds-molecules-list.vue
index f4888a4f0..2804e9486 100644
--- a/es-ds-docs/components/ds-molecules-list.vue
+++ b/es-ds-docs/components/ds-molecules-list.vue
@@ -1,68 +1,115 @@
+
- Accordion
+
+ Accordion
+
+
+
+
+ Badge
+
- Badge
+
+ Breadcrumbs
+
- Breadcrumbs
+
+ Button
+
- Button
+
+ Card
+
- Card
+
+ Checkbox
+
- Checkbox
+
+ Collapse
+
- Collapse
+
+ Data table
+
- Data table
+
+ Data table simple
+
- Data table simple
+
+ File input
+
- File input
+
+ Form message
+
- Form message
+
+ Modal
+
- Modal
+
+ Pagination
+
- Pagination
+
+ Popover
+
- Popover
+
+ Progress
+
- Progress
+
+ Progress circle
+
- Progress circle
+
+ Radio button
+
- Radio button
+
+ Radio cards
+
- Rating
+
+ Rating
+
- Support
+
+ Support
+
- Tabs
+
+ Tabs
+
- Text input
+
+ Text input
+
-
diff --git a/es-ds-docs/pages/molecules/radio-cards.vue b/es-ds-docs/pages/molecules/radio-cards.vue
new file mode 100644
index 000000000..67cf87cda
--- /dev/null
+++ b/es-ds-docs/pages/molecules/radio-cards.vue
@@ -0,0 +1,72 @@
+
+
+
+
+
+
+ Radio cards
+
+
+ Extended from
+ prime-vue form-radio
+
+
+
+
+ Radio Card
+
+
+
+
+ Default
+
+
+ Responsive font sizing is applied by default. This means the text will be smaller on
+ mobile and larger on desktop.
+
+
+
+
+ Selection:
+ {{ form.propertyType || '[none]' }}
+
+
+
+
+
From 1a20c9368a8eafef3b2abf9a4516bd0a9dcc3990 Mon Sep 17 00:00:00 2001
From: Tommy
Date: Tue, 10 Sep 2024 10:36:05 -0400
Subject: [PATCH 03/26] feat: explicit prop passing
---
.../components/es-form-radio-card.vue | 43 ++++++++++++++++++-
.../components/es-radio-button.vue | 16 ++++++-
es-ds-docs/pages/molecules/radio-cards.vue | 9 +++-
3 files changed, 64 insertions(+), 4 deletions(-)
diff --git a/es-ds-components/components/es-form-radio-card.vue b/es-ds-components/components/es-form-radio-card.vue
index 15e677cb3..54bd459f4 100644
--- a/es-ds-components/components/es-form-radio-card.vue
+++ b/es-ds-components/components/es-form-radio-card.vue
@@ -6,6 +6,8 @@ interface IProps {
inline?: boolean;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
value: any;
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ modelValue: any;
}
const props = withDefaults(defineProps(), {
@@ -15,14 +17,53 @@ const props = withDefaults(defineProps(), {
inline: false,
value: null,
});
+
+const emit = defineEmits([
+ 'radio-card:change',
+ 'radio-card:blur',
+ 'radio-card:focus',
+ 'radio-card:update',
+])
+
+
+
+function handleClick() {
+ if (props.value !== props.modelValue) {
+ emit('radio-card:update', props.value);
+ }
+}
+
+const isSelected = computed(() => props.modelValue === props.value)
+
+const isFocused = ref(false);
+// eslint-disable-next-line @typescript-eslint/no-explicit-any
+function handleFocus(e: any) {
+ console.log('form-radio-card:handleFocus ', e);
+ // eslint-disable-next-line no-debugger
+ // debugger;
+ emit('radio-card:focus', e);
+ if (isSelected.value) {
+ isFocused.value = true;
+ } else {
+ isFocused.value = false;
+ }
+}
+ :value="props.value"
+ :model-value="props.modelValue"
+ @radio-button:change="$emit('radio-card:change', (evt: any) => evt)"
+ @radio-button:blur="$emit('radio-card:blur', (evt: any) => evt)"
+ @radio-button:focus="handleFocus"
+ @radio-button:update="$emit('radio-card:update', props.value)"
+ @click="handleClick"
+ />
diff --git a/es-ds-components/components/es-radio-button.vue b/es-ds-components/components/es-radio-button.vue
index b171a7aa4..c14e01ec6 100644
--- a/es-ds-components/components/es-radio-button.vue
+++ b/es-ds-components/components/es-radio-button.vue
@@ -8,6 +8,8 @@ interface IProps {
inline?: boolean;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
value: any;
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ modelValue: any;
}
const props = withDefaults(defineProps(), {
@@ -17,6 +19,13 @@ const props = withDefaults(defineProps(), {
inline: false,
value: null,
});
+
+defineEmits([
+ 'radio-button:change',
+ 'radio-button:focus',
+ 'radio-button:blur',
+ 'radio-button:update',
+])
@@ -28,7 +37,12 @@ const props = withDefaults(defineProps(), {
:disabled="disabled"
:input-id="`${props.value}-${props.groupName}`"
:name="props.groupName"
- :value="props.value" />
+ :model-value="modelValue"
+ :value="props.value"
+ @change="$emit('radio-button:change', (evt: any) => evt)"
+ @focus="$emit('radio-button:focus', (evt: any) => evt)"
+ @blur="$emit('radio-button:blur', (evt: any) => evt)"
+ @update:model-value="$emit('radio-button:update', props.value)" />
+ :model-value="form.propertyType"
+ :value="propertyTypeOptions[0].value"
+ @radio-card:update="(val) => form.propertyType = val"
+ />
Default
@@ -57,7 +60,9 @@ const propertyTypeOptions = [
:key="option.value"
:display-name="option.label"
group-name="radioCards1"
- :value="option.value">
+ :model-value="form.propertyType"
+ :value="option.value"
+ @radio-card:update="(val) => form.propertyType = val">
{{ option.label }}
From 8d02e2b25e4545f9a7b9fca6a3ba4ed634487ed9 Mon Sep 17 00:00:00 2001
From: Tommy
Date: Tue, 10 Sep 2024 16:25:51 -0400
Subject: [PATCH 04/26] feat: rewrite of radio-button with native element
---
.../components/es-radio-button-group-new.vue | 61 ++++++++++++
.../components/es-radio-button-new.vue | 57 ++++++++++++
.../components/es-radio-button.vue | 12 +--
.../pages/molecules/radio-button-new.vue | 93 +++++++++++++++++++
es-ds-styles/scss/_custom-forms.scss | 8 +-
5 files changed, 220 insertions(+), 11 deletions(-)
create mode 100644 es-ds-components/components/es-radio-button-group-new.vue
create mode 100644 es-ds-components/components/es-radio-button-new.vue
create mode 100644 es-ds-docs/pages/molecules/radio-button-new.vue
diff --git a/es-ds-components/components/es-radio-button-group-new.vue b/es-ds-components/components/es-radio-button-group-new.vue
new file mode 100644
index 000000000..b7b5ff710
--- /dev/null
+++ b/es-ds-components/components/es-radio-button-group-new.vue
@@ -0,0 +1,61 @@
+
+
+
+
+
+ {{ label }}
+
+
+
+
+
+
diff --git a/es-ds-components/components/es-radio-button-new.vue b/es-ds-components/components/es-radio-button-new.vue
new file mode 100644
index 000000000..4d58f1824
--- /dev/null
+++ b/es-ds-components/components/es-radio-button-new.vue
@@ -0,0 +1,57 @@
+
+
+
+
+
+
+
+ {{ displayName }}
+
+
+
+
diff --git a/es-ds-components/components/es-radio-button.vue b/es-ds-components/components/es-radio-button.vue
index c14e01ec6..ccd86b354 100644
--- a/es-ds-components/components/es-radio-button.vue
+++ b/es-ds-components/components/es-radio-button.vue
@@ -43,12 +43,10 @@ defineEmits([
@focus="$emit('radio-button:focus', (evt: any) => evt)"
@blur="$emit('radio-button:blur', (evt: any) => evt)"
@update:model-value="$emit('radio-button:update', props.value)" />
-
-
- {{ props.displayName }}
-
-
+
+ {{ props.displayName }}
+
diff --git a/es-ds-docs/pages/molecules/radio-button-new.vue b/es-ds-docs/pages/molecules/radio-button-new.vue
new file mode 100644
index 000000000..22cc6628f
--- /dev/null
+++ b/es-ds-docs/pages/molecules/radio-button-new.vue
@@ -0,0 +1,93 @@
+
+
+
+
+
+
Basic Radio Button
+ {{ fruit.name }}
+
+
+
+
Inline
+
+
+
+
+
+
+
Stacked
+
+
+
+
+
+
+
Disabled
+
+
+
+
+
+
+
Using options prop
+
+
selected: {{ test2Selected }}
+
+
+
+
diff --git a/es-ds-styles/scss/_custom-forms.scss b/es-ds-styles/scss/_custom-forms.scss
index 8b795a825..72b1a0ac6 100644
--- a/es-ds-styles/scss/_custom-forms.scss
+++ b/es-ds-styles/scss/_custom-forms.scss
@@ -181,21 +181,21 @@
border-radius: variables.$custom-radio-indicator-border-radius;
}
- .custom-control-input:has(.custom-radio-input:checked) ~ .custom-control-label {
+ .custom-control-input:checked ~ .custom-control-label {
&::before {
background-color: variables.$custom-control-indicator-bg;
}
&::after {
- background-image: functions.escape-svg(variables.$custom-radio-indicator-icon-checked) !important;
+ background-image: functions.escape-svg(variables.$custom-radio-indicator-icon-checked);
}
}
- .custom-control-input:has(.custom-radio-input:disabled:checked) ~ .custom-control-label {
+ .custom-control-input:disabled:checked ~ .custom-control-label {
&::before {
@include gradients.gradient-bg(variables.$custom-control-indicator-checked-disabled-bg);
}
&::after {
- background-image: functions.escape-svg(variables.$custom-radio-indicator-icon-checked-disabled) !important;
+ background-image: functions.escape-svg(variables.$custom-radio-indicator-icon-checked-disabled);
}
}
}
From 2bb4eb671528dda721ea5e7ecc74f83ada7fb126 Mon Sep 17 00:00:00 2001
From: Tommy
Date: Tue, 10 Sep 2024 17:17:37 -0400
Subject: [PATCH 05/26] feat: rewrite without prime button
---
.../components/es-radio-button-group-new.vue | 61 -----------------
.../components/es-radio-button-group.vue | 41 +++++------
.../components/es-radio-button-new.vue | 57 ----------------
.../components/es-radio-button.vue | 68 ++++++++++---------
es-ds-docs/pages/molecules/radio-button.vue | 61 ++++++++---------
5 files changed, 83 insertions(+), 205 deletions(-)
delete mode 100644 es-ds-components/components/es-radio-button-group-new.vue
delete mode 100644 es-ds-components/components/es-radio-button-new.vue
diff --git a/es-ds-components/components/es-radio-button-group-new.vue b/es-ds-components/components/es-radio-button-group-new.vue
deleted file mode 100644
index b7b5ff710..000000000
--- a/es-ds-components/components/es-radio-button-group-new.vue
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-
- {{ label }}
-
-
-
-
-
-
diff --git a/es-ds-components/components/es-radio-button-group.vue b/es-ds-components/components/es-radio-button-group.vue
index 80ce3aa85..d9f37753e 100644
--- a/es-ds-components/components/es-radio-button-group.vue
+++ b/es-ds-components/components/es-radio-button-group.vue
@@ -1,18 +1,11 @@
@@ -43,19 +39,18 @@ const model = defineModel();
tabindex="-1">
{{ label }}
-
-
-
-
+
-
+ :name="name"
+ :value="option.value"
+ :model-value="props.modelValue"
+ :inline="option.inline || false"
+ :display-name="option.text"
+ @update:model-value="$emit('update:model-value', option.value)" />
+
diff --git a/es-ds-components/components/es-radio-button-new.vue b/es-ds-components/components/es-radio-button-new.vue
deleted file mode 100644
index 4d58f1824..000000000
--- a/es-ds-components/components/es-radio-button-new.vue
+++ /dev/null
@@ -1,57 +0,0 @@
-
-
-
-
-
-
-
- {{ displayName }}
-
-
-
-
diff --git a/es-ds-components/components/es-radio-button.vue b/es-ds-components/components/es-radio-button.vue
index ccd86b354..d60d86345 100644
--- a/es-ds-components/components/es-radio-button.vue
+++ b/es-ds-components/components/es-radio-button.vue
@@ -1,52 +1,58 @@
-
-
+ evt)"
- @focus="$emit('radio-button:focus', (evt: any) => evt)"
- @blur="$emit('radio-button:blur', (evt: any) => evt)"
- @update:model-value="$emit('radio-button:update', props.value)" />
+ :checked="isChecked"
+ @click="handleRadioButtonClick"
+ />
- {{ props.displayName }}
+ class="custom-control-label"
+ :for="id"
+ @click="handleRadioButtonClick">
+
+ {{ displayName }}
+
diff --git a/es-ds-docs/pages/molecules/radio-button.vue b/es-ds-docs/pages/molecules/radio-button.vue
index fe3c41b45..9275c127d 100644
--- a/es-ds-docs/pages/molecules/radio-button.vue
+++ b/es-ds-docs/pages/molecules/radio-button.vue
@@ -1,41 +1,34 @@
- evt)"
- @radio-button:blur="$emit('radio-card:blur', (evt: any) => evt)"
- @radio-button:focus="handleFocus"
- @radio-button:update="$emit('radio-card:update', props.value)"
- @click="handleClick"
- />
+
+
+
+ {{ displayName }}
+
+
diff --git a/es-ds-components/components/es-form-radio-cards.vue b/es-ds-components/components/es-form-radio-cards.vue
index d6f238c98..72b1350f4 100644
--- a/es-ds-components/components/es-form-radio-cards.vue
+++ b/es-ds-components/components/es-form-radio-cards.vue
@@ -1,36 +1,81 @@
-
+
+
+
+
+ {{ option.text }}
+
+
+
+
diff --git a/es-ds-components/components/es-radio-button-group.vue b/es-ds-components/components/es-radio-button-group.vue
index d9f37753e..810e61a67 100644
--- a/es-ds-components/components/es-radio-button-group.vue
+++ b/es-ds-components/components/es-radio-button-group.vue
@@ -5,7 +5,7 @@ interface IOptions {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
value: any;
disabled?: boolean;
- inline?: boolean;
+ // inline?: boolean;
}
interface IProps {
@@ -45,10 +45,10 @@ defineEmits([
:id="option.id"
:key="option.value"
:disabled="option?.disabled || false"
- :name="name"
+ :name="props.name"
:value="option.value"
:model-value="props.modelValue"
- :inline="option.inline || false"
+ :inline="props.inline || false"
:display-name="option.text"
@update:model-value="$emit('update:model-value', option.value)" />
diff --git a/es-ds-docs/pages/molecules/radio-cards.vue b/es-ds-docs/pages/molecules/radio-cards.vue
index d48839837..aaf7c7ae8 100644
--- a/es-ds-docs/pages/molecules/radio-cards.vue
+++ b/es-ds-docs/pages/molecules/radio-cards.vue
@@ -1,10 +1,5 @@
@@ -35,11 +34,11 @@ const propertyTypeOptions = [
Radio Card
form.propertyType = val"
- />
+ >{{ propertyTypeOptions[0].label }}
Default
@@ -52,19 +51,16 @@ const propertyTypeOptions = [
From 90f46ae7a9c9fa2d7a13e4cfc4a2bd9d6dbdc812 Mon Sep 17 00:00:00 2001
From: Tommy
Date: Wed, 11 Sep 2024 13:33:03 -0400
Subject: [PATCH 07/26] feat: rewrite radio cards
---
.../components/es-form-radio-cards.vue | 74 ++++++++++---------
.../components/es-radio-button-group.vue | 4 +-
2 files changed, 43 insertions(+), 35 deletions(-)
diff --git a/es-ds-components/components/es-form-radio-cards.vue b/es-ds-components/components/es-form-radio-cards.vue
index 72b1350f4..b5e4f262c 100644
--- a/es-ds-components/components/es-form-radio-cards.vue
+++ b/es-ds-components/components/es-form-radio-cards.vue
@@ -45,37 +45,45 @@ function handleUpdate(value: any) {
-
-
-
-
-
- {{ option.text }}
-
-
-
-
-
+
+
+
+ {{ props.label }}
+
+
+
+
+
+
+
+ {{ option.text }}
+
+
+
+
+
+
diff --git a/es-ds-components/components/es-radio-button-group.vue b/es-ds-components/components/es-radio-button-group.vue
index 810e61a67..f8e275e5a 100644
--- a/es-ds-components/components/es-radio-button-group.vue
+++ b/es-ds-components/components/es-radio-button-group.vue
@@ -34,10 +34,10 @@ defineEmits([
:id="id"
class="form-group">
- {{ label }}
+ {{ props.label }}
Date: Wed, 11 Sep 2024 17:01:26 -0400
Subject: [PATCH 08/26] feat: fleshing out radio card docs
---
.../components/es-form-radio-cards.vue | 4 +-
es-ds-docs/pages/molecules/radio-cards.vue | 76 +++++++++++++++++++
2 files changed, 79 insertions(+), 1 deletion(-)
diff --git a/es-ds-components/components/es-form-radio-cards.vue b/es-ds-components/components/es-form-radio-cards.vue
index b5e4f262c..89ed34895 100644
--- a/es-ds-components/components/es-form-radio-cards.vue
+++ b/es-ds-components/components/es-form-radio-cards.vue
@@ -60,7 +60,9 @@ function handleUpdate(value: any) {
:id="`${props.id}-radiogroup`"
role="radiogroup"
tabindex="-1"
- class="es-form-radio-cards d-flex justify-content-center ">
+ class="es-form-radio-cards d-flex justify-content-center"
+ :class="{ 'has-icon': props.hasIcon }"
+ >
+
+ Custom card styling
+
+
+ This example demonstrates customizing the content, spacing, and typography of the cards,
+ as well as changing the layout based on the breakpoint.
+
+
+
+
+ Selection:
+ {{ form.storageReason || '[none]' }}
+
+
+
From cfc529ed940feb9afc9aa7c4752ba23e7c806800 Mon Sep 17 00:00:00 2001
From: Tommy
Date: Thu, 12 Sep 2024 11:13:15 -0400
Subject: [PATCH 09/26] feat: add detach label example
---
.../components/es-form-radio-cards.vue | 2 +-
es-ds-docs/pages/molecules/radio-cards.vue | 54 +++++++++++++++++++
2 files changed, 55 insertions(+), 1 deletion(-)
diff --git a/es-ds-components/components/es-form-radio-cards.vue b/es-ds-components/components/es-form-radio-cards.vue
index 89ed34895..402488908 100644
--- a/es-ds-components/components/es-form-radio-cards.vue
+++ b/es-ds-components/components/es-form-radio-cards.vue
@@ -60,7 +60,7 @@ function handleUpdate(value: any) {
:id="`${props.id}-radiogroup`"
role="radiogroup"
tabindex="-1"
- class="es-form-radio-cards d-flex justify-content-center"
+ class="es-form-radio-cards d-flex justify-content-center btn-group-vertical"
:class="{ 'has-icon': props.hasIcon }"
>
diff --git a/es-ds-docs/pages/molecules/radio-cards.vue b/es-ds-docs/pages/molecules/radio-cards.vue
index 2db9ad67b..384299a6d 100644
--- a/es-ds-docs/pages/molecules/radio-cards.vue
+++ b/es-ds-docs/pages/molecules/radio-cards.vue
@@ -37,6 +37,14 @@ const storageReasonOptions: { [key:string]: any }[] = [
},
]
+const installTimelineLabel = 'What’s your timeline for installing heat pumps?';
+const installTimelineOptions = [
+ { label: 'ASAP', value: 'ASAP' },
+ { label: 'Within the next 2-4 weeks', value: '2-4 weeks' },
+ { label: 'Within the next 2-4 months', value: '2-4 months' },
+ { label: '5+ months', value: '5+ months' },
+];
+
function handleSubmit() {
console.log('handleSubmit');
}
@@ -145,5 +153,51 @@ function handleSubmit() {
+
+ Detached label
+
+
+ This example demonstrates a case where more control is needed over the position of the field
+ label on the desktop breakpoint, so it is rendered separately of the radio cards component.
+ We do still need to pass the label text into the radio cards component for accessibility
+ purposes, but hide it visually by passing in a prop.
+
+
+
+
+ Selection:
+ {{ form.installTimeline || '[none]' }}
+
+
+
From 5e025002412c7fe626a407a82b23da5606688c92 Mon Sep 17 00:00:00 2001
From: Tommy
Date: Thu, 12 Sep 2024 13:26:02 -0400
Subject: [PATCH 10/26] feat: add disabled styling
---
.../components/es-form-radio-card.vue | 2 +-
.../components/es-form-radio-cards.vue | 2 +-
es-ds-docs/pages/molecules/radio-cards.vue | 108 ++++++++++++++++--
.../scss/vue/components/_radio-cards.scss | 10 ++
4 files changed, 113 insertions(+), 9 deletions(-)
diff --git a/es-ds-components/components/es-form-radio-card.vue b/es-ds-components/components/es-form-radio-card.vue
index 7daef3e5c..0ab0df824 100644
--- a/es-ds-components/components/es-form-radio-card.vue
+++ b/es-ds-components/components/es-form-radio-card.vue
@@ -34,7 +34,7 @@ const isChecked = computed(() => props.value === model.value);
(), {
inline: false,
modelValue: undefined,
hasIcon: false,
- labelClass: 'font-size-h1 font-weight-bolder mb-200 pb-0 text-dark',
+ labelClass: 'font-size-h3',
labelSrOnly: false,
});
diff --git a/es-ds-docs/pages/molecules/radio-cards.vue b/es-ds-docs/pages/molecules/radio-cards.vue
index 384299a6d..8b921ab07 100644
--- a/es-ds-docs/pages/molecules/radio-cards.vue
+++ b/es-ds-docs/pages/molecules/radio-cards.vue
@@ -16,7 +16,7 @@ const propertyTypeOptions = [
const storageReasonOptions: { [key:string]: any }[] = [
{
title: 'Back up power',
- description: 'Run appliances during a power outage',
+ description: 'Run appliances during a power outage, with backup power',
icon: 'IconSettingsVertical',
component: resolveComponent('icon-settings-vertical'),
value: 'Back up power',
@@ -45,10 +45,58 @@ const installTimelineOptions = [
{ label: '5+ months', value: '5+ months' },
];
+const test2Options = ref([
+ { text: 'Toggle this custom radio', value: 'first', id: 'idFirst' },
+ { text: 'Or toggle this other custom radio', value: 'second', id: 'idSecond' },
+ { text: 'This one is Disabled', value: 'third', disabled: true, id: 'idThird' },
+ { text: 'This is the 4th radio', value: { fourth: 4 }, id: 'idFourth' },
+]);
+const test2Selected = ref('first');
+
+const { $prism } = useNuxtApp();
+const componentCodeRadioCard = ref('');
+const componentCodeRadioCards = ref('');
+const docCode = ref('');
+if ($prism) {
+ /* eslint-disable import/no-webpack-loader-syntax, import/no-self-import */
+ const componentCodeRadioCardSource = await import('@energysage/es-ds-components/components/es-form-radio-card.vue?raw');
+ const componentCodeRadioCardsSource = await import ('@energysage/es-ds-components/components/es-form-radio-cards.vue?raw');
+ const docSource = await import('./radio-cards.vue?raw');
+ /* eslint-enable import/no-webpack-loader-syntax, import/no-self-import */
+
+ componentCodeRadioCard.value = $prism.normalizeCode(componentCodeRadioCardSource.default);
+ componentCodeRadioCards.value = $prism.normalizeCode(componentCodeRadioCardsSource.default);
+ docCode.value = $prism.normalizeCode(docSource.default);
+ $prism.highlight();
+}
+
function handleSubmit() {
console.log('handleSubmit');
}
+// Name, Type, Default, Description
+const propTableRowsRadioCard = [
+ ['id', 'String', 'n/a', 'Required.'],
+ ['name', 'String', 'n/a', 'Required. Name of radio group'],
+ ['value', 'Any', 'n/a', 'Required. Value of radio button'],
+ ['disabled', 'Boolean', 'false', 'Optional. When present, it specifies that the radio button should be disabled.'],
+ ['inline', 'Boolean', 'false', 'Optional. When present, it specifies that the radio buttons should be displayed inline.'],
+ ['displayName', 'String', '', 'Optional. Required, if not using the default slot. The text to display next to the radio button.'],
+ ['v-model', 'Any', 'n/a', 'Required.'],
+];
+
+const propTableRowsRadioCards = [
+ ['id', 'String', 'n/a', 'Required.'],
+ ['label', 'String', 'n/a', 'Required.'],
+ ['name', 'String', `''`, 'Optional.'], // TODO: should this be required?
+ ['options', 'Array', 'undefined', 'Optional. Alternative to creating an es-form-radio-card in the default slot.'],
+ ['inline', 'Boolean', 'false', 'Optional.'], // TODO: example of this?
+ ['modelValue', 'Any', 'undefined', 'Optional. Required, if using the options prop'],
+ ['hasIcon', 'Boolean', 'false', 'Optional. Adds a "has-icon" class to the radiogroup'],
+ ['labelClass', 'String', `''`, 'Optional. Apply class to the input label. Defaults to "font-size-h3"'],
+ ['labelSrOnly', 'Boolean', 'false', 'Optional. Applies an `sr-only` class to the label'],
+]
+
@@ -66,12 +114,14 @@ function handleSubmit() {
Radio Card
- {{ propertyTypeOptions[0].label }}
+
+ {{ propertyTypeOptions[0].label }}
+
Default
@@ -199,5 +249,49 @@ function handleSubmit() {
+
+ Passing options
+
+
+
+
+ Selection:
+ {{ test2Selected || '[none]' }}
+
+
+
+
+
EsFormRadioCard props
+
+
+
+
+
EsFormRadioCards props
+
+
+
+
+
+
+
+
+
diff --git a/es-ds-styles/scss/vue/components/_radio-cards.scss b/es-ds-styles/scss/vue/components/_radio-cards.scss
index c1147a314..47e43dfa3 100644
--- a/es-ds-styles/scss/vue/components/_radio-cards.scss
+++ b/es-ds-styles/scss/vue/components/_radio-cards.scss
@@ -148,6 +148,16 @@ $inner-circle-translate-y-from-top-desktop: $inner-circle-translate-x-from-left-
transform: variables.$btn-active-transform;
}
+ &.disabled {
+ background: variables.$gray-50;
+ border-color: variables.$gray-200;
+ color: variables.$gray-500;
+
+ &::before {
+ border: 2.5px solid variables.$gray-500;
+ }
+ }
+
input {
/**
* hide the radio button input elements the same way bootstrap vue does.
From b8d694d0aebbe3493619a335a07db12d1abd8516 Mon Sep 17 00:00:00 2001
From: Tommy
Date: Thu, 12 Sep 2024 13:53:22 -0400
Subject: [PATCH 11/26] chore: apply formatting
---
.../components/es-form-radio-card.vue | 12 +--
.../components/es-form-radio-cards.vue | 18 ++--
.../components/es-radio-button-group.vue | 4 +-
.../components/es-radio-button.vue | 9 +-
es-ds-docs/components/ds-molecules-list.vue | 88 +++++--------------
es-ds-docs/pages/molecules/radio-button.vue | 17 ++--
es-ds-docs/pages/molecules/radio-cards.vue | 87 +++++++++---------
7 files changed, 88 insertions(+), 147 deletions(-)
diff --git a/es-ds-components/components/es-form-radio-card.vue b/es-ds-components/components/es-form-radio-card.vue
index 0ab0df824..2c0cae733 100644
--- a/es-ds-components/components/es-form-radio-card.vue
+++ b/es-ds-components/components/es-form-radio-card.vue
@@ -17,9 +17,7 @@ const props = withDefaults(defineProps(), {
// Need to define the implicit emit from v-model, so that it can also get fired
// from the label clicks
-const emit = defineEmits([
- 'update:modelValue',
-])
+const emit = defineEmits(['update:modelValue']);
function handleRadioButtonClick() {
if (!props.disabled) {
@@ -34,9 +32,8 @@ const isChecked = computed(() => props.value === model.value);
+ :class="{ active: isChecked, disabled: props.disabled }"
+ @click="handleRadioButtonClick">
props.value === model.value);
name="props.name"
:value="props.value"
:checked="isChecked"
- @click="handleRadioButtonClick"
- />
+ @click="handleRadioButtonClick" />
{{ displayName }}
diff --git a/es-ds-components/components/es-form-radio-cards.vue b/es-ds-components/components/es-form-radio-cards.vue
index 6388e0025..abedbdcb6 100644
--- a/es-ds-components/components/es-form-radio-cards.vue
+++ b/es-ds-components/components/es-form-radio-cards.vue
@@ -16,11 +16,9 @@ interface IProps {
inline?: boolean;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
modelValue?: any;
-
- // TODO
hasIcon?: boolean;
- labelClass?: string,
- labelSrOnly?: boolean,
+ labelClass?: string;
+ labelSrOnly?: boolean;
}
const props = withDefaults(defineProps(), {
name: '',
@@ -32,16 +30,12 @@ const props = withDefaults(defineProps(), {
labelSrOnly: false,
});
-const emit = defineEmits([
- 'update:model-value',
-])
+const emit = defineEmits(['update:model-value']);
// eslint-disable-next-line @typescript-eslint/no-unused-vars
function handleUpdate(value: any) {
- console.log("radio-cards got value: ", value);
emit('update:model-value', value);
}
-// @update:model-value="$emit('update:model-value', option.value)"
@@ -61,8 +55,7 @@ function handleUpdate(value: any) {
role="radiogroup"
tabindex="-1"
class="es-form-radio-cards d-flex justify-content-center btn-group-vertical"
- :class="{ 'has-icon': props.hasIcon }"
- >
+ :class="{ 'has-icon': props.hasIcon }">
+ }">
{{ option.text }}
diff --git a/es-ds-components/components/es-radio-button-group.vue b/es-ds-components/components/es-radio-button-group.vue
index f8e275e5a..247a672c4 100644
--- a/es-ds-components/components/es-radio-button-group.vue
+++ b/es-ds-components/components/es-radio-button-group.vue
@@ -24,9 +24,7 @@ const props = withDefaults(defineProps(), {
modelValue: undefined,
});
-defineEmits([
- 'update:model-value',
-])
+defineEmits(['update:model-value']);
diff --git a/es-ds-components/components/es-radio-button.vue b/es-ds-components/components/es-radio-button.vue
index d60d86345..ebac52a23 100644
--- a/es-ds-components/components/es-radio-button.vue
+++ b/es-ds-components/components/es-radio-button.vue
@@ -17,9 +17,7 @@ const props = withDefaults(defineProps(), {
// Need to define the implicit emit from v-model, so that it can also get fired
// from the label clicks
-const emit = defineEmits([
- 'update:modelValue',
-])
+const emit = defineEmits(['update:modelValue']);
function handleRadioButtonClick() {
if (!props.disabled) {
emit('update:modelValue', props.value);
@@ -34,7 +32,7 @@ const isChecked = computed(() => props.value === model.value);
+ :class="{ 'custom-control-inline': props.inline }">
props.value === model.value);
class="custom-control-input"
:value="props.value"
:checked="isChecked"
- @click="handleRadioButtonClick"
- />
+ @click="handleRadioButtonClick" />
-
- Accordion
-
+ Accordion
-
- Badge
-
+ Badge
-
- Breadcrumbs
-
+ Breadcrumbs
-
- Button
-
+ Button
-
- Card
-
+ Card
-
- Checkbox
-
+ Checkbox
-
- Collapse
-
+ Collapse
-
- Data table
-
+ Data table
-
- Data table simple
-
+ Data table simple
-
- File input
-
+ File input
-
- Form message
-
+ Form message
-
- Modal
-
+ Modal
-
- Pagination
-
+ Pagination
-
- Popover
-
+ Popover
-
- Progress
-
+ Progress
-
- Progress circle
-
+ Progress circle
-
- Radio button
-
+ Radio button
-
- Radio cards
-
+ Radio cards
-
- Rating
-
+ Rating
-
- Support
-
+ Support
-
- Tabs
-
+ Tabs
-
- Text input
-
+ Text input
View more
diff --git a/es-ds-docs/pages/molecules/radio-button.vue b/es-ds-docs/pages/molecules/radio-button.vue
index 9275c127d..cc61b1704 100644
--- a/es-ds-docs/pages/molecules/radio-button.vue
+++ b/es-ds-docs/pages/molecules/radio-button.vue
@@ -15,12 +15,17 @@ const test2Selected = ref('first');
// Name, Type, Default, Description
const radioButtonPropTableRows = [
- ['name', 'String', 'n/a', 'Required. Name of radio group'],
- ['value', 'Any', 'n/a', 'Required. Value of radio button'],
+ ['name', 'String', 'n/a', 'Required. Name of radio group'],
+ ['value', 'Any', 'n/a', 'Required. Value of radio button'],
['id', 'String', 'n/a', 'Required.'],
['disabled', 'Boolean', 'false', 'When present, it specifies that the radio button should be disabled.'],
['inline', 'Boolean', 'false', 'When present, it specifies that the radio buttons should be displayed inline.'],
- ['displayName', 'String', '', 'Required, if not using the default slot. The text to display next to the radio button.'],
+ [
+ 'displayName',
+ 'String',
+ '',
+ 'Required, if not using the default slot. The text to display next to the radio button.',
+ ],
['v-model', 'Any', 'n/a', 'Optional. The v-model directive binds the radio button to a data property.'],
];
@@ -43,14 +48,14 @@ const radioButtonComponentCode = ref('');
const radioButtonGroupComponentCode = ref('');
const docCode = ref('');
if ($prism) {
- /* eslint-disable import/no-webpack-loader-syntax, import/no-self-import */
+ /* eslint-disable import/no-webpack-loader-syntax, import/no-self-import, import/no-unresolved */
const radioButtonComponentSource = await import('@energysage/es-ds-components/components/es-radio-button.vue?raw');
// eslint-disable-next-line max-len
const radioButtonGroupComponentSource = await import(
'@energysage/es-ds-components/components/es-radio-button-group.vue?raw'
);
const docSource = await import('./radio-button.vue?raw');
- /* eslint-enable import/no-webpack-loader-syntax, import/no-self-import */
+ /* eslint-enable import/no-webpack-loader-syntax, import/no-self-import, import/no-unresolved */
radioButtonComponentCode.value = $prism.normalizeCode(radioButtonComponentSource.default);
radioButtonGroupComponentCode.value = $prism.normalizeCode(radioButtonGroupComponentSource.default);
@@ -103,7 +108,7 @@ if ($prism) {
-
+
Disabled
const form = ref({
installTimeline: '',
@@ -13,7 +12,7 @@ const propertyTypeOptions = [
];
// eslint-disable-next-line @typescript-eslint/no-explicit-any
-const storageReasonOptions: { [key:string]: any }[] = [
+const storageReasonOptions: { [key: string]: any }[] = [
{
title: 'Back up power',
description: 'Run appliances during a power outage, with backup power',
@@ -35,7 +34,7 @@ const storageReasonOptions: { [key:string]: any }[] = [
component: resolveComponent('icon-person-check'),
value: 'Self supply',
},
-]
+];
const installTimelineLabel = 'What’s your timeline for installing heat pumps?';
const installTimelineOptions = [
@@ -59,8 +58,12 @@ const componentCodeRadioCards = ref('');
const docCode = ref('');
if ($prism) {
/* eslint-disable import/no-webpack-loader-syntax, import/no-self-import */
- const componentCodeRadioCardSource = await import('@energysage/es-ds-components/components/es-form-radio-card.vue?raw');
- const componentCodeRadioCardsSource = await import ('@energysage/es-ds-components/components/es-form-radio-cards.vue?raw');
+ const componentCodeRadioCardSource = await import(
+ '@energysage/es-ds-components/components/es-form-radio-card.vue?raw'
+ );
+ const componentCodeRadioCardsSource = await import(
+ '@energysage/es-ds-components/components/es-form-radio-cards.vue?raw'
+ );
const docSource = await import('./radio-cards.vue?raw');
/* eslint-enable import/no-webpack-loader-syntax, import/no-self-import */
@@ -71,17 +74,28 @@ if ($prism) {
}
function handleSubmit() {
+ // eslint-disable-next-line no-console
console.log('handleSubmit');
}
// Name, Type, Default, Description
const propTableRowsRadioCard = [
['id', 'String', 'n/a', 'Required.'],
- ['name', 'String', 'n/a', 'Required. Name of radio group'],
- ['value', 'Any', 'n/a', 'Required. Value of radio button'],
+ ['name', 'String', 'n/a', 'Required. Name of radio group'],
+ ['value', 'Any', 'n/a', 'Required. Value of radio button'],
['disabled', 'Boolean', 'false', 'Optional. When present, it specifies that the radio button should be disabled.'],
- ['inline', 'Boolean', 'false', 'Optional. When present, it specifies that the radio buttons should be displayed inline.'],
- ['displayName', 'String', '', 'Optional. Required, if not using the default slot. The text to display next to the radio button.'],
+ [
+ 'inline',
+ 'Boolean',
+ 'false',
+ 'Optional. When present, it specifies that the radio buttons should be displayed inline.',
+ ],
+ [
+ 'displayName',
+ 'String',
+ '',
+ 'Optional. Required, if not using the default slot. The text to display next to the radio button.',
+ ],
['v-model', 'Any', 'n/a', 'Required.'],
];
@@ -95,40 +109,31 @@ const propTableRowsRadioCards = [
['hasIcon', 'Boolean', 'false', 'Optional. Adds a "has-icon" class to the radiogroup'],
['labelClass', 'String', `''`, 'Optional. Apply class to the input label. Defaults to "font-size-h3"'],
['labelSrOnly', 'Boolean', 'false', 'Optional. Applies an `sr-only` class to the label'],
-]
-
+];
-
- Radio cards
-
+
Radio cards
- Extended from
- prime-vue form-radio
-
+ Extended from prime-vue form-radio
-
- Radio Card
-
+
Radio Card
{{ propertyTypeOptions[0].label }}
+ >{{ propertyTypeOptions[0].label }}
-
- Default
-
+
Default
- Responsive font sizing is applied by default. This means the text will be smaller on
- mobile and larger on desktop.
+ Responsive font sizing is applied by default. This means the text will be smaller on mobile and larger on
+ desktop.
-
- Custom card styling
-
+
Custom card styling
- This example demonstrates customizing the content, spacing, and typography of the cards,
- as well as changing the layout based on the breakpoint.
+ This example demonstrates customizing the content, spacing, and typography of the cards, as well as
+ changing the layout based on the breakpoint.
-
- Detached label
-
+
Detached label
- This example demonstrates a case where more control is needed over the position of the field
- label on the desktop breakpoint, so it is rendered separately of the radio cards component.
- We do still need to pass the label text into the radio cards component for accessibility
- purposes, but hide it visually by passing in a prop.
+ This example demonstrates a case where more control is needed over the position of the field label on the
+ desktop breakpoint, so it is rendered separately of the radio cards component. We do still need to pass the
+ label text into the radio cards component for accessibility purposes, but hide it visually by passing in a
+ prop.
-
- Passing options
-
+
Passing options
Selection:
@@ -292,6 +290,5 @@ const propTableRowsRadioCards = [
doc-title="Radio card & radio cards documentation"
:doc-code="docCode"
doc-source="es-ds-docs/pages/molecules/radio-cards.vue" />
-
From abaceeefb3536f2c27293ce1d80c4a070db2cb3a Mon Sep 17 00:00:00 2001
From: Tommy
Date: Thu, 12 Sep 2024 13:58:47 -0400
Subject: [PATCH 12/26] chore: apply formatting
---
es-ds-components/components/es-form-radio-cards.vue | 2 +-
es-ds-docs/pages/molecules/radio-button-new.vue | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/es-ds-components/components/es-form-radio-cards.vue b/es-ds-components/components/es-form-radio-cards.vue
index abedbdcb6..79e899d1a 100644
--- a/es-ds-components/components/es-form-radio-cards.vue
+++ b/es-ds-components/components/es-form-radio-cards.vue
@@ -32,7 +32,7 @@ const props = withDefaults(defineProps(), {
const emit = defineEmits(['update:model-value']);
-// eslint-disable-next-line @typescript-eslint/no-unused-vars
+// eslint-disable-next-line @typescript-eslint/no-explicit-any
function handleUpdate(value: any) {
emit('update:model-value', value);
}
diff --git a/es-ds-docs/pages/molecules/radio-button-new.vue b/es-ds-docs/pages/molecules/radio-button-new.vue
index 22cc6628f..e0c44c316 100644
--- a/es-ds-docs/pages/molecules/radio-button-new.vue
+++ b/es-ds-docs/pages/molecules/radio-button-new.vue
@@ -25,7 +25,8 @@ const test2Selected = ref('first');
v-model="selectedFruit"
name="basic"
:value="fruit.key"
- >{{ fruit.name }}
+ >{{ fruit.name }}
@@ -88,6 +89,5 @@ const test2Selected = ref('first');
name="radioGroupUsingOptionsProp" />
selected: {{ test2Selected }}
-
From ae7a6f7d55d364220fcbb21f83c9a0d7c889c23e Mon Sep 17 00:00:00 2001
From: Tommy
Date: Fri, 13 Sep 2024 16:27:37 -0400
Subject: [PATCH 13/26] chore: tweaks after merge
---
es-ds-docs/pages/molecules/radio-button.vue | 20 +++++++++++---------
es-ds-docs/pages/molecules/radio-cards.vue | 2 +-
2 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/es-ds-docs/pages/molecules/radio-button.vue b/es-ds-docs/pages/molecules/radio-button.vue
index 4bddc5cee..b984c3a6f 100644
--- a/es-ds-docs/pages/molecules/radio-button.vue
+++ b/es-ds-docs/pages/molecules/radio-button.vue
@@ -47,15 +47,17 @@ const { $prism } = useNuxtApp();
const radioButtonComponentCode = ref('');
const radioButtonGroupComponentCode = ref('');
const docCode = ref('');
-if ($prism) {
- /* eslint-disable import/no-webpack-loader-syntax, import/no-self-import, import/no-unresolved */
- const radioButtonComponentSource = await import('@energysage/es-ds-components/components/es-radio-button.vue?raw');
- // eslint-disable-next-line max-len
- const radioButtonGroupComponentSource = await import(
- '@energysage/es-ds-components/components/es-radio-button-group.vue?raw'
- );
- const docSource = await import('./radio-button.vue?raw');
- /* eslint-enable import/no-webpack-loader-syntax, import/no-self-import, import/no-unresolved */
+
+onMounted(async () => {
+ if ($prism) {
+ /* eslint-disable import/no-webpack-loader-syntax, import/no-self-import, import/no-unresolved */
+ const radioButtonComponentSource = await import('@energysage/es-ds-components/components/es-radio-button.vue?raw');
+ // eslint-disable-next-line max-len
+ const radioButtonGroupComponentSource = await import(
+ '@energysage/es-ds-components/components/es-radio-button-group.vue?raw'
+ );
+ const docSource = await import('./radio-button.vue?raw');
+ /* eslint-enable import/no-webpack-loader-syntax, import/no-self-import, import/no-unresolved */
radioButtonComponentCode.value = $prism.normalizeCode(radioButtonComponentSource.default);
radioButtonGroupComponentCode.value = $prism.normalizeCode(radioButtonGroupComponentSource.default);
diff --git a/es-ds-docs/pages/molecules/radio-cards.vue b/es-ds-docs/pages/molecules/radio-cards.vue
index c26c953f5..fdb5d1941 100644
--- a/es-ds-docs/pages/molecules/radio-cards.vue
+++ b/es-ds-docs/pages/molecules/radio-cards.vue
@@ -93,7 +93,7 @@ const propTableRowsRadioCard = [
[
'displayName',
'String',
- '',
+ `''`,
'Optional. Required, if not using the default slot. The text to display next to the radio button.',
],
['v-model', 'Any', 'n/a', 'Required.'],
From 16436725bcf41bb7474a314438134c67da44c0d7 Mon Sep 17 00:00:00 2001
From: Tommy
Date: Fri, 13 Sep 2024 16:29:56 -0400
Subject: [PATCH 14/26] chore: formatting
---
es-ds-docs/pages/molecules/radio-button.vue | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/es-ds-docs/pages/molecules/radio-button.vue b/es-ds-docs/pages/molecules/radio-button.vue
index b984c3a6f..148738543 100644
--- a/es-ds-docs/pages/molecules/radio-button.vue
+++ b/es-ds-docs/pages/molecules/radio-button.vue
@@ -51,7 +51,9 @@ const docCode = ref('');
onMounted(async () => {
if ($prism) {
/* eslint-disable import/no-webpack-loader-syntax, import/no-self-import, import/no-unresolved */
- const radioButtonComponentSource = await import('@energysage/es-ds-components/components/es-radio-button.vue?raw');
+ const radioButtonComponentSource = await import(
+ '@energysage/es-ds-components/components/es-radio-button.vue?raw'
+ );
// eslint-disable-next-line max-len
const radioButtonGroupComponentSource = await import(
'@energysage/es-ds-components/components/es-radio-button-group.vue?raw'
From f02d866ef296a27d695bf435299cb83cc5593d17 Mon Sep 17 00:00:00 2001
From: Tommy
Date: Mon, 16 Sep 2024 21:32:55 -0400
Subject: [PATCH 15/26] chore: interface tweak
---
es-ds-components/components/es-form-radio-cards.vue | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/es-ds-components/components/es-form-radio-cards.vue b/es-ds-components/components/es-form-radio-cards.vue
index 79e899d1a..185e3c367 100644
--- a/es-ds-components/components/es-form-radio-cards.vue
+++ b/es-ds-components/components/es-form-radio-cards.vue
@@ -1,5 +1,5 @@
diff --git a/es-ds-docs/pages/molecules/radio-button-new.vue b/es-ds-docs/pages/molecules/radio-button-new.vue
deleted file mode 100644
index e0c44c316..000000000
--- a/es-ds-docs/pages/molecules/radio-button-new.vue
+++ /dev/null
@@ -1,93 +0,0 @@
-
-
-
-
-
-
Basic Radio Button
- {{ fruit.name }}
-
-
-
-
Inline
-
-
-
-
-
-
-
Stacked
-
-
-
-
-
-
-
Disabled
-
-
-
-
-
-
-
Using options prop
-
-
selected: {{ test2Selected }}
-
-
-
diff --git a/es-ds-docs/pages/molecules/radio-button.vue b/es-ds-docs/pages/molecules/radio-button.vue
index 148738543..8d39ae52f 100644
--- a/es-ds-docs/pages/molecules/radio-button.vue
+++ b/es-ds-docs/pages/molecules/radio-button.vue
@@ -50,7 +50,7 @@ const docCode = ref('');
onMounted(async () => {
if ($prism) {
- /* eslint-disable import/no-webpack-loader-syntax, import/no-self-import, import/no-unresolved */
+ /* eslint-disable import/no-self-import */
const radioButtonComponentSource = await import(
'@energysage/es-ds-components/components/es-radio-button.vue?raw'
);
@@ -59,7 +59,7 @@ onMounted(async () => {
'@energysage/es-ds-components/components/es-radio-button-group.vue?raw'
);
const docSource = await import('./radio-button.vue?raw');
- /* eslint-enable import/no-webpack-loader-syntax, import/no-self-import, import/no-unresolved */
+ /* eslint-enable import/no-self-import */
radioButtonComponentCode.value = $prism.normalizeCode(radioButtonComponentSource.default);
radioButtonGroupComponentCode.value = $prism.normalizeCode(radioButtonGroupComponentSource.default);
@@ -71,14 +71,7 @@ onMounted(async () => {
-
- Uses
-
- PrimeVue RadioButton
-
-
+
Radio button
Inline
diff --git a/es-ds-docs/pages/molecules/radio-cards.vue b/es-ds-docs/pages/molecules/radio-cards.vue
index fdb5d1941..9fbd76329 100644
--- a/es-ds-docs/pages/molecules/radio-cards.vue
+++ b/es-ds-docs/pages/molecules/radio-cards.vue
@@ -56,22 +56,25 @@ const { $prism } = useNuxtApp();
const componentCodeRadioCard = ref('');
const componentCodeRadioCards = ref('');
const docCode = ref('');
-if ($prism) {
- /* eslint-disable import/no-webpack-loader-syntax, import/no-self-import */
- const componentCodeRadioCardSource = await import(
- '@energysage/es-ds-components/components/es-form-radio-card.vue?raw'
- );
- const componentCodeRadioCardsSource = await import(
- '@energysage/es-ds-components/components/es-form-radio-cards.vue?raw'
- );
- const docSource = await import('./radio-cards.vue?raw');
- /* eslint-enable import/no-webpack-loader-syntax, import/no-self-import */
- componentCodeRadioCard.value = $prism.normalizeCode(componentCodeRadioCardSource.default);
- componentCodeRadioCards.value = $prism.normalizeCode(componentCodeRadioCardsSource.default);
- docCode.value = $prism.normalizeCode(docSource.default);
- $prism.highlight();
-}
+onMounted(async () => {
+ if ($prism) {
+ /* eslint-disable import/no-self-import */
+ const componentCodeRadioCardSource = await import(
+ '@energysage/es-ds-components/components/es-form-radio-card.vue?raw'
+ );
+ const componentCodeRadioCardsSource = await import(
+ '@energysage/es-ds-components/components/es-form-radio-cards.vue?raw'
+ );
+ const docSource = await import('./radio-cards.vue?raw');
+ /* eslint-enable import/no-self-import */
+
+ componentCodeRadioCard.value = $prism.normalizeCode(componentCodeRadioCardSource.default);
+ componentCodeRadioCards.value = $prism.normalizeCode(componentCodeRadioCardsSource.default);
+ docCode.value = $prism.normalizeCode(docSource.default);
+ $prism.highlight();
+ }
+})
function handleSubmit() {
// eslint-disable-next-line no-console
@@ -115,11 +118,9 @@ const propTableRowsRadioCards = [
Radio cards
-
- Extended from prime-vue form-radio
-
-
Radio Card
+
Radio card
+
Date: Mon, 16 Sep 2024 22:07:47 -0400
Subject: [PATCH 17/26] feat: add migration docs
---
es-ds-docs/pages/molecules/radio-cards.vue | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/es-ds-docs/pages/molecules/radio-cards.vue b/es-ds-docs/pages/molecules/radio-cards.vue
index 9fbd76329..61be309a7 100644
--- a/es-ds-docs/pages/molecules/radio-cards.vue
+++ b/es-ds-docs/pages/molecules/radio-cards.vue
@@ -277,6 +277,27 @@ const propTableRowsRadioCards = [
+
+ Migrating from ESDS 2.0 form radio cards
+
+
+ The previous
+
+ radio card
+ and radio card group components were based on
+
+ bootstrap-vue
+ 's implementation.
+
+
+ Going forward the v-model
should be on the radio card group
+ component when passing in the options
prop.
+
+
+ When using the radio card group's default slot
+ the v-model
should be on the radio card components within that slot.
+
+
Date: Mon, 16 Sep 2024 22:11:24 -0400
Subject: [PATCH 18/26] chore: re-order props
---
es-ds-docs/pages/molecules/radio-button.vue | 18 +++++++++---------
es-ds-docs/pages/molecules/radio-cards.vue | 18 +++++++++---------
2 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/es-ds-docs/pages/molecules/radio-button.vue b/es-ds-docs/pages/molecules/radio-button.vue
index 8d39ae52f..94cc77959 100644
--- a/es-ds-docs/pages/molecules/radio-button.vue
+++ b/es-ds-docs/pages/molecules/radio-button.vue
@@ -134,26 +134,26 @@ onMounted(async () => {
selected: {{ test2Selected }}
-
-
EsRadioButton props
-
-
-
EsRadioButtonGroup props
-
+
+
EsRadioButton props
+
+
+
+
-
EsFormRadioCard props
-
+ EsFormRadioCards props
+
-
EsFormRadioCards props
-
+ EsFormRadioCard props
+
@@ -298,16 +298,16 @@ const propTableRowsRadioCards = [
the v-model
should be on the radio card components within that slot.
-
-
+
+
Date: Mon, 16 Sep 2024 22:21:32 -0400
Subject: [PATCH 19/26] feat: remove unused prop from example
---
es-ds-docs/pages/molecules/radio-cards.vue | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/es-ds-docs/pages/molecules/radio-cards.vue b/es-ds-docs/pages/molecules/radio-cards.vue
index 5ac92304c..634ca9d58 100644
--- a/es-ds-docs/pages/molecules/radio-cards.vue
+++ b/es-ds-docs/pages/molecules/radio-cards.vue
@@ -105,10 +105,10 @@ const propTableRowsRadioCard = [
const propTableRowsRadioCards = [
['id', 'String', 'n/a', 'Required.'],
['label', 'String', 'n/a', 'Required.'],
- ['name', 'String', `''`, 'Optional.'], // TODO: should this be required?
+ ['name', 'String', `''`, 'Optional.'],
['options', 'Array', 'undefined', 'Optional. Alternative to creating an es-form-radio-card in the default slot.'],
- ['inline', 'Boolean', 'false', 'Optional.'], // TODO: example of this?
- ['modelValue', 'Any', 'undefined', 'Optional. Required, if using the options prop'],
+ ['inline', 'Boolean', 'false', 'Optional.'],
+ ['v-model', 'Any', 'undefined', 'Optional. Required, only if passing the options prop'],
['hasIcon', 'Boolean', 'false', 'Optional. Adds a "has-icon" class to the radiogroup'],
['labelClass', 'String', `''`, 'Optional. Apply class to the input label. Defaults to "font-size-h3"'],
['labelSrOnly', 'Boolean', 'false', 'Optional. Applies an `sr-only` class to the label'],
@@ -168,7 +168,6 @@ const propTableRowsRadioCards = [
Date: Mon, 16 Sep 2024 22:36:36 -0400
Subject: [PATCH 20/26] fix: sr-only prop behavior
---
es-ds-components/components/es-form-radio-cards.vue | 8 ++------
es-ds-docs/pages/molecules/radio-cards.vue | 2 +-
2 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/es-ds-components/components/es-form-radio-cards.vue b/es-ds-components/components/es-form-radio-cards.vue
index 185e3c367..fbea19b85 100644
--- a/es-ds-components/components/es-form-radio-cards.vue
+++ b/es-ds-components/components/es-form-radio-cards.vue
@@ -45,8 +45,8 @@ function handleUpdate(value: any) {
-
{{ props.label }}
@@ -56,7 +56,6 @@ function handleUpdate(value: any) {
tabindex="-1"
class="es-form-radio-cards d-flex justify-content-center btn-group-vertical"
:class="{ 'has-icon': props.hasIcon }">
-
+ :class="props.labelClass">
{{ option.text }}
diff --git a/es-ds-docs/pages/molecules/radio-cards.vue b/es-ds-docs/pages/molecules/radio-cards.vue
index 634ca9d58..8a3d05c16 100644
--- a/es-ds-docs/pages/molecules/radio-cards.vue
+++ b/es-ds-docs/pages/molecules/radio-cards.vue
@@ -219,7 +219,7 @@ const propTableRowsRadioCards = [
-
+
{{ installTimelineLabel }}
From 5caf66391f155812c3c8e104cfafbbc531573a84 Mon Sep 17 00:00:00 2001
From: Tommy
Date: Mon, 16 Sep 2024 22:37:39 -0400
Subject: [PATCH 21/26] fix: header level
---
es-ds-docs/pages/molecules/radio-cards.vue | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/es-ds-docs/pages/molecules/radio-cards.vue b/es-ds-docs/pages/molecules/radio-cards.vue
index 8a3d05c16..8815e2cb0 100644
--- a/es-ds-docs/pages/molecules/radio-cards.vue
+++ b/es-ds-docs/pages/molecules/radio-cards.vue
@@ -219,9 +219,11 @@ const propTableRowsRadioCards = [
-
+
{{ installTimelineLabel }}
-
+
Date: Mon, 16 Sep 2024 22:40:53 -0400
Subject: [PATCH 22/26] chore: add inline comment for clarity
---
es-ds-components/components/es-radio-button.vue | 2 ++
1 file changed, 2 insertions(+)
diff --git a/es-ds-components/components/es-radio-button.vue b/es-ds-components/components/es-radio-button.vue
index ebac52a23..355d3a2c5 100644
--- a/es-ds-components/components/es-radio-button.vue
+++ b/es-ds-components/components/es-radio-button.vue
@@ -24,6 +24,8 @@ function handleRadioButtonClick() {
}
}
+// Similar to the API of https://bootstrap-vue.org/docs/components/form-radio#changing-the-option-field-names
+// the value can be a string, number, or simple object. Avoid using complex types in values.
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const model = defineModel();
const isChecked = computed(() => props.value === model.value);
From d00f497fa537adae124547250da5112ceb30dee0 Mon Sep 17 00:00:00 2001
From: Tommy
Date: Mon, 16 Sep 2024 22:42:48 -0400
Subject: [PATCH 23/26] chore: apply formatting
---
.../components/es-form-radio-cards.vue | 5 ++--
es-ds-docs/pages/molecules/radio-cards.vue | 29 ++++++++++---------
2 files changed, 18 insertions(+), 16 deletions(-)
diff --git a/es-ds-components/components/es-form-radio-cards.vue b/es-ds-components/components/es-form-radio-cards.vue
index fbea19b85..3e0922fed 100644
--- a/es-ds-components/components/es-form-radio-cards.vue
+++ b/es-ds-components/components/es-form-radio-cards.vue
@@ -45,7 +45,7 @@ function handleUpdate(value: any) {
{{ props.label }}
@@ -67,8 +67,7 @@ function handleUpdate(value: any) {
:model-value="props.modelValue"
:inline="props.inline || false"
@update:model-value="handleUpdate">
-
+
{{ option.text }}
diff --git a/es-ds-docs/pages/molecules/radio-cards.vue b/es-ds-docs/pages/molecules/radio-cards.vue
index 8815e2cb0..444b06f8e 100644
--- a/es-ds-docs/pages/molecules/radio-cards.vue
+++ b/es-ds-docs/pages/molecules/radio-cards.vue
@@ -74,7 +74,7 @@ onMounted(async () => {
docCode.value = $prism.normalizeCode(docSource.default);
$prism.highlight();
}
-})
+});
function handleSubmit() {
// eslint-disable-next-line no-console
@@ -278,25 +278,28 @@ const propTableRowsRadioCards = [
-
- Migrating from ESDS 2.0 form radio cards
-
+ Migrating from ESDS 2.0 form radio cards
The previous
-
+
radio card
- and radio card group components were based on
-
- bootstrap-vue
- 's implementation.
+
+ and
+ radio card group
+ components were based on
+ bootstrap-vue 's implementation.
- Going forward the v-model
should be on the radio card group
- component when passing in the options
prop.
+ Going forward the v-model
should be on the radio card group component when
+ passing in the options
prop.
- When using the radio card group's default slot
- the v-model
should be on the radio card components within that slot.
+ When using the radio card group's default slot the v-model
should be on the
+ radio card components within that slot.
Date: Tue, 17 Sep 2024 23:16:11 -0400
Subject: [PATCH 24/26] fix: doc-source references
---
es-ds-docs/pages/molecules/radio-cards.vue | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/es-ds-docs/pages/molecules/radio-cards.vue b/es-ds-docs/pages/molecules/radio-cards.vue
index 444b06f8e..f21384640 100644
--- a/es-ds-docs/pages/molecules/radio-cards.vue
+++ b/es-ds-docs/pages/molecules/radio-cards.vue
@@ -305,12 +305,12 @@ const propTableRowsRadioCards = [
+ comp-source="es-ds-components/components/es-form-radio-cards.vue" />
+ comp-source="es-ds-components/components/es-form-radio-card.vue" />
Date: Tue, 17 Sep 2024 23:56:38 -0400
Subject: [PATCH 25/26] feat: add focus state logic
---
.../components/es-form-radio-card.vue | 9 +-
es-ds-components/nuxt.config.ts | 1 +
es-ds-components/package-lock.json | 89 +++++++++++++++++++
es-ds-components/package.json | 7 +-
es-ds-docs/package-lock.json | 89 +++++++++++++++++++
es-ds-docs/package.json | 5 +-
6 files changed, 194 insertions(+), 6 deletions(-)
diff --git a/es-ds-components/components/es-form-radio-card.vue b/es-ds-components/components/es-form-radio-card.vue
index 2c0cae733..ab25d5454 100644
--- a/es-ds-components/components/es-form-radio-card.vue
+++ b/es-ds-components/components/es-form-radio-card.vue
@@ -1,4 +1,9 @@