@lapis-notes/ui 0.1.0
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/CHANGELOG.md +9 -0
- package/LICENSE.md +4 -0
- package/README.md +46 -0
- package/dist/codemirror-autocomplete.css +223 -0
- package/dist/command-fuzzy-filter.d.ts +15 -0
- package/dist/command-fuzzy-filter.js +27 -0
- package/dist/components/ui/confirm-dialog/confirm-dialog.css +11 -0
- package/dist/components/ui/confirm-dialog/confirm-dialog.svelte +94 -0
- package/dist/components/ui/confirm-dialog/confirm-dialog.svelte.d.ts +18 -0
- package/dist/components/ui/confirm-dialog/index.d.ts +3 -0
- package/dist/components/ui/confirm-dialog/index.js +3 -0
- package/dist/components/ui/modal/index.d.ts +3 -0
- package/dist/components/ui/modal/index.js +3 -0
- package/dist/components/ui/modal/modal.css +16 -0
- package/dist/components/ui/modal/modal.svelte +74 -0
- package/dist/components/ui/modal/modal.svelte.d.ts +16 -0
- package/dist/components/ui/search/index.d.ts +3 -0
- package/dist/components/ui/search/index.js +3 -0
- package/dist/components/ui/search/search.css +55 -0
- package/dist/components/ui/search/search.svelte +54 -0
- package/dist/components/ui/search/search.svelte.d.ts +10 -0
- package/dist/components/ui/sidebar-custom/constants.d.ts +6 -0
- package/dist/components/ui/sidebar-custom/constants.js +6 -0
- package/dist/components/ui/sidebar-custom/context.svelte.d.ts +49 -0
- package/dist/components/ui/sidebar-custom/context.svelte.js +68 -0
- package/dist/components/ui/sidebar-custom/index.d.ts +26 -0
- package/dist/components/ui/sidebar-custom/index.js +28 -0
- package/dist/components/ui/sidebar-custom/sidebar-content.svelte +23 -0
- package/dist/components/ui/sidebar-custom/sidebar-content.svelte.d.ts +5 -0
- package/dist/components/ui/sidebar-custom/sidebar-custom.css +1357 -0
- package/dist/components/ui/sidebar-custom/sidebar-footer.svelte +23 -0
- package/dist/components/ui/sidebar-custom/sidebar-footer.svelte.d.ts +5 -0
- package/dist/components/ui/sidebar-custom/sidebar-group-action.svelte +37 -0
- package/dist/components/ui/sidebar-custom/sidebar-group-action.svelte.d.ts +11 -0
- package/dist/components/ui/sidebar-custom/sidebar-group-content.svelte +23 -0
- package/dist/components/ui/sidebar-custom/sidebar-group-content.svelte.d.ts +5 -0
- package/dist/components/ui/sidebar-custom/sidebar-group-label.svelte +37 -0
- package/dist/components/ui/sidebar-custom/sidebar-group-label.svelte.d.ts +11 -0
- package/dist/components/ui/sidebar-custom/sidebar-group.svelte +23 -0
- package/dist/components/ui/sidebar-custom/sidebar-group.svelte.d.ts +5 -0
- package/dist/components/ui/sidebar-custom/sidebar-header.svelte +23 -0
- package/dist/components/ui/sidebar-custom/sidebar-header.svelte.d.ts +5 -0
- package/dist/components/ui/sidebar-custom/sidebar-input.svelte +24 -0
- package/dist/components/ui/sidebar-custom/sidebar-input.svelte.d.ts +4 -0
- package/dist/components/ui/sidebar-custom/sidebar-inset.svelte +22 -0
- package/dist/components/ui/sidebar-custom/sidebar-inset.svelte.d.ts +5 -0
- package/dist/components/ui/sidebar-custom/sidebar-menu-action.svelte +40 -0
- package/dist/components/ui/sidebar-custom/sidebar-menu-action.svelte.d.ts +12 -0
- package/dist/components/ui/sidebar-custom/sidebar-menu-badge.svelte +23 -0
- package/dist/components/ui/sidebar-custom/sidebar-menu-badge.svelte.d.ts +5 -0
- package/dist/components/ui/sidebar-custom/sidebar-menu-button.svelte +106 -0
- package/dist/components/ui/sidebar-custom/sidebar-menu-button.svelte.d.ts +27 -0
- package/dist/components/ui/sidebar-custom/sidebar-menu-item.svelte +23 -0
- package/dist/components/ui/sidebar-custom/sidebar-menu-item.svelte.d.ts +5 -0
- package/dist/components/ui/sidebar-custom/sidebar-menu-skeleton.svelte +43 -0
- package/dist/components/ui/sidebar-custom/sidebar-menu-skeleton.svelte.d.ts +8 -0
- package/dist/components/ui/sidebar-custom/sidebar-menu-sub-button.svelte +43 -0
- package/dist/components/ui/sidebar-custom/sidebar-menu-sub-button.svelte.d.ts +13 -0
- package/dist/components/ui/sidebar-custom/sidebar-menu-sub-item.svelte +23 -0
- package/dist/components/ui/sidebar-custom/sidebar-menu-sub-item.svelte.d.ts +5 -0
- package/dist/components/ui/sidebar-custom/sidebar-menu-sub.svelte +23 -0
- package/dist/components/ui/sidebar-custom/sidebar-menu-sub.svelte.d.ts +5 -0
- package/dist/components/ui/sidebar-custom/sidebar-menu.svelte +26 -0
- package/dist/components/ui/sidebar-custom/sidebar-menu.svelte.d.ts +5 -0
- package/dist/components/ui/sidebar-custom/sidebar-nested-provider.svelte +69 -0
- package/dist/components/ui/sidebar-custom/sidebar-nested-provider.svelte.d.ts +16 -0
- package/dist/components/ui/sidebar-custom/sidebar-provider.svelte +72 -0
- package/dist/components/ui/sidebar-custom/sidebar-provider.svelte.d.ts +15 -0
- package/dist/components/ui/sidebar-custom/sidebar-rail.svelte +44 -0
- package/dist/components/ui/sidebar-custom/sidebar-rail.svelte.d.ts +9 -0
- package/dist/components/ui/sidebar-custom/sidebar-resize.svelte.d.ts +15 -0
- package/dist/components/ui/sidebar-custom/sidebar-resize.svelte.js +131 -0
- package/dist/components/ui/sidebar-custom/sidebar-separator.svelte +22 -0
- package/dist/components/ui/sidebar-custom/sidebar-separator.svelte.d.ts +4 -0
- package/dist/components/ui/sidebar-custom/sidebar-trigger.svelte +86 -0
- package/dist/components/ui/sidebar-custom/sidebar-trigger.svelte.d.ts +10 -0
- package/dist/components/ui/sidebar-custom/sidebar.svelte +102 -0
- package/dist/components/ui/sidebar-custom/sidebar.svelte.d.ts +11 -0
- package/dist/components/ui/table-dnd/index.d.ts +3 -0
- package/dist/components/ui/table-dnd/index.js +3 -0
- package/dist/components/ui/table-dnd/table-dnd-sensors.d.ts +2 -0
- package/dist/components/ui/table-dnd/table-dnd-sensors.js +11 -0
- package/dist/components/ui/table-dnd/table-dnd-utils.d.ts +29 -0
- package/dist/components/ui/table-dnd/table-dnd-utils.js +77 -0
- package/dist/components/ui/table-dnd/table-dnd.css +12 -0
- package/dist/components/ui/table-dnd/table-drag-grip.svelte +63 -0
- package/dist/components/ui/table-dnd/table-drag-grip.svelte.d.ts +17 -0
- package/dist/fuzzy-search.d.ts +12 -0
- package/dist/fuzzy-search.js +22 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/is-mobile.svelte.d.ts +4 -0
- package/dist/hooks/is-mobile.svelte.js +7 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/dist/styles.css +11 -0
- package/dist/theme.css +89 -0
- package/dist/utils.d.ts +12 -0
- package/dist/utils.js +5 -0
- package/package.json +109 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Input } from "@lapismd/design-core/shadcn/input";
|
|
3
|
+
import type { ComponentProps } from "svelte";
|
|
4
|
+
import { cn } from "../../../utils.js";
|
|
5
|
+
import SearchIcon from "@lucide/svelte/icons/search";
|
|
6
|
+
import X from "@lucide/svelte/icons/x";
|
|
7
|
+
import { Button } from "@lapismd/design-core/shadcn/button";
|
|
8
|
+
import "./search.css";
|
|
9
|
+
|
|
10
|
+
let {
|
|
11
|
+
ref = $bindable(null),
|
|
12
|
+
value = $bindable(""),
|
|
13
|
+
class: inputClass,
|
|
14
|
+
className,
|
|
15
|
+
containerStyle,
|
|
16
|
+
...restProps
|
|
17
|
+
}: ComponentProps<typeof Input> & {
|
|
18
|
+
className?: string;
|
|
19
|
+
containerStyle?: string;
|
|
20
|
+
} = $props();
|
|
21
|
+
|
|
22
|
+
let isClearable = $derived((value ?? "").length > 0);
|
|
23
|
+
|
|
24
|
+
function clear() {
|
|
25
|
+
value = "";
|
|
26
|
+
}
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<div
|
|
30
|
+
data-ui-component="search"
|
|
31
|
+
data-ui-part="root"
|
|
32
|
+
class={cn(className)}
|
|
33
|
+
style={containerStyle}
|
|
34
|
+
>
|
|
35
|
+
<SearchIcon data-ui-component="search" data-ui-part="icon" />
|
|
36
|
+
<div data-ui-component="search" data-ui-part="field">
|
|
37
|
+
<Input
|
|
38
|
+
class={cn(inputClass)}
|
|
39
|
+
bind:ref
|
|
40
|
+
bind:value
|
|
41
|
+
{...restProps}
|
|
42
|
+
/>
|
|
43
|
+
</div>
|
|
44
|
+
{#if isClearable}
|
|
45
|
+
<Button
|
|
46
|
+
size="icon-xs"
|
|
47
|
+
onclick={() => clear()}
|
|
48
|
+
variant="ghost"
|
|
49
|
+
aria-label="Clear search"
|
|
50
|
+
>
|
|
51
|
+
<X />
|
|
52
|
+
</Button>
|
|
53
|
+
{/if}
|
|
54
|
+
</div>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Input } from "@lapismd/design-core/shadcn/input";
|
|
2
|
+
import type { ComponentProps } from "svelte";
|
|
3
|
+
import "./search.css";
|
|
4
|
+
type $$ComponentProps = ComponentProps<typeof Input> & {
|
|
5
|
+
className?: string;
|
|
6
|
+
containerStyle?: string;
|
|
7
|
+
};
|
|
8
|
+
declare const Search: import("svelte").Component<$$ComponentProps, {}, "ref" | "value">;
|
|
9
|
+
type Search = ReturnType<typeof Search>;
|
|
10
|
+
export default Search;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const SIDEBAR_COOKIE_NAME = "sidebar:state";
|
|
2
|
+
export declare const SIDEBAR_COOKIE_MAX_AGE: number;
|
|
3
|
+
export declare const SIDEBAR_WIDTH = "16rem";
|
|
4
|
+
export declare const SIDEBAR_WIDTH_MOBILE = "18rem";
|
|
5
|
+
export declare const SIDEBAR_WIDTH_ICON = "3rem";
|
|
6
|
+
export declare const SIDEBAR_KEYBOARD_SHORTCUT = "b";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export const SIDEBAR_COOKIE_NAME = "sidebar:state";
|
|
2
|
+
export const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
|
|
3
|
+
export const SIDEBAR_WIDTH = "16rem";
|
|
4
|
+
export const SIDEBAR_WIDTH_MOBILE = "18rem";
|
|
5
|
+
export const SIDEBAR_WIDTH_ICON = "3rem";
|
|
6
|
+
export const SIDEBAR_KEYBOARD_SHORTCUT = "b";
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
type Getter<T> = () => T;
|
|
2
|
+
export type SidebarStateProps = {
|
|
3
|
+
/**
|
|
4
|
+
* A getter function that returns the current open state of the sidebar. We
|
|
5
|
+
* use a getter function here to support `bind:open` on the `Sidebar.Provider`
|
|
6
|
+
* component.
|
|
7
|
+
*/
|
|
8
|
+
open: Getter<boolean>;
|
|
9
|
+
/**
|
|
10
|
+
* A function that sets the open state of the sidebar. To support `bind:open`,
|
|
11
|
+
* we need a source of truth for changing the open state to ensure it will be
|
|
12
|
+
* synced throughout the sub-components and any `bind:` references.
|
|
13
|
+
*/
|
|
14
|
+
setOpen: (open: boolean) => void;
|
|
15
|
+
id: string;
|
|
16
|
+
collapsedSize?: string;
|
|
17
|
+
initialWidth?: string;
|
|
18
|
+
};
|
|
19
|
+
export declare class SidebarState {
|
|
20
|
+
#private;
|
|
21
|
+
readonly props: SidebarStateProps;
|
|
22
|
+
open: boolean;
|
|
23
|
+
openMobile: boolean;
|
|
24
|
+
isDraggingRail: boolean;
|
|
25
|
+
width: string;
|
|
26
|
+
setOpen: SidebarStateProps["setOpen"];
|
|
27
|
+
state: string;
|
|
28
|
+
size: string;
|
|
29
|
+
constructor(props: SidebarStateProps);
|
|
30
|
+
get isMobile(): boolean;
|
|
31
|
+
handleShortcutKeydown: (e: KeyboardEvent) => void;
|
|
32
|
+
setOpenMobile: (value: boolean) => void;
|
|
33
|
+
toggle: () => boolean | void;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Instantiates a new `SidebarState` instance and sets it in the context.
|
|
37
|
+
*
|
|
38
|
+
* @param props The constructor props for the `SidebarState` class.
|
|
39
|
+
* @returns The `SidebarState` instance.
|
|
40
|
+
*/
|
|
41
|
+
export declare function setSidebar(props: SidebarStateProps | SidebarState): SidebarState;
|
|
42
|
+
/**
|
|
43
|
+
* Retrieves the `SidebarState` instance from the context. This is a class
|
|
44
|
+
* instance, so you cannot destructure it.
|
|
45
|
+
*
|
|
46
|
+
* @returns The `SidebarState` instance.
|
|
47
|
+
*/
|
|
48
|
+
export declare function useSidebar(): SidebarState;
|
|
49
|
+
export {};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { IsMobile } from "../../../hooks/is-mobile.svelte.js";
|
|
2
|
+
import { getContext, setContext } from "svelte";
|
|
3
|
+
import { SIDEBAR_KEYBOARD_SHORTCUT, SIDEBAR_WIDTH, SIDEBAR_WIDTH_ICON, } from "./constants.js";
|
|
4
|
+
export class SidebarState {
|
|
5
|
+
props;
|
|
6
|
+
open = $derived.by(() => this.props.open());
|
|
7
|
+
openMobile = $state(false);
|
|
8
|
+
isDraggingRail = $state(false);
|
|
9
|
+
width = $state(SIDEBAR_WIDTH);
|
|
10
|
+
setOpen;
|
|
11
|
+
#isMobile;
|
|
12
|
+
state = $derived.by(() => (this.open ? "expanded" : "collapsed"));
|
|
13
|
+
size = $derived.by(() => {
|
|
14
|
+
if (this.isMobile) {
|
|
15
|
+
return "0 px";
|
|
16
|
+
}
|
|
17
|
+
else if (!this.open) {
|
|
18
|
+
return this.props.collapsedSize ?? SIDEBAR_WIDTH_ICON;
|
|
19
|
+
}
|
|
20
|
+
return this.width;
|
|
21
|
+
});
|
|
22
|
+
constructor(props) {
|
|
23
|
+
this.setOpen = props.setOpen;
|
|
24
|
+
this.#isMobile = new IsMobile();
|
|
25
|
+
this.props = props;
|
|
26
|
+
this.width = this.props.initialWidth ?? SIDEBAR_WIDTH;
|
|
27
|
+
}
|
|
28
|
+
// Convenience getter for checking if the sidebar is mobile
|
|
29
|
+
// without this, we would need to use `sidebar.isMobile.current` everywhere
|
|
30
|
+
get isMobile() {
|
|
31
|
+
return this.#isMobile.current;
|
|
32
|
+
}
|
|
33
|
+
// Event handler to apply to the `<svelte:window>`
|
|
34
|
+
handleShortcutKeydown = (e) => {
|
|
35
|
+
if (e.key === SIDEBAR_KEYBOARD_SHORTCUT && (e.metaKey || e.ctrlKey)) {
|
|
36
|
+
e.preventDefault();
|
|
37
|
+
this.toggle();
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
setOpenMobile = (value) => {
|
|
41
|
+
this.openMobile = value;
|
|
42
|
+
};
|
|
43
|
+
toggle = () => {
|
|
44
|
+
return this.#isMobile.current
|
|
45
|
+
? (this.openMobile = !this.openMobile)
|
|
46
|
+
: this.setOpen(!this.open);
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
const SYMBOL_KEY = "scn-sidebar";
|
|
50
|
+
/**
|
|
51
|
+
* Instantiates a new `SidebarState` instance and sets it in the context.
|
|
52
|
+
*
|
|
53
|
+
* @param props The constructor props for the `SidebarState` class.
|
|
54
|
+
* @returns The `SidebarState` instance.
|
|
55
|
+
*/
|
|
56
|
+
export function setSidebar(props) {
|
|
57
|
+
const sidebar = props instanceof SidebarState ? props : new SidebarState(props);
|
|
58
|
+
return setContext(Symbol.for(SYMBOL_KEY), sidebar);
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Retrieves the `SidebarState` instance from the context. This is a class
|
|
62
|
+
* instance, so you cannot destructure it.
|
|
63
|
+
*
|
|
64
|
+
* @returns The `SidebarState` instance.
|
|
65
|
+
*/
|
|
66
|
+
export function useSidebar() {
|
|
67
|
+
return getContext(Symbol.for(SYMBOL_KEY));
|
|
68
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { SidebarState, useSidebar, type SidebarStateProps } 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
|
+
import NestedProvider from "./sidebar-nested-provider.svelte";
|
|
26
|
+
export { Content, Footer, Group, GroupAction, GroupContent, GroupLabel, Header, Input, Inset, Menu, MenuAction, MenuBadge, MenuButton, MenuItem, MenuSkeleton, MenuSub, MenuSubButton, MenuSubItem, Provider, NestedProvider, Rail, Root, Separator, 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, Trigger, useSidebar, SidebarState, type SidebarStateProps, };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { SidebarState, 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
|
+
import NestedProvider from "./sidebar-nested-provider.svelte";
|
|
26
|
+
export { Content, Footer, Group, GroupAction, GroupContent, GroupLabel, Header, Input, Inset, Menu, MenuAction, MenuBadge, MenuButton, MenuItem, MenuSkeleton, MenuSub, MenuSubButton, MenuSubItem, Provider, NestedProvider, Rail, Root, Separator,
|
|
27
|
+
//
|
|
28
|
+
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, Trigger, useSidebar, SidebarState, };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
3
|
+
import { 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
|
+
{...restProps}
|
|
16
|
+
data-ui-component="sidebar-custom"
|
|
17
|
+
data-ui-part="sidebar-content"
|
|
18
|
+
data-slot="sidebar-content"
|
|
19
|
+
data-sidebar="content"
|
|
20
|
+
class={className}
|
|
21
|
+
>
|
|
22
|
+
{@render children?.()}
|
|
23
|
+
</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;
|