@citizenplane/pimp 6.3.1 → 6.4.3

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 (93) hide show
  1. package/dist/pimp.common.js +529 -320
  2. package/dist/pimp.common.js.map +1 -1
  3. package/dist/pimp.css +1 -1
  4. package/dist/pimp.umd.js +529 -320
  5. package/dist/pimp.umd.js.map +1 -1
  6. package/dist/pimp.umd.min.js +1 -1
  7. package/dist/pimp.umd.min.js.map +1 -1
  8. package/package-lock.json +434 -279
  9. package/package.json +8 -8
  10. package/src/assets/styles/base/_base.scss +1 -1
  11. package/src/assets/styles/helpers/{_function.scss → _functions.scss} +3 -2
  12. package/src/assets/styles/main.scss +1 -1
  13. package/src/assets/styles/variables/_sizing.scss +1 -1
  14. package/src/assets/styles/variables/_spacing.scss +9 -2
  15. package/src/components/core/BaseInputLabel/index.vue +2 -2
  16. package/src/components/core/playground-sections/SectionButtons.vue +2 -2
  17. package/src/components/core/playground-sections/SectionContainer.vue +2 -2
  18. package/src/components/core/playground-sections/SectionDatePickers.vue +3 -3
  19. package/src/components/core/playground-sections/SectionFeedbackIndicators.vue +2 -2
  20. package/src/components/core/playground-sections/SectionInputs.vue +2 -2
  21. package/src/components/core/playground-sections/SectionListsAndTables.vue +4 -4
  22. package/src/components/core/playground-sections/SectionSelects.vue +2 -2
  23. package/src/components/core/playground-sections/SectionSimpleInputs.vue +2 -2
  24. package/src/components/core/playground-sections/SectionToasters.vue +0 -1
  25. package/src/components/core/playground-sections/SectionToggles.vue +1 -1
  26. package/src/components/date-pickers/CpDate.vue +11 -11
  27. package/src/components/feedback-indicators/CpAlert.vue +6 -7
  28. package/src/components/feedback-indicators/CpToaster.vue +2 -2
  29. package/src/components/inputs/CpInput.vue +3 -1
  30. package/src/components/lists-and-table/CpTable/{CpTableEmptyState.vue → CpTableEmptyState/index.vue} +4 -4
  31. package/src/components/lists-and-table/CpTable/index.scss +308 -0
  32. package/src/components/lists-and-table/CpTable/index.vue +2 -307
  33. package/src/components/toggles/CpCheckbox/index.scss +120 -0
  34. package/src/components/toggles/CpCheckbox/index.vue +1 -114
  35. package/src/components/toggles/CpRadio/index.scss +152 -0
  36. package/src/components/toggles/CpRadio/index.vue +1 -151
  37. package/src/libs/CoreToaster.vue +40 -27
  38. package/src/assets/css/fonts.css +0 -167
  39. package/src/assets/fonts/gt_america/GT-America-Standard-Black-Italic.eot +0 -0
  40. package/src/assets/fonts/gt_america/GT-America-Standard-Black-Italic.woff +0 -0
  41. package/src/assets/fonts/gt_america/GT-America-Standard-Black-Italic.woff2 +0 -0
  42. package/src/assets/fonts/gt_america/GT-America-Standard-Black.eot +0 -0
  43. package/src/assets/fonts/gt_america/GT-America-Standard-Black.woff +0 -0
  44. package/src/assets/fonts/gt_america/GT-America-Standard-Black.woff2 +0 -0
  45. package/src/assets/fonts/gt_america/GT-America-Standard-Bold-Italic.eot +0 -0
  46. package/src/assets/fonts/gt_america/GT-America-Standard-Bold-Italic.woff +0 -0
  47. package/src/assets/fonts/gt_america/GT-America-Standard-Bold-Italic.woff2 +0 -0
  48. package/src/assets/fonts/gt_america/GT-America-Standard-Bold.eot +0 -0
  49. package/src/assets/fonts/gt_america/GT-America-Standard-Bold.woff +0 -0
  50. package/src/assets/fonts/gt_america/GT-America-Standard-Bold.woff2 +0 -0
  51. package/src/assets/fonts/gt_america/GT-America-Standard-Light-Italic.eot +0 -0
  52. package/src/assets/fonts/gt_america/GT-America-Standard-Light-Italic.woff +0 -0
  53. package/src/assets/fonts/gt_america/GT-America-Standard-Light-Italic.woff2 +0 -0
  54. package/src/assets/fonts/gt_america/GT-America-Standard-Light.eot +0 -0
  55. package/src/assets/fonts/gt_america/GT-America-Standard-Light.woff +0 -0
  56. package/src/assets/fonts/gt_america/GT-America-Standard-Light.woff2 +0 -0
  57. package/src/assets/fonts/gt_america/GT-America-Standard-Medium-Italic.eot +0 -0
  58. package/src/assets/fonts/gt_america/GT-America-Standard-Medium-Italic.woff +0 -0
  59. package/src/assets/fonts/gt_america/GT-America-Standard-Medium-Italic.woff2 +0 -0
  60. package/src/assets/fonts/gt_america/GT-America-Standard-Medium.eot +0 -0
  61. package/src/assets/fonts/gt_america/GT-America-Standard-Medium.woff +0 -0
  62. package/src/assets/fonts/gt_america/GT-America-Standard-Medium.woff2 +0 -0
  63. package/src/assets/fonts/gt_america/GT-America-Standard-Regular-Italic.eot +0 -0
  64. package/src/assets/fonts/gt_america/GT-America-Standard-Regular-Italic.woff +0 -0
  65. package/src/assets/fonts/gt_america/GT-America-Standard-Regular-Italic.woff2 +0 -0
  66. package/src/assets/fonts/gt_america/GT-America-Standard-Regular.eot +0 -0
  67. package/src/assets/fonts/gt_america/GT-America-Standard-Regular.woff +0 -0
  68. package/src/assets/fonts/gt_america/GT-America-Standard-Regular.woff2 +0 -0
  69. package/src/assets/fonts/gt_america/GT-America-Standard-Thin-Italic.eot +0 -0
  70. package/src/assets/fonts/gt_america/GT-America-Standard-Thin-Italic.woff +0 -0
  71. package/src/assets/fonts/gt_america/GT-America-Standard-Thin-Italic.woff2 +0 -0
  72. package/src/assets/fonts/gt_america/GT-America-Standard-Thin.eot +0 -0
  73. package/src/assets/fonts/gt_america/GT-America-Standard-Thin.woff +0 -0
  74. package/src/assets/fonts/gt_america/GT-America-Standard-Thin.woff2 +0 -0
  75. package/src/assets/fonts/gt_america/GT-America-Standard-Ultra-Light-Italic.eot +0 -0
  76. package/src/assets/fonts/gt_america/GT-America-Standard-Ultra-Light-Italic.woff +0 -0
  77. package/src/assets/fonts/gt_america/GT-America-Standard-Ultra-Light-Italic.woff2 +0 -0
  78. package/src/assets/fonts/gt_america/GT-America-Standard-Ultra-Light.eot +0 -0
  79. package/src/assets/fonts/gt_america/GT-America-Standard-Ultra-Light.woff +0 -0
  80. package/src/assets/fonts/gt_america/GT-America-Standard-Ultra-Light.woff2 +0 -0
  81. package/src/assets/fonts/proxima_nova/proxima_nova_black.eot +0 -0
  82. package/src/assets/fonts/proxima_nova/proxima_nova_black.otf +0 -0
  83. package/src/assets/fonts/proxima_nova/proxima_nova_black.svg +0 -3238
  84. package/src/assets/fonts/proxima_nova/proxima_nova_black.woff +0 -0
  85. package/src/assets/fonts/proxima_nova/proxima_nova_bold.eot +0 -0
  86. package/src/assets/fonts/proxima_nova/proxima_nova_bold.svg +0 -3892
  87. package/src/assets/fonts/proxima_nova/proxima_nova_bold.woff +0 -0
  88. package/src/assets/fonts/proxima_nova/proxima_nova_demibold.eot +0 -0
  89. package/src/assets/fonts/proxima_nova/proxima_nova_demibold.svg +0 -3914
  90. package/src/assets/fonts/proxima_nova/proxima_nova_demibold.woff +0 -0
  91. package/src/assets/fonts/proxima_nova/proxima_nova_regular.eot +0 -0
  92. package/src/assets/fonts/proxima_nova/proxima_nova_regular.svg +0 -3922
  93. package/src/assets/fonts/proxima_nova/proxima_nova_regular.woff +0 -0
