cja-phoenix 1.2.39 → 1.2.41

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 (184) hide show
  1. package/dist/module.d.mts +6 -2
  2. package/dist/module.json +1 -1
  3. package/dist/module.mjs +29 -16
  4. package/dist/runtime/assets/iconia/fonts/CGG-icomoon.svg +94 -0
  5. package/dist/runtime/assets/iconia/fonts/CGG-icomoon.ttf +0 -0
  6. package/dist/runtime/assets/iconia/fonts/CGG-icomoon.woff +0 -0
  7. package/dist/runtime/assets/iconia/selection.json +1 -0
  8. package/dist/runtime/assets/iconia/style.css +281 -0
  9. package/dist/runtime/assets/scss/main.scss +6 -0
  10. package/dist/runtime/assets/scss/mixins/_funnel.scss +15 -0
  11. package/dist/runtime/assets/scss/mixins/_index.scss +46 -0
  12. package/dist/runtime/assets/scss/mixins/_media-queries.scss +109 -0
  13. package/dist/runtime/assets/scss/mixins/_results.scss +235 -0
  14. package/dist/runtime/assets/scss/tippy.scss +31 -0
  15. package/dist/runtime/assets/scss/variables/_breakpoints.scss +18 -0
  16. package/dist/runtime/assets/scss/variables/_colors.scss +100 -0
  17. package/dist/runtime/assets/scss/variables/_forms.scss +121 -0
  18. package/dist/runtime/assets/scss/variables/_grid.scss +12 -0
  19. package/dist/runtime/assets/scss/variables/_index.scss +6 -0
  20. package/dist/runtime/assets/scss/variables/_shadows.scss +7 -0
  21. package/dist/runtime/assets/scss/variables/_z-index.scss +6 -0
  22. package/dist/runtime/components/CjaButton.d.vue.ts +33 -0
  23. package/dist/runtime/components/CjaButton.vue +437 -0
  24. package/dist/runtime/components/CjaButton.vue.d.ts +33 -0
  25. package/dist/runtime/components/CollapseContainer.d.vue.ts +35 -0
  26. package/dist/runtime/components/CollapseContainer.vue +112 -0
  27. package/dist/runtime/components/CollapseContainer.vue.d.ts +35 -0
  28. package/dist/runtime/components/ContentTabs.d.vue.ts +23 -0
  29. package/dist/runtime/components/ContentTabs.vue +103 -0
  30. package/dist/runtime/components/ContentTabs.vue.d.ts +23 -0
  31. package/dist/runtime/components/Drawer.d.vue.ts +52 -0
  32. package/dist/runtime/components/Drawer.vue +169 -0
  33. package/dist/runtime/components/Drawer.vue.d.ts +52 -0
  34. package/dist/runtime/components/FixedContainer.d.vue.ts +37 -0
  35. package/dist/runtime/components/FixedContainer.vue +95 -0
  36. package/dist/runtime/components/FixedContainer.vue.d.ts +37 -0
  37. package/dist/runtime/components/GridContainer.d.vue.ts +13 -0
  38. package/dist/runtime/components/GridContainer.vue +37 -0
  39. package/dist/runtime/components/GridContainer.vue.d.ts +13 -0
  40. package/dist/runtime/components/GridItem.d.vue.ts +29 -0
  41. package/dist/runtime/components/GridItem.vue +93 -0
  42. package/dist/runtime/components/GridItem.vue.d.ts +29 -0
  43. package/dist/runtime/components/InfoMessage.d.vue.ts +28 -0
  44. package/dist/runtime/components/InfoMessage.vue +141 -0
  45. package/dist/runtime/components/InfoMessage.vue.d.ts +28 -0
  46. package/dist/runtime/components/LoadingSpinner.d.vue.ts +10 -0
  47. package/dist/runtime/components/LoadingSpinner.vue +39 -0
  48. package/dist/runtime/components/LoadingSpinner.vue.d.ts +10 -0
  49. package/dist/runtime/components/Modal.d.vue.ts +39 -0
  50. package/dist/runtime/components/Modal.vue +195 -0
  51. package/dist/runtime/components/Modal.vue.d.ts +39 -0
  52. package/dist/runtime/components/Scaffold.d.vue.ts +13 -0
  53. package/dist/runtime/components/Scaffold.vue +3 -0
  54. package/dist/runtime/components/Scaffold.vue.d.ts +13 -0
  55. package/dist/runtime/components/StickyContainer.d.vue.ts +21 -0
  56. package/dist/runtime/components/StickyContainer.vue +57 -0
  57. package/dist/runtime/components/StickyContainer.vue.d.ts +21 -0
  58. package/dist/runtime/components/form/CheckboxInput.d.vue.ts +42 -0
  59. package/dist/runtime/components/form/CheckboxInput.vue +163 -0
  60. package/dist/runtime/components/form/CheckboxInput.vue.d.ts +42 -0
  61. package/dist/runtime/components/form/CheckboxInputList.d.vue.ts +37 -0
  62. package/dist/runtime/components/form/CheckboxInputList.vue +84 -0
  63. package/dist/runtime/components/form/CheckboxInputList.vue.d.ts +37 -0
  64. package/dist/runtime/components/form/CurrencyInput.d.vue.ts +37 -0
  65. package/dist/runtime/components/form/CurrencyInput.vue +134 -0
  66. package/dist/runtime/components/form/CurrencyInput.vue.d.ts +37 -0
  67. package/dist/runtime/components/form/DateInput.d.vue.ts +40 -0
  68. package/dist/runtime/components/form/DateInput.vue +325 -0
  69. package/dist/runtime/components/form/DateInput.vue.d.ts +40 -0
  70. package/dist/runtime/components/form/FileInput.d.vue.ts +46 -0
  71. package/dist/runtime/components/form/FileInput.vue +202 -0
  72. package/dist/runtime/components/form/FileInput.vue.d.ts +46 -0
  73. package/dist/runtime/components/form/NumberInput.d.vue.ts +41 -0
  74. package/dist/runtime/components/form/NumberInput.vue +162 -0
  75. package/dist/runtime/components/form/NumberInput.vue.d.ts +41 -0
  76. package/dist/runtime/components/form/PhoneInput.d.vue.ts +44 -0
  77. package/dist/runtime/components/form/PhoneInput.vue +143 -0
  78. package/dist/runtime/components/form/PhoneInput.vue.d.ts +44 -0
  79. package/dist/runtime/components/form/RadioInput.d.vue.ts +42 -0
  80. package/dist/runtime/components/form/RadioInput.vue +181 -0
  81. package/dist/runtime/components/form/RadioInput.vue.d.ts +42 -0
  82. package/dist/runtime/components/form/RadioInputList.d.vue.ts +57 -0
  83. package/dist/runtime/components/form/RadioInputList.vue +130 -0
  84. package/dist/runtime/components/form/RadioInputList.vue.d.ts +57 -0
  85. package/dist/runtime/components/form/SelectInput.d.vue.ts +46 -0
  86. package/dist/runtime/components/form/SelectInput.vue +362 -0
  87. package/dist/runtime/components/form/SelectInput.vue.d.ts +46 -0
  88. package/dist/runtime/components/form/SelectionTiles.d.vue.ts +44 -0
  89. package/dist/runtime/components/form/SelectionTiles.vue +329 -0
  90. package/dist/runtime/components/form/SelectionTiles.vue.d.ts +44 -0
  91. package/dist/runtime/components/form/SliderInput.d.vue.ts +51 -0
  92. package/dist/runtime/components/form/SliderInput.vue +175 -0
  93. package/dist/runtime/components/form/SliderInput.vue.d.ts +51 -0
  94. package/dist/runtime/components/form/TextInput.d.vue.ts +56 -0
  95. package/dist/runtime/components/form/TextInput.vue +227 -0
  96. package/dist/runtime/components/form/TextInput.vue.d.ts +56 -0
  97. package/dist/runtime/components/form/TextareaInput.d.vue.ts +37 -0
  98. package/dist/runtime/components/form/TextareaInput.vue +76 -0
  99. package/dist/runtime/components/form/TextareaInput.vue.d.ts +37 -0
  100. package/dist/runtime/components/form/TileCheckboxInput.d.vue.ts +40 -0
  101. package/dist/runtime/components/form/TileCheckboxInput.vue +108 -0
  102. package/dist/runtime/components/form/TileCheckboxInput.vue.d.ts +40 -0
  103. package/dist/runtime/components/form/ToggleInput.d.vue.ts +43 -0
  104. package/dist/runtime/components/form/ToggleInput.vue +119 -0
  105. package/dist/runtime/components/form/ToggleInput.vue.d.ts +43 -0
  106. package/dist/runtime/components/form/structure/Container.d.vue.ts +16 -0
  107. package/dist/runtime/components/form/structure/Container.vue +31 -0
  108. package/dist/runtime/components/form/structure/Container.vue.d.ts +16 -0
  109. package/dist/runtime/components/form/structure/Description.d.vue.ts +9 -0
  110. package/dist/runtime/components/form/structure/Description.vue +26 -0
  111. package/dist/runtime/components/form/structure/Description.vue.d.ts +9 -0
  112. package/dist/runtime/components/form/structure/Error.d.vue.ts +9 -0
  113. package/dist/runtime/components/form/structure/Error.vue +23 -0
  114. package/dist/runtime/components/form/structure/Error.vue.d.ts +9 -0
  115. package/dist/runtime/components/form/structure/Title.d.vue.ts +12 -0
  116. package/dist/runtime/components/form/structure/Title.vue +43 -0
  117. package/dist/runtime/components/form/structure/Title.vue.d.ts +12 -0
  118. package/dist/runtime/components/funnel/Header.d.vue.ts +18 -0
  119. package/dist/runtime/components/funnel/Header.vue +62 -0
  120. package/dist/runtime/components/funnel/Header.vue.d.ts +18 -0
  121. package/dist/runtime/composables/useCjaGtm.d.ts +19 -0
  122. package/dist/runtime/composables/useCjaGtm.js +164 -0
  123. package/dist/runtime/composables/useFunnelConfig.d.ts +11 -0
  124. package/dist/runtime/composables/useFunnelConfig.js +51 -0
  125. package/dist/runtime/composables/useFunnelSummary.d.ts +14 -0
  126. package/dist/runtime/composables/useFunnelSummary.js +16 -0
  127. package/dist/runtime/composables/useHeaderHeight.d.ts +3 -0
  128. package/dist/runtime/composables/useHeaderHeight.js +24 -0
  129. package/dist/runtime/composables/useJourneyConfig.d.ts +11 -0
  130. package/dist/runtime/composables/useJourneyConfig.js +13 -0
  131. package/dist/runtime/composables/useValidateForm.d.ts +11 -0
  132. package/dist/runtime/composables/useValidateForm.js +33 -0
  133. package/dist/runtime/data/dialCodes.d.ts +7 -0
  134. package/dist/runtime/data/dialCodes.js +1466 -0
  135. package/dist/runtime/data/phoneDigits.d.ts +2 -0
  136. package/dist/runtime/data/phoneDigits.js +231 -0
  137. package/dist/runtime/plugins/tippy.d.ts +4 -0
  138. package/dist/runtime/plugins/tippy.js +12 -0
  139. package/dist/runtime/plugins/v-calendar.d.ts +3 -0
  140. package/dist/runtime/plugins/v-calendar.js +6 -0
  141. package/dist/runtime/server/tsconfig.json +3 -0
  142. package/dist/runtime/types/Form.d.ts +34 -0
  143. package/dist/runtime/types/Form.js +20 -0
  144. package/dist/runtime/types/Grid.d.ts +4 -0
  145. package/dist/runtime/types/Grid.js +0 -0
  146. package/dist/runtime/types/Icon.d.ts +2 -0
  147. package/dist/runtime/types/Icon.js +85 -0
  148. package/dist/runtime/types/JourneyConfig.d.ts +9 -0
  149. package/dist/runtime/types/JourneyConfig.js +0 -0
  150. package/dist/runtime/types/index.d.ts +4 -0
  151. package/dist/runtime/types/index.js +4 -0
  152. package/dist/runtime/utils/applyProductData.d.ts +10 -0
  153. package/dist/runtime/utils/applyProductData.js +22 -0
  154. package/dist/runtime/utils/convertDate.d.ts +5 -0
  155. package/dist/runtime/utils/convertDate.js +17 -0
  156. package/dist/runtime/utils/findScrollAncestor.d.ts +1 -0
  157. package/dist/runtime/utils/findScrollAncestor.js +14 -0
  158. package/dist/runtime/utils/formValidations.d.ts +78 -0
  159. package/dist/runtime/utils/formValidations.js +180 -0
  160. package/dist/runtime/utils/formatValue.d.ts +4 -0
  161. package/dist/runtime/utils/formatValue.js +20 -0
  162. package/dist/runtime/utils/getAbTestVersion.d.ts +9 -0
  163. package/dist/runtime/utils/getAbTestVersion.js +48 -0
  164. package/dist/runtime/utils/getCalendarUrl.d.ts +8 -0
  165. package/dist/runtime/utils/getCalendarUrl.js +24 -0
  166. package/dist/runtime/utils/getFromUrl.d.ts +2 -0
  167. package/dist/runtime/utils/getFromUrl.js +25 -0
  168. package/dist/runtime/utils/getStoryblokUrl.d.ts +71 -0
  169. package/dist/runtime/utils/getStoryblokUrl.js +35 -0
  170. package/dist/runtime/utils/jsonReviver.d.ts +1 -0
  171. package/dist/runtime/utils/jsonReviver.js +18 -0
  172. package/dist/runtime/utils/mediaBreakpoints.d.ts +28 -0
  173. package/dist/runtime/utils/mediaBreakpoints.js +28 -0
  174. package/dist/runtime/utils/toggleScroll.d.ts +1 -0
  175. package/dist/runtime/utils/toggleScroll.js +6 -0
  176. package/dist/runtime/utils/updateForm.d.ts +11 -0
  177. package/dist/runtime/utils/updateForm.js +74 -0
  178. package/dist/runtime/utils/updateMarketingConsent.d.ts +4 -0
  179. package/dist/runtime/utils/updateMarketingConsent.js +13 -0
  180. package/dist/runtime/utils/uploadFile.d.ts +8 -0
  181. package/dist/runtime/utils/uploadFile.js +13 -0
  182. package/dist/types.d.mts +6 -10
  183. package/package.json +9 -8
  184. package/dist/module.d.cts +0 -2
