@energysage/es-ds-components 0.0.1 → 3.0.0-alpha.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.
Files changed (234) hide show
  1. package/.eslintignore +9 -0
  2. package/.eslintrc.json +3 -0
  3. package/.prettierrc.json +10 -0
  4. package/README.md +0 -3
  5. package/components/es-accordion-list.vue +117 -0
  6. package/components/es-accordion.vue +7 -0
  7. package/components/es-badge.vue +20 -0
  8. package/components/es-breadcrumbs.vue +73 -0
  9. package/components/es-button.vue +122 -0
  10. package/components/es-card.vue +64 -0
  11. package/components/es-carousel.vue +316 -0
  12. package/components/es-col.vue +27 -0
  13. package/components/es-collapse.vue +83 -0
  14. package/components/es-container.vue +14 -0
  15. package/components/es-cta-banner.vue +95 -0
  16. package/components/es-cta-card.vue +60 -0
  17. package/components/es-data-table-simple.vue +73 -0
  18. package/components/es-data-table.vue +128 -0
  19. package/components/es-error-page.vue +120 -0
  20. package/components/es-file-input.vue +334 -0
  21. package/components/es-file-preview-modal.vue +61 -0
  22. package/components/es-footer.vue +163 -0
  23. package/components/es-form-checkbox.vue +40 -0
  24. package/components/es-form-input.vue +130 -0
  25. package/components/es-form-msg.vue +81 -0
  26. package/components/es-form-radio-card.vue +57 -0
  27. package/components/es-form-radio-cards.vue +78 -0
  28. package/components/es-form-textarea.vue +124 -0
  29. package/components/es-form.vue +16 -0
  30. package/components/es-modal.vue +103 -0
  31. package/components/es-nav-bar-account-menu.vue +70 -0
  32. package/components/es-nav-bar-featured-article.vue +60 -0
  33. package/components/es-nav-bar-link.vue +27 -0
  34. package/components/es-nav-bar-product-menu.vue +219 -0
  35. package/components/es-nav-bar-top-level-menu.vue +194 -0
  36. package/components/es-nav-bar-topic-menu.vue +197 -0
  37. package/components/es-nav-bar.vue +411 -0
  38. package/components/es-pagination.vue +67 -0
  39. package/components/es-popover.vue +113 -0
  40. package/components/es-progress-circle.vue +81 -0
  41. package/components/es-progress.vue +36 -0
  42. package/components/es-radio-button-group.vue +53 -0
  43. package/components/es-radio-button.vue +57 -0
  44. package/components/es-rating.vue +120 -0
  45. package/components/es-reviews-io-card-carousel.vue +279 -0
  46. package/components/es-row.vue +5 -0
  47. package/components/es-skeleton-img.vue +38 -0
  48. package/components/es-skeleton-wrapper.vue +17 -0
  49. package/components/es-skeleton.vue +97 -0
  50. package/components/es-slider.vue +218 -0
  51. package/components/es-spinner.vue +22 -0
  52. package/components/es-support-card.vue +150 -0
  53. package/components/es-support.vue +66 -0
  54. package/components/es-tab.vue +7 -0
  55. package/components/es-tabs.vue +70 -0
  56. package/components/es-verification-code.vue +94 -0
  57. package/components/es-video.vue +60 -0
  58. package/components/es-view-more.vue +64 -0
  59. package/components/es-zip-code-form.vue +204 -0
  60. package/components/icon/arrow-clockwise.vue +51 -0
  61. package/components/icon/arrow-counter-clockwise.vue +37 -0
  62. package/components/icon/arrow-cycle.vue +43 -0
  63. package/components/icon/arrow-left.vue +39 -0
  64. package/components/icon/arrow-right.vue +39 -0
  65. package/components/icon/arrow-up.vue +39 -0
  66. package/components/icon/arrow.vue +68 -0
  67. package/components/icon/bank.vue +38 -0
  68. package/components/icon/battery.vue +40 -0
  69. package/components/icon/bell.vue +42 -0
  70. package/components/icon/block.vue +46 -0
  71. package/components/icon/bolt.vue +38 -0
  72. package/components/icon/business.vue +42 -0
  73. package/components/icon/calculator.vue +37 -0
  74. package/components/icon/calendar.vue +46 -0
  75. package/components/icon/cart.vue +46 -0
  76. package/components/icon/chat-add.vue +44 -0
  77. package/components/icon/chat-approve.vue +42 -0
  78. package/components/icon/chat-bubble.vue +40 -0
  79. package/components/icon/chat-dots.vue +42 -0
  80. package/components/icon/check.vue +39 -0
  81. package/components/icon/chevron-down.vue +39 -0
  82. package/components/icon/chevron-horizontal.vue +39 -0
  83. package/components/icon/chevron-left.vue +39 -0
  84. package/components/icon/chevron-right.vue +39 -0
  85. package/components/icon/chevron-up.vue +39 -0
  86. package/components/icon/circle-alert.vue +46 -0
  87. package/components/icon/circle-check.vue +46 -0
  88. package/components/icon/circle-chevron-down.vue +47 -0
  89. package/components/icon/circle-chevron-left.vue +46 -0
  90. package/components/icon/circle-chevron-right.vue +46 -0
  91. package/components/icon/circle-chevron-up.vue +46 -0
  92. package/components/icon/circle-minus.vue +46 -0
  93. package/components/icon/circle-plus.vue +46 -0
  94. package/components/icon/circle-x.vue +46 -0
  95. package/components/icon/circle.vue +42 -0
  96. package/components/icon/clock.vue +46 -0
  97. package/components/icon/community-solar.vue +37 -0
  98. package/components/icon/companies.vue +43 -0
  99. package/components/icon/contact-us.vue +37 -0
  100. package/components/icon/copy.vue +45 -0
  101. package/components/icon/credit-card.vue +37 -0
  102. package/components/icon/document.vue +45 -0
  103. package/components/icon/electric-vehicle.vue +37 -0
  104. package/components/icon/electricity-circle.vue +39 -0
  105. package/components/icon/envelope.vue +45 -0
  106. package/components/icon/es-leaf.vue +39 -0
  107. package/components/icon/eye.vue +41 -0
  108. package/components/icon/facebook.vue +41 -0
  109. package/components/icon/file-doc.vue +72 -0
  110. package/components/icon/file-docx.vue +72 -0
  111. package/components/icon/file-pdf.vue +72 -0
  112. package/components/icon/flag.vue +37 -0
  113. package/components/icon/folder.vue +41 -0
  114. package/components/icon/gear.vue +37 -0
  115. package/components/icon/gift.vue +37 -0
  116. package/components/icon/hamburger.vue +38 -0
  117. package/components/icon/heart.vue +39 -0
  118. package/components/icon/heat-pump.vue +41 -0
  119. package/components/icon/image.vue +45 -0
  120. package/components/icon/info-blog-post.vue +47 -0
  121. package/components/icon/info.vue +45 -0
  122. package/components/icon/instagram.vue +49 -0
  123. package/components/icon/light-bulb.vue +36 -0
  124. package/components/icon/link-out.vue +38 -0
  125. package/components/icon/linkedin.vue +41 -0
  126. package/components/icon/location.vue +45 -0
  127. package/components/icon/lock-off.vue +45 -0
  128. package/components/icon/lock-on.vue +48 -0
  129. package/components/icon/marketplace.vue +43 -0
  130. package/components/icon/minus.vue +38 -0
  131. package/components/icon/money-bag.vue +37 -0
  132. package/components/icon/money.vue +35 -0
  133. package/components/icon/open-envelope.vue +45 -0
  134. package/components/icon/paper.vue +45 -0
  135. package/components/icon/payback.vue +37 -0
  136. package/components/icon/pencil.vue +45 -0
  137. package/components/icon/person-add.vue +41 -0
  138. package/components/icon/person-check.vue +41 -0
  139. package/components/icon/person-cross.vue +41 -0
  140. package/components/icon/person.vue +41 -0
  141. package/components/icon/phone.vue +41 -0
  142. package/components/icon/play.vue +41 -0
  143. package/components/icon/plus.vue +38 -0
  144. package/components/icon/roof.vue +37 -0
  145. package/components/icon/rooftop-solar.vue +37 -0
  146. package/components/icon/saving.vue +37 -0
  147. package/components/icon/search.vue +43 -0
  148. package/components/icon/settings-horizontal.vue +57 -0
  149. package/components/icon/settings-vertical.vue +57 -0
  150. package/components/icon/shield-with-check.vue +38 -0
  151. package/components/icon/shield.vue +41 -0
  152. package/components/icon/shopping-bag.vue +39 -0
  153. package/components/icon/solar.vue +37 -0
  154. package/components/icon/sound-down.vue +45 -0
  155. package/components/icon/sound-off.vue +41 -0
  156. package/components/icon/sound-on.vue +41 -0
  157. package/components/icon/sound-up.vue +41 -0
  158. package/components/icon/star-empty.vue +38 -0
  159. package/components/icon/star-full.vue +36 -0
  160. package/components/icon/star-half.vue +55 -0
  161. package/components/icon/state-ak.vue +53 -0
  162. package/components/icon/state-al.vue +38 -0
  163. package/components/icon/state-ar.vue +38 -0
  164. package/components/icon/state-az.vue +38 -0
  165. package/components/icon/state-ca.vue +38 -0
  166. package/components/icon/state-co.vue +38 -0
  167. package/components/icon/state-ct.vue +38 -0
  168. package/components/icon/state-dc.vue +52 -0
  169. package/components/icon/state-de.vue +38 -0
  170. package/components/icon/state-fl.vue +38 -0
  171. package/components/icon/state-ga.vue +38 -0
  172. package/components/icon/state-hi.vue +59 -0
  173. package/components/icon/state-ia.vue +38 -0
  174. package/components/icon/state-id.vue +38 -0
  175. package/components/icon/state-il.vue +38 -0
  176. package/components/icon/state-in.vue +38 -0
  177. package/components/icon/state-ks.vue +38 -0
  178. package/components/icon/state-ky.vue +38 -0
  179. package/components/icon/state-la.vue +38 -0
  180. package/components/icon/state-ma.vue +38 -0
  181. package/components/icon/state-md.vue +39 -0
  182. package/components/icon/state-me.vue +38 -0
  183. package/components/icon/state-mi.vue +38 -0
  184. package/components/icon/state-mn.vue +38 -0
  185. package/components/icon/state-mo.vue +38 -0
  186. package/components/icon/state-ms.vue +38 -0
  187. package/components/icon/state-mt.vue +38 -0
  188. package/components/icon/state-nc.vue +38 -0
  189. package/components/icon/state-nd.vue +38 -0
  190. package/components/icon/state-ne.vue +38 -0
  191. package/components/icon/state-nh.vue +38 -0
  192. package/components/icon/state-nj.vue +37 -0
  193. package/components/icon/state-nm.vue +38 -0
  194. package/components/icon/state-nv.vue +38 -0
  195. package/components/icon/state-ny.vue +41 -0
  196. package/components/icon/state-oh.vue +38 -0
  197. package/components/icon/state-ok.vue +38 -0
  198. package/components/icon/state-or.vue +38 -0
  199. package/components/icon/state-pa.vue +38 -0
  200. package/components/icon/state-ri.vue +38 -0
  201. package/components/icon/state-sc.vue +38 -0
  202. package/components/icon/state-sd.vue +38 -0
  203. package/components/icon/state-tn.vue +38 -0
  204. package/components/icon/state-tx.vue +38 -0
  205. package/components/icon/state-ut.vue +38 -0
  206. package/components/icon/state-va.vue +38 -0
  207. package/components/icon/state-vt.vue +38 -0
  208. package/components/icon/state-wa.vue +38 -0
  209. package/components/icon/state-wi.vue +38 -0
  210. package/components/icon/state-wv.vue +38 -0
  211. package/components/icon/state-wy.vue +38 -0
  212. package/components/icon/thumbs-up.vue +39 -0
  213. package/components/icon/trash-can.vue +41 -0
  214. package/components/icon/tree.vue +37 -0
  215. package/components/icon/twitter.vue +43 -0
  216. package/components/icon/upload.vue +41 -0
  217. package/components/icon/verified.vue +40 -0
  218. package/components/icon/video-play.vue +41 -0
  219. package/components/icon/wifi.vue +38 -0
  220. package/components/icon/x.vue +38 -0
  221. package/components/icon/youtube.vue +45 -0
  222. package/composables/forms.ts +124 -0
  223. package/nuxt.config.ts +83 -1
  224. package/package.json +47 -13
  225. package/tsconfig.json +4 -0
  226. package/types/es-carousel.ts +12 -0
  227. package/types/index.ts +1 -0
  228. package/utils/forms.ts +120 -0
  229. package/utils/get-es-footer-content.ts +90 -0
  230. package/utils/get-es-nav-bar-account-content.ts +55 -0
  231. package/utils/get-es-nav-bar-global-content.ts +482 -0
  232. package/utils/mime-type-finder.ts +48 -0
  233. package/utils/vuelidate-keys.ts +39 -0
  234. package/components/TestComponent.vue +0 -5
