cja-phoenix 0.24.19 → 0.24.21

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.
@@ -12,12 +12,17 @@
12
12
  <script lang="ts" setup>
13
13
  import { InputHTMLAttributes } from "vue";
14
14
 
15
- defineProps<{
16
- title: string;
17
- tooltip?: string;
18
- disabled?: InputHTMLAttributes["disabled"];
19
- size?: "sm" | "md" | "lg";
20
- }>();
15
+ withDefaults(
16
+ defineProps<{
17
+ title: string;
18
+ tooltip?: string;
19
+ disabled?: InputHTMLAttributes["disabled"];
20
+ size?: "sm" | "md" | "lg";
21
+ }>(),
22
+ {
23
+ size: "md",
24
+ }
25
+ );
21
26
  </script>
22
27
 
23
28
  <style lang="scss" scoped>
@@ -8,14 +8,19 @@
8
8
  `btn-${type}`,
9
9
  `btn-size-${size}`,
10
10
  `btn-color-${color}`,
11
+ `btn-align-${textAlign}`,
11
12
  { 'btn-loading': loading, 'btn-shadow': shadow, 'icon-only': iconOnly },
12
13
  ]"
13
14
  >
14
- <span v-if="iconLeft" :class="iconLeft" />
15
- <slot v-if="!iconOnly && !loading" />
16
- <span v-if="iconRight" :class="iconRight" />
17
- <Transition name="fade">
15
+ <Transition name="fade" mode="out-in">
18
16
  <div class="spinner" v-if="loading" />
17
+ <div class="text-wrapper" v-else>
18
+ <span v-if="iconLeft" :class="iconLeft" />
19
+ <span class="text" v-if="!iconOnly">
20
+ <slot />
21
+ </span>
22
+ <span v-if="iconRight" :class="iconRight" />
23
+ </div>
19
24
  </Transition>
20
25
  </component>
21
26
  </template>