@@ -0,0 +1,120 @@
1
+ @use 'sass:math';
2
+ @import "src/assets/styles/main";
3
+
4
+ $cp-checkbox-base-width: pxToEm(20);
5
+ $cp-checkbox-tick-base-width: pxToEm(14);
6
+
7
+ @mixin cp-checkbox-style($color, $className) {
8
+ &--is#{$className} input:checked {
9
+ background-color: $color;
10
+ border-color: $color;
11
+ }
12
+
13
+ &--is#{$className}:hover input {
14
+ background-color: scale-color($color, $lightness: 95%);
15
+ }
16
+
17
+ &--is#{$className}:hover input:checked {
18
+ background-color: darken($color, 10%);
19
+ }
20
+
21
+ &--is#{$className} input:focus-within {
22
+ position: relative;
23
+ z-index: 1;
24
+ box-shadow: 0 0 0 pxToEm(3) scale-color($color, $lightness: 70%);
25
+ border-color: scale-color($color, $lightness: 70%);
26
+ }
27
+ }
28
+
29
+ .cpCheckbox {
30
+ position: relative;
31
+ display: grid;
32
+ grid-template-columns: min-content 1fr;
33
+ grid-gap: pxToRem(12);
34
+ align-items: center;
35
+ cursor: pointer;
36
+
37
+ @include cp-checkbox-style($secondary-color, 'Blue');
38
+ @include cp-checkbox-style($primary-color, 'Purple');
39
+
40
+ input {
41
+ -webkit-appearance: none;
42
+ -moz-appearance: none;
43
+ appearance: none;
44
+ border: pxToRem(1) solid $neutral-dark-4;
45
+ border-radius: pxToEm(4);
46
+ width: $cp-checkbox-base-width;
47
+ height: $cp-checkbox-base-width;
48
+ flex-shrink: 0;
49
+ cursor: pointer;
50
+ transition: background-color 0.1s ease-out, transform 0.1s linear;
51
+
52
+ & + svg {
53
+ position: absolute;
54
+ z-index: 2;
55
+ top: 50%;
56
+ left: calc(#{math.div($cp-checkbox-base-width, 2)} - #{math.div($cp-checkbox-tick-base-width, 2)});
57
+ transform: translateY(-50%);
58
+ width: $cp-checkbox-tick-base-width;
59
+ height: $cp-checkbox-tick-base-width;
60
+ stroke: $neutral-light;
61
+ stroke-width: 3;
62
+ opacity: 0;
63
+ transition: opacity 0.2s linear 0.1s;
64
+ }
65
+
66
+ &:checked + svg {
67
+ visibility: visible;
68
+ opacity: 1;
69
+ }
70
+
71
+ &:disabled {
72
+ background-color: $neutral-light-1;
73
+ cursor: not-allowed;
74
+
75
+ & ~ span {
76
+ color: $neutral-dark-1;
77
+ }
78
+ }
79
+
80
+ &:checked:disabled {
81
+ border-color: $neutral-dark-1;
82
+ background-color: $neutral-dark-1;
83
+
84
+ & ~ span {
85
+ color: $neutral-dark-1;
86
+ }
87
+ }
88
+
89
+ &:active:not(:disabled) {
90
+ transform: scale(0.8);
91
+ }
92
+ }
93
+
94
+ &--isDisabled {
95
+ cursor: not-allowed;
96
+ }
97
+
98
+ &--isReversed {
99
+ grid-template-columns: 1fr min-content;
100
+
101
+ .cpCheckbox__label {
102
+ grid-row: 1;
103
+ }
104
+
105
+ input + svg {
106
+ left: auto;
107
+ right: calc(#{math.div($cp-checkbox-base-width, 2)} - #{math.div($cp-checkbox-tick-base-width, 2)});
108
+ }
109
+ }
110
+
111
+ &__label {
112
+ display: block;
113
+ font-weight: 500;
114
+ line-height: pxToEm(20);
115
+
116
+ &--isCapitalized::first-letter {
117
+ text-transform: capitalize;
118
+ }
119
+ }
120
+ }
@@ -113,118 +113,5 @@ export default {
113
113
  </script>
114
114
 
115
115
  <style lang="scss">
116
- @mixin cp-checkbox-style($color, $className) {
117
- &--is#{$className} input:checked {
118
- background-color: $color;
119
- border-color: $color;
120
- }
121
-
122
- &--is#{$className}:hover input {
123
- background-color: scale-color($color, $lightness: 95%);
124
- }
125
-
126
- &--is#{$className}:hover input:checked {
127
- background-color: darken($color, 10%);
128
- }
129
-
130
- &--is#{$className} input:focus-within {
131
- position: relative;
132
- z-index: 1;
133
- box-shadow: 0 0 0 pxToEm(3) scale-color($color, $lightness: 70%);
134
- border-color: scale-color($color, $lightness: 70%);
135
- }
136
- }
137
-
138
- .cpCheckbox {
139
- $cp-checkbox-base-width: pxToEm(20);
140
- $cp-checkbox-tick-base-width: pxToEm(14);
141
- position: relative;
142
- display: grid;
143
- grid-template-columns: min-content 1fr;
144
- grid-gap: pxToRem(12);
145
- align-items: center;
146
- cursor: pointer;
147
-
148
- @include cp-checkbox-style($secondary-color, 'Blue');
149
- @include cp-checkbox-style($primary-color, 'Purple');
150
-
151
- input {
152
- -webkit-appearance: none;
153
- -moz-appearance: none;
154
- appearance: none;
155
- border: pxToRem(1) solid $neutral-dark-4;
156
- border-radius: pxToEm(4);
157
- width: $cp-checkbox-base-width;
158
- height: $cp-checkbox-base-width;
159
- flex-shrink: 0;
160
- cursor: pointer;
161
- transition: background-color 0.1s ease-out;
162
-
163
- & + svg {
164
- position: absolute;
165
- z-index: 2;
166
- top: 50%;
167
- left: calc(#{$cp-checkbox-base-width / 2} - #{$cp-checkbox-tick-base-width / 2});
168
- transform: translateY(-50%);
169
- width: $cp-checkbox-tick-base-width;
170
- height: $cp-checkbox-tick-base-width;
171
- stroke: $neutral-light;
172
- stroke-width: 3;
173
- opacity: 0;
174
- transition: opacity 0.2s linear 0.1s;
175
- }
176
-
177
- &:checked {
178
- & + svg {
179
- visibility: visible;
180
- opacity: 1;
181
- }
182
- }
183
-
184
- &:disabled {
185
- background-color: $neutral-light-1;
186
- cursor: not-allowed;
187
-
188
- & ~ span {
189
- color: $neutral-dark-1;
190
- }
191
- }
192
-
193
- &:checked:disabled {
194
- border-color: $neutral-dark-1;
195
- background-color: $neutral-dark-1;
196
-
197
- & ~ span {
198
- color: $neutral-dark-1;
199
- }
200
- }
201
- }
202
-
203
- &--isDisabled {
204
- cursor: not-allowed;
205
- }
206
-
207
- &--isReversed {
208
- grid-template-columns: 1fr min-content;
209
-
210
- .cpCheckbox__label {
211
- grid-row: 1;
212
- }
213
-
214
- input + svg {
215
- left: auto;
216
- right: calc(#{$cp-checkbox-base-width / 2} - #{$cp-checkbox-tick-base-width / 2});
217
- }
218
- }
219
-
220
- &__label {
221
- display: block;
222
- font-weight: 500;
223
- line-height: pxToEm(20);
224
-
225
- &--isCapitalized::first-letter {
226
- text-transform: capitalize;
227
- }
228
- }
229
- }
116
+ @import 'index';
230
117
  </style>
@@ -0,0 +1,152 @@
1
+ @use 'sass:math';
2
+ @import "src/assets/styles/main";
3
+
4
+ $cp-radio-base-width: pxToEm(20);
5
+
6
+ @mixin cp-radio-style($color, $className) {
7
+ &--is#{$className}#{&}--isActive {
8
+ border-color: $color;
9
+ }
10
+
11
+ &--is#{$className} input:checked {
12
+ background-color: $color;
13
+ border-color: $color;
14
+
15
+ & ~ span .cpRadio {
16
+ &__label,
17
+ &__additionalData {
18
+ color: $color;
19
+ }
20
+ }
21
+ }
22
+
23
+ &--is#{$className}:hover,
24
+ &--is#{$className}:focus-within {
25
+ border-color: $color;
26
+ }
27
+
28
+ &--is#{$className}:focus-within {
29
+ box-shadow: 0 0 0 pxToRem(4) rgba($color, 0.1);
30
+ }
31
+ }
32
+
33
+ .cpRadio {
34
+ position: relative;
35
+ border: pxToRem(1) solid $neutral-dark-4;
36
+ border-radius: pxToRem(10);
37
+ padding: $space-lg $space-md;
38
+ display: grid;
39
+ grid-template-columns: min-content 1fr;
40
+ grid-gap: $space-md;
41
+ align-items: center;
42
+ cursor: pointer;
43
+
44
+ @include cp-radio-style($secondary-color, 'Blue');
45
+ @include cp-radio-style($primary-color, 'Purple');
46
+
47
+ &--isDisabled {
48
+ background-color: $neutral-light-1;
49
+ cursor: not-allowed;
50
+ color: $neutral-dark-1;
51
+
52
+ &:hover,
53
+ &:focus {
54
+ box-shadow: none;
55
+ border-color: $neutral-dark-4;
56
+ }
57
+ }
58
+
59
+ &--isActive#{&}--isDisabled,
60
+ &--isActive#{&}--isDisabled:hover {
61
+ border-color: $neutral-dark-4;
62
+ }
63
+
64
+ &:not(:last-of-type) {
65
+ margin-bottom: $space-md;
66
+ }
67
+
68
+ input {
69
+ -webkit-appearance: none;
70
+ -moz-appearance: none;
71
+ appearance: none;
72
+ border: pxToRem(1) solid $neutral-dark-4;
73
+ border-radius: 100%;
74
+ padding: 25%;
75
+ width: $cp-radio-base-width;
76
+ height: $cp-radio-base-width;
77
+ cursor: pointer;
78
+ transition: transform 0.1s linear;
79
+
80
+ &:before {
81
+ content: "";
82
+ display: flex;
83
+ width: 100%;
84
+ height: 100%;
85
+ border-radius: 100%;
86
+ background-color: $neutral-light;
87
+ transition: transform 0.15s linear;
88
+ transform: scale(0);
89
+ }
90
+
91
+ &:active:not(:disabled) {
92
+ transform: scale(0.8);
93
+ }
94
+
95
+ &:checked:before {
96
+ transform: scale(1);
97
+ }
98
+
99
+ &:checked:disabled {
100
+ border-color: $neutral-dark-1;
101
+ background-color: $neutral-dark-1;
102
+ }
103
+
104
+ &:checked:disabled ~ span .cpRadio {
105
+ &__label,
106
+ &__additionalData {
107
+ color: $neutral-dark-1;
108
+ }
109
+ }
110
+ }
111
+
112
+ &__content {
113
+ display: flex;
114
+ align-items: center;
115
+ line-height: 1.3;
116
+ }
117
+
118
+ &__information {
119
+ flex-grow: 2;
120
+ display: flex;
121
+ align-items: center;
122
+ justify-content: space-between;
123
+ flex-wrap: wrap;
124
+ text-transform: capitalize;
125
+ margin: 0 -$space;
126
+ }
127
+
128
+ &__label,
129
+ &__description {
130
+ margin: 0 $space;
131
+ flex-grow: 1;
132
+ }
133
+
134
+ &__label,
135
+ &__additionalData {
136
+ font-weight: 500;
137
+ }
138
+
139
+ &__description,
140
+ &__additionalData {
141
+ color: $neutral-dark-1;
142
+ }
143
+
144
+ &__label {
145
+ white-space: nowrap;
146
+ }
147
+
148
+ &__additionalData {
149
+ text-align: right;
150
+ margin-left: $space-lg;
151
+ }
152
+ }
@@ -10,7 +10,6 @@
10
10
  :name="groupName"
