cja-phoenix 0.0.1 → 0.0.2

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 (42) hide show
  1. package/README.md +1 -0
  2. package/dist/cja-phoenix.es.js +3134 -63
  3. package/dist/fonts/ProximaNova-Black.woff +0 -0
  4. package/dist/fonts/ProximaNova-Black.woff2 +0 -0
  5. package/dist/fonts/ProximaNova-Bold.woff +0 -0
  6. package/dist/fonts/ProximaNova-Bold.woff2 +0 -0
  7. package/dist/fonts/ProximaNova-Extrabld.woff +0 -0
  8. package/dist/fonts/ProximaNova-Extrabld.woff2 +0 -0
  9. package/dist/fonts/ProximaNova-Regular.woff +0 -0
  10. package/dist/fonts/ProximaNova-Regular.woff2 +0 -0
  11. package/dist/fonts/ProximaNovaT-Thin.woff +0 -0
  12. package/dist/fonts/ProximaNovaT-Thin.woff2 +0 -0
  13. package/dist/iconia/fonts/CGG-icomoon.eot +0 -0
  14. package/dist/iconia/fonts/CGG-icomoon.svg +507 -0
  15. package/dist/iconia/fonts/CGG-icomoon.ttf +0 -0
  16. package/dist/iconia/fonts/CGG-icomoon.woff +0 -0
  17. package/dist/iconia/selection.json +1 -0
  18. package/dist/iconia/style.css +1529 -0
  19. package/dist/style.css +1 -1
  20. package/dist/types/components/CheckboxInput.vue.d.ts +14 -0
  21. package/dist/types/components/CjaButton.vue.d.ts +9 -0
  22. package/dist/types/components/ComponentA.vue.d.ts +4 -4
  23. package/dist/types/components/ComponentB.vue.d.ts +1 -1
  24. package/dist/types/components/Modal.vue.d.ts +32 -0
  25. package/dist/types/components/PhoneInput.vue.d.ts +62 -0
  26. package/dist/types/components/TextInput.vue.d.ts +58 -0
  27. package/dist/types/components/index.d.ts +8 -3
  28. package/dist/types/stories/Modal.story.vue.d.ts +2 -0
  29. package/package.json +18 -6
  30. package/src/assets/fonts.scss +44 -0
  31. package/src/assets/forms.scss +375 -0
  32. package/src/assets/main.scss +9 -12
  33. package/src/components/CheckboxInput.vue +27 -0
  34. package/src/components/CjaButton.vue +65 -0
  35. package/src/components/Modal.vue +191 -0
  36. package/src/components/PhoneInput.vue +91 -0
  37. package/src/components/TextInput.vue +72 -0
  38. package/src/components/index.ts +14 -4
  39. package/src/env.d.ts +5 -4
  40. package/src/index.ts +3 -0
  41. package/src/stories/Modal.story.vue +18 -0
  42. package/src/assets/fonts/myfont.woff +0 -0