@@ -28,6 +33,7 @@ withDefaults(
28
33
  defineProps<{
29
34
  type?: "primary" | "secondary" | "tertiary";
30
35
  color?: "blue" | "orange" | "white" | "light-blue" | "gradient-green-blue";
36
+ textAlign?: "center" | "left" | "right";
31
37
  size?: "sm" | "md" | "lg";
32
38
  shadow?: boolean;
33
39
  iconRight?: Icon;
@@ -43,19 +49,17 @@ withDefaults(
43
49
  type: "primary",
44
50
  color: "blue",
45
51
  size: "md",
52
+ textAlign: "center",
46
53
  }
47
54
  );
48
55
  </script>
49
56
 
50
57
  <style lang="scss" scoped>
51
58
  .cja-btn {
52
- display: inline-flex;
53
- justify-content: center;
54
- align-items: center;
55
- text-align: center;
59
+ font-family: Nunito Sans, Helvetica, sans-serif;
56
60
  font-weight: 700;
57
61
  cursor: pointer;
58
- transition-property: background, color, width;
62
+ transition-property: background, color, border-color, width;
59
63
  transition-duration: 0.2s;
60
64
  transition-timing-function: ease-in-out;
61
65
  border-width: 1px;
@@ -63,9 +67,17 @@ withDefaults(
63
67
  border-color: transparent;
64
68
  background: none;
65
69
  text-decoration: none;
66
- font-family: Nunito Sans, Helvetica, sans-serif;
67
70
 
68
- span {
71
+ .text-wrapper {
72
+ display: flex;
73
+ align-items: center;
74
+
75
+ .text {
76
+ flex-grow: 1;
77
+ }
78
+ }
79
+
80
+ * {
69
81
  pointer-events: none;
70
82
  }
71
83
 
@@ -82,19 +94,13 @@ withDefaults(
82
94
  line-height: 18px;
83
95
  padding: 8px 12px;
84
96
  border-radius: 8px;
85
- gap: 8px;
86
97
 
87
- &.icon-only {
88
- padding: 6px 10px;
98
+ .text-wrapper {
99
+ gap: 8px;
89
100
  }
90
101
 
91
- &.btn-loading {
92
- min-width: 36px;
93
- }
94
-
95
- .spinner {
96
- width: 14px;
97
- height: 14px;
102
+ &.icon-only {
103
+ padding: 6px 10px;
98
104
  }
99
105
  }
100
106
 
@@ -103,19 +109,13 @@ withDefaults(
103
109
  border-radius: 8px;
104
110
  font-size: 16px;
105
111
  line-height: 20px;
106
- gap: 8px;
107
-
108
- &.icon-only {
109
- padding: 9px 13px;
110
- }
111
112
 
112
- &.btn-loading {
113
- min-width: 44px;
113
+ .text-wrapper {
114
+ gap: 8px;
114
115
  }
115
116
 
116
- .spinner {
117
- width: 18px;
118
- height: 18px;
117
+ &.icon-only {
118
+ padding: 9px 13px;
119
119
  }
120
120
  }
121
121
 
@@ -124,19 +124,19 @@ withDefaults(
124
124
  line-height: 22px;
125
125
  padding: 16px;
126
126
  border-radius: 8px;
127
- gap: 12px;
128
127
 
129
- &.icon-only {
130
- padding: 16px 18px;
128
+ .text-wrapper {
129
+ gap: 12px;
131
130
  }
132
131
 
133
- &.btn-loading {
134
- min-width: 56px;
132
+ &.icon-only {
133
+ padding: 16px 18px;
135
134
  }
135
+ }
136
136
 
137
- .spinner {
138
- width: 22px;
139
- height: 22px;
137
+ @each $align in center, left, right {
138
+ &.btn-align-#{$align} {
139
+ text-align: $align;
140
140
  }
141
141
  }
142
142
 
@@ -193,11 +193,6 @@ withDefaults(
193
193
  border-color: $extra-dark-blue;
194
194
  color: $white;
195
195
  }
196
-
197
- .spinner {
198
- border-color: $main-blue;
199
- border-top-color: $light-blue;
200
- }
201
196
  }
202
197
 
203
198
  &.btn-color-white:not(:disabled) {
@@ -207,18 +202,12 @@ withDefaults(
207
202
 
208
203
  &:hover {
209
204
  background: $dark-white;
210
- border-color: $dark-white;
211
205
  }
212
206
 
213
207
  &:focus {
214
208
  background: $light-grey;
215
209
  border-color: $light-grey;
216
210
  }
217
-
218
- .spinner {
219
- border-color: $main-blue;
220
- border-top-color: $light-blue;
221
- }
222
211
  }
223
212
 
224
213
  &:disabled {
@@ -227,11 +216,6 @@ withDefaults(
227
216
  color: $blue-grey;
228
217
  cursor: auto;
229
218
  }
230
-
231
- .spinner {
232
- border-color: $white;
233
- border-top-color: rgba(255, 255, 255, 0.2);
234
- }
235
219
  }
236
220
 
237
221
  &.btn-secondary {
@@ -309,10 +293,6 @@ withDefaults(
309
293
  color: $blue-grey;
310
294
  cursor: auto;
311
295
  }
312
-
313
- .spinner {
314
- border-top-color: rgba(255, 255, 255, 0.2);
315
- }
316
296
  }
317
297
 
318
298
  &.btn-tertiary {
@@ -370,10 +350,6 @@ withDefaults(
370
350
  color: $disabled-grey;
371
351
  cursor: auto;
372
352
  }
373
-
374
- .spinner {
375
- border-top-color: rgba(255, 255, 255, 0.2);
376
- }
377
353
  }
378
354
 
379
355
  &.btn-color-gradient-green-blue {
@@ -393,35 +369,63 @@ withDefaults(
393
369
 
394
370
  &.btn-loading {
395
371
  cursor: auto;
396
-
397
- span:not(.spinner) {
398
- opacity: 0;
399
- }
400
- }
401
-
402
- span {
403
- transition: opacity 0.3s ease-in-out;
404
- }
405
-
406
- span:not(.spinner) {
407
- transition-delay: 0.15s;
408
372
  }
409
373
 
410
374
  .spinner {
411
- position: absolute;
412
375
  display: block;
413
376
  border-width: 2px;
414
377
  border-style: solid;
378
+ border-color: inherit;
379
+ border-top-color: rgba(255, 255, 255, 0.2);
415
380
  border-radius: 50%;
416
381
  animation: spin 1s infinite;
417
382
  animation-timing-function: linear;
418
383
 
419
- &.fade-enter-active {
420
- transition-delay: 0.15s;
384
+ &.fade-leave-active {
385
+ animation: none;
386
+ }
387
+ }
388
+
389
+ @mixin spinner-color($on-color, $off-color: rgba(255, 255, 255, 0.2)) {
390
+ .spinner {
391
+ border-color: $on-color;
392
+ border-top-color: $off-color;
393
+ }
394
+ }
395
+
396
+ @each $size, $value in "sm" 14px, "md" 18px, "lg" 22px {
397
+ &.btn-size-#{$size} .spinner {
398
+ width: $value;
399
+ height: $value;
400
+ }
401
+ }
402
+
403
+ &.btn-primary {
404
+ @include spinner-color($white);
405
+ @each $btn, $color in ("light-blue": $main-blue, "white": $light-grey) {
406
+ &.btn-color-#{$btn} {
407
+ @include spinner-color($color);
408
+ }
409
+ }
410
+ }
411
+
412
+ &.btn-tertiary {
413
+ @each $btn,
414
+ $color
415
+ in (
416
+ "blue": $main-blue,
417
+ "orange": $main-orange,
418
+ "light-blue": $light-blue,
419
+ "white": $white
420
+ )
421
+ {
422
+ &.btn-color-#{$btn} {
423
+ @include spinner-color($color);
424
+ }
421
425
  }
422
426
  }
423
427
 
424
- @include fade-transition(0.3s);
428
+ @include fade-transition(0.2s);
425
429
  }
426
430
 
427
431
  @keyframes spin {