@energysage/es-ds-components 3.0.0-alpha.6 → 3.0.0-alpha.7

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.
Files changed (224) hide show
  1. package/.eslintignore +9 -0
  2. package/.eslintrc.json +3 -0
  3. package/.prettierrc.json +10 -0
  4. package/components/es-accordion-list.vue +112 -0
  5. package/components/es-accordion.vue +7 -0
  6. package/components/es-badge.vue +20 -0
  7. package/components/es-breadcrumbs.vue +43 -32
  8. package/components/es-button.vue +112 -0
  9. package/components/es-card.vue +64 -0
  10. package/components/es-carousel.vue +160 -0
  11. package/components/{b-col.vue → es-col.vue} +11 -11
  12. package/components/es-collapse.vue +38 -36
  13. package/components/es-cta-banner.vue +95 -0
  14. package/components/es-cta-card.vue +60 -0
  15. package/components/es-data-table-simple.vue +73 -0
  16. package/components/es-data-table.vue +126 -0
  17. package/components/es-error-page.vue +120 -0
  18. package/components/es-file-input.vue +331 -0
  19. package/components/es-file-preview-modal.vue +61 -0
  20. package/components/es-footer.vue +163 -0
  21. package/components/es-form-checkbox.vue +40 -0
  22. package/components/es-form-input.vue +130 -0
  23. package/components/es-form-msg.vue +81 -0
  24. package/components/es-form-radio-card.vue +57 -0
  25. package/components/es-form-radio-cards.vue +78 -0
  26. package/components/es-form-textarea.vue +124 -0
  27. package/components/es-form.vue +16 -0
  28. package/components/es-modal.vue +103 -0
  29. package/components/es-nav-bar-account-menu.vue +67 -0
  30. package/components/es-nav-bar-featured-article.vue +60 -0
  31. package/components/es-nav-bar-link.vue +27 -0
  32. package/components/es-nav-bar-product-menu.vue +215 -0
  33. package/components/es-nav-bar-top-level-menu.vue +193 -0
  34. package/components/es-nav-bar-topic-menu.vue +194 -0
  35. package/components/es-nav-bar.vue +396 -0
  36. package/components/es-pagination.vue +66 -0
  37. package/components/es-popover.vue +113 -0
  38. package/components/es-progress-circle.vue +81 -0
  39. package/components/es-progress.vue +36 -0
  40. package/components/es-radio-button-group.vue +53 -0
  41. package/components/es-radio-button.vue +50 -57
  42. package/components/es-rating.vue +120 -0
  43. package/components/es-reviews-io-card-carousel.vue +275 -0
  44. package/components/es-slider.vue +147 -0
  45. package/components/es-spinner.vue +22 -0
  46. package/components/es-support-card.vue +150 -0
  47. package/components/es-support.vue +66 -0
  48. package/components/es-tab.vue +7 -0
  49. package/components/es-tabs.vue +67 -0
  50. package/components/es-verification-code.vue +94 -0
  51. package/components/es-view-more.vue +63 -0
  52. package/components/es-zip-code-form.vue +204 -0
  53. package/components/icon/arrow-clockwise.vue +51 -0
  54. package/components/icon/arrow-counter-clockwise.vue +37 -0
  55. package/components/icon/arrow-cycle.vue +43 -0
  56. package/components/icon/arrow-left.vue +39 -0
  57. package/components/icon/arrow-right.vue +39 -0
  58. package/components/icon/arrow-up.vue +39 -0
  59. package/components/icon/arrow.vue +68 -0
  60. package/components/icon/bank.vue +38 -0
  61. package/components/icon/battery.vue +40 -0
  62. package/components/icon/bell.vue +42 -0
  63. package/components/icon/block.vue +46 -0
  64. package/components/icon/bolt.vue +38 -0
  65. package/components/icon/business.vue +42 -0
  66. package/components/icon/calculator.vue +37 -0
  67. package/components/icon/calendar.vue +46 -0
  68. package/components/icon/cart.vue +46 -0
  69. package/components/icon/chat-add.vue +44 -0
  70. package/components/icon/chat-approve.vue +42 -0
  71. package/components/icon/chat-bubble.vue +40 -0
  72. package/components/icon/chat-dots.vue +42 -0
  73. package/components/icon/check.vue +39 -0
  74. package/components/{icon-chevron-down.vue → icon/chevron-down.vue} +16 -16
  75. package/components/icon/chevron-horizontal.vue +39 -0
  76. package/components/icon/chevron-left.vue +39 -0
  77. package/components/{icon-chevron-right.vue → icon/chevron-right.vue} +16 -16
  78. package/components/icon/chevron-up.vue +39 -0
  79. package/components/icon/circle-alert.vue +46 -0
  80. package/components/icon/circle-check.vue +46 -0
  81. package/components/icon/circle-chevron-down.vue +47 -0
  82. package/components/icon/circle-chevron-left.vue +46 -0
  83. package/components/icon/circle-chevron-right.vue +46 -0
  84. package/components/icon/circle-chevron-up.vue +46 -0
  85. package/components/icon/circle-minus.vue +46 -0
  86. package/components/icon/circle-plus.vue +46 -0
  87. package/components/icon/circle-x.vue +46 -0
  88. package/components/icon/circle.vue +42 -0
  89. package/components/icon/clock.vue +46 -0
  90. package/components/icon/community-solar.vue +37 -0
  91. package/components/icon/companies.vue +43 -0
  92. package/components/icon/contact-us.vue +37 -0
  93. package/components/icon/copy.vue +45 -0
  94. package/components/icon/credit-card.vue +37 -0
  95. package/components/icon/document.vue +45 -0
  96. package/components/icon/electric-vehicle.vue +37 -0
  97. package/components/icon/electricity-circle.vue +39 -0
  98. package/components/icon/envelope.vue +45 -0
  99. package/components/icon/es-leaf.vue +39 -0
  100. package/components/icon/eye.vue +41 -0
  101. package/components/icon/facebook.vue +41 -0
  102. package/components/icon/file-doc.vue +72 -0
  103. package/components/icon/file-docx.vue +72 -0
  104. package/components/icon/file-pdf.vue +72 -0
  105. package/components/icon/flag.vue +37 -0
  106. package/components/icon/folder.vue +41 -0
  107. package/components/icon/gear.vue +37 -0
  108. package/components/icon/gift.vue +37 -0
  109. package/components/icon/hamburger.vue +38 -0
  110. package/components/icon/heart.vue +39 -0
  111. package/components/icon/heat-pump.vue +41 -0
  112. package/components/icon/image.vue +45 -0
  113. package/components/icon/info-blog-post.vue +47 -0
  114. package/components/icon/info.vue +45 -0
  115. package/components/icon/instagram.vue +49 -0
  116. package/components/icon/light-bulb.vue +36 -0
  117. package/components/icon/link-out.vue +38 -0
  118. package/components/icon/linkedin.vue +41 -0
  119. package/components/icon/location.vue +45 -0
  120. package/components/icon/lock-off.vue +45 -0
  121. package/components/icon/lock-on.vue +48 -0
  122. package/components/icon/marketplace.vue +43 -0
  123. package/components/icon/minus.vue +38 -0
  124. package/components/icon/money-bag.vue +37 -0
  125. package/components/icon/money.vue +35 -0
  126. package/components/icon/open-envelope.vue +45 -0
  127. package/components/icon/paper.vue +45 -0
  128. package/components/icon/payback.vue +37 -0
  129. package/components/icon/pencil.vue +45 -0
  130. package/components/icon/person-add.vue +41 -0
  131. package/components/icon/person-check.vue +41 -0
  132. package/components/icon/person-cross.vue +41 -0
  133. package/components/icon/person.vue +41 -0
  134. package/components/icon/phone.vue +41 -0
  135. package/components/icon/play.vue +41 -0
  136. package/components/icon/plus.vue +38 -0
  137. package/components/icon/roof.vue +37 -0
  138. package/components/icon/rooftop-solar.vue +37 -0
  139. package/components/icon/saving.vue +37 -0
  140. package/components/icon/search.vue +43 -0
  141. package/components/icon/settings-horizontal.vue +57 -0
  142. package/components/icon/settings-vertical.vue +57 -0
  143. package/components/icon/shield-with-check.vue +38 -0
  144. package/components/icon/shield.vue +41 -0
  145. package/components/icon/shopping-bag.vue +39 -0
  146. package/components/icon/solar.vue +37 -0
  147. package/components/icon/sound-down.vue +45 -0
  148. package/components/icon/sound-off.vue +41 -0
  149. package/components/icon/sound-on.vue +41 -0
  150. package/components/icon/sound-up.vue +41 -0
  151. package/components/icon/star-empty.vue +38 -0
  152. package/components/icon/star-full.vue +36 -0
  153. package/components/icon/star-half.vue +55 -0
  154. package/components/icon/state-ak.vue +53 -0
  155. package/components/icon/state-al.vue +38 -0
  156. package/components/icon/state-ar.vue +38 -0
  157. package/components/icon/state-az.vue +38 -0
  158. package/components/icon/state-ca.vue +38 -0
  159. package/components/icon/state-co.vue +38 -0
  160. package/components/icon/state-ct.vue +38 -0
  161. package/components/icon/state-dc.vue +52 -0
  162. package/components/icon/state-de.vue +38 -0
  163. package/components/icon/state-fl.vue +38 -0
  164. package/components/icon/state-ga.vue +38 -0
  165. package/components/icon/state-hi.vue +59 -0
  166. package/components/icon/state-ia.vue +38 -0
  167. package/components/icon/state-id.vue +38 -0
  168. package/components/icon/state-il.vue +38 -0
  169. package/components/icon/state-in.vue +38 -0
  170. package/components/icon/state-ks.vue +38 -0
  171. package/components/icon/state-ky.vue +38 -0
  172. package/components/icon/state-la.vue +38 -0
  173. package/components/icon/state-ma.vue +38 -0
  174. package/components/icon/state-md.vue +39 -0
  175. package/components/icon/state-me.vue +38 -0
  176. package/components/icon/state-mi.vue +38 -0
  177. package/components/icon/state-mn.vue +38 -0
  178. package/components/icon/state-mo.vue +38 -0
  179. package/components/icon/state-ms.vue +38 -0
  180. package/components/icon/state-mt.vue +38 -0
  181. package/components/icon/state-nc.vue +38 -0
  182. package/components/icon/state-nd.vue +38 -0
  183. package/components/icon/state-ne.vue +38 -0
  184. package/components/icon/state-nh.vue +38 -0
  185. package/components/icon/state-nj.vue +37 -0
  186. package/components/icon/state-nm.vue +38 -0
  187. package/components/icon/state-nv.vue +38 -0
  188. package/components/icon/state-ny.vue +41 -0
  189. package/components/icon/state-oh.vue +38 -0
  190. package/components/icon/state-ok.vue +38 -0
  191. package/components/icon/state-or.vue +38 -0
  192. package/components/icon/state-pa.vue +38 -0
  193. package/components/icon/state-ri.vue +38 -0
  194. package/components/icon/state-sc.vue +38 -0
  195. package/components/icon/state-sd.vue +38 -0
  196. package/components/icon/state-tn.vue +38 -0
  197. package/components/icon/state-tx.vue +38 -0
  198. package/components/icon/state-ut.vue +38 -0
  199. package/components/icon/state-va.vue +38 -0
  200. package/components/icon/state-vt.vue +38 -0
  201. package/components/icon/state-wa.vue +38 -0
  202. package/components/icon/state-wi.vue +38 -0
  203. package/components/icon/state-wv.vue +38 -0
  204. package/components/icon/state-wy.vue +38 -0
  205. package/components/icon/thumbs-up.vue +39 -0
  206. package/components/icon/trash-can.vue +41 -0
  207. package/components/icon/tree.vue +37 -0
  208. package/components/icon/twitter.vue +43 -0
  209. package/components/icon/upload.vue +41 -0
  210. package/components/icon/verified.vue +40 -0
  211. package/components/icon/video-play.vue +41 -0
  212. package/components/icon/wifi.vue +38 -0
  213. package/components/icon/x.vue +38 -0
  214. package/components/icon/youtube.vue +45 -0
  215. package/composables/forms.ts +124 -0
  216. package/lib-utils/mime-type-finder.js +48 -0
  217. package/nuxt.config.ts +40 -9
  218. package/package.json +29 -5
  219. package/tsconfig.json +2 -2
  220. package/utils/get-es-footer-content.js +90 -0
  221. package/utils/get-es-nav-bar-account-content.js +55 -0
  222. package/utils/get-es-nav-bar-global-content.js +474 -0
  223. /package/components/{b-container.vue → es-container.vue} +0 -0
  224. /package/components/{b-row.vue → es-row.vue} +0 -0