@@ -0,0 +1,375 @@
1
+ .form-group {
2
+ .input-title {
3
+ font-size: 14px;
4
+ line-height: 17px;
5
+ font-weight: bold;
6
+ margin-bottom: 10px;
7
+
8
+ @media screen and (min-width: 768px) {
9
+ font-size: 16px;
10
+ line-height: 19px;
11
+ }
12
+ }
13
+
14
+ .input-container {
15
+ position: relative;
16
+
17
+ input,
18
+ textarea {
19
+ outline: none;
20
+ padding: 10px 8px;
21
+ font-size: 15px;
22
+ line-height: 18px;
23
+ width: 100%;
24
+ border: 1px solid #dedede;
25
+ border-radius: 5px;
26
+ transition: all 0.1s ease-in;
27
+
28
+ &:active,
29
+ &:focus {
30
+ border: 1px solid #5fbbff;
31
+ outline: none;
32
+
33
+ & + .icon {
34
+ color: #312f2e;
35
+ }
36
+ }
37
+ }
38
+
39
+ textarea {
40
+ resize: none;
41
+ }
42
+
43
+ &.has-icon {
44
+ input {
45
+ padding-right: 50px;
46
+ }
47
+
48
+ .icon {
49
+ position: absolute;
50
+ top: 50%;
51
+ transform: translateY(-50%);
52
+ right: 20px;
53
+ line-height: 10px;
54
+ font-size: 20px;
55
+ font-weight: 700;
56
+ color: #979290;
57
+ transition: color 0.1s ease-in;
58
+ }
59
+ }
60
+
61
+ &.error {
62
+ input,
63
+ textarea {
64
+ background-color: #ffebeb;
65
+ border: 1px solid #ff533f;
66
+ }
67
+ }
68
+ }
69
+
70
+ .input-container-radio {
71
+ ul {
72
+ display: flex;
73
+ flex-direction: column;
74
+ gap: 15px;
75
+ }
76
+
77
+ label {
78
+ display: flex;
79
+ flex-direction: row;
80
+ gap: 10px;
81
+ cursor: pointer;
82
+
83
+ input {
84
+ display: none;
85
+ }
86
+
87
+ input:checked + .radio-icon {
88
+ border-color: #77aa43;
89
+
90
+ &::before {
91
+ opacity: 1;
92
+ }
93
+ }
94
+
95
+ .radio-icon {
96
+ height: 25px;
97
+ width: 25px;
98
+ border: 2px solid #9fabbc;
99
+ border-radius: 50%;
100
+ transition: all 0.3s ease-in-out;
101
+
102
+ &:before {
103
+ content: "";
104
+ display: block;
105
+ opacity: 0;
106
+ transition: all 0.3s ease-in-out;
107
+ width: 100%;
108
+ height: 100%;
109
+ background-color: #77aa43;
110
+ background-clip: content-box;
111
+ border: 4px solid transparent;
112
+ border-radius: 50%;
113
+ }
114
+ }
115
+
116
+ p {
117
+ font-size: 16px;
118
+ line-height: 25px;
119
+ }
120
+ }
121
+ }
122
+
123
+ .input-container-checkbox {
124
+ label {
125
+ display: flex;
126
+ flex-direction: row;
127
+ flex-wrap: nowrap;
128
+ gap: 15px;
129
+ cursor: pointer;
130
+
131
+ input {
132
+ display: none;
133
+ }
134
+
135
+ &.active {
136
+ .radio-icon {
137
+ border-color: #77aa43;
138
+
139
+ &::before {
140
+ opacity: 1;
141
+ }
142
+ }
143
+
144
+ p {
145
+ color: #77aa43;
146
+ }
147
+ }
148
+
149
+ .checkbox-icon {
150
+ position: relative;
151
+
152
+ &:after {
153
+ content: "";
154
+ display: block;
155
+ width: 22px;
156
+ height: 22px;
157
+ border-radius: 3px;
158
+ border: 1px solid #cccbc8;
159
+ color: #77aa43;
160
+ }
161
+
162
+ &:before {
163
+ position: absolute;
164
+ opacity: 0;
165
+ font-size: 20px;
166
+ }
167
+ }
168
+
169
+ input:checked + .checkbox-icon:before {
170
+ opacity: 1;
171
+ }
172
+
173
+ .text-container {
174
+ font-size: 12px;
175
+ line-height: 18px;
176
+ user-select: none;
177
+
178
+ a {
179
+ color: inherit;
180
+ font-weight: 700;
181
+ text-decoration: underline;
182
+
183
+ &:hover {
184
+ text-decoration: none;
185
+ }
186
+ }
187
+ }
188
+ }
189
+ }
190
+
191
+ .input-container-select {
192
+ position: relative;
193
+
194
+ .close-overlay {
195
+ position: fixed;
196
+ top: 0;
197
+ left: 0;
198
+ width: 100vw;
199
+ height: 100vh;
200
+ z-index: 23;
201
+ }
202
+
203
+ .select-toggle {
204
+ position: relative;
205
+ display: flex;
206
+ justify-content: space-between;
207
+ gap: 10px;
208
+ background-color: #fff;
209
+ border: 1px solid #dedede;
210
+ border-radius: 5px;
211
+ cursor: pointer;
212
+ padding: 10px 8px;
213
+ font-size: 15px;
214
+ line-height: 18px;
215
+ width: 100%;
216
+ transition: z-index 0s 0.3s;
217
+ z-index: 0;
218
+
219
+ .select-display {
220
+ flex-grow: 1;
221
+ text-overflow: ellipsis;
222
+ overflow: hidden;
223
+ }
224
+
225
+ &.open {
226
+ z-index: 25;
227
+ transition: z-index 0s;
228
+
229
+ em {
230
+ transform: rotate(180deg);
231
+ }
232
+ }
233
+
234
+ &.disabled {
235
+ opacity: 0.5;
236
+ cursor: auto;
237
+ }
238
+
239
+ em {
240
+ font-size: 12px;
241
+ line-height: 18px;
242
+ color: #9fabbc;
243
+ transition: all 0.3s ease-in-out;
244
+ }
245
+ }
246
+
247
+ .select-collapse {
248
+ position: absolute;
249
+ z-index: 24;
250
+ left: 0;
251
+ width: 100%;
252
+ max-height: 400px;
253
+ overflow-y: auto;
254
+ padding-top: 4px;
255
+ background-color: #fff;
256
+ border: 1px solid #dedede;
257
+ transition: all 0.3s ease-in-out;
258
+
259
+ &.position-top {
260
+ bottom: calc(100% - 5px);
261
+ border-top-left-radius: 5px;
262
+ border-top-right-radius: 5px;
263
+ box-shadow: 0px -4px 10px rgba(0, 0, 0, 0.15);
264
+ }
265
+
266
+ &.position-bottom {
267
+ top: calc(100% - 5px);
268
+ border-bottom-left-radius: 5px;
269
+ border-bottom-right-radius: 5px;
270
+ box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.15);
271
+ }
272
+
273
+ .search-filter-container {
274
+ padding: 5px 10px;
275
+
276
+ input {
277
+ outline: none;
278
+ padding: 10px 8px;
279
+ font-size: 15px;
280
+ line-height: 18px;
281
+ width: 100%;
282
+ border: 1px solid #dedede;
283
+ border-radius: 5px;
284
+
285
+ &:active,
286
+ &:focus {
287
+ border: 1px solid #5fbbff;
288
+ outline: none;
289
+ }
290
+ }
291
+ }
292
+
293
+ &.slide-fade-enter-from,
294
+ &.slide-fade-leave-to {
295
+ opacity: 0;
296
+ }
297
+
298
+ &.slide-fade-enter-to,
299
+ &.slide-fade-leave-from {
300
+ opacity: 1;
301
+ }
302
+
303
+ ul li {
304
+ display: flex;
305
+ align-items: center;
306
+ transition: all 0.3s ease-in-out;
307
+ padding: 8px 10px;
308
+ cursor: pointer;
309
+ user-select: none;
310
+ overflow-x: hidden;
311
+
312
+ &:hover {
313
+ background-color: #f1f7ee;
314
+ }
315
+
316
+ .checkbox-icon {
317
+ height: 20px;
318
+ width: 20px;
319
+ border: 2px solid #9fabbc;
320
+ border-radius: 3px;
321
+ transition: all 0.3s ease-in-out;
322
+ display: inline-flex;
323
+ place-items: center;
324
+ margin-right: 10px;
325
+
326
+ &:before {
327
+ color: #77aa43;
328
+ opacity: 0;
329
+ }
330
+ }
331
+
332
+ &.active .checkbox-icon:before {
333
+ opacity: 1;
334
+ }
335
+ }
336
+ }
337
+
338
+ &.error {
339
+ .select-toggle {
340
+ background-color: #ffebeb;
341
+ border: 1px solid #ff533f;
342
+ }
343
+
344
+ em {
345
+ background-color: #ffebeb;
346
+ }
347
+ }
348
+ }
349
+
350
+ .input-error {
351
+ color: #ff533f;
352
+ font-size: 14px;
353
+ line-height: 16px;
354
+ margin-top: 8px;
355
+
356
+ @media screen and (min-width: 768px) {
357
+ font-size: 16px;
358
+ line-height: 18px;
359
+ }
360
+ }
361
+
362
+ .iti {
363
+ display: block;
364
+ }
365
+
366
+ .iti__flag {
367
+ background-image: url("https://www.comparaja.pt/s3/portugal/comparaja.pt/production/pt/images/general/flags.png") !important;
368
+ }
369
+
370
+ @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
371
+ .iti__flag {
372
+ background-image: url("https://www.comparaja.pt/s3/portugal/comparaja.pt/production/pt/images/general/flags@2x.png") !important;
373
+ }
374
+ }
375
+ }
@@ -1,17 +1,14 @@
1
- @font-face {
2
- font-family: 'myfont';
3
- src: url('fonts/myfont.woff');
4
- }
1
+ @import "fonts";
5
2
 
