@invopop/popui 0.1.97 → 0.1.98
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/dist/CounterWidget.svelte +18 -1
- package/dist/GlobalSearch.svelte +1 -1
- package/dist/MenuItem.svelte +1 -1
- package/dist/index.d.ts +36 -1
- package/dist/index.js +74 -0
- package/dist/separator/index.d.ts +2 -0
- package/dist/separator/index.js +4 -0
- package/dist/separator/separator.svelte +21 -0
- package/dist/separator/separator.svelte.d.ts +4 -0
- package/dist/sheet/index.d.ts +11 -0
- package/dist/sheet/index.js +13 -0
- package/dist/sheet/sheet-close.svelte +7 -0
- package/dist/sheet/sheet-close.svelte.d.ts +4 -0
- package/dist/sheet/sheet-content.svelte +65 -0
- package/dist/sheet/sheet-content.svelte.d.ts +15 -0
- package/dist/sheet/sheet-description.svelte +17 -0
- package/dist/sheet/sheet-description.svelte.d.ts +4 -0
- package/dist/sheet/sheet-footer.svelte +20 -0
- package/dist/sheet/sheet-footer.svelte.d.ts +5 -0
- package/dist/sheet/sheet-header.svelte +20 -0
- package/dist/sheet/sheet-header.svelte.d.ts +5 -0
- package/dist/sheet/sheet-overlay.svelte +20 -0
- package/dist/sheet/sheet-overlay.svelte.d.ts +4 -0
- package/dist/sheet/sheet-portal.svelte +7 -0
- package/dist/sheet/sheet-portal.svelte.d.ts +3 -0
- package/dist/sheet/sheet-title.svelte +17 -0
- package/dist/sheet/sheet-title.svelte.d.ts +4 -0
- package/dist/sheet/sheet-trigger.svelte +7 -0
- package/dist/sheet/sheet-trigger.svelte.d.ts +4 -0
- package/dist/sheet/sheet.svelte +7 -0
- package/dist/sheet/sheet.svelte.d.ts +3 -0
- package/dist/sidebar/constants.d.ts +10 -0
- package/dist/sidebar/constants.js +10 -0
- package/dist/sidebar/context.svelte.d.ts +23 -0
- package/dist/sidebar/context.svelte.js +58 -0
- package/dist/sidebar/index.d.ts +25 -0
- package/dist/sidebar/index.js +27 -0
- package/dist/sidebar/is-mobile.svelte.d.ts +4 -0
- package/dist/sidebar/is-mobile.svelte.js +7 -0
- package/dist/sidebar/sidebar-content.svelte +25 -0
- package/dist/sidebar/sidebar-content.svelte.d.ts +5 -0
- package/dist/sidebar/sidebar-footer.svelte +21 -0
- package/dist/sidebar/sidebar-footer.svelte.d.ts +5 -0
- package/dist/sidebar/sidebar-group-action.svelte +33 -0
- package/dist/sidebar/sidebar-group-action.svelte.d.ts +11 -0
- package/dist/sidebar/sidebar-group-content.svelte +21 -0
- package/dist/sidebar/sidebar-group-content.svelte.d.ts +5 -0
- package/dist/sidebar/sidebar-group-label.svelte +33 -0
- package/dist/sidebar/sidebar-group-label.svelte.d.ts +11 -0
- package/dist/sidebar/sidebar-group.svelte +21 -0
- package/dist/sidebar/sidebar-group.svelte.d.ts +5 -0
- package/dist/sidebar/sidebar-header.svelte +21 -0
- package/dist/sidebar/sidebar-header.svelte.d.ts +5 -0
- package/dist/sidebar/sidebar-input.svelte +23 -0
- package/dist/sidebar/sidebar-input.svelte.d.ts +5 -0
- package/dist/sidebar/sidebar-inset.svelte +23 -0
- package/dist/sidebar/sidebar-inset.svelte.d.ts +5 -0
- package/dist/sidebar/sidebar-menu-action.svelte +37 -0
- package/dist/sidebar/sidebar-menu-action.svelte.d.ts +12 -0
- package/dist/sidebar/sidebar-menu-badge.svelte +24 -0
- package/dist/sidebar/sidebar-menu-badge.svelte.d.ts +5 -0
- package/dist/sidebar/sidebar-menu-button.svelte +102 -0
- package/dist/sidebar/sidebar-menu-button.svelte.d.ts +51 -0
- package/dist/sidebar/sidebar-menu-item.svelte +21 -0
- package/dist/sidebar/sidebar-menu-item.svelte.d.ts +5 -0
- package/dist/sidebar/sidebar-menu-skeleton.svelte +35 -0
- package/dist/sidebar/sidebar-menu-skeleton.svelte.d.ts +8 -0
- package/dist/sidebar/sidebar-menu-sub-button.svelte +39 -0
- package/dist/sidebar/sidebar-menu-sub-button.svelte.d.ts +13 -0
- package/dist/sidebar/sidebar-menu-sub-item.svelte +21 -0
- package/dist/sidebar/sidebar-menu-sub-item.svelte.d.ts +5 -0
- package/dist/sidebar/sidebar-menu-sub.svelte +24 -0
- package/dist/sidebar/sidebar-menu-sub.svelte.d.ts +5 -0
- package/dist/sidebar/sidebar-menu.svelte +21 -0
- package/dist/sidebar/sidebar-menu.svelte.d.ts +5 -0
- package/dist/sidebar/sidebar-provider.svelte +47 -0
- package/dist/sidebar/sidebar-provider.svelte.d.ts +9 -0
- package/dist/sidebar/sidebar-rail.svelte +165 -0
- package/dist/sidebar/sidebar-rail.svelte.d.ts +5 -0
- package/dist/sidebar/sidebar-separator.svelte +19 -0
- package/dist/sidebar/sidebar-separator.svelte.d.ts +13 -0
- package/dist/sidebar/sidebar-trigger.svelte +35 -0
- package/dist/sidebar/sidebar-trigger.svelte.d.ts +5 -0
- package/dist/sidebar/sidebar.svelte +106 -0
- package/dist/sidebar/sidebar.svelte.d.ts +10 -0
- package/dist/tailwind.theme.css +20 -0
- package/package.json +2 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { useSidebar } from './context.svelte.js';
|
|
2
|
+
import Content from './sidebar-content.svelte';
|
|
3
|
+
import Footer from './sidebar-footer.svelte';
|
|
4
|
+
import GroupAction from './sidebar-group-action.svelte';
|
|
5
|
+
import GroupContent from './sidebar-group-content.svelte';
|
|
6
|
+
import GroupLabel from './sidebar-group-label.svelte';
|
|
7
|
+
import Group from './sidebar-group.svelte';
|
|
8
|
+
import Header from './sidebar-header.svelte';
|
|
9
|
+
import Input from './sidebar-input.svelte';
|
|
10
|
+
import Inset from './sidebar-inset.svelte';
|
|
11
|
+
import MenuAction from './sidebar-menu-action.svelte';
|
|
12
|
+
import MenuBadge from './sidebar-menu-badge.svelte';
|
|
13
|
+
import MenuButton from './sidebar-menu-button.svelte';
|
|
14
|
+
import MenuItem from './sidebar-menu-item.svelte';
|
|
15
|
+
import MenuSkeleton from './sidebar-menu-skeleton.svelte';
|
|
16
|
+
import MenuSubButton from './sidebar-menu-sub-button.svelte';
|
|
17
|
+
import MenuSubItem from './sidebar-menu-sub-item.svelte';
|
|
18
|
+
import MenuSub from './sidebar-menu-sub.svelte';
|
|
19
|
+
import Menu from './sidebar-menu.svelte';
|
|
20
|
+
import Provider from './sidebar-provider.svelte';
|
|
21
|
+
import Rail from './sidebar-rail.svelte';
|
|
22
|
+
import Separator from './sidebar-separator.svelte';
|
|
23
|
+
import Trigger from './sidebar-trigger.svelte';
|
|
24
|
+
import Root from './sidebar.svelte';
|
|
25
|
+
export { Content, Footer, Group, GroupAction, GroupContent, GroupLabel, Header, Input, Inset, Menu, MenuAction, MenuBadge, MenuButton, MenuItem, MenuSkeleton, MenuSub, MenuSubButton, MenuSubItem, Provider, Rail, Root, Separator, Trigger, Root as Sidebar, Content as SidebarContent, Footer as SidebarFooter, Group as SidebarGroup, GroupAction as SidebarGroupAction, GroupContent as SidebarGroupContent, GroupLabel as SidebarGroupLabel, Header as SidebarHeader, Input as SidebarInput, Inset as SidebarInset, Menu as SidebarMenu, MenuAction as SidebarMenuAction, MenuBadge as SidebarMenuBadge, MenuButton as SidebarMenuButton, MenuItem as SidebarMenuItem, MenuSkeleton as SidebarMenuSkeleton, MenuSub as SidebarMenuSub, MenuSubButton as SidebarMenuSubButton, MenuSubItem as SidebarMenuSubItem, Provider as SidebarProvider, Rail as SidebarRail, Separator as SidebarSeparator, Trigger as SidebarTrigger, useSidebar };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { useSidebar } from './context.svelte.js';
|
|
2
|
+
import Content from './sidebar-content.svelte';
|
|
3
|
+
import Footer from './sidebar-footer.svelte';
|
|
4
|
+
import GroupAction from './sidebar-group-action.svelte';
|
|
5
|
+
import GroupContent from './sidebar-group-content.svelte';
|
|
6
|
+
import GroupLabel from './sidebar-group-label.svelte';
|
|
7
|
+
import Group from './sidebar-group.svelte';
|
|
8
|
+
import Header from './sidebar-header.svelte';
|
|
9
|
+
import Input from './sidebar-input.svelte';
|
|
10
|
+
import Inset from './sidebar-inset.svelte';
|
|
11
|
+
import MenuAction from './sidebar-menu-action.svelte';
|
|
12
|
+
import MenuBadge from './sidebar-menu-badge.svelte';
|
|
13
|
+
import MenuButton from './sidebar-menu-button.svelte';
|
|
14
|
+
import MenuItem from './sidebar-menu-item.svelte';
|
|
15
|
+
import MenuSkeleton from './sidebar-menu-skeleton.svelte';
|
|
16
|
+
import MenuSubButton from './sidebar-menu-sub-button.svelte';
|
|
17
|
+
import MenuSubItem from './sidebar-menu-sub-item.svelte';
|
|
18
|
+
import MenuSub from './sidebar-menu-sub.svelte';
|
|
19
|
+
import Menu from './sidebar-menu.svelte';
|
|
20
|
+
import Provider from './sidebar-provider.svelte';
|
|
21
|
+
import Rail from './sidebar-rail.svelte';
|
|
22
|
+
import Separator from './sidebar-separator.svelte';
|
|
23
|
+
import Trigger from './sidebar-trigger.svelte';
|
|
24
|
+
import Root from './sidebar.svelte';
|
|
25
|
+
export { Content, Footer, Group, GroupAction, GroupContent, GroupLabel, Header, Input, Inset, Menu, MenuAction, MenuBadge, MenuButton, MenuItem, MenuSkeleton, MenuSub, MenuSubButton, MenuSubItem, Provider, Rail, Root, Separator, Trigger,
|
|
26
|
+
//
|
|
27
|
+
Root as Sidebar, Content as SidebarContent, Footer as SidebarFooter, Group as SidebarGroup, GroupAction as SidebarGroupAction, GroupContent as SidebarGroupContent, GroupLabel as SidebarGroupLabel, Header as SidebarHeader, Input as SidebarInput, Inset as SidebarInset, Menu as SidebarMenu, MenuAction as SidebarMenuAction, MenuBadge as SidebarMenuBadge, MenuButton as SidebarMenuButton, MenuItem as SidebarMenuItem, MenuSkeleton as SidebarMenuSkeleton, MenuSub as SidebarMenuSub, MenuSubButton as SidebarMenuSubButton, MenuSubItem as SidebarMenuSubItem, Provider as SidebarProvider, Rail as SidebarRail, Separator as SidebarSeparator, Trigger as SidebarTrigger, useSidebar };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements'
|
|
3
|
+
import { cn, type WithElementRef } from '../utils.js'
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
children,
|
|
9
|
+
...restProps
|
|
10
|
+
}: WithElementRef<HTMLAttributes<HTMLElement>> = $props()
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<div
|
|
14
|
+
bind:this={ref}
|
|
15
|
+
data-slot="sidebar-content"
|
|
16
|
+
data-sidebar="content"
|
|
17
|
+
class={cn(
|
|
18
|
+
'flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden',
|
|
19
|
+
'[&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]',
|
|
20
|
+
className
|
|
21
|
+
)}
|
|
22
|
+
{...restProps}
|
|
23
|
+
>
|
|
24
|
+
{@render children?.()}
|
|
25
|
+
</div>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
2
|
+
import { type WithElementRef } from '../utils.js';
|
|
3
|
+
declare const SidebarContent: import("svelte").Component<WithElementRef<HTMLAttributes<HTMLElement>>, {}, "ref">;
|
|
4
|
+
type SidebarContent = ReturnType<typeof SidebarContent>;
|
|
5
|
+
export default SidebarContent;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements'
|
|
3
|
+
import { cn, type WithElementRef } from '../utils.js'
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
children,
|
|
9
|
+
...restProps
|
|
10
|
+
}: WithElementRef<HTMLAttributes<HTMLElement>> = $props()
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<div
|
|
14
|
+
bind:this={ref}
|
|
15
|
+
data-slot="sidebar-footer"
|
|
16
|
+
data-sidebar="footer"
|
|
17
|
+
class={cn('flex flex-col gap-2 p-2', className)}
|
|
18
|
+
{...restProps}
|
|
19
|
+
>
|
|
20
|
+
{@render children?.()}
|
|
21
|
+
</div>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
2
|
+
import { type WithElementRef } from '../utils.js';
|
|
3
|
+
declare const SidebarFooter: import("svelte").Component<WithElementRef<HTMLAttributes<HTMLElement>>, {}, "ref">;
|
|
4
|
+
type SidebarFooter = ReturnType<typeof SidebarFooter>;
|
|
5
|
+
export default SidebarFooter;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte'
|
|
3
|
+
import type { HTMLButtonAttributes } from 'svelte/elements'
|
|
4
|
+
import { cn, type WithElementRef } from '../utils.js'
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
ref = $bindable(null),
|
|
8
|
+
class: className,
|
|
9
|
+
children,
|
|
10
|
+
child,
|
|
11
|
+
...restProps
|
|
12
|
+
}: WithElementRef<HTMLButtonAttributes> & {
|
|
13
|
+
child?: Snippet<[{ props: Record<string, unknown> }]>
|
|
14
|
+
} = $props()
|
|
15
|
+
|
|
16
|
+
const mergedProps = $derived({
|
|
17
|
+
class: cn(
|
|
18
|
+
'text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0 group-data-[collapsible=icon]:hidden after:absolute after:-inset-2 md:after:hidden',
|
|
19
|
+
className
|
|
20
|
+
),
|
|
21
|
+
'data-slot': 'sidebar-group-action',
|
|
22
|
+
'data-sidebar': 'group-action',
|
|
23
|
+
...restProps
|
|
24
|
+
})
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
{#if child}
|
|
28
|
+
{@render child({ props: mergedProps })}
|
|
29
|
+
{:else}
|
|
30
|
+
<button bind:this={ref} {...mergedProps}>
|
|
31
|
+
{@render children?.()}
|
|
32
|
+
</button>
|
|
33
|
+
{/if}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
import type { HTMLButtonAttributes } from 'svelte/elements';
|
|
3
|
+
import { type WithElementRef } from '../utils.js';
|
|
4
|
+
type $$ComponentProps = WithElementRef<HTMLButtonAttributes> & {
|
|
5
|
+
child?: Snippet<[{
|
|
6
|
+
props: Record<string, unknown>;
|
|
7
|
+
}]>;
|
|
8
|
+
};
|
|
9
|
+
declare const SidebarGroupAction: import("svelte").Component<$$ComponentProps, {}, "ref">;
|
|
10
|
+
type SidebarGroupAction = ReturnType<typeof SidebarGroupAction>;
|
|
11
|
+
export default SidebarGroupAction;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements'
|
|
3
|
+
import { cn, type WithElementRef } from '../utils.js'
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
children,
|
|
9
|
+
...restProps
|
|
10
|
+
}: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props()
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<div
|
|
14
|
+
bind:this={ref}
|
|
15
|
+
data-slot="sidebar-group-content"
|
|
16
|
+
data-sidebar="group-content"
|
|
17
|
+
class={cn('w-full text-sm', className)}
|
|
18
|
+
{...restProps}
|
|
19
|
+
>
|
|
20
|
+
{@render children?.()}
|
|
21
|
+
</div>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
2
|
+
import { type WithElementRef } from '../utils.js';
|
|
3
|
+
declare const SidebarGroupContent: import("svelte").Component<WithElementRef<HTMLAttributes<HTMLDivElement>>, {}, "ref">;
|
|
4
|
+
type SidebarGroupContent = ReturnType<typeof SidebarGroupContent>;
|
|
5
|
+
export default SidebarGroupContent;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte'
|
|
3
|
+
import type { HTMLAttributes } from 'svelte/elements'
|
|
4
|
+
import { cn, type WithElementRef } from '../utils.js'
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
ref = $bindable(null),
|
|
8
|
+
children,
|
|
9
|
+
child,
|
|
10
|
+
class: className,
|
|
11
|
+
...restProps
|
|
12
|
+
}: WithElementRef<HTMLAttributes<HTMLElement>> & {
|
|
13
|
+
child?: Snippet<[{ props: Record<string, unknown> }]>
|
|
14
|
+
} = $props()
|
|
15
|
+
|
|
16
|
+
const mergedProps = $derived({
|
|
17
|
+
class: cn(
|
|
18
|
+
'text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0 group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0',
|
|
19
|
+
className
|
|
20
|
+
),
|
|
21
|
+
'data-slot': 'sidebar-group-label',
|
|
22
|
+
'data-sidebar': 'group-label',
|
|
23
|
+
...restProps
|
|
24
|
+
})
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
{#if child}
|
|
28
|
+
{@render child({ props: mergedProps })}
|
|
29
|
+
{:else}
|
|
30
|
+
<div bind:this={ref} {...mergedProps}>
|
|
31
|
+
{@render children?.()}
|
|
32
|
+
</div>
|
|
33
|
+
{/if}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
import { type WithElementRef } from '../utils.js';
|
|
4
|
+
type $$ComponentProps = WithElementRef<HTMLAttributes<HTMLElement>> & {
|
|
5
|
+
child?: Snippet<[{
|
|
6
|
+
props: Record<string, unknown>;
|
|
7
|
+
}]>;
|
|
8
|
+
};
|
|
9
|
+
declare const SidebarGroupLabel: import("svelte").Component<$$ComponentProps, {}, "ref">;
|
|
10
|
+
type SidebarGroupLabel = ReturnType<typeof SidebarGroupLabel>;
|
|
11
|
+
export default SidebarGroupLabel;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements'
|
|
3
|
+
import { cn, type WithElementRef } from '../utils.js'
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
children,
|
|
9
|
+
...restProps
|
|
10
|
+
}: WithElementRef<HTMLAttributes<HTMLElement>> = $props()
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<div
|
|
14
|
+
bind:this={ref}
|
|
15
|
+
data-slot="sidebar-group"
|
|
16
|
+
data-sidebar="group"
|
|
17
|
+
class={cn('relative flex w-full min-w-0 flex-col p-2', className)}
|
|
18
|
+
{...restProps}
|
|
19
|
+
>
|
|
20
|
+
{@render children?.()}
|
|
21
|
+
</div>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
2
|
+
import { type WithElementRef } from '../utils.js';
|
|
3
|
+
declare const SidebarGroup: import("svelte").Component<WithElementRef<HTMLAttributes<HTMLElement>>, {}, "ref">;
|
|
4
|
+
type SidebarGroup = ReturnType<typeof SidebarGroup>;
|
|
5
|
+
export default SidebarGroup;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements'
|
|
3
|
+
import { cn, type WithElementRef } from '../utils.js'
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
children,
|
|
9
|
+
...restProps
|
|
10
|
+
}: WithElementRef<HTMLAttributes<HTMLElement>> = $props()
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<div
|
|
14
|
+
bind:this={ref}
|
|
15
|
+
data-slot="sidebar-header"
|
|
16
|
+
data-sidebar="header"
|
|
17
|
+
class={cn('flex flex-col gap-2 p-2', className)}
|
|
18
|
+
{...restProps}
|
|
19
|
+
>
|
|
20
|
+
{@render children?.()}
|
|
21
|
+
</div>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
2
|
+
import { type WithElementRef } from '../utils.js';
|
|
3
|
+
declare const SidebarHeader: import("svelte").Component<WithElementRef<HTMLAttributes<HTMLElement>>, {}, "ref">;
|
|
4
|
+
type SidebarHeader = ReturnType<typeof SidebarHeader>;
|
|
5
|
+
export default SidebarHeader;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { HTMLInputAttributes } from 'svelte/elements'
|
|
3
|
+
import { cn, type WithElementRef } from '../utils.js'
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
value = $bindable(''),
|
|
8
|
+
class: className,
|
|
9
|
+
...restProps
|
|
10
|
+
}: WithElementRef<HTMLInputAttributes, HTMLInputElement> = $props()
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<input
|
|
14
|
+
bind:this={ref}
|
|
15
|
+
bind:value
|
|
16
|
+
data-slot="sidebar-input"
|
|
17
|
+
data-sidebar="input"
|
|
18
|
+
class={cn(
|
|
19
|
+
'bg-background border-input flex h-8 w-full rounded-md border px-3 py-1 text-sm shadow-none transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-foreground-secondary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sidebar-ring disabled:cursor-not-allowed disabled:opacity-50',
|
|
20
|
+
className
|
|
21
|
+
)}
|
|
22
|
+
{...restProps}
|
|
23
|
+
/>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { HTMLInputAttributes } from 'svelte/elements';
|
|
2
|
+
import { type WithElementRef } from '../utils.js';
|
|
3
|
+
declare const SidebarInput: import("svelte").Component<WithElementRef<HTMLInputAttributes, HTMLInputElement>, {}, "value" | "ref">;
|
|
4
|
+
type SidebarInput = ReturnType<typeof SidebarInput>;
|
|
5
|
+
export default SidebarInput;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements'
|
|
3
|
+
import { cn, type WithElementRef } from '../utils.js'
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
children,
|
|
9
|
+
...restProps
|
|
10
|
+
}: WithElementRef<HTMLAttributes<HTMLElement>> = $props()
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<main
|
|
14
|
+
bind:this={ref}
|
|
15
|
+
data-slot="sidebar-inset"
|
|
16
|
+
class={cn(
|
|
17
|
+
'bg-background relative flex w-full flex-1 flex-col md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2',
|
|
18
|
+
className
|
|
19
|
+
)}
|
|
20
|
+
{...restProps}
|
|
21
|
+
>
|
|
22
|
+
{@render children?.()}
|
|
23
|
+
</main>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
2
|
+
import { type WithElementRef } from '../utils.js';
|
|
3
|
+
declare const SidebarInset: import("svelte").Component<WithElementRef<HTMLAttributes<HTMLElement>>, {}, "ref">;
|
|
4
|
+
type SidebarInset = ReturnType<typeof SidebarInset>;
|
|
5
|
+
export default SidebarInset;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte'
|
|
3
|
+
import type { HTMLButtonAttributes } from 'svelte/elements'
|
|
4
|
+
import { cn, type WithElementRef } from '../utils.js'
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
ref = $bindable(null),
|
|
8
|
+
class: className,
|
|
9
|
+
showOnHover = false,
|
|
10
|
+
children,
|
|
11
|
+
child,
|
|
12
|
+
...restProps
|
|
13
|
+
}: WithElementRef<HTMLButtonAttributes> & {
|
|
14
|
+
child?: Snippet<[{ props: Record<string, unknown> }]>
|
|
15
|
+
showOnHover?: boolean
|
|
16
|
+
} = $props()
|
|
17
|
+
|
|
18
|
+
const mergedProps = $derived({
|
|
19
|
+
class: cn(
|
|
20
|
+
'text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0 group-data-[collapsible=icon]:hidden after:absolute after:-inset-2 md:after:hidden peer-data-[size=sm]/menu-button:top-1 peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5',
|
|
21
|
+
showOnHover &&
|
|
22
|
+
'peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0',
|
|
23
|
+
className
|
|
24
|
+
),
|
|
25
|
+
'data-slot': 'sidebar-menu-action',
|
|
26
|
+
'data-sidebar': 'menu-action',
|
|
27
|
+
...restProps
|
|
28
|
+
})
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
{#if child}
|
|
32
|
+
{@render child({ props: mergedProps })}
|
|
33
|
+
{:else}
|
|
34
|
+
<button bind:this={ref} {...mergedProps}>
|
|
35
|
+
{@render children?.()}
|
|
36
|
+
</button>
|
|
37
|
+
{/if}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
import type { HTMLButtonAttributes } from 'svelte/elements';
|
|
3
|
+
import { type WithElementRef } from '../utils.js';
|
|
4
|
+
type $$ComponentProps = WithElementRef<HTMLButtonAttributes> & {
|
|
5
|
+
child?: Snippet<[{
|
|
6
|
+
props: Record<string, unknown>;
|
|
7
|
+
}]>;
|
|
8
|
+
showOnHover?: boolean;
|
|
9
|
+
};
|
|
10
|
+
declare const SidebarMenuAction: import("svelte").Component<$$ComponentProps, {}, "ref">;
|
|
11
|
+
type SidebarMenuAction = ReturnType<typeof SidebarMenuAction>;
|
|
12
|
+
export default SidebarMenuAction;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements'
|
|
3
|
+
import { cn, type WithElementRef } from '../utils.js'
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
children,
|
|
9
|
+
...restProps
|
|
10
|
+
}: WithElementRef<HTMLAttributes<HTMLElement>> = $props()
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<div
|
|
14
|
+
bind:this={ref}
|
|
15
|
+
data-slot="sidebar-menu-badge"
|
|
16
|
+
data-sidebar="menu-badge"
|
|
17
|
+
class={cn(
|
|
18
|
+
'text-sidebar-foreground peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums select-none group-data-[collapsible=icon]:hidden peer-data-[size=sm]/menu-button:top-1 peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5',
|
|
19
|
+
className
|
|
20
|
+
)}
|
|
21
|
+
{...restProps}
|
|
22
|
+
>
|
|
23
|
+
{@render children?.()}
|
|
24
|
+
</div>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
2
|
+
import { type WithElementRef } from '../utils.js';
|
|
3
|
+
declare const SidebarMenuBadge: import("svelte").Component<WithElementRef<HTMLAttributes<HTMLElement>>, {}, "ref">;
|
|
4
|
+
type SidebarMenuBadge = ReturnType<typeof SidebarMenuBadge>;
|
|
5
|
+
export default SidebarMenuBadge;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import { tv, type VariantProps } from 'tailwind-variants'
|
|
3
|
+
|
|
4
|
+
export const sidebarMenuButtonVariants = tv({
|
|
5
|
+
base: 'peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0',
|
|
6
|
+
variants: {
|
|
7
|
+
variant: {
|
|
8
|
+
default: 'hover:bg-sidebar-accent hover:text-sidebar-accent-foreground',
|
|
9
|
+
outline:
|
|
10
|
+
'bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]'
|
|
11
|
+
},
|
|
12
|
+
size: {
|
|
13
|
+
default: 'h-8 text-sm',
|
|
14
|
+
sm: 'h-7 text-xs',
|
|
15
|
+
lg: 'h-12 text-sm group-data-[collapsible=icon]:!p-0'
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
defaultVariants: {
|
|
19
|
+
variant: 'default',
|
|
20
|
+
size: 'default'
|
|
21
|
+
}
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
export type SidebarMenuButtonVariant = VariantProps<typeof sidebarMenuButtonVariants>['variant']
|
|
25
|
+
export type SidebarMenuButtonSize = VariantProps<typeof sidebarMenuButtonVariants>['size']
|
|
26
|
+
</script>
|
|
27
|
+
|
|
28
|
+
<script lang="ts">
|
|
29
|
+
import { Tooltip as TooltipPrimitive } from 'bits-ui'
|
|
30
|
+
import { mergeProps } from 'svelte-toolbelt'
|
|
31
|
+
import type { ComponentProps, Snippet } from 'svelte'
|
|
32
|
+
import type { HTMLButtonAttributes } from 'svelte/elements'
|
|
33
|
+
import TooltipContent from '../tooltip/tooltip-content.svelte'
|
|
34
|
+
import { cn, type WithElementRef, type WithoutChildrenOrChild } from '../utils.js'
|
|
35
|
+
import { useSidebar } from './context.svelte.js'
|
|
36
|
+
|
|
37
|
+
let {
|
|
38
|
+
ref = $bindable(null),
|
|
39
|
+
class: className,
|
|
40
|
+
children,
|
|
41
|
+
child,
|
|
42
|
+
variant = 'default',
|
|
43
|
+
size = 'default',
|
|
44
|
+
isActive = false,
|
|
45
|
+
tooltipContent,
|
|
46
|
+
tooltipContentProps,
|
|
47
|
+
...restProps
|
|
48
|
+
}: WithElementRef<HTMLButtonAttributes, HTMLButtonElement> & {
|
|
49
|
+
isActive?: boolean
|
|
50
|
+
variant?: SidebarMenuButtonVariant
|
|
51
|
+
size?: SidebarMenuButtonSize
|
|
52
|
+
tooltipContent?: Snippet | string
|
|
53
|
+
tooltipContentProps?: WithoutChildrenOrChild<ComponentProps<typeof TooltipContent>>
|
|
54
|
+
child?: Snippet<[{ props: Record<string, unknown> }]>
|
|
55
|
+
} = $props()
|
|
56
|
+
|
|
57
|
+
const sidebar = useSidebar()
|
|
58
|
+
|
|
59
|
+
const buttonProps = $derived({
|
|
60
|
+
class: cn(sidebarMenuButtonVariants({ variant, size }), className),
|
|
61
|
+
'data-slot': 'sidebar-menu-button',
|
|
62
|
+
'data-sidebar': 'menu-button',
|
|
63
|
+
'data-size': size,
|
|
64
|
+
'data-active': isActive,
|
|
65
|
+
...restProps
|
|
66
|
+
})
|
|
67
|
+
</script>
|
|
68
|
+
|
|
69
|
+
{#snippet Button({ props }: { props?: Record<string, unknown> })}
|
|
70
|
+
{@const mergedProps = mergeProps(buttonProps, props)}
|
|
71
|
+
{#if child}
|
|
72
|
+
{@render child({ props: mergedProps })}
|
|
73
|
+
{:else}
|
|
74
|
+
<button bind:this={ref} {...mergedProps}>
|
|
75
|
+
{@render children?.()}
|
|
76
|
+
</button>
|
|
77
|
+
{/if}
|
|
78
|
+
{/snippet}
|
|
79
|
+
|
|
80
|
+
{#if !tooltipContent}
|
|
81
|
+
{@render Button({})}
|
|
82
|
+
{:else}
|
|
83
|
+
<TooltipPrimitive.Root>
|
|
84
|
+
<TooltipPrimitive.Trigger>
|
|
85
|
+
{#snippet child({ props })}
|
|
86
|
+
{@render Button({ props })}
|
|
87
|
+
{/snippet}
|
|
88
|
+
</TooltipPrimitive.Trigger>
|
|
89
|
+
<TooltipContent
|
|
90
|
+
side="right"
|
|
91
|
+
align="center"
|
|
92
|
+
hidden={sidebar.state !== 'collapsed' || sidebar.isMobile}
|
|
93
|
+
{...tooltipContentProps}
|
|
94
|
+
>
|
|
95
|
+
{#if typeof tooltipContent === 'string'}
|
|
96
|
+
{tooltipContent}
|
|
97
|
+
{:else if tooltipContent}
|
|
98
|
+
{@render tooltipContent()}
|
|
99
|
+
{/if}
|
|
100
|
+
</TooltipContent>
|
|
101
|
+
</TooltipPrimitive.Root>
|
|
102
|
+
{/if}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { type VariantProps } from 'tailwind-variants';
|
|
2
|
+
export declare const sidebarMenuButtonVariants: import("tailwind-variants").TVReturnType<{
|
|
3
|
+
variant: {
|
|
4
|
+
default: string;
|
|
5
|
+
outline: string;
|
|
6
|
+
};
|
|
7
|
+
size: {
|
|
8
|
+
default: string;
|
|
9
|
+
sm: string;
|
|
10
|
+
lg: string;
|
|
11
|
+
};
|
|
12
|
+
}, undefined, "peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0", {
|
|
13
|
+
variant: {
|
|
14
|
+
default: string;
|
|
15
|
+
outline: string;
|
|
16
|
+
};
|
|
17
|
+
size: {
|
|
18
|
+
default: string;
|
|
19
|
+
sm: string;
|
|
20
|
+
lg: string;
|
|
21
|
+
};
|
|
22
|
+
}, undefined, import("tailwind-variants").TVReturnType<{
|
|
23
|
+
variant: {
|
|
24
|
+
default: string;
|
|
25
|
+
outline: string;
|
|
26
|
+
};
|
|
27
|
+
size: {
|
|
28
|
+
default: string;
|
|
29
|
+
sm: string;
|
|
30
|
+
lg: string;
|
|
31
|
+
};
|
|
32
|
+
}, undefined, "peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0", unknown, unknown, undefined>>;
|
|
33
|
+
export type SidebarMenuButtonVariant = VariantProps<typeof sidebarMenuButtonVariants>['variant'];
|
|
34
|
+
export type SidebarMenuButtonSize = VariantProps<typeof sidebarMenuButtonVariants>['size'];
|
|
35
|
+
import type { ComponentProps, Snippet } from 'svelte';
|
|
36
|
+
import type { HTMLButtonAttributes } from 'svelte/elements';
|
|
37
|
+
import TooltipContent from '../tooltip/tooltip-content.svelte';
|
|
38
|
+
import { type WithElementRef, type WithoutChildrenOrChild } from '../utils.js';
|
|
39
|
+
type $$ComponentProps = WithElementRef<HTMLButtonAttributes, HTMLButtonElement> & {
|
|
40
|
+
isActive?: boolean;
|
|
41
|
+
variant?: SidebarMenuButtonVariant;
|
|
42
|
+
size?: SidebarMenuButtonSize;
|
|
43
|
+
tooltipContent?: Snippet | string;
|
|
44
|
+
tooltipContentProps?: WithoutChildrenOrChild<ComponentProps<typeof TooltipContent>>;
|
|
45
|
+
child?: Snippet<[{
|
|
46
|
+
props: Record<string, unknown>;
|
|
47
|
+
}]>;
|
|
48
|
+
};
|
|
49
|
+
declare const SidebarMenuButton: import("svelte").Component<$$ComponentProps, {}, "ref">;
|
|
50
|
+
type SidebarMenuButton = ReturnType<typeof SidebarMenuButton>;
|
|
51
|
+
export default SidebarMenuButton;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements'
|
|
3
|
+
import { cn, type WithElementRef } from '../utils.js'
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
children,
|
|
9
|
+
...restProps
|
|
10
|
+
}: WithElementRef<HTMLAttributes<HTMLLIElement>, HTMLLIElement> = $props()
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<li
|
|
14
|
+
bind:this={ref}
|
|
15
|
+
data-slot="sidebar-menu-item"
|
|
16
|
+
data-sidebar="menu-item"
|
|
17
|
+
class={cn('group/menu-item relative', className)}
|
|
18
|
+
{...restProps}
|
|
19
|
+
>
|
|
20
|
+
{@render children?.()}
|
|
21
|
+
</li>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
2
|
+
import { type WithElementRef } from '../utils.js';
|
|
3
|
+
declare const SidebarMenuItem: import("svelte").Component<WithElementRef<HTMLAttributes<HTMLLIElement>, HTMLLIElement>, {}, "ref">;
|
|
4
|
+
type SidebarMenuItem = ReturnType<typeof SidebarMenuItem>;
|
|
5
|
+
export default SidebarMenuItem;
|