@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.
Files changed (100) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/LICENSE.md +4 -0
  3. package/README.md +46 -0
  4. package/dist/codemirror-autocomplete.css +223 -0
  5. package/dist/command-fuzzy-filter.d.ts +15 -0
  6. package/dist/command-fuzzy-filter.js +27 -0
  7. package/dist/components/ui/confirm-dialog/confirm-dialog.css +11 -0
  8. package/dist/components/ui/confirm-dialog/confirm-dialog.svelte +94 -0
  9. package/dist/components/ui/confirm-dialog/confirm-dialog.svelte.d.ts +18 -0
  10. package/dist/components/ui/confirm-dialog/index.d.ts +3 -0
  11. package/dist/components/ui/confirm-dialog/index.js +3 -0
  12. package/dist/components/ui/modal/index.d.ts +3 -0
  13. package/dist/components/ui/modal/index.js +3 -0
  14. package/dist/components/ui/modal/modal.css +16 -0
  15. package/dist/components/ui/modal/modal.svelte +74 -0
  16. package/dist/components/ui/modal/modal.svelte.d.ts +16 -0
  17. package/dist/components/ui/search/index.d.ts +3 -0
  18. package/dist/components/ui/search/index.js +3 -0
  19. package/dist/components/ui/search/search.css +55 -0
  20. package/dist/components/ui/search/search.svelte +54 -0
  21. package/dist/components/ui/search/search.svelte.d.ts +10 -0
  22. package/dist/components/ui/sidebar-custom/constants.d.ts +6 -0
  23. package/dist/components/ui/sidebar-custom/constants.js +6 -0
  24. package/dist/components/ui/sidebar-custom/context.svelte.d.ts +49 -0
  25. package/dist/components/ui/sidebar-custom/context.svelte.js +68 -0
  26. package/dist/components/ui/sidebar-custom/index.d.ts +26 -0
  27. package/dist/components/ui/sidebar-custom/index.js +28 -0
  28. package/dist/components/ui/sidebar-custom/sidebar-content.svelte +23 -0
  29. package/dist/components/ui/sidebar-custom/sidebar-content.svelte.d.ts +5 -0
  30. package/dist/components/ui/sidebar-custom/sidebar-custom.css +1357 -0
  31. package/dist/components/ui/sidebar-custom/sidebar-footer.svelte +23 -0
  32. package/dist/components/ui/sidebar-custom/sidebar-footer.svelte.d.ts +5 -0
  33. package/dist/components/ui/sidebar-custom/sidebar-group-action.svelte +37 -0
  34. package/dist/components/ui/sidebar-custom/sidebar-group-action.svelte.d.ts +11 -0
  35. package/dist/components/ui/sidebar-custom/sidebar-group-content.svelte +23 -0
  36. package/dist/components/ui/sidebar-custom/sidebar-group-content.svelte.d.ts +5 -0
  37. package/dist/components/ui/sidebar-custom/sidebar-group-label.svelte +37 -0
  38. package/dist/components/ui/sidebar-custom/sidebar-group-label.svelte.d.ts +11 -0
  39. package/dist/components/ui/sidebar-custom/sidebar-group.svelte +23 -0
  40. package/dist/components/ui/sidebar-custom/sidebar-group.svelte.d.ts +5 -0
  41. package/dist/components/ui/sidebar-custom/sidebar-header.svelte +23 -0
  42. package/dist/components/ui/sidebar-custom/sidebar-header.svelte.d.ts +5 -0
  43. package/dist/components/ui/sidebar-custom/sidebar-input.svelte +24 -0
  44. package/dist/components/ui/sidebar-custom/sidebar-input.svelte.d.ts +4 -0
  45. package/dist/components/ui/sidebar-custom/sidebar-inset.svelte +22 -0
  46. package/dist/components/ui/sidebar-custom/sidebar-inset.svelte.d.ts +5 -0
  47. package/dist/components/ui/sidebar-custom/sidebar-menu-action.svelte +40 -0
  48. package/dist/components/ui/sidebar-custom/sidebar-menu-action.svelte.d.ts +12 -0
  49. package/dist/components/ui/sidebar-custom/sidebar-menu-badge.svelte +23 -0
  50. package/dist/components/ui/sidebar-custom/sidebar-menu-badge.svelte.d.ts +5 -0
  51. package/dist/components/ui/sidebar-custom/sidebar-menu-button.svelte +106 -0
  52. package/dist/components/ui/sidebar-custom/sidebar-menu-button.svelte.d.ts +27 -0
  53. package/dist/components/ui/sidebar-custom/sidebar-menu-item.svelte +23 -0
  54. package/dist/components/ui/sidebar-custom/sidebar-menu-item.svelte.d.ts +5 -0
  55. package/dist/components/ui/sidebar-custom/sidebar-menu-skeleton.svelte +43 -0
  56. package/dist/components/ui/sidebar-custom/sidebar-menu-skeleton.svelte.d.ts +8 -0
  57. package/dist/components/ui/sidebar-custom/sidebar-menu-sub-button.svelte +43 -0
  58. package/dist/components/ui/sidebar-custom/sidebar-menu-sub-button.svelte.d.ts +13 -0
  59. package/dist/components/ui/sidebar-custom/sidebar-menu-sub-item.svelte +23 -0
  60. package/dist/components/ui/sidebar-custom/sidebar-menu-sub-item.svelte.d.ts +5 -0
  61. package/dist/components/ui/sidebar-custom/sidebar-menu-sub.svelte +23 -0
  62. package/dist/components/ui/sidebar-custom/sidebar-menu-sub.svelte.d.ts +5 -0
  63. package/dist/components/ui/sidebar-custom/sidebar-menu.svelte +26 -0
  64. package/dist/components/ui/sidebar-custom/sidebar-menu.svelte.d.ts +5 -0
  65. package/dist/components/ui/sidebar-custom/sidebar-nested-provider.svelte +69 -0
  66. package/dist/components/ui/sidebar-custom/sidebar-nested-provider.svelte.d.ts +16 -0
  67. package/dist/components/ui/sidebar-custom/sidebar-provider.svelte +72 -0
  68. package/dist/components/ui/sidebar-custom/sidebar-provider.svelte.d.ts +15 -0
  69. package/dist/components/ui/sidebar-custom/sidebar-rail.svelte +44 -0
  70. package/dist/components/ui/sidebar-custom/sidebar-rail.svelte.d.ts +9 -0
  71. package/dist/components/ui/sidebar-custom/sidebar-resize.svelte.d.ts +15 -0
  72. package/dist/components/ui/sidebar-custom/sidebar-resize.svelte.js +131 -0
  73. package/dist/components/ui/sidebar-custom/sidebar-separator.svelte +22 -0
  74. package/dist/components/ui/sidebar-custom/sidebar-separator.svelte.d.ts +4 -0
  75. package/dist/components/ui/sidebar-custom/sidebar-trigger.svelte +86 -0
  76. package/dist/components/ui/sidebar-custom/sidebar-trigger.svelte.d.ts +10 -0
  77. package/dist/components/ui/sidebar-custom/sidebar.svelte +102 -0
  78. package/dist/components/ui/sidebar-custom/sidebar.svelte.d.ts +11 -0
  79. package/dist/components/ui/table-dnd/index.d.ts +3 -0
  80. package/dist/components/ui/table-dnd/index.js +3 -0
  81. package/dist/components/ui/table-dnd/table-dnd-sensors.d.ts +2 -0
  82. package/dist/components/ui/table-dnd/table-dnd-sensors.js +11 -0
  83. package/dist/components/ui/table-dnd/table-dnd-utils.d.ts +29 -0
  84. package/dist/components/ui/table-dnd/table-dnd-utils.js +77 -0
  85. package/dist/components/ui/table-dnd/table-dnd.css +12 -0
  86. package/dist/components/ui/table-dnd/table-drag-grip.svelte +63 -0
  87. package/dist/components/ui/table-dnd/table-drag-grip.svelte.d.ts +17 -0
  88. package/dist/fuzzy-search.d.ts +12 -0
  89. package/dist/fuzzy-search.js +22 -0
  90. package/dist/hooks/index.d.ts +1 -0
  91. package/dist/hooks/index.js +1 -0
  92. package/dist/hooks/is-mobile.svelte.d.ts +4 -0
  93. package/dist/hooks/is-mobile.svelte.js +7 -0
  94. package/dist/index.d.ts +4 -0
  95. package/dist/index.js +4 -0
  96. package/dist/styles.css +11 -0
  97. package/dist/theme.css +89 -0
  98. package/dist/utils.d.ts +12 -0
  99. package/dist/utils.js +5 -0
  100. package/package.json +109 -0
