@energysage/es-ds-components 3.0.8 → 3.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -35,8 +35,14 @@ const actualVariant = computed(() => {
35
35
  });
36
36
  const defaultTag = computed(() => {
37
37
  // if an href is provided and no alternate link tag was provided (e.g. nuxt-link),
38
- // force the tag to be a nuxt-link, no matter the variant
38
+ // force the tag to be an anchor tag, no matter the variant
39
39
  if (props.href && props.tag === 'div') {
40
+ return 'a';
41
+ }
42
+
43
+ // if a 'to' destination is provided and no alternate link tag was provided (e.g. nuxt-link),
44
+ // force the tag to be a nuxt-link, no matter the variant
45
+ if (props.to && props.tag === 'div') {
40
46
  return 'nuxt-link';
41
47
  }
42
48
 
@@ -57,7 +63,8 @@ const defaultTag = computed(() => {
57
63
  :is="defaultTag == 'nuxt-link' ? NuxtLink : defaultTag"
58
64
  class="es-card"
59
65
  :class="actualVariant"
60
- :to="to ? to : href"
66
+ :href="href"
67
+ :to="to"
61
68
  v-bind="$attrs">
62
69
  <slot />
63
70
  </component>
@@ -1,21 +1,26 @@
1
1
  <script setup lang="ts">
2
- const props = defineProps({
3
- dark: {
4
- type: Boolean,
5
- default: false,
6
- },
7
- hasButton: {
8
- type: Boolean,
9
- default: false,
10
- },
11
- // default or wide
12
- variant: {
13
- type: String,
14
- default: 'default',
15
- },
2
+ interface Props {
3
+ alignMobile?: 'left' | 'center' | 'right';
4
+ background?: 'none' | 'blue-300-radial' | 'dark-blue';
5
+ hasButton?: boolean;
6
+ variant?: 'default' | 'stacked' | 'wide';
7
+ // deprecated
8
+ dark?: boolean;
9
+ }
10
+ const props = withDefaults(defineProps<Props>(), {
11
+ alignMobile: 'center',
12
+ background: 'none',
13
+ hasButton: false,
14
+ variant: 'default',
15
+ // deprecated
16
+ dark: false,
16
17
  });
17
18
 
18
19
  const lgFirst = computed(() => {
20
+ if (props.variant === 'stacked') {
21
+ return '12';
22
+ }
23
+
19
24
  if (props.variant === 'wide') {
20
25
  return props.hasButton ? '8' : '6';
21
26
  }
@@ -24,6 +29,10 @@ const lgFirst = computed(() => {
24
29
  });
25
30
 
26
31
  const lgSecond = computed(() => {
32
+ if (props.variant === 'stacked') {
33
+ return '12';
34
+ }
35
+
27
36
  if (props.variant === 'wide') {
28
37
  return props.hasButton ? '4' : '6';
29
38
  }
@@ -32,6 +41,10 @@ const lgSecond = computed(() => {
32
41
  });
33
42
 
34
43
  const xxlFirst = computed(() => {
44
+ if (props.variant === 'stacked') {
45
+ return '12';
46
+ }
47
+
35
48
  if (props.variant === 'wide') {
36
49
  return props.hasButton ? '8' : '6';
37
50
  }
@@ -40,6 +53,10 @@ const xxlFirst = computed(() => {
40
53
  });
41
54
 
42
55
  const xxlSecond = computed(() => {
56
+ if (props.variant === 'stacked') {
57
+ return '12';
58
+ }
59
+
43
60
  if (props.variant === 'wide') {
44
61
  return props.hasButton ? '4' : '6';
45
62
  }
@@ -52,7 +69,8 @@ const xxlSecond = computed(() => {
52
69
  <es-card
53
70
  :class="[
54
71
  {
55
- 'bg-dark-blue border-dark-blue text-white': dark,
72
+ 'bg-dark-blue border-dark-blue text-white': dark || background === 'dark-blue',
73
+ 'bg-blue-300-radial-gradient': background === 'blue-300-radial',
56
74
  'px-100 px-lg-200': variant === 'default',
57
75
  'px-100 px-lg-300': variant === 'wide',
58
76
  },
@@ -60,7 +78,12 @@ const xxlSecond = computed(() => {
60
78
  v-bind="$attrs">
61
79
  <es-row>
62
80
  <es-col
63
- class="mb-200 my-lg-auto text-center text-lg-left"
81
+ class="text-lg-left"
82
+ :class="{
83
+ [`text-${alignMobile}`]: true,
84
+ 'mb-100': variant === 'stacked',
85
+ 'mb-200 my-lg-auto': variant !== 'stacked',
86
+ }"
64
87
  :lg="lgFirst"
65
88
  :xxl="xxlFirst">
66
89
  <!-- avoiding use of an <h2> tag here for long-form content SEO reasons,
@@ -70,10 +93,10 @@ const xxlSecond = computed(() => {
70
93
  aria-level="2"
71
94
  class="font-weight-semibold"
72
95
  :class="{
73
- 'font-size-300': variant === 'default',
96
+ 'font-size-300': variant === 'default' || variant === 'stacked',
74
97
  'mb-50': $slots.subtitle,
75
98
  'mb-0': !$slots.subtitle,
76
- 'text-white': dark,
99
+ 'text-white': dark || background === 'dark-blue',
77
100
  h2: variant === 'wide',
78
101
  }">
79
102
  <slot name="heading"> Easily find what solar costs in your area </slot>
@@ -85,7 +108,10 @@ const xxlSecond = computed(() => {
85
108
  </p>
86
109
  </es-col>
87
110
  <es-col
88
- class="d-flex justify-content-center justify-content-lg-end my-auto"
111
+ class="d-flex justify-content-center my-auto"
112
+ :class="{
113
+ 'justify-content-lg-end': variant !== 'stacked',
114
+ }"
89
115
  :lg="lgSecond"
90
116
  :xxl="xxlSecond">
91
117
  <slot name="cta" />
@@ -93,3 +119,19 @@ const xxlSecond = computed(() => {
93
119
  </es-row>
94
120
  </es-card>
95
121
  </template>
122
+
123
+ <style lang="scss" scoped>
124
+ @use '@energysage/es-ds-styles/scss/mixins/breakpoints' as breakpoints;
125
+ @use '@energysage/es-ds-styles/scss/variables' as variables;
126
+
127
+ .bg-blue-300-radial-gradient {
128
+ background:
129
+ radial-gradient(44.92% 45.42% at 5.14% 6.4%, rgba(133, 178, 255, 0) 0%, variables.$blue-300 100%), #fff;
130
+
131
+ @include breakpoints.media-breakpoint-up(md) {
132
+ background:
133
+ radial-gradient(95.61% 111.81% at -0.65% 0%, rgba(133, 178, 255, 0) 0%, variables.$blue-300 100%),
134
+ variables.$white;
135
+ }
136
+ }
137
+ </style>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@energysage/es-ds-components",
3
- "version": "3.0.8",
3
+ "version": "3.0.10",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "An EnergySage Vue component library",