Skip to content

Commit

Permalink
fix(NavigationMenu): remove w-full on root slot
Browse files Browse the repository at this point in the history
Resolves #3000
  • Loading branch information
benjamincanac committed Jan 6, 2025
1 parent 41dc11c commit ef7ecd2
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 53 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const items = [
<template>
<UNavigationMenu
:items="items"
class="justify-center"
class="w-full justify-center"
:ui="{
viewport: 'sm:w-[var(--reka-navigation-menu-viewport-width)]',
childList: 'sm:w-96',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const items = [
</script>

<template>
<UNavigationMenu :items="items" class="justify-center">
<UNavigationMenu :items="items" class="w-full justify-center">
<template #components-trailing>
<UBadge label="44" variant="subtle" size="sm" />
</template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,5 +111,5 @@ defineShortcuts({
</script>

<template>
<UNavigationMenu v-model="active" :items="items" class="justify-center" />
<UNavigationMenu v-model="active" :items="items" class="w-full justify-center" />
</template>
14 changes: 9 additions & 5 deletions docs/content/3.components/navigation-menu.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ props:
- label: Help
icon: i-lucide-circle-help
disabled: true
class: 'justify-center'
class: 'w-full justify-center'
---
::

Expand Down Expand Up @@ -329,7 +329,7 @@ props:
- label: Help
icon: i-lucide-circle-help
disabled: true
class: 'data-[orientation=horizontal]:border-b border-[var(--ui-border)] data-[orientation=vertical]:w-48'
class: 'data-[orientation=horizontal]:border-b border-[var(--ui-border)] data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-48'
---
::

Expand All @@ -349,6 +349,7 @@ Use the `color` prop to change the color of the NavigationMenu.
---
ignore:
- items
- class
external:
- items
props:
Expand All @@ -369,6 +370,7 @@ props:
badge: 3.8k
to: https://github.com/nuxt/ui
target: _blank
class: 'w-full'
---
::

Expand All @@ -380,6 +382,7 @@ Use the `variant` prop to change the variant of the NavigationMenu.
---
ignore:
- items
- class
external:
- items
props:
Expand All @@ -402,6 +405,7 @@ props:
badge: 3.8k
to: https://github.com/nuxt/ui
target: _blank
class: 'w-full'
---
::

Expand Down Expand Up @@ -496,7 +500,7 @@ props:
icon: i-lucide-file-text
description: Show a horizontal bar to indicate task progression.
to: /components/progress
class: 'justify-center'
class: 'w-full justify-center'
---
::

Expand Down Expand Up @@ -596,7 +600,7 @@ props:
icon: i-lucide-file-text
description: Show a horizontal bar to indicate task progression.
to: /components/progress
class: 'justify-center'
class: 'w-full justify-center'
---
::

Expand Down Expand Up @@ -688,7 +692,7 @@ props:
icon: i-lucide-file-text
description: Show a horizontal bar to indicate task progression.
to: /components/progress
class: 'justify-center'
class: 'w-full justify-center'
---
::

Expand Down
2 changes: 1 addition & 1 deletion src/theme/navigation-menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default (options: Required<ModuleOptions>) => ({
},
orientation: {
horizontal: {
root: 'w-full items-center justify-between',
root: 'items-center justify-between',
list: 'flex items-center',
item: 'py-2',
link: 'px-2.5 py-1.5 before:inset-x-px before:inset-y-0',
Expand Down
44 changes: 22 additions & 22 deletions test/components/__snapshots__/NavigationMenu-vue.spec.ts.snap

Large diffs are not rendered by default.

44 changes: 22 additions & 22 deletions test/components/__snapshots__/NavigationMenu.spec.ts.snap

Large diffs are not rendered by default.

0 comments on commit ef7ecd2

Please sign in to comment.