@@ -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-footer"
18
+ data-slot="sidebar-footer"
19
+ data-sidebar="footer"
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 SidebarFooter: import("svelte").Component<WithElementRef<HTMLAttributes<HTMLElement>>, {}, "ref">;
4
+ type SidebarFooter = ReturnType<typeof SidebarFooter>;
5
+ export default SidebarFooter;
@@ -0,0 +1,37 @@
1
+ <script lang="ts">
2
+ import { type WithElementRef } from "../../../utils.js";
3
+ import type { Snippet } from "svelte";
4
+ import type { HTMLButtonAttributes } from "svelte/elements";
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
+ ...restProps,
18
+ class: className,
19
+ "data-ui-component": "sidebar-custom",
20
+ "data-ui-part": "sidebar-group-action",
21
+ "data-slot": "sidebar-group-action",
22
+ "data-sidebar": "group-action",
23
+ });
24
+ </script>
25
+
26
+ {#if child}
27
+ {@render child({ props: mergedProps })}
28
+ {:else}
29
+ <button
30
+ bind:this={ref}
31
+ {...mergedProps}
32
+ data-ui-component="sidebar-custom"
33
+ data-ui-part="sidebar-group-action"
34
+ >
35
+ {@render children?.()}
36
+ </button>
37
+ {/if}
@@ -0,0 +1,11 @@
1
+ import { type WithElementRef } from "../../../utils.js";
2
+ import type { Snippet } from "svelte";
3
+ import type { HTMLButtonAttributes } from "svelte/elements";
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,23 @@
1
+ <script lang="ts">
2
+ import { type WithElementRef } from "../../../utils.js";
3
+ import type { HTMLAttributes } from "svelte/elements";
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
+ {...restProps}
16
+ data-ui-component="sidebar-custom"
17
+ data-ui-part="sidebar-group-content"
18
+ data-slot="sidebar-group-content"
19
+ data-sidebar="group-content"
20
+ class={className}
21
+ >
22
+ {@render children?.()}
23
+ </div>
@@ -0,0 +1,5 @@
1
+ import { type WithElementRef } from "../../../utils.js";
2
+ import type { HTMLAttributes } from "svelte/elements";
3
+ declare const SidebarGroupContent: import("svelte").Component<WithElementRef<HTMLAttributes<HTMLDivElement>>, {}, "ref">;
4
+ type SidebarGroupContent = ReturnType<typeof SidebarGroupContent>;
5
+ export default SidebarGroupContent;
@@ -0,0 +1,37 @@
1
+ <script lang="ts">
2
+ import { type WithElementRef } from "../../../utils.js";
3
+ import type { Snippet } from "svelte";
4
+ import type { HTMLAttributes } from "svelte/elements";
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
+ ...restProps,
18
+ class: className,
19
+ "data-ui-component": "sidebar-custom",
20
+ "data-ui-part": "sidebar-group-label",
21
+ "data-slot": "sidebar-group-label",
22
+ "data-sidebar": "group-label",
23
+ });
24
+ </script>
25
+
26
+ {#if child}
27
+ {@render child({ props: mergedProps })}
28
+ {:else}
29
+ <div
30
+ bind:this={ref}
31
+ {...mergedProps}
32
+ data-ui-component="sidebar-custom"
33
+ data-ui-part="sidebar-group-label"
34
+ >
35
+ {@render children?.()}
36
+ </div>
37
+ {/if}
@@ -0,0 +1,11 @@
1
+ import { type WithElementRef } from "../../../utils.js";
2
+ import type { Snippet } from "svelte";
3
+ import type { HTMLAttributes } from "svelte/elements";
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,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-group"
18
+ data-slot="sidebar-group"
19
+ data-sidebar="group"
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 SidebarGroup: import("svelte").Component<WithElementRef<HTMLAttributes<HTMLElement>>, {}, "ref">;
4
+ type SidebarGroup = ReturnType<typeof SidebarGroup>;
5
+ export default SidebarGroup;
@@ -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-header"
18
+ data-slot="sidebar-header"
19
+ data-sidebar="header"
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 SidebarHeader: import("svelte").Component<WithElementRef<HTMLAttributes<HTMLElement>>, {}, "ref">;
4
+ type SidebarHeader = ReturnType<typeof SidebarHeader>;
5
+ export default SidebarHeader;
@@ -0,0 +1,24 @@
1
+ <script lang="ts">
2
+ import {
3
+ Input,
4
+ type InputProps,
5
+ } from "@lapismd/design-core/shadcn/input";
6
+
7
+ let {
8
+ ref = $bindable(null),
9
+ value = $bindable(""),
10
+ class: className,
11
+ ...restProps
12
+ }: InputProps = $props();
13
+ </script>
14
+
15
+ <Input
16
+ bind:ref
17
+ bind:value
18
+ data-ui-component="sidebar-custom"
19
+ data-ui-part="sidebar-input"
20
+ data-slot="sidebar-input"
21
+ data-sidebar="input"
22
+ class={className}
23
+ {...restProps}
24
+ />
@@ -0,0 +1,4 @@
1
+ import { type InputProps } from "@lapismd/design-core/shadcn/input";
2
+ declare const SidebarInput: import("svelte").Component<InputProps, {}, "ref" | "value">;
3
+ type SidebarInput = ReturnType<typeof SidebarInput>;
4
+ export default SidebarInput;
@@ -0,0 +1,22 @@
1
+ <script lang="ts">
2
+ import { type WithElementRef } from "../../../utils.js";
3
+ import type { HTMLAttributes } from "svelte/elements";
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
+ {...restProps}
16
+ data-ui-component="sidebar-custom"
17
+ data-ui-part="sidebar-inset"
18
+ data-slot="sidebar-inset"
19
+ class={className}
20
+ >
21
+ {@render children?.()}
22
+ </main>
@@ -0,0 +1,5 @@
1
+ import { type WithElementRef } from "../../../utils.js";
2
+ import type { HTMLAttributes } from "svelte/elements";
3
+ declare const SidebarInset: import("svelte").Component<WithElementRef<HTMLAttributes<HTMLElement>>, {}, "ref">;
4
+ type SidebarInset = ReturnType<typeof SidebarInset>;
5
+ export default SidebarInset;
@@ -0,0 +1,40 @@
1
+ <script lang="ts">
2
+ import { type WithElementRef } from "../../../utils.js";
3
+ import type { Snippet } from "svelte";
4
+ import type { HTMLButtonAttributes } from "svelte/elements";
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
+ ...restProps,
20
+ class: className,
21
+ "data-ui-component": "sidebar-custom",
22
+ "data-ui-part": "sidebar-menu-action",
23
+ "data-slot": "sidebar-menu-action",
24
+ "data-sidebar": "menu-action",
25
+ "data-show-on-hover": showOnHover ? "true" : undefined,
26
+ });
27
+ </script>
28
+
29
+ {#if child}
30
+ {@render child({ props: mergedProps })}
31
+ {:else}
32
+ <button
33
+ bind:this={ref}
34
+ {...mergedProps}
35
+ data-ui-component="sidebar-custom"
36
+ data-ui-part="sidebar-menu-action"
37
+ >
38
+ {@render children?.()}
39
+ </button>
40
+ {/if}
@@ -0,0 +1,12 @@
1
+ import { type WithElementRef } from "../../../utils.js";
2
+ import type { Snippet } from "svelte";
3
+ import type { HTMLButtonAttributes } from "svelte/elements";
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,23 @@
1
+ <script lang="ts">
2
+ import { type WithElementRef } from "../../../utils.js";
3
+ import type { HTMLAttributes } from "svelte/elements";
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-menu-badge"
18
+ data-slot="sidebar-menu-badge"
19
+ data-sidebar="menu-badge"
20
+ class={className}
21
+ >
22
+ {@render children?.()}
23
+ </div>
@@ -0,0 +1,5 @@
1
+ import { type WithElementRef } from "../../../utils.js";
2
+ import type { HTMLAttributes } from "svelte/elements";
3
+ declare const SidebarMenuBadge: import("svelte").Component<WithElementRef<HTMLAttributes<HTMLElement>>, {}, "ref">;
4
+ type SidebarMenuBadge = ReturnType<typeof SidebarMenuBadge>;
5
+ export default SidebarMenuBadge;
@@ -0,0 +1,106 @@
1
+ <script lang="ts" module>
2
+ export const SIDEBAR_MENU_BUTTON_VARIANTS = ["default", "outline"] as const;
3
+ export type SidebarMenuButtonVariant =
4
+ (typeof SIDEBAR_MENU_BUTTON_VARIANTS)[number];
5
+
6
+ export const SIDEBAR_MENU_BUTTON_SIZES = ["default", "sm", "lg"] as const;
7
+ export type SidebarMenuButtonSize =
8
+ (typeof SIDEBAR_MENU_BUTTON_SIZES)[number];
9
+
10
+ /** @deprecated Prefer typed props; retained for API compatibility. */
11
+ export function sidebarMenuButtonVariants(_opts?: {
12
+ variant?: SidebarMenuButtonVariant;
13
+ size?: SidebarMenuButtonSize;
14
+ class?: string;
15
+ }): string {
16
+ return "";
17
+ }
18
+ </script>
19
+
20
+ <script lang="ts">
21
+ import * as Tooltip from "@lapismd/design-core/shadcn/tooltip";
22
+ import {
23
+ type WithElementRef,
24
+ type WithoutChildrenOrChild,
25
+ } from "../../../utils.js";
26
+ import { mergeProps } from "bits-ui";
27
+ import type { ComponentProps, Snippet } from "svelte";
28
+ import type { HTMLAttributes } from "svelte/elements";
29
+ import { useSidebar } from "./context.svelte.js";
30
+
31
+ let {
32
+ ref = $bindable(null),
33
+ class: className,
34
+ children,
35
+ child,
36
+ variant = "default",
37
+ size = "default",
38
+ isActive = false,
39
+ tooltipContent,
40
+ tooltipContentProps,
41
+ ...restProps
42
+ }: WithElementRef<HTMLAttributes<HTMLButtonElement>, HTMLButtonElement> & {
43
+ isActive?: boolean;
44
+ variant?: SidebarMenuButtonVariant;
45
+ size?: SidebarMenuButtonSize;
46
+ tooltipContent?: Snippet | string;
47
+ tooltipContentProps?: WithoutChildrenOrChild<
48
+ ComponentProps<typeof Tooltip.Content>
49
+ >;
50
+ child?: Snippet<[{ props: Record<string, unknown> }]>;
51
+ } = $props();
52
+
53
+ const sidebar = useSidebar();
54
+
55
+ const buttonProps = $derived({
56
+ ...restProps,
57
+ class: className,
58
+ "data-ui-component": "sidebar-custom",
59
+ "data-ui-part": "sidebar-menu-button",
60
+ "data-slot": "sidebar-menu-button",
61
+ "data-sidebar": "menu-button",
62
+ "data-variant": variant,
63
+ "data-size": size,
64
+ "data-active": isActive,
65
+ });
66
+ </script>
67
+
68
+ {#snippet Button({ props }: { props?: Record<string, unknown> })}
69
+ {@const mergedProps = mergeProps(buttonProps, props ?? {})}
70
+ {#if child}
71
+ {@render child({ props: mergedProps })}
72
+ {:else}
73
+ <button
74
+ bind:this={ref}
75
+ {...mergedProps}
76
+ data-ui-component="sidebar-custom"
77
+ data-ui-part="sidebar-menu-button"
78
+ >
79
+ {@render children?.()}
80
+ </button>
81
+ {/if}
82
+ {/snippet}
83
+
84
+ {#if !tooltipContent}
85
+ {@render Button({})}
86
+ {:else}
87
+ <Tooltip.Root>
88
+ <Tooltip.Trigger>
89
+ {#snippet child({ props })}
90
+ {@render Button({ props })}
91
+ {/snippet}
92
+ </Tooltip.Trigger>
93
+ <Tooltip.Content
94
+ side="right"
95
+ align="center"
96
+ hidden={sidebar.state !== "collapsed" || sidebar.isMobile}
97
+ {...tooltipContentProps}
98
+ >
99
+ {#if typeof tooltipContent === "string"}
100
+ {tooltipContent}
101
+ {:else if tooltipContent}
102
+ {@render tooltipContent()}
103
+ {/if}
104
+ </Tooltip.Content>
105
+ </Tooltip.Root>
106
+ {/if}
@@ -0,0 +1,27 @@
1
+ export declare const SIDEBAR_MENU_BUTTON_VARIANTS: readonly ["default", "outline"];
2
+ export type SidebarMenuButtonVariant = (typeof SIDEBAR_MENU_BUTTON_VARIANTS)[number];
3
+ export declare const SIDEBAR_MENU_BUTTON_SIZES: readonly ["default", "sm", "lg"];
4
+ export type SidebarMenuButtonSize = (typeof SIDEBAR_MENU_BUTTON_SIZES)[number];
5
+ /** @deprecated Prefer typed props; retained for API compatibility. */
6
+ export declare function sidebarMenuButtonVariants(_opts?: {
7
+ variant?: SidebarMenuButtonVariant;
8
+ size?: SidebarMenuButtonSize;
9
+ class?: string;
10
+ }): string;
11
+ import * as Tooltip from "@lapismd/design-core/shadcn/tooltip";
12
+ import { type WithElementRef, type WithoutChildrenOrChild } from "../../../utils.js";
13
+ import type { ComponentProps, Snippet } from "svelte";
14
+ import type { HTMLAttributes } from "svelte/elements";
15
+ type $$ComponentProps = WithElementRef<HTMLAttributes<HTMLButtonElement>, HTMLButtonElement> & {
16
+ isActive?: boolean;
17
+ variant?: SidebarMenuButtonVariant;
18
+ size?: SidebarMenuButtonSize;
19
+ tooltipContent?: Snippet | string;
20
+ tooltipContentProps?: WithoutChildrenOrChild<ComponentProps<typeof Tooltip.Content>>;
21
+ child?: Snippet<[{
22
+ props: Record<string, unknown>;
23
+ }]>;
24
+ };
25
+ declare const SidebarMenuButton: import("svelte").Component<$$ComponentProps, {}, "ref">;
26
+ type SidebarMenuButton = ReturnType<typeof SidebarMenuButton>;
27
+ export default SidebarMenuButton;
@@ -0,0 +1,23 @@
1
+ <script lang="ts">
2
+ import { type WithElementRef } from "../../../utils.js";
3
+ import type { HTMLAttributes } from "svelte/elements";
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
+ {...restProps}
16
+ data-ui-component="sidebar-custom"
17
+ data-ui-part="sidebar-menu-item"
18
+ data-slot="sidebar-menu-item"
19
+ data-sidebar="menu-item"
20
+ class={className}
21
+ >
22
+ {@render children?.()}
23
+ </li>
@@ -0,0 +1,5 @@
1
+ import { type WithElementRef } from "../../../utils.js";
2
+ import type { HTMLAttributes } from "svelte/elements";
3
+ declare const SidebarMenuItem: import("svelte").Component<WithElementRef<HTMLAttributes<HTMLLIElement>, HTMLLIElement>, {}, "ref">;
4
+ type SidebarMenuItem = ReturnType<typeof SidebarMenuItem>;
5
+ export default SidebarMenuItem;
@@ -0,0 +1,43 @@
1
+ <script lang="ts">
2
+ import { type WithElementRef } from "../../../utils.js";
3
+ import { Skeleton } from "@lapismd/design-core/shadcn/skeleton";
4
+ import type { HTMLAttributes } from "svelte/elements";
5
+
6
+ let {
7
+ ref = $bindable(null),
8
+ class: className,
9
+ showIcon = false,
10
+ children,
11
+ ...restProps
12
+ }: WithElementRef<HTMLAttributes<HTMLElement>> & {
13
+ showIcon?: boolean;
14
+ } = $props();
15
+
16
+ // Random width between 50% and 90%
17
+ const width = `${Math.floor(Math.random() * 40) + 50}%`;
18
+ </script>
19
+
20
+ <div
21
+ bind:this={ref}
22
+ {...restProps}
23
+ data-ui-component="sidebar-custom"
24
+ data-ui-part="sidebar-menu-skeleton"
25
+ data-slot="sidebar-menu-skeleton"
26
+ data-sidebar="menu-skeleton"
27
+ class={className}
28
+ >
29
+ {#if showIcon}
30
+ <Skeleton
31
+ data-ui-part="sidebar-skeleton"
32
+ data-slot="sidebar-skeleton"
33
+ data-sidebar="menu-skeleton-icon"
34
+ />
35
+ {/if}
36
+ <Skeleton
37
+ data-ui-part="sidebar-menu-skeleton-anon-2"
38
+ data-slot="sidebar-menu-skeleton-anon-2"
39
+ data-sidebar="menu-skeleton-text"
40
+ style="--skeleton-width: {width};"
41
+ />
42
+ {@render children?.()}
43
+ </div>
@@ -0,0 +1,8 @@
1
+ import { type WithElementRef } from "../../../utils.js";
2
+ import type { HTMLAttributes } from "svelte/elements";
3
+ type $$ComponentProps = WithElementRef<HTMLAttributes<HTMLElement>> & {
4
+ showIcon?: boolean;
5
+ };
6
+ declare const SidebarMenuSkeleton: import("svelte").Component<$$ComponentProps, {}, "ref">;
7
+ type SidebarMenuSkeleton = ReturnType<typeof SidebarMenuSkeleton>;
8
+ export default SidebarMenuSkeleton;
@@ -0,0 +1,43 @@
1
+ <script lang="ts">
2
+ import { type WithElementRef } from "../../../utils.js";
3
+ import type { Snippet } from "svelte";
4
+ import type { HTMLAnchorAttributes } from "svelte/elements";
5
+
6
+ let {
7
+ ref = $bindable(null),
8
+ children,
9
+ child,
10
+ class: className,
11
+ size = "md",
12
+ isActive = false,
13
+ ...restProps
14
+ }: WithElementRef<HTMLAnchorAttributes> & {
15
+ child?: Snippet<[{ props: Record<string, unknown> }]>;
16
+ size?: "sm" | "md";
17
+ isActive?: boolean;
18
+ } = $props();
19
+
20
+ const mergedProps = $derived({
21
+ ...restProps,
22
+ class: className,
23
+ "data-ui-component": "sidebar-custom",
24
+ "data-ui-part": "sidebar-menu-sub-button",
25
+ "data-slot": "sidebar-menu-sub-button",
26
+ "data-sidebar": "menu-sub-button",
27
+ "data-size": size,
28
+ "data-active": isActive,
29
+ });
30
+ </script>
31
+
32
+ {#if child}
33
+ {@render child({ props: mergedProps })}
34
+ {:else}
35
+ <a
36
+ bind:this={ref}
37
+ {...mergedProps}
38
+ data-ui-component="sidebar-custom"
39
+ data-ui-part="sidebar-menu-sub-button"
40
+ >
41
+ {@render children?.()}
42
+ </a>
43
+ {/if}
@@ -0,0 +1,13 @@
1
+ import { type WithElementRef } from "../../../utils.js";
2
+ import type { Snippet } from "svelte";
3
+ import type { HTMLAnchorAttributes } from "svelte/elements";
4
+ type $$ComponentProps = WithElementRef<HTMLAnchorAttributes> & {
5
+ child?: Snippet<[{
6
+ props: Record<string, unknown>;
7
+ }]>;
8
+ size?: "sm" | "md";
9
+ isActive?: boolean;
10
+ };
11
+ declare const SidebarMenuSubButton: import("svelte").Component<$$ComponentProps, {}, "ref">;
12
+ type SidebarMenuSubButton = ReturnType<typeof SidebarMenuSubButton>;
13
+ export default SidebarMenuSubButton;