@appscode/design-system 1.1.0-beta.14 → 1.1.0-beta.15

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appscode/design-system",
3
- "version": "1.1.0-beta.14",
3
+ "version": "1.1.0-beta.15",
4
4
  "description": "A design system for Appscode websites and dashboards made using Bulma",
5
5
  "main": "main.scss",
6
6
  "scripts": {
@@ -20,7 +20,7 @@ withDefaults(defineProps<Props>(), {
20
20
  // for alert message
21
21
  .ac-notification {
22
22
  background-color: #dee7f5;
23
- font-size: 13;
23
+ font-size: 13px;
24
24
  color: $primary;
25
25
  min-height: 36px;
26
26
  display: flex;
@@ -27,10 +27,15 @@ const { notificationType, content, hideIcon, actionButton } = toRefs(props);
27
27
 
28
28
  const iconClass = computed(() => {
29
29
  if (notificationType.value === "success") return "fa-check-circle";
30
- else if (notificationType.value === "info") return "fa-info-circle";
31
- else if (notificationType.value === "danger") return "fa-times-circle";
30
+ else if (notificationType.value === "info") return "fa-info-circle ";
31
+ else if (notificationType.value === "error") return "fa-times-circle";
32
32
  else return "fa-info-circle";
33
33
  });
34
+ const backgroundColor = computed(() => {
35
+ if (notificationType.value === "success") return "is-success";
36
+ else if (notificationType.value === "error") return "is-danger";
37
+ else return "";
38
+ });
34
39
 
35
40
  const getSanitizedHtml = (content: string) => {
36
41
  return DOMPurify.sanitize(content || "");
@@ -40,7 +45,10 @@ const getSanitizedHtml = (content: string) => {
40
45
  <template>
41
46
  <!-- alert-message area start -->
42
47
  <!-- plsease, use this class name ('.is-info' 'is-success', 'is-danger', 'is-warning') -->
43
- <div :class="`notification is-${notificationType} mb-15`">
48
+ <div
49
+ class="ac-notification is-${notificationType} mb-15"
50
+ :class="backgroundColor"
51
+ >
44
52
  <p>
45
53
  <i v-if="!hideIcon" :class="`fa ${iconClass} mr-5`"></i
46
54
  ><span v-html="getSanitizedHtml(content)"></span>
@@ -56,3 +64,224 @@ const getSanitizedHtml = (content: string) => {
56
64
  </div>
57
65
  <!-- alert-message area end -->
58
66
  </template>
67
+
68
+ <style lang="scss" scoped>
69
+ // for alert message
70
+ .ac-notification {
71
+ background-color: #dee7f5;
72
+ font-size: 13px;
73
+ color: $primary;
74
+ min-height: 36px;
75
+ display: flex;
76
+ align-items: center;
77
+ padding: 8px 16px;
78
+ overflow: hidden;
79
+ border: 1px solid $primary;
80
+ border-radius: 4px;
81
+ justify-content: flex-start;
82
+ position: relative;
83
+ z-index: 1;
84
+ min-width: 280px;
85
+
86
+ p {
87
+ color: $primary;
88
+
89
+ .close-icon {
90
+ padding-right: 10px;
91
+ font-size: 15px;
92
+ }
93
+
94
+ a {
95
+ text-decoration: underline;
96
+ color: $primary;
97
+
98
+ &:hover {
99
+ color: hsla(
100
+ var(--hsl-hue),
101
+ var(--hsl-saturation),
102
+ calc(var(--hsl-lightness) - 10%),
103
+ 1
104
+ );
105
+ }
106
+ }
107
+ }
108
+
109
+ button.close {
110
+ background-color: transparent;
111
+ cursor: pointer;
112
+ right: 0px;
113
+ position: absolute;
114
+ box-shadow: none;
115
+ border: none;
116
+ font-size: 14px;
117
+ color: $danger;
118
+ width: 40px;
119
+ height: 100%;
120
+ display: flex;
121
+ align-items: center;
122
+ justify-content: center;
123
+ }
124
+ }
125
+
126
+ // mixin for .ac-notification
127
+ @mixin acNotification($colorName) {
128
+ background-color: scale-color($color: $colorName, $lightness: 80%);
129
+ color: $white-100;
130
+ border-color: $colorName;
131
+
132
+ p {
133
+ color: $colorName;
134
+
135
+ a {
136
+ color: $colorName;
137
+
138
+ &:hover {
139
+ color: $colorName;
140
+ opacity: 0.8;
141
+ }
142
+ }
143
+ }
144
+ }
145
+ @mixin acPrimaryNotification() {
146
+ background-color: hsla(
147
+ var(--hsl-hue),
148
+ var(--hsl-saturation),
149
+ var(--hsl-lightness),
150
+ 0.2
151
+ );
152
+ color: $white-100;
153
+ border-color: $primary;
154
+
155
+ p {
156
+ color: $primary;
157
+
158
+ a {
159
+ color: $primary;
160
+
161
+ &:hover {
162
+ color: $primary;
163
+ opacity: 0.8;
164
+ }
165
+ }
166
+ }
167
+ }
168
+
169
+ // is-primary
170
+ .ac-notification.is-primary {
171
+ @include acPrimaryNotification();
172
+ }
173
+
174
+ // is.info
175
+ .ac-notification.is-info {
176
+ @include acNotification($info);
177
+ }
178
+
179
+ // is.success
180
+ .ac-notification.is-success {
181
+ @include acNotification($success);
182
+ }
183
+
184
+ // is-danger
185
+ .ac-notification.is-danger {
186
+ @include acNotification($danger);
187
+ }
188
+
189
+ // is-warning
190
+ .ac-notification.is-warning {
191
+ @include acNotification($warning);
192
+ }
193
+
194
+ /*====================================
195
+ AC Toast
196
+ =====================================*/
197
+
198
+ .ac-toast {
199
+ width: 350px;
200
+ display: flex;
201
+ align-items: center;
202
+ justify-content: space-between;
203
+ font-size: 13px;
204
+ border-radius: 4px;
205
+ position: relative;
206
+ padding-right: 30px;
207
+ margin-bottom: 10px;
208
+
209
+ * {
210
+ color: $white-100;
211
+ }
212
+
213
+ p {
214
+ padding-left: 16px;
215
+
216
+ i.fa {
217
+ padding-right: 0 !important;
218
+ margin-right: 4px;
219
+ }
220
+ }
221
+
222
+ a {
223
+ font-weight: 500;
224
+ text-decoration: underline;
225
+ padding: 0 15px;
226
+
227
+ &:hover {
228
+ color: $black-70;
229
+ }
230
+ }
231
+
232
+ button.close-button {
233
+ border-radius: 0px;
234
+ background-color: transparent;
235
+ border: none;
236
+ color: $white-100;
237
+ position: absolute;
238
+ right: 0;
239
+ top: 0;
240
+ padding: 5px;
241
+ height: 100%;
242
+ width: 30px;
243
+ z-index: 1;
244
+ cursor: pointer;
245
+ border-left: 1px solid #dddddd;
246
+ }
247
+ }
248
+
249
+ // mixin for .ac-toast
250
+ @mixin acToast($colorName) {
251
+ background-color: $colorName;
252
+ color: $white-100;
253
+ border-color: $colorName;
254
+ }
255
+
256
+ // is-primary
257
+ .ac-toast.is-primary {
258
+ @include acToast($primary);
259
+ }
260
+
261
+ // is-info
262
+ .ac-toast.is-info {
263
+ @include acToast($info);
264
+ }
265
+
266
+ // is.success
267
+ .ac-toast.is-success {
268
+ @include acToast($success);
269
+ }
270
+
271
+ // is-danger
272
+ .ac-toast.is-danger {
273
+ @include acToast($danger);
274
+ }
275
+
276
+ // is-warning
277
+ .ac-toast.is-warning {
278
+ @include acToast($warning);
279
+ }
280
+
281
+ // dark theme start
282
+ // .is-dark-theme {
283
+ // .ac-notification.is-danger {
284
+ // background-color: $dark-bg-light;
285
+ // }
286
+ // }
287
+ </style>