11
11
  @change="onChange(radioValue)"
12
12
  />
13
- <check-icon />
14
13
  <span class="cpRadio__content">
15
14
  <span class="cpRadio__information">
16
15
  <span class="cpRadio__label">{{ radioLabel }}</span>
@@ -22,15 +21,10 @@
22
21
  </template>
23
22
 
24
23
  <script>
25
- import { CheckIcon } from 'vue-feather-icons'
26
-
27
24
  import { capitalizeFirstLetter, randomString } from '@/helpers'
28
25
  import { ToggleColors } from '@/constants'
29
26
 
30
27
  export default {
31
- components: {
32
- CheckIcon,
33
- },
34
28
  props: {
35
29
  radioValue: {
36
30
  type: String,
@@ -110,149 +104,5 @@ export default {
110
104
  </script>
111
105
 
112
106
  <style lang="scss">
113
- @mixin cp-radio-style($color, $className) {
114
- &--is#{$className}#{&}--isActive {
115
- border-color: $color;
116
- }
117
-
118
- &--is#{$className} input:checked {
119
- background-color: $color;
120
- border-color: $color;
121
-
122
- & ~ span .cpRadio {
123
- &__label,
124
- &__additionalData {
125
- color: $color;
126
- }
127
- }
128
- }
129
-
130
- &--is#{$className}:hover,
131
- &--is#{$className}:focus-within {
132
- border-color: $color;
133
- }
134
-
135
- &--is#{$className}:focus-within {
136
- box-shadow: 0 0 0 pxToRem(4) rgba($color, 0.1);
137
- }
138
- }
139
-
140
- .cpRadio {
141
- position: relative;
142
- border: pxToRem(1) solid $neutral-dark-4;
143
- border-radius: pxToRem(10);
144
- padding: pxToRem(16) pxToRem(12);
145
- display: grid;
146
- grid-template-columns: min-content 1fr;
147
- grid-gap: pxToRem(12);
148
- align-items: center;
149
- cursor: pointer;
150
-
151
- @include cp-radio-style($secondary-color, 'Blue');
152
- @include cp-radio-style($primary-color, 'Purple');
153
-
154
- &--isDisabled {
155
- background-color: $neutral-light-1;
156
- cursor: not-allowed;
157
- color: $neutral-dark-1;
158
-
159
- &:hover,
160
- &:focus {
161
- box-shadow: none;
162
- border-color: $neutral-dark-4;
163
- }
164
- }
165
-
166
- &--isActive#{&}--isDisabled,
167
- &--isActive#{&}--isDisabled:hover {
168
- border-color: $neutral-dark-4;
169
- }
170
-
171
- &:not(:last-of-type) {
172
- margin-bottom: pxToRem(12);
173
- }
174
-
175
- input {
176
- -webkit-appearance: none;
177
- -moz-appearance: none;
178
- appearance: none;
179
- border: pxToRem(1) solid $neutral-dark-4;
180
- border-radius: 100%;
181
- width: pxToRem(20);
182
- height: pxToRem(20);
183
- flex-shrink: 0;
184
- cursor: pointer;
185
-
186
- & + svg {
187
- position: absolute;
188
- top: 50%;
189
- left: calc(#{pxToRem(12)} + #{pxToRem(10)} - #{pxToRem(7)});
190
- transform: translateY(-50%);
191
- width: pxToEm(14);
192
- height: pxToEm(14);
193
- stroke: $neutral-light;
194
- stroke-width: pxToRem(3);
195
- opacity: 0;
196
- transition: opacity 0.2s linear;
197
- }
198
-
199
- &:checked + svg {
200
- visibility: visible;
201
- opacity: 1;
202
- }
203
-
204
- &:checked:disabled {
205
- border-color: $neutral-dark-1;
206
- background-color: $neutral-dark-1;
207
- }
208
-
209
- &:checked:disabled ~ span .cpRadio {
210
- &__label,
211
- &__additionalData {
212
- color: $neutral-dark-1;
213
- }
214
- }
215
- }
216
-
217
- &__content {
218
- display: flex;
219
- align-items: center;
220
- line-height: 1.3;
221
- }
222
-
223
- &__information {
224
- flex-grow: 2;
225
- display: flex;
226
- align-items: center;
227
- justify-content: space-between;
228
- flex-wrap: wrap;
229
- text-transform: capitalize;
230
- margin: 0 -$spacing-unit;
231
- }
232
-
233
- &__label,
234
- &__description {
235
- margin: 0 $spacing-unit;
236
- flex-grow: 1;
237
- }
238
-
239
- &__label,
240
- &__additionalData {
241
- font-weight: 500;
242
- }
243
-
244
- &__description,
245
- &__additionalData {
246
- color: $neutral-dark-1;
247
- }
248
-
249
- &__label {
250
- white-space: nowrap;
251
- }
252
-
253
- &__additionalData {
254
- text-align: right;
255
- margin-left: $spacing-unit * 2;
256
- }
257
- }
107
+ @import 'index';
258
108
  </style>
