@bjj/nuxt-layer-shadcn-ui 0.13.3 → 0.13.5

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.
@@ -4,7 +4,6 @@ import {
4
4
  SidebarMenu,
5
5
  SidebarMenuButton,
6
6
  SidebarMenuItem,
7
- useSidebar,
8
7
  } from '../../shadcn/sidebar'
9
8
 
10
9
  const props = defineProps<{
@@ -12,8 +11,6 @@ const props = defineProps<{
12
11
  menuItems?: AdminLayoutSidebarDropdownMenuItem[]
13
12
  }>()
14
13
 
15
- const { isMobile } = useSidebar()
16
-
17
14
  // 'profile' items render through the 'profile' slot: clickable (`custom-action`,
18
15
  // padding reset so the slot owns it) when it has a `command`, else a label.
19
16
  const dropdownItems = computed<DropdownItem[]>(() =>
@@ -35,8 +32,7 @@ const dropdownItems = computed<DropdownItem[]>(() =>
35
32
  <Dropdown
36
33
  :menus="dropdownItems"
37
34
  trigger="click"
38
- :side="isMobile ? 'bottom' : 'right'"
39
- align="start"
35
+ align="end"
40
36
  :sideOffset="4"
41
37
  class="min-w-56 rounded-lg"
42
38
  >
@@ -105,9 +105,16 @@ function hasActiveChild (item: AdminLayoutSidebarMenuItem): boolean {
105
105
  v-for="child in item.children"
106
106
  :key="child.label"
107
107
  >
108
+ <!-- The vendored sub-button renders `data-active=""` when active while its
109
+ built-in styles only match `data-active="true"`, so the active styles
110
+ are re-applied here via an attribute-presence selector. -->
108
111
  <SidebarMenuSubButton
109
112
  :asChild="isLink(child)"
110
113
  :isActive="isActive(child.href)"
114
+ class="
115
+ data-active:bg-sidebar-accent
116
+ data-active:text-sidebar-accent-foreground
117
+ "
111
118
  >
112
119
  <WebLink
113
120
  v-if="isLink(child)"
@@ -150,7 +157,7 @@ function hasActiveChild (item: AdminLayoutSidebarMenuItem): boolean {
150
157
  <Icon
151
158
  v-if="isExternal(item.href!)"
152
159
  name="external-link"
153
- class="ml-auto size-3.5 text-sidebar-foreground/50"
160
+ class="size-3.5 text-sidebar-foreground/50 ml-auto"
154
161
  />
155
162
  </WebLink>
156
163
  <template v-else>
@@ -181,7 +188,7 @@ function hasActiveChild (item: AdminLayoutSidebarMenuItem): boolean {
181
188
  v-if="isLink(action)"
182
189
  :href="action.href"
183
190
  unstyled
184
- class="flex items-center gap-2"
191
+ class="gap-2 flex items-center"
185
192
  >
186
193
  <Icon
187
194
  v-if="action.icon"
@@ -224,7 +231,7 @@ function hasActiveChild (item: AdminLayoutSidebarMenuItem): boolean {
224
231
  <Icon
225
232
  v-if="isExternal(item.href!)"
226
233
  name="external-link"
227
- class="ml-auto size-3.5 text-sidebar-foreground/50"
234
+ class="size-3.5 text-sidebar-foreground/50 ml-auto"
228
235
  />
229
236
  </WebLink>
230
237
  <template v-else>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bjj/nuxt-layer-shadcn-ui",
3
- "version": "0.13.3",
3
+ "version": "0.13.5",
4
4
  "description": "Nuxt layer providing shadcn-vue based UI components",
5
5
  "type": "module",
6
6
  "main": "./nuxt.config.ts",
@@ -42,5 +42,5 @@
42
42
  "vue-i18n": "^11",
43
43
  "vue-router": "^4 || ^5"
44
44
  },
45
- "gitHead": "02d6b4c35baefc4092632af1aa21c969c007b779"
45
+ "gitHead": "148d441a7aa5c99bab2401dccaeca469a6958df1"
46
46
  }