File tree Expand file tree Collapse file tree 19 files changed +68
-75
lines changed Expand file tree Collapse file tree 19 files changed +68
-75
lines changed Original file line number Diff line number Diff line change 1
1
<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'
5
4
import { cn } from ' @/lib/utils'
6
5
import { SIDEBAR_WIDTH_MOBILE , useSidebar } from ' ./utils'
7
6
8
7
defineOptions ({
9
8
inheritAttrs: false ,
10
9
})
11
10
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 >(), {
18
12
side: ' left' ,
19
13
variant: ' sidebar' ,
20
14
collapsible: ' offcanvas' ,
Original file line number Diff line number Diff line change 1
1
<script setup lang="ts">
2
2
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'
4
4
import { cn } from ' @/lib/utils'
5
5
6
6
const props = defineProps <{
Original file line number Diff line number Diff line change 1
1
<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'
5
3
import { type Component , computed } from ' vue'
6
4
import SidebarMenuButtonChild , { type SidebarMenuButtonProps } from ' ./SidebarMenuButtonChild.vue'
7
5
import { useSidebar } from ' ./utils'
Original file line number Diff line number Diff line change 1
1
<script setup lang="ts">
2
- import Skeleton from ' @/lib/registry/default/ui/skeleton/Skeleton.vue '
2
+ import { Skeleton } from ' @/lib/registry/default/ui/skeleton'
3
3
import { cn } from ' @/lib/utils'
4
4
import { computed , type HTMLAttributes } from ' vue'
5
5
Original file line number Diff line number Diff line change @@ -72,6 +72,7 @@ provideSidebarContext({
72
72
'--sidebar-width-icon': SIDEBAR_WIDTH_ICON,
73
73
}"
74
74
: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"
75
76
>
76
77
<slot />
77
78
</div >
Original file line number Diff line number Diff line change 1
1
<script setup lang="ts">
2
2
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'
4
4
import { cn } from ' @/lib/utils'
5
5
6
6
const props = defineProps <{
Original file line number Diff line number Diff line change 1
1
<script setup lang="ts">
2
2
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'
4
4
import { cn } from ' @/lib/utils'
5
5
import { PanelLeft } from ' lucide-vue-next'
6
6
import { useSidebar } from ' ./utils'
Original file line number Diff line number Diff line change
1
+ import type { HTMLAttributes } from 'vue'
1
2
import { cva , type VariantProps } from 'class-variance-authority'
2
3
4
+ export interface SidebarProps {
5
+ side ?: 'left' | 'right'
6
+ variant ?: 'sidebar' | 'floating' | 'inset'
7
+ collapsible ?: 'offcanvas' | 'icon' | 'none'
8
+ class ?: HTMLAttributes [ 'class' ]
9
+ }
10
+
3
11
export { default as Sidebar } from './Sidebar.vue'
4
12
export { default as SidebarContent } from './SidebarContent.vue'
5
13
export { default as SidebarFooter } from './SidebarFooter.vue'
Original file line number Diff line number Diff line change 1
1
<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'
5
4
import { cn } from ' @/lib/utils'
6
5
import { SIDEBAR_WIDTH_MOBILE , useSidebar } from ' ./utils'
7
6
8
7
defineOptions ({
9
8
inheritAttrs: false ,
10
9
})
11
10
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 >(), {
18
12
side: ' left' ,
19
13
variant: ' sidebar' ,
20
14
collapsible: ' offcanvas' ,
Original file line number Diff line number Diff line change 1
1
<script setup lang="ts">
2
2
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'
4
4
import { cn } from ' @/lib/utils'
5
5
6
6
const props = defineProps <{
You can’t perform that action at this time.
0 commit comments