ketekny-ui-kit 1.0.89 → 1.0.90

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,7 +1,7 @@
1
1
  {
2
2
  "name": "ketekny-ui-kit",
3
3
  "type": "module",
4
- "version": "1.0.89",
4
+ "version": "1.0.90",
5
5
  "description": "A Vue 3 UI component library with Tailwind CSS styling",
6
6
  "main": "index.js",
7
7
  "files": [
@@ -317,6 +317,7 @@ export default {
317
317
  key,
318
318
  label: item?.label || "",
319
319
  description: item?.description || "",
320
+ badge: item?.badge ?? null,
320
321
  icon: item?.icon || "Dot",
321
322
  active,
322
323
  hasActiveChild,
@@ -12,23 +12,29 @@
12
12
  <component
13
13
  :is="menuItemComponent(item)"
14
14
  v-bind="item.bindings"
15
- class="sidebar-menu-item flex min-w-0 flex-1 appearance-none items-center gap-3 rounded-r-xl border-l-2 border-transparent bg-transparent px-3 py-2 text-left outline-none transition-all duration-150"
15
+ class="sidebar-menu-item relative flex min-h-[38px] min-w-0 flex-1 items-center gap-2.5 rounded-md px-3 py-2 text-left outline-none transition-colors duration-150"
16
16
  :class="itemRowClasses(item)"
17
17
  @click="handleItemClick(item, $event)"
18
18
  >
19
19
  <span
20
- class="flex h-5 w-5 shrink-0 items-center justify-center transition-colors duration-150"
21
- :class="item.active ? 'text-[#eef2f7]' : 'text-gray-500'"
20
+ v-if="item.active"
21
+ class="absolute left-0 top-1/2 h-5 w-1 -translate-y-1/2 rounded-r bg-[#2491ff]"
22
+ aria-hidden="true"
23
+ />
24
+ <span
25
+ class="flex h-4 w-4 shrink-0 items-center justify-center transition-colors duration-150"
26
+ :class="iconWrapClasses(item)"
22
27
  >
23
28
  <kIcon
24
29
  v-if="showFullIcon(item)"
25
30
  :name="item.icon"
26
- size="18"
27
- :color="item.active ? '#eef2f7' : '#9ca3af'"
31
+ size="16"
32
+ color="currentColor"
33
+ class="sidebar-menu-item-icon"
28
34
  />
29
35
  <span
30
36
  v-else
31
- class="h-1.5 w-1.5 rounded-full bg-current opacity-80"
37
+ class="h-1.5 w-1.5 rounded-full bg-current"
32
38
  />
33
39
  </span>
34
40
  <span class="min-w-0 flex-1">
@@ -37,18 +43,25 @@
37
43
  </span>
38
44
  <span
39
45
  v-if="item.description"
40
- class="mt-1 block truncate"
46
+ class="block truncate"
41
47
  :class="[itemDescriptionClasses, item.active ? 'text-[#9fa6b5]' : 'sidebar-menu-item-description text-[#6f7786]']"
42
48
  >
43
49
  {{ item.description }}
44
50
  </span>
45
51
  </span>
52
+ <span
53
+ v-if="item.badge != null"
54
+ class="ml-auto rounded-full px-1.5 py-0.5 text-[11px] font-medium leading-none tabular-nums transition-colors duration-150"
55
+ :class="badgeClasses(item)"
56
+ >
57
+ {{ item.badge }}
58
+ </span>
46
59
  </component>
47
60
 
48
61
  <button
49
62
  v-if="item.hasChildren"
50
63
  type="button"
51
- class="flex w-8 shrink-0 appearance-none items-center justify-center border-0 bg-transparent text-[#6f7786] outline-none transition hover:bg-white/6 hover:text-[#cbd5e1]"
64
+ class="flex w-8 shrink-0 appearance-none items-center justify-center border-0 bg-transparent text-[#6f7786] outline-none transition-colors duration-150 hover:text-[#e5e7eb]"
52
65
  :aria-expanded="isExpanded(item)"
53
66
  :aria-label="`${isExpanded(item) ? 'Collapse' : 'Expand'} ${item.label}`"
54
67
  @click.stop="toggle(item.key)"
@@ -65,7 +78,7 @@
65
78
 
66
79
  <div
67
80
  v-if="item.hasChildren && isExpanded(item)"
68
- class="ml-2 pl-4"
81
+ class="pl-3"
69
82
  >
70
83
  <TwoColSidebarMenuList
71
84
  :items="item.children"
@@ -130,12 +143,28 @@ export default {
130
143
  showFullIcon(item) {
131
144
  return this.level === 0 && Boolean(item?.icon);
132
145
  },
146
+ iconWrapClasses(item) {
147
+ if (item.active) return "text-[#eef2f7]";
148
+ if (item.hasActiveChild) return "text-[#cfd6e4]";
149
+ return "text-[#7b8494] group-hover:text-[#eef2f7]";
150
+ },
151
+ badgeClasses(item) {
152
+ if (item.active) {
153
+ return "bg-white/12 text-[#eef2f7]";
154
+ }
155
+
156
+ return "sidebar-menu-item-badge bg-white/8 text-[#8e97a8]";
157
+ },
133
158
  itemRowClasses(item) {
134
159
  if (item.active) {
135
- return "sidebar-menu-item--active text-white border-l-[#2491ff] bg-[#141922]";
160
+ return "sidebar-menu-item--active bg-white/10 text-[#eef2f7]";
161
+ }
162
+
163
+ if (item.hasActiveChild) {
164
+ return "text-[#eef2f7]";
136
165
  }
137
166
 
138
- return "text-[#e5e7eb] hover:text-white";
167
+ return "text-[#c7cfdb] hover:bg-white/6 hover:text-[#eef2f7]";
139
168
  },
140
169
  toggle(key) {
141
170
  this.$emit("toggle-branch", key);
@@ -145,11 +174,37 @@ export default {
145
174
  </script>
146
175
 
147
176
  <style scoped>
177
+ .sidebar-menu-item-icon,
178
+ .sidebar-menu-item-description {
179
+ transition: color 150ms ease-out;
180
+ }
181
+
148
182
  .sidebar-menu-item--active {
149
- box-shadow: inset 0 0 0 1px rgba(36, 145, 255, 0.1);
183
+ box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
184
+ }
185
+
186
+ .sidebar-menu-item-icon {
187
+ color: currentColor !important;
188
+ }
189
+
190
+ .sidebar-menu-item--active .sidebar-menu-item-icon {
191
+ color: #eef2f7 !important;
192
+ }
193
+
194
+ .sidebar-menu-item:hover .sidebar-menu-item-icon {
195
+ color: #eef2f7 !important;
196
+ }
197
+
198
+ .sidebar-menu-item:hover {
199
+ color: #eef2f7;
200
+ }
201
+
202
+ .sidebar-menu-item:hover .sidebar-menu-item-badge {
203
+ color: #eef2f7;
150
204
  }
151
205
 
206
+ .sidebar-menu-item--active .sidebar-menu-item-description,
152
207
  .sidebar-menu-item:hover .sidebar-menu-item-description {
153
- color: #ffffff;
208
+ color: #eef2f7;
154
209
  }
155
210
  </style>
@@ -211,33 +211,34 @@
211
211
  <div v-else class="flex flex-col px-1">
212
212
  <div
213
213
  v-if="helpUrl || account.loggedIn"
214
+ class="flex flex-col gap-0.5"
214
215
  >
215
216
  <a
216
217
  v-if="helpUrl"
217
218
  :href="helpUrl"
218
219
  target="_blank"
219
220
  rel="noreferrer"
220
- class="flex w-full items-center gap-3 rounded-xl px-2 py-2 text-lg font-medium text-[#d7dbe3] transition hover:bg-[#242424] hover:text-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/70"
221
+ class="sidebar-footer-item flex min-h-[38px] w-full items-center gap-2.5 rounded-md bg-transparent px-3 py-2 text-left text-[15px] font-medium text-[#c7cfdb] outline-none transition-colors duration-150 hover:bg-white/6 hover:text-[#eef2f7] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/70"
221
222
  >
222
- <kIcon name="HelpCircle" size="16" color="#d7dbe3" />
223
+ <kIcon name="HelpCircle" size="16" color="currentColor" class="sidebar-footer-item-icon" />
223
224
  <span>Βοήθεια και υποστήριξη</span>
224
225
  </a>
225
226
  <button
226
227
  v-if="account.loggedIn"
227
228
  type="button"
228
- class="flex w-full items-center gap-3 rounded-xl px-2 py-2 text-left text-lg font-medium text-[#d7dbe3] transition hover:bg-[#242424] hover:text-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/70"
229
+ class="sidebar-footer-item flex min-h-[38px] w-full items-center gap-2.5 rounded-md bg-transparent px-3 py-2 text-left text-[15px] font-medium text-[#c7cfdb] outline-none transition-colors duration-150 hover:bg-white/6 hover:text-[#eef2f7] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/70"
229
230
  @click="$emit('edit-profile')"
230
231
  >
231
- <kIcon name="UserRoundCog" size="16" color="#d7dbe3" />
232
+ <kIcon name="UserRoundCog" size="16" color="currentColor" class="sidebar-footer-item-icon" />
232
233
  <span>Το προφίλ μου</span>
233
234
  </button>
234
235
  <button
235
236
  v-if="account.loggedIn"
236
237
  type="button"
237
- class="flex w-full items-center gap-3 rounded-xl px-2 py-2 text-left text-lg font-medium text-[#f59e0b] transition hover:bg-[#3a1f12] hover:text-[#fbbf24] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#f59e0b]/40"
238
+ class="sidebar-footer-item sidebar-footer-item--warning flex min-h-[38px] w-full items-center gap-2.5 rounded-md bg-transparent px-3 py-2 text-left text-[15px] font-medium text-[#f59e0b] outline-none transition-colors duration-150 hover:bg-[#3a2410] hover:text-[#fbbf24] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#f59e0b]/40"
238
239
  @click="$emit('signout')"
239
240
  >
240
- <kIcon name="LogOut" size="16" color="#f59e0b" />
241
+ <kIcon name="LogOut" size="16" color="currentColor" class="sidebar-footer-item-icon" />
241
242
  <span>Αποσύνδεση</span>
242
243
  </button>
243
244
  </div>
@@ -631,3 +632,22 @@ export default {
631
632
  },
632
633
  };
633
634
  </script>
635
+
636
+ <style scoped>
637
+ .sidebar-footer-item-icon {
638
+ color: #9ca3af !important;
639
+ transition: color 200ms ease-out;
640
+ }
641
+
642
+ .sidebar-footer-item:hover .sidebar-footer-item-icon {
643
+ color: #ffffff !important;
644
+ }
645
+
646
+ .sidebar-footer-item--warning .sidebar-footer-item-icon {
647
+ color: #f59e0b !important;
648
+ }
649
+
650
+ .sidebar-footer-item--warning:hover .sidebar-footer-item-icon {
651
+ color: #fbbf24 !important;
652
+ }
653
+ </style>