Skip to content

Commit 693b0d2

Browse files
committed
fix(Sidebar): component import and registry dependencies
1 parent 8a24d11 commit 693b0d2

19 files changed

+68
-75
lines changed

apps/www/src/lib/registry/default/ui/sidebar/Sidebar.vue

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,14 @@
11
<script setup lang="ts">
2-
import type { HTMLAttributes } from 'vue'
3-
import Sheet from '@/lib/registry/default/ui/sheet/Sheet.vue'
4-
import SheetContent from '@/lib/registry/default/ui/sheet/SheetContent.vue'
2+
import type { SidebarProps } from '.'
3+
import { Sheet, SheetContent } from '@/lib/registry/default/ui/sheet'
54
import { cn } from '@/lib/utils'
65
import { SIDEBAR_WIDTH_MOBILE, useSidebar } from './utils'
76
87
defineOptions({
98
inheritAttrs: false,
109
})
1110
12-
const props = withDefaults(defineProps<{
13-
side?: 'left' | 'right'
14-
variant?: 'sidebar' | 'floating' | 'inset'
15-
collapsible?: 'offcanvas' | 'icon' | 'none'
16-
class?: HTMLAttributes['class']
17-
}>(), {
11+
const props = withDefaults(defineProps<SidebarProps>(), {
1812
side: 'left',
1913
variant: 'sidebar',
2014
collapsible: 'offcanvas',

apps/www/src/lib/registry/default/ui/sidebar/SidebarInput.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script setup lang="ts">
22
import type { HTMLAttributes } from 'vue'
3-
import Input from '@/lib/registry/default/ui/input/Input.vue'
3+
import { Input } from '@/lib/registry/default/ui/input'
44
import { cn } from '@/lib/utils'
55
66
const props = defineProps<{

apps/www/src/lib/registry/default/ui/sidebar/SidebarMenuButton.vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<script setup lang="ts">
2-
import Tooltip from '@/lib/registry/default/ui/tooltip/Tooltip.vue'
3-
import TooltipContent from '@/lib/registry/default/ui/tooltip/TooltipContent.vue'
4-
import TooltipTrigger from '@/lib/registry/default/ui/tooltip/TooltipTrigger.vue'
2+
import { Tooltip, TooltipContent, TooltipTrigger } from '@/lib/registry/default/ui/tooltip'
53
import { type Component, computed } from 'vue'
64
import SidebarMenuButtonChild, { type SidebarMenuButtonProps } from './SidebarMenuButtonChild.vue'
75
import { useSidebar } from './utils'

apps/www/src/lib/registry/default/ui/sidebar/SidebarMenuSkeleton.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script setup lang="ts">
2-
import Skeleton from '@/lib/registry/default/ui/skeleton/Skeleton.vue'
2+
import { Skeleton } from '@/lib/registry/default/ui/skeleton'
33
import { cn } from '@/lib/utils'
44
import { computed, type HTMLAttributes } from 'vue'
55

apps/www/src/lib/registry/default/ui/sidebar/SidebarProvider.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ provideSidebarContext({
7272
'--sidebar-width-icon': SIDEBAR_WIDTH_ICON,
7373
}"
7474
:class="cn('group/sidebar-wrapper flex min-h-svh w-full text-sidebar-foreground has-[[data-variant=inset]]:bg-sidebar', props.class)"
75+
v-bind="$attrs"
7576
>
7677
<slot />
7778
</div>

apps/www/src/lib/registry/default/ui/sidebar/SidebarSeparator.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script setup lang="ts">
22
import type { HTMLAttributes } from 'vue'
3-
import Separator from '@/lib/registry/default/ui/separator/Separator.vue'
3+
import { Separator } from '@/lib/registry/default/ui/separator'
44
import { cn } from '@/lib/utils'
55
66
const props = defineProps<{

apps/www/src/lib/registry/default/ui/sidebar/SidebarTrigger.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script setup lang="ts">
22
import type { HTMLAttributes } from 'vue'
3-
import Button from '@/lib/registry/default/ui/button/Button.vue'
3+
import { Button } from '@/lib/registry/default/ui/button'
44
import { cn } from '@/lib/utils'
55
import { PanelLeft } from 'lucide-vue-next'
66
import { useSidebar } from './utils'

apps/www/src/lib/registry/default/ui/sidebar/index.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
1+
import type { HTMLAttributes } from 'vue'
12
import { cva, type VariantProps } from 'class-variance-authority'
23

4+
export interface SidebarProps {
5+
side?: 'left' | 'right'
6+
variant?: 'sidebar' | 'floating' | 'inset'
7+
collapsible?: 'offcanvas' | 'icon' | 'none'
8+
class?: HTMLAttributes['class']
9+
}
10+
311
export { default as Sidebar } from './Sidebar.vue'
412
export { default as SidebarContent } from './SidebarContent.vue'
513
export { default as SidebarFooter } from './SidebarFooter.vue'

apps/www/src/lib/registry/new-york/ui/sidebar/Sidebar.vue

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,14 @@
11
<script setup lang="ts">
2-
import type { HTMLAttributes } from 'vue'
3-
import Sheet from '@/lib/registry/new-york/ui/sheet/Sheet.vue'
4-
import SheetContent from '@/lib/registry/new-york/ui/sheet/SheetContent.vue'
2+
import type { SidebarProps } from '.'
3+
import { Sheet, SheetContent } from '@/lib/registry/new-york/ui/sheet'
54
import { cn } from '@/lib/utils'
65
import { SIDEBAR_WIDTH_MOBILE, useSidebar } from './utils'
76
87
defineOptions({
98
inheritAttrs: false,
109
})
1110
12-
const props = withDefaults(defineProps<{
13-
side?: 'left' | 'right'
14-
variant?: 'sidebar' | 'floating' | 'inset'
15-
collapsible?: 'offcanvas' | 'icon' | 'none'
16-
class?: HTMLAttributes['class']
17-
}>(), {
11+
const props = withDefaults(defineProps<SidebarProps>(), {
1812
side: 'left',
1913
variant: 'sidebar',
2014
collapsible: 'offcanvas',

apps/www/src/lib/registry/new-york/ui/sidebar/SidebarInput.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script setup lang="ts">
22
import type { HTMLAttributes } from 'vue'
3-
import Input from '@/lib/registry/new-york/ui/input/Input.vue'
3+
import { Input } from '@/lib/registry/new-york/ui/input'
44
import { cn } from '@/lib/utils'
55
66
const props = defineProps<{

0 commit comments

Comments
 (0)