6
- [class^='icon-'],
7
- [class*=' icon-'] {
8
- font-family: 'myfont' !important;
3
+ body {
4
+ font-family: "Proxima Nova", "Helvetica Neue", "Helvetica",
5
+ "Microsoft JhengHei", "Open Sans", "Arial", "sans-serif";
9
6
  }
10
7
 
11
- .icon-heart:before {
12
- content: '\e9da';
8
+ *,
9
+ *:before,
10
+ *:after {
11
+ box-sizing: border-box;
13
12
  }
14
13
 
15
- .global-example {
16
- color: red;
17
- }
14
+ @import "forms";
@@ -0,0 +1,27 @@
1
+ <template>
2
+ <div class="form-group">
3
+ <div class="input-container-checkbox">
4
+ <label>
5
+ <input
6
+ type="checkbox"
7
+ :checked="modelValue"
8
+ @change="(event) => $emit('update:modelValue', (<HTMLInputElement>event.target).checked)"
9
+ />
10
+ <div class="checkbox-icon m-cgg-icon--check2"></div>
11
+ <div class="text-container" v-html="label"></div>
12
+ </label>
13
+ </div>
14
+
15
+ <div v-if="error" class="input-error">{{ error }}</div>
16
+ </div>
17
+ </template>
18
+
19
+ <script lang="ts" setup>
20
+ const props = defineProps({
21
+ label: String,
22
+ error: String,
23
+ modelValue: Boolean,
24
+ });
25
+
26
+ const emit = defineEmits(["update:modelValue"]);
27
+ </script>
@@ -0,0 +1,65 @@
1
+ <template>
2
+ <button class="cja-btn">
3
+ <slot></slot>
4
+ </button>
5
+ </template>
6
+
7
+ <script lang="ts" setup></script>
8
+
9
+ <style lang="scss" scoped>
10
+ .cja-btn {
11
+ display: inline-flex;
12
+ justify-content: center;
13
+ align-items: center;
14
+ padding: 10px 20px;
15
+ border-radius: 8px;
16
+ box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.1);
17
+ color: #076b9c;
18
+ background: none;
19
+ font-weight: 700;
20
+ font-size: 16px;
21
+ line-height: 16px;
22
+ cursor: pointer;
23
+
24
+ @media screen and (min-width: 768px) {
25
+ padding: 15px 20px;
26
+ font-size: 20px;
27
+ line-height: 20px;
28
+ }
29
+
30
+ &:focus-visible {
31
+ outline: none;
32
+ }
33
+
34
+ &.btn-primary {
35
+ background: #076b9c;
36
+ border: 1px solid #076b9c;
37
+ color: #fff;
38
+
39
+ &.btn-orange {
40
+ background: #f58423;
41
+ border-color: #f58423;
42
+ }
43
+
44
+ &.btn-white {
45
+ background: #fff;
46
+ border-color: #fff;
47
+ color: #155072;
48
+ }
49
+
50
+ &:disabled {
51
+ background: #dedede;
52
+ border: 1px solid #dedede;
53
+ cursor: pointer;
54
+ }
55
+ }
56
+
57
+ &.btn-secondary {
58
+ border: 1px solid #dedede;
59
+ }
60
+
61
+ :deep(span[class^="m-cgg-icon--"]:last-child) {
62
+ margin-left: 5px;
63
+ }
64
+ }
65
+ </style>
@@ -0,0 +1,191 @@
1
+ <template>
2
+ <Teleport to="body">
3
+ <Transition name="fade">
4
+ <div v-show="active" class="modal-backdrop">
5
+ <div class="modal-overlay" @click.self="closeModal">
6
+ <div class="modal-container" :class="class" ref="modalContainer">
7
+ <button
8
+ type="button"
9
+ class="btn-close"
10
+ aria-label="Close"
11
+ @click="closeModal"
12
+ >
13
+ <span class="m-cgg-icon--cross"></span>
14
+ </button>
15
+ <div class="modal-header" v-if="title">
16
+ {{ title }}
17
+ </div>
18
+ <div class="modal-body">
19
+ <slot name="body"></slot>
20
+ </div>
21
+ <div class="modal-footer" v-if="$slots.footer">
22
+ <slot name="footer"></slot>
23
+ </div>
24
+ </div>
25
+ </div>
26
+ </div>
27
+ </Transition>
28
+ </Teleport>
29
+ </template>
30
+
31
+ <script lang="ts" setup>
32
+ import { ref, watch } from "vue";
33
+
34
+ const props = defineProps<{
35
+ title?: string;
36
+ class?: string;
37
+ }>();
38
+
39
+ const active = ref(false);
40
+ const modalContainer = ref();
41
+
42
+ const emit = defineEmits(["close"]);
43
+
44
+ watch(
45
+ () => active.value,
46
+ (active) => {
47
+ if (active) {
48
+ document.body.classList.add("modal-active");
49
+ } else {
50
+ document.body.classList.remove("modal-active");
51
+ }
52
+ }
53
+ );
54
+
55
+ const openModal = () => {
56
+ active.value = true;
57
+ };
58
+
59
+ const closeModal = () => {
60
+ active.value = false;
61
+ emit("close");
62
+ };
63
+
64
+ const toggleModal = () => {
65
+ active.value = !active.value;
66
+ };
67
+
68
+ defineExpose({ active, openModal, closeModal, toggleModal });
69
+ </script>
70
+
71
+ <style lang="scss" scoped>
72
+ .modal-backdrop {
73
+ position: fixed;
74
+ top: 0;
75
+ left: 0;
76
+ width: 100%;
77
+ height: 100%;
78
+ z-index: 12;
79
+ background-color: rgba(0, 0, 0, 0.4);
80
+ transition: all 0.4s ease-in-out;
81
+ }
82
+
83
+ .modal-overlay {
84
+ position: fixed;
85
+ top: 0;
86
+ left: 0;
87
+ width: 100%;
88
+ height: 100%;
89
+ z-index: 13;
90
+ }
91
+
92
+ .modal-container {
93
+ position: absolute;
94
+ top: 0;
95
+ left: 0;
96
+ height: 100%;
97
+ background: #ffffff;
98
+ padding: 20px;
99
+ width: 100%;
100
+ box-sizing: border-box;
101
+
102
+ @media screen and (min-width: 601px) {
103
+ top: 50%;
104
+ left: 50%;
105
+ transform: translateY(-50%) translateX(-50%);
106
+ max-width: calc(100% - 60px);
107
+ border-radius: 8px;
108
+ padding: 20px 40px;
109
+ height: auto;
110
+ }
111
+
112
+ @media screen and (min-width: 1100px) {
113
+ max-width: 1040px;
114
+ }
115
+
116
+ .modal-header {
117
+ font-weight: 700;
118
+ font-size: 18px;
119
+ line-height: 21px;
120
+ padding-bottom: 15px;
121
+ padding-right: 20px;
122
+ border-bottom: 1px solid #dedede;
123
+
124
+ @media screen and (min-width: 601px) {
125
+ font-size: 24px;
126
+ line-height: 27px;
127
+ }
128
+ }
129
+
130
+ .btn-close {
131
+ position: absolute;
132
+ top: 20px;
133
+ right: 20px;
134
+ background: none;
135
+ border: none;
136
+ padding: 0;
137
+ outline: 0;
138
+ height: 20px;
139
+ cursor: pointer;
140
+
141
+ @media screen and (min-width: 601px) {
142
+ right: 40px;
143
+ }
144
+
145
+ span {
146
+ line-height: 20px;
147
+ }
148
+
149
+ &:focus {
150
+ outline: 0;
151
+ }
152
+ }
153
+
154
+ .modal-body {
155
+ margin: 20px -15px -15px;
156
+ font-size: 15px;
157
+ line-height: 17px;
158
+ overflow-y: auto;
159
+ max-height: calc(100vh - 97px);
160
+ height: auto;
161
+ padding: 0 15px 15px;
162
+
163
+ @media screen and (min-width: 768px) {
164
+ max-height: 700px;
165
+ }
166
+ }
167
+
168
+ .modal-footer {
169
+ border-top: 1px solid #dedede;
170
+ padding-top: 15px;
171
+ margin-top: 15px;
172
+
173
+ :deep(.button-container) {
174
+ display: flex;
175
+ flex-direction: row;
176
+ justify-content: flex-end;
177
+ gap: 10px;
178
+ }
179
+ }
180
+ }
181
+
182
+ .fade-enter-from,
183
+ .fade-leave-to {
184
+ opacity: 0;
185
+ }
186
+
187
+ .fade-enter-to,
188
+ .fade-leave-from {
189
+ opacity: 1;
190
+ }
191
+ </style>