@@ -0,0 +1,33 @@
1
+ import type { AnchorHTMLAttributes } from "vue";
2
+ import type { Icon } from "../types/Icon.js";
3
+ type __VLS_Props = {
4
+ type?: "primary" | "secondary" | "tertiary";
5
+ color?: "blue" | "orange" | "white" | "light-blue" | "gradient-green-blue";
6
+ textAlign?: "center" | "left" | "right";
7
+ size?: "sm" | "md" | "lg";
8
+ shadow?: boolean;
9
+ iconRight?: Icon;
10
+ iconLeft?: Icon;
11
+ iconOnly?: boolean;
12
+ loading?: boolean;
13
+ href?: AnchorHTMLAttributes["href"];
14
+ target?: AnchorHTMLAttributes["target"];
15
+ };
16
+ declare var __VLS_14: {};
17
+ type __VLS_Slots = {} & {
18
+ default?: (props: typeof __VLS_14) => any;
19
+ };
20
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
21
+ type: "primary" | "secondary" | "tertiary";
22
+ size: "sm" | "md" | "lg";
23
+ color: "blue" | "orange" | "white" | "light-blue" | "gradient-green-blue";
24
+ textAlign: "center" | "left" | "right";
25
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
26
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
27
+ declare const _default: typeof __VLS_export;
28
+ export default _default;
29
+ type __VLS_WithSlots<T, S> = T & {
30
+ new (): {
31
+ $slots: S;
32
+ };
33
+ };
@@ -0,0 +1,437 @@
1
+ <template>
2
+ <component
3
+ external
4
+ :is="href ? NuxtLink : 'button'"
5
+ class="cja-btn"
6
+ :href="href"
7
+ :target="target"
8
+ :class="[
9
+ `btn-${type}`,
10
+ `btn-size-${size}`,
11
+ `btn-color-${color}`,
12
+ `btn-align-${textAlign}`,
13
+ { 'btn-loading': loading, 'btn-shadow': shadow, 'icon-only': iconOnly }
14
+ ]"
15
+ >
16
+ <Transition name="fade" mode="out-in">
17
+ <div v-if="loading" class="spinner" />
18
+ <div v-else class="text-wrapper">
19
+ <span v-if="iconLeft" :class="iconLeft" />
20
+ <span v-if="!iconOnly" class="text">
21
+ <slot />
22
+ </span>
23
+ <span v-if="iconRight" :class="iconRight" />
24
+ </div>
25
+ </Transition>
26
+ </component>
27
+ </template>
28
+
29
+ <script setup>
30
+ import { NuxtLink } from "#components";
31
+ defineProps({
32
+ type: { type: String, required: false, default: "primary" },
33
+ color: { type: String, required: false, default: "blue" },
34
+ textAlign: { type: String, required: false, default: "center" },
35
+ size: { type: String, required: false, default: "md" },
36
+ shadow: { type: Boolean, required: false },
37
+ iconRight: { type: null, required: false },
38
+ iconLeft: { type: null, required: false },
39
+ iconOnly: { type: Boolean, required: false },
40
+ loading: { type: Boolean, required: false },
41
+ href: { type: null, required: false },
42
+ target: { type: null, required: false }
43
+ });
44
+ </script>
45
+
46
+ <style lang="scss" scoped>
47
+ .cja-btn {
48
+ display: inline-flex;
49
+ font-family: Nunito Sans, Helvetica, sans-serif;
50
+ font-weight: 700;
51
+ cursor: pointer;
52
+ transition-property: background, color, border-color, width;
53
+ transition-duration: 0.2s;
54
+ transition-timing-function: ease-in-out;
55
+ border-width: 1px;
56
+ border-style: solid;
57
+ border-color: transparent;
58
+ background: none;
59
+ text-decoration: none;
60
+
61
+ .text-wrapper {
62
+ display: flex;
63
+ align-items: center;
64
+ flex-grow: 1;
65
+ }
66
+
67
+ * {
68
+ pointer-events: none;
69
+ }
70
+
71
+ &:focus-visible {
72
+ outline: none;
73
+ }
74
+
75
+ &:hover {
76
+ text-decoration: none;
77
+ }
78
+
79
+ &.btn-size-sm {
80
+ font-size: 14px;
81
+ line-height: 18px;
82
+ padding: 8px 12px;
83
+ border-radius: 8px;
84
+
85
+ .text-wrapper {
86
+ gap: 8px;
87
+ }
88
+
89
+ &.icon-only {
90
+ padding: 6px 10px;
91
+ }
92
+ }
93
+
94
+ &.btn-size-md {
95
+ padding: 11px 12px;
96
+ border-radius: 8px;
97
+ font-size: 16px;
98
+ line-height: 20px;
99
+
100
+ .text-wrapper {
101
+ gap: 8px;
102
+ }
103
+
104
+ &.icon-only {
105
+ padding: 9px 13px;
106
+ }
107
+ }
108
+
109
+ &.btn-size-lg {
110
+ font-size: 18px;
111
+ line-height: 22px;
112
+ padding: 16px;
113
+ border-radius: 8px;
114
+
115
+ .text-wrapper {
116
+ gap: 12px;
117
+ }
118
+
119
+ &.icon-only {
120
+ padding: 16px 18px;
121
+ }
122
+ }
123
+
124
+ @each $align in center, left, right {
125
+ &.btn-align-#{$align} .text-wrapper {
126
+ text-align: $align;
127
+ @if $align == center {
128
+ justify-content: center;
129
+ }
130
+
131
+ @if $align == left or $align == right {
132
+ .text {
133
+ flex-grow: 1;
134
+ }
135
+ }
136
+ }
137
+ }
138
+
139
+ &.btn-primary {
140
+ &.btn-shadow {
141
+ box-shadow: $box-shadow-s;
142
+ }
143
+
144
+ &.btn-color-orange:not(:disabled) {
145
+ background: $main-orange;
146
+ border-color: $main-orange;
147
+ color: $white;
148
+
149
+ &:hover {
150
+ background: $dark-orange;
151
+ border-color: $dark-orange;
152
+ }
153
+
154
+ &:focus {
155
+ background: $extra-dark-orange;
156
+ border-color: $extra-dark-orange;
157
+ }
158
+ }
159
+
160
+ &.btn-color-blue:not(:disabled) {
161
+ background: $main-blue;
162
+ border-color: $main-blue;
163
+ color: $white;
164
+
165
+ &:hover {
166
+ background: $dark-blue;
167
+ border-color: $dark-blue;
168
+ }
169
+
170
+ &:focus {
171
+ background: $extra-dark-blue;
172
+ border-color: $extra-dark-blue;
173
+ }
174
+ }
175
+
176
+ &.btn-color-light-blue:not(:disabled) {
177
+ background: $light-blue;
178
+ border-color: $light-blue;
179
+ color: $main-blue;
180
+
181
+ &:hover {
182
+ background: $main-blue;
183
+ border-color: $main-blue;
184
+ color: $white;
185
+ }
186
+
187
+ &:focus {
188
+ background: $extra-dark-blue;
189
+ border-color: $extra-dark-blue;
190
+ color: $white;
191
+ }
192
+ }
193
+
194
+ &.btn-color-white:not(:disabled) {
195
+ background: $white;
196
+ border-color: $light-grey;
197
+ color: $extra-dark-blue;
198
+
199
+ &:hover {
200
+ background: $dark-white;
201
+ }
202
+
203
+ &:focus {
204
+ background: $light-grey;
205
+ border-color: $light-grey;
206
+ }
207
+ }
208
+
209
+ &:disabled {
210
+ background: $disabled-grey;
211
+ border-color: $disabled-grey;
212
+ color: $blue-grey;
213
+ cursor: auto;
214
+ }
215
+ }
216
+
217
+ &.btn-secondary {
218
+ &.btn-color-orange:not(:disabled) {
219
+ border-color: $main-orange;
220
+ color: $main-orange;
221
+
222
+ &:hover {
223
+ background: $light-orange;
224
+ border-color: $main-orange;
225
+ color: $main-orange;
226
+ }
227
+
228
+ &:focus {
229
+ background: $light-orange;
230
+ border-color: $extra-dark-orange;
231
+ color: $extra-dark-orange;
232
+ }
233
+ }
234
+
235
+ &.btn-color-blue:not(:disabled) {
236
+ border-color: $main-blue;
237
+ color: $main-blue;
238
+
239
+ &:hover {
240
+ background: $light-blue;
241
+ border-color: $main-blue;
242
+ color: $main-blue;
243
+ }
244
+
245
+ &:focus {
246
+ background: $light-blue;
247
+ border-color: $extra-dark-blue;
248
+ color: $extra-dark-blue;
249
+ }
250
+ }
251
+
252
+ &.btn-color-light-blue:not(:disabled) {
253
+ border-color: $light-blue;
254
+ color: $light-blue;
255
+
256
+ &:hover {
257
+ background: $light-blue;
258
+ border-color: $light-blue;
259
+ color: $main-blue;
260
+ }
261
+
262
+ &:focus {
263
+ background: $light-blue;
264
+ border-color: $light-blue;
265
+ color: $dark-blue;
266
+ }
267
+ }
268
+
269
+ &.btn-color-white:not(:disabled) {
270
+ border-color: $white;
271
+ color: $white;
272
+
273
+ &:hover {
274
+ background: $white;
275
+ border-color: $white;
276
+ color: $main-blue;
277
+ }
278
+
279
+ &:focus {
280
+ background: $dark-white;
281
+ border-color: $dark-white;
282
+ color: $dark-blue;
283
+ }
284
+ }
285
+
286
+ &:disabled {
287
+ background: $disabled-grey;
288
+ border-color: $disabled-grey;
289
+ color: $blue-grey;
290
+ cursor: auto;
291
+ }
292
+ }
293
+
294
+ &.btn-tertiary {
295
+ padding: 0;
296
+
297
+ &.btn-color-blue:not(:disabled) {
298
+ color: $main-blue;
299
+
300
+ &:hover {
301
+ color: $dark-blue;
302
+ }
303
+
304
+ &:focus {
305
+ color: $extra-dark-blue;
306
+ }
307
+ }
308
+
309
+ &.btn-color-light-blue:not(:disabled) {
310
+ color: $light-blue;
311
+
312
+ &:hover {
313
+ color: $light-blue;
314
+ }
315
+
316
+ &:focus {
317
+ color: $medium-blue;
318
+ }
319
+ }
320
+
321
+ &.btn-color-orange:not(:disabled) {
322
+ color: $main-orange;
323
+
324
+ &:hover {
325
+ color: $bright-orange;
326
+ }
327
+
328
+ &:focus {
329
+ color: $dark-orange;
330
+ }
331
+ }
332
+
333
+ &.btn-color-white:not(:disabled) {
334
+ color: $white;
335
+
336
+ &:hover {
337
+ color: $dark-white;
338
+ }
339
+
340
+ &:focus {
341
+ color: $blue-grey;
342
+ }
343
+ }
344
+
345
+ &:disabled {
346
+ color: $disabled-grey;
347
+ cursor: auto;
348
+ }
349
+ }
350
+
351
+ &.btn-color-gradient-green-blue {
352
+ background: linear-gradient(90deg, $bright-green -62.79%, $main-blue 100%),
353
+ $main-blue;
354
+ border: none;
355
+ color: $white;
356
+
357
+ &:hover {
358
+ background: $main-blue;
359
+ }
360
+
361
+ &:focus {
362
+ background: $dark-blue;
363
+ }
364
+ }
365
+
366
+ &.btn-loading {
367
+ cursor: auto;
368
+ }
369
+
370
+ .spinner {
371
+ display: block;
372
+ border-width: 2px;
373
+ border-style: solid;
374
+ border-color: inherit;
375
+ border-top-color: rgba(255, 255, 255, 0.2);
376
+ border-radius: 50%;
377
+ animation: spin 1s infinite;
378
+ animation-timing-function: linear;
379
+ margin: 0 auto;
380
+
381
+ &.fade-leave-active {
382
+ animation: none;
383
+ }
384
+ }
385
+
386
+ @mixin spinner-color($on-color, $off-color: rgba(255, 255, 255, 0.2)) {
387
+ .spinner {
388
+ border-color: $on-color;
389
+ border-top-color: $off-color;
390
+ }
391
+ }
392
+
393
+ @each $size, $value in "sm" 18px, "md" 20px, "lg" 22px {
394
+ &.btn-size-#{$size} .spinner {
395
+ width: $value;
396
+ height: $value;
397
+ }
398
+ }
399
+
400
+ &.btn-primary {
401
+ @include spinner-color($white);
402
+ @each $btn, $color in ("light-blue": $main-blue, "white": $light-grey) {
403
+ &.btn-color-#{$btn} {
404
+ @include spinner-color($color);
405
+ }
406
+ }
407
+ }
408
+
409
+ &.btn-tertiary {
410
+ @each $btn,
411
+ $color
412
+ in (
413
+ "blue": $main-blue,
414
+ "orange": $main-orange,
415
+ "light-blue": $light-blue,
416
+ "white": $white
417
+ )
418
+ {
419
+ &.btn-color-#{$btn} {
420
+ @include spinner-color($color);
421
+ }
422
+ }
423
+ }
424
+
425
+ @include fade-transition(0.2s);
426
+ }
427
+
428
+ @keyframes spin {
429
+ from {
430
+ transform: rotate(0deg);
431
+ }
432
+
433
+ to {
434
+ transform: rotate(360deg);
435
+ }
436
+ }
437
+ </style>
@@ -0,0 +1,33 @@
1
+ import type { AnchorHTMLAttributes } from "vue";
2
+ import type { Icon } from "../types/Icon.js";
3
+ type __VLS_Props = {
4
+ type?: "primary" | "secondary" | "tertiary";
5
+ color?: "blue" | "orange" | "white" | "light-blue" | "gradient-green-blue";
6
+ textAlign?: "center" | "left" | "right";
7
+ size?: "sm" | "md" | "lg";
8
+ shadow?: boolean;
9
+ iconRight?: Icon;
10
+ iconLeft?: Icon;
11
+ iconOnly?: boolean;
12
+ loading?: boolean;
13
+ href?: AnchorHTMLAttributes["href"];
14
+ target?: AnchorHTMLAttributes["target"];
15
+ };
16
+ declare var __VLS_14: {};
17
+ type __VLS_Slots = {} & {
18
+ default?: (props: typeof __VLS_14) => any;
19
+ };
20
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
21
+ type: "primary" | "secondary" | "tertiary";
22
+ size: "sm" | "md" | "lg";
23
+ color: "blue" | "orange" | "white" | "light-blue" | "gradient-green-blue";
24
+ textAlign: "center" | "left" | "right";
25
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
26
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
27
+ declare const _default: typeof __VLS_export;
28
+ export default _default;
29
+ type __VLS_WithSlots<T, S> = T & {
30
+ new (): {
31
+ $slots: S;
32
+ };
33
+ };
@@ -0,0 +1,35 @@
1
+ type __VLS_Props = {
2
+ active?: boolean;
3
+ scrollToContent?: {
4
+ element: HTMLElement;
5
+ };
6
+ };
7
+ declare var __VLS_1: {}, __VLS_12: {};
8
+ type __VLS_Slots = {} & {
9
+ header?: (props: typeof __VLS_1) => any;
10
+ } & {
11
+ content?: (props: typeof __VLS_12) => any;
12
+ };
13
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
14
+ toggleCollapse: () => void;
15
+ openCollapse: () => void;
16
+ closeCollapse: () => void;
17
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
18
+ "toggle:collapse": (...args: any[]) => void;
19
+ "open:collapse": (...args: any[]) => void;
20
+ "close:collapse": (...args: any[]) => void;
21
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
22
+ "onToggle:collapse"?: ((...args: any[]) => any) | undefined;
23
+ "onOpen:collapse"?: ((...args: any[]) => any) | undefined;
24
+ "onClose:collapse"?: ((...args: any[]) => any) | undefined;
25
+ }>, {
26
+ active: boolean;
27
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
28
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
29
+ declare const _default: typeof __VLS_export;
30
+ export default _default;
31
+ type __VLS_WithSlots<T, S> = T & {
32
+ new (): {
33
+ $slots: S;
34
+ };
35
+ };
@@ -0,0 +1,112 @@
1
+ <template>
2
+ <div class="collapse-container" :class="{ active }">
3
+ <div class="collapse-header" @click="toggleCollapse">
4
+ <div class="header-wrapper">
5
+ <slot name="header" />
6
+ </div>
7
+ <span class="m-cgg-icon--chevron-down" />
8
+ </div>
9
+ <Transition name="slide" @enter="slideEnter" @leave="slideLeave">
10
+ <div v-show="active" ref="contentContainer" class="content-container">
11
+ <div ref="contentWrapper" class="content-wrapper">
12
+ <slot name="content" />
13
+ </div>
14
+ </div>
15
+ </Transition>
16
+ </div>
17
+ </template>
18
+
19
+ <script setup>
20
+ import { ref } from "vue";
21
+ const props = defineProps({
22
+ active: { type: Boolean, required: false, default: false },
23
+ scrollToContent: { type: Object, required: false }
24
+ });
25
+ const active = ref(props.active);
26
+ const contentContainer = ref();
27
+ const contentWrapper = ref();
28
+ const emit = defineEmits([
29
+ "toggle:collapse",
30
+ "open:collapse",
31
+ "close:collapse"
32
+ ]);
33
+ const toggleCollapse = () => {
34
+ active.value = !active.value;
35
+ emit("toggle:collapse", active.value);
36
+ emit(`${active.value ? "open" : "close"}:collapse`);
37
+ };
38
+ const openCollapse = () => {
39
+ active.value = true;
40
+ emit("open:collapse");
41
+ };
42
+ const closeCollapse = () => {
43
+ active.value = false;
44
+ emit("close:collapse");
45
+ };
46
+ const slideEnter = () => {
47
+ contentContainer.value.style.height = "0";
48
+ requestAnimationFrame(() => {
49
+ if (contentContainer.value && contentWrapper.value) {
50
+ contentContainer.value.style.height = `${contentWrapper.value.clientHeight}px`;
51
+ setTimeout(() => {
52
+ contentContainer.value.style.height = "";
53
+ }, 200);
54
+ if (active.value && props.scrollToContent) {
55
+ setTimeout(() => {
56
+ props.scrollToContent?.element.scrollTo({
57
+ top: contentWrapper.value.offsetTop,
58
+ left: 0,
59
+ behavior: "smooth"
60
+ });
61
+ }, 250);
62
+ }
63
+ }
64
+ });
65
+ };
66
+ const slideLeave = () => {
67
+ contentContainer.value.style.height = `${contentWrapper.value.clientHeight}px`;
68
+ requestAnimationFrame(() => {
69
+ contentContainer.value.style.height = "0";
70
+ });
71
+ };
72
+ defineExpose({ toggleCollapse, openCollapse, closeCollapse });
73
+ </script>
74
+
75
+ <style lang="scss" scoped>
76
+ .collapse-container {
77
+ .collapse-header {
78
+ display: flex;
79
+ flex-direction: row;
80
+ align-items: center;
81
+ justify-content: space-between;
82
+ gap: 16px;
83
+ cursor: pointer;
84
+ user-select: none;
85
+
86
+ > span {
87
+ transition: all 0.2s linear;
88
+ }
89
+ }
90
+
91
+ .content-container {
92
+ transition: all 0.2s linear;
93
+
94
+ &.slide-leave-active,
95
+ &.slide-enter-active {
96
+ overflow: hidden;
97
+ }
98
+
99
+ .content-wrapper {
100
+ padding-top: 16px;
101
+ }
102
+ }
103
+
104
+ &.active > .collapse-header > span {
105
+ transform: rotate(180deg);
106
+ }
107
+
108
+ &:not(.active) > .content-container {
109
+ overflow: hidden;
110
+ }
111
+ }
112
+ </style>
@@ -0,0 +1,35 @@
1
+ type __VLS_Props = {
2
+ active?: boolean;
3
+ scrollToContent?: {
4
+ element: HTMLElement;
5
+ };
6
+ };
7
+ declare var __VLS_1: {}, __VLS_12: {};
8
+ type __VLS_Slots = {} & {
9
+ header?: (props: typeof __VLS_1) => any;
10
+ } & {
11
+ content?: (props: typeof __VLS_12) => any;
12
+ };
13
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
14
+ toggleCollapse: () => void;
15
+ openCollapse: () => void;
16
+ closeCollapse: () => void;
17
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
18
+ "toggle:collapse": (...args: any[]) => void;
19
+ "open:collapse": (...args: any[]) => void;
20
+ "close:collapse": (...args: any[]) => void;
21
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
22
+ "onToggle:collapse"?: ((...args: any[]) => any) | undefined;
23
+ "onOpen:collapse"?: ((...args: any[]) => any) | undefined;
24
+ "onClose:collapse"?: ((...args: any[]) => any) | undefined;
25
+ }>, {
26
+ active: boolean;
27
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
28
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
29
+ declare const _default: typeof __VLS_export;
30
+ export default _default;
31
+ type __VLS_WithSlots<T, S> = T & {
32
+ new (): {
33
+ $slots: S;
34
+ };
35
+ };
@@ -0,0 +1,23 @@
1
+ type __VLS_Props = {
2
+ defaultTab: number;
3
+ tabs: string[];
4
+ };
5
+ declare var __VLS_8: number, __VLS_9: {};
6
+ type __VLS_Slots = {} & {
7
+ [K in NonNullable<typeof __VLS_8>]?: (props: typeof __VLS_9) => any;
8
+ };
9
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
10
+ activeTab: import("vue").Ref<number, number>;
11
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
12
+ "tab:changed": (...args: any[]) => void;
13
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
14
+ "onTab:changed"?: ((...args: any[]) => any) | undefined;
15
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
16
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
17
+ declare const _default: typeof __VLS_export;
18
+ export default _default;
19
+ type __VLS_WithSlots<T, S> = T & {
20
+ new (): {
21
+ $slots: S;
22
+ };
23
+ };