@@ -1,27 +1,23 @@
1
1
  <template>
2
2
  <div
3
3
  class="coreToaster"
4
- :class="`coreToaster--${type}`"
4
+ :class="dynamicClass"
5
5
  role="alert"
6
6
  @mouseenter="setHoverState()"
7
7
  @mouseleave="setHoverState(false)"
8
8
  >
9
- <div class="coreToaster__body">
10
- <div class="coreToaster__icon">
11
- <div :is="toasterIcon" :class="`coreToaster__icon--${type}`" />
12
- </div>
13
- <div class="coreToaster__content">
14
- <cp-heading heading-level="h4" :size="400" class="coreToaster__title">
15
- <strong>{{ title }}</strong>
16
- </cp-heading>
9
+ <div class="coreToaster__content">
10
+ <div :is="toasterIcon" class="coreToaster__icon" />
11
+ <div class="coreToaster__body">
12
+ <cp-heading heading-level="h4" :size="400" class="coreToaster__title">{{ title }}</cp-heading>
17
13
  <p v-if="description" class="coreToaster__description">{{ description }}</p>
18
14
  </div>
19
- <button class="coreToaster__close" @click="closeToaster"><x-icon /></button>
20
15
  </div>
16
+ <button class="coreToaster__close" @click="closeToaster"><x-icon /></button>
21
17
  <div v-if="actionLabel" class="coreToaster__footer">
