ketekny-ui-kit 1.0.88 → 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.88",
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,22 +12,29 @@
12
12
  <component
13
13
  :is="menuItemComponent(item)"
14
14
  v-bind="item.bindings"
15
- class="flex min-w-0 flex-1 appearance-none items-center gap-3 border-0 bg-transparent px-2 py-1.5 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 text-[#eef2f7] transition-colors duration-150"
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)"
21
27
  >
22
28
  <kIcon
23
29
  v-if="showFullIcon(item)"
24
30
  :name="item.icon"
25
- size="18"
26
- color="#eef2f7"
31
+ size="16"
32
+ color="currentColor"
33
+ class="sidebar-menu-item-icon"
27
34
  />
28
35
  <span
29
36
  v-else
30
- 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"
31
38
  />
32
39
  </span>
33
40
  <span class="min-w-0 flex-1">
@@ -36,18 +43,25 @@
36
43
  </span>
37
44
  <span
38
45
  v-if="item.description"
39
- class="mt-1 block truncate"
40
- :class="[itemDescriptionClasses, item.active ? 'text-[#9fa6b5]' : 'text-[#6f7786]']"
46
+ class="block truncate"
47
+ :class="[itemDescriptionClasses, item.active ? 'text-[#9fa6b5]' : 'sidebar-menu-item-description text-[#6f7786]']"
41
48
  >
42
49
  {{ item.description }}
43
50
  </span>
44
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>
45
59
  </component>
46
60
 
47
61
  <button
48
62
  v-if="item.hasChildren"
49
63
  type="button"
50
- 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]"
51
65
  :aria-expanded="isExpanded(item)"
52
66
  :aria-label="`${isExpanded(item) ? 'Collapse' : 'Expand'} ${item.label}`"
53
67
  @click.stop="toggle(item.key)"
@@ -64,7 +78,7 @@
64
78
 
65
79
  <div
66
80
  v-if="item.hasChildren && isExpanded(item)"
67
- class="ml-2 pl-4"
81
+ class="pl-3"
68
82
  >
69
83
  <TwoColSidebarMenuList
70
84
  :items="item.children"
@@ -105,11 +119,6 @@ export default {
105
119
  ? "text-[12px] leading-4"
106
120
  : "text-[11px] leading-4";
107
121
  },
108
- activeIndicatorClasses() {
109
- return this.level === 0
110
- ? "before:left-0"
111
- : "before:-left-4";
112
- },
113
122
  },
114
123
  methods: {
115
124
  menuItemComponent(item) {
@@ -134,10 +143,28 @@ export default {
134
143
  showFullIcon(item) {
135
144
  return this.level === 0 && Boolean(item?.icon);
136
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
+ },
137
158
  itemRowClasses(item) {
138
- return item.active
139
- ? `relative rounded-xl bg-[#1f232b] text-white before:absolute before:bottom-2 before:top-2 before:w-[3px] before:rounded-r-full before:bg-[#2491ff] ${this.activeIndicatorClasses}`
140
- : "rounded-xl text-[#e5e7eb] hover:bg-[#242424] hover:text-white";
159
+ if (item.active) {
160
+ return "sidebar-menu-item--active bg-white/10 text-[#eef2f7]";
161
+ }
162
+
163
+ if (item.hasActiveChild) {
164
+ return "text-[#eef2f7]";
165
+ }
166
+
167
+ return "text-[#c7cfdb] hover:bg-white/6 hover:text-[#eef2f7]";
141
168
  },
142
169
  toggle(key) {
143
170
  this.$emit("toggle-branch", key);
@@ -145,3 +172,39 @@ export default {
145
172
  },
146
173
  };
147
174
  </script>
175
+
176
+ <style scoped>
177
+ .sidebar-menu-item-icon,
178
+ .sidebar-menu-item-description {
179
+ transition: color 150ms ease-out;
180
+ }
181
+
182
+ .sidebar-menu-item--active {
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;
204
+ }
205
+
206
+ .sidebar-menu-item--active .sidebar-menu-item-description,
207
+ .sidebar-menu-item:hover .sidebar-menu-item-description {
208
+ color: #eef2f7;
209
+ }
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>