@appscode/design-system 1.1.0-beta.79 → 1.1.0-beta.80

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.79",
3
+ "version": "1.1.0-beta.80",
4
4
  "description": "A design system for Appscode websites and dashboards made using Bulma",
5
5
  "main": "main.scss",
6
6
  "scripts": {
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="buttons">
2
+ <div class="buttons" style="width: max-content">
3
3
  <slot />
4
4
  </div>
5
5
  </template>
@@ -28,33 +28,38 @@ const OptionDots = defineAsyncComponent(
28
28
  </script>
29
29
 
30
30
  <template>
31
- <div class="card-details" :class="modifierClasses" data-testid="cluster-item-navigate">
32
- <div class="c-header">
33
- <div class="c-logo">
34
- <img :src="clusterData.providerIcon" alt="" />
35
- </div>
36
- <div class="c-content">
37
- <div class="is-flex is-justify-content-space-between">
38
- <h4 data-testid="cluster-title-text">{{ clusterData.name }}</h4>
39
- <option-dots v-if="showOptions" :position="'is-right'">
40
- <slot name="options" />
41
- </option-dots>
31
+ <div class="card-details" data-testid="cluster-item-navigate">
32
+ <option-dots v-if="showOptions" :position="'is-right'">
33
+ <slot name="options" />
34
+ </option-dots>
35
+ <div class="card-details-inner" :class="modifierClasses">
36
+ <div class="c-header">
37
+ <div class="c-logo">
38
+ <img :src="clusterData.providerIcon" alt="" />
42
39
  </div>
43
- <div class="tags">
44
- <span
45
- v-for="(tag, idx) in clusterData.tags"
46
- :key="idx + tag.value"
47
- :class="tag.class"
48
- :data-testid="idx===0 ? 'cluster-status-text' : undefined"
49
- >{{ tag.value }}</span
50
- >
40
+ <div class="c-content">
41
+ <div class="is-flex is-justify-content-space-between pr-32">
42
+ <h4 data-testid="cluster-title-text">{{ clusterData.name }}</h4>
43
+ </div>
44
+ <div class="tags">
45
+ <span
46
+ v-for="(tag, idx) in clusterData.tags"
47
+ :key="idx + tag.value"
48
+ :class="tag.class"
49
+ :data-testid="idx === 0 ? 'cluster-status-text' : undefined"
50
+ >{{ tag.value }}</span
51
+ >
52
+ </div>
51
53
  </div>
52
54
  </div>
53
- </div>
54
- <div class="c-body">
55
- <p v-for="(detail, idx) in clusterData.details" :key="idx + detail.title">
56
- <span>{{ detail.title }}</span> <strong>{{ detail.value }}</strong>
57
- </p>
55
+ <div class="c-body">
56
+ <p
57
+ v-for="(detail, idx) in clusterData.details"
58
+ :key="idx + detail.title"
59
+ >
60
+ <span>{{ detail.title }}</span> <strong>{{ detail.value }}</strong>
61
+ </p>
62
+ </div>
58
63
  </div>
59
64
  </div>
60
65
  </template>
@@ -69,7 +74,12 @@ const OptionDots = defineAsyncComponent(
69
74
  width: calc(33% - 7px);
70
75
  min-width: 430px;
71
76
  max-width: 530px;
72
-
77
+ .ac-options {
78
+ position: absolute;
79
+ right: 20px;
80
+ top: 30px;
81
+ z-index: 999;
82
+ }
73
83
  .c-header {
74
84
  display: flex;
75
85
  margin-bottom: 20px;
@@ -1,4 +1,7 @@
1
1
  <script setup lang="ts">
2
+ import { ref } from "vue";
3
+ import { onClickOutside } from "@vueuse/core";
4
+
2
5
  interface Props {
3
6
  modifierClasses?: string;
4
7
  }
@@ -6,11 +9,28 @@ interface Props {
6
9
  withDefaults(defineProps<Props>(), {
7
10
  modifierClasses: "",
8
11
  });
12
+
13
+ const emit = defineEmits(["isActive"]);
14
+
15
+ const navbarItem = ref(null);
16
+
17
+ const isActive = ref("");
18
+ function clickEvent() {
19
+ if (isActive.value) isActive.value = "";
20
+ else isActive.value = " is-active";
21
+ emit("isActive", isActive.value);
22
+ }
23
+
24
+ onClickOutside(navbarItem, () => (isActive.value = ""));
9
25
  </script>
10
26
 
11
27
  <template>
12
- <div class="ac-menu-item" :class="modifierClasses">
13
- <button class="button ac-nav-button">
28
+ <div
29
+ ref="navbarItem"
30
+ class="ac-menu-item"
31
+ :class="modifierClasses + isActive"
32
+ >
33
+ <button class="button ac-nav-button" @click="clickEvent()">
14
34
  <slot name="navbar-item" />
15
35
  </button>
16
36
  <slot name="navbar-content" />
@@ -22,6 +42,14 @@ withDefaults(defineProps<Props>(), {
22
42
  margin-left: 12px;
23
43
  position: relative;
24
44
 
45
+ &.is-active {
46
+ .ac-nav-button {
47
+ &::after {
48
+ background-color: $primary-90;
49
+ }
50
+ }
51
+ }
52
+
25
53
  &:first-child {
26
54
  margin-left: 0;
27
55
  }
@@ -32,13 +60,6 @@ withDefaults(defineProps<Props>(), {
32
60
  border-radius: 0;
33
61
  font-weight: 500;
34
62
  border: none;
35
- // .ac-user-profile {
36
- // img {
37
- // border-radius: 50%;
38
- // width: 32px;
39
- // height: 32px;
40
- // }
41
- // }
42
63
  &::after {
43
64
  border-radius: 0;
44
65
  border: none;
@@ -55,25 +76,26 @@ withDefaults(defineProps<Props>(), {
55
76
  position: relative;
56
77
  z-index: 99;
57
78
  user-select: none;
79
+ border: 1px solid $primary-80;
58
80
  cursor: pointer;
59
81
  &:after {
60
82
  position: absolute;
61
83
  content: "";
62
84
  left: 0;
63
85
  top: 0;
64
-
65
- background-color: $primary-80;
66
- opacity: 0.2;
86
+ opacity: 1;
87
+ z-index: -1;
67
88
  width: 100%;
68
89
  height: 100%;
69
90
  border-radius: 50%;
70
91
  transition: 0.3s ease-in-out;
71
92
  }
72
-
93
+ &:focus {
94
+ box-shadow: none;
95
+ }
73
96
  &:hover {
74
97
  &:after {
75
- background-color: $primary-70;
76
- opacity: 0.4;
98
+ background-color: $primary-90;
77
99
  }
78
100
  }
79
101
  }
@@ -262,7 +262,7 @@
262
262
  }
263
263
 
264
264
  .ac-menu-item {
265
- &:hover {
265
+ &.is-active {
266
266
  .ac-menu-content {
267
267
  opacity: 1;
268
268
  visibility: visible;
@@ -6,16 +6,23 @@ const NavbarItem = defineAsyncComponent(() => import("./NavbarItem.vue"));
6
6
  const NavbarItemContent = defineAsyncComponent(
7
7
  () => import("./NavbarItemContent.vue")
8
8
  );
9
- defineProps<{
10
- notifications: Notification[];
11
- }>();
12
-
9
+ withDefaults(
10
+ defineProps<{
11
+ notifications?: Array<Notification>;
12
+ unreadNotification?: number;
13
+ }>(),
14
+ {
15
+ notifications: () => [],
16
+ unreadNotification: 0,
17
+ }
18
+ );
19
+ defineEmits(["isActive"]);
13
20
  function notificationTime(time: number) {
14
21
  return TimeConvert.getDayDifferences({ past: time });
15
22
  }
16
23
  </script>
17
24
  <template>
18
- <navbar-item v-if="true">
25
+ <navbar-item ref="notificationItem" @is-active="$emit('isActive', $event)">
19
26
  <template #navbar-item>
20
27
  <svg
21
28
  width="16"
@@ -39,6 +46,13 @@ function notificationTime(time: number) {
39
46
  </clipPath>
40
47
  </defs>
41
48
  </svg>
49
+
50
+ <span v-if="unreadNotification > 999" class="notification-count"
51
+ >999+</span
52
+ >
53
+ <span v-else-if="unreadNotification !== 0" class="notification-count">{{
54
+ unreadNotification
55
+ }}</span>
42
56
  </template>
43
57
 
44
58
  <template #navbar-content>
@@ -80,10 +94,6 @@ function notificationTime(time: number) {
80
94
  <span> </span>
81
95
  </a>
82
96
  </div>
83
-
84
- <div class="notification-footer">
85
- <button class="">See More</button>
86
- </div>
87
97
  </div>
88
98
  </navbar-item-content>
89
99
  </template>
@@ -91,6 +101,22 @@ function notificationTime(time: number) {
91
101
  </template>
92
102
 
93
103
  <style lang="scss" scoped>
104
+ .notification-count {
105
+ position: absolute;
106
+ background-color: $primary;
107
+ color: $white-100;
108
+ padding: 4px;
109
+ font-size: 11px;
110
+ line-height: 1;
111
+ border-radius: 50px;
112
+ min-width: 20px;
113
+ height: 20px;
114
+ right: -10px;
115
+ top: -8px;
116
+ border: 1px solid $primary-97;
117
+ opacity: 1;
118
+ z-index: 9;
119
+ }
94
120
  .dropdown-inner {
95
121
  border-radius: 4px;
96
122
  overflow: hidden;
@@ -261,7 +261,7 @@ watch(dropDownStatus, (n) => {
261
261
  display: flex;
262
262
  align-items: center;
263
263
  border-bottom: 1px solid $primary-90;
264
- padding: 8px 16px;
264
+ padding: 16px 16px;
265
265
 
266
266
  .profile-photo {
267
267
  // width: 50px;
@@ -51,11 +51,21 @@ const documentClick = (e: Event) => {
51
51
 
52
52
  <style lang="scss">
53
53
  .ac-options {
54
- position: relative;
55
- z-index: 9;
56
- background-color: transparent;
54
+ border-radius: 50%;
55
+ width: 32px;
56
+ height: 32px;
57
+ text-align: center;
58
+ margin: 0;
59
+ display: flex;
60
+ align-items: center;
61
+ justify-content: center;
57
62
  border: none;
58
- box-shadow: none;
63
+ background-color: transparent;
64
+ cursor: pointer;
65
+ &:hover {
66
+ background-color: $primary-90;
67
+ }
68
+
59
69
  &:focus-within {
60
70
  .options-items {
61
71
  opacity: 1;
@@ -87,8 +97,6 @@ const documentClick = (e: Event) => {
87
97
  &.is-right {
88
98
  .option-dots {
89
99
  align-items: flex-end;
90
- padding: 0 10px;
91
- margin-right: -10px;
92
100
  }
93
101
 
94
102
  .options-items {