22
- <cp-button appearance="minimal" color="blue" class="coreToaster__button" is-square @click="handleActionMethod">
18
+ <button class="coreToaster__button" @click="handleActionMethod">
23
19
  {{ actionLabel }}
24
- </cp-button>
20
+ </button>
25
21
  </div>
26
22
  </div>
27
23
  </template>
@@ -98,6 +94,9 @@ export default {
98
94
  const intentValues = Object.values(Intent)
99
95
  return intentValues.find((intentItem) => intentItem.value === this.type).icon
100
96
  },
97
+ dynamicClass() {
98
+ return `coreToaster--${this.type}`
99
+ },
101
100
  },
102
101
  watch: {
103
102
  isHovered(newValue) {
@@ -157,7 +156,7 @@ export default {
157
156
 
158
157
  <style lang="scss">
159
158
  @mixin cp-toaster-style($color, $className) {
160
- &__icon--#{$className} {
159
+ &--#{$className} &__icon {
161
160
  color: $color;
162
161
  }
163
162
 
@@ -170,7 +169,7 @@ export default {
170
169
  position: relative;
171
170
  box-shadow: rgba(67, 90, 111, 0.3) 0 0 1px, rgba(67, 90, 111, 0.47) 0 8px 10px -4px;
172
171
  background: $neutral-light;
173
- padding: pxToRem(12);
172
+ padding: $space-md;
174
173
  overflow: hidden;
175
174
  width: max-content;
176
175
  max-width: 100%;
@@ -178,8 +177,9 @@ export default {
178
177
  font-size: pxToRem(14);
179
178
 
180
179
  @media (min-width: 769px) {
181
- border-radius: pxToRem(4);
180
+ border-radius: pxToRem(8);
182
181
  }
182
+
183
183
  @media (max-width: 768px) {
184
184
  min-width: 100%;
185
185
  }
@@ -193,26 +193,33 @@ export default {
193
193
  height: 100%;
194
194
  }
195
195
 
196
+ &__content {
197
+ display: flex;
198
+ align-items: flex-start;
199
+ }
200
+
196
201
  &__body {
197
- display: grid;
198
- grid-template-columns: min-content 1fr min-content;
199
- align-items: start;
200
- grid-gap: $spacing-unit;
202
+ flex: 1;
203
+ margin-left: $space;
204
+ padding-right: calc(#{$space-lg} + #{$space-lg});
201
205
  }
202
206
 
203
- &__icon > svg {
207
+ &__icon {
208
+ flex-shrink: 0;
204
209
  height: pxToRem(16);
205
210
  width: pxToRem(16);
206
211
  }
207
212
 
208
213
  &__content,
209
214
  &__title {
210
- line-height: 1;
215
+ line-height: pxToRem(16);
211
216
  }
212
217
 
213
218
  &__title {
219
+ font-weight: 600;
220
+
214
221
  &:not(:only-child) {
215
- margin-bottom: $spacing-unit / 2;
222
+ margin-bottom: $space-sm;
216
223
  }
217
224
  }
218
225
 
@@ -221,12 +228,15 @@ export default {
221
228
  }
222
229
 
223
230
  &__close {
231
+ position: absolute;
232
+ right: $space;
233
+ top: $space;
224
234
  border-radius: pxToRem(4);
225
- padding: $spacing-unit / 2;
226
- transform: translate($spacing-unit / 2, -$spacing-unit / 2);
235
+ padding: $space-sm;
236
+ color: $neutral-dark-1;
227
237
 
228
238
  > svg {
229
- color: $neutral-dark-1;
239
+ margin: 0;
230
240
  width: pxToRem(18);
231
241
  height: pxToRem(18);
232
242
  }
@@ -239,13 +249,16 @@ export default {
239
249
  &__footer {
240
250
  display: flex;
241
251
  justify-content: flex-end;
242
- margin-top: $spacing-unit * 2;
252
+ margin-top: $space-lg;
243
253
  }
244
254
 
245
255
  &__button {
246
- padding: pxToRem(6) pxToRem(12);
247
256
  font-size: pxToRem(12);
248
257
  color: $secondary-color;
258
+
259
+ &:not(:hover) {
260
+ text-decoration: underline;
261
+ }
249
262
  }
250
263
 
251
264
  @include cp-toaster-style($secondary-color, 'info');