@@ -0,0 +1,279 @@
1
+ <script setup lang="ts">
2
+ useHead({
3
+ link: [
4
+ {
5
+ // https://web.dev/defer-non-critical-css/
6
+ href: 'https://assets.reviews.io/css/widgets/carousel-widget.css?_t=2023040418',
7
+ rel: 'preload',
8
+ as: 'style',
9
+ onload: "this.onload=null;this.rel='stylesheet'",
10
+ },
11
+ {
12
+ // https://web.dev/defer-non-critical-css/
13
+ href: 'https://assets.reviews.io/iconfont/reviewsio-icons/style.css?_t=2023040418',
14
+ rel: 'preload',
15
+ as: 'style',
16
+ onload: "this.onload=null;this.rel='stylesheet'",
17
+ },
18
+ ],
19
+ script: [
20
+ {
21
+ // https://developer.chrome.com/docs/lighthouse/performance/render-blocking-resources/#how-to-eliminate-render-blocking-scripts
22
+ src: 'https://widget.reviews.io/carousel-inline-iframeless/dist.js?_t=2023040418',
23
+ async: true,
24
+ },
25
+ ],
26
+ });
27
+
28
+ onBeforeUnmount(() => {
29
+ const widgetPrefixes = document.querySelectorAll('.CarouselWidget-prefix');
30
+ widgetPrefixes.forEach((prefix) => {
31
+ prefix.remove();
32
+ });
33
+ });
34
+
35
+ const initializeWidget = () => {
36
+ // if the Reviews.io script loaded before
37
+ // @ts-expect-error global-scoped ReviewsIO stuff
38
+ if (typeof window !== 'undefined' && window.carouselInlineWidget) {
39
+ // @ts-expect-error global-scoped ReviewsIO stuff
40
+ // eslint-disable-next-line no-new, new-cap
41
+ new window.carouselInlineWidget('reviewsio-carousel-widget', {
42
+ /* Your REVIEWS.io account ID: */
43
+ store: 'energy-sage',
44
+ sku: '',
45
+ lang: 'en',
46
+ carousel_type: 'topHeader',
47
+ styles_carousel: 'CarouselWidget--topHeader--withcards',
48
+
49
+ /* Widget settings: */
50
+ options: {
51
+ general: {
52
+ // UNDOCUMENTED??
53
+ // Disables rich snippet injection; ls+json data and what else who knows....
54
+ enable_richsnippets_company: false,
55
+ /* What reviews should the widget display? Available options: company, product,
56
+ third_party. You can choose one type or multiple separated by comma. */
57
+ review_type: 'company',
58
+ /* Minimum number of reviews required for widget to be displayed */
59
+ min_reviews: '1',
60
+ /* Maximum number of reviews to include in the carousel widget. */
61
+ max_reviews: '10',
62
+ address_format: 'CITY, COUNTRY',
63
+ /* Carousel auto-scrolling speed. 3000 = 3 seconds. If you want to disable auto-scroll,
64
+ set this value to false. */
65
+ enable_auto_scroll: false,
66
+ },
67
+ header: {
68
+ /* Show overall rating stars */
69
+ enable_overall_stars: true,
70
+ rating_decimal_places: 2,
71
+ },
72
+ reviews: {
73
+ /* Show customer name */
74
+ enable_customer_name: true,
75
+ /* Show customer location */
76
+ enable_customer_location: true,
77
+ /* Show "verified review" badge */
78
+ enable_verified_badge: true,
79
+ /* Show "verified subscriber" badge */
80
+ enable_subscriber_badge: true,
81
+ /* Show "I recommend this product" badge (Only for product reviews) */
82
+ enable_recommends_badge: true,
83
+ /* Show photos attached to reviews */
84
+ enable_photos: false,
85
+ /* Show videos attached to reviews */
86
+ enable_videos: false,
87
+ /* Show when review was written */
88
+ enable_review_date: true,
89
+ /* Hide reviews written by the same customer
90
+ (This may occur when customer reviews multiple products) */
91
+ disable_same_customer: true,
92
+ /* Minimum star rating */
93
+ min_review_percent: 4,
94
+ /* Show 3rd party review source */
95
+ third_party_source: true,
96
+ /* Hide reviews without comments (still shows if review has a photo) */
97
+ hide_empty_reviews: true,
98
+ /* Show product name */
99
+ enable_product_name: true,
100
+ /* Show only reviews which have specific tags (multiple semicolon
101
+ separated tags allowed i.e tag1;tag2) */
102
+ tags: 'es-featured',
103
+ /* Show branch, only one input */
104
+ branch: '',
105
+ enable_branch_name: false,
106
+ },
107
+ popups: {
108
+ /* Make review items clickable (When they are clicked, a popup appears
109
+ with more information about a customer and review) */
110
+ enable_review_popups: true,
111
+ /* Show "was this review helpful" buttons */
112
+ enable_helpful_buttons: false,
113
+ /* Show how many times review was upvoted as helpful */
114
+ enable_helpful_count: false,
115
+ /* Show share buttons */
116
+ enable_share_buttons: false,
117
+ },
118
+ },
119
+ translations: {
120
+ verified_customer: 'Verified Customer',
121
+ },
122
+ /**
123
+ * The styles below, if uncommented, are inserted via JS, which violates our CSP.
124
+ * They are only used for customization, and we are only customizing one of these variables.
125
+ * See _reviews.scss for the place to safely include the necessary variables.
126
+ * This list is preserved here for reference, in case more customization is needed.
127
+ */
128
+ /* styles: {
129
+ // Base font size is a reference size for all text elements. When base value gets changed,
130
+ all TextHeading and TexBody elements get proportionally adjusted.
131
+ '--base-font-size': '16px',
132
+ '--base-maxwidth': '100%',
133
+
134
+ // Logo styles:
135
+ '--reviewsio-logo-style': 'var(--logo-normal)',
136
+
137
+ // Star styles
138
+ '--common-star-color': ' #0E1311',
139
+ '--common-star-disabled-color': ' rgba(0,0,0,0.25)',
140
+ '--medium-star-size': ' 22px',
141
+ '--small-star-size': '19px', // Modal
142
+ '--x-small-star-size': '16px',
143
+ '--x-small-star-display': 'inline-flex',
144
+
145
+ // Header styles:
146
+ '--header-order': '1',
147
+ '--header-width': '160px',
148
+ '--header-bg-start-color': 'transparent',
149
+ '--header-bg-end-color': 'transparent',
150
+ '--header-gradient-direction': '135deg',
151
+ '--header-padding': '0.5em',
152
+ '--header-border-width': '0px',
153
+ '--header-border-color': 'rgba(0,0,0,0.1)',
154
+ '--header-border-radius': '0px',
155
+ '--header-shadow-size': '0px',
156
+ '--header-shadow-color': 'rgba(0, 0, 0, 0.1)',
157
+
158
+ // Header content styles:
159
+ '--header-star-color': 'inherit',
160
+ '--header-disabled-star-color': 'inherit',
161
+ '--header-heading-text-color': 'inherit',
162
+ '--header-heading-font-size': 'inherit',
163
+ '--header-heading-font-weight': 'inherit',
164
+ '--header-heading-line-height': 'inherit',
165
+ '--header-heading-text-transform': 'inherit',
166
+ '--header-subheading-text-color': 'inherit',
167
+ '--header-subheading-font-size': 'inherit',
168
+ '--header-subheading-font-weight': 'inherit',
169
+ '--header-subheading-line-height': 'inherit',
170
+ '--header-subheading-text-transform': 'inherit',
171
+
172
+ // Review item styles:
173
+ '--item-maximum-columns': '5', // Must be 3 or larger
174
+ '--item-background-start-color': '#ffffff',
175
+ '--item-background-end-color': '#ffffff',
176
+ '--item-gradient-direction': '135deg',
177
+ '--item-padding': '1.5em',
178
+ '--item-border-width': '0px',
179
+ '--item-border-color': 'rgba(0,0,0,0.1)',
180
+ '--item-border-radius': '12px',
181
+ '--item-shadow-size': '10px',
182
+ '--item-shadow-color': 'rgba(0,0,0,0.05)',
183
+
184
+ // Heading styles:
185
+ '--heading-text-color': ' #0E1311',
186
+ '--heading-text-font-weight': ' 600',
187
+ '--heading-text-font-family': ' inherit',
188
+ '--heading-text-line-height': ' 1.4',
189
+ '--heading-text-letter-spacing': '0',
190
+ '--heading-text-transform': 'none',
191
+
192
+ // Body text styles:
193
+ '--body-text-color': ' #0E1311',
194
+ '--body-text-font-weight': '400',
195
+ '--body-text-font-family': ' inherit',
196
+ '--body-text-line-height': ' 1.4',
197
+ '--body-text-letter-spacing': '0',
198
+ '--body-text-transform': 'none',
199
+
200
+ // Scroll button styles:
201
+ '--scroll-button-icon-color': '#0E1311',
202
+ '--scroll-button-icon-size': '24px',
203
+ '--scroll-button-bg-color': 'transparent',
204
+
205
+ '--scroll-button-border-width': '0px',
206
+ '--scroll-button-border-color': 'rgba(0,0,0,0.1)',
207
+
208
+ '--scroll-button-border-radius': '60px',
209
+ '--scroll-button-shadow-size': '0px',
210
+ '--scroll-button-shadow-color': 'rgba(0,0,0,0.1)',
211
+ '--scroll-button-horizontal-position': '0px',
212
+ '--scroll-button-vertical-position': '0px',
213
+
214
+ // Badge styles:
215
+ '--badge-icon-color': '#0E1311',
216
+ '--badge-icon-font-size': '15px',
217
+ '--badge-text-color': '#0E1311',
218
+ '--badge-text-font-size': 'inherit',
219
+ '--badge-text-letter-spacing': 'inherit',
220
+ '--badge-text-transform': 'inherit',
221
+
222
+ // Author styles:
223
+ '--author-font-size': 'inherit',
224
+ '--author-font-weight': 'inherit',
225
+ '--author-text-transform': 'inherit',
226
+
227
+ // Product photo or review photo styles:
228
+ '--photo-video-thumbnail-size': '60px',
229
+ '--photo-video-thumbnail-border-radius': '0px',
230
+
231
+ // Popup styles:
232
+ '--popup-backdrop-color': 'rgba(0,0,0,0.75)',
233
+ '--popup-color': '#ffffff',
234
+ '--popup-star-color': 'inherit',
235
+ '--popup-disabled-star-color': 'inherit',
236
+ '--popup-heading-text-color': 'inherit',
237
+ '--popup-body-text-color': 'inherit',
238
+ '--popup-badge-icon-color': 'inherit',
239
+ '--popup-badge-icon-font-size': '19px',
240
+ '--popup-badge-text-color': 'inherit',
241
+ '--popup-badge-text-font-size': '14px',
242
+ '--popup-border-width': '0px',
243
+ '--popup-border-color': 'rgba(0,0,0,0.1)',
244
+ '--popup-border-radius': '0px',
245
+ '--popup-shadow-size': '0px',
246
+ '--popup-shadow-color': 'rgba(0,0,0,0.1)',
247
+ '--popup-icon-color': '#0E1311',
248
+
249
+ // Tooltip styles:
250
+ '--tooltip-bg-color': '#0E1311',
251
+ '--tooltip-text-color': '#ffffff',
252
+ }, */
253
+ });
254
+ }
255
+ };
256
+
257
+ onMounted(async () => {
258
+ // if we're server-side, get out
259
+ if (typeof window === 'undefined') return;
260
+
261
+ // @ts-expect-error global-scoped ReviewsIO stuff
262
+ if (window.carouselInlineWidget) {
263
+ // if the Reviews.io script has loaded, initialize the widget
264
+ initializeWidget();
265
+ } else {
266
+ // if the Reviews.io script has not loaded, set its callback function to trigger widget initialization
267
+ // @ts-expect-error global-scoped ReviewsIO stuff
268
+ window.carouselInlineWidgetCallback = () => {
269
+ initializeWidget();
270
+ };
271
+ }
272
+ });
273
+ </script>
274
+
275
+ <template>
276
+ <div
277
+ id="reviewsio-carousel-widget"
278
+ class="EsReviewsIoCardCarousel" />
279
+ </template>
@@ -0,0 +1,5 @@
1
+ <template>
2
+ <div class="row">
3
+ <slot />
4
+ </div>
5
+ </template>
@@ -0,0 +1,38 @@
1
+ <script setup lang="ts">
2
+ const props = defineProps({
3
+ aspect: {
4
+ type: String,
5
+ default: '16:9',
6
+ },
7
+ noAspect: {
8
+ type: Boolean,
9
+ default: false,
10
+ },
11
+ });
12
+
13
+ const aspects = props.aspect.split(':');
14
+ const aspectRatio = computed(() => `${(parseFloat(aspects[1]) / parseFloat(aspects[0])) * 100}%`);
15
+ </script>
16
+
17
+ <template>
18
+ <!-- if noAspect is set, pass along to esSkeleton with all other props -->
19
+ <es-skeleton
20
+ v-if="noAspect"
21
+ v-bind="$attrs" />
22
+ <!-- if setting the aspect ratio, wrap skeleton in containers to determine responsive size -->
23
+ <!-- based on Bootstrap Aspect -->
24
+ <div
25
+ v-else
26
+ class="d-flex">
27
+ <div
28
+ class="flex-grow-1"
29
+ :style="{ 'padding-bottom': aspectRatio, height: '0px' }" />
30
+ <div
31
+ class="flex-grow-1 w-100 mw-100"
32
+ style="margin-left: -100%">
33
+ <es-skeleton
34
+ v-bind="$attrs"
35
+ class="h-100 w-100" />
36
+ </div>
37
+ </div>
38
+ </template>
@@ -0,0 +1,17 @@
1
+ <script setup lang="ts">
2
+ defineProps({
3
+ loading: {
4
+ type: Boolean,
5
+ default: false,
6
+ },
7
+ });
8
+ </script>
9
+
10
+ <template>
11
+ <div>
12
+ <slot
13
+ v-if="loading"
14
+ name="loading" />
15
+ <slot v-else />
16
+ </div>
17
+ </template>
@@ -0,0 +1,97 @@
1
+ <script setup lang="ts">
2
+ import Skeleton from 'primevue/skeleton';
3
+
4
+ defineProps({
5
+ animation: {
6
+ type: String,
7
+ default: 'wave',
8
+ validator: (val: string) => ['wave', 'fade', 'none'].includes(val as string),
9
+ },
10
+ height: {
11
+ type: String,
12
+ default: '1rem',
13
+ },
14
+ width: {
15
+ type: String,
16
+ default: 'auto',
17
+ },
18
+ size: {
19
+ type: String,
20
+ default: null,
21
+ },
22
+ });
23
+ </script>
24
+
25
+ <template>
26
+ <skeleton
27
+ :height="size ? size : height"
28
+ :width="size ? size : width"
29
+ class="es-skeleton rounded-xs mb-25 bg-gray-200"
30
+ :class="{
31
+ 'es-skeleton-wave': animation == 'wave',
32
+ 'es-skeleton-fade': animation == 'fade',
33
+ }" />
34
+ </template>
35
+
36
+ <style lang="scss" scoped>
37
+ @use '@energysage/es-ds-styles/scss/variables' as variables;
38
+
39
+ @keyframes skeleton-animate-wave {
40
+ 0% {
41
+ transform: translateX(-100%);
42
+ }
43
+ 100% {
44
+ transform: translateX(100%);
45
+ }
46
+ }
47
+
48
+ @keyframes skeleton-animate-fade {
49
+ 0% {
50
+ opacity: 1;
51
+ }
52
+ 100% {
53
+ opacity: 0.4;
54
+ }
55
+ }
56
+
57
+ .es-skeleton {
58
+ overflow: hidden;
59
+
60
+ &-wave:after {
61
+ content: '';
62
+ height: 100%;
63
+ position: absolute;
64
+ left: 0;
65
+ right: 0;
66
+ top: 0;
67
+ z-index: 1;
68
+ // wave animation from PrimeVue Skeleton
69
+ background-image: linear-gradient(
70
+ 90deg,
71
+ rgba(variables.$white, 0),
72
+ rgba(variables.$white, 0.4),
73
+ rgba(variables.$white, 0)
74
+ );
75
+ animation-name: skeleton-animate-wave;
76
+ animation-duration: 1.2s;
77
+ animation-timing-function: ease;
78
+ animation-delay: 0s;
79
+ animation-iteration-count: infinite;
80
+ animation-direction: normal;
81
+ animation-fill-mode: none;
82
+ animation-play-state: running;
83
+ }
84
+
85
+ &-fade {
86
+ // fade animation from Bootstrap Skeleton
87
+ animation-name: skeleton-animate-fade;
88
+ animation-duration: 0.875s;
89
+ animation-timing-function: ease-in-out;
90
+ animation-delay: 0s;
91
+ animation-iteration-count: infinite;
92
+ animation-direction: alternate;
93
+ animation-fill-mode: none;
94
+ animation-play-state: running;
95
+ }
96
+ }
97
+ </style>
@@ -0,0 +1,218 @@
1
+ <script setup lang="ts">
2
+ import Slider from 'primevue/slider';
3
+
4
+ const props = defineProps({
5
+ /**
6
+ * Aria label for slider handle
7
+ */
8
+ ariaLabel: {
9
+ type: String,
10
+ default: null,
11
+ },
12
+ /**
13
+ * An id of the element whose contents describe this slider
14
+ */
15
+ ariaLabelledby: {
16
+ type: String,
17
+ default: null,
18
+ },
19
+ /**
20
+ * Indicates whether or not the slider should be disabled
21
+ */
22
+ disabled: {
23
+ type: Boolean,
24
+ default: false,
25
+ },
26
+ /**
27
+ * Function that modifies label value
28
+ */
29
+ labelFormatter: {
30
+ type: Function,
31
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
32
+ default: (val: any) => val,
33
+ },
34
+ /**
35
+ * Maximum value of slider
36
+ */
37
+ max: {
38
+ type: Number,
39
+ required: true,
40
+ default: 100,
41
+ },
42
+ /**
43
+ * Minimum value of slider
44
+ */
45
+ min: {
46
+ type: Number,
47
+ required: true,
48
+ default: 1,
49
+ },
50
+ /**
51
+ * Starting value of slider thumb
52
+ */
53
+ startingValue: {
54
+ type: Number,
55
+ default: null,
56
+ },
57
+ /**
58
+ * Step increment
59
+ */
60
+ step: {
61
+ type: Number,
62
+ default: 1,
63
+ },
64
+ /**
65
+ * Function that modifies tooltip value
66
+ */
67
+ tooltipFormatter: {
68
+ type: Function,
69
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
70
+ default: (val: any) => val,
71
+ },
72
+ });
73
+
74
+ // allow use of v-model on this component
75
+ // and only use props.startingValue if it's provided, otherwise use the value from the v-model
76
+ const model = defineModel<number | number[]>();
77
+ model.value = props.startingValue !== null ? props.startingValue : model.value;
78
+ </script>
79
+
80
+ <template>
81
+ <div :class="{ 'es-slider--disabled': props.disabled }">
82
+ <slider
83
+ v-model="model"
84
+ v-bind="$attrs"
85
+ :aria-disabled="disabled"
86
+ :disabled="disabled"
87
+ :min="min"
88
+ :max="max"
89
+ :step="step"
90
+ :aria-labelledby="ariaLabelledby"
91
+ :aria-label="ariaLabel"
92
+ :pt="{
93
+ root: {
94
+ class: 'es-slider-root',
95
+ },
96
+ range: {
97
+ class: 'es-slider-range',
98
+ },
99
+ handle: {
100
+ class: 'es-slider-handle',
101
+ },
102
+ }" />
103
+ <!--
104
+ this is aria-hidden because the slider already uses the aria-valuemin and aria-value-max
105
+ attributes to indicate the minimum and maximum value, so these labels are just for visual users
106
+ -->
107
+ <div
108
+ aria-hidden
109
+ class="es-slider-labels d-flex flex-row font-weight-bold justify-content-between text-gray-700">
110
+ <span>{{ labelFormatter(min) }}</span>
111
+ <span>{{ labelFormatter(max) }}</span>
112
+ </div>
113
+ </div>
114
+ </template>
115
+
116
+ <style lang="scss" scoped>
117
+ @use '@energysage/es-ds-styles/scss/variables' as variables;
118
+
119
+ $hover-focus-animation-duration: 0.15s;
120
+ $slide-animation-duration: 0.05s;
121
+
122
+ :deep(.es-slider-root) {
123
+ background-color: variables.$gray-200;
124
+ border-radius: 15px;
125
+ height: 10px;
126
+ margin-bottom: 1rem;
127
+ position: relative;
128
+
129
+ &[data-p-sliding='true'] .slider-handle {
130
+ box-shadow: 0 0 0 9px variables.$blue-50;
131
+ }
132
+ }
133
+
134
+ :deep(.es-slider-range) {
135
+ background: linear-gradient(90deg, variables.$blue-400, variables.$blue-800);
136
+ border-radius: 15px;
137
+ height: 10px;
138
+
139
+ @media not (prefers-reduced-motion) {
140
+ transition: width $slide-animation-duration ease-in-out;
141
+ }
142
+ }
143
+
144
+ :deep(.es-slider-handle) {
145
+ background-color: variables.$white;
146
+ border: 9px solid variables.$blue-700;
147
+ border-radius: 50%;
148
+ box-shadow: 0 1px 6px 0 rgba(34, 38, 51, 0.25);
149
+ cursor: pointer;
150
+ height: 28px;
151
+ /* important to prevent sliding from attempting to horizontally scroll on mobile */
152
+ touch-action: none;
153
+ transform: translate(-54%, -32%);
154
+ width: 28px;
155
+
156
+ @media not (prefers-reduced-motion) {
157
+ transition:
158
+ box-shadow $hover-focus-animation-duration ease-in-out,
159
+ left $slide-animation-duration ease-in-out;
160
+ }
161
+
162
+ &:focus-visible {
163
+ outline: none;
164
+ }
165
+
166
+ &:hover {
167
+ box-shadow: 0 0 0 9px variables.$blue-50;
168
+ }
169
+
170
+ &:focus {
171
+ box-shadow: 0 0 0 9px variables.$blue-300;
172
+ }
173
+ }
174
+
175
+ // "tooltip"
176
+ :deep(.es-slider-handle::before) {
177
+ align-items: center;
178
+ background-color: variables.$blue-600;
179
+ border-radius: 50%;
180
+ bottom: 32px;
181
+ box-shadow: 0 1px 6px 0 rgba(34, 38, 51, 0.25);
182
+ color: variables.$white;
183
+ content: v-bind("`'${tooltipFormatter(model)}'`");
184
+ display: flex;
185
+ font-weight: variables.$font-weight-bold;
186
+ height: 52px;
187
+ justify-content: center;
188
+ padding-bottom: 2px;
189
+ position: absolute;
190
+ right: -22px;
191
+ width: 52px;
192
+ }
193
+
194
+ .es-slider--disabled {
195
+ /* at least prevents click/tap from giving it focus, if not keyboard */
196
+ pointer-events: none;
197
+
198
+ :deep(.es-slider-range) {
199
+ /* use background instead of background-color here to clear out the linear-gradient */
200
+ background: variables.$gray-400;
201
+ }
202
+
203
+ :deep(.es-slider-handle) {
204
+ border-color: variables.$gray-400;
205
+ box-shadow: none;
206
+
207
+ &::before {
208
+ background-color: variables.$gray-300;
209
+ color: variables.$gray-500;
210
+ }
211
+ }
212
+
213
+ .es-slider-labels {
214
+ /* use important to override the utility class */
215
+ color: variables.$gray-500 !important;
216
+ }
217
+ }
218
+ </style>
@@ -0,0 +1,22 @@
1
+ <script setup lang="ts">
2
+ defineProps({
3
+ label: {
4
+ type: String,
5
+ required: true,
6
+ },
7
+ role: {
8
+ type: String,
9
+ default: 'status',
10
+ },
11
+ });
12
+ </script>
13
+
14
+ <template>
15
+ <span
16
+ :role="role"
17
+ class="spinner-border">
18
+ <span class="sr-only">
19
+ {{ label }}
20
+ </span>
21
+ </span>
22
+ </template>