@@ -0,0 +1,130 @@
1
+ <script setup lang="ts">
2
+ import InputText from 'primevue/inputtext';
3
+ import InputMask from 'primevue/inputmask';
4
+ // Prevents attributes from being applied to first <div>
5
+ // v-bind="$attr" is on the input instead
6
+ defineOptions({
7
+ inheritAttrs: false,
8
+ });
9
+
10
+ defineProps({
11
+ /**
12
+ * Required
13
+ */
14
+ required: {
15
+ type: Boolean,
16
+ default: false,
17
+ },
18
+ /**
19
+ * Disabled
20
+ */
21
+ disabled: {
22
+ type: Boolean,
23
+ default: false,
24
+ },
25
+ /**
26
+ * Type
27
+ */
28
+ type: {
29
+ type: String,
30
+ default: 'text',
31
+ validator: (val: string) => ['text', 'email', 'number', 'password', 'tel', 'maskedTel'].includes(val),
32
+ },
33
+ /**
34
+ * ID
35
+ * required
36
+ */
37
+ id: {
38
+ type: String,
39
+ required: true,
40
+ },
41
+ /**
42
+ * state
43
+ */
44
+ state: {
45
+ type: [Boolean, null],
46
+ default: null,
47
+ },
48
+ labelSrOnly: {
49
+ type: Boolean,
50
+ default: false,
51
+ },
52
+ phoneMaskValue: {
53
+ type: String,
54
+ default: '(999) 999-9999',
55
+ required: false,
56
+ },
57
+ });
58
+
59
+ const slots = useSlots();
60
+
61
+ const hasSuccess = () => !!slots.successMessage;
62
+ const hasMessage = () => !!slots.message;
63
+ const hasError = () => !!slots.errorMessage;
64
+ const hasExtraContext = () => !!slots.extraContext;
65
+ </script>
66
+
67
+ <template>
68
+ <div
69
+ class="input-wrapper justify-content-end"
70
+ :class="$attrs.class"
71
+ :required="required">
72
+ <!-- eslint-disable-next-line vuejs-accessibility/label-has-for -->
73
+ <label
74
+ :for="id"
75
+ class="label justify-content-start"
76
+ :class="{ 'sr-only': labelSrOnly }">
77
+ <slot name="label" />
78
+ <span
79
+ v-if="required"
80
+ class="text-danger">
81
+ *
82
+ </span>
83
+ </label>
84
+ <p
85
+ v-if="hasExtraContext()"
86
+ class="mb-25 font-size-75">
87
+ <slot name="extraContext" />
88
+ </p>
89
+ <div class="input-holder position-relative">
90
+ <!-- prefix icons are decorative only so are aria-hidden -->
91
+ <span
92
+ v-if="$slots.prefixIcon"
93
+ aria-hidden="true"
94
+ class="prefix-icon position-absolute">
95
+ <slot name="prefixIcon" />
96
+ </span>
97
+ <component
98
+ :is="type === 'maskedTel' ? InputMask : InputText"
99
+ :id="id"
100
+ v-bind="{ ...$attrs, class: undefined }"
101
+ :type="type"
102
+ class="es-form-input form-control w-100"
103
+ :class="{
104
+ 'has-prefix-icon': $slots.prefixIcon,
105
+ 'is-invalid': state === false,
106
+ }"
107
+ :mask="phoneMaskValue"
108
+ :disabled="disabled"
109
+ :invalid="state === false" />
110
+ <small
111
+ v-if="hasMessage() && ((!hasSuccess() && state) || state == null)"
112
+ class="text-muted">
113
+ <slot name="message" />
114
+ </small>
115
+ <small
116
+ v-if="state === false && (hasError() || required)"
117
+ class="text-danger">
118
+ <slot
119
+ v-if="hasError()"
120
+ name="errorMessage" />
121
+ <template v-else-if="required"> This field is required. </template>
122
+ </small>
123
+ <small
124
+ v-if="state && hasSuccess()"
125
+ class="text-success">
126
+ <slot name="successMessage" />
127
+ </small>
128
+ </div>
129
+ </div>
130
+ </template>
@@ -0,0 +1,81 @@
1
+ <script setup lang="ts">
2
+ const props = defineProps({
3
+ show: {
4
+ type: Boolean,
5
+ default: false,
6
+ },
7
+ timeout: {
8
+ type: Number,
9
+ default: 20,
10
+ required: false,
11
+ },
12
+ variant: {
13
+ type: String,
14
+ default: 'danger',
15
+ required: false,
16
+ validator: (val: string) => ['danger', 'success', 'primary'].includes(val),
17
+ },
18
+ });
19
+
20
+ const emit = defineEmits(['hidden']);
21
+
22
+ const hide = () => {
23
+ emit('hidden');
24
+ };
25
+
26
+ watch(
27
+ () => props.show,
28
+ (newValue, oldValue) => {
29
+ if (newValue && !oldValue) {
30
+ setTimeout(() => {
31
+ hide();
32
+ }, props.timeout * 1000);
33
+ }
34
+ },
35
+ );
36
+ </script>
37
+
38
+ <template>
39
+ <transition>
40
+ <div
41
+ v-if="show"
42
+ role="alert"
43
+ aria-live="polite"
44
+ aria-atomic="true"
45
+ class="alert es-form-msg my-100 alert-dismissible"
46
+ :class="`alert-${variant}`">
47
+ <div class="d-flex pr-100">
48
+ <div class="icon-wrapper flex-shrink-0 mr-100">
49
+ <icon-circle-alert v-if="variant === 'danger'" />
50
+ <icon-circle-check v-if="variant === 'success'" />
51
+ <icon-info v-if="variant === 'primary'" />
52
+ </div>
53
+ <slot />
54
+ </div>
55
+ <button
56
+ type="button"
57
+ aria-label="Close"
58
+ class="close"
59
+ @click="hide">
60
+ <icon-x />
61
+ </button>
62
+ </div>
63
+ </transition>
64
+ </template>
65
+
66
+ <style lang="scss" scoped>
67
+ .form-msg {
68
+ flex: 0 0 100%;
69
+ padding-right: 2.5rem;
70
+ }
71
+
72
+ .v-enter-active,
73
+ .v-leave-active {
74
+ transition: opacity 0.15s;
75
+ }
76
+
77
+ .v-enter-from,
78
+ .v-leave-to {
79
+ opacity: 0;
80
+ }
81
+ </style>
@@ -0,0 +1,57 @@
1
+ <script setup lang="ts">
2
+ import { useFocus } from '@vueuse/core';
3
+
4
+ const inputElem = useTemplateRef('input-elem');
5
+ const { focused: inputFocused } = useFocus(inputElem);
6
+
7
+ /* eslint-disable @typescript-eslint/no-explicit-any */
8
+ interface IProps {
9
+ id: string;
10
+ name: string;
11
+ value: any;
12
+ disabled?: boolean;
13
+ inline?: boolean;
14
+ displayName?: string;
15
+ }
16
+
17
+ const props = withDefaults(defineProps<IProps>(), {
18
+ disabled: false,
19
+ inline: false,
20
+ displayName: '',
21
+ });
22
+
23
+ // Need to define the implicit emit from v-model, so that it can also get fired
24
+ // from the label clicks
25
+ const emit = defineEmits(['update:modelValue']);
26
+
27
+ function handleRadioButtonClick() {
28
+ if (!props.disabled) {
29
+ emit('update:modelValue', props.value);
30
+ }
31
+ }
32
+
33
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
34
+ const model = defineModel<any>();
35
+ const isChecked = computed(() => props.value === model.value);
36
+ </script>
37
+
38
+ <template>
39
+ <label
40
+ class="es-form-radio-card es-card interactive w-100 btn btn-outline-primary"
41
+ :class="{ active: isChecked, disabled: props.disabled, focus: isChecked || inputFocused }"
42
+ @click="handleRadioButtonClick">
43
+ <input
44
+ :id="id"
45
+ ref="input-elem"
46
+ v-model="model"
47
+ :disabled="props.disabled"
48
+ type="radio"
49
+ name="props.name"
50
+ :value="props.value"
51
+ :checked="isChecked"
52
+ @click="handleRadioButtonClick" />
53
+ <slot>
54
+ {{ displayName }}
55
+ </slot>
56
+ </label>
57
+ </template>
@@ -0,0 +1,78 @@
1
+ <script setup lang="ts">
2
+ interface Option {
3
+ id: string;
4
+ text: string;
5
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
6
+ value: any;
7
+ disabled?: boolean;
8
+ inline?: boolean;
9
+ }
10
+
11
+ interface Props {
12
+ id: string;
13
+ label: string;
14
+ name?: string;
15
+ options?: Option[];
16
+ inline?: boolean;
17
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
18
+ modelValue?: any;
19
+ hasIcon?: boolean;
20
+ labelClass?: string;
21
+ labelSrOnly?: boolean;
22
+ }
23
+ const props = withDefaults(defineProps<Props>(), {
24
+ name: '',
25
+ options: undefined,
26
+ inline: false,
27
+ modelValue: undefined,
28
+ hasIcon: false,
29
+ labelClass: 'font-size-h3',
30
+ labelSrOnly: false,
31
+ });
32
+
33
+ const emit = defineEmits(['update:model-value']);
34
+
35
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
36
+ function handleUpdate(value: any) {
37
+ emit('update:model-value', value);
38
+ }
39
+ </script>
40
+
41
+ <template>
42
+ <fieldset
43
+ :id="`${props.id}-fieldset`"
44
+ class="form-group">
45
+ <legend
46
+ :id="`${props.id}-legend`"
47
+ class="font-size-h1 font-weight-bolder mb-200 pb-0 text-dark"
48
+ :class="{ 'sr-only': props.labelSrOnly }"
49
+ tabindex="-1">
50
+ {{ props.label }}
51
+ </legend>
52
+ <div>
53
+ <div
54
+ :id="`${props.id}-radiogroup`"
55
+ role="radiogroup"
56
+ tabindex="-1"
57
+ class="es-form-radio-cards d-flex justify-content-center btn-group-vertical"
58
+ :class="{ 'has-icon': props.hasIcon }">
59
+ <slot :options="options">
60
+ <es-form-radio-card
61
+ v-for="option in options"
62
+ :id="option.id"
63
+ :key="option.value"
64
+ :disabled="option?.disabled || false"
65
+ :name="props.name"
66
+ :value="option.value"
67
+ :model-value="props.modelValue"
68
+ :inline="props.inline || false"
69
+ @update:model-value="handleUpdate">
70
+ <span :class="props.labelClass">
71
+ {{ option.text }}
72
+ </span>
73
+ </es-form-radio-card>
74
+ </slot>
75
+ </div>
76
+ </div>
77
+ </fieldset>
78
+ </template>
@@ -0,0 +1,124 @@
1
+ <script setup lang="ts">
2
+ // Prevents attributes from being applied to first <div>
3
+ // v-bind="$attr" is on the input instead
4
+ defineOptions({
5
+ inheritAttrs: false,
6
+ });
7
+
8
+ defineProps({
9
+ /**
10
+ * Required
11
+ */
12
+ required: {
13
+ type: Boolean,
14
+ default: false,
15
+ },
16
+ /**
17
+ * Disabled
18
+ */
19
+ disabled: {
20
+ type: Boolean,
21
+ default: false,
22
+ },
23
+ /**
24
+ * ID
25
+ * required
26
+ */
27
+ id: {
28
+ type: String,
29
+ required: true,
30
+ },
31
+ /**
32
+ * state
33
+ */
34
+ state: {
35
+ type: [Boolean, null],
36
+ default: null,
37
+ },
38
+ });
39
+ const model = defineModel<string>();
40
+
41
+ const slots = useSlots();
42
+
43
+ const hasSuccess = () => !!slots.successMessage;
44
+ const hasMessage = () => !!slots.message;
45
+ const hasError = () => !!slots.errorMessage;
46
+ </script>
47
+
48
+ <template>
49
+ <div
50
+ class="input-wrapper justify-content-end"
51
+ :required="required">
52
+ <!-- eslint-disable-next-line vuejs-accessibility/label-has-for -->
53
+ <label
54
+ :for="id"
55
+ class="label justify-content-start">
56
+ <slot name="label" />
57
+
58
+ <span
59
+ v-if="required"
60
+ class="text-danger">
61
+ *
62
+ </span>
63
+ </label>
64
+
65
+ <div class="input-holder">
66
+ <textarea
67
+ :id="id"
68
+ v-model="model"
69
+ v-bind="$attrs"
70
+ class="es-form-textarea w-100 form-control"
71
+ :class="{ 'is-invalid': state === false }"
72
+ :disabled="disabled"
73
+ :invalid="state === false" />
74
+ <small
75
+ v-if="hasMessage() && ((!hasSuccess() && state) || state == null)"
76
+ class="text-muted">
77
+ <slot name="message" />
78
+ </small>
79
+ <small
80
+ v-if="state === false && (hasError() || required)"
81
+ class="text-danger">
82
+ <slot
83
+ v-if="hasError()"
84
+ name="errorMessage" />
85
+ <template v-else-if="required"> This field is required. </template>
86
+ </small>
87
+ <small
88
+ v-if="state && hasSuccess()"
89
+ class="text-success">
90
+ <slot name="successMessage" />
91
+ </small>
92
+ </div>
93
+ </div>
94
+ </template>
95
+
96
+ <style lang="scss" scoped>
97
+ @use '@energysage/es-ds-styles/scss/variables' as variables;
98
+
99
+ .es-form-textarea {
100
+ min-height: 8.125rem;
101
+ }
102
+
103
+ .es-form-textarea:disabled,
104
+ .es-form-textarea[readonly] {
105
+ border: 0;
106
+ }
107
+
108
+ .is-invalid {
109
+ color: variables.$danger;
110
+ }
111
+
112
+ .form-inline .input-wrapper {
113
+ display: flex;
114
+ flex: 0 0 100%;
115
+
116
+ label {
117
+ flex: 0 0 30%;
118
+ }
119
+
120
+ .input-holder {
121
+ flex: 0 0 70%;
122
+ }
123
+ }
124
+ </style>
@@ -0,0 +1,16 @@
1
+ <script setup lang="ts">
2
+ const props = defineProps({
3
+ inline: {
4
+ type: Boolean,
5
+ default: false,
6
+ },
7
+ });
8
+ </script>
9
+
10
+ <template>
11
+ <form
12
+ :class="{ 'form-inline': props.inline }"
13
+ v-bind="$attrs">
14
+ <slot />
15
+ </form>
16
+ </template>
@@ -0,0 +1,103 @@
1
+ <script setup lang="ts">
2
+ import PrimeDialog from 'primevue/dialog';
3
+
4
+ const props = defineProps({
5
+ id: {
6
+ type: String,
7
+ required: true,
8
+ },
9
+ hideFooter: {
10
+ type: Boolean,
11
+ default: false,
12
+ },
13
+ size: {
14
+ type: String,
15
+ default: 'md',
16
+ validator: (val) => ['sm', 'md', 'lg', 'xl'].includes(val),
17
+ },
18
+ bodyClass: {
19
+ type: String,
20
+ required: false,
21
+ default: '',
22
+ },
23
+ });
24
+
25
+ const modalPt = {
26
+ root: {
27
+ class: 'modal-dialog modal-dialog-scrollable modal-content',
28
+ },
29
+ header: {
30
+ class: 'modal-header',
31
+ },
32
+ title: {
33
+ class: 'modal-title',
34
+ },
35
+ closeButton: {
36
+ class: 'close',
37
+ },
38
+ content: {
39
+ class: `modal-body ${props.bodyClass}`,
40
+ },
41
+ footer: {
42
+ class: 'modal-footer',
43
+ },
44
+ mask: {
45
+ class: 'es-modal-mask',
46
+ },
47
+ // https://vuejs.org/guide/built-ins/transition
48
+ transition: {
49
+ enterActiveClass: 'es-modal-enter-active',
50
+ enterFromClass: 'es-modal-enter-from',
51
+ enterToClass: 'es-modal-enter-to',
52
+ leaveActiveClass: 'es-modal-leave-active',
53
+ leaveFromClass: 'es-modal-leave-from',
54
+ leaveToClass: 'es-modal-leave-to',
55
+ },
56
+ };
57
+
58
+ const emit = defineEmits(['hidden']);
59
+
60
+ const onChange = (visible: boolean) => {
61
+ if (!visible) {
62
+ emit('hidden');
63
+ }
64
+ };
65
+
66
+ const getSizeClass = computed(() => {
67
+ const modalSize = props.size === '' ? 'modal-md' : `modal-${props.size}`;
68
+ return modalSize;
69
+ });
70
+ </script>
71
+
72
+ <template>
73
+ <prime-dialog
74
+ :id="id"
75
+ modal
76
+ :class="getSizeClass"
77
+ :pt="modalPt"
78
+ dismissable-mask
79
+ @update:visible="onChange">
80
+ <template #header>
81
+ <h5
82
+ :id="`${id}_header`"
83
+ class="modal-title h2">
84
+ <slot name="modal-title" />
85
+ </h5>
86
+ </template>
87
+
88
+ <template #closeicon>
89
+ <icon-x
90
+ class="text-gray-900"
91
+ height="2rem"
92
+ width="2rem" />
93
+ </template>
94
+
95
+ <slot />
96
+
97
+ <template
98
+ v-if="!hideFooter"
99
+ #footer>
100
+ <slot name="modal-footer" />
101
+ </template>
102
+ </prime-dialog>
103
+ </template>
@@ -0,0 +1,67 @@
1
+ <script lang="js">
2
+ export default {
3
+ name: 'EsNavBarAccountMenu',
4
+ props: {
5
+ authItems: {
6
+ type: Array,
7
+ default: () => [],
8
+ },
9
+ loggedOut: {
10
+ type: Object,
11
+ required: true,
12
+ },
13
+ },
14
+ };
15
+ </script>
16
+
17
+ <template>
18
+ <div class="icon-dropdown">
19
+ <div class="nav-item">
20
+ <div class="nav-link dropdown-toggle d-none d-lg-flex flex-nowrap py-100">
21
+ <icon-person
22
+ class="align-self-center account-icon"
23
+ width="20px"
24
+ height="20px" />
25
+ <span class="sr-only">
26
+ {{ loggedOut.menuButtonText }}
27
+ </span>
28
+ </div>
29
+ <div class="menu">
30
+ <ul
31
+ class="loggedIn dropdown-menu account-menu rounded mt-0 py-100 list-unstyled"
32
+ style="display: none">
33
+ <li
34
+ v-for="item in authItems"
35
+ :key="item.name">
36
+ <es-nav-bar-link
37
+ class="dropdown-item nav-link"
38
+ :href="item.link">
39
+ <span class="mx-50">
40
+ {{ item.name }}
41
+ </span>
42
+ </es-nav-bar-link>
43
+ </li>
44
+ </ul>
45
+ <ul
46
+ class="loggedOut dropdown-menu account-menu rounded mt-0"
47
+ style="display: none">
48
+ <li class="d-flex justify-content-center">
49
+ <es-button
50
+ :href="loggedOut.signIn.link"
51
+ class="m-100 w-100 text-white font-weight-bold">
52
+ {{ loggedOut.signIn.name }}
53
+ </es-button>
54
+ </li>
55
+ <li class="d-flex justify-content-center">
56
+ <es-button
57
+ :href="loggedOut.createAccount.link"
58
+ :outline="true"
59
+ class="mx-100 w-100 font-weight-bold">
60
+ {{ loggedOut.createAccount.name }}
61
+ </es-button>
62
+ </li>
63
+ </ul>
64
+ </div>
65
+ </div>
66
+ </div>